diff --git a/bios-maps/asrock/b650e-riptide-wifi.gv b/bios-maps/asrock/b650e-riptide-wifi.gv index c93c354..d01623c 100644 --- a/bios-maps/asrock/b650e-riptide-wifi.gv +++ b/bios-maps/asrock/b650e-riptide-wifi.gv @@ -4,74 +4,252 @@ digraph bios node [shape = "box"] style = dashed color = red - main [label = "Main"] + "Main" //rankdir = "LR" + + //VALUES ARE DEFAULT VALUES FROM A FRESHLY CLEARED CMOS + //THIS FILE IS NOT TO BE MODIFIED EXCEPT FOR BREAKING BIOS UPDATES - oc_tweaker [label = "OC Tweaker"] - gaming_mode [label = "Gaming Mode" value = "Disabled"] - tdp_to_105w [label = "TDP to 105W" value = "Disabled"] + subgraph cluster_oc_tweaker + { + "OC Tweaker" + "Gaming Mode" + "TDP to 105W" + "Performance Boost" + "Performance Preset" + "Platform Thermal throttle Limit(TjMax)" + "CPU Overclocking" + "DRAM Frequency" + "Memory Context Restore" + + subgraph cluster_dram_profile + { + "DRAM Profile Configuration" + "DRAM Profile Configuration (Enter subfolder)" + "DRAM Profile Setting" [option_type = "list" value = "Auto" options = "Auto,DDR5-4800,XMP1-6000" traversal_key = "ArrowDown"] + "DRAM Performance Mode" [option_type = "list" value = "AMD AGESA Default" options = "AMD AGESA Default,Competitive,Aggressive" traversal_key = "ArrowDown"] + } + + "DRAM Timing Configuration" + "VDDIO Voltage (VDDIO_MEM_S3)" + "DRAM VDD Voltage" + "DRAM VDDQ Voltage" + "DRAM VPP Voltage" + "Infinity Fabric Frequency" + "UCLK DIV1 MODE" + "SOC/Uncore OC Voltage (VDD_SOC)" [option_type = "field" value = "Auto"] + "VDD Misc Voltage" + "VDDG CCD Voltage" + "VDDG IOD Voltage" + "VDDP Voltage" + "Overclock Mode(Bus Speed)" + "BCLK 0 (MHz)" [option_type = "field" value = "Auto"] + "Spread Spectrum" [option_type = "list" value = "Auto" options = "Auto,Disabled,Enabled" traversal_key = "ArrowDown"] + "External Voltage Settings" + } subgraph cluster_advanced { - advanced [label = "Advanced"] - cpu_config [label = "CPU Configuration"] - pci_config [label = "PCI Configuration"] - onb_dev_config [label = "Onboard Devices Configuration"] - stor_config [label = "Storage Configuration"] - acpi_config [label = "ACPI Configuration"] - usb_config [label = "USB Configuration"] - trust_com [label = "Trusted Computing"] - amd_cbs [label = "AMD CBS"] - amd_pbs [label = "AMD PBS"] - amd_oc [label = "AMD Overclocking"] - oc_menu [label = "OC Menu"] + "Advanced" + "CPU Configuration" + "PCI Configuration" + "Onboard Devices Configuration" + "Storage Configuration" + "ACPI Configuration" + "USB Configuration" + "Trusted Computing" + "AMD PBS" + + subgraph cluster_amd_cbs + { + "AMD CBS" + "CPU Common Options" + + subgraph cluster_df_options + { + "DF Common Options" + "Memory Addressing" + "ACPI" + // why in the name of all that is unholy is this list in reverse?! + "ACPI SRAT L3 Cache As NUMA Domain" [option_type = "list" value = "Auto" options = "Auto,Enabled,Disabled" traversal_key = "ArrowUp"] + } + + "UMC Common Options" + subgraph cluster_nbio + { + "NBIO Common Options" + "IOMMU" + "PCIe ARI Support" + "PCIe All Port ECRC" + "Advanced Error Reporting (AER)" + "PCIe ARI Enumeration" + subgraph cluster_gfx_config + { + "GFX Configuration" + "dGPU Only Mode" [option_type = "list" value = "Auto" options = "Auto,Disabled,Enabled" traversal_key = "ArrowDown"] + } + "Audio Configuration" + "PCIe loopback Mode" + "Persistence mode for legacy endpoints" + "Retimer margining support" + } + } + + subgraph cluster_amd_overclocking + { + "AMD Overclocking" + "Manual CPU Overclocking" + "DDR and Infinity Fabric Frequency/Timings" + + subgraph cluster_pbo + { + "Precision Boost Overdrive (Enter subfolder)" + "Precision Boost Overdrive" + "PBO Limits" [option_type = "list" value = "Auto" options = "Auto,Disable,Motherboard,Manual" traversal_key = "ArrowDown"] + "Precision Boost Overdrive Scalar Ctrl" + "Precision Boost Overdrive Scalar" [option_type = "list" value = "1X" options = "1X,2X,3X,4X,5X,6X,7X,8X,9X,10X" traversal_key = "ArrowDown"] + "CPU Boost Clock Override" + "Max CPU Boost Clock Override(+)" [option_type = "field" value = "25"] + "Platform Thermal Throttle Ctrl" + "GFX Curve Optimizer" + "Curve Optimizer" + "Curve Shaper" + } + } } - tool [label = "Tool"] - hw_mon [label = "H/W Monitor"] - security [label = "Security"] - boot [label = "Boot"] - exit [label = "Exit"] - save_and_exit [label = "Save Changes and Exit"] + subgraph cluster_tool + { + "Tool" + "ASR USB LED test form" + "SSD Secure Erase Tool" + "Media Sanitization" + "Instant Flash" + "Auto Driver Installer" [option_type = "list" value = "Enabled" options = "Enabled,Disabled" traversal_key = "ArrowUp"] + } + "H/W Monitor" + "Security" + "Boot" + "Exit" + "Save Changes and Exit" - main -> oc_tweaker [keypath = "ArrowRight"] - oc_tweaker -> advanced [keypath = "ArrowRight"] - advanced -> tool [keypath = "ArrowRight"] - tool -> hw_mon [keypath = "ArrowRight"] - hw_mon -> security [keypath = "ArrowRight"] - security -> boot [keypath = "ArrowRight"] - boot -> exit [keypath = "ArrowRight"] + "Main" -> "OC Tweaker" [keypath = "ArrowRight"] + "OC Tweaker" -> "Advanced" [keypath = "ArrowRight"] + "Advanced" -> "Tool" [keypath = "ArrowRight"] + "Tool" -> "H/W Monitor" [keypath = "ArrowRight"] + "H/W Monitor" -> "Security" [keypath = "ArrowRight"] + "Security" -> "Boot" [keypath = "ArrowRight"] + "Boot" -> "Exit" [keypath = "ArrowRight"] - exit -> boot [keypath = "ArrowLeft"] - boot -> security [keypath = "ArrowLeft"] - security -> hw_mon [keypath = "ArrowLeft"] - hw_mon -> tool [keypath = "ArrowLeft"] - tool -> advanced [keypath = "ArrowLeft"] - advanced -> oc_tweaker [keypath = "ArrowLeft"] - oc_tweaker -> main [keypath = "ArrowLeft"] + "Exit" -> "Boot" [keypath = "ArrowLeft"] + "Boot" -> "Security" [keypath = "ArrowLeft"] + "Security" -> "H/W Monitor" [keypath = "ArrowLeft"] + "H/W Monitor" -> "Tool" [keypath = "ArrowLeft"] + "Tool" -> "Advanced" [keypath = "ArrowLeft"] + "Advanced" -> "OC Tweaker" [keypath = "ArrowLeft"] + "OC Tweaker" -> "Main" [keypath = "ArrowLeft"] - oc_tweaker -> gaming_mode [keypath = "Home"] - gaming_mode -> oc_tweaker [keypath = "Home"] - gaming_mode -> tdp_to_105w [keypath = "ArrowDown"] - tdp_to_105w -> gaming_mode [keypath = "ArrowUp"] + "OC Tweaker" -> "Gaming Mode" [keypath = "Home"] + "Gaming Mode" -> "TDP to 105W" [keypath = "ArrowDown"] + "TDP to 105W" -> "Performance Boost" [keypath = "ArrowDown"] + "Performance Boost" -> "Performance Preset" [keypath = "ArrowDown"] + "Performance Preset" -> "Platform Thermal throttle Limit(TjMax)" [keypath = "ArrowDown"] + "Platform Thermal throttle Limit(TjMax)" -> "CPU Overclocking" [keypath = "ArrowDown"] + "CPU Overclocking" -> "DRAM Frequency" [keypath = "ArrowDown"] + "DRAM Frequency" -> "Memory Context Restore" [keypath = "ArrowDown"] + "Memory Context Restore" -> "DRAM Profile Configuration" [keypath = "ArrowDown"] - advanced -> cpu_config [keypath = "Home"] - cpu_config -> pci_config [keypath = "ArrowDown"] - pci_config -> onb_dev_config [keypath = "ArrowDown"] - onb_dev_config -> stor_config [keypath = "ArrowDown"] - stor_config -> acpi_config [keypath = "ArrowDown"] - acpi_config -> usb_config [keypath = "ArrowDown"] - usb_config -> trust_com [keypath = "ArrowDown"] - trust_com -> amd_cbs [keypath = "ArrowDown"] - amd_cbs -> amd_pbs [keypath = "ArrowDown"] - amd_pbs -> amd_oc [keypath = "ArrowDown"] + "DRAM Profile Configuration" -> "DRAM Timing Configuration" [keypath = "ArrowDown"] + "DRAM Profile Configuration" -> "DRAM Profile Configuration (Enter subfolder)" [keypath = "Enter"] + "DRAM Profile Configuration (Enter subfolder)" -> "DRAM Profile Setting" [keypath = "Home"] + "DRAM Profile Setting" -> "DRAM Performance Mode" [keypath = "ArrowDown"] - cpu_config, pci_config, onb_dev_config, stor_config, acpi_config, usb_config, trust_com, amd_cbs, amd_pbs, amd_oc -> advanced [keypath = "Home"] + "DRAM Profile Setting", "DRAM Performance Mode" -> "DRAM Profile Configuration" [keypath = "Escape"] - amd_oc -> oc_menu [keypath = "Enter,Enter"] - oc_menu -> amd_oc [keypath = "Escape,Escape"] + "DRAM Timing Configuration" -> "VDDIO Voltage (VDDIO_MEM_S3)" [keypath = "ArrowDown"] + "VDDIO Voltage (VDDIO_MEM_S3)" -> "DRAM VDD Voltage" [keypath = "ArrowDown"] + "DRAM VDD Voltage" -> "DRAM VDDQ Voltage" [keypath = "ArrowDown"] + "DRAM VDDQ Voltage" -> "DRAM VPP Voltage" [keypath = "ArrowDown"] + "DRAM VPP Voltage" -> "Infinity Fabric Frequency" [keypath = "ArrowDown"] + "Infinity Fabric Frequency" -> "UCLK DIV1 MODE" [keypath = "ArrowDown"] + "UCLK DIV1 MODE" -> "SOC/Uncore OC Voltage (VDD_SOC)" [keypath = "ArrowDown"] + "SOC/Uncore OC Voltage (VDD_SOC)" -> "VDD Misc Voltage" [keypath = "ArrowDown"] + "VDD Misc Voltage" -> "VDDG CCD Voltage" [keypath = "ArrowDown"] + "VDDG CCD Voltage" -> "VDDG IOD Voltage" [keypath = "ArrowDown"] + "VDDG IOD Voltage" -> "VDDP Voltage" [keypath = "ArrowDown"] + "VDDP Voltage" -> "Overclock Mode(Bus Speed)" [keypath = "ArrowDown"] + "Overclock Mode(Bus Speed)" -> "BCLK 0 (MHz)" [keypath = "ArrowDown" initial_keypath = "Enter,ArrowDown,Enter,ArrowDown" visited = "false"] + "BCLK 0 (MHz)" -> "Spread Spectrum" [keypath = "ArrowDown"] + "Spread Spectrum" -> "External Voltage Settings" [keypath = "ArrowDown"] - exit -> save_and_exit [keypath = "Enter,Enter"] + "Gaming Mode", "TDP to 105W", "Performance Boost", "Performance Preset", "Platform Thermal throttle Limit(TjMax)", "CPU Overclocking", "DRAM Frequency", "Memory Context Restore", "DRAM Profile Configuration", "DRAM Timing Configuration", "VDDIO Voltage (VDDIO_MEM_S3)", "DRAM VDD Voltage", "DRAM VDDQ Voltage", "DRAM VPP Voltage", "Infinity Fabric Frequency", "UCLK DIV1 MODE", "SOC/Uncore OC Voltage (VDD_SOC)", "VDD Misc Voltage", "VDDG CCD Voltage", "VDDG IOD Voltage", "VDDP Voltage", "Overclock Mode(Bus Speed)", "BCLK 0 (MHz)", "Spread Spectrum", "External Voltage Settings" -> "OC Tweaker" [keypath = "Home"] + + "Advanced" -> "CPU Configuration" [keypath = "Home"] + "CPU Configuration" -> "PCI Configuration" [keypath = "ArrowDown"] + "PCI Configuration" -> "Onboard Devices Configuration" [keypath = "ArrowDown"] + "Onboard Devices Configuration" -> "Storage Configuration" [keypath = "ArrowDown"] + "Storage Configuration" -> "ACPI Configuration" [keypath = "ArrowDown"] + "ACPI Configuration" -> "USB Configuration" [keypath = "ArrowDown"] + "USB Configuration" -> "Trusted Computing" [keypath = "ArrowDown"] + "Trusted Computing" -> "AMD CBS" [keypath = "ArrowDown"] + "AMD CBS" -> "AMD PBS" [keypath = "ArrowDown"] + + "AMD CBS" -> "CPU Common Options" [keypath = "Enter"] + "CPU Common Options" -> "DF Common Options" [keypath = "ArrowDown"] + "DF Common Options" -> "Memory Addressing" [keypath = "Enter"] + "DF Common Options" -> "ACPI" [keypath = "Enter,ArrowDown"] + "ACPI" -> "ACPI SRAT L3 Cache As NUMA Domain" [keypath = "Enter"] + "ACPI SRAT L3 Cache As NUMA Domain" -> "ACPI" [keypath = "Escape"] + "ACPI" -> "DF Common Options" [keypath = "Escape"] + "DF Common Options" -> "UMC Common Options" [keypath = "ArrowDown"] + "UMC Common Options" -> "NBIO Common Options" [keypath = "ArrowDown"] + "NBIO Common Options" -> "IOMMU" [keypath = "Enter"] + "IOMMU" -> "PCIe ARI Support" [keypath = "ArrowDown"] + "PCIe ARI Support" -> "PCIe All Port ECRC" [keypath = "ArrowDown"] + "PCIe All Port ECRC" -> "Advanced Error Reporting (AER)" [keypath = "ArrowDown"] + "Advanced Error Reporting (AER)" -> "PCIe ARI Enumeration" [keypath = "ArrowDown"] + "PCIe ARI Enumeration" -> "GFX Configuration" [keypath = "ArrowDown"] + "GFX Configuration" -> "dGPU Only Mode" [keypath = "Enter"] + "dGPU Only Mode" -> "GFX Configuration" [keypath = "Escape"] + "GFX Configuration" -> "Audio Configuration" [keypath = "ArrowDown"] + "Audio Configuration" -> "PCIe loopback Mode" [keypath = "ArrowDown"] + "PCIe loopback Mode" -> "Persistence mode for legacy endpoints" [keypath = "ArrowDown"] + "Persistence mode for legacy endpoints" -> "Retimer margining support" [keypath = "ArrowDown"] + + "IOMMU", "PCIe ARI Support", "PCIe All Port ECRC", "Advanced Error Reporting (AER)", "PCIe ARI Enumeration", "GFX Configuration", "Audio Configuration", "PCIe loopback Mode", "Persistence mode for legacy endpoints", "Retimer margining support" -> "NBIO Common Options" [keypath = "Escape"] + + "CPU Common Options", "DF Common Options", "UMC Common Options", "NBIO Common Options" -> "AMD CBS" [keypath = "Escape"] + + "AMD PBS" -> "AMD Overclocking" [keypath = "ArrowDown"] + + "CPU Configuration", "PCI Configuration", "Onboard Devices Configuration", "Storage Configuration", "ACPI Configuration", "USB Configuration", "Trusted Computing", "AMD CBS", "AMD PBS", "AMD Overclocking" -> "Advanced" [keypath = "Home"] + + "AMD Overclocking" -> "Manual CPU Overclocking" [keypath = "Enter,Enter"] + "AMD Overclocking" -> "DDR and Infinity Fabric Frequency/Timings" [keypath = "Enter,Enter,ArrowDown"] + "DDR and Infinity Fabric Frequency/Timings" -> "Precision Boost Overdrive (Enter subfolder)" [keypath = "ArrowDown"] + "Precision Boost Overdrive (Enter subfolder)" -> "Precision Boost Overdrive" [keypath = "Enter" initial_keypath = "Enter,Enter,ArrowDown,ArrowDown,ArrowDown,Enter" visited = "false"] + "Precision Boost Overdrive" -> "PBO Limits" [keypath = "ArrowDown"] + "PBO Limits" -> "Precision Boost Overdrive Scalar Ctrl" [keypath = "ArrowDown" initial_keypath = "ArrowDown,Enter,ArrowDown,Enter" visited = "false"] + "Precision Boost Overdrive Scalar Ctrl" -> "Precision Boost Overdrive Scalar" [keypath = "ArrowDown"] + "Precision Boost Overdrive Scalar" -> "CPU Boost Clock Override" [keypath = "ArrowDown" initial_keypath = "ArrowDown,Enter,ArrowDown,Enter" visited = "false"] + "CPU Boost Clock Override" -> "Max CPU Boost Clock Override(+)" [keypath = "ArrowDown"] + "Max CPU Boost Clock Override(+)" -> "Platform Thermal Throttle Ctrl" [keypath = "ArrowDown"] + "Platform Thermal Throttle Ctrl" -> "GFX Curve Optimizer" [keypath = "ArrowDown"] + "GFX Curve Optimizer" -> "Curve Optimizer" [keypath = "ArrowDown"] + "Curve Optimizer" -> "Curve Shaper" [keypath = "ArrowDown"] + + "Precision Boost Overdrive", "PBO Limits", "Precision Boost Overdrive Scalar Ctrl", "CPU Boost Clock Override", "Platform Thermal Throttle Ctrl" -> "Precision Boost Overdrive (Enter subfolder)" [keypath = "Escape"] + "Precision Boost Overdrive (Enter subfolder)" -> "AMD Overclocking" [keypath = "Escape,Escape"] + + "Tool" -> "ASR USB LED test form" [keypath = "Home"] + "ASR USB LED test form" -> "SSD Secure Erase Tool" [keypath = "ArrowDown"] + "SSD Secure Erase Tool" -> "Media Sanitization" [keypath = "ArrowDown"] + "Media Sanitization" -> "Instant Flash" [keypath = "ArrowDown"] + "Instant Flash" -> "Auto Driver Installer" [keypath = "ArrowDown"] + + "ASR USB LED test form", "SSD Secure Erase Tool", "Media Sanitization", "Instant Flash", "Auto Driver Installer" -> "Tool" [keypath = "Home"] + + "Exit" -> "Save Changes and Exit" [keypath = "Enter,Enter"] } diff --git a/esp32/src/main.cpp b/esp32/src/main.cpp index bddf2e3..1953bf7 100644 --- a/esp32/src/main.cpp +++ b/esp32/src/main.cpp @@ -53,12 +53,12 @@ void loop() { if (analogRead(pwr_detect) > 1000) { - power_status["pwr"] = "on"; + power_status["pwr"] = true; } else { - power_status["pwr"] = "off"; + power_status["pwr"] = false; } serializeJson(power_status, host_serial); diff --git a/my_state_diagram.svg b/my_state_diagram.svg new file mode 100644 index 0000000..d4a4808 --- /dev/null +++ b/my_state_diagram.svg @@ -0,0 +1,254 @@ + + + + + + + +State Machine + + +PoweredOff + +PoweredOff + + + +POST + +POST + + + +PoweredOff->POST + + +power_on + + + +POST->PoweredOff + + +hard_shutdown + + + +EnterBIOS + +EnterBIOS + + + +POST->EnterBIOS + + +enter_bios + + + +WaitingForOS + +WaitingForOS + + + +POST->WaitingForOS + + +enter_os + + + +BootLoop + +BootLoop + + + +POST->BootLoop + + +unsuccessful_post + + + +BIOSSetup + +BIOSSetup + + + +EnterBIOS->BIOSSetup + + +start_bios_setup + + + +BIOSSetup->PoweredOff + + +hard_shutdown + + + +BIOSSetup->POST + + +finished_bios_setup + + + +WaitingForOS->PoweredOff + + +hard_shutdown + + + +WaitingForHWInfo + +WaitingForHWInfo + + + +WaitingForOS->WaitingForHWInfo + + +os_booted + + + +OCTypeDecision + +OCTypeDecision + + + +WaitingForHWInfo->OCTypeDecision + + +hwinfo_available + + + +RoughMulticoreUndervolt + +RoughMulticoreUndervolt + + + +OCTypeDecision->RoughMulticoreUndervolt + + +rough_multicore_undervolt + + + +PreciseMulticoreUndervolt + +PreciseMulticoreUndervolt + + + +OCTypeDecision->PreciseMulticoreUndervolt + + +precise_multicore_undervolt + + + +SingleCoreTuning + +SingleCoreTuning + + + +OCTypeDecision->SingleCoreTuning + + +single_core_tuning + + + +RoughMulticoreUndervolt->PoweredOff + + +hard_shutdown + + + +RoughMulticoreUndervolt->POST + + +reboot + + + +PreciseMulticoreUndervolt->PoweredOff + + +hard_shutdown + + + +PreciseMulticoreUndervolt->POST + + +reboot + + + +SingleCoreTuning->PoweredOff + + +hard_shutdown + + + +SingleCoreTuning->POST + + +reboot + + + +BootLoop->PoweredOff + + +trigger_cmos_reset | hard_shutdown + + + +IdleWaitingForInput + + +IdleWaitingForInput + + + +IdleWaitingForInput->PoweredOff + + +hard_shutdown | soft_shutdown + + + +IdleWaitingForInput->POST + + +power_on | reboot + + + +IdleWaitingForInput->WaitingForHWInfo + + +begin_automation + + + diff --git a/profiles/hong.json b/profiles/hong.json deleted file mode 100644 index 38c8b75..0000000 --- a/profiles/hong.json +++ /dev/null @@ -1 +0,0 @@ -{"video_device": {"friendly_name": "WARRKY USB 3.0", "format": "mjpeg", "resolution": "1920x1080", "fps": "60.000"}, "esp32_serial": "usb-1a86_USB_Single_Serial_585D015807-if00"} \ No newline at end of file diff --git a/profiles/hong.toml b/profiles/hong.toml new file mode 100644 index 0000000..68a8af3 --- /dev/null +++ b/profiles/hong.toml @@ -0,0 +1,28 @@ +[server] +esp32_serial = "usb-1a86_USB_Single_Serial_585D015807-if00" + +[server.video_device] +friendly_name = "WARRKY USB 3.0" +format = "mjpeg" +resolution = "1920x1080" +fps = "60.000" + +[client] +hostname = "10.20.30.48" +hwinfo_port = "60000" + +[client.overclocking.common] +"ACPI SRAT L3 Cache As NUMA Domain" = "Enabled" +"Spread Spectrum" = "Disabled" +"PBO Limits" = "Motherboard" +"Precision Boost Overdrive Scalar" = "10X" +"Max CPU Boost Clock Override(+)" = "200" +"Auto Driver Installer" = "Disabled" +# "dGPU Only Mode" = "Enabled" + +[client.overclocking.cpu] + +[client.overclocking.memory] +"DRAM Profile Setting" = "XMP1-6000" +"DRAM Performance Mode" = "Aggressive" +"SOC/Uncore OC Voltage (VDD_SOC)" = "1.1" \ No newline at end of file diff --git a/webui/graphtest.py b/webui/graphtest.py index bf4adee..f7fd086 100644 --- a/webui/graphtest.py +++ b/webui/graphtest.py @@ -1,12 +1,14 @@ import networkx as nx import serial -from ipkvm.util.mkb import HIDKeyCode +#from ipkvm.util.mkb import HIDKeyCode import json import time # Load the Graphviz file graph = nx.nx_agraph.read_dot("bios-maps/asrock/b650e-riptide-wifi.gv") +print(type(graph)) + print(graph) print(graph.edges()) @@ -21,7 +23,7 @@ print(graph.edges(data=True)) for edge_a, edge_b, data in graph.edges(data=True): print(f"Edge: {edge_a} to {edge_b}, Attributes: {data}") -path = nx.shortest_path(graph, "exit", "oc_menu") +path = nx.shortest_path(graph, "Exit", "TDP to 105W") for pair in nx.utils.pairwise(path): print(pair) @@ -37,35 +39,36 @@ print("Edge path with data:", edge_path_with_data) print("GENERATOR TEST") -for path in sorted(nx.all_simple_edge_paths(graph, "exit", "oc_menu")): +for path in sorted(nx.all_simple_edge_paths(graph, "Exit", "Tool")): for edge in path: - print(edge) + #print(edge) keys = graph.get_edge_data(edge[0], edge[1])[0]["keypath"].split(',') - print(keys) + #print(keys) - with serial.Serial('/dev/serial/by-id/usb-1a86_USB_Single_Serial_585D015807-if00', 115200, bytesize=serial.EIGHTBITS, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE) as ser: - for key in keys: - test_json_a = { - "mouseX": 99999, - "mouseY": 99999, - "mouse_down": ["rbutton", "lbutton"], - "mouse_up": ["otherbutton"], - "key_down": [HIDKeyCode[key]], - "key_up": [] - } -# - print(HIDKeyCode[key]) - ser.write(json.dumps(test_json_a).encode()) - - test_json_a = { - "mouseX": 99999, - "mouseY": 99999, - "mouse_down": ["rbutton", "lbutton"], - "mouse_up": ["otherbutton"], - "key_down": [], - "key_up": [HIDKeyCode[key]] - } -# - print(HIDKeyCode[key]) - ser.write(json.dumps(test_json_a).encode()) - #time.sleep(0.1) \ No newline at end of file + # with serial.Serial('/dev/serial/by-id/usb-1a86_USB_Single_Serial_585D015807-if00', 115200, bytesize=serial.EIGHTBITS, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE) as ser: + for key in keys: + print(key) + #test_json_a = { + # "mouseX": 99999, + # "mouseY": 99999, + # "mouse_down": ["rbutton", "lbutton"], + # "mouse_up": ["otherbutton"], + # "key_down": [HIDKeyCode[key]], + # "key_up": [] + #} +# # + #print(key) + ##ser.write(json.dumps(test_json_a).encode()) +# + #test_json_a = { + # "mouseX": 99999, + # "mouseY": 99999, + # "mouse_down": ["rbutton", "lbutton"], + # "mouse_up": ["otherbutton"], + # "key_down": [], + # "key_up": [HIDKeyCode[key]] + #} +# # + #print(key) + ##ser.write(json.dumps(test_json_a).encode()) + ##time.sleep(0.1) \ No newline at end of file diff --git a/webui/ipkvm/__init__.py b/webui/ipkvm/__init__.py index 656d6c7..dc4f469 100644 --- a/webui/ipkvm/__init__.py +++ b/webui/ipkvm/__init__.py @@ -1,7 +1,7 @@ from os import name, listdir from flask import Flask from flask_socketio import SocketIO -import json +import tomlkit import logging @@ -10,7 +10,14 @@ ui = SocketIO(app) logger = app.logger logger.setLevel(logging.INFO) +from ipkvm.util import video + def new_profile(): + profile = tomlkit.document() + server = tomlkit.table() + video_device = tomlkit.table() + client = tomlkit.table() + device_list = video.create_device_list() print(f"Detected {len(device_list)} video devices on your system.") print("Please enter the number of your preferred video device.") @@ -18,6 +25,7 @@ def new_profile(): print(f"{i + 1}. {device.friendly_name}") device = int(input("> ")) - 1 + video_device["friendly_name"] = device_list[device].friendly_name if len(device_list[device].video_formats) > 1: print("Please enter your preferred video input format: ") @@ -25,10 +33,12 @@ def new_profile(): print(f"{i + 1}. {format}") format = list(device_list[device].video_formats.keys())[int(input("> ")) - 1] + video_device["format"] = format else: format = next(iter(device_list[device].video_formats)) print(f"Video input format auto-detected as {format}!") + video_device["format"] = format print("Please enter the number of your preferred video resolution.") @@ -36,6 +46,7 @@ def new_profile(): print(f"{i + 1}. {resolution}") resolution = list(device_list[device].video_formats[format].keys())[int(input("> ")) - 1] + video_device["resolution"] = resolution print("Please enter the number of your preferred video refresh rate.") @@ -43,6 +54,7 @@ def new_profile(): print(f"{i + 1}. {fps}") fps = str(device_list[device].video_formats[format][resolution][int(input("> ")) - 1]) + video_device["fps"] = fps if name == "posix": serial_devices = listdir("/dev/serial/by-id/") @@ -55,31 +67,63 @@ def new_profile(): for i, serial_device in enumerate(serial_devices): print(f"{i + 1}. {serial_device}") - serial_device = serial_devices[int(input("> ")) - 1] + server["esp32_serial"] = serial_devices[int(input("> ")) - 1] elif len(serial_devices) == 1: print(f"ESP32 auto-detected as {serial_devices[0]}!") - serial_device = serial_devices[0] + server["esp32_serial"] = serial_devices[0] else: raise RuntimeError("No valid ESP32 devices connected!") + + print("Please enter the hostname or IP address of your client.") + client["hostname"] = input("> ") + + print("Please enter the port for RemoteHWInfo, if you have changed it from the default [60000].") + port = input("> ") + + if port == "": + port = "60000" + + client["hwinfo_port"] = port print("Please enter your new profile name.") profile_name = input("> ") - profile: dict[str, str | dict[str, str]] = { - "video_device": { - "friendly_name": device_list[device].friendly_name, - "format": format, - "resolution": resolution, - "fps": fps - }, - - "esp32_serial": serial_device + server["video_device"] = video_device + client["overclocking"] = { + "common": {}, + "cpu": {}, + "memory": {} } + profile["server"] = server + profile["client"] = client + + #profile: dict[str, dict[str, str | dict[str, str]] | dict[str, str | dict[str, dict[str, str]]]] = { + # "server": { + # "esp32_serial": serial_device, + # "video_device": { + # "friendly_name": device_list[device].friendly_name, + # "format": format, + # "resolution": resolution, + # "fps": fps + # } + # }, +# + # "client": { + # "hostname": hostname, + # "hwinfo_port": port, +# + # "overclocking": { + # "common": {}, + # "cpu": {}, + # "memory": {} + # } + # } + #} - with open(f"profiles/{profile_name}.json", 'w') as file: - json.dump(profile, file) + with open(f"profiles/{profile_name}.toml", 'w') as file: + tomlkit.dump(profile, file) return profile @@ -90,14 +134,14 @@ if len(listdir("profiles")) == 0: elif len(listdir("profiles")) == 1: print(f"Only one profile found, autoloading {listdir("profiles")[0]}...") with open(f"profiles/{listdir("profiles")[0]}", 'r') as file: - profile = json.load(file) - print(profile) + profile = tomlkit.load(file) -from ipkvm.util import video from ipkvm import feed from ipkvm.util.mkb import Esp32Serial +from ipkvm.hwinfo import HWInfoMonitor frame_buffer = feed.FrameBuffer() esp32_serial = Esp32Serial() +monitor = HWInfoMonitor() from ipkvm import routes, events diff --git a/webui/ipkvm/events.py b/webui/ipkvm/events.py index 0630bb7..372120b 100644 --- a/webui/ipkvm/events.py +++ b/webui/ipkvm/events.py @@ -2,6 +2,10 @@ from ipkvm import ui from ipkvm import esp32_serial from ipkvm.util.mkb import HIDKeyCode, HIDMouseScanCodes, GPIO import time +from ipkvm.util import graphs +from ipkvm import states +from ipkvm import profile +import tomlkit def power_switch(delay: float): msg = { @@ -16,41 +20,36 @@ def power_switch(delay: float): @ui.on("power_on") def handle_poweron(): - if esp32_serial.power_status == "off": - power_switch(0.2) + states.model.power_on() @ui.on("soft_power_off") def handle_soft_poweroff(): - if esp32_serial.power_status == "on": - power_switch(0.2) + states.model.soft_shutdown() @ui.on("hard_power_off") def handle_hard_poweroff(): - if esp32_serial.power_status == "on": - power_switch(0.5) + states.model.hard_shutdown() @ui.on("reboot_into_bios") def handle_reboot_bios(): - if esp32_serial.power_status == "on": # and OS state = offline - power_switch(5) - time.sleep(2) - power_switch(0.2) - - else: - power_switch(0.2) - - while time.time() - esp32_serial.bios_timer <= 5 or time.time() - esp32_serial.bios_timer >= 6: - print(time.time() - esp32_serial.bios_timer) - msg = { - "key_down": HIDKeyCode.Delete.value + states.model.reboot_into_bios() + +@ui.on("clear_cmos") +def handle_clear_cmos(): + msg = { + "cmos": GPIO.HIGH.value } - esp32_serial.mkb_queue.put(msg) - time.sleep(0.1) - msg = { - "key_up": HIDKeyCode.Delete.value + esp32_serial.mkb_queue.put(msg) + time.sleep(0.2) + msg = { + "cmos": GPIO.LOW.value } - esp32_serial.mkb_queue.put(msg) - time.sleep(0.1) + esp32_serial.mkb_queue.put(msg) + + time.sleep(1) + + power_switch(0.2) + spam_delete_until_bios() @ui.on('key_down') def handle_keydown(data: str): @@ -94,3 +93,11 @@ def handle_mouseup(data: int): } esp32_serial.mkb_queue.put(msg) + +@ui.on("test_route") +def handle_test_route(): + graphs.test_route() + +@ui.on("get_current_profile") +def handle_current_profile(): + return tomlkit.dumps(profile) \ No newline at end of file diff --git a/webui/ipkvm/feed.py b/webui/ipkvm/feed.py index a2afd14..d3b4e10 100644 --- a/webui/ipkvm/feed.py +++ b/webui/ipkvm/feed.py @@ -75,7 +75,7 @@ class FrameBuffer(threading.Thread): device_list = video.create_device_list() device_path = "" for device in device_list: - if device.friendly_name == profile["video_device"]["friendly_name"]: + if device.friendly_name == profile["server"]["video_device"]["friendly_name"]: device_path = device.path if name == "posix": @@ -85,8 +85,8 @@ class FrameBuffer(threading.Thread): raise RuntimeError("We're on something other than Linux, and that's not yet supported!") device.set(cv2.CAP_PROP_FOURCC, cv2.VideoWriter_fourcc(*"YUYV")) - device.set(cv2.CAP_PROP_FRAME_WIDTH, int(profile["video_device"]["resolution"].split('x')[0])) - device.set(cv2.CAP_PROP_FRAME_HEIGHT, int(profile["video_device"]["resolution"].split('x')[1])) - device.set(cv2.CAP_PROP_FPS, float(profile["video_device"]["fps"])) + device.set(cv2.CAP_PROP_FRAME_WIDTH, int(profile["server"]["video_device"]["resolution"].split('x')[0])) + device.set(cv2.CAP_PROP_FRAME_HEIGHT, int(profile["server"]["video_device"]["resolution"].split('x')[1])) + device.set(cv2.CAP_PROP_FPS, float(profile["server"]["video_device"]["fps"])) return device \ No newline at end of file diff --git a/webui/ipkvm/hwinfo.py b/webui/ipkvm/hwinfo.py new file mode 100644 index 0000000..3a60718 --- /dev/null +++ b/webui/ipkvm/hwinfo.py @@ -0,0 +1,77 @@ +import json +import threading +import re +import requests +#from ipkvm import profile +import time +from rich import print +import pandas as pd +from ipkvm import ui + +class HWInfoMonitor(threading.Thread): + def __init__(self): + super().__init__() + #self.request_url = f"http://{profile["client"]["hostname"]}:{profile["client"]["port"]}/json.json" + self.request_url = "http://10.20.30.48:60000/json.json" + self.dataframe = self.create_dataframe() + self.start() + + def run(self): + while True: + self.create_dataframe() + time.sleep(0.25) + + def create_dataframe(self): + while not self.is_hwinfo_alive(): + time.sleep(1) + + request = requests.get(self.request_url) + + data = request.json() + + cpu_list: list[str] = [] + vid_list: list[str] = [] + mhz_list: list[str] = [] + ccd_list: list[str] = [] + temp_list: list[str] = [] + power_list: list[str] = [] + + for reading in data["hwinfo"]["readings"]: + label = reading["labelOriginal"] + + match = re.match(r"(?PCore[0-9]* \(CCD[0-9]\))|(?PCore [0-9]* VID)|(?PCore [0-9]* T0 Effective Clock)|(?PCore [0-9]* Power)", label) + + if match: + if match.group("core_ccd"): + core_ccd = match.group("core_ccd").split(' ') + core_ccd[0] = core_ccd[0][:4] + ' ' + core_ccd[0][4:] + cpu_list.append(core_ccd[0]) + ccd_list.append(core_ccd[1].strip('()')) + temp_list.append(round(reading["value"], 2)) + + elif match.group("core_vid"): + vid_list.append(reading["value"]) + + elif match.group("core_mhz"): + mhz_list.append(round(reading["value"], 2)) + + elif match.group("core_power"): + power_list.append(round(reading["value"], 2)) + + core_dataframe = pd.DataFrame({ + "CCD": ccd_list, + "Clk": mhz_list, + "VID": vid_list, + "Power": power_list, + "Temp": temp_list + }, index=cpu_list) + + ui.emit("update_core_info_table", core_dataframe.to_dict("index")) + + def is_hwinfo_alive(self): + request = requests.get(self.request_url) + + if request.status_code == 200 and len(request.json()) > 0: + return True + + return False diff --git a/webui/ipkvm/states.py b/webui/ipkvm/states.py new file mode 100644 index 0000000..b94b268 --- /dev/null +++ b/webui/ipkvm/states.py @@ -0,0 +1,170 @@ +from enum import Enum +import time +from transitions.experimental.utils import with_model_definitions, add_transitions, transition +from transitions.extensions import GraphMachine +from ipkvm import esp32_serial +from ipkvm.util.mkb import GPIO, HIDKeyCode +import logging +logging.basicConfig(level=logging.DEBUG) +# Set transitions' log level to INFO; DEBUG messages will be omitted +logging.getLogger('transitions').setLevel(logging.DEBUG) + +class State(Enum): + PoweredOff = "powered off" + EnterBIOS = "enter bios" + BIOSSetup = "bios setup" + WaitingForOS = "waiting for os" + OCTypeDecision = "next process decision" + RoughMulticoreUndervolt = "rough multicore undervolting" + PreciseMulticoreUndervolt = "precise multicore undervolting" + POST = "power on self test" + WaitingForHWInfo = "waiting for hwinfo" + BootLoop = "boot loop" + IdleWaitingForInput = "idle, waiting for input" + SingleCoreTuning = "single core tuning" + +class Overclocking: + + state: State = State.IdleWaitingForInput + + # TRANSITION DEFINITIONS + @add_transitions(transition([State.PoweredOff, State.IdleWaitingForInput], State.POST, after="_power_on", + unless="client_powered")) + def power_on(self): ... + + @add_transitions(transition(State.POST, State.WaitingForOS)) + def enter_os(self): ... + + @add_transitions(transition(State.WaitingForOS, State.WaitingForHWInfo)) + def os_booted(self): ... + + @add_transitions(transition(State.WaitingForHWInfo, State.OCTypeDecision)) + def hwinfo_available(self): ... + + @add_transitions(transition(State.POST, State.EnterBIOS, after="_enter_bios")) + def enter_bios(self): ... + + @add_transitions(transition(State.EnterBIOS, State.BIOSSetup)) + def start_bios_setup(self): ... + + @add_transitions(transition(State.BIOSSetup, State.POST)) + def finished_bios_setup(self): ... + + @add_transitions(transition(State.IdleWaitingForInput, State.WaitingForHWInfo)) + def begin_automation(self): ... + + @add_transitions(transition(State.POST, State.BootLoop)) + def unsuccessful_post(self): ... + + @add_transitions(transition(State.BootLoop, State.PoweredOff)) + def trigger_cmos_reset(self): ... + + @add_transitions(transition([State.IdleWaitingForInput, State.RoughMulticoreUndervolt, + State.PreciseMulticoreUndervolt, State.SingleCoreTuning], State.POST)) + def reboot(self): ... + + @add_transitions(transition([State.BIOSSetup, State.IdleWaitingForInput, State.BootLoop, State.POST, + State.WaitingForOS, State.RoughMulticoreUndervolt, + State.PreciseMulticoreUndervolt, State.SingleCoreTuning], + State.PoweredOff, after="_hard_shutdown", conditions="client_powered")) + def hard_shutdown(self): ... + + @add_transitions(transition(State.IdleWaitingForInput, State.PoweredOff, + after="_soft_shutdown", conditions="client_powered")) + def soft_shutdown(self): ... + + @add_transitions(transition(State.OCTypeDecision, State.RoughMulticoreUndervolt)) + def rough_multicore_undervolt(self): ... + + @add_transitions(transition(State.OCTypeDecision, State.PreciseMulticoreUndervolt)) + def precise_multicore_undervolt(self): ... + + @add_transitions(transition(State.OCTypeDecision, State.SingleCoreTuning)) + def single_core_tuning(self): ... + + + # PROPERTIES GO HERE + @property + def client_powered(self): + return esp32_serial.power_status + + # UTILITY FUNCTIONS GO HERE + def _power_switch(self, delay: float): + msg = { + "pwr": GPIO.HIGH.value + } + esp32_serial.mkb_queue.put(msg) + time.sleep(delay) + msg = { + "pwr": GPIO.LOW.value + } + esp32_serial.mkb_queue.put(msg) + + # FUNCTIONS TRIGGERED BY STATE CHANGES + def _power_on(self): + self._power_switch(0.2) + + # Unknown code definition, but this is the first consistent one indicating POST has started. + while esp32_serial.last_post_code != "FC": + pass + + def _hard_shutdown(self): + self._power_switch(5) + while self.client_powered: + pass + + def _soft_shutdown(self): + self._power_switch(0.2) + while self.client_powered: + pass + + def _enter_bios(self): + # Wait until the POST has progressed far enough for USB devices to be loaded and options to be imminent + esp32_serial.notify_code = "45" + esp32_serial.active_notification_request.set() + esp32_serial.post_code_notify.wait() + esp32_serial.post_code_notify.clear() + + # Spam delete until the BIOS is loaded + esp32_serial.notify_code = "Ab" + esp32_serial.active_notification_request.set() + while not esp32_serial.post_code_notify.is_set(): + msg = { + "key_down": HIDKeyCode.Delete.value + } + esp32_serial.mkb_queue.put(msg) + time.sleep(0.1) + msg = { + "key_up": HIDKeyCode.Delete.value + } + esp32_serial.mkb_queue.put(msg) + time.sleep(0.1) + + esp32_serial.post_code_notify.clear() + + # Wait a few seconds for the BIOS to become responsive + time.sleep(5) + + # OTHER FUNCTIONS GO HERE + def reboot_into_bios(self): + if self.client_powered: + if self.state is State.IdleWaitingForInput: + self.soft_shutdown() + + else: + self.hard_shutdown() + + self.power_on() + self.enter_bios() + + +@with_model_definitions +class MyMachine(GraphMachine): + pass + +model = Overclocking() +machine = MyMachine(model, states=State, initial=model.state) + +machine.get_graph().draw('my_state_diagram.svg', prog='dot') +print(model.client_powered) +print(model.state) \ No newline at end of file diff --git a/webui/ipkvm/static/css/codemirror.css b/webui/ipkvm/static/css/codemirror.css new file mode 100644 index 0000000..d730bad --- /dev/null +++ b/webui/ipkvm/static/css/codemirror.css @@ -0,0 +1,344 @@ +/* BASICS */ + +.CodeMirror { + /* Set height, width, borders, and global font properties here */ + font-family: monospace; + height: 100%; + color: black; + direction: ltr; +} + +/* PADDING */ + +.CodeMirror-lines { + padding: 4px 0; /* Vertical padding around content */ +} +.CodeMirror pre.CodeMirror-line, +.CodeMirror pre.CodeMirror-line-like { + padding: 0 4px; /* Horizontal padding of content */ +} + +.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { + background-color: white; /* The little square between H and V scrollbars */ +} + +/* GUTTER */ + +.CodeMirror-gutters { + border-right: 1px solid #ddd; + background-color: #f7f7f7; + white-space: nowrap; +} +.CodeMirror-linenumbers {} +.CodeMirror-linenumber { + padding: 0 3px 0 5px; + min-width: 20px; + text-align: right; + color: #999; + white-space: nowrap; +} + +.CodeMirror-guttermarker { color: black; } +.CodeMirror-guttermarker-subtle { color: #999; } + +/* CURSOR */ + +.CodeMirror-cursor { + border-left: 1px solid black; + border-right: none; + width: 0; +} +/* Shown when moving in bi-directional text */ +.CodeMirror div.CodeMirror-secondarycursor { + border-left: 1px solid silver; +} +.cm-fat-cursor .CodeMirror-cursor { + width: auto; + border: 0 !important; + background: #7e7; +} +.cm-fat-cursor div.CodeMirror-cursors { + z-index: 1; +} +.cm-fat-cursor .CodeMirror-line::selection, +.cm-fat-cursor .CodeMirror-line > span::selection, +.cm-fat-cursor .CodeMirror-line > span > span::selection { background: transparent; } +.cm-fat-cursor .CodeMirror-line::-moz-selection, +.cm-fat-cursor .CodeMirror-line > span::-moz-selection, +.cm-fat-cursor .CodeMirror-line > span > span::-moz-selection { background: transparent; } +.cm-fat-cursor { caret-color: transparent; } +@-moz-keyframes blink { + 0% {} + 50% { background-color: transparent; } + 100% {} +} +@-webkit-keyframes blink { + 0% {} + 50% { background-color: transparent; } + 100% {} +} +@keyframes blink { + 0% {} + 50% { background-color: transparent; } + 100% {} +} + +/* Can style cursor different in overwrite (non-insert) mode */ +.CodeMirror-overwrite .CodeMirror-cursor {} + +.cm-tab { display: inline-block; text-decoration: inherit; } + +.CodeMirror-rulers { + position: absolute; + left: 0; right: 0; top: -50px; bottom: 0; + overflow: hidden; +} +.CodeMirror-ruler { + border-left: 1px solid #ccc; + top: 0; bottom: 0; + position: absolute; +} + +/* DEFAULT THEME */ + +.cm-s-default .cm-header {color: blue;} +.cm-s-default .cm-quote {color: #090;} +.cm-negative {color: #d44;} +.cm-positive {color: #292;} +.cm-header, .cm-strong {font-weight: bold;} +.cm-em {font-style: italic;} +.cm-link {text-decoration: underline;} +.cm-strikethrough {text-decoration: line-through;} + +.cm-s-default .cm-keyword {color: #708;} +.cm-s-default .cm-atom {color: #219;} +.cm-s-default .cm-number {color: #164;} +.cm-s-default .cm-def {color: #00f;} +.cm-s-default .cm-variable, +.cm-s-default .cm-punctuation, +.cm-s-default .cm-property, +.cm-s-default .cm-operator {} +.cm-s-default .cm-variable-2 {color: #05a;} +.cm-s-default .cm-variable-3, .cm-s-default .cm-type {color: #085;} +.cm-s-default .cm-comment {color: #a50;} +.cm-s-default .cm-string {color: #a11;} +.cm-s-default .cm-string-2 {color: #f50;} +.cm-s-default .cm-meta {color: #555;} +.cm-s-default .cm-qualifier {color: #555;} +.cm-s-default .cm-builtin {color: #30a;} +.cm-s-default .cm-bracket {color: #997;} +.cm-s-default .cm-tag {color: #170;} +.cm-s-default .cm-attribute {color: #00c;} +.cm-s-default .cm-hr {color: #999;} +.cm-s-default .cm-link {color: #00c;} + +.cm-s-default .cm-error {color: #f00;} +.cm-invalidchar {color: #f00;} + +.CodeMirror-composing { border-bottom: 2px solid; } + +/* Default styles for common addons */ + +div.CodeMirror span.CodeMirror-matchingbracket {color: #0b0;} +div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;} +.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); } +.CodeMirror-activeline-background {background: #e8f2ff;} + +/* STOP */ + +/* The rest of this file contains styles related to the mechanics of + the editor. You probably shouldn't touch them. */ + +.CodeMirror { + position: relative; + overflow: hidden; + background: white; +} + +.CodeMirror-scroll { + overflow: scroll !important; /* Things will break if this is overridden */ + /* 50px is the magic margin used to hide the element's real scrollbars */ + /* See overflow: hidden in .CodeMirror */ + margin-bottom: -50px; margin-right: -50px; + padding-bottom: 50px; + height: 100%; + outline: none; /* Prevent dragging from highlighting the element */ + position: relative; + z-index: 0; +} +.CodeMirror-sizer { + position: relative; + border-right: 50px solid transparent; +} + +/* The fake, visible scrollbars. Used to force redraw during scrolling + before actual scrolling happens, thus preventing shaking and + flickering artifacts. */ +.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { + position: absolute; + z-index: 6; + display: none; + outline: none; +} +.CodeMirror-vscrollbar { + right: 0; top: 0; + overflow-x: hidden; + overflow-y: scroll; +} +.CodeMirror-hscrollbar { + bottom: 0; left: 0; + overflow-y: hidden; + overflow-x: scroll; +} +.CodeMirror-scrollbar-filler { + right: 0; bottom: 0; +} +.CodeMirror-gutter-filler { + left: 0; bottom: 0; +} + +.CodeMirror-gutters { + position: absolute; left: 0; top: 0; + min-height: 100%; + z-index: 3; +} +.CodeMirror-gutter { + white-space: normal; + height: 100%; + display: inline-block; + vertical-align: top; + margin-bottom: -50px; +} +.CodeMirror-gutter-wrapper { + position: absolute; + z-index: 4; + background: none !important; + border: none !important; +} +.CodeMirror-gutter-background { + position: absolute; + top: 0; bottom: 0; + z-index: 4; +} +.CodeMirror-gutter-elt { + position: absolute; + cursor: default; + z-index: 4; +} +.CodeMirror-gutter-wrapper ::selection { background-color: transparent } +.CodeMirror-gutter-wrapper ::-moz-selection { background-color: transparent } + +.CodeMirror-lines { + cursor: text; + min-height: 1px; /* prevents collapsing before first draw */ +} +.CodeMirror pre.CodeMirror-line, +.CodeMirror pre.CodeMirror-line-like { + /* Reset some styles that the rest of the page might have set */ + -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0; + border-width: 0; + background: transparent; + font-family: inherit; + font-size: inherit; + margin: 0; + white-space: pre; + word-wrap: normal; + line-height: inherit; + color: inherit; + z-index: 2; + position: relative; + overflow: visible; + -webkit-tap-highlight-color: transparent; + -webkit-font-variant-ligatures: contextual; + font-variant-ligatures: contextual; +} +.CodeMirror-wrap pre.CodeMirror-line, +.CodeMirror-wrap pre.CodeMirror-line-like { + word-wrap: break-word; + white-space: pre-wrap; + word-break: normal; +} + +.CodeMirror-linebackground { + position: absolute; + left: 0; right: 0; top: 0; bottom: 0; + z-index: 0; +} + +.CodeMirror-linewidget { + position: relative; + z-index: 2; + padding: 0.1px; /* Force widget margins to stay inside of the container */ +} + +.CodeMirror-widget {} + +.CodeMirror-rtl pre { direction: rtl; } + +.CodeMirror-code { + outline: none; +} + +/* Force content-box sizing for the elements where we expect it */ +.CodeMirror-scroll, +.CodeMirror-sizer, +.CodeMirror-gutter, +.CodeMirror-gutters, +.CodeMirror-linenumber { + -moz-box-sizing: content-box; + box-sizing: content-box; +} + +.CodeMirror-measure { + position: absolute; + width: 100%; + height: 0; + overflow: hidden; + visibility: hidden; +} + +.CodeMirror-cursor { + position: absolute; + pointer-events: none; +} +.CodeMirror-measure pre { position: static; } + +div.CodeMirror-cursors { + visibility: hidden; + position: relative; + z-index: 3; +} +div.CodeMirror-dragcursors { + visibility: visible; +} + +.CodeMirror-focused div.CodeMirror-cursors { + visibility: visible; +} + +.CodeMirror-selected { background: #d9d9d9; } +.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; } +.CodeMirror-crosshair { cursor: crosshair; } +.CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: #d7d4f0; } +.CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #d7d4f0; } + +.cm-searching { + background-color: #ffa; + background-color: rgba(255, 255, 0, .4); +} + +/* Used to force a border model for a node */ +.cm-force-border { padding-right: .1px; } + +@media print { + /* Hide the cursor when printing */ + .CodeMirror div.CodeMirror-cursors { + visibility: hidden; + } +} + +/* See issue #2901 */ +.cm-tab-wrap-hack:after { content: ''; } + +/* Help users use markselection to safely style text background */ +span.CodeMirror-selectedtext { background: none; } diff --git a/webui/ipkvm/static/css/style.css b/webui/ipkvm/static/css/style.css index 807ef23..5e7e7c2 100644 --- a/webui/ipkvm/static/css/style.css +++ b/webui/ipkvm/static/css/style.css @@ -1,8 +1,71 @@ +.full-screen { + max-width: 100vw; + max-height: 100vh; + overflow: hidden; +} + .stream-container { margin: 0 auto; border: 20px; } + .stream-view { width: 100%; height: auto; +} + +.column-flex-container { + display: flex; + flex-direction: column; + overflow: hidden; +} + +.row-flex-container { + display: flex; + flex-direction: row; + overflow: hidden; +} + +.left-third { + flex-basis: 34%; + flex-grow: 1; +} + +.right-third { + flex-basis: 66%; +} + +.segment-container { + background-color: rgb(36, 30, 30); + border: 3px solid rgb(153, 153, 153); + width: 300px; + height: 188px; + margin-left: auto; +} + +.post-log-container { + border: 1px solid #ccc; + overflow: auto; + flex-grow: 1; + min-height: 1em; + max-height: 100%; + flex-basis: 0; + white-space: pre-wrap; +} + +/* god bless for this https://codsen.com/articles/styling-react-codemirror */ +.cm-editor { + /* our container wrapper for Codemirror instance */ + flex: 1; /* expand to the maximum */ + height: 100%; + position: relative; /* needed for child component .cm-scroller */ + } + +.cm-scroller { + position: absolute !important; + top: 0; + right: 0; + bottom: 0; + left: 0; + overflow: auto; } \ No newline at end of file diff --git a/webui/ipkvm/static/css/vendor/handsontable/handsontable.min.css b/webui/ipkvm/static/css/vendor/handsontable/handsontable.min.css new file mode 100755 index 0000000..fad2ecf --- /dev/null +++ b/webui/ipkvm/static/css/vendor/handsontable/handsontable.min.css @@ -0,0 +1,30 @@ +/*! + * Copyright (c) HANDSONCODE sp. z o. o. + * + * HANDSONTABLE is a software distributed by HANDSONCODE sp. z o. o., a Polish corporation based in + * Gdynia, Poland, at Aleja Zwyciestwa 96-98, registered by the District Court in Gdansk under number + * 538651, EU tax ID number: PL5862294002, share capital: PLN 62,800.00. + * + * This software is protected by applicable copyright laws, including international treaties, and dual- + * licensed - depending on whether your use for commercial purposes, meaning intended for or + * resulting in commercial advantage or monetary compensation, or not. + * + * If your use is strictly personal or solely for evaluation purposes, meaning for the purposes of testing + * the suitability, performance, and usefulness of this software outside the production environment, + * you agree to be bound by the terms included in the "handsontable-non-commercial-license.pdf" file. + * + * Your use of this software for commercial purposes is subject to the terms included in an applicable + * license agreement. + * + * In any case, you must not make any such use of this software as to develop software which may be + * considered competitive with this software. + * + * UNLESS EXPRESSLY AGREED OTHERWISE, HANDSONCODE PROVIDES THIS SOFTWARE ON AN "AS IS" + * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, AND IN NO EVENT AND UNDER NO + * LEGAL THEORY, SHALL HANDSONCODE BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY DIRECT, + * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER ARISING FROM + * USE OR INABILITY TO USE THIS SOFTWARE. + * + * Version: 15.1.0 + * Release date: 20/02/2025 (built at 19/02/2025 10:01:18) + */.ht-wrapper:not([class*=ht-theme]){--ht-cell-horizontal-padding:8px;--ht-cell-vertical-padding:4px;--ht-font-size:14px;--ht-line-height:20px;--ht-border-color:#222;--ht-foreground-color:#222;--ht-background-color:#fff;--ht-header-foreground-color:#222;--ht-header-background-color:#f7f7f9;--ht-header-row-foreground-color:#222;--ht-header-row-background-color:#f7f7f9;--ht-cell-horizontal-border-color:#222;--ht-cell-vertical-border-color:#222;--ht-header-active-border-color:#1a42e8;--ht-header-active-foreground-color:#fff;--ht-header-active-background-color:#1a42e8;--ht-header-row-active-foreground-color:#fff;--ht-header-row-active-background-color:#1a42e8;--ht-cell-selection-border-color:#1a42e8}.handsontable{color:var(--ht-foreground-color);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Helvetica Neue,Arial,sans-serif;font-size:var(--ht-font-size);font-weight:var(--ht-font-weight);letter-spacing:0;line-height:var(--ht-line-height);position:relative;scrollbar-color:var(--ht-scrollbar-thumb-color) var(--ht-scrollbar-track-color);scrollbar-width:thin;touch-action:manipulation}.handsontable::-webkit-scrollbar-track{border-radius:var(--ht-scrollbar-border-radius)}.handsontable.ht-wrapper{border-radius:var(--ht-wrapper-border-radius,0)}.handsontable.ht-wrapper:before{border:var(--ht-wrapper-border-width) solid var(--ht-wrapper-border-color);border-radius:var(--ht-wrapper-border-radius,0);content:"";display:block;inset:0;overflow:hidden;pointer-events:none;position:absolute;z-index:999}.handsontable.htGhostTable table thead th{border-bottom-width:0}.handsontable.htGhostTable table tbody tr td,.handsontable.htGhostTable table tbody tr th{border-top-width:0}.handsontable.htHasScrollX .ht_master .wtHolder,.handsontable.htHasScrollY .ht_master .wtHolder{background-color:var(--ht-background-color)}.handsontable tr.ht__row_even th{background-color:var(--ht-row-header-even-background-color)}.handsontable tr.ht__row_even td{background-color:var(--ht-row-cell-even-background-color)}.handsontable tr.ht__row_odd th{background-color:var(--ht-row-header-odd-background-color)}.handsontable tr.ht__row_odd td{background-color:var(--ht-row-cell-odd-background-color)}.handsontable td,.handsontable th{border-bottom:1px solid var(--ht-cell-vertical-border-color);border-inline-end-color:var(--ht-cell-horizontal-border-color);border-inline-end-width:1px;border-inline-start-color:var(--ht-cell-horizontal-border-color);border-inline-start-width:0;border-left-style:solid;border-right-style:solid;border-top:0 solid var(--ht-cell-vertical-border-color);box-sizing:border-box;color:var(--ht-foreground-color);empty-cells:show;font-size:var(--ht-font-size);height:calc(var(--ht-cell-vertical-padding)*2 + var(--ht-line-height) + 1px);line-height:var(--ht-line-height);outline:none;outline-width:0;overflow:hidden;padding:var(--ht-cell-vertical-padding) var(--ht-cell-horizontal-padding);vertical-align:top;white-space:pre-wrap}.handsontable td.invisibleSelection,.handsontable th.invisibleSelection{outline:none}.handsontable td.invisibleSelection::selection,.handsontable th.invisibleSelection::selection{background:transparent}.handsontable td:first-of-type{border-inline-start-width:1px}.handsontable th{background-color:var(--ht-header-background-color);color:var(--ht-header-foreground-color);font-weight:var(--ht-header-font-weight);overflow:visible;position:relative;text-align:center;white-space:nowrap}.handsontable th:last-child{border-bottom-width:1px;border-inline-end-color:var(--ht-border-color);border-inline-end-width:1px;border-inline-start-width:0}.handsontable th:last-child.ht__active_highlight{border-inline-end-color:var(--ht-header-active-border-color)}.handsontable th:first-child{border-inline-start-color:var(--ht-border-color)}.handsontable th:first-child.ht__active_highlight{border-inline-start-color:var(--ht-header-active-border-color)}.handsontable th:first-child,.handsontable th:nth-child(2){border-inline-start-width:1px}.handsontable th.current{box-shadow:inset 0 0 0 1px var(--ht-cell-selection-border-color)}.handsontable th.active{background-color:var(--ht-header-active-background-color);color:var(--ht-header-active-foreground-color)}.handsontable th.ht__highlight{background-color:var(--ht-header-highlighted-background-color);color:var(--ht-header-highlighted-foreground-color)}.handsontable th.ht__highlight .relative:after{background-color:var(--ht-accent-color);content:"";display:block;position:absolute}.handsontable th.ht__active_highlight{background-color:var(--ht-header-active-background-color);border-color:var(--ht-header-active-border-color);box-shadow:-1px 0 0 0 var(--ht-header-active-border-color);color:var(--ht-header-active-foreground-color)}.handsontable tbody tr.ht__row_even th.ht__highlight,.handsontable tbody tr.ht__row_odd th.ht__highlight{background-color:var(--ht-header-row-highlighted-background-color);color:var(--ht-header-row-highlighted-foreground-color)}.handsontable tbody tr.ht__row_even th.ht__active_highlight,.handsontable tbody tr.ht__row_odd th.ht__active_highlight{background-color:var(--ht-header-row-active-background-color);color:var(--ht-header-row-active-foreground-color)}.handsontable tbody tr th{background-color:var(--ht-header-row-background-color);color:var(--ht-header-row-foreground-color);padding:0}.handsontable tbody tr th .relative{height:100%;padding:var(--ht-cell-vertical-padding) var(--ht-cell-horizontal-padding)}.handsontable tbody tr th .relative:after{bottom:-1px;right:-1px;top:-1px;width:var(--ht-header-highlighted-shadow-size)}.handsontable tbody tr th.ht__active_highlight{box-shadow:0 -1px 0 0 var(--ht-header-active-border-color)}.handsontable tbody tr td:first-child{border-inline-start-color:var(--ht-border-color)}.handsontable tbody tr td:last-child{border-inline-end-color:var(--ht-border-color)}.handsontable thead tr:only-of-type th .relative:after{bottom:0}.handsontable thead tr th{padding:0}.handsontable thead tr th .relative{padding:var(--ht-cell-vertical-padding) var(--ht-cell-horizontal-padding)}.handsontable thead tr th .relative:after{bottom:-1px;height:var(--ht-header-highlighted-shadow-size);left:-1px;right:-1px}.handsontable thead tr th .relative .colHeader{max-width:calc(100% + 1px);overflow:hidden;text-overflow:ellipsis;vertical-align:top}.handsontable thead tr th .relative:has(.collapsibleIndicator,.changeType) .colHeader{max-width:calc(100% - var(--ht-icon-size) - var(--ht-gap-size))}.handsontable tr:first-child td,.handsontable tr:first-child th{border-top-color:var(--ht-border-color);border-top-width:1px}.handsontable tr:first-child td.ht__active_highlight,.handsontable tr:first-child th.ht__active_highlight{border-top-color:var(--ht-header-active-border-color)}.handsontable tr:last-child td,.handsontable tr:last-child th{border-bottom-color:var(--ht-border-color)}.handsontable tr:last-child td.ht__active_highlight,.handsontable tr:last-child th.ht__active_highlight{border-bottom-color:var(--ht-header-active-border-color)}.handsontable thead tr:not(:last-child) th{overflow:hidden}.handsontable .hide{display:none}.handsontable .relative{box-sizing:border-box;position:relative}.handsontable .wtHider{width:0}.handsontable .wtSpreader{height:auto;position:relative;width:0}.handsontable .htAutoSize{left:-99000px;position:absolute;top:-99000px;visibility:hidden}.handsontable .htFocusCatcher{border:0;height:0;margin:0;opacity:0;padding:0;position:absolute;width:0;z-index:-1}.handsontable div,.handsontable input,.handsontable table,.handsontable tbody,.handsontable textarea,.handsontable thead{box-sizing:content-box}.handsontable input,.handsontable textarea{min-height:auto}.handsontable .htCore{background-color:var(--ht-background-color);border-collapse:separate;border-spacing:0;border-width:0;cursor:default;margin:0;outline-width:0;table-layout:fixed;width:0}.handsontable col,.handsontable col.rowHeader{width:64px}.handsontable col.hidden{width:0!important}.handsontable span.colHeader,.handsontable span.rowHeader{display:inline-block;font-size:var(--ht-font-size);line-height:var(--ht-line-height)}.handsontable tr.hidden,.handsontable tr.hidden td,.handsontable tr.hidden th{display:none}.handsontable a{color:var(--ht-link-color)}.handsontable a:hover{color:var(--ht-link-hover-color)}.handsontable .ht_clone_top th:nth-child(2){border-inline-end-width:1px;border-inline-start-width:0}.handsontable.htRowHeaders thead tr th:nth-child(2){border-inline-start-width:1px}.handsontable .ht_master:not(.innerBorderInlineStart):not(.emptyColumns) tbody tr th,.handsontable .ht_master:not(.innerBorderInlineStart):not(.emptyColumns) thead tr th:first-child,.handsontable .ht_master:not(.innerBorderInlineStart):not(.emptyColumns)~.handsontable:not(.htGhostTable) tbody tr th,.handsontable .ht_master:not(.innerBorderInlineStart):not(.emptyColumns)~.handsontable:not(.ht_clone_top):not(.htGhostTable) thead tr th:first-child{border-inline-end-width:0;border-inline-start-width:1px}.handsontable .ht_master:not(.innerBorderTop):not(.innerBorderBottom) thead tr.lastChild th,.handsontable .ht_master:not(.innerBorderTop):not(.innerBorderBottom) thead tr:last-child th,.handsontable .ht_master:not(.innerBorderTop):not(.innerBorderBottom)~.handsontable thead tr.lastChild th,.handsontable .ht_master:not(.innerBorderTop):not(.innerBorderBottom)~.handsontable thead tr:last-child th{border-bottom-width:0}.handsontable .ht_clone_inline_start table.htCore>thead,.handsontable .ht_master table.htCore>tbody>tr>th,.handsontable .ht_master table.htCore>thead{visibility:hidden}.ht_clone_bottom,.ht_clone_bottom .wtHolder,.ht_clone_inline_start,.ht_clone_inline_start .wtHolder,.ht_clone_top,.ht_clone_top .wtHolder,.ht_master,.ht_master .wtHolder{overflow:hidden}.ht_master .wtHolder{overflow:auto}[dir=rtl].handsontable td[dir=ltr]{border-inline-end-width:0;border-inline-start-width:1px}[dir=rtl].handsontable tbody tr td[dir=ltr]:last-child{border-inline-start-color:var(--ht-border-color)}[dir=rtl].handsontable tbody tr th .relative:after{left:-1px;right:auto}.handsontable.ht-wrapper .ht_master .htCore{border-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper .ht_master .htCore thead tr:first-child th:first-child{border-start-start-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper .ht_master .htCore thead tr:first-child th:last-child{border-start-end-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper .ht_master .htCore tbody tr:first-child td:first-child{border-start-start-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper .ht_master .htCore tbody tr:first-child td:last-child{border-start-end-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper .ht_master .htCore tbody tr:last-child td:first-child{border-end-start-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper .ht_master .htCore tbody tr:last-child td:last-child{border-end-end-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper:has(.ht_clone_top tbody tr td) .ht_master .htCore tbody tr:first-child td:first-child,.handsontable.ht-wrapper:has(.ht_clone_top thead tr th) .ht_master .htCore tbody tr:first-child td:first-child{border-start-start-radius:0}.handsontable.ht-wrapper:has(.ht_clone_top tbody tr td) .ht_master .htCore tbody tr:first-child td:last-child,.handsontable.ht-wrapper:has(.ht_clone_top thead tr th) .ht_master .htCore tbody tr:first-child td:last-child{border-start-end-radius:0}.handsontable.ht-wrapper .ht_clone_top_inline_start_corner .htCore,.handsontable.ht-wrapper .ht_clone_top_inline_start_corner .htCore tbody tr:first-child td:first-child,.handsontable.ht-wrapper .ht_clone_top_inline_start_corner .htCore tbody tr:first-child th:first-child,.handsontable.ht-wrapper .ht_clone_top_inline_start_corner .htCore thead tr:first-child th:first-child{border-start-start-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper .ht_clone_top_inline_start_corner .htCore:has(thead tr th) tbody tr:first-child td:first-child,.handsontable.ht-wrapper .ht_clone_top_inline_start_corner .htCore:has(thead tr th) tbody tr:first-child th:first-child{border-start-start-radius:0!important}.handsontable.ht-wrapper .ht_clone_bottom_inline_start_corner .htCore,.handsontable.ht-wrapper .ht_clone_bottom_inline_start_corner .htCore tbody tr:last-child td:first-child,.handsontable.ht-wrapper .ht_clone_bottom_inline_start_corner .htCore tbody tr:last-child th:first-child,.handsontable.ht-wrapper .ht_clone_bottom_inline_start_corner .htCore thead tr:last-child th:first-child{border-end-start-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper .ht_clone_bottom_inline_start_corner .htCore:has(thead tr td) tbody tr:last-child td:first-child,.handsontable.ht-wrapper .ht_clone_bottom_inline_start_corner .htCore:has(thead tr td) tbody tr:last-child th:first-child{border-end-start-radius:0!important}.handsontable.ht-wrapper .ht_clone_top .htCore{border-start-end-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper .ht_clone_top .htCore,.handsontable.ht-wrapper .ht_clone_top .htCore thead tr:first-child th:first-child{border-start-start-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper .ht_clone_top .htCore thead tr:first-child th:last-child{border-start-end-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper .ht_clone_top .htCore tbody tr:first-child td:first-child{border-start-start-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper .ht_clone_top .htCore tbody tr:first-child td:last-child{border-start-end-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper .ht_clone_top .htCore:has(thead tr th) tbody tr:first-child td:first-child{border-start-start-radius:0}.handsontable.ht-wrapper .ht_clone_top .htCore:has(thead tr th) tbody tr:first-child td:last-child{border-start-end-radius:0}.handsontable.ht-wrapper .ht_clone_inline_start .htCore{border-end-start-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper .ht_clone_inline_start .htCore,.handsontable.ht-wrapper .ht_clone_inline_start .htCore tbody tr:first-child td:first-child,.handsontable.ht-wrapper .ht_clone_inline_start .htCore tbody tr:first-child th:first-child,.handsontable.ht-wrapper .ht_clone_inline_start .htCore thead tr:first-child th:first-child{border-start-start-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper .ht_clone_inline_start .htCore tbody tr:last-child td:first-child,.handsontable.ht-wrapper .ht_clone_inline_start .htCore tbody tr:last-child th:first-child{border-end-start-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper .ht_clone_inline_start .htCore:has(thead tr th) tbody tr:first-child td:first-child,.handsontable.ht-wrapper .ht_clone_inline_start .htCore:has(thead tr th) tbody tr:first-child th:first-child{border-start-start-radius:0}.handsontable.ht-wrapper .ht_clone_bottom .htCore{border-end-end-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper .ht_clone_bottom .htCore,.handsontable.ht-wrapper .ht_clone_bottom .htCore thead tr:last-child th:first-child{border-end-start-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper .ht_clone_bottom .htCore thead tr:last-child th:last-child{border-end-end-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper .ht_clone_bottom .htCore tbody tr:last-child td:first-child{border-end-start-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper .ht_clone_bottom .htCore tbody tr:last-child td:last-child{border-end-end-radius:var(--ht-wrapper-border-radius)}.handsontable.ht-wrapper .ht_clone_bottom .htCore:has(thead tr th) tbody tr:last-child td:first-child{border-end-start-radius:0}.handsontable.ht-wrapper .ht_clone_bottom .htCore:has(thead tr th) tbody tr:last-child td:last-child{border-end-end-radius:0}.handsontable.ht-wrapper.htHasScrollX .htCore{border-end-end-radius:0;border-end-start-radius:0}.handsontable.ht-wrapper.htHasScrollX .htCore tbody tr:last-child td:first-child,.handsontable.ht-wrapper.htHasScrollX .htCore tbody tr:last-child th:first-child,.handsontable.ht-wrapper.htHasScrollX .htCore thead tr:last-child th:first-child{border-end-start-radius:0}.handsontable.ht-wrapper.htHasScrollX .htCore tbody tr:last-child td:last-child,.handsontable.ht-wrapper.htHasScrollX .htCore tbody tr:last-child th:last-child,.handsontable.ht-wrapper.htHasScrollX .htCore thead tr:last-child th:last-child{border-end-end-radius:0}.handsontable.ht-wrapper.htHasScrollY .htCore{border-end-end-radius:0;border-start-end-radius:0}.handsontable.ht-wrapper.htHasScrollY .htCore tbody tr:first-child td:last-child,.handsontable.ht-wrapper.htHasScrollY .htCore tbody tr:first-child th:last-child,.handsontable.ht-wrapper.htHasScrollY .htCore thead tr:first-child th:last-child{border-start-end-radius:0}.handsontable.ht-wrapper.htHasScrollY .htCore tbody tr:last-child td:last-child,.handsontable.ht-wrapper.htHasScrollY .htCore tbody tr:last-child th:last-child,.handsontable.ht-wrapper.htHasScrollY .htCore thead tr:last-child th:last-child{border-end-end-radius:0}.handsontable.mobile,.handsontable.mobile .wtHolder{user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-overflow-scrolling:touch}.handsontable.mobile .handsontableInput:focus{-webkit-appearance:none;box-shadow:inset 0 0 0 2px var(--ht-accent-color)}.handsontable .bottomSelectionHandle,.handsontable .bottomSelectionHandle-HitArea,.handsontable .topSelectionHandle,.handsontable .topSelectionHandle-HitArea{inset-inline-end:unset;inset-inline-start:-10000px;top:-10000px;z-index:9999}.handsontable.hide-tween{-webkit-animation:opacity-hide .2s;animation:opacity-hide .2s;animation-fill-mode:forwards;-webkit-animation-fill-mode:forwards}.handsontable.show-tween{-webkit-animation:opacity-show .3s;animation:opacity-show .3s;animation-fill-mode:forwards;-webkit-animation-fill-mode:forwards}.ht_clone_master{z-index:100}.ht_clone_inline_start{z-index:120}.ht_clone_bottom{z-index:130}.ht_clone_bottom_inline_start_corner{z-index:150}.ht_clone_top{z-index:160}.ht_clone_top_inline_start_corner{z-index:180}.ht_editor_hidden{z-index:-1}.ht_editor_visible{z-index:200}.handsontable td.area{position:relative}.handsontable td.area:before{background:var(--ht-cell-selection-background-color,#1a42e8);content:"";inset:0;position:absolute}.handsontable td.area-1{position:relative}.handsontable td.area-1:before{background:var(--ht-cell-selection-background-color,#1a42e8);content:"";inset:0;position:absolute}.handsontable td.area-2{position:relative}.handsontable td.area-2:before{background:var(--ht-cell-selection-background-color,#1a42e8);content:"";inset:0;position:absolute}.handsontable td.area-3{position:relative}.handsontable td.area-3:before{background:var(--ht-cell-selection-background-color,#1a42e8);content:"";inset:0;position:absolute}.handsontable td.area-4{position:relative}.handsontable td.area-4:before{background:var(--ht-cell-selection-background-color,#1a42e8);content:"";inset:0;position:absolute}.handsontable td.area-5{position:relative}.handsontable td.area-5:before{background:var(--ht-cell-selection-background-color,#1a42e8);content:"";inset:0;position:absolute}.handsontable td.area-6{position:relative}.handsontable td.area-6:before{background:var(--ht-cell-selection-background-color,#1a42e8);content:"";inset:0;position:absolute}.handsontable td.area-7{position:relative}.handsontable td.area-7:before{background:var(--ht-cell-selection-background-color,#1a42e8);content:"";inset:0;position:absolute}.handsontable td.area:before{opacity:.14}.handsontable td.area-1:before{opacity:.21}.handsontable td.area-2:before{opacity:.28}.handsontable td.area-3:before{opacity:.35}.handsontable td.area-4:before{opacity:.42}.handsontable td.area-5:before{opacity:.49}.handsontable td.area-6:before{opacity:.56}.handsontable td.area-7:before{opacity:.63}.handsontable td.area{border-color:color-mix(in srgb,var(--ht-border-color),var(--ht-foreground-color) 10%)}.handsontable .wtBorder{font-size:0;position:absolute}.handsontable .wtBorder.hidden{display:none!important}.handsontable .wtBorder.current{z-index:10}.handsontable .wtBorder.area,.handsontable .wtBorder.current{background-color:var(--ht-cell-selection-border-color)!important}.handsontable .wtBorder.area{z-index:8}.handsontable .wtBorder.fill{background-color:var(--ht-cell-autofill-fill-border-color,#68696c)!important;z-index:6}.handsontable .wtBorder.corner{background-color:var(--ht-cell-autofill-background-color,#1a42e8)!important;border-color:var(--ht-cell-autofill-border-color)!important;border-radius:var(--ht-cell-autofill-border-radius)!important;cursor:crosshair;font-size:0;z-index:10}.hot-display-license-info{background-color:var(--ht-license-background-color,#f7f7f9);border:1px solid var(--ht-border-color,#f7f7f9);border-radius:var(--ht-wrapper-border-radius);color:var(--ht-license-foreground-color);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Helvetica Neue,Arial,sans-serif;font-size:calc(var(--ht-font-size) - 2px);line-height:calc(var(--ht-line-height) - 2px);margin-top:10px;padding:var(--ht-license-vertical-padding,16px) var(--ht-license-horizontal-padding,16px);text-align:left}.hot-display-license-info a{color:var(--ht-link-color);font-size:var(--ht-license-font-size)}.hot-display-license-info a:hover{color:var(--ht-link-hover-color)}.handsontable .htAutocompleteArrow{cursor:default;float:right;font-size:0;height:var(--ht-icon-size);margin-inline-start:calc(var(--ht-gap-size)*2);position:relative;top:calc((var(--ht-line-height) - var(--ht-icon-size))/2);width:var(--ht-icon-size)}.handsontable .htAutocompleteArrow:after{content:"";display:block;left:0;opacity:.6;position:absolute;top:0}[dir=rtl].handsontable .htAutocompleteArrow{float:left}.handsontable .htCheckboxRendererInput{appearance:none;cursor:pointer;display:inline-block;height:var(--ht-checkbox-size);margin:-2px 0 0;position:relative;vertical-align:middle;width:var(--ht-checkbox-size)}.handsontable .htCheckboxRendererInput:first-child{margin-inline-end:var(--ht-gap-size)}.handsontable .htCheckboxRendererInput:last-child{margin-inline-start:var(--ht-gap-size)}.handsontable .htCheckboxRendererInput:before{background-color:var(--ht-checkbox-background-color);border:1px solid var(--ht-checkbox-border-color);border-radius:var(--ht-checkbox-border-radius);box-sizing:border-box;content:"";display:inline-block;height:var(--ht-checkbox-size);pointer-events:none;transition:all var(--ht-table-transition) ease-in-out;width:var(--ht-checkbox-size)}.handsontable .htCheckboxRendererInput:after{color:var(--ht-checkbox-icon-color);content:"";display:block;left:0;pointer-events:none;position:absolute;top:0}.handsontable .htCheckboxRendererInput:checked:before{background-color:var(--ht-checkbox-checked-background-color);border-color:var(--ht-checkbox-checked-border-color)}.handsontable .htCheckboxRendererInput:checked:after{color:var(--ht-checkbox-checked-icon-color)}.handsontable .htCheckboxRendererInput:checked:disabled:before{background-color:var(--ht-checkbox-checked-disabled-background-color);border-color:var(--ht-checkbox-checked-disabled-border-color)}.handsontable .htCheckboxRendererInput:checked:disabled:after{color:var(--ht-checkbox-checked-disabled-icon-color)}.handsontable .htCheckboxRendererInput:checked:focus:before{background-color:var(--ht-checkbox-checked-focus-background-color);border-color:var(--ht-checkbox-checked-focus-border-color);outline:1px solid var(--ht-checkbox-checked-focus-ring-color)}.handsontable .htCheckboxRendererInput:checked:focus:after{color:var(--ht-checkbox-checked-focus-icon-color)}.handsontable .htCheckboxRendererInput:focus:before{background-color:var(--ht-checkbox-focus-background-color);border-color:var(--ht-checkbox-focus-border-color);outline:1px solid var(--ht-checkbox-focus-ring-color)}.handsontable .htCheckboxRendererInput:focus:after{color:var(--ht-checkbox-focus-icon-color)}.handsontable .htCheckboxRendererInput:disabled{cursor:auto}.handsontable .htCheckboxRendererInput:disabled:before{background-color:var(--ht-checkbox-disabled-background-color);border-color:var(--ht-checkbox-disabled-border-color)}.handsontable .htCheckboxRendererInput:disabled:after{color:var(--ht-checkbox-disabled-icon-color)}.handsontable .htCheckboxRendererInput:indeterminate:before{background-color:red}.handsontable .htCheckboxRendererInput.noValue{opacity:.5}.handsontable .htCheckboxRendererLabel{color:inherit;cursor:pointer;display:inline-block;font-size:inherit;line-height:inherit;margin:0;position:relative}.handsontable .htCheckboxRendererLabel.fullWidth{width:100%}.handsontable .htPlaceholder{color:var(--ht-placeholder-color)}.handsontable .htDimmed{color:var(--ht-read-only-color)}.handsontable .htLeft{text-align:left}.handsontable .htCenter{text-align:center}.handsontable .htRight{text-align:right}.handsontable .htJustify{text-align:justify}.handsontable .htTop{vertical-align:top}.handsontable .htMiddle{vertical-align:middle}.handsontable .htBottom{vertical-align:bottom}.handsontable .htInvalid{background-color:var(--ht-cell-error-background-color)!important}.handsontable .htNoWrap{white-space:nowrap}.handsontable .htSearchResult{background:var(--ht-cell-success-background-color)!important}.handsontableInputHolder{left:0;position:absolute;top:0}.handsontableInputHolder .handsontableInput{-webkit-appearance:none!important;background-color:var(--ht-cell-editor-background-color,#fff);border:none;box-shadow:inset 0 0 0 var(--ht-cell-editor-border-width,2px) var(--ht-cell-editor-border-color,#1a42e8),0 0 var(--ht-cell-editor-shadow-blur-radius,0) 0 var(--ht-cell-editor-shadow-color,transparent);box-sizing:border-box;color:var(--ht-cell-editor-foreground-color);display:block;font-family:inherit!important;font-size:inherit!important;line-height:inherit!important;margin:0;outline-width:0;padding:calc(var(--ht-cell-vertical-padding, 4px) + 1px) calc(var(--ht-cell-horizontal-padding, 8px) + 1px)}.handsontableInputHolder .handsontableInput:focus{outline:none}.htSelectEditor{position:absolute}.htSelectEditor select{-webkit-appearance:none!important;background-color:var(--ht-cell-editor-background-color,#fff);border:none;box-shadow:inset 0 0 0 var(--ht-cell-editor-border-width,2px) var(--ht-cell-editor-border-color,#1a42e8),0 0 var(--ht-cell-editor-shadow-blur-radius,0) 0 var(--ht-cell-editor-shadow-color,transparent);box-sizing:border-box;color:var(--ht-cell-editor-foreground-color);font-family:inherit!important;font-size:inherit!important;height:100%;inset:0;line-height:inherit!important;margin:0;overflow:hidden;padding:calc(var(--ht-cell-vertical-padding, 4px) + 1px) calc(var(--ht-cell-horizontal-padding, 8px) + 1px);padding-inline-end:26px;position:absolute;text-overflow:ellipsis;white-space:nowrap;width:100%}.htSelectEditor select:focus{outline:none}.htSelectEditor .htAutocompleteArrow{margin-inline-end:4px;pointer-events:none;top:50%;transform:translateY(-50%);z-index:1}.handsontable.listbox{border:var(--ht-menu-border-width,1px) solid var(--ht-menu-border-color,#e5e5e9);box-shadow:var(--ht-menu-shadow-x,0) var(--ht-menu-shadow-y,0) var(--ht-menu-shadow-blur,8px) var(--ht-menu-shadow-color,rgba(0,0,0,.08));margin:0}.handsontable.listbox .ht_master{background-color:var(--ht-background-color);overflow:hidden}.handsontable.listbox .wtHolder{overflow:auto}.handsontable.listbox .htCore,.handsontable.listbox .wtHider{border-radius:0!important}.handsontable.listbox table{overflow:hidden}.handsontable.listbox table td,.handsontable.listbox table th,.handsontable.listbox table tr:first-child td,.handsontable.listbox table tr:first-child th,.handsontable.listbox table tr:last-child th{border-color:transparent!important}.handsontable.listbox table td,.handsontable.listbox table th{border-radius:0!important;text-overflow:ellipsis;white-space:nowrap}.handsontable.listbox table td.htDimmed{color:inherit;cursor:default;font-style:inherit}.handsontable.listbox table .wtBorder{visibility:hidden}.handsontable.listbox table strong{color:inherit;font-weight:700}.handsontable.listbox table tr td.current,.handsontable.listbox table tr td:hover,.handsontable.listbox table tr:hover td{background:var(--ht-menu-item-hover-color,#e5e5e9);cursor:pointer}.handsontable.listbox table thead th{border-width:0 1px 1px;height:auto!important;text-align:left}.handsontable.listbox table thead th>div{padding-bottom:8px;padding-top:8px}.handsontable.listbox table thead th:first-child{padding-left:8px}.handsontable.listbox .ht_clone_top .wtHider{overflow:hidden}.handsontable.listbox .ht_clone_top table{border-radius:0}.handsontable.listbox .htBorders div{background:none!important}.handsontable.autocompleteEditor tr.ht__row_even td,.handsontable.autocompleteEditor tr.ht__row_even th,.handsontable.autocompleteEditor tr.ht__row_odd td,.handsontable.autocompleteEditor tr.ht__row_odd th{background-color:var(--ht-background-color,#fff)}.pika-single{background:var(--ht-background-color,#fff);border:var(--ht-menu-border-width,1px) solid var(--ht-menu-border-color,#e5e5e9);border-radius:var(--ht-menu-border-radius);box-shadow:var(--ht-menu-shadow-x,0) var(--ht-menu-shadow-y,0) var(--ht-menu-shadow-blur,8px) var(--ht-menu-shadow-color,rgba(0,0,0,.08));color:var(--ht-foreground-color);display:block;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Helvetica Neue,Arial,sans-serif;font-size:var(--ht-font-size);font-weight:var(--ht-font-weight);line-height:var(--ht-line-height);padding:10px;position:relative;z-index:9999}.pika-single.is-hidden{display:none}.pika-single .pika-row{background-color:transparent}.pika-single .pika-title{align-items:center;display:flex;justify-content:center}.pika-single .pika-label{color:var(--ht-accent-color);order:2;padding:5px;position:relative}.pika-single .pika-label .pika-select{cursor:pointer;inset:0;opacity:0;position:absolute}.pika-single .pika-next,.pika-single .pika-prev{background:none;border:none;color:var(--ht-accent-color);cursor:pointer;height:20px;text-indent:-9999px;white-space:nowrap;width:20px}.pika-single .pika-prev{margin-right:auto;order:1}.pika-single .pika-next{margin-left:auto;order:3}.pika-single .pika-table thead{height:50px}.pika-single .pika-table th{padding:1px;vertical-align:middle}.pika-single .pika-table th abbr{border:none;cursor:auto;font-weight:400;text-decoration:none}.pika-single .pika-table td{padding:1px;vertical-align:middle}.pika-single .pika-table td.is-disabled .pika-button{opacity:.5;pointer-events:none}.pika-single .pika-table td.is-today .pika-button{background:var(--ht-menu-item-hover-color)}.pika-single .pika-table td.is-selected .pika-button{background:var(--ht-accent-color,#1a42e8);color:var(--ht-background-color,#fff)}.pika-single .pika-table td.pika-week{text-align:center;width:12.5%}.pika-single .pika-table .pika-button{aspect-ratio:1/1;background:transparent;border:none;border-radius:var(--ht-button-border-radius);color:var(--ht-foreground-color);cursor:pointer;font-size:inherit;margin:0;padding:10px;width:100%}.pika-single .pika-table .pika-button:hover{background:var(--ht-menu-item-hover-color)}[dir=rtl].htDatepickerHolder .pika-single .pika-next{margin-left:0;margin-right:auto;transform:rotate(180deg)}[dir=rtl].htDatepickerHolder .pika-single .pika-prev{margin-left:auto;margin-right:0;transform:rotate(180deg)}.handsontable .htUISelectCaption{background-color:var(--ht-input-background-color);border:var(--ht-input-border-width) solid var(--ht-input-border-color);border-radius:var(--ht-input-border-radius);box-sizing:border-box;color:var(--ht-input-foreground-color);cursor:pointer;font-family:inherit;font-size:var(--ht-font-size);font-weight:var(--ht-font-weight);line-height:var(--ht-line-height);margin:0;outline:none!important;overflow:hidden;padding:var(--ht-input-vertical-padding) var(--ht-input-horizontal-padding);padding-inline-end:calc(var(--ht-input-horizontal-padding) + var(--ht-icon-size));text-overflow:ellipsis;white-space:nowrap;width:100%}.handsontable .htUISelectCaption:after{content:"";display:block;position:absolute;right:calc(var(--ht-input-horizontal-padding) - var(--ht-icon-size)/4);top:50%;transform:translateY(-50%)}.handsontable .htUISelectCaption:hover{background-color:var(--ht-input-hover-background-color);border-color:var(--ht-input-hover-border-color);color:var(--ht-input-hover-foreground-color)}.handsontable .htUISelectCaption:disabled{background-color:var(--ht-input-disabled-background-color);border-color:var(--ht-input-disabled-border-color);color:var(--ht-input-disabled-foreground-color)}.handsontable .htUISelectCaption:focus{background-color:var(--ht-input-focus-background-color);border-color:var(--ht-input-focus-border-color);color:var(--ht-input-focus-foreground-color)}.handsontable .htUISelect{cursor:pointer;outline:none!important;position:relative}.handsontable .htUISelect:focus .htUISelectCaption{background-color:var(--ht-input-focus-background-color);border-color:var(--ht-input-focus-border-color);color:var(--ht-input-focus-foreground-color)}[dir=rtl].handsontable .htUISelectCaption:after{left:calc(var(--ht-input-horizontal-padding) - var(--ht-icon-size)/4);right:auto}.handsontable .htFiltersMenuCondition .htUIInput input,.handsontable .htFiltersMenuValue .htUIMultipleSelectSearch input{background-color:var(--ht-input-background-color);border:var(--ht-input-border-width) solid var(--ht-input-border-color);border-radius:var(--ht-input-border-radius);box-sizing:border-box;color:var(--ht-input-foreground-color);cursor:pointer;font-family:inherit;font-size:var(--ht-font-size);font-weight:var(--ht-font-weight);line-height:var(--ht-line-height);outline:none!important;padding:var(--ht-input-vertical-padding) var(--ht-input-horizontal-padding);transition:var(--ht-table-transition) all ease-in-out;width:100%}.handsontable .htFiltersMenuCondition .htUIInput input:hover,.handsontable .htFiltersMenuValue .htUIMultipleSelectSearch input:hover{background-color:var(--ht-input-hover-background-color);border-color:var(--ht-input-hover-border-color);color:var(--ht-input-hover-foreground-color)}.handsontable .htFiltersMenuCondition .htUIInput input:disabled,.handsontable .htFiltersMenuValue .htUIMultipleSelectSearch input:disabled{background-color:var(--ht-input-disabled-background-color);border-color:var(--ht-input-disabled-border-color);color:var(--ht-input-disabled-foreground-color)}.handsontable .htFiltersMenuCondition .htUIInput input:focus,.handsontable .htFiltersMenuValue .htUIMultipleSelectSearch input:focus{background-color:var(--ht-input-focus-background-color);border-color:var(--ht-input-focus-border-color);color:var(--ht-input-focus-foreground-color)}.handsontable .htUIInput{outline:none!important;padding:0;position:relative;text-align:center}.handsontable .htUIInputIcon{position:absolute}.handsontable .htUIInput.htUIButton{cursor:pointer;display:inline-block}.handsontable .htUIInput.htUIButton input{background-color:var(--ht-secondary-button-background-color);border:1px solid var(--ht-secondary-button-border-color);border-radius:var(--ht-button-border-radius);box-sizing:border-box;color:var(--ht-secondary-button-foreground-color);cursor:pointer;font-family:inherit;font-size:var(--ht-font-size);font-weight:var(--ht-font-weight);line-height:var(--ht-line-height);min-width:64px;outline:none!important;padding:var(--ht-button-vertical-padding) var(--ht-button-horizontal-padding);transition:var(--ht-table-transition) all ease-in-out}.handsontable .htUIInput.htUIButton input:hover{background-color:var(--ht-secondary-button-hover-background-color);border-color:var(--ht-secondary-button-hover-border-color);color:var(--ht-secondary-button-hover-foreground-color)}.handsontable .htUIInput.htUIButton input:disabled{background-color:var(--ht-secondary-button-disabled-background-color);border-color:var(--ht-secondary-button-disabled-border-color);color:var(--ht-secondary-button-disabled-foreground-color)}.handsontable .htUIInput.htUIButton input:focus{background-color:var(--ht-secondary-button-focus-background-color);border-color:var(--ht-secondary-button-focus-border-color);box-shadow:0 0 0 1px var(--ht-accent-color);color:var(--ht-secondary-button-focus-foreground-color)}.handsontable .htUIInput.htUIButtonOK{margin-inline-end:calc(var(--ht-gap-size, 2px)*2);margin-inline-start:0}.handsontable .htUIInput.htUIButtonOK input{background-color:var(--ht-primary-button-background-color);border-color:var(--ht-primary-button-border-color);color:var(--ht-primary-button-foreground-color)}.handsontable .htUIInput.htUIButtonOK input:hover{background-color:var(--ht-primary-button-hover-background-color);border-color:var(--ht-primary-button-hover-border-color);color:var(--ht-primary-button-hover-foreground-color)}.handsontable .htUIInput.htUIButtonOK input:disabled{background-color:var(--ht-primary-button-disabled-background-color);border-color:var(--ht-primary-button-disabled-border-color);color:var(--ht-primary-button-disabled-foreground-color)}.handsontable .htUIInput.htUIButtonOK input:focus{background-color:var(--ht-primary-button-focus-background-color);border-color:var(--ht-primary-button-focus-border-color);box-shadow:0 0 0 1px var(--ht-accent-color);color:var(--ht-primary-button-focus-foreground-color)}.handsontable .htUIRadio{align-items:center;cursor:pointer;display:inline-flex;gap:var(--ht-gap-size);margin:0;padding:var(--ht-gap-size) calc(var(--ht-gap-size)*2);padding-bottom:0;position:relative}.handsontable .htUIRadio:first-child{padding-inline-start:0}.handsontable .htUIRadio>input[type=radio]{appearance:none;cursor:pointer;height:var(--ht-checkbox-size);margin:0;position:relative;width:var(--ht-checkbox-size)}.handsontable .htUIRadio>input[type=radio]:before{background-color:var(--ht-checkbox-background-color);border:1px solid var(--ht-checkbox-border-color);border-radius:calc(var(--ht-checkbox-size)*.5);content:"";display:block;inset:0;position:absolute}.handsontable .htUIRadio>input[type=radio]:after{color:var(--ht-checkbox-background-color);content:"";display:block;position:absolute}.handsontable .htUIRadio>input[type=radio]:checked:before{border-color:var(--ht-checkbox-checked-border-color)}.handsontable .htUIRadio>input[type=radio]:checked:after{color:var(--ht-checkbox-checked-background-color)}.handsontable .htUIRadio>input[type=radio]:checked:disabled{cursor:auto}.handsontable .htUIRadio>input[type=radio]:checked:disabled:before{border-color:var(--ht-checkbox-checked-disabled-border-color)}.handsontable .htUIRadio>input[type=radio]:checked:disabled:after{color:var(--ht-checkbox-checked-disabled-background-color)}.handsontable .htUIRadio>input[type=radio]:checked:focus:before{border-color:var(--ht-checkbox-checked-focus-background-color)}.handsontable .htUIRadio>input[type=radio]:checked:focus:after{color:var(--ht-checkbox-checked-focus-background-color)}.handsontable .htUIRadio>input[type=radio]:disabled{cursor:auto}.handsontable .htUIRadio>input[type=radio]:disabled:before{border-color:var(--ht-checkbox-disabled-border-color)}.handsontable .htUIRadio>input[type=radio]:disabled:after{color:var(--ht-checkbox-disabled-background-color)}.handsontable .htUIRadio>input[type=radio]:focus:before{border-color:var(--ht-checkbox-focus-background-color)}.handsontable .htUIRadio>input[type=radio]:focus:after{color:var(--ht-checkbox-focus-background-color)}.handsontable .htUIRadio label{color:inherit;cursor:pointer;vertical-align:middle}.handsontable .htUIRadio label:before{content:"";display:block;inset:0;position:absolute}.handsontable .collapsibleIndicator{margin-inline-start:var(--ht-gap-size);top:calc((var(--ht-line-height) - var(--ht-icon-size))/2)}.handsontable .collapsibleIndicator,.handsontable .ht_nestingButton{border-radius:var(--ht-collapse-button-border-radius);box-sizing:border-box;cursor:pointer;float:right;font-size:0;height:var(--ht-icon-size);overflow:hidden;position:relative;text-indent:-100px;width:var(--ht-icon-size)}.handsontable .collapsibleIndicator:before,.handsontable .ht_nestingButton:before{content:"";display:block;left:0;position:absolute;top:0;transition:var(--ht-table-transition) all ease-in-out}.handsontable .collapsibleIndicator.expanded,.handsontable .collapsibleIndicator.ht_nestingCollapse,.handsontable .ht_nestingButton.expanded,.handsontable .ht_nestingButton.ht_nestingCollapse{background-color:var(--ht-collapse-button-open-background-color);box-shadow:0 0 0 1px var(--ht-collapse-button-open-border-color)}.handsontable .collapsibleIndicator.expanded:before,.handsontable .collapsibleIndicator.ht_nestingCollapse:before,.handsontable .ht_nestingButton.expanded:before,.handsontable .ht_nestingButton.ht_nestingCollapse:before{color:var(--ht-collapse-button-open-icon-color)}.handsontable .collapsibleIndicator.expanded:hover,.handsontable .collapsibleIndicator.ht_nestingCollapse:hover,.handsontable .ht_nestingButton.expanded:hover,.handsontable .ht_nestingButton.ht_nestingCollapse:hover{background-color:var(--ht-collapse-button-open-hover-background-color);box-shadow:0 0 0 1px var(--ht-collapse-button-open-hover-border-color)}.handsontable .collapsibleIndicator.expanded:hover:before,.handsontable .collapsibleIndicator.ht_nestingCollapse:hover:before,.handsontable .ht_nestingButton.expanded:hover:before,.handsontable .ht_nestingButton.ht_nestingCollapse:hover:before{color:var(--ht-collapse-button-open-hover-icon-color)}.handsontable .collapsibleIndicator.collapsed,.handsontable .collapsibleIndicator.ht_nestingExpand,.handsontable .ht_nestingButton.collapsed,.handsontable .ht_nestingButton.ht_nestingExpand{background-color:var(--ht-collapse-button-close-background-color);box-shadow:0 0 0 1px var(--ht-collapse-button-close-border-color)}.handsontable .collapsibleIndicator.collapsed:before,.handsontable .collapsibleIndicator.ht_nestingExpand:before,.handsontable .ht_nestingButton.collapsed:before,.handsontable .ht_nestingButton.ht_nestingExpand:before{color:var(--ht-collapse-button-close-icon-color)}.handsontable .collapsibleIndicator.collapsed:hover,.handsontable .collapsibleIndicator.ht_nestingExpand:hover,.handsontable .ht_nestingButton.collapsed:hover,.handsontable .ht_nestingButton.ht_nestingExpand:hover{background-color:var(--ht-collapse-button-close-hover-background-color);box-shadow:0 0 0 1px var(--ht-collapse-button-close-hover-border-color)}.handsontable .collapsibleIndicator.collapsed:hover:before,.handsontable .collapsibleIndicator.ht_nestingExpand:hover:before,.handsontable .ht_nestingButton.collapsed:hover:before,.handsontable .ht_nestingButton.ht_nestingExpand:hover:before{color:var(--ht-collapse-button-close-hover-icon-color)}.handsontable th.ht__active_highlight .collapsibleIndicator.collapsed:before,.handsontable th.ht__active_highlight .collapsibleIndicator.ht_nestingExpand:before,.handsontable th.ht__active_highlight .ht_nestingButton.collapsed:before,.handsontable th.ht__active_highlight .ht_nestingButton.ht_nestingExpand:before{color:var(--ht-collapse-button-close-icon-active-color)}.handsontable th.ht__active_highlight .collapsibleIndicator.collapsed:hover:before,.handsontable th.ht__active_highlight .collapsibleIndicator.ht_nestingExpand:hover:before,.handsontable th.ht__active_highlight .ht_nestingButton.collapsed:hover:before,.handsontable th.ht__active_highlight .ht_nestingButton.ht_nestingExpand:hover:before{color:var(--ht-collapse-button-close-hover-icon-active-color)}.handsontable th.ht__active_highlight .collapsibleIndicator.expanded:before,.handsontable th.ht__active_highlight .collapsibleIndicator.ht_nestingCollapse:before,.handsontable th.ht__active_highlight .ht_nestingButton.expanded:before,.handsontable th.ht__active_highlight .ht_nestingButton.ht_nestingCollapse:before{color:var(--ht-collapse-button-open-icon-active-color)}.handsontable th.ht__active_highlight .collapsibleIndicator.expanded:hover:before,.handsontable th.ht__active_highlight .collapsibleIndicator.ht_nestingCollapse:hover:before,.handsontable th.ht__active_highlight .ht_nestingButton.expanded:hover:before,.handsontable th.ht__active_highlight .ht_nestingButton.ht_nestingCollapse:hover:before{color:var(--ht-collapse-button-open-hover-icon-active-color)}[dir=rtl].handsontable .collapsibleIndicator,[dir=rtl].handsontable .ht_nestingButton{float:left}.handsontable thead th.hiddenHeader:not(:first-of-type){display:none}.handsontable thead th.hiddenHeaderText .colHeader{opacity:0}.handsontable th.ht_nestingLevels>.relative{align-items:center;display:flex;gap:5px}.handsontable th.ht_nestingLevels span:last-child{padding-left:calc(var(--ht-icon-size) + 5px)}.handsontable th.ht_nestingLevels span.ht_nestingLevel{display:inline-block}.handsontable th.ht_nestingLevels span.ht_nestingLevel_empty{display:inline-block;height:1px;order:-2;position:relative;width:5px}.handsontable th.ht_nestingLevels .ht_nestingButton{cursor:pointer;order:-1;position:relative}.handsontable th.afterHiddenColumn,.handsontable th.beforeHiddenColumn{position:relative}.handsontable th.afterHiddenColumn:after,.handsontable th.afterHiddenColumn:before,.handsontable th.beforeHiddenColumn:after,.handsontable th.beforeHiddenColumn:before{color:var(--ht-hidden-indicator-color);height:10px!important;position:absolute;top:50%;transform:translateY(-50%);width:10px!important}.handsontable th.beforeHiddenColumn:after{content:"";display:block;right:-2px}.handsontable th.afterHiddenColumn:before{content:"";display:block;left:-2px}.handsontable th.ht__active_highlight.afterHiddenColumn:after,.handsontable th.ht__active_highlight.afterHiddenColumn:before,.handsontable th.ht__active_highlight.beforeHiddenColumn:after,.handsontable th.ht__active_highlight.beforeHiddenColumn:before{color:var(--ht-icon-active-button-icon-color)}[dir=rtl].handsontable th.beforeHiddenColumn:after{left:-2px;right:auto;transform:translateY(-50%) rotate(180deg)}[dir=rtl].handsontable th.afterHiddenColumn:before{left:auto;right:-2px;transform:translateY(-50%) rotate(180deg)}.handsontable th.afterHiddenRow,.handsontable th.beforeHiddenRow{position:relative}.handsontable th.afterHiddenRow:after,.handsontable th.afterHiddenRow:before,.handsontable th.beforeHiddenRow:after,.handsontable th.beforeHiddenRow:before{color:var(--ht-hidden-indicator-color);height:10px!important;left:50%;position:absolute;transform:translateX(-50%);width:10px!important}.handsontable th.beforeHiddenRow:after{bottom:-2px;content:"";display:block}.handsontable th.afterHiddenRow:before{content:"";display:block;top:-2px}.handsontable th.ht__active_highlight.afterHiddenRow:after,.handsontable th.ht__active_highlight.afterHiddenRow:before,.handsontable th.ht__active_highlight.beforeHiddenRow:after,.handsontable th.ht__active_highlight.beforeHiddenRow:before{color:var(--ht-icon-active-button-icon-color)}.handsontable .changeType{background-color:var(--ht-icon-button-background-color);border:none;border-radius:var(--ht-icon-button-border-radius);box-shadow:0 0 0 1px var(--ht-icon-button-border-color);box-sizing:border-box;color:inherit;float:right;height:var(--ht-icon-size);margin:0;margin-inline-start:var(--ht-gap-size);order:1;padding:0;position:relative;top:calc((var(--ht-line-height) - var(--ht-icon-size))/2);width:var(--ht-icon-size);z-index:1}.handsontable .changeType:before{color:var(--ht-icon-button-icon-color);content:"";display:block;left:0;position:absolute;top:0}.handsontable .changeType:hover{background-color:var(--ht-icon-button-hover-background-color);box-shadow:0 0 0 1px var(--ht-icon-button-hover-border-color);cursor:pointer}.handsontable .changeType:hover:before{color:var(--ht-icon-button-hover-icon-color)}.handsontable .ht__active_highlight .changeType{background-color:var(--ht-icon-active-button-background-color);box-shadow:0 0 0 1px var(--ht-icon-active-button-border-color)}.handsontable .ht__active_highlight .changeType:before{color:var(--ht-icon-active-button-icon-color)}.handsontable .ht__active_highlight .changeType:hover{background-color:var(--ht-icon-active-button-hover-background-color);box-shadow:0 0 0 1px var(--ht-icon-active-button-hover-border-color)}.handsontable .ht__active_highlight .changeType:hover:before{color:var(--ht-icon-active-button-hover-icon-color)}.handsontable th.htFiltersActive{background-color:var(--ht-header-filter-background-color)}.handsontable th.htFiltersActive.ht__active_highlight{background-color:color-mix(in srgb,var(--ht-header-active-background-color),var(--ht-header-filter-background-color) 20%)}.handsontable th.htFiltersActive.ht__active_highlight .changeType:after{background-color:var(--ht-header-active-foreground-color)}.handsontable.htContextMenu>.ht_master,.handsontable.htDropdownMenu>.ht_master,.handsontable.htFiltersConditionsMenu>.ht_master{background-color:var(--ht-background-color,#fff);border:var(--ht-menu-border-width,1px) solid var(--ht-menu-border-color,#e5e5e9);border-radius:var(--ht-menu-border-radius);box-shadow:var(--ht-menu-shadow-x,0) var(--ht-menu-shadow-y,0) var(--ht-menu-shadow-blur,8px) var(--ht-menu-shadow-color,rgba(0,0,0,.08));overflow:hidden;padding:var(--ht-menu-vertical-padding,8px) var(--ht-menu-horizontal-padding,0)}.handsontable.htContextMenu:not(.htGhostTable),.handsontable.htDropdownMenu:not(.htGhostTable),.handsontable.htFiltersConditionsMenu:not(.htGhostTable){display:none;position:absolute;z-index:1060}.handsontable.htContextMenu .ht_clone_bottom,.handsontable.htContextMenu .ht_clone_bottom_inline_start_corner,.handsontable.htContextMenu .ht_clone_inline_start,.handsontable.htContextMenu .ht_clone_top,.handsontable.htContextMenu .ht_clone_top_inline_start_corner,.handsontable.htDropdownMenu .ht_clone_bottom,.handsontable.htDropdownMenu .ht_clone_bottom_inline_start_corner,.handsontable.htDropdownMenu .ht_clone_inline_start,.handsontable.htDropdownMenu .ht_clone_top,.handsontable.htDropdownMenu .ht_clone_top_inline_start_corner,.handsontable.htFiltersConditionsMenu .ht_clone_bottom,.handsontable.htFiltersConditionsMenu .ht_clone_bottom_inline_start_corner,.handsontable.htFiltersConditionsMenu .ht_clone_inline_start,.handsontable.htFiltersConditionsMenu .ht_clone_top,.handsontable.htFiltersConditionsMenu .ht_clone_top_inline_start_corner{display:none}.handsontable.htContextMenu table.htCore,.handsontable.htDropdownMenu table.htCore,.handsontable.htFiltersConditionsMenu table.htCore{overflow:hidden}.handsontable.htContextMenu .htCustomMenuRenderer .table.htCore,.handsontable.htDropdownMenu .htCustomMenuRenderer .table.htCore,.handsontable.htFiltersConditionsMenu .htCustomMenuRenderer .table.htCore{box-shadow:none}.handsontable.htContextMenu.handsontable:focus,.handsontable.htDropdownMenu.handsontable:focus,.handsontable.htFiltersConditionsMenu.handsontable:focus{outline:none}.handsontable.htContextMenu .wtBorder,.handsontable.htDropdownMenu .wtBorder,.handsontable.htFiltersConditionsMenu .wtBorder{visibility:hidden}.handsontable.htContextMenu table tbody tr td,.handsontable.htDropdownMenu table tbody tr td,.handsontable.htFiltersConditionsMenu table tbody tr td{background:var(--ht-background-color,#fff);border-width:0;cursor:pointer;overflow:hidden;padding:var(--ht-menu-item-vertical-padding,4px) var(--ht-menu-item-horizontal-padding,8px);position:relative;text-overflow:ellipsis;transition:background calc(var(--ht-table-transition)*.5) ease-in-out;white-space:nowrap}.handsontable.htContextMenu table tbody tr td:first-child,.handsontable.htDropdownMenu table tbody tr td:first-child,.handsontable.htFiltersConditionsMenu table tbody tr td:first-child{border-bottom-width:0;border-inline-end-width:0;border-inline-start-width:0;border-top-width:0}.handsontable.htContextMenu table tbody tr td.htDimmed,.handsontable.htDropdownMenu table tbody tr td.htDimmed,.handsontable.htFiltersConditionsMenu table tbody tr td.htDimmed{color:var(--ht-foreground-color);font-style:normal}.handsontable.htContextMenu table tbody tr td:not(.handsontable.htDropdownMenu table tbody tr td.htCustomMenuRenderer,.handsontable.htDropdownMenu table tbody tr td.htDisabled,.handsontable.htContextMenu table tbody tr td.htCustomMenuRenderer,.handsontable.htContextMenu table tbody tr td.htDisabled,.handsontable.htFiltersConditionsMenu table tbody tr td.htCustomMenuRenderer,.handsontable.htFiltersConditionsMenu table tbody tr td.htDisabled).current,.handsontable.htContextMenu table tbody tr td:not(.handsontable.htDropdownMenu table tbody tr td.htCustomMenuRenderer,.handsontable.htDropdownMenu table tbody tr td.htDisabled,.handsontable.htContextMenu table tbody tr td.htCustomMenuRenderer,.handsontable.htContextMenu table tbody tr td.htDisabled,.handsontable.htFiltersConditionsMenu table tbody tr td.htCustomMenuRenderer,.handsontable.htFiltersConditionsMenu table tbody tr td.htDisabled):hover,.handsontable.htDropdownMenu table tbody tr td:not(.handsontable.htDropdownMenu table tbody tr td.htCustomMenuRenderer,.handsontable.htDropdownMenu table tbody tr td.htDisabled,.handsontable.htContextMenu table tbody tr td.htCustomMenuRenderer,.handsontable.htContextMenu table tbody tr td.htDisabled,.handsontable.htFiltersConditionsMenu table tbody tr td.htCustomMenuRenderer,.handsontable.htFiltersConditionsMenu table tbody tr td.htDisabled).current,.handsontable.htDropdownMenu table tbody tr td:not(.handsontable.htDropdownMenu table tbody tr td.htCustomMenuRenderer,.handsontable.htDropdownMenu table tbody tr td.htDisabled,.handsontable.htContextMenu table tbody tr td.htCustomMenuRenderer,.handsontable.htContextMenu table tbody tr td.htDisabled,.handsontable.htFiltersConditionsMenu table tbody tr td.htCustomMenuRenderer,.handsontable.htFiltersConditionsMenu table tbody tr td.htDisabled):hover,.handsontable.htFiltersConditionsMenu table tbody tr td:not(.handsontable.htDropdownMenu table tbody tr td.htCustomMenuRenderer,.handsontable.htDropdownMenu table tbody tr td.htDisabled,.handsontable.htContextMenu table tbody tr td.htCustomMenuRenderer,.handsontable.htContextMenu table tbody tr td.htDisabled,.handsontable.htFiltersConditionsMenu table tbody tr td.htCustomMenuRenderer,.handsontable.htFiltersConditionsMenu table tbody tr td.htDisabled).current,.handsontable.htFiltersConditionsMenu table tbody tr td:not(.handsontable.htDropdownMenu table tbody tr td.htCustomMenuRenderer,.handsontable.htDropdownMenu table tbody tr td.htDisabled,.handsontable.htContextMenu table tbody tr td.htCustomMenuRenderer,.handsontable.htContextMenu table tbody tr td.htDisabled,.handsontable.htFiltersConditionsMenu table tbody tr td.htCustomMenuRenderer,.handsontable.htFiltersConditionsMenu table tbody tr td.htDisabled):hover{background:var(--ht-menu-item-hover-color,#e5e5e9);cursor:pointer}.handsontable.htContextMenu table tbody tr td.htSubmenu .htItemWrapper,.handsontable.htDropdownMenu table tbody tr td.htSubmenu .htItemWrapper,.handsontable.htFiltersConditionsMenu table tbody tr td.htSubmenu .htItemWrapper{margin-inline-end:calc(var(--ht-gap-size, 4px)*2 + var(--ht-icon-size))}.handsontable.htContextMenu table tbody tr td.htSubmenu .htItemWrapper:after,.handsontable.htDropdownMenu table tbody tr td.htSubmenu .htItemWrapper:after,.handsontable.htFiltersConditionsMenu table tbody tr td.htSubmenu .htItemWrapper:after{content:"";display:block;position:absolute;right:calc(var(--ht-menu-item-horizontal-padding) + var(--ht-gap-size)*2);top:50%;transform:translateY(-50%)}.handsontable.htContextMenu table tbody tr td.htSeparator,.handsontable.htDropdownMenu table tbody tr td.htSeparator,.handsontable.htFiltersConditionsMenu table tbody tr td.htSeparator{border-top:1px solid var(--ht-border-color);cursor:default;height:0;padding:0}.handsontable.htContextMenu table tbody tr td.htDisabled,.handsontable.htDropdownMenu table tbody tr td.htDisabled,.handsontable.htFiltersConditionsMenu table tbody tr td.htDisabled{color:var(--ht-disabled-color);cursor:default}.handsontable.htContextMenu table tbody tr td.htDisabled:hover,.handsontable.htDropdownMenu table tbody tr td.htDisabled:hover,.handsontable.htFiltersConditionsMenu table tbody tr td.htDisabled:hover{background:var(--ht-background-color);color:var(--ht-disabled-color)}.handsontable.htContextMenu table tbody tr td.htHidden,.handsontable.htDropdownMenu table tbody tr td.htHidden,.handsontable.htFiltersConditionsMenu table tbody tr td.htHidden{display:none}.handsontable.htContextMenu table tbody tr td:has(.htItemWrapper .selected),.handsontable.htDropdownMenu table tbody tr td:has(.htItemWrapper .selected),.handsontable.htFiltersConditionsMenu table tbody tr td:has(.htItemWrapper .selected){background-color:var(--ht-menu-item-active-color)}.handsontable.htContextMenu table tbody tr td .htItemWrapper,.handsontable.htDropdownMenu table tbody tr td .htItemWrapper,.handsontable.htFiltersConditionsMenu table tbody tr td .htItemWrapper{margin-inline:calc(var(--ht-gap-size, 4px)*2)}.handsontable.htContextMenu table tbody tr td .htItemWrapper:before,.handsontable.htDropdownMenu table tbody tr td .htItemWrapper:before,.handsontable.htFiltersConditionsMenu table tbody tr td .htItemWrapper:before{margin-right:12px;vertical-align:text-bottom}.handsontable.htContextMenu table tbody tr td .htItemWrapper span.selected,.handsontable.htDropdownMenu table tbody tr td .htItemWrapper span.selected,.handsontable.htFiltersConditionsMenu table tbody tr td .htItemWrapper span.selected{font-size:0;inset:0}.handsontable.htContextMenu table tbody tr td .htItemWrapper span.selected:after,.handsontable.htDropdownMenu table tbody tr td .htItemWrapper span.selected:after,.handsontable.htFiltersConditionsMenu table tbody tr td .htItemWrapper span.selected:after{color:var(--ht-accent-color);content:"";display:block;position:absolute;right:calc(var(--ht-menu-item-horizontal-padding) + var(--ht-gap-size)*2);top:50%;transform:translateY(-50%)}.handsontable.htContextMenu table tbody tr td div span.selected,.handsontable.htDropdownMenu table tbody tr td div span.selected,.handsontable.htFiltersConditionsMenu table tbody tr td div span.selected{inset-inline-end:0;position:absolute}.handsontable.htContextMenu table tbody tr td .htUIButton,.handsontable.htDropdownMenu table tbody tr td .htUIButton,.handsontable.htFiltersConditionsMenu table tbody tr td .htUIButton{width:calc(50% - var(--ht-gap-size))}.handsontable.htContextMenu table tbody tr td .htUIButton input,.handsontable.htDropdownMenu table tbody tr td .htUIButton input,.handsontable.htFiltersConditionsMenu table tbody tr td .htUIButton input{width:100%}.handsontable.htContextMenuSub_Alignment,.handsontable.htDropdownMenuSub_Alignment{margin-top:calc(var(--ht-menu-vertical-padding)*-1)}.handsontable .htUIClearAll a,.handsontable .htUISelectAll a{display:inline-block;padding:var(--ht-gap-size);text-decoration:none}.handsontable .htUIMultipleSelect .ht_master .wtHolder{background:transparent;overflow-y:scroll!important}.handsontable .htUIMultipleSelect .ht_master .wtHolder .htCore{box-shadow:none}[dir=rtl].handsontable.htContextMenu table tbody tr td.htSubmenu .htItemWrapper:after,[dir=rtl].handsontable.htDropdownMenu table tbody tr td.htSubmenu .htItemWrapper:after,[dir=rtl].handsontable.htFiltersConditionsMenu table tbody tr td.htSubmenu .htItemWrapper:after{left:calc(var(--ht-gap-size)*4);right:auto;transform:translateY(-50%) rotate(180deg)}[dir=rtl].handsontable.htContextMenu table tbody tr td .htItemWrapper span.selected:after,[dir=rtl].handsontable.htDropdownMenu table tbody tr td .htItemWrapper span.selected:after,[dir=rtl].handsontable.htFiltersConditionsMenu table tbody tr td .htItemWrapper span.selected:after{left:calc(var(--ht-gap-size)*4);right:auto}[dir=rtl].handsontable .changeType{float:left}.handsontable.htFiltersConditionsMenu:not(.htGhostTable){z-index:1070}.handsontable .ht_master table td.htCustomMenuRenderer{cursor:auto}.handsontable .ht_master table td.htCustomMenuRenderer.htFiltersMenuActionBar{padding-top:calc(var(--ht-menu-item-vertical-padding, 4px)*2)}.handsontable .htFiltersMenuLabel{font-size:calc(var(--ht-font-size) - 2px);font-weight:var(--ht-font-weight);line-height:calc(var(--ht-line-height) - 4px);margin-bottom:calc(var(--ht-gap-size, 2px)*2)}.handsontable .htFiltersMenuLabel:empty{display:none}.handsontable .htFiltersMenuCondition{padding-bottom:0!important;padding-top:calc(var(--ht-gap-size, 2px)*3)!important}.handsontable .htFiltersMenuCondition .border{border-bottom:1px solid var(--ht-border-color)!important}.handsontable .htFiltersMenuCondition .htUIInput{margin-top:calc(var(--ht-gap-size, 2px)*2)}.handsontable .htFiltersMenuValue{border-bottom:1px solid var(--ht-border-color)!important;padding-bottom:0!important;padding-top:calc(var(--ht-gap-size, 2px)*3)!important}.handsontable .htFiltersMenuOperators{padding-bottom:0!important;padding-top:calc(var(--ht-gap-size, 2px)*2)!important}.handsontable .htUISelectionControls{margin:0 calc(var(--ht-gap-size, 2px)*-1);padding-bottom:var(--ht-gap-size,2px)!important;padding-top:calc(var(--ht-gap-size, 2px)*2)!important}.handsontable .htUIMultipleSelectHot{--ht-cell-horizontal-padding:calc(var(--ht-menu-item-horizontal-padding, 2px) + var(--ht-gap-size, 2px)*2);margin:0 calc((var(--ht-menu-item-horizontal-padding, 2px) + var(--ht-gap-size, 2px)*2)*-1);overflow:initial!important;width:calc(100% + var(--ht-menu-item-horizontal-padding, 2px)*2 + var(--ht-gap-size, 2px)*4)}.handsontable .htUIMultipleSelectHot:before{background-color:var(--ht-border-color);content:"";display:block;height:1px;left:0;position:absolute;top:-1px;width:100%}.handsontable .htUIMultipleSelectHot .wtHolder{box-sizing:border-box;overflow-x:hidden;padding:0}.handsontable .htUIMultipleSelectHot .wtHolder .wtSpreader{padding:calc(var(--ht-gap-size)*2) 0}.handsontable .htUIMultipleSelectHot .wtHolder td{height:auto;padding:4px var(--ht-cell-horizontal-padding)}.handsontable .htUIClearAll,.handsontable .htUISelectAll{display:inline-block;margin-bottom:var(--ht-gap-size,4px);margin-right:var(--ht-gap-size,4px)}.handsontable .htUIClearAll a,.handsontable .htUISelectAll a{border-radius:var(--ht-button-border-radius);color:var(--ht-link-color);font-size:var(--ht-font-size);line-height:var(--ht-line-height)}.handsontable .htUIClearAll a:hover,.handsontable .htUISelectAll a:hover{color:var(--ht-link-hover-color)}.handsontable .htUIClearAll a:focus,.handsontable .htUISelectAll a:focus{outline:1px solid var(--ht-link-hover-color)}.handsontable .htUIMultipleSelect .ht_master .wtHolder{overflow-y:auto}.handsontable .htUIMultipleSelect .ht_master .wtHolder .htCore,.handsontable .htUIMultipleSelect .ht_master .wtHolder .wtHider,.handsontable .htUIMultipleSelect .ht_master .wtHolder td,.handsontable .htUIMultipleSelect .ht_master .wtHolder tr{background:none}.handsontable .htCommentCell{position:relative}.handsontable .htCommentCell:after{border-inline-end:none;border-inline-start:var(--ht-comments-indicator-size,4px) solid transparent;border-top:var(--ht-comments-indicator-size,4px) solid var(--ht-comments-indicator-color,#1a42e8);content:"";display:block;inset-inline-end:0;inset-inline-start:unset;position:absolute;top:0}.htCommentsContainer .htComments{display:none;position:absolute;z-index:1059}.htCommentsContainer .htCommentTextArea{-webkit-appearance:none;background-color:var(--ht-comments-textarea-background-color,#fff);border:var(--ht-comments-textarea-border-width,1px) solid var(--ht-comments-textarea-border-color,transparent);border-inline-start:var(--ht-comments-textarea-border-width,1px) solid var(--ht-comments-textarea-border-color,#1a42e8);box-shadow:var(--ht-menu-shadow-x,0) var(--ht-menu-shadow-y,0) var(--ht-menu-shadow-blur,8px) var(--ht-menu-shadow-color,rgba(0,0,0,.08));box-sizing:border-box;color:var(--ht-comments-textarea-foreground-color);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Helvetica Neue,Arial,sans-serif;font-size:var(--ht-font-size);font-weight:var(--ht-font-weight);height:88px;line-height:var(--ht-line-height);margin:0 -1px;outline:0!important;padding:var(--ht-comments-textarea-vertical-padding) var(--ht-comments-textarea-horizontal-padding);width:240px}.htCommentsContainer .htCommentTextArea:focus{background-color:var(--ht-comments-textarea-focus-background-color,#fff);border:var(--ht-comments-textarea-focus-border-width,1px) solid var(--ht-comments-textarea-focus-border-color,#1a42e8);color:var(--ht-comments-textarea-focus-foreground-color)}.handsontable .columnSorting{position:relative}.handsontable .columnSorting.sortAction{max-width:calc(100% - var(--ht-icon-size, 16px)*2 - 4px);min-width:calc(var(--ht-icon-size, 16px) + 8px);padding-inline-end:calc(var(--ht-icon-size, 16px) + 2px);padding-inline-start:calc(var(--ht-icon-size, 16px) + 2px)}.handsontable .columnSorting.sortAction:hover{cursor:pointer;text-decoration:none}.handsontable .columnSorting.sortAction:before{content:"";display:block;position:absolute;right:2px;text-align:right;top:50%;transform:translateY(-50%);width:var(--ht-icon-size,16px)}.handsontable .htLeft .columnSorting.sortAction{padding-inline-start:0}.handsontable .htRight .columnSorting.sortAction{padding-inline-end:var(--ht-gap-size,4px);padding-inline-start:var(--ht-icon-size,16px)}.handsontable .htRight .columnSorting.sortAction:before,[dir=rtl] .handsontable .columnSorting.sortAction:before{left:2px;right:auto;text-align:left}[dir=rtl] .handsontable .htRight .columnSorting.sortAction{padding-inline-end:var(--ht-icon-size,16px);padding-inline-start:var(--ht-gap-size,4px)}[dir=rtl] .handsontable .htLeft .columnSorting.sortAction{padding-inline-end:var(--ht-gap-size,4px);padding-inline-start:var(--ht-icon-size,16px)}[dir=rtl] .handsontable .htLeft .columnSorting.sortAction:before{left:auto;right:2px;text-align:right}.htGhostTable .htCore span.colHeader.columnSorting:not(.indicatorDisabled):before{content:"*";display:inline-block;padding-right:20px;position:relative}.handsontable .colHeader.columnSorting:after{content:"";display:block;font-size:8px;margin-top:4px;position:absolute;right:0;text-align:right;top:50%;transform:translateY(-50%);width:8px}.handsontable .colHeader.columnSorting[class*=" sort-"]:after,.handsontable .colHeader.columnSorting[class^=sort-]:after{content:"+"}.handsontable .colHeader.columnSorting.sort-1:after{content:"1"}.handsontable .colHeader.columnSorting.sort-2:after{content:"2"}.handsontable .colHeader.columnSorting.sort-3:after{content:"3"}.handsontable .colHeader.columnSorting.sort-4:after{content:"4"}.handsontable .colHeader.columnSorting.sort-5:after{content:"5"}.handsontable .colHeader.columnSorting.sort-6:after{content:"6"}.handsontable .colHeader.columnSorting.sort-7:after{content:"7"}.handsontable .htRight .colHeader.columnSorting:after,[dir=rtl] .handsontable .colHeader.columnSorting:after{left:0;right:auto;text-align:left}[dir=rtl] .handsontable .htLeft .colHeader.columnSorting:after{left:auto;right:0;text-align:right}.htGhostTable th div button.changeType+span.colHeader.columnSorting:not(.indicatorDisabled){padding-right:var(--ht-gap-size)}.handsontable .htRowHeaders .ht_master.innerBorderInlineStart~.ht_clone_inline_start td:first-of-type,.handsontable .htRowHeaders .ht_master.innerBorderInlineStart~.ht_clone_top_inline_start_corner th:nth-child(2){border-left:0}.handsontable .ht_clone_top_inline_start_corner th.ht__active_highlight{box-shadow:none}.handsontable .manualColumnResizer{background:none;cursor:col-resize;margin:0;opacity:0;position:absolute;top:0;width:10px;z-index:210}.handsontable .manualColumnResizer:after,.handsontable .manualColumnResizer:before{background:var(--ht-resize-indicator-color);border-radius:2px;content:"";display:block;height:calc(100% - 12px);left:1px;max-height:16px;position:absolute;top:50%;transform:translateY(-50%);width:2px}.handsontable .manualColumnResizer:after{left:auto;right:0}.handsontable .manualColumnResizer.active,.handsontable .manualColumnResizer:hover{opacity:1}.handsontable .manualColumnResizerGuide{border-inline-end:1px solid var(--ht-accent-color);border-inline-start:none;display:none;inset-inline-end:unset;margin-inline-end:unset;margin-inline-start:5px;position:absolute;top:0;width:0}.handsontable .manualColumnResizerGuide.active{display:block;z-index:209}.handsontable .manualRowResizer{background:none;cursor:row-resize;height:10px;left:0;margin:0;opacity:0;position:absolute;transition:opacity .2s ease-in-out;z-index:210}.handsontable .manualRowResizer:after,.handsontable .manualRowResizer:before{background:var(--ht-resize-indicator-color);border-radius:2px;content:"";display:block;height:2px;left:50%;max-width:16px;position:absolute;top:1px;transform:translateX(-50%);width:calc(100% - 12px)}.handsontable .manualRowResizer:after{bottom:0;top:auto}.handsontable .manualRowResizer.active,.handsontable .manualRowResizer:hover{opacity:1}.handsontable .manualRowResizerGuide{border-bottom:1px solid var(--ht-accent-color);border-top:none;bottom:0;display:none;height:0;left:0;margin-top:4px;position:absolute}.handsontable .manualRowResizerGuide.active{display:block;z-index:209}.handsontable tbody td[rowspan][class*=area][class*=highlight]:not([class*=fullySelectedMergedCell]):before{opacity:0}.handsontable tbody td[rowspan][class*=area][class*=highlight][class*=fullySelectedMergedCell-0]:before,.handsontable tbody td[rowspan][class*=area][class*=highlight][class*=fullySelectedMergedCell-multiple]:before{opacity:.14}.handsontable tbody td[rowspan][class*=area][class*=highlight][class*=fullySelectedMergedCell-1]:before{opacity:.21}.handsontable tbody td[rowspan][class*=area][class*=highlight][class*=fullySelectedMergedCell-2]:before{opacity:.28}.handsontable tbody td[rowspan][class*=area][class*=highlight][class*=fullySelectedMergedCell-3]:before{opacity:.35}.handsontable tbody td[rowspan][class*=area][class*=highlight][class*=fullySelectedMergedCell-4]:before{opacity:.42}.handsontable tbody td[rowspan][class*=area][class*=highlight][class*=fullySelectedMergedCell-5]:before{opacity:.49}.handsontable tbody td[rowspan][class*=area][class*=highlight][class*=fullySelectedMergedCell-6]:before{opacity:.56}.handsontable tbody td[rowspan][class*=area][class*=highlight][class*=fullySelectedMergedCell-7]:before{opacity:.63}.handsontable .ht__manualColumnMove.after-selection--columns thead th.ht__highlight,.handsontable.ht__manualColumnMove.after-selection--columns thead th.ht__highlight{cursor:move;cursor:-moz-grab;cursor:-webkit-grab;cursor:grab}.handsontable .ht__manualColumnMove.on-moving--columns *,.handsontable .ht__manualColumnMove.on-moving--columns thead th.ht__highlight,.handsontable.ht__manualColumnMove.on-moving--columns *,.handsontable.ht__manualColumnMove.on-moving--columns thead th.ht__highlight{cursor:move;cursor:-moz-grabbing;cursor:-webkit-grabbing;cursor:grabbing}.handsontable .ht__manualColumnMove.on-moving--columns .manualColumnResizer,.handsontable.ht__manualColumnMove.on-moving--columns .manualColumnResizer{display:none}.handsontable .ht__manualColumnMove--backlight,.handsontable .ht__manualColumnMove--guideline,.handsontable.ht__manualColumnMove--backlight,.handsontable.ht__manualColumnMove--guideline{display:none;height:100%;position:absolute}.handsontable .ht__manualColumnMove--guideline,.handsontable.ht__manualColumnMove--guideline{background:var(--ht-move-indicator-color,#1a42e8);margin-inline-end:0;margin-inline-start:-.5px;top:0;width:1px;z-index:205}.handsontable .ht__manualColumnMove--backlight,.handsontable.ht__manualColumnMove--backlight{background:var(--ht-move-backlight-color);display:none;pointer-events:none;z-index:205}.handsontable .on-moving--columns .ht__manualColumnMove--backlight,.handsontable .on-moving--columns.show-ui .ht__manualColumnMove--guideline,.handsontable.on-moving--columns .ht__manualColumnMove--backlight,.handsontable.on-moving--columns.show-ui .ht__manualColumnMove--guideline{display:block}.handsontable .wtHider{position:relative}.handsontable .ht__manualRowMove.after-selection--rows tbody th.ht__highlight,.handsontable.ht__manualRowMove.after-selection--rows tbody th.ht__highlight{cursor:move;cursor:-moz-grab;cursor:-webkit-grab;cursor:grab}.handsontable .ht__manualRowMove.on-moving--rows *,.handsontable .ht__manualRowMove.on-moving--rows tbody th.ht__highlight,.handsontable.ht__manualRowMove.on-moving--rows *,.handsontable.ht__manualRowMove.on-moving--rows tbody th.ht__highlight{cursor:move;cursor:-moz-grabbing;cursor:-webkit-grabbing;cursor:grabbing}.handsontable .ht__manualRowMove.on-moving--rows .manualRowResizer,.handsontable.ht__manualRowMove.on-moving--rows .manualRowResizer{display:none}.handsontable .ht__manualRowMove--backlight,.handsontable .ht__manualRowMove--guideline,.handsontable.ht__manualRowMove--backlight,.handsontable.ht__manualRowMove--guideline{display:none;position:absolute;width:100%}.handsontable .ht__manualRowMove--guideline,.handsontable.ht__manualRowMove--guideline{background:var(--ht-move-indicator-color);height:1px;left:0;margin-top:-.5px;z-index:205}.handsontable .ht__manualRowMove--backlight,.handsontable.ht__manualRowMove--backlight{background:var(--ht-move-backlight-color);display:none;pointer-events:none;z-index:205}.handsontable .on-moving--rows .ht__manualRowMove--backlight,.handsontable .on-moving--rows.show-ui .ht__manualRowMove--guideline,.handsontable.on-moving--rows .ht__manualRowMove--backlight,.handsontable.on-moving--rows.show-ui .ht__manualRowMove--guideline{display:block} \ No newline at end of file diff --git a/webui/ipkvm/static/css/vendor/handsontable/ht-theme-main.min.css b/webui/ipkvm/static/css/vendor/handsontable/ht-theme-main.min.css new file mode 100755 index 0000000..49cbad4 --- /dev/null +++ b/webui/ipkvm/static/css/vendor/handsontable/ht-theme-main.min.css @@ -0,0 +1,30 @@ +/*! + * Copyright (c) HANDSONCODE sp. z o. o. + * + * HANDSONTABLE is a software distributed by HANDSONCODE sp. z o. o., a Polish corporation based in + * Gdynia, Poland, at Aleja Zwyciestwa 96-98, registered by the District Court in Gdansk under number + * 538651, EU tax ID number: PL5862294002, share capital: PLN 62,800.00. + * + * This software is protected by applicable copyright laws, including international treaties, and dual- + * licensed - depending on whether your use for commercial purposes, meaning intended for or + * resulting in commercial advantage or monetary compensation, or not. + * + * If your use is strictly personal or solely for evaluation purposes, meaning for the purposes of testing + * the suitability, performance, and usefulness of this software outside the production environment, + * you agree to be bound by the terms included in the "handsontable-non-commercial-license.pdf" file. + * + * Your use of this software for commercial purposes is subject to the terms included in an applicable + * license agreement. + * + * In any case, you must not make any such use of this software as to develop software which may be + * considered competitive with this software. + * + * UNLESS EXPRESSLY AGREED OTHERWISE, HANDSONCODE PROVIDES THIS SOFTWARE ON AN "AS IS" + * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, AND IN NO EVENT AND UNDER NO + * LEGAL THEORY, SHALL HANDSONCODE BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY DIRECT, + * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER ARISING FROM + * USE OR INABILITY TO USE THIS SOFTWARE. + * + * Version: 15.1.0 + * Release date: 20/02/2025 (built at 19/02/2025 10:01:30) + */.ht-theme-main,.ht-theme-main-dark,.ht-theme-main-dark-auto{--ht-font-size:14px;--ht-line-height:20px;--ht-font-weight:400;--ht-gap-size:4px;--ht-icon-size:16px;--ht-table-transition:0.15s;--ht-border-color:#e7e7e9;--ht-accent-color:#1a42e8;--ht-foreground-color:#222;--ht-background-color:#fff;--ht-placeholder-color:#999;--ht-read-only-color:#a3a3a3;--ht-disabled-color:#a3a3a3;--ht-cell-horizontal-border-color:#e7e7e9;--ht-cell-vertical-border-color:#e7e7e9;--ht-wrapper-border-width:0;--ht-wrapper-border-radius:4px;--ht-wrapper-border-color:#e7e7e9;--ht-row-header-odd-background-color:#f7f7f9;--ht-row-header-even-background-color:#f7f7f9;--ht-row-cell-odd-background-color:rgba(34,34,34,0);--ht-row-cell-even-background-color:rgba(34,34,34,0);--ht-cell-horizontal-padding:8px;--ht-cell-vertical-padding:4px;--ht-cell-editor-border-width:2px;--ht-cell-editor-border-color:#1a42e8;--ht-cell-editor-foreground-color:#000;--ht-cell-editor-background-color:#fff;--ht-cell-editor-shadow-blur-radius:0;--ht-cell-editor-shadow-color:rgba(17,61,201,.6);--ht-cell-success-background-color:rgba(55,188,108,.2);--ht-cell-error-background-color:rgba(250,77,50,.2);--ht-cell-selection-border-color:#1a42e8;--ht-cell-selection-background-color:#5371ee;--ht-cell-autofill-size:6px;--ht-cell-autofill-border-width:1px;--ht-cell-autofill-border-radius:4px;--ht-cell-autofill-border-color:#fff;--ht-cell-autofill-background-color:#1a42e8;--ht-cell-autofill-fill-border-color:#222;--ht-resize-indicator-color:rgba(34,34,34,.4);--ht-move-backlight-color:rgba(34,34,34,.06);--ht-move-indicator-color:#1a42e8;--ht-hidden-indicator-color:rgba(34,34,34,.4);--ht-scrollbar-border-radius:8px;--ht-scrollbar-track-color:#f7f7f9;--ht-scrollbar-thumb-color:#999;--ht-checkbox-size:16px;--ht-checkbox-border-radius:4px;--ht-checkbox-border-color:#d1d1d5;--ht-checkbox-background-color:#fff;--ht-checkbox-icon-color:hsla(0,0%,100%,0);--ht-checkbox-focus-border-color:#d1d1d5;--ht-checkbox-focus-background-color:#fff;--ht-checkbox-focus-icon-color:hsla(0,0%,100%,0);--ht-checkbox-focus-ring-color:#1a42e8;--ht-checkbox-disabled-border-color:#e7e7e9;--ht-checkbox-disabled-background-color:#d1d1d5;--ht-checkbox-disabled-icon-color:hsla(0,0%,100%,0);--ht-checkbox-checked-border-color:#3f60ec;--ht-checkbox-checked-background-color:#1a42e8;--ht-checkbox-checked-icon-color:#fff;--ht-checkbox-checked-focus-border-color:#fff;--ht-checkbox-checked-focus-background-color:#1a42e8;--ht-checkbox-checked-focus-icon-color:#fff;--ht-checkbox-checked-disabled-border-color:#e7e7e9;--ht-checkbox-checked-disabled-background-color:#d1d1d5;--ht-checkbox-checked-disabled-icon-color:#a3a3a3;--ht-header-font-weight:400;--ht-header-foreground-color:#222;--ht-header-background-color:#f7f7f9;--ht-header-active-border-color:#2e56fc;--ht-header-active-foreground-color:#fff;--ht-header-active-background-color:#1a42e8;--ht-header-highlighted-shadow-size:0;--ht-header-highlighted-foreground-color:#000;--ht-header-highlighted-background-color:#ebebed;--ht-header-filter-background-color:rgba(55,188,108,.2);--ht-header-row-foreground-color:#222;--ht-header-row-background-color:#f7f7f9;--ht-header-row-highlighted-foreground-color:#000;--ht-header-row-highlighted-background-color:#ebebed;--ht-header-row-active-foreground-color:#fff;--ht-header-row-active-background-color:#1a42e8;--ht-icon-button-border-radius:2px;--ht-icon-button-border-color:#f7f7f9;--ht-icon-button-background-color:#f7f7f9;--ht-icon-button-icon-color:rgba(34,34,34,.4);--ht-icon-button-hover-border-color:#e7e7e8;--ht-icon-button-hover-background-color:#e7e7e8;--ht-icon-button-hover-icon-color:rgba(34,34,34,.4);--ht-icon-active-button-border-color:#2e56fc;--ht-icon-active-button-background-color:#1a42e8;--ht-icon-active-button-icon-color:#fff;--ht-icon-active-button-hover-border-color:#2e56fc;--ht-icon-active-button-hover-background-color:#3357ea;--ht-icon-active-button-hover-icon-color:#fff;--ht-collapse-button-border-radius:4px;--ht-collapse-button-open-border-color:#d1d1d5;--ht-collapse-button-open-background-color:#fff;--ht-collapse-button-open-icon-color:#666;--ht-collapse-button-open-icon-active-color:#666;--ht-collapse-button-open-hover-border-color:#d1d1d5;--ht-collapse-button-open-hover-background-color:#f7f7f9;--ht-collapse-button-open-hover-icon-color:#666;--ht-collapse-button-open-hover-icon-active-color:#666;--ht-collapse-button-close-border-color:#d1d1d5;--ht-collapse-button-close-background-color:#ebebed;--ht-collapse-button-close-icon-color:#666;--ht-collapse-button-close-icon-active-color:#666;--ht-collapse-button-close-hover-border-color:#d1d1d5;--ht-collapse-button-close-hover-background-color:#ebebed;--ht-collapse-button-close-hover-icon-color:#666;--ht-collapse-button-close-hover-icon-active-color:#666;--ht-button-border-radius:4px;--ht-button-horizontal-padding:12px;--ht-button-vertical-padding:6px;--ht-primary-button-border-color:hsla(0,0%,100%,0);--ht-primary-button-foreground-color:#fff;--ht-primary-button-background-color:#1a42e8;--ht-primary-button-disabled-border-color:hsla(0,0%,100%,0);--ht-primary-button-disabled-foreground-color:#a3a3a3;--ht-primary-button-disabled-background-color:hsla(0,0%,60%,.32);--ht-primary-button-hover-border-color:hsla(0,0%,100%,0);--ht-primary-button-hover-foreground-color:#fff;--ht-primary-button-hover-background-color:#1535bc;--ht-primary-button-focus-border-color:#fff;--ht-primary-button-focus-foreground-color:#fff;--ht-primary-button-focus-background-color:#1a42e8;--ht-secondary-button-border-color:#e7e7e9;--ht-secondary-button-foreground-color:#222;--ht-secondary-button-background-color:#fff;--ht-secondary-button-disabled-border-color:#e7e7e9;--ht-secondary-button-disabled-foreground-color:#a3a3a3;--ht-secondary-button-disabled-background-color:#ebebed;--ht-secondary-button-hover-border-color:#e7e7e9;--ht-secondary-button-hover-foreground-color:#222;--ht-secondary-button-hover-background-color:#fff;--ht-secondary-button-focus-border-color:#e7e7e9;--ht-secondary-button-focus-foreground-color:#222;--ht-secondary-button-focus-background-color:#fff;--ht-comments-textarea-horizontal-padding:8px;--ht-comments-textarea-vertical-padding:4px;--ht-comments-indicator-size:6px;--ht-comments-indicator-color:#1a42e8;--ht-comments-textarea-border-width:1px;--ht-comments-textarea-border-color:hsla(0,0%,100%,0);--ht-comments-textarea-foreground-color:#222;--ht-comments-textarea-background-color:#f7f7f9;--ht-comments-textarea-focus-border-width:1px;--ht-comments-textarea-focus-border-color:#1a42e8;--ht-comments-textarea-focus-foreground-color:#222;--ht-comments-textarea-focus-background-color:#fff;--ht-license-horizontal-padding:16px;--ht-license-vertical-padding:8px;--ht-license-foreground-color:#222;--ht-license-background-color:#f7f7f9;--ht-link-color:#1a42e8;--ht-link-hover-color:#3e67ec;--ht-input-border-width:1px;--ht-input-border-radius:4px;--ht-input-horizontal-padding:12px;--ht-input-vertical-padding:6px;--ht-input-border-color:#e7e7e9;--ht-input-foreground-color:#222;--ht-input-background-color:#f7f7f9;--ht-input-hover-border-color:#e7e7e9;--ht-input-hover-foreground-color:#222;--ht-input-hover-background-color:#fff;--ht-input-disabled-border-color:#e7e7e9;--ht-input-disabled-foreground-color:#a3a3a3;--ht-input-disabled-background-color:hsla(0,0%,60%,.32);--ht-input-focus-border-color:#1a42e8;--ht-input-focus-foreground-color:#222;--ht-input-focus-background-color:#fff;--ht-menu-border-width:1px;--ht-menu-border-radius:4px;--ht-menu-horizontal-padding:0;--ht-menu-vertical-padding:8px;--ht-menu-item-horizontal-padding:12px;--ht-menu-item-vertical-padding:4px;--ht-menu-shadow-x:0;--ht-menu-shadow-y:8px;--ht-menu-shadow-blur:16px;--ht-menu-border-color:#e7e7e9;--ht-menu-shadow-color:rgba(0,0,0,.08);--ht-menu-item-hover-color:rgba(0,0,0,.05);--ht-menu-item-active-color:rgba(0,0,0,.08)}.ht-theme-main-dark{--ht-border-color:#313132;--ht-accent-color:#476af7;--ht-foreground-color:#c7c7c7;--ht-background-color:#0f0f10;--ht-placeholder-color:#68696c;--ht-read-only-color:#68696c;--ht-disabled-color:#68696c;--ht-cell-horizontal-border-color:#313132;--ht-cell-vertical-border-color:#313132;--ht-wrapper-border-color:#313132;--ht-row-header-odd-background-color:#1e1e1f;--ht-row-header-even-background-color:#1e1e1f;--ht-row-cell-odd-background-color:rgba(239,239,243,0);--ht-row-cell-even-background-color:rgba(239,239,243,0);--ht-cell-editor-border-color:#476af7;--ht-cell-editor-foreground-color:#fff;--ht-cell-editor-background-color:#0f0f10;--ht-cell-editor-shadow-color:rgba(71,106,247,.6);--ht-cell-success-background-color:rgba(66,190,101,.3);--ht-cell-error-background-color:rgba(255,42,52,.3);--ht-cell-selection-border-color:#476af7;--ht-cell-selection-background-color:#476af7;--ht-cell-autofill-border-color:#0f0f10;--ht-cell-autofill-background-color:#476af7;--ht-cell-autofill-fill-border-color:#c7c7c7;--ht-resize-indicator-color:hsla(0,0%,100%,.4);--ht-move-backlight-color:hsla(0,0%,87%,.12);--ht-move-indicator-color:#476af7;--ht-hidden-indicator-color:hsla(0,0%,100%,.4);--ht-scrollbar-track-color:#19191c;--ht-scrollbar-thumb-color:#68696c;--ht-checkbox-border-color:#404144;--ht-checkbox-background-color:#0f0f10;--ht-checkbox-focus-border-color:#404144;--ht-checkbox-focus-background-color:#0f0f10;--ht-checkbox-focus-ring-color:#476af7;--ht-checkbox-disabled-border-color:#313132;--ht-checkbox-disabled-background-color:#404144;--ht-checkbox-checked-border-color:#3c59cf;--ht-checkbox-checked-background-color:#476af7;--ht-checkbox-checked-icon-color:#c7c7c7;--ht-checkbox-checked-focus-background-color:#476af7;--ht-checkbox-checked-focus-icon-color:#c7c7c7;--ht-checkbox-checked-disabled-border-color:#313132;--ht-checkbox-checked-disabled-background-color:#36373a;--ht-checkbox-checked-disabled-icon-color:#68696c;--ht-header-foreground-color:#c7c7c7;--ht-header-background-color:#1e1e1f;--ht-header-active-border-color:#4767e5;--ht-header-active-foreground-color:#0f0f10;--ht-header-active-background-color:#476af7;--ht-header-highlighted-foreground-color:#f3f3f3;--ht-header-highlighted-background-color:#262627;--ht-header-filter-background-color:rgba(66,190,101,.3);--ht-header-row-foreground-color:#c7c7c7;--ht-header-row-background-color:#1e1e1f;--ht-header-row-highlighted-foreground-color:#f3f3f3;--ht-header-row-highlighted-background-color:#262627;--ht-header-row-active-foreground-color:#0f0f10;--ht-header-row-active-background-color:#476af7;--ht-icon-button-border-color:#1e1e1f;--ht-icon-button-background-color:#1e1e1f;--ht-icon-button-icon-color:hsla(0,0%,100%,.4);--ht-icon-button-hover-border-color:#303031;--ht-icon-button-hover-background-color:#303031;--ht-icon-button-hover-icon-color:hsla(0,0%,100%,.4);--ht-icon-active-button-border-color:#4767e5;--ht-icon-active-button-background-color:#476af7;--ht-icon-active-button-icon-color:#0f0f10;--ht-icon-active-button-hover-border-color:#4767e5;--ht-icon-active-button-hover-background-color:#5576f8;--ht-icon-active-button-hover-icon-color:#0f0f10;--ht-collapse-button-open-border-color:rgba(83,83,85,.64);--ht-collapse-button-open-background-color:#000;--ht-collapse-button-open-icon-color:#999;--ht-collapse-button-open-icon-active-color:#999;--ht-collapse-button-open-hover-border-color:rgba(83,83,85,.64);--ht-collapse-button-open-hover-background-color:#1e1e1f;--ht-collapse-button-open-hover-icon-color:#999;--ht-collapse-button-open-hover-icon-active-color:#999;--ht-collapse-button-close-border-color:rgba(83,83,85,.64);--ht-collapse-button-close-background-color:#262627;--ht-collapse-button-close-icon-color:#999;--ht-collapse-button-close-icon-active-color:#999;--ht-collapse-button-close-hover-border-color:rgba(83,83,85,.64);--ht-collapse-button-close-hover-background-color:#262627;--ht-collapse-button-close-hover-icon-color:#999;--ht-collapse-button-close-hover-icon-active-color:#999;--ht-primary-button-foreground-color:#c7c7c7;--ht-primary-button-background-color:#476af7;--ht-primary-button-disabled-foreground-color:#68696c;--ht-primary-button-disabled-background-color:hsla(225,2%,42%,.32);--ht-primary-button-hover-foreground-color:#c7c7c7;--ht-primary-button-hover-background-color:#6180ff;--ht-primary-button-focus-border-color:#0f0f10;--ht-primary-button-focus-foreground-color:#c7c7c7;--ht-primary-button-focus-background-color:#476af7;--ht-secondary-button-border-color:#313132;--ht-secondary-button-foreground-color:#c7c7c7;--ht-secondary-button-background-color:#0f0f10;--ht-secondary-button-disabled-border-color:#313132;--ht-secondary-button-disabled-foreground-color:#68696c;--ht-secondary-button-disabled-background-color:#262627;--ht-secondary-button-hover-border-color:#313132;--ht-secondary-button-hover-foreground-color:#c7c7c7;--ht-secondary-button-hover-background-color:#0f0f10;--ht-secondary-button-focus-border-color:#313132;--ht-secondary-button-focus-foreground-color:#c7c7c7;--ht-secondary-button-focus-background-color:#0f0f10;--ht-comments-indicator-color:#476af7;--ht-comments-textarea-foreground-color:#c7c7c7;--ht-comments-textarea-background-color:#1e1e1f;--ht-comments-textarea-focus-border-color:#476af7;--ht-comments-textarea-focus-foreground-color:#c7c7c7;--ht-comments-textarea-focus-background-color:#0f0f10;--ht-license-foreground-color:#c7c7c7;--ht-license-background-color:#1e1e1f;--ht-link-color:#5576f8;--ht-link-hover-color:#728eff;--ht-input-border-color:#313132;--ht-input-foreground-color:#c7c7c7;--ht-input-background-color:#1e1e1f;--ht-input-hover-border-color:#313132;--ht-input-hover-foreground-color:#c7c7c7;--ht-input-hover-background-color:#0f0f10;--ht-input-disabled-border-color:#313132;--ht-input-disabled-foreground-color:#68696c;--ht-input-disabled-background-color:hsla(225,2%,42%,.32);--ht-input-focus-border-color:#476af7;--ht-input-focus-foreground-color:#c7c7c7;--ht-input-focus-background-color:#0f0f10;--ht-menu-border-color:#313132;--ht-menu-shadow-color:rgba(0,0,0,.8);--ht-menu-item-hover-color:rgba(239,239,243,.05);--ht-menu-item-active-color:rgba(239,239,243,.12)}@media(prefers-color-scheme:dark){.ht-theme-main-dark-auto{--ht-border-color:#313132;--ht-accent-color:#476af7;--ht-foreground-color:#c7c7c7;--ht-background-color:#0f0f10;--ht-placeholder-color:#68696c;--ht-read-only-color:#68696c;--ht-disabled-color:#68696c;--ht-cell-horizontal-border-color:#313132;--ht-cell-vertical-border-color:#313132;--ht-wrapper-border-color:#313132;--ht-row-header-odd-background-color:#1e1e1f;--ht-row-header-even-background-color:#1e1e1f;--ht-row-cell-odd-background-color:rgba(239,239,243,0);--ht-row-cell-even-background-color:rgba(239,239,243,0);--ht-cell-editor-border-color:#476af7;--ht-cell-editor-foreground-color:#fff;--ht-cell-editor-background-color:#0f0f10;--ht-cell-editor-shadow-color:rgba(71,106,247,.6);--ht-cell-success-background-color:rgba(66,190,101,.3);--ht-cell-error-background-color:rgba(255,42,52,.3);--ht-cell-selection-border-color:#476af7;--ht-cell-selection-background-color:#476af7;--ht-cell-autofill-border-color:#0f0f10;--ht-cell-autofill-background-color:#476af7;--ht-cell-autofill-fill-border-color:#c7c7c7;--ht-resize-indicator-color:hsla(0,0%,100%,.4);--ht-move-backlight-color:hsla(0,0%,87%,.12);--ht-move-indicator-color:#476af7;--ht-hidden-indicator-color:hsla(0,0%,100%,.4);--ht-scrollbar-track-color:#19191c;--ht-scrollbar-thumb-color:#68696c;--ht-checkbox-border-color:#404144;--ht-checkbox-background-color:#0f0f10;--ht-checkbox-focus-border-color:#404144;--ht-checkbox-focus-background-color:#0f0f10;--ht-checkbox-focus-ring-color:#476af7;--ht-checkbox-disabled-border-color:#313132;--ht-checkbox-disabled-background-color:#404144;--ht-checkbox-checked-border-color:#3c59cf;--ht-checkbox-checked-background-color:#476af7;--ht-checkbox-checked-icon-color:#c7c7c7;--ht-checkbox-checked-focus-background-color:#476af7;--ht-checkbox-checked-focus-icon-color:#c7c7c7;--ht-checkbox-checked-disabled-border-color:#313132;--ht-checkbox-checked-disabled-background-color:#36373a;--ht-checkbox-checked-disabled-icon-color:#68696c;--ht-header-foreground-color:#c7c7c7;--ht-header-background-color:#1e1e1f;--ht-header-active-border-color:#4767e5;--ht-header-active-foreground-color:#0f0f10;--ht-header-active-background-color:#476af7;--ht-header-highlighted-foreground-color:#f3f3f3;--ht-header-highlighted-background-color:#262627;--ht-header-filter-background-color:rgba(66,190,101,.3);--ht-header-row-foreground-color:#c7c7c7;--ht-header-row-background-color:#1e1e1f;--ht-header-row-highlighted-foreground-color:#f3f3f3;--ht-header-row-highlighted-background-color:#262627;--ht-header-row-active-foreground-color:#0f0f10;--ht-header-row-active-background-color:#476af7;--ht-icon-button-border-color:#1e1e1f;--ht-icon-button-background-color:#1e1e1f;--ht-icon-button-icon-color:hsla(0,0%,100%,.4);--ht-icon-button-hover-border-color:#303031;--ht-icon-button-hover-background-color:#303031;--ht-icon-button-hover-icon-color:hsla(0,0%,100%,.4);--ht-icon-active-button-border-color:#4767e5;--ht-icon-active-button-background-color:#476af7;--ht-icon-active-button-icon-color:#0f0f10;--ht-icon-active-button-hover-border-color:#4767e5;--ht-icon-active-button-hover-background-color:#5576f8;--ht-icon-active-button-hover-icon-color:#0f0f10;--ht-collapse-button-open-border-color:rgba(83,83,85,.64);--ht-collapse-button-open-background-color:#000;--ht-collapse-button-open-icon-color:#999;--ht-collapse-button-open-icon-active-color:#999;--ht-collapse-button-open-hover-border-color:rgba(83,83,85,.64);--ht-collapse-button-open-hover-background-color:#1e1e1f;--ht-collapse-button-open-hover-icon-color:#999;--ht-collapse-button-open-hover-icon-active-color:#999;--ht-collapse-button-close-border-color:rgba(83,83,85,.64);--ht-collapse-button-close-background-color:#262627;--ht-collapse-button-close-icon-color:#999;--ht-collapse-button-close-icon-active-color:#999;--ht-collapse-button-close-hover-border-color:rgba(83,83,85,.64);--ht-collapse-button-close-hover-background-color:#262627;--ht-collapse-button-close-hover-icon-color:#999;--ht-collapse-button-close-hover-icon-active-color:#999;--ht-primary-button-foreground-color:#c7c7c7;--ht-primary-button-background-color:#476af7;--ht-primary-button-disabled-foreground-color:#68696c;--ht-primary-button-disabled-background-color:hsla(225,2%,42%,.32);--ht-primary-button-hover-foreground-color:#c7c7c7;--ht-primary-button-hover-background-color:#6180ff;--ht-primary-button-focus-border-color:#0f0f10;--ht-primary-button-focus-foreground-color:#c7c7c7;--ht-primary-button-focus-background-color:#476af7;--ht-secondary-button-border-color:#313132;--ht-secondary-button-foreground-color:#c7c7c7;--ht-secondary-button-background-color:#0f0f10;--ht-secondary-button-disabled-border-color:#313132;--ht-secondary-button-disabled-foreground-color:#68696c;--ht-secondary-button-disabled-background-color:#262627;--ht-secondary-button-hover-border-color:#313132;--ht-secondary-button-hover-foreground-color:#c7c7c7;--ht-secondary-button-hover-background-color:#0f0f10;--ht-secondary-button-focus-border-color:#313132;--ht-secondary-button-focus-foreground-color:#c7c7c7;--ht-secondary-button-focus-background-color:#0f0f10;--ht-comments-indicator-color:#476af7;--ht-comments-textarea-foreground-color:#c7c7c7;--ht-comments-textarea-background-color:#1e1e1f;--ht-comments-textarea-focus-border-color:#476af7;--ht-comments-textarea-focus-foreground-color:#c7c7c7;--ht-comments-textarea-focus-background-color:#0f0f10;--ht-license-foreground-color:#c7c7c7;--ht-license-background-color:#1e1e1f;--ht-link-color:#5576f8;--ht-link-hover-color:#728eff;--ht-input-border-color:#313132;--ht-input-foreground-color:#c7c7c7;--ht-input-background-color:#1e1e1f;--ht-input-hover-border-color:#313132;--ht-input-hover-foreground-color:#c7c7c7;--ht-input-hover-background-color:#0f0f10;--ht-input-disabled-border-color:#313132;--ht-input-disabled-foreground-color:#68696c;--ht-input-disabled-background-color:hsla(225,2%,42%,.32);--ht-input-focus-border-color:#476af7;--ht-input-focus-foreground-color:#c7c7c7;--ht-input-focus-background-color:#0f0f10;--ht-menu-border-color:#313132;--ht-menu-shadow-color:rgba(0,0,0,.8);--ht-menu-item-hover-color:rgba(239,239,243,.05);--ht-menu-item-active-color:rgba(239,239,243,.12)}}[class*=ht-theme-main] .pika-single .pika-next,[class*=ht-theme-main].htContextMenu table tbody tr td.htSubmenu .htItemWrapper:after,[class*=ht-theme-main].htDropdownMenu table tbody tr td.htSubmenu .htItemWrapper:after,[class*=ht-theme-main].htFiltersConditionsMenu table tbody tr td.htSubmenu .htItemWrapper:after{background-color:currentColor;height:var(--ht-icon-size);-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3E%3Cpath stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' d='M6.646 10.94 9.94 7.645 6.646 4.354'/%3E%3C/svg%3E");-webkit-mask-size:contain;width:var(--ht-icon-size)}[class*=ht-theme-main] .pika-single .pika-prev{background-color:currentColor;height:var(--ht-icon-size);-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3E%3Cpath stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' d='M9.94 10.94 6.645 7.645 9.94 4.354'/%3E%3C/svg%3E");-webkit-mask-size:contain;width:var(--ht-icon-size)}[class*=ht-theme-main] .changeType:before,[class*=ht-theme-main] .htAutocompleteArrow:after,[class*=ht-theme-main] .htUISelectCaption:after{background-color:currentColor;height:var(--ht-icon-size);-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3E%3Cpath fill='currentColor' d='M11 6.667a.5.5 0 0 1 .392.811l-.038.042-3 3a.5.5 0 0 1-.66.042l-.047-.042-3-3-.042-.047-.027-.038-.027-.048-.008-.018-.014-.034-.016-.054-.005-.026-.005-.03-.002-.029v-.059l.003-.029.004-.03.005-.026.016-.054.014-.033.035-.066.032-.045.037-.04.047-.042.038-.027.048-.027.018-.009.034-.013.054-.016.026-.005.03-.005.029-.002z'/%3E%3C/svg%3E");-webkit-mask-size:contain;width:var(--ht-icon-size)}[class*=ht-theme-main] .columnSorting.sortAction.ascending:before{background-color:currentColor;height:var(--ht-icon-size);-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3E%3Cpath stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' d='M8 12.667V3.333m0 0L5.333 6M8 3.333 10.667 6'/%3E%3C/svg%3E");-webkit-mask-size:contain;width:var(--ht-icon-size)}[class*=ht-theme-main] .columnSorting.sortAction.descending:before{background-color:currentColor;height:var(--ht-icon-size);-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3E%3Cpath stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' d='M8 3.333v9.334m0 0L10.667 10M8 12.667 5.333 10'/%3E%3C/svg%3E");-webkit-mask-size:contain;width:var(--ht-icon-size)}[class*=ht-theme-main].htContextMenu table tbody tr td .htItemWrapper span.selected:after,[class*=ht-theme-main].htDropdownMenu table tbody tr td .htItemWrapper span.selected:after,[class*=ht-theme-main].htFiltersConditionsMenu table tbody tr td .htItemWrapper span.selected:after{background-color:currentColor;height:var(--ht-icon-size);-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3E%3Cpath stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' d='m3.333 8 3.334 3.333 6.666-6.666'/%3E%3C/svg%3E");-webkit-mask-size:contain;width:var(--ht-icon-size)}[class*=ht-theme-main] .htCheckboxRendererInput:after{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3E%3Cpath stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' d='m5 8 2 2 4-4'/%3E%3C/svg%3E")}[class*=ht-theme-main] .htCheckboxRendererInput:after,[class*=ht-theme-main] th.beforeHiddenColumn:after{background-color:currentColor;height:var(--ht-icon-size);-webkit-mask-size:contain;width:var(--ht-icon-size)}[class*=ht-theme-main] th.beforeHiddenColumn:after{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='none'%3E%3Cpath fill='currentColor' d='m6.085 1.358.03-.003h.061l.03.003.032.004.027.006.056.016.035.014.069.037.047.034.042.038.043.049.028.04.028.05.01.018.013.035.017.057.005.027.005.031.003.03v6.28a.521.521 0 0 1-.845.409l-.043-.04-3.125-3.125a.52.52 0 0 1-.044-.687l.044-.05 3.125-3.124.048-.044.04-.028.05-.028.02-.009.034-.014.056-.016.028-.006z'/%3E%3C/svg%3E")}[class*=ht-theme-main] th.afterHiddenColumn:before{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='none'%3E%3Cpath fill='currentColor' d='M3.333 1.875c0-.444.514-.676.846-.408l.043.04 3.125 3.125a.52.52 0 0 1 .044.687l-.044.05-3.125 3.124-.049.043-.04.029-.05.028-.018.009-.035.014-.057.016-.027.005-.031.006-.03.002h-.062l-.03-.003-.031-.005-.027-.005-.056-.016-.035-.014-.069-.037-.047-.034-.042-.038-.043-.049-.028-.04-.029-.05-.008-.019-.014-.034-.017-.057-.005-.027-.006-.032-.002-.03z'/%3E%3C/svg%3E")}[class*=ht-theme-main] th.afterHiddenColumn:before,[class*=ht-theme-main] th.beforeHiddenRow:after{background-color:currentColor;height:var(--ht-icon-size);-webkit-mask-size:contain;width:var(--ht-icon-size)}[class*=ht-theme-main] th.beforeHiddenRow:after{-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' fill='none'%3E%3Cpath fill='currentColor' d='M3.764 2.431a.333.333 0 0 1 .44-.028l.032.028 2 2 .027.031.018.026.018.032.006.012.009.022.01.036.004.018.003.02.002.019v.04l-.002.019-.003.02-.003.017-.011.036-.01.022-.022.044-.022.03-.024.027-.032.028-.025.018-.032.018-.012.006-.023.009-.036.01-.017.004-.02.003-.02.001L6 5H2a.334.334 0 0 1-.26-.541l.025-.028z'/%3E%3C/svg%3E")}[class*=ht-theme-main] th.afterHiddenRow:before{background-color:currentColor;height:var(--ht-icon-size);-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' fill='none'%3E%3Cpath fill='currentColor' d='M6 3c.284 0 .432.329.26.541l-.024.028-2 2a.333.333 0 0 1-.44.028l-.032-.028-2-2-.027-.031-.018-.026L1.7 3.48l-.006-.012-.01-.022-.01-.036-.003-.018-.003-.02-.002-.019v-.04l.002-.019.003-.02.003-.017.01-.036.01-.022.023-.044.022-.03.024-.027.032-.028.025-.018.032-.018.012-.006.023-.009.036-.01.017-.004.02-.003.02-.001z'/%3E%3C/svg%3E");-webkit-mask-size:contain;width:var(--ht-icon-size)}[class*=ht-theme-main] .collapsibleIndicator:before,[class*=ht-theme-main] .ht_nestingButton:before{background-color:currentColor;height:var(--ht-icon-size);-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3E%3Cpath stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' d='M4.333 8h7.334'/%3E%3C/svg%3E");-webkit-mask-size:contain;width:var(--ht-icon-size)}[class*=ht-theme-main] .collapsibleIndicator.collapsed:before,[class*=ht-theme-main] .collapsibleIndicator.ht_nestingExpand:before,[class*=ht-theme-main] .ht_nestingButton.collapsed:before,[class*=ht-theme-main] .ht_nestingButton.ht_nestingExpand:before{background-color:currentColor;height:var(--ht-icon-size);-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M7.5 11.667a.5.5 0 0 0 1 0V8.5h3.167a.5.5 0 0 0 0-1H8.5V4.333a.5.5 0 0 0-1 0V7.5H4.333a.5.5 0 0 0 0 1H7.5z' clip-rule='evenodd'/%3E%3C/svg%3E");-webkit-mask-size:contain;width:var(--ht-icon-size)}[class*=ht-theme-main] .htUIRadio>input[type=radio]:after{background-color:currentColor;height:var(--ht-icon-size);-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3E%3Ccircle cx='8' cy='8' r='4' fill='currentColor'/%3E%3C/svg%3E");-webkit-mask-size:contain;width:var(--ht-icon-size)} \ No newline at end of file diff --git a/webui/ipkvm/static/js/mkb_handler.js b/webui/ipkvm/static/js/mkb_handler.js index 4a3c188..10c7634 100644 --- a/webui/ipkvm/static/js/mkb_handler.js +++ b/webui/ipkvm/static/js/mkb_handler.js @@ -2,9 +2,11 @@ var last_mouse_update = Date.now() var socket = io(); +let streamview; + function mkbhandler_load() { - const streamview = document.getElementById('streamview'); + streamview = document.getElementById('streamview'); streamview.addEventListener("mouseenter", enable_listener); streamview.addEventListener("mouseleave", disable_listener); @@ -80,4 +82,12 @@ function disable_listener() document.removeEventListener('contextmenu', prevent_right_click); } +function update_post_log(data) +{ + document.getElementById("post-log-container").innerText += `\n ${data}`; + document.getElementById("post-log-container").scrollTop = document.getElementById("post-log-container").scrollHeight; +} + +socket.on("update_post_log", update_post_log); + window.addEventListener("load", mkbhandler_load); diff --git a/webui/ipkvm/static/js/my-codemirror.js b/webui/ipkvm/static/js/my-codemirror.js new file mode 100644 index 0000000..aa0a25e --- /dev/null +++ b/webui/ipkvm/static/js/my-codemirror.js @@ -0,0 +1,14 @@ +function codemirror_load() +{ + const code_div = document.getElementById('codemirror'); + + var code_mirror = CodeMirror(code_div, { + lineNumbers: true + }) + + socket.emit("get_current_profile", (data) => { + code_mirror.setValue(data) + }); +} + +window.addEventListener("load", codemirror_load); \ No newline at end of file diff --git a/webui/ipkvm/static/js/table.js b/webui/ipkvm/static/js/table.js new file mode 100644 index 0000000..20e4271 --- /dev/null +++ b/webui/ipkvm/static/js/table.js @@ -0,0 +1,48 @@ +let container; +let hot; + +function table_load() { + container = document.getElementById("stats-table"); +} + +function create_table(data) { + let row_headers = [] + let col_headers = [] + + Object.keys(data).forEach((key, index) => { + row_headers.push(key) + Object.keys(data[key]).forEach((value, subIndex) => { + col_headers.push(value) + }); + }); + + hot = new Handsontable(container, { + rowHeaders: row_headers, + rowHeaderWidth: 60, + colHeaders: col_headers, + height: 'auto', + autoWrapRow: true, + autoWrapCol: true, + licenseKey: 'non-commercial-and-evaluation' // for non-commercial use only + }); +} + +function update_core_info_table(data) { + if (hot) { + hot.batch(() => { + Object.keys(data).forEach((key, index) => { + Object.keys(data[key]).forEach((value, subIndex) => { + hot.setDataAtCell(index, subIndex, data[key][value]) + }); + }); + }); + } + + else { + create_table(data) + } +} + +socket.on("update_core_info_table", update_core_info_table); + +window.addEventListener("load", table_load); diff --git a/webui/ipkvm/static/js/vendor/codemirror/codemirror.js b/webui/ipkvm/static/js/vendor/codemirror/codemirror.js new file mode 100644 index 0000000..e42b63b --- /dev/null +++ b/webui/ipkvm/static/js/vendor/codemirror/codemirror.js @@ -0,0 +1,9884 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: https://codemirror.net/5/LICENSE + +// This is CodeMirror (https://codemirror.net/5), a code editor +// implemented in JavaScript on top of the browser's DOM. +// +// You can find some technical background for some of the code below +// at http://marijnhaverbeke.nl/blog/#cm-internals . + +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global = global || self, global.CodeMirror = factory()); +}(this, (function () { 'use strict'; + + // Kludges for bugs and behavior differences that can't be feature + // detected are enabled based on userAgent etc sniffing. + var userAgent = navigator.userAgent; + var platform = navigator.platform; + + var gecko = /gecko\/\d/i.test(userAgent); + var ie_upto10 = /MSIE \d/.test(userAgent); + var ie_11up = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(userAgent); + var edge = /Edge\/(\d+)/.exec(userAgent); + var ie = ie_upto10 || ie_11up || edge; + var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : +(edge || ie_11up)[1]); + var webkit = !edge && /WebKit\//.test(userAgent); + var qtwebkit = webkit && /Qt\/\d+\.\d+/.test(userAgent); + var chrome = !edge && /Chrome\/(\d+)/.exec(userAgent); + var chrome_version = chrome && +chrome[1]; + var presto = /Opera\//.test(userAgent); + var safari = /Apple Computer/.test(navigator.vendor); + var mac_geMountainLion = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(userAgent); + var phantom = /PhantomJS/.test(userAgent); + + var ios = safari && (/Mobile\/\w+/.test(userAgent) || navigator.maxTouchPoints > 2); + var android = /Android/.test(userAgent); + // This is woefully incomplete. Suggestions for alternative methods welcome. + var mobile = ios || android || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent); + var mac = ios || /Mac/.test(platform); + var chromeOS = /\bCrOS\b/.test(userAgent); + var windows = /win/i.test(platform); + + var presto_version = presto && userAgent.match(/Version\/(\d*\.\d*)/); + if (presto_version) { presto_version = Number(presto_version[1]); } + if (presto_version && presto_version >= 15) { presto = false; webkit = true; } + // Some browsers use the wrong event properties to signal cmd/ctrl on OS X + var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11)); + var captureRightClick = gecko || (ie && ie_version >= 9); + + function classTest(cls) { return new RegExp("(^|\\s)" + cls + "(?:$|\\s)\\s*") } + + var rmClass = function(node, cls) { + var current = node.className; + var match = classTest(cls).exec(current); + if (match) { + var after = current.slice(match.index + match[0].length); + node.className = current.slice(0, match.index) + (after ? match[1] + after : ""); + } + }; + + function removeChildren(e) { + for (var count = e.childNodes.length; count > 0; --count) + { e.removeChild(e.firstChild); } + return e + } + + function removeChildrenAndAdd(parent, e) { + return removeChildren(parent).appendChild(e) + } + + function elt(tag, content, className, style) { + var e = document.createElement(tag); + if (className) { e.className = className; } + if (style) { e.style.cssText = style; } + if (typeof content == "string") { e.appendChild(document.createTextNode(content)); } + else if (content) { for (var i = 0; i < content.length; ++i) { e.appendChild(content[i]); } } + return e + } + // wrapper for elt, which removes the elt from the accessibility tree + function eltP(tag, content, className, style) { + var e = elt(tag, content, className, style); + e.setAttribute("role", "presentation"); + return e + } + + var range; + if (document.createRange) { range = function(node, start, end, endNode) { + var r = document.createRange(); + r.setEnd(endNode || node, end); + r.setStart(node, start); + return r + }; } + else { range = function(node, start, end) { + var r = document.body.createTextRange(); + try { r.moveToElementText(node.parentNode); } + catch(e) { return r } + r.collapse(true); + r.moveEnd("character", end); + r.moveStart("character", start); + return r + }; } + + function contains(parent, child) { + if (child.nodeType == 3) // Android browser always returns false when child is a textnode + { child = child.parentNode; } + if (parent.contains) + { return parent.contains(child) } + do { + if (child.nodeType == 11) { child = child.host; } + if (child == parent) { return true } + } while (child = child.parentNode) + } + + function activeElt(rootNode) { + // IE and Edge may throw an "Unspecified Error" when accessing document.activeElement. + // IE < 10 will throw when accessed while the page is loading or in an iframe. + // IE > 9 and Edge will throw when accessed in an iframe if document.body is unavailable. + var doc = rootNode.ownerDocument || rootNode; + var activeElement; + try { + activeElement = rootNode.activeElement; + } catch(e) { + activeElement = doc.body || null; + } + while (activeElement && activeElement.shadowRoot && activeElement.shadowRoot.activeElement) + { activeElement = activeElement.shadowRoot.activeElement; } + return activeElement + } + + function addClass(node, cls) { + var current = node.className; + if (!classTest(cls).test(current)) { node.className += (current ? " " : "") + cls; } + } + function joinClasses(a, b) { + var as = a.split(" "); + for (var i = 0; i < as.length; i++) + { if (as[i] && !classTest(as[i]).test(b)) { b += " " + as[i]; } } + return b + } + + var selectInput = function(node) { node.select(); }; + if (ios) // Mobile Safari apparently has a bug where select() is broken. + { selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length; }; } + else if (ie) // Suppress mysterious IE10 errors + { selectInput = function(node) { try { node.select(); } catch(_e) {} }; } + + function doc(cm) { return cm.display.wrapper.ownerDocument } + + function root(cm) { + return rootNode(cm.display.wrapper) + } + + function rootNode(element) { + // Detect modern browsers (2017+). + return element.getRootNode ? element.getRootNode() : element.ownerDocument + } + + function win(cm) { return doc(cm).defaultView } + + function bind(f) { + var args = Array.prototype.slice.call(arguments, 1); + return function(){return f.apply(null, args)} + } + + function copyObj(obj, target, overwrite) { + if (!target) { target = {}; } + for (var prop in obj) + { if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop))) + { target[prop] = obj[prop]; } } + return target + } + + // Counts the column offset in a string, taking tabs into account. + // Used mostly to find indentation. + function countColumn(string, end, tabSize, startIndex, startValue) { + if (end == null) { + end = string.search(/[^\s\u00a0]/); + if (end == -1) { end = string.length; } + } + for (var i = startIndex || 0, n = startValue || 0;;) { + var nextTab = string.indexOf("\t", i); + if (nextTab < 0 || nextTab >= end) + { return n + (end - i) } + n += nextTab - i; + n += tabSize - (n % tabSize); + i = nextTab + 1; + } + } + + var Delayed = function() { + this.id = null; + this.f = null; + this.time = 0; + this.handler = bind(this.onTimeout, this); + }; + Delayed.prototype.onTimeout = function (self) { + self.id = 0; + if (self.time <= +new Date) { + self.f(); + } else { + setTimeout(self.handler, self.time - +new Date); + } + }; + Delayed.prototype.set = function (ms, f) { + this.f = f; + var time = +new Date + ms; + if (!this.id || time < this.time) { + clearTimeout(this.id); + this.id = setTimeout(this.handler, ms); + this.time = time; + } + }; + + function indexOf(array, elt) { + for (var i = 0; i < array.length; ++i) + { if (array[i] == elt) { return i } } + return -1 + } + + // Number of pixels added to scroller and sizer to hide scrollbar + var scrollerGap = 50; + + // Returned or thrown by various protocols to signal 'I'm not + // handling this'. + var Pass = {toString: function(){return "CodeMirror.Pass"}}; + + // Reused option objects for setSelection & friends + var sel_dontScroll = {scroll: false}, sel_mouse = {origin: "*mouse"}, sel_move = {origin: "+move"}; + + // The inverse of countColumn -- find the offset that corresponds to + // a particular column. + function findColumn(string, goal, tabSize) { + for (var pos = 0, col = 0;;) { + var nextTab = string.indexOf("\t", pos); + if (nextTab == -1) { nextTab = string.length; } + var skipped = nextTab - pos; + if (nextTab == string.length || col + skipped >= goal) + { return pos + Math.min(skipped, goal - col) } + col += nextTab - pos; + col += tabSize - (col % tabSize); + pos = nextTab + 1; + if (col >= goal) { return pos } + } + } + + var spaceStrs = [""]; + function spaceStr(n) { + while (spaceStrs.length <= n) + { spaceStrs.push(lst(spaceStrs) + " "); } + return spaceStrs[n] + } + + function lst(arr) { return arr[arr.length-1] } + + function map(array, f) { + var out = []; + for (var i = 0; i < array.length; i++) { out[i] = f(array[i], i); } + return out + } + + function insertSorted(array, value, score) { + var pos = 0, priority = score(value); + while (pos < array.length && score(array[pos]) <= priority) { pos++; } + array.splice(pos, 0, value); + } + + function nothing() {} + + function createObj(base, props) { + var inst; + if (Object.create) { + inst = Object.create(base); + } else { + nothing.prototype = base; + inst = new nothing(); + } + if (props) { copyObj(props, inst); } + return inst + } + + var nonASCIISingleCaseWordChar = /[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/; + function isWordCharBasic(ch) { + return /\w/.test(ch) || ch > "\x80" && + (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch)) + } + function isWordChar(ch, helper) { + if (!helper) { return isWordCharBasic(ch) } + if (helper.source.indexOf("\\w") > -1 && isWordCharBasic(ch)) { return true } + return helper.test(ch) + } + + function isEmpty(obj) { + for (var n in obj) { if (obj.hasOwnProperty(n) && obj[n]) { return false } } + return true + } + + // Extending unicode characters. A series of a non-extending char + + // any number of extending chars is treated as a single unit as far + // as editing and measuring is concerned. This is not fully correct, + // since some scripts/fonts/browsers also treat other configurations + // of code points as a group. + var extendingChars = /[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/; + function isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendingChars.test(ch) } + + // Returns a number from the range [`0`; `str.length`] unless `pos` is outside that range. + function skipExtendingChars(str, pos, dir) { + while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; } + return pos + } + + // Returns the value from the range [`from`; `to`] that satisfies + // `pred` and is closest to `from`. Assumes that at least `to` + // satisfies `pred`. Supports `from` being greater than `to`. + function findFirst(pred, from, to) { + // At any point we are certain `to` satisfies `pred`, don't know + // whether `from` does. + var dir = from > to ? -1 : 1; + for (;;) { + if (from == to) { return from } + var midF = (from + to) / 2, mid = dir < 0 ? Math.ceil(midF) : Math.floor(midF); + if (mid == from) { return pred(mid) ? from : to } + if (pred(mid)) { to = mid; } + else { from = mid + dir; } + } + } + + // BIDI HELPERS + + function iterateBidiSections(order, from, to, f) { + if (!order) { return f(from, to, "ltr", 0) } + var found = false; + for (var i = 0; i < order.length; ++i) { + var part = order[i]; + if (part.from < to && part.to > from || from == to && part.to == from) { + f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? "rtl" : "ltr", i); + found = true; + } + } + if (!found) { f(from, to, "ltr"); } + } + + var bidiOther = null; + function getBidiPartAt(order, ch, sticky) { + var found; + bidiOther = null; + for (var i = 0; i < order.length; ++i) { + var cur = order[i]; + if (cur.from < ch && cur.to > ch) { return i } + if (cur.to == ch) { + if (cur.from != cur.to && sticky == "before") { found = i; } + else { bidiOther = i; } + } + if (cur.from == ch) { + if (cur.from != cur.to && sticky != "before") { found = i; } + else { bidiOther = i; } + } + } + return found != null ? found : bidiOther + } + + // Bidirectional ordering algorithm + // See http://unicode.org/reports/tr9/tr9-13.html for the algorithm + // that this (partially) implements. + + // One-char codes used for character types: + // L (L): Left-to-Right + // R (R): Right-to-Left + // r (AL): Right-to-Left Arabic + // 1 (EN): European Number + // + (ES): European Number Separator + // % (ET): European Number Terminator + // n (AN): Arabic Number + // , (CS): Common Number Separator + // m (NSM): Non-Spacing Mark + // b (BN): Boundary Neutral + // s (B): Paragraph Separator + // t (S): Segment Separator + // w (WS): Whitespace + // N (ON): Other Neutrals + + // Returns null if characters are ordered as they appear + // (left-to-right), or an array of sections ({from, to, level} + // objects) in the order in which they occur visually. + var bidiOrdering = (function() { + // Character types for codepoints 0 to 0xff + var lowTypes = "bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN"; + // Character types for codepoints 0x600 to 0x6f9 + var arabicTypes = "nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111"; + function charType(code) { + if (code <= 0xf7) { return lowTypes.charAt(code) } + else if (0x590 <= code && code <= 0x5f4) { return "R" } + else if (0x600 <= code && code <= 0x6f9) { return arabicTypes.charAt(code - 0x600) } + else if (0x6ee <= code && code <= 0x8ac) { return "r" } + else if (0x2000 <= code && code <= 0x200b) { return "w" } + else if (code == 0x200c) { return "b" } + else { return "L" } + } + + var bidiRE = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/; + var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/; + + function BidiSpan(level, from, to) { + this.level = level; + this.from = from; this.to = to; + } + + return function(str, direction) { + var outerType = direction == "ltr" ? "L" : "R"; + + if (str.length == 0 || direction == "ltr" && !bidiRE.test(str)) { return false } + var len = str.length, types = []; + for (var i = 0; i < len; ++i) + { types.push(charType(str.charCodeAt(i))); } + + // W1. Examine each non-spacing mark (NSM) in the level run, and + // change the type of the NSM to the type of the previous + // character. If the NSM is at the start of the level run, it will + // get the type of sor. + for (var i$1 = 0, prev = outerType; i$1 < len; ++i$1) { + var type = types[i$1]; + if (type == "m") { types[i$1] = prev; } + else { prev = type; } + } + + // W2. Search backwards from each instance of a European number + // until the first strong type (R, L, AL, or sor) is found. If an + // AL is found, change the type of the European number to Arabic + // number. + // W3. Change all ALs to R. + for (var i$2 = 0, cur = outerType; i$2 < len; ++i$2) { + var type$1 = types[i$2]; + if (type$1 == "1" && cur == "r") { types[i$2] = "n"; } + else if (isStrong.test(type$1)) { cur = type$1; if (type$1 == "r") { types[i$2] = "R"; } } + } + + // W4. A single European separator between two European numbers + // changes to a European number. A single common separator between + // two numbers of the same type changes to that type. + for (var i$3 = 1, prev$1 = types[0]; i$3 < len - 1; ++i$3) { + var type$2 = types[i$3]; + if (type$2 == "+" && prev$1 == "1" && types[i$3+1] == "1") { types[i$3] = "1"; } + else if (type$2 == "," && prev$1 == types[i$3+1] && + (prev$1 == "1" || prev$1 == "n")) { types[i$3] = prev$1; } + prev$1 = type$2; + } + + // W5. A sequence of European terminators adjacent to European + // numbers changes to all European numbers. + // W6. Otherwise, separators and terminators change to Other + // Neutral. + for (var i$4 = 0; i$4 < len; ++i$4) { + var type$3 = types[i$4]; + if (type$3 == ",") { types[i$4] = "N"; } + else if (type$3 == "%") { + var end = (void 0); + for (end = i$4 + 1; end < len && types[end] == "%"; ++end) {} + var replace = (i$4 && types[i$4-1] == "!") || (end < len && types[end] == "1") ? "1" : "N"; + for (var j = i$4; j < end; ++j) { types[j] = replace; } + i$4 = end - 1; + } + } + + // W7. Search backwards from each instance of a European number + // until the first strong type (R, L, or sor) is found. If an L is + // found, then change the type of the European number to L. + for (var i$5 = 0, cur$1 = outerType; i$5 < len; ++i$5) { + var type$4 = types[i$5]; + if (cur$1 == "L" && type$4 == "1") { types[i$5] = "L"; } + else if (isStrong.test(type$4)) { cur$1 = type$4; } + } + + // N1. A sequence of neutrals takes the direction of the + // surrounding strong text if the text on both sides has the same + // direction. European and Arabic numbers act as if they were R in + // terms of their influence on neutrals. Start-of-level-run (sor) + // and end-of-level-run (eor) are used at level run boundaries. + // N2. Any remaining neutrals take the embedding direction. + for (var i$6 = 0; i$6 < len; ++i$6) { + if (isNeutral.test(types[i$6])) { + var end$1 = (void 0); + for (end$1 = i$6 + 1; end$1 < len && isNeutral.test(types[end$1]); ++end$1) {} + var before = (i$6 ? types[i$6-1] : outerType) == "L"; + var after = (end$1 < len ? types[end$1] : outerType) == "L"; + var replace$1 = before == after ? (before ? "L" : "R") : outerType; + for (var j$1 = i$6; j$1 < end$1; ++j$1) { types[j$1] = replace$1; } + i$6 = end$1 - 1; + } + } + + // Here we depart from the documented algorithm, in order to avoid + // building up an actual levels array. Since there are only three + // levels (0, 1, 2) in an implementation that doesn't take + // explicit embedding into account, we can build up the order on + // the fly, without following the level-based algorithm. + var order = [], m; + for (var i$7 = 0; i$7 < len;) { + if (countsAsLeft.test(types[i$7])) { + var start = i$7; + for (++i$7; i$7 < len && countsAsLeft.test(types[i$7]); ++i$7) {} + order.push(new BidiSpan(0, start, i$7)); + } else { + var pos = i$7, at = order.length, isRTL = direction == "rtl" ? 1 : 0; + for (++i$7; i$7 < len && types[i$7] != "L"; ++i$7) {} + for (var j$2 = pos; j$2 < i$7;) { + if (countsAsNum.test(types[j$2])) { + if (pos < j$2) { order.splice(at, 0, new BidiSpan(1, pos, j$2)); at += isRTL; } + var nstart = j$2; + for (++j$2; j$2 < i$7 && countsAsNum.test(types[j$2]); ++j$2) {} + order.splice(at, 0, new BidiSpan(2, nstart, j$2)); + at += isRTL; + pos = j$2; + } else { ++j$2; } + } + if (pos < i$7) { order.splice(at, 0, new BidiSpan(1, pos, i$7)); } + } + } + if (direction == "ltr") { + if (order[0].level == 1 && (m = str.match(/^\s+/))) { + order[0].from = m[0].length; + order.unshift(new BidiSpan(0, 0, m[0].length)); + } + if (lst(order).level == 1 && (m = str.match(/\s+$/))) { + lst(order).to -= m[0].length; + order.push(new BidiSpan(0, len - m[0].length, len)); + } + } + + return direction == "rtl" ? order.reverse() : order + } + })(); + + // Get the bidi ordering for the given line (and cache it). Returns + // false for lines that are fully left-to-right, and an array of + // BidiSpan objects otherwise. + function getOrder(line, direction) { + var order = line.order; + if (order == null) { order = line.order = bidiOrdering(line.text, direction); } + return order + } + + // EVENT HANDLING + + // Lightweight event framework. on/off also work on DOM nodes, + // registering native DOM handlers. + + var noHandlers = []; + + var on = function(emitter, type, f) { + if (emitter.addEventListener) { + emitter.addEventListener(type, f, false); + } else if (emitter.attachEvent) { + emitter.attachEvent("on" + type, f); + } else { + var map = emitter._handlers || (emitter._handlers = {}); + map[type] = (map[type] || noHandlers).concat(f); + } + }; + + function getHandlers(emitter, type) { + return emitter._handlers && emitter._handlers[type] || noHandlers + } + + function off(emitter, type, f) { + if (emitter.removeEventListener) { + emitter.removeEventListener(type, f, false); + } else if (emitter.detachEvent) { + emitter.detachEvent("on" + type, f); + } else { + var map = emitter._handlers, arr = map && map[type]; + if (arr) { + var index = indexOf(arr, f); + if (index > -1) + { map[type] = arr.slice(0, index).concat(arr.slice(index + 1)); } + } + } + } + + function signal(emitter, type /*, values...*/) { + var handlers = getHandlers(emitter, type); + if (!handlers.length) { return } + var args = Array.prototype.slice.call(arguments, 2); + for (var i = 0; i < handlers.length; ++i) { handlers[i].apply(null, args); } + } + + // The DOM events that CodeMirror handles can be overridden by + // registering a (non-DOM) handler on the editor for the event name, + // and preventDefault-ing the event in that handler. + function signalDOMEvent(cm, e, override) { + if (typeof e == "string") + { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; } + signal(cm, override || e.type, cm, e); + return e_defaultPrevented(e) || e.codemirrorIgnore + } + + function signalCursorActivity(cm) { + var arr = cm._handlers && cm._handlers.cursorActivity; + if (!arr) { return } + var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = []); + for (var i = 0; i < arr.length; ++i) { if (indexOf(set, arr[i]) == -1) + { set.push(arr[i]); } } + } + + function hasHandler(emitter, type) { + return getHandlers(emitter, type).length > 0 + } + + // Add on and off methods to a constructor's prototype, to make + // registering events on such objects more convenient. + function eventMixin(ctor) { + ctor.prototype.on = function(type, f) {on(this, type, f);}; + ctor.prototype.off = function(type, f) {off(this, type, f);}; + } + + // Due to the fact that we still support jurassic IE versions, some + // compatibility wrappers are needed. + + function e_preventDefault(e) { + if (e.preventDefault) { e.preventDefault(); } + else { e.returnValue = false; } + } + function e_stopPropagation(e) { + if (e.stopPropagation) { e.stopPropagation(); } + else { e.cancelBubble = true; } + } + function e_defaultPrevented(e) { + return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false + } + function e_stop(e) {e_preventDefault(e); e_stopPropagation(e);} + + function e_target(e) {return e.target || e.srcElement} + function e_button(e) { + var b = e.which; + if (b == null) { + if (e.button & 1) { b = 1; } + else if (e.button & 2) { b = 3; } + else if (e.button & 4) { b = 2; } + } + if (mac && e.ctrlKey && b == 1) { b = 3; } + return b + } + + // Detect drag-and-drop + var dragAndDrop = function() { + // There is *some* kind of drag-and-drop support in IE6-8, but I + // couldn't get it to work yet. + if (ie && ie_version < 9) { return false } + var div = elt('div'); + return "draggable" in div || "dragDrop" in div + }(); + + var zwspSupported; + function zeroWidthElement(measure) { + if (zwspSupported == null) { + var test = elt("span", "\u200b"); + removeChildrenAndAdd(measure, elt("span", [test, document.createTextNode("x")])); + if (measure.firstChild.offsetHeight != 0) + { zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8); } + } + var node = zwspSupported ? elt("span", "\u200b") : + elt("span", "\u00a0", null, "display: inline-block; width: 1px; margin-right: -1px"); + node.setAttribute("cm-text", ""); + return node + } + + // Feature-detect IE's crummy client rect reporting for bidi text + var badBidiRects; + function hasBadBidiRects(measure) { + if (badBidiRects != null) { return badBidiRects } + var txt = removeChildrenAndAdd(measure, document.createTextNode("A\u062eA")); + var r0 = range(txt, 0, 1).getBoundingClientRect(); + var r1 = range(txt, 1, 2).getBoundingClientRect(); + removeChildren(measure); + if (!r0 || r0.left == r0.right) { return false } // Safari returns null in some cases (#2780) + return badBidiRects = (r1.right - r0.right < 3) + } + + // See if "".split is the broken IE version, if so, provide an + // alternative way to split lines. + var splitLinesAuto = "\n\nb".split(/\n/).length != 3 ? function (string) { + var pos = 0, result = [], l = string.length; + while (pos <= l) { + var nl = string.indexOf("\n", pos); + if (nl == -1) { nl = string.length; } + var line = string.slice(pos, string.charAt(nl - 1) == "\r" ? nl - 1 : nl); + var rt = line.indexOf("\r"); + if (rt != -1) { + result.push(line.slice(0, rt)); + pos += rt + 1; + } else { + result.push(line); + pos = nl + 1; + } + } + return result + } : function (string) { return string.split(/\r\n?|\n/); }; + + var hasSelection = window.getSelection ? function (te) { + try { return te.selectionStart != te.selectionEnd } + catch(e) { return false } + } : function (te) { + var range; + try {range = te.ownerDocument.selection.createRange();} + catch(e) {} + if (!range || range.parentElement() != te) { return false } + return range.compareEndPoints("StartToEnd", range) != 0 + }; + + var hasCopyEvent = (function () { + var e = elt("div"); + if ("oncopy" in e) { return true } + e.setAttribute("oncopy", "return;"); + return typeof e.oncopy == "function" + })(); + + var badZoomedRects = null; + function hasBadZoomedRects(measure) { + if (badZoomedRects != null) { return badZoomedRects } + var node = removeChildrenAndAdd(measure, elt("span", "x")); + var normal = node.getBoundingClientRect(); + var fromRange = range(node, 0, 1).getBoundingClientRect(); + return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1 + } + + // Known modes, by name and by MIME + var modes = {}, mimeModes = {}; + + // Extra arguments are stored as the mode's dependencies, which is + // used by (legacy) mechanisms like loadmode.js to automatically + // load a mode. (Preferred mechanism is the require/define calls.) + function defineMode(name, mode) { + if (arguments.length > 2) + { mode.dependencies = Array.prototype.slice.call(arguments, 2); } + modes[name] = mode; + } + + function defineMIME(mime, spec) { + mimeModes[mime] = spec; + } + + // Given a MIME type, a {name, ...options} config object, or a name + // string, return a mode config object. + function resolveMode(spec) { + if (typeof spec == "string" && mimeModes.hasOwnProperty(spec)) { + spec = mimeModes[spec]; + } else if (spec && typeof spec.name == "string" && mimeModes.hasOwnProperty(spec.name)) { + var found = mimeModes[spec.name]; + if (typeof found == "string") { found = {name: found}; } + spec = createObj(found, spec); + spec.name = found.name; + } else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+xml$/.test(spec)) { + return resolveMode("application/xml") + } else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+json$/.test(spec)) { + return resolveMode("application/json") + } + if (typeof spec == "string") { return {name: spec} } + else { return spec || {name: "null"} } + } + + // Given a mode spec (anything that resolveMode accepts), find and + // initialize an actual mode object. + function getMode(options, spec) { + spec = resolveMode(spec); + var mfactory = modes[spec.name]; + if (!mfactory) { return getMode(options, "text/plain") } + var modeObj = mfactory(options, spec); + if (modeExtensions.hasOwnProperty(spec.name)) { + var exts = modeExtensions[spec.name]; + for (var prop in exts) { + if (!exts.hasOwnProperty(prop)) { continue } + if (modeObj.hasOwnProperty(prop)) { modeObj["_" + prop] = modeObj[prop]; } + modeObj[prop] = exts[prop]; + } + } + modeObj.name = spec.name; + if (spec.helperType) { modeObj.helperType = spec.helperType; } + if (spec.modeProps) { for (var prop$1 in spec.modeProps) + { modeObj[prop$1] = spec.modeProps[prop$1]; } } + + return modeObj + } + + // This can be used to attach properties to mode objects from + // outside the actual mode definition. + var modeExtensions = {}; + function extendMode(mode, properties) { + var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {}); + copyObj(properties, exts); + } + + function copyState(mode, state) { + if (state === true) { return state } + if (mode.copyState) { return mode.copyState(state) } + var nstate = {}; + for (var n in state) { + var val = state[n]; + if (val instanceof Array) { val = val.concat([]); } + nstate[n] = val; + } + return nstate + } + + // Given a mode and a state (for that mode), find the inner mode and + // state at the position that the state refers to. + function innerMode(mode, state) { + var info; + while (mode.innerMode) { + info = mode.innerMode(state); + if (!info || info.mode == mode) { break } + state = info.state; + mode = info.mode; + } + return info || {mode: mode, state: state} + } + + function startState(mode, a1, a2) { + return mode.startState ? mode.startState(a1, a2) : true + } + + // STRING STREAM + + // Fed to the mode parsers, provides helper functions to make + // parsers more succinct. + + var StringStream = function(string, tabSize, lineOracle) { + this.pos = this.start = 0; + this.string = string; + this.tabSize = tabSize || 8; + this.lastColumnPos = this.lastColumnValue = 0; + this.lineStart = 0; + this.lineOracle = lineOracle; + }; + + StringStream.prototype.eol = function () {return this.pos >= this.string.length}; + StringStream.prototype.sol = function () {return this.pos == this.lineStart}; + StringStream.prototype.peek = function () {return this.string.charAt(this.pos) || undefined}; + StringStream.prototype.next = function () { + if (this.pos < this.string.length) + { return this.string.charAt(this.pos++) } + }; + StringStream.prototype.eat = function (match) { + var ch = this.string.charAt(this.pos); + var ok; + if (typeof match == "string") { ok = ch == match; } + else { ok = ch && (match.test ? match.test(ch) : match(ch)); } + if (ok) {++this.pos; return ch} + }; + StringStream.prototype.eatWhile = function (match) { + var start = this.pos; + while (this.eat(match)){} + return this.pos > start + }; + StringStream.prototype.eatSpace = function () { + var start = this.pos; + while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) { ++this.pos; } + return this.pos > start + }; + StringStream.prototype.skipToEnd = function () {this.pos = this.string.length;}; + StringStream.prototype.skipTo = function (ch) { + var found = this.string.indexOf(ch, this.pos); + if (found > -1) {this.pos = found; return true} + }; + StringStream.prototype.backUp = function (n) {this.pos -= n;}; + StringStream.prototype.column = function () { + if (this.lastColumnPos < this.start) { + this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue); + this.lastColumnPos = this.start; + } + return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0) + }; + StringStream.prototype.indentation = function () { + return countColumn(this.string, null, this.tabSize) - + (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0) + }; + StringStream.prototype.match = function (pattern, consume, caseInsensitive) { + if (typeof pattern == "string") { + var cased = function (str) { return caseInsensitive ? str.toLowerCase() : str; }; + var substr = this.string.substr(this.pos, pattern.length); + if (cased(substr) == cased(pattern)) { + if (consume !== false) { this.pos += pattern.length; } + return true + } + } else { + var match = this.string.slice(this.pos).match(pattern); + if (match && match.index > 0) { return null } + if (match && consume !== false) { this.pos += match[0].length; } + return match + } + }; + StringStream.prototype.current = function (){return this.string.slice(this.start, this.pos)}; + StringStream.prototype.hideFirstChars = function (n, inner) { + this.lineStart += n; + try { return inner() } + finally { this.lineStart -= n; } + }; + StringStream.prototype.lookAhead = function (n) { + var oracle = this.lineOracle; + return oracle && oracle.lookAhead(n) + }; + StringStream.prototype.baseToken = function () { + var oracle = this.lineOracle; + return oracle && oracle.baseToken(this.pos) + }; + + // Find the line object corresponding to the given line number. + function getLine(doc, n) { + n -= doc.first; + if (n < 0 || n >= doc.size) { throw new Error("There is no line " + (n + doc.first) + " in the document.") } + var chunk = doc; + while (!chunk.lines) { + for (var i = 0;; ++i) { + var child = chunk.children[i], sz = child.chunkSize(); + if (n < sz) { chunk = child; break } + n -= sz; + } + } + return chunk.lines[n] + } + + // Get the part of a document between two positions, as an array of + // strings. + function getBetween(doc, start, end) { + var out = [], n = start.line; + doc.iter(start.line, end.line + 1, function (line) { + var text = line.text; + if (n == end.line) { text = text.slice(0, end.ch); } + if (n == start.line) { text = text.slice(start.ch); } + out.push(text); + ++n; + }); + return out + } + // Get the lines between from and to, as array of strings. + function getLines(doc, from, to) { + var out = []; + doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value + return out + } + + // Update the height of a line, propagating the height change + // upwards to parent nodes. + function updateLineHeight(line, height) { + var diff = height - line.height; + if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } } + } + + // Given a line object, find its line number by walking up through + // its parent links. + function lineNo(line) { + if (line.parent == null) { return null } + var cur = line.parent, no = indexOf(cur.lines, line); + for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) { + for (var i = 0;; ++i) { + if (chunk.children[i] == cur) { break } + no += chunk.children[i].chunkSize(); + } + } + return no + cur.first + } + + // Find the line at the given vertical position, using the height + // information in the document tree. + function lineAtHeight(chunk, h) { + var n = chunk.first; + outer: do { + for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) { + var child = chunk.children[i$1], ch = child.height; + if (h < ch) { chunk = child; continue outer } + h -= ch; + n += child.chunkSize(); + } + return n + } while (!chunk.lines) + var i = 0; + for (; i < chunk.lines.length; ++i) { + var line = chunk.lines[i], lh = line.height; + if (h < lh) { break } + h -= lh; + } + return n + i + } + + function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size} + + function lineNumberFor(options, i) { + return String(options.lineNumberFormatter(i + options.firstLineNumber)) + } + + // A Pos instance represents a position within the text. + function Pos(line, ch, sticky) { + if ( sticky === void 0 ) sticky = null; + + if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) } + this.line = line; + this.ch = ch; + this.sticky = sticky; + } + + // Compare two positions, return 0 if they are the same, a negative + // number when a is less, and a positive number otherwise. + function cmp(a, b) { return a.line - b.line || a.ch - b.ch } + + function equalCursorPos(a, b) { return a.sticky == b.sticky && cmp(a, b) == 0 } + + function copyPos(x) {return Pos(x.line, x.ch)} + function maxPos(a, b) { return cmp(a, b) < 0 ? b : a } + function minPos(a, b) { return cmp(a, b) < 0 ? a : b } + + // Most of the external API clips given positions to make sure they + // actually exist within the document. + function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1))} + function clipPos(doc, pos) { + if (pos.line < doc.first) { return Pos(doc.first, 0) } + var last = doc.first + doc.size - 1; + if (pos.line > last) { return Pos(last, getLine(doc, last).text.length) } + return clipToLen(pos, getLine(doc, pos.line).text.length) + } + function clipToLen(pos, linelen) { + var ch = pos.ch; + if (ch == null || ch > linelen) { return Pos(pos.line, linelen) } + else if (ch < 0) { return Pos(pos.line, 0) } + else { return pos } + } + function clipPosArray(doc, array) { + var out = []; + for (var i = 0; i < array.length; i++) { out[i] = clipPos(doc, array[i]); } + return out + } + + var SavedContext = function(state, lookAhead) { + this.state = state; + this.lookAhead = lookAhead; + }; + + var Context = function(doc, state, line, lookAhead) { + this.state = state; + this.doc = doc; + this.line = line; + this.maxLookAhead = lookAhead || 0; + this.baseTokens = null; + this.baseTokenPos = 1; + }; + + Context.prototype.lookAhead = function (n) { + var line = this.doc.getLine(this.line + n); + if (line != null && n > this.maxLookAhead) { this.maxLookAhead = n; } + return line + }; + + Context.prototype.baseToken = function (n) { + if (!this.baseTokens) { return null } + while (this.baseTokens[this.baseTokenPos] <= n) + { this.baseTokenPos += 2; } + var type = this.baseTokens[this.baseTokenPos + 1]; + return {type: type && type.replace(/( |^)overlay .*/, ""), + size: this.baseTokens[this.baseTokenPos] - n} + }; + + Context.prototype.nextLine = function () { + this.line++; + if (this.maxLookAhead > 0) { this.maxLookAhead--; } + }; + + Context.fromSaved = function (doc, saved, line) { + if (saved instanceof SavedContext) + { return new Context(doc, copyState(doc.mode, saved.state), line, saved.lookAhead) } + else + { return new Context(doc, copyState(doc.mode, saved), line) } + }; + + Context.prototype.save = function (copy) { + var state = copy !== false ? copyState(this.doc.mode, this.state) : this.state; + return this.maxLookAhead > 0 ? new SavedContext(state, this.maxLookAhead) : state + }; + + + // Compute a style array (an array starting with a mode generation + // -- for invalidation -- followed by pairs of end positions and + // style strings), which is used to highlight the tokens on the + // line. + function highlightLine(cm, line, context, forceToEnd) { + // A styles array always starts with a number identifying the + // mode/overlays that it is based on (for easy invalidation). + var st = [cm.state.modeGen], lineClasses = {}; + // Compute the base array of styles + runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); }, + lineClasses, forceToEnd); + var state = context.state; + + // Run overlays, adjust style array. + var loop = function ( o ) { + context.baseTokens = st; + var overlay = cm.state.overlays[o], i = 1, at = 0; + context.state = true; + runMode(cm, line.text, overlay.mode, context, function (end, style) { + var start = i; + // Ensure there's a token end at the current position, and that i points at it + while (at < end) { + var i_end = st[i]; + if (i_end > end) + { st.splice(i, 1, end, st[i+1], i_end); } + i += 2; + at = Math.min(end, i_end); + } + if (!style) { return } + if (overlay.opaque) { + st.splice(start, i - start, end, "overlay " + style); + i = start + 2; + } else { + for (; start < i; start += 2) { + var cur = st[start+1]; + st[start+1] = (cur ? cur + " " : "") + "overlay " + style; + } + } + }, lineClasses); + context.state = state; + context.baseTokens = null; + context.baseTokenPos = 1; + }; + + for (var o = 0; o < cm.state.overlays.length; ++o) loop( o ); + + return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null} + } + + function getLineStyles(cm, line, updateFrontier) { + if (!line.styles || line.styles[0] != cm.state.modeGen) { + var context = getContextBefore(cm, lineNo(line)); + var resetState = line.text.length > cm.options.maxHighlightLength && copyState(cm.doc.mode, context.state); + var result = highlightLine(cm, line, context); + if (resetState) { context.state = resetState; } + line.stateAfter = context.save(!resetState); + line.styles = result.styles; + if (result.classes) { line.styleClasses = result.classes; } + else if (line.styleClasses) { line.styleClasses = null; } + if (updateFrontier === cm.doc.highlightFrontier) + { cm.doc.modeFrontier = Math.max(cm.doc.modeFrontier, ++cm.doc.highlightFrontier); } + } + return line.styles + } + + function getContextBefore(cm, n, precise) { + var doc = cm.doc, display = cm.display; + if (!doc.mode.startState) { return new Context(doc, true, n) } + var start = findStartLine(cm, n, precise); + var saved = start > doc.first && getLine(doc, start - 1).stateAfter; + var context = saved ? Context.fromSaved(doc, saved, start) : new Context(doc, startState(doc.mode), start); + + doc.iter(start, n, function (line) { + processLine(cm, line.text, context); + var pos = context.line; + line.stateAfter = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo ? context.save() : null; + context.nextLine(); + }); + if (precise) { doc.modeFrontier = context.line; } + return context + } + + // Lightweight form of highlight -- proceed over this line and + // update state, but don't save a style array. Used for lines that + // aren't currently visible. + function processLine(cm, text, context, startAt) { + var mode = cm.doc.mode; + var stream = new StringStream(text, cm.options.tabSize, context); + stream.start = stream.pos = startAt || 0; + if (text == "") { callBlankLine(mode, context.state); } + while (!stream.eol()) { + readToken(mode, stream, context.state); + stream.start = stream.pos; + } + } + + function callBlankLine(mode, state) { + if (mode.blankLine) { return mode.blankLine(state) } + if (!mode.innerMode) { return } + var inner = innerMode(mode, state); + if (inner.mode.blankLine) { return inner.mode.blankLine(inner.state) } + } + + function readToken(mode, stream, state, inner) { + for (var i = 0; i < 10; i++) { + if (inner) { inner[0] = innerMode(mode, state).mode; } + var style = mode.token(stream, state); + if (stream.pos > stream.start) { return style } + } + throw new Error("Mode " + mode.name + " failed to advance stream.") + } + + var Token = function(stream, type, state) { + this.start = stream.start; this.end = stream.pos; + this.string = stream.current(); + this.type = type || null; + this.state = state; + }; + + // Utility for getTokenAt and getLineTokens + function takeToken(cm, pos, precise, asArray) { + var doc = cm.doc, mode = doc.mode, style; + pos = clipPos(doc, pos); + var line = getLine(doc, pos.line), context = getContextBefore(cm, pos.line, precise); + var stream = new StringStream(line.text, cm.options.tabSize, context), tokens; + if (asArray) { tokens = []; } + while ((asArray || stream.pos < pos.ch) && !stream.eol()) { + stream.start = stream.pos; + style = readToken(mode, stream, context.state); + if (asArray) { tokens.push(new Token(stream, style, copyState(doc.mode, context.state))); } + } + return asArray ? tokens : new Token(stream, style, context.state) + } + + function extractLineClasses(type, output) { + if (type) { for (;;) { + var lineClass = type.match(/(?:^|\s+)line-(background-)?(\S+)/); + if (!lineClass) { break } + type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length); + var prop = lineClass[1] ? "bgClass" : "textClass"; + if (output[prop] == null) + { output[prop] = lineClass[2]; } + else if (!(new RegExp("(?:^|\\s)" + lineClass[2] + "(?:$|\\s)")).test(output[prop])) + { output[prop] += " " + lineClass[2]; } + } } + return type + } + + // Run the given mode's parser over a line, calling f for each token. + function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) { + var flattenSpans = mode.flattenSpans; + if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans; } + var curStart = 0, curStyle = null; + var stream = new StringStream(text, cm.options.tabSize, context), style; + var inner = cm.options.addModeClass && [null]; + if (text == "") { extractLineClasses(callBlankLine(mode, context.state), lineClasses); } + while (!stream.eol()) { + if (stream.pos > cm.options.maxHighlightLength) { + flattenSpans = false; + if (forceToEnd) { processLine(cm, text, context, stream.pos); } + stream.pos = text.length; + style = null; + } else { + style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses); + } + if (inner) { + var mName = inner[0].name; + if (mName) { style = "m-" + (style ? mName + " " + style : mName); } + } + if (!flattenSpans || curStyle != style) { + while (curStart < stream.start) { + curStart = Math.min(stream.start, curStart + 5000); + f(curStart, curStyle); + } + curStyle = style; + } + stream.start = stream.pos; + } + while (curStart < stream.pos) { + // Webkit seems to refuse to render text nodes longer than 57444 + // characters, and returns inaccurate measurements in nodes + // starting around 5000 chars. + var pos = Math.min(stream.pos, curStart + 5000); + f(pos, curStyle); + curStart = pos; + } + } + + // Finds the line to start with when starting a parse. Tries to + // find a line with a stateAfter, so that it can start with a + // valid state. If that fails, it returns the line with the + // smallest indentation, which tends to need the least context to + // parse correctly. + function findStartLine(cm, n, precise) { + var minindent, minline, doc = cm.doc; + var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100); + for (var search = n; search > lim; --search) { + if (search <= doc.first) { return doc.first } + var line = getLine(doc, search - 1), after = line.stateAfter; + if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier)) + { return search } + var indented = countColumn(line.text, null, cm.options.tabSize); + if (minline == null || minindent > indented) { + minline = search - 1; + minindent = indented; + } + } + return minline + } + + function retreatFrontier(doc, n) { + doc.modeFrontier = Math.min(doc.modeFrontier, n); + if (doc.highlightFrontier < n - 10) { return } + var start = doc.first; + for (var line = n - 1; line > start; line--) { + var saved = getLine(doc, line).stateAfter; + // change is on 3 + // state on line 1 looked ahead 2 -- so saw 3 + // test 1 + 2 < 3 should cover this + if (saved && (!(saved instanceof SavedContext) || line + saved.lookAhead < n)) { + start = line + 1; + break + } + } + doc.highlightFrontier = Math.min(doc.highlightFrontier, start); + } + + // Optimize some code when these features are not used. + var sawReadOnlySpans = false, sawCollapsedSpans = false; + + function seeReadOnlySpans() { + sawReadOnlySpans = true; + } + + function seeCollapsedSpans() { + sawCollapsedSpans = true; + } + + // TEXTMARKER SPANS + + function MarkedSpan(marker, from, to) { + this.marker = marker; + this.from = from; this.to = to; + } + + // Search an array of spans for a span matching the given marker. + function getMarkedSpanFor(spans, marker) { + if (spans) { for (var i = 0; i < spans.length; ++i) { + var span = spans[i]; + if (span.marker == marker) { return span } + } } + } + + // Remove a span from an array, returning undefined if no spans are + // left (we don't store arrays for lines without spans). + function removeMarkedSpan(spans, span) { + var r; + for (var i = 0; i < spans.length; ++i) + { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } } + return r + } + + // Add a span to a line. + function addMarkedSpan(line, span, op) { + var inThisOp = op && window.WeakSet && (op.markedSpans || (op.markedSpans = new WeakSet)); + if (inThisOp && line.markedSpans && inThisOp.has(line.markedSpans)) { + line.markedSpans.push(span); + } else { + line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span]; + if (inThisOp) { inThisOp.add(line.markedSpans); } + } + span.marker.attachLine(line); + } + + // Used for the algorithm that adjusts markers for a change in the + // document. These functions cut an array of spans at a given + // character position, returning an array of remaining chunks (or + // undefined if nothing remains). + function markedSpansBefore(old, startCh, isInsert) { + var nw; + if (old) { for (var i = 0; i < old.length; ++i) { + var span = old[i], marker = span.marker; + var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh); + if (startsBefore || span.from == startCh && marker.type == "bookmark" && (!isInsert || !span.marker.insertLeft)) { + var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh) + ;(nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to)); + } + } } + return nw + } + function markedSpansAfter(old, endCh, isInsert) { + var nw; + if (old) { for (var i = 0; i < old.length; ++i) { + var span = old[i], marker = span.marker; + var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh); + if (endsAfter || span.from == endCh && marker.type == "bookmark" && (!isInsert || span.marker.insertLeft)) { + var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh) + ;(nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh, + span.to == null ? null : span.to - endCh)); + } + } } + return nw + } + + // Given a change object, compute the new set of marker spans that + // cover the line in which the change took place. Removes spans + // entirely within the change, reconnects spans belonging to the + // same marker that appear on both sides of the change, and cuts off + // spans partially within the change. Returns an array of span + // arrays with one element for each line in (after) the change. + function stretchSpansOverChange(doc, change) { + if (change.full) { return null } + var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans; + var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans; + if (!oldFirst && !oldLast) { return null } + + var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0; + // Get the spans that 'stick out' on both sides + var first = markedSpansBefore(oldFirst, startCh, isInsert); + var last = markedSpansAfter(oldLast, endCh, isInsert); + + // Next, merge those two ends + var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0); + if (first) { + // Fix up .to properties of first + for (var i = 0; i < first.length; ++i) { + var span = first[i]; + if (span.to == null) { + var found = getMarkedSpanFor(last, span.marker); + if (!found) { span.to = startCh; } + else if (sameLine) { span.to = found.to == null ? null : found.to + offset; } + } + } + } + if (last) { + // Fix up .from in last (or move them into first in case of sameLine) + for (var i$1 = 0; i$1 < last.length; ++i$1) { + var span$1 = last[i$1]; + if (span$1.to != null) { span$1.to += offset; } + if (span$1.from == null) { + var found$1 = getMarkedSpanFor(first, span$1.marker); + if (!found$1) { + span$1.from = offset; + if (sameLine) { (first || (first = [])).push(span$1); } + } + } else { + span$1.from += offset; + if (sameLine) { (first || (first = [])).push(span$1); } + } + } + } + // Make sure we didn't create any zero-length spans + if (first) { first = clearEmptySpans(first); } + if (last && last != first) { last = clearEmptySpans(last); } + + var newMarkers = [first]; + if (!sameLine) { + // Fill gap with whole-line-spans + var gap = change.text.length - 2, gapMarkers; + if (gap > 0 && first) + { for (var i$2 = 0; i$2 < first.length; ++i$2) + { if (first[i$2].to == null) + { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)); } } } + for (var i$3 = 0; i$3 < gap; ++i$3) + { newMarkers.push(gapMarkers); } + newMarkers.push(last); + } + return newMarkers + } + + // Remove spans that are empty and don't have a clearWhenEmpty + // option of false. + function clearEmptySpans(spans) { + for (var i = 0; i < spans.length; ++i) { + var span = spans[i]; + if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false) + { spans.splice(i--, 1); } + } + if (!spans.length) { return null } + return spans + } + + // Used to 'clip' out readOnly ranges when making a change. + function removeReadOnlyRanges(doc, from, to) { + var markers = null; + doc.iter(from.line, to.line + 1, function (line) { + if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) { + var mark = line.markedSpans[i].marker; + if (mark.readOnly && (!markers || indexOf(markers, mark) == -1)) + { (markers || (markers = [])).push(mark); } + } } + }); + if (!markers) { return null } + var parts = [{from: from, to: to}]; + for (var i = 0; i < markers.length; ++i) { + var mk = markers[i], m = mk.find(0); + for (var j = 0; j < parts.length; ++j) { + var p = parts[j]; + if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue } + var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to); + if (dfrom < 0 || !mk.inclusiveLeft && !dfrom) + { newParts.push({from: p.from, to: m.from}); } + if (dto > 0 || !mk.inclusiveRight && !dto) + { newParts.push({from: m.to, to: p.to}); } + parts.splice.apply(parts, newParts); + j += newParts.length - 3; + } + } + return parts + } + + // Connect or disconnect spans from a line. + function detachMarkedSpans(line) { + var spans = line.markedSpans; + if (!spans) { return } + for (var i = 0; i < spans.length; ++i) + { spans[i].marker.detachLine(line); } + line.markedSpans = null; + } + function attachMarkedSpans(line, spans) { + if (!spans) { return } + for (var i = 0; i < spans.length; ++i) + { spans[i].marker.attachLine(line); } + line.markedSpans = spans; + } + + // Helpers used when computing which overlapping collapsed span + // counts as the larger one. + function extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0 } + function extraRight(marker) { return marker.inclusiveRight ? 1 : 0 } + + // Returns a number indicating which of two overlapping collapsed + // spans is larger (and thus includes the other). Falls back to + // comparing ids when the spans cover exactly the same range. + function compareCollapsedMarkers(a, b) { + var lenDiff = a.lines.length - b.lines.length; + if (lenDiff != 0) { return lenDiff } + var aPos = a.find(), bPos = b.find(); + var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b); + if (fromCmp) { return -fromCmp } + var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b); + if (toCmp) { return toCmp } + return b.id - a.id + } + + // Find out whether a line ends or starts in a collapsed span. If + // so, return the marker for that span. + function collapsedSpanAtSide(line, start) { + var sps = sawCollapsedSpans && line.markedSpans, found; + if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) { + sp = sps[i]; + if (sp.marker.collapsed && (start ? sp.from : sp.to) == null && + (!found || compareCollapsedMarkers(found, sp.marker) < 0)) + { found = sp.marker; } + } } + return found + } + function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true) } + function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false) } + + function collapsedSpanAround(line, ch) { + var sps = sawCollapsedSpans && line.markedSpans, found; + if (sps) { for (var i = 0; i < sps.length; ++i) { + var sp = sps[i]; + if (sp.marker.collapsed && (sp.from == null || sp.from < ch) && (sp.to == null || sp.to > ch) && + (!found || compareCollapsedMarkers(found, sp.marker) < 0)) { found = sp.marker; } + } } + return found + } + + // Test whether there exists a collapsed span that partially + // overlaps (covers the start or end, but not both) of a new span. + // Such overlap is not allowed. + function conflictingCollapsedRange(doc, lineNo, from, to, marker) { + var line = getLine(doc, lineNo); + var sps = sawCollapsedSpans && line.markedSpans; + if (sps) { for (var i = 0; i < sps.length; ++i) { + var sp = sps[i]; + if (!sp.marker.collapsed) { continue } + var found = sp.marker.find(0); + var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker); + var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker); + if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue } + if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) || + fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0)) + { return true } + } } + } + + // A visual line is a line as drawn on the screen. Folding, for + // example, can cause multiple logical lines to appear on the same + // visual line. This finds the start of the visual line that the + // given line is part of (usually that is the line itself). + function visualLine(line) { + var merged; + while (merged = collapsedSpanAtStart(line)) + { line = merged.find(-1, true).line; } + return line + } + + function visualLineEnd(line) { + var merged; + while (merged = collapsedSpanAtEnd(line)) + { line = merged.find(1, true).line; } + return line + } + + // Returns an array of logical lines that continue the visual line + // started by the argument, or undefined if there are no such lines. + function visualLineContinued(line) { + var merged, lines; + while (merged = collapsedSpanAtEnd(line)) { + line = merged.find(1, true).line + ;(lines || (lines = [])).push(line); + } + return lines + } + + // Get the line number of the start of the visual line that the + // given line number is part of. + function visualLineNo(doc, lineN) { + var line = getLine(doc, lineN), vis = visualLine(line); + if (line == vis) { return lineN } + return lineNo(vis) + } + + // Get the line number of the start of the next visual line after + // the given line. + function visualLineEndNo(doc, lineN) { + if (lineN > doc.lastLine()) { return lineN } + var line = getLine(doc, lineN), merged; + if (!lineIsHidden(doc, line)) { return lineN } + while (merged = collapsedSpanAtEnd(line)) + { line = merged.find(1, true).line; } + return lineNo(line) + 1 + } + + // Compute whether a line is hidden. Lines count as hidden when they + // are part of a visual line that starts with another line, or when + // they are entirely covered by collapsed, non-widget span. + function lineIsHidden(doc, line) { + var sps = sawCollapsedSpans && line.markedSpans; + if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) { + sp = sps[i]; + if (!sp.marker.collapsed) { continue } + if (sp.from == null) { return true } + if (sp.marker.widgetNode) { continue } + if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp)) + { return true } + } } + } + function lineIsHiddenInner(doc, line, span) { + if (span.to == null) { + var end = span.marker.find(1, true); + return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker)) + } + if (span.marker.inclusiveRight && span.to == line.text.length) + { return true } + for (var sp = (void 0), i = 0; i < line.markedSpans.length; ++i) { + sp = line.markedSpans[i]; + if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to && + (sp.to == null || sp.to != span.from) && + (sp.marker.inclusiveLeft || span.marker.inclusiveRight) && + lineIsHiddenInner(doc, line, sp)) { return true } + } + } + + // Find the height above the given line. + function heightAtLine(lineObj) { + lineObj = visualLine(lineObj); + + var h = 0, chunk = lineObj.parent; + for (var i = 0; i < chunk.lines.length; ++i) { + var line = chunk.lines[i]; + if (line == lineObj) { break } + else { h += line.height; } + } + for (var p = chunk.parent; p; chunk = p, p = chunk.parent) { + for (var i$1 = 0; i$1 < p.children.length; ++i$1) { + var cur = p.children[i$1]; + if (cur == chunk) { break } + else { h += cur.height; } + } + } + return h + } + + // Compute the character length of a line, taking into account + // collapsed ranges (see markText) that might hide parts, and join + // other lines onto it. + function lineLength(line) { + if (line.height == 0) { return 0 } + var len = line.text.length, merged, cur = line; + while (merged = collapsedSpanAtStart(cur)) { + var found = merged.find(0, true); + cur = found.from.line; + len += found.from.ch - found.to.ch; + } + cur = line; + while (merged = collapsedSpanAtEnd(cur)) { + var found$1 = merged.find(0, true); + len -= cur.text.length - found$1.from.ch; + cur = found$1.to.line; + len += cur.text.length - found$1.to.ch; + } + return len + } + + // Find the longest line in the document. + function findMaxLine(cm) { + var d = cm.display, doc = cm.doc; + d.maxLine = getLine(doc, doc.first); + d.maxLineLength = lineLength(d.maxLine); + d.maxLineChanged = true; + doc.iter(function (line) { + var len = lineLength(line); + if (len > d.maxLineLength) { + d.maxLineLength = len; + d.maxLine = line; + } + }); + } + + // LINE DATA STRUCTURE + + // Line objects. These hold state related to a line, including + // highlighting info (the styles array). + var Line = function(text, markedSpans, estimateHeight) { + this.text = text; + attachMarkedSpans(this, markedSpans); + this.height = estimateHeight ? estimateHeight(this) : 1; + }; + + Line.prototype.lineNo = function () { return lineNo(this) }; + eventMixin(Line); + + // Change the content (text, markers) of a line. Automatically + // invalidates cached information and tries to re-estimate the + // line's height. + function updateLine(line, text, markedSpans, estimateHeight) { + line.text = text; + if (line.stateAfter) { line.stateAfter = null; } + if (line.styles) { line.styles = null; } + if (line.order != null) { line.order = null; } + detachMarkedSpans(line); + attachMarkedSpans(line, markedSpans); + var estHeight = estimateHeight ? estimateHeight(line) : 1; + if (estHeight != line.height) { updateLineHeight(line, estHeight); } + } + + // Detach a line from the document tree and its markers. + function cleanUpLine(line) { + line.parent = null; + detachMarkedSpans(line); + } + + // Convert a style as returned by a mode (either null, or a string + // containing one or more styles) to a CSS style. This is cached, + // and also looks for line-wide styles. + var styleToClassCache = {}, styleToClassCacheWithMode = {}; + function interpretTokenStyle(style, options) { + if (!style || /^\s*$/.test(style)) { return null } + var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache; + return cache[style] || + (cache[style] = style.replace(/\S+/g, "cm-$&")) + } + + // Render the DOM representation of the text of a line. Also builds + // up a 'line map', which points at the DOM nodes that represent + // specific stretches of text, and is used by the measuring code. + // The returned object contains the DOM node, this map, and + // information about line-wide styles that were set by the mode. + function buildLineContent(cm, lineView) { + // The padding-right forces the element to have a 'border', which + // is needed on Webkit to be able to get line-level bounding + // rectangles for it (in measureChar). + var content = eltP("span", null, null, webkit ? "padding-right: .1px" : null); + var builder = {pre: eltP("pre", [content], "CodeMirror-line"), content: content, + col: 0, pos: 0, cm: cm, + trailingSpace: false, + splitSpaces: cm.getOption("lineWrapping")}; + lineView.measure = {}; + + // Iterate over the logical lines that make up this visual line. + for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) { + var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0); + builder.pos = 0; + builder.addToken = buildToken; + // Optionally wire in some hacks into the token-rendering + // algorithm, to deal with browser quirks. + if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction))) + { builder.addToken = buildTokenBadBidi(builder.addToken, order); } + builder.map = []; + var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line); + insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate)); + if (line.styleClasses) { + if (line.styleClasses.bgClass) + { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || ""); } + if (line.styleClasses.textClass) + { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || ""); } + } + + // Ensure at least a single node is present, for measuring. + if (builder.map.length == 0) + { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); } + + // Store the map and a cache object for the current logical line + if (i == 0) { + lineView.measure.map = builder.map; + lineView.measure.cache = {}; + } else { + (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map) + ;(lineView.measure.caches || (lineView.measure.caches = [])).push({}); + } + } + + // See issue #2901 + if (webkit) { + var last = builder.content.lastChild; + if (/\bcm-tab\b/.test(last.className) || (last.querySelector && last.querySelector(".cm-tab"))) + { builder.content.className = "cm-tab-wrap-hack"; } + } + + signal(cm, "renderLine", cm, lineView.line, builder.pre); + if (builder.pre.className) + { builder.textClass = joinClasses(builder.pre.className, builder.textClass || ""); } + + return builder + } + + function defaultSpecialCharPlaceholder(ch) { + var token = elt("span", "\u2022", "cm-invalidchar"); + token.title = "\\u" + ch.charCodeAt(0).toString(16); + token.setAttribute("aria-label", token.title); + return token + } + + // Build up the DOM representation for a single token, and add it to + // the line map. Takes care to render special characters separately. + function buildToken(builder, text, style, startStyle, endStyle, css, attributes) { + if (!text) { return } + var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text; + var special = builder.cm.state.specialChars, mustWrap = false; + var content; + if (!special.test(text)) { + builder.col += text.length; + content = document.createTextNode(displayText); + builder.map.push(builder.pos, builder.pos + text.length, content); + if (ie && ie_version < 9) { mustWrap = true; } + builder.pos += text.length; + } else { + content = document.createDocumentFragment(); + var pos = 0; + while (true) { + special.lastIndex = pos; + var m = special.exec(text); + var skipped = m ? m.index - pos : text.length - pos; + if (skipped) { + var txt = document.createTextNode(displayText.slice(pos, pos + skipped)); + if (ie && ie_version < 9) { content.appendChild(elt("span", [txt])); } + else { content.appendChild(txt); } + builder.map.push(builder.pos, builder.pos + skipped, txt); + builder.col += skipped; + builder.pos += skipped; + } + if (!m) { break } + pos += skipped + 1; + var txt$1 = (void 0); + if (m[0] == "\t") { + var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize; + txt$1 = content.appendChild(elt("span", spaceStr(tabWidth), "cm-tab")); + txt$1.setAttribute("role", "presentation"); + txt$1.setAttribute("cm-text", "\t"); + builder.col += tabWidth; + } else if (m[0] == "\r" || m[0] == "\n") { + txt$1 = content.appendChild(elt("span", m[0] == "\r" ? "\u240d" : "\u2424", "cm-invalidchar")); + txt$1.setAttribute("cm-text", m[0]); + builder.col += 1; + } else { + txt$1 = builder.cm.options.specialCharPlaceholder(m[0]); + txt$1.setAttribute("cm-text", m[0]); + if (ie && ie_version < 9) { content.appendChild(elt("span", [txt$1])); } + else { content.appendChild(txt$1); } + builder.col += 1; + } + builder.map.push(builder.pos, builder.pos + 1, txt$1); + builder.pos++; + } + } + builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32; + if (style || startStyle || endStyle || mustWrap || css || attributes) { + var fullStyle = style || ""; + if (startStyle) { fullStyle += startStyle; } + if (endStyle) { fullStyle += endStyle; } + var token = elt("span", [content], fullStyle, css); + if (attributes) { + for (var attr in attributes) { if (attributes.hasOwnProperty(attr) && attr != "style" && attr != "class") + { token.setAttribute(attr, attributes[attr]); } } + } + return builder.content.appendChild(token) + } + builder.content.appendChild(content); + } + + // Change some spaces to NBSP to prevent the browser from collapsing + // trailing spaces at the end of a line when rendering text (issue #1362). + function splitSpaces(text, trailingBefore) { + if (text.length > 1 && !/ /.test(text)) { return text } + var spaceBefore = trailingBefore, result = ""; + for (var i = 0; i < text.length; i++) { + var ch = text.charAt(i); + if (ch == " " && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32)) + { ch = "\u00a0"; } + result += ch; + spaceBefore = ch == " "; + } + return result + } + + // Work around nonsense dimensions being reported for stretches of + // right-to-left text. + function buildTokenBadBidi(inner, order) { + return function (builder, text, style, startStyle, endStyle, css, attributes) { + style = style ? style + " cm-force-border" : "cm-force-border"; + var start = builder.pos, end = start + text.length; + for (;;) { + // Find the part that overlaps with the start of this text + var part = (void 0); + for (var i = 0; i < order.length; i++) { + part = order[i]; + if (part.to > start && part.from <= start) { break } + } + if (part.to >= end) { return inner(builder, text, style, startStyle, endStyle, css, attributes) } + inner(builder, text.slice(0, part.to - start), style, startStyle, null, css, attributes); + startStyle = null; + text = text.slice(part.to - start); + start = part.to; + } + } + } + + function buildCollapsedSpan(builder, size, marker, ignoreWidget) { + var widget = !ignoreWidget && marker.widgetNode; + if (widget) { builder.map.push(builder.pos, builder.pos + size, widget); } + if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) { + if (!widget) + { widget = builder.content.appendChild(document.createElement("span")); } + widget.setAttribute("cm-marker", marker.id); + } + if (widget) { + builder.cm.display.input.setUneditable(widget); + builder.content.appendChild(widget); + } + builder.pos += size; + builder.trailingSpace = false; + } + + // Outputs a number of spans to make up a line, taking highlighting + // and marked text into account. + function insertLineContent(line, builder, styles) { + var spans = line.markedSpans, allText = line.text, at = 0; + if (!spans) { + for (var i$1 = 1; i$1 < styles.length; i$1+=2) + { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); } + return + } + + var len = allText.length, pos = 0, i = 1, text = "", style, css; + var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes; + for (;;) { + if (nextChange == pos) { // Update current marker set + spanStyle = spanEndStyle = spanStartStyle = css = ""; + attributes = null; + collapsed = null; nextChange = Infinity; + var foundBookmarks = [], endStyles = (void 0); + for (var j = 0; j < spans.length; ++j) { + var sp = spans[j], m = sp.marker; + if (m.type == "bookmark" && sp.from == pos && m.widgetNode) { + foundBookmarks.push(m); + } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) { + if (sp.to != null && sp.to != pos && nextChange > sp.to) { + nextChange = sp.to; + spanEndStyle = ""; + } + if (m.className) { spanStyle += " " + m.className; } + if (m.css) { css = (css ? css + ";" : "") + m.css; } + if (m.startStyle && sp.from == pos) { spanStartStyle += " " + m.startStyle; } + if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); } + // support for the old title property + // https://github.com/codemirror/CodeMirror/pull/5673 + if (m.title) { (attributes || (attributes = {})).title = m.title; } + if (m.attributes) { + for (var attr in m.attributes) + { (attributes || (attributes = {}))[attr] = m.attributes[attr]; } + } + if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0)) + { collapsed = sp; } + } else if (sp.from > pos && nextChange > sp.from) { + nextChange = sp.from; + } + } + if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2) + { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += " " + endStyles[j$1]; } } } + + if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2) + { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } } + if (collapsed && (collapsed.from || 0) == pos) { + buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos, + collapsed.marker, collapsed.from == null); + if (collapsed.to == null) { return } + if (collapsed.to == pos) { collapsed = false; } + } + } + if (pos >= len) { break } + + var upto = Math.min(len, nextChange); + while (true) { + if (text) { + var end = pos + text.length; + if (!collapsed) { + var tokenText = end > upto ? text.slice(0, upto - pos) : text; + builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle, + spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : "", css, attributes); + } + if (end >= upto) {text = text.slice(upto - pos); pos = upto; break} + pos = end; + spanStartStyle = ""; + } + text = allText.slice(at, at = styles[i++]); + style = interpretTokenStyle(styles[i++], builder.cm.options); + } + } + } + + + // These objects are used to represent the visible (currently drawn) + // part of the document. A LineView may correspond to multiple + // logical lines, if those are connected by collapsed ranges. + function LineView(doc, line, lineN) { + // The starting line + this.line = line; + // Continuing lines, if any + this.rest = visualLineContinued(line); + // Number of logical lines in this visual line + this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1; + this.node = this.text = null; + this.hidden = lineIsHidden(doc, line); + } + + // Create a range of LineView objects for the given lines. + function buildViewArray(cm, from, to) { + var array = [], nextPos; + for (var pos = from; pos < to; pos = nextPos) { + var view = new LineView(cm.doc, getLine(cm.doc, pos), pos); + nextPos = pos + view.size; + array.push(view); + } + return array + } + + var operationGroup = null; + + function pushOperation(op) { + if (operationGroup) { + operationGroup.ops.push(op); + } else { + op.ownsGroup = operationGroup = { + ops: [op], + delayedCallbacks: [] + }; + } + } + + function fireCallbacksForOps(group) { + // Calls delayed callbacks and cursorActivity handlers until no + // new ones appear + var callbacks = group.delayedCallbacks, i = 0; + do { + for (; i < callbacks.length; i++) + { callbacks[i].call(null); } + for (var j = 0; j < group.ops.length; j++) { + var op = group.ops[j]; + if (op.cursorActivityHandlers) + { while (op.cursorActivityCalled < op.cursorActivityHandlers.length) + { op.cursorActivityHandlers[op.cursorActivityCalled++].call(null, op.cm); } } + } + } while (i < callbacks.length) + } + + function finishOperation(op, endCb) { + var group = op.ownsGroup; + if (!group) { return } + + try { fireCallbacksForOps(group); } + finally { + operationGroup = null; + endCb(group); + } + } + + var orphanDelayedCallbacks = null; + + // Often, we want to signal events at a point where we are in the + // middle of some work, but don't want the handler to start calling + // other methods on the editor, which might be in an inconsistent + // state or simply not expect any other events to happen. + // signalLater looks whether there are any handlers, and schedules + // them to be executed when the last operation ends, or, if no + // operation is active, when a timeout fires. + function signalLater(emitter, type /*, values...*/) { + var arr = getHandlers(emitter, type); + if (!arr.length) { return } + var args = Array.prototype.slice.call(arguments, 2), list; + if (operationGroup) { + list = operationGroup.delayedCallbacks; + } else if (orphanDelayedCallbacks) { + list = orphanDelayedCallbacks; + } else { + list = orphanDelayedCallbacks = []; + setTimeout(fireOrphanDelayed, 0); + } + var loop = function ( i ) { + list.push(function () { return arr[i].apply(null, args); }); + }; + + for (var i = 0; i < arr.length; ++i) + loop( i ); + } + + function fireOrphanDelayed() { + var delayed = orphanDelayedCallbacks; + orphanDelayedCallbacks = null; + for (var i = 0; i < delayed.length; ++i) { delayed[i](); } + } + + // When an aspect of a line changes, a string is added to + // lineView.changes. This updates the relevant part of the line's + // DOM structure. + function updateLineForChanges(cm, lineView, lineN, dims) { + for (var j = 0; j < lineView.changes.length; j++) { + var type = lineView.changes[j]; + if (type == "text") { updateLineText(cm, lineView); } + else if (type == "gutter") { updateLineGutter(cm, lineView, lineN, dims); } + else if (type == "class") { updateLineClasses(cm, lineView); } + else if (type == "widget") { updateLineWidgets(cm, lineView, dims); } + } + lineView.changes = null; + } + + // Lines with gutter elements, widgets or a background class need to + // be wrapped, and have the extra elements added to the wrapper div + function ensureLineWrapped(lineView) { + if (lineView.node == lineView.text) { + lineView.node = elt("div", null, null, "position: relative"); + if (lineView.text.parentNode) + { lineView.text.parentNode.replaceChild(lineView.node, lineView.text); } + lineView.node.appendChild(lineView.text); + if (ie && ie_version < 8) { lineView.node.style.zIndex = 2; } + } + return lineView.node + } + + function updateLineBackground(cm, lineView) { + var cls = lineView.bgClass ? lineView.bgClass + " " + (lineView.line.bgClass || "") : lineView.line.bgClass; + if (cls) { cls += " CodeMirror-linebackground"; } + if (lineView.background) { + if (cls) { lineView.background.className = cls; } + else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null; } + } else if (cls) { + var wrap = ensureLineWrapped(lineView); + lineView.background = wrap.insertBefore(elt("div", null, cls), wrap.firstChild); + cm.display.input.setUneditable(lineView.background); + } + } + + // Wrapper around buildLineContent which will reuse the structure + // in display.externalMeasured when possible. + function getLineContent(cm, lineView) { + var ext = cm.display.externalMeasured; + if (ext && ext.line == lineView.line) { + cm.display.externalMeasured = null; + lineView.measure = ext.measure; + return ext.built + } + return buildLineContent(cm, lineView) + } + + // Redraw the line's text. Interacts with the background and text + // classes because the mode may output tokens that influence these + // classes. + function updateLineText(cm, lineView) { + var cls = lineView.text.className; + var built = getLineContent(cm, lineView); + if (lineView.text == lineView.node) { lineView.node = built.pre; } + lineView.text.parentNode.replaceChild(built.pre, lineView.text); + lineView.text = built.pre; + if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) { + lineView.bgClass = built.bgClass; + lineView.textClass = built.textClass; + updateLineClasses(cm, lineView); + } else if (cls) { + lineView.text.className = cls; + } + } + + function updateLineClasses(cm, lineView) { + updateLineBackground(cm, lineView); + if (lineView.line.wrapClass) + { ensureLineWrapped(lineView).className = lineView.line.wrapClass; } + else if (lineView.node != lineView.text) + { lineView.node.className = ""; } + var textClass = lineView.textClass ? lineView.textClass + " " + (lineView.line.textClass || "") : lineView.line.textClass; + lineView.text.className = textClass || ""; + } + + function updateLineGutter(cm, lineView, lineN, dims) { + if (lineView.gutter) { + lineView.node.removeChild(lineView.gutter); + lineView.gutter = null; + } + if (lineView.gutterBackground) { + lineView.node.removeChild(lineView.gutterBackground); + lineView.gutterBackground = null; + } + if (lineView.line.gutterClass) { + var wrap = ensureLineWrapped(lineView); + lineView.gutterBackground = elt("div", null, "CodeMirror-gutter-background " + lineView.line.gutterClass, + ("left: " + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px; width: " + (dims.gutterTotalWidth) + "px")); + cm.display.input.setUneditable(lineView.gutterBackground); + wrap.insertBefore(lineView.gutterBackground, lineView.text); + } + var markers = lineView.line.gutterMarkers; + if (cm.options.lineNumbers || markers) { + var wrap$1 = ensureLineWrapped(lineView); + var gutterWrap = lineView.gutter = elt("div", null, "CodeMirror-gutter-wrapper", ("left: " + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px")); + gutterWrap.setAttribute("aria-hidden", "true"); + cm.display.input.setUneditable(gutterWrap); + wrap$1.insertBefore(gutterWrap, lineView.text); + if (lineView.line.gutterClass) + { gutterWrap.className += " " + lineView.line.gutterClass; } + if (cm.options.lineNumbers && (!markers || !markers["CodeMirror-linenumbers"])) + { lineView.lineNumber = gutterWrap.appendChild( + elt("div", lineNumberFor(cm.options, lineN), + "CodeMirror-linenumber CodeMirror-gutter-elt", + ("left: " + (dims.gutterLeft["CodeMirror-linenumbers"]) + "px; width: " + (cm.display.lineNumInnerWidth) + "px"))); } + if (markers) { for (var k = 0; k < cm.display.gutterSpecs.length; ++k) { + var id = cm.display.gutterSpecs[k].className, found = markers.hasOwnProperty(id) && markers[id]; + if (found) + { gutterWrap.appendChild(elt("div", [found], "CodeMirror-gutter-elt", + ("left: " + (dims.gutterLeft[id]) + "px; width: " + (dims.gutterWidth[id]) + "px"))); } + } } + } + } + + function updateLineWidgets(cm, lineView, dims) { + if (lineView.alignable) { lineView.alignable = null; } + var isWidget = classTest("CodeMirror-linewidget"); + for (var node = lineView.node.firstChild, next = (void 0); node; node = next) { + next = node.nextSibling; + if (isWidget.test(node.className)) { lineView.node.removeChild(node); } + } + insertLineWidgets(cm, lineView, dims); + } + + // Build a line's DOM representation from scratch + function buildLineElement(cm, lineView, lineN, dims) { + var built = getLineContent(cm, lineView); + lineView.text = lineView.node = built.pre; + if (built.bgClass) { lineView.bgClass = built.bgClass; } + if (built.textClass) { lineView.textClass = built.textClass; } + + updateLineClasses(cm, lineView); + updateLineGutter(cm, lineView, lineN, dims); + insertLineWidgets(cm, lineView, dims); + return lineView.node + } + + // A lineView may contain multiple logical lines (when merged by + // collapsed spans). The widgets for all of them need to be drawn. + function insertLineWidgets(cm, lineView, dims) { + insertLineWidgetsFor(cm, lineView.line, lineView, dims, true); + if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++) + { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } } + } + + function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) { + if (!line.widgets) { return } + var wrap = ensureLineWrapped(lineView); + for (var i = 0, ws = line.widgets; i < ws.length; ++i) { + var widget = ws[i], node = elt("div", [widget.node], "CodeMirror-linewidget" + (widget.className ? " " + widget.className : "")); + if (!widget.handleMouseEvents) { node.setAttribute("cm-ignore-events", "true"); } + positionLineWidget(widget, node, lineView, dims); + cm.display.input.setUneditable(node); + if (allowAbove && widget.above) + { wrap.insertBefore(node, lineView.gutter || lineView.text); } + else + { wrap.appendChild(node); } + signalLater(widget, "redraw"); + } + } + + function positionLineWidget(widget, node, lineView, dims) { + if (widget.noHScroll) { + (lineView.alignable || (lineView.alignable = [])).push(node); + var width = dims.wrapperWidth; + node.style.left = dims.fixedPos + "px"; + if (!widget.coverGutter) { + width -= dims.gutterTotalWidth; + node.style.paddingLeft = dims.gutterTotalWidth + "px"; + } + node.style.width = width + "px"; + } + if (widget.coverGutter) { + node.style.zIndex = 5; + node.style.position = "relative"; + if (!widget.noHScroll) { node.style.marginLeft = -dims.gutterTotalWidth + "px"; } + } + } + + function widgetHeight(widget) { + if (widget.height != null) { return widget.height } + var cm = widget.doc.cm; + if (!cm) { return 0 } + if (!contains(document.body, widget.node)) { + var parentStyle = "position: relative;"; + if (widget.coverGutter) + { parentStyle += "margin-left: -" + cm.display.gutters.offsetWidth + "px;"; } + if (widget.noHScroll) + { parentStyle += "width: " + cm.display.wrapper.clientWidth + "px;"; } + removeChildrenAndAdd(cm.display.measure, elt("div", [widget.node], null, parentStyle)); + } + return widget.height = widget.node.parentNode.offsetHeight + } + + // Return true when the given mouse event happened in a widget + function eventInWidget(display, e) { + for (var n = e_target(e); n != display.wrapper; n = n.parentNode) { + if (!n || (n.nodeType == 1 && n.getAttribute("cm-ignore-events") == "true") || + (n.parentNode == display.sizer && n != display.mover)) + { return true } + } + } + + // POSITION MEASUREMENT + + function paddingTop(display) {return display.lineSpace.offsetTop} + function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight} + function paddingH(display) { + if (display.cachedPaddingH) { return display.cachedPaddingH } + var e = removeChildrenAndAdd(display.measure, elt("pre", "x", "CodeMirror-line-like")); + var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle; + var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)}; + if (!isNaN(data.left) && !isNaN(data.right)) { display.cachedPaddingH = data; } + return data + } + + function scrollGap(cm) { return scrollerGap - cm.display.nativeBarWidth } + function displayWidth(cm) { + return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth + } + function displayHeight(cm) { + return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight + } + + // Ensure the lineView.wrapping.heights array is populated. This is + // an array of bottom offsets for the lines that make up a drawn + // line. When lineWrapping is on, there might be more than one + // height. + function ensureLineHeights(cm, lineView, rect) { + var wrapping = cm.options.lineWrapping; + var curWidth = wrapping && displayWidth(cm); + if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) { + var heights = lineView.measure.heights = []; + if (wrapping) { + lineView.measure.width = curWidth; + var rects = lineView.text.firstChild.getClientRects(); + for (var i = 0; i < rects.length - 1; i++) { + var cur = rects[i], next = rects[i + 1]; + if (Math.abs(cur.bottom - next.bottom) > 2) + { heights.push((cur.bottom + next.top) / 2 - rect.top); } + } + } + heights.push(rect.bottom - rect.top); + } + } + + // Find a line map (mapping character offsets to text nodes) and a + // measurement cache for the given line number. (A line view might + // contain multiple lines when collapsed ranges are present.) + function mapFromLineView(lineView, line, lineN) { + if (lineView.line == line) + { return {map: lineView.measure.map, cache: lineView.measure.cache} } + if (lineView.rest) { + for (var i = 0; i < lineView.rest.length; i++) + { if (lineView.rest[i] == line) + { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } } + for (var i$1 = 0; i$1 < lineView.rest.length; i$1++) + { if (lineNo(lineView.rest[i$1]) > lineN) + { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } } + } + } + + // Render a line into the hidden node display.externalMeasured. Used + // when measurement is needed for a line that's not in the viewport. + function updateExternalMeasurement(cm, line) { + line = visualLine(line); + var lineN = lineNo(line); + var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN); + view.lineN = lineN; + var built = view.built = buildLineContent(cm, view); + view.text = built.pre; + removeChildrenAndAdd(cm.display.lineMeasure, built.pre); + return view + } + + // Get a {top, bottom, left, right} box (in line-local coordinates) + // for a given character. + function measureChar(cm, line, ch, bias) { + return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias) + } + + // Find a line view that corresponds to the given line number. + function findViewForLine(cm, lineN) { + if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo) + { return cm.display.view[findViewIndex(cm, lineN)] } + var ext = cm.display.externalMeasured; + if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size) + { return ext } + } + + // Measurement can be split in two steps, the set-up work that + // applies to the whole line, and the measurement of the actual + // character. Functions like coordsChar, that need to do a lot of + // measurements in a row, can thus ensure that the set-up work is + // only done once. + function prepareMeasureForLine(cm, line) { + var lineN = lineNo(line); + var view = findViewForLine(cm, lineN); + if (view && !view.text) { + view = null; + } else if (view && view.changes) { + updateLineForChanges(cm, view, lineN, getDimensions(cm)); + cm.curOp.forceUpdate = true; + } + if (!view) + { view = updateExternalMeasurement(cm, line); } + + var info = mapFromLineView(view, line, lineN); + return { + line: line, view: view, rect: null, + map: info.map, cache: info.cache, before: info.before, + hasHeights: false + } + } + + // Given a prepared measurement object, measures the position of an + // actual character (or fetches it from the cache). + function measureCharPrepared(cm, prepared, ch, bias, varHeight) { + if (prepared.before) { ch = -1; } + var key = ch + (bias || ""), found; + if (prepared.cache.hasOwnProperty(key)) { + found = prepared.cache[key]; + } else { + if (!prepared.rect) + { prepared.rect = prepared.view.text.getBoundingClientRect(); } + if (!prepared.hasHeights) { + ensureLineHeights(cm, prepared.view, prepared.rect); + prepared.hasHeights = true; + } + found = measureCharInner(cm, prepared, ch, bias); + if (!found.bogus) { prepared.cache[key] = found; } + } + return {left: found.left, right: found.right, + top: varHeight ? found.rtop : found.top, + bottom: varHeight ? found.rbottom : found.bottom} + } + + var nullRect = {left: 0, right: 0, top: 0, bottom: 0}; + + function nodeAndOffsetInLineMap(map, ch, bias) { + var node, start, end, collapse, mStart, mEnd; + // First, search the line map for the text node corresponding to, + // or closest to, the target character. + for (var i = 0; i < map.length; i += 3) { + mStart = map[i]; + mEnd = map[i + 1]; + if (ch < mStart) { + start = 0; end = 1; + collapse = "left"; + } else if (ch < mEnd) { + start = ch - mStart; + end = start + 1; + } else if (i == map.length - 3 || ch == mEnd && map[i + 3] > ch) { + end = mEnd - mStart; + start = end - 1; + if (ch >= mEnd) { collapse = "right"; } + } + if (start != null) { + node = map[i + 2]; + if (mStart == mEnd && bias == (node.insertLeft ? "left" : "right")) + { collapse = bias; } + if (bias == "left" && start == 0) + { while (i && map[i - 2] == map[i - 3] && map[i - 1].insertLeft) { + node = map[(i -= 3) + 2]; + collapse = "left"; + } } + if (bias == "right" && start == mEnd - mStart) + { while (i < map.length - 3 && map[i + 3] == map[i + 4] && !map[i + 5].insertLeft) { + node = map[(i += 3) + 2]; + collapse = "right"; + } } + break + } + } + return {node: node, start: start, end: end, collapse: collapse, coverStart: mStart, coverEnd: mEnd} + } + + function getUsefulRect(rects, bias) { + var rect = nullRect; + if (bias == "left") { for (var i = 0; i < rects.length; i++) { + if ((rect = rects[i]).left != rect.right) { break } + } } else { for (var i$1 = rects.length - 1; i$1 >= 0; i$1--) { + if ((rect = rects[i$1]).left != rect.right) { break } + } } + return rect + } + + function measureCharInner(cm, prepared, ch, bias) { + var place = nodeAndOffsetInLineMap(prepared.map, ch, bias); + var node = place.node, start = place.start, end = place.end, collapse = place.collapse; + + var rect; + if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates. + for (var i$1 = 0; i$1 < 4; i$1++) { // Retry a maximum of 4 times when nonsense rectangles are returned + while (start && isExtendingChar(prepared.line.text.charAt(place.coverStart + start))) { --start; } + while (place.coverStart + end < place.coverEnd && isExtendingChar(prepared.line.text.charAt(place.coverStart + end))) { ++end; } + if (ie && ie_version < 9 && start == 0 && end == place.coverEnd - place.coverStart) + { rect = node.parentNode.getBoundingClientRect(); } + else + { rect = getUsefulRect(range(node, start, end).getClientRects(), bias); } + if (rect.left || rect.right || start == 0) { break } + end = start; + start = start - 1; + collapse = "right"; + } + if (ie && ie_version < 11) { rect = maybeUpdateRectForZooming(cm.display.measure, rect); } + } else { // If it is a widget, simply get the box for the whole widget. + if (start > 0) { collapse = bias = "right"; } + var rects; + if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1) + { rect = rects[bias == "right" ? rects.length - 1 : 0]; } + else + { rect = node.getBoundingClientRect(); } + } + if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) { + var rSpan = node.parentNode.getClientRects()[0]; + if (rSpan) + { rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom}; } + else + { rect = nullRect; } + } + + var rtop = rect.top - prepared.rect.top, rbot = rect.bottom - prepared.rect.top; + var mid = (rtop + rbot) / 2; + var heights = prepared.view.measure.heights; + var i = 0; + for (; i < heights.length - 1; i++) + { if (mid < heights[i]) { break } } + var top = i ? heights[i - 1] : 0, bot = heights[i]; + var result = {left: (collapse == "right" ? rect.right : rect.left) - prepared.rect.left, + right: (collapse == "left" ? rect.left : rect.right) - prepared.rect.left, + top: top, bottom: bot}; + if (!rect.left && !rect.right) { result.bogus = true; } + if (!cm.options.singleCursorHeightPerLine) { result.rtop = rtop; result.rbottom = rbot; } + + return result + } + + // Work around problem with bounding client rects on ranges being + // returned incorrectly when zoomed on IE10 and below. + function maybeUpdateRectForZooming(measure, rect) { + if (!window.screen || screen.logicalXDPI == null || + screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure)) + { return rect } + var scaleX = screen.logicalXDPI / screen.deviceXDPI; + var scaleY = screen.logicalYDPI / screen.deviceYDPI; + return {left: rect.left * scaleX, right: rect.right * scaleX, + top: rect.top * scaleY, bottom: rect.bottom * scaleY} + } + + function clearLineMeasurementCacheFor(lineView) { + if (lineView.measure) { + lineView.measure.cache = {}; + lineView.measure.heights = null; + if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++) + { lineView.measure.caches[i] = {}; } } + } + } + + function clearLineMeasurementCache(cm) { + cm.display.externalMeasure = null; + removeChildren(cm.display.lineMeasure); + for (var i = 0; i < cm.display.view.length; i++) + { clearLineMeasurementCacheFor(cm.display.view[i]); } + } + + function clearCaches(cm) { + clearLineMeasurementCache(cm); + cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null; + if (!cm.options.lineWrapping) { cm.display.maxLineChanged = true; } + cm.display.lineNumChars = null; + } + + function pageScrollX(doc) { + // Work around https://bugs.chromium.org/p/chromium/issues/detail?id=489206 + // which causes page_Offset and bounding client rects to use + // different reference viewports and invalidate our calculations. + if (chrome && android) { return -(doc.body.getBoundingClientRect().left - parseInt(getComputedStyle(doc.body).marginLeft)) } + return doc.defaultView.pageXOffset || (doc.documentElement || doc.body).scrollLeft + } + function pageScrollY(doc) { + if (chrome && android) { return -(doc.body.getBoundingClientRect().top - parseInt(getComputedStyle(doc.body).marginTop)) } + return doc.defaultView.pageYOffset || (doc.documentElement || doc.body).scrollTop + } + + function widgetTopHeight(lineObj) { + var ref = visualLine(lineObj); + var widgets = ref.widgets; + var height = 0; + if (widgets) { for (var i = 0; i < widgets.length; ++i) { if (widgets[i].above) + { height += widgetHeight(widgets[i]); } } } + return height + } + + // Converts a {top, bottom, left, right} box from line-local + // coordinates into another coordinate system. Context may be one of + // "line", "div" (display.lineDiv), "local"./null (editor), "window", + // or "page". + function intoCoordSystem(cm, lineObj, rect, context, includeWidgets) { + if (!includeWidgets) { + var height = widgetTopHeight(lineObj); + rect.top += height; rect.bottom += height; + } + if (context == "line") { return rect } + if (!context) { context = "local"; } + var yOff = heightAtLine(lineObj); + if (context == "local") { yOff += paddingTop(cm.display); } + else { yOff -= cm.display.viewOffset; } + if (context == "page" || context == "window") { + var lOff = cm.display.lineSpace.getBoundingClientRect(); + yOff += lOff.top + (context == "window" ? 0 : pageScrollY(doc(cm))); + var xOff = lOff.left + (context == "window" ? 0 : pageScrollX(doc(cm))); + rect.left += xOff; rect.right += xOff; + } + rect.top += yOff; rect.bottom += yOff; + return rect + } + + // Coverts a box from "div" coords to another coordinate system. + // Context may be "window", "page", "div", or "local"./null. + function fromCoordSystem(cm, coords, context) { + if (context == "div") { return coords } + var left = coords.left, top = coords.top; + // First move into "page" coordinate system + if (context == "page") { + left -= pageScrollX(doc(cm)); + top -= pageScrollY(doc(cm)); + } else if (context == "local" || !context) { + var localBox = cm.display.sizer.getBoundingClientRect(); + left += localBox.left; + top += localBox.top; + } + + var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect(); + return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top} + } + + function charCoords(cm, pos, context, lineObj, bias) { + if (!lineObj) { lineObj = getLine(cm.doc, pos.line); } + return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context) + } + + // Returns a box for a given cursor position, which may have an + // 'other' property containing the position of the secondary cursor + // on a bidi boundary. + // A cursor Pos(line, char, "before") is on the same visual line as `char - 1` + // and after `char - 1` in writing order of `char - 1` + // A cursor Pos(line, char, "after") is on the same visual line as `char` + // and before `char` in writing order of `char` + // Examples (upper-case letters are RTL, lower-case are LTR): + // Pos(0, 1, ...) + // before after + // ab a|b a|b + // aB a|B aB| + // Ab |Ab A|b + // AB B|A B|A + // Every position after the last character on a line is considered to stick + // to the last character on the line. + function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) { + lineObj = lineObj || getLine(cm.doc, pos.line); + if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); } + function get(ch, right) { + var m = measureCharPrepared(cm, preparedMeasure, ch, right ? "right" : "left", varHeight); + if (right) { m.left = m.right; } else { m.right = m.left; } + return intoCoordSystem(cm, lineObj, m, context) + } + var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky; + if (ch >= lineObj.text.length) { + ch = lineObj.text.length; + sticky = "before"; + } else if (ch <= 0) { + ch = 0; + sticky = "after"; + } + if (!order) { return get(sticky == "before" ? ch - 1 : ch, sticky == "before") } + + function getBidi(ch, partPos, invert) { + var part = order[partPos], right = part.level == 1; + return get(invert ? ch - 1 : ch, right != invert) + } + var partPos = getBidiPartAt(order, ch, sticky); + var other = bidiOther; + var val = getBidi(ch, partPos, sticky == "before"); + if (other != null) { val.other = getBidi(ch, other, sticky != "before"); } + return val + } + + // Used to cheaply estimate the coordinates for a position. Used for + // intermediate scroll updates. + function estimateCoords(cm, pos) { + var left = 0; + pos = clipPos(cm.doc, pos); + if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; } + var lineObj = getLine(cm.doc, pos.line); + var top = heightAtLine(lineObj) + paddingTop(cm.display); + return {left: left, right: left, top: top, bottom: top + lineObj.height} + } + + // Positions returned by coordsChar contain some extra information. + // xRel is the relative x position of the input coordinates compared + // to the found position (so xRel > 0 means the coordinates are to + // the right of the character position, for example). When outside + // is true, that means the coordinates lie outside the line's + // vertical range. + function PosWithInfo(line, ch, sticky, outside, xRel) { + var pos = Pos(line, ch, sticky); + pos.xRel = xRel; + if (outside) { pos.outside = outside; } + return pos + } + + // Compute the character position closest to the given coordinates. + // Input must be lineSpace-local ("div" coordinate system). + function coordsChar(cm, x, y) { + var doc = cm.doc; + y += cm.display.viewOffset; + if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) } + var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1; + if (lineN > last) + { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) } + if (x < 0) { x = 0; } + + var lineObj = getLine(doc, lineN); + for (;;) { + var found = coordsCharInner(cm, lineObj, lineN, x, y); + var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0)); + if (!collapsed) { return found } + var rangeEnd = collapsed.find(1); + if (rangeEnd.line == lineN) { return rangeEnd } + lineObj = getLine(doc, lineN = rangeEnd.line); + } + } + + function wrappedLineExtent(cm, lineObj, preparedMeasure, y) { + y -= widgetTopHeight(lineObj); + var end = lineObj.text.length; + var begin = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch - 1).bottom <= y; }, end, 0); + end = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch).top > y; }, begin, end); + return {begin: begin, end: end} + } + + function wrappedLineExtentChar(cm, lineObj, preparedMeasure, target) { + if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); } + var targetTop = intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, target), "line").top; + return wrappedLineExtent(cm, lineObj, preparedMeasure, targetTop) + } + + // Returns true if the given side of a box is after the given + // coordinates, in top-to-bottom, left-to-right order. + function boxIsAfter(box, x, y, left) { + return box.bottom <= y ? false : box.top > y ? true : (left ? box.left : box.right) > x + } + + function coordsCharInner(cm, lineObj, lineNo, x, y) { + // Move y into line-local coordinate space + y -= heightAtLine(lineObj); + var preparedMeasure = prepareMeasureForLine(cm, lineObj); + // When directly calling `measureCharPrepared`, we have to adjust + // for the widgets at this line. + var widgetHeight = widgetTopHeight(lineObj); + var begin = 0, end = lineObj.text.length, ltr = true; + + var order = getOrder(lineObj, cm.doc.direction); + // If the line isn't plain left-to-right text, first figure out + // which bidi section the coordinates fall into. + if (order) { + var part = (cm.options.lineWrapping ? coordsBidiPartWrapped : coordsBidiPart) + (cm, lineObj, lineNo, preparedMeasure, order, x, y); + ltr = part.level != 1; + // The awkward -1 offsets are needed because findFirst (called + // on these below) will treat its first bound as inclusive, + // second as exclusive, but we want to actually address the + // characters in the part's range + begin = ltr ? part.from : part.to - 1; + end = ltr ? part.to : part.from - 1; + } + + // A binary search to find the first character whose bounding box + // starts after the coordinates. If we run across any whose box wrap + // the coordinates, store that. + var chAround = null, boxAround = null; + var ch = findFirst(function (ch) { + var box = measureCharPrepared(cm, preparedMeasure, ch); + box.top += widgetHeight; box.bottom += widgetHeight; + if (!boxIsAfter(box, x, y, false)) { return false } + if (box.top <= y && box.left <= x) { + chAround = ch; + boxAround = box; + } + return true + }, begin, end); + + var baseX, sticky, outside = false; + // If a box around the coordinates was found, use that + if (boxAround) { + // Distinguish coordinates nearer to the left or right side of the box + var atLeft = x - boxAround.left < boxAround.right - x, atStart = atLeft == ltr; + ch = chAround + (atStart ? 0 : 1); + sticky = atStart ? "after" : "before"; + baseX = atLeft ? boxAround.left : boxAround.right; + } else { + // (Adjust for extended bound, if necessary.) + if (!ltr && (ch == end || ch == begin)) { ch++; } + // To determine which side to associate with, get the box to the + // left of the character and compare it's vertical position to the + // coordinates + sticky = ch == 0 ? "after" : ch == lineObj.text.length ? "before" : + (measureCharPrepared(cm, preparedMeasure, ch - (ltr ? 1 : 0)).bottom + widgetHeight <= y) == ltr ? + "after" : "before"; + // Now get accurate coordinates for this place, in order to get a + // base X position + var coords = cursorCoords(cm, Pos(lineNo, ch, sticky), "line", lineObj, preparedMeasure); + baseX = coords.left; + outside = y < coords.top ? -1 : y >= coords.bottom ? 1 : 0; + } + + ch = skipExtendingChars(lineObj.text, ch, 1); + return PosWithInfo(lineNo, ch, sticky, outside, x - baseX) + } + + function coordsBidiPart(cm, lineObj, lineNo, preparedMeasure, order, x, y) { + // Bidi parts are sorted left-to-right, and in a non-line-wrapping + // situation, we can take this ordering to correspond to the visual + // ordering. This finds the first part whose end is after the given + // coordinates. + var index = findFirst(function (i) { + var part = order[i], ltr = part.level != 1; + return boxIsAfter(cursorCoords(cm, Pos(lineNo, ltr ? part.to : part.from, ltr ? "before" : "after"), + "line", lineObj, preparedMeasure), x, y, true) + }, 0, order.length - 1); + var part = order[index]; + // If this isn't the first part, the part's start is also after + // the coordinates, and the coordinates aren't on the same line as + // that start, move one part back. + if (index > 0) { + var ltr = part.level != 1; + var start = cursorCoords(cm, Pos(lineNo, ltr ? part.from : part.to, ltr ? "after" : "before"), + "line", lineObj, preparedMeasure); + if (boxIsAfter(start, x, y, true) && start.top > y) + { part = order[index - 1]; } + } + return part + } + + function coordsBidiPartWrapped(cm, lineObj, _lineNo, preparedMeasure, order, x, y) { + // In a wrapped line, rtl text on wrapping boundaries can do things + // that don't correspond to the ordering in our `order` array at + // all, so a binary search doesn't work, and we want to return a + // part that only spans one line so that the binary search in + // coordsCharInner is safe. As such, we first find the extent of the + // wrapped line, and then do a flat search in which we discard any + // spans that aren't on the line. + var ref = wrappedLineExtent(cm, lineObj, preparedMeasure, y); + var begin = ref.begin; + var end = ref.end; + if (/\s/.test(lineObj.text.charAt(end - 1))) { end--; } + var part = null, closestDist = null; + for (var i = 0; i < order.length; i++) { + var p = order[i]; + if (p.from >= end || p.to <= begin) { continue } + var ltr = p.level != 1; + var endX = measureCharPrepared(cm, preparedMeasure, ltr ? Math.min(end, p.to) - 1 : Math.max(begin, p.from)).right; + // Weigh against spans ending before this, so that they are only + // picked if nothing ends after + var dist = endX < x ? x - endX + 1e9 : endX - x; + if (!part || closestDist > dist) { + part = p; + closestDist = dist; + } + } + if (!part) { part = order[order.length - 1]; } + // Clip the part to the wrapped line. + if (part.from < begin) { part = {from: begin, to: part.to, level: part.level}; } + if (part.to > end) { part = {from: part.from, to: end, level: part.level}; } + return part + } + + var measureText; + // Compute the default text height. + function textHeight(display) { + if (display.cachedTextHeight != null) { return display.cachedTextHeight } + if (measureText == null) { + measureText = elt("pre", null, "CodeMirror-line-like"); + // Measure a bunch of lines, for browsers that compute + // fractional heights. + for (var i = 0; i < 49; ++i) { + measureText.appendChild(document.createTextNode("x")); + measureText.appendChild(elt("br")); + } + measureText.appendChild(document.createTextNode("x")); + } + removeChildrenAndAdd(display.measure, measureText); + var height = measureText.offsetHeight / 50; + if (height > 3) { display.cachedTextHeight = height; } + removeChildren(display.measure); + return height || 1 + } + + // Compute the default character width. + function charWidth(display) { + if (display.cachedCharWidth != null) { return display.cachedCharWidth } + var anchor = elt("span", "xxxxxxxxxx"); + var pre = elt("pre", [anchor], "CodeMirror-line-like"); + removeChildrenAndAdd(display.measure, pre); + var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10; + if (width > 2) { display.cachedCharWidth = width; } + return width || 10 + } + + // Do a bulk-read of the DOM positions and sizes needed to draw the + // view, so that we don't interleave reading and writing to the DOM. + function getDimensions(cm) { + var d = cm.display, left = {}, width = {}; + var gutterLeft = d.gutters.clientLeft; + for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) { + var id = cm.display.gutterSpecs[i].className; + left[id] = n.offsetLeft + n.clientLeft + gutterLeft; + width[id] = n.clientWidth; + } + return {fixedPos: compensateForHScroll(d), + gutterTotalWidth: d.gutters.offsetWidth, + gutterLeft: left, + gutterWidth: width, + wrapperWidth: d.wrapper.clientWidth} + } + + // Computes display.scroller.scrollLeft + display.gutters.offsetWidth, + // but using getBoundingClientRect to get a sub-pixel-accurate + // result. + function compensateForHScroll(display) { + return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left + } + + // Returns a function that estimates the height of a line, to use as + // first approximation until the line becomes visible (and is thus + // properly measurable). + function estimateHeight(cm) { + var th = textHeight(cm.display), wrapping = cm.options.lineWrapping; + var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3); + return function (line) { + if (lineIsHidden(cm.doc, line)) { return 0 } + + var widgetsHeight = 0; + if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) { + if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; } + } } + + if (wrapping) + { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th } + else + { return widgetsHeight + th } + } + } + + function estimateLineHeights(cm) { + var doc = cm.doc, est = estimateHeight(cm); + doc.iter(function (line) { + var estHeight = est(line); + if (estHeight != line.height) { updateLineHeight(line, estHeight); } + }); + } + + // Given a mouse event, find the corresponding position. If liberal + // is false, it checks whether a gutter or scrollbar was clicked, + // and returns null if it was. forRect is used by rectangular + // selections, and tries to estimate a character position even for + // coordinates beyond the right of the text. + function posFromMouse(cm, e, liberal, forRect) { + var display = cm.display; + if (!liberal && e_target(e).getAttribute("cm-not-content") == "true") { return null } + + var x, y, space = display.lineSpace.getBoundingClientRect(); + // Fails unpredictably on IE[67] when mouse is dragged around quickly. + try { x = e.clientX - space.left; y = e.clientY - space.top; } + catch (e$1) { return null } + var coords = coordsChar(cm, x, y), line; + if (forRect && coords.xRel > 0 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) { + var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length; + coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff)); + } + return coords + } + + // Find the view element corresponding to a given line. Return null + // when the line isn't visible. + function findViewIndex(cm, n) { + if (n >= cm.display.viewTo) { return null } + n -= cm.display.viewFrom; + if (n < 0) { return null } + var view = cm.display.view; + for (var i = 0; i < view.length; i++) { + n -= view[i].size; + if (n < 0) { return i } + } + } + + // Updates the display.view data structure for a given change to the + // document. From and to are in pre-change coordinates. Lendiff is + // the amount of lines added or subtracted by the change. This is + // used for changes that span multiple lines, or change the way + // lines are divided into visual lines. regLineChange (below) + // registers single-line changes. + function regChange(cm, from, to, lendiff) { + if (from == null) { from = cm.doc.first; } + if (to == null) { to = cm.doc.first + cm.doc.size; } + if (!lendiff) { lendiff = 0; } + + var display = cm.display; + if (lendiff && to < display.viewTo && + (display.updateLineNumbers == null || display.updateLineNumbers > from)) + { display.updateLineNumbers = from; } + + cm.curOp.viewChanged = true; + + if (from >= display.viewTo) { // Change after + if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo) + { resetView(cm); } + } else if (to <= display.viewFrom) { // Change before + if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) { + resetView(cm); + } else { + display.viewFrom += lendiff; + display.viewTo += lendiff; + } + } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap + resetView(cm); + } else if (from <= display.viewFrom) { // Top overlap + var cut = viewCuttingPoint(cm, to, to + lendiff, 1); + if (cut) { + display.view = display.view.slice(cut.index); + display.viewFrom = cut.lineN; + display.viewTo += lendiff; + } else { + resetView(cm); + } + } else if (to >= display.viewTo) { // Bottom overlap + var cut$1 = viewCuttingPoint(cm, from, from, -1); + if (cut$1) { + display.view = display.view.slice(0, cut$1.index); + display.viewTo = cut$1.lineN; + } else { + resetView(cm); + } + } else { // Gap in the middle + var cutTop = viewCuttingPoint(cm, from, from, -1); + var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1); + if (cutTop && cutBot) { + display.view = display.view.slice(0, cutTop.index) + .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN)) + .concat(display.view.slice(cutBot.index)); + display.viewTo += lendiff; + } else { + resetView(cm); + } + } + + var ext = display.externalMeasured; + if (ext) { + if (to < ext.lineN) + { ext.lineN += lendiff; } + else if (from < ext.lineN + ext.size) + { display.externalMeasured = null; } + } + } + + // Register a change to a single line. Type must be one of "text", + // "gutter", "class", "widget" + function regLineChange(cm, line, type) { + cm.curOp.viewChanged = true; + var display = cm.display, ext = cm.display.externalMeasured; + if (ext && line >= ext.lineN && line < ext.lineN + ext.size) + { display.externalMeasured = null; } + + if (line < display.viewFrom || line >= display.viewTo) { return } + var lineView = display.view[findViewIndex(cm, line)]; + if (lineView.node == null) { return } + var arr = lineView.changes || (lineView.changes = []); + if (indexOf(arr, type) == -1) { arr.push(type); } + } + + // Clear the view. + function resetView(cm) { + cm.display.viewFrom = cm.display.viewTo = cm.doc.first; + cm.display.view = []; + cm.display.viewOffset = 0; + } + + function viewCuttingPoint(cm, oldN, newN, dir) { + var index = findViewIndex(cm, oldN), diff, view = cm.display.view; + if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size) + { return {index: index, lineN: newN} } + var n = cm.display.viewFrom; + for (var i = 0; i < index; i++) + { n += view[i].size; } + if (n != oldN) { + if (dir > 0) { + if (index == view.length - 1) { return null } + diff = (n + view[index].size) - oldN; + index++; + } else { + diff = n - oldN; + } + oldN += diff; newN += diff; + } + while (visualLineNo(cm.doc, newN) != newN) { + if (index == (dir < 0 ? 0 : view.length - 1)) { return null } + newN += dir * view[index - (dir < 0 ? 1 : 0)].size; + index += dir; + } + return {index: index, lineN: newN} + } + + // Force the view to cover a given range, adding empty view element + // or clipping off existing ones as needed. + function adjustView(cm, from, to) { + var display = cm.display, view = display.view; + if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) { + display.view = buildViewArray(cm, from, to); + display.viewFrom = from; + } else { + if (display.viewFrom > from) + { display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view); } + else if (display.viewFrom < from) + { display.view = display.view.slice(findViewIndex(cm, from)); } + display.viewFrom = from; + if (display.viewTo < to) + { display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)); } + else if (display.viewTo > to) + { display.view = display.view.slice(0, findViewIndex(cm, to)); } + } + display.viewTo = to; + } + + // Count the number of lines in the view whose DOM representation is + // out of date (or nonexistent). + function countDirtyView(cm) { + var view = cm.display.view, dirty = 0; + for (var i = 0; i < view.length; i++) { + var lineView = view[i]; + if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty; } + } + return dirty + } + + function updateSelection(cm) { + cm.display.input.showSelection(cm.display.input.prepareSelection()); + } + + function prepareSelection(cm, primary) { + if ( primary === void 0 ) primary = true; + + var doc = cm.doc, result = {}; + var curFragment = result.cursors = document.createDocumentFragment(); + var selFragment = result.selection = document.createDocumentFragment(); + + var customCursor = cm.options.$customCursor; + if (customCursor) { primary = true; } + for (var i = 0; i < doc.sel.ranges.length; i++) { + if (!primary && i == doc.sel.primIndex) { continue } + var range = doc.sel.ranges[i]; + if (range.from().line >= cm.display.viewTo || range.to().line < cm.display.viewFrom) { continue } + var collapsed = range.empty(); + if (customCursor) { + var head = customCursor(cm, range); + if (head) { drawSelectionCursor(cm, head, curFragment); } + } else if (collapsed || cm.options.showCursorWhenSelecting) { + drawSelectionCursor(cm, range.head, curFragment); + } + if (!collapsed) + { drawSelectionRange(cm, range, selFragment); } + } + return result + } + + // Draws a cursor for the given range + function drawSelectionCursor(cm, head, output) { + var pos = cursorCoords(cm, head, "div", null, null, !cm.options.singleCursorHeightPerLine); + + var cursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor")); + cursor.style.left = pos.left + "px"; + cursor.style.top = pos.top + "px"; + cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + "px"; + + if (/\bcm-fat-cursor\b/.test(cm.getWrapperElement().className)) { + var charPos = charCoords(cm, head, "div", null, null); + var width = charPos.right - charPos.left; + cursor.style.width = (width > 0 ? width : cm.defaultCharWidth()) + "px"; + } + + if (pos.other) { + // Secondary cursor, shown when on a 'jump' in bi-directional text + var otherCursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor CodeMirror-secondarycursor")); + otherCursor.style.display = ""; + otherCursor.style.left = pos.other.left + "px"; + otherCursor.style.top = pos.other.top + "px"; + otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + "px"; + } + } + + function cmpCoords(a, b) { return a.top - b.top || a.left - b.left } + + // Draws the given range as a highlighted selection + function drawSelectionRange(cm, range, output) { + var display = cm.display, doc = cm.doc; + var fragment = document.createDocumentFragment(); + var padding = paddingH(cm.display), leftSide = padding.left; + var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right; + var docLTR = doc.direction == "ltr"; + + function add(left, top, width, bottom) { + if (top < 0) { top = 0; } + top = Math.round(top); + bottom = Math.round(bottom); + fragment.appendChild(elt("div", null, "CodeMirror-selected", ("position: absolute; left: " + left + "px;\n top: " + top + "px; width: " + (width == null ? rightSide - left : width) + "px;\n height: " + (bottom - top) + "px"))); + } + + function drawForLine(line, fromArg, toArg) { + var lineObj = getLine(doc, line); + var lineLen = lineObj.text.length; + var start, end; + function coords(ch, bias) { + return charCoords(cm, Pos(line, ch), "div", lineObj, bias) + } + + function wrapX(pos, dir, side) { + var extent = wrappedLineExtentChar(cm, lineObj, null, pos); + var prop = (dir == "ltr") == (side == "after") ? "left" : "right"; + var ch = side == "after" ? extent.begin : extent.end - (/\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1); + return coords(ch, prop)[prop] + } + + var order = getOrder(lineObj, doc.direction); + iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) { + var ltr = dir == "ltr"; + var fromPos = coords(from, ltr ? "left" : "right"); + var toPos = coords(to - 1, ltr ? "right" : "left"); + + var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen; + var first = i == 0, last = !order || i == order.length - 1; + if (toPos.top - fromPos.top <= 3) { // Single line + var openLeft = (docLTR ? openStart : openEnd) && first; + var openRight = (docLTR ? openEnd : openStart) && last; + var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left; + var right = openRight ? rightSide : (ltr ? toPos : fromPos).right; + add(left, fromPos.top, right - left, fromPos.bottom); + } else { // Multiple lines + var topLeft, topRight, botLeft, botRight; + if (ltr) { + topLeft = docLTR && openStart && first ? leftSide : fromPos.left; + topRight = docLTR ? rightSide : wrapX(from, dir, "before"); + botLeft = docLTR ? leftSide : wrapX(to, dir, "after"); + botRight = docLTR && openEnd && last ? rightSide : toPos.right; + } else { + topLeft = !docLTR ? leftSide : wrapX(from, dir, "before"); + topRight = !docLTR && openStart && first ? rightSide : fromPos.right; + botLeft = !docLTR && openEnd && last ? leftSide : toPos.left; + botRight = !docLTR ? rightSide : wrapX(to, dir, "after"); + } + add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom); + if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); } + add(botLeft, toPos.top, botRight - botLeft, toPos.bottom); + } + + if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; } + if (cmpCoords(toPos, start) < 0) { start = toPos; } + if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; } + if (cmpCoords(toPos, end) < 0) { end = toPos; } + }); + return {start: start, end: end} + } + + var sFrom = range.from(), sTo = range.to(); + if (sFrom.line == sTo.line) { + drawForLine(sFrom.line, sFrom.ch, sTo.ch); + } else { + var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line); + var singleVLine = visualLine(fromLine) == visualLine(toLine); + var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end; + var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start; + if (singleVLine) { + if (leftEnd.top < rightStart.top - 2) { + add(leftEnd.right, leftEnd.top, null, leftEnd.bottom); + add(leftSide, rightStart.top, rightStart.left, rightStart.bottom); + } else { + add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom); + } + } + if (leftEnd.bottom < rightStart.top) + { add(leftSide, leftEnd.bottom, null, rightStart.top); } + } + + output.appendChild(fragment); + } + + // Cursor-blinking + function restartBlink(cm) { + if (!cm.state.focused) { return } + var display = cm.display; + clearInterval(display.blinker); + var on = true; + display.cursorDiv.style.visibility = ""; + if (cm.options.cursorBlinkRate > 0) + { display.blinker = setInterval(function () { + if (!cm.hasFocus()) { onBlur(cm); } + display.cursorDiv.style.visibility = (on = !on) ? "" : "hidden"; + }, cm.options.cursorBlinkRate); } + else if (cm.options.cursorBlinkRate < 0) + { display.cursorDiv.style.visibility = "hidden"; } + } + + function ensureFocus(cm) { + if (!cm.hasFocus()) { + cm.display.input.focus(); + if (!cm.state.focused) { onFocus(cm); } + } + } + + function delayBlurEvent(cm) { + cm.state.delayingBlurEvent = true; + setTimeout(function () { if (cm.state.delayingBlurEvent) { + cm.state.delayingBlurEvent = false; + if (cm.state.focused) { onBlur(cm); } + } }, 100); + } + + function onFocus(cm, e) { + if (cm.state.delayingBlurEvent && !cm.state.draggingText) { cm.state.delayingBlurEvent = false; } + + if (cm.options.readOnly == "nocursor") { return } + if (!cm.state.focused) { + signal(cm, "focus", cm, e); + cm.state.focused = true; + addClass(cm.display.wrapper, "CodeMirror-focused"); + // This test prevents this from firing when a context + // menu is closed (since the input reset would kill the + // select-all detection hack) + if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) { + cm.display.input.reset(); + if (webkit) { setTimeout(function () { return cm.display.input.reset(true); }, 20); } // Issue #1730 + } + cm.display.input.receivedFocus(); + } + restartBlink(cm); + } + function onBlur(cm, e) { + if (cm.state.delayingBlurEvent) { return } + + if (cm.state.focused) { + signal(cm, "blur", cm, e); + cm.state.focused = false; + rmClass(cm.display.wrapper, "CodeMirror-focused"); + } + clearInterval(cm.display.blinker); + setTimeout(function () { if (!cm.state.focused) { cm.display.shift = false; } }, 150); + } + + // Read the actual heights of the rendered lines, and update their + // stored heights to match. + function updateHeightsInViewport(cm) { + var display = cm.display; + var prevBottom = display.lineDiv.offsetTop; + var viewTop = Math.max(0, display.scroller.getBoundingClientRect().top); + var oldHeight = display.lineDiv.getBoundingClientRect().top; + var mustScroll = 0; + for (var i = 0; i < display.view.length; i++) { + var cur = display.view[i], wrapping = cm.options.lineWrapping; + var height = (void 0), width = 0; + if (cur.hidden) { continue } + oldHeight += cur.line.height; + if (ie && ie_version < 8) { + var bot = cur.node.offsetTop + cur.node.offsetHeight; + height = bot - prevBottom; + prevBottom = bot; + } else { + var box = cur.node.getBoundingClientRect(); + height = box.bottom - box.top; + // Check that lines don't extend past the right of the current + // editor width + if (!wrapping && cur.text.firstChild) + { width = cur.text.firstChild.getBoundingClientRect().right - box.left - 1; } + } + var diff = cur.line.height - height; + if (diff > .005 || diff < -.005) { + if (oldHeight < viewTop) { mustScroll -= diff; } + updateLineHeight(cur.line, height); + updateWidgetHeight(cur.line); + if (cur.rest) { for (var j = 0; j < cur.rest.length; j++) + { updateWidgetHeight(cur.rest[j]); } } + } + if (width > cm.display.sizerWidth) { + var chWidth = Math.ceil(width / charWidth(cm.display)); + if (chWidth > cm.display.maxLineLength) { + cm.display.maxLineLength = chWidth; + cm.display.maxLine = cur.line; + cm.display.maxLineChanged = true; + } + } + } + if (Math.abs(mustScroll) > 2) { display.scroller.scrollTop += mustScroll; } + } + + // Read and store the height of line widgets associated with the + // given line. + function updateWidgetHeight(line) { + if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) { + var w = line.widgets[i], parent = w.node.parentNode; + if (parent) { w.height = parent.offsetHeight; } + } } + } + + // Compute the lines that are visible in a given viewport (defaults + // the current scroll position). viewport may contain top, + // height, and ensure (see op.scrollToPos) properties. + function visibleLines(display, doc, viewport) { + var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop; + top = Math.floor(top - paddingTop(display)); + var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight; + + var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom); + // Ensure is a {from: {line, ch}, to: {line, ch}} object, and + // forces those lines into the viewport (if possible). + if (viewport && viewport.ensure) { + var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line; + if (ensureFrom < from) { + from = ensureFrom; + to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight); + } else if (Math.min(ensureTo, doc.lastLine()) >= to) { + from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight); + to = ensureTo; + } + } + return {from: from, to: Math.max(to, from + 1)} + } + + // SCROLLING THINGS INTO VIEW + + // If an editor sits on the top or bottom of the window, partially + // scrolled out of view, this ensures that the cursor is visible. + function maybeScrollWindow(cm, rect) { + if (signalDOMEvent(cm, "scrollCursorIntoView")) { return } + + var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null; + var doc = display.wrapper.ownerDocument; + if (rect.top + box.top < 0) { doScroll = true; } + else if (rect.bottom + box.top > (doc.defaultView.innerHeight || doc.documentElement.clientHeight)) { doScroll = false; } + if (doScroll != null && !phantom) { + var scrollNode = elt("div", "\u200b", null, ("position: absolute;\n top: " + (rect.top - display.viewOffset - paddingTop(cm.display)) + "px;\n height: " + (rect.bottom - rect.top + scrollGap(cm) + display.barHeight) + "px;\n left: " + (rect.left) + "px; width: " + (Math.max(2, rect.right - rect.left)) + "px;")); + cm.display.lineSpace.appendChild(scrollNode); + scrollNode.scrollIntoView(doScroll); + cm.display.lineSpace.removeChild(scrollNode); + } + } + + // Scroll a given position into view (immediately), verifying that + // it actually became visible (as line heights are accurately + // measured, the position of something may 'drift' during drawing). + function scrollPosIntoView(cm, pos, end, margin) { + if (margin == null) { margin = 0; } + var rect; + if (!cm.options.lineWrapping && pos == end) { + // Set pos and end to the cursor positions around the character pos sticks to + // If pos.sticky == "before", that is around pos.ch - 1, otherwise around pos.ch + // If pos == Pos(_, 0, "before"), pos and end are unchanged + end = pos.sticky == "before" ? Pos(pos.line, pos.ch + 1, "before") : pos; + pos = pos.ch ? Pos(pos.line, pos.sticky == "before" ? pos.ch - 1 : pos.ch, "after") : pos; + } + for (var limit = 0; limit < 5; limit++) { + var changed = false; + var coords = cursorCoords(cm, pos); + var endCoords = !end || end == pos ? coords : cursorCoords(cm, end); + rect = {left: Math.min(coords.left, endCoords.left), + top: Math.min(coords.top, endCoords.top) - margin, + right: Math.max(coords.left, endCoords.left), + bottom: Math.max(coords.bottom, endCoords.bottom) + margin}; + var scrollPos = calculateScrollPos(cm, rect); + var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft; + if (scrollPos.scrollTop != null) { + updateScrollTop(cm, scrollPos.scrollTop); + if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; } + } + if (scrollPos.scrollLeft != null) { + setScrollLeft(cm, scrollPos.scrollLeft); + if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; } + } + if (!changed) { break } + } + return rect + } + + // Scroll a given set of coordinates into view (immediately). + function scrollIntoView(cm, rect) { + var scrollPos = calculateScrollPos(cm, rect); + if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); } + if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); } + } + + // Calculate a new scroll position needed to scroll the given + // rectangle into view. Returns an object with scrollTop and + // scrollLeft properties. When these are undefined, the + // vertical/horizontal position does not need to be adjusted. + function calculateScrollPos(cm, rect) { + var display = cm.display, snapMargin = textHeight(cm.display); + if (rect.top < 0) { rect.top = 0; } + var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop; + var screen = displayHeight(cm), result = {}; + if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; } + var docBottom = cm.doc.height + paddingVert(display); + var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin; + if (rect.top < screentop) { + result.scrollTop = atTop ? 0 : rect.top; + } else if (rect.bottom > screentop + screen) { + var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen); + if (newTop != screentop) { result.scrollTop = newTop; } + } + + var gutterSpace = cm.options.fixedGutter ? 0 : display.gutters.offsetWidth; + var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft - gutterSpace; + var screenw = displayWidth(cm) - display.gutters.offsetWidth; + var tooWide = rect.right - rect.left > screenw; + if (tooWide) { rect.right = rect.left + screenw; } + if (rect.left < 10) + { result.scrollLeft = 0; } + else if (rect.left < screenleft) + { result.scrollLeft = Math.max(0, rect.left + gutterSpace - (tooWide ? 0 : 10)); } + else if (rect.right > screenw + screenleft - 3) + { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; } + return result + } + + // Store a relative adjustment to the scroll position in the current + // operation (to be applied when the operation finishes). + function addToScrollTop(cm, top) { + if (top == null) { return } + resolveScrollToPos(cm); + cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top; + } + + // Make sure that at the end of the operation the current cursor is + // shown. + function ensureCursorVisible(cm) { + resolveScrollToPos(cm); + var cur = cm.getCursor(); + cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin}; + } + + function scrollToCoords(cm, x, y) { + if (x != null || y != null) { resolveScrollToPos(cm); } + if (x != null) { cm.curOp.scrollLeft = x; } + if (y != null) { cm.curOp.scrollTop = y; } + } + + function scrollToRange(cm, range) { + resolveScrollToPos(cm); + cm.curOp.scrollToPos = range; + } + + // When an operation has its scrollToPos property set, and another + // scroll action is applied before the end of the operation, this + // 'simulates' scrolling that position into view in a cheap way, so + // that the effect of intermediate scroll commands is not ignored. + function resolveScrollToPos(cm) { + var range = cm.curOp.scrollToPos; + if (range) { + cm.curOp.scrollToPos = null; + var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to); + scrollToCoordsRange(cm, from, to, range.margin); + } + } + + function scrollToCoordsRange(cm, from, to, margin) { + var sPos = calculateScrollPos(cm, { + left: Math.min(from.left, to.left), + top: Math.min(from.top, to.top) - margin, + right: Math.max(from.right, to.right), + bottom: Math.max(from.bottom, to.bottom) + margin + }); + scrollToCoords(cm, sPos.scrollLeft, sPos.scrollTop); + } + + // Sync the scrollable area and scrollbars, ensure the viewport + // covers the visible area. + function updateScrollTop(cm, val) { + if (Math.abs(cm.doc.scrollTop - val) < 2) { return } + if (!gecko) { updateDisplaySimple(cm, {top: val}); } + setScrollTop(cm, val, true); + if (gecko) { updateDisplaySimple(cm); } + startWorker(cm, 100); + } + + function setScrollTop(cm, val, forceScroll) { + val = Math.max(0, Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight, val)); + if (cm.display.scroller.scrollTop == val && !forceScroll) { return } + cm.doc.scrollTop = val; + cm.display.scrollbars.setScrollTop(val); + if (cm.display.scroller.scrollTop != val) { cm.display.scroller.scrollTop = val; } + } + + // Sync scroller and scrollbar, ensure the gutter elements are + // aligned. + function setScrollLeft(cm, val, isScroller, forceScroll) { + val = Math.max(0, Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth)); + if ((isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) && !forceScroll) { return } + cm.doc.scrollLeft = val; + alignHorizontally(cm); + if (cm.display.scroller.scrollLeft != val) { cm.display.scroller.scrollLeft = val; } + cm.display.scrollbars.setScrollLeft(val); + } + + // SCROLLBARS + + // Prepare DOM reads needed to update the scrollbars. Done in one + // shot to minimize update/measure roundtrips. + function measureForScrollbars(cm) { + var d = cm.display, gutterW = d.gutters.offsetWidth; + var docH = Math.round(cm.doc.height + paddingVert(cm.display)); + return { + clientHeight: d.scroller.clientHeight, + viewHeight: d.wrapper.clientHeight, + scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth, + viewWidth: d.wrapper.clientWidth, + barLeft: cm.options.fixedGutter ? gutterW : 0, + docHeight: docH, + scrollHeight: docH + scrollGap(cm) + d.barHeight, + nativeBarWidth: d.nativeBarWidth, + gutterWidth: gutterW + } + } + + var NativeScrollbars = function(place, scroll, cm) { + this.cm = cm; + var vert = this.vert = elt("div", [elt("div", null, null, "min-width: 1px")], "CodeMirror-vscrollbar"); + var horiz = this.horiz = elt("div", [elt("div", null, null, "height: 100%; min-height: 1px")], "CodeMirror-hscrollbar"); + vert.tabIndex = horiz.tabIndex = -1; + place(vert); place(horiz); + + on(vert, "scroll", function () { + if (vert.clientHeight) { scroll(vert.scrollTop, "vertical"); } + }); + on(horiz, "scroll", function () { + if (horiz.clientWidth) { scroll(horiz.scrollLeft, "horizontal"); } + }); + + this.checkedZeroWidth = false; + // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8). + if (ie && ie_version < 8) { this.horiz.style.minHeight = this.vert.style.minWidth = "18px"; } + }; + + NativeScrollbars.prototype.update = function (measure) { + var needsH = measure.scrollWidth > measure.clientWidth + 1; + var needsV = measure.scrollHeight > measure.clientHeight + 1; + var sWidth = measure.nativeBarWidth; + + if (needsV) { + this.vert.style.display = "block"; + this.vert.style.bottom = needsH ? sWidth + "px" : "0"; + var totalHeight = measure.viewHeight - (needsH ? sWidth : 0); + // A bug in IE8 can cause this value to be negative, so guard it. + this.vert.firstChild.style.height = + Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + "px"; + } else { + this.vert.scrollTop = 0; + this.vert.style.display = ""; + this.vert.firstChild.style.height = "0"; + } + + if (needsH) { + this.horiz.style.display = "block"; + this.horiz.style.right = needsV ? sWidth + "px" : "0"; + this.horiz.style.left = measure.barLeft + "px"; + var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0); + this.horiz.firstChild.style.width = + Math.max(0, measure.scrollWidth - measure.clientWidth + totalWidth) + "px"; + } else { + this.horiz.style.display = ""; + this.horiz.firstChild.style.width = "0"; + } + + if (!this.checkedZeroWidth && measure.clientHeight > 0) { + if (sWidth == 0) { this.zeroWidthHack(); } + this.checkedZeroWidth = true; + } + + return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0} + }; + + NativeScrollbars.prototype.setScrollLeft = function (pos) { + if (this.horiz.scrollLeft != pos) { this.horiz.scrollLeft = pos; } + if (this.disableHoriz) { this.enableZeroWidthBar(this.horiz, this.disableHoriz, "horiz"); } + }; + + NativeScrollbars.prototype.setScrollTop = function (pos) { + if (this.vert.scrollTop != pos) { this.vert.scrollTop = pos; } + if (this.disableVert) { this.enableZeroWidthBar(this.vert, this.disableVert, "vert"); } + }; + + NativeScrollbars.prototype.zeroWidthHack = function () { + var w = mac && !mac_geMountainLion ? "12px" : "18px"; + this.horiz.style.height = this.vert.style.width = w; + this.horiz.style.visibility = this.vert.style.visibility = "hidden"; + this.disableHoriz = new Delayed; + this.disableVert = new Delayed; + }; + + NativeScrollbars.prototype.enableZeroWidthBar = function (bar, delay, type) { + bar.style.visibility = ""; + function maybeDisable() { + // To find out whether the scrollbar is still visible, we + // check whether the element under the pixel in the bottom + // right corner of the scrollbar box is the scrollbar box + // itself (when the bar is still visible) or its filler child + // (when the bar is hidden). If it is still visible, we keep + // it enabled, if it's hidden, we disable pointer events. + var box = bar.getBoundingClientRect(); + var elt = type == "vert" ? document.elementFromPoint(box.right - 1, (box.top + box.bottom) / 2) + : document.elementFromPoint((box.right + box.left) / 2, box.bottom - 1); + if (elt != bar) { bar.style.visibility = "hidden"; } + else { delay.set(1000, maybeDisable); } + } + delay.set(1000, maybeDisable); + }; + + NativeScrollbars.prototype.clear = function () { + var parent = this.horiz.parentNode; + parent.removeChild(this.horiz); + parent.removeChild(this.vert); + }; + + var NullScrollbars = function () {}; + + NullScrollbars.prototype.update = function () { return {bottom: 0, right: 0} }; + NullScrollbars.prototype.setScrollLeft = function () {}; + NullScrollbars.prototype.setScrollTop = function () {}; + NullScrollbars.prototype.clear = function () {}; + + function updateScrollbars(cm, measure) { + if (!measure) { measure = measureForScrollbars(cm); } + var startWidth = cm.display.barWidth, startHeight = cm.display.barHeight; + updateScrollbarsInner(cm, measure); + for (var i = 0; i < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i++) { + if (startWidth != cm.display.barWidth && cm.options.lineWrapping) + { updateHeightsInViewport(cm); } + updateScrollbarsInner(cm, measureForScrollbars(cm)); + startWidth = cm.display.barWidth; startHeight = cm.display.barHeight; + } + } + + // Re-synchronize the fake scrollbars with the actual size of the + // content. + function updateScrollbarsInner(cm, measure) { + var d = cm.display; + var sizes = d.scrollbars.update(measure); + + d.sizer.style.paddingRight = (d.barWidth = sizes.right) + "px"; + d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + "px"; + d.heightForcer.style.borderBottom = sizes.bottom + "px solid transparent"; + + if (sizes.right && sizes.bottom) { + d.scrollbarFiller.style.display = "block"; + d.scrollbarFiller.style.height = sizes.bottom + "px"; + d.scrollbarFiller.style.width = sizes.right + "px"; + } else { d.scrollbarFiller.style.display = ""; } + if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) { + d.gutterFiller.style.display = "block"; + d.gutterFiller.style.height = sizes.bottom + "px"; + d.gutterFiller.style.width = measure.gutterWidth + "px"; + } else { d.gutterFiller.style.display = ""; } + } + + var scrollbarModel = {"native": NativeScrollbars, "null": NullScrollbars}; + + function initScrollbars(cm) { + if (cm.display.scrollbars) { + cm.display.scrollbars.clear(); + if (cm.display.scrollbars.addClass) + { rmClass(cm.display.wrapper, cm.display.scrollbars.addClass); } + } + + cm.display.scrollbars = new scrollbarModel[cm.options.scrollbarStyle](function (node) { + cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller); + // Prevent clicks in the scrollbars from killing focus + on(node, "mousedown", function () { + if (cm.state.focused) { setTimeout(function () { return cm.display.input.focus(); }, 0); } + }); + node.setAttribute("cm-not-content", "true"); + }, function (pos, axis) { + if (axis == "horizontal") { setScrollLeft(cm, pos); } + else { updateScrollTop(cm, pos); } + }, cm); + if (cm.display.scrollbars.addClass) + { addClass(cm.display.wrapper, cm.display.scrollbars.addClass); } + } + + // Operations are used to wrap a series of changes to the editor + // state in such a way that each change won't have to update the + // cursor and display (which would be awkward, slow, and + // error-prone). Instead, display updates are batched and then all + // combined and executed at once. + + var nextOpId = 0; + // Start a new operation. + function startOperation(cm) { + cm.curOp = { + cm: cm, + viewChanged: false, // Flag that indicates that lines might need to be redrawn + startHeight: cm.doc.height, // Used to detect need to update scrollbar + forceUpdate: false, // Used to force a redraw + updateInput: 0, // Whether to reset the input textarea + typing: false, // Whether this reset should be careful to leave existing text (for compositing) + changeObjs: null, // Accumulated changes, for firing change events + cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on + cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already + selectionChanged: false, // Whether the selection needs to be redrawn + updateMaxLine: false, // Set when the widest line needs to be determined anew + scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet + scrollToPos: null, // Used to scroll to a specific position + focus: false, + id: ++nextOpId, // Unique ID + markArrays: null // Used by addMarkedSpan + }; + pushOperation(cm.curOp); + } + + // Finish an operation, updating the display and signalling delayed events + function endOperation(cm) { + var op = cm.curOp; + if (op) { finishOperation(op, function (group) { + for (var i = 0; i < group.ops.length; i++) + { group.ops[i].cm.curOp = null; } + endOperations(group); + }); } + } + + // The DOM updates done when an operation finishes are batched so + // that the minimum number of relayouts are required. + function endOperations(group) { + var ops = group.ops; + for (var i = 0; i < ops.length; i++) // Read DOM + { endOperation_R1(ops[i]); } + for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe) + { endOperation_W1(ops[i$1]); } + for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM + { endOperation_R2(ops[i$2]); } + for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe) + { endOperation_W2(ops[i$3]); } + for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM + { endOperation_finish(ops[i$4]); } + } + + function endOperation_R1(op) { + var cm = op.cm, display = cm.display; + maybeClipScrollbars(cm); + if (op.updateMaxLine) { findMaxLine(cm); } + + op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null || + op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom || + op.scrollToPos.to.line >= display.viewTo) || + display.maxLineChanged && cm.options.lineWrapping; + op.update = op.mustUpdate && + new DisplayUpdate(cm, op.mustUpdate && {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate); + } + + function endOperation_W1(op) { + op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update); + } + + function endOperation_R2(op) { + var cm = op.cm, display = cm.display; + if (op.updatedDisplay) { updateHeightsInViewport(cm); } + + op.barMeasure = measureForScrollbars(cm); + + // If the max line changed since it was last measured, measure it, + // and ensure the document's width matches it. + // updateDisplay_W2 will use these properties to do the actual resizing + if (display.maxLineChanged && !cm.options.lineWrapping) { + op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3; + cm.display.sizerWidth = op.adjustWidthTo; + op.barMeasure.scrollWidth = + Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth); + op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm)); + } + + if (op.updatedDisplay || op.selectionChanged) + { op.preparedSelection = display.input.prepareSelection(); } + } + + function endOperation_W2(op) { + var cm = op.cm; + + if (op.adjustWidthTo != null) { + cm.display.sizer.style.minWidth = op.adjustWidthTo + "px"; + if (op.maxScrollLeft < cm.doc.scrollLeft) + { setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true); } + cm.display.maxLineChanged = false; + } + + var takeFocus = op.focus && op.focus == activeElt(root(cm)); + if (op.preparedSelection) + { cm.display.input.showSelection(op.preparedSelection, takeFocus); } + if (op.updatedDisplay || op.startHeight != cm.doc.height) + { updateScrollbars(cm, op.barMeasure); } + if (op.updatedDisplay) + { setDocumentHeight(cm, op.barMeasure); } + + if (op.selectionChanged) { restartBlink(cm); } + + if (cm.state.focused && op.updateInput) + { cm.display.input.reset(op.typing); } + if (takeFocus) { ensureFocus(op.cm); } + } + + function endOperation_finish(op) { + var cm = op.cm, display = cm.display, doc = cm.doc; + + if (op.updatedDisplay) { postUpdateDisplay(cm, op.update); } + + // Abort mouse wheel delta measurement, when scrolling explicitly + if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos)) + { display.wheelStartX = display.wheelStartY = null; } + + // Propagate the scroll position to the actual DOM scroller + if (op.scrollTop != null) { setScrollTop(cm, op.scrollTop, op.forceScroll); } + + if (op.scrollLeft != null) { setScrollLeft(cm, op.scrollLeft, true, true); } + // If we need to scroll a specific position into view, do so. + if (op.scrollToPos) { + var rect = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from), + clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin); + maybeScrollWindow(cm, rect); + } + + // Fire events for markers that are hidden/unidden by editing or + // undoing + var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers; + if (hidden) { for (var i = 0; i < hidden.length; ++i) + { if (!hidden[i].lines.length) { signal(hidden[i], "hide"); } } } + if (unhidden) { for (var i$1 = 0; i$1 < unhidden.length; ++i$1) + { if (unhidden[i$1].lines.length) { signal(unhidden[i$1], "unhide"); } } } + + if (display.wrapper.offsetHeight) + { doc.scrollTop = cm.display.scroller.scrollTop; } + + // Fire change events, and delayed event handlers + if (op.changeObjs) + { signal(cm, "changes", cm, op.changeObjs); } + if (op.update) + { op.update.finish(); } + } + + // Run the given function in an operation + function runInOp(cm, f) { + if (cm.curOp) { return f() } + startOperation(cm); + try { return f() } + finally { endOperation(cm); } + } + // Wraps a function in an operation. Returns the wrapped function. + function operation(cm, f) { + return function() { + if (cm.curOp) { return f.apply(cm, arguments) } + startOperation(cm); + try { return f.apply(cm, arguments) } + finally { endOperation(cm); } + } + } + // Used to add methods to editor and doc instances, wrapping them in + // operations. + function methodOp(f) { + return function() { + if (this.curOp) { return f.apply(this, arguments) } + startOperation(this); + try { return f.apply(this, arguments) } + finally { endOperation(this); } + } + } + function docMethodOp(f) { + return function() { + var cm = this.cm; + if (!cm || cm.curOp) { return f.apply(this, arguments) } + startOperation(cm); + try { return f.apply(this, arguments) } + finally { endOperation(cm); } + } + } + + // HIGHLIGHT WORKER + + function startWorker(cm, time) { + if (cm.doc.highlightFrontier < cm.display.viewTo) + { cm.state.highlight.set(time, bind(highlightWorker, cm)); } + } + + function highlightWorker(cm) { + var doc = cm.doc; + if (doc.highlightFrontier >= cm.display.viewTo) { return } + var end = +new Date + cm.options.workTime; + var context = getContextBefore(cm, doc.highlightFrontier); + var changedLines = []; + + doc.iter(context.line, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function (line) { + if (context.line >= cm.display.viewFrom) { // Visible + var oldStyles = line.styles; + var resetState = line.text.length > cm.options.maxHighlightLength ? copyState(doc.mode, context.state) : null; + var highlighted = highlightLine(cm, line, context, true); + if (resetState) { context.state = resetState; } + line.styles = highlighted.styles; + var oldCls = line.styleClasses, newCls = highlighted.classes; + if (newCls) { line.styleClasses = newCls; } + else if (oldCls) { line.styleClasses = null; } + var ischange = !oldStyles || oldStyles.length != line.styles.length || + oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass); + for (var i = 0; !ischange && i < oldStyles.length; ++i) { ischange = oldStyles[i] != line.styles[i]; } + if (ischange) { changedLines.push(context.line); } + line.stateAfter = context.save(); + context.nextLine(); + } else { + if (line.text.length <= cm.options.maxHighlightLength) + { processLine(cm, line.text, context); } + line.stateAfter = context.line % 5 == 0 ? context.save() : null; + context.nextLine(); + } + if (+new Date > end) { + startWorker(cm, cm.options.workDelay); + return true + } + }); + doc.highlightFrontier = context.line; + doc.modeFrontier = Math.max(doc.modeFrontier, context.line); + if (changedLines.length) { runInOp(cm, function () { + for (var i = 0; i < changedLines.length; i++) + { regLineChange(cm, changedLines[i], "text"); } + }); } + } + + // DISPLAY DRAWING + + var DisplayUpdate = function(cm, viewport, force) { + var display = cm.display; + + this.viewport = viewport; + // Store some values that we'll need later (but don't want to force a relayout for) + this.visible = visibleLines(display, cm.doc, viewport); + this.editorIsHidden = !display.wrapper.offsetWidth; + this.wrapperHeight = display.wrapper.clientHeight; + this.wrapperWidth = display.wrapper.clientWidth; + this.oldDisplayWidth = displayWidth(cm); + this.force = force; + this.dims = getDimensions(cm); + this.events = []; + }; + + DisplayUpdate.prototype.signal = function (emitter, type) { + if (hasHandler(emitter, type)) + { this.events.push(arguments); } + }; + DisplayUpdate.prototype.finish = function () { + for (var i = 0; i < this.events.length; i++) + { signal.apply(null, this.events[i]); } + }; + + function maybeClipScrollbars(cm) { + var display = cm.display; + if (!display.scrollbarsClipped && display.scroller.offsetWidth) { + display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth; + display.heightForcer.style.height = scrollGap(cm) + "px"; + display.sizer.style.marginBottom = -display.nativeBarWidth + "px"; + display.sizer.style.borderRightWidth = scrollGap(cm) + "px"; + display.scrollbarsClipped = true; + } + } + + function selectionSnapshot(cm) { + if (cm.hasFocus()) { return null } + var active = activeElt(root(cm)); + if (!active || !contains(cm.display.lineDiv, active)) { return null } + var result = {activeElt: active}; + if (window.getSelection) { + var sel = win(cm).getSelection(); + if (sel.anchorNode && sel.extend && contains(cm.display.lineDiv, sel.anchorNode)) { + result.anchorNode = sel.anchorNode; + result.anchorOffset = sel.anchorOffset; + result.focusNode = sel.focusNode; + result.focusOffset = sel.focusOffset; + } + } + return result + } + + function restoreSelection(snapshot) { + if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt(rootNode(snapshot.activeElt))) { return } + snapshot.activeElt.focus(); + if (!/^(INPUT|TEXTAREA)$/.test(snapshot.activeElt.nodeName) && + snapshot.anchorNode && contains(document.body, snapshot.anchorNode) && contains(document.body, snapshot.focusNode)) { + var doc = snapshot.activeElt.ownerDocument; + var sel = doc.defaultView.getSelection(), range = doc.createRange(); + range.setEnd(snapshot.anchorNode, snapshot.anchorOffset); + range.collapse(false); + sel.removeAllRanges(); + sel.addRange(range); + sel.extend(snapshot.focusNode, snapshot.focusOffset); + } + } + + // Does the actual updating of the line display. Bails out + // (returning false) when there is nothing to be done and forced is + // false. + function updateDisplayIfNeeded(cm, update) { + var display = cm.display, doc = cm.doc; + + if (update.editorIsHidden) { + resetView(cm); + return false + } + + // Bail out if the visible area is already rendered and nothing changed. + if (!update.force && + update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo && + (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) && + display.renderedView == display.view && countDirtyView(cm) == 0) + { return false } + + if (maybeUpdateLineNumberWidth(cm)) { + resetView(cm); + update.dims = getDimensions(cm); + } + + // Compute a suitable new viewport (from & to) + var end = doc.first + doc.size; + var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first); + var to = Math.min(end, update.visible.to + cm.options.viewportMargin); + if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); } + if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); } + if (sawCollapsedSpans) { + from = visualLineNo(cm.doc, from); + to = visualLineEndNo(cm.doc, to); + } + + var different = from != display.viewFrom || to != display.viewTo || + display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth; + adjustView(cm, from, to); + + display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom)); + // Position the mover div to align with the current scroll position + cm.display.mover.style.top = display.viewOffset + "px"; + + var toUpdate = countDirtyView(cm); + if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view && + (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo)) + { return false } + + // For big changes, we hide the enclosing element during the + // update, since that speeds up the operations on most browsers. + var selSnapshot = selectionSnapshot(cm); + if (toUpdate > 4) { display.lineDiv.style.display = "none"; } + patchDisplay(cm, display.updateLineNumbers, update.dims); + if (toUpdate > 4) { display.lineDiv.style.display = ""; } + display.renderedView = display.view; + // There might have been a widget with a focused element that got + // hidden or updated, if so re-focus it. + restoreSelection(selSnapshot); + + // Prevent selection and cursors from interfering with the scroll + // width and height. + removeChildren(display.cursorDiv); + removeChildren(display.selectionDiv); + display.gutters.style.height = display.sizer.style.minHeight = 0; + + if (different) { + display.lastWrapHeight = update.wrapperHeight; + display.lastWrapWidth = update.wrapperWidth; + startWorker(cm, 400); + } + + display.updateLineNumbers = null; + + return true + } + + function postUpdateDisplay(cm, update) { + var viewport = update.viewport; + + for (var first = true;; first = false) { + if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) { + // Clip forced viewport to actual scrollable area. + if (viewport && viewport.top != null) + { viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)}; } + // Updated line heights might result in the drawn area not + // actually covering the viewport. Keep looping until it does. + update.visible = visibleLines(cm.display, cm.doc, viewport); + if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo) + { break } + } else if (first) { + update.visible = visibleLines(cm.display, cm.doc, viewport); + } + if (!updateDisplayIfNeeded(cm, update)) { break } + updateHeightsInViewport(cm); + var barMeasure = measureForScrollbars(cm); + updateSelection(cm); + updateScrollbars(cm, barMeasure); + setDocumentHeight(cm, barMeasure); + update.force = false; + } + + update.signal(cm, "update", cm); + if (cm.display.viewFrom != cm.display.reportedViewFrom || cm.display.viewTo != cm.display.reportedViewTo) { + update.signal(cm, "viewportChange", cm, cm.display.viewFrom, cm.display.viewTo); + cm.display.reportedViewFrom = cm.display.viewFrom; cm.display.reportedViewTo = cm.display.viewTo; + } + } + + function updateDisplaySimple(cm, viewport) { + var update = new DisplayUpdate(cm, viewport); + if (updateDisplayIfNeeded(cm, update)) { + updateHeightsInViewport(cm); + postUpdateDisplay(cm, update); + var barMeasure = measureForScrollbars(cm); + updateSelection(cm); + updateScrollbars(cm, barMeasure); + setDocumentHeight(cm, barMeasure); + update.finish(); + } + } + + // Sync the actual display DOM structure with display.view, removing + // nodes for lines that are no longer in view, and creating the ones + // that are not there yet, and updating the ones that are out of + // date. + function patchDisplay(cm, updateNumbersFrom, dims) { + var display = cm.display, lineNumbers = cm.options.lineNumbers; + var container = display.lineDiv, cur = container.firstChild; + + function rm(node) { + var next = node.nextSibling; + // Works around a throw-scroll bug in OS X Webkit + if (webkit && mac && cm.display.currentWheelTarget == node) + { node.style.display = "none"; } + else + { node.parentNode.removeChild(node); } + return next + } + + var view = display.view, lineN = display.viewFrom; + // Loop over the elements in the view, syncing cur (the DOM nodes + // in display.lineDiv) with the view as we go. + for (var i = 0; i < view.length; i++) { + var lineView = view[i]; + if (lineView.hidden) ; else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet + var node = buildLineElement(cm, lineView, lineN, dims); + container.insertBefore(node, cur); + } else { // Already drawn + while (cur != lineView.node) { cur = rm(cur); } + var updateNumber = lineNumbers && updateNumbersFrom != null && + updateNumbersFrom <= lineN && lineView.lineNumber; + if (lineView.changes) { + if (indexOf(lineView.changes, "gutter") > -1) { updateNumber = false; } + updateLineForChanges(cm, lineView, lineN, dims); + } + if (updateNumber) { + removeChildren(lineView.lineNumber); + lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN))); + } + cur = lineView.node.nextSibling; + } + lineN += lineView.size; + } + while (cur) { cur = rm(cur); } + } + + function updateGutterSpace(display) { + var width = display.gutters.offsetWidth; + display.sizer.style.marginLeft = width + "px"; + // Send an event to consumers responding to changes in gutter width. + signalLater(display, "gutterChanged", display); + } + + function setDocumentHeight(cm, measure) { + cm.display.sizer.style.minHeight = measure.docHeight + "px"; + cm.display.heightForcer.style.top = measure.docHeight + "px"; + cm.display.gutters.style.height = (measure.docHeight + cm.display.barHeight + scrollGap(cm)) + "px"; + } + + // Re-align line numbers and gutter marks to compensate for + // horizontal scrolling. + function alignHorizontally(cm) { + var display = cm.display, view = display.view; + if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return } + var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft; + var gutterW = display.gutters.offsetWidth, left = comp + "px"; + for (var i = 0; i < view.length; i++) { if (!view[i].hidden) { + if (cm.options.fixedGutter) { + if (view[i].gutter) + { view[i].gutter.style.left = left; } + if (view[i].gutterBackground) + { view[i].gutterBackground.style.left = left; } + } + var align = view[i].alignable; + if (align) { for (var j = 0; j < align.length; j++) + { align[j].style.left = left; } } + } } + if (cm.options.fixedGutter) + { display.gutters.style.left = (comp + gutterW) + "px"; } + } + + // Used to ensure that the line number gutter is still the right + // size for the current document size. Returns true when an update + // is needed. + function maybeUpdateLineNumberWidth(cm) { + if (!cm.options.lineNumbers) { return false } + var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display; + if (last.length != display.lineNumChars) { + var test = display.measure.appendChild(elt("div", [elt("div", last)], + "CodeMirror-linenumber CodeMirror-gutter-elt")); + var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW; + display.lineGutter.style.width = ""; + display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1; + display.lineNumWidth = display.lineNumInnerWidth + padding; + display.lineNumChars = display.lineNumInnerWidth ? last.length : -1; + display.lineGutter.style.width = display.lineNumWidth + "px"; + updateGutterSpace(cm.display); + return true + } + return false + } + + function getGutters(gutters, lineNumbers) { + var result = [], sawLineNumbers = false; + for (var i = 0; i < gutters.length; i++) { + var name = gutters[i], style = null; + if (typeof name != "string") { style = name.style; name = name.className; } + if (name == "CodeMirror-linenumbers") { + if (!lineNumbers) { continue } + else { sawLineNumbers = true; } + } + result.push({className: name, style: style}); + } + if (lineNumbers && !sawLineNumbers) { result.push({className: "CodeMirror-linenumbers", style: null}); } + return result + } + + // Rebuild the gutter elements, ensure the margin to the left of the + // code matches their width. + function renderGutters(display) { + var gutters = display.gutters, specs = display.gutterSpecs; + removeChildren(gutters); + display.lineGutter = null; + for (var i = 0; i < specs.length; ++i) { + var ref = specs[i]; + var className = ref.className; + var style = ref.style; + var gElt = gutters.appendChild(elt("div", null, "CodeMirror-gutter " + className)); + if (style) { gElt.style.cssText = style; } + if (className == "CodeMirror-linenumbers") { + display.lineGutter = gElt; + gElt.style.width = (display.lineNumWidth || 1) + "px"; + } + } + gutters.style.display = specs.length ? "" : "none"; + updateGutterSpace(display); + } + + function updateGutters(cm) { + renderGutters(cm.display); + regChange(cm); + alignHorizontally(cm); + } + + // The display handles the DOM integration, both for input reading + // and content drawing. It holds references to DOM nodes and + // display-related state. + + function Display(place, doc, input, options) { + var d = this; + this.input = input; + + // Covers bottom-right square when both scrollbars are present. + d.scrollbarFiller = elt("div", null, "CodeMirror-scrollbar-filler"); + d.scrollbarFiller.setAttribute("cm-not-content", "true"); + // Covers bottom of gutter when coverGutterNextToScrollbar is on + // and h scrollbar is present. + d.gutterFiller = elt("div", null, "CodeMirror-gutter-filler"); + d.gutterFiller.setAttribute("cm-not-content", "true"); + // Will contain the actual code, positioned to cover the viewport. + d.lineDiv = eltP("div", null, "CodeMirror-code"); + // Elements are added to these to represent selection and cursors. + d.selectionDiv = elt("div", null, null, "position: relative; z-index: 1"); + d.cursorDiv = elt("div", null, "CodeMirror-cursors"); + // A visibility: hidden element used to find the size of things. + d.measure = elt("div", null, "CodeMirror-measure"); + // When lines outside of the viewport are measured, they are drawn in this. + d.lineMeasure = elt("div", null, "CodeMirror-measure"); + // Wraps everything that needs to exist inside the vertically-padded coordinate system + d.lineSpace = eltP("div", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv], + null, "position: relative; outline: none"); + var lines = eltP("div", [d.lineSpace], "CodeMirror-lines"); + // Moved around its parent to cover visible view. + d.mover = elt("div", [lines], null, "position: relative"); + // Set to the height of the document, allowing scrolling. + d.sizer = elt("div", [d.mover], "CodeMirror-sizer"); + d.sizerWidth = null; + // Behavior of elts with overflow: auto and padding is + // inconsistent across browsers. This is used to ensure the + // scrollable area is big enough. + d.heightForcer = elt("div", null, null, "position: absolute; height: " + scrollerGap + "px; width: 1px;"); + // Will contain the gutters, if any. + d.gutters = elt("div", null, "CodeMirror-gutters"); + d.lineGutter = null; + // Actual scrollable element. + d.scroller = elt("div", [d.sizer, d.heightForcer, d.gutters], "CodeMirror-scroll"); + d.scroller.setAttribute("tabIndex", "-1"); + // The element in which the editor lives. + d.wrapper = elt("div", [d.scrollbarFiller, d.gutterFiller, d.scroller], "CodeMirror"); + // See #6982. FIXME remove when this has been fixed for a while in Chrome + if (chrome && chrome_version >= 105) { d.wrapper.style.clipPath = "inset(0px)"; } + + // This attribute is respected by automatic translation systems such as Google Translate, + // and may also be respected by tools used by human translators. + d.wrapper.setAttribute('translate', 'no'); + + // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported) + if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; } + if (!webkit && !(gecko && mobile)) { d.scroller.draggable = true; } + + if (place) { + if (place.appendChild) { place.appendChild(d.wrapper); } + else { place(d.wrapper); } + } + + // Current rendered range (may be bigger than the view window). + d.viewFrom = d.viewTo = doc.first; + d.reportedViewFrom = d.reportedViewTo = doc.first; + // Information about the rendered lines. + d.view = []; + d.renderedView = null; + // Holds info about a single rendered line when it was rendered + // for measurement, while not in view. + d.externalMeasured = null; + // Empty space (in pixels) above the view + d.viewOffset = 0; + d.lastWrapHeight = d.lastWrapWidth = 0; + d.updateLineNumbers = null; + + d.nativeBarWidth = d.barHeight = d.barWidth = 0; + d.scrollbarsClipped = false; + + // Used to only resize the line number gutter when necessary (when + // the amount of lines crosses a boundary that makes its width change) + d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null; + // Set to true when a non-horizontal-scrolling line widget is + // added. As an optimization, line widget aligning is skipped when + // this is false. + d.alignWidgets = false; + + d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null; + + // Tracks the maximum line length so that the horizontal scrollbar + // can be kept static when scrolling. + d.maxLine = null; + d.maxLineLength = 0; + d.maxLineChanged = false; + + // Used for measuring wheel scrolling granularity + d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null; + + // True when shift is held down. + d.shift = false; + + // Used to track whether anything happened since the context menu + // was opened. + d.selForContextMenu = null; + + d.activeTouch = null; + + d.gutterSpecs = getGutters(options.gutters, options.lineNumbers); + renderGutters(d); + + input.init(d); + } + + // Since the delta values reported on mouse wheel events are + // unstandardized between browsers and even browser versions, and + // generally horribly unpredictable, this code starts by measuring + // the scroll effect that the first few mouse wheel events have, + // and, from that, detects the way it can convert deltas to pixel + // offsets afterwards. + // + // The reason we want to know the amount a wheel event will scroll + // is that it gives us a chance to update the display before the + // actual scrolling happens, reducing flickering. + + var wheelSamples = 0, wheelPixelsPerUnit = null; + // Fill in a browser-detected starting value on browsers where we + // know one. These don't have to be accurate -- the result of them + // being wrong would just be a slight flicker on the first wheel + // scroll (if it is large enough). + if (ie) { wheelPixelsPerUnit = -.53; } + else if (gecko) { wheelPixelsPerUnit = 15; } + else if (chrome) { wheelPixelsPerUnit = -.7; } + else if (safari) { wheelPixelsPerUnit = -1/3; } + + function wheelEventDelta(e) { + var dx = e.wheelDeltaX, dy = e.wheelDeltaY; + if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) { dx = e.detail; } + if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) { dy = e.detail; } + else if (dy == null) { dy = e.wheelDelta; } + return {x: dx, y: dy} + } + function wheelEventPixels(e) { + var delta = wheelEventDelta(e); + delta.x *= wheelPixelsPerUnit; + delta.y *= wheelPixelsPerUnit; + return delta + } + + function onScrollWheel(cm, e) { + // On Chrome 102, viewport updates somehow stop wheel-based + // scrolling. Turning off pointer events during the scroll seems + // to avoid the issue. + if (chrome && chrome_version == 102) { + if (cm.display.chromeScrollHack == null) { cm.display.sizer.style.pointerEvents = "none"; } + else { clearTimeout(cm.display.chromeScrollHack); } + cm.display.chromeScrollHack = setTimeout(function () { + cm.display.chromeScrollHack = null; + cm.display.sizer.style.pointerEvents = ""; + }, 100); + } + var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y; + var pixelsPerUnit = wheelPixelsPerUnit; + if (e.deltaMode === 0) { + dx = e.deltaX; + dy = e.deltaY; + pixelsPerUnit = 1; + } + + var display = cm.display, scroll = display.scroller; + // Quit if there's nothing to scroll here + var canScrollX = scroll.scrollWidth > scroll.clientWidth; + var canScrollY = scroll.scrollHeight > scroll.clientHeight; + if (!(dx && canScrollX || dy && canScrollY)) { return } + + // Webkit browsers on OS X abort momentum scrolls when the target + // of the scroll event is removed from the scrollable element. + // This hack (see related code in patchDisplay) makes sure the + // element is kept around. + if (dy && mac && webkit) { + outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) { + for (var i = 0; i < view.length; i++) { + if (view[i].node == cur) { + cm.display.currentWheelTarget = cur; + break outer + } + } + } + } + + // On some browsers, horizontal scrolling will cause redraws to + // happen before the gutter has been realigned, causing it to + // wriggle around in a most unseemly way. When we have an + // estimated pixels/delta value, we just handle horizontal + // scrolling entirely here. It'll be slightly off from native, but + // better than glitching out. + if (dx && !gecko && !presto && pixelsPerUnit != null) { + if (dy && canScrollY) + { updateScrollTop(cm, Math.max(0, scroll.scrollTop + dy * pixelsPerUnit)); } + setScrollLeft(cm, Math.max(0, scroll.scrollLeft + dx * pixelsPerUnit)); + // Only prevent default scrolling if vertical scrolling is + // actually possible. Otherwise, it causes vertical scroll + // jitter on OSX trackpads when deltaX is small and deltaY + // is large (issue #3579) + if (!dy || (dy && canScrollY)) + { e_preventDefault(e); } + display.wheelStartX = null; // Abort measurement, if in progress + return + } + + // 'Project' the visible viewport to cover the area that is being + // scrolled into view (if we know enough to estimate it). + if (dy && pixelsPerUnit != null) { + var pixels = dy * pixelsPerUnit; + var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight; + if (pixels < 0) { top = Math.max(0, top + pixels - 50); } + else { bot = Math.min(cm.doc.height, bot + pixels + 50); } + updateDisplaySimple(cm, {top: top, bottom: bot}); + } + + if (wheelSamples < 20 && e.deltaMode !== 0) { + if (display.wheelStartX == null) { + display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop; + display.wheelDX = dx; display.wheelDY = dy; + setTimeout(function () { + if (display.wheelStartX == null) { return } + var movedX = scroll.scrollLeft - display.wheelStartX; + var movedY = scroll.scrollTop - display.wheelStartY; + var sample = (movedY && display.wheelDY && movedY / display.wheelDY) || + (movedX && display.wheelDX && movedX / display.wheelDX); + display.wheelStartX = display.wheelStartY = null; + if (!sample) { return } + wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1); + ++wheelSamples; + }, 200); + } else { + display.wheelDX += dx; display.wheelDY += dy; + } + } + } + + // Selection objects are immutable. A new one is created every time + // the selection changes. A selection is one or more non-overlapping + // (and non-touching) ranges, sorted, and an integer that indicates + // which one is the primary selection (the one that's scrolled into + // view, that getCursor returns, etc). + var Selection = function(ranges, primIndex) { + this.ranges = ranges; + this.primIndex = primIndex; + }; + + Selection.prototype.primary = function () { return this.ranges[this.primIndex] }; + + Selection.prototype.equals = function (other) { + if (other == this) { return true } + if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) { return false } + for (var i = 0; i < this.ranges.length; i++) { + var here = this.ranges[i], there = other.ranges[i]; + if (!equalCursorPos(here.anchor, there.anchor) || !equalCursorPos(here.head, there.head)) { return false } + } + return true + }; + + Selection.prototype.deepCopy = function () { + var out = []; + for (var i = 0; i < this.ranges.length; i++) + { out[i] = new Range(copyPos(this.ranges[i].anchor), copyPos(this.ranges[i].head)); } + return new Selection(out, this.primIndex) + }; + + Selection.prototype.somethingSelected = function () { + for (var i = 0; i < this.ranges.length; i++) + { if (!this.ranges[i].empty()) { return true } } + return false + }; + + Selection.prototype.contains = function (pos, end) { + if (!end) { end = pos; } + for (var i = 0; i < this.ranges.length; i++) { + var range = this.ranges[i]; + if (cmp(end, range.from()) >= 0 && cmp(pos, range.to()) <= 0) + { return i } + } + return -1 + }; + + var Range = function(anchor, head) { + this.anchor = anchor; this.head = head; + }; + + Range.prototype.from = function () { return minPos(this.anchor, this.head) }; + Range.prototype.to = function () { return maxPos(this.anchor, this.head) }; + Range.prototype.empty = function () { return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch }; + + // Take an unsorted, potentially overlapping set of ranges, and + // build a selection out of it. 'Consumes' ranges array (modifying + // it). + function normalizeSelection(cm, ranges, primIndex) { + var mayTouch = cm && cm.options.selectionsMayTouch; + var prim = ranges[primIndex]; + ranges.sort(function (a, b) { return cmp(a.from(), b.from()); }); + primIndex = indexOf(ranges, prim); + for (var i = 1; i < ranges.length; i++) { + var cur = ranges[i], prev = ranges[i - 1]; + var diff = cmp(prev.to(), cur.from()); + if (mayTouch && !cur.empty() ? diff > 0 : diff >= 0) { + var from = minPos(prev.from(), cur.from()), to = maxPos(prev.to(), cur.to()); + var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head; + if (i <= primIndex) { --primIndex; } + ranges.splice(--i, 2, new Range(inv ? to : from, inv ? from : to)); + } + } + return new Selection(ranges, primIndex) + } + + function simpleSelection(anchor, head) { + return new Selection([new Range(anchor, head || anchor)], 0) + } + + // Compute the position of the end of a change (its 'to' property + // refers to the pre-change end). + function changeEnd(change) { + if (!change.text) { return change.to } + return Pos(change.from.line + change.text.length - 1, + lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0)) + } + + // Adjust a position to refer to the post-change position of the + // same text, or the end of the change if the change covers it. + function adjustForChange(pos, change) { + if (cmp(pos, change.from) < 0) { return pos } + if (cmp(pos, change.to) <= 0) { return changeEnd(change) } + + var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch; + if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; } + return Pos(line, ch) + } + + function computeSelAfterChange(doc, change) { + var out = []; + for (var i = 0; i < doc.sel.ranges.length; i++) { + var range = doc.sel.ranges[i]; + out.push(new Range(adjustForChange(range.anchor, change), + adjustForChange(range.head, change))); + } + return normalizeSelection(doc.cm, out, doc.sel.primIndex) + } + + function offsetPos(pos, old, nw) { + if (pos.line == old.line) + { return Pos(nw.line, pos.ch - old.ch + nw.ch) } + else + { return Pos(nw.line + (pos.line - old.line), pos.ch) } + } + + // Used by replaceSelections to allow moving the selection to the + // start or around the replaced test. Hint may be "start" or "around". + function computeReplacedSel(doc, changes, hint) { + var out = []; + var oldPrev = Pos(doc.first, 0), newPrev = oldPrev; + for (var i = 0; i < changes.length; i++) { + var change = changes[i]; + var from = offsetPos(change.from, oldPrev, newPrev); + var to = offsetPos(changeEnd(change), oldPrev, newPrev); + oldPrev = change.to; + newPrev = to; + if (hint == "around") { + var range = doc.sel.ranges[i], inv = cmp(range.head, range.anchor) < 0; + out[i] = new Range(inv ? to : from, inv ? from : to); + } else { + out[i] = new Range(from, from); + } + } + return new Selection(out, doc.sel.primIndex) + } + + // Used to get the editor into a consistent state again when options change. + + function loadMode(cm) { + cm.doc.mode = getMode(cm.options, cm.doc.modeOption); + resetModeState(cm); + } + + function resetModeState(cm) { + cm.doc.iter(function (line) { + if (line.stateAfter) { line.stateAfter = null; } + if (line.styles) { line.styles = null; } + }); + cm.doc.modeFrontier = cm.doc.highlightFrontier = cm.doc.first; + startWorker(cm, 100); + cm.state.modeGen++; + if (cm.curOp) { regChange(cm); } + } + + // DOCUMENT DATA STRUCTURE + + // By default, updates that start and end at the beginning of a line + // are treated specially, in order to make the association of line + // widgets and marker elements with the text behave more intuitive. + function isWholeLineUpdate(doc, change) { + return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == "" && + (!doc.cm || doc.cm.options.wholeLineUpdateBefore) + } + + // Perform a change on the document data structure. + function updateDoc(doc, change, markedSpans, estimateHeight) { + function spansFor(n) {return markedSpans ? markedSpans[n] : null} + function update(line, text, spans) { + updateLine(line, text, spans, estimateHeight); + signalLater(line, "change", line, change); + } + function linesFor(start, end) { + var result = []; + for (var i = start; i < end; ++i) + { result.push(new Line(text[i], spansFor(i), estimateHeight)); } + return result + } + + var from = change.from, to = change.to, text = change.text; + var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line); + var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line; + + // Adjust the line structure + if (change.full) { + doc.insert(0, linesFor(0, text.length)); + doc.remove(text.length, doc.size - text.length); + } else if (isWholeLineUpdate(doc, change)) { + // This is a whole-line replace. Treated specially to make + // sure line objects move the way they are supposed to. + var added = linesFor(0, text.length - 1); + update(lastLine, lastLine.text, lastSpans); + if (nlines) { doc.remove(from.line, nlines); } + if (added.length) { doc.insert(from.line, added); } + } else if (firstLine == lastLine) { + if (text.length == 1) { + update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans); + } else { + var added$1 = linesFor(1, text.length - 1); + added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight)); + update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0)); + doc.insert(from.line + 1, added$1); + } + } else if (text.length == 1) { + update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0)); + doc.remove(from.line + 1, nlines); + } else { + update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0)); + update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans); + var added$2 = linesFor(1, text.length - 1); + if (nlines > 1) { doc.remove(from.line + 1, nlines - 1); } + doc.insert(from.line + 1, added$2); + } + + signalLater(doc, "change", doc, change); + } + + // Call f for all linked documents. + function linkedDocs(doc, f, sharedHistOnly) { + function propagate(doc, skip, sharedHist) { + if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) { + var rel = doc.linked[i]; + if (rel.doc == skip) { continue } + var shared = sharedHist && rel.sharedHist; + if (sharedHistOnly && !shared) { continue } + f(rel.doc, shared); + propagate(rel.doc, doc, shared); + } } + } + propagate(doc, null, true); + } + + // Attach a document to an editor. + function attachDoc(cm, doc) { + if (doc.cm) { throw new Error("This document is already in use.") } + cm.doc = doc; + doc.cm = cm; + estimateLineHeights(cm); + loadMode(cm); + setDirectionClass(cm); + cm.options.direction = doc.direction; + if (!cm.options.lineWrapping) { findMaxLine(cm); } + cm.options.mode = doc.modeOption; + regChange(cm); + } + + function setDirectionClass(cm) { + (cm.doc.direction == "rtl" ? addClass : rmClass)(cm.display.lineDiv, "CodeMirror-rtl"); + } + + function directionChanged(cm) { + runInOp(cm, function () { + setDirectionClass(cm); + regChange(cm); + }); + } + + function History(prev) { + // Arrays of change events and selections. Doing something adds an + // event to done and clears undo. Undoing moves events from done + // to undone, redoing moves them in the other direction. + this.done = []; this.undone = []; + this.undoDepth = prev ? prev.undoDepth : Infinity; + // Used to track when changes can be merged into a single undo + // event + this.lastModTime = this.lastSelTime = 0; + this.lastOp = this.lastSelOp = null; + this.lastOrigin = this.lastSelOrigin = null; + // Used by the isClean() method + this.generation = this.maxGeneration = prev ? prev.maxGeneration : 1; + } + + // Create a history change event from an updateDoc-style change + // object. + function historyChangeFromChange(doc, change) { + var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)}; + attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); + linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true); + return histChange + } + + // Pop all selection events off the end of a history array. Stop at + // a change event. + function clearSelectionEvents(array) { + while (array.length) { + var last = lst(array); + if (last.ranges) { array.pop(); } + else { break } + } + } + + // Find the top change event in the history. Pop off selection + // events that are in the way. + function lastChangeEvent(hist, force) { + if (force) { + clearSelectionEvents(hist.done); + return lst(hist.done) + } else if (hist.done.length && !lst(hist.done).ranges) { + return lst(hist.done) + } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) { + hist.done.pop(); + return lst(hist.done) + } + } + + // Register a change in the history. Merges changes that are within + // a single operation, or are close together with an origin that + // allows merging (starting with "+") into a single event. + function addChangeToHistory(doc, change, selAfter, opId) { + var hist = doc.history; + hist.undone.length = 0; + var time = +new Date, cur; + var last; + + if ((hist.lastOp == opId || + hist.lastOrigin == change.origin && change.origin && + ((change.origin.charAt(0) == "+" && hist.lastModTime > time - (doc.cm ? doc.cm.options.historyEventDelay : 500)) || + change.origin.charAt(0) == "*")) && + (cur = lastChangeEvent(hist, hist.lastOp == opId))) { + // Merge this change into the last event + last = lst(cur.changes); + if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) { + // Optimized case for simple insertion -- don't want to add + // new changesets for every character typed + last.to = changeEnd(change); + } else { + // Add new sub-event + cur.changes.push(historyChangeFromChange(doc, change)); + } + } else { + // Can not be merged, start a new event. + var before = lst(hist.done); + if (!before || !before.ranges) + { pushSelectionToHistory(doc.sel, hist.done); } + cur = {changes: [historyChangeFromChange(doc, change)], + generation: hist.generation}; + hist.done.push(cur); + while (hist.done.length > hist.undoDepth) { + hist.done.shift(); + if (!hist.done[0].ranges) { hist.done.shift(); } + } + } + hist.done.push(selAfter); + hist.generation = ++hist.maxGeneration; + hist.lastModTime = hist.lastSelTime = time; + hist.lastOp = hist.lastSelOp = opId; + hist.lastOrigin = hist.lastSelOrigin = change.origin; + + if (!last) { signal(doc, "historyAdded"); } + } + + function selectionEventCanBeMerged(doc, origin, prev, sel) { + var ch = origin.charAt(0); + return ch == "*" || + ch == "+" && + prev.ranges.length == sel.ranges.length && + prev.somethingSelected() == sel.somethingSelected() && + new Date - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.historyEventDelay : 500) + } + + // Called whenever the selection changes, sets the new selection as + // the pending selection in the history, and pushes the old pending + // selection into the 'done' array when it was significantly + // different (in number of selected ranges, emptiness, or time). + function addSelectionToHistory(doc, sel, opId, options) { + var hist = doc.history, origin = options && options.origin; + + // A new event is started when the previous origin does not match + // the current, or the origins don't allow matching. Origins + // starting with * are always merged, those starting with + are + // merged when similar and close together in time. + if (opId == hist.lastSelOp || + (origin && hist.lastSelOrigin == origin && + (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin || + selectionEventCanBeMerged(doc, origin, lst(hist.done), sel)))) + { hist.done[hist.done.length - 1] = sel; } + else + { pushSelectionToHistory(sel, hist.done); } + + hist.lastSelTime = +new Date; + hist.lastSelOrigin = origin; + hist.lastSelOp = opId; + if (options && options.clearRedo !== false) + { clearSelectionEvents(hist.undone); } + } + + function pushSelectionToHistory(sel, dest) { + var top = lst(dest); + if (!(top && top.ranges && top.equals(sel))) + { dest.push(sel); } + } + + // Used to store marked span information in the history. + function attachLocalSpans(doc, change, from, to) { + var existing = change["spans_" + doc.id], n = 0; + doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function (line) { + if (line.markedSpans) + { (existing || (existing = change["spans_" + doc.id] = {}))[n] = line.markedSpans; } + ++n; + }); + } + + // When un/re-doing restores text containing marked spans, those + // that have been explicitly cleared should not be restored. + function removeClearedSpans(spans) { + if (!spans) { return null } + var out; + for (var i = 0; i < spans.length; ++i) { + if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } } + else if (out) { out.push(spans[i]); } + } + return !out ? spans : out.length ? out : null + } + + // Retrieve and filter the old marked spans stored in a change event. + function getOldSpans(doc, change) { + var found = change["spans_" + doc.id]; + if (!found) { return null } + var nw = []; + for (var i = 0; i < change.text.length; ++i) + { nw.push(removeClearedSpans(found[i])); } + return nw + } + + // Used for un/re-doing changes from the history. Combines the + // result of computing the existing spans with the set of spans that + // existed in the history (so that deleting around a span and then + // undoing brings back the span). + function mergeOldSpans(doc, change) { + var old = getOldSpans(doc, change); + var stretched = stretchSpansOverChange(doc, change); + if (!old) { return stretched } + if (!stretched) { return old } + + for (var i = 0; i < old.length; ++i) { + var oldCur = old[i], stretchCur = stretched[i]; + if (oldCur && stretchCur) { + spans: for (var j = 0; j < stretchCur.length; ++j) { + var span = stretchCur[j]; + for (var k = 0; k < oldCur.length; ++k) + { if (oldCur[k].marker == span.marker) { continue spans } } + oldCur.push(span); + } + } else if (stretchCur) { + old[i] = stretchCur; + } + } + return old + } + + // Used both to provide a JSON-safe object in .getHistory, and, when + // detaching a document, to split the history in two + function copyHistoryArray(events, newGroup, instantiateSel) { + var copy = []; + for (var i = 0; i < events.length; ++i) { + var event = events[i]; + if (event.ranges) { + copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event); + continue + } + var changes = event.changes, newChanges = []; + copy.push({changes: newChanges}); + for (var j = 0; j < changes.length; ++j) { + var change = changes[j], m = (void 0); + newChanges.push({from: change.from, to: change.to, text: change.text}); + if (newGroup) { for (var prop in change) { if (m = prop.match(/^spans_(\d+)$/)) { + if (indexOf(newGroup, Number(m[1])) > -1) { + lst(newChanges)[prop] = change[prop]; + delete change[prop]; + } + } } } + } + } + return copy + } + + // The 'scroll' parameter given to many of these indicated whether + // the new cursor position should be scrolled into view after + // modifying the selection. + + // If shift is held or the extend flag is set, extends a range to + // include a given position (and optionally a second position). + // Otherwise, simply returns the range between the given positions. + // Used for cursor motion and such. + function extendRange(range, head, other, extend) { + if (extend) { + var anchor = range.anchor; + if (other) { + var posBefore = cmp(head, anchor) < 0; + if (posBefore != (cmp(other, anchor) < 0)) { + anchor = head; + head = other; + } else if (posBefore != (cmp(head, other) < 0)) { + head = other; + } + } + return new Range(anchor, head) + } else { + return new Range(other || head, head) + } + } + + // Extend the primary selection range, discard the rest. + function extendSelection(doc, head, other, options, extend) { + if (extend == null) { extend = doc.cm && (doc.cm.display.shift || doc.extend); } + setSelection(doc, new Selection([extendRange(doc.sel.primary(), head, other, extend)], 0), options); + } + + // Extend all selections (pos is an array of selections with length + // equal the number of selections) + function extendSelections(doc, heads, options) { + var out = []; + var extend = doc.cm && (doc.cm.display.shift || doc.extend); + for (var i = 0; i < doc.sel.ranges.length; i++) + { out[i] = extendRange(doc.sel.ranges[i], heads[i], null, extend); } + var newSel = normalizeSelection(doc.cm, out, doc.sel.primIndex); + setSelection(doc, newSel, options); + } + + // Updates a single range in the selection. + function replaceOneSelection(doc, i, range, options) { + var ranges = doc.sel.ranges.slice(0); + ranges[i] = range; + setSelection(doc, normalizeSelection(doc.cm, ranges, doc.sel.primIndex), options); + } + + // Reset the selection to a single range. + function setSimpleSelection(doc, anchor, head, options) { + setSelection(doc, simpleSelection(anchor, head), options); + } + + // Give beforeSelectionChange handlers a change to influence a + // selection update. + function filterSelectionChange(doc, sel, options) { + var obj = { + ranges: sel.ranges, + update: function(ranges) { + this.ranges = []; + for (var i = 0; i < ranges.length; i++) + { this.ranges[i] = new Range(clipPos(doc, ranges[i].anchor), + clipPos(doc, ranges[i].head)); } + }, + origin: options && options.origin + }; + signal(doc, "beforeSelectionChange", doc, obj); + if (doc.cm) { signal(doc.cm, "beforeSelectionChange", doc.cm, obj); } + if (obj.ranges != sel.ranges) { return normalizeSelection(doc.cm, obj.ranges, obj.ranges.length - 1) } + else { return sel } + } + + function setSelectionReplaceHistory(doc, sel, options) { + var done = doc.history.done, last = lst(done); + if (last && last.ranges) { + done[done.length - 1] = sel; + setSelectionNoUndo(doc, sel, options); + } else { + setSelection(doc, sel, options); + } + } + + // Set a new selection. + function setSelection(doc, sel, options) { + setSelectionNoUndo(doc, sel, options); + addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options); + } + + function setSelectionNoUndo(doc, sel, options) { + if (hasHandler(doc, "beforeSelectionChange") || doc.cm && hasHandler(doc.cm, "beforeSelectionChange")) + { sel = filterSelectionChange(doc, sel, options); } + + var bias = options && options.bias || + (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1); + setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true)); + + if (!(options && options.scroll === false) && doc.cm && doc.cm.getOption("readOnly") != "nocursor") + { ensureCursorVisible(doc.cm); } + } + + function setSelectionInner(doc, sel) { + if (sel.equals(doc.sel)) { return } + + doc.sel = sel; + + if (doc.cm) { + doc.cm.curOp.updateInput = 1; + doc.cm.curOp.selectionChanged = true; + signalCursorActivity(doc.cm); + } + signalLater(doc, "cursorActivity", doc); + } + + // Verify that the selection does not partially select any atomic + // marked ranges. + function reCheckSelection(doc) { + setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false)); + } + + // Return a selection that does not partially select any atomic + // ranges. + function skipAtomicInSelection(doc, sel, bias, mayClear) { + var out; + for (var i = 0; i < sel.ranges.length; i++) { + var range = sel.ranges[i]; + var old = sel.ranges.length == doc.sel.ranges.length && doc.sel.ranges[i]; + var newAnchor = skipAtomic(doc, range.anchor, old && old.anchor, bias, mayClear); + var newHead = range.head == range.anchor ? newAnchor : skipAtomic(doc, range.head, old && old.head, bias, mayClear); + if (out || newAnchor != range.anchor || newHead != range.head) { + if (!out) { out = sel.ranges.slice(0, i); } + out[i] = new Range(newAnchor, newHead); + } + } + return out ? normalizeSelection(doc.cm, out, sel.primIndex) : sel + } + + function skipAtomicInner(doc, pos, oldPos, dir, mayClear) { + var line = getLine(doc, pos.line); + if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) { + var sp = line.markedSpans[i], m = sp.marker; + + // Determine if we should prevent the cursor being placed to the left/right of an atomic marker + // Historically this was determined using the inclusiveLeft/Right option, but the new way to control it + // is with selectLeft/Right + var preventCursorLeft = ("selectLeft" in m) ? !m.selectLeft : m.inclusiveLeft; + var preventCursorRight = ("selectRight" in m) ? !m.selectRight : m.inclusiveRight; + + if ((sp.from == null || (preventCursorLeft ? sp.from <= pos.ch : sp.from < pos.ch)) && + (sp.to == null || (preventCursorRight ? sp.to >= pos.ch : sp.to > pos.ch))) { + if (mayClear) { + signal(m, "beforeCursorEnter"); + if (m.explicitlyCleared) { + if (!line.markedSpans) { break } + else {--i; continue} + } + } + if (!m.atomic) { continue } + + if (oldPos) { + var near = m.find(dir < 0 ? 1 : -1), diff = (void 0); + if (dir < 0 ? preventCursorRight : preventCursorLeft) + { near = movePos(doc, near, -dir, near && near.line == pos.line ? line : null); } + if (near && near.line == pos.line && (diff = cmp(near, oldPos)) && (dir < 0 ? diff < 0 : diff > 0)) + { return skipAtomicInner(doc, near, pos, dir, mayClear) } + } + + var far = m.find(dir < 0 ? -1 : 1); + if (dir < 0 ? preventCursorLeft : preventCursorRight) + { far = movePos(doc, far, dir, far.line == pos.line ? line : null); } + return far ? skipAtomicInner(doc, far, pos, dir, mayClear) : null + } + } } + return pos + } + + // Ensure a given position is not inside an atomic range. + function skipAtomic(doc, pos, oldPos, bias, mayClear) { + var dir = bias || 1; + var found = skipAtomicInner(doc, pos, oldPos, dir, mayClear) || + (!mayClear && skipAtomicInner(doc, pos, oldPos, dir, true)) || + skipAtomicInner(doc, pos, oldPos, -dir, mayClear) || + (!mayClear && skipAtomicInner(doc, pos, oldPos, -dir, true)); + if (!found) { + doc.cantEdit = true; + return Pos(doc.first, 0) + } + return found + } + + function movePos(doc, pos, dir, line) { + if (dir < 0 && pos.ch == 0) { + if (pos.line > doc.first) { return clipPos(doc, Pos(pos.line - 1)) } + else { return null } + } else if (dir > 0 && pos.ch == (line || getLine(doc, pos.line)).text.length) { + if (pos.line < doc.first + doc.size - 1) { return Pos(pos.line + 1, 0) } + else { return null } + } else { + return new Pos(pos.line, pos.ch + dir) + } + } + + function selectAll(cm) { + cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll); + } + + // UPDATING + + // Allow "beforeChange" event handlers to influence a change + function filterChange(doc, change, update) { + var obj = { + canceled: false, + from: change.from, + to: change.to, + text: change.text, + origin: change.origin, + cancel: function () { return obj.canceled = true; } + }; + if (update) { obj.update = function (from, to, text, origin) { + if (from) { obj.from = clipPos(doc, from); } + if (to) { obj.to = clipPos(doc, to); } + if (text) { obj.text = text; } + if (origin !== undefined) { obj.origin = origin; } + }; } + signal(doc, "beforeChange", doc, obj); + if (doc.cm) { signal(doc.cm, "beforeChange", doc.cm, obj); } + + if (obj.canceled) { + if (doc.cm) { doc.cm.curOp.updateInput = 2; } + return null + } + return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin} + } + + // Apply a change to a document, and add it to the document's + // history, and propagating it to all linked documents. + function makeChange(doc, change, ignoreReadOnly) { + if (doc.cm) { + if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) } + if (doc.cm.state.suppressEdits) { return } + } + + if (hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange")) { + change = filterChange(doc, change, true); + if (!change) { return } + } + + // Possibly split or suppress the update based on the presence + // of read-only spans in its range. + var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to); + if (split) { + for (var i = split.length - 1; i >= 0; --i) + { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [""] : change.text, origin: change.origin}); } + } else { + makeChangeInner(doc, change); + } + } + + function makeChangeInner(doc, change) { + if (change.text.length == 1 && change.text[0] == "" && cmp(change.from, change.to) == 0) { return } + var selAfter = computeSelAfterChange(doc, change); + addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN); + + makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change)); + var rebased = []; + + linkedDocs(doc, function (doc, sharedHist) { + if (!sharedHist && indexOf(rebased, doc.history) == -1) { + rebaseHist(doc.history, change); + rebased.push(doc.history); + } + makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change)); + }); + } + + // Revert a change stored in a document's history. + function makeChangeFromHistory(doc, type, allowSelectionOnly) { + var suppress = doc.cm && doc.cm.state.suppressEdits; + if (suppress && !allowSelectionOnly) { return } + + var hist = doc.history, event, selAfter = doc.sel; + var source = type == "undo" ? hist.done : hist.undone, dest = type == "undo" ? hist.undone : hist.done; + + // Verify that there is a useable event (so that ctrl-z won't + // needlessly clear selection events) + var i = 0; + for (; i < source.length; i++) { + event = source[i]; + if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges) + { break } + } + if (i == source.length) { return } + hist.lastOrigin = hist.lastSelOrigin = null; + + for (;;) { + event = source.pop(); + if (event.ranges) { + pushSelectionToHistory(event, dest); + if (allowSelectionOnly && !event.equals(doc.sel)) { + setSelection(doc, event, {clearRedo: false}); + return + } + selAfter = event; + } else if (suppress) { + source.push(event); + return + } else { break } + } + + // Build up a reverse change object to add to the opposite history + // stack (redo when undoing, and vice versa). + var antiChanges = []; + pushSelectionToHistory(selAfter, dest); + dest.push({changes: antiChanges, generation: hist.generation}); + hist.generation = event.generation || ++hist.maxGeneration; + + var filter = hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange"); + + var loop = function ( i ) { + var change = event.changes[i]; + change.origin = type; + if (filter && !filterChange(doc, change, false)) { + source.length = 0; + return {} + } + + antiChanges.push(historyChangeFromChange(doc, change)); + + var after = i ? computeSelAfterChange(doc, change) : lst(source); + makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change)); + if (!i && doc.cm) { doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}); } + var rebased = []; + + // Propagate to the linked documents + linkedDocs(doc, function (doc, sharedHist) { + if (!sharedHist && indexOf(rebased, doc.history) == -1) { + rebaseHist(doc.history, change); + rebased.push(doc.history); + } + makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change)); + }); + }; + + for (var i$1 = event.changes.length - 1; i$1 >= 0; --i$1) { + var returned = loop( i$1 ); + + if ( returned ) return returned.v; + } + } + + // Sub-views need their line numbers shifted when text is added + // above or below them in the parent document. + function shiftDoc(doc, distance) { + if (distance == 0) { return } + doc.first += distance; + doc.sel = new Selection(map(doc.sel.ranges, function (range) { return new Range( + Pos(range.anchor.line + distance, range.anchor.ch), + Pos(range.head.line + distance, range.head.ch) + ); }), doc.sel.primIndex); + if (doc.cm) { + regChange(doc.cm, doc.first, doc.first - distance, distance); + for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++) + { regLineChange(doc.cm, l, "gutter"); } + } + } + + // More lower-level change function, handling only a single document + // (not linked ones). + function makeChangeSingleDoc(doc, change, selAfter, spans) { + if (doc.cm && !doc.cm.curOp) + { return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans) } + + if (change.to.line < doc.first) { + shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line)); + return + } + if (change.from.line > doc.lastLine()) { return } + + // Clip the change to the size of this doc + if (change.from.line < doc.first) { + var shift = change.text.length - 1 - (doc.first - change.from.line); + shiftDoc(doc, shift); + change = {from: Pos(doc.first, 0), to: Pos(change.to.line + shift, change.to.ch), + text: [lst(change.text)], origin: change.origin}; + } + var last = doc.lastLine(); + if (change.to.line > last) { + change = {from: change.from, to: Pos(last, getLine(doc, last).text.length), + text: [change.text[0]], origin: change.origin}; + } + + change.removed = getBetween(doc, change.from, change.to); + + if (!selAfter) { selAfter = computeSelAfterChange(doc, change); } + if (doc.cm) { makeChangeSingleDocInEditor(doc.cm, change, spans); } + else { updateDoc(doc, change, spans); } + setSelectionNoUndo(doc, selAfter, sel_dontScroll); + + if (doc.cantEdit && skipAtomic(doc, Pos(doc.firstLine(), 0))) + { doc.cantEdit = false; } + } + + // Handle the interaction of a change to a document with the editor + // that this document is part of. + function makeChangeSingleDocInEditor(cm, change, spans) { + var doc = cm.doc, display = cm.display, from = change.from, to = change.to; + + var recomputeMaxLength = false, checkWidthStart = from.line; + if (!cm.options.lineWrapping) { + checkWidthStart = lineNo(visualLine(getLine(doc, from.line))); + doc.iter(checkWidthStart, to.line + 1, function (line) { + if (line == display.maxLine) { + recomputeMaxLength = true; + return true + } + }); + } + + if (doc.sel.contains(change.from, change.to) > -1) + { signalCursorActivity(cm); } + + updateDoc(doc, change, spans, estimateHeight(cm)); + + if (!cm.options.lineWrapping) { + doc.iter(checkWidthStart, from.line + change.text.length, function (line) { + var len = lineLength(line); + if (len > display.maxLineLength) { + display.maxLine = line; + display.maxLineLength = len; + display.maxLineChanged = true; + recomputeMaxLength = false; + } + }); + if (recomputeMaxLength) { cm.curOp.updateMaxLine = true; } + } + + retreatFrontier(doc, from.line); + startWorker(cm, 400); + + var lendiff = change.text.length - (to.line - from.line) - 1; + // Remember that these lines changed, for updating the display + if (change.full) + { regChange(cm); } + else if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change)) + { regLineChange(cm, from.line, "text"); } + else + { regChange(cm, from.line, to.line + 1, lendiff); } + + var changesHandler = hasHandler(cm, "changes"), changeHandler = hasHandler(cm, "change"); + if (changeHandler || changesHandler) { + var obj = { + from: from, to: to, + text: change.text, + removed: change.removed, + origin: change.origin + }; + if (changeHandler) { signalLater(cm, "change", cm, obj); } + if (changesHandler) { (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj); } + } + cm.display.selForContextMenu = null; + } + + function replaceRange(doc, code, from, to, origin) { + var assign; + + if (!to) { to = from; } + if (cmp(to, from) < 0) { (assign = [to, from], from = assign[0], to = assign[1]); } + if (typeof code == "string") { code = doc.splitLines(code); } + makeChange(doc, {from: from, to: to, text: code, origin: origin}); + } + + // Rebasing/resetting history to deal with externally-sourced changes + + function rebaseHistSelSingle(pos, from, to, diff) { + if (to < pos.line) { + pos.line += diff; + } else if (from < pos.line) { + pos.line = from; + pos.ch = 0; + } + } + + // Tries to rebase an array of history events given a change in the + // document. If the change touches the same lines as the event, the + // event, and everything 'behind' it, is discarded. If the change is + // before the event, the event's positions are updated. Uses a + // copy-on-write scheme for the positions, to avoid having to + // reallocate them all on every rebase, but also avoid problems with + // shared position objects being unsafely updated. + function rebaseHistArray(array, from, to, diff) { + for (var i = 0; i < array.length; ++i) { + var sub = array[i], ok = true; + if (sub.ranges) { + if (!sub.copied) { sub = array[i] = sub.deepCopy(); sub.copied = true; } + for (var j = 0; j < sub.ranges.length; j++) { + rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff); + rebaseHistSelSingle(sub.ranges[j].head, from, to, diff); + } + continue + } + for (var j$1 = 0; j$1 < sub.changes.length; ++j$1) { + var cur = sub.changes[j$1]; + if (to < cur.from.line) { + cur.from = Pos(cur.from.line + diff, cur.from.ch); + cur.to = Pos(cur.to.line + diff, cur.to.ch); + } else if (from <= cur.to.line) { + ok = false; + break + } + } + if (!ok) { + array.splice(0, i + 1); + i = 0; + } + } + } + + function rebaseHist(hist, change) { + var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1; + rebaseHistArray(hist.done, from, to, diff); + rebaseHistArray(hist.undone, from, to, diff); + } + + // Utility for applying a change to a line by handle or number, + // returning the number and optionally registering the line as + // changed. + function changeLine(doc, handle, changeType, op) { + var no = handle, line = handle; + if (typeof handle == "number") { line = getLine(doc, clipLine(doc, handle)); } + else { no = lineNo(handle); } + if (no == null) { return null } + if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); } + return line + } + + // The document is represented as a BTree consisting of leaves, with + // chunk of lines in them, and branches, with up to ten leaves or + // other branch nodes below them. The top node is always a branch + // node, and is the document object itself (meaning it has + // additional methods and properties). + // + // All nodes have parent links. The tree is used both to go from + // line numbers to line objects, and to go from objects to numbers. + // It also indexes by height, and is used to convert between height + // and line object, and to find the total height of the document. + // + // See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html + + function LeafChunk(lines) { + this.lines = lines; + this.parent = null; + var height = 0; + for (var i = 0; i < lines.length; ++i) { + lines[i].parent = this; + height += lines[i].height; + } + this.height = height; + } + + LeafChunk.prototype = { + chunkSize: function() { return this.lines.length }, + + // Remove the n lines at offset 'at'. + removeInner: function(at, n) { + for (var i = at, e = at + n; i < e; ++i) { + var line = this.lines[i]; + this.height -= line.height; + cleanUpLine(line); + signalLater(line, "delete"); + } + this.lines.splice(at, n); + }, + + // Helper used to collapse a small branch into a single leaf. + collapse: function(lines) { + lines.push.apply(lines, this.lines); + }, + + // Insert the given array of lines at offset 'at', count them as + // having the given height. + insertInner: function(at, lines, height) { + this.height += height; + this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at)); + for (var i = 0; i < lines.length; ++i) { lines[i].parent = this; } + }, + + // Used to iterate over a part of the tree. + iterN: function(at, n, op) { + for (var e = at + n; at < e; ++at) + { if (op(this.lines[at])) { return true } } + } + }; + + function BranchChunk(children) { + this.children = children; + var size = 0, height = 0; + for (var i = 0; i < children.length; ++i) { + var ch = children[i]; + size += ch.chunkSize(); height += ch.height; + ch.parent = this; + } + this.size = size; + this.height = height; + this.parent = null; + } + + BranchChunk.prototype = { + chunkSize: function() { return this.size }, + + removeInner: function(at, n) { + this.size -= n; + for (var i = 0; i < this.children.length; ++i) { + var child = this.children[i], sz = child.chunkSize(); + if (at < sz) { + var rm = Math.min(n, sz - at), oldHeight = child.height; + child.removeInner(at, rm); + this.height -= oldHeight - child.height; + if (sz == rm) { this.children.splice(i--, 1); child.parent = null; } + if ((n -= rm) == 0) { break } + at = 0; + } else { at -= sz; } + } + // If the result is smaller than 25 lines, ensure that it is a + // single leaf node. + if (this.size - n < 25 && + (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) { + var lines = []; + this.collapse(lines); + this.children = [new LeafChunk(lines)]; + this.children[0].parent = this; + } + }, + + collapse: function(lines) { + for (var i = 0; i < this.children.length; ++i) { this.children[i].collapse(lines); } + }, + + insertInner: function(at, lines, height) { + this.size += lines.length; + this.height += height; + for (var i = 0; i < this.children.length; ++i) { + var child = this.children[i], sz = child.chunkSize(); + if (at <= sz) { + child.insertInner(at, lines, height); + if (child.lines && child.lines.length > 50) { + // To avoid memory thrashing when child.lines is huge (e.g. first view of a large file), it's never spliced. + // Instead, small slices are taken. They're taken in order because sequential memory accesses are fastest. + var remaining = child.lines.length % 25 + 25; + for (var pos = remaining; pos < child.lines.length;) { + var leaf = new LeafChunk(child.lines.slice(pos, pos += 25)); + child.height -= leaf.height; + this.children.splice(++i, 0, leaf); + leaf.parent = this; + } + child.lines = child.lines.slice(0, remaining); + this.maybeSpill(); + } + break + } + at -= sz; + } + }, + + // When a node has grown, check whether it should be split. + maybeSpill: function() { + if (this.children.length <= 10) { return } + var me = this; + do { + var spilled = me.children.splice(me.children.length - 5, 5); + var sibling = new BranchChunk(spilled); + if (!me.parent) { // Become the parent node + var copy = new BranchChunk(me.children); + copy.parent = me; + me.children = [copy, sibling]; + me = copy; + } else { + me.size -= sibling.size; + me.height -= sibling.height; + var myIndex = indexOf(me.parent.children, me); + me.parent.children.splice(myIndex + 1, 0, sibling); + } + sibling.parent = me.parent; + } while (me.children.length > 10) + me.parent.maybeSpill(); + }, + + iterN: function(at, n, op) { + for (var i = 0; i < this.children.length; ++i) { + var child = this.children[i], sz = child.chunkSize(); + if (at < sz) { + var used = Math.min(n, sz - at); + if (child.iterN(at, used, op)) { return true } + if ((n -= used) == 0) { break } + at = 0; + } else { at -= sz; } + } + } + }; + + // Line widgets are block elements displayed above or below a line. + + var LineWidget = function(doc, node, options) { + if (options) { for (var opt in options) { if (options.hasOwnProperty(opt)) + { this[opt] = options[opt]; } } } + this.doc = doc; + this.node = node; + }; + + LineWidget.prototype.clear = function () { + var cm = this.doc.cm, ws = this.line.widgets, line = this.line, no = lineNo(line); + if (no == null || !ws) { return } + for (var i = 0; i < ws.length; ++i) { if (ws[i] == this) { ws.splice(i--, 1); } } + if (!ws.length) { line.widgets = null; } + var height = widgetHeight(this); + updateLineHeight(line, Math.max(0, line.height - height)); + if (cm) { + runInOp(cm, function () { + adjustScrollWhenAboveVisible(cm, line, -height); + regLineChange(cm, no, "widget"); + }); + signalLater(cm, "lineWidgetCleared", cm, this, no); + } + }; + + LineWidget.prototype.changed = function () { + var this$1 = this; + + var oldH = this.height, cm = this.doc.cm, line = this.line; + this.height = null; + var diff = widgetHeight(this) - oldH; + if (!diff) { return } + if (!lineIsHidden(this.doc, line)) { updateLineHeight(line, line.height + diff); } + if (cm) { + runInOp(cm, function () { + cm.curOp.forceUpdate = true; + adjustScrollWhenAboveVisible(cm, line, diff); + signalLater(cm, "lineWidgetChanged", cm, this$1, lineNo(line)); + }); + } + }; + eventMixin(LineWidget); + + function adjustScrollWhenAboveVisible(cm, line, diff) { + if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop)) + { addToScrollTop(cm, diff); } + } + + function addLineWidget(doc, handle, node, options) { + var widget = new LineWidget(doc, node, options); + var cm = doc.cm; + if (cm && widget.noHScroll) { cm.display.alignWidgets = true; } + changeLine(doc, handle, "widget", function (line) { + var widgets = line.widgets || (line.widgets = []); + if (widget.insertAt == null) { widgets.push(widget); } + else { widgets.splice(Math.min(widgets.length, Math.max(0, widget.insertAt)), 0, widget); } + widget.line = line; + if (cm && !lineIsHidden(doc, line)) { + var aboveVisible = heightAtLine(line) < doc.scrollTop; + updateLineHeight(line, line.height + widgetHeight(widget)); + if (aboveVisible) { addToScrollTop(cm, widget.height); } + cm.curOp.forceUpdate = true; + } + return true + }); + if (cm) { signalLater(cm, "lineWidgetAdded", cm, widget, typeof handle == "number" ? handle : lineNo(handle)); } + return widget + } + + // TEXTMARKERS + + // Created with markText and setBookmark methods. A TextMarker is a + // handle that can be used to clear or find a marked position in the + // document. Line objects hold arrays (markedSpans) containing + // {from, to, marker} object pointing to such marker objects, and + // indicating that such a marker is present on that line. Multiple + // lines may point to the same marker when it spans across lines. + // The spans will have null for their from/to properties when the + // marker continues beyond the start/end of the line. Markers have + // links back to the lines they currently touch. + + // Collapsed markers have unique ids, in order to be able to order + // them, which is needed for uniquely determining an outer marker + // when they overlap (they may nest, but not partially overlap). + var nextMarkerId = 0; + + var TextMarker = function(doc, type) { + this.lines = []; + this.type = type; + this.doc = doc; + this.id = ++nextMarkerId; + }; + + // Clear the marker. + TextMarker.prototype.clear = function () { + if (this.explicitlyCleared) { return } + var cm = this.doc.cm, withOp = cm && !cm.curOp; + if (withOp) { startOperation(cm); } + if (hasHandler(this, "clear")) { + var found = this.find(); + if (found) { signalLater(this, "clear", found.from, found.to); } + } + var min = null, max = null; + for (var i = 0; i < this.lines.length; ++i) { + var line = this.lines[i]; + var span = getMarkedSpanFor(line.markedSpans, this); + if (cm && !this.collapsed) { regLineChange(cm, lineNo(line), "text"); } + else if (cm) { + if (span.to != null) { max = lineNo(line); } + if (span.from != null) { min = lineNo(line); } + } + line.markedSpans = removeMarkedSpan(line.markedSpans, span); + if (span.from == null && this.collapsed && !lineIsHidden(this.doc, line) && cm) + { updateLineHeight(line, textHeight(cm.display)); } + } + if (cm && this.collapsed && !cm.options.lineWrapping) { for (var i$1 = 0; i$1 < this.lines.length; ++i$1) { + var visual = visualLine(this.lines[i$1]), len = lineLength(visual); + if (len > cm.display.maxLineLength) { + cm.display.maxLine = visual; + cm.display.maxLineLength = len; + cm.display.maxLineChanged = true; + } + } } + + if (min != null && cm && this.collapsed) { regChange(cm, min, max + 1); } + this.lines.length = 0; + this.explicitlyCleared = true; + if (this.atomic && this.doc.cantEdit) { + this.doc.cantEdit = false; + if (cm) { reCheckSelection(cm.doc); } + } + if (cm) { signalLater(cm, "markerCleared", cm, this, min, max); } + if (withOp) { endOperation(cm); } + if (this.parent) { this.parent.clear(); } + }; + + // Find the position of the marker in the document. Returns a {from, + // to} object by default. Side can be passed to get a specific side + // -- 0 (both), -1 (left), or 1 (right). When lineObj is true, the + // Pos objects returned contain a line object, rather than a line + // number (used to prevent looking up the same line twice). + TextMarker.prototype.find = function (side, lineObj) { + if (side == null && this.type == "bookmark") { side = 1; } + var from, to; + for (var i = 0; i < this.lines.length; ++i) { + var line = this.lines[i]; + var span = getMarkedSpanFor(line.markedSpans, this); + if (span.from != null) { + from = Pos(lineObj ? line : lineNo(line), span.from); + if (side == -1) { return from } + } + if (span.to != null) { + to = Pos(lineObj ? line : lineNo(line), span.to); + if (side == 1) { return to } + } + } + return from && {from: from, to: to} + }; + + // Signals that the marker's widget changed, and surrounding layout + // should be recomputed. + TextMarker.prototype.changed = function () { + var this$1 = this; + + var pos = this.find(-1, true), widget = this, cm = this.doc.cm; + if (!pos || !cm) { return } + runInOp(cm, function () { + var line = pos.line, lineN = lineNo(pos.line); + var view = findViewForLine(cm, lineN); + if (view) { + clearLineMeasurementCacheFor(view); + cm.curOp.selectionChanged = cm.curOp.forceUpdate = true; + } + cm.curOp.updateMaxLine = true; + if (!lineIsHidden(widget.doc, line) && widget.height != null) { + var oldHeight = widget.height; + widget.height = null; + var dHeight = widgetHeight(widget) - oldHeight; + if (dHeight) + { updateLineHeight(line, line.height + dHeight); } + } + signalLater(cm, "markerChanged", cm, this$1); + }); + }; + + TextMarker.prototype.attachLine = function (line) { + if (!this.lines.length && this.doc.cm) { + var op = this.doc.cm.curOp; + if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1) + { (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this); } + } + this.lines.push(line); + }; + + TextMarker.prototype.detachLine = function (line) { + this.lines.splice(indexOf(this.lines, line), 1); + if (!this.lines.length && this.doc.cm) { + var op = this.doc.cm.curOp + ;(op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this); + } + }; + eventMixin(TextMarker); + + // Create a marker, wire it up to the right lines, and + function markText(doc, from, to, options, type) { + // Shared markers (across linked documents) are handled separately + // (markTextShared will call out to this again, once per + // document). + if (options && options.shared) { return markTextShared(doc, from, to, options, type) } + // Ensure we are in an operation. + if (doc.cm && !doc.cm.curOp) { return operation(doc.cm, markText)(doc, from, to, options, type) } + + var marker = new TextMarker(doc, type), diff = cmp(from, to); + if (options) { copyObj(options, marker, false); } + // Don't connect empty markers unless clearWhenEmpty is false + if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false) + { return marker } + if (marker.replacedWith) { + // Showing up as a widget implies collapsed (widget replaces text) + marker.collapsed = true; + marker.widgetNode = eltP("span", [marker.replacedWith], "CodeMirror-widget"); + if (!options.handleMouseEvents) { marker.widgetNode.setAttribute("cm-ignore-events", "true"); } + if (options.insertLeft) { marker.widgetNode.insertLeft = true; } + } + if (marker.collapsed) { + if (conflictingCollapsedRange(doc, from.line, from, to, marker) || + from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker)) + { throw new Error("Inserting collapsed marker partially overlapping an existing one") } + seeCollapsedSpans(); + } + + if (marker.addToHistory) + { addChangeToHistory(doc, {from: from, to: to, origin: "markText"}, doc.sel, NaN); } + + var curLine = from.line, cm = doc.cm, updateMaxLine; + doc.iter(curLine, to.line + 1, function (line) { + if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine) + { updateMaxLine = true; } + if (marker.collapsed && curLine != from.line) { updateLineHeight(line, 0); } + addMarkedSpan(line, new MarkedSpan(marker, + curLine == from.line ? from.ch : null, + curLine == to.line ? to.ch : null), doc.cm && doc.cm.curOp); + ++curLine; + }); + // lineIsHidden depends on the presence of the spans, so needs a second pass + if (marker.collapsed) { doc.iter(from.line, to.line + 1, function (line) { + if (lineIsHidden(doc, line)) { updateLineHeight(line, 0); } + }); } + + if (marker.clearOnEnter) { on(marker, "beforeCursorEnter", function () { return marker.clear(); }); } + + if (marker.readOnly) { + seeReadOnlySpans(); + if (doc.history.done.length || doc.history.undone.length) + { doc.clearHistory(); } + } + if (marker.collapsed) { + marker.id = ++nextMarkerId; + marker.atomic = true; + } + if (cm) { + // Sync editor state + if (updateMaxLine) { cm.curOp.updateMaxLine = true; } + if (marker.collapsed) + { regChange(cm, from.line, to.line + 1); } + else if (marker.className || marker.startStyle || marker.endStyle || marker.css || + marker.attributes || marker.title) + { for (var i = from.line; i <= to.line; i++) { regLineChange(cm, i, "text"); } } + if (marker.atomic) { reCheckSelection(cm.doc); } + signalLater(cm, "markerAdded", cm, marker); + } + return marker + } + + // SHARED TEXTMARKERS + + // A shared marker spans multiple linked documents. It is + // implemented as a meta-marker-object controlling multiple normal + // markers. + var SharedTextMarker = function(markers, primary) { + this.markers = markers; + this.primary = primary; + for (var i = 0; i < markers.length; ++i) + { markers[i].parent = this; } + }; + + SharedTextMarker.prototype.clear = function () { + if (this.explicitlyCleared) { return } + this.explicitlyCleared = true; + for (var i = 0; i < this.markers.length; ++i) + { this.markers[i].clear(); } + signalLater(this, "clear"); + }; + + SharedTextMarker.prototype.find = function (side, lineObj) { + return this.primary.find(side, lineObj) + }; + eventMixin(SharedTextMarker); + + function markTextShared(doc, from, to, options, type) { + options = copyObj(options); + options.shared = false; + var markers = [markText(doc, from, to, options, type)], primary = markers[0]; + var widget = options.widgetNode; + linkedDocs(doc, function (doc) { + if (widget) { options.widgetNode = widget.cloneNode(true); } + markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type)); + for (var i = 0; i < doc.linked.length; ++i) + { if (doc.linked[i].isParent) { return } } + primary = lst(markers); + }); + return new SharedTextMarker(markers, primary) + } + + function findSharedMarkers(doc) { + return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())), function (m) { return m.parent; }) + } + + function copySharedMarkers(doc, markers) { + for (var i = 0; i < markers.length; i++) { + var marker = markers[i], pos = marker.find(); + var mFrom = doc.clipPos(pos.from), mTo = doc.clipPos(pos.to); + if (cmp(mFrom, mTo)) { + var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type); + marker.markers.push(subMark); + subMark.parent = marker; + } + } + } + + function detachSharedMarkers(markers) { + var loop = function ( i ) { + var marker = markers[i], linked = [marker.primary.doc]; + linkedDocs(marker.primary.doc, function (d) { return linked.push(d); }); + for (var j = 0; j < marker.markers.length; j++) { + var subMarker = marker.markers[j]; + if (indexOf(linked, subMarker.doc) == -1) { + subMarker.parent = null; + marker.markers.splice(j--, 1); + } + } + }; + + for (var i = 0; i < markers.length; i++) loop( i ); + } + + var nextDocId = 0; + var Doc = function(text, mode, firstLine, lineSep, direction) { + if (!(this instanceof Doc)) { return new Doc(text, mode, firstLine, lineSep, direction) } + if (firstLine == null) { firstLine = 0; } + + BranchChunk.call(this, [new LeafChunk([new Line("", null)])]); + this.first = firstLine; + this.scrollTop = this.scrollLeft = 0; + this.cantEdit = false; + this.cleanGeneration = 1; + this.modeFrontier = this.highlightFrontier = firstLine; + var start = Pos(firstLine, 0); + this.sel = simpleSelection(start); + this.history = new History(null); + this.id = ++nextDocId; + this.modeOption = mode; + this.lineSep = lineSep; + this.direction = (direction == "rtl") ? "rtl" : "ltr"; + this.extend = false; + + if (typeof text == "string") { text = this.splitLines(text); } + updateDoc(this, {from: start, to: start, text: text}); + setSelection(this, simpleSelection(start), sel_dontScroll); + }; + + Doc.prototype = createObj(BranchChunk.prototype, { + constructor: Doc, + // Iterate over the document. Supports two forms -- with only one + // argument, it calls that for each line in the document. With + // three, it iterates over the range given by the first two (with + // the second being non-inclusive). + iter: function(from, to, op) { + if (op) { this.iterN(from - this.first, to - from, op); } + else { this.iterN(this.first, this.first + this.size, from); } + }, + + // Non-public interface for adding and removing lines. + insert: function(at, lines) { + var height = 0; + for (var i = 0; i < lines.length; ++i) { height += lines[i].height; } + this.insertInner(at - this.first, lines, height); + }, + remove: function(at, n) { this.removeInner(at - this.first, n); }, + + // From here, the methods are part of the public interface. Most + // are also available from CodeMirror (editor) instances. + + getValue: function(lineSep) { + var lines = getLines(this, this.first, this.first + this.size); + if (lineSep === false) { return lines } + return lines.join(lineSep || this.lineSeparator()) + }, + setValue: docMethodOp(function(code) { + var top = Pos(this.first, 0), last = this.first + this.size - 1; + makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length), + text: this.splitLines(code), origin: "setValue", full: true}, true); + if (this.cm) { scrollToCoords(this.cm, 0, 0); } + setSelection(this, simpleSelection(top), sel_dontScroll); + }), + replaceRange: function(code, from, to, origin) { + from = clipPos(this, from); + to = to ? clipPos(this, to) : from; + replaceRange(this, code, from, to, origin); + }, + getRange: function(from, to, lineSep) { + var lines = getBetween(this, clipPos(this, from), clipPos(this, to)); + if (lineSep === false) { return lines } + if (lineSep === '') { return lines.join('') } + return lines.join(lineSep || this.lineSeparator()) + }, + + getLine: function(line) {var l = this.getLineHandle(line); return l && l.text}, + + getLineHandle: function(line) {if (isLine(this, line)) { return getLine(this, line) }}, + getLineNumber: function(line) {return lineNo(line)}, + + getLineHandleVisualStart: function(line) { + if (typeof line == "number") { line = getLine(this, line); } + return visualLine(line) + }, + + lineCount: function() {return this.size}, + firstLine: function() {return this.first}, + lastLine: function() {return this.first + this.size - 1}, + + clipPos: function(pos) {return clipPos(this, pos)}, + + getCursor: function(start) { + var range = this.sel.primary(), pos; + if (start == null || start == "head") { pos = range.head; } + else if (start == "anchor") { pos = range.anchor; } + else if (start == "end" || start == "to" || start === false) { pos = range.to(); } + else { pos = range.from(); } + return pos + }, + listSelections: function() { return this.sel.ranges }, + somethingSelected: function() {return this.sel.somethingSelected()}, + + setCursor: docMethodOp(function(line, ch, options) { + setSimpleSelection(this, clipPos(this, typeof line == "number" ? Pos(line, ch || 0) : line), null, options); + }), + setSelection: docMethodOp(function(anchor, head, options) { + setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options); + }), + extendSelection: docMethodOp(function(head, other, options) { + extendSelection(this, clipPos(this, head), other && clipPos(this, other), options); + }), + extendSelections: docMethodOp(function(heads, options) { + extendSelections(this, clipPosArray(this, heads), options); + }), + extendSelectionsBy: docMethodOp(function(f, options) { + var heads = map(this.sel.ranges, f); + extendSelections(this, clipPosArray(this, heads), options); + }), + setSelections: docMethodOp(function(ranges, primary, options) { + if (!ranges.length) { return } + var out = []; + for (var i = 0; i < ranges.length; i++) + { out[i] = new Range(clipPos(this, ranges[i].anchor), + clipPos(this, ranges[i].head || ranges[i].anchor)); } + if (primary == null) { primary = Math.min(ranges.length - 1, this.sel.primIndex); } + setSelection(this, normalizeSelection(this.cm, out, primary), options); + }), + addSelection: docMethodOp(function(anchor, head, options) { + var ranges = this.sel.ranges.slice(0); + ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor))); + setSelection(this, normalizeSelection(this.cm, ranges, ranges.length - 1), options); + }), + + getSelection: function(lineSep) { + var ranges = this.sel.ranges, lines; + for (var i = 0; i < ranges.length; i++) { + var sel = getBetween(this, ranges[i].from(), ranges[i].to()); + lines = lines ? lines.concat(sel) : sel; + } + if (lineSep === false) { return lines } + else { return lines.join(lineSep || this.lineSeparator()) } + }, + getSelections: function(lineSep) { + var parts = [], ranges = this.sel.ranges; + for (var i = 0; i < ranges.length; i++) { + var sel = getBetween(this, ranges[i].from(), ranges[i].to()); + if (lineSep !== false) { sel = sel.join(lineSep || this.lineSeparator()); } + parts[i] = sel; + } + return parts + }, + replaceSelection: function(code, collapse, origin) { + var dup = []; + for (var i = 0; i < this.sel.ranges.length; i++) + { dup[i] = code; } + this.replaceSelections(dup, collapse, origin || "+input"); + }, + replaceSelections: docMethodOp(function(code, collapse, origin) { + var changes = [], sel = this.sel; + for (var i = 0; i < sel.ranges.length; i++) { + var range = sel.ranges[i]; + changes[i] = {from: range.from(), to: range.to(), text: this.splitLines(code[i]), origin: origin}; + } + var newSel = collapse && collapse != "end" && computeReplacedSel(this, changes, collapse); + for (var i$1 = changes.length - 1; i$1 >= 0; i$1--) + { makeChange(this, changes[i$1]); } + if (newSel) { setSelectionReplaceHistory(this, newSel); } + else if (this.cm) { ensureCursorVisible(this.cm); } + }), + undo: docMethodOp(function() {makeChangeFromHistory(this, "undo");}), + redo: docMethodOp(function() {makeChangeFromHistory(this, "redo");}), + undoSelection: docMethodOp(function() {makeChangeFromHistory(this, "undo", true);}), + redoSelection: docMethodOp(function() {makeChangeFromHistory(this, "redo", true);}), + + setExtending: function(val) {this.extend = val;}, + getExtending: function() {return this.extend}, + + historySize: function() { + var hist = this.history, done = 0, undone = 0; + for (var i = 0; i < hist.done.length; i++) { if (!hist.done[i].ranges) { ++done; } } + for (var i$1 = 0; i$1 < hist.undone.length; i$1++) { if (!hist.undone[i$1].ranges) { ++undone; } } + return {undo: done, redo: undone} + }, + clearHistory: function() { + var this$1 = this; + + this.history = new History(this.history); + linkedDocs(this, function (doc) { return doc.history = this$1.history; }, true); + }, + + markClean: function() { + this.cleanGeneration = this.changeGeneration(true); + }, + changeGeneration: function(forceSplit) { + if (forceSplit) + { this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null; } + return this.history.generation + }, + isClean: function (gen) { + return this.history.generation == (gen || this.cleanGeneration) + }, + + getHistory: function() { + return {done: copyHistoryArray(this.history.done), + undone: copyHistoryArray(this.history.undone)} + }, + setHistory: function(histData) { + var hist = this.history = new History(this.history); + hist.done = copyHistoryArray(histData.done.slice(0), null, true); + hist.undone = copyHistoryArray(histData.undone.slice(0), null, true); + }, + + setGutterMarker: docMethodOp(function(line, gutterID, value) { + return changeLine(this, line, "gutter", function (line) { + var markers = line.gutterMarkers || (line.gutterMarkers = {}); + markers[gutterID] = value; + if (!value && isEmpty(markers)) { line.gutterMarkers = null; } + return true + }) + }), + + clearGutter: docMethodOp(function(gutterID) { + var this$1 = this; + + this.iter(function (line) { + if (line.gutterMarkers && line.gutterMarkers[gutterID]) { + changeLine(this$1, line, "gutter", function () { + line.gutterMarkers[gutterID] = null; + if (isEmpty(line.gutterMarkers)) { line.gutterMarkers = null; } + return true + }); + } + }); + }), + + lineInfo: function(line) { + var n; + if (typeof line == "number") { + if (!isLine(this, line)) { return null } + n = line; + line = getLine(this, line); + if (!line) { return null } + } else { + n = lineNo(line); + if (n == null) { return null } + } + return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers, + textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass, + widgets: line.widgets} + }, + + addLineClass: docMethodOp(function(handle, where, cls) { + return changeLine(this, handle, where == "gutter" ? "gutter" : "class", function (line) { + var prop = where == "text" ? "textClass" + : where == "background" ? "bgClass" + : where == "gutter" ? "gutterClass" : "wrapClass"; + if (!line[prop]) { line[prop] = cls; } + else if (classTest(cls).test(line[prop])) { return false } + else { line[prop] += " " + cls; } + return true + }) + }), + removeLineClass: docMethodOp(function(handle, where, cls) { + return changeLine(this, handle, where == "gutter" ? "gutter" : "class", function (line) { + var prop = where == "text" ? "textClass" + : where == "background" ? "bgClass" + : where == "gutter" ? "gutterClass" : "wrapClass"; + var cur = line[prop]; + if (!cur) { return false } + else if (cls == null) { line[prop] = null; } + else { + var found = cur.match(classTest(cls)); + if (!found) { return false } + var end = found.index + found[0].length; + line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? "" : " ") + cur.slice(end) || null; + } + return true + }) + }), + + addLineWidget: docMethodOp(function(handle, node, options) { + return addLineWidget(this, handle, node, options) + }), + removeLineWidget: function(widget) { widget.clear(); }, + + markText: function(from, to, options) { + return markText(this, clipPos(this, from), clipPos(this, to), options, options && options.type || "range") + }, + setBookmark: function(pos, options) { + var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options), + insertLeft: options && options.insertLeft, + clearWhenEmpty: false, shared: options && options.shared, + handleMouseEvents: options && options.handleMouseEvents}; + pos = clipPos(this, pos); + return markText(this, pos, pos, realOpts, "bookmark") + }, + findMarksAt: function(pos) { + pos = clipPos(this, pos); + var markers = [], spans = getLine(this, pos.line).markedSpans; + if (spans) { for (var i = 0; i < spans.length; ++i) { + var span = spans[i]; + if ((span.from == null || span.from <= pos.ch) && + (span.to == null || span.to >= pos.ch)) + { markers.push(span.marker.parent || span.marker); } + } } + return markers + }, + findMarks: function(from, to, filter) { + from = clipPos(this, from); to = clipPos(this, to); + var found = [], lineNo = from.line; + this.iter(from.line, to.line + 1, function (line) { + var spans = line.markedSpans; + if (spans) { for (var i = 0; i < spans.length; i++) { + var span = spans[i]; + if (!(span.to != null && lineNo == from.line && from.ch >= span.to || + span.from == null && lineNo != from.line || + span.from != null && lineNo == to.line && span.from >= to.ch) && + (!filter || filter(span.marker))) + { found.push(span.marker.parent || span.marker); } + } } + ++lineNo; + }); + return found + }, + getAllMarks: function() { + var markers = []; + this.iter(function (line) { + var sps = line.markedSpans; + if (sps) { for (var i = 0; i < sps.length; ++i) + { if (sps[i].from != null) { markers.push(sps[i].marker); } } } + }); + return markers + }, + + posFromIndex: function(off) { + var ch, lineNo = this.first, sepSize = this.lineSeparator().length; + this.iter(function (line) { + var sz = line.text.length + sepSize; + if (sz > off) { ch = off; return true } + off -= sz; + ++lineNo; + }); + return clipPos(this, Pos(lineNo, ch)) + }, + indexFromPos: function (coords) { + coords = clipPos(this, coords); + var index = coords.ch; + if (coords.line < this.first || coords.ch < 0) { return 0 } + var sepSize = this.lineSeparator().length; + this.iter(this.first, coords.line, function (line) { // iter aborts when callback returns a truthy value + index += line.text.length + sepSize; + }); + return index + }, + + copy: function(copyHistory) { + var doc = new Doc(getLines(this, this.first, this.first + this.size), + this.modeOption, this.first, this.lineSep, this.direction); + doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft; + doc.sel = this.sel; + doc.extend = false; + if (copyHistory) { + doc.history.undoDepth = this.history.undoDepth; + doc.setHistory(this.getHistory()); + } + return doc + }, + + linkedDoc: function(options) { + if (!options) { options = {}; } + var from = this.first, to = this.first + this.size; + if (options.from != null && options.from > from) { from = options.from; } + if (options.to != null && options.to < to) { to = options.to; } + var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from, this.lineSep, this.direction); + if (options.sharedHist) { copy.history = this.history + ; }(this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist}); + copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}]; + copySharedMarkers(copy, findSharedMarkers(this)); + return copy + }, + unlinkDoc: function(other) { + if (other instanceof CodeMirror) { other = other.doc; } + if (this.linked) { for (var i = 0; i < this.linked.length; ++i) { + var link = this.linked[i]; + if (link.doc != other) { continue } + this.linked.splice(i, 1); + other.unlinkDoc(this); + detachSharedMarkers(findSharedMarkers(this)); + break + } } + // If the histories were shared, split them again + if (other.history == this.history) { + var splitIds = [other.id]; + linkedDocs(other, function (doc) { return splitIds.push(doc.id); }, true); + other.history = new History(null); + other.history.done = copyHistoryArray(this.history.done, splitIds); + other.history.undone = copyHistoryArray(this.history.undone, splitIds); + } + }, + iterLinkedDocs: function(f) {linkedDocs(this, f);}, + + getMode: function() {return this.mode}, + getEditor: function() {return this.cm}, + + splitLines: function(str) { + if (this.lineSep) { return str.split(this.lineSep) } + return splitLinesAuto(str) + }, + lineSeparator: function() { return this.lineSep || "\n" }, + + setDirection: docMethodOp(function (dir) { + if (dir != "rtl") { dir = "ltr"; } + if (dir == this.direction) { return } + this.direction = dir; + this.iter(function (line) { return line.order = null; }); + if (this.cm) { directionChanged(this.cm); } + }) + }); + + // Public alias. + Doc.prototype.eachLine = Doc.prototype.iter; + + // Kludge to work around strange IE behavior where it'll sometimes + // re-fire a series of drag-related events right after the drop (#1551) + var lastDrop = 0; + + function onDrop(e) { + var cm = this; + clearDragCursor(cm); + if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) + { return } + e_preventDefault(e); + if (ie) { lastDrop = +new Date; } + var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files; + if (!pos || cm.isReadOnly()) { return } + // Might be a file drop, in which case we simply extract the text + // and insert it. + if (files && files.length && window.FileReader && window.File) { + var n = files.length, text = Array(n), read = 0; + var markAsReadAndPasteIfAllFilesAreRead = function () { + if (++read == n) { + operation(cm, function () { + pos = clipPos(cm.doc, pos); + var change = {from: pos, to: pos, + text: cm.doc.splitLines( + text.filter(function (t) { return t != null; }).join(cm.doc.lineSeparator())), + origin: "paste"}; + makeChange(cm.doc, change); + setSelectionReplaceHistory(cm.doc, simpleSelection(clipPos(cm.doc, pos), clipPos(cm.doc, changeEnd(change)))); + })(); + } + }; + var readTextFromFile = function (file, i) { + if (cm.options.allowDropFileTypes && + indexOf(cm.options.allowDropFileTypes, file.type) == -1) { + markAsReadAndPasteIfAllFilesAreRead(); + return + } + var reader = new FileReader; + reader.onerror = function () { return markAsReadAndPasteIfAllFilesAreRead(); }; + reader.onload = function () { + var content = reader.result; + if (/[\x00-\x08\x0e-\x1f]{2}/.test(content)) { + markAsReadAndPasteIfAllFilesAreRead(); + return + } + text[i] = content; + markAsReadAndPasteIfAllFilesAreRead(); + }; + reader.readAsText(file); + }; + for (var i = 0; i < files.length; i++) { readTextFromFile(files[i], i); } + } else { // Normal drop + // Don't do a replace if the drop happened inside of the selected text. + if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) { + cm.state.draggingText(e); + // Ensure the editor is re-focused + setTimeout(function () { return cm.display.input.focus(); }, 20); + return + } + try { + var text$1 = e.dataTransfer.getData("Text"); + if (text$1) { + var selected; + if (cm.state.draggingText && !cm.state.draggingText.copy) + { selected = cm.listSelections(); } + setSelectionNoUndo(cm.doc, simpleSelection(pos, pos)); + if (selected) { for (var i$1 = 0; i$1 < selected.length; ++i$1) + { replaceRange(cm.doc, "", selected[i$1].anchor, selected[i$1].head, "drag"); } } + cm.replaceSelection(text$1, "around", "paste"); + cm.display.input.focus(); + } + } + catch(e$1){} + } + } + + function onDragStart(cm, e) { + if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return } + if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) { return } + + e.dataTransfer.setData("Text", cm.getSelection()); + e.dataTransfer.effectAllowed = "copyMove"; + + // Use dummy image instead of default browsers image. + // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there. + if (e.dataTransfer.setDragImage && !safari) { + var img = elt("img", null, null, "position: fixed; left: 0; top: 0;"); + img.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="; + if (presto) { + img.width = img.height = 1; + cm.display.wrapper.appendChild(img); + // Force a relayout, or Opera won't use our image for some obscure reason + img._top = img.offsetTop; + } + e.dataTransfer.setDragImage(img, 0, 0); + if (presto) { img.parentNode.removeChild(img); } + } + } + + function onDragOver(cm, e) { + var pos = posFromMouse(cm, e); + if (!pos) { return } + var frag = document.createDocumentFragment(); + drawSelectionCursor(cm, pos, frag); + if (!cm.display.dragCursor) { + cm.display.dragCursor = elt("div", null, "CodeMirror-cursors CodeMirror-dragcursors"); + cm.display.lineSpace.insertBefore(cm.display.dragCursor, cm.display.cursorDiv); + } + removeChildrenAndAdd(cm.display.dragCursor, frag); + } + + function clearDragCursor(cm) { + if (cm.display.dragCursor) { + cm.display.lineSpace.removeChild(cm.display.dragCursor); + cm.display.dragCursor = null; + } + } + + // These must be handled carefully, because naively registering a + // handler for each editor will cause the editors to never be + // garbage collected. + + function forEachCodeMirror(f) { + if (!document.getElementsByClassName) { return } + var byClass = document.getElementsByClassName("CodeMirror"), editors = []; + for (var i = 0; i < byClass.length; i++) { + var cm = byClass[i].CodeMirror; + if (cm) { editors.push(cm); } + } + if (editors.length) { editors[0].operation(function () { + for (var i = 0; i < editors.length; i++) { f(editors[i]); } + }); } + } + + var globalsRegistered = false; + function ensureGlobalHandlers() { + if (globalsRegistered) { return } + registerGlobalHandlers(); + globalsRegistered = true; + } + function registerGlobalHandlers() { + // When the window resizes, we need to refresh active editors. + var resizeTimer; + on(window, "resize", function () { + if (resizeTimer == null) { resizeTimer = setTimeout(function () { + resizeTimer = null; + forEachCodeMirror(onResize); + }, 100); } + }); + // When the window loses focus, we want to show the editor as blurred + on(window, "blur", function () { return forEachCodeMirror(onBlur); }); + } + // Called when the window resizes + function onResize(cm) { + var d = cm.display; + // Might be a text scaling operation, clear size caches. + d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null; + d.scrollbarsClipped = false; + cm.setSize(); + } + + var keyNames = { + 3: "Pause", 8: "Backspace", 9: "Tab", 13: "Enter", 16: "Shift", 17: "Ctrl", 18: "Alt", + 19: "Pause", 20: "CapsLock", 27: "Esc", 32: "Space", 33: "PageUp", 34: "PageDown", 35: "End", + 36: "Home", 37: "Left", 38: "Up", 39: "Right", 40: "Down", 44: "PrintScrn", 45: "Insert", + 46: "Delete", 59: ";", 61: "=", 91: "Mod", 92: "Mod", 93: "Mod", + 106: "*", 107: "=", 109: "-", 110: ".", 111: "/", 145: "ScrollLock", + 173: "-", 186: ";", 187: "=", 188: ",", 189: "-", 190: ".", 191: "/", 192: "`", 219: "[", 220: "\\", + 221: "]", 222: "'", 224: "Mod", 63232: "Up", 63233: "Down", 63234: "Left", 63235: "Right", 63272: "Delete", + 63273: "Home", 63275: "End", 63276: "PageUp", 63277: "PageDown", 63302: "Insert" + }; + + // Number keys + for (var i = 0; i < 10; i++) { keyNames[i + 48] = keyNames[i + 96] = String(i); } + // Alphabetic keys + for (var i$1 = 65; i$1 <= 90; i$1++) { keyNames[i$1] = String.fromCharCode(i$1); } + // Function keys + for (var i$2 = 1; i$2 <= 12; i$2++) { keyNames[i$2 + 111] = keyNames[i$2 + 63235] = "F" + i$2; } + + var keyMap = {}; + + keyMap.basic = { + "Left": "goCharLeft", "Right": "goCharRight", "Up": "goLineUp", "Down": "goLineDown", + "End": "goLineEnd", "Home": "goLineStartSmart", "PageUp": "goPageUp", "PageDown": "goPageDown", + "Delete": "delCharAfter", "Backspace": "delCharBefore", "Shift-Backspace": "delCharBefore", + "Tab": "defaultTab", "Shift-Tab": "indentAuto", + "Enter": "newlineAndIndent", "Insert": "toggleOverwrite", + "Esc": "singleSelection" + }; + // Note that the save and find-related commands aren't defined by + // default. User code or addons can define them. Unknown commands + // are simply ignored. + keyMap.pcDefault = { + "Ctrl-A": "selectAll", "Ctrl-D": "deleteLine", "Ctrl-Z": "undo", "Shift-Ctrl-Z": "redo", "Ctrl-Y": "redo", + "Ctrl-Home": "goDocStart", "Ctrl-End": "goDocEnd", "Ctrl-Up": "goLineUp", "Ctrl-Down": "goLineDown", + "Ctrl-Left": "goGroupLeft", "Ctrl-Right": "goGroupRight", "Alt-Left": "goLineStart", "Alt-Right": "goLineEnd", + "Ctrl-Backspace": "delGroupBefore", "Ctrl-Delete": "delGroupAfter", "Ctrl-S": "save", "Ctrl-F": "find", + "Ctrl-G": "findNext", "Shift-Ctrl-G": "findPrev", "Shift-Ctrl-F": "replace", "Shift-Ctrl-R": "replaceAll", + "Ctrl-[": "indentLess", "Ctrl-]": "indentMore", + "Ctrl-U": "undoSelection", "Shift-Ctrl-U": "redoSelection", "Alt-U": "redoSelection", + "fallthrough": "basic" + }; + // Very basic readline/emacs-style bindings, which are standard on Mac. + keyMap.emacsy = { + "Ctrl-F": "goCharRight", "Ctrl-B": "goCharLeft", "Ctrl-P": "goLineUp", "Ctrl-N": "goLineDown", + "Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd", "Ctrl-V": "goPageDown", "Shift-Ctrl-V": "goPageUp", + "Ctrl-D": "delCharAfter", "Ctrl-H": "delCharBefore", "Alt-Backspace": "delWordBefore", "Ctrl-K": "killLine", + "Ctrl-T": "transposeChars", "Ctrl-O": "openLine" + }; + keyMap.macDefault = { + "Cmd-A": "selectAll", "Cmd-D": "deleteLine", "Cmd-Z": "undo", "Shift-Cmd-Z": "redo", "Cmd-Y": "redo", + "Cmd-Home": "goDocStart", "Cmd-Up": "goDocStart", "Cmd-End": "goDocEnd", "Cmd-Down": "goDocEnd", "Alt-Left": "goGroupLeft", + "Alt-Right": "goGroupRight", "Cmd-Left": "goLineLeft", "Cmd-Right": "goLineRight", "Alt-Backspace": "delGroupBefore", + "Ctrl-Alt-Backspace": "delGroupAfter", "Alt-Delete": "delGroupAfter", "Cmd-S": "save", "Cmd-F": "find", + "Cmd-G": "findNext", "Shift-Cmd-G": "findPrev", "Cmd-Alt-F": "replace", "Shift-Cmd-Alt-F": "replaceAll", + "Cmd-[": "indentLess", "Cmd-]": "indentMore", "Cmd-Backspace": "delWrappedLineLeft", "Cmd-Delete": "delWrappedLineRight", + "Cmd-U": "undoSelection", "Shift-Cmd-U": "redoSelection", "Ctrl-Up": "goDocStart", "Ctrl-Down": "goDocEnd", + "fallthrough": ["basic", "emacsy"] + }; + keyMap["default"] = mac ? keyMap.macDefault : keyMap.pcDefault; + + // KEYMAP DISPATCH + + function normalizeKeyName(name) { + var parts = name.split(/-(?!$)/); + name = parts[parts.length - 1]; + var alt, ctrl, shift, cmd; + for (var i = 0; i < parts.length - 1; i++) { + var mod = parts[i]; + if (/^(cmd|meta|m)$/i.test(mod)) { cmd = true; } + else if (/^a(lt)?$/i.test(mod)) { alt = true; } + else if (/^(c|ctrl|control)$/i.test(mod)) { ctrl = true; } + else if (/^s(hift)?$/i.test(mod)) { shift = true; } + else { throw new Error("Unrecognized modifier name: " + mod) } + } + if (alt) { name = "Alt-" + name; } + if (ctrl) { name = "Ctrl-" + name; } + if (cmd) { name = "Cmd-" + name; } + if (shift) { name = "Shift-" + name; } + return name + } + + // This is a kludge to keep keymaps mostly working as raw objects + // (backwards compatibility) while at the same time support features + // like normalization and multi-stroke key bindings. It compiles a + // new normalized keymap, and then updates the old object to reflect + // this. + function normalizeKeyMap(keymap) { + var copy = {}; + for (var keyname in keymap) { if (keymap.hasOwnProperty(keyname)) { + var value = keymap[keyname]; + if (/^(name|fallthrough|(de|at)tach)$/.test(keyname)) { continue } + if (value == "...") { delete keymap[keyname]; continue } + + var keys = map(keyname.split(" "), normalizeKeyName); + for (var i = 0; i < keys.length; i++) { + var val = (void 0), name = (void 0); + if (i == keys.length - 1) { + name = keys.join(" "); + val = value; + } else { + name = keys.slice(0, i + 1).join(" "); + val = "..."; + } + var prev = copy[name]; + if (!prev) { copy[name] = val; } + else if (prev != val) { throw new Error("Inconsistent bindings for " + name) } + } + delete keymap[keyname]; + } } + for (var prop in copy) { keymap[prop] = copy[prop]; } + return keymap + } + + function lookupKey(key, map, handle, context) { + map = getKeyMap(map); + var found = map.call ? map.call(key, context) : map[key]; + if (found === false) { return "nothing" } + if (found === "...") { return "multi" } + if (found != null && handle(found)) { return "handled" } + + if (map.fallthrough) { + if (Object.prototype.toString.call(map.fallthrough) != "[object Array]") + { return lookupKey(key, map.fallthrough, handle, context) } + for (var i = 0; i < map.fallthrough.length; i++) { + var result = lookupKey(key, map.fallthrough[i], handle, context); + if (result) { return result } + } + } + } + + // Modifier key presses don't count as 'real' key presses for the + // purpose of keymap fallthrough. + function isModifierKey(value) { + var name = typeof value == "string" ? value : keyNames[value.keyCode]; + return name == "Ctrl" || name == "Alt" || name == "Shift" || name == "Mod" + } + + function addModifierNames(name, event, noShift) { + var base = name; + if (event.altKey && base != "Alt") { name = "Alt-" + name; } + if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != "Ctrl") { name = "Ctrl-" + name; } + if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != "Mod") { name = "Cmd-" + name; } + if (!noShift && event.shiftKey && base != "Shift") { name = "Shift-" + name; } + return name + } + + // Look up the name of a key as indicated by an event object. + function keyName(event, noShift) { + if (presto && event.keyCode == 34 && event["char"]) { return false } + var name = keyNames[event.keyCode]; + if (name == null || event.altGraphKey) { return false } + // Ctrl-ScrollLock has keyCode 3, same as Ctrl-Pause, + // so we'll use event.code when available (Chrome 48+, FF 38+, Safari 10.1+) + if (event.keyCode == 3 && event.code) { name = event.code; } + return addModifierNames(name, event, noShift) + } + + function getKeyMap(val) { + return typeof val == "string" ? keyMap[val] : val + } + + // Helper for deleting text near the selection(s), used to implement + // backspace, delete, and similar functionality. + function deleteNearSelection(cm, compute) { + var ranges = cm.doc.sel.ranges, kill = []; + // Build up a set of ranges to kill first, merging overlapping + // ranges. + for (var i = 0; i < ranges.length; i++) { + var toKill = compute(ranges[i]); + while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) { + var replaced = kill.pop(); + if (cmp(replaced.from, toKill.from) < 0) { + toKill.from = replaced.from; + break + } + } + kill.push(toKill); + } + // Next, remove those actual ranges. + runInOp(cm, function () { + for (var i = kill.length - 1; i >= 0; i--) + { replaceRange(cm.doc, "", kill[i].from, kill[i].to, "+delete"); } + ensureCursorVisible(cm); + }); + } + + function moveCharLogically(line, ch, dir) { + var target = skipExtendingChars(line.text, ch + dir, dir); + return target < 0 || target > line.text.length ? null : target + } + + function moveLogically(line, start, dir) { + var ch = moveCharLogically(line, start.ch, dir); + return ch == null ? null : new Pos(start.line, ch, dir < 0 ? "after" : "before") + } + + function endOfLine(visually, cm, lineObj, lineNo, dir) { + if (visually) { + if (cm.doc.direction == "rtl") { dir = -dir; } + var order = getOrder(lineObj, cm.doc.direction); + if (order) { + var part = dir < 0 ? lst(order) : order[0]; + var moveInStorageOrder = (dir < 0) == (part.level == 1); + var sticky = moveInStorageOrder ? "after" : "before"; + var ch; + // With a wrapped rtl chunk (possibly spanning multiple bidi parts), + // it could be that the last bidi part is not on the last visual line, + // since visual lines contain content order-consecutive chunks. + // Thus, in rtl, we are looking for the first (content-order) character + // in the rtl chunk that is on the last line (that is, the same line + // as the last (content-order) character). + if (part.level > 0 || cm.doc.direction == "rtl") { + var prep = prepareMeasureForLine(cm, lineObj); + ch = dir < 0 ? lineObj.text.length - 1 : 0; + var targetTop = measureCharPrepared(cm, prep, ch).top; + ch = findFirst(function (ch) { return measureCharPrepared(cm, prep, ch).top == targetTop; }, (dir < 0) == (part.level == 1) ? part.from : part.to - 1, ch); + if (sticky == "before") { ch = moveCharLogically(lineObj, ch, 1); } + } else { ch = dir < 0 ? part.to : part.from; } + return new Pos(lineNo, ch, sticky) + } + } + return new Pos(lineNo, dir < 0 ? lineObj.text.length : 0, dir < 0 ? "before" : "after") + } + + function moveVisually(cm, line, start, dir) { + var bidi = getOrder(line, cm.doc.direction); + if (!bidi) { return moveLogically(line, start, dir) } + if (start.ch >= line.text.length) { + start.ch = line.text.length; + start.sticky = "before"; + } else if (start.ch <= 0) { + start.ch = 0; + start.sticky = "after"; + } + var partPos = getBidiPartAt(bidi, start.ch, start.sticky), part = bidi[partPos]; + if (cm.doc.direction == "ltr" && part.level % 2 == 0 && (dir > 0 ? part.to > start.ch : part.from < start.ch)) { + // Case 1: We move within an ltr part in an ltr editor. Even with wrapped lines, + // nothing interesting happens. + return moveLogically(line, start, dir) + } + + var mv = function (pos, dir) { return moveCharLogically(line, pos instanceof Pos ? pos.ch : pos, dir); }; + var prep; + var getWrappedLineExtent = function (ch) { + if (!cm.options.lineWrapping) { return {begin: 0, end: line.text.length} } + prep = prep || prepareMeasureForLine(cm, line); + return wrappedLineExtentChar(cm, line, prep, ch) + }; + var wrappedLineExtent = getWrappedLineExtent(start.sticky == "before" ? mv(start, -1) : start.ch); + + if (cm.doc.direction == "rtl" || part.level == 1) { + var moveInStorageOrder = (part.level == 1) == (dir < 0); + var ch = mv(start, moveInStorageOrder ? 1 : -1); + if (ch != null && (!moveInStorageOrder ? ch >= part.from && ch >= wrappedLineExtent.begin : ch <= part.to && ch <= wrappedLineExtent.end)) { + // Case 2: We move within an rtl part or in an rtl editor on the same visual line + var sticky = moveInStorageOrder ? "before" : "after"; + return new Pos(start.line, ch, sticky) + } + } + + // Case 3: Could not move within this bidi part in this visual line, so leave + // the current bidi part + + var searchInVisualLine = function (partPos, dir, wrappedLineExtent) { + var getRes = function (ch, moveInStorageOrder) { return moveInStorageOrder + ? new Pos(start.line, mv(ch, 1), "before") + : new Pos(start.line, ch, "after"); }; + + for (; partPos >= 0 && partPos < bidi.length; partPos += dir) { + var part = bidi[partPos]; + var moveInStorageOrder = (dir > 0) == (part.level != 1); + var ch = moveInStorageOrder ? wrappedLineExtent.begin : mv(wrappedLineExtent.end, -1); + if (part.from <= ch && ch < part.to) { return getRes(ch, moveInStorageOrder) } + ch = moveInStorageOrder ? part.from : mv(part.to, -1); + if (wrappedLineExtent.begin <= ch && ch < wrappedLineExtent.end) { return getRes(ch, moveInStorageOrder) } + } + }; + + // Case 3a: Look for other bidi parts on the same visual line + var res = searchInVisualLine(partPos + dir, dir, wrappedLineExtent); + if (res) { return res } + + // Case 3b: Look for other bidi parts on the next visual line + var nextCh = dir > 0 ? wrappedLineExtent.end : mv(wrappedLineExtent.begin, -1); + if (nextCh != null && !(dir > 0 && nextCh == line.text.length)) { + res = searchInVisualLine(dir > 0 ? 0 : bidi.length - 1, dir, getWrappedLineExtent(nextCh)); + if (res) { return res } + } + + // Case 4: Nowhere to move + return null + } + + // Commands are parameter-less actions that can be performed on an + // editor, mostly used for keybindings. + var commands = { + selectAll: selectAll, + singleSelection: function (cm) { return cm.setSelection(cm.getCursor("anchor"), cm.getCursor("head"), sel_dontScroll); }, + killLine: function (cm) { return deleteNearSelection(cm, function (range) { + if (range.empty()) { + var len = getLine(cm.doc, range.head.line).text.length; + if (range.head.ch == len && range.head.line < cm.lastLine()) + { return {from: range.head, to: Pos(range.head.line + 1, 0)} } + else + { return {from: range.head, to: Pos(range.head.line, len)} } + } else { + return {from: range.from(), to: range.to()} + } + }); }, + deleteLine: function (cm) { return deleteNearSelection(cm, function (range) { return ({ + from: Pos(range.from().line, 0), + to: clipPos(cm.doc, Pos(range.to().line + 1, 0)) + }); }); }, + delLineLeft: function (cm) { return deleteNearSelection(cm, function (range) { return ({ + from: Pos(range.from().line, 0), to: range.from() + }); }); }, + delWrappedLineLeft: function (cm) { return deleteNearSelection(cm, function (range) { + var top = cm.charCoords(range.head, "div").top + 5; + var leftPos = cm.coordsChar({left: 0, top: top}, "div"); + return {from: leftPos, to: range.from()} + }); }, + delWrappedLineRight: function (cm) { return deleteNearSelection(cm, function (range) { + var top = cm.charCoords(range.head, "div").top + 5; + var rightPos = cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div"); + return {from: range.from(), to: rightPos } + }); }, + undo: function (cm) { return cm.undo(); }, + redo: function (cm) { return cm.redo(); }, + undoSelection: function (cm) { return cm.undoSelection(); }, + redoSelection: function (cm) { return cm.redoSelection(); }, + goDocStart: function (cm) { return cm.extendSelection(Pos(cm.firstLine(), 0)); }, + goDocEnd: function (cm) { return cm.extendSelection(Pos(cm.lastLine())); }, + goLineStart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStart(cm, range.head.line); }, + {origin: "+move", bias: 1} + ); }, + goLineStartSmart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStartSmart(cm, range.head); }, + {origin: "+move", bias: 1} + ); }, + goLineEnd: function (cm) { return cm.extendSelectionsBy(function (range) { return lineEnd(cm, range.head.line); }, + {origin: "+move", bias: -1} + ); }, + goLineRight: function (cm) { return cm.extendSelectionsBy(function (range) { + var top = cm.cursorCoords(range.head, "div").top + 5; + return cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div") + }, sel_move); }, + goLineLeft: function (cm) { return cm.extendSelectionsBy(function (range) { + var top = cm.cursorCoords(range.head, "div").top + 5; + return cm.coordsChar({left: 0, top: top}, "div") + }, sel_move); }, + goLineLeftSmart: function (cm) { return cm.extendSelectionsBy(function (range) { + var top = cm.cursorCoords(range.head, "div").top + 5; + var pos = cm.coordsChar({left: 0, top: top}, "div"); + if (pos.ch < cm.getLine(pos.line).search(/\S/)) { return lineStartSmart(cm, range.head) } + return pos + }, sel_move); }, + goLineUp: function (cm) { return cm.moveV(-1, "line"); }, + goLineDown: function (cm) { return cm.moveV(1, "line"); }, + goPageUp: function (cm) { return cm.moveV(-1, "page"); }, + goPageDown: function (cm) { return cm.moveV(1, "page"); }, + goCharLeft: function (cm) { return cm.moveH(-1, "char"); }, + goCharRight: function (cm) { return cm.moveH(1, "char"); }, + goColumnLeft: function (cm) { return cm.moveH(-1, "column"); }, + goColumnRight: function (cm) { return cm.moveH(1, "column"); }, + goWordLeft: function (cm) { return cm.moveH(-1, "word"); }, + goGroupRight: function (cm) { return cm.moveH(1, "group"); }, + goGroupLeft: function (cm) { return cm.moveH(-1, "group"); }, + goWordRight: function (cm) { return cm.moveH(1, "word"); }, + delCharBefore: function (cm) { return cm.deleteH(-1, "codepoint"); }, + delCharAfter: function (cm) { return cm.deleteH(1, "char"); }, + delWordBefore: function (cm) { return cm.deleteH(-1, "word"); }, + delWordAfter: function (cm) { return cm.deleteH(1, "word"); }, + delGroupBefore: function (cm) { return cm.deleteH(-1, "group"); }, + delGroupAfter: function (cm) { return cm.deleteH(1, "group"); }, + indentAuto: function (cm) { return cm.indentSelection("smart"); }, + indentMore: function (cm) { return cm.indentSelection("add"); }, + indentLess: function (cm) { return cm.indentSelection("subtract"); }, + insertTab: function (cm) { return cm.replaceSelection("\t"); }, + insertSoftTab: function (cm) { + var spaces = [], ranges = cm.listSelections(), tabSize = cm.options.tabSize; + for (var i = 0; i < ranges.length; i++) { + var pos = ranges[i].from(); + var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize); + spaces.push(spaceStr(tabSize - col % tabSize)); + } + cm.replaceSelections(spaces); + }, + defaultTab: function (cm) { + if (cm.somethingSelected()) { cm.indentSelection("add"); } + else { cm.execCommand("insertTab"); } + }, + // Swap the two chars left and right of each selection's head. + // Move cursor behind the two swapped characters afterwards. + // + // Doesn't consider line feeds a character. + // Doesn't scan more than one line above to find a character. + // Doesn't do anything on an empty line. + // Doesn't do anything with non-empty selections. + transposeChars: function (cm) { return runInOp(cm, function () { + var ranges = cm.listSelections(), newSel = []; + for (var i = 0; i < ranges.length; i++) { + if (!ranges[i].empty()) { continue } + var cur = ranges[i].head, line = getLine(cm.doc, cur.line).text; + if (line) { + if (cur.ch == line.length) { cur = new Pos(cur.line, cur.ch - 1); } + if (cur.ch > 0) { + cur = new Pos(cur.line, cur.ch + 1); + cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2), + Pos(cur.line, cur.ch - 2), cur, "+transpose"); + } else if (cur.line > cm.doc.first) { + var prev = getLine(cm.doc, cur.line - 1).text; + if (prev) { + cur = new Pos(cur.line, 1); + cm.replaceRange(line.charAt(0) + cm.doc.lineSeparator() + + prev.charAt(prev.length - 1), + Pos(cur.line - 1, prev.length - 1), cur, "+transpose"); + } + } + } + newSel.push(new Range(cur, cur)); + } + cm.setSelections(newSel); + }); }, + newlineAndIndent: function (cm) { return runInOp(cm, function () { + var sels = cm.listSelections(); + for (var i = sels.length - 1; i >= 0; i--) + { cm.replaceRange(cm.doc.lineSeparator(), sels[i].anchor, sels[i].head, "+input"); } + sels = cm.listSelections(); + for (var i$1 = 0; i$1 < sels.length; i$1++) + { cm.indentLine(sels[i$1].from().line, null, true); } + ensureCursorVisible(cm); + }); }, + openLine: function (cm) { return cm.replaceSelection("\n", "start"); }, + toggleOverwrite: function (cm) { return cm.toggleOverwrite(); } + }; + + + function lineStart(cm, lineN) { + var line = getLine(cm.doc, lineN); + var visual = visualLine(line); + if (visual != line) { lineN = lineNo(visual); } + return endOfLine(true, cm, visual, lineN, 1) + } + function lineEnd(cm, lineN) { + var line = getLine(cm.doc, lineN); + var visual = visualLineEnd(line); + if (visual != line) { lineN = lineNo(visual); } + return endOfLine(true, cm, line, lineN, -1) + } + function lineStartSmart(cm, pos) { + var start = lineStart(cm, pos.line); + var line = getLine(cm.doc, start.line); + var order = getOrder(line, cm.doc.direction); + if (!order || order[0].level == 0) { + var firstNonWS = Math.max(start.ch, line.text.search(/\S/)); + var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch; + return Pos(start.line, inWS ? 0 : firstNonWS, start.sticky) + } + return start + } + + // Run a handler that was bound to a key. + function doHandleBinding(cm, bound, dropShift) { + if (typeof bound == "string") { + bound = commands[bound]; + if (!bound) { return false } + } + // Ensure previous input has been read, so that the handler sees a + // consistent view of the document + cm.display.input.ensurePolled(); + var prevShift = cm.display.shift, done = false; + try { + if (cm.isReadOnly()) { cm.state.suppressEdits = true; } + if (dropShift) { cm.display.shift = false; } + done = bound(cm) != Pass; + } finally { + cm.display.shift = prevShift; + cm.state.suppressEdits = false; + } + return done + } + + function lookupKeyForEditor(cm, name, handle) { + for (var i = 0; i < cm.state.keyMaps.length; i++) { + var result = lookupKey(name, cm.state.keyMaps[i], handle, cm); + if (result) { return result } + } + return (cm.options.extraKeys && lookupKey(name, cm.options.extraKeys, handle, cm)) + || lookupKey(name, cm.options.keyMap, handle, cm) + } + + // Note that, despite the name, this function is also used to check + // for bound mouse clicks. + + var stopSeq = new Delayed; + + function dispatchKey(cm, name, e, handle) { + var seq = cm.state.keySeq; + if (seq) { + if (isModifierKey(name)) { return "handled" } + if (/\'$/.test(name)) + { cm.state.keySeq = null; } + else + { stopSeq.set(50, function () { + if (cm.state.keySeq == seq) { + cm.state.keySeq = null; + cm.display.input.reset(); + } + }); } + if (dispatchKeyInner(cm, seq + " " + name, e, handle)) { return true } + } + return dispatchKeyInner(cm, name, e, handle) + } + + function dispatchKeyInner(cm, name, e, handle) { + var result = lookupKeyForEditor(cm, name, handle); + + if (result == "multi") + { cm.state.keySeq = name; } + if (result == "handled") + { signalLater(cm, "keyHandled", cm, name, e); } + + if (result == "handled" || result == "multi") { + e_preventDefault(e); + restartBlink(cm); + } + + return !!result + } + + // Handle a key from the keydown event. + function handleKeyBinding(cm, e) { + var name = keyName(e, true); + if (!name) { return false } + + if (e.shiftKey && !cm.state.keySeq) { + // First try to resolve full name (including 'Shift-'). Failing + // that, see if there is a cursor-motion command (starting with + // 'go') bound to the keyname without 'Shift-'. + return dispatchKey(cm, "Shift-" + name, e, function (b) { return doHandleBinding(cm, b, true); }) + || dispatchKey(cm, name, e, function (b) { + if (typeof b == "string" ? /^go[A-Z]/.test(b) : b.motion) + { return doHandleBinding(cm, b) } + }) + } else { + return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); }) + } + } + + // Handle a key from the keypress event + function handleCharBinding(cm, e, ch) { + return dispatchKey(cm, "'" + ch + "'", e, function (b) { return doHandleBinding(cm, b, true); }) + } + + var lastStoppedKey = null; + function onKeyDown(e) { + var cm = this; + if (e.target && e.target != cm.display.input.getField()) { return } + cm.curOp.focus = activeElt(root(cm)); + if (signalDOMEvent(cm, e)) { return } + // IE does strange things with escape. + if (ie && ie_version < 11 && e.keyCode == 27) { e.returnValue = false; } + var code = e.keyCode; + cm.display.shift = code == 16 || e.shiftKey; + var handled = handleKeyBinding(cm, e); + if (presto) { + lastStoppedKey = handled ? code : null; + // Opera has no cut event... we try to at least catch the key combo + if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey)) + { cm.replaceSelection("", null, "cut"); } + } + if (gecko && !mac && !handled && code == 46 && e.shiftKey && !e.ctrlKey && document.execCommand) + { document.execCommand("cut"); } + + // Turn mouse into crosshair when Alt is held on Mac. + if (code == 18 && !/\bCodeMirror-crosshair\b/.test(cm.display.lineDiv.className)) + { showCrossHair(cm); } + } + + function showCrossHair(cm) { + var lineDiv = cm.display.lineDiv; + addClass(lineDiv, "CodeMirror-crosshair"); + + function up(e) { + if (e.keyCode == 18 || !e.altKey) { + rmClass(lineDiv, "CodeMirror-crosshair"); + off(document, "keyup", up); + off(document, "mouseover", up); + } + } + on(document, "keyup", up); + on(document, "mouseover", up); + } + + function onKeyUp(e) { + if (e.keyCode == 16) { this.doc.sel.shift = false; } + signalDOMEvent(this, e); + } + + function onKeyPress(e) { + var cm = this; + if (e.target && e.target != cm.display.input.getField()) { return } + if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) { return } + var keyCode = e.keyCode, charCode = e.charCode; + if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return} + if ((presto && (!e.which || e.which < 10)) && handleKeyBinding(cm, e)) { return } + var ch = String.fromCharCode(charCode == null ? keyCode : charCode); + // Some browsers fire keypress events for backspace + if (ch == "\x08") { return } + if (handleCharBinding(cm, e, ch)) { return } + cm.display.input.onKeyPress(e); + } + + var DOUBLECLICK_DELAY = 400; + + var PastClick = function(time, pos, button) { + this.time = time; + this.pos = pos; + this.button = button; + }; + + PastClick.prototype.compare = function (time, pos, button) { + return this.time + DOUBLECLICK_DELAY > time && + cmp(pos, this.pos) == 0 && button == this.button + }; + + var lastClick, lastDoubleClick; + function clickRepeat(pos, button) { + var now = +new Date; + if (lastDoubleClick && lastDoubleClick.compare(now, pos, button)) { + lastClick = lastDoubleClick = null; + return "triple" + } else if (lastClick && lastClick.compare(now, pos, button)) { + lastDoubleClick = new PastClick(now, pos, button); + lastClick = null; + return "double" + } else { + lastClick = new PastClick(now, pos, button); + lastDoubleClick = null; + return "single" + } + } + + // A mouse down can be a single click, double click, triple click, + // start of selection drag, start of text drag, new cursor + // (ctrl-click), rectangle drag (alt-drag), or xwin + // middle-click-paste. Or it might be a click on something we should + // not interfere with, such as a scrollbar or widget. + function onMouseDown(e) { + var cm = this, display = cm.display; + if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return } + display.input.ensurePolled(); + display.shift = e.shiftKey; + + if (eventInWidget(display, e)) { + if (!webkit) { + // Briefly turn off draggability, to allow widgets to do + // normal dragging things. + display.scroller.draggable = false; + setTimeout(function () { return display.scroller.draggable = true; }, 100); + } + return + } + if (clickInGutter(cm, e)) { return } + var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : "single"; + win(cm).focus(); + + // #3261: make sure, that we're not starting a second selection + if (button == 1 && cm.state.selectingText) + { cm.state.selectingText(e); } + + if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return } + + if (button == 1) { + if (pos) { leftButtonDown(cm, pos, repeat, e); } + else if (e_target(e) == display.scroller) { e_preventDefault(e); } + } else if (button == 2) { + if (pos) { extendSelection(cm.doc, pos); } + setTimeout(function () { return display.input.focus(); }, 20); + } else if (button == 3) { + if (captureRightClick) { cm.display.input.onContextMenu(e); } + else { delayBlurEvent(cm); } + } + } + + function handleMappedButton(cm, button, pos, repeat, event) { + var name = "Click"; + if (repeat == "double") { name = "Double" + name; } + else if (repeat == "triple") { name = "Triple" + name; } + name = (button == 1 ? "Left" : button == 2 ? "Middle" : "Right") + name; + + return dispatchKey(cm, addModifierNames(name, event), event, function (bound) { + if (typeof bound == "string") { bound = commands[bound]; } + if (!bound) { return false } + var done = false; + try { + if (cm.isReadOnly()) { cm.state.suppressEdits = true; } + done = bound(cm, pos) != Pass; + } finally { + cm.state.suppressEdits = false; + } + return done + }) + } + + function configureMouse(cm, repeat, event) { + var option = cm.getOption("configureMouse"); + var value = option ? option(cm, repeat, event) : {}; + if (value.unit == null) { + var rect = chromeOS ? event.shiftKey && event.metaKey : event.altKey; + value.unit = rect ? "rectangle" : repeat == "single" ? "char" : repeat == "double" ? "word" : "line"; + } + if (value.extend == null || cm.doc.extend) { value.extend = cm.doc.extend || event.shiftKey; } + if (value.addNew == null) { value.addNew = mac ? event.metaKey : event.ctrlKey; } + if (value.moveOnDrag == null) { value.moveOnDrag = !(mac ? event.altKey : event.ctrlKey); } + return value + } + + function leftButtonDown(cm, pos, repeat, event) { + if (ie) { setTimeout(bind(ensureFocus, cm), 0); } + else { cm.curOp.focus = activeElt(root(cm)); } + + var behavior = configureMouse(cm, repeat, event); + + var sel = cm.doc.sel, contained; + if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() && + repeat == "single" && (contained = sel.contains(pos)) > -1 && + (cmp((contained = sel.ranges[contained]).from(), pos) < 0 || pos.xRel > 0) && + (cmp(contained.to(), pos) > 0 || pos.xRel < 0)) + { leftButtonStartDrag(cm, event, pos, behavior); } + else + { leftButtonSelect(cm, event, pos, behavior); } + } + + // Start a text drag. When it ends, see if any dragging actually + // happen, and treat as a click if it didn't. + function leftButtonStartDrag(cm, event, pos, behavior) { + var display = cm.display, moved = false; + var dragEnd = operation(cm, function (e) { + if (webkit) { display.scroller.draggable = false; } + cm.state.draggingText = false; + if (cm.state.delayingBlurEvent) { + if (cm.hasFocus()) { cm.state.delayingBlurEvent = false; } + else { delayBlurEvent(cm); } + } + off(display.wrapper.ownerDocument, "mouseup", dragEnd); + off(display.wrapper.ownerDocument, "mousemove", mouseMove); + off(display.scroller, "dragstart", dragStart); + off(display.scroller, "drop", dragEnd); + if (!moved) { + e_preventDefault(e); + if (!behavior.addNew) + { extendSelection(cm.doc, pos, null, null, behavior.extend); } + // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081) + if ((webkit && !safari) || ie && ie_version == 9) + { setTimeout(function () {display.wrapper.ownerDocument.body.focus({preventScroll: true}); display.input.focus();}, 20); } + else + { display.input.focus(); } + } + }); + var mouseMove = function(e2) { + moved = moved || Math.abs(event.clientX - e2.clientX) + Math.abs(event.clientY - e2.clientY) >= 10; + }; + var dragStart = function () { return moved = true; }; + // Let the drag handler handle this. + if (webkit) { display.scroller.draggable = true; } + cm.state.draggingText = dragEnd; + dragEnd.copy = !behavior.moveOnDrag; + on(display.wrapper.ownerDocument, "mouseup", dragEnd); + on(display.wrapper.ownerDocument, "mousemove", mouseMove); + on(display.scroller, "dragstart", dragStart); + on(display.scroller, "drop", dragEnd); + + cm.state.delayingBlurEvent = true; + setTimeout(function () { return display.input.focus(); }, 20); + // IE's approach to draggable + if (display.scroller.dragDrop) { display.scroller.dragDrop(); } + } + + function rangeForUnit(cm, pos, unit) { + if (unit == "char") { return new Range(pos, pos) } + if (unit == "word") { return cm.findWordAt(pos) } + if (unit == "line") { return new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) } + var result = unit(cm, pos); + return new Range(result.from, result.to) + } + + // Normal selection, as opposed to text dragging. + function leftButtonSelect(cm, event, start, behavior) { + if (ie) { delayBlurEvent(cm); } + var display = cm.display, doc = cm.doc; + e_preventDefault(event); + + var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges; + if (behavior.addNew && !behavior.extend) { + ourIndex = doc.sel.contains(start); + if (ourIndex > -1) + { ourRange = ranges[ourIndex]; } + else + { ourRange = new Range(start, start); } + } else { + ourRange = doc.sel.primary(); + ourIndex = doc.sel.primIndex; + } + + if (behavior.unit == "rectangle") { + if (!behavior.addNew) { ourRange = new Range(start, start); } + start = posFromMouse(cm, event, true, true); + ourIndex = -1; + } else { + var range = rangeForUnit(cm, start, behavior.unit); + if (behavior.extend) + { ourRange = extendRange(ourRange, range.anchor, range.head, behavior.extend); } + else + { ourRange = range; } + } + + if (!behavior.addNew) { + ourIndex = 0; + setSelection(doc, new Selection([ourRange], 0), sel_mouse); + startSel = doc.sel; + } else if (ourIndex == -1) { + ourIndex = ranges.length; + setSelection(doc, normalizeSelection(cm, ranges.concat([ourRange]), ourIndex), + {scroll: false, origin: "*mouse"}); + } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == "char" && !behavior.extend) { + setSelection(doc, normalizeSelection(cm, ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0), + {scroll: false, origin: "*mouse"}); + startSel = doc.sel; + } else { + replaceOneSelection(doc, ourIndex, ourRange, sel_mouse); + } + + var lastPos = start; + function extendTo(pos) { + if (cmp(lastPos, pos) == 0) { return } + lastPos = pos; + + if (behavior.unit == "rectangle") { + var ranges = [], tabSize = cm.options.tabSize; + var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize); + var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize); + var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol); + for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line)); + line <= end; line++) { + var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize); + if (left == right) + { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); } + else if (text.length > leftPos) + { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); } + } + if (!ranges.length) { ranges.push(new Range(start, start)); } + setSelection(doc, normalizeSelection(cm, startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex), + {origin: "*mouse", scroll: false}); + cm.scrollIntoView(pos); + } else { + var oldRange = ourRange; + var range = rangeForUnit(cm, pos, behavior.unit); + var anchor = oldRange.anchor, head; + if (cmp(range.anchor, anchor) > 0) { + head = range.head; + anchor = minPos(oldRange.from(), range.anchor); + } else { + head = range.anchor; + anchor = maxPos(oldRange.to(), range.head); + } + var ranges$1 = startSel.ranges.slice(0); + ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc, anchor), head)); + setSelection(doc, normalizeSelection(cm, ranges$1, ourIndex), sel_mouse); + } + } + + var editorSize = display.wrapper.getBoundingClientRect(); + // Used to ensure timeout re-tries don't fire when another extend + // happened in the meantime (clearTimeout isn't reliable -- at + // least on Chrome, the timeouts still happen even when cleared, + // if the clear happens after their scheduled firing time). + var counter = 0; + + function extend(e) { + var curCount = ++counter; + var cur = posFromMouse(cm, e, true, behavior.unit == "rectangle"); + if (!cur) { return } + if (cmp(cur, lastPos) != 0) { + cm.curOp.focus = activeElt(root(cm)); + extendTo(cur); + var visible = visibleLines(display, doc); + if (cur.line >= visible.to || cur.line < visible.from) + { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e); }}), 150); } + } else { + var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0; + if (outside) { setTimeout(operation(cm, function () { + if (counter != curCount) { return } + display.scroller.scrollTop += outside; + extend(e); + }), 50); } + } + } + + function done(e) { + cm.state.selectingText = false; + counter = Infinity; + // If e is null or undefined we interpret this as someone trying + // to explicitly cancel the selection rather than the user + // letting go of the mouse button. + if (e) { + e_preventDefault(e); + display.input.focus(); + } + off(display.wrapper.ownerDocument, "mousemove", move); + off(display.wrapper.ownerDocument, "mouseup", up); + doc.history.lastSelOrigin = null; + } + + var move = operation(cm, function (e) { + if (e.buttons === 0 || !e_button(e)) { done(e); } + else { extend(e); } + }); + var up = operation(cm, done); + cm.state.selectingText = up; + on(display.wrapper.ownerDocument, "mousemove", move); + on(display.wrapper.ownerDocument, "mouseup", up); + } + + // Used when mouse-selecting to adjust the anchor to the proper side + // of a bidi jump depending on the visual position of the head. + function bidiSimplify(cm, range) { + var anchor = range.anchor; + var head = range.head; + var anchorLine = getLine(cm.doc, anchor.line); + if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range } + var order = getOrder(anchorLine); + if (!order) { return range } + var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index]; + if (part.from != anchor.ch && part.to != anchor.ch) { return range } + var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1); + if (boundary == 0 || boundary == order.length) { return range } + + // Compute the relative visual position of the head compared to the + // anchor (<0 is to the left, >0 to the right) + var leftSide; + if (head.line != anchor.line) { + leftSide = (head.line - anchor.line) * (cm.doc.direction == "ltr" ? 1 : -1) > 0; + } else { + var headIndex = getBidiPartAt(order, head.ch, head.sticky); + var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1); + if (headIndex == boundary - 1 || headIndex == boundary) + { leftSide = dir < 0; } + else + { leftSide = dir > 0; } + } + + var usePart = order[boundary + (leftSide ? -1 : 0)]; + var from = leftSide == (usePart.level == 1); + var ch = from ? usePart.from : usePart.to, sticky = from ? "after" : "before"; + return anchor.ch == ch && anchor.sticky == sticky ? range : new Range(new Pos(anchor.line, ch, sticky), head) + } + + + // Determines whether an event happened in the gutter, and fires the + // handlers for the corresponding event. + function gutterEvent(cm, e, type, prevent) { + var mX, mY; + if (e.touches) { + mX = e.touches[0].clientX; + mY = e.touches[0].clientY; + } else { + try { mX = e.clientX; mY = e.clientY; } + catch(e$1) { return false } + } + if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) { return false } + if (prevent) { e_preventDefault(e); } + + var display = cm.display; + var lineBox = display.lineDiv.getBoundingClientRect(); + + if (mY > lineBox.bottom || !hasHandler(cm, type)) { return e_defaultPrevented(e) } + mY -= lineBox.top - display.viewOffset; + + for (var i = 0; i < cm.display.gutterSpecs.length; ++i) { + var g = display.gutters.childNodes[i]; + if (g && g.getBoundingClientRect().right >= mX) { + var line = lineAtHeight(cm.doc, mY); + var gutter = cm.display.gutterSpecs[i]; + signal(cm, type, cm, line, gutter.className, e); + return e_defaultPrevented(e) + } + } + } + + function clickInGutter(cm, e) { + return gutterEvent(cm, e, "gutterClick", true) + } + + // CONTEXT MENU HANDLING + + // To make the context menu work, we need to briefly unhide the + // textarea (making it as unobtrusive as possible) to let the + // right-click take effect on it. + function onContextMenu(cm, e) { + if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return } + if (signalDOMEvent(cm, e, "contextmenu")) { return } + if (!captureRightClick) { cm.display.input.onContextMenu(e); } + } + + function contextMenuInGutter(cm, e) { + if (!hasHandler(cm, "gutterContextMenu")) { return false } + return gutterEvent(cm, e, "gutterContextMenu", false) + } + + function themeChanged(cm) { + cm.display.wrapper.className = cm.display.wrapper.className.replace(/\s*cm-s-\S+/g, "") + + cm.options.theme.replace(/(^|\s)\s*/g, " cm-s-"); + clearCaches(cm); + } + + var Init = {toString: function(){return "CodeMirror.Init"}}; + + var defaults = {}; + var optionHandlers = {}; + + function defineOptions(CodeMirror) { + var optionHandlers = CodeMirror.optionHandlers; + + function option(name, deflt, handle, notOnInit) { + CodeMirror.defaults[name] = deflt; + if (handle) { optionHandlers[name] = + notOnInit ? function (cm, val, old) {if (old != Init) { handle(cm, val, old); }} : handle; } + } + + CodeMirror.defineOption = option; + + // Passed to option handlers when there is no old value. + CodeMirror.Init = Init; + + // These two are, on init, called from the constructor because they + // have to be initialized before the editor can start at all. + option("value", "", function (cm, val) { return cm.setValue(val); }, true); + option("mode", null, function (cm, val) { + cm.doc.modeOption = val; + loadMode(cm); + }, true); + + option("indentUnit", 2, loadMode, true); + option("indentWithTabs", false); + option("smartIndent", true); + option("tabSize", 4, function (cm) { + resetModeState(cm); + clearCaches(cm); + regChange(cm); + }, true); + + option("lineSeparator", null, function (cm, val) { + cm.doc.lineSep = val; + if (!val) { return } + var newBreaks = [], lineNo = cm.doc.first; + cm.doc.iter(function (line) { + for (var pos = 0;;) { + var found = line.text.indexOf(val, pos); + if (found == -1) { break } + pos = found + val.length; + newBreaks.push(Pos(lineNo, found)); + } + lineNo++; + }); + for (var i = newBreaks.length - 1; i >= 0; i--) + { replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)); } + }); + option("specialChars", /[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g, function (cm, val, old) { + cm.state.specialChars = new RegExp(val.source + (val.test("\t") ? "" : "|\t"), "g"); + if (old != Init) { cm.refresh(); } + }); + option("specialCharPlaceholder", defaultSpecialCharPlaceholder, function (cm) { return cm.refresh(); }, true); + option("electricChars", true); + option("inputStyle", mobile ? "contenteditable" : "textarea", function () { + throw new Error("inputStyle can not (yet) be changed in a running editor") // FIXME + }, true); + option("spellcheck", false, function (cm, val) { return cm.getInputField().spellcheck = val; }, true); + option("autocorrect", false, function (cm, val) { return cm.getInputField().autocorrect = val; }, true); + option("autocapitalize", false, function (cm, val) { return cm.getInputField().autocapitalize = val; }, true); + option("rtlMoveVisually", !windows); + option("wholeLineUpdateBefore", true); + + option("theme", "default", function (cm) { + themeChanged(cm); + updateGutters(cm); + }, true); + option("keyMap", "default", function (cm, val, old) { + var next = getKeyMap(val); + var prev = old != Init && getKeyMap(old); + if (prev && prev.detach) { prev.detach(cm, next); } + if (next.attach) { next.attach(cm, prev || null); } + }); + option("extraKeys", null); + option("configureMouse", null); + + option("lineWrapping", false, wrappingChanged, true); + option("gutters", [], function (cm, val) { + cm.display.gutterSpecs = getGutters(val, cm.options.lineNumbers); + updateGutters(cm); + }, true); + option("fixedGutter", true, function (cm, val) { + cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + "px" : "0"; + cm.refresh(); + }, true); + option("coverGutterNextToScrollbar", false, function (cm) { return updateScrollbars(cm); }, true); + option("scrollbarStyle", "native", function (cm) { + initScrollbars(cm); + updateScrollbars(cm); + cm.display.scrollbars.setScrollTop(cm.doc.scrollTop); + cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft); + }, true); + option("lineNumbers", false, function (cm, val) { + cm.display.gutterSpecs = getGutters(cm.options.gutters, val); + updateGutters(cm); + }, true); + option("firstLineNumber", 1, updateGutters, true); + option("lineNumberFormatter", function (integer) { return integer; }, updateGutters, true); + option("showCursorWhenSelecting", false, updateSelection, true); + + option("resetSelectionOnContextMenu", true); + option("lineWiseCopyCut", true); + option("pasteLinesPerSelection", true); + option("selectionsMayTouch", false); + + option("readOnly", false, function (cm, val) { + if (val == "nocursor") { + onBlur(cm); + cm.display.input.blur(); + } + cm.display.input.readOnlyChanged(val); + }); + + option("screenReaderLabel", null, function (cm, val) { + val = (val === '') ? null : val; + cm.display.input.screenReaderLabelChanged(val); + }); + + option("disableInput", false, function (cm, val) {if (!val) { cm.display.input.reset(); }}, true); + option("dragDrop", true, dragDropChanged); + option("allowDropFileTypes", null); + + option("cursorBlinkRate", 530); + option("cursorScrollMargin", 0); + option("cursorHeight", 1, updateSelection, true); + option("singleCursorHeightPerLine", true, updateSelection, true); + option("workTime", 100); + option("workDelay", 100); + option("flattenSpans", true, resetModeState, true); + option("addModeClass", false, resetModeState, true); + option("pollInterval", 100); + option("undoDepth", 200, function (cm, val) { return cm.doc.history.undoDepth = val; }); + option("historyEventDelay", 1250); + option("viewportMargin", 10, function (cm) { return cm.refresh(); }, true); + option("maxHighlightLength", 10000, resetModeState, true); + option("moveInputWithCursor", true, function (cm, val) { + if (!val) { cm.display.input.resetPosition(); } + }); + + option("tabindex", null, function (cm, val) { return cm.display.input.getField().tabIndex = val || ""; }); + option("autofocus", null); + option("direction", "ltr", function (cm, val) { return cm.doc.setDirection(val); }, true); + option("phrases", null); + } + + function dragDropChanged(cm, value, old) { + var wasOn = old && old != Init; + if (!value != !wasOn) { + var funcs = cm.display.dragFunctions; + var toggle = value ? on : off; + toggle(cm.display.scroller, "dragstart", funcs.start); + toggle(cm.display.scroller, "dragenter", funcs.enter); + toggle(cm.display.scroller, "dragover", funcs.over); + toggle(cm.display.scroller, "dragleave", funcs.leave); + toggle(cm.display.scroller, "drop", funcs.drop); + } + } + + function wrappingChanged(cm) { + if (cm.options.lineWrapping) { + addClass(cm.display.wrapper, "CodeMirror-wrap"); + cm.display.sizer.style.minWidth = ""; + cm.display.sizerWidth = null; + } else { + rmClass(cm.display.wrapper, "CodeMirror-wrap"); + findMaxLine(cm); + } + estimateLineHeights(cm); + regChange(cm); + clearCaches(cm); + setTimeout(function () { return updateScrollbars(cm); }, 100); + } + + // A CodeMirror instance represents an editor. This is the object + // that user code is usually dealing with. + + function CodeMirror(place, options) { + var this$1 = this; + + if (!(this instanceof CodeMirror)) { return new CodeMirror(place, options) } + + this.options = options = options ? copyObj(options) : {}; + // Determine effective options based on given values and defaults. + copyObj(defaults, options, false); + + var doc = options.value; + if (typeof doc == "string") { doc = new Doc(doc, options.mode, null, options.lineSeparator, options.direction); } + else if (options.mode) { doc.modeOption = options.mode; } + this.doc = doc; + + var input = new CodeMirror.inputStyles[options.inputStyle](this); + var display = this.display = new Display(place, doc, input, options); + display.wrapper.CodeMirror = this; + themeChanged(this); + if (options.lineWrapping) + { this.display.wrapper.className += " CodeMirror-wrap"; } + initScrollbars(this); + + this.state = { + keyMaps: [], // stores maps added by addKeyMap + overlays: [], // highlighting overlays, as added by addOverlay + modeGen: 0, // bumped when mode/overlay changes, used to invalidate highlighting info + overwrite: false, + delayingBlurEvent: false, + focused: false, + suppressEdits: false, // used to disable editing during key handlers when in readOnly mode + pasteIncoming: -1, cutIncoming: -1, // help recognize paste/cut edits in input.poll + selectingText: false, + draggingText: false, + highlight: new Delayed(), // stores highlight worker timeout + keySeq: null, // Unfinished key sequence + specialChars: null + }; + + if (options.autofocus && !mobile) { display.input.focus(); } + + // Override magic textarea content restore that IE sometimes does + // on our hidden textarea on reload + if (ie && ie_version < 11) { setTimeout(function () { return this$1.display.input.reset(true); }, 20); } + + registerEventHandlers(this); + ensureGlobalHandlers(); + + startOperation(this); + this.curOp.forceUpdate = true; + attachDoc(this, doc); + + if ((options.autofocus && !mobile) || this.hasFocus()) + { setTimeout(function () { + if (this$1.hasFocus() && !this$1.state.focused) { onFocus(this$1); } + }, 20); } + else + { onBlur(this); } + + for (var opt in optionHandlers) { if (optionHandlers.hasOwnProperty(opt)) + { optionHandlers[opt](this, options[opt], Init); } } + maybeUpdateLineNumberWidth(this); + if (options.finishInit) { options.finishInit(this); } + for (var i = 0; i < initHooks.length; ++i) { initHooks[i](this); } + endOperation(this); + // Suppress optimizelegibility in Webkit, since it breaks text + // measuring on line wrapping boundaries. + if (webkit && options.lineWrapping && + getComputedStyle(display.lineDiv).textRendering == "optimizelegibility") + { display.lineDiv.style.textRendering = "auto"; } + } + + // The default configuration options. + CodeMirror.defaults = defaults; + // Functions to run when options are changed. + CodeMirror.optionHandlers = optionHandlers; + + // Attach the necessary event handlers when initializing the editor + function registerEventHandlers(cm) { + var d = cm.display; + on(d.scroller, "mousedown", operation(cm, onMouseDown)); + // Older IE's will not fire a second mousedown for a double click + if (ie && ie_version < 11) + { on(d.scroller, "dblclick", operation(cm, function (e) { + if (signalDOMEvent(cm, e)) { return } + var pos = posFromMouse(cm, e); + if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return } + e_preventDefault(e); + var word = cm.findWordAt(pos); + extendSelection(cm.doc, word.anchor, word.head); + })); } + else + { on(d.scroller, "dblclick", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); } + // Some browsers fire contextmenu *after* opening the menu, at + // which point we can't mess with it anymore. Context menu is + // handled in onMouseDown for these browsers. + on(d.scroller, "contextmenu", function (e) { return onContextMenu(cm, e); }); + on(d.input.getField(), "contextmenu", function (e) { + if (!d.scroller.contains(e.target)) { onContextMenu(cm, e); } + }); + + // Used to suppress mouse event handling when a touch happens + var touchFinished, prevTouch = {end: 0}; + function finishTouch() { + if (d.activeTouch) { + touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000); + prevTouch = d.activeTouch; + prevTouch.end = +new Date; + } + } + function isMouseLikeTouchEvent(e) { + if (e.touches.length != 1) { return false } + var touch = e.touches[0]; + return touch.radiusX <= 1 && touch.radiusY <= 1 + } + function farAway(touch, other) { + if (other.left == null) { return true } + var dx = other.left - touch.left, dy = other.top - touch.top; + return dx * dx + dy * dy > 20 * 20 + } + on(d.scroller, "touchstart", function (e) { + if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) { + d.input.ensurePolled(); + clearTimeout(touchFinished); + var now = +new Date; + d.activeTouch = {start: now, moved: false, + prev: now - prevTouch.end <= 300 ? prevTouch : null}; + if (e.touches.length == 1) { + d.activeTouch.left = e.touches[0].pageX; + d.activeTouch.top = e.touches[0].pageY; + } + } + }); + on(d.scroller, "touchmove", function () { + if (d.activeTouch) { d.activeTouch.moved = true; } + }); + on(d.scroller, "touchend", function (e) { + var touch = d.activeTouch; + if (touch && !eventInWidget(d, e) && touch.left != null && + !touch.moved && new Date - touch.start < 300) { + var pos = cm.coordsChar(d.activeTouch, "page"), range; + if (!touch.prev || farAway(touch, touch.prev)) // Single tap + { range = new Range(pos, pos); } + else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap + { range = cm.findWordAt(pos); } + else // Triple tap + { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); } + cm.setSelection(range.anchor, range.head); + cm.focus(); + e_preventDefault(e); + } + finishTouch(); + }); + on(d.scroller, "touchcancel", finishTouch); + + // Sync scrolling between fake scrollbars and real scrollable + // area, ensure viewport is updated when scrolling. + on(d.scroller, "scroll", function () { + if (d.scroller.clientHeight) { + updateScrollTop(cm, d.scroller.scrollTop); + setScrollLeft(cm, d.scroller.scrollLeft, true); + signal(cm, "scroll", cm); + } + }); + + // Listen to wheel events in order to try and update the viewport on time. + on(d.scroller, "mousewheel", function (e) { return onScrollWheel(cm, e); }); + on(d.scroller, "DOMMouseScroll", function (e) { return onScrollWheel(cm, e); }); + + // Prevent wrapper from ever scrolling + on(d.wrapper, "scroll", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; }); + + d.dragFunctions = { + enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }}, + over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }}, + start: function (e) { return onDragStart(cm, e); }, + drop: operation(cm, onDrop), + leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }} + }; + + var inp = d.input.getField(); + on(inp, "keyup", function (e) { return onKeyUp.call(cm, e); }); + on(inp, "keydown", operation(cm, onKeyDown)); + on(inp, "keypress", operation(cm, onKeyPress)); + on(inp, "focus", function (e) { return onFocus(cm, e); }); + on(inp, "blur", function (e) { return onBlur(cm, e); }); + } + + var initHooks = []; + CodeMirror.defineInitHook = function (f) { return initHooks.push(f); }; + + // Indent the given line. The how parameter can be "smart", + // "add"/null, "subtract", or "prev". When aggressive is false + // (typically set to true for forced single-line indents), empty + // lines are not indented, and places where the mode returns Pass + // are left alone. + function indentLine(cm, n, how, aggressive) { + var doc = cm.doc, state; + if (how == null) { how = "add"; } + if (how == "smart") { + // Fall back to "prev" when the mode doesn't have an indentation + // method. + if (!doc.mode.indent) { how = "prev"; } + else { state = getContextBefore(cm, n).state; } + } + + var tabSize = cm.options.tabSize; + var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize); + if (line.stateAfter) { line.stateAfter = null; } + var curSpaceString = line.text.match(/^\s*/)[0], indentation; + if (!aggressive && !/\S/.test(line.text)) { + indentation = 0; + how = "not"; + } else if (how == "smart") { + indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text); + if (indentation == Pass || indentation > 150) { + if (!aggressive) { return } + how = "prev"; + } + } + if (how == "prev") { + if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); } + else { indentation = 0; } + } else if (how == "add") { + indentation = curSpace + cm.options.indentUnit; + } else if (how == "subtract") { + indentation = curSpace - cm.options.indentUnit; + } else if (typeof how == "number") { + indentation = curSpace + how; + } + indentation = Math.max(0, indentation); + + var indentString = "", pos = 0; + if (cm.options.indentWithTabs) + { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += "\t";} } + if (pos < indentation) { indentString += spaceStr(indentation - pos); } + + if (indentString != curSpaceString) { + replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), "+input"); + line.stateAfter = null; + return true + } else { + // Ensure that, if the cursor was in the whitespace at the start + // of the line, it is moved to the end of that space. + for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) { + var range = doc.sel.ranges[i$1]; + if (range.head.line == n && range.head.ch < curSpaceString.length) { + var pos$1 = Pos(n, curSpaceString.length); + replaceOneSelection(doc, i$1, new Range(pos$1, pos$1)); + break + } + } + } + } + + // This will be set to a {lineWise: bool, text: [string]} object, so + // that, when pasting, we know what kind of selections the copied + // text was made out of. + var lastCopied = null; + + function setLastCopied(newLastCopied) { + lastCopied = newLastCopied; + } + + function applyTextInput(cm, inserted, deleted, sel, origin) { + var doc = cm.doc; + cm.display.shift = false; + if (!sel) { sel = doc.sel; } + + var recent = +new Date - 200; + var paste = origin == "paste" || cm.state.pasteIncoming > recent; + var textLines = splitLinesAuto(inserted), multiPaste = null; + // When pasting N lines into N selections, insert one line per selection + if (paste && sel.ranges.length > 1) { + if (lastCopied && lastCopied.text.join("\n") == inserted) { + if (sel.ranges.length % lastCopied.text.length == 0) { + multiPaste = []; + for (var i = 0; i < lastCopied.text.length; i++) + { multiPaste.push(doc.splitLines(lastCopied.text[i])); } + } + } else if (textLines.length == sel.ranges.length && cm.options.pasteLinesPerSelection) { + multiPaste = map(textLines, function (l) { return [l]; }); + } + } + + var updateInput = cm.curOp.updateInput; + // Normal behavior is to insert the new text into every selection + for (var i$1 = sel.ranges.length - 1; i$1 >= 0; i$1--) { + var range = sel.ranges[i$1]; + var from = range.from(), to = range.to(); + if (range.empty()) { + if (deleted && deleted > 0) // Handle deletion + { from = Pos(from.line, from.ch - deleted); } + else if (cm.state.overwrite && !paste) // Handle overwrite + { to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)); } + else if (paste && lastCopied && lastCopied.lineWise && lastCopied.text.join("\n") == textLines.join("\n")) + { from = to = Pos(from.line, 0); } + } + var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i$1 % multiPaste.length] : textLines, + origin: origin || (paste ? "paste" : cm.state.cutIncoming > recent ? "cut" : "+input")}; + makeChange(cm.doc, changeEvent); + signalLater(cm, "inputRead", cm, changeEvent); + } + if (inserted && !paste) + { triggerElectric(cm, inserted); } + + ensureCursorVisible(cm); + if (cm.curOp.updateInput < 2) { cm.curOp.updateInput = updateInput; } + cm.curOp.typing = true; + cm.state.pasteIncoming = cm.state.cutIncoming = -1; + } + + function handlePaste(e, cm) { + var pasted = e.clipboardData && e.clipboardData.getData("Text"); + if (pasted) { + e.preventDefault(); + if (!cm.isReadOnly() && !cm.options.disableInput && cm.hasFocus()) + { runInOp(cm, function () { return applyTextInput(cm, pasted, 0, null, "paste"); }); } + return true + } + } + + function triggerElectric(cm, inserted) { + // When an 'electric' character is inserted, immediately trigger a reindent + if (!cm.options.electricChars || !cm.options.smartIndent) { return } + var sel = cm.doc.sel; + + for (var i = sel.ranges.length - 1; i >= 0; i--) { + var range = sel.ranges[i]; + if (range.head.ch > 100 || (i && sel.ranges[i - 1].head.line == range.head.line)) { continue } + var mode = cm.getModeAt(range.head); + var indented = false; + if (mode.electricChars) { + for (var j = 0; j < mode.electricChars.length; j++) + { if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) { + indented = indentLine(cm, range.head.line, "smart"); + break + } } + } else if (mode.electricInput) { + if (mode.electricInput.test(getLine(cm.doc, range.head.line).text.slice(0, range.head.ch))) + { indented = indentLine(cm, range.head.line, "smart"); } + } + if (indented) { signalLater(cm, "electricInput", cm, range.head.line); } + } + } + + function copyableRanges(cm) { + var text = [], ranges = []; + for (var i = 0; i < cm.doc.sel.ranges.length; i++) { + var line = cm.doc.sel.ranges[i].head.line; + var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)}; + ranges.push(lineRange); + text.push(cm.getRange(lineRange.anchor, lineRange.head)); + } + return {text: text, ranges: ranges} + } + + function disableBrowserMagic(field, spellcheck, autocorrect, autocapitalize) { + field.setAttribute("autocorrect", autocorrect ? "on" : "off"); + field.setAttribute("autocapitalize", autocapitalize ? "on" : "off"); + field.setAttribute("spellcheck", !!spellcheck); + } + + function hiddenTextarea() { + var te = elt("textarea", null, null, "position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"); + var div = elt("div", [te], null, "overflow: hidden; position: relative; width: 3px; height: 0px;"); + // The textarea is kept positioned near the cursor to prevent the + // fact that it'll be scrolled into view on input from scrolling + // our fake cursor out of view. On webkit, when wrap=off, paste is + // very slow. So make the area wide instead. + if (webkit) { te.style.width = "1000px"; } + else { te.setAttribute("wrap", "off"); } + // If border: 0; -- iOS fails to open keyboard (issue #1287) + if (ios) { te.style.border = "1px solid black"; } + return div + } + + // The publicly visible API. Note that methodOp(f) means + // 'wrap f in an operation, performed on its `this` parameter'. + + // This is not the complete set of editor methods. Most of the + // methods defined on the Doc type are also injected into + // CodeMirror.prototype, for backwards compatibility and + // convenience. + + function addEditorMethods(CodeMirror) { + var optionHandlers = CodeMirror.optionHandlers; + + var helpers = CodeMirror.helpers = {}; + + CodeMirror.prototype = { + constructor: CodeMirror, + focus: function(){win(this).focus(); this.display.input.focus();}, + + setOption: function(option, value) { + var options = this.options, old = options[option]; + if (options[option] == value && option != "mode") { return } + options[option] = value; + if (optionHandlers.hasOwnProperty(option)) + { operation(this, optionHandlers[option])(this, value, old); } + signal(this, "optionChange", this, option); + }, + + getOption: function(option) {return this.options[option]}, + getDoc: function() {return this.doc}, + + addKeyMap: function(map, bottom) { + this.state.keyMaps[bottom ? "push" : "unshift"](getKeyMap(map)); + }, + removeKeyMap: function(map) { + var maps = this.state.keyMaps; + for (var i = 0; i < maps.length; ++i) + { if (maps[i] == map || maps[i].name == map) { + maps.splice(i, 1); + return true + } } + }, + + addOverlay: methodOp(function(spec, options) { + var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec); + if (mode.startState) { throw new Error("Overlays may not be stateful.") } + insertSorted(this.state.overlays, + {mode: mode, modeSpec: spec, opaque: options && options.opaque, + priority: (options && options.priority) || 0}, + function (overlay) { return overlay.priority; }); + this.state.modeGen++; + regChange(this); + }), + removeOverlay: methodOp(function(spec) { + var overlays = this.state.overlays; + for (var i = 0; i < overlays.length; ++i) { + var cur = overlays[i].modeSpec; + if (cur == spec || typeof spec == "string" && cur.name == spec) { + overlays.splice(i, 1); + this.state.modeGen++; + regChange(this); + return + } + } + }), + + indentLine: methodOp(function(n, dir, aggressive) { + if (typeof dir != "string" && typeof dir != "number") { + if (dir == null) { dir = this.options.smartIndent ? "smart" : "prev"; } + else { dir = dir ? "add" : "subtract"; } + } + if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive); } + }), + indentSelection: methodOp(function(how) { + var ranges = this.doc.sel.ranges, end = -1; + for (var i = 0; i < ranges.length; i++) { + var range = ranges[i]; + if (!range.empty()) { + var from = range.from(), to = range.to(); + var start = Math.max(end, from.line); + end = Math.min(this.lastLine(), to.line - (to.ch ? 0 : 1)) + 1; + for (var j = start; j < end; ++j) + { indentLine(this, j, how); } + var newRanges = this.doc.sel.ranges; + if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0) + { replaceOneSelection(this.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); } + } else if (range.head.line > end) { + indentLine(this, range.head.line, how, true); + end = range.head.line; + if (i == this.doc.sel.primIndex) { ensureCursorVisible(this); } + } + } + }), + + // Fetch the parser token for a given character. Useful for hacks + // that want to inspect the mode state (say, for completion). + getTokenAt: function(pos, precise) { + return takeToken(this, pos, precise) + }, + + getLineTokens: function(line, precise) { + return takeToken(this, Pos(line), precise, true) + }, + + getTokenTypeAt: function(pos) { + pos = clipPos(this.doc, pos); + var styles = getLineStyles(this, getLine(this.doc, pos.line)); + var before = 0, after = (styles.length - 1) / 2, ch = pos.ch; + var type; + if (ch == 0) { type = styles[2]; } + else { for (;;) { + var mid = (before + after) >> 1; + if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid; } + else if (styles[mid * 2 + 1] < ch) { before = mid + 1; } + else { type = styles[mid * 2 + 2]; break } + } } + var cut = type ? type.indexOf("overlay ") : -1; + return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1) + }, + + getModeAt: function(pos) { + var mode = this.doc.mode; + if (!mode.innerMode) { return mode } + return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode + }, + + getHelper: function(pos, type) { + return this.getHelpers(pos, type)[0] + }, + + getHelpers: function(pos, type) { + var found = []; + if (!helpers.hasOwnProperty(type)) { return found } + var help = helpers[type], mode = this.getModeAt(pos); + if (typeof mode[type] == "string") { + if (help[mode[type]]) { found.push(help[mode[type]]); } + } else if (mode[type]) { + for (var i = 0; i < mode[type].length; i++) { + var val = help[mode[type][i]]; + if (val) { found.push(val); } + } + } else if (mode.helperType && help[mode.helperType]) { + found.push(help[mode.helperType]); + } else if (help[mode.name]) { + found.push(help[mode.name]); + } + for (var i$1 = 0; i$1 < help._global.length; i$1++) { + var cur = help._global[i$1]; + if (cur.pred(mode, this) && indexOf(found, cur.val) == -1) + { found.push(cur.val); } + } + return found + }, + + getStateAfter: function(line, precise) { + var doc = this.doc; + line = clipLine(doc, line == null ? doc.first + doc.size - 1: line); + return getContextBefore(this, line + 1, precise).state + }, + + cursorCoords: function(start, mode) { + var pos, range = this.doc.sel.primary(); + if (start == null) { pos = range.head; } + else if (typeof start == "object") { pos = clipPos(this.doc, start); } + else { pos = start ? range.from() : range.to(); } + return cursorCoords(this, pos, mode || "page") + }, + + charCoords: function(pos, mode) { + return charCoords(this, clipPos(this.doc, pos), mode || "page") + }, + + coordsChar: function(coords, mode) { + coords = fromCoordSystem(this, coords, mode || "page"); + return coordsChar(this, coords.left, coords.top) + }, + + lineAtHeight: function(height, mode) { + height = fromCoordSystem(this, {top: height, left: 0}, mode || "page").top; + return lineAtHeight(this.doc, height + this.display.viewOffset) + }, + heightAtLine: function(line, mode, includeWidgets) { + var end = false, lineObj; + if (typeof line == "number") { + var last = this.doc.first + this.doc.size - 1; + if (line < this.doc.first) { line = this.doc.first; } + else if (line > last) { line = last; end = true; } + lineObj = getLine(this.doc, line); + } else { + lineObj = line; + } + return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || "page", includeWidgets || end).top + + (end ? this.doc.height - heightAtLine(lineObj) : 0) + }, + + defaultTextHeight: function() { return textHeight(this.display) }, + defaultCharWidth: function() { return charWidth(this.display) }, + + getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}}, + + addWidget: function(pos, node, scroll, vert, horiz) { + var display = this.display; + pos = cursorCoords(this, clipPos(this.doc, pos)); + var top = pos.bottom, left = pos.left; + node.style.position = "absolute"; + node.setAttribute("cm-ignore-events", "true"); + this.display.input.setUneditable(node); + display.sizer.appendChild(node); + if (vert == "over") { + top = pos.top; + } else if (vert == "above" || vert == "near") { + var vspace = Math.max(display.wrapper.clientHeight, this.doc.height), + hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth); + // Default to positioning above (if specified and possible); otherwise default to positioning below + if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight) + { top = pos.top - node.offsetHeight; } + else if (pos.bottom + node.offsetHeight <= vspace) + { top = pos.bottom; } + if (left + node.offsetWidth > hspace) + { left = hspace - node.offsetWidth; } + } + node.style.top = top + "px"; + node.style.left = node.style.right = ""; + if (horiz == "right") { + left = display.sizer.clientWidth - node.offsetWidth; + node.style.right = "0px"; + } else { + if (horiz == "left") { left = 0; } + else if (horiz == "middle") { left = (display.sizer.clientWidth - node.offsetWidth) / 2; } + node.style.left = left + "px"; + } + if (scroll) + { scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}); } + }, + + triggerOnKeyDown: methodOp(onKeyDown), + triggerOnKeyPress: methodOp(onKeyPress), + triggerOnKeyUp: onKeyUp, + triggerOnMouseDown: methodOp(onMouseDown), + + execCommand: function(cmd) { + if (commands.hasOwnProperty(cmd)) + { return commands[cmd].call(null, this) } + }, + + triggerElectric: methodOp(function(text) { triggerElectric(this, text); }), + + findPosH: function(from, amount, unit, visually) { + var dir = 1; + if (amount < 0) { dir = -1; amount = -amount; } + var cur = clipPos(this.doc, from); + for (var i = 0; i < amount; ++i) { + cur = findPosH(this.doc, cur, dir, unit, visually); + if (cur.hitSide) { break } + } + return cur + }, + + moveH: methodOp(function(dir, unit) { + var this$1 = this; + + this.extendSelectionsBy(function (range) { + if (this$1.display.shift || this$1.doc.extend || range.empty()) + { return findPosH(this$1.doc, range.head, dir, unit, this$1.options.rtlMoveVisually) } + else + { return dir < 0 ? range.from() : range.to() } + }, sel_move); + }), + + deleteH: methodOp(function(dir, unit) { + var sel = this.doc.sel, doc = this.doc; + if (sel.somethingSelected()) + { doc.replaceSelection("", null, "+delete"); } + else + { deleteNearSelection(this, function (range) { + var other = findPosH(doc, range.head, dir, unit, false); + return dir < 0 ? {from: other, to: range.head} : {from: range.head, to: other} + }); } + }), + + findPosV: function(from, amount, unit, goalColumn) { + var dir = 1, x = goalColumn; + if (amount < 0) { dir = -1; amount = -amount; } + var cur = clipPos(this.doc, from); + for (var i = 0; i < amount; ++i) { + var coords = cursorCoords(this, cur, "div"); + if (x == null) { x = coords.left; } + else { coords.left = x; } + cur = findPosV(this, coords, dir, unit); + if (cur.hitSide) { break } + } + return cur + }, + + moveV: methodOp(function(dir, unit) { + var this$1 = this; + + var doc = this.doc, goals = []; + var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected(); + doc.extendSelectionsBy(function (range) { + if (collapse) + { return dir < 0 ? range.from() : range.to() } + var headPos = cursorCoords(this$1, range.head, "div"); + if (range.goalColumn != null) { headPos.left = range.goalColumn; } + goals.push(headPos.left); + var pos = findPosV(this$1, headPos, dir, unit); + if (unit == "page" && range == doc.sel.primary()) + { addToScrollTop(this$1, charCoords(this$1, pos, "div").top - headPos.top); } + return pos + }, sel_move); + if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++) + { doc.sel.ranges[i].goalColumn = goals[i]; } } + }), + + // Find the word at the given position (as returned by coordsChar). + findWordAt: function(pos) { + var doc = this.doc, line = getLine(doc, pos.line).text; + var start = pos.ch, end = pos.ch; + if (line) { + var helper = this.getHelper(pos, "wordChars"); + if ((pos.sticky == "before" || end == line.length) && start) { --start; } else { ++end; } + var startChar = line.charAt(start); + var check = isWordChar(startChar, helper) + ? function (ch) { return isWordChar(ch, helper); } + : /\s/.test(startChar) ? function (ch) { return /\s/.test(ch); } + : function (ch) { return (!/\s/.test(ch) && !isWordChar(ch)); }; + while (start > 0 && check(line.charAt(start - 1))) { --start; } + while (end < line.length && check(line.charAt(end))) { ++end; } + } + return new Range(Pos(pos.line, start), Pos(pos.line, end)) + }, + + toggleOverwrite: function(value) { + if (value != null && value == this.state.overwrite) { return } + if (this.state.overwrite = !this.state.overwrite) + { addClass(this.display.cursorDiv, "CodeMirror-overwrite"); } + else + { rmClass(this.display.cursorDiv, "CodeMirror-overwrite"); } + + signal(this, "overwriteToggle", this, this.state.overwrite); + }, + hasFocus: function() { return this.display.input.getField() == activeElt(root(this)) }, + isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) }, + + scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y); }), + getScrollInfo: function() { + var scroller = this.display.scroller; + return {left: scroller.scrollLeft, top: scroller.scrollTop, + height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight, + width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth, + clientHeight: displayHeight(this), clientWidth: displayWidth(this)} + }, + + scrollIntoView: methodOp(function(range, margin) { + if (range == null) { + range = {from: this.doc.sel.primary().head, to: null}; + if (margin == null) { margin = this.options.cursorScrollMargin; } + } else if (typeof range == "number") { + range = {from: Pos(range, 0), to: null}; + } else if (range.from == null) { + range = {from: range, to: null}; + } + if (!range.to) { range.to = range.from; } + range.margin = margin || 0; + + if (range.from.line != null) { + scrollToRange(this, range); + } else { + scrollToCoordsRange(this, range.from, range.to, range.margin); + } + }), + + setSize: methodOp(function(width, height) { + var this$1 = this; + + var interpret = function (val) { return typeof val == "number" || /^\d+$/.test(String(val)) ? val + "px" : val; }; + if (width != null) { this.display.wrapper.style.width = interpret(width); } + if (height != null) { this.display.wrapper.style.height = interpret(height); } + if (this.options.lineWrapping) { clearLineMeasurementCache(this); } + var lineNo = this.display.viewFrom; + this.doc.iter(lineNo, this.display.viewTo, function (line) { + if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) + { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo, "widget"); break } } } + ++lineNo; + }); + this.curOp.forceUpdate = true; + signal(this, "refresh", this); + }), + + operation: function(f){return runInOp(this, f)}, + startOperation: function(){return startOperation(this)}, + endOperation: function(){return endOperation(this)}, + + refresh: methodOp(function() { + var oldHeight = this.display.cachedTextHeight; + regChange(this); + this.curOp.forceUpdate = true; + clearCaches(this); + scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop); + updateGutterSpace(this.display); + if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5 || this.options.lineWrapping) + { estimateLineHeights(this); } + signal(this, "refresh", this); + }), + + swapDoc: methodOp(function(doc) { + var old = this.doc; + old.cm = null; + // Cancel the current text selection if any (#5821) + if (this.state.selectingText) { this.state.selectingText(); } + attachDoc(this, doc); + clearCaches(this); + this.display.input.reset(); + scrollToCoords(this, doc.scrollLeft, doc.scrollTop); + this.curOp.forceScroll = true; + signalLater(this, "swapDoc", this, old); + return old + }), + + phrase: function(phraseText) { + var phrases = this.options.phrases; + return phrases && Object.prototype.hasOwnProperty.call(phrases, phraseText) ? phrases[phraseText] : phraseText + }, + + getInputField: function(){return this.display.input.getField()}, + getWrapperElement: function(){return this.display.wrapper}, + getScrollerElement: function(){return this.display.scroller}, + getGutterElement: function(){return this.display.gutters} + }; + eventMixin(CodeMirror); + + CodeMirror.registerHelper = function(type, name, value) { + if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []}; } + helpers[type][name] = value; + }; + CodeMirror.registerGlobalHelper = function(type, name, predicate, value) { + CodeMirror.registerHelper(type, name, value); + helpers[type]._global.push({pred: predicate, val: value}); + }; + } + + // Used for horizontal relative motion. Dir is -1 or 1 (left or + // right), unit can be "codepoint", "char", "column" (like char, but + // doesn't cross line boundaries), "word" (across next word), or + // "group" (to the start of next group of word or + // non-word-non-whitespace chars). The visually param controls + // whether, in right-to-left text, direction 1 means to move towards + // the next index in the string, or towards the character to the right + // of the current position. The resulting position will have a + // hitSide=true property if it reached the end of the document. + function findPosH(doc, pos, dir, unit, visually) { + var oldPos = pos; + var origDir = dir; + var lineObj = getLine(doc, pos.line); + var lineDir = visually && doc.direction == "rtl" ? -dir : dir; + function findNextLine() { + var l = pos.line + lineDir; + if (l < doc.first || l >= doc.first + doc.size) { return false } + pos = new Pos(l, pos.ch, pos.sticky); + return lineObj = getLine(doc, l) + } + function moveOnce(boundToLine) { + var next; + if (unit == "codepoint") { + var ch = lineObj.text.charCodeAt(pos.ch + (dir > 0 ? 0 : -1)); + if (isNaN(ch)) { + next = null; + } else { + var astral = dir > 0 ? ch >= 0xD800 && ch < 0xDC00 : ch >= 0xDC00 && ch < 0xDFFF; + next = new Pos(pos.line, Math.max(0, Math.min(lineObj.text.length, pos.ch + dir * (astral ? 2 : 1))), -dir); + } + } else if (visually) { + next = moveVisually(doc.cm, lineObj, pos, dir); + } else { + next = moveLogically(lineObj, pos, dir); + } + if (next == null) { + if (!boundToLine && findNextLine()) + { pos = endOfLine(visually, doc.cm, lineObj, pos.line, lineDir); } + else + { return false } + } else { + pos = next; + } + return true + } + + if (unit == "char" || unit == "codepoint") { + moveOnce(); + } else if (unit == "column") { + moveOnce(true); + } else if (unit == "word" || unit == "group") { + var sawType = null, group = unit == "group"; + var helper = doc.cm && doc.cm.getHelper(pos, "wordChars"); + for (var first = true;; first = false) { + if (dir < 0 && !moveOnce(!first)) { break } + var cur = lineObj.text.charAt(pos.ch) || "\n"; + var type = isWordChar(cur, helper) ? "w" + : group && cur == "\n" ? "n" + : !group || /\s/.test(cur) ? null + : "p"; + if (group && !first && !type) { type = "s"; } + if (sawType && sawType != type) { + if (dir < 0) {dir = 1; moveOnce(); pos.sticky = "after";} + break + } + + if (type) { sawType = type; } + if (dir > 0 && !moveOnce(!first)) { break } + } + } + var result = skipAtomic(doc, pos, oldPos, origDir, true); + if (equalCursorPos(oldPos, result)) { result.hitSide = true; } + return result + } + + // For relative vertical movement. Dir may be -1 or 1. Unit can be + // "page" or "line". The resulting position will have a hitSide=true + // property if it reached the end of the document. + function findPosV(cm, pos, dir, unit) { + var doc = cm.doc, x = pos.left, y; + if (unit == "page") { + var pageSize = Math.min(cm.display.wrapper.clientHeight, win(cm).innerHeight || doc(cm).documentElement.clientHeight); + var moveAmount = Math.max(pageSize - .5 * textHeight(cm.display), 3); + y = (dir > 0 ? pos.bottom : pos.top) + dir * moveAmount; + + } else if (unit == "line") { + y = dir > 0 ? pos.bottom + 3 : pos.top - 3; + } + var target; + for (;;) { + target = coordsChar(cm, x, y); + if (!target.outside) { break } + if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break } + y += dir * 5; + } + return target + } + + // CONTENTEDITABLE INPUT STYLE + + var ContentEditableInput = function(cm) { + this.cm = cm; + this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null; + this.polling = new Delayed(); + this.composing = null; + this.gracePeriod = false; + this.readDOMTimeout = null; + }; + + ContentEditableInput.prototype.init = function (display) { + var this$1 = this; + + var input = this, cm = input.cm; + var div = input.div = display.lineDiv; + div.contentEditable = true; + disableBrowserMagic(div, cm.options.spellcheck, cm.options.autocorrect, cm.options.autocapitalize); + + function belongsToInput(e) { + for (var t = e.target; t; t = t.parentNode) { + if (t == div) { return true } + if (/\bCodeMirror-(?:line)?widget\b/.test(t.className)) { break } + } + return false + } + + on(div, "paste", function (e) { + if (!belongsToInput(e) || signalDOMEvent(cm, e) || handlePaste(e, cm)) { return } + // IE doesn't fire input events, so we schedule a read for the pasted content in this way + if (ie_version <= 11) { setTimeout(operation(cm, function () { return this$1.updateFromDOM(); }), 20); } + }); + + on(div, "compositionstart", function (e) { + this$1.composing = {data: e.data, done: false}; + }); + on(div, "compositionupdate", function (e) { + if (!this$1.composing) { this$1.composing = {data: e.data, done: false}; } + }); + on(div, "compositionend", function (e) { + if (this$1.composing) { + if (e.data != this$1.composing.data) { this$1.readFromDOMSoon(); } + this$1.composing.done = true; + } + }); + + on(div, "touchstart", function () { return input.forceCompositionEnd(); }); + + on(div, "input", function () { + if (!this$1.composing) { this$1.readFromDOMSoon(); } + }); + + function onCopyCut(e) { + if (!belongsToInput(e) || signalDOMEvent(cm, e)) { return } + if (cm.somethingSelected()) { + setLastCopied({lineWise: false, text: cm.getSelections()}); + if (e.type == "cut") { cm.replaceSelection("", null, "cut"); } + } else if (!cm.options.lineWiseCopyCut) { + return + } else { + var ranges = copyableRanges(cm); + setLastCopied({lineWise: true, text: ranges.text}); + if (e.type == "cut") { + cm.operation(function () { + cm.setSelections(ranges.ranges, 0, sel_dontScroll); + cm.replaceSelection("", null, "cut"); + }); + } + } + if (e.clipboardData) { + e.clipboardData.clearData(); + var content = lastCopied.text.join("\n"); + // iOS exposes the clipboard API, but seems to discard content inserted into it + e.clipboardData.setData("Text", content); + if (e.clipboardData.getData("Text") == content) { + e.preventDefault(); + return + } + } + // Old-fashioned briefly-focus-a-textarea hack + var kludge = hiddenTextarea(), te = kludge.firstChild; + disableBrowserMagic(te); + cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild); + te.value = lastCopied.text.join("\n"); + var hadFocus = activeElt(rootNode(div)); + selectInput(te); + setTimeout(function () { + cm.display.lineSpace.removeChild(kludge); + hadFocus.focus(); + if (hadFocus == div) { input.showPrimarySelection(); } + }, 50); + } + on(div, "copy", onCopyCut); + on(div, "cut", onCopyCut); + }; + + ContentEditableInput.prototype.screenReaderLabelChanged = function (label) { + // Label for screenreaders, accessibility + if(label) { + this.div.setAttribute('aria-label', label); + } else { + this.div.removeAttribute('aria-label'); + } + }; + + ContentEditableInput.prototype.prepareSelection = function () { + var result = prepareSelection(this.cm, false); + result.focus = activeElt(rootNode(this.div)) == this.div; + return result + }; + + ContentEditableInput.prototype.showSelection = function (info, takeFocus) { + if (!info || !this.cm.display.view.length) { return } + if (info.focus || takeFocus) { this.showPrimarySelection(); } + this.showMultipleSelections(info); + }; + + ContentEditableInput.prototype.getSelection = function () { + return this.cm.display.wrapper.ownerDocument.getSelection() + }; + + ContentEditableInput.prototype.showPrimarySelection = function () { + var sel = this.getSelection(), cm = this.cm, prim = cm.doc.sel.primary(); + var from = prim.from(), to = prim.to(); + + if (cm.display.viewTo == cm.display.viewFrom || from.line >= cm.display.viewTo || to.line < cm.display.viewFrom) { + sel.removeAllRanges(); + return + } + + var curAnchor = domToPos(cm, sel.anchorNode, sel.anchorOffset); + var curFocus = domToPos(cm, sel.focusNode, sel.focusOffset); + if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad && + cmp(minPos(curAnchor, curFocus), from) == 0 && + cmp(maxPos(curAnchor, curFocus), to) == 0) + { return } + + var view = cm.display.view; + var start = (from.line >= cm.display.viewFrom && posToDOM(cm, from)) || + {node: view[0].measure.map[2], offset: 0}; + var end = to.line < cm.display.viewTo && posToDOM(cm, to); + if (!end) { + var measure = view[view.length - 1].measure; + var map = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map; + end = {node: map[map.length - 1], offset: map[map.length - 2] - map[map.length - 3]}; + } + + if (!start || !end) { + sel.removeAllRanges(); + return + } + + var old = sel.rangeCount && sel.getRangeAt(0), rng; + try { rng = range(start.node, start.offset, end.offset, end.node); } + catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible + if (rng) { + if (!gecko && cm.state.focused) { + sel.collapse(start.node, start.offset); + if (!rng.collapsed) { + sel.removeAllRanges(); + sel.addRange(rng); + } + } else { + sel.removeAllRanges(); + sel.addRange(rng); + } + if (old && sel.anchorNode == null) { sel.addRange(old); } + else if (gecko) { this.startGracePeriod(); } + } + this.rememberSelection(); + }; + + ContentEditableInput.prototype.startGracePeriod = function () { + var this$1 = this; + + clearTimeout(this.gracePeriod); + this.gracePeriod = setTimeout(function () { + this$1.gracePeriod = false; + if (this$1.selectionChanged()) + { this$1.cm.operation(function () { return this$1.cm.curOp.selectionChanged = true; }); } + }, 20); + }; + + ContentEditableInput.prototype.showMultipleSelections = function (info) { + removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors); + removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection); + }; + + ContentEditableInput.prototype.rememberSelection = function () { + var sel = this.getSelection(); + this.lastAnchorNode = sel.anchorNode; this.lastAnchorOffset = sel.anchorOffset; + this.lastFocusNode = sel.focusNode; this.lastFocusOffset = sel.focusOffset; + }; + + ContentEditableInput.prototype.selectionInEditor = function () { + var sel = this.getSelection(); + if (!sel.rangeCount) { return false } + var node = sel.getRangeAt(0).commonAncestorContainer; + return contains(this.div, node) + }; + + ContentEditableInput.prototype.focus = function () { + if (this.cm.options.readOnly != "nocursor") { + if (!this.selectionInEditor() || activeElt(rootNode(this.div)) != this.div) + { this.showSelection(this.prepareSelection(), true); } + this.div.focus(); + } + }; + ContentEditableInput.prototype.blur = function () { this.div.blur(); }; + ContentEditableInput.prototype.getField = function () { return this.div }; + + ContentEditableInput.prototype.supportsTouch = function () { return true }; + + ContentEditableInput.prototype.receivedFocus = function () { + var this$1 = this; + + var input = this; + if (this.selectionInEditor()) + { setTimeout(function () { return this$1.pollSelection(); }, 20); } + else + { runInOp(this.cm, function () { return input.cm.curOp.selectionChanged = true; }); } + + function poll() { + if (input.cm.state.focused) { + input.pollSelection(); + input.polling.set(input.cm.options.pollInterval, poll); + } + } + this.polling.set(this.cm.options.pollInterval, poll); + }; + + ContentEditableInput.prototype.selectionChanged = function () { + var sel = this.getSelection(); + return sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset || + sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset + }; + + ContentEditableInput.prototype.pollSelection = function () { + if (this.readDOMTimeout != null || this.gracePeriod || !this.selectionChanged()) { return } + var sel = this.getSelection(), cm = this.cm; + // On Android Chrome (version 56, at least), backspacing into an + // uneditable block element will put the cursor in that element, + // and then, because it's not editable, hide the virtual keyboard. + // Because Android doesn't allow us to actually detect backspace + // presses in a sane way, this code checks for when that happens + // and simulates a backspace press in this case. + if (android && chrome && this.cm.display.gutterSpecs.length && isInGutter(sel.anchorNode)) { + this.cm.triggerOnKeyDown({type: "keydown", keyCode: 8, preventDefault: Math.abs}); + this.blur(); + this.focus(); + return + } + if (this.composing) { return } + this.rememberSelection(); + var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset); + var head = domToPos(cm, sel.focusNode, sel.focusOffset); + if (anchor && head) { runInOp(cm, function () { + setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll); + if (anchor.bad || head.bad) { cm.curOp.selectionChanged = true; } + }); } + }; + + ContentEditableInput.prototype.pollContent = function () { + if (this.readDOMTimeout != null) { + clearTimeout(this.readDOMTimeout); + this.readDOMTimeout = null; + } + + var cm = this.cm, display = cm.display, sel = cm.doc.sel.primary(); + var from = sel.from(), to = sel.to(); + if (from.ch == 0 && from.line > cm.firstLine()) + { from = Pos(from.line - 1, getLine(cm.doc, from.line - 1).length); } + if (to.ch == getLine(cm.doc, to.line).text.length && to.line < cm.lastLine()) + { to = Pos(to.line + 1, 0); } + if (from.line < display.viewFrom || to.line > display.viewTo - 1) { return false } + + var fromIndex, fromLine, fromNode; + if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) { + fromLine = lineNo(display.view[0].line); + fromNode = display.view[0].node; + } else { + fromLine = lineNo(display.view[fromIndex].line); + fromNode = display.view[fromIndex - 1].node.nextSibling; + } + var toIndex = findViewIndex(cm, to.line); + var toLine, toNode; + if (toIndex == display.view.length - 1) { + toLine = display.viewTo - 1; + toNode = display.lineDiv.lastChild; + } else { + toLine = lineNo(display.view[toIndex + 1].line) - 1; + toNode = display.view[toIndex + 1].node.previousSibling; + } + + if (!fromNode) { return false } + var newText = cm.doc.splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine)); + var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length)); + while (newText.length > 1 && oldText.length > 1) { + if (lst(newText) == lst(oldText)) { newText.pop(); oldText.pop(); toLine--; } + else if (newText[0] == oldText[0]) { newText.shift(); oldText.shift(); fromLine++; } + else { break } + } + + var cutFront = 0, cutEnd = 0; + var newTop = newText[0], oldTop = oldText[0], maxCutFront = Math.min(newTop.length, oldTop.length); + while (cutFront < maxCutFront && newTop.charCodeAt(cutFront) == oldTop.charCodeAt(cutFront)) + { ++cutFront; } + var newBot = lst(newText), oldBot = lst(oldText); + var maxCutEnd = Math.min(newBot.length - (newText.length == 1 ? cutFront : 0), + oldBot.length - (oldText.length == 1 ? cutFront : 0)); + while (cutEnd < maxCutEnd && + newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) + { ++cutEnd; } + // Try to move start of change to start of selection if ambiguous + if (newText.length == 1 && oldText.length == 1 && fromLine == from.line) { + while (cutFront && cutFront > from.ch && + newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) { + cutFront--; + cutEnd++; + } + } + + newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd).replace(/^\u200b+/, ""); + newText[0] = newText[0].slice(cutFront).replace(/\u200b+$/, ""); + + var chFrom = Pos(fromLine, cutFront); + var chTo = Pos(toLine, oldText.length ? lst(oldText).length - cutEnd : 0); + if (newText.length > 1 || newText[0] || cmp(chFrom, chTo)) { + replaceRange(cm.doc, newText, chFrom, chTo, "+input"); + return true + } + }; + + ContentEditableInput.prototype.ensurePolled = function () { + this.forceCompositionEnd(); + }; + ContentEditableInput.prototype.reset = function () { + this.forceCompositionEnd(); + }; + ContentEditableInput.prototype.forceCompositionEnd = function () { + if (!this.composing) { return } + clearTimeout(this.readDOMTimeout); + this.composing = null; + this.updateFromDOM(); + this.div.blur(); + this.div.focus(); + }; + ContentEditableInput.prototype.readFromDOMSoon = function () { + var this$1 = this; + + if (this.readDOMTimeout != null) { return } + this.readDOMTimeout = setTimeout(function () { + this$1.readDOMTimeout = null; + if (this$1.composing) { + if (this$1.composing.done) { this$1.composing = null; } + else { return } + } + this$1.updateFromDOM(); + }, 80); + }; + + ContentEditableInput.prototype.updateFromDOM = function () { + var this$1 = this; + + if (this.cm.isReadOnly() || !this.pollContent()) + { runInOp(this.cm, function () { return regChange(this$1.cm); }); } + }; + + ContentEditableInput.prototype.setUneditable = function (node) { + node.contentEditable = "false"; + }; + + ContentEditableInput.prototype.onKeyPress = function (e) { + if (e.charCode == 0 || this.composing) { return } + e.preventDefault(); + if (!this.cm.isReadOnly()) + { operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0); } + }; + + ContentEditableInput.prototype.readOnlyChanged = function (val) { + this.div.contentEditable = String(val != "nocursor"); + }; + + ContentEditableInput.prototype.onContextMenu = function () {}; + ContentEditableInput.prototype.resetPosition = function () {}; + + ContentEditableInput.prototype.needsContentAttribute = true; + + function posToDOM(cm, pos) { + var view = findViewForLine(cm, pos.line); + if (!view || view.hidden) { return null } + var line = getLine(cm.doc, pos.line); + var info = mapFromLineView(view, line, pos.line); + + var order = getOrder(line, cm.doc.direction), side = "left"; + if (order) { + var partPos = getBidiPartAt(order, pos.ch); + side = partPos % 2 ? "right" : "left"; + } + var result = nodeAndOffsetInLineMap(info.map, pos.ch, side); + result.offset = result.collapse == "right" ? result.end : result.start; + return result + } + + function isInGutter(node) { + for (var scan = node; scan; scan = scan.parentNode) + { if (/CodeMirror-gutter-wrapper/.test(scan.className)) { return true } } + return false + } + + function badPos(pos, bad) { if (bad) { pos.bad = true; } return pos } + + function domTextBetween(cm, from, to, fromLine, toLine) { + var text = "", closing = false, lineSep = cm.doc.lineSeparator(), extraLinebreak = false; + function recognizeMarker(id) { return function (marker) { return marker.id == id; } } + function close() { + if (closing) { + text += lineSep; + if (extraLinebreak) { text += lineSep; } + closing = extraLinebreak = false; + } + } + function addText(str) { + if (str) { + close(); + text += str; + } + } + function walk(node) { + if (node.nodeType == 1) { + var cmText = node.getAttribute("cm-text"); + if (cmText) { + addText(cmText); + return + } + var markerID = node.getAttribute("cm-marker"), range; + if (markerID) { + var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID)); + if (found.length && (range = found[0].find(0))) + { addText(getBetween(cm.doc, range.from, range.to).join(lineSep)); } + return + } + if (node.getAttribute("contenteditable") == "false") { return } + var isBlock = /^(pre|div|p|li|table|br)$/i.test(node.nodeName); + if (!/^br$/i.test(node.nodeName) && node.textContent.length == 0) { return } + + if (isBlock) { close(); } + for (var i = 0; i < node.childNodes.length; i++) + { walk(node.childNodes[i]); } + + if (/^(pre|p)$/i.test(node.nodeName)) { extraLinebreak = true; } + if (isBlock) { closing = true; } + } else if (node.nodeType == 3) { + addText(node.nodeValue.replace(/\u200b/g, "").replace(/\u00a0/g, " ")); + } + } + for (;;) { + walk(from); + if (from == to) { break } + from = from.nextSibling; + extraLinebreak = false; + } + return text + } + + function domToPos(cm, node, offset) { + var lineNode; + if (node == cm.display.lineDiv) { + lineNode = cm.display.lineDiv.childNodes[offset]; + if (!lineNode) { return badPos(cm.clipPos(Pos(cm.display.viewTo - 1)), true) } + node = null; offset = 0; + } else { + for (lineNode = node;; lineNode = lineNode.parentNode) { + if (!lineNode || lineNode == cm.display.lineDiv) { return null } + if (lineNode.parentNode && lineNode.parentNode == cm.display.lineDiv) { break } + } + } + for (var i = 0; i < cm.display.view.length; i++) { + var lineView = cm.display.view[i]; + if (lineView.node == lineNode) + { return locateNodeInLineView(lineView, node, offset) } + } + } + + function locateNodeInLineView(lineView, node, offset) { + var wrapper = lineView.text.firstChild, bad = false; + if (!node || !contains(wrapper, node)) { return badPos(Pos(lineNo(lineView.line), 0), true) } + if (node == wrapper) { + bad = true; + node = wrapper.childNodes[offset]; + offset = 0; + if (!node) { + var line = lineView.rest ? lst(lineView.rest) : lineView.line; + return badPos(Pos(lineNo(line), line.text.length), bad) + } + } + + var textNode = node.nodeType == 3 ? node : null, topNode = node; + if (!textNode && node.childNodes.length == 1 && node.firstChild.nodeType == 3) { + textNode = node.firstChild; + if (offset) { offset = textNode.nodeValue.length; } + } + while (topNode.parentNode != wrapper) { topNode = topNode.parentNode; } + var measure = lineView.measure, maps = measure.maps; + + function find(textNode, topNode, offset) { + for (var i = -1; i < (maps ? maps.length : 0); i++) { + var map = i < 0 ? measure.map : maps[i]; + for (var j = 0; j < map.length; j += 3) { + var curNode = map[j + 2]; + if (curNode == textNode || curNode == topNode) { + var line = lineNo(i < 0 ? lineView.line : lineView.rest[i]); + var ch = map[j] + offset; + if (offset < 0 || curNode != textNode) { ch = map[j + (offset ? 1 : 0)]; } + return Pos(line, ch) + } + } + } + } + var found = find(textNode, topNode, offset); + if (found) { return badPos(found, bad) } + + // FIXME this is all really shaky. might handle the few cases it needs to handle, but likely to cause problems + for (var after = topNode.nextSibling, dist = textNode ? textNode.nodeValue.length - offset : 0; after; after = after.nextSibling) { + found = find(after, after.firstChild, 0); + if (found) + { return badPos(Pos(found.line, found.ch - dist), bad) } + else + { dist += after.textContent.length; } + } + for (var before = topNode.previousSibling, dist$1 = offset; before; before = before.previousSibling) { + found = find(before, before.firstChild, -1); + if (found) + { return badPos(Pos(found.line, found.ch + dist$1), bad) } + else + { dist$1 += before.textContent.length; } + } + } + + // TEXTAREA INPUT STYLE + + var TextareaInput = function(cm) { + this.cm = cm; + // See input.poll and input.reset + this.prevInput = ""; + + // Flag that indicates whether we expect input to appear real soon + // now (after some event like 'keypress' or 'input') and are + // polling intensively. + this.pollingFast = false; + // Self-resetting timeout for the poller + this.polling = new Delayed(); + // Used to work around IE issue with selection being forgotten when focus moves away from textarea + this.hasSelection = false; + this.composing = null; + this.resetting = false; + }; + + TextareaInput.prototype.init = function (display) { + var this$1 = this; + + var input = this, cm = this.cm; + this.createField(display); + var te = this.textarea; + + display.wrapper.insertBefore(this.wrapper, display.wrapper.firstChild); + + // Needed to hide big blue blinking cursor on Mobile Safari (doesn't seem to work in iOS 8 anymore) + if (ios) { te.style.width = "0px"; } + + on(te, "input", function () { + if (ie && ie_version >= 9 && this$1.hasSelection) { this$1.hasSelection = null; } + input.poll(); + }); + + on(te, "paste", function (e) { + if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return } + + cm.state.pasteIncoming = +new Date; + input.fastPoll(); + }); + + function prepareCopyCut(e) { + if (signalDOMEvent(cm, e)) { return } + if (cm.somethingSelected()) { + setLastCopied({lineWise: false, text: cm.getSelections()}); + } else if (!cm.options.lineWiseCopyCut) { + return + } else { + var ranges = copyableRanges(cm); + setLastCopied({lineWise: true, text: ranges.text}); + if (e.type == "cut") { + cm.setSelections(ranges.ranges, null, sel_dontScroll); + } else { + input.prevInput = ""; + te.value = ranges.text.join("\n"); + selectInput(te); + } + } + if (e.type == "cut") { cm.state.cutIncoming = +new Date; } + } + on(te, "cut", prepareCopyCut); + on(te, "copy", prepareCopyCut); + + on(display.scroller, "paste", function (e) { + if (eventInWidget(display, e) || signalDOMEvent(cm, e)) { return } + if (!te.dispatchEvent) { + cm.state.pasteIncoming = +new Date; + input.focus(); + return + } + + // Pass the `paste` event to the textarea so it's handled by its event listener. + var event = new Event("paste"); + event.clipboardData = e.clipboardData; + te.dispatchEvent(event); + }); + + // Prevent normal selection in the editor (we handle our own) + on(display.lineSpace, "selectstart", function (e) { + if (!eventInWidget(display, e)) { e_preventDefault(e); } + }); + + on(te, "compositionstart", function () { + var start = cm.getCursor("from"); + if (input.composing) { input.composing.range.clear(); } + input.composing = { + start: start, + range: cm.markText(start, cm.getCursor("to"), {className: "CodeMirror-composing"}) + }; + }); + on(te, "compositionend", function () { + if (input.composing) { + input.poll(); + input.composing.range.clear(); + input.composing = null; + } + }); + }; + + TextareaInput.prototype.createField = function (_display) { + // Wraps and hides input textarea + this.wrapper = hiddenTextarea(); + // The semihidden textarea that is focused when the editor is + // focused, and receives input. + this.textarea = this.wrapper.firstChild; + var opts = this.cm.options; + disableBrowserMagic(this.textarea, opts.spellcheck, opts.autocorrect, opts.autocapitalize); + }; + + TextareaInput.prototype.screenReaderLabelChanged = function (label) { + // Label for screenreaders, accessibility + if(label) { + this.textarea.setAttribute('aria-label', label); + } else { + this.textarea.removeAttribute('aria-label'); + } + }; + + TextareaInput.prototype.prepareSelection = function () { + // Redraw the selection and/or cursor + var cm = this.cm, display = cm.display, doc = cm.doc; + var result = prepareSelection(cm); + + // Move the hidden textarea near the cursor to prevent scrolling artifacts + if (cm.options.moveInputWithCursor) { + var headPos = cursorCoords(cm, doc.sel.primary().head, "div"); + var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect(); + result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10, + headPos.top + lineOff.top - wrapOff.top)); + result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10, + headPos.left + lineOff.left - wrapOff.left)); + } + + return result + }; + + TextareaInput.prototype.showSelection = function (drawn) { + var cm = this.cm, display = cm.display; + removeChildrenAndAdd(display.cursorDiv, drawn.cursors); + removeChildrenAndAdd(display.selectionDiv, drawn.selection); + if (drawn.teTop != null) { + this.wrapper.style.top = drawn.teTop + "px"; + this.wrapper.style.left = drawn.teLeft + "px"; + } + }; + + // Reset the input to correspond to the selection (or to be empty, + // when not typing and nothing is selected) + TextareaInput.prototype.reset = function (typing) { + if (this.contextMenuPending || this.composing && typing) { return } + var cm = this.cm; + this.resetting = true; + if (cm.somethingSelected()) { + this.prevInput = ""; + var content = cm.getSelection(); + this.textarea.value = content; + if (cm.state.focused) { selectInput(this.textarea); } + if (ie && ie_version >= 9) { this.hasSelection = content; } + } else if (!typing) { + this.prevInput = this.textarea.value = ""; + if (ie && ie_version >= 9) { this.hasSelection = null; } + } + this.resetting = false; + }; + + TextareaInput.prototype.getField = function () { return this.textarea }; + + TextareaInput.prototype.supportsTouch = function () { return false }; + + TextareaInput.prototype.focus = function () { + if (this.cm.options.readOnly != "nocursor" && (!mobile || activeElt(rootNode(this.textarea)) != this.textarea)) { + try { this.textarea.focus(); } + catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM + } + }; + + TextareaInput.prototype.blur = function () { this.textarea.blur(); }; + + TextareaInput.prototype.resetPosition = function () { + this.wrapper.style.top = this.wrapper.style.left = 0; + }; + + TextareaInput.prototype.receivedFocus = function () { this.slowPoll(); }; + + // Poll for input changes, using the normal rate of polling. This + // runs as long as the editor is focused. + TextareaInput.prototype.slowPoll = function () { + var this$1 = this; + + if (this.pollingFast) { return } + this.polling.set(this.cm.options.pollInterval, function () { + this$1.poll(); + if (this$1.cm.state.focused) { this$1.slowPoll(); } + }); + }; + + // When an event has just come in that is likely to add or change + // something in the input textarea, we poll faster, to ensure that + // the change appears on the screen quickly. + TextareaInput.prototype.fastPoll = function () { + var missed = false, input = this; + input.pollingFast = true; + function p() { + var changed = input.poll(); + if (!changed && !missed) {missed = true; input.polling.set(60, p);} + else {input.pollingFast = false; input.slowPoll();} + } + input.polling.set(20, p); + }; + + // Read input from the textarea, and update the document to match. + // When something is selected, it is present in the textarea, and + // selected (unless it is huge, in which case a placeholder is + // used). When nothing is selected, the cursor sits after previously + // seen text (can be empty), which is stored in prevInput (we must + // not reset the textarea when typing, because that breaks IME). + TextareaInput.prototype.poll = function () { + var this$1 = this; + + var cm = this.cm, input = this.textarea, prevInput = this.prevInput; + // Since this is called a *lot*, try to bail out as cheaply as + // possible when it is clear that nothing happened. hasSelection + // will be the case when there is a lot of text in the textarea, + // in which case reading its value would be expensive. + if (this.contextMenuPending || this.resetting || !cm.state.focused || + (hasSelection(input) && !prevInput && !this.composing) || + cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq) + { return false } + + var text = input.value; + // If nothing changed, bail. + if (text == prevInput && !cm.somethingSelected()) { return false } + // Work around nonsensical selection resetting in IE9/10, and + // inexplicable appearance of private area unicode characters on + // some key combos in Mac (#2689). + if (ie && ie_version >= 9 && this.hasSelection === text || + mac && /[\uf700-\uf7ff]/.test(text)) { + cm.display.input.reset(); + return false + } + + if (cm.doc.sel == cm.display.selForContextMenu) { + var first = text.charCodeAt(0); + if (first == 0x200b && !prevInput) { prevInput = "\u200b"; } + if (first == 0x21da) { this.reset(); return this.cm.execCommand("undo") } + } + // Find the part of the input that is actually new + var same = 0, l = Math.min(prevInput.length, text.length); + while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) { ++same; } + + runInOp(cm, function () { + applyTextInput(cm, text.slice(same), prevInput.length - same, + null, this$1.composing ? "*compose" : null); + + // Don't leave long text in the textarea, since it makes further polling slow + if (text.length > 1000 || text.indexOf("\n") > -1) { input.value = this$1.prevInput = ""; } + else { this$1.prevInput = text; } + + if (this$1.composing) { + this$1.composing.range.clear(); + this$1.composing.range = cm.markText(this$1.composing.start, cm.getCursor("to"), + {className: "CodeMirror-composing"}); + } + }); + return true + }; + + TextareaInput.prototype.ensurePolled = function () { + if (this.pollingFast && this.poll()) { this.pollingFast = false; } + }; + + TextareaInput.prototype.onKeyPress = function () { + if (ie && ie_version >= 9) { this.hasSelection = null; } + this.fastPoll(); + }; + + TextareaInput.prototype.onContextMenu = function (e) { + var input = this, cm = input.cm, display = cm.display, te = input.textarea; + if (input.contextMenuPending) { input.contextMenuPending(); } + var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop; + if (!pos || presto) { return } // Opera is difficult. + + // Reset the current text selection only if the click is done outside of the selection + // and 'resetSelectionOnContextMenu' option is true. + var reset = cm.options.resetSelectionOnContextMenu; + if (reset && cm.doc.sel.contains(pos) == -1) + { operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll); } + + var oldCSS = te.style.cssText, oldWrapperCSS = input.wrapper.style.cssText; + var wrapperBox = input.wrapper.offsetParent.getBoundingClientRect(); + input.wrapper.style.cssText = "position: static"; + te.style.cssText = "position: absolute; width: 30px; height: 30px;\n top: " + (e.clientY - wrapperBox.top - 5) + "px; left: " + (e.clientX - wrapperBox.left - 5) + "px;\n z-index: 1000; background: " + (ie ? "rgba(255, 255, 255, .05)" : "transparent") + ";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);"; + var oldScrollY; + if (webkit) { oldScrollY = te.ownerDocument.defaultView.scrollY; } // Work around Chrome issue (#2712) + display.input.focus(); + if (webkit) { te.ownerDocument.defaultView.scrollTo(null, oldScrollY); } + display.input.reset(); + // Adds "Select all" to context menu in FF + if (!cm.somethingSelected()) { te.value = input.prevInput = " "; } + input.contextMenuPending = rehide; + display.selForContextMenu = cm.doc.sel; + clearTimeout(display.detectingSelectAll); + + // Select-all will be greyed out if there's nothing to select, so + // this adds a zero-width space so that we can later check whether + // it got selected. + function prepareSelectAllHack() { + if (te.selectionStart != null) { + var selected = cm.somethingSelected(); + var extval = "\u200b" + (selected ? te.value : ""); + te.value = "\u21da"; // Used to catch context-menu undo + te.value = extval; + input.prevInput = selected ? "" : "\u200b"; + te.selectionStart = 1; te.selectionEnd = extval.length; + // Re-set this, in case some other handler touched the + // selection in the meantime. + display.selForContextMenu = cm.doc.sel; + } + } + function rehide() { + if (input.contextMenuPending != rehide) { return } + input.contextMenuPending = false; + input.wrapper.style.cssText = oldWrapperCSS; + te.style.cssText = oldCSS; + if (ie && ie_version < 9) { display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos); } + + // Try to detect the user choosing select-all + if (te.selectionStart != null) { + if (!ie || (ie && ie_version < 9)) { prepareSelectAllHack(); } + var i = 0, poll = function () { + if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 && + te.selectionEnd > 0 && input.prevInput == "\u200b") { + operation(cm, selectAll)(cm); + } else if (i++ < 10) { + display.detectingSelectAll = setTimeout(poll, 500); + } else { + display.selForContextMenu = null; + display.input.reset(); + } + }; + display.detectingSelectAll = setTimeout(poll, 200); + } + } + + if (ie && ie_version >= 9) { prepareSelectAllHack(); } + if (captureRightClick) { + e_stop(e); + var mouseup = function () { + off(window, "mouseup", mouseup); + setTimeout(rehide, 20); + }; + on(window, "mouseup", mouseup); + } else { + setTimeout(rehide, 50); + } + }; + + TextareaInput.prototype.readOnlyChanged = function (val) { + if (!val) { this.reset(); } + this.textarea.disabled = val == "nocursor"; + this.textarea.readOnly = !!val; + }; + + TextareaInput.prototype.setUneditable = function () {}; + + TextareaInput.prototype.needsContentAttribute = false; + + function fromTextArea(textarea, options) { + options = options ? copyObj(options) : {}; + options.value = textarea.value; + if (!options.tabindex && textarea.tabIndex) + { options.tabindex = textarea.tabIndex; } + if (!options.placeholder && textarea.placeholder) + { options.placeholder = textarea.placeholder; } + // Set autofocus to true if this textarea is focused, or if it has + // autofocus and no other element is focused. + if (options.autofocus == null) { + var hasFocus = activeElt(rootNode(textarea)); + options.autofocus = hasFocus == textarea || + textarea.getAttribute("autofocus") != null && hasFocus == document.body; + } + + function save() {textarea.value = cm.getValue();} + + var realSubmit; + if (textarea.form) { + on(textarea.form, "submit", save); + // Deplorable hack to make the submit method do the right thing. + if (!options.leaveSubmitMethodAlone) { + var form = textarea.form; + realSubmit = form.submit; + try { + var wrappedSubmit = form.submit = function () { + save(); + form.submit = realSubmit; + form.submit(); + form.submit = wrappedSubmit; + }; + } catch(e) {} + } + } + + options.finishInit = function (cm) { + cm.save = save; + cm.getTextArea = function () { return textarea; }; + cm.toTextArea = function () { + cm.toTextArea = isNaN; // Prevent this from being ran twice + save(); + textarea.parentNode.removeChild(cm.getWrapperElement()); + textarea.style.display = ""; + if (textarea.form) { + off(textarea.form, "submit", save); + if (!options.leaveSubmitMethodAlone && typeof textarea.form.submit == "function") + { textarea.form.submit = realSubmit; } + } + }; + }; + + textarea.style.display = "none"; + var cm = CodeMirror(function (node) { return textarea.parentNode.insertBefore(node, textarea.nextSibling); }, + options); + return cm + } + + function addLegacyProps(CodeMirror) { + CodeMirror.off = off; + CodeMirror.on = on; + CodeMirror.wheelEventPixels = wheelEventPixels; + CodeMirror.Doc = Doc; + CodeMirror.splitLines = splitLinesAuto; + CodeMirror.countColumn = countColumn; + CodeMirror.findColumn = findColumn; + CodeMirror.isWordChar = isWordCharBasic; + CodeMirror.Pass = Pass; + CodeMirror.signal = signal; + CodeMirror.Line = Line; + CodeMirror.changeEnd = changeEnd; + CodeMirror.scrollbarModel = scrollbarModel; + CodeMirror.Pos = Pos; + CodeMirror.cmpPos = cmp; + CodeMirror.modes = modes; + CodeMirror.mimeModes = mimeModes; + CodeMirror.resolveMode = resolveMode; + CodeMirror.getMode = getMode; + CodeMirror.modeExtensions = modeExtensions; + CodeMirror.extendMode = extendMode; + CodeMirror.copyState = copyState; + CodeMirror.startState = startState; + CodeMirror.innerMode = innerMode; + CodeMirror.commands = commands; + CodeMirror.keyMap = keyMap; + CodeMirror.keyName = keyName; + CodeMirror.isModifierKey = isModifierKey; + CodeMirror.lookupKey = lookupKey; + CodeMirror.normalizeKeyMap = normalizeKeyMap; + CodeMirror.StringStream = StringStream; + CodeMirror.SharedTextMarker = SharedTextMarker; + CodeMirror.TextMarker = TextMarker; + CodeMirror.LineWidget = LineWidget; + CodeMirror.e_preventDefault = e_preventDefault; + CodeMirror.e_stopPropagation = e_stopPropagation; + CodeMirror.e_stop = e_stop; + CodeMirror.addClass = addClass; + CodeMirror.contains = contains; + CodeMirror.rmClass = rmClass; + CodeMirror.keyNames = keyNames; + } + + // EDITOR CONSTRUCTOR + + defineOptions(CodeMirror); + + addEditorMethods(CodeMirror); + + // Set up methods on CodeMirror's prototype to redirect to the editor's document. + var dontDelegate = "iter insert remove copy getEditor constructor".split(" "); + for (var prop in Doc.prototype) { if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0) + { CodeMirror.prototype[prop] = (function(method) { + return function() {return method.apply(this.doc, arguments)} + })(Doc.prototype[prop]); } } + + eventMixin(Doc); + CodeMirror.inputStyles = {"textarea": TextareaInput, "contenteditable": ContentEditableInput}; + + // Extra arguments are stored as the mode's dependencies, which is + // used by (legacy) mechanisms like loadmode.js to automatically + // load a mode. (Preferred mechanism is the require/define calls.) + CodeMirror.defineMode = function(name/*, mode, …*/) { + if (!CodeMirror.defaults.mode && name != "null") { CodeMirror.defaults.mode = name; } + defineMode.apply(this, arguments); + }; + + CodeMirror.defineMIME = defineMIME; + + // Minimal default mode. + CodeMirror.defineMode("null", function () { return ({token: function (stream) { return stream.skipToEnd(); }}); }); + CodeMirror.defineMIME("text/plain", "null"); + + // EXTENSIONS + + CodeMirror.defineExtension = function (name, func) { + CodeMirror.prototype[name] = func; + }; + CodeMirror.defineDocExtension = function (name, func) { + Doc.prototype[name] = func; + }; + + CodeMirror.fromTextArea = fromTextArea; + + addLegacyProps(CodeMirror); + + CodeMirror.version = "5.65.18"; + + return CodeMirror; + +}))); diff --git a/webui/ipkvm/static/js/vendor/codemirror/toml/index.html b/webui/ipkvm/static/js/vendor/codemirror/toml/index.html new file mode 100644 index 0000000..21bb12d --- /dev/null +++ b/webui/ipkvm/static/js/vendor/codemirror/toml/index.html @@ -0,0 +1,73 @@ + + +CodeMirror: TOML Mode + + + + + + + + + +
+

TOML Mode

+
+ +

The TOML Mode

+

Created by Forbes Lindesay.

+

MIME type defined: text/x-toml.

+
diff --git a/webui/ipkvm/static/js/vendor/codemirror/toml/toml.js b/webui/ipkvm/static/js/vendor/codemirror/toml/toml.js new file mode 100644 index 0000000..ee0c239 --- /dev/null +++ b/webui/ipkvm/static/js/vendor/codemirror/toml/toml.js @@ -0,0 +1,88 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: https://codemirror.net/5/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("toml", function () { + return { + startState: function () { + return { + inString: false, + stringType: "", + lhs: true, + inArray: 0 + }; + }, + token: function (stream, state) { + //check for state changes + if (!state.inString && ((stream.peek() == '"') || (stream.peek() == "'"))) { + state.stringType = stream.peek(); + stream.next(); // Skip quote + state.inString = true; // Update state + } + if (stream.sol() && state.inArray === 0) { + state.lhs = true; + } + //return state + if (state.inString) { + while (state.inString && !stream.eol()) { + if (stream.peek() === state.stringType) { + stream.next(); // Skip quote + state.inString = false; // Clear flag + } else if (stream.peek() === '\\') { + stream.next(); + stream.next(); + } else { + stream.match(/^.[^\\\"\']*/); + } + } + return state.lhs ? "property string" : "string"; // Token style + } else if (state.inArray && stream.peek() === ']') { + stream.next(); + state.inArray--; + return 'bracket'; + } else if (state.lhs && stream.peek() === '[' && stream.skipTo(']')) { + stream.next();//skip closing ] + // array of objects has an extra open & close [] + if (stream.peek() === ']') stream.next(); + return "atom"; + } else if (stream.peek() === "#") { + stream.skipToEnd(); + return "comment"; + } else if (stream.eatSpace()) { + return null; + } else if (state.lhs && stream.eatWhile(function (c) { return c != '=' && c != ' '; })) { + return "property"; + } else if (state.lhs && stream.peek() === "=") { + stream.next(); + state.lhs = false; + return null; + } else if (!state.lhs && stream.match(/^\d\d\d\d[\d\-\:\.T]*Z/)) { + return 'atom'; //date + } else if (!state.lhs && (stream.match('true') || stream.match('false'))) { + return 'atom'; + } else if (!state.lhs && stream.peek() === '[') { + state.inArray++; + stream.next(); + return 'bracket'; + } else if (!state.lhs && stream.match(/^\-?\d+(?:\.\d+)?/)) { + return 'number'; + } else if (!stream.eatSpace()) { + stream.next(); + } + return null; + } + }; +}); + +CodeMirror.defineMIME('text/x-toml', 'toml'); + +}); diff --git a/webui/ipkvm/static/js/vendor/handsontable/handsontable.full.min.js b/webui/ipkvm/static/js/vendor/handsontable/handsontable.full.min.js new file mode 100755 index 0000000..098750d --- /dev/null +++ b/webui/ipkvm/static/js/vendor/handsontable/handsontable.full.min.js @@ -0,0 +1,1180 @@ +/*! + * Copyright (c) HANDSONCODE sp. z o. o. + * + * HANDSONTABLE is a software distributed by HANDSONCODE sp. z o. o., a Polish corporation based in + * Gdynia, Poland, at Aleja Zwyciestwa 96-98, registered by the District Court in Gdansk under number + * 538651, EU tax ID number: PL5862294002, share capital: PLN 62,800.00. + * + * This software is protected by applicable copyright laws, including international treaties, and dual- + * licensed - depending on whether your use for commercial purposes, meaning intended for or + * resulting in commercial advantage or monetary compensation, or not. + * + * If your use is strictly personal or solely for evaluation purposes, meaning for the purposes of testing + * the suitability, performance, and usefulness of this software outside the production environment, + * you agree to be bound by the terms included in the "handsontable-non-commercial-license.pdf" file. + * + * Your use of this software for commercial purposes is subject to the terms included in an applicable + * license agreement. + * + * In any case, you must not make any such use of this software as to develop software which may be + * considered competitive with this software. + * + * UNLESS EXPRESSLY AGREED OTHERWISE, HANDSONCODE PROVIDES THIS SOFTWARE ON AN "AS IS" + * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, AND IN NO EVENT AND UNDER NO + * LEGAL THEORY, SHALL HANDSONCODE BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY DIRECT, + * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER ARISING FROM + * USE OR INABILITY TO USE THIS SOFTWARE. + * + * Version: 15.1.0 + * Release date: 20/02/2025 (built at 19/02/2025 10:01:18) + */ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Handsontable",[],t):"object"==typeof exports?exports.Handsontable=t():e.Handsontable=t()}("undefined"!=typeof self?self:this,(()=>(()=>{var e={88088:()=>{},98339:(e,t,r)=>{"use strict"; +/*! @license DOMPurify 3.2.4 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.4/LICENSE */const{entries:n,setPrototypeOf:s,isFrozen:i,getPrototypeOf:o,getOwnPropertyDescriptor:a}=Object;let{freeze:l,seal:h,create:u}=Object,{apply:c,construct:d}="undefined"!=typeof Reflect&&Reflect;l||(l=function(e){return e}),h||(h=function(e){return e}),c||(c=function(e,t,r){return e.apply(t,r)}),d||(d=function(e,t){return new e(...t)});const p=b(Array.prototype.forEach),g=b(Array.prototype.lastIndexOf),f=b(Array.prototype.pop),m=b(Array.prototype.push),y=b(Array.prototype.splice),E=b(String.prototype.toLowerCase),w=b(String.prototype.toString),C=b(String.prototype.match),v=b(String.prototype.replace),R=b(String.prototype.indexOf),S=b(String.prototype.trim),T=b(Object.prototype.hasOwnProperty),N=b(RegExp.prototype.test),M=(_=TypeError,function(){for(var e=arguments.length,t=new Array(e),r=0;r1?r-1:0),s=1;s2&&void 0!==arguments[2]?arguments[2]:E;s&&s(e,null);let n=t.length;for(;n--;){let s=t[n];if("string"==typeof s){const e=r(s);e!==s&&(i(t)||(t[n]=e),s=e)}e[s]=!0}return e}function A(e){for(let t=0;t/gm),z=h(/\$\{[\w\W]*/gm),$=h(/^data-[\-\w.\u00B7-\uFFFF]+$/),K=h(/^aria-[\-\w]+$/),X=h(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),q=h(/^(?:\w+script|data):/i),Q=h(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Z=h(/^html$/i),J=h(/^[a-z][.\w]*(-[.\w]+)+$/i);var ee=Object.freeze({__proto__:null,ARIA_ATTR:K,ATTR_WHITESPACE:Q,CUSTOM_ELEMENT:J,DATA_ATTR:$,DOCTYPE_NAME:Z,ERB_EXPR:j,IS_ALLOWED_URI:X,IS_SCRIPT_OR_DATA:q,MUSTACHE_EXPR:G,TMPLIT_EXPR:z});const te=1,re=3,ne=7,se=8,ie=9,oe=function(){return"undefined"==typeof window?null:window};var ae=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:oe();const r=t=>e(t);if(r.version="3.2.4",r.removed=[],!t||!t.document||t.document.nodeType!==ie||!t.Element)return r.isSupported=!1,r;let{document:s}=t;const i=s,o=i.currentScript,{DocumentFragment:a,HTMLTemplateElement:h,Node:c,Element:d,NodeFilter:_,NamedNodeMap:b=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:A,DOMParser:G,trustedTypes:j}=t,z=d.prototype,$=x(z,"cloneNode"),K=x(z,"remove"),q=x(z,"nextSibling"),Q=x(z,"childNodes"),J=x(z,"parentNode");if("function"==typeof h){const e=s.createElement("template");e.content&&e.content.ownerDocument&&(s=e.content.ownerDocument)}let ae,le="";const{implementation:he,createNodeIterator:ue,createDocumentFragment:ce,getElementsByTagName:de}=s,{importNode:pe}=i;let ge={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};r.isSupported="function"==typeof n&&"function"==typeof J&&he&&void 0!==he.createHTMLDocument;const{MUSTACHE_EXPR:fe,ERB_EXPR:me,TMPLIT_EXPR:ye,DATA_ATTR:Ee,ARIA_ATTR:we,IS_SCRIPT_OR_DATA:Ce,ATTR_WHITESPACE:ve,CUSTOM_ELEMENT:Re}=ee;let{IS_ALLOWED_URI:Se}=ee,Te=null;const Ne=O({},[...P,...L,...D,...H,...U]);let Me=null;const _e=O({},[...V,...B,...W,...Y]);let be=Object.seal(u(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Oe=null,Ae=null,Ie=!0,xe=!0,Pe=!1,Le=!0,De=!1,ke=!0,He=!1,Fe=!1,Ue=!1,Ve=!1,Be=!1,We=!1,Ye=!0,Ge=!1,je=!0,ze=!1,$e={},Ke=null;const Xe=O({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let qe=null;const Qe=O({},["audio","video","img","source","image","track"]);let Ze=null;const Je=O({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),et="http://www.w3.org/1998/Math/MathML",tt="http://www.w3.org/2000/svg",rt="http://www.w3.org/1999/xhtml";let nt=rt,st=!1,it=null;const ot=O({},[et,tt,rt],w);let at=O({},["mi","mo","mn","ms","mtext"]),lt=O({},["annotation-xml"]);const ht=O({},["title","style","font","a","script"]);let ut=null;const ct=["application/xhtml+xml","text/html"];let dt=null,pt=null;const gt=s.createElement("form"),ft=function(e){return e instanceof RegExp||e instanceof Function},mt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!pt||pt!==e){if(e&&"object"==typeof e||(e={}),e=I(e),ut=-1===ct.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,dt="application/xhtml+xml"===ut?w:E,Te=T(e,"ALLOWED_TAGS")?O({},e.ALLOWED_TAGS,dt):Ne,Me=T(e,"ALLOWED_ATTR")?O({},e.ALLOWED_ATTR,dt):_e,it=T(e,"ALLOWED_NAMESPACES")?O({},e.ALLOWED_NAMESPACES,w):ot,Ze=T(e,"ADD_URI_SAFE_ATTR")?O(I(Je),e.ADD_URI_SAFE_ATTR,dt):Je,qe=T(e,"ADD_DATA_URI_TAGS")?O(I(Qe),e.ADD_DATA_URI_TAGS,dt):Qe,Ke=T(e,"FORBID_CONTENTS")?O({},e.FORBID_CONTENTS,dt):Xe,Oe=T(e,"FORBID_TAGS")?O({},e.FORBID_TAGS,dt):{},Ae=T(e,"FORBID_ATTR")?O({},e.FORBID_ATTR,dt):{},$e=!!T(e,"USE_PROFILES")&&e.USE_PROFILES,Ie=!1!==e.ALLOW_ARIA_ATTR,xe=!1!==e.ALLOW_DATA_ATTR,Pe=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Le=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,De=e.SAFE_FOR_TEMPLATES||!1,ke=!1!==e.SAFE_FOR_XML,He=e.WHOLE_DOCUMENT||!1,Ve=e.RETURN_DOM||!1,Be=e.RETURN_DOM_FRAGMENT||!1,We=e.RETURN_TRUSTED_TYPE||!1,Ue=e.FORCE_BODY||!1,Ye=!1!==e.SANITIZE_DOM,Ge=e.SANITIZE_NAMED_PROPS||!1,je=!1!==e.KEEP_CONTENT,ze=e.IN_PLACE||!1,Se=e.ALLOWED_URI_REGEXP||X,nt=e.NAMESPACE||rt,at=e.MATHML_TEXT_INTEGRATION_POINTS||at,lt=e.HTML_INTEGRATION_POINTS||lt,be=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&ft(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(be.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&ft(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(be.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(be.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),De&&(xe=!1),Be&&(Ve=!0),$e&&(Te=O({},U),Me=[],!0===$e.html&&(O(Te,P),O(Me,V)),!0===$e.svg&&(O(Te,L),O(Me,B),O(Me,Y)),!0===$e.svgFilters&&(O(Te,D),O(Me,B),O(Me,Y)),!0===$e.mathMl&&(O(Te,H),O(Me,W),O(Me,Y))),e.ADD_TAGS&&(Te===Ne&&(Te=I(Te)),O(Te,e.ADD_TAGS,dt)),e.ADD_ATTR&&(Me===_e&&(Me=I(Me)),O(Me,e.ADD_ATTR,dt)),e.ADD_URI_SAFE_ATTR&&O(Ze,e.ADD_URI_SAFE_ATTR,dt),e.FORBID_CONTENTS&&(Ke===Xe&&(Ke=I(Ke)),O(Ke,e.FORBID_CONTENTS,dt)),je&&(Te["#text"]=!0),He&&O(Te,["html","head","body"]),Te.table&&(O(Te,["tbody"]),delete Oe.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw M('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw M('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');ae=e.TRUSTED_TYPES_POLICY,le=ae.createHTML("")}else void 0===ae&&(ae=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let r=null;const n="data-tt-policy-suffix";t&&t.hasAttribute(n)&&(r=t.getAttribute(n));const s="dompurify"+(r?"#"+r:"");try{return e.createPolicy(s,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+s+" could not be created."),null}}(j,o)),null!==ae&&"string"==typeof le&&(le=ae.createHTML(""));l&&l(e),pt=e}},yt=O({},[...L,...D,...k]),Et=O({},[...H,...F]),wt=function(e){m(r.removed,{element:e});try{J(e).removeChild(e)}catch(t){K(e)}},Ct=function(e,t){try{m(r.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){m(r.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(Ve||Be)try{wt(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},vt=function(e){let t=null,r=null;if(Ue)e=""+e;else{const t=C(e,/^[\r\n\t ]+/);r=t&&t[0]}"application/xhtml+xml"===ut&&nt===rt&&(e=''+e+"");const n=ae?ae.createHTML(e):e;if(nt===rt)try{t=(new G).parseFromString(n,ut)}catch(e){}if(!t||!t.documentElement){t=he.createDocument(nt,"template",null);try{t.documentElement.innerHTML=st?le:n}catch(e){}}const i=t.body||t.documentElement;return e&&r&&i.insertBefore(s.createTextNode(r),i.childNodes[0]||null),nt===rt?de.call(t,He?"html":"body")[0]:He?t.documentElement:i},Rt=function(e){return ue.call(e.ownerDocument||e,e,_.SHOW_ELEMENT|_.SHOW_COMMENT|_.SHOW_TEXT|_.SHOW_PROCESSING_INSTRUCTION|_.SHOW_CDATA_SECTION,null)},St=function(e){return e instanceof A&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof b)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Tt=function(e){return"function"==typeof c&&e instanceof c};function Nt(e,t,n){p(e,(e=>{e.call(r,t,n,pt)}))}const Mt=function(e){let t=null;if(Nt(ge.beforeSanitizeElements,e,null),St(e))return wt(e),!0;const n=dt(e.nodeName);if(Nt(ge.uponSanitizeElement,e,{tagName:n,allowedTags:Te}),e.hasChildNodes()&&!Tt(e.firstElementChild)&&N(/<[/\w]/g,e.innerHTML)&&N(/<[/\w]/g,e.textContent))return wt(e),!0;if(e.nodeType===ne)return wt(e),!0;if(ke&&e.nodeType===se&&N(/<[/\w]/g,e.data))return wt(e),!0;if(!Te[n]||Oe[n]){if(!Oe[n]&&bt(n)){if(be.tagNameCheck instanceof RegExp&&N(be.tagNameCheck,n))return!1;if(be.tagNameCheck instanceof Function&&be.tagNameCheck(n))return!1}if(je&&!Ke[n]){const t=J(e)||e.parentNode,r=Q(e)||e.childNodes;if(r&&t){for(let n=r.length-1;n>=0;--n){const s=$(r[n],!0);s.__removalCount=(e.__removalCount||0)+1,t.insertBefore(s,q(e))}}}return wt(e),!0}return e instanceof d&&!function(e){let t=J(e);t&&t.tagName||(t={namespaceURI:nt,tagName:"template"});const r=E(e.tagName),n=E(t.tagName);return!!it[e.namespaceURI]&&(e.namespaceURI===tt?t.namespaceURI===rt?"svg"===r:t.namespaceURI===et?"svg"===r&&("annotation-xml"===n||at[n]):Boolean(yt[r]):e.namespaceURI===et?t.namespaceURI===rt?"math"===r:t.namespaceURI===tt?"math"===r&<[n]:Boolean(Et[r]):e.namespaceURI===rt?!(t.namespaceURI===tt&&!lt[n])&&!(t.namespaceURI===et&&!at[n])&&!Et[r]&&(ht[r]||!yt[r]):!("application/xhtml+xml"!==ut||!it[e.namespaceURI]))}(e)?(wt(e),!0):"noscript"!==n&&"noembed"!==n&&"noframes"!==n||!N(/<\/no(script|embed|frames)/i,e.innerHTML)?(De&&e.nodeType===re&&(t=e.textContent,p([fe,me,ye],(e=>{t=v(t,e," ")})),e.textContent!==t&&(m(r.removed,{element:e.cloneNode()}),e.textContent=t)),Nt(ge.afterSanitizeElements,e,null),!1):(wt(e),!0)},_t=function(e,t,r){if(Ye&&("id"===t||"name"===t)&&(r in s||r in gt))return!1;if(xe&&!Ae[t]&&N(Ee,t));else if(Ie&&N(we,t));else if(!Me[t]||Ae[t]){if(!(bt(e)&&(be.tagNameCheck instanceof RegExp&&N(be.tagNameCheck,e)||be.tagNameCheck instanceof Function&&be.tagNameCheck(e))&&(be.attributeNameCheck instanceof RegExp&&N(be.attributeNameCheck,t)||be.attributeNameCheck instanceof Function&&be.attributeNameCheck(t))||"is"===t&&be.allowCustomizedBuiltInElements&&(be.tagNameCheck instanceof RegExp&&N(be.tagNameCheck,r)||be.tagNameCheck instanceof Function&&be.tagNameCheck(r))))return!1}else if(Ze[t]);else if(N(Se,v(r,ve,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==R(r,"data:")||!qe[e]){if(Pe&&!N(Ce,v(r,ve,"")));else if(r)return!1}else;return!0},bt=function(e){return"annotation-xml"!==e&&C(e,Re)},Ot=function(e){Nt(ge.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||St(e))return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Me,forceKeepAttr:void 0};let s=t.length;for(;s--;){const i=t[s],{name:o,namespaceURI:a,value:l}=i,h=dt(o);let u="value"===o?l:S(l);if(n.attrName=h,n.attrValue=u,n.keepAttr=!0,n.forceKeepAttr=void 0,Nt(ge.uponSanitizeAttribute,e,n),u=n.attrValue,!Ge||"id"!==h&&"name"!==h||(Ct(o,e),u="user-content-"+u),ke&&N(/((--!?|])>)|<\/(style|title)/i,u)){Ct(o,e);continue}if(n.forceKeepAttr)continue;if(Ct(o,e),!n.keepAttr)continue;if(!Le&&N(/\/>/i,u)){Ct(o,e);continue}De&&p([fe,me,ye],(e=>{u=v(u,e," ")}));const c=dt(e.nodeName);if(_t(c,h,u)){if(ae&&"object"==typeof j&&"function"==typeof j.getAttributeType)if(a);else switch(j.getAttributeType(c,h)){case"TrustedHTML":u=ae.createHTML(u);break;case"TrustedScriptURL":u=ae.createScriptURL(u)}try{a?e.setAttributeNS(a,o,u):e.setAttribute(o,u),St(e)?wt(e):f(r.removed)}catch(e){}}}Nt(ge.afterSanitizeAttributes,e,null)},At=function e(t){let r=null;const n=Rt(t);for(Nt(ge.beforeSanitizeShadowDOM,t,null);r=n.nextNode();)Nt(ge.uponSanitizeShadowNode,r,null),Mt(r),Ot(r),r.content instanceof a&&e(r.content);Nt(ge.afterSanitizeShadowDOM,t,null)};return r.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,s=null,o=null,l=null;if(st=!e,st&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Tt(e)){if("function"!=typeof e.toString)throw M("toString is not a function");if("string"!=typeof(e=e.toString()))throw M("dirty is not a string, aborting")}if(!r.isSupported)return e;if(Fe||mt(t),r.removed=[],"string"==typeof e&&(ze=!1),ze){if(e.nodeName){const t=dt(e.nodeName);if(!Te[t]||Oe[t])throw M("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof c)n=vt("\x3c!----\x3e"),s=n.ownerDocument.importNode(e,!0),s.nodeType===te&&"BODY"===s.nodeName||"HTML"===s.nodeName?n=s:n.appendChild(s);else{if(!Ve&&!De&&!He&&-1===e.indexOf("<"))return ae&&We?ae.createHTML(e):e;if(n=vt(e),!n)return Ve?null:We?le:""}n&&Ue&&wt(n.firstChild);const h=Rt(ze?e:n);for(;o=h.nextNode();)Mt(o),Ot(o),o.content instanceof a&&At(o.content);if(ze)return e;if(Ve){if(Be)for(l=ce.call(n.ownerDocument);n.firstChild;)l.appendChild(n.firstChild);else l=n;return(Me.shadowroot||Me.shadowrootmode)&&(l=pe.call(i,l,!0)),l}let u=He?n.outerHTML:n.innerHTML;return He&&Te["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&N(Z,n.ownerDocument.doctype.name)&&(u="\n"+u),De&&p([fe,me,ye],(e=>{u=v(u,e," ")})),ae&&We?ae.createHTML(u):u},r.setConfig=function(){mt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Fe=!0},r.clearConfig=function(){pt=null,Fe=!1},r.isValidAttribute=function(e,t,r){pt||mt({});const n=dt(e),s=dt(t);return _t(n,s,r)},r.addHook=function(e,t){"function"==typeof t&&m(ge[e],t)},r.removeHook=function(e,t){if(void 0!==t){const r=g(ge[e],t);return-1===r?void 0:y(ge[e],r,1)[0]}return f(ge[e])},r.removeHooks=function(e){ge[e]=[]},r.removeAllHooks=function(){ge={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},r}();e.exports=ae,window.DOMPurify=r(98339)},37086:()=>{},17289:()=>{},65145:()=>{},70872:()=>{},66569:()=>{},90470:()=>{},25819:()=>{},39685:()=>{},73762:()=>{},38906:()=>{},22956:()=>{},11414:()=>{},42516:()=>{},49888:()=>{},63933:()=>{},30718:()=>{},44169:()=>{},96954:()=>{},97417:()=>{},97527:()=>{},92556:()=>{},67105:()=>{},14130:()=>{},18158:()=>{},98952:()=>{},21918:()=>{},53611:()=>{},25496:()=>{},28809:()=>{},7275:()=>{},57306:()=>{},2609:()=>{},82970:()=>{},46192:()=>{},20851:()=>{},97953:()=>{},5137:()=>{},30147:()=>{},49999:()=>{},17778:()=>{},18741:()=>{},75712:()=>{},65431:()=>{},61716:()=>{},61388:()=>{},7858:()=>{},89098:()=>{},55218:()=>{},58713:()=>{},72237:()=>{},31260:()=>{},25485:()=>{},39842:()=>{},4986:()=>{},18691:()=>{},87812:()=>{},28833:()=>{},63434:()=>{},24254:()=>{},87235:()=>{},26074:()=>{},63237:()=>{},58844:()=>{},86937:()=>{},4566:()=>{},5324:()=>{},38728:()=>{},49165:()=>{},17905:()=>{},82759:()=>{},7525:()=>{},77788:()=>{},59427:()=>{},92022:()=>{},88029:()=>{},5881:()=>{},60039:()=>{},45284:()=>{},5909:()=>{},47891:()=>{},52047:()=>{},4163:()=>{},47301:()=>{},46800:()=>{},84122:()=>{},17886:()=>{},11680:()=>{},51101:()=>{},70888:()=>{},18227:()=>{},78629:()=>{},12304:()=>{},45745:()=>{},40847:()=>{},11249:()=>{},45617:()=>{},24532:()=>{},51001:()=>{},77498:()=>{},43793:()=>{},95758:()=>{},34220:()=>{},34646:()=>{},26709:()=>{},37089:()=>{},18271:()=>{},11422:()=>{},67401:()=>{},65775:()=>{},17040:()=>{},40263:()=>{},92764:()=>{},74403:()=>{},65026:()=>{},58830:()=>{},4048:()=>{},86436:()=>{},18505:()=>{},33968:()=>{},63422:()=>{},45441:()=>{},92671:()=>{},4659:()=>{},67956:()=>{},80204:()=>{},65191:()=>{},21949:()=>{},23174:()=>{},19286:()=>{},26158:()=>{},12284:()=>{},14912:()=>{},59357:()=>{},1313:()=>{},73021:()=>{},21312:()=>{},16629:()=>{},6671:function(e,t,r){(e=r.nmd(e)).exports=function(){"use strict";var t,n;function s(){return t.apply(null,arguments)}function i(e){t=e}function o(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function a(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function l(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function h(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(l(e,t))return!1;return!0}function u(e){return void 0===e}function c(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function d(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function p(e,t){var r,n=[],s=e.length;for(r=0;r>>0;for(t=0;t0)for(r=0;r=0?r?"+":"":"-")+Math.pow(10,Math.max(0,s)).toString().substr(1)+n}var H=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,F=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,U={},V={};function B(e,t,r,n){var s=n;"string"==typeof n&&(s=function(){return this[n]()}),e&&(V[e]=s),t&&(V[t[0]]=function(){return k(s.apply(this,arguments),t[1],t[2])}),r&&(V[r]=function(){return this.localeData().ordinal(s.apply(this,arguments),e)})}function W(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function Y(e){var t,r,n=e.match(H);for(t=0,r=n.length;t=0&&F.test(e);)e=e.replace(F,n),F.lastIndex=0,r-=1;return e}var z={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function $(e){var t=this._longDateFormat[e],r=this._longDateFormat[e.toUpperCase()];return t||!r?t:(this._longDateFormat[e]=r.match(H).map((function(e){return"MMMM"===e||"MM"===e||"DD"===e||"dddd"===e?e.slice(1):e})).join(""),this._longDateFormat[e])}var K="Invalid date";function X(){return this._invalidDate}var q="%d",Q=/\d{1,2}/;function Z(e){return this._ordinal.replace("%d",e)}var J={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function ee(e,t,r,n){var s=this._relativeTime[r];return A(s)?s(e,t,r,n):s.replace(/%d/i,e)}function te(e,t){var r=this._relativeTime[e>0?"future":"past"];return A(r)?r(t):r.replace(/%s/i,t)}var re={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function ne(e){return"string"==typeof e?re[e]||re[e.toLowerCase()]:void 0}function se(e){var t,r,n={};for(r in e)l(e,r)&&(t=ne(r))&&(n[t]=e[r]);return n}var ie={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function oe(e){var t,r=[];for(t in e)l(e,t)&&r.push({unit:t,priority:ie[t]});return r.sort((function(e,t){return e.priority-t.priority})),r}var ae,le=/\d/,he=/\d\d/,ue=/\d{3}/,ce=/\d{4}/,de=/[+-]?\d{6}/,pe=/\d\d?/,ge=/\d\d\d\d?/,fe=/\d\d\d\d\d\d?/,me=/\d{1,3}/,ye=/\d{1,4}/,Ee=/[+-]?\d{1,6}/,we=/\d+/,Ce=/[+-]?\d+/,ve=/Z|[+-]\d\d:?\d\d/gi,Re=/Z|[+-]\d\d(?::?\d\d)?/gi,Se=/[+-]?\d+(\.\d{1,3})?/,Te=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Ne=/^[1-9]\d?/,Me=/^([1-9]\d|\d)/;function _e(e,t,r){ae[e]=A(t)?t:function(e,n){return e&&r?r:t}}function be(e,t){return l(ae,e)?ae[e](t._strict,t._locale):new RegExp(Oe(e))}function Oe(e){return Ae(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,(function(e,t,r,n,s){return t||r||n||s})))}function Ae(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Ie(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function xe(e){var t=+e,r=0;return 0!==t&&isFinite(t)&&(r=Ie(t)),r}ae={};var Pe={};function Le(e,t){var r,n,s=t;for("string"==typeof e&&(e=[e]),c(t)&&(s=function(e,r){r[t]=xe(e)}),n=e.length,r=0;r68?1900:2e3)};var Ke,Xe=Qe("FullYear",!0);function qe(){return He(this.year())}function Qe(e,t){return function(r){return null!=r?(Je(this,e,r),s.updateOffset(this,t),this):Ze(this,e)}}function Ze(e,t){if(!e.isValid())return NaN;var r=e._d,n=e._isUTC;switch(t){case"Milliseconds":return n?r.getUTCMilliseconds():r.getMilliseconds();case"Seconds":return n?r.getUTCSeconds():r.getSeconds();case"Minutes":return n?r.getUTCMinutes():r.getMinutes();case"Hours":return n?r.getUTCHours():r.getHours();case"Date":return n?r.getUTCDate():r.getDate();case"Day":return n?r.getUTCDay():r.getDay();case"Month":return n?r.getUTCMonth():r.getMonth();case"FullYear":return n?r.getUTCFullYear():r.getFullYear();default:return NaN}}function Je(e,t,r){var n,s,i,o,a;if(e.isValid()&&!isNaN(r)){switch(n=e._d,s=e._isUTC,t){case"Milliseconds":return void(s?n.setUTCMilliseconds(r):n.setMilliseconds(r));case"Seconds":return void(s?n.setUTCSeconds(r):n.setSeconds(r));case"Minutes":return void(s?n.setUTCMinutes(r):n.setMinutes(r));case"Hours":return void(s?n.setUTCHours(r):n.setHours(r));case"Date":return void(s?n.setUTCDate(r):n.setDate(r));case"FullYear":break;default:return}i=r,o=e.month(),a=29!==(a=e.date())||1!==o||He(i)?a:28,s?n.setUTCFullYear(i,o,a):n.setFullYear(i,o,a)}}function et(e){return A(this[e=ne(e)])?this[e]():this}function tt(e,t){if("object"==typeof e){var r,n=oe(e=se(e)),s=n.length;for(r=0;r=0?(a=new Date(e+400,t,r,n,s,i,o),isFinite(a.getFullYear())&&a.setFullYear(e)):a=new Date(e,t,r,n,s,i,o),a}function Ct(e){var t,r;return e<100&&e>=0?((r=Array.prototype.slice.call(arguments))[0]=e+400,t=new Date(Date.UTC.apply(null,r)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function vt(e,t,r){var n=7+t-r;return-(7+Ct(e,0,n).getUTCDay()-t)%7+n-1}function Rt(e,t,r,n,s){var i,o,a=1+7*(t-1)+(7+r-n)%7+vt(e,n,s);return a<=0?o=$e(i=e-1)+a:a>$e(e)?(i=e+1,o=a-$e(e)):(i=e,o=a),{year:i,dayOfYear:o}}function St(e,t,r){var n,s,i=vt(e.year(),t,r),o=Math.floor((e.dayOfYear()-i-1)/7)+1;return o<1?n=o+Tt(s=e.year()-1,t,r):o>Tt(e.year(),t,r)?(n=o-Tt(e.year(),t,r),s=e.year()+1):(s=e.year(),n=o),{week:n,year:s}}function Tt(e,t,r){var n=vt(e,t,r),s=vt(e+1,t,r);return($e(e)-n+s)/7}function Nt(e){return St(e,this._week.dow,this._week.doy).week}B("w",["ww",2],"wo","week"),B("W",["WW",2],"Wo","isoWeek"),_e("w",pe,Ne),_e("ww",pe,he),_e("W",pe,Ne),_e("WW",pe,he),De(["w","ww","W","WW"],(function(e,t,r,n){t[n.substr(0,1)]=xe(e)}));var Mt={dow:0,doy:6};function _t(){return this._week.dow}function bt(){return this._week.doy}function Ot(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")}function At(e){var t=St(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")}function It(e,t){return"string"!=typeof e?e:isNaN(e)?"number"==typeof(e=t.weekdaysParse(e))?e:null:parseInt(e,10)}function xt(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function Pt(e,t){return e.slice(t,7).concat(e.slice(0,t))}B("d",0,"do","day"),B("dd",0,0,(function(e){return this.localeData().weekdaysMin(this,e)})),B("ddd",0,0,(function(e){return this.localeData().weekdaysShort(this,e)})),B("dddd",0,0,(function(e){return this.localeData().weekdays(this,e)})),B("e",0,0,"weekday"),B("E",0,0,"isoWeekday"),_e("d",pe),_e("e",pe),_e("E",pe),_e("dd",(function(e,t){return t.weekdaysMinRegex(e)})),_e("ddd",(function(e,t){return t.weekdaysShortRegex(e)})),_e("dddd",(function(e,t){return t.weekdaysRegex(e)})),De(["dd","ddd","dddd"],(function(e,t,r,n){var s=r._locale.weekdaysParse(e,n,r._strict);null!=s?t.d=s:y(r).invalidWeekday=e})),De(["d","e","E"],(function(e,t,r,n){t[n]=xe(e)}));var Lt="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Dt="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),kt="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Ht=Te,Ft=Te,Ut=Te;function Vt(e,t){var r=o(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?Pt(r,this._week.dow):e?r[e.day()]:r}function Bt(e){return!0===e?Pt(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function Wt(e){return!0===e?Pt(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function Yt(e,t,r){var n,s,i,o=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)i=f([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(i,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(i,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(i,"").toLocaleLowerCase();return r?"dddd"===t?-1!==(s=Ke.call(this._weekdaysParse,o))?s:null:"ddd"===t?-1!==(s=Ke.call(this._shortWeekdaysParse,o))?s:null:-1!==(s=Ke.call(this._minWeekdaysParse,o))?s:null:"dddd"===t?-1!==(s=Ke.call(this._weekdaysParse,o))||-1!==(s=Ke.call(this._shortWeekdaysParse,o))||-1!==(s=Ke.call(this._minWeekdaysParse,o))?s:null:"ddd"===t?-1!==(s=Ke.call(this._shortWeekdaysParse,o))||-1!==(s=Ke.call(this._weekdaysParse,o))||-1!==(s=Ke.call(this._minWeekdaysParse,o))?s:null:-1!==(s=Ke.call(this._minWeekdaysParse,o))||-1!==(s=Ke.call(this._weekdaysParse,o))||-1!==(s=Ke.call(this._shortWeekdaysParse,o))?s:null}function Gt(e,t,r){var n,s,i;if(this._weekdaysParseExact)return Yt.call(this,e,t,r);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(s=f([2e3,1]).day(n),r&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(s,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(s,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(s,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(i="^"+this.weekdays(s,"")+"|^"+this.weekdaysShort(s,"")+"|^"+this.weekdaysMin(s,""),this._weekdaysParse[n]=new RegExp(i.replace(".",""),"i")),r&&"dddd"===t&&this._fullWeekdaysParse[n].test(e))return n;if(r&&"ddd"===t&&this._shortWeekdaysParse[n].test(e))return n;if(r&&"dd"===t&&this._minWeekdaysParse[n].test(e))return n;if(!r&&this._weekdaysParse[n].test(e))return n}}function jt(e){if(!this.isValid())return null!=e?this:NaN;var t=Ze(this,"Day");return null!=e?(e=It(e,this.localeData()),this.add(e-t,"d")):t}function zt(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")}function $t(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=xt(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7}function Kt(e){return this._weekdaysParseExact?(l(this,"_weekdaysRegex")||Qt.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(l(this,"_weekdaysRegex")||(this._weekdaysRegex=Ht),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function Xt(e){return this._weekdaysParseExact?(l(this,"_weekdaysRegex")||Qt.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(l(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Ft),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function qt(e){return this._weekdaysParseExact?(l(this,"_weekdaysRegex")||Qt.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(l(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Ut),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Qt(){function e(e,t){return t.length-e.length}var t,r,n,s,i,o=[],a=[],l=[],h=[];for(t=0;t<7;t++)r=f([2e3,1]).day(t),n=Ae(this.weekdaysMin(r,"")),s=Ae(this.weekdaysShort(r,"")),i=Ae(this.weekdays(r,"")),o.push(n),a.push(s),l.push(i),h.push(n),h.push(s),h.push(i);o.sort(e),a.sort(e),l.sort(e),h.sort(e),this._weekdaysRegex=new RegExp("^("+h.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+o.join("|")+")","i")}function Zt(){return this.hours()%12||12}function Jt(){return this.hours()||24}function er(e,t){B(e,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)}))}function tr(e,t){return t._meridiemParse}function rr(e){return"p"===(e+"").toLowerCase().charAt(0)}B("H",["HH",2],0,"hour"),B("h",["hh",2],0,Zt),B("k",["kk",2],0,Jt),B("hmm",0,0,(function(){return""+Zt.apply(this)+k(this.minutes(),2)})),B("hmmss",0,0,(function(){return""+Zt.apply(this)+k(this.minutes(),2)+k(this.seconds(),2)})),B("Hmm",0,0,(function(){return""+this.hours()+k(this.minutes(),2)})),B("Hmmss",0,0,(function(){return""+this.hours()+k(this.minutes(),2)+k(this.seconds(),2)})),er("a",!0),er("A",!1),_e("a",tr),_e("A",tr),_e("H",pe,Me),_e("h",pe,Ne),_e("k",pe,Ne),_e("HH",pe,he),_e("hh",pe,he),_e("kk",pe,he),_e("hmm",ge),_e("hmmss",fe),_e("Hmm",ge),_e("Hmmss",fe),Le(["H","HH"],Be),Le(["k","kk"],(function(e,t,r){var n=xe(e);t[Be]=24===n?0:n})),Le(["a","A"],(function(e,t,r){r._isPm=r._locale.isPM(e),r._meridiem=e})),Le(["h","hh"],(function(e,t,r){t[Be]=xe(e),y(r).bigHour=!0})),Le("hmm",(function(e,t,r){var n=e.length-2;t[Be]=xe(e.substr(0,n)),t[We]=xe(e.substr(n)),y(r).bigHour=!0})),Le("hmmss",(function(e,t,r){var n=e.length-4,s=e.length-2;t[Be]=xe(e.substr(0,n)),t[We]=xe(e.substr(n,2)),t[Ye]=xe(e.substr(s)),y(r).bigHour=!0})),Le("Hmm",(function(e,t,r){var n=e.length-2;t[Be]=xe(e.substr(0,n)),t[We]=xe(e.substr(n))})),Le("Hmmss",(function(e,t,r){var n=e.length-4,s=e.length-2;t[Be]=xe(e.substr(0,n)),t[We]=xe(e.substr(n,2)),t[Ye]=xe(e.substr(s))}));var nr=/[ap]\.?m?\.?/i,sr=Qe("Hours",!0);function ir(e,t,r){return e>11?r?"pm":"PM":r?"am":"AM"}var or,ar={calendar:L,longDateFormat:z,invalidDate:K,ordinal:q,dayOfMonthOrdinalParse:Q,relativeTime:J,months:st,monthsShort:it,week:Mt,weekdays:Lt,weekdaysMin:kt,weekdaysShort:Dt,meridiemParse:nr},lr={},hr={};function ur(e,t){var r,n=Math.min(e.length,t.length);for(r=0;r0;){if(n=gr(s.slice(0,t).join("-")))return n;if(r&&r.length>=t&&ur(s,r)>=t-1)break;t--}i++}return or}function pr(e){return!(!e||!e.match("^[^/\\\\]*$"))}function gr(t){var n=null;if(void 0===lr[t]&&e&&e.exports&&pr(t))try{n=or._abbr,r(35358)("./"+t),fr(n)}catch(e){lr[t]=null}return lr[t]}function fr(e,t){var r;return e&&((r=u(t)?Er(e):mr(e,t))?or=r:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),or._abbr}function mr(e,t){if(null!==t){var r,n=ar;if(t.abbr=e,null!=lr[e])O("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=lr[e]._config;else if(null!=t.parentLocale)if(null!=lr[t.parentLocale])n=lr[t.parentLocale]._config;else{if(null==(r=gr(t.parentLocale)))return hr[t.parentLocale]||(hr[t.parentLocale]=[]),hr[t.parentLocale].push({name:e,config:t}),null;n=r._config}return lr[e]=new P(x(n,t)),hr[e]&&hr[e].forEach((function(e){mr(e.name,e.config)})),fr(e),lr[e]}return delete lr[e],null}function yr(e,t){if(null!=t){var r,n,s=ar;null!=lr[e]&&null!=lr[e].parentLocale?lr[e].set(x(lr[e]._config,t)):(null!=(n=gr(e))&&(s=n._config),t=x(s,t),null==n&&(t.abbr=e),(r=new P(t)).parentLocale=lr[e],lr[e]=r),fr(e)}else null!=lr[e]&&(null!=lr[e].parentLocale?(lr[e]=lr[e].parentLocale,e===fr()&&fr(e)):null!=lr[e]&&delete lr[e]);return lr[e]}function Er(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return or;if(!o(e)){if(t=gr(e))return t;e=[e]}return dr(e)}function wr(){return _(lr)}function Cr(e){var t,r=e._a;return r&&-2===y(e).overflow&&(t=r[Ue]<0||r[Ue]>11?Ue:r[Ve]<1||r[Ve]>nt(r[Fe],r[Ue])?Ve:r[Be]<0||r[Be]>24||24===r[Be]&&(0!==r[We]||0!==r[Ye]||0!==r[Ge])?Be:r[We]<0||r[We]>59?We:r[Ye]<0||r[Ye]>59?Ye:r[Ge]<0||r[Ge]>999?Ge:-1,y(e)._overflowDayOfYear&&(tVe)&&(t=Ve),y(e)._overflowWeeks&&-1===t&&(t=je),y(e)._overflowWeekday&&-1===t&&(t=ze),y(e).overflow=t),e}var vr=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Rr=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Sr=/Z|[+-]\d\d(?::?\d\d)?/,Tr=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Nr=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Mr=/^\/?Date\((-?\d+)/i,_r=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,br={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Or(e){var t,r,n,s,i,o,a=e._i,l=vr.exec(a)||Rr.exec(a),h=Tr.length,u=Nr.length;if(l){for(y(e).iso=!0,t=0,r=h;t$e(i)||0===e._dayOfYear)&&(y(e)._overflowDayOfYear=!0),r=Ct(i,0,e._dayOfYear),e._a[Ue]=r.getUTCMonth(),e._a[Ve]=r.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=o[t]=n[t];for(;t<7;t++)e._a[t]=o[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[Be]&&0===e._a[We]&&0===e._a[Ye]&&0===e._a[Ge]&&(e._nextDay=!0,e._a[Be]=0),e._d=(e._useUTC?Ct:wt).apply(null,o),s=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[Be]=24),e._w&&void 0!==e._w.d&&e._w.d!==s&&(y(e).weekdayMismatch=!0)}}function Vr(e){var t,r,n,s,i,o,a,l,h;null!=(t=e._w).GG||null!=t.W||null!=t.E?(i=1,o=4,r=Hr(t.GG,e._a[Fe],St(Xr(),1,4).year),n=Hr(t.W,1),((s=Hr(t.E,1))<1||s>7)&&(l=!0)):(i=e._locale._week.dow,o=e._locale._week.doy,h=St(Xr(),i,o),r=Hr(t.gg,e._a[Fe],h.year),n=Hr(t.w,h.week),null!=t.d?((s=t.d)<0||s>6)&&(l=!0):null!=t.e?(s=t.e+i,(t.e<0||t.e>6)&&(l=!0)):s=i),n<1||n>Tt(r,i,o)?y(e)._overflowWeeks=!0:null!=l?y(e)._overflowWeekday=!0:(a=Rt(r,n,s,i,o),e._a[Fe]=a.year,e._dayOfYear=a.dayOfYear)}function Br(e){if(e._f!==s.ISO_8601)if(e._f!==s.RFC_2822){e._a=[],y(e).empty=!0;var t,r,n,i,o,a,l,h=""+e._i,u=h.length,c=0;for(l=(n=j(e._f,e._locale).match(H)||[]).length,t=0;t0&&y(e).unusedInput.push(o),h=h.slice(h.indexOf(r)+r.length),c+=r.length),V[i]?(r?y(e).empty=!1:y(e).unusedTokens.push(i),ke(i,r,e)):e._strict&&!r&&y(e).unusedTokens.push(i);y(e).charsLeftOver=u-c,h.length>0&&y(e).unusedInput.push(h),e._a[Be]<=12&&!0===y(e).bigHour&&e._a[Be]>0&&(y(e).bigHour=void 0),y(e).parsedDateParts=e._a.slice(0),y(e).meridiem=e._meridiem,e._a[Be]=Wr(e._locale,e._a[Be],e._meridiem),null!==(a=y(e).era)&&(e._a[Fe]=e._locale.erasConvertYear(a,e._a[Fe])),Ur(e),Cr(e)}else Dr(e);else Or(e)}function Wr(e,t,r){var n;return null==r?t:null!=e.meridiemHour?e.meridiemHour(t,r):null!=e.isPM?((n=e.isPM(r))&&t<12&&(t+=12),n||12!==t||(t=0),t):t}function Yr(e){var t,r,n,s,i,o,a=!1,l=e._f.length;if(0===l)return y(e).invalidFormat=!0,void(e._d=new Date(NaN));for(s=0;sthis?this:e:w()}));function Zr(e,t){var r,n;if(1===t.length&&o(t[0])&&(t=t[0]),!t.length)return Xr();for(r=t[0],n=1;nthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Sn(){if(!u(this._isDSTShifted))return this._isDSTShifted;var e,t={};return R(t,this),(t=zr(t))._a?(e=t._isUTC?f(t._a):Xr(t._a),this._isDSTShifted=this.isValid()&&un(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Tn(){return!!this.isValid()&&!this._isUTC}function Nn(){return!!this.isValid()&&this._isUTC}function Mn(){return!!this.isValid()&&this._isUTC&&0===this._offset}s.updateOffset=function(){};var _n=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,bn=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function On(e,t){var r,n,s,i=e,o=null;return ln(e)?i={ms:e._milliseconds,d:e._days,M:e._months}:c(e)||!isNaN(+e)?(i={},t?i[t]=+e:i.milliseconds=+e):(o=_n.exec(e))?(r="-"===o[1]?-1:1,i={y:0,d:xe(o[Ve])*r,h:xe(o[Be])*r,m:xe(o[We])*r,s:xe(o[Ye])*r,ms:xe(hn(1e3*o[Ge]))*r}):(o=bn.exec(e))?(r="-"===o[1]?-1:1,i={y:An(o[2],r),M:An(o[3],r),w:An(o[4],r),d:An(o[5],r),h:An(o[6],r),m:An(o[7],r),s:An(o[8],r)}):null==i?i={}:"object"==typeof i&&("from"in i||"to"in i)&&(s=xn(Xr(i.from),Xr(i.to)),(i={}).ms=s.milliseconds,i.M=s.months),n=new an(i),ln(e)&&l(e,"_locale")&&(n._locale=e._locale),ln(e)&&l(e,"_isValid")&&(n._isValid=e._isValid),n}function An(e,t){var r=e&&parseFloat(e.replace(",","."));return(isNaN(r)?0:r)*t}function In(e,t){var r={};return r.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(r.months,"M").isAfter(t)&&--r.months,r.milliseconds=+t-+e.clone().add(r.months,"M"),r}function xn(e,t){var r;return e.isValid()&&t.isValid()?(t=gn(t,e),e.isBefore(t)?r=In(e,t):((r=In(t,e)).milliseconds=-r.milliseconds,r.months=-r.months),r):{milliseconds:0,months:0}}function Pn(e,t){return function(r,n){var s;return null===n||isNaN(+n)||(O(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),s=r,r=n,n=s),Ln(this,On(r,n),e),this}}function Ln(e,t,r,n){var i=t._milliseconds,o=hn(t._days),a=hn(t._months);e.isValid()&&(n=null==n||n,a&&pt(e,Ze(e,"Month")+a*r),o&&Je(e,"Date",Ze(e,"Date")+o*r),i&&e._d.setTime(e._d.valueOf()+i*r),n&&s.updateOffset(e,o||a))}On.fn=an.prototype,On.invalid=on;var Dn=Pn(1,"add"),kn=Pn(-1,"subtract");function Hn(e){return"string"==typeof e||e instanceof String}function Fn(e){return T(e)||d(e)||Hn(e)||c(e)||Vn(e)||Un(e)||null==e}function Un(e){var t,r,n=a(e)&&!h(e),s=!1,i=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],o=i.length;for(t=0;tr.valueOf():r.valueOf()9999?G(r,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):A(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",G(r,"Z")):G(r,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function ts(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e,t,r,n,s="moment",i="";return this.isLocal()||(s=0===this.utcOffset()?"moment.utc":"moment.parseZone",i="Z"),e="["+s+'("]',t=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",r="-MM-DD[T]HH:mm:ss.SSS",n=i+'[")]',this.format(e+t+r+n)}function rs(e){e||(e=this.isUtc()?s.defaultFormatUtc:s.defaultFormat);var t=G(this,e);return this.localeData().postformat(t)}function ns(e,t){return this.isValid()&&(T(e)&&e.isValid()||Xr(e).isValid())?On({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function ss(e){return this.from(Xr(),e)}function is(e,t){return this.isValid()&&(T(e)&&e.isValid()||Xr(e).isValid())?On({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function os(e){return this.to(Xr(),e)}function as(e){var t;return void 0===e?this._locale._abbr:(null!=(t=Er(e))&&(this._locale=t),this)}s.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",s.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var ls=M("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",(function(e){return void 0===e?this.localeData():this.locale(e)}));function hs(){return this._locale}var us=1e3,cs=60*us,ds=60*cs,ps=3506328*ds;function gs(e,t){return(e%t+t)%t}function fs(e,t,r){return e<100&&e>=0?new Date(e+400,t,r)-ps:new Date(e,t,r).valueOf()}function ms(e,t,r){return e<100&&e>=0?Date.UTC(e+400,t,r)-ps:Date.UTC(e,t,r)}function ys(e){var t,r;if(void 0===(e=ne(e))||"millisecond"===e||!this.isValid())return this;switch(r=this._isUTC?ms:fs,e){case"year":t=r(this.year(),0,1);break;case"quarter":t=r(this.year(),this.month()-this.month()%3,1);break;case"month":t=r(this.year(),this.month(),1);break;case"week":t=r(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=r(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=gs(t+(this._isUTC?0:this.utcOffset()*cs),ds);break;case"minute":t=this._d.valueOf(),t-=gs(t,cs);break;case"second":t=this._d.valueOf(),t-=gs(t,us)}return this._d.setTime(t),s.updateOffset(this,!0),this}function Es(e){var t,r;if(void 0===(e=ne(e))||"millisecond"===e||!this.isValid())return this;switch(r=this._isUTC?ms:fs,e){case"year":t=r(this.year()+1,0,1)-1;break;case"quarter":t=r(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=r(this.year(),this.month()+1,1)-1;break;case"week":t=r(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=r(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=ds-gs(t+(this._isUTC?0:this.utcOffset()*cs),ds)-1;break;case"minute":t=this._d.valueOf(),t+=cs-gs(t,cs)-1;break;case"second":t=this._d.valueOf(),t+=us-gs(t,us)-1}return this._d.setTime(t),s.updateOffset(this,!0),this}function ws(){return this._d.valueOf()-6e4*(this._offset||0)}function Cs(){return Math.floor(this.valueOf()/1e3)}function vs(){return new Date(this.valueOf())}function Rs(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function Ss(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function Ts(){return this.isValid()?this.toISOString():null}function Ns(){return E(this)}function Ms(){return g({},y(this))}function _s(){return y(this).overflow}function bs(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function Os(e,t){var r,n,i,o=this._eras||Er("en")._eras;for(r=0,n=o.length;r=0)return l[n]}function Is(e,t){var r=e.since<=e.until?1:-1;return void 0===t?s(e.since).year():s(e.since).year()+(t-e.offset)*r}function xs(){var e,t,r,n=this.localeData().eras();for(e=0,t=n.length;e(i=Tt(e,n,s))&&(t=i),Zs.call(this,e,t,r,n,s))}function Zs(e,t,r,n,s){var i=Rt(e,t,r,n,s),o=Ct(i.year,0,i.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}function Js(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)}B("N",0,0,"eraAbbr"),B("NN",0,0,"eraAbbr"),B("NNN",0,0,"eraAbbr"),B("NNNN",0,0,"eraName"),B("NNNNN",0,0,"eraNarrow"),B("y",["y",1],"yo","eraYear"),B("y",["yy",2],0,"eraYear"),B("y",["yyy",3],0,"eraYear"),B("y",["yyyy",4],0,"eraYear"),_e("N",Us),_e("NN",Us),_e("NNN",Us),_e("NNNN",Vs),_e("NNNNN",Bs),Le(["N","NN","NNN","NNNN","NNNNN"],(function(e,t,r,n){var s=r._locale.erasParse(e,n,r._strict);s?y(r).era=s:y(r).invalidEra=e})),_e("y",we),_e("yy",we),_e("yyy",we),_e("yyyy",we),_e("yo",Ws),Le(["y","yy","yyy","yyyy"],Fe),Le(["yo"],(function(e,t,r,n){var s;r._locale._eraYearOrdinalRegex&&(s=e.match(r._locale._eraYearOrdinalRegex)),r._locale.eraYearOrdinalParse?t[Fe]=r._locale.eraYearOrdinalParse(e,s):t[Fe]=parseInt(e,10)})),B(0,["gg",2],0,(function(){return this.weekYear()%100})),B(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),Gs("gggg","weekYear"),Gs("ggggg","weekYear"),Gs("GGGG","isoWeekYear"),Gs("GGGGG","isoWeekYear"),_e("G",Ce),_e("g",Ce),_e("GG",pe,he),_e("gg",pe,he),_e("GGGG",ye,ce),_e("gggg",ye,ce),_e("GGGGG",Ee,de),_e("ggggg",Ee,de),De(["gggg","ggggg","GGGG","GGGGG"],(function(e,t,r,n){t[n.substr(0,2)]=xe(e)})),De(["gg","GG"],(function(e,t,r,n){t[n]=s.parseTwoDigitYear(e)})),B("Q",0,"Qo","quarter"),_e("Q",le),Le("Q",(function(e,t){t[Ue]=3*(xe(e)-1)})),B("D",["DD",2],"Do","date"),_e("D",pe,Ne),_e("DD",pe,he),_e("Do",(function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient})),Le(["D","DD"],Ve),Le("Do",(function(e,t){t[Ve]=xe(e.match(pe)[0])}));var ei=Qe("Date",!0);function ti(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")}B("DDD",["DDDD",3],"DDDo","dayOfYear"),_e("DDD",me),_e("DDDD",ue),Le(["DDD","DDDD"],(function(e,t,r){r._dayOfYear=xe(e)})),B("m",["mm",2],0,"minute"),_e("m",pe,Me),_e("mm",pe,he),Le(["m","mm"],We);var ri=Qe("Minutes",!1);B("s",["ss",2],0,"second"),_e("s",pe,Me),_e("ss",pe,he),Le(["s","ss"],Ye);var ni,si,ii=Qe("Seconds",!1);for(B("S",0,0,(function(){return~~(this.millisecond()/100)})),B(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),B(0,["SSS",3],0,"millisecond"),B(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),B(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),B(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),B(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),B(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),B(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),_e("S",me,le),_e("SS",me,he),_e("SSS",me,ue),ni="SSSS";ni.length<=9;ni+="S")_e(ni,we);function oi(e,t){t[Ge]=xe(1e3*("0."+e))}for(ni="S";ni.length<=9;ni+="S")Le(ni,oi);function ai(){return this._isUTC?"UTC":""}function li(){return this._isUTC?"Coordinated Universal Time":""}si=Qe("Milliseconds",!1),B("z",0,0,"zoneAbbr"),B("zz",0,0,"zoneName");var hi=S.prototype;function ui(e){return Xr(1e3*e)}function ci(){return Xr.apply(null,arguments).parseZone()}function di(e){return e}hi.add=Dn,hi.calendar=Yn,hi.clone=Gn,hi.diff=Qn,hi.endOf=Es,hi.format=rs,hi.from=ns,hi.fromNow=ss,hi.to=is,hi.toNow=os,hi.get=et,hi.invalidAt=_s,hi.isAfter=jn,hi.isBefore=zn,hi.isBetween=$n,hi.isSame=Kn,hi.isSameOrAfter=Xn,hi.isSameOrBefore=qn,hi.isValid=Ns,hi.lang=ls,hi.locale=as,hi.localeData=hs,hi.max=Qr,hi.min=qr,hi.parsingFlags=Ms,hi.set=tt,hi.startOf=ys,hi.subtract=kn,hi.toArray=Rs,hi.toObject=Ss,hi.toDate=vs,hi.toISOString=es,hi.inspect=ts,"undefined"!=typeof Symbol&&null!=Symbol.for&&(hi[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),hi.toJSON=Ts,hi.toString=Jn,hi.unix=Cs,hi.valueOf=ws,hi.creationData=bs,hi.eraName=xs,hi.eraNarrow=Ps,hi.eraAbbr=Ls,hi.eraYear=Ds,hi.year=Xe,hi.isLeapYear=qe,hi.weekYear=js,hi.isoWeekYear=zs,hi.quarter=hi.quarters=Js,hi.month=gt,hi.daysInMonth=ft,hi.week=hi.weeks=Ot,hi.isoWeek=hi.isoWeeks=At,hi.weeksInYear=Xs,hi.weeksInWeekYear=qs,hi.isoWeeksInYear=$s,hi.isoWeeksInISOWeekYear=Ks,hi.date=ei,hi.day=hi.days=jt,hi.weekday=zt,hi.isoWeekday=$t,hi.dayOfYear=ti,hi.hour=hi.hours=sr,hi.minute=hi.minutes=ri,hi.second=hi.seconds=ii,hi.millisecond=hi.milliseconds=si,hi.utcOffset=mn,hi.utc=En,hi.local=wn,hi.parseZone=Cn,hi.hasAlignedHourOffset=vn,hi.isDST=Rn,hi.isLocal=Tn,hi.isUtcOffset=Nn,hi.isUtc=Mn,hi.isUTC=Mn,hi.zoneAbbr=ai,hi.zoneName=li,hi.dates=M("dates accessor is deprecated. Use date instead.",ei),hi.months=M("months accessor is deprecated. Use month instead",gt),hi.years=M("years accessor is deprecated. Use year instead",Xe),hi.zone=M("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",yn),hi.isDSTShifted=M("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Sn);var pi=P.prototype;function gi(e,t,r,n){var s=Er(),i=f().set(n,t);return s[r](i,e)}function fi(e,t,r){if(c(e)&&(t=e,e=void 0),e=e||"",null!=t)return gi(e,t,r,"month");var n,s=[];for(n=0;n<12;n++)s[n]=gi(e,n,r,"month");return s}function mi(e,t,r,n){"boolean"==typeof e?(c(t)&&(r=t,t=void 0),t=t||""):(r=t=e,e=!1,c(t)&&(r=t,t=void 0),t=t||"");var s,i=Er(),o=e?i._week.dow:0,a=[];if(null!=r)return gi(t,(r+o)%7,n,"day");for(s=0;s<7;s++)a[s]=gi(t,(s+o)%7,n,"day");return a}function yi(e,t){return fi(e,t,"months")}function Ei(e,t){return fi(e,t,"monthsShort")}function wi(e,t,r){return mi(e,t,r,"weekdays")}function Ci(e,t,r){return mi(e,t,r,"weekdaysShort")}function vi(e,t,r){return mi(e,t,r,"weekdaysMin")}pi.calendar=D,pi.longDateFormat=$,pi.invalidDate=X,pi.ordinal=Z,pi.preparse=di,pi.postformat=di,pi.relativeTime=ee,pi.pastFuture=te,pi.set=I,pi.eras=Os,pi.erasParse=As,pi.erasConvertYear=Is,pi.erasAbbrRegex=Hs,pi.erasNameRegex=ks,pi.erasNarrowRegex=Fs,pi.months=ht,pi.monthsShort=ut,pi.monthsParse=dt,pi.monthsRegex=yt,pi.monthsShortRegex=mt,pi.week=Nt,pi.firstDayOfYear=bt,pi.firstDayOfWeek=_t,pi.weekdays=Vt,pi.weekdaysMin=Wt,pi.weekdaysShort=Bt,pi.weekdaysParse=Gt,pi.weekdaysRegex=Kt,pi.weekdaysShortRegex=Xt,pi.weekdaysMinRegex=qt,pi.isPM=rr,pi.meridiem=ir,fr("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===xe(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),s.lang=M("moment.lang is deprecated. Use moment.locale instead.",fr),s.langData=M("moment.langData is deprecated. Use moment.localeData instead.",Er);var Ri=Math.abs;function Si(){var e=this._data;return this._milliseconds=Ri(this._milliseconds),this._days=Ri(this._days),this._months=Ri(this._months),e.milliseconds=Ri(e.milliseconds),e.seconds=Ri(e.seconds),e.minutes=Ri(e.minutes),e.hours=Ri(e.hours),e.months=Ri(e.months),e.years=Ri(e.years),this}function Ti(e,t,r,n){var s=On(t,r);return e._milliseconds+=n*s._milliseconds,e._days+=n*s._days,e._months+=n*s._months,e._bubble()}function Ni(e,t){return Ti(this,e,t,1)}function Mi(e,t){return Ti(this,e,t,-1)}function _i(e){return e<0?Math.floor(e):Math.ceil(e)}function bi(){var e,t,r,n,s,i=this._milliseconds,o=this._days,a=this._months,l=this._data;return i>=0&&o>=0&&a>=0||i<=0&&o<=0&&a<=0||(i+=864e5*_i(Ai(a)+o),o=0,a=0),l.milliseconds=i%1e3,e=Ie(i/1e3),l.seconds=e%60,t=Ie(e/60),l.minutes=t%60,r=Ie(t/60),l.hours=r%24,o+=Ie(r/24),a+=s=Ie(Oi(o)),o-=_i(Ai(s)),n=Ie(a/12),a%=12,l.days=o,l.months=a,l.years=n,this}function Oi(e){return 4800*e/146097}function Ai(e){return 146097*e/4800}function Ii(e){if(!this.isValid())return NaN;var t,r,n=this._milliseconds;if("month"===(e=ne(e))||"quarter"===e||"year"===e)switch(t=this._days+n/864e5,r=this._months+Oi(t),e){case"month":return r;case"quarter":return r/3;case"year":return r/12}else switch(t=this._days+Math.round(Ai(this._months)),e){case"week":return t/7+n/6048e5;case"day":return t+n/864e5;case"hour":return 24*t+n/36e5;case"minute":return 1440*t+n/6e4;case"second":return 86400*t+n/1e3;case"millisecond":return Math.floor(864e5*t)+n;default:throw new Error("Unknown unit "+e)}}function xi(e){return function(){return this.as(e)}}var Pi=xi("ms"),Li=xi("s"),Di=xi("m"),ki=xi("h"),Hi=xi("d"),Fi=xi("w"),Ui=xi("M"),Vi=xi("Q"),Bi=xi("y"),Wi=Pi;function Yi(){return On(this)}function Gi(e){return e=ne(e),this.isValid()?this[e+"s"]():NaN}function ji(e){return function(){return this.isValid()?this._data[e]:NaN}}var zi=ji("milliseconds"),$i=ji("seconds"),Ki=ji("minutes"),Xi=ji("hours"),qi=ji("days"),Qi=ji("months"),Zi=ji("years");function Ji(){return Ie(this.days()/7)}var eo=Math.round,to={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function ro(e,t,r,n,s){return s.relativeTime(t||1,!!r,e,n)}function no(e,t,r,n){var s=On(e).abs(),i=eo(s.as("s")),o=eo(s.as("m")),a=eo(s.as("h")),l=eo(s.as("d")),h=eo(s.as("M")),u=eo(s.as("w")),c=eo(s.as("y")),d=i<=r.ss&&["s",i]||i0,d[4]=n,ro.apply(null,d)}function so(e){return void 0===e?eo:"function"==typeof e&&(eo=e,!0)}function io(e,t){return void 0!==to[e]&&(void 0===t?to[e]:(to[e]=t,"s"===e&&(to.ss=t-1),!0))}function oo(e,t){if(!this.isValid())return this.localeData().invalidDate();var r,n,s=!1,i=to;return"object"==typeof e&&(t=e,e=!1),"boolean"==typeof e&&(s=e),"object"==typeof t&&(i=Object.assign({},to,t),null!=t.s&&null==t.ss&&(i.ss=t.s-1)),n=no(this,!s,i,r=this.localeData()),s&&(n=r.pastFuture(+this,n)),r.postformat(n)}var ao=Math.abs;function lo(e){return(e>0)-(e<0)||+e}function ho(){if(!this.isValid())return this.localeData().invalidDate();var e,t,r,n,s,i,o,a,l=ao(this._milliseconds)/1e3,h=ao(this._days),u=ao(this._months),c=this.asSeconds();return c?(e=Ie(l/60),t=Ie(e/60),l%=60,e%=60,r=Ie(u/12),u%=12,n=l?l.toFixed(3).replace(/\.?0+$/,""):"",s=c<0?"-":"",i=lo(this._months)!==lo(c)?"-":"",o=lo(this._days)!==lo(c)?"-":"",a=lo(this._milliseconds)!==lo(c)?"-":"",s+"P"+(r?i+r+"Y":"")+(u?i+u+"M":"")+(h?o+h+"D":"")+(t||e||l?"T":"")+(t?a+t+"H":"")+(e?a+e+"M":"")+(l?a+n+"S":"")):"P0D"}var uo=an.prototype;return uo.isValid=sn,uo.abs=Si,uo.add=Ni,uo.subtract=Mi,uo.as=Ii,uo.asMilliseconds=Pi,uo.asSeconds=Li,uo.asMinutes=Di,uo.asHours=ki,uo.asDays=Hi,uo.asWeeks=Fi,uo.asMonths=Ui,uo.asQuarters=Vi,uo.asYears=Bi,uo.valueOf=Wi,uo._bubble=bi,uo.clone=Yi,uo.get=Gi,uo.milliseconds=zi,uo.seconds=$i,uo.minutes=Ki,uo.hours=Xi,uo.days=qi,uo.weeks=Ji,uo.months=Qi,uo.years=Zi,uo.humanize=oo,uo.toISOString=ho,uo.toString=ho,uo.toJSON=ho,uo.locale=as,uo.localeData=hs,uo.toIsoString=M("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",ho),uo.lang=ls,B("X",0,0,"unix"),B("x",0,0,"valueOf"),_e("x",Ce),_e("X",Se),Le("X",(function(e,t,r){r._d=new Date(1e3*parseFloat(e))})),Le("x",(function(e,t,r){r._d=new Date(xe(e))})), +//! moment.js +s.version="2.30.1",i(Xr),s.fn=hi,s.min=Jr,s.max=en,s.now=tn,s.utc=f,s.unix=ui,s.months=yi,s.isDate=d,s.locale=fr,s.invalid=w,s.duration=On,s.isMoment=T,s.weekdays=wi,s.parseZone=ci,s.localeData=Er,s.isDuration=ln,s.monthsShort=Ei,s.weekdaysMin=vi,s.defineLocale=mr,s.updateLocale=yr,s.locales=wr,s.weekdaysShort=Ci,s.normalizeUnits=ne,s.relativeTimeRounding=so,s.relativeTimeThreshold=io,s.calendarFormat=Wn,s.prototype=hi,s.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},s}(),window.moment=r(6671)},80586:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>K});var n,s,i,o,a,l,h="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function u(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e} +/*! + * Copyright (c) 2017 Benjamin Van Ryseghem + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */function c(){return s?n:(s=1,n={languageTag:"en-US",delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},spaceSeparated:!1,ordinal:function(e){let t=e%10;return 1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th"},bytes:{binarySuffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],decimalSuffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]},currency:{symbol:"$",position:"prefix",code:"USD"},currencyFormat:{thousandSeparated:!0,totalLength:4,spaceSeparated:!0,spaceSeparatedCurrency:!0},formats:{fourDigits:{totalLength:4,spaceSeparated:!0},fullWithTwoDecimals:{output:"currency",thousandSeparated:!0,mantissa:2},fullWithTwoDecimalsNoCurrency:{thousandSeparated:!0,mantissa:2},fullWithNoDecimals:{output:"currency",thousandSeparated:!0,mantissa:0}}})} +/*! + * Copyright (c) 2017 Benjamin Van Ryseghem + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */function d(){if(o)return i;o=1;const e=[{key:"ZiB",factor:Math.pow(1024,7)},{key:"ZB",factor:Math.pow(1e3,7)},{key:"YiB",factor:Math.pow(1024,8)},{key:"YB",factor:Math.pow(1e3,8)},{key:"TiB",factor:Math.pow(1024,4)},{key:"TB",factor:Math.pow(1e3,4)},{key:"PiB",factor:Math.pow(1024,5)},{key:"PB",factor:Math.pow(1e3,5)},{key:"MiB",factor:Math.pow(1024,2)},{key:"MB",factor:Math.pow(1e3,2)},{key:"KiB",factor:Math.pow(1024,1)},{key:"KB",factor:Math.pow(1e3,1)},{key:"GiB",factor:Math.pow(1024,3)},{key:"GB",factor:Math.pow(1e3,3)},{key:"EiB",factor:Math.pow(1024,6)},{key:"EB",factor:Math.pow(1e3,6)},{key:"B",factor:1}];function t(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function r(n,s,i,o,a,l,h){if(!isNaN(+n))return+n;let u="",c=n.replace(/(^[^(]*)\((.*)\)([^)]*$)/,"$1$2$3");if(c!==n)return-1*r(c,s,i,o,a,l);for(let t=0;t{g[l[e]]=e}));let f=Object.keys(g).sort().reverse(),m=f.length;for(let e=0;e + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */function p(){if(l)return a;l=1;let e=d();const t=/^[a-z]{2,3}(-[a-zA-Z]{4})?(-([A-Z]{2}|[0-9]{3}))?$/,r={output:{type:"string",validValues:["currency","percent","byte","time","ordinal","number"]},base:{type:"string",validValues:["decimal","binary","general"],restriction:(e,t)=>"byte"===t.output,message:"`base` must be provided only when the output is `byte`",mandatory:e=>"byte"===e.output},characteristic:{type:"number",restriction:e=>e>=0,message:"value must be positive"},prefix:"string",postfix:"string",forceAverage:{type:"string",validValues:["trillion","billion","million","thousand"]},average:"boolean",lowPrecision:{type:"boolean",restriction:(e,t)=>!0===t.average,message:"`lowPrecision` must be provided only when the option `average` is set"},currencyPosition:{type:"string",validValues:["prefix","infix","postfix"]},currencySymbol:"string",totalLength:{type:"number",restrictions:[{restriction:e=>e>=0,message:"value must be positive"},{restriction:(e,t)=>!t.exponential,message:"`totalLength` is incompatible with `exponential`"}]},mantissa:{type:"number",restriction:e=>e>=0,message:"value must be positive"},optionalMantissa:"boolean",trimMantissa:"boolean",roundingFunction:"function",optionalCharacteristic:"boolean",thousandSeparated:"boolean",spaceSeparated:"boolean",spaceSeparatedCurrency:"boolean",spaceSeparatedAbbreviation:"boolean",abbreviations:{type:"object",children:{thousand:"string",million:"string",billion:"string",trillion:"string"}},negative:{type:"string",validValues:["sign","parenthesis"]},forceSign:"boolean",exponential:{type:"boolean"},prefixSymbol:{type:"boolean",restriction:(e,t)=>"percent"===t.output,message:"`prefixSymbol` can be provided only when the output is `percent`"}},n={languageTag:{type:"string",mandatory:!0,restriction:e=>e.match(t),message:"the language tag must follow the BCP 47 specification (see https://tools.ieft.org/html/bcp47)"},delimiters:{type:"object",children:{thousands:"string",decimal:"string",thousandsSize:"number"},mandatory:!0},abbreviations:{type:"object",children:{thousand:{type:"string",mandatory:!0},million:{type:"string",mandatory:!0},billion:{type:"string",mandatory:!0},trillion:{type:"string",mandatory:!0}},mandatory:!0},spaceSeparated:"boolean",spaceSeparatedCurrency:"boolean",ordinal:{type:"function",mandatory:!0},bytes:{type:"object",children:{binarySuffixes:"object",decimalSuffixes:"object"}},currency:{type:"object",children:{symbol:"string",position:"string",code:"string"},mandatory:!0},defaults:"format",ordinalFormat:"format",byteFormat:"format",percentageFormat:"format",currencyFormat:"format",timeDefaults:"format",formats:{type:"object",children:{fourDigits:{type:"format",mandatory:!0},fullWithTwoDecimals:{type:"format",mandatory:!0},fullWithTwoDecimalsNoCurrency:{type:"format",mandatory:!0},fullWithNoDecimals:{type:"format",mandatory:!0}}}};function s(t){return void 0!==e.unformat(t)}function i(e,t,n,s=!1){let o=Object.keys(e).map((s=>{if(!t[s])return console.error(`${n} Invalid key: ${s}`),!1;let o=e[s],a=t[s];if("string"==typeof a&&(a={type:a}),"format"===a.type){if(!i(o,r,`[Validate ${s}]`,!0))return!1}else if(typeof o!==a.type)return console.error(`${n} ${s} type mismatched: "${a.type}" expected, "${typeof o}" provided`),!1;if(a.restrictions&&a.restrictions.length){let t=a.restrictions.length;for(let r=0;r{let s=t[r];if("string"==typeof s&&(s={type:s}),s.mandatory){let t=s.mandatory;if("function"==typeof t&&(t=t(e)),t&&void 0===e[r])return console.error(`${n} Missing mandatory key "${r}"`),!1}return!0}))),o.reduce(((e,t)=>e&&t),!0)}function o(e){return i(e,r,"[Validate format]")}return a={validate:function(e,t){let r=s(e),n=o(t);return r&&n},validateFormat:o,validateInput:s,validateLanguage:function(e){return i(e,n,"[Validate language]")}},a} +/*! + * Copyright (c) 2017 Benjamin Van Ryseghem + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */var g,f,m={parseFormat:function(e,t={}){return"string"!=typeof e?e:(function(e,t){if(-1===e.indexOf("$")){if(-1===e.indexOf("%"))return-1!==e.indexOf("bd")?(t.output="byte",void(t.base="general")):-1!==e.indexOf("b")?(t.output="byte",void(t.base="binary")):-1!==e.indexOf("d")?(t.output="byte",void(t.base="decimal")):void(-1===e.indexOf(":")?-1!==e.indexOf("o")&&(t.output="ordinal"):t.output="time");t.output="percent"}else t.output="currency"}(e=function(e,t){let r=e.match(/{([^}]*)}$/);return r?(t.postfix=r[1],e.slice(0,-r[0].length)):e}(e=function(e,t){let r=e.match(/^{([^}]*)}/);return r?(t.prefix=r[1],e.slice(r[0].length)):e}(e,t),t),t),function(e,t){let r=e.match(/[1-9]+[0-9]*/);r&&(t.totalLength=+r[0])}(e,t),function(e,t){let r=e.split(".")[0].match(/0+/);r&&(t.characteristic=r[0].length)}(e,t),function(e,t){if(-1!==e.indexOf(".")){let r=e.split(".")[0];t.optionalCharacteristic=-1===r.indexOf("0")}}(e,t),function(e,t){-1!==e.indexOf("a")&&(t.average=!0)}(e,t),function(e,t){-1!==e.indexOf("K")?t.forceAverage="thousand":-1!==e.indexOf("M")?t.forceAverage="million":-1!==e.indexOf("B")?t.forceAverage="billion":-1!==e.indexOf("T")&&(t.forceAverage="trillion")}(e,t),function(e,t){let r=e.split(".")[1];if(r){let e=r.match(/0+/);e&&(t.mantissa=e[0].length)}}(e,t),function(e,t){e.match(/\[\.]/)?t.optionalMantissa=!0:e.match(/\./)&&(t.optionalMantissa=!1)}(e,t),function(e,t){const r=e.split(".")[1];r&&(t.trimMantissa=-1!==r.indexOf("["))}(e,t),function(e,t){-1!==e.indexOf(",")&&(t.thousandSeparated=!0)}(e,t),function(e,t){-1!==e.indexOf(" ")&&(t.spaceSeparated=!0,t.spaceSeparatedCurrency=!0,(t.average||t.forceAverage)&&(t.spaceSeparatedAbbreviation=!0))}(e,t),function(e,t){e.match(/^\+?\([^)]*\)$/)&&(t.negative="parenthesis"),e.match(/^\+?-/)&&(t.negative="sign")}(e,t),function(e,t){e.match(/^\+/)&&(t.forceSign=!0)}(e,t),t)}}; +/*! + * Copyright (c) 2017 Benjamin Van Ryseghem + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */function y(){if(f)return g;f=1;const e=c(),t=p(),r=m;let n,s={},i={},o=null,a={};function l(e){n=e}function h(){return i[n]}return s.languages=()=>Object.assign({},i),s.currentLanguage=()=>n,s.currentBytes=()=>h().bytes||{},s.currentCurrency=()=>h().currency,s.currentAbbreviations=()=>h().abbreviations,s.currentDelimiters=()=>h().delimiters,s.currentOrdinal=()=>h().ordinal,s.currentDefaults=()=>Object.assign({},h().defaults,a),s.currentOrdinalDefaultFormat=()=>Object.assign({},s.currentDefaults(),h().ordinalFormat),s.currentByteDefaultFormat=()=>Object.assign({},s.currentDefaults(),h().byteFormat),s.currentPercentageDefaultFormat=()=>Object.assign({},s.currentDefaults(),h().percentageFormat),s.currentCurrencyDefaultFormat=()=>Object.assign({},s.currentDefaults(),h().currencyFormat),s.currentTimeDefaultFormat=()=>Object.assign({},s.currentDefaults(),h().timeFormat),s.setDefaults=e=>{e=r.parseFormat(e),t.validateFormat(e)&&(a=e)},s.getZeroFormat=()=>o,s.setZeroFormat=e=>o="string"==typeof e?e:null,s.hasZeroFormat=()=>null!==o,s.languageData=e=>{if(e){if(i[e])return i[e];throw new Error(`Unknown tag "${e}"`)}return h()},s.registerLanguage=(e,r=!1)=>{if(!t.validateLanguage(e))throw new Error("Invalid language data");i[e.languageTag]=e,r&&l(e.languageTag)},s.setLanguage=(t,r=e.languageTag)=>{if(!i[t]){let e=t.split("-")[0],n=Object.keys(i).find((t=>t.split("-")[0]===e));return i[n]?void l(n):void l(r)}l(t)},s.registerLanguage(e),n=e.languageTag,g=s} +/*! + * Copyright (c) 2017 Benjamin Van Ryseghem + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +function E(e,t){e.forEach((e=>{let r;try{r=function(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}(`../languages/${e}`)}catch(t){console.error(`Unable to load "${e}". No matching language file found.`)}r&&t.registerLanguage(r)}))}var w={exports:{}};!function(e){!function(t){var r,n=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,s=Math.ceil,i=Math.floor,o="[BigNumber Error] ",a=o+"Number primitive has more than 15 significant digits: ",l=1e14,h=14,u=9007199254740991,c=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],d=1e7,p=1e9;function g(e){var t=0|e;return e>0||e===t?t:t-1}function f(e){for(var t,r,n=1,s=e.length,i=e[0]+"";nh^r?1:-1;for(a=(l=s.length)<(h=i.length)?l:h,o=0;oi[o]^r?1:-1;return l==h?0:l>h^r?1:-1}function y(e,t,r,n){if(er||e!==i(e))throw Error(o+(n||"Argument")+("number"==typeof e?er?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function E(e){var t=e.c.length-1;return g(e.e/h)==t&&e.c[t]%2!=0}function w(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function C(e,t,r){var n,s;if(t<0){for(s=r+".";++t;s+=r);e=s+e}else if(++t>(n=e.length)){for(s=r,t-=n;--t;s+=r);e+=s}else tH?f.c=f.e=null:e.e=10;c/=10,l++);return void(l>H?f.c=f.e=null:(f.e=l,f.c=[e]))}g=String(e)}else{if(!n.test(g=String(e)))return R(f,g,d);f.s=45==g.charCodeAt(0)?(g=g.slice(1),-1):1}(l=g.indexOf("."))>-1&&(g=g.replace(".","")),(c=g.search(/e/i))>0?(l<0&&(l=c),l+=+g.slice(c+1),g=g.substring(0,c)):l<0&&(l=g.length)}else{if(y(t,2,W.length,"Base"),10==t&&Y)return K(f=new G(e),x+f.e+1,P);if(g=String(e),d="number"==typeof e){if(0*e!=0)return R(f,g,d,t);if(f.s=1/e<0?(g=g.slice(1),-1):1,G.DEBUG&&g.replace(/^0\.0*|\./,"").length>15)throw Error(a+e)}else f.s=45===g.charCodeAt(0)?(g=g.slice(1),-1):1;for(r=W.slice(0,t),l=c=0,p=g.length;cl){l=p;continue}}else if(!o&&(g==g.toUpperCase()&&(g=g.toLowerCase())||g==g.toLowerCase()&&(g=g.toUpperCase()))){o=!0,c=-1,l=0;continue}return R(f,String(e),d,t)}d=!1,(l=(g=v(g,t,10,f.s)).indexOf("."))>-1?g=g.replace(".",""):l=g.length}for(c=0;48===g.charCodeAt(c);c++);for(p=g.length;48===g.charCodeAt(--p););if(g=g.slice(c,++p)){if(p-=c,d&&G.DEBUG&&p>15&&(e>u||e!==i(e)))throw Error(a+f.s*e);if((l=l-c-1)>H)f.c=f.e=null;else if(l=D)?w(l,o):C(l,o,"0");else if(i=(e=K(new G(e),t,r)).e,a=(l=f(e.c)).length,1==n||2==n&&(t<=i||i<=L)){for(;aa){if(--t>0)for(l+=".";t--;l+="0");}else if((t+=i-a)>0)for(i+1==a&&(l+=".");t--;l+="0");return e.s<0&&s?"-"+l:l}function z(e,t){for(var r,n,s=1,i=new G(e[0]);s=10;s/=10,n++);return(r=n+r*h-1)>H?e.c=e.e=null:r=10;d/=10,o++);if((a=t-o)<0)a+=h,u=t,p=m[g=0],f=i(p/y[o-u-1]%10);else if((g=s((a+1)/h))>=m.length){if(!n)break e;for(;m.length<=g;m.push(0));p=f=0,o=1,u=(a%=h)-h+1}else{for(p=d=m[g],o=1;d>=10;d/=10,o++);f=(u=(a%=h)-h+o)<0?0:i(p/y[o-u-1]%10)}if(n=n||t<0||null!=m[g+1]||(u<0?p:p%y[o-u-1]),n=r<4?(f||n)&&(0==r||r==(e.s<0?3:2)):f>5||5==f&&(4==r||n||6==r&&(a>0?u>0?p/y[o-u]:0:m[g-1])%10&1||r==(e.s<0?8:7)),t<1||!m[0])return m.length=0,n?(t-=e.e+1,m[0]=y[(h-t%h)%h],e.e=-t||0):m[0]=e.e=0,e;if(0==a?(m.length=g,d=1,g--):(m.length=g+1,d=y[h-a],m[g]=u>0?i(p/y[o-u]%y[u])*d:0),n)for(;;){if(0==g){for(a=1,u=m[0];u>=10;u/=10,a++);for(u=m[0]+=d,d=1;u>=10;u/=10,d++);a!=d&&(e.e++,m[0]==l&&(m[0]=1));break}if(m[g]+=d,m[g]!=l)break;m[g--]=0,d=1}for(a=m.length;0===m[--a];m.pop());}e.e>H?e.c=e.e=null:e.e=D?w(t,r):C(t,r,"0"),e.s<0?"-"+t:t)}return G.clone=e,G.ROUND_UP=0,G.ROUND_DOWN=1,G.ROUND_CEIL=2,G.ROUND_FLOOR=3,G.ROUND_HALF_UP=4,G.ROUND_HALF_DOWN=5,G.ROUND_HALF_EVEN=6,G.ROUND_HALF_CEIL=7,G.ROUND_HALF_FLOOR=8,G.EUCLID=9,G.config=G.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(o+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(y(r=e[t],0,p,t),x=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(y(r=e[t],0,8,t),P=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(y(r[0],-p,0,t),y(r[1],0,p,t),L=r[0],D=r[1]):(y(r,-p,p,t),L=-(D=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)y(r[0],-p,-1,t),y(r[1],1,p,t),k=r[0],H=r[1];else{if(y(r,-p,p,t),!r)throw Error(o+t+" cannot be zero: "+r);k=-(H=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(o+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw F=!r,Error(o+"crypto unavailable");F=r}else F=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(y(r=e[t],0,9,t),U=r),e.hasOwnProperty(t="POW_PRECISION")&&(y(r=e[t],0,p,t),V=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(o+t+" not an object: "+r);B=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(o+t+" invalid: "+r);Y="0123456789"==r.slice(0,10),W=r}}return{DECIMAL_PLACES:x,ROUNDING_MODE:P,EXPONENTIAL_AT:[L,D],RANGE:[k,H],CRYPTO:F,MODULO_MODE:U,POW_PRECISION:V,FORMAT:B,ALPHABET:W}},G.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!G.DEBUG)return!0;var t,r,n=e.c,s=e.e,a=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===a||-1===a)&&s>=-p&&s<=p&&s===i(s)){if(0===n[0]){if(0===s&&1===n.length)return!0;break e}if((t=(s+1)%h)<1&&(t+=h),String(n[0]).length==t){for(t=0;t=l||r!==i(r))break e;if(0!==r)return!0}}}else if(null===n&&null===s&&(null===a||1===a||-1===a))return!0;throw Error(o+"Invalid BigNumber: "+e)},G.maximum=G.max=function(){return z(arguments,-1)},G.minimum=G.min=function(){return z(arguments,1)},G.random=(S=9007199254740992,T=Math.random()*S&2097151?function(){return i(Math.random()*S)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,a,l,u=0,d=[],g=new G(I);if(null==e?e=x:y(e,0,p),a=s(e/h),F)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(a*=2));u>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[u]=r[0],t[u+1]=r[1]):(d.push(l%1e14),u+=2);u=a/2}else{if(!crypto.randomBytes)throw F=!1,Error(o+"crypto unavailable");for(t=crypto.randomBytes(a*=7);u=9e15?crypto.randomBytes(7).copy(t,u):(d.push(l%1e14),u+=7);u=a/7}if(!F)for(;u=10;l/=10,u++);ur-1&&(null==o[s+1]&&(o[s+1]=0),o[s+1]+=o[s]/r|0,o[s]%=r)}return o.reverse()}return function(n,s,i,o,a){var l,h,u,c,d,p,g,m,y=n.indexOf("."),E=x,w=P;for(y>=0&&(c=V,V=0,n=n.replace(".",""),p=(m=new G(s)).pow(n.length-y),V=c,m.c=t(C(f(p.c),p.e,"0"),10,i,e),m.e=m.c.length),u=c=(g=t(n,s,i,a?(l=W,e):(l=e,W))).length;0==g[--c];g.pop());if(!g[0])return l.charAt(0);if(y<0?--u:(p.c=g,p.e=u,p.s=o,g=(p=r(p,m,E,w,i)).c,d=p.r,u=p.e),y=g[h=u+E+1],c=i/2,d=d||h<0||null!=g[h+1],d=w<4?(null!=y||d)&&(0==w||w==(p.s<0?3:2)):y>c||y==c&&(4==w||d||6==w&&1&g[h-1]||w==(p.s<0?8:7)),h<1||!g[0])n=d?C(l.charAt(1),-E,l.charAt(0)):l.charAt(0);else{if(g.length=h,d)for(--i;++g[--h]>i;)g[h]=0,h||(++u,g=[1].concat(g));for(c=g.length;!g[--c];);for(y=0,n="";y<=c;n+=l.charAt(g[y++]));n=C(n,u,l.charAt(0))}return n}}(),r=function(){function e(e,t,r){var n,s,i,o,a=0,l=e.length,h=t%d,u=t/d|0;for(e=e.slice();l--;)a=((s=h*(i=e[l]%d)+(n=u*i+(o=e[l]/d|0)*h)%d*d+a)/r|0)+(n/d|0)+u*o,e[l]=s%r;return a&&(e=[a].concat(e)),e}function t(e,t,r,n){var s,i;if(r!=n)i=r>n?1:-1;else for(s=i=0;st[s]?1:-1;break}return i}function r(e,t,r,n){for(var s=0;r--;)e[r]-=s,s=e[r]1;e.splice(0,1));}return function(n,s,o,a,u){var c,d,p,f,m,y,E,w,C,v,R,S,T,N,M,_,b,O=n.s==s.s?1:-1,A=n.c,I=s.c;if(!(A&&A[0]&&I&&I[0]))return new G(n.s&&s.s&&(A?!I||A[0]!=I[0]:I)?A&&0==A[0]||!I?0*O:O/0:NaN);for(C=(w=new G(O)).c=[],O=o+(d=n.e-s.e)+1,u||(u=l,d=g(n.e/h)-g(s.e/h),O=O/h|0),p=0;I[p]==(A[p]||0);p++);if(I[p]>(A[p]||0)&&d--,O<0)C.push(1),f=!0;else{for(N=A.length,_=I.length,p=0,O+=2,(m=i(u/(I[0]+1)))>1&&(I=e(I,m,u),A=e(A,m,u),_=I.length,N=A.length),T=_,R=(v=A.slice(0,_)).length;R<_;v[R++]=0);b=I.slice(),b=[0].concat(b),M=I[0],I[1]>=u/2&&M++;do{if(m=0,(c=t(I,v,_,R))<0){if(S=v[0],_!=R&&(S=S*u+(v[1]||0)),(m=i(S/M))>1)for(m>=u&&(m=u-1),E=(y=e(I,m,u)).length,R=v.length;1==t(y,v,E,R);)m--,r(y,_=10;O/=10,p++);K(w,o+(w.e=p+d*h-1)+1,a,f)}else w.e=d,w.r=+f;return w}}(),N=/^(-?)0([xbo])(?=\w[\w.]*$)/i,M=/^([^.]+)\.$/,_=/^\.([^.]+)$/,b=/^-?(Infinity|NaN)$/,O=/^\s*\+(?=[\w.])|^\s+|\s+$/g,R=function(e,t,r,n){var s,i=r?t:t.replace(O,"");if(b.test(i))e.s=isNaN(i)?null:i<0?-1:1;else{if(!r&&(i=i.replace(N,(function(e,t,r){return s="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=s?e:t})),n&&(s=n,i=i.replace(M,"$1").replace(_,"0.$1")),t!=i))return new G(i,s);if(G.DEBUG)throw Error(o+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},A.absoluteValue=A.abs=function(){var e=new G(this);return e.s<0&&(e.s=1),e},A.comparedTo=function(e,t){return m(this,new G(e,t))},A.decimalPlaces=A.dp=function(e,t){var r,n,s,i=this;if(null!=e)return y(e,0,p),null==t?t=P:y(t,0,8),K(new G(i),e+i.e+1,t);if(!(r=i.c))return null;if(n=((s=r.length-1)-g(this.e/h))*h,s=r[s])for(;s%10==0;s/=10,n--);return n<0&&(n=0),n},A.dividedBy=A.div=function(e,t){return r(this,new G(e,t),x,P)},A.dividedToIntegerBy=A.idiv=function(e,t){return r(this,new G(e,t),0,1)},A.exponentiatedBy=A.pow=function(e,t){var r,n,a,l,u,c,d,p,g=this;if((e=new G(e)).c&&!e.isInteger())throw Error(o+"Exponent not an integer: "+X(e));if(null!=t&&(t=new G(t)),u=e.e>14,!g.c||!g.c[0]||1==g.c[0]&&!g.e&&1==g.c.length||!e.c||!e.c[0])return p=new G(Math.pow(+X(g),u?e.s*(2-E(e)):+X(e))),t?p.mod(t):p;if(c=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new G(NaN);(n=!c&&g.isInteger()&&t.isInteger())&&(g=g.mod(t))}else{if(e.e>9&&(g.e>0||g.e<-1||(0==g.e?g.c[0]>1||u&&g.c[1]>=24e7:g.c[0]<8e13||u&&g.c[0]<=9999975e7)))return l=g.s<0&&E(e)?-0:0,g.e>-1&&(l=1/l),new G(c?1/l:l);V&&(l=s(V/h+2))}for(u?(r=new G(.5),c&&(e.s=1),d=E(e)):d=(a=Math.abs(+X(e)))%2,p=new G(I);;){if(d){if(!(p=p.times(g)).c)break;l?p.c.length>l&&(p.c.length=l):n&&(p=p.mod(t))}if(a){if(0===(a=i(a/2)))break;d=a%2}else if(K(e=e.times(r),e.e+1,1),e.e>14)d=E(e);else{if(0===(a=+X(e)))break;d=a%2}g=g.times(g),l?g.c&&g.c.length>l&&(g.c.length=l):n&&(g=g.mod(t))}return n?p:(c&&(p=I.div(p)),t?p.mod(t):l?K(p,V,P,undefined):p)},A.integerValue=function(e){var t=new G(this);return null==e?e=P:y(e,0,8),K(t,t.e+1,e)},A.isEqualTo=A.eq=function(e,t){return 0===m(this,new G(e,t))},A.isFinite=function(){return!!this.c},A.isGreaterThan=A.gt=function(e,t){return m(this,new G(e,t))>0},A.isGreaterThanOrEqualTo=A.gte=function(e,t){return 1===(t=m(this,new G(e,t)))||0===t},A.isInteger=function(){return!!this.c&&g(this.e/h)>this.c.length-2},A.isLessThan=A.lt=function(e,t){return m(this,new G(e,t))<0},A.isLessThanOrEqualTo=A.lte=function(e,t){return-1===(t=m(this,new G(e,t)))||0===t},A.isNaN=function(){return!this.s},A.isNegative=function(){return this.s<0},A.isPositive=function(){return this.s>0},A.isZero=function(){return!!this.c&&0==this.c[0]},A.minus=function(e,t){var r,n,s,i,o=this,a=o.s;if(t=(e=new G(e,t)).s,!a||!t)return new G(NaN);if(a!=t)return e.s=-t,o.plus(e);var u=o.e/h,c=e.e/h,d=o.c,p=e.c;if(!u||!c){if(!d||!p)return d?(e.s=-t,e):new G(p?o:NaN);if(!d[0]||!p[0])return p[0]?(e.s=-t,e):new G(d[0]?o:3==P?-0:0)}if(u=g(u),c=g(c),d=d.slice(),a=u-c){for((i=a<0)?(a=-a,s=d):(c=u,s=p),s.reverse(),t=a;t--;s.push(0));s.reverse()}else for(n=(i=(a=d.length)<(t=p.length))?a:t,a=t=0;t0)for(;t--;d[r++]=0);for(t=l-1;n>a;){if(d[--n]=0;){for(r=0,m=S[s]%C,y=S[s]/C|0,i=s+(o=u);i>s;)r=((c=m*(c=R[--o]%C)+(a=y*c+(p=R[o]/C|0)*m)%C*C+E[i]+r)/w|0)+(a/C|0)+y*p,E[i--]=c%w;E[i]=r}return r?++n:E.splice(0,1),$(e,E,n)},A.negated=function(){var e=new G(this);return e.s=-e.s||null,e},A.plus=function(e,t){var r,n=this,s=n.s;if(t=(e=new G(e,t)).s,!s||!t)return new G(NaN);if(s!=t)return e.s=-t,n.minus(e);var i=n.e/h,o=e.e/h,a=n.c,u=e.c;if(!i||!o){if(!a||!u)return new G(s/0);if(!a[0]||!u[0])return u[0]?e:new G(a[0]?n:0*s)}if(i=g(i),o=g(o),a=a.slice(),s=i-o){for(s>0?(o=i,r=u):(s=-s,r=a),r.reverse();s--;r.push(0));r.reverse()}for((s=a.length)-(t=u.length)<0&&(r=u,u=a,a=r,t=s),s=0;t;)s=(a[--t]=a[t]+u[t]+s)/l|0,a[t]=l===a[t]?0:a[t]%l;return s&&(a=[s].concat(a),++o),$(e,a,o)},A.precision=A.sd=function(e,t){var r,n,s,i=this;if(null!=e&&e!==!!e)return y(e,1,p),null==t?t=P:y(t,0,8),K(new G(i),e,t);if(!(r=i.c))return null;if(n=(s=r.length-1)*h+1,s=r[s]){for(;s%10==0;s/=10,n--);for(s=r[0];s>=10;s/=10,n++);}return e&&i.e+1>n&&(n=i.e+1),n},A.shiftedBy=function(e){return y(e,-9007199254740991,u),this.times("1e"+e)},A.squareRoot=A.sqrt=function(){var e,t,n,s,i,o=this,a=o.c,l=o.s,h=o.e,u=x+4,c=new G("0.5");if(1!==l||!a||!a[0])return new G(!l||l<0&&(!a||a[0])?NaN:a?o:1/0);if(0==(l=Math.sqrt(+X(o)))||l==1/0?(((t=f(a)).length+h)%2==0&&(t+="0"),l=Math.sqrt(+t),h=g((h+1)/2)-(h<0||h%2),n=new G(t=l==1/0?"5e"+h:(t=l.toExponential()).slice(0,t.indexOf("e")+1)+h)):n=new G(l+""),n.c[0])for((l=(h=n.e)+u)<3&&(l=0);;)if(i=n,n=c.times(i.plus(r(o,i,u,1))),f(i.c).slice(0,l)===(t=f(n.c)).slice(0,l)){if(n.e0&&f>0){for(i=f%l||l,c=g.substr(0,i);i0&&(c+=u+g.slice(i)),p&&(c="-"+c)}n=d?c+(r.decimalSeparator||"")+((h=+r.fractionGroupSize)?d.replace(new RegExp("\\d{"+h+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):d):c}return(r.prefix||"")+n+(r.suffix||"")},A.toFraction=function(e){var t,n,s,i,a,l,u,d,p,g,m,y,E=this,w=E.c;if(null!=e&&(!(u=new G(e)).isInteger()&&(u.c||1!==u.s)||u.lt(I)))throw Error(o+"Argument "+(u.isInteger()?"out of range: ":"not an integer: ")+X(u));if(!w)return new G(E);for(t=new G(I),p=n=new G(I),s=d=new G(I),y=f(w),a=t.e=y.length-E.e-1,t.c[0]=c[(l=a%h)<0?h+l:l],e=!e||u.comparedTo(t)>0?a>0?t:p:u,l=H,H=1/0,u=new G(y),d.c[0]=0;g=r(u,t,0,1),1!=(i=n.plus(g.times(s))).comparedTo(e);)n=s,s=i,p=d.plus(g.times(i=p)),d=i,t=u.minus(g.times(i=t)),u=i;return i=r(e.minus(n),s,0,1),d=d.plus(i.times(p)),n=n.plus(i.times(s)),d.s=p.s=E.s,m=r(p,s,a*=2,P).minus(E).abs().comparedTo(r(d,n,a,P).minus(E).abs())<1?[p,s]:[d,n],H=l,m},A.toNumber=function(){return+X(this)},A.toPrecision=function(e,t){return null!=e&&y(e,1,p),j(this,e,t,2)},A.toString=function(e){var t,r=this,n=r.s,s=r.e;return null===s?n?(t="Infinity",n<0&&(t="-"+t)):t="NaN":(null==e?t=s<=L||s>=D?w(f(r.c),s):C(f(r.c),s,"0"):10===e&&Y?t=C(f((r=K(new G(r),x+s+1,P)).c),r.e,"0"):(y(e,2,W.length,"Base"),t=v(C(f(r.c),s,"0"),10,e,n,!0)),n<0&&r.c[0]&&(t="-"+t)),t},A.valueOf=A.toJSON=function(){return X(this)},A._isBigNumber=!0,null!=t&&G.set(t),G}(),r.default=r.BigNumber=r,e.exports?e.exports=r:(t||(t="undefined"!=typeof self&&self?self:window),t.BigNumber=r)}(h)}(w);var C=w.exports; +/*! + * Copyright (c) 2017 Benjamin Van Ryseghem + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */const v=y(),R=p(),S=m,T=C,N={trillion:Math.pow(10,12),billion:Math.pow(10,9),million:Math.pow(10,6),thousand:Math.pow(10,3)},M={totalLength:0,characteristic:0,forceAverage:!1,average:!1,mantissa:-1,optionalMantissa:!0,thousandSeparated:!1,spaceSeparated:!1,negative:"sign",forceSign:!1,roundingFunction:Math.round,spaceSeparatedAbbreviation:!1},{binarySuffixes:_,decimalSuffixes:b}=v.currentBytes(),O={general:{scale:1024,suffixes:b,marker:"bd"},binary:{scale:1024,suffixes:_,marker:"b"},decimal:{scale:1e3,suffixes:b,marker:"d"}};function A(e,t={},r){if("string"==typeof t&&(t=S.parseFormat(t)),!R.validateFormat(t))return"ERROR: invalid format";let n=t.prefix||"",s=t.postfix||"",i=function(e,t,r){switch(t.output){case"currency":return function(e,t,r){const n=r.currentCurrency();let s,i=Object.assign({},t),o=Object.assign({},M,i),a="",l=!!o.totalLength||!!o.forceAverage||o.average,h=i.currencyPosition||n.position,u=i.currencySymbol||n.symbol;const c=void 0!==o.spaceSeparatedCurrency?o.spaceSeparatedCurrency:o.spaceSeparated;void 0===i.lowPrecision&&(i.lowPrecision=!1);c&&(a=" ");"infix"===h&&(s=a+u+a);let d=L({instance:e,providedFormat:i,state:r,decimalSeparator:s});"prefix"===h&&(d=e._value<0&&"sign"===o.negative?`-${a}${u}${d.slice(1)}`:e._value>0&&o.forceSign?`+${a}${u}${d.slice(1)}`:u+a+d);h&&"postfix"!==h||(a=!o.spaceSeparatedAbbreviation&&l?"":a,d=d+a+u);return d}(e,t=D(t,v.currentCurrencyDefaultFormat()),v);case"percent":return function(e,t,r,n){let s=t.prefixSymbol,i=L({instance:n(100*e._value),providedFormat:t,state:r}),o=Object.assign({},M,t);if(s)return`%${o.spaceSeparated?" ":""}${i}`;return`${i}${o.spaceSeparated?" ":""}%`}(e,t=D(t,v.currentPercentageDefaultFormat()),v,r);case"byte":return function(e,t,r,n){let s=t.base||"binary",i=Object.assign({},M,t);const{binarySuffixes:o,decimalSuffixes:a}=r.currentBytes();let l={general:{scale:1024,suffixes:a||b,marker:"bd"},binary:{scale:1024,suffixes:o||_,marker:"b"},decimal:{scale:1e3,suffixes:a||b,marker:"d"}}[s],{value:h,suffix:u}=I(e._value,l.suffixes,l.scale),c=L({instance:n(h),providedFormat:t,state:r,defaults:r.currentByteDefaultFormat()});return`${c}${i.spaceSeparated?" ":""}${u}`}(e,t=D(t,v.currentByteDefaultFormat()),v,r);case"time":return t=D(t,v.currentTimeDefaultFormat()),function(e){let t=Math.floor(e._value/60/60),r=Math.floor((e._value-60*t*60)/60),n=Math.round(e._value-60*t*60-60*r);return`${t}:${r<10?"0":""}${r}:${n<10?"0":""}${n}`}(e);case"ordinal":return function(e,t,r){let n=r.currentOrdinal(),s=Object.assign({},M,t),i=L({instance:e,providedFormat:t,state:r}),o=n(e._value);return`${i}${s.spaceSeparated?" ":""}${o}`}(e,t=D(t,v.currentOrdinalDefaultFormat()),v);default:return L({instance:e,providedFormat:t,numbro:r})}}(e,t,r);return i=function(e,t){return t+e}(i,n),i=function(e,t){return e+t}(i,s),i}function I(e,t,r){let n=t[0],s=Math.abs(e);if(s>=r){for(let i=1;i=o&&s0)r=i+o+x(s-o.length);else{let e=".";e=+i<0?`-0${e}`:`0${e}`;let n=(x(-s-1)+Math.abs(i)+o).substr(0,t);n.length0&&t>0&&(r+=`.${x(t)}`),r}(e,t);return new T(r(+`${e}e+${t}`)/Math.pow(10,t)).toFixed(t)}function L({instance:e,providedFormat:t,state:r=v,decimalSeparator:n,defaults:s=r.currentDefaults()}){let i=e._value;if(0===i&&r.hasZeroFormat())return r.getZeroFormat();if(!isFinite(i))return i.toString();let o=Object.assign({},M,s,t),a=o.totalLength,l=a?0:o.characteristic,h=o.optionalCharacteristic,u=o.forceAverage,c=o.lowPrecision,d=!!a||!!u||o.average,p=a?-1:d&&void 0===t.mantissa?0:o.mantissa,g=!a&&(void 0===t.optionalMantissa?-1===p:o.optionalMantissa),f=o.trimMantissa,m=o.thousandSeparated,y=o.spaceSeparated,E=o.negative,w=o.forceSign,C=o.exponential,R=o.roundingFunction,S="";if(d){let e=function({value:e,forceAverage:t,lowPrecision:r=!0,abbreviations:n,spaceSeparated:s=!1,totalLength:i=0,roundingFunction:o=Math.round}){let a="",l=Math.abs(e),h=-1;if(t&&n[t]&&N[t]?(a=n[t],e/=N[t]):l>=N.trillion||r&&1===o(l/N.trillion)?(a=n.trillion,e/=N.trillion):l=N.billion||r&&1===o(l/N.billion)?(a=n.billion,e/=N.billion):l=N.million||r&&1===o(l/N.million)?(a=n.million,e/=N.million):(l=N.thousand||r&&1===o(l/N.thousand))&&(a=n.thousand,e/=N.thousand),a&&(a=(s?" ":"")+a),i){let t=e<0,r=e.toString().split(".")[0],n=t?r.length-1:r.length;h=Math.max(i-n,0)}return{value:e,abbreviation:a,mantissaPrecision:h}}({value:i,forceAverage:u,lowPrecision:c,abbreviations:r.currentAbbreviations(),spaceSeparated:y,roundingFunction:R,totalLength:a});i=e.value,S+=e.abbreviation,a&&(p=e.mantissaPrecision)}if(C){let e=function({value:e,characteristicPrecision:t}){let[r,n]=e.toExponential().split("e"),s=+r;return t?(1=0?`+${n}`:n),{value:s,abbreviation:`e${n}`}):{value:s,abbreviation:`e${n}`}}({value:i,characteristicPrecision:l});i=e.value,S=e.abbreviation+S}let T=function(e,t,r,n,s,i){if(-1===n)return e;let o=P(t,n,i),[a,l=""]=o.toString().split(".");if(l.match(/^0+$/)&&(r||s))return a;let h=l.match(/0+$/);return s&&h?`${a}.${l.toString().slice(0,h.index)}`:o.toString()}(i.toString(),i,g,p,f,R);return T=function(e,t,r,n){let s=e,[i,o]=s.toString().split(".");if(i.match(/^-?0$/)&&r)return o?`${i.replace("0","")}.${o}`:i.replace("0","");const a=t<0&&0===i.indexOf("-");if(a&&(i=i.slice(1),s=s.slice(1)),i.length0;s--)n===t&&(r.unshift(s),n=0),n++;return r}(h.length,a);e.forEach(((e,t)=>{h=h.slice(0,e+t)+o+h.slice(e+t)})),c&&(h=`-${h}`)}return l=u?h+s+u:h,l}(T,i,m,r,n),(d||C)&&(T=function(e,t){return e+t}(T,S)),(w||i<0)&&(T=function(e,t,r){return 0===t?e:0==+e?e.replace("-",""):t>0?`+${e}`:"sign"===r?e:`(${e.replace("-","")})`}(T,i,E)),T}function D(e,t){if(!e)return t;let r=Object.keys(e);return 1===r.length&&"output"===r[0]?t:e} +/*! + * Copyright (c) 2017 Benjamin Van Ryseghem + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +const k=C;function H(e,t,r){let n=new k(e._value),s=t;return r.isNumbro(t)&&(s=t._value),s=new k(s),e._value=n.minus(s).toNumber(),e} +/*! + * Copyright (c) 2017 Benjamin Van Ryseghem + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +const F=y(),U=p(),V=(e=>({loadLanguagesInNode:t=>E(t,e)}))($),B=d();let W=(e=>({format:(...t)=>A(...t,e),getByteUnit:(...t)=>function(e){let t=O.general;return I(e._value,t.suffixes,t.scale).suffix}(...t,e),getBinaryByteUnit:(...t)=>function(e){let t=O.binary;return I(e._value,t.suffixes,t.scale).suffix}(...t,e),getDecimalByteUnit:(...t)=>function(e){let t=O.decimal;return I(e._value,t.suffixes,t.scale).suffix}(...t,e),formatOrDefault:D}))($),Y=(e=>({add:(t,r)=>function(e,t,r){let n=new k(e._value),s=t;return r.isNumbro(t)&&(s=t._value),s=new k(s),e._value=n.plus(s).toNumber(),e}(t,r,e),subtract:(t,r)=>H(t,r,e),multiply:(t,r)=>function(e,t,r){let n=new k(e._value),s=t;return r.isNumbro(t)&&(s=t._value),s=new k(s),e._value=n.times(s).toNumber(),e}(t,r,e),divide:(t,r)=>function(e,t,r){let n=new k(e._value),s=t;return r.isNumbro(t)&&(s=t._value),s=new k(s),e._value=n.dividedBy(s).toNumber(),e}(t,r,e),set:(t,r)=>function(e,t,r){let n=t;return r.isNumbro(t)&&(n=t._value),e._value=n,e}(t,r,e),difference:(t,r)=>function(e,t,r){let n=r(e._value);return H(n,t,r),Math.abs(n._value)}(t,r,e),BigNumber:k}))($);const G=m;class j{constructor(e){this._value=e}clone(){return $(this._value)}format(e={}){return W.format(this,e)}formatCurrency(e){return"string"==typeof e&&(e=G.parseFormat(e)),(e=W.formatOrDefault(e,F.currentCurrencyDefaultFormat())).output="currency",W.format(this,e)}formatTime(e={}){return e.output="time",W.format(this,e)}binaryByteUnits(){return W.getBinaryByteUnit(this)}decimalByteUnits(){return W.getDecimalByteUnit(this)}byteUnits(){return W.getByteUnit(this)}difference(e){return Y.difference(this,e)}add(e){return Y.add(this,e)}subtract(e){return Y.subtract(this,e)}multiply(e){return Y.multiply(this,e)}divide(e){return Y.divide(this,e)}set(e){return Y.set(this,z(e))}value(){return this._value}valueOf(){return this._value}}function z(e){let t=e;return $.isNumbro(e)?t=e._value:"string"==typeof e?t=$.unformat(e):isNaN(e)&&(t=NaN),t}function $(e){return new j(z(e))}$.version="2.5.0",$.isNumbro=function(e){return e instanceof j},$.language=F.currentLanguage,$.registerLanguage=F.registerLanguage,$.setLanguage=F.setLanguage,$.languages=F.languages,$.languageData=F.languageData,$.zeroFormat=F.setZeroFormat,$.defaultFormat=F.currentDefaults,$.setDefaults=F.setDefaults,$.defaultCurrencyFormat=F.currentCurrencyDefaultFormat,$.validate=U.validate,$.loadLanguagesInNode=V.loadLanguagesInNode,$.unformat=B.unformat,$.BigNumber=Y.BigNumber;var K=u($);window.numbro=r(80586).default},35358:(e,t,r)=>{var n={"./af":37086,"./af.js":37086,"./ar":73762,"./ar-dz":17289,"./ar-dz.js":17289,"./ar-kw":65145,"./ar-kw.js":65145,"./ar-ly":70872,"./ar-ly.js":70872,"./ar-ma":66569,"./ar-ma.js":66569,"./ar-ps":90470,"./ar-ps.js":90470,"./ar-sa":25819,"./ar-sa.js":25819,"./ar-tn":39685,"./ar-tn.js":39685,"./ar.js":73762,"./az":38906,"./az.js":38906,"./be":22956,"./be.js":22956,"./bg":11414,"./bg.js":11414,"./bm":42516,"./bm.js":42516,"./bn":63933,"./bn-bd":49888,"./bn-bd.js":49888,"./bn.js":63933,"./bo":30718,"./bo.js":30718,"./br":44169,"./br.js":44169,"./bs":96954,"./bs.js":96954,"./ca":97417,"./ca.js":97417,"./cs":97527,"./cs.js":97527,"./cv":92556,"./cv.js":92556,"./cy":67105,"./cy.js":67105,"./da":14130,"./da.js":14130,"./de":21918,"./de-at":18158,"./de-at.js":18158,"./de-ch":98952,"./de-ch.js":98952,"./de.js":21918,"./dv":53611,"./dv.js":53611,"./el":25496,"./el.js":25496,"./en-au":28809,"./en-au.js":28809,"./en-ca":7275,"./en-ca.js":7275,"./en-gb":57306,"./en-gb.js":57306,"./en-ie":2609,"./en-ie.js":2609,"./en-il":82970,"./en-il.js":82970,"./en-in":46192,"./en-in.js":46192,"./en-nz":20851,"./en-nz.js":20851,"./en-sg":97953,"./en-sg.js":97953,"./eo":5137,"./eo.js":5137,"./es":18741,"./es-do":30147,"./es-do.js":30147,"./es-mx":49999,"./es-mx.js":49999,"./es-us":17778,"./es-us.js":17778,"./es.js":18741,"./et":75712,"./et.js":75712,"./eu":65431,"./eu.js":65431,"./fa":61716,"./fa.js":61716,"./fi":61388,"./fi.js":61388,"./fil":7858,"./fil.js":7858,"./fo":89098,"./fo.js":89098,"./fr":72237,"./fr-ca":55218,"./fr-ca.js":55218,"./fr-ch":58713,"./fr-ch.js":58713,"./fr.js":72237,"./fy":31260,"./fy.js":31260,"./ga":25485,"./ga.js":25485,"./gd":39842,"./gd.js":39842,"./gl":4986,"./gl.js":4986,"./gom-deva":18691,"./gom-deva.js":18691,"./gom-latn":87812,"./gom-latn.js":87812,"./gu":28833,"./gu.js":28833,"./he":63434,"./he.js":63434,"./hi":24254,"./hi.js":24254,"./hr":87235,"./hr.js":87235,"./hu":26074,"./hu.js":26074,"./hy-am":63237,"./hy-am.js":63237,"./id":58844,"./id.js":58844,"./is":86937,"./is.js":86937,"./it":5324,"./it-ch":4566,"./it-ch.js":4566,"./it.js":5324,"./ja":38728,"./ja.js":38728,"./jv":49165,"./jv.js":49165,"./ka":17905,"./ka.js":17905,"./kk":82759,"./kk.js":82759,"./km":7525,"./km.js":7525,"./kn":77788,"./kn.js":77788,"./ko":59427,"./ko.js":59427,"./ku":88029,"./ku-kmr":92022,"./ku-kmr.js":92022,"./ku.js":88029,"./ky":5881,"./ky.js":5881,"./lb":60039,"./lb.js":60039,"./lo":45284,"./lo.js":45284,"./lt":5909,"./lt.js":5909,"./lv":47891,"./lv.js":47891,"./me":52047,"./me.js":52047,"./mi":4163,"./mi.js":4163,"./mk":47301,"./mk.js":47301,"./ml":46800,"./ml.js":46800,"./mn":84122,"./mn.js":84122,"./mr":17886,"./mr.js":17886,"./ms":51101,"./ms-my":11680,"./ms-my.js":11680,"./ms.js":51101,"./mt":70888,"./mt.js":70888,"./my":18227,"./my.js":18227,"./nb":78629,"./nb.js":78629,"./ne":12304,"./ne.js":12304,"./nl":40847,"./nl-be":45745,"./nl-be.js":45745,"./nl.js":40847,"./nn":11249,"./nn.js":11249,"./oc-lnc":45617,"./oc-lnc.js":45617,"./pa-in":24532,"./pa-in.js":24532,"./pl":51001,"./pl.js":51001,"./pt":43793,"./pt-br":77498,"./pt-br.js":77498,"./pt.js":43793,"./ro":95758,"./ro.js":95758,"./ru":34220,"./ru.js":34220,"./sd":34646,"./sd.js":34646,"./se":26709,"./se.js":26709,"./si":37089,"./si.js":37089,"./sk":18271,"./sk.js":18271,"./sl":11422,"./sl.js":11422,"./sq":67401,"./sq.js":67401,"./sr":17040,"./sr-cyrl":65775,"./sr-cyrl.js":65775,"./sr.js":17040,"./ss":40263,"./ss.js":40263,"./sv":92764,"./sv.js":92764,"./sw":74403,"./sw.js":74403,"./ta":65026,"./ta.js":65026,"./te":58830,"./te.js":58830,"./tet":4048,"./tet.js":4048,"./tg":86436,"./tg.js":86436,"./th":18505,"./th.js":18505,"./tk":33968,"./tk.js":33968,"./tl-ph":63422,"./tl-ph.js":63422,"./tlh":45441,"./tlh.js":45441,"./tr":92671,"./tr.js":92671,"./tzl":4659,"./tzl.js":4659,"./tzm":80204,"./tzm-latn":67956,"./tzm-latn.js":67956,"./tzm.js":80204,"./ug-cn":65191,"./ug-cn.js":65191,"./uk":21949,"./uk.js":21949,"./ur":23174,"./ur.js":23174,"./uz":26158,"./uz-latn":19286,"./uz-latn.js":19286,"./uz.js":26158,"./vi":12284,"./vi.js":12284,"./x-pseudo":14912,"./x-pseudo.js":14912,"./yo":59357,"./yo.js":59357,"./zh-cn":1313,"./zh-cn.js":1313,"./zh-hk":73021,"./zh-hk.js":73021,"./zh-mo":21312,"./zh-mo.js":21312,"./zh-tw":16629,"./zh-tw.js":16629};function s(e){var t=i(e);return r(t)}function i(e){if(!r.o(n,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}s.keys=function(){return Object.keys(n)},s.resolve=i,e.exports=s,s.id=35358},72679:(e,t)=>{"use strict";t.__esModule=!0,t.parse=function(e){const t=[[""]];if(0===e.length)return t;let i,o=0,a=0;for(;e.length>0&&i!==e.length;)if(i=e.length,e.match(s))e=e.replace(s,""),o+=1,t[a][o]="";else if(e.match(r))e=e.replace(r,""),o=0,a+=1,t[a]=[""];else{let r="";if(e.startsWith('"')){let t=0,n=!0;for(;n;){const s=e.slice(0,1);'"'===s&&(t+=1),r+=s,(0===(e=e.slice(1)).length||e.match(/^[\t\r\n]/)&&t%2==0)&&(n=!1)}r=r.replace(/^"/,"").replace(/"$/,"").replace(/["]*/g,(e=>new Array(Math.floor(e.length/2)).fill('"').join("")))}else{const t=e.match(n);r=t?t[0]:"",e=e.slice(r.length)}t[a][o]=r}return t},t.stringify=function(e){let t,r,n,s,i,o="";for(t=0,r=e.length;t0&&(o+="\t"),i=e[t][n],"string"==typeof i?i.indexOf("\n")>-1?o+=`"${i.replace(/"/g,'""')}"`:o+=i:o+=null==i?"":i;t!==r-1&&(o+="\n")}return o};const r=/^(\r\n|\n\r|\r|\n)/,n=/^[^\t\r\n]+/,s=/^\t/},42354:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(72679);t.parse=n.parse,t.stringify=n.stringify},60512:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(95913),r(12587);var s=n(r(85707));t.FullyVisibleColumnsCalculationType=class{constructor(){(0,s.default)(this,"count",0),(0,s.default)(this,"startColumn",null),(0,s.default)(this,"endColumn",null),(0,s.default)(this,"startPosition",null),(0,s.default)(this,"isVisibleInTrimmingContainer",!1)}initialize(){}process(e,t){const{totalCalculatedWidth:r,zeroBasedScrollOffset:n,viewportWidth:s,columnWidth:i}=t;r>=n&&r+i<=n+(n>0?s+1:s)&&(null!==this.startColumn&&void 0!==this.startColumn||(this.startColumn=e),this.endColumn=e)}finalize(e){var t;const{scrollOffset:r,viewportWidth:n,inlineStartOffset:s,zeroBasedScrollOffset:i,totalColumns:o,needReverse:a,startPositions:l,columnWidth:h}=e;if(this.endColumn===o-1&&a)for(this.startColumn=this.endColumn;this.startColumn>0;){const e=l[this.endColumn]+h-l[this.startColumn-1];if(e<=n&&(this.startColumn-=1),e>=n)break}this.startPosition=null!==(t=l[this.startColumn])&&void 0!==t?t:null;const u=r+n-(i>0?n+1:n),c=null===this.startColumn?0:e.getColumnWidth(this.startColumn);u<-1*s||r>l.at(-1)||-1*r-n>-1*c?this.isVisibleInTrimmingContainer=!1:this.isVisibleInTrimmingContainer=!0,o{"use strict";var n=r(96784);t.__esModule=!0,r(95913),r(12587);var s=n(r(85707));t.FullyVisibleRowsCalculationType=class{constructor(){(0,s.default)(this,"count",0),(0,s.default)(this,"startRow",null),(0,s.default)(this,"endRow",null),(0,s.default)(this,"startPosition",null),(0,s.default)(this,"isVisibleInTrimmingContainer",!1)}initialize(){}process(e,t){const{totalCalculatedHeight:r,zeroBasedScrollOffset:n,innerViewportHeight:s,rowHeight:i}=t;r>=n&&r+i<=s&&(null===this.startRow&&(this.startRow=e),this.endRow=e)}finalize(e){var t;const{scrollOffset:r,viewportHeight:n,horizontalScrollbarHeight:s,totalRows:i,needReverse:o,startPositions:a,rowHeight:l}=e;if(this.endRow===i-1&&o)for(this.startRow=this.endRow;this.startRow>0;){const e=a[this.endRow]+l-a[this.startRow-1];if(e<=n-s&&(this.startRow-=1),e>=n-s)break}this.startPosition=null!==(t=a[this.startRow])&&void 0!==t?t:null;r+n-s<(null===this.startRow?0:e.getRowHeight(this.startRow))||r>a.at(-1)?this.isVisibleInTrimmingContainer=!1:this.isVisibleInTrimmingContainer=!0,i{"use strict";var n=r(96784);t.__esModule=!0,r(95913),r(12587);var s=n(r(85707));t.PartiallyVisibleColumnsCalculationType=class{constructor(){(0,s.default)(this,"count",0),(0,s.default)(this,"startColumn",null),(0,s.default)(this,"endColumn",null),(0,s.default)(this,"startPosition",null),(0,s.default)(this,"isVisibleInTrimmingContainer",!1)}initialize(){}process(e,t){const{totalCalculatedWidth:r,zeroBasedScrollOffset:n,viewportWidth:s}=t;r<=n&&(this.startColumn=e);r>=n&&r<=n+(n>0?s+1:s)&&(null!==this.startColumn&&void 0!==this.startColumn||(this.startColumn=e)),this.endColumn=e}finalize(e){var t;const{scrollOffset:r,viewportWidth:n,inlineStartOffset:s,zeroBasedScrollOffset:i,totalColumns:o,needReverse:a,startPositions:l,columnWidth:h}=e;if(this.endColumn===o-1&&a)for(this.startColumn=this.endColumn;this.startColumn>0;){const e=l[this.endColumn]+h-l[this.startColumn-1];if(this.startColumn-=1,e>n)break}this.startPosition=null!==(t=l[this.startColumn])&&void 0!==t?t:null;r+n-(i>0?n+1:n)<-1*s||r>l.at(-1)+h||-1*r-n>0?this.isVisibleInTrimmingContainer=!1:this.isVisibleInTrimmingContainer=!0,o{"use strict";var n=r(96784);t.__esModule=!0,r(95913),r(12587);var s=n(r(85707));t.PartiallyVisibleRowsCalculationType=class{constructor(){(0,s.default)(this,"count",0),(0,s.default)(this,"startRow",null),(0,s.default)(this,"endRow",null),(0,s.default)(this,"startPosition",null),(0,s.default)(this,"isVisibleInTrimmingContainer",!1)}initialize(){}process(e,t){const{totalCalculatedHeight:r,zeroBasedScrollOffset:n,innerViewportHeight:s}=t;r<=n&&(this.startRow=e),r>=n&&r<=s&&null===this.startRow&&(this.startRow=e),this.endRow=e}finalize(e){var t;const{scrollOffset:r,viewportHeight:n,horizontalScrollbarHeight:s,totalRows:i,needReverse:o,startPositions:a,rowHeight:l}=e;if(this.endRow===i-1&&o)for(this.startRow=this.endRow;this.startRow>0;){const e=a[this.endRow]+l-a[this.startRow-1];if(this.startRow-=1,e>=n-s)break}this.startPosition=null!==(t=a[this.startRow])&&void 0!==t?t:null;r+n-s<0||r>a.at(-1)+l?this.isVisibleInTrimmingContainer=!1:this.isVisibleInTrimmingContainer=!0,i{"use strict";var n=r(96784);t.__esModule=!0;var s=n(r(85707));t.RenderedAllColumnsCalculationType=class{constructor(){(0,s.default)(this,"count",0),(0,s.default)(this,"startColumn",0),(0,s.default)(this,"endColumn",0),(0,s.default)(this,"startPosition",0),(0,s.default)(this,"isVisibleInTrimmingContainer",!0)}initialize(e){let{totalColumns:t}=e;this.count=t,this.endColumn=this.count-1}process(){}finalize(){}}},74892:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0;var s=n(r(85707));t.RenderedAllRowsCalculationType=class{constructor(){(0,s.default)(this,"count",0),(0,s.default)(this,"startRow",0),(0,s.default)(this,"endRow",0),(0,s.default)(this,"startPosition",0),(0,s.default)(this,"isVisibleInTrimmingContainer",!0)}initialize(e){let{totalRows:t}=e;this.count=t,this.endRow=this.count-1}process(){}finalize(){}}},2069:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0;var s=n(r(85707)),i=r(48454);class o extends i.PartiallyVisibleColumnsCalculationType{constructor(){super(...arguments),(0,s.default)(this,"columnStartOffset",0),(0,s.default)(this,"columnEndOffset",0)}finalize(e){var t;super.finalize(e);const{overrideFn:r,totalColumns:n,startPositions:s}=e;if(null!==this.startColumn&&"function"==typeof r){const e=this.startColumn,t=this.endColumn;r(this),this.columnStartOffset=e-this.startColumn,this.columnEndOffset=this.endColumn-t}this.startColumn<0&&(this.startColumn=0),this.startPosition=null!==(t=s[this.startColumn])&&void 0!==t?t:null,n{"use strict";var n=r(96784);t.__esModule=!0;var s=n(r(85707)),i=r(22488);class o extends i.PartiallyVisibleRowsCalculationType{constructor(){super(...arguments),(0,s.default)(this,"rowStartOffset",0),(0,s.default)(this,"rowEndOffset",0)}finalize(e){var t;super.finalize(e);const{overrideFn:r,totalRows:n,startPositions:s}=e;if(null!==this.startRow&&"function"==typeof r){const e=this.startRow,t=this.endRow;r(this),this.rowStartOffset=e-this.startRow,this.rowEndOffset=this.endRow-t}this.startRow<0&&(this.startRow=0),this.startPosition=null!==(t=s[this.startRow])&&void 0!==t?t:null,n{"use strict";t.__esModule=!0;var n=r(60512);t.FullyVisibleColumnsCalculationType=n.FullyVisibleColumnsCalculationType;var s=r(71782);t.FullyVisibleRowsCalculationType=s.FullyVisibleRowsCalculationType;var i=r(48454);t.PartiallyVisibleColumnsCalculationType=i.PartiallyVisibleColumnsCalculationType;var o=r(22488);t.PartiallyVisibleRowsCalculationType=o.PartiallyVisibleRowsCalculationType;var a=r(24746);t.RenderedAllColumnsCalculationType=a.RenderedAllColumnsCalculationType;var l=r(74892);t.RenderedAllRowsCalculationType=l.RenderedAllRowsCalculationType;var h=r(2069);t.RenderedColumnsCalculationType=h.RenderedColumnsCalculationType;var u=r(79221);t.RenderedRowsCalculationType=u.RenderedRowsCalculationType;var c=r(83786);t.ViewportColumnsCalculator=c.ViewportColumnsCalculator,t.DEFAULT_COLUMN_WIDTH=c.DEFAULT_WIDTH;var d=r(7628);t.ViewportRowsCalculator=d.ViewportRowsCalculator},83820:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(14846),r(69655);var s=n(r(85707));t.ViewportBaseCalculator=class{constructor(e){(0,s.default)(this,"calculationTypes",[]),(0,s.default)(this,"calculationResults",new Map),this.calculationTypes=e}_initialize(e){this.calculationTypes.forEach((t=>{let[r,n]=t;this.calculationResults.set(r,n),n.initialize(e)}))}_process(e,t){this.calculationTypes.forEach((r=>{let[,n]=r;return n.process(e,t)}))}_finalize(e){this.calculationTypes.forEach((t=>{let[,r]=t;return r.finalize(e)}))}getResultsFor(e){return this.calculationResults.get(e)}}},83786:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(15724);var s=n(r(85707)),i=r(83820);const o=t.DEFAULT_WIDTH=50;class a extends i.ViewportBaseCalculator{constructor(e){let{calculationTypes:t,viewportWidth:r,scrollOffset:n,totalColumns:i,columnWidthFn:o,overrideFn:a,inlineStartOffset:l}=e;super(t),(0,s.default)(this,"viewportWidth",0),(0,s.default)(this,"scrollOffset",0),(0,s.default)(this,"zeroBasedScrollOffset",0),(0,s.default)(this,"totalColumns",0),(0,s.default)(this,"columnWidthFn",null),(0,s.default)(this,"columnWidth",0),(0,s.default)(this,"overrideFn",null),(0,s.default)(this,"inlineStartOffset",0),(0,s.default)(this,"totalCalculatedWidth",0),(0,s.default)(this,"startPositions",[]),(0,s.default)(this,"needReverse",!0),this.viewportWidth=r,this.scrollOffset=n,this.zeroBasedScrollOffset=Math.max(n,0),this.totalColumns=i,this.columnWidthFn=o,this.overrideFn=a,this.inlineStartOffset=l,this.calculate()}calculate(){this._initialize(this);for(let e=0;e=this.zeroBasedScrollOffset+this.viewportWidth){this.needReverse=!1;break}this._finalize(this)}getColumnWidth(e){const t=this.columnWidthFn(e);return isNaN(t)?o:t}}t.ViewportColumnsCalculator=a},7628:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(15724);var s=n(r(85707)),i=r(83820);class o extends i.ViewportBaseCalculator{constructor(e){let{calculationTypes:t,viewportHeight:r,scrollOffset:n,totalRows:i,defaultRowHeight:o,rowHeightFn:a,overrideFn:l,horizontalScrollbarHeight:h}=e;super(t),(0,s.default)(this,"viewportHeight",0),(0,s.default)(this,"scrollOffset",0),(0,s.default)(this,"zeroBasedScrollOffset",0),(0,s.default)(this,"totalRows",0),(0,s.default)(this,"rowHeightFn",null),(0,s.default)(this,"rowHeight",0),(0,s.default)(this,"overrideFn",null),(0,s.default)(this,"horizontalScrollbarHeight",0),(0,s.default)(this,"innerViewportHeight",0),(0,s.default)(this,"totalCalculatedHeight",0),(0,s.default)(this,"startPositions",[]),(0,s.default)(this,"needReverse",!0),this.defaultHeight=o,this.viewportHeight=r,this.scrollOffset=n,this.zeroBasedScrollOffset=Math.max(n,0),this.totalRows=i,this.rowHeightFn=a,this.overrideFn=l,this.horizontalScrollbarHeight=null!=h?h:0,this.innerViewportHeight=this.zeroBasedScrollOffset+this.viewportHeight-this.horizontalScrollbarHeight,this.calculate()}calculate(){this._initialize(this);for(let e=0;e=this.innerViewportHeight){this.needReverse=!1;break}this._finalize(this)}getRowHeight(e){const t=this.rowHeightFn(e);return isNaN(t)?this.defaultHeight:t}}t.ViewportRowsCalculator=o},2141:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834);var s=n(r(85707));function i(e,t,r){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}function o(e,t){return e.get(l(e,t))}function a(e,t,r){return e.set(l(e,t),r),r}function l(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var h=new WeakMap;class u{constructor(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];(0,s.default)(this,"row",null),(0,s.default)(this,"col",null),i(this,h,!1),a(h,this,r),void 0!==e&&void 0!==t&&(this.row=e,this.col=t)}isValid(e){const{countRows:t,countCols:r,countRowHeaders:n,countColHeaders:s}={countRows:0,countCols:0,countRowHeaders:0,countColHeaders:0,...e};return!(!Number.isInteger(this.row)||!Number.isInteger(this.col))&&(!(this.row<-s||this.col<-n)&&!(this.row>=t||this.col>=r))}isEqual(e){return e===this||this.row===e.row&&this.col===e.col}isHeader(){return!this.isCell()}isCell(){return this.row>=0&&this.col>=0}isRtl(){return o(h,this)}isSouthEastOf(e){return this.row>=e.row&&(o(h,this)?this.col<=e.col:this.col>=e.col)}isNorthWestOf(e){return this.row<=e.row&&(o(h,this)?this.col>=e.col:this.col<=e.col)}isSouthWestOf(e){return this.row>=e.row&&(o(h,this)?this.col>=e.col:this.col<=e.col)}isNorthEastOf(e){return this.row<=e.row&&(o(h,this)?this.col<=e.col:this.col>=e.col)}normalize(){return this.row=null===this.row?this.row:Math.max(this.row,0),this.col=null===this.col?this.col:Math.max(this.col,0),this}assign(e){return Number.isInteger(null==e?void 0:e.row)&&(this.row=e.row),Number.isInteger(null==e?void 0:e.col)&&(this.col=e.col),e instanceof u&&a(h,this,e.isRtl()),this}clone(){return new u(this.row,this.col,o(h,this))}toObject(){return{row:this.row,col:this.col}}}t.default=u},16818:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834),r(15724);var s=n(r(85707)),i=n(r(2141));function o(e,t,r){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}function a(e,t){return e.get(l(e,t))}function l(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var h=new WeakMap;class u{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];var i,a,u;(0,s.default)(this,"highlight",null),(0,s.default)(this,"from",null),(0,s.default)(this,"to",null),o(this,h,!1),this.highlight=e.clone(),this.from=t.clone(),this.to=r.clone(),a=this,u=n,(i=h).set(l(i,a),u)}setHighlight(e){return this.highlight=e.clone(),this}setFrom(e){return this.from=e.clone(),this}setTo(e){return this.to=e.clone(),this}isValid(e){return this.from.isValid(e)&&this.to.isValid(e)}isSingle(){return this.isSingleCell()||this.isSingleHeader()}isSingleCell(){return this.from.row>=0&&this.from.row===this.to.row&&this.from.col>=0&&this.from.col===this.to.col}isSingleHeader(){return(this.from.row<0||this.from.col<0)&&this.from.row===this.to.row&&this.from.col===this.to.col}isHeader(){return!(!this.from.isHeader()||!this.to.isHeader())||(this.from.col<0&&this.to.col<0||this.from.row<0&&this.to.row<0)}containsHeaders(){return this.from.isHeader()||this.to.isHeader()}getOuterHeight(){return Math.max(this.from.row,this.to.row)-Math.min(this.from.row,this.to.row)+1}getOuterWidth(){return Math.max(this.from.col,this.to.col)-Math.min(this.from.col,this.to.col)+1}getHeight(){if(this.from.row<0&&this.to.row<0)return 0;const e=Math.max(this.from.row,0),t=Math.max(this.to.row,0);return Math.max(e,t)-Math.min(e,t)+1}getWidth(){if(this.from.col<0&&this.to.col<0)return 0;const e=Math.max(this.from.col,0),t=Math.max(this.to.col,0);return Math.max(e,t)-Math.min(e,t)+1}getCellsCount(){return this.getWidth()*this.getHeight()}includes(e){const{row:t,col:r}=e,n=this.getOuterTopStartCorner(),s=this.getOuterBottomEndCorner();return n.row<=t&&s.row>=t&&n.col<=r&&s.col>=r}includesRange(e){return this.includes(e.getOuterTopStartCorner())&&this.includes(e.getOuterBottomEndCorner())}isEqual(e){return Math.min(this.from.row,this.to.row)===Math.min(e.from.row,e.to.row)&&Math.max(this.from.row,this.to.row)===Math.max(e.from.row,e.to.row)&&Math.min(this.from.col,this.to.col)===Math.min(e.from.col,e.to.col)&&Math.max(this.from.col,this.to.col)===Math.max(e.from.col,e.to.col)}overlaps(e){return e.isSouthEastOf(this.getOuterTopLeftCorner())&&e.isNorthWestOf(this.getOuterBottomRightCorner())}isSouthEastOf(e){return this.getOuterTopLeftCorner().isSouthEastOf(e)||this.getOuterBottomRightCorner().isSouthEastOf(e)}isNorthWestOf(e){return this.getOuterTopLeftCorner().isNorthWestOf(e)||this.getOuterBottomRightCorner().isNorthWestOf(e)}isOverlappingHorizontally(e){return this.getOuterTopEndCorner().col>=e.getOuterTopStartCorner().col&&this.getOuterTopEndCorner().col<=e.getOuterTopEndCorner().col||this.getOuterTopStartCorner().col<=e.getOuterTopEndCorner().col&&this.getOuterTopStartCorner().col>=e.getOuterTopStartCorner().col}isOverlappingVertically(e){return this.getOuterBottomStartCorner().row>=e.getOuterTopRightCorner().row&&this.getOuterBottomStartCorner().row<=e.getOuterBottomStartCorner().row||this.getOuterTopEndCorner().row<=e.getOuterBottomStartCorner().row&&this.getOuterTopEndCorner().row>=e.getOuterTopRightCorner().row}expand(e){const t=this.getOuterTopStartCorner(),r=this.getOuterBottomEndCorner();return(e.rowr.row||e.col>r.col)&&(this.from=this._createCellCoords(Math.min(t.row,e.row),Math.min(t.col,e.col)),this.to=this._createCellCoords(Math.max(r.row,e.row),Math.max(r.col,e.col)),!0)}expandByRange(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.includesRange(e)||!this.overlaps(e))return!1;const r=this.getOuterTopStartCorner(),n=this.getOuterBottomEndCorner(),s=this.getDirection(),i=e.getOuterTopStartCorner(),o=e.getOuterBottomEndCorner(),a=Math.min(r.row,i.row),l=Math.min(r.col,i.col),h=Math.max(n.row,o.row),u=Math.max(n.col,o.col),c=this._createCellCoords(a,l),d=this._createCellCoords(h,u);return this.from=c,this.to=d,this.setDirection(s),t&&(this.highlight.row===this.getOuterBottomRightCorner().row&&"N-S"===this.getVerticalDirection()&&this.flipDirectionVertically(),this.highlight.col===this.getOuterTopRightCorner().col&&"W-E"===this.getHorizontalDirection()&&this.flipDirectionHorizontally()),!0}getDirection(){return this.from.isNorthWestOf(this.to)?"NW-SE":this.from.isNorthEastOf(this.to)?"NE-SW":this.from.isSouthEastOf(this.to)?"SE-NW":this.from.isSouthWestOf(this.to)?"SW-NE":void 0}setDirection(e){switch(e){case"NW-SE":[this.from,this.to]=[this.getOuterTopLeftCorner(),this.getOuterBottomRightCorner()];break;case"NE-SW":[this.from,this.to]=[this.getOuterTopRightCorner(),this.getOuterBottomLeftCorner()];break;case"SE-NW":[this.from,this.to]=[this.getOuterBottomRightCorner(),this.getOuterTopLeftCorner()];break;case"SW-NE":[this.from,this.to]=[this.getOuterBottomLeftCorner(),this.getOuterTopRightCorner()]}}getVerticalDirection(){return["NE-SW","NW-SE"].indexOf(this.getDirection())>-1?"N-S":"S-N"}getHorizontalDirection(){return["NW-SE","SW-NE"].indexOf(this.getDirection())>-1?"W-E":"E-W"}flipDirectionVertically(){switch(this.getDirection()){case"NW-SE":this.setDirection("SW-NE");break;case"NE-SW":this.setDirection("SE-NW");break;case"SE-NW":this.setDirection("NE-SW");break;case"SW-NE":this.setDirection("NW-SE")}}flipDirectionHorizontally(){switch(this.getDirection()){case"NW-SE":this.setDirection("NE-SW");break;case"NE-SW":this.setDirection("NW-SE");break;case"SE-NW":this.setDirection("SW-NE");break;case"SW-NE":this.setDirection("SE-NW")}}getTopStartCorner(){return this._createCellCoords(Math.min(this.from.row,this.to.row),Math.min(this.from.col,this.to.col)).normalize()}getTopLeftCorner(){return a(h,this)?this.getTopEndCorner():this.getTopStartCorner()}getBottomEndCorner(){return this._createCellCoords(Math.max(this.from.row,this.to.row),Math.max(this.from.col,this.to.col)).normalize()}getBottomRightCorner(){return a(h,this)?this.getBottomStartCorner():this.getBottomEndCorner()}getTopEndCorner(){return this._createCellCoords(Math.min(this.from.row,this.to.row),Math.max(this.from.col,this.to.col)).normalize()}getTopRightCorner(){return a(h,this)?this.getTopStartCorner():this.getTopEndCorner()}getBottomStartCorner(){return this._createCellCoords(Math.max(this.from.row,this.to.row),Math.min(this.from.col,this.to.col)).normalize()}getBottomLeftCorner(){return a(h,this)?this.getBottomEndCorner():this.getBottomStartCorner()}getOuterTopStartCorner(){return this._createCellCoords(Math.min(this.from.row,this.to.row),Math.min(this.from.col,this.to.col))}getOuterTopLeftCorner(){return a(h,this)?this.getOuterTopEndCorner():this.getOuterTopStartCorner()}getOuterBottomEndCorner(){return this._createCellCoords(Math.max(this.from.row,this.to.row),Math.max(this.from.col,this.to.col))}getOuterBottomRightCorner(){return a(h,this)?this.getOuterBottomStartCorner():this.getOuterBottomEndCorner()}getOuterTopEndCorner(){return this._createCellCoords(Math.min(this.from.row,this.to.row),Math.max(this.from.col,this.to.col))}getOuterTopRightCorner(){return a(h,this)?this.getOuterTopStartCorner():this.getOuterTopEndCorner()}getOuterBottomStartCorner(){return this._createCellCoords(Math.max(this.from.row,this.to.row),Math.min(this.from.col,this.to.col))}getOuterBottomLeftCorner(){return a(h,this)?this.getOuterBottomEndCorner():this.getOuterBottomStartCorner()}isCorner(e){return e.isEqual(this.getOuterTopLeftCorner())||e.isEqual(this.getOuterTopRightCorner())||e.isEqual(this.getOuterBottomLeftCorner())||e.isEqual(this.getOuterBottomRightCorner())}getOppositeCorner(e){return e instanceof i.default&&(e.isEqual(this.getOuterBottomEndCorner())?this.getOuterTopStartCorner():e.isEqual(this.getOuterTopStartCorner())?this.getOuterBottomEndCorner():e.isEqual(this.getOuterTopEndCorner())?this.getOuterBottomStartCorner():e.isEqual(this.getOuterBottomStartCorner())?this.getOuterTopEndCorner():void 0)}getBordersSharedWith(e){if(!this.includesRange(e))return[];const t=Math.min(this.from.row,this.to.row),r=Math.max(this.from.row,this.to.row),n=Math.min(this.from.col,this.to.col),s=Math.max(this.from.col,this.to.col),i=Math.min(e.from.row,e.to.row),o=Math.max(e.from.row,e.to.row),l=Math.min(e.from.col,e.to.col),u=Math.max(e.from.col,e.to.col),c=[];return t===i&&c.push("top"),s===u&&c.push(a(h,this)?"left":"right"),r===o&&c.push("bottom"),n===l&&c.push(a(h,this)?"right":"left"),c}getInner(){const e=this.getOuterTopStartCorner(),t=this.getOuterBottomEndCorner(),r=[];for(let n=e.row;n<=t.row;n++)for(let s=e.col;s<=t.col;s++)this.from.row===n&&this.from.col===s||this.to.row===n&&this.to.col===s||r.push(this._createCellCoords(n,s));return r}getAll(){const e=this.getOuterTopStartCorner(),t=this.getOuterBottomEndCorner(),r=[];for(let n=e.row;n<=t.row;n++)for(let s=e.col;s<=t.col;s++)e.row===n&&e.col===s?r.push(e):t.row===n&&t.col===s?r.push(t):r.push(this._createCellCoords(n,s));return r}forAll(e){const t=this.getOuterTopStartCorner(),r=this.getOuterBottomEndCorner();for(let n=t.row;n<=r.row;n++)for(let s=t.col;s<=r.col;s++){if(!1===e(n,s))return}}clone(){return new u(this.highlight,this.from,this.to,a(h,this))}toObject(){return{from:this.from.toObject(),to:this.to.toObject()}}_createCellCoords(e,t){return new i.default(e,t,a(h,this))}}t.default=u},40564:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(15724);var s=n(r(85707)),i=r(62577),o=r(5893),a=n(r(3849)),l=n(r(15401)),h=n(r(2141)),u=n(r(16818));t.default=class{get eventManager(){return new a.default(this)}constructor(e,t){(0,s.default)(this,"wtTable",void 0),(0,s.default)(this,"wtScroll",void 0),(0,s.default)(this,"wtViewport",void 0),(0,s.default)(this,"wtOverlays",void 0),(0,s.default)(this,"selectionManager",void 0),(0,s.default)(this,"wtEvent",void 0),(0,s.default)(this,"guid",`wt_${(0,o.randomString)()}`),(0,s.default)(this,"drawInterrupted",!1),(0,s.default)(this,"drawn",!1),(0,s.default)(this,"activeOverlayName","master"),(0,s.default)(this,"domBindings",void 0),(0,s.default)(this,"wtSettings",void 0),this.domBindings={rootTable:e,rootDocument:e.ownerDocument,rootWindow:e.ownerDocument.defaultView},this.wtSettings=t,this.wtScroll=new l.default(this.createScrollDao())}findOriginalHeaders(){const e=[];if(this.wtTable.THEAD.childNodes.length&&this.wtTable.THEAD.childNodes[0].childNodes.length){for(let t=0,r=this.wtTable.THEAD.childNodes[0].childNodes.length;t0&&void 0!==arguments[0]&&arguments[0];return this.drawInterrupted=!1,this.wtTable.isVisible()?this.wtTable.draw(e):this.drawInterrupted=!0,this}getCell(e){if(!(arguments.length>1&&void 0!==arguments[1]&&arguments[1]))return this.wtTable.getCell(e);const t=this.wtSettings.getSetting("totalRows"),r=this.wtSettings.getSetting("fixedRowsTop"),n=this.wtSettings.getSetting("fixedRowsBottom"),s=this.wtSettings.getSetting("fixedColumnsStart");if(e.row=t-n){if(this.wtOverlays.bottomInlineStartCornerOverlay&&this.wtOverlays.bottomInlineStartCornerOverlay.clone)return this.wtOverlays.bottomInlineStartCornerOverlay.clone.wtTable.getCell(e)}else{if(e.col=t-n&&this.wtOverlays.bottomOverlay&&this.wtOverlays.bottomOverlay.clone)return this.wtOverlays.bottomOverlay.clone.wtTable.getCell(e)}return this.wtTable.getCell(e)}scrollViewport(e,t,r){return this.wtScroll.scrollViewport(e,t,r)}scrollViewportHorizontally(e,t){return this.wtScroll.scrollViewportHorizontally(e,t)}scrollViewportVertically(e,t){return this.wtScroll.scrollViewportVertically(e,t)}getViewport(){return[this.wtTable.getFirstVisibleRow(),this.wtTable.getFirstVisibleColumn(),this.wtTable.getLastVisibleRow(),this.wtTable.getLastVisibleColumn()]}destroy(){this.wtOverlays.destroy(),this.wtEvent.destroy()}createScrollDao(){const e=this;return{get drawn(){return e.drawn},get topOverlay(){return e.wtOverlays.topOverlay},get inlineStartOverlay(){return e.wtOverlays.inlineStartOverlay},get wtTable(){return e.wtTable},get wtViewport(){return e.wtViewport},get wtSettings(){return e.wtSettings},get rootWindow(){return e.domBindings.rootWindow},get totalRows(){return e.wtSettings.getSetting("totalRows")},get totalColumns(){return e.wtSettings.getSetting("totalColumns")},get fixedRowsTop(){return e.wtSettings.getSetting("fixedRowsTop")},get fixedRowsBottom(){return e.wtSettings.getSetting("fixedRowsBottom")},get fixedColumnsStart(){return e.wtSettings.getSetting("fixedColumnsStart")}}}getTableDao(){const e=this;return{get wot(){return e},get parentTableOffset(){return e.cloneSource.wtTable.tableOffset},get cloneSource(){return e.cloneSource},get workspaceWidth(){return e.wtViewport.getWorkspaceWidth()},get wtViewport(){return e.wtViewport},get wtOverlays(){return e.wtOverlays},get selectionManager(){return e.selectionManager},get stylesHandler(){return e.stylesHandler},get drawn(){return e.drawn},set drawn(t){e.drawn=t},get wtTable(){return e.wtTable},get startColumnRendered(){return e.wtViewport.columnsRenderCalculator.startColumn},get startColumnVisible(){return e.wtViewport.columnsVisibleCalculator.startColumn},get startColumnPartiallyVisible(){return e.wtViewport.columnsPartiallyVisibleCalculator.startColumn},get endColumnRendered(){return e.wtViewport.columnsRenderCalculator.endColumn},get endColumnVisible(){return e.wtViewport.columnsVisibleCalculator.endColumn},get endColumnPartiallyVisible(){return e.wtViewport.columnsPartiallyVisibleCalculator.endColumn},get countColumnsRendered(){return e.wtViewport.columnsRenderCalculator.count},get countColumnsVisible(){return e.wtViewport.columnsVisibleCalculator.count},get startRowRendered(){return e.wtViewport.rowsRenderCalculator.startRow},get startRowVisible(){return e.wtViewport.rowsVisibleCalculator.startRow},get startRowPartiallyVisible(){return e.wtViewport.rowsPartiallyVisibleCalculator.startRow},get endRowRendered(){return e.wtViewport.rowsRenderCalculator.endRow},get endRowVisible(){return e.wtViewport.rowsVisibleCalculator.endRow},get endRowPartiallyVisible(){return e.wtViewport.rowsPartiallyVisibleCalculator.endRow},get countRowsRendered(){return e.wtViewport.rowsRenderCalculator.count},get countRowsVisible(){return e.wtViewport.rowsVisibleCalculator.count},get columnHeaders(){return e.wtSettings.getSetting("columnHeaders")},get rowHeaders(){return e.wtSettings.getSetting("rowHeaders")}}}}},36817:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0;var s=n(r(85707)),i=n(r(15478)),o=n(r(40564));class a extends o.default{constructor(e,t,r){super(e,t),(0,s.default)(this,"cloneSource",void 0),(0,s.default)(this,"cloneOverlay",void 0);const n=this.wtSettings.getSetting("facade",this);this.cloneSource=r.source,this.cloneOverlay=r.overlay,this.stylesHandler=r.stylesHandler,this.wtTable=this.cloneOverlay.createTable(this.getTableDao(),n,this.domBindings,this.wtSettings),this.wtViewport=r.viewport,this.selectionManager=r.selectionManager,this.wtEvent=new i.default(n,this.domBindings,this.wtSettings,this.eventManager,this.wtTable,this.selectionManager,r.event),this.findOriginalHeaders()}}t.default=a},9717:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(15724);var s=n(r(15478)),i=n(r(66925)),o=r(69397),a=n(r(34117)),l=n(r(78951)),h=n(r(16598)),u=n(r(40564)),c=r(67600),d=r(25499),p=r(62577),g=r(52714);class f extends u.default{constructor(e,t){super(e,new a.default(t)),this.stylesHandler=new g.StylesHandler(this.domBindings);const r=this.wtSettings.getSetting("facade",this);this.wtTable=new l.default(this.getTableDao(),r,this.domBindings,this.wtSettings),this.wtViewport=new h.default(this.getViewportDao(),this.domBindings,this.wtSettings,this.eventManager,this.wtTable),this.selectionManager=new c.SelectionManager(this.wtSettings.getSetting("selections")),this.wtEvent=new s.default(r,this.domBindings,this.wtSettings,this.eventManager,this.wtTable,this.selectionManager),this.wtOverlays=new i.default(this,r,this.domBindings,this.wtSettings,this.eventManager,this.wtTable),this.exportSettingsAsClassNames(),this.findOriginalHeaders()}exportSettingsAsClassNames(){const e=[],t=[];(0,d.objectEach)({rowHeaders:"htRowHeaders",columnHeaders:"htColumnHeaders"},((r,n)=>{this.wtSettings.getSetting(n).length&&t.push(r),e.push(r)})),(0,p.removeClass)(this.wtTable.wtRootElement.parentNode,e),(0,p.addClass)(this.wtTable.wtRootElement.parentNode,t)}getOverlayByName(e){var t;if(!o.CLONE_TYPES.includes(e))return null;const r=e.replace(/_([a-z])/g,(e=>e[1].toUpperCase()));return null!==(t=this.wtOverlays[`${r}Overlay`])&&void 0!==t?t:null}getViewportDao(){const e=this;return{get wot(){return e},get topOverlayTrimmingContainer(){return e.wtOverlays.topOverlay.trimmingContainer},get inlineStartOverlayTrimmingContainer(){return e.wtOverlays.inlineStartOverlay.trimmingContainer},get topScrollPosition(){return e.wtOverlays.topOverlay.getScrollPosition()},get topParentOffset(){return e.wtOverlays.topOverlay.getTableParentOffset()},get inlineStartScrollPosition(){return e.wtOverlays.inlineStartOverlay.getScrollPosition()},get inlineStartParentOffset(){return e.wtOverlays.inlineStartOverlay.getTableParentOffset()},get topOverlay(){return e.wtOverlays.topOverlay},get inlineStartOverlay(){return e.wtOverlays.inlineStartOverlay},get bottomOverlay(){return e.wtOverlays.bottomOverlay}}}}t.default=f},15478:(e,t,r)=>{"use strict";t.__esModule=!0,r(67834);var n=r(62577),s=r(89804),i=r(85992),o=r(25046),a=r(70505);function l(e,t,r){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}function h(e,t){return e.get(c(e,t))}function u(e,t,r){return e.set(c(e,t),r),r}function c(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var d=new WeakMap,p=new WeakMap,g=new WeakMap,f=new WeakMap,m=new WeakMap,y=new WeakMap,E=new WeakMap,w=new WeakMap,C=new WeakMap,v=new WeakMap;t.default=class{constructor(e,t,r,n,s,i){let o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null;l(this,d,void 0),l(this,p,void 0),l(this,g,void 0),l(this,f,void 0),l(this,m,void 0),l(this,y,void 0),l(this,E,void 0),l(this,w,void 0),l(this,C,[null,null]),l(this,v,[null,null]),u(d,this,r),u(p,this,t),u(g,this,s),u(f,this,i),u(m,this,o),u(y,this,n),u(E,this,e),this.registerEvents()}registerEvents(){h(y,this).addEventListener(h(g,this).holder,"contextmenu",(e=>this.onContextMenu(e))),h(y,this).addEventListener(h(g,this).TABLE,"mouseover",(e=>this.onMouseOver(e))),h(y,this).addEventListener(h(g,this).TABLE,"mouseout",(e=>this.onMouseOut(e)));const e=()=>{h(y,this).addEventListener(h(g,this).holder,"touchstart",(e=>this.onTouchStart(e))),h(y,this).addEventListener(h(g,this).holder,"touchend",(e=>this.onTouchEnd(e))),this.momentumScrolling||(this.momentumScrolling={}),h(y,this).addEventListener(h(g,this).holder,"scroll",(()=>{clearTimeout(this.momentumScrolling._timeout),this.momentumScrolling.ongoing||h(d,this).getSetting("onBeforeTouchScroll"),this.momentumScrolling.ongoing=!0,this.momentumScrolling._timeout=setTimeout((()=>{this.touchApplied||(this.momentumScrolling.ongoing=!1,h(d,this).getSetting("onAfterMomentumScroll"))}),200)}))},t=()=>{h(y,this).addEventListener(h(g,this).holder,"mouseup",(e=>this.onMouseUp(e))),h(y,this).addEventListener(h(g,this).holder,"mousedown",(e=>this.onMouseDown(e)))};(0,o.isMobileBrowser)()?e():((0,i.isTouchSupported)()&&e(),t())}selectedCellWasTouched(e){const t=this.parentCell(e).coords;if(h(w,this)&&t){const[e,r]=[t.row,h(w,this).from.row],[n,s]=[t.col,h(w,this).from.col];return e===r&&n===s}return!1}parentCell(e){const t={},r=h(g,this).TABLE,s=(0,n.closestDown)(e,["TD","TH"],r);return s?(t.coords=h(g,this).getCoords(s),t.TD=s):(0,n.hasClass)(e,"wtBorder")&&(0,n.hasClass)(e,"current")?(t.coords=h(f,this).getFocusSelection().cellRange.highlight,t.TD=h(g,this).getCell(t.coords)):(0,n.hasClass)(e,"wtBorder")&&(0,n.hasClass)(e,"area")&&h(f,this).getAreaSelection().cellRange&&(t.coords=h(f,this).getAreaSelection().cellRange.to,t.TD=h(g,this).getCell(t.coords)),t}onMouseDown(e){const t=h(p,this).rootDocument.activeElement,r=(0,s.partial)(n.getParent,e.target),i=e.target;if(!["TD","TH"].includes(t.nodeName)&&(i===t||r(0)===t||r(1)===t))return;const o=this.parentCell(i);(0,n.hasClass)(i,"corner")?h(d,this).getSetting("onCellCornerMouseDown",e,i):o.TD&&h(d,this).has("onCellMouseDown")&&this.callListener("onCellMouseDown",e,o.coords,o.TD),(0===e.button||this.touchApplied)&&o.TD&&(h(v,this)[0]=o.TD,clearTimeout(h(C,this)[0]),h(C,this)[0]=setTimeout((()=>{h(v,this)[0]=null}),1e3))}onContextMenu(e){if(h(d,this).has("onCellContextMenu")){const t=this.parentCell(e.target);t.TD&&this.callListener("onCellContextMenu",e,t.coords,t.TD)}}onMouseOver(e){if(!h(d,this).has("onCellMouseOver"))return;const t=h(g,this).TABLE,r=(0,n.closestDown)(e.target,["TD","TH"],t),s=h(m,this)||this;r&&r!==s.lastMouseOver&&(0,n.isChildOf)(r,t)&&(s.lastMouseOver=r,this.callListener("onCellMouseOver",e,h(g,this).getCoords(r),r))}onMouseOut(e){if(!h(d,this).has("onCellMouseOut"))return;const t=h(g,this).TABLE,r=(0,n.closestDown)(e.target,["TD","TH"],t),s=(0,n.closestDown)(e.relatedTarget,["TD","TH"],t),i=h(m,this)||this;r&&r!==s&&(0,n.isChildOf)(r,t)&&(this.callListener("onCellMouseOut",e,h(g,this).getCoords(r),r),null===s&&(i.lastMouseOver=null))}onMouseUp(e){const t=this.parentCell(e.target);t.TD&&h(d,this).has("onCellMouseUp")&&this.callListener("onCellMouseUp",e,t.coords,t.TD),(0===e.button||this.touchApplied)&&(t.TD===h(v,this)[0]&&t.TD===h(v,this)[1]?((0,n.hasClass)(e.target,"corner")?this.callListener("onCellCornerDblClick",e,t.coords,t.TD):this.callListener("onCellDblClick",e,t.coords,t.TD),h(v,this)[0]=null,h(v,this)[1]=null):t.TD===h(v,this)[0]&&(h(v,this)[1]=t.TD,clearTimeout(h(C,this)[1]),h(C,this)[1]=setTimeout((()=>{h(v,this)[1]=null}),500)))}onTouchStart(e){u(w,this,h(f,this).getFocusSelection().cellRange),this.touchApplied=!0,this.onMouseDown(e)}onTouchEnd(e){var t;const r=e.target,n=null===(t=this.parentCell(r))||void 0===t?void 0:t.coords,s=(0,a.isDefined)(n)&&n.row>=0&&n.col>=0;if(e.cancelable&&s&&h(d,this).getSetting("isDataViewInstance")){const t=["A","BUTTON","INPUT"];(0,o.isIOS)()&&((0,o.isChromeWebKit)()||(0,o.isFirefoxWebKit)())&&this.selectedCellWasTouched(r)&&!t.includes(r.tagName)?e.preventDefault():this.selectedCellWasTouched(r)||e.preventDefault()}this.onMouseUp(e),this.touchApplied=!1}callListener(e,t,r,n){const s=h(d,this).getSettingPure(e);s&&s(t,r,n,h(E,this).call(this))}destroy(){clearTimeout(h(C,this)[0]),clearTimeout(h(C,this)[1]),h(y,this).destroy()}}},11322:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0;var s=n(r(9717)),i=n(r(40564));class o{constructor(e){e instanceof i.default?this._wot=e:this._initFromSettings(e)}_initFromSettings(e){e.facade=e=>{const t=new o(e);return()=>t},this._wot=new s.default(e.table,e)}get guid(){return this._wot.guid}get rootDocument(){return this._wot.domBindings.rootDocument}get rootWindow(){return this._wot.domBindings.rootWindow}get wtSettings(){return this._wot.wtSettings}get cloneSource(){return this._wot.cloneSource}get cloneOverlay(){return this._wot.cloneOverlay}get selectionManager(){return this._wot.selectionManager}get wtViewport(){return this._wot.wtViewport}get wtOverlays(){return this._wot.wtOverlays}get wtTable(){return this._wot.wtTable}get wtEvent(){return this._wot.wtEvent}get wtScroll(){return this._wot.wtScroll}get drawn(){return this._wot.drawn}set drawn(e){this._wot.drawn=e}get activeOverlayName(){return this._wot.activeOverlayName}get drawInterrupted(){return this._wot.drawInterrupted}set drawInterrupted(e){this._wot.drawInterrupted=e}get lastMouseOver(){return this._wot.lastMouseOver}set lastMouseOver(e){this._wot.lastMouseOver=e}get momentumScrolling(){return this._wot.momentumScrolling}set momentumScrolling(e){this._wot.momentumScrolling=e}get touchApplied(){return this._wot.touchApplied}set touchApplied(e){this._wot.touchApplied=e}get domBindings(){return this._wot.domBindings}get eventListeners(){return this._wot.eventListeners}set eventListeners(e){this._wot.eventListeners=e}get eventManager(){return this._wot.eventManager}get stylesHandler(){return this._wot.stylesHandler}createCellCoords(e,t){return this._wot.createCellCoords(e,t)}createCellRange(e,t,r){return this._wot.createCellRange(e,t,r)}draw(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._wot.draw(e),this}getCell(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._wot.getCell(e,t)}scrollViewport(e,t,r){return this._wot.scrollViewport(e,t,r)}scrollViewportHorizontally(e,t){return this._wot.scrollViewportHorizontally(e,t)}scrollViewportVertically(e,t){return this._wot.scrollViewportVertically(e,t)}getViewport(){return this._wot.getViewport()}getOverlayName(){return this._wot.cloneOverlay?this._wot.cloneOverlay.type:"master"}getOverlayByName(e){return this._wot.getOverlayByName(e)}exportSettingsAsClassNames(){return this._wot.exportSettingsAsClassNames()}update(e,t){return this._wot.wtSettings.update(e,t),this}getSetting(e,t,r,n,s){return this._wot.wtSettings.getSetting(e,t,r,n,s)}hasSetting(e){return this._wot.wtSettings.hasSetting(e)}destroy(){this._wot.destroy()}}t.default=o},62383:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0;var s=n(r(85707));t.default=class{constructor(e,t,r){(0,s.default)(this,"offset",void 0),(0,s.default)(this,"total",void 0),(0,s.default)(this,"countTH",void 0),this.offset=e,this.total=t,this.countTH=r}offsetted(e){return e+this.offset}unOffsetted(e){return e-this.offset}renderedToSource(e){return this.offsetted(e)}sourceToRendered(e){return this.unOffsetted(e)}offsettedTH(e){return e-this.countTH}unOffsettedTH(e){return e+this.countTH}visibleRowHeadedColumnToSourceColumn(e){return this.renderedToSource(this.offsettedTH(e))}sourceColumnToVisibleRowHeadedColumn(e){return this.unOffsettedTH(this.sourceToRendered(e))}}},82217:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0;var s=n(r(85707));t.default=class{constructor(e,t,r){(0,s.default)(this,"offset",void 0),(0,s.default)(this,"total",void 0),(0,s.default)(this,"countTH",void 0),this.offset=e,this.total=t,this.countTH=r}offsetted(e){return e+this.offset}unOffsetted(e){return e-this.offset}renderedToSource(e){return this.offsetted(e)}sourceToRendered(e){return this.unOffsetted(e)}offsettedTH(e){return e-this.countTH}unOffsettedTH(e){return e+this.countTH}visibleColHeadedRowToSourceRow(e){return this.renderedToSource(this.offsettedTH(e))}sourceRowToVisibleColHeadedRow(e){return this.unOffsettedTH(this.sourceToRendered(e))}}},50206:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0;var s=r(63059);t.ViewportColumnsCalculator=s.ViewportColumnsCalculator,t.ViewportRowsCalculator=s.ViewportRowsCalculator,t.DEFAULT_COLUMN_WIDTH=s.DEFAULT_COLUMN_WIDTH;var i=n(r(2141));t.CellCoords=i.default;var o=n(r(16818));t.CellRange=o.default;var a=n(r(11322));t.default=a.default,t.Core=a.default;var l=r(70471);t.Selection=l.Selection,t.HIGHLIGHT_ACTIVE_HEADER_TYPE=l.ACTIVE_HEADER_TYPE,t.HIGHLIGHT_AREA_TYPE=l.AREA_TYPE,t.HIGHLIGHT_FOCUS_TYPE=l.FOCUS_TYPE,t.HIGHLIGHT_FILL_TYPE=l.FILL_TYPE,t.HIGHLIGHT_HEADER_TYPE=l.HEADER_TYPE,t.HIGHLIGHT_ROW_TYPE=l.ROW_TYPE,t.HIGHLIGHT_COLUMN_TYPE=l.COLUMN_TYPE,t.HIGHLIGHT_CUSTOM_SELECTION_TYPE=l.CUSTOM_SELECTION_TYPE;var h=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=p(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var o=s?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(n,i,o):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n}(r(36936));t.Renderer=h;var u=r(97646);t.OrderView=u.OrderView,t.SharedOrderView=u.SharedOrderView;var c=r(76095);t.NodesPool=c.NodesPool;var d=r(3849);function p(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(p=function(e){return e?r:t})(e)}t.getListenersCounter=d.getListenersCounter},18113:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834),r(14846),r(69655);var s=n(r(85707)),i=r(62577),o=r(25499),a=r(14859),l=r(85484),h=n(r(36817)),u=r(71120);t.Overlay=class{constructor(e,t,r,n,a){(0,s.default)(this,"wtSettings",null),(0,o.defineGetter)(this,"wot",e,{writable:!1}),this.domBindings=a,this.facadeGetter=t,this.wtSettings=n;const{TABLE:l,hider:h,spreader:u,holder:c,wtRootElement:d}=this.wot.wtTable;this.instance=this.wot,this.type=r,this.mainTableScrollableElement=null,this.TABLE=l,this.hider=h,this.spreader=u,this.holder=c,this.wtRootElement=d,this.trimmingContainer=(0,i.getTrimmingContainer)(this.hider.parentNode.parentNode),this.needFullRender=this.shouldBeRendered(),this.clone=this.makeClone()}hasRenderingStateChanged(){return this.needFullRender!==this.shouldBeRendered()}updateStateOfRendering(e){"before"===e&&this.shouldBeRendered()?this.needFullRender=!0:"after"!==e||this.shouldBeRendered()||(this.needFullRender=!1)}shouldBeRendered(){return!0}updateTrimmingContainer(){this.trimmingContainer=(0,i.getTrimmingContainer)(this.hider.parentNode.parentNode)}updateMainScrollableElement(){const{wtTable:e}=this.wot,{rootWindow:t}=this.domBindings;"hidden"===t.getComputedStyle(e.wtRootElement.parentNode).getPropertyValue("overflow")?this.mainTableScrollableElement=this.wot.wtTable.holder:this.mainTableScrollableElement=(0,i.getScrollableElement)(e.TABLE)}getRelativeCellPosition(e,t,r){if(!1===this.clone.wtTable.holder.contains(e))return void(0,a.warn)(`The provided element is not a child of the ${this.type} overlay`);const n=this.mainTableScrollableElement===this.domBindings.rootWindow,s=r=this.wtSettings.getSetting("totalRows")-this.wtSettings.getSetting("fixedRowsBottom"),l=this.clone.wtTable.spreader,h={start:this.getRelativeStartPosition(l),top:l.offsetTop},u={start:this.getRelativeStartPosition(e),top:e.offsetTop};let c=null;return c=n?this.getRelativeCellPositionWithinWindow(i,s,u,h):this.getRelativeCellPositionWithinHolder(i,o,s,u,h),c}getRelativeStartPosition(e){return this.isRtl()?e.offsetParent.offsetWidth-e.offsetLeft-e.offsetWidth:e.offsetLeft}getRelativeCellPositionWithinWindow(e,t,r,n){const s=this.wot.wtTable.wtRootElement.getBoundingClientRect();let o=0,a=0;if(t){let e=s.left;this.isRtl()&&(e=this.domBindings.rootWindow.innerWidth-(s.left+s.width+(0,i.getScrollbarWidth)())),o=e<=0?-1*e:0}else o=n.start;if(e){a=this.clone.wtTable.TABLE.getBoundingClientRect().top-s.top}else a=n.top;return{start:r.start+o,top:r.top+a}}getRelativeCellPositionWithinHolder(e,t,r,n,s){const i=this.wot.wtOverlays.inlineStartOverlay.getScrollPosition(),o=this.wot.wtOverlays.topOverlay.getScrollPosition();let a=0,l=0;if(r||(a=i-s.start),t){const e=this.wot.wtTable.wtRootElement.getBoundingClientRect();l=-1*this.clone.wtTable.TABLE.getBoundingClientRect().top+e.top}else e||(l=o-s.top);return{start:n.start-a,top:n.top-l}}makeClone(){if(-1===l.CLONE_TYPES.indexOf(this.type))throw new Error(`Clone type "${this.type}" is not supported.`);const{wtTable:e,wtSettings:t}=this.wot,{rootDocument:r,rootWindow:n}=this.domBindings,s=r.createElement("div"),o=r.createElement("table"),a=e.wtRootElement.parentNode;s.className=`${l.CLONE_CLASS_NAMES.get(this.type)} handsontable`,s.setAttribute("dir",this.isRtl()?"rtl":"ltr"),s.style.position="absolute",s.style.top=0,s.style.overflow="visible",this.isRtl()?s.style.right=0:s.style.left=0,t.getSetting("ariaTags")&&(0,i.setAttribute)(s,[(0,u.A11Y_PRESENTATION)()]),o.className=e.TABLE.className;e.TABLE.getAttribute("role")&&o.setAttribute("role",e.TABLE.getAttribute("role")),s.appendChild(o),a.appendChild(s);const c=this.wtSettings.getSetting("preventOverflow");return!0===c||"horizontal"===c&&this.type===l.CLONE_TOP||"vertical"===c&&this.type===l.CLONE_INLINE_START?this.mainTableScrollableElement=n:"hidden"===n.getComputedStyle(a).getPropertyValue("overflow")?this.mainTableScrollableElement=e.holder:this.mainTableScrollableElement=(0,i.getScrollableElement)(e.TABLE),new h.default(o,this.wtSettings,{source:this.wot,overlay:this,viewport:this.wot.wtViewport,event:this.wot.wtEvent,selectionManager:this.wot.selectionManager,stylesHandler:this.wot.stylesHandler})}refresh(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.needFullRender){const t=this.clone.cloneSource;t.activeOverlayName=this.clone.wtTable.name,this.clone.draw(e),t.activeOverlayName="master"}}reset(){const e=this.clone.wtTable.holder,t=this.clone.wtTable.hider;[e.style,t.style,e.parentNode.style].forEach((e=>{e.width="",e.height=""}))}isRtl(){return this.wtSettings.getSetting("rtlMode")}destroy(){this.clone.eventManager.destroy()}}},12942:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834);var s=n(r(85707)),i=r(62577),o=n(r(55538)),a=r(18113),l=r(85484);class h extends a.Overlay{constructor(e,t,r,n){super(e,t,l.CLONE_BOTTOM,r,n),(0,s.default)(this,"cachedFixedRowsBottom",-1),this.cachedFixedRowsBottom=this.wtSettings.getSetting("fixedRowsBottom")}createTable(){for(var e=arguments.length,t=new Array(e),r=0;rt&&(r=0)}return r}adjustHeaderBordersPosition(e){const t=this.wtSettings.getSetting("fixedRowsBottom"),r=this.cachedFixedRowsBottom!==t,n=this.wtSettings.getSetting("columnHeaders");let s=!1;if((r||0===t)&&n.length>0){const t=this.wot.wtTable.holder.parentNode,r=(0,i.hasClass)(t,"innerBorderBottom");this.cachedFixedRowsBottom=this.wtSettings.getSetting("fixedRowsBottom"),e||0===this.wtSettings.getSetting("totalRows")?((0,i.addClass)(t,"innerBorderBottom"),s=!r):((0,i.removeClass)(t,"innerBorderBottom"),s=r)}return s}}t.BottomOverlay=h},72478:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0;var s=r(62577),i=n(r(41618)),o=r(18113),a=r(85484);class l extends o.Overlay{constructor(e,t,r,n,s,i){super(e,t,a.CLONE_BOTTOM_INLINE_START_CORNER,r,n),this.bottomOverlay=s,this.inlineStartOverlay=i}createTable(){for(var e=arguments.length,t=new Array(e),r=0;r{"use strict";t.__esModule=!0;const r=t.CLONE_TOP="top",n=t.CLONE_BOTTOM="bottom",s=t.CLONE_INLINE_START="inline_start",i=t.CLONE_TOP_INLINE_START_CORNER="top_inline_start_corner",o=t.CLONE_BOTTOM_INLINE_START_CORNER="bottom_inline_start_corner";t.CLONE_TYPES=[r,n,s,i,o],t.CLONE_CLASS_NAMES=new Map([[r,`ht_clone_${r}`],[n,`ht_clone_${n}`],[s,`ht_clone_${s} ht_clone_left`],[i,`ht_clone_${i} ht_clone_top_left_corner`],[o,`ht_clone_${o} ht_clone_bottom_left_corner`]])},69397:(e,t,r)=>{"use strict";r(14846),r(69655),t.__esModule=!0;var n={BottomInlineStartCornerOverlay:!0,BottomOverlay:!0,InlineStartOverlay:!0,Overlay:!0,TopInlineStartCornerOverlay:!0,TopOverlay:!0},s=r(72478);t.BottomInlineStartCornerOverlay=s.BottomInlineStartCornerOverlay;var i=r(12942);t.BottomOverlay=i.BottomOverlay;var o=r(90122);t.InlineStartOverlay=o.InlineStartOverlay;var a=r(18113);t.Overlay=a.Overlay;var l=r(76922);t.TopInlineStartCornerOverlay=l.TopInlineStartCornerOverlay;var h=r(73114);t.TopOverlay=h.TopOverlay;var u=r(85484);Object.keys(u).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||e in t&&t[e]===u[e]||(t[e]=u[e]))}))},90122:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834);var s=r(62577),i=n(r(80222)),o=r(18113),a=r(70471),l=r(85484);class h extends o.Overlay{constructor(e,t,r,n){super(e,t,l.CLONE_INLINE_START,r,n)}createTable(){for(var e=arguments.length,t=new Array(e),r=0;r0&&!(0,s.hasClass)(o.parentNode,"innerBorderInlineStart")?1:0;let l=this.getTableParentOffset(),h=0;if(t){this.wot.wtTable.getColumnWidth(e)>this.wot.wtViewport.getViewportWidth()&&(t=!1)}return t&&o.offsetWidth!==o.clientWidth&&(h=(0,s.getScrollbarWidth)(this.domBindings.rootDocument)),t?(l+=this.sumCellSizes(0,e+1),l-=this.wot.wtViewport.getViewportWidth(),l+=a):l+=this.sumCellSizes(this.wtSettings.getSetting("fixedColumnsStart"),e),l+=h,(0,s.getMaximumScrollLeft)(this.mainTableScrollableElement)===l-a&&a>0&&this.wot.wtOverlays.expandHiderHorizontallyBy(a),this.setScrollPosition(l)}getTableParentOffset(){let e=0;return this.wtSettings.getSetting("preventOverflow")||this.trimmingContainer!==this.domBindings.rootWindow||(e=this.wot.wtTable.holderOffset.left),e}getScrollPosition(){return Math.abs((0,s.getScrollLeft)(this.mainTableScrollableElement,this.domBindings.rootWindow))}getOverlayOffset(){const{rootWindow:e}=this.domBindings,t=this.wtSettings.getSetting("preventOverflow");let r=0;if(this.trimmingContainer===e&&(!t||"horizontal"!==t)){r=this.isRtl()?Math.abs(Math.min(this.getTableParentOffset()-this.getScrollPosition(),0)):Math.max(this.getScrollPosition()-this.getTableParentOffset(),0);r>this.wot.wtTable.getTotalWidth()-this.clone.wtTable.getTotalWidth()&&(r=0)}return r}adjustHeaderBordersPosition(e){const{wtSettings:t}=this,r=this.wot.wtTable.holder.parentNode,n=t.getSetting("rowHeaders"),i=t.getSetting("fixedColumnsStart"),o=t.getSetting("totalRows"),a="vertical"===t.getSetting("preventOverflow");o?(0,s.removeClass)(r,"emptyRows"):(0,s.addClass)(r,"emptyRows");let l=!1;if(!a)if(i&&!n.length)(0,s.addClass)(r,"innerBorderLeft innerBorderInlineStart");else if(!i&&n.length){const t=(0,s.hasClass)(r,"innerBorderInlineStart");e?((0,s.addClass)(r,"innerBorderLeft innerBorderInlineStart"),l=!t):((0,s.removeClass)(r,"innerBorderLeft innerBorderInlineStart"),l=t)}return l}}t.InlineStartOverlay=h},73114:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834);var s=n(r(85707)),i=r(62577),o=n(r(94318)),a=r(18113),l=r(70471),h=r(85484);class u extends a.Overlay{constructor(e,t,r,n){super(e,t,h.CLONE_TOP,r,n),(0,s.default)(this,"cachedFixedRowsTop",-1),this.cachedFixedRowsTop=this.wtSettings.getSetting("fixedRowsTop")}createTable(){for(var e=arguments.length,t=new Array(e),r=0;r0&&!(0,i.hasClass)(s.parentNode,"innerBorderTop")?1:0;let l=this.getTableParentOffset(),h=0;if(t){this.wot.wtTable.getRowHeight(e)>this.wot.wtViewport.getViewportHeight()&&(t=!1)}if(t&&s.offsetHeight!==s.clientHeight&&(h=(0,i.getScrollbarWidth)(this.domBindings.rootDocument)),t){const t=n.getSetting("fixedRowsBottom"),s=n.getSetting("totalRows");l+=this.sumCellSizes(0,e+1),l-=r.wtViewport.getViewportHeight()-this.sumCellSizes(s-t,s),l+=1,l+=a}else l+=this.sumCellSizes(n.getSetting("fixedRowsTop"),e);return l+=h,(0,i.getMaximumScrollTop)(this.mainTableScrollableElement)===l-a&&a>0&&this.wot.wtOverlays.expandHiderVerticallyBy(a),this.setScrollPosition(l)}getTableParentOffset(){return this.mainTableScrollableElement===this.domBindings.rootWindow?this.wot.wtTable.holderOffset.top:0}getScrollPosition(){return(0,i.getScrollTop)(this.mainTableScrollableElement,this.domBindings.rootWindow)}getOverlayOffset(){const{rootWindow:e}=this.domBindings,t=this.wtSettings.getSetting("preventOverflow");let r=0;if(this.trimmingContainer===e&&(!t||"vertical"!==t)){const e=this.wot.wtTable.getTotalHeight()-this.clone.wtTable.getTotalHeight();r=Math.max(this.getScrollPosition()-this.getTableParentOffset(),0),r>e&&(r=0)}return r}adjustHeaderBordersPosition(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const{wtSettings:r}=this,n=this.wot.wtTable.holder.parentNode,s=r.getSetting("totalColumns"),o="horizontal"===r.getSetting("preventOverflow");s?(0,i.removeClass)(n,"emptyColumns"):(0,i.addClass)(n,"emptyColumns");let a=!1;if(!t&&!o){const t=r.getSetting("fixedRowsTop"),s=this.cachedFixedRowsTop!==t,o=r.getSetting("columnHeaders");if((s||0===t)&&o.length>0){const t=(0,i.hasClass)(n,"innerBorderTop");this.cachedFixedRowsTop=r.getSetting("fixedRowsTop"),e||0===r.getSetting("totalRows")?((0,i.addClass)(n,"innerBorderTop"),a=!t):((0,i.removeClass)(n,"innerBorderTop"),a=t)}}return a}}t.TopOverlay=u},76922:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0;var s=n(r(85707)),i=r(62577),o=n(r(16318)),a=r(18113),l=r(85484);class h extends a.Overlay{constructor(e,t,r,n,i,o){super(e,t,l.CLONE_TOP_INLINE_START_CORNER,r,n),(0,s.default)(this,"topOverlay",void 0),(0,s.default)(this,"inlineStartOverlay",void 0),this.topOverlay=i,this.inlineStartOverlay=o}createTable(){for(var e=arguments.length,t=new Array(e),r=0;r{"use strict";var n=r(96784);t.__esModule=!0,r(67834),r(15724),r(14846),r(69655),r(90458);var s=n(r(85707)),i=r(62577),o=r(85992),a=r(10587),l=r(83445),h=r(25046),u=r(14859),c=r(69397);function d(e,t,r){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}function p(e,t,r){return e.set(f(e,t),r),r}function g(e,t){return e.get(f(e,t))}function f(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var m=new WeakMap,y=new WeakMap,E=new WeakMap,w=new WeakMap;t.default=class{constructor(e,t,r,n,a,l){(0,s.default)(this,"wot",null),d(this,m,[]),(0,s.default)(this,"topOverlay",null),(0,s.default)(this,"bottomOverlay",null),(0,s.default)(this,"inlineStartOverlay",null),(0,s.default)(this,"topInlineStartCornerOverlay",null),(0,s.default)(this,"bottomInlineStartCornerOverlay",null),(0,s.default)(this,"browserLineHeight",void 0),(0,s.default)(this,"wtSettings",null),d(this,y,!1),d(this,E,0),d(this,w,null),(0,s.default)(this,"resizeObserver",new ResizeObserver((e=>{(0,o.requestAnimationFrame)((()=>{Array.isArray(e)&&e.length&&(p(E,this,g(E,this)+1),100===g(E,this)&&((0,u.warn)("The ResizeObserver callback was fired too many times in direct succession.\nThis may be due to an infinite loop caused by setting a dynamic height/width (for example, with the `dvh` units) to a Handsontable container's parent. \nThe observer will be disconnected."),this.resizeObserver.disconnect()),null!==g(w,this)&&clearTimeout(g(w,this)),p(w,this,setTimeout((()=>{p(E,this,0)}),100)),this.wtSettings.getSetting("onContainerElementResize"))}))}))),this.wot=e,this.wtSettings=n,this.domBindings=r,this.facadeGetter=t,this.wtTable=l;const{rootDocument:h,rootWindow:c}=this.domBindings;this.instance=this.wot,this.eventManager=a,this.scrollbarSize=(0,i.getScrollbarWidth)(h);const f="hidden"===c.getComputedStyle(l.wtRootElement.parentNode).getPropertyValue("overflow");this.scrollableElement=f?l.holder:(0,i.getScrollableElement)(l.TABLE),this.initOverlays(),this.destroyed=!1,this.keyPressed=!1,this.spreaderLastSize={width:null,height:null},this.verticalScrolling=!1,this.horizontalScrolling=!1,this.initBrowserLineHeight(),this.registerListeners(),this.lastScrollX=c.scrollX,this.lastScrollY=c.scrollY}getOverlays(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=[...g(m,this)];return e&&t.push(this.wtTable),t}initBrowserLineHeight(){const{rootWindow:e,rootDocument:t}=this.domBindings,r=e.getComputedStyle(t.body),n=parseInt(r.lineHeight,10),s=1.2*parseInt(r.fontSize,10);this.browserLineHeight=n||s}initOverlays(){const e=[this.wot,this.facadeGetter,this.wtSettings,this.domBindings];this.topOverlay=new c.TopOverlay(...e),this.bottomOverlay=new c.BottomOverlay(...e),this.inlineStartOverlay=new c.InlineStartOverlay(...e),this.topInlineStartCornerOverlay=new c.TopInlineStartCornerOverlay(...e,this.topOverlay,this.inlineStartOverlay),this.bottomInlineStartCornerOverlay=new c.BottomInlineStartCornerOverlay(...e,this.bottomOverlay,this.inlineStartOverlay),p(m,this,[this.topOverlay,this.bottomOverlay,this.inlineStartOverlay,this.topInlineStartCornerOverlay,this.bottomInlineStartCornerOverlay])}beforeDraw(){p(y,this,g(m,this).reduce(((e,t)=>t.hasRenderingStateChanged()||e),!1)),g(m,this).forEach((e=>e.updateStateOfRendering("before")))}afterDraw(){this.syncScrollWithMaster(),g(m,this).forEach((e=>{const t=e.hasRenderingStateChanged();e.updateStateOfRendering("after"),t&&!e.needFullRender&&e.reset()}))}refreshAll(){this.wot.drawn&&(this.wtTable.holder.parentNode?(this.wot.draw(!0),this.verticalScrolling&&this.inlineStartOverlay.onScroll(),this.horizontalScrolling&&this.topOverlay.onScroll(),this.verticalScrolling=!1,this.horizontalScrolling=!1):this.destroy())}registerListeners(){const{rootDocument:e,rootWindow:t}=this.domBindings,{mainTableScrollableElement:r}=this.topOverlay,{mainTableScrollableElement:n}=this.inlineStartOverlay;this.eventManager.addEventListener(e.documentElement,"keydown",(e=>this.onKeyDown(e))),this.eventManager.addEventListener(e.documentElement,"keyup",(()=>this.onKeyUp())),this.eventManager.addEventListener(e,"visibilitychange",(()=>this.onKeyUp())),this.eventManager.addEventListener(r,"scroll",(e=>this.onTableScroll(e)),{passive:!0}),r!==n&&this.eventManager.addEventListener(n,"scroll",(e=>this.onTableScroll(e)),{passive:!0});const s=t.devicePixelRatio&&t.devicePixelRatio>1,i=this.scrollableElement===t,a=this.wtSettings.getSetting("preventWheel"),l={passive:i};(a||s||!(0,h.isChrome)())&&this.eventManager.addEventListener(this.wtTable.wtRootElement,"wheel",(e=>this.onCloneWheel(e,a)),l);let u;[this.topOverlay,this.bottomOverlay,this.inlineStartOverlay,this.topInlineStartCornerOverlay,this.bottomInlineStartCornerOverlay].forEach((e=>{this.eventManager.addEventListener(e.clone.wtTable.holder,"wheel",(e=>this.onCloneWheel(e,a)),l)})),this.eventManager.addEventListener(t,"resize",(()=>{(0,o.requestAnimationFrame)((()=>{clearTimeout(u),this.wtSettings.getSetting("onWindowResize"),u=setTimeout((()=>{p(E,this,0)}),200)}))})),i||this.resizeObserver.observe(this.wtTable.wtRootElement.parentElement)}onTableScroll(e){const t=this.domBindings.rootWindow,r=this.inlineStartOverlay.mainTableScrollableElement,n=this.topOverlay.mainTableScrollableElement,s=e.target;this.keyPressed&&(n!==t&&s!==t&&!e.target.contains(n)||r!==t&&s!==t&&!e.target.contains(r))||this.syncScrollPositions(e)}onCloneWheel(e,t){const{rootWindow:r}=this.domBindings,n=this.inlineStartOverlay.mainTableScrollableElement,s=this.topOverlay.mainTableScrollableElement,i=e.target,o=s!==r&&i!==r&&!i.contains(s),a=n!==r&&i!==r&&!i.contains(n);if(this.keyPressed&&(o||a)||this.scrollableElement===r)return;const l=this.translateMouseWheelToScroll(e);(t||this.scrollableElement!==r&&l)&&e.preventDefault()}onKeyDown(e){this.keyPressed=(0,l.isKey)(e.keyCode,"ARROW_UP|ARROW_RIGHT|ARROW_DOWN|ARROW_LEFT")}onKeyUp(){this.keyPressed=!1}translateMouseWheelToScroll(e){let t=isNaN(e.deltaY)?-1*e.wheelDeltaY:e.deltaY,r=isNaN(e.deltaX)?-1*e.wheelDeltaX:e.deltaX;1===e.deltaMode&&(r+=r*this.browserLineHeight,t+=t*this.browserLineHeight);const n=this.scrollVertically(t),s=this.scrollHorizontally(r);return n||s}scrollVertically(e){const t=this.scrollableElement.scrollTop;return this.scrollableElement.scrollTop+=e,t!==this.scrollableElement.scrollTop}scrollHorizontally(e){const t=this.scrollableElement.scrollLeft;return this.scrollableElement.scrollLeft+=e,t!==this.scrollableElement.scrollLeft}syncScrollPositions(){if(this.destroyed)return;const{rootWindow:e}=this.domBindings,t=this.topOverlay.clone.wtTable.holder,r=this.inlineStartOverlay.clone.wtTable.holder,[n,s]=[this.scrollableElement.scrollLeft,this.scrollableElement.scrollTop];if(this.horizontalScrolling=t.scrollLeft!==n||this.lastScrollX!==e.scrollX,this.verticalScrolling=r.scrollTop!==s||this.lastScrollY!==e.scrollY,this.lastScrollX=e.scrollX,this.lastScrollY=e.scrollY,this.horizontalScrolling){t.scrollLeft=n;const e=this.bottomOverlay.needFullRender?this.bottomOverlay.clone.wtTable.holder:null;e&&(e.scrollLeft=n)}this.verticalScrolling&&(r.scrollTop=s),this.refreshAll()}syncScrollWithMaster(){if(!g(y,this))return;const e=this.topOverlay.mainTableScrollableElement,{scrollLeft:t,scrollTop:r}=e;this.topOverlay.needFullRender&&(this.topOverlay.clone.wtTable.holder.scrollLeft=t),this.bottomOverlay.needFullRender&&(this.bottomOverlay.clone.wtTable.holder.scrollLeft=t),this.inlineStartOverlay.needFullRender&&(this.inlineStartOverlay.clone.wtTable.holder.scrollTop=r),p(y,this,!1)}updateMainScrollableElements(){this.eventManager.clearEvents(!0),this.inlineStartOverlay.updateMainScrollableElement(),this.topOverlay.updateMainScrollableElement(),this.bottomOverlay.needFullRender&&this.bottomOverlay.updateMainScrollableElement();const{wtTable:e}=this,{rootWindow:t}=this.domBindings;"hidden"===t.getComputedStyle(e.wtRootElement.parentNode).getPropertyValue("overflow")?this.scrollableElement=e.holder:this.scrollableElement=(0,i.getScrollableElement)(e.TABLE),this.registerListeners()}destroy(){this.resizeObserver.disconnect(),this.eventManager.destroy(),this.topOverlay.destroy(),this.bottomOverlay.clone&&this.bottomOverlay.destroy(),this.inlineStartOverlay.destroy(),this.topInlineStartCornerOverlay&&this.topInlineStartCornerOverlay.destroy(),this.bottomInlineStartCornerOverlay&&this.bottomInlineStartCornerOverlay.clone&&this.bottomInlineStartCornerOverlay.destroy(),this.destroyed=!0}refresh(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.updateLastSpreaderSize()&&this.adjustElementsSize(),this.bottomOverlay.clone&&this.bottomOverlay.refresh(e),this.inlineStartOverlay.refresh(e),this.topOverlay.refresh(e),this.topInlineStartCornerOverlay&&this.topInlineStartCornerOverlay.refresh(e),this.bottomInlineStartCornerOverlay&&this.bottomInlineStartCornerOverlay.clone&&this.bottomInlineStartCornerOverlay.refresh(e)}updateLastSpreaderSize(){const e=this.wtTable.spreader,t=e.clientWidth,r=e.clientHeight,n=t!==this.spreaderLastSize.width||r!==this.spreaderLastSize.height;return n&&(this.spreaderLastSize.width=t,this.spreaderLastSize.height=r),n}adjustElementsSize(){const{wtViewport:e}=this.wot,{wtTable:t}=this,{rootWindow:r}=this.domBindings,n=this.scrollableElement===r,s=this.wtSettings.getSetting("totalColumns"),i=this.wtSettings.getSetting("totalRows"),o=e.getRowHeaderWidth(),a=e.getColumnHeaderHeight()+this.topOverlay.sumCellSizes(0,i)+1,l=o+this.inlineStartOverlay.sumCellSizes(0,s),h=t.hider.style,u=(()=>!n&&this.scrollableElement.scrollTop>Math.max(0,a-t.holder.clientHeight))()?1:0,c=(()=>!n&&this.scrollableElement.scrollLeft>Math.max(0,l-t.holder.clientWidth))()?1:0;h.width=`${l+c}px`,h.height=`${a+u}px`,this.topOverlay.adjustElementsSize(),this.inlineStartOverlay.adjustElementsSize(),this.bottomOverlay.adjustElementsSize()}expandHiderVerticallyBy(e){const{wtTable:t}=this;t.hider.style.height=`${parseInt(t.hider.style.height,10)+e}px`}expandHiderHorizontallyBy(e){const{wtTable:t}=this;t.hider.style.width=`${parseInt(t.hider.style.width,10)+e}px`}applyToDOM(){this.wtTable.isVisible()&&(this.topOverlay.applyToDOM(),this.bottomOverlay.clone&&this.bottomOverlay.applyToDOM(),this.inlineStartOverlay.applyToDOM())}getParentOverlay(e){if(!e)return null;const t=[this.topOverlay,this.inlineStartOverlay,this.bottomOverlay,this.topInlineStartCornerOverlay,this.bottomInlineStartCornerOverlay];let r=null;return(0,a.arrayEach)(t,(t=>{t&&t.clone&&t.clone.wtTable.TABLE.contains(e)&&(r=t.clone)})),r}syncOverlayTableClassNames(){const e=this.wtTable.TABLE,t=[this.topOverlay,this.inlineStartOverlay,this.bottomOverlay,this.topInlineStartCornerOverlay,this.bottomInlineStartCornerOverlay];(0,a.arrayEach)(t,(t=>{t&&(t.clone.wtTable.TABLE.className=e.className)}))}}},41608:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0;var s=n(r(85707)),i=r(76095);t.BaseRenderer=class{constructor(e,t){(0,s.default)(this,"nodesPool",null),(0,s.default)(this,"nodeType",void 0),(0,s.default)(this,"rootNode",void 0),(0,s.default)(this,"table",null),(0,s.default)(this,"renderedNodes",0),this.nodesPool="string"==typeof e?new i.NodesPool(e):null,this.nodeType=e,this.rootNode=t}setTable(e){this.nodesPool&&this.nodesPool.setRootDocument(e.rootDocument),this.table=e}adjust(){}render(){}}},62861:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0;var s=n(r(85707)),i=r(62577),o=r(97646),a=r(41608),l=r(71120);class h extends a.BaseRenderer{constructor(){super("TD"),(0,s.default)(this,"orderViews",new WeakMap),(0,s.default)(this,"sourceRowIndex",0)}obtainOrderView(e){let t;return this.orderViews.has(e)?t=this.orderViews.get(e):(t=new o.SharedOrderView(e,(e=>this.nodesPool.obtain(this.sourceRowIndex,e)),this.nodeType),this.orderViews.set(e,t)),t}render(){const{rowsToRender:e,columnsToRender:t,rows:r,rowHeaders:n}=this.table;for(let a=0;a{"use strict";t.__esModule=!0;var n=r(41608),s=r(14859),i=r(21595),o=r(62577);let a=!1;class l extends n.BaseRenderer{constructor(e){super(null,e)}adjust(){const{columnsToRender:e,rowHeadersCount:t}=this.table,r=e+t;for(;this.renderedNodesr;)this.rootNode.removeChild(this.rootNode.lastChild),this.renderedNodes-=1}render(){this.adjust();const{columnsToRender:e,rowHeadersCount:t}=this.table;!a&&e>1e3&&(a=!0,(0,s.warn)(i.toSingleLine`Performance tip: Handsontable rendered more than 1000 visible columns.\x20 + Consider limiting the number of rendered columns by specifying the table width and/or\x20 + turning off the "renderAllColumns" option.`));for(let e=0;e{"use strict";t.__esModule=!0;var n=r(62577),s=r(41608),i=r(71120);class o extends s.BaseRenderer{constructor(e){super(null,e)}adjust(){const{columnHeadersCount:e,rowHeadersCount:t}=this.table;let r=this.rootNode.firstChild;if(e){const{columnsToRender:n}=this.table,s=n+t;for(let t=0,n=e;ts;)r.removeChild(r.lastChild),this.renderedNodes-=1}const i=this.rootNode.childNodes.length;if(i>e)for(let t=e;t=0?[(0,i.A11Y_SCOPE_COL)()]:[(0,i.A11Y_ROW)()]]),e[t](r,l,t)}}}}t.ColumnHeadersRenderer=o},36936:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(59376);t.RowHeadersRenderer=n.RowHeadersRenderer;var s=r(75396);t.ColumnHeadersRenderer=s.ColumnHeadersRenderer;var i=r(16951);t.ColGroupRenderer=i.ColGroupRenderer;var o=r(98575);t.RowsRenderer=o.RowsRenderer;var a=r(62861);t.CellsRenderer=a.CellsRenderer;var l=r(85604);t.TableRenderer=l.TableRenderer;t.Renderer=class{constructor(){let{TABLE:e,THEAD:t,COLGROUP:r,TBODY:h,rowUtils:u,columnUtils:c,cellRenderer:d,stylesHandler:p}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.renderer=new l.TableRenderer(e,{cellRenderer:d,stylesHandler:p}),this.renderer.setRenderers({rowHeaders:new n.RowHeadersRenderer,columnHeaders:new s.ColumnHeadersRenderer(t),colGroup:new i.ColGroupRenderer(r),rows:new o.RowsRenderer(h),cells:new a.CellsRenderer}),this.renderer.setAxisUtils(u,c)}setActiveOverlayName(e){return this.renderer.setActiveOverlayName(e),this}setFilters(e,t){return this.renderer.setFilters(e,t),this}setViewportSize(e,t){return this.renderer.setViewportSize(e,t),this}setHeaderContentRenderers(e,t){return this.renderer.setHeaderContentRenderers(e,t),this}adjust(){this.renderer.adjust()}render(){this.renderer.render()}}},59376:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0;var s=n(r(85707)),i=r(97646),o=r(41608),a=r(62577),l=r(71120);class h extends o.BaseRenderer{constructor(){super("TH"),(0,s.default)(this,"orderViews",new WeakMap),(0,s.default)(this,"sourceRowIndex",0)}obtainOrderView(e){let t;return this.orderViews.has(e)?t=this.orderViews.get(e):(t=new i.SharedOrderView(e,(e=>this.nodesPool.obtain(this.sourceRowIndex,e))),this.orderViews.set(e,t)),t}render(){const{rowsToRender:e,rowHeaderFunctions:t,rowHeadersCount:r,rows:n,cells:s}=this.table;for(let i=0;i{"use strict";var n=r(96784);t.__esModule=!0;var s=n(r(85707)),i=r(41608),o=r(14859),a=r(21595),l=r(97646),h=r(62577),u=r(71120);const c="ht__row_even",d="ht__row_odd";let p=!1;class g extends i.BaseRenderer{constructor(e){super("TR",e),(0,s.default)(this,"orderView",void 0),this.orderView=new l.OrderView(e,(e=>this.nodesPool.obtain(e)))}getRenderedNode(e){return this.orderView.getNode(e)}hasStaleContent(e){return this.orderView.hasStaleContent(e)}render(){const{rowsToRender:e}=this.table;!p&&e>1e3&&(p=!0,(0,o.warn)(a.toSingleLine`Performance tip: Handsontable rendered more than 1000 visible rows.\x20 + Consider limiting the number of rendered rows by specifying the table height and/or\x20 + turning off the "renderAllRows" option.`)),this.table.isAriaEnabled()&&(0,h.setAttribute)(this.rootNode,[(0,u.A11Y_ROWGROUP)()]),this.orderView.setSize(e).setOffset(this.table.renderedRowToSource(0)).start();for(let n=0;n{"use strict";var n=r(96784);t.__esModule=!0;var s=n(r(85707));t.TableRenderer=class{constructor(e){let{cellRenderer:t,stylesHandler:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,s.default)(this,"rootNode",void 0),(0,s.default)(this,"rootDocument",void 0),(0,s.default)(this,"rowHeaders",null),(0,s.default)(this,"columnHeaders",null),(0,s.default)(this,"colGroup",null),(0,s.default)(this,"rows",null),(0,s.default)(this,"cells",null),(0,s.default)(this,"rowFilter",null),(0,s.default)(this,"columnFilter",null),(0,s.default)(this,"rowUtils",null),(0,s.default)(this,"columnUtils",null),(0,s.default)(this,"rowsToRender",0),(0,s.default)(this,"columnsToRender",0),(0,s.default)(this,"rowHeaderFunctions",[]),(0,s.default)(this,"rowHeadersCount",0),(0,s.default)(this,"columnHeaderFunctions",[]),(0,s.default)(this,"columnHeadersCount",0),(0,s.default)(this,"cellRenderer",void 0),(0,s.default)(this,"activeOverlayName",void 0),(0,s.default)(this,"stylesHandler",void 0),this.rootNode=e,this.rootDocument=this.rootNode.ownerDocument,this.cellRenderer=t,this.stylesHandler=r}setActiveOverlayName(e){this.activeOverlayName=e}setAxisUtils(e,t){this.rowUtils=e,this.columnUtils=t}setViewportSize(e,t){this.rowsToRender=e,this.columnsToRender=t}setFilters(e,t){this.rowFilter=e,this.columnFilter=t}setHeaderContentRenderers(e,t){this.rowHeaderFunctions=e,this.rowHeadersCount=e.length,this.columnHeaderFunctions=t,this.columnHeadersCount=t.length}setRenderers(){let{rowHeaders:e,columnHeaders:t,colGroup:r,rows:n,cells:s}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.setTable(this),t.setTable(this),r.setTable(this),n.setTable(this),s.setTable(this),this.rowHeaders=e,this.columnHeaders=t,this.colGroup=r,this.rows=n,this.cells=s}renderedRowToSource(e){return this.rowFilter.renderedToSource(e)}renderedColumnToSource(e){return this.columnFilter.renderedToSource(e)}isAriaEnabled(){return this.rowUtils.wtSettings.getSetting("ariaTags")}render(){this.colGroup.adjust(),this.columnHeaders.adjust(),this.rows.adjust(),this.rowHeaders.adjust(),this.columnHeaders.render(),this.rows.render(),this.rowHeaders.render(),this.cells.render(),this.columnUtils.calculateWidths(),this.colGroup.render();const{rowsToRender:e,rows:t}=this;for(let r=0;r{"use strict";var n=r(96784);t.__esModule=!0,r(67834);var s=n(r(85707)),i=r(62577),o=r(25499);function a(e,t){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.add(e)}function l(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var h=new WeakSet;function u(e){const{wtSettings:t,inlineStartOverlay:r,wtTable:n,wtViewport:s,totalColumns:o,rootWindow:a}=this.dataAccessObject;if(r.mainTableScrollableElement===a){let l=null;if(t.getSetting("rtlMode")){const e=n.TABLE.getBoundingClientRect(),t=this.dataAccessObject.rootWindow.document.documentElement.offsetWidth;l=Math.abs(e.right-t)}else{l=(0,i.offset)(n.wtRootElement).left}const h=Math.abs((0,i.getScrollLeft)(a,a));if(l>h){const t=(0,i.innerWidth)(a);let n=s.getRowHeaderWidth();for(let s=1;s<=o;s++)if(n+=r.sumCellSizes(s-1,s),l+n-h>=t){e=s-2;break}}}return e}function c(e){const{topOverlay:t,wtTable:r,wtViewport:n,totalRows:s,rootWindow:o}=this.dataAccessObject;if(t.mainTableScrollableElement===o){const a=(0,i.offset)(r.wtRootElement),l=(0,i.getScrollTop)(o,o);if(a.top>l){const r=(0,i.innerHeight)(o);let h=n.getColumnHeaderHeight();for(let n=1;n<=s;n++)if(h+=t.sumCellSizes(n-1,n),a.top+h-l>=r){e=n-2;break}}}return e}t.default=class{constructor(e){a(this,h),(0,s.default)(this,"dataAccessObject",void 0),this.dataAccessObject=e}scrollViewport(e,t,r){if(e.col<0||e.row<0)return!1;const n=this.scrollViewportHorizontally(e.col,t),s=this.scrollViewportVertically(e.row,r);return n||s}scrollViewportHorizontally(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"auto";const{drawn:r,totalColumns:n}=this.dataAccessObject;if(!r)return!1;const s=(0,o.createObjectPropListener)(t);if(e=this.dataAccessObject.wtSettings.getSetting("onBeforeViewportScrollHorizontally",e,s),!Number.isInteger(e)||e<0||e>n)return!1;t=s.value;const{fixedColumnsStart:i,inlineStartOverlay:a}=this.dataAccessObject,l="auto"===t;if(l&&eu)||!l)&&(c=a.scrollTo(e,l?e>=this.getLastPartiallyVisibleColumn():"end"===t)),c}scrollViewportVertically(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"auto";const{drawn:r,totalRows:n}=this.dataAccessObject;if(!r)return!1;const s=(0,o.createObjectPropListener)(t);if(e=this.dataAccessObject.wtSettings.getSetting("onBeforeViewportScrollVertically",e,s),!Number.isInteger(e)||e<0||e>n)return!1;t=s.value;const{fixedRowsBottom:i,fixedRowsTop:a,topOverlay:l}=this.dataAccessObject,h="auto"===t;if(h&&(en-i-1))return!1;const u=this.getFirstVisibleRow(),c=this.getLastVisibleRow();let d=!1;return(h&&(ec)||!h)&&(d=l.scrollTo(e,h?e>=this.getLastPartiallyVisibleRow():"bottom"===t)),d}getFirstVisibleRow(){return this.dataAccessObject.wtTable.getFirstVisibleRow()}getLastVisibleRow(){return l(h,this,c).call(this,this.dataAccessObject.wtTable.getLastVisibleRow())}getFirstPartiallyVisibleRow(){return this.dataAccessObject.wtTable.getFirstPartiallyVisibleRow()}getLastPartiallyVisibleRow(){return l(h,this,c).call(this,this.dataAccessObject.wtTable.getLastPartiallyVisibleRow())}getFirstVisibleColumn(){return this.dataAccessObject.wtTable.getFirstVisibleColumn()}getLastVisibleColumn(){return l(h,this,u).call(this,this.dataAccessObject.wtTable.getLastVisibleColumn())}getFirstPartiallyVisibleColumn(){return this.dataAccessObject.wtTable.getFirstPartiallyVisibleColumn()}getLastPartiallyVisibleColumn(){return l(h,this,u).call(this,this.dataAccessObject.wtTable.getLastPartiallyVisibleColumn())}}},32506:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(62577),s=r(77661),i=r(25499),o=r(25046),a=r(38087);t.default=class{constructor(e,t){t&&(this.eventManager=e.eventManager,this.instance=e,this.wot=e,this.settings=t,this.mouseDown=!1,this.main=null,this.top=null,this.bottom=null,this.start=null,this.end=null,this.topStyle=null,this.bottomStyle=null,this.startStyle=null,this.endStyle=null,this.cornerDefaultStyle=(0,a.getCornerStyle)(this.instance),this.cornerCenterPointOffset=-Math.ceil(parseInt(this.cornerDefaultStyle.width,10)/2),this.corner=null,this.cornerStyle=null,this.createBorders(t),this.registerListeners())}registerListeners(){const e=this.wot.rootDocument.body;this.eventManager.addEventListener(e,"mousedown",(()=>this.onMouseDown())),this.eventManager.addEventListener(e,"mouseup",(()=>this.onMouseUp()));for(let e=0,t=this.main.childNodes.length;ethis.onMouseEnter(t,this.main.childNodes[e])))}}onMouseDown(){this.mouseDown=!0}onMouseUp(){this.mouseDown=!1}onMouseEnter(e,t){if(!this.mouseDown||!this.wot.getSetting("hideBorderOnMouseDownOver"))return;e.preventDefault(),(0,s.stopImmediatePropagation)(e);const r=this,n=this.wot.rootDocument.body,i=t.getBoundingClientRect();t.style.display="none",this.eventManager.addEventListener(n,"mousemove",(function e(s){var o;((o=s).clientYMath.ceil(i.top+i.height)||o.clientXMath.ceil(i.left+i.width))&&(r.eventManager.removeEventListener(n,"mousemove",e),t.style.display="block")}))}createBorders(e){const{rootDocument:t}=this.wot;this.main=t.createElement("div");const r=["top","start","bottom","end","corner"];let n=this.main.style;n.position="absolute",n.top=0,n.left=0;for(let s=0;s<5;s++){const i=r[s],o=t.createElement("div");o.className=`wtBorder ${this.settings.className||""}`,this.settings[i]&&this.settings[i].hide&&(o.className+=" hidden"),n=o.style,n.backgroundColor=this.settings[i]&&this.settings[i].color?this.settings[i].color:e.border.color,n.height=this.settings[i]&&this.settings[i].width?`${this.settings[i].width}px`:`${e.border.width}px`,n.width=this.settings[i]&&this.settings[i].width?`${this.settings[i].width}px`:`${e.border.width}px`,this.main.appendChild(o)}this.top=this.main.childNodes[0],this.start=this.main.childNodes[1],this.bottom=this.main.childNodes[2],this.end=this.main.childNodes[3],this.topStyle=this.top.style,this.startStyle=this.start.style,this.bottomStyle=this.bottom.style,this.endStyle=this.end.style,this.corner=this.main.childNodes[4],this.corner.className+=" corner",this.cornerStyle=this.corner.style,this.cornerStyle.width=`${this.cornerDefaultStyle.width}px`,this.cornerStyle.height=`${this.cornerDefaultStyle.height}px`,this.cornerStyle.border=[`${this.cornerDefaultStyle.borderWidth}px`,this.cornerDefaultStyle.borderStyle,this.cornerDefaultStyle.borderColor].join(" "),(0,o.isMobileBrowser)()&&this.instance.getSetting("isDataViewInstance")&&this.createMultipleSelectorHandles(),this.disappear();const{wtTable:s}=this.wot;let i=s.bordersHolder;i||(i=t.createElement("div"),i.className="htBorders",s.bordersHolder=i,s.spreader.appendChild(i)),i.appendChild(this.main)}createMultipleSelectorHandles(){const{rootDocument:e}=this.wot;this.selectionHandles={top:e.createElement("DIV"),topHitArea:e.createElement("DIV"),bottom:e.createElement("DIV"),bottomHitArea:e.createElement("DIV")};this.selectionHandles.top.className="topSelectionHandle topLeftSelectionHandle",this.selectionHandles.topHitArea.className="topSelectionHandle-HitArea topLeftSelectionHandle-HitArea",this.selectionHandles.bottom.className="bottomSelectionHandle bottomRightSelectionHandle",this.selectionHandles.bottomHitArea.className="bottomSelectionHandle-HitArea bottomRightSelectionHandle-HitArea",this.selectionHandles.styles={top:this.selectionHandles.top.style,topHitArea:this.selectionHandles.topHitArea.style,bottom:this.selectionHandles.bottom.style,bottomHitArea:this.selectionHandles.bottomHitArea.style};const t={position:"absolute",height:"40px",width:"40px","border-radius":`${parseInt(40/1.5,10)}px`};(0,i.objectEach)(t,((e,t)=>{this.selectionHandles.styles.bottomHitArea[t]=e,this.selectionHandles.styles.topHitArea[t]=e}));const r={position:"absolute",height:"10px",width:"10px","border-radius":`${parseInt(10/1.5,10)}px`,background:"#F5F5FF",border:"1px solid #4285c8"};(0,i.objectEach)(r,((e,t)=>{this.selectionHandles.styles.bottom[t]=e,this.selectionHandles.styles.top[t]=e})),this.main.appendChild(this.selectionHandles.top),this.main.appendChild(this.selectionHandles.bottom),this.main.appendChild(this.selectionHandles.topHitArea),this.main.appendChild(this.selectionHandles.bottomHitArea)}isPartRange(e,t){const r=this.wot.selectionManager.getAreaSelection();return!(!r.cellRange||e===r.cellRange.to.row&&t===r.cellRange.to.col)}updateMultipleSelectionHandlesPosition(e,t,r,n,s,i){const o=this.wot.wtSettings.getSetting("rtlMode")?"right":"left",{top:a,topHitArea:l,bottom:h,bottomHitArea:u}=this.selectionHandles.styles,c=parseInt(a.borderWidth,10),d=parseInt(a.width,10),p=parseInt(l.width,10),g=this.wot.wtTable.getWidth(),f=this.wot.wtTable.getHeight();a.top=`${parseInt(r-d-1,10)}px`,a[o]=`${parseInt(n-d-1,10)}px`,l.top=`${parseInt(r-p/4*3,10)}px`,l[o]=`${parseInt(n-p/4*3,10)}px`;const m=Math.min(parseInt(n+s,10),g-d-2*c),y=Math.min(parseInt(n+s-p/4,10),g-p-2*c);h[o]=`${m}px`,u[o]=`${y}px`;const E=Math.min(parseInt(r+i,10),f-d-2*c),w=Math.min(parseInt(r+i-p/4,10),f-p-2*c);h.top=`${E}px`,u.top=`${w}px`,this.settings.border.cornerVisible&&this.settings.border.cornerVisible()?(a.display="block",l.display="block",this.isPartRange(e,t)?(h.display="none",u.display="none"):(h.display="block",u.display="block")):(a.display="none",h.display="none",l.display="none",u.display="none"),e===this.wot.wtSettings.getSetting("fixedRowsTop")||t===this.wot.wtSettings.getSetting("fixedColumnsStart")?(a.zIndex="9999",l.zIndex="9999"):(a.zIndex="",l.zIndex="")}appear(e){if(this.disabled)return;let[t,r,s,i]=e;if(t<0&&s<0||r<0&&i<0)return void this.disappear();const{wtTable:a,rootDocument:l,rootWindow:h}=this.wot,u=t!==s||r!==i,c=a.getFirstRenderedRow(),d=a.getLastRenderedRow(),p=a.getFirstRenderedColumn(),g=a.getLastRenderedColumn();let f;if(u){if(r=Math.max(r,p),i=Math.min(i,g),t=Math.max(t,c),s=Math.min(s,d),i0&&(N+=1,M=M>0?M-1:0),parseInt(_[R?"borderRightWidth":"borderLeftWidth"],10)>0&&(S+=1,T=T>0?T-1:0);const b=R?"right":"left";this.topStyle.top=`${N}px`,this.topStyle[b]=`${S}px`,this.topStyle.width=`${T}px`,this.topStyle.display="block",this.startStyle.top=`${N}px`,this.startStyle[b]=`${S}px`,this.startStyle.height=`${M}px`,this.startStyle.display="block";const O=Math.floor(this.settings.border.width/2);this.bottomStyle.top=N+M-O+"px",this.bottomStyle[b]=`${S}px`,this.bottomStyle.width=`${T}px`,this.bottomStyle.display="block",this.endStyle.top=`${N}px`,this.endStyle[b]=S+T-O+"px",this.endStyle.height=`${M+1}px`,this.endStyle.display="block";let A=this.settings.border.cornerVisible;A="function"==typeof A?A(this.settings.layerLevel):A;const I=this.wot.getSetting("onModifyGetCellCoords",s,i,!1,"render");let[x,P]=[s,i];if(I&&Array.isArray(I)&&([,,x,P]=I),(0,o.isMobileBrowser)()||!A||this.isPartRange(x,P))this.cornerStyle.display="none";else{this.cornerStyle.top=N+M+this.cornerCenterPointOffset-this.cornerDefaultStyle.borderWidth+"px",this.cornerStyle[b]=S+T+this.cornerCenterPointOffset-this.cornerDefaultStyle.borderWidth+"px",this.cornerStyle.borderRightWidth=`${this.cornerDefaultStyle.borderWidth}px`,this.cornerStyle.borderLeftWidth=`${this.cornerDefaultStyle.borderWidth}px`,this.cornerStyle.borderBottomWidth=`${this.cornerDefaultStyle.borderWidth}px`,this.cornerStyle.width=this.cornerDefaultStyle.width,this.cornerStyle.display="none";let e=(0,n.getTrimmingContainer)(a.TABLE);const t=e===h;t&&(e=l.documentElement);const r=parseInt(this.cornerDefaultStyle.borderWidth,10)-1,o=Math.ceil(parseInt(this.cornerDefaultStyle.width,10)/2),u=Math.ceil(parseInt(this.cornerDefaultStyle.height,10)/2);if(i===this.wot.getSetting("totalColumns")-1){const s=t?m.getBoundingClientRect().left:m.offsetLeft;let i=!1,a=0;R?(a=s-parseInt(this.cornerDefaultStyle.width,10)/2,i=a<0):(a=s+(0,n.outerWidth)(m)+parseInt(this.cornerDefaultStyle.width,10)/2,i=a>=(0,n.innerWidth)(e)),i&&(this.cornerStyle[b]=`${Math.floor(S+T+this.cornerCenterPointOffset-o-r)}px`,this.cornerStyle[R?"borderLeftWidth":"borderRightWidth"]=0)}if(s===this.wot.getSetting("totalRows")-1){const s=(t?m.getBoundingClientRect().top:m.offsetTop)+(0,n.outerHeight)(m)+parseInt(this.cornerDefaultStyle.height,10)/2>=(0,n.innerHeight)(e),i=this.wot.stylesHandler.isClassicTheme();if(s){const e=Math.floor(N+M+this.cornerCenterPointOffset-u-r);i?(this.cornerStyle.top=`${e}px`,this.cornerStyle.borderBottomWidth=0):this.cornerStyle.top=e-1+"px"}}this.cornerStyle.display="block"}(0,o.isMobileBrowser)()&&this.instance.getSetting("isDataViewInstance")&&this.updateMultipleSelectionHandlesPosition(s,i,N,S,T,M)}isEntireColumnSelected(e,t){return e===this.wot.wtTable.getFirstRenderedRow()&&t===this.wot.wtTable.getLastRenderedRow()}isEntireRowSelected(e,t){return e===this.wot.wtTable.getFirstRenderedColumn()&&t===this.wot.wtTable.getLastRenderedColumn()}getDimensionsFromHeader(e,t,r,s,i){const{wtTable:o}=this.wot,a=o.wtRootElement.parentNode;let l=null,h=null,u=null,c=null,d=null,p=null,g=null,f=null;switch(e){case"rows":l=function(){return o.getRowHeader(...arguments)},h=function(){return(0,n.outerHeight)(...arguments)},u="ht__selection--rows",p="top";break;case"columns":l=function(){return o.getColumnHeader(...arguments)},h=function(){return(0,n.outerWidth)(...arguments)},u="ht__selection--columns",p="left"}if(a.classList.contains(u)){const e=this.wot.getSetting("columnHeaders").length;if(g=l(t,e-s),f=l(r,e-s),!g||!f)return!1;const o=(0,n.offset)(g),a=(0,n.offset)(f);return g&&f&&(c=o[p]-i[p]-1,d=a[p]+h(f)-o[p]),[g,c,d]}return!1}changeBorderStyle(e,t){const r=this[e].style,s=t[e];!s||s.hide?(0,n.addClass)(this[e],"hidden"):((0,n.hasClass)(this[e],"hidden")&&(0,n.removeClass)(this[e],"hidden"),r.backgroundColor=s.color,"top"!==e&&"bottom"!==e||(r.height=`${s.width}px`),"start"!==e&&"end"!==e||(r.width=`${s.width}px`))}changeBorderToDefaultStyle(e){const t=1,r="#000",n=this[e].style;n.backgroundColor=r,n.width=`${t}px`,n.height=`${t}px`}toggleHiddenClass(e,t){this.changeBorderToDefaultStyle(e),t?(0,n.addClass)(this[e],"hidden"):(0,n.removeClass)(this[e],"hidden")}disappear(){this.topStyle.display="none",this.bottomStyle.display="none",this.startStyle.display="none",this.endStyle.display="none",this.cornerStyle.display="none",(0,o.isMobileBrowser)()&&this.instance.getSetting("isDataViewInstance")&&(this.selectionHandles.styles.top.display="none",this.selectionHandles.styles.topHitArea.display="none",this.selectionHandles.styles.bottom.display="none",this.selectionHandles.styles.bottomHitArea.display="none")}destroy(){this.eventManager.destroyWithOwnEventsOnly(),this.main.parentNode.removeChild(this.main)}}},38087:(e,t)=>{"use strict";t.__esModule=!0;t.getCornerStyle=e=>{const t=e.stylesHandler;if(t.isClassicTheme())return Object.freeze({width:6,height:6,borderWidth:1,borderStyle:"solid",borderColor:"#FFF"});const r=t.getCSSVariableValue("cell-autofill-size"),n=t.getCSSVariableValue("cell-autofill-border-width"),s=t.getCSSVariableValue("cell-autofill-border-color");return Object.freeze({width:r,height:r,borderWidth:n,borderStyle:"solid",borderColor:s})}},20746:(e,t)=>{"use strict";t.__esModule=!0;t.ACTIVE_HEADER_TYPE="active-header",t.HEADER_TYPE="header",t.AREA_TYPE="area",t.FOCUS_TYPE="focus",t.FILL_TYPE="fill",t.ROW_TYPE="row",t.COLUMN_TYPE="column",t.CUSTOM_SELECTION_TYPE="custom-selection"},70471:(e,t,r)=>{"use strict";r(14846),r(69655);var n=r(96784);t.__esModule=!0;var s={SelectionManager:!0,Selection:!0},i=n(r(42157));t.Selection=i.default;var o=r(20746);Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(s,e)||e in t&&t[e]===o[e]||(t[e]=o[e]))}));var a=r(38087);Object.keys(a).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(s,e)||e in t&&t[e]===a[e]||(t[e]=a[e]))}));var l=r(67600);t.SelectionManager=l.SelectionManager},67600:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834),r(15724),r(25352),r(71336),r(41558),r(17663),r(68630),r(79645),r(89858),r(8620),r(14846),r(69655),r(94364);var s=r(62577),i=r(10917),o=n(r(32506));function a(e,t,r){l(e,t),t.set(e,r)}function l(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function h(e,t){return e.get(c(e,t))}function u(e,t,r){return e.set(c(e,t),r),r}function c(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var d=new WeakMap,p=new WeakMap,g=new WeakMap,f=new WeakMap,m=new WeakMap,y=new WeakMap,E=new WeakSet;function w(){const e=h(f,this).get(h(d,this)),t=h(d,this).wtSettings.getSetting("onBeforeRemoveCellClassNames");if(Array.isArray(t))for(let r=0;r{var t,r;const n=h(d,this).wtTable.TABLE.querySelectorAll(`.${e}`);let i=[];Array.isArray(null===(t=h(p,this).options)||void 0===t?void 0:t.cellAttributes)&&(i=h(p,this).options.cellAttributes.map((e=>e[0]))),Array.isArray(null===(r=h(p,this).options)||void 0===r?void 0:r.headerAttributes)&&(i=[...i,...h(p,this).options.headerAttributes.map((e=>e[0]))]);for(let t=0,r=n.length;te.destroy())),h(y,this).delete(e)}render(e){if(null===h(p,this))return;e&&c(E,this,w).call(this);const t=Array.from(h(p,this)),r=new Map,n=new Map;for(let e=0;ethis.destroyBorders(s))));const u=this.getBorderInstance(s);if(s.isEmpty()){null==u||u.disappear();continue}if(i){h(g,this).setActiveSelection(s).scan().forEach((e=>{if(r.has(e)){const t=r.get(e);t.has(i)&&!0===a?t.set(i,t.get(i)+1):t.set(i,1)}else r.set(e,new Map([[i,1]]));o&&(n.has(e)||n.set(e,[]),"TH"===e.nodeName&&n.get(e).push(...o))}))}const c=s.getCorners();h(d,this).getSetting("onBeforeDrawBorders",c,l),null==u||u.appear(c)}r.forEach(((e,t)=>{var r;const n=Array.from(e).map((e=>{let[t,r]=e;return 1===r?t:[t,...Array.from({length:r-1},((e,r)=>`${t}-${r+1}`))]})).flat();n.forEach((e=>h(f,this).get(h(d,this)).add(e))),(0,s.addClass)(t,n),"TD"===t.nodeName&&Array.isArray(null===(r=h(p,this).options)||void 0===r?void 0:r.cellAttributes)&&(0,s.setAttribute)(t,h(p,this).options.cellAttributes)})),Array.from(n.keys()).forEach((e=>{(0,s.setAttribute)(e,[...n.get(e)])}))}}},10917:(e,t,r)=>{"use strict";t.__esModule=!0,r(67834),r(71336),r(41558),r(17663),r(68630),r(79645),r(89858),r(8620);var n=r(62577);function s(e,t,r){i(e,t),t.set(e,r)}function i(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function o(e,t){return e.get(l(e,t))}function a(e,t,r){return e.set(l(e,t),r),r}function l(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var h=new WeakMap,u=new WeakMap,c=new WeakSet;function d(e){let[t,r,n,s]=o(h,this).getCorners();if(t<0&&n<0||r<0&&s<0)return;const{wtTable:i}=o(u,this),a=t!==n||r!==s;if(r=Math.max(r,0),s=Math.max(s,0),t=Math.max(t,0),n=Math.max(n,0),a){if(r=Math.max(r,i.getFirstRenderedColumn()),s=Math.min(s,i.getLastRenderedColumn()),t=Math.max(t,i.getFirstRenderedRow()),n=Math.min(n,i.getLastRenderedRow()),st.add(e))),this.scanRowsInHeadersRange((e=>t.add(e)))):"area"===e?this.scanCellsRange((e=>t.add(e))):"focus"===e?(this.scanColumnsInHeadersRange((e=>t.add(e))),this.scanRowsInHeadersRange((e=>t.add(e))),this.scanCellsRange((e=>t.add(e)))):"fill"===e?this.scanCellsRange((e=>t.add(e))):"header"===e?(this.scanColumnsInHeadersRange((e=>t.add(e))),this.scanRowsInHeadersRange((e=>t.add(e)))):"row"===e?(this.scanRowsInHeadersRange((e=>t.add(e))),this.scanRowsInCellsRange((e=>t.add(e)))):"column"===e&&(this.scanColumnsInHeadersRange((e=>t.add(e))),this.scanColumnsInCellsRange((e=>t.add(e)))),t}scanColumnsInHeadersRange(e){const[t,r,n,s]=o(h,this).getCorners(),{wtTable:i}=o(u,this),a=i.getRenderedColumnsCount(),l=i.getColumnHeadersCount();let c=0;for(let d=-i.getRowHeadersCount();ds)){for(let d=-l;d<0;d++){if(dn)continue;const p=d+l;let g=i.getColumnHeader(a,p);const f=o(u,this).getSetting("onBeforeHighlightingColumnHeader",a,p,{selectionType:o(h,this).settings.selectionType,columnCursor:c,selectionWidth:s-r+1});null!==f&&(f!==a&&(g=i.getColumnHeader(f,p)),e(g))}c+=1}}}scanRowsInHeadersRange(e){const[t,r,n,s]=o(h,this).getCorners(),{wtTable:i}=o(u,this),a=i.getRenderedRowsCount(),l=i.getRowHeadersCount();let c=0;for(let d=-i.getColumnHeadersCount();dn)){for(let d=-l;d<0;d++){if(ds)continue;const p=d+l;let g=i.getRowHeader(a,p);const f=o(u,this).getSetting("onBeforeHighlightingRowHeader",a,p,{selectionType:o(h,this).settings.selectionType,rowCursor:c,selectionHeight:n-t+1});null!==f&&(f!==a&&(g=i.getRowHeader(f,p)),e(g))}c+=1}}}scanCellsRange(e){const{wtTable:t}=o(u,this);l(c,this,d).call(this,((r,s)=>{const i=t.getCell(o(u,this).createCellCoords(r,s)),a=o(u,this).getSetting("onAfterDrawSelection",r,s,o(h,this).settings.layerLevel);"string"==typeof a&&(0,n.addClass)(i,a),e(i)}))}scanRowsInCellsRange(e){const[t,,r]=o(h,this).getCorners(),{wtTable:n}=o(u,this);l(c,this,p).call(this,((s,i)=>{if(s>=t&&s<=r){const t=n.getCell(o(u,this).createCellCoords(s,i));e(t)}}))}scanColumnsInCellsRange(e){const[,t,,r]=o(h,this).getCorners(),{wtTable:n}=o(u,this);l(c,this,p).call(this,((s,i)=>{if(i>=t&&i<=r){const t=n.getCell(o(u,this).createCellCoords(s,i));e(t)}}))}}},42157:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0;var s=r(25499),i=n(r(16050));class o{constructor(e,t){this.settings=e,this.cellRange=t||null}isEmpty(){return null===this.cellRange}add(e){return this.isEmpty()?this.cellRange=this.settings.createCellRange(e):this.cellRange.expand(e),this}replace(e,t){if(!this.isEmpty()){if(this.cellRange.from.isEqual(e))return this.cellRange.from=t,!0;if(this.cellRange.to.isEqual(e))return this.cellRange.to=t,!0}return!1}clear(){return this.cellRange=null,this}getCorners(){const e=this.cellRange.getOuterTopStartCorner(),t=this.cellRange.getOuterBottomEndCorner();return[e.row,e.col,t.row,t.col]}destroy(){this.runLocalHooks("destroy")}}(0,s.mixin)(o,i.default);t.default=o},34117:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834);var s=n(r(85707)),i=r(62577),o=r(25499);t.default=class{constructor(e){(0,s.default)(this,"settings",{}),(0,s.default)(this,"defaults",Object.freeze(this.getDefaults())),(0,o.objectEach)(this.defaults,((t,r)=>{if(void 0!==e[r])this.settings[r]=e[r];else{if(void 0===t)throw new Error(`A required setting "${r}" was not provided`);this.settings[r]=t}}))}getDefaults(){return{facade:void 0,table:void 0,isDataViewInstance:!0,externalRowCalculator:!1,currentRowClassName:null,currentColumnClassName:null,preventOverflow:()=>!1,preventWheel:!1,data:void 0,fixedColumnsStart:0,fixedRowsTop:0,fixedRowsBottom:0,shouldRenderInlineStartOverlay:()=>this.getSetting("fixedColumnsStart")>0||this.getSetting("rowHeaders").length>0,shouldRenderTopOverlay:()=>this.getSetting("fixedRowsTop")>0||this.getSetting("columnHeaders").length>0,shouldRenderBottomOverlay:()=>this.getSetting("fixedRowsBottom")>0,minSpareRows:0,rowHeaders:()=>[],columnHeaders:()=>[],totalRows:void 0,totalColumns:void 0,cellRenderer:(e,t,r)=>{const n=this.getSetting("data",e,t);(0,i.fastInnerText)(r,null==n?"":n)},columnWidth(){},rowHeight(){},rowHeightByOverlayName(){},defaultColumnWidth:50,selections:null,hideBorderOnMouseDownOver:!1,viewportRowCalculatorOverride:null,viewportColumnCalculatorOverride:null,viewportRowRenderingThreshold:null,viewportColumnRenderingThreshold:null,onCellMouseDown:null,onCellContextMenu:null,onCellMouseOver:null,onCellMouseOut:null,onCellMouseUp:null,onCellDblClick:null,onCellCornerMouseDown:null,onCellCornerDblClick:null,beforeDraw:null,onDraw:null,onBeforeRemoveCellClassNames:null,onAfterDrawSelection:null,onBeforeDrawBorders:null,onBeforeViewportScrollHorizontally:e=>e,onBeforeViewportScrollVertically:e=>e,onScrollHorizontally:null,onScrollVertically:null,onBeforeTouchScroll:null,onAfterMomentumScroll:null,onModifyRowHeaderWidth:null,onModifyGetCellCoords:null,onModifyGetCoordsElement:null,onModifyGetCoords:null,onBeforeHighlightingRowHeader:e=>e,onBeforeHighlightingColumnHeader:e=>e,onWindowResize:null,onContainerElementResize:null,renderAllColumns:!1,renderAllRows:!1,groups:!1,rowHeaderWidth:null,columnHeaderHeight:null,headerClassName:null,rtlMode:!1,ariaTags:!0}}update(e,t){return void 0===t?(0,o.objectEach)(e,((e,t)=>{this.settings[t]=e})):this.settings[e]=t,this}getSetting(e,t,r,n,s){return"function"==typeof this.settings[e]?this.settings[e](t,r,n,s):void 0!==t&&Array.isArray(this.settings[e])?this.settings[e][t]:this.settings[e]}getSettingPure(e){return this.settings[e]}has(e){return!!this.settings[e]}}},7346:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834),r(15724),r(14846),r(69655);var s=n(r(85707)),i=r(62577),o=r(89804),a=n(r(62383)),l=n(r(82217)),h=r(36936),u=n(r(92020)),c=n(r(67920)),d=r(69397),p=r(71120);t.default=class{constructor(e,t,r,n,o){(0,s.default)(this,"wtSettings",null),(0,s.default)(this,"domBindings",void 0),(0,s.default)(this,"TBODY",null),(0,s.default)(this,"THEAD",null),(0,s.default)(this,"COLGROUP",null),(0,s.default)(this,"hasTableHeight",!0),(0,s.default)(this,"hasTableWidth",!0),(0,s.default)(this,"isTableVisible",!1),(0,s.default)(this,"tableOffset",0),(0,s.default)(this,"holderOffset",0),this.domBindings=r,this.isMaster="master"===o,this.name=o,this.dataAccessObject=e,this.facadeGetter=t,this.wtSettings=n,this.instance=this.dataAccessObject.wot,this.wot=this.dataAccessObject.wot,this.TABLE=r.rootTable,(0,i.removeTextNodes)(this.TABLE),this.spreader=this.createSpreader(this.TABLE),this.hider=this.createHider(this.spreader),this.holder=this.createHolder(this.hider),this.wtRootElement=this.holder.parentNode,this.isMaster&&this.alignOverlaysWithTrimmingContainer(),this.fixTableDomTree(),this.rowFilter=null,this.columnFilter=null,this.correctHeaderWidth=!1;const a=this.wtSettings.getSettingPure("rowHeaderWidth");this.wtSettings.update("rowHeaderWidth",(()=>this._modifyRowHeaderWidth(a))),this.rowUtils=new c.default(this.dataAccessObject,this.wtSettings),this.columnUtils=new u.default(this.dataAccessObject,this.wtSettings),this.tableRenderer=new h.Renderer({TABLE:this.TABLE,THEAD:this.THEAD,COLGROUP:this.COLGROUP,TBODY:this.TBODY,rowUtils:this.rowUtils,columnUtils:this.columnUtils,cellRenderer:this.wtSettings.getSettingPure("cellRenderer"),stylesHandler:this.dataAccessObject.stylesHandler})}is(e){return this.name===e}fixTableDomTree(){const e=this.domBindings.rootDocument;this.TBODY=this.TABLE.querySelector("tbody"),this.TBODY||(this.TBODY=e.createElement("tbody"),this.TABLE.appendChild(this.TBODY)),this.THEAD=this.TABLE.querySelector("thead"),this.THEAD||(this.THEAD=e.createElement("thead"),this.TABLE.insertBefore(this.THEAD,this.TBODY)),this.COLGROUP=this.TABLE.querySelector("colgroup"),this.COLGROUP||(this.COLGROUP=e.createElement("colgroup"),this.TABLE.insertBefore(this.COLGROUP,this.THEAD))}createSpreader(e){const t=e.parentNode;let r;return t&&t.nodeType===Node.ELEMENT_NODE&&(0,i.hasClass)(t,"wtHolder")||(r=this.domBindings.rootDocument.createElement("div"),r.className="wtSpreader",t&&t.insertBefore(r,e),r.appendChild(e)),r.style.position="relative",this.wtSettings.getSetting("ariaTags")&&(0,i.setAttribute)(r,[(0,p.A11Y_PRESENTATION)()]),r}createHider(e){const t=e.parentNode;let r;return t&&t.nodeType===Node.ELEMENT_NODE&&(0,i.hasClass)(t,"wtHolder")||(r=this.domBindings.rootDocument.createElement("div"),r.className="wtHider",t&&t.insertBefore(r,e),r.appendChild(e)),this.wtSettings.getSetting("ariaTags")&&(0,i.setAttribute)(r,[(0,p.A11Y_PRESENTATION)()]),r}createHolder(e){const t=e.parentNode;let r;return t&&t.nodeType===Node.ELEMENT_NODE&&(0,i.hasClass)(t,"wtHolder")||(r=this.domBindings.rootDocument.createElement("div"),r.style.position="relative",r.className="wtHolder",t&&t.insertBefore(r,e),this.isMaster&&(r.parentNode.className+="ht_master handsontable",r.parentNode.setAttribute("dir",this.wtSettings.getSettingPure("rtlMode")?"rtl":"ltr"),this.wtSettings.getSetting("ariaTags")&&(0,i.setAttribute)(r.parentNode,[(0,p.A11Y_PRESENTATION)()])),r.appendChild(e)),this.wtSettings.getSetting("ariaTags")&&(0,i.setAttribute)(r,[(0,p.A11Y_PRESENTATION)()]),r}draw(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const{wtSettings:t}=this,{wtOverlays:r,wtViewport:n}=this.dataAccessObject,s=t.getSetting("totalRows"),o=t.getSetting("totalColumns"),h=t.getSetting("rowHeaders"),u=h.length,c=t.getSetting("columnHeaders"),p=c.length;let g=e;if(this.isMaster&&(r.beforeDraw(),this.holderOffset=(0,i.offset)(this.holder),g=n.createCalculators(g),u&&!t.getSetting("fixedColumnsStart"))){const e=r.inlineStartOverlay.getScrollPosition(),t=this.correctHeaderWidth;this.correctHeaderWidth=0!==e,t!==this.correctHeaderWidth&&(g=!1)}if(g)this.isMaster&&r.refresh(!0);else{this.isMaster?this.tableOffset=(0,i.offset)(this.TABLE):this.tableOffset=this.dataAccessObject.parentTableOffset;const e=s>0?this.getFirstRenderedRow():0,t=o>0?this.getFirstRenderedColumn():0;this.rowFilter=new l.default(e,s,p),this.columnFilter=new a.default(t,o,u);let g=!0;if(this.isMaster){this.alignOverlaysWithTrimmingContainer();const e={};this.wtSettings.getSetting("beforeDraw",!0,e),g=!0!==e.skipRender}g&&(this.tableRenderer.setHeaderContentRenderers(h,c),(this.is(d.CLONE_BOTTOM)||this.is(d.CLONE_BOTTOM_INLINE_START_CORNER))&&this.tableRenderer.setHeaderContentRenderers(h,[]),this.resetOversizedRows(),this.tableRenderer.setActiveOverlayName(this.name).setViewportSize(this.getRenderedRowsCount(),this.getRenderedColumnsCount()).setFilters(this.rowFilter,this.columnFilter).render(),this.isMaster&&this.markOversizedColumnHeaders(),this.adjustColumnHeaderHeights(),(this.isMaster||this.is(d.CLONE_BOTTOM))&&this.markOversizedRows(),this.isMaster?(this.wtSettings.getSetting("externalRowCalculator")||n.createVisibleCalculators(),r.refresh(!1),r.applyToDOM(),this.wtSettings.getSetting("onDraw",!0)):this.is(d.CLONE_BOTTOM)&&this.dataAccessObject.cloneSource.wtOverlays.adjustElementsSize())}let f=!1;return this.isMaster&&(f=r.topOverlay.resetFixedPosition(),r.bottomOverlay.clone&&(f=r.bottomOverlay.resetFixedPosition()||f),f=r.inlineStartOverlay.resetFixedPosition()||f,r.topInlineStartCornerOverlay&&r.topInlineStartCornerOverlay.resetFixedPosition(),r.bottomInlineStartCornerOverlay&&r.bottomInlineStartCornerOverlay.clone&&r.bottomInlineStartCornerOverlay.resetFixedPosition()),f?(r.refreshAll(),r.adjustElementsSize()):this.dataAccessObject.selectionManager.setActiveOverlay(this.facadeGetter()).render(g),this.isMaster&&r.afterDraw(),this.dataAccessObject.drawn=!0,this}markIfOversizedColumnHeader(e){const t=this.columnFilter.renderedToSource(e);let r=this.wtSettings.getSetting("columnHeaders").length;const n=this.dataAccessObject.stylesHandler.getDefaultRowHeight();let s,o,a;const l=this.wtSettings.getSetting("columnHeaderHeight")||[];for(;r;)r-=1,s=this.getColumnHeaderHeight(r),o=this.getColumnHeader(t,r),o&&(a=(0,i.innerHeight)(o),(!s&&n=0)throw new Error("TR was expected to be rendered but is not");const i=s.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(r)];if(!i&&r>=0)throw new Error("TD or TH was expected to be rendered but is not");return i}getRow(e){let t=null,r=null;var n,s;e<0?(t=null===(n=this.rowFilter)||void 0===n?void 0:n.sourceRowToVisibleColHeadedRow(e),r=this.THEAD):(t=null===(s=this.rowFilter)||void 0===s?void 0:s.sourceToRendered(e),r=this.TBODY);return void 0!==t&&void 0!==r&&(!(r.childNodes.length1&&void 0!==arguments[1]?arguments[1]:0;const r=this.THEAD.childNodes[t];return null==r?void 0:r.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(e)]}getColumnHeaders(e){const t=[],r=this.columnFilter.sourceColumnToVisibleRowHeadedColumn(e);return this.THEAD.childNodes.forEach((e=>{const n=e.childNodes[r];n&&t.push(n)})),t}getRowHeader(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(t>=this.wtSettings.getSetting("rowHeaders").length)return;const r=this.rowFilter.sourceToRendered(e),n=r<0?this.rowFilter.sourceRowToVisibleColHeadedRow(e):r,s=(r<0?this.THEAD:this.TBODY).childNodes[n];return null==s?void 0:s.childNodes[t]}getRowHeaders(e){const t=[],r=this.wtSettings.getSetting("rowHeaders").length;for(let n=0;n=0)return!1;const t=this.wtSettings.getSetting("rowHeaders").length;return Math.abs(e)<=t}isRowHeaderRendered(e){if(e>=0)return!1;const t=this.wtSettings.getSetting("columnHeaders").length;return Math.abs(e)<=t}isRowBeforeRenderedRows(e){const t=this.getFirstRenderedRow();return e<0&&t<=0?!this.isRowHeaderRendered(e):ethis.getLastRenderedRow()}isColumnBeforeRenderedColumns(e){const t=this.getFirstRenderedColumn();return e<0&&t<=0?!this.isColumnHeaderRendered(e):ethis.getLastRenderedColumn()}isColumnAfterViewport(e){return this.columnFilter&&e>this.getLastVisibleColumn()}isRowAfterViewport(e){return this.rowFilter&&e>this.getLastVisibleRow()}isColumnBeforeViewport(e){return this.columnFilter&&this.columnFilter.sourceToRendered(e)<0&&e>=0}isLastRowFullyVisible(){return this.getLastVisibleRow()===this.getLastRenderedRow()}isLastColumnFullyVisible(){return this.getLastVisibleColumn()===this.getLastRenderedColumn()}allRowsInViewport(){return this.wtSettings.getSetting("totalRows")===this.getVisibleRowsCount()}allColumnsInViewport(){return this.wtSettings.getSetting("totalColumns")===this.getVisibleColumnsCount()}getRowHeight(e){return this.rowUtils.getHeight(e)}getColumnHeaderHeight(e){return this.columnUtils.getHeaderHeight(e)}getColumnWidth(e){return this.columnUtils.getWidth(e)}hasDefinedSize(){return this.hasTableHeight&&this.hasTableWidth}getWidth(){return(0,i.outerWidth)(this.TABLE)}getHeight(){return(0,i.outerHeight)(this.TABLE)}getTotalWidth(){const e=(0,i.outerWidth)(this.hider);return 0!==e?e:this.getWidth()}getTotalHeight(){const e=(0,i.outerHeight)(this.hider);return 0!==e?e:this.getHeight()}isVisible(){return(0,i.isVisible)(this.TABLE)}_modifyRowHeaderWidth(e){let t=(0,o.isFunction)(e)?e():null;return Array.isArray(t)?(t=[...t],t[t.length-1]=this._correctRowHeaderWidth(t[t.length-1])):t=this._correctRowHeaderWidth(t),t}_correctRowHeaderWidth(e){let t=e;return"number"!=typeof e&&(t=this.wtSettings.getSetting("defaultColumnWidth")),this.correctHeaderWidth&&(t+=1),t}}},55538:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0;var s=n(r(7346)),i=n(r(96514)),o=n(r(29220)),a=r(25499),l=r(69397);class h extends s.default{constructor(e,t,r,n){super(e,t,r,n,l.CLONE_BOTTOM)}}(0,a.mixin)(h,i.default),(0,a.mixin)(h,o.default);t.default=h},41618:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0;var s=n(r(7346)),i=n(r(96514)),o=n(r(11381)),a=r(25499),l=r(69397);class h extends s.default{constructor(e,t,r,n){super(e,t,r,n,l.CLONE_BOTTOM_INLINE_START_CORNER)}}(0,a.mixin)(h,i.default),(0,a.mixin)(h,o.default);t.default=h},80222:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0;var s=n(r(7346)),i=n(r(9898)),o=n(r(11381)),a=r(25499),l=r(69397);class h extends s.default{constructor(e,t,r,n){super(e,t,r,n,l.CLONE_INLINE_START)}}(0,a.mixin)(h,i.default),(0,a.mixin)(h,o.default);t.default=h},78951:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0;var s=r(62577),i=n(r(7346)),o=n(r(9898)),a=n(r(29220)),l=r(25499);class h extends i.default{constructor(e,t,r,n){super(e,t,r,n,"master")}alignOverlaysWithTrimmingContainer(){const e=(0,s.getTrimmingContainer)(this.wtRootElement),{rootWindow:t}=this.domBindings;if(e===t){this.wtSettings.getSetting("preventOverflow")||(this.holder.style.overflow="visible",this.wtRootElement.style.overflow="visible")}else{const r=e.parentElement,n=(0,s.getStyle)(e,"height",t),i=(0,s.getStyle)(e,"overflow",t),o=this.holder.style,{scrollWidth:a,scrollHeight:l}=e;let h=e.offsetWidth,u=e.offsetHeight;if(r&&["auto","hidden","scroll"].includes(i)){const n=e.cloneNode(!1);n.style.overflow="auto",n.style.position="absolute",e.nextElementSibling?r.insertBefore(n,e.nextElementSibling):r.appendChild(n);const s=parseInt(t.getComputedStyle(n).height,10);r.removeChild(n),0===s&&(u=0)}u=Math.min(u,l),o.height="auto"===n?"auto":`${u}px`,h=Math.min(h,a),o.width=`${h}px`,o.overflow="",this.hasTableHeight="auto"===o.height||u>0,this.hasTableWidth=h>0}this.isTableVisible=(0,s.isVisible)(this.TABLE)}markOversizedColumnHeaders(){const{wtSettings:e}=this,{wtViewport:t}=this.dataAccessObject,r="master",n=e.getSetting("columnHeaders").length;if(n&&!t.hasOversizedColumnHeadersMarked[r]){const s=e.getSetting("rowHeaders").length,i=this.getRenderedColumnsCount();for(let e=0;e{"use strict";t.__esModule=!0;var n=r(25499);const s={getFirstRenderedColumn(){const e=this.dataAccessObject.startColumnRendered;return null===e?-1:e},getFirstVisibleColumn(){const e=this.dataAccessObject.startColumnVisible;return null===e?-1:e},getFirstPartiallyVisibleColumn(){const e=this.dataAccessObject.startColumnPartiallyVisible;return null===e?-1:e},getLastRenderedColumn(){const e=this.dataAccessObject.endColumnRendered;return null===e?-1:e},getLastVisibleColumn(){const e=this.dataAccessObject.endColumnVisible;return null===e?-1:e},getLastPartiallyVisibleColumn(){const e=this.dataAccessObject.endColumnPartiallyVisible;return null===e?-1:e},getRenderedColumnsCount(){return this.dataAccessObject.countColumnsRendered},getVisibleColumnsCount(){return this.dataAccessObject.countColumnsVisible},getRowHeadersCount(){return this.dataAccessObject.rowHeaders.length}};(0,n.defineGetter)(s,"MIXIN_NAME","calculatedColumns",{writable:!1,enumerable:!1});t.default=s},9898:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(25499);const s={getFirstRenderedRow(){const e=this.dataAccessObject.startRowRendered;return null===e?-1:e},getFirstVisibleRow(){const e=this.dataAccessObject.startRowVisible;return null===e?-1:e},getFirstPartiallyVisibleRow(){const e=this.dataAccessObject.startRowPartiallyVisible;return null===e?-1:e},getLastRenderedRow(){const e=this.dataAccessObject.endRowRendered;return null===e?-1:e},getLastVisibleRow(){const e=this.dataAccessObject.endRowVisible;return null===e?-1:e},getLastPartiallyVisibleRow(){const e=this.dataAccessObject.endRowPartiallyVisible;return null===e?-1:e},getRenderedRowsCount(){return this.dataAccessObject.countRowsRendered},getVisibleRowsCount(){return this.dataAccessObject.countRowsVisible},getColumnHeadersCount(){return this.dataAccessObject.columnHeaders.length}};(0,n.defineGetter)(s,"MIXIN_NAME","calculatedRows",{writable:!1,enumerable:!1});t.default=s},11381:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(25499);const s={getFirstRenderedColumn(){return 0===this.wtSettings.getSetting("totalColumns")?-1:0},getFirstVisibleColumn(){return this.getFirstRenderedColumn()},getFirstPartiallyVisibleColumn(){return this.getFirstRenderedColumn()},getLastRenderedColumn(){return this.getRenderedColumnsCount()-1},getLastVisibleColumn(){return this.getLastRenderedColumn()},getLastPartiallyVisibleColumn(){return this.getLastRenderedColumn()},getRenderedColumnsCount(){const e=this.wtSettings.getSetting("totalColumns");return Math.min(this.wtSettings.getSetting("fixedColumnsStart"),e)},getVisibleColumnsCount(){return this.getRenderedColumnsCount()},getRowHeadersCount(){return this.dataAccessObject.rowHeaders.length}};(0,n.defineGetter)(s,"MIXIN_NAME","stickyColumnsStart",{writable:!1,enumerable:!1});t.default=s},96514:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(25499);const s={getFirstRenderedRow(){const e=this.wtSettings.getSetting("totalRows"),t=this.wtSettings.getSetting("fixedRowsBottom"),r=e-t;return 0===e||0===t?-1:r<0?0:r},getFirstVisibleRow(){return this.getFirstRenderedRow()},getFirstPartiallyVisibleRow(){return this.getFirstRenderedRow()},getLastRenderedRow(){return this.wtSettings.getSetting("totalRows")-1},getLastVisibleRow(){return this.getLastRenderedRow()},getLastPartiallyVisibleRow(){return this.getLastRenderedRow()},getRenderedRowsCount(){const e=this.wtSettings.getSetting("totalRows");return Math.min(this.wtSettings.getSetting("fixedRowsBottom"),e)},getVisibleRowsCount(){return this.getRenderedRowsCount()},getColumnHeadersCount:()=>0};(0,n.defineGetter)(s,"MIXIN_NAME","stickyRowsBottom",{writable:!1,enumerable:!1});t.default=s},26814:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(25499);const s={getFirstRenderedRow(){return 0===this.wtSettings.getSetting("totalRows")?-1:0},getFirstVisibleRow(){return this.getFirstRenderedRow()},getFirstPartiallyVisibleRow(){return this.getFirstRenderedRow()},getLastRenderedRow(){return this.getRenderedRowsCount()-1},getLastVisibleRow(){return this.getLastRenderedRow()},getLastPartiallyVisibleRow(){return this.getLastRenderedRow()},getRenderedRowsCount(){const e=this.wtSettings.getSetting("totalRows");return Math.min(this.wtSettings.getSetting("fixedRowsTop"),e)},getVisibleRowsCount(){return this.getRenderedRowsCount()},getColumnHeadersCount(){return this.dataAccessObject.columnHeaders.length}};(0,n.defineGetter)(s,"MIXIN_NAME","stickyRowsTop",{writable:!1,enumerable:!1});t.default=s},94318:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0;var s=n(r(7346)),i=n(r(26814)),o=n(r(29220)),a=r(25499),l=r(69397);class h extends s.default{constructor(e,t,r,n){super(e,t,r,n,l.CLONE_TOP)}}(0,a.mixin)(h,i.default),(0,a.mixin)(h,o.default);t.default=h},16318:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0;var s=n(r(7346)),i=n(r(26814)),o=n(r(11381)),a=r(25499),l=r(69397);class h extends s.default{constructor(e,t,r,n){super(e,t,r,n,l.CLONE_TOP_INLINE_START_CORNER)}}(0,a.mixin)(h,i.default),(0,a.mixin)(h,o.default);t.default=h},92020:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0;var s=n(r(85707));t.default=class{constructor(e,t){(0,s.default)(this,"dataAccessObject",void 0),(0,s.default)(this,"wtSettings",void 0),(0,s.default)(this,"headerWidths",new Map),this.dataAccessObject=e,this.wtSettings=t}getWidth(e){return this.wtSettings.getSetting("columnWidth",e)||this.wtSettings.getSetting("defaultColumnWidth")}getHeaderHeight(e){let t=this.dataAccessObject.stylesHandler.getDefaultRowHeight();const r=this.dataAccessObject.wtViewport.oversizedColumnHeaders[e];return void 0!==r&&(t=t?Math.max(t,r):r),t}getHeaderWidth(e){return this.headerWidths.get(this.dataAccessObject.wtTable.columnFilter.sourceToRendered(e))}calculateWidths(){const{wtSettings:e}=this;let t=e.getSetting("rowHeaderWidth");if(t=e.getSetting("onModifyRowHeaderWidth",t),null!=t){const r=e.getSetting("rowHeaders").length,n=e.getSetting("defaultColumnWidth");for(let e=0;e{"use strict";var n=r(96784);t.__esModule=!0;var s=n(r(85707));t.NodesPool=class{constructor(e){(0,s.default)(this,"nodeType",void 0),(0,s.default)(this,"pool",new Map),this.nodeType=e.toUpperCase()}setRootDocument(e){this.rootDocument=e}obtain(e,t){const r="number"==typeof t?`${e}x${t}`:e.toString();if(this.pool.has(r))return this.pool.get(r);const n=this.rootDocument.createElement(this.nodeType);return this.pool.set(r,n),n}}},30303:(e,t)=>{"use strict";t.__esModule=!0;t.WORKING_SPACE_ALL=0,t.WORKING_SPACE_TOP=1,t.WORKING_SPACE_BOTTOM=2},97646:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(44653);t.OrderView=n.OrderView;var s=r(7620);t.SharedOrderView=s.SharedOrderView},7620:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(44653);class s extends n.OrderView{prependView(e){return this.sizeSet.prepend(e.sizeSet),e.sizeSet.append(this.sizeSet),this}appendView(e){return this.sizeSet.append(e.sizeSet),e.sizeSet.prepend(this.sizeSet),this}}t.SharedOrderView=s},44653:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(15724);var s=n(r(85707)),i=r(70074),o=r(64230);t.OrderView=class{constructor(e,t){(0,s.default)(this,"rootNode",void 0),(0,s.default)(this,"nodesPool",void 0),(0,s.default)(this,"sizeSet",new i.ViewSizeSet),(0,s.default)(this,"collectedNodes",[]),(0,s.default)(this,"viewDiffer",new o.ViewDiffer(this.sizeSet)),(0,s.default)(this,"leads",[]),this.rootNode=e,this.nodesPool=t}setSize(e){return this.sizeSet.setSize(e),this}setOffset(e){return this.sizeSet.setOffset(e),this}isSharedViewSet(){return this.sizeSet.isShared()}getNode(e){return e0?this.collectedNodes[e-1]:null}applyCommand(e){const{rootNode:t}=this,[r,n,s,i]=e,o=this.nodesPool(n);switch(this.collectedNodes.push(o),r){case"prepend":t.insertBefore(o,t.firstChild);break;case"append":t.appendChild(o);break;case"insert_before":t.insertBefore(o,this.nodesPool(s)),t.removeChild(this.nodesPool(i));break;case"replace":t.replaceChild(o,this.nodesPool(s));break;case"remove":t.removeChild(o)}}start(){this.collectedNodes.length=0,this.leads=this.viewDiffer.diff()}render(){this.leads.length>0&&this.applyCommand(this.leads.shift())}end(){for(;this.leads.length>0;)this.applyCommand(this.leads.shift())}}},64230:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(15724);var s=n(r(85707)),i=r(30303),o=r(26349);t.ViewDiffer=class{constructor(e){(0,s.default)(this,"sizeSet",void 0),this.sizeSet=e}diff(){const{sizeSet:e}=this,{currentSize:t,nextSize:r}=e.getViewSize();let n=Math.max(r,t);if(0===n)return[];const{currentOffset:s,nextOffset:a}=e.getViewSize(),l=new o.ViewOrder(s,t),h=new o.ViewOrder(a,r),u=[];for(let t=0;ts)l.has(o)&&(l.remove(o),r<=l.length&&(n-=1)),u.push(["replace",o,s]);else if(o{"use strict";var n=r(96784);t.__esModule=!0,r(54999),r(94364);var s=n(r(85707));t.ViewOrder=class{constructor(e,t){(0,s.default)(this,"order",[]),this.order=[...Array(t).keys()].map((t=>e+t))}get length(){return this.order.length}has(e){return this.order.indexOf(e)>-1}get(e){return e{"use strict";var n=r(96784);t.__esModule=!0;var s=n(r(85707));t.ViewSize=class{constructor(){(0,s.default)(this,"currentSize",0),(0,s.default)(this,"nextSize",0),(0,s.default)(this,"currentOffset",0),(0,s.default)(this,"nextOffset",0)}setSize(e){this.currentSize=this.nextSize,this.nextSize=e}setOffset(e){this.currentOffset=this.nextOffset,this.nextOffset=e}}},70074:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0;var s=n(r(85707)),i=r(67744),o=r(30303);t.ViewSizeSet=class{constructor(){(0,s.default)(this,"size",new i.ViewSize),(0,s.default)(this,"workingSpace",o.WORKING_SPACE_ALL),(0,s.default)(this,"sharedSize",null)}setSize(e){this.size.setSize(e)}setOffset(e){this.size.setOffset(e)}getViewSize(){return this.size}isShared(){return null!==this.sharedSize}isPlaceOn(e){return this.workingSpace===e}append(e){this.workingSpace=o.WORKING_SPACE_TOP,e.workingSpace=o.WORKING_SPACE_BOTTOM,this.sharedSize=e.getViewSize()}prepend(e){this.workingSpace=o.WORKING_SPACE_BOTTOM,e.workingSpace=o.WORKING_SPACE_TOP,this.sharedSize=e.getViewSize()}}},67920:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0;var s=n(r(85707));t.default=class{constructor(e,t){(0,s.default)(this,"dataAccessObject",void 0),(0,s.default)(this,"wtSettings",void 0),this.dataAccessObject=e,this.wtSettings=t}getHeight(e){let t=this.wtSettings.getSetting("rowHeight",e);const r=this.dataAccessObject.wtViewport.oversizedRows[e];return void 0!==r&&(t=void 0===t?r:Math.max(t,r)),t}getHeightByOverlayName(e,t){let r=this.wtSettings.getSetting("rowHeightByOverlayName",e,t);const n=this.dataAccessObject.wtViewport.oversizedRows[e];return void 0!==n&&(r=void 0===r?n:Math.max(r,n)),r}}},52714:(e,t,r)=>{"use strict";t.__esModule=!0,r(67834),r(14846),r(69655);var n=r(62577),s=r(14859);function i(e,t,r){o(e,t),t.set(e,r)}function o(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function a(e,t){return e.get(h(e,t))}function l(e,t,r){return e.set(h(e,t),r),r}function h(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var u=new WeakMap,c=new WeakMap,d=new WeakMap,p=new WeakMap,g=new WeakMap,f=new WeakMap,m=new WeakMap,y=new WeakSet;function E(){const e=this.getCSSVariableValue("line-height"),t=this.getCSSVariableValue("cell-vertical-padding"),r=Math.ceil(parseFloat(this.getStyleForTD("border-bottom-width")));return null===e||null===t||isNaN(r)?null:e+2*t+r}function w(){(0,n.removeClass)(a(c,this),/ht-theme-.*/g),(0,n.addClass)(a(c,this),a(u,this))}function C(){this.isClassicTheme()||l(d,this,getComputedStyle(a(c,this)));const e=h(y,this,v).call(this,["box-sizing","border-bottom-width"]);a(m,this).td={...a(m,this).td,"box-sizing":e["box-sizing"],"border-bottom-width":e["border-bottom-width"]}}function v(e){const t=a(p,this),r=a(c,this),n=t.createElement("table"),s=t.createElement("tbody"),i=t.createElement("tr"),o=t.createElement("tr"),l=t.createElement("td");o.appendChild(l),s.appendChild(i),s.appendChild(o),n.appendChild(s),r.appendChild(n);const h=getComputedStyle(l),u={};return e.forEach((e=>{u[e]=h.getPropertyValue(e)})),r.removeChild(n),u}function R(e){const t=Math.ceil(parseFloat(h(y,this,S).call(this,e)));return Number.isNaN(t)?null:t}function S(e){const t=a(d,this).getPropertyValue(e);return""===t?null:t}function T(){l(m,this,{}),l(f,this,{}),l(g,this,!0)}t.StylesHandler=class{constructor(e){var t,r;o(t=this,r=y),r.add(t),i(this,u,void 0),i(this,c,void 0),i(this,d,void 0),i(this,p,void 0),i(this,g,!0),i(this,f,{}),i(this,m,{}),l(c,this,e.rootTable.parentElement.parentElement),l(p,this,e.rootDocument)}isClassicTheme(){return a(g,this)}getCSSVariableValue(e){var t;if(a(g,this))return null;if(a(f,this)[`--ht-${e}`])return a(f,this)[`--ht-${e}`];const r=null!==(t=h(y,this,R).call(this,`--ht-${e}`))&&void 0!==t?t:h(y,this,S).call(this,`--ht-${e}`);return null!==r?(a(f,this)[`--ht-${e}`]=r,r):void 0}getStyleForTD(e){var t;return null===(t=a(m,this))||void 0===t?void 0:t.td[e]}getDefaultRowHeight(){if(a(g,this))return 23;const e=h(y,this,E).call(this);return!e&&(0,n.hasClass)(a(c,this),"ht-wrapper")?((0,s.warn)(`The "${a(u,this)}" theme is enabled, but its stylesheets are missing or not imported correctly. Import the correct CSS files in order to use that theme.`),l(g,this,!0),this.useTheme(),23):e}areCellsBorderBox(){return"border-box"===this.getStyleForTD("box-sizing")}useTheme(e){if(!e)return h(y,this,C).call(this),l(g,this,!0),void l(u,this,e||void 0);e&&e!==a(u,this)&&(a(u,this)&&h(y,this,T).call(this),l(u,this,e),l(g,this,!1),h(y,this,w).call(this),h(y,this,C).call(this))}getThemeName(){return a(u,this)}removeClassNames(){(0,n.hasClass)(a(c,this),a(u,this))&&(0,n.removeClass)(a(c,this),a(u,this))}}},16598:(e,t,r)=>{"use strict";t.__esModule=!0,r(94364);var n=r(62577),s=r(25499),i=r(63059);t.default=class{constructor(e,t,r,n,s){this.dataAccessObject=e,this.wot=e.wot,this.instance=this.wot,this.domBindings=t,this.wtSettings=r,this.wtTable=s,this.oversizedRows=[],this.oversizedColumnHeaders=[],this.hasOversizedColumnHeadersMarked={},this.clientHeight=0,this.rowHeaderWidth=NaN,this.rowsVisibleCalculator=null,this.columnsVisibleCalculator=null,this.rowsCalculatorTypes=new Map([["rendered",()=>this.wtSettings.getSetting("renderAllRows")?new i.RenderedAllRowsCalculationType:new i.RenderedRowsCalculationType],["fullyVisible",()=>new i.FullyVisibleRowsCalculationType],["partiallyVisible",()=>new i.PartiallyVisibleRowsCalculationType]]),this.columnsCalculatorTypes=new Map([["rendered",()=>this.wtSettings.getSetting("renderAllColumns")?new i.RenderedAllColumnsCalculationType:new i.RenderedColumnsCalculationType],["fullyVisible",()=>new i.FullyVisibleColumnsCalculationType],["partiallyVisible",()=>new i.PartiallyVisibleColumnsCalculationType]]),this.eventManager=n,this.eventManager.addEventListener(this.domBindings.rootWindow,"resize",(()=>{this.clientHeight=this.getWorkspaceHeight()}))}getWorkspaceHeight(){const e=this.domBindings.rootDocument,t=this.dataAccessObject.topOverlayTrimmingContainer;let r=0;if(t===this.domBindings.rootWindow)r=e.documentElement.clientHeight;else{r=(0,n.outerHeight)(t)>0&&t.clientHeight>0?t.clientHeight:1/0}return r}getViewportHeight(){let e=this.getWorkspaceHeight();if(e===1/0)return e;const t=this.getColumnHeaderHeight();return t>0&&(e-=t),e}getWorkspaceWidth(){const{rootDocument:e,rootWindow:t}=this.domBindings,r=this.dataAccessObject.inlineStartOverlayTrimmingContainer;let n;if(r===t){const t=this.wtSettings.getSetting("totalColumns");n=this.wtTable.holder.offsetWidth,this.getRowHeaderWidth()+this.sumColumnWidths(0,t)>n&&(n=e.documentElement.clientWidth)}else n=r.clientWidth;return n}getViewportWidth(){const e=this.getWorkspaceWidth();if(e===1/0)return e;const t=this.getRowHeaderWidth();return t>0?e-t:e}hasVerticalScroll(){return this.wtTable.hider.offsetHeight>this.getWorkspaceHeight()}hasHorizontalScroll(){return this.wtTable.hider.offsetWidth>this.getWorkspaceWidth()}isVerticallyScrollableByWindow(){return this.dataAccessObject.topOverlayTrimmingContainer===this.domBindings.rootWindow}isHorizontallyScrollableByWindow(){return this.dataAccessObject.inlineStartOverlayTrimmingContainer===this.domBindings.rootWindow}sumColumnWidths(e,t){let r=0,n=e;for(;n0&&void 0!==arguments[0]?arguments[0]:["rendered","fullyVisible","partiallyVisible"];const{wtSettings:t,wtTable:r}=this;let s,o,a=this.getViewportHeight();this.rowHeaderWidth=NaN;let l=this.dataAccessObject.topScrollPosition-this.dataAccessObject.topParentOffset;const h=t.getSetting("fixedRowsTop"),u=t.getSetting("fixedRowsBottom"),c=t.getSetting("totalRows");return h&&l>=0&&(o=this.dataAccessObject.topOverlay.sumCellSizes(0,h),l+=o,a-=o),u&&this.dataAccessObject.bottomOverlay.clone&&(o=this.dataAccessObject.bottomOverlay.sumCellSizes(c-u,c),a-=o),s=r.holder.clientHeight===r.holder.offsetHeight?0:(0,n.getScrollbarWidth)(this.domBindings.rootDocument),new i.ViewportRowsCalculator({calculationTypes:e.map((e=>[e,this.rowsCalculatorTypes.get(e)()])),viewportHeight:a,scrollOffset:l,totalRows:t.getSetting("totalRows"),defaultRowHeight:this.instance.stylesHandler.getDefaultRowHeight(),rowHeightFn:e=>r.getRowHeight(e),overrideFn:t.getSettingPure("viewportRowCalculatorOverride"),horizontalScrollbarHeight:s})}createColumnsCalculator(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["rendered","fullyVisible","partiallyVisible"];const{wtSettings:t,wtTable:r}=this;let s=this.getViewportWidth(),o=Math.abs(this.dataAccessObject.inlineStartScrollPosition)-this.dataAccessObject.inlineStartParentOffset;this.columnHeaderHeight=NaN;const a=t.getSetting("fixedColumnsStart");if(a&&o>=0){const e=this.dataAccessObject.inlineStartOverlay.sumCellSizes(0,a);o+=e,s-=e}return r.holder.clientWidth!==r.holder.offsetWidth&&(s-=(0,n.getScrollbarWidth)(this.domBindings.rootDocument)),new i.ViewportColumnsCalculator({calculationTypes:e.map((e=>[e,this.columnsCalculatorTypes.get(e)()])),viewportWidth:s,scrollOffset:o,totalColumns:t.getSetting("totalColumns"),columnWidthFn:e=>r.getColumnWidth(e),overrideFn:t.getSettingPure("viewportColumnCalculatorOverride"),inlineStartOffset:this.dataAccessObject.inlineStartParentOffset})}createCalculators(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const{wtSettings:t}=this,r=this.createRowsCalculator(),n=this.createColumnsCalculator();if(e&&!t.getSetting("renderAllRows")){const t=r.getResultsFor("fullyVisible");e=this.areAllProposedVisibleRowsAlreadyRendered(t)}if(e&&!t.getSetting("renderAllColumns")){const t=n.getResultsFor("fullyVisible");e=this.areAllProposedVisibleColumnsAlreadyRendered(t)}return e||(this.rowsRenderCalculator=r.getResultsFor("rendered"),this.columnsRenderCalculator=n.getResultsFor("rendered")),this.rowsVisibleCalculator=r.getResultsFor("fullyVisible"),this.columnsVisibleCalculator=n.getResultsFor("fullyVisible"),this.rowsPartiallyVisibleCalculator=r.getResultsFor("partiallyVisible"),this.columnsPartiallyVisibleCalculator=n.getResultsFor("partiallyVisible"),e}createVisibleCalculators(){const e=this.createRowsCalculator(["fullyVisible","partiallyVisible"]),t=this.createColumnsCalculator(["fullyVisible","partiallyVisible"]);this.rowsVisibleCalculator=e.getResultsFor("fullyVisible"),this.columnsVisibleCalculator=t.getResultsFor("fullyVisible"),this.rowsPartiallyVisibleCalculator=e.getResultsFor("partiallyVisible"),this.columnsPartiallyVisibleCalculator=t.getResultsFor("partiallyVisible")}areAllProposedVisibleRowsAlreadyRendered(e){if(!this.rowsVisibleCalculator)return!1;let{startRow:t,endRow:r}=e;if(null===t&&null===r){if(!e.isVisibleInTrimmingContainer)return!0;t=this.rowsPartiallyVisibleCalculator.startRow,r=this.rowsPartiallyVisibleCalculator.endRow}const{startRow:n,endRow:s,rowStartOffset:i,rowEndOffset:o}=this.rowsRenderCalculator,a=this.wtSettings.getSetting("totalRows")-1,l=this.wtSettings.getSetting("viewportRowRenderingThreshold");return Number.isInteger(l)&&l>0?(t=Math.max(0,t-Math.min(i,l)),r=Math.min(a,r+Math.min(o,l))):"auto"===l&&(t=Math.max(0,t-Math.ceil(i/2)),r=Math.min(a,r+Math.ceil(o/2))),!(t0)&&!(r>s||r===s&&r0?(t=Math.max(0,t-Math.min(i,l)),r=Math.min(a,r+Math.min(o,l))):"auto"===l&&(t=Math.max(0,t-Math.ceil(i/2)),r=Math.min(a,r+Math.ceil(o/2))),!(t0)&&!(r>s||r===s&&r{r[t]=void 0}))}}},87935:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(88088);var s=n(r(83497)),i=r(45435),o=r(6521),a=r(28197),l=r(58570),h=r(1791),u=r(10912),c=r(74854),d=r(50206);function p(e,t){const r=new s.default(e,t||{},i.rootInstanceSymbol);return r.init(),r}t.CellCoords=d.CellCoords,t.CellRange=d.CellRange,(0,h.registerCellType)(u.TextCellType),p.editors={BaseEditor:c.BaseEditor},p.Core=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new s.default(e,t,i.rootInstanceSymbol)},p.DefaultSettings=(0,o.metaSchemaFactory)(),p.hooks=a.Hooks.getSingleton(),p.CellCoords=d.CellCoords,p.CellRange=d.CellRange,p.packageName="handsontable",p.buildDate="19/02/2025 10:01:18",p.version="15.1.0",p.languages={dictionaryKeys:l.dictionaryKeys,getLanguageDictionary:l.getLanguageDictionary,getLanguagesDictionaries:l.getLanguagesDictionaries,registerLanguageDictionary:l.registerLanguageDictionary,getTranslatedPhrase:l.getTranslatedPhrase};t.default=p},76527:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(10463),s=r(36759),i=r(25799);const o=t.CELL_TYPE="autocomplete";t.AutocompleteCellType={CELL_TYPE:o,editor:n.AutocompleteEditor,renderer:s.autocompleteRenderer,validator:i.autocompleteValidator}},33023:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(76527);t.AutocompleteCellType=n.AutocompleteCellType,t.CELL_TYPE=n.CELL_TYPE},65829:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(12302),s=r(86510);const i=t.CELL_TYPE="checkbox";t.CheckboxCellType={CELL_TYPE:i,editor:n.CheckboxEditor,renderer:s.checkboxRenderer}},40834:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(65829);t.CELL_TYPE=n.CELL_TYPE,t.CheckboxCellType=n.CheckboxCellType},34135:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(16339),s=r(72375),i=r(5535);const o=t.CELL_TYPE="date";t.DateCellType={CELL_TYPE:o,editor:n.DateEditor,renderer:s.dateRenderer,validator:i.dateValidator}},41031:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(34135);t.CELL_TYPE=n.CELL_TYPE,t.DateCellType=n.DateCellType},62277:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(51034),s=r(24682),i=r(96);const o=t.CELL_TYPE="dropdown";t.DropdownCellType={CELL_TYPE:o,editor:n.DropdownEditor,renderer:s.dropdownRenderer,validator:i.dropdownValidator,filter:!1,strict:!0}},96306:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(62277);t.CELL_TYPE=n.CELL_TYPE,t.DropdownCellType=n.DropdownCellType},74845:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(82518),s=r(32278);const i=t.CELL_TYPE="handsontable";t.HandsontableCellType={CELL_TYPE:i,editor:n.HandsontableEditor,renderer:s.handsontableRenderer}},96618:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(74845);t.CELL_TYPE=n.CELL_TYPE,t.HandsontableCellType=n.HandsontableCellType},14758:(e,t,r)=>{"use strict";t.__esModule=!0,t.registerAllCellTypes=function(){(0,p.registerCellType)(n.AutocompleteCellType),(0,p.registerCellType)(s.CheckboxCellType),(0,p.registerCellType)(i.DateCellType),(0,p.registerCellType)(o.DropdownCellType),(0,p.registerCellType)(a.HandsontableCellType),(0,p.registerCellType)(l.NumericCellType),(0,p.registerCellType)(h.PasswordCellType),(0,p.registerCellType)(u.SelectCellType),(0,p.registerCellType)(c.TextCellType),(0,p.registerCellType)(d.TimeCellType)};var n=r(33023);t.AutocompleteCellType=n.AutocompleteCellType,t.AUTOCOMPLETE_TYPE=n.CELL_TYPE;var s=r(40834);t.CheckboxCellType=s.CheckboxCellType,t.CHECKBOX_TYPE=s.CELL_TYPE;var i=r(41031);t.DateCellType=i.DateCellType,t.DATE_TYPE=i.CELL_TYPE;var o=r(96306);t.DropdownCellType=o.DropdownCellType,t.DROPDOWN_TYPE=o.CELL_TYPE;var a=r(96618);t.HandsontableCellType=a.HandsontableCellType,t.HANDSONTABLE_TYPE=a.CELL_TYPE;var l=r(15718);t.NumericCellType=l.NumericCellType,t.NUMERIC_TYPE=l.CELL_TYPE;var h=r(20210);t.PasswordCellType=h.PasswordCellType,t.PASSWORD_TYPE=h.CELL_TYPE;var u=r(22315);t.SelectCellType=u.SelectCellType,t.SELECT_TYPE=u.CELL_TYPE;var c=r(10912);t.TextCellType=c.TextCellType,t.TEXT_TYPE=c.CELL_TYPE;var d=r(92858);t.TimeCellType=d.TimeCellType,t.TIME_TYPE=d.CELL_TYPE;var p=r(1791);t.registerCellType=p.registerCellType,t.getCellType=p.getCellType,t.getRegisteredCellTypeNames=p.getRegisteredCellTypeNames,t.getRegisteredCellTypes=p.getRegisteredCellTypes,t.hasCellType=p.hasCellType},15718:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(3421);t.CELL_TYPE=n.CELL_TYPE,t.NumericCellType=n.NumericCellType},3421:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(82304),s=r(17756),i=r(48636);const o=t.CELL_TYPE="numeric";t.NumericCellType={CELL_TYPE:o,editor:n.NumericEditor,renderer:s.numericRenderer,validator:i.numericValidator,dataType:"number"}},20210:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(24157);t.CELL_TYPE=n.CELL_TYPE,t.PasswordCellType=n.PasswordCellType},24157:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(14150),s=r(64910);const i=t.CELL_TYPE="password";t.PasswordCellType={CELL_TYPE:i,editor:n.PasswordEditor,renderer:s.passwordRenderer,copyable:!1}},1791:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,t.getCellType=function(e){if(!u(e))throw Error(`You declared cell type "${e}" as a string that is not mapped to a known object.\n Cell type must be an object or a string mapped to an object registered by\n "Handsontable.cellTypes.registerCellType" method`);return h(e)},t.registerCellType=function(e,t){"string"!=typeof e&&(e=(t=e).CELL_TYPE);const{editor:r,renderer:n,validator:s}=t;r&&(0,i.registerEditor)(e,r);n&&(0,o.registerRenderer)(e,n);s&&(0,a.registerValidator)(e,s);l(e,t)},r(67834);var s=n(r(28651)),i=r(8266),o=r(54852),a=r(17027);const{register:l,getItem:h,hasItem:u,getNames:c,getValues:d}=(0,s.default)("cellTypes");t.getRegisteredCellTypes=d,t.getRegisteredCellTypeNames=c,t.hasCellType=u},22315:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(19908);t.CELL_TYPE=n.CELL_TYPE,t.SelectCellType=n.SelectCellType},19908:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(63303),s=r(15651);const i=t.CELL_TYPE="select";t.SelectCellType={CELL_TYPE:i,editor:n.SelectEditor,renderer:s.selectRenderer}},10912:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(57489);t.CELL_TYPE=n.CELL_TYPE,t.TextCellType=n.TextCellType},57489:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(66420),s=r(85096);const i=t.CELL_TYPE="text";t.TextCellType={CELL_TYPE:i,editor:n.TextEditor,renderer:s.textRenderer}},92858:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(99421);t.CELL_TYPE=n.CELL_TYPE,t.TimeCellType=n.TimeCellType},99421:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(35442),s=r(70350),i=r(68864);const o=t.CELL_TYPE="time";t.TimeCellType={CELL_TYPE:o,editor:n.TimeEditor,renderer:s.timeRenderer,validator:i.timeValidator}},83497:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,t.default=function(e,t){var r,n=this;let F=arguments.length>2&&void 0!==arguments[2]&&arguments[2],U=this;const V=new h.default(U);let B,W,Y,G,j,z,$=!0;(0,T.hasValidParameter)(F)&&(0,T.registerAsRootInstance)(this);this.rootElement=e,this.rootDocument=e.ownerDocument,this.rootWindow=this.rootDocument.defaultView,this.isDestroyed=!1,this.renderSuspendedCounter=0,this.executionSuspendedCounter=0;const K=null!==(r=null==t?void 0:t.layoutDirection)&&void 0!==r?r:"inherit",X=["rtl","ltr"].includes(K)?K:this.rootWindow.getComputedStyle(this.rootElement).direction;this.rootElement.setAttribute("dir",X),this.isRtl=function(){return"rtl"===X},this.isLtr=function(){return!U.isRtl()},this.getDirectionFactor=function(){return U.isLtr()?1:-1},t.language=(0,_.getValidLanguageCode)(t.language);const q=new A.MetaManager(U,t,[A.DynamicCellMetaMod,A.ExtendMetaPropertiesMod]),Q=q.getTableMeta(),Z=q.getGlobalMeta(),J=(0,x.createUniqueMap)();this.container=this.rootDocument.createElement("div"),this.renderCall=!1,e.insertBefore(this.container,e.firstChild),(0,T.isRootInstance)(this)&&((0,o._injectProductInfo)(t.licenseKey,e),(0,s.addClass)(e,"ht-wrapper"));this.guid=`ht_${(0,E.randomString)()}`,H.set(this.guid,this),this.columnIndexMapper=new S.IndexMapper,this.rowIndexMapper=new S.IndexMapper,this.columnIndexMapper.addLocalHook("indexesSequenceChange",(e=>{U.runHooks("afterColumnSequenceChange",e)})),this.rowIndexMapper.addLocalHook("indexesSequenceChange",(e=>{U.runHooks("afterRowSequenceChange",e)})),W=new v.default(U),this.rootElement.id&&"ht_"!==this.rootElement.id.substring(0,3)||(this.rootElement.id=this.guid);let ee=new O.Selection(Q,{rowIndexMapper:U.rowIndexMapper,columnIndexMapper:U.columnIndexMapper,countCols:()=>U.countCols(),countRows:()=>U.countRows(),propToCol:e=>B.propToCol(e),isEditorOpened:()=>!!U.getActiveEditor()&&U.getActiveEditor().isOpened(),countRenderableColumns:()=>this.view.countRenderableColumns(),countRenderableRows:()=>this.view.countRenderableRows(),countRowHeaders:()=>this.countRowHeaders(),countColHeaders:()=>this.countColHeaders(),countRenderableRowsInRange:function(){return n.view.countRenderableRowsInRange(...arguments)},countRenderableColumnsInRange:function(){return n.view.countRenderableColumnsInRange(...arguments)},getShortcutManager:()=>U.getShortcutManager(),createCellCoords:(e,t)=>U._createCellCoords(e,t),createCellRange:(e,t,r)=>U._createCellRange(e,t,r),visualToRenderableCoords:e=>{const{row:t,col:r}=e;return U._createCellCoords(t>=0?U.rowIndexMapper.getRenderableFromVisualIndex(t):t,r>=0?U.columnIndexMapper.getRenderableFromVisualIndex(r):r)},renderableToVisualCoords:e=>{const{row:t,col:r}=e;return U._createCellCoords(t>=0?U.rowIndexMapper.getVisualFromRenderableIndex(t):t,r>=0?U.columnIndexMapper.getVisualFromRenderableIndex(r):r)},findFirstNonHiddenRenderableRow:(e,t)=>{const r=t>e?1:-1,n=Math.min(e,t),s=Math.max(e,t),i=U.rowIndexMapper.getNearestNotHiddenIndex(e,r);return null===i||1===r&&i>s||-1===r&&i=0?U.rowIndexMapper.getRenderableFromVisualIndex(i):i},findFirstNonHiddenRenderableColumn:(e,t)=>{const r=t>e?1:-1,n=Math.min(e,t),s=Math.max(e,t),i=U.columnIndexMapper.getNearestNotHiddenIndex(e,r);return null===i||1===r&&i>s||-1===r&&i=0?U.columnIndexMapper.getRenderableFromVisualIndex(i):i},isDisabledCellSelection:(e,t)=>e<0||t<0?U.getSettings().disableVisualSelection:U.getCellMeta(e,t).disableVisualSelection});this.selection=ee;const te=e=>{let{hiddenIndexesChanged:t}=e;t&&this.selection.commit()};function re(e){const t=(0,b.normalizeLanguageCode)(e);(0,_.hasLanguageDictionary)(t)?(U.runHooks("beforeLanguageChange",t),Z.language=t,U.runHooks("afterLanguageChange",t)):(0,b.warnUserAboutLanguageRegistration)(e)}function ne(e,t){const r="className"===e?U.rootElement:U.table;if($)(0,s.addClass)(r,t);else{let n=[],i=[];Z[e]&&(n=Array.isArray(Z[e])?Z[e]:(0,d.stringToArray)(Z[e])),t&&(i=Array.isArray(t)?t:(0,d.stringToArray)(t));const o=(0,d.getDifferenceOfArrays)(n,i),a=(0,d.getDifferenceOfArrays)(i,n);o.length&&(0,s.removeClass)(r,o),a.length&&(0,s.addClass)(r,a)}Z[e]=t}function se(){let e=!1;return{validatorsInQueue:0,valid:!0,addValidatorToQueue(){this.validatorsInQueue+=1,e=!1},removeValidatorFormQueue(){this.validatorsInQueue=this.validatorsInQueue-1<0?0:this.validatorsInQueue-1,this.checkIfQueueIsEmpty()},onQueueEmpty(){},checkIfQueueIsEmpty(){0===this.validatorsInQueue&&!1===e&&(e=!0,this.onQueueEmpty(this.valid))}}}function ie(e){const t=e.replace(",",".");return!1===isNaN(parseFloat(t))?parseFloat(t):e}function oe(e,t,r){if(!e.length)return void r();const n=U.getActiveEditor(),s=new se;let i=!0;s.onQueueEmpty=()=>{n&&i&&n.cancelChanges(),r()};for(let r=e.length-1;r>=0;r--){const[n,o]=e[r],a=B.propToCol(o);let l;l=Number.isInteger(a)?U.getCellMeta(n,a):{...Object.getPrototypeOf(Q),...Q},U.getCellValidator(l)&&(s.addValidatorToQueue(),U.validateCell(e[r][3],l,function(t,r){return function(n){if("boolean"!=typeof n)throw new Error("Validation error: result is not boolean");!1===n&&!1===r.allowInvalid&&(i=!1,e.splice(t,1),r.valid=!0),s.removeValidatorFormQueue()}}(r,l),t))}s.checkIfQueueIsEmpty()}function ae(e,t){for(let t=e.length-1;t>=0;t--){let r=!1;if(null!==e[t]){if(null!==e[t][2]&&void 0!==e[t][2]||null!==e[t][3]&&void 0!==e[t][3]){if(Q.allowInsertRow)for(;e[t][0]>U.countRows()-1;){const{delta:e}=B.createRow(void 0,void 0,{source:"auto"});if(0===e){r=!0;break}}if("array"===U.dataType&&(!Q.columns||0===Q.columns.length)&&Q.allowInsertColumn)for(;B.propToCol(e[t][1])>U.countCols()-1;){const{delta:e}=B.createCol(void 0,void 0,{source:"auto"});if(0===e){r=!0;break}}r||B.set(e[t][0],e[t][1],e[t][3])}}else e.splice(t,1)}const r=e.length>0;if(U.forceFullRender=!0,r){Y.adjustRowsAndCols(),U.runHooks("beforeChangeRender",e,t),G.closeEditor(),U.view.render(),G.prepareEditor(),U.view.adjustElementsSize(),U.runHooks("afterChange",e,t||"edit");const r=U.getActiveEditor();r&&(0,o.isDefined)(r.refreshValue)&&r.refreshValue()}else U.view.render()}function le(e,t,r){return Array.isArray(e)?e:[[e,t,r]]}function he(e,t){const r=U.runHooks("beforeChange",e,t||"edit"),n=e.filter((e=>null!==e));var s;if(!1===r||0===n.length)return null===(s=U.getActiveEditor())||void 0===s||s.cancelChanges(),[];for(let e=n.length-1;e>=0;e--){const[t,r,,s]=n[e],i=B.propToCol(r);let o;o=Number.isInteger(i)?U.getCellMeta(t,i):{...Object.getPrototypeOf(Q),...Q},"numeric"===o.type&&"string"==typeof s&&(0,w.isNumericLike)(s)&&(n[e][3]=ie(s))}return n}this.columnIndexMapper.addLocalHook("cacheUpdated",te),this.rowIndexMapper.addLocalHook("cacheUpdated",te),this.selection.addLocalHook("afterSetRangeEnd",((e,t)=>{const r=(0,u.createObjectPropListener)(!1),n=this.selection.getSelectedRange(),{from:i,to:o}=n.current(),a=n.size()-1;this.runHooks("afterSelection",i.row,i.col,o.row,o.col,r,a),this.runHooks("afterSelectionByProp",i.row,U.colToProp(i.col),o.row,U.colToProp(o.col),r,a),t&&(!r.isTouched()||r.isTouched()&&!r.value)&&z.scrollTo(e);const l=ee.isSelectedByRowHeader(),h=ee.isSelectedByColumnHeader();l&&h?(0,s.addClass)(this.rootElement,["ht__selection--rows","ht__selection--columns"]):l?((0,s.removeClass)(this.rootElement,"ht__selection--columns"),(0,s.addClass)(this.rootElement,"ht__selection--rows")):h?((0,s.removeClass)(this.rootElement,"ht__selection--rows"),(0,s.addClass)(this.rootElement,"ht__selection--columns")):(0,s.removeClass)(this.rootElement,["ht__selection--rows","ht__selection--columns"]),"shift"!==ee.getSelectionSource()&&G.closeEditor(null),U.view.render(),G.prepareEditor()})),this.selection.addLocalHook("beforeSetFocus",(e=>{this.runHooks("beforeSelectionFocusSet",e.row,e.col)})),this.selection.addLocalHook("afterSetFocus",(e=>{const t=(0,u.createObjectPropListener)(!1);this.runHooks("afterSelectionFocusSet",e.row,e.col,t),(!t.isTouched()||t.isTouched()&&!t.value)&&z.scrollTo(e),G.closeEditor(),U.view.render(),G.prepareEditor()})),this.selection.addLocalHook("afterSelectionFinished",(e=>{const t=e.length-1,{from:r,to:n}=e[t];this.runHooks("afterSelectionEnd",r.row,r.col,n.row,n.col,t),this.runHooks("afterSelectionEndByProp",r.row,U.colToProp(r.col),n.row,U.colToProp(n.col),t)})),this.selection.addLocalHook("afterIsMultipleSelection",(e=>{const t=this.runHooks("afterIsMultipleSelection",e.value);e.value&&(e.value=t)})),this.selection.addLocalHook("afterDeselect",(()=>{G.closeEditor(),U.view.render(),(0,s.removeClass)(this.rootElement,["ht__selection--rows","ht__selection--columns"]),this.runHooks("afterDeselect")})),this.selection.addLocalHook("beforeHighlightSet",(()=>this.runHooks("beforeSelectionHighlightSet"))).addLocalHook("beforeSetRangeStart",(function(){for(var e=arguments.length,t=new Array(e),r=0;rthis.alter("insert_row_above",e,1,"auto"))).addLocalHook("insertColRequire",(e=>this.alter("insert_col_start",e,1,"auto"))),Y={alter(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=arguments.length>3?arguments[3]:void 0,s=arguments.length>4?arguments[4]:void 0;const i=e=>{if(0===e.length)return[];const t=[...e];t.sort(((e,t)=>{let[r]=e,[n]=t;return r===n?0:r>n?1:-1}));return(0,d.arrayReduce)(t,((e,t)=>{let[r,n]=t;const s=e[e.length-1],[i,o]=s,a=i+o;if(r<=a){const e=Math.max(n-(a-r),0);s[1]+=e}else e.push([r,n]);return e}),[t[0]])};switch(e){case"insert_row_below":case"insert_row_above":const s=U.countSourceRows();if(Q.maxRows===s)return;const a="insert_row_below"===e?"below":"above";t=null!=t?t:"below"===a?s:0;const{delta:l,startPhysicalIndex:h}=B.createRow(t,r,{source:n,mode:a});ee.shiftRows(U.toVisualRow(h),l);break;case"insert_col_start":case"insert_col_end":const u="insert_col_end"===e?"end":"start";t=null!=t?t:"end"===u?U.countSourceCols():0;const{delta:c,startPhysicalIndex:p}=B.createCol(t,r,{source:n,mode:u});if(c){if(Array.isArray(Q.colHeaders)){const e=[U.toVisualColumn(p),0];e.length+=c,Array.prototype.splice.apply(Q.colHeaders,e)}ee.shiftColumns(U.toVisualColumn(p),c)}break;case"remove_row":const g=e=>{let t=0;(0,d.arrayEach)(e,(e=>{let[r,s]=e;const i=(0,o.isEmpty)(r)?U.countRows()-1:Math.max(r-t,0);Number.isInteger(r)&&(r=Math.max(r-t,0));if(!B.removeRow(r,s,n))return;if(ee.isSelected()){const{row:e}=U.getSelectedRangeLast().highlight;e>=r&&e<=r+s-1&&G.closeEditor(!0)}const a=U.countRows();0===a?ee.deselect():"ContextMenu.removeRow"===n?ee.refresh():ee.shiftRows(r,-s);const l=Q.fixedRowsTop;l>=i+1&&(Q.fixedRowsTop-=Math.min(s,l-i));const h=Q.fixedRowsBottom;h&&i>=a-h&&(Q.fixedRowsBottom-=Math.min(s,h)),t+=s}))};Array.isArray(t)?g(i(t)):g([[t,r]]);break;case"remove_col":const f=e=>{let t=0;(0,d.arrayEach)(e,(e=>{let[r,s]=e;const i=(0,o.isEmpty)(r)?U.countCols()-1:Math.max(r-t,0);let a=U.toPhysicalColumn(i);Number.isInteger(r)&&(r=Math.max(r-t,0));if(!B.removeCol(r,s,n))return;if(ee.isSelected()){const{col:e}=U.getSelectedRangeLast().highlight;e>=r&&e<=r+s-1&&G.closeEditor(!0)}0===U.countCols()?ee.deselect():"ContextMenu.removeColumn"===n?ee.refresh():ee.shiftColumns(r,-s);const l=Q.fixedColumnsStart;l>=i+1&&(Q.fixedColumnsStart-=Math.min(s,l-i)),Array.isArray(Q.colHeaders)&&(void 0===a&&(a=-1),Q.colHeaders.splice(a,s)),t+=s}))};Array.isArray(t)?f(i(t)):f([[t,r]]);break;default:throw new Error(`There is no such action "${e}"`)}s||Y.adjustRowsAndCols(),U.view.render(),U.view.adjustElementsSize()},adjustRowsAndCols(){const e=Q.minRows,t=Q.minSpareRows,r=Q.minCols,n=Q.minSpareCols;if(e){const t=U.countRows();te.slice(f)));for(i=0;i1&&void 0!==arguments[1]?arguments[1]:null;const n=t[e%t.length];return null!==r?n[r%n.length]:n},A=t.length,I=r?r.row-e.row+1:0;for(o=r?I:Math.max(A,I),i=0;ir.row&&I>A||!Q.allowInsertRow&&c.row>U.countRows()-1||c.row>=Q.maxRows);i++){const t=i-M,s=O(t).length,d=r?r.col-e.col+1:0;if(l=r?d:Math.max(s,d),c.col=e.col,N=U.getCellMeta(c.row,c.col),"CopyPaste.paste"!==n&&"Autofill.fill"!==n||!N.skipRowOnPaste){for(_=0,a=0;ar.col&&d>s||!Q.allowInsertColumn&&c.col>U.countCols()-1||c.col>=Q.maxCols);a++){if(N=U.getCellMeta(c.row,c.col),("CopyPaste.paste"===n||"Autofill.fill"===n)&&N.skipColumnOnPaste){_+=1,c.col+=1,l+=1;continue}if(N.readOnly&&"UndoRedo.undo"!==n){c.col+=1;continue}let e=O(t,a-_),r=U.getDataAtCell(c.row,c.col);if(null!==e&&"object"==typeof e)if(Array.isArray(e)&&null===r&&(r=[]),null===r||"object"!=typeof r)b=!1;else{const t=(0,u.duckSchema)(Array.isArray(r)?r:r[0]||r),n=(0,u.duckSchema)(Array.isArray(e)?e:e[0]||e);(0,u.isObjectEqual)(t,n)||Array.isArray(t)&&Array.isArray(n)?e=(0,u.deepClone)(e):b=!1}else null!==r&&"object"==typeof r&&(b=!1);b&&h.push([c.row,c.col,e]),b=!0,c.col+=1}c.row+=1}else M+=1,c.row+=1,o+=1}U.setDataAtCell(h,null,null,n||"populateFromArray")}}},this.init=function(){W.setData(Q.data),U.runHooks("beforeInit"),((0,a.isMobileBrowser)()||(0,a.isIpadOS)())&&(0,s.addClass)(U.rootElement,"mobile"),this.updateSettings(Q,!0),this.view=new C.default(this);const e=Q.themeName||(0,D.getThemeClassName)(U.rootElement);U.useTheme(e),U.view.addClassNameToLicenseElement(U.getCurrentThemeName()),G=l.default.getInstance(U,Q,ee),z=(0,I.createViewportScroller)(U),j=new c.FocusManager(U),(0,T.isRootInstance)(this)&&(0,I.installFocusCatcher)(U),U.runHooks("init"),this.forceFullRender=!0,this.view.render(),$&&null===U.rootElement.offsetParent&&(0,s.observeVisibilityChangeOnce)(U.rootElement,(()=>{U.view._wt.wtOverlays.updateLastSpreaderSize(),U.render(),U.view.adjustElementsSize()})),"object"==typeof $&&(U.runHooks("afterChange",$[0],$[1]),$=!1),U.runHooks("afterInit")},this._createCellCoords=function(e,t){return U.view._wt.createCellCoords(e,t)},this._createCellRange=function(e,t,r){return U.view._wt.createCellRange(e,t,r)},this.validateCell=function(e,t,r,n){let s=U.getCellValidator(t);function a(e){if(!(!(arguments.length>1&&void 0!==arguments[1])||arguments[1])||!0===t.hidden)return void r(e);const n=t.visualCol,s=t.visualRow,i=U.getCell(s,n,!0);if(i&&"TH"!==i.nodeName){const e=U.rowIndexMapper.getRenderableFromVisualIndex(s),t=U.columnIndexMapper.getRenderableFromVisualIndex(n);U.view._wt.getSetting("cellRenderer",e,t,i)}r(e)}var l;(0,o.isRegExp)(s)&&(l=s,s=function(e,t){t(l.test(e))}),(0,i.isFunction)(s)?(e=U.runHooks("beforeValidate",e,t.visualRow,t.prop,n),U._registerImmediate((()=>{s.call(t,e,(r=>{U&&(r=U.runHooks("afterValidate",r,e,t.visualRow,t.prop,n),t.valid=r,a(r),U.runHooks("postAfterValidate",r,e,t.visualRow,t.prop,n))}))}))):U._registerImmediate((()=>{t.valid=!0,a(t.valid,!1)}))},this.setDataAtCell=function(e,t,r,n){const s=le(e,t,r),i=[];let o,a,l,h=n;for(o=0,a=s.length;o=this.countCols()?s[o][1]:B.colToProp(s[o][1]),i.push([s[o][0],l,W.getAtCell(this.toPhysicalRow(s[o][0]),s[o][1]),s[o][2]])}h||"object"!=typeof e||(h=t);const u=he(i,h);U.runHooks("afterSetDataAtCell",u,h),oe(u,h,(()=>{ae(u,h)}))},this.setDataAtRowProp=function(e,t,r,n){const s=le(e,t,r),i=[];let o,a,l=n;for(o=0,a=s.length;o{ae(h,l)}))},this.listen=function(){U&&!U.isListening()&&(H.forEach((e=>{U!==e&&e.unlisten()})),k=U.guid,U.runHooks("afterListen"))},this.unlisten=function(){this.isListening()&&(k=null,U.runHooks("afterUnlisten"))},this.isListening=function(){return k===U.guid},this.destroyEditor=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];G.closeEditor(e),U.view.render(),t&&ee.isSelected()&&G.prepareEditor()},this.populateFromArray=function(e,t,r,n,s,i,o){if("object"!=typeof r||"object"!=typeof r[0])throw new Error("populateFromArray parameter `input` must be an array of arrays");const a="number"==typeof n?U._createCellCoords(n,s):null;return Y.populateFromArray(U._createCellCoords(e,t),r,a,i,o)},this.spliceCol=function(e,t,r){for(var n=arguments.length,s=new Array(n>3?n-3:0),i=3;i3?n-3:0),i=3;i{let{from:t,to:r}=e;return[t.row,t.col,r.row,r.col]}))},this.getSelectedLast=function(){const e=this.getSelected();let t;return e&&e.length>0&&(t=e[e.length-1]),t},this.getSelectedRange=function(){if(ee.isSelected())return Array.from(ee.getSelectedRange())},this.getSelectedRangeLast=function(){const e=this.getSelectedRange();let t;return e&&e.length>0&&(t=e[e.length-1]),t},this.emptySelectedCells=function(e){if(!ee.isSelected()||0===this.countRows()||0===this.countCols())return;const t=[];(0,d.arrayEach)(ee.getSelectedRange(),(e=>{if(e.isSingleHeader())return;const r=e.getTopStartCorner(),n=e.getBottomEndCorner();(0,w.rangeEach)(r.row,n.row,(e=>{(0,w.rangeEach)(r.col,n.col,(r=>{this.getCellMeta(e,r).readOnly||t.push([e,r,null])}))}))})),t.length>0&&this.setDataAtCell(t,e)},this.isRenderSuspended=function(){return this.renderSuspendedCounter>0},this.suspendRender=function(){this.renderSuspendedCounter+=1},this.resumeRender=function(){const e=this.renderSuspendedCounter-1;this.renderSuspendedCounter=Math.max(e,0),this.isRenderSuspended()||e!==this.renderSuspendedCounter||(this.renderCall?this.render():U.view.render())},this.render=function(){this.view&&(this.renderCall=!0,this.forceFullRender=!0,this.isRenderSuspended()||U.view.render())},this.batchRender=function(e){this.suspendRender();const t=e();return this.resumeRender(),t},this.isExecutionSuspended=function(){return this.executionSuspendedCounter>0},this.suspendExecution=function(){this.executionSuspendedCounter+=1,this.columnIndexMapper.suspendOperations(),this.rowIndexMapper.suspendOperations()},this.resumeExecution=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=this.executionSuspendedCounter-1;this.executionSuspendedCounter=Math.max(t,0),(!this.isExecutionSuspended()&&t===this.executionSuspendedCounter||e)&&(this.columnIndexMapper.resumeOperations(),this.rowIndexMapper.resumeOperations())},this.batchExecution=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.suspendExecution();const r=e();return this.resumeExecution(t),r},this.batch=function(e){this.suspendRender(),this.suspendExecution();const t=e();return this.resumeExecution(),this.resumeRender(),t},this.refreshDimensions=function(){if(!U.view)return;const e=U.view,{width:t,height:r}=e.getLastSize(),{width:n,height:s}=U.rootElement.getBoundingClientRect(),i=n!==t||s!==r;!1===U.runHooks("beforeRefreshDimensions",{width:t,height:r},{width:n,height:s},i)||((i||e._wt.wtOverlays.scrollableElement===U.rootWindow)&&(e.setLastSize(n,s),U.render(),e.adjustElementsSize()),U.runHooks("afterRefreshDimensions",{width:t,height:r},{width:n,height:s},i))},this.updateData=function(e,t){(0,A.replaceData)(e,(e=>{B=e}),(e=>{B=e,U.columnIndexMapper.fitToLength(this.getInitialColumnCount()),U.rowIndexMapper.fitToLength(this.countSourceRows()),Y.adjustRowsAndCols(),ee.refresh()}),{hotInstance:U,dataMap:B,dataSource:W,internalSource:"updateData",source:t,metaManager:q,firstRun:$})},this.loadData=function(e,t){(0,A.replaceData)(e,(e=>{B=e}),(()=>{q.clearCellsCache(),U.initIndexMappers(),Y.adjustRowsAndCols(),ee.refresh(),$&&($=[null,"loadData"])}),{hotInstance:U,dataMap:B,dataSource:W,internalSource:"loadData",source:t,metaManager:q,firstRun:$})},this.getInitialColumnCount=function(){const e=Q.columns;let t=0;if(Array.isArray(e))t=e.length;else if((0,i.isFunction)(e))if("array"===U.dataType){const r=this.countSourceCols();for(let n=0;n1&&void 0!==arguments[1]&&arguments[1];const r=($?U.loadData:U.updateData).bind(this);let n,s,a=!1;if((0,o.isDefined)(e.rows))throw new Error('The "rows" setting is no longer supported. Do you mean startRows, minRows or maxRows?');if((0,o.isDefined)(e.cols))throw new Error('The "cols" setting is no longer supported. Do you mean startCols, minCols or maxCols?');if((0,o.isDefined)(e.ganttChart))throw new Error('Since 8.0.0 the "ganttChart" setting is no longer supported.');for(n in e)"data"===n||("language"===n?re(e.language):"className"===n?ne("className",e.className):"tableClassName"===n&&U.table?(ne("tableClassName",e.tableClassName),U.view._wt.wtOverlays.syncOverlayTableClassNames()):M.Hooks.getSingleton().isRegistered(n)||M.Hooks.getSingleton().isDeprecated(n)?(0,i.isFunction)(e[n])?M.Hooks.getSingleton().addAsFixed(n,e[n],U):Array.isArray(e[n])&&M.Hooks.getSingleton().add(n,e[n],U):!t&&(0,u.hasOwnProperty)(e,n)&&(Z[n]=e[n]));void 0===e.data&&void 0===Q.data?r(null,"updateSettings"):void 0!==e.data?r(e.data,"updateSettings"):void 0!==e.columns&&(B.createMap(),U.initIndexMappers());const l=U.countCols(),h=Q.columns;if(h&&(0,i.isFunction)(h)&&(a=!0),void 0===e.cell&&void 0===e.cells&&void 0===e.columns||q.clearCache(),l>0)for(n=0,s=0;n{U.setCellMetaObject(e.row,e.col,e)})),U.runHooks("afterCellMetaReset");let c=U.rootElement.style.height;""!==c&&(c=parseInt(U.rootElement.style.height,10));let d=e.height;if((0,i.isFunction)(d)&&(d=d()),t){U.rootElement.getAttribute("style")&&U.rootElement.setAttribute("data-initialstyle",U.rootElement.getAttribute("style"))}if(null===d){const e=U.rootElement.getAttribute("data-initialstyle");e&&(e.indexOf("height")>-1||e.indexOf("overflow")>-1)?U.rootElement.setAttribute("style",e):(U.rootElement.style.height="",U.rootElement.style.overflow="")}else void 0!==d&&(U.rootElement.style.height=isNaN(d)?`${d}`:`${d}px`,U.rootElement.style.overflow="hidden");if(void 0!==e.width){let t=e.width;(0,i.isFunction)(t)&&(t=t()),U.rootElement.style.width=isNaN(t)?`${t}`:`${t}px`}if(!t){if(U.view){U.view._wt.wtViewport.resetHasOversizedColumnHeadersMarked(),U.view._wt.exportSettingsAsClassNames();const t=U.getCurrentThemeName(),r=(0,u.hasOwnProperty)(e,"themeName");t&&r&&t!==e.themeName&&(U.view.getStylesHandler().removeClassNames(),U.view.removeClassNameFromLicenseElement(t));const n=r&&e.themeName||(0,D.getThemeClassName)(U.rootElement);U.useTheme(n),U.view.addClassNameToLicenseElement(U.getCurrentThemeName())}U.runHooks("afterUpdateSettings",e)}Y.adjustRowsAndCols(),U.view&&!$&&(U.forceFullRender=!0,U.view.render(),U.view._wt.wtOverlays.adjustElementsSize()),t||!U.view||""!==c&&""!==d&&void 0!==d||c===d||U.view._wt.wtOverlays.updateMainScrollableElements()},this.getValue=function(){const e=U.getSelectedLast();if(Q.getValue){if((0,i.isFunction)(Q.getValue))return Q.getValue.call(U);if(e)return U.getData()[e[0][0]][Q.getValue]}else if(e)return U.getDataAtCell(e[0],e[1])},this.getSettings=function(){return Q},this.clear=function(){this.selectAll(),this.emptySelectedCells()},this.alter=function(e,t,r,n,s){Y.alter(e,t,r,n,s)},this.getCell=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=t,s=e;if(t>=0){if(this.columnIndexMapper.isHidden(this.toPhysicalColumn(t)))return null;n=this.columnIndexMapper.getRenderableFromVisualIndex(t)}if(e>=0){if(this.rowIndexMapper.isHidden(this.toPhysicalRow(e)))return null;s=this.rowIndexMapper.getRenderableFromVisualIndex(e)}return null===s||null===n||void 0===s||void 0===n?null:U.view.getCellAtCoords(U._createCellCoords(s,n),r)},this.getCoords=function(e){const t=this.view._wt.wtTable.getCoords(e);if(null===t)return null;const{row:r,col:n}=t;let s=r,i=n;return r>=0&&(s=this.rowIndexMapper.getVisualFromRenderableIndex(r)),n>=0&&(i=this.columnIndexMapper.getVisualFromRenderableIndex(n)),U._createCellCoords(s,i)},this.colToProp=function(e){return B.colToProp(e)},this.propToCol=function(e){return B.propToCol(e)},this.toVisualRow=e=>this.rowIndexMapper.getVisualFromPhysicalIndex(e),this.toVisualColumn=e=>this.columnIndexMapper.getVisualFromPhysicalIndex(e),this.toPhysicalRow=e=>this.rowIndexMapper.getPhysicalFromVisualIndex(e),this.toPhysicalColumn=e=>this.columnIndexMapper.getPhysicalFromVisualIndex(e),this.getDataAtCell=function(e,t){return B.get(e,B.colToProp(t))},this.getDataAtRowProp=function(e,t){return B.get(e,t)},this.getDataAtCol=function(e){const t=[],r=B.getRange(U._createCellCoords(0,e),U._createCellCoords(Q.data.length-1,e),B.DESTINATION_RENDERER);for(let e=0;e{let[t,r,n]=e;a.push([t,r,W.getAtCell(t,r),n])})),(0,d.arrayEach)(s,(e=>{let[t,r,n]=e;W.setAtCell(t,r,n)})),i&&this.runHooks("afterSetSourceDataAtCell",a,n),this.render();const l=U.getActiveEditor();l&&(0,o.isDefined)(l.refreshValue)&&l.refreshValue()},this.getSourceDataAtRow=function(e){return W.getAtRow(e)},this.getSourceDataAtCell=function(e,t){return W.getAtCell(e,t)},this.getDataAtRow=function(e){return B.getRange(U._createCellCoords(e,0),U._createCellCoords(e,this.countCols()-1),B.DESTINATION_RENDERER)[0]||[]},this.getDataType=function(e,t,r,n){const s=void 0===e?[0,0,this.countRows(),this.countCols()]:[e,t,r,n],[i,o]=s;let[,,a,l]=s,h=null,u=null;void 0===a&&(a=i),void 0===l&&(l=o);let c="mixed";return(0,w.rangeEach)(Math.max(Math.min(i,a),0),Math.max(i,a),(e=>{let t=!0;return(0,w.rangeEach)(Math.max(Math.min(o,l),0),Math.max(o,l),(r=>{const n=this.getCellMeta(e,r);return u=n.type,h?t=h===u:h=u,t})),c=t?u:"mixed",t})),c},this.removeCellMeta=function(e,t,r){const[n,s]=[this.toPhysicalRow(e),this.toPhysicalColumn(t)];let i=q.getCellMetaKeyValue(n,s,r);!1!==U.runHooks("beforeRemoveCellMeta",e,t,r,i)&&(q.removeCellMeta(n,s,r),U.runHooks("afterRemoveCellMeta",e,t,r,i)),i=null},this.spliceCellsMeta=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;for(var r=arguments.length,n=new Array(r>2?r-2:0),s=2;s0&&!Array.isArray(n[0]))throw new Error("The 3rd argument (cellMetaRows) has to be passed as an array of cell meta objects array.");t>0&&q.removeRow(this.toPhysicalRow(e),t),n.length>0&&(0,d.arrayEach)(n.reverse(),(t=>{q.createRow(this.toPhysicalRow(e)),(0,d.arrayEach)(t,((t,r)=>this.setCellMetaObject(e,r,t)))})),U.render()},this.setCellMetaObject=function(e,t,r){"object"==typeof r&&(0,u.objectEach)(r,((r,n)=>{this.setCellMeta(e,t,n,r)}))},this.setCellMeta=function(e,t,r,n){if(!1===U.runHooks("beforeSetCellMeta",e,t,r,n))return;let s=e,i=t;e=0;){if(void 0!==t&&-1===t.indexOf(s)){s-=1;continue}let e=U.countCols()-1;for(;e>=0;)void 0===r||-1!==r.indexOf(e)?(n.addValidatorToQueue(),U.validateCell(U.getDataAtCell(s,e),U.getCellMeta(s,e),(e=>{if("boolean"!=typeof e)throw new Error("Validation error: result is not boolean");!1===e&&(n.valid=!1),n.removeValidatorFormQueue()}),"validateCells"),e-=1):e-=1;s-=1}n.checkIfQueueIsEmpty()},this.getRowHeader=function(e){let t=Q.rowHeaders,r=e;return void 0!==r&&(r=U.runHooks("modifyRowHeader",r)),void 0===r?(t=[],(0,w.rangeEach)(U.countRows()-1,(e=>{t.push(U.getRowHeader(e))}))):Array.isArray(t)&&void 0!==t[r]?t=t[r]:(0,i.isFunction)(t)?t=t(r):t&&"string"!=typeof t&&"number"!=typeof t&&(t=r+1),t},this.hasRowHeaders=function(){return!!Q.rowHeaders},this.hasColHeaders=function(){if(void 0!==Q.colHeaders&&null!==Q.colHeaders)return!!Q.colHeaders;for(let e=0,t=U.countCols();e1&&void 0!==arguments[1]?arguments[1]:-1;const r=U.runHooks("modifyColHeader",e);if(void 0===r){const e=[],t=U.countCols();for(let r=0;r=0){t=U.getCellMeta(0,e).width}if(void 0!==t&&t!==Q.width||(t=Q.colWidths),null!=t){switch(typeof t){case"object":t=t[e];break;case"function":t=t(e)}"string"==typeof t&&(t=parseInt(t,10))}return t},this.getColWidth=function(e,t){let r=U._getColWidthFromSettings(e);return r=U.runHooks("modifyColWidth",r,e,t),void 0===r&&(r=N.DEFAULT_COLUMN_WIDTH),r},this._getRowHeightFromSettings=function(e){let t=Q.rowHeights;if(null!=t){switch(typeof t){case"object":t=t[e];break;case"function":t=t(e)}"string"==typeof t&&(t=parseInt(t,10))}return t},this.getRowHeight=function(e,t){let r=U._getRowHeightFromSettings(e);return r=U.runHooks("modifyRowHeight",r,e,t),r},this.countSourceRows=function(){return W.countRows()},this.countSourceCols=function(){return W.countFirstRowKeys()},this.countRows=function(){return B.getLength()},this.countCols=function(){const e=Q.maxCols,t=this.columnIndexMapper.getNotTrimmedIndexesLength();return Math.min(e,t)},this.countRenderedRows=function(){return U.view._wt.drawn?U.view._wt.wtTable.getRenderedRowsCount():-1},this.countVisibleRows=function(){return U.view._wt.drawn?U.view._wt.wtTable.getVisibleRowsCount():-1},this.countRenderedCols=function(){return U.view._wt.drawn?U.view._wt.wtTable.getRenderedColumnsCount():-1},this.countVisibleCols=function(){return U.view._wt.drawn?U.view._wt.wtTable.getVisibleColumnsCount():-1},this.countRowHeaders=function(){return this.view.getRowHeadersCount()},this.countColHeaders=function(){return this.view.getColumnHeadersCount()},this.countEmptyRows=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=0;return(0,w.rangeEachReverse)(U.countRows()-1,(r=>{if(U.isEmptyRow(r))t+=1;else if(!0===e)return!1})),t},this.countEmptyCols=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=0;return(0,w.rangeEachReverse)(U.countCols()-1,(r=>{if(U.isEmptyCol(r))t+=1;else if(!0===e)return!1})),t},this.isEmptyRow=function(e){return Q.isEmptyRow.call(U,e)},this.isEmptyCol=function(e){return Q.isEmptyCol.call(U,e)},this.selectCell=function(e,t,r,n){let s=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],i=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];return!(0,o.isUndefined)(e)&&!(0,o.isUndefined)(t)&&this.selectCells([[e,t,r,n]],s,i)},this.selectCells=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[[]],t=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];!1===(!(arguments.length>1&&void 0!==arguments[1])||arguments[1])&&z.suspend();const r=ee.selectCells(e);return r&&t&&U.listen(),z.resume(),r},this.selectColumns=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,r=arguments.length>2?arguments[2]:void 0;return ee.selectColumns(e,t,r)},this.selectRows=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,r=arguments.length>2?arguments[2]:void 0;return ee.selectRows(e,t,r)},this.deselectCell=function(){ee.deselect()},this.selectAll=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,r=arguments.length>2?arguments[2]:void 0;z.skipNextScrollCycle(),ee.selectAll(e,t,r)};const ue=(e,t)=>e.getNearestNotHiddenIndex(t,1,!0);this.scrollViewportTo=function(e){var t;"number"==typeof e&&(e={row:arguments[0],col:arguments[1],verticalSnap:arguments[2]?"bottom":"top",horizontalSnap:arguments[3]?"end":"start",considerHiddenIndexes:null===(t=arguments[4])||void 0===t||t});const{row:r,col:n,considerHiddenIndexes:s}=null!=e?e:{};let i=r,o=n;if(void 0===s||s){const e=Number.isInteger(r)&&r>=0,t=Number.isInteger(n)&&n>=0,s=e?ue(this.rowIndexMapper,r):void 0,a=t?ue(this.columnIndexMapper,n):void 0;if(null===s||null===a)return!1;i=e?U.rowIndexMapper.getRenderableFromVisualIndex(s):r,o=t?U.columnIndexMapper.getRenderableFromVisualIndex(a):n}const a=Number.isInteger(i),l=Number.isInteger(o);return a&&i>=0&&l&&o>=0?U.view.scrollViewport(U._createCellCoords(i,o),e.horizontalSnap,e.verticalSnap):a&&i>=0&&(l&&o<0||!l)?U.view.scrollViewportVertically(i,e.verticalSnap):!!(l&&o>=0&&(a&&i<0||!a))&&U.view.scrollViewportHorizontally(o,e.horizontalSnap)},this.scrollToFocusedCell=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:()=>{};if(!this.selection.isSelected())return;this.addHookOnce("afterScroll",e);const{highlight:t}=this.getSelectedRangeLast();this.scrollViewportTo(t.toObject())?this.view.render():(this.removeHook("afterScroll",e),this._registerImmediate((()=>e())))},this.destroy=function(){if(U._clearTimeouts(),U._clearImmediates(),U.view&&U.view.destroy(),W&&W.destroy(),W=null,this.getShortcutManager().destroy(),q.clearCache(),H.delete(this.guid),(0,T.isRootInstance)(U)){const e=this.rootDocument.querySelector(".hot-display-license-info");e&&e.parentNode.removeChild(e)}(0,s.empty)(U.rootElement),V.destroy(),G&&G.destroy(),U.batchExecution((()=>{U.rowIndexMapper.unregisterAll(),U.columnIndexMapper.unregisterAll(),J.getItems().forEach((e=>{let[,t]=e;t.destroy()})),J.clear(),U.runHooks("afterDestroy")}),!0),M.Hooks.getSingleton().destroy(U),(0,u.objectEach)(U,((e,t,r)=>{var n;(0,i.isFunction)(e)?r[t]=(n=t,()=>{throw new Error(`The "${n}" method cannot be called because this Handsontable instance has been destroyed`)}):"guid"!==t&&(r[t]=null)})),U.isDestroyed=!0,B&&B.destroy(),B=null,Y=null,ee=null,G=null,U=null},this.getActiveEditor=function(){return G.getActiveEditor()},this.getFirstRenderedVisibleRow=function(){return U.view.getFirstRenderedVisibleRow()},this.getLastRenderedVisibleRow=function(){return U.view.getLastRenderedVisibleRow()},this.getFirstRenderedVisibleColumn=function(){return U.view.getFirstRenderedVisibleColumn()},this.getLastRenderedVisibleColumn=function(){return U.view.getLastRenderedVisibleColumn()},this.getFirstFullyVisibleRow=function(){return U.view.getFirstFullyVisibleRow()},this.getLastFullyVisibleRow=function(){return U.view.getLastFullyVisibleRow()},this.getFirstFullyVisibleColumn=function(){return U.view.getFirstFullyVisibleColumn()},this.getLastFullyVisibleColumn=function(){return U.view.getLastFullyVisibleColumn()},this.getFirstPartiallyVisibleRow=function(){return U.view.getFirstPartiallyVisibleRow()},this.getLastPartiallyVisibleRow=function(){return U.view.getLastPartiallyVisibleRow()},this.getFirstPartiallyVisibleColumn=function(){return U.view.getFirstPartiallyVisibleColumn()},this.getLastPartiallyVisibleColumn=function(){return U.view.getLastPartiallyVisibleColumn()},this.getPlugin=function(e){return J.getItem((0,E.toUpperCaseFirst)(e))},this.getPluginName=function(e){return e===this.undoRedo?this.undoRedo.constructor.PLUGIN_KEY:J.getId(e)},this.getInstance=function(){return U},this.addHook=function(e,t,r){M.Hooks.getSingleton().add(e,t,U,r)},this.hasHook=function(e){return M.Hooks.getSingleton().has(e,U)||M.Hooks.getSingleton().has(e)},this.addHookOnce=function(e,t,r){M.Hooks.getSingleton().once(e,t,U,r)},this.removeHook=function(e,t){M.Hooks.getSingleton().remove(e,t,U)},this.runHooks=function(e,t,r,n,s,i,o){return M.Hooks.getSingleton().run(U,e,t,r,n,s,i,o)},this.getTranslatedPhrase=function(e,t){return(0,_.getTranslatedPhrase)(Q.language,e,t)},this.toHTML=()=>(0,p.instanceToHTML)(this),this.toTableElement=()=>{const e=this.rootDocument.createElement("div");return e.insertAdjacentHTML("afterbegin",(0,p.instanceToHTML)(this)),e.firstElementChild},this.timeouts=[],this.useTheme=e=>{this.view.getStylesHandler().useTheme(e),this.runHooks("afterSetTheme",e,!!$)},this.getCurrentThemeName=()=>this.view.getStylesHandler().getThemeName(),this._registerTimeout=function(e){let t=e;"function"==typeof t&&(t=setTimeout(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0)),this.timeouts.push(t)},this._clearTimeouts=function(){(0,d.arrayEach)(this.timeouts,(e=>{clearTimeout(e)}))},this.immediates=[],this._registerImmediate=function(e){this.immediates.push(setImmediate(e))},this._clearImmediates=function(){(0,d.arrayEach)(this.immediates,(e=>{clearImmediate(e)}))},this._getEditorManager=function(){return G},this.isRtl=function(){return"rtl"===U.rootWindow.getComputedStyle(U.rootElement).direction},this.isLtr=function(){return!U.isRtl()},this.getDirectionFactor=function(){return U.isLtr()?1:-1};const ce=(0,P.createShortcutManager)({handleEvent:()=>U.isListening(),beforeKeyDown:e=>this.runHooks("beforeKeyDown",e),afterKeyDown:e=>{this.isDestroyed||U.runHooks("afterDocumentKeyDown",e)},ownerWindow:this.rootWindow});this.addHook("beforeOnCellMouseDown",(e=>{!1===e.ctrlKey&&!1===e.metaKey&&ce.releasePressedKeys()})),this.getShortcutManager=function(){return ce},this.getFocusManager=function(){return j},(0,g.getPluginsNames)().forEach((e=>{const t=(0,g.getPlugin)(e);J.addItem(e,new t(this))})),(0,L.registerAllShortcutContexts)(U),ce.setActiveContextName("grid"),M.Hooks.getSingleton().run(U,"construct")},r(67834),r(15724),r(71336),r(41558),r(17663),r(68630),r(79645),r(89858),r(8620),r(14846),r(27458),r(69655),r(94364),r(71766);var s=r(62577),i=r(89804),o=r(70505),a=r(25046),l=n(r(70892)),h=n(r(3849)),u=r(25499),c=r(19053),d=r(10587),p=r(96173),g=r(74672),f=r(54852),m=r(8266),y=r(17027),E=r(5893),w=r(22137),C=n(r(33925)),v=n(r(61068)),R=r(87124),S=r(61149),T=r(45435),N=r(50206),M=r(28197),_=r(58570),b=r(1052),O=r(76717),A=r(6521),I=r(97826),x=r(54394),P=r(89616),L=r(92399),D=r(73618);let k=null;const H=new Map;new Set},32741:(e,t,r)=>{"use strict";t.__esModule=!0,t.installFocusDetector=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=e.rootElement,n=i(e),s=i(e);return n.addEventListener("focus",(()=>null==t?void 0:t.onFocusFromTop())),s.addEventListener("focus",(()=>null==t?void 0:t.onFocusFromBottom())),r.firstChild.before(n),r.lastChild.after(s),{activate(){e._registerTimeout((()=>{n.tabIndex=0,s.tabIndex=0}),10)},deactivate(){e._registerTimeout((()=>{n.tabIndex=-1,s.tabIndex=-1}),10)}}};var n=r(62577),s=r(71120);function i(e){const t=e.rootDocument.createElement("input");return t.type="text",t.name="__htFocusCatcher",t.classList.add("htFocusCatcher"),e.getSettings().ariaTags&&(0,n.setAttribute)(t,[(0,s.A11Y_PRESENTATION)(),(0,s.A11Y_HIDDEN)()]),t}},20511:(e,t,r)=>{"use strict";t.__esModule=!0,t.installFocusCatcher=function(e){const t=function(e){return t=>{if(!t)return null;const r=i(e),n=o(e);return t.coln.col&&(t.col=n.col),t.rown.row&&(t.row=n.row),t}}(e);let r;const{activate:a,deactivate:l}=(0,s.installFocusDetector)(e,{onFocusFromTop(){var n;const s=null!==(n=t(r))&&void 0!==n?n:i(e);s&&(e.runHooks("modifyFocusOnTabNavigation","from_above",s),e.selectCell(s.row,s.col)),e.listen()},onFocusFromBottom(){var n;const s=null!==(n=t(r))&&void 0!==n?n:o(e);s&&(e.runHooks("modifyFocusOnTabNavigation","from_below",s),e.selectCell(s.row,s.col)),e.listen()}}),h={wrapped:!1,flipped:!1};let u=!0,c=!1,d=!1;e.addHook("afterListen",(()=>l())),e.addHook("afterUnlisten",(()=>a())),e.addHook("afterSelection",((t,n,s,i,o)=>{var a;(c&&(h.wrapped&&h.flipped||d)&&(d=!1,o.value=!0),u)&&(r=null===(a=e.getSelectedRangeLast())||void 0===a?void 0:a.highlight)})),e.addHook("beforeRowWrap",((e,t,r)=>{h.wrapped=!0,h.flipped=r}));const p={keys:[["Tab"],["Shift","Tab"]],preventDefault:!1,stopPropagation:!1,relativeToGroup:n.GRID_GROUP,group:"focusCatcher"};e.getShortcutManager().getContext("grid").addShortcuts([{...p,callback:()=>{const{tabNavigation:t}=e.getSettings();c=!0,e.getSelectedRangeLast()&&!t&&(u=!1),t||(d=!0)},position:"before"},{...p,callback:t=>{const{tabNavigation:n,autoWrapRow:s}=e.getSettings();if(c=!1,u=!0,!n||!e.selection.isSelected()||s&&h.wrapped&&h.flipped||!s&&h.wrapped)return s&&h.wrapped&&h.flipped&&(r=t.shiftKey?i(e):o(e)),h.wrapped=!1,h.flipped=!1,e.deselectCell(),e.unlisten(),!1;t.preventDefault()},position:"after"}])};var n=r(92399),s=r(32741);function i(e){const{rowIndexMapper:t,columnIndexMapper:r}=e,{navigableHeaders:n}=e.getSettings();let s=n&&e.countColHeaders()>0?-e.countColHeaders():0,i=n&&e.countRowHeaders()>0?-e.countRowHeaders():0;return 0===s&&(s=t.getVisualFromRenderableIndex(s)),0===i&&(i=r.getVisualFromRenderableIndex(i)),null===s||null===i?null:e._createCellCoords(s,i)}function o(e){var t,r;const{rowIndexMapper:n,columnIndexMapper:s}=e,{navigableHeaders:i}=e.getSettings();let o=n.getRenderableIndexesLength()-1,a=s.getRenderableIndexesLength()-1;if(o<0){if(!i||0===e.countColHeaders())return null;o=-1}if(a<0){if(!i||0===e.countColHeaders())return null;a=-1}return e._createCellCoords(null!==(t=n.getVisualFromRenderableIndex(o))&&void 0!==t?t:o,null!==(r=s.getVisualFromRenderableIndex(a))&&void 0!==r?r:a)}},39631:(e,t,r)=>{"use strict";t.__esModule=!0,r(67834),r(15724),r(79747),r(71336),r(41558),r(17663),r(68630),r(79645),r(89858),r(8620),r(14846),r(27458),r(6211),r(69655);var n=r(64924);function s(e,t,r){i(e,t),t.set(e,r)}function i(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function o(e,t,r){return e.set(l(e,t),r),r}function a(e,t){return e.get(l(e,t))}function l(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var h=new WeakMap,u=new WeakMap,c=new WeakMap,d=new WeakSet;function p(e){a(h,this).set(e,[]),a(u,this).set(e,0)}t.HooksBucket=class{constructor(){var e,t;i(e=this,t=d),t.add(e),s(this,h,new Map),s(this,u,new Map),s(this,c,new Set),n.REGISTERED_HOOKS.forEach((e=>l(d,this,p).call(this,e)))}getHooks(e){var t;return null!==(t=a(h,this).get(e))&&void 0!==t?t:[]}add(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};a(h,this).has(e)||(l(d,this,p).call(this,e),n.REGISTERED_HOOKS.push(e));const s=a(h,this).get(e);if(s.find((e=>e.callback===t)))return;const i=Number.isInteger(r.orderIndex)?r.orderIndex:0,o=!!r.runOnce,u=!!r.initialHook;let g=!1;if(u){const e=s.find((e=>e.initialHook));e&&(e.callback=t,g=!0)}if(!g){s.push({callback:t,orderIndex:i,runOnce:o,initialHook:u,skip:!1});let r=a(c,this).has(e);r||0===i||(r=!0,a(c,this).add(e)),r&&s.length>1&&a(h,this).set(e,s.toSorted(((e,t)=>e.orderIndex-t.orderIndex)))}}has(e){return a(h,this).has(e)&&a(h,this).get(e).length>0}remove(e,t){if(!a(h,this).has(e))return!1;const r=a(h,this).get(e),n=r.find((e=>e.callback===t));if(n){let t=a(u,this).get(e);return n.skip=!0,t+=1,t>100&&(a(h,this).set(e,r.filter((e=>!e.skip))),t=0),a(u,this).set(e,t),!0}return!1}destroy(){a(h,this).clear(),a(u,this).clear(),o(h,this,null),o(u,this,null)}}},64924:(e,t)=>{"use strict";t.__esModule=!0;t.REGISTERED_HOOKS=["afterCellMetaReset","afterChange","afterContextMenuDefaultOptions","beforeContextMenuSetItems","afterDropdownMenuDefaultOptions","beforeDropdownMenuSetItems","afterContextMenuHide","beforeContextMenuShow","afterContextMenuShow","afterCopyLimit","beforeCreateCol","afterColumnSequenceChange","afterCreateCol","beforeCreateRow","afterCreateRow","afterDeselect","afterDestroy","afterDocumentKeyDown","afterDrawSelection","beforeRemoveCellClassNames","afterGetCellMeta","afterGetColHeader","afterGetRowHeader","afterInit","afterLoadData","afterUpdateData","afterMomentumScroll","afterOnCellCornerMouseDown","afterOnCellCornerDblClick","afterOnCellMouseDown","afterOnCellMouseUp","afterOnCellContextMenu","afterOnCellMouseOver","afterOnCellMouseOut","afterRemoveCol","afterRemoveRow","beforeRenderer","afterRenderer","afterRowSequenceChange","beforeViewportScrollVertically","beforeViewportScrollHorizontally","beforeViewportScroll","afterScrollHorizontally","afterScrollVertically","afterScroll","afterSelection","afterSelectionByProp","afterSelectionEnd","afterSelectionEndByProp","afterSelectionFocusSet","beforeSelectColumns","afterSelectColumns","beforeSelectRows","afterSelectRows","afterSetCellMeta","afterRemoveCellMeta","afterSetDataAtCell","afterSetDataAtRowProp","afterSetSourceDataAtCell","afterSetTheme","afterUpdateSettings","afterValidate","beforeLanguageChange","afterLanguageChange","beforeAutofill","afterAutofill","beforeCellAlignment","beforeChange","beforeChangeRender","beforeDrawBorders","beforeGetCellMeta","beforeRemoveCellMeta","beforeInit","beforeInitWalkontable","beforeLoadData","beforeUpdateData","beforeKeyDown","beforeOnCellMouseDown","beforeOnCellMouseUp","beforeOnCellContextMenu","beforeOnCellMouseOver","beforeOnCellMouseOut","beforeRemoveCol","beforeRemoveRow","beforeViewRender","afterViewRender","beforeRender","afterRender","beforeRowWrap","beforeColumnWrap","beforeSetCellMeta","beforeSelectionFocusSet","beforeSetRangeStartOnly","beforeSetRangeStart","beforeSetRangeEnd","beforeSelectionHighlightSet","beforeTouchScroll","beforeValidate","beforeValueRender","construct","init","modifyColHeader","modifyColWidth","modifyFiltersMultiSelectValue","modifyFocusedElement","modifyRowHeader","modifyRowHeight","modifyRowHeightByOverlayName","modifyData","modifySourceData","modifyRowData","modifyGetCellCoords","modifyGetCoordsElement","modifyFocusOnTabNavigation","beforeHighlightingRowHeader","beforeHighlightingColumnHeader","persistentStateLoad","persistentStateReset","persistentStateSave","beforeColumnSort","afterColumnSort","modifyAutofillRange","modifyCopyableRange","beforeCut","afterCut","beforeCopy","afterCopy","beforePaste","afterPaste","beforeColumnFreeze","afterColumnFreeze","beforeColumnMove","afterColumnMove","beforeColumnUnfreeze","afterColumnUnfreeze","beforeRowMove","afterRowMove","beforeColumnResize","afterColumnResize","beforeRowResize","afterRowResize","afterGetColumnHeaderRenderers","afterGetRowHeaderRenderers","beforeStretchingColumnWidth","beforeFilter","afterFilter","afterFormulasValuesUpdate","afterNamedExpressionAdded","afterNamedExpressionRemoved","afterSheetAdded","afterSheetRenamed","afterSheetRemoved","modifyColumnHeaderHeight","modifyColumnHeaderValue","beforeUndo","beforeUndoStackChange","afterUndo","afterUndoStackChange","beforeRedo","beforeRedoStackChange","afterRedo","afterRedoStackChange","modifyRowHeaderWidth","modifyTransformFocus","modifyTransformStart","modifyTransformEnd","afterModifyTransformFocus","afterModifyTransformStart","afterModifyTransformEnd","afterViewportRowCalculatorOverride","afterViewportColumnCalculatorOverride","afterPluginsInitialized","beforeHideRows","afterHideRows","beforeUnhideRows","afterUnhideRows","beforeHideColumns","afterHideColumns","beforeUnhideColumns","afterUnhideColumns","beforeTrimRow","afterTrimRow","beforeUntrimRow","afterUntrimRow","beforeDropdownMenuShow","afterDropdownMenuShow","afterDropdownMenuHide","beforeAddChild","afterAddChild","beforeDetachChild","afterDetachChild","beforeBeginEditing","afterBeginEditing","beforeMergeCells","afterMergeCells","beforeUnmergeCells","afterUnmergeCells","afterListen","afterUnlisten","afterRefreshDimensions","beforeRefreshDimensions","beforeColumnCollapse","afterColumnCollapse","beforeColumnExpand","afterColumnExpand","modifyAutoColumnSizeSeed"],t.REMOVED_HOOKS=new Map([["modifyRow","8.0.0"],["modifyCol","8.0.0"],["unmodifyRow","8.0.0"],["unmodifyCol","8.0.0"],["skipLengthCache","8.0.0"],["hiddenColumn","8.0.0"],["hiddenRow","8.0.0"]]),t.DEPRECATED_HOOKS=new Map([[]])},28197:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(15724);var s=n(r(85707)),i=r(10587),o=r(5893),a=r(14859),l=r(21595),h=r(89804),u=r(64924),c=r(39631);const d=l.toSingleLine`The plugin hook "[hookName]" was removed in Handsontable [removedInVersion].\x20 + Please consult release notes https://github.com/handsontable/handsontable/releases/tag/[removedInVersion] to\x20 + learn about the migration path.`;class p{constructor(){(0,s.default)(this,"globalBucket",new c.HooksBucket)}static getSingleton(){return g}getBucket(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return e?(e.pluginHookBucket||(e.pluginHookBucket=new c.HooksBucket),e.pluginHookBucket):this.globalBucket}add(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3?arguments[3]:void 0;return Array.isArray(t)?(0,i.arrayEach)(t,(t=>this.add(e,t,r))):(u.REMOVED_HOOKS.has(e)&&(0,a.warn)((0,o.substitute)(d,{hookName:e,removedInVersion:u.REMOVED_HOOKS.get(e)})),u.DEPRECATED_HOOKS.has(e)&&(0,a.warn)(u.DEPRECATED_HOOKS.get(e)),this.getBucket(r).add(e,t,{orderIndex:n,runOnce:!1})),this}once(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3?arguments[3]:void 0;return Array.isArray(t)?(0,i.arrayEach)(t,(t=>this.once(e,t,r))):this.getBucket(r).add(e,t,{orderIndex:n,runOnce:!0}),this}addAsFixed(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return Array.isArray(t)?(0,i.arrayEach)(t,(t=>this.addAsFixed(e,t,r))):this.getBucket(r).add(e,t,{initialHook:!0}),this}remove(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return this.getBucket(r).remove(e,t)}has(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.getBucket(t).has(e)}run(e,t,r,n,s,i,o,a){{const l=this.getBucket().getHooks(t),u=l?l.length:0;let c=0;if(u)for(;c0&&void 0!==arguments[0]?arguments[0]:null;this.getBucket(e).destroy()}register(e){this.isRegistered(e)||u.REGISTERED_HOOKS.push(e)}deregister(e){this.isRegistered(e)&&u.REGISTERED_HOOKS.splice(u.REGISTERED_HOOKS.indexOf(e),1)}isDeprecated(e){return u.DEPRECATED_HOOKS.has(e)||u.REMOVED_HOOKS.has(e)}isRegistered(e){return u.REGISTERED_HOOKS.indexOf(e)>=0}getRegistered(){return u.REGISTERED_HOOKS}}t.Hooks=p;const g=new p;t.default=p},97826:(e,t,r)=>{"use strict";r(14846),r(69655),t.__esModule=!0;var n=r(20511);Object.keys(n).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===n[e]||(t[e]=n[e]))}));var s=r(92104);Object.keys(s).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===s[e]||(t[e]=s[e]))}))},92104:(e,t,r)=>{"use strict";t.__esModule=!0,t.createViewportScroller=function(e){const{selection:t}=e;let r=!1,u=!1;return{resume(){u=!1},suspend(){u=!0},skipNextScrollCycle(){r=!0},scrollTo(c){var d;if(r||u)return void(r=!1);let p;t.isFocusSelectionChanged()?p=(0,i.focusScrollStrategy)(e):t.isSelectedByCorner()?p=(0,s.cornerHeaderScrollStrategy)(e):t.isSelectedByRowHeader()?p=(0,l.rowHeaderScrollStrategy)(e):t.isSelectedByColumnHeader()?p=(0,n.columnHeaderScrollStrategy)(e):1===t.getSelectedRange().size()&&t.isMultiple()?p=(0,o.multipleScrollStrategy)(e):1!==t.getSelectedRange().size()||t.isMultiple()?t.getSelectedRange().size()>1&&(p=(0,a.noncontiguousScrollStrategy)(e)):p=(0,h.singleScrollStrategy)(e),null===(d=p)||void 0===d||d(c)}}};var n=r(58007),s=r(85924),i=r(53720),o=r(13312),a=r(70671),l=r(71725),h=r(39068)},58007:(e,t)=>{"use strict";t.__esModule=!0,t.columnHeaderScrollStrategy=function(e){return t=>{let{col:r}=t;e.scrollViewportTo({col:r})}}},85924:(e,t)=>{"use strict";t.__esModule=!0,t.cornerHeaderScrollStrategy=function(){return()=>{}}},53720:(e,t)=>{"use strict";t.__esModule=!0,t.focusScrollStrategy=function(e){return t=>{e.scrollViewportTo(t.toObject())}}},13312:(e,t)=>{"use strict";t.__esModule=!0,t.multipleScrollStrategy=function(e){return t=>{e.scrollViewportTo(t.toObject())}}},70671:(e,t)=>{"use strict";t.__esModule=!0,t.noncontiguousScrollStrategy=function(e){return t=>{e.scrollViewportTo(t.toObject())}}},71725:(e,t)=>{"use strict";t.__esModule=!0,t.rowHeaderScrollStrategy=function(e){return t=>{let{row:r}=t;e.scrollViewportTo({row:r})}}},39068:(e,t)=>{"use strict";t.__esModule=!0,t.singleScrollStrategy=function(e){return t=>{const r=e.selection.getSelectionSource(),{row:n,col:s}=t;if(n<0&&s>=0)e.scrollViewportTo({col:s});else if(s<0&&n>=0)e.scrollViewportTo({row:n});else{if("mouse"===r&&(s===e.view.getLastPartiallyVisibleColumn()||n===e.view.getLastPartiallyVisibleRow()))return;e.scrollViewportTo({row:n,col:s})}}}},78747:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834),r(15724),r(14846),r(27458),r(69655);var s=n(r(85707)),i=r(42354),o=r(87124),a=r(25499),l=r(10587),h=r(22137),u=r(70505);class c{static get DESTINATION_RENDERER(){return 1}static get DESTINATION_CLIPBOARD_GENERATOR(){return 2}constructor(e,t,r){(0,s.default)(this,"hot",void 0),(0,s.default)(this,"metaManager",void 0),(0,s.default)(this,"tableMeta",void 0),(0,s.default)(this,"dataSource",void 0),(0,s.default)(this,"duckSchema",void 0),(0,s.default)(this,"colToPropCache",void 0),(0,s.default)(this,"propToColCache",void 0),this.hot=e,this.metaManager=r,this.tableMeta=r.getTableMeta(),this.dataSource=t,this.duckSchema=this.createDuckSchema(),this.createMap()}createMap(){const e=this.getSchema();if(void 0===e)throw new Error("trying to create `columns` definition but you didn't provide `schema` nor `data`");const t=this.tableMeta.columns;let r;if(this.colToPropCache=[],this.propToColCache=new Map,t){let n=0,s=0,i=!1;if("function"==typeof t){const t=(0,a.deepObjectSize)(e);n=t>0?t:this.countFirstRowKeys(),i=!0}else{const e=this.tableMeta.maxCols;n=Math.min(e,t.length)}for(r=0;r{null===e?(n=i+t,this.colToPropCache.push(n),this.propToColCache.set(n,s),s+=1):s=this.recursiveDuckColumns(e,s,`${t}.`)})),s}colToProp(e){if(!1===Number.isInteger(e))return e;const t=this.hot.toPhysicalColumn(e);return null===t?e:this.colToPropCache&&(0,u.isDefined)(this.colToPropCache[t])?this.colToPropCache[t]:t}propToCol(e){const t=this.propToColCache.get(e);if((0,u.isDefined)(t))return this.hot.toVisualColumn(t);const r=this.hot.toVisualColumn(e);return null===r?e:r}getSchema(){const e=this.tableMeta.dataSchema;return e?"function"==typeof e?e():e:this.duckSchema}createDuckSchema(){return this.dataSource&&this.dataSource[0]?(0,a.duckSchema)(this.dataSource[0]):{}}refreshDuckSchema(){this.duckSchema=this.createDuckSchema()}createRow(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,{source:r,mode:n="above"}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const s=this.hot.countSourceRows();let i=s,o=0,l=e;("number"!=typeof l||l>=s)&&(l=s),le.push(null)))):"function"===this.hot.dataType?e=this.tableMeta.dataSchema(l+o):(e={},(0,a.deepExtend)(e,this.getSchema())),d.push(e),o+=1}this.hot.rowIndexMapper.insertIndexes(l,o),"below"===n&&(i=Math.min(i+1,s)),this.spliceData(i,0,d);const p=this.hot.toVisualRow(i);return this.hot.countSourceRows()===d.length&&this.hot.columnIndexMapper.initToLength(this.hot.getInitialColumnCount()),o>0&&(null==e?this.metaManager.createRow(null,o):"auto"!==r&&this.metaManager.createRow(i,t)),this.hot.runHooks("afterCreateRow",p,o,r),this.hot.forceFullRender=!0,{delta:o,startPhysicalIndex:i}}createCol(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,{source:r,mode:n="start"}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!this.hot.isColumnModificationAllowed())throw new Error("Cannot create new column. When data source in an object, you can only have as much columns as defined in first data row, data schema or in the 'columns' setting.If you want to be able to add new columns, you have to use array datasource.");const s=this.dataSource,i=this.tableMeta.maxCols,o=this.hot.countSourceCols();let a=e;("number"!=typeof a||a>=o)&&(a=o);if(!1===this.hot.runHooks("beforeCreateCol",a,t,r))return{delta:0};let l=o;a=u)if(h>0)for(let e=0;e0&&(null==e?this.metaManager.createColumn(null,c):"auto"!==r&&this.metaManager.createColumn(p,t));const g=this.hot.toVisualColumn(p);return this.hot.runHooks("afterCreateCol",g,c,r),this.hot.forceFullRender=!0,this.refreshDuckSchema(),{delta:c,startPhysicalIndex:p}}removeRow(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2?arguments[2]:void 0,n=Number.isInteger(e)?e:-t;const s=this.visualRowsToPhysical(n,t),i=this.hot.countSourceRows();n=(i+n)%i;if(!1===this.hot.runHooks("beforeRemoveRow",n,s.length,s,r))return!1;const o=s.length;if(this.filterData(n,o,s),nt-e)).forEach((e=>{this.metaManager.removeRow(e,1)})),this.hot.runHooks("afterRemoveRow",n,o,s,r),this.hot.forceFullRender=!0,!0}removeCol(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2?arguments[2]:void 0;if("object"===this.hot.dataType||this.tableMeta.columns)throw new Error("cannot remove column with object data source or columns option specified");let n="number"!=typeof e?-t:e;n=(this.hot.countCols()+n)%this.hot.countCols();const s=this.visualColumnsToPhysical(n,t),i=s.slice(0).sort(((e,t)=>t-e));if(!1===this.hot.runHooks("beforeRemoveCol",n,t,s,r))return!1;let o=!0;const a=i.length,l=this.dataSource;for(let e=0;e3?o-3:0),h=3;h3?o-3:0),h=3;hthis.dataSource.push(e)))}}filterData(e,t,r){let n=this.hot.runHooks("filterData",e,t,r);!1===Array.isArray(n)&&(n=this.dataSource.filter(((e,t)=>-1===r.indexOf(t)))),this.dataSource.length=0,Array.prototype.push.apply(this.dataSource,n)}get(e,t){const r=this.hot.toPhysicalRow(e);let n=this.dataSource[r];const s=this.hot.runHooks("modifyRowData",r);n=isNaN(s)?s:n;const{dataDotNotation:i}=this.hot.getSettings();let o=null;if(n&&n.hasOwnProperty&&(0,a.hasOwnProperty)(n,t))o=n[t];else if(i&&"string"==typeof t&&t.indexOf(".")>-1){let e=n;if(!e)return null;const r=t.split(".");for(let t=0,n=r.length;t-1){let e,r=i,n=0;const o=t.split(".");for(n=0,e=o.length-1;n=0?this.hot.toPhysicalRow(s):s;for(i=Math.min(e.col,t.col);i<=d&&null!==r;i++)o.push(h.call(this,s,this.colToProp(i)));null!==r&&n.push(o)}return n}getText(e,t){return(0,i.stringify)(this.getRange(e,t,c.DESTINATION_RENDERER))}getCopyableText(e,t){return(0,i.stringify)(this.getRange(e,t,c.DESTINATION_CLIPBOARD_GENERATOR))}destroy(){this.hot=null,this.metaManager=null,this.dataSource=null,this.duckSchema=null,this.colToPropCache.length=0,this.propToColCache.clear(),this.propToColCache=void 0}}t.default=c},61068:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(15724),r(14846),r(69655);var s=n(r(85707)),i=r(25499),o=r(87124),a=r(10587),l=r(22137),h=r(89804);t.default=class{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];(0,s.default)(this,"hot",void 0),(0,s.default)(this,"data",void 0),(0,s.default)(this,"dataType","array"),(0,s.default)(this,"colToProp",(()=>{})),(0,s.default)(this,"propToCol",(()=>{})),this.hot=e,this.data=t}modifyRowData(e){let t;return this.hot.hasHook("modifyRowData")&&(t=this.hot.runHooks("modifyRowData",e)),void 0===t||Number.isInteger(t)?this.data[e]:t}getData(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.data&&0!==this.data.length?this.getByRange(null,null,e):this.data}setData(e){this.data=e}getAtColumn(e){const t=[];return(0,a.arrayEach)(this.data,((r,n)=>{const s=this.getAtCell(n,e);t.push(s)})),t}getAtRow(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const s=void 0===t&&void 0===r,{dataDotNotation:o}=this.hot.getSettings();let a=null,u=null;if(a=this.modifyRowData(e),Array.isArray(a))u=[],s?a.forEach(((t,r)=>{u[r]=this.getAtPhysicalCell(e,r,a)})):(0,l.rangeEach)(t,r,(r=>{u[r-t]=this.getAtPhysicalCell(e,r,a)}));else if((0,i.isObject)(a)||(0,h.isFunction)(a))if(u=n?[]:{},!s||n){const s=0,h=this.countFirstRowKeys()-1;(0,l.rangeEach)(s,h,(l=>{const c=this.colToProp(l);if(l>=(t||s)&&l<=(r||h)&&!Number.isInteger(c)){const t=this.getAtPhysicalCell(e,c,a);n?u.push(t):o?(0,i.setProperty)(u,c,t):u[c]=t}}))}else(0,i.objectEach)(a,((t,r)=>{const n=this.getAtPhysicalCell(e,r,a);o?(0,i.setProperty)(u,r,n):u[r]=n}));return u}setAtCell(e,t,r){if(!(e>=this.countRows()||t>=this.countFirstRowKeys())){if(this.hot.hasHook("modifySourceData")){const n=(0,i.createObjectPropListener)(r);this.hot.runHooks("modifySourceData",e,t,n,"set"),n.isTouched()&&(r=n.value)}Number.isInteger(e)&&(Number.isInteger(t)?this.data[e][t]=r:(0,i.setProperty)(this.data[e],t,r))}}getAtPhysicalCell(e,t,r){let n=null;if(r)if("string"==typeof t){const{dataDotNotation:e}=this.hot.getSettings();n=e?(0,i.getProperty)(r,t):r[t]}else n="function"==typeof t?t(r):r[t];if(this.hot.hasHook("modifySourceData")){const r=(0,i.createObjectPropListener)(n);this.hot.runHooks("modifySourceData",e,t,r,"get"),r.isTouched()&&(n=r.value)}return n}getAtCell(e,t){const r=this.modifyRowData(e);return this.getAtPhysicalCell(e,this.colToProp(t),r)}getByRange(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=!1,s=null,i=null,o=null,a=null;null===e||null===t?(n=!0,s=0,o=this.countRows()-1):(s=Math.min(e.row,t.row),i=Math.min(e.col,t.col),o=Math.max(e.row,t.row),a=Math.max(e.col,t.col));const h=[];return(0,l.rangeEach)(s,o,(e=>{h.push(n?this.getAtRow(e,void 0,void 0,r):this.getAtRow(e,i,a,r))})),h}countRows(){if(this.hot.hasHook("modifySourceLength")){const e=this.hot.runHooks("modifySourceLength");if(Number.isInteger(e))return e}return this.data.length}countFirstRowKeys(){return(0,o.countFirstRowKeys)(this.data)}destroy(){this.data=null,this.hot=null}}},6521:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0;var s=n(r(78747));t.DataMap=s.default;var i=n(r(47746));t.MetaManager=i.default;var o=n(r(954));t.metaSchemaFactory=o.default;var a=r(32465);t.replaceData=a.replaceData;var l=r(59594);t.DynamicCellMetaMod=l.DynamicCellMetaMod;var h=r(13944);t.ExtendMetaPropertiesMod=h.ExtendMetaPropertiesMod},47746:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834),r(14846),r(69655);var s=n(r(98960)),i=n(r(7229)),o=n(r(72653)),a=n(r(66535)),l=n(r(16050)),h=r(25499);class u{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];this.hot=e,this.globalMeta=new s.default(e),this.tableMeta=new i.default(this.globalMeta),this.columnMeta=new o.default(this.globalMeta),this.cellMeta=new a.default(this.columnMeta),r.forEach((e=>new e(this))),this.globalMeta.updateMeta(t)}getGlobalMeta(){return this.globalMeta.getMeta()}updateGlobalMeta(e){this.globalMeta.updateMeta(e)}getTableMeta(){return this.tableMeta.getMeta()}updateTableMeta(e){this.tableMeta.updateMeta(e)}getColumnMeta(e){return this.columnMeta.getMeta(e)}updateColumnMeta(e,t){this.columnMeta.updateMeta(e,t)}getCellMeta(e,t,r){let{visualRow:n,visualColumn:s}=r;const i=this.cellMeta.getMeta(e,t);return i.visualRow=n,i.visualCol=s,i.row=e,i.col=t,this.runLocalHooks("afterGetCellMeta",i),i}getCellMetaKeyValue(e,t,r){if("string"!=typeof r)throw new Error("The passed cell meta object key is not a string");return this.cellMeta.getMeta(e,t,r)}setCellMeta(e,t,r,n){this.cellMeta.setMeta(e,t,r,n)}updateCellMeta(e,t,r){this.cellMeta.updateMeta(e,t,r)}removeCellMeta(e,t,r){this.cellMeta.removeMeta(e,t,r)}getCellsMeta(){return this.cellMeta.getMetas()}getCellsMetaAtRow(e){return this.cellMeta.getMetasAtRow(e)}createRow(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.cellMeta.createRow(e,t)}removeRow(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.cellMeta.removeRow(e,t)}createColumn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.cellMeta.createColumn(e,t),this.columnMeta.createColumn(e,t)}removeColumn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.cellMeta.removeColumn(e,t),this.columnMeta.removeColumn(e,t)}clearCellsCache(){this.cellMeta.clearCache()}clearCache(){this.cellMeta.clearCache(),this.columnMeta.clearCache()}}t.default=u,(0,h.mixin)(u,l.default)},86310:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(15724),r(71336),r(41558),r(17663),r(68630),r(79645),r(89858),r(8620),r(14846),r(27458);var s=n(r(85707)),i=r(62979);class o{constructor(e){(0,s.default)(this,"valueFactory",void 0),(0,s.default)(this,"data",[]),(0,s.default)(this,"index",[]),(0,s.default)(this,"holes",new Set),this.valueFactory=e}obtain(e){(0,i.assert)((()=>(0,i.isUnsignedNumber)(e)),"Expecting an unsigned number.");const t=this._getStorageIndexByKey(e);let r;if(t>=0)r=this.data[t],void 0===r&&(r=this.valueFactory(e),this.data[t]=r);else if(r=this.valueFactory(e),this.holes.size>0){const t=this.holes.values().next().value;this.holes.delete(t),this.data[t]=r,this.index[e]=t}else this.data.push(r),this.index[e]=this.data.length-1;return r}insert(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;(0,i.assert)((()=>(0,i.isUnsignedNumber)(e)||(0,i.isNullish)(e)),"Expecting an unsigned number or null/undefined argument.");const r=[],n=this.data.length;for(let e=0;e1&&void 0!==arguments[1]?arguments[1]:1;(0,i.assert)((()=>(0,i.isUnsignedNumber)(e)||(0,i.isNullish)(e)),"Expecting an unsigned number or null/undefined argument.");const r=this.index.splice((0,i.isNullish)(e)?this.index.length-t:e,t);for(let e=0;evoid 0!==e&&!this.holes.has(t)))[Symbol.iterator]()}entries(){const e=[];for(let t=0;t{if(te?this.index[e]:-1}_getKeyByStorageIndex(e){return this.index.indexOf(e)}[Symbol.iterator](){return this.entries()}}t.default=o},66535:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(15724);var s=n(r(85707)),i=r(25499),o=r(62979),a=n(r(86310)),l=r(70505);t.default=class{constructor(e){(0,s.default)(this,"columnMeta",void 0),(0,s.default)(this,"metas",new a.default((()=>this._createRow()))),this.columnMeta=e}updateMeta(e,t,r){const n=this.getMeta(e,t);(0,i.extend)(n,r),(0,o.extendByMetaType)(n,r)}createRow(e,t){this.metas.insert(e,t)}createColumn(e,t){for(let r=0;r(0,o.isUnsignedNumber)(e)),"Expecting an unsigned number.");const t=new Map(this.metas);return t.has(e)?Array.from(t.get(e).values()):[]}clearCache(){this.metas.clear()}_createRow(){return new a.default((e=>this._createMeta(e)))}_createMeta(e){return new(this.columnMeta.getMetaConstructor(e))}}},72653:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0;var s=n(r(85707)),i=r(25499),o=r(62979),a=n(r(86310));const l=["data","width"];t.default=class{constructor(e){(0,s.default)(this,"globalMeta",void 0),(0,s.default)(this,"metas",new a.default((()=>this._createMeta()))),this.globalMeta=e,this.metas=new a.default((()=>this._createMeta()))}updateMeta(e,t){const r=this.getMeta(e);(0,i.extend)(r,t),(0,o.extendByMetaType)(r,t)}createColumn(e,t){this.metas.insert(e,t)}removeColumn(e,t){this.metas.remove(e,t)}getMeta(e){return this.metas.obtain(e)}getMetaConstructor(e){return this.metas.obtain(e).constructor}clearCache(){this.metas.clear()}_createMeta(){return(0,o.columnFactory)(this.globalMeta.getMetaConstructor(),l).prototype}}},98960:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0;var s=n(r(85707)),i=r(25499),o=r(62979),a=n(r(954));t.default=class{constructor(e){(0,s.default)(this,"metaCtor",class{}),(0,s.default)(this,"meta",void 0),this.meta=this.metaCtor.prototype,(0,i.extend)(this.meta,(0,a.default)()),this.meta.instance=e}getMetaConstructor(){return this.metaCtor}getMeta(){return this.meta}updateMeta(e){var t;(0,i.extend)(this.meta,e),(0,o.extendByMetaType)(this.meta,{...e,type:null!==(t=e.type)&&void 0!==t?t:this.meta.type},e)}}},7229:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0;var s=n(r(85707)),i=r(25499),o=r(62979);t.default=class{constructor(e){(0,s.default)(this,"meta",void 0);const t=e.getMetaConstructor();this.meta=new t}getMeta(){return this.meta}updateMeta(e){(0,i.extend)(this.meta,e),(0,o.extendByMetaType)(this.meta,e,e)}}},954:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(70505),s=r(25499);t.default=()=>({_automaticallyAssignedMetaProps:void 0,activeHeaderClassName:"ht__active_highlight",allowEmpty:!0,allowHtml:!1,allowInsertColumn:!0,allowInsertRow:!0,allowInvalid:!0,allowRemoveColumn:!0,allowRemoveRow:!0,ariaTags:!0,autoColumnSize:void 0,autoRowSize:void 0,autoWrapCol:!1,autoWrapRow:!1,bindRowsWithHeaders:void 0,cell:[],cells:void 0,checkedTemplate:void 0,className:void 0,colHeaders:null,collapsibleColumns:void 0,columnHeaderHeight:void 0,columns:void 0,columnSorting:void 0,columnSummary:void 0,colWidths:void 0,commentedCellClassName:"htCommentCell",comments:!1,contextMenu:void 0,copyable:!0,copyPaste:!0,correctFormat:!1,currentColClassName:void 0,currentHeaderClassName:"ht__highlight",currentRowClassName:void 0,customBorders:!1,data:void 0,dataDotNotation:!0,dataSchema:void 0,dateFormat:"DD/MM/YYYY",timeFormat:"h:mm:ss a",datePickerConfig:void 0,defaultDate:void 0,disableVisualSelection:!1,dragToScroll:!0,dropdownMenu:void 0,editor:void 0,enterBeginsEditing:!0,enterMoves:{col:0,row:1},fillHandle:{autoInsertRow:!1},filter:!0,filteringCaseSensitive:!1,filters:void 0,fixedColumnsLeft:0,fixedColumnsStart:0,fixedRowsBottom:0,fixedRowsTop:0,formulas:void 0,fragmentSelection:!1,headerClassName:void 0,height:void 0,hiddenColumns:void 0,hiddenRows:void 0,invalidCellClassName:"htInvalid",imeFastEdit:!1,isEmptyCol(e){let t,r,s;for(t=0,r=this.countRows();t{"use strict";var n=r(96784);t.__esModule=!0,r(71336),r(41558),r(17663),r(68630),r(79645),r(89858),r(8620);var s=n(r(85707)),i=r(28197),o=r(25499),a=r(89804);t.DynamicCellMetaMod=class{constructor(e){(0,s.default)(this,"metaManager",void 0),(0,s.default)(this,"metaSyncMemo",new Map),this.metaManager=e,e.addLocalHook("afterGetCellMeta",(e=>this.extendCellMeta(e))),i.Hooks.getSingleton().add("beforeRender",(e=>{e&&this.metaSyncMemo.clear()}),this.metaManager.hot)}extendCellMeta(e){var t;const{row:r,col:n}=e;if(null!==(t=this.metaSyncMemo.get(r))&&void 0!==t&&t.has(n))return;const{visualRow:s,visualCol:i}=e,l=this.metaManager.hot,h=l.colToProp(i);e.prop=h,l.runHooks("beforeGetCellMeta",s,i,e);const u=(0,o.hasOwnProperty)(e,"type")?e.type:null;let c=(0,a.isFunction)(e.cells)?e.cells(r,n,h):null;var d;u&&(c?c.type=null!==(d=c.type)&&void 0!==d?d:u:c={type:u});c&&this.metaManager.updateCellMeta(r,n,c),l.runHooks("afterGetCellMeta",s,i,e),this.metaSyncMemo.has(r)||this.metaSyncMemo.set(r,new Set),this.metaSyncMemo.get(r).add(n)}}},13944:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834),r(15724),r(71336),r(41558),r(17663),r(68630),r(79645),r(89858),r(8620),r(14846),r(69655);var s=n(r(85707));function i(e,t,r){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}function o(e,t){return e.get(function(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}(e,t))}var a=new WeakMap;t.ExtendMetaPropertiesMod=class{constructor(e){(0,s.default)(this,"metaManager",void 0),(0,s.default)(this,"usageTracker",new Set),(0,s.default)(this,"propDescriptors",new Map([["ariaTags",{initOnly:!0}],["fixedColumnsLeft",{target:"fixedColumnsStart",onChange(e){if(this.metaManager.hot.isRtl()&&"fixedColumnsLeft"===e)throw new Error("The `fixedColumnsLeft` is not supported for RTL. Please use option `fixedColumnsStart`.");if(this.usageTracker.has("fixedColumnsLeft")&&this.usageTracker.has("fixedColumnsStart"))throw new Error("The `fixedColumnsLeft` and `fixedColumnsStart` should not be used together. Please use only the option `fixedColumnsStart`.")}}],["layoutDirection",{initOnly:!0}],["renderAllColumns",{initOnly:!0}],["renderAllRows",{initOnly:!0}]])),i(this,a,((e,t,r)=>{if(!r)throw new Error(`The \`${e}\` option can not be updated after the Handsontable is initialized.`)})),this.metaManager=e,this.extendMetaProps()}extendMetaProps(){this.propDescriptors.forEach(((e,t)=>{const{initOnly:r,target:n,onChange:s}=e,i="string"==typeof n,l=i?n:t,h=`_${l}`;this.metaManager.globalMeta.meta[h]=this.metaManager.globalMeta.meta[l],s?(this.installPropWatcher(t,h,s),i&&this.installPropWatcher(n,h,s)):r&&(this.installPropWatcher(t,h,o(a,this)),this.metaManager.globalMeta.meta._initOnlySettings||(this.metaManager.globalMeta.meta._initOnlySettings=[]),this.metaManager.globalMeta.meta._initOnlySettings.push(t))}))}installPropWatcher(e,t,r){const n=this;Object.defineProperty(this.metaManager.globalMeta.meta,e,{get(){return this[t]},set(s){const i=!n.usageTracker.has(e);n.usageTracker.add(e),r.call(n,e,s,i),this[t]=s},enumerable:!0,configurable:!0})}}},62979:(e,t,r)=>{"use strict";t.__esModule=!0,t.assert=function(e,t){if(!e())throw new Error(`Assertion failed: ${t}`)},t.columnFactory=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];function r(){}(0,n.inherit)(r,e);for(let e=0;e2&&void 0!==arguments[2]?arguments[2]:e;const i="string"==typeof t.type?(0,s.getCellType)(t.type):t.type;e._automaticallyAssignedMetaProps&&(0,n.objectEach)(t,((t,r)=>{e._automaticallyAssignedMetaProps.delete(r)}));if(!(0,n.isObject)(i))return;r!==e||e._automaticallyAssignedMetaProps||(e._automaticallyAssignedMetaProps=new Set);const o={};(0,n.objectEach)(i,((t,s)=>{var i;(function(e,t){var r;if("CELL_TYPE"===e)return!1;return(null===(r=t._automaticallyAssignedMetaProps)||void 0===r?void 0:r.has(e))||!(0,n.hasOwnProperty)(t,e)})(s,r)&&(o[s]=t,null===(i=e._automaticallyAssignedMetaProps)||void 0===i||i.add(s))})),(0,n.extend)(e,o)},t.isNullish=function(e){return null==e},t.isUnsignedNumber=function(e){return Number.isInteger(e)&&e>=0},r(67834),r(71336),r(41558),r(17663),r(68630),r(79645),r(89858),r(8620);var n=r(25499),s=r(1791)},32465:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,t.replaceData=function(e,t,r,n){const{hotInstance:u,dataMap:c,dataSource:d,internalSource:p,source:g,metaManager:f,firstRun:m}=n,y=(0,s.toUpperCaseFirst)(p),E=u.getSettings();Array.isArray(E.dataSchema)?u.dataType="array":(0,i.isFunction)(E.dataSchema)?u.dataType="function":u.dataType="object";c&&c.destroy();e=u.runHooks(`before${y}`,e,m,g);const w=new o.default(u,e,f);if(t(w),"object"==typeof e&&null!==e)e.push&&e.splice||(e=[e]);else{if(null!==e)throw new Error(`${p} only accepts array of objects or array of arrays (${typeof e} given)`);{const t=w.getSchema();let r;e=[];let n=0,s=0;for(n=0,s=E.startRows;n{"use strict";var n=r(96784);t.__esModule=!0,r(67834);var s=n(r(85707)),i=r(83445),o=r(77661),a=r(8266),l=n(r(3849));function h(e,t){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.add(e)}function u(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var c=new WeakSet;class d{constructor(e,t,r){h(this,c),(0,s.default)(this,"hot",void 0),(0,s.default)(this,"tableMeta",void 0),(0,s.default)(this,"selection",void 0),(0,s.default)(this,"eventManager",void 0),(0,s.default)(this,"destroyed",!1),(0,s.default)(this,"activeEditor",void 0),(0,s.default)(this,"cellProperties",void 0),this.hot=e,this.tableMeta=t,this.selection=r,this.eventManager=new l.default(e),this.hot.addHook("afterDocumentKeyDown",(e=>u(c,this,p).call(this,e))),this.eventManager.addEventListener(this.hot.rootDocument.documentElement,"compositionstart",(e=>{!this.destroyed&&this.hot.isListening()&&this.openEditor("",e)})),this.hot.view._wt.update("onCellDblClick",((e,t,r)=>u(c,this,g).call(this,e,t,r)))}getActiveEditor(){return this.activeEditor}prepareEditor(){var e;if(this.activeEditor&&this.activeEditor.isWaiting())return void this.closeEditor(!1,!1,(e=>{e&&this.prepareEditor()}));const t=null===(e=this.hot.getSelectedRangeLast())||void 0===e?void 0:e.highlight;if(!t||t.isHeader())return;const{row:r,col:n}=t,s=this.hot.runHooks("modifyGetCellCoords",r,n,!1,"meta");let i=r,o=n;if(Array.isArray(s)&&([i,o]=s),this.cellProperties=this.hot.getCellMeta(i,o),!this.isCellEditable())return void this.clearActiveEditor();const l=this.hot.getCell(r,n,!0);if(l){const e=this.hot.getCellEditor(this.cellProperties),t=this.hot.colToProp(o),s=this.hot.getSourceDataAtCell(this.hot.toPhysicalRow(i),o);this.activeEditor=(0,a.getEditorInstance)(e,this.hot),this.activeEditor.prepare(r,n,t,l,s,this.cellProperties)}}isEditorOpened(){return this.activeEditor&&this.activeEditor.isOpened()}openEditor(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!this.isCellEditable())return void this.clearActiveEditor();const n=this.hot.getSelectedRangeLast();let s=this.hot.runHooks("beforeBeginEditing",n.highlight.row,n.highlight.col,e,t,r);t instanceof MouseEvent&&"boolean"!=typeof s&&(s=0===this.hot.selection.getLayerLevel()&&n.isSingle()),!1!==s?(this.activeEditor||(this.hot.scrollToFocusedCell(),this.prepareEditor()),this.activeEditor&&(r&&this.activeEditor.enableFullEditMode(),this.activeEditor.beginEditing(e,t))):this.clearActiveEditor()}closeEditor(e,t,r){this.activeEditor?this.activeEditor.finishEditing(e,t,r):r&&r(!1)}closeEditorAndSaveChanges(e){this.closeEditor(!1,e)}closeEditorAndRestoreOriginalValue(e){this.closeEditor(!0,e)}clearActiveEditor(){this.activeEditor=void 0}isCellEditable(){const e=this.hot.getSelectedRangeLast();if(!e)return!1;const t=this.hot.getCellEditor(this.cellProperties),{row:r,col:n}=e.highlight,{rowIndexMapper:s,columnIndexMapper:i}=this.hot,o=s.isHidden(this.hot.toPhysicalRow(r))||i.isHidden(this.hot.toPhysicalColumn(n));return!(this.cellProperties.readOnly||!t||o)}moveSelectionAfterEnter(e){const t={..."function"==typeof this.tableMeta.enterMoves?this.tableMeta.enterMoves(e):this.tableMeta.enterMoves};e.shiftKey&&(t.row=-t.row,t.col=-t.col),this.hot.selection.isMultiple()?this.selection.transformFocus(t.row,t.col):this.selection.transformStart(t.row,t.col,!0)}destroy(){this.destroyed=!0,this.eventManager.destroy()}}function p(e){const t=this.hot.getSelectedRangeLast();if(!this.hot.isListening()||!t||t.highlight.isHeader()||(0,o.isImmediatePropagationStopped)(e))return;const{keyCode:r}=e,n=(e.ctrlKey||e.metaKey)&&!e.altKey;(!this.activeEditor||this.activeEditor&&!this.activeEditor.isWaiting())&&((0,i.isFunctionKey)(r)||(0,i.isCtrlMetaKey)(r)||n||this.isEditorOpened()||this.openEditor("",e))}function g(e,t){t.isCell()&&this.openEditor(null,e,!0)}const f=new WeakMap;d.getInstance=function(e,t,r){let n=f.get(e);return n||(n=new d(e,t,r),f.set(e,n)),n};t.default=d},28474:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834),r(15724),r(14846),r(27458),r(6211),r(90458);var s=n(r(85707)),i=r(82518),o=r(10587),a=r(62577),l=r(70505),h=r(5893),u=r(83445),c=r(85096),d=r(71120);function p(e,t,r){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}function g(e,t){return e.get(function(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}(e,t))}const f=t.EDITOR_TYPE="autocomplete";var m=new WeakMap;class y extends i.HandsontableEditor{constructor(){super(...arguments),(0,s.default)(this,"query",null),(0,s.default)(this,"strippedChoices",[]),(0,s.default)(this,"rawChoices",[]),p(this,m,this.hot.guid.slice(0,9)),(0,s.default)(this,"sortByRelevance",(function(e,t,r){const n=[],s=[],i=e.length;let o,a,u,c,d=t.length;if(0===i){for(u=0;u{if(-1===t.index)return-1;if(-1===e.index)return 1;if(e.indext.charsLeft)return 1}return 0})),u=0,d=n.length;uthis.stripValueIfNeeded(e)===this.TEXTAREA.value));return(0,l.isDefined)(e)?e:this.TEXTAREA.value}createElements(){super.createElements(),(0,a.addClass)(this.htContainer,"autocompleteEditor"),(0,a.addClass)(this.htContainer,-1===this.hot.rootWindow.navigator.platform.indexOf("Mac")?"":"htMacScroll"),this.hot.getSettings().ariaTags&&(0,a.setAttribute)(this.TEXTAREA,[(0,d.A11Y_TEXT)(),(0,d.A11Y_COMBOBOX)(),(0,d.A11Y_HASPOPUP)("listbox"),(0,d.A11Y_AUTOCOMPLETE)()])}prepare(e,t,r,n,s,i){super.prepare(e,t,r,n,s,i),this.hot.getSettings().ariaTags&&(0,a.setAttribute)(this.TEXTAREA,[(0,d.A11Y_EXPANDED)("false"),(0,d.A11Y_CONTROLS)(`${g(m,this)}-listbox-${e}-${t}`)])}open(){super.open();const e=void 0===this.cellProperties.trimDropdown||this.cellProperties.trimDropdown,t=this.hot.getSettings().ariaTags,r=Array.isArray(this.cellProperties.source)?this.cellProperties.source:null,n=null==r?void 0:r.length,{row:s,col:i}=this;this.showEditableElement(),this.focus(),this.addHook("beforeKeyDown",(e=>this.onBeforeKeyDown(e))),this.htEditor.updateSettings({colWidths:e?[(0,a.outerWidth)(this.TEXTAREA)-2]:void 0,autoColumnSize:!0,autoRowSize:!0,renderer:(e,s,i,o,h,u,p)=>{(0,c.textRenderer)(e,s,i,o,h,u,p);const{filteringCaseSensitive:g,allowHtml:f,locale:m}=this.cellProperties,y=this.query;let E,w,C=(0,l.stringify)(u);C&&!f&&(E=!0===g?C.indexOf(y):C.toLocaleLowerCase(m).indexOf(y.toLocaleLowerCase(m)),-1!==E&&(w=C.substr(E,y.length),C=C.replace(w,`${w}`))),t&&(0,a.setAttribute)(s,[(0,d.A11Y_OPTION)(),...r?[(0,d.A11Y_SETSIZE)(n)]:[],...r?[(0,d.A11Y_POSINSET)(r.indexOf(u)+1)]:[],["id",`${this.htEditor.rootElement.id}_${i}-${o}`]]),s.innerHTML=C},afterSelectionEnd:(e,r)=>{if(t){const t=this.htEditor.getCell(e,r,!0);(0,a.setAttribute)(t,[(0,d.A11Y_SELECTED)()]),(0,a.setAttribute)(this.TEXTAREA,...(0,d.A11Y_ACTIVEDESCENDANT)(t.id))}}}),t&&((0,a.setAttribute)(this.htEditor.view._wt.wtOverlays.wtTable.TABLE,...(0,d.A11Y_PRESENTATION)()),(0,a.setAttribute)(this.htEditor.rootElement,[(0,d.A11Y_LISTBOX)(),(0,d.A11Y_LIVE)("polite"),(0,d.A11Y_RELEVANT)("text"),["id",`${g(m,this)}-listbox-${s}-${i}`]]),(0,a.setAttribute)(this.TEXTAREA,...(0,d.A11Y_EXPANDED)("true"))),this.hot._registerTimeout((()=>{this.queryChoices(this.TEXTAREA.value)}))}close(){this.removeHooksByKey("beforeKeyDown"),super.close(),this.hot.getSettings().ariaTags&&(0,a.setAttribute)(this.TEXTAREA,[(0,d.A11Y_EXPANDED)("false")])}discardEditor(e){super.discardEditor(e),this.hot.view.render()}queryChoices(e){const t=this.cellProperties.source;this.query=e,"function"==typeof t?t.call(this.cellProperties,e,(e=>{this.rawChoices=e,this.updateChoicesList(this.stripValuesIfNeeded(e))})):Array.isArray(t)?(this.rawChoices=t,this.updateChoicesList(this.stripValuesIfNeeded(t))):this.updateChoicesList([])}updateChoicesList(e){const t=(0,a.getCaretPosition)(this.TEXTAREA),r=(0,a.getSelectionEndPosition)(this.TEXTAREA),n=this.cellProperties.sortByRelevance,s=this.cellProperties.filter;let i=null,l=null,h=e;n&&(i=this.sortByRelevance(this.stripValueIfNeeded(this.getValue()),h,this.cellProperties.filteringCaseSensitive));const u=Array.isArray(i)?i.length:0;if(!1===s)l=u>0?i[0]:0;else{const e=[];for(let t=0,r=h.length;t0&&(this.updateDropdownDimensions(),this.flipDropdownIfNeeded(),!0===this.cellProperties.strict&&this.highlightBestMatchingChoice(l)),this.hot.listen(),(0,a.setCaretPosition)(this.TEXTAREA,t,t===r?void 0:r)}flipDropdownIfNeeded(){const e=(0,a.getTrimmingContainer)(this.hot.view._wt.wtTable.TABLE),t=e===this.hot.rootWindow,r=this.cellProperties.preventOverflow;if(t||!t&&(r||"horizontal"===r))return!1;const n=(0,a.offset)(this.TEXTAREA),s=(0,a.outerHeight)(this.TEXTAREA),i=this.getHeight(),o=e.scrollTop,l=(0,a.outerHeight)(this.hot.view._wt.wtTable.THEAD),h=(0,a.offset)(e),u=n.top-h.top-l+o,c=e.scrollHeight-u-l-s,d=i>c&&u>c;return d?this.flipDropdown(i):this.unflipDropdown(),this.limitDropdownIfNeeded(d?u:c,i),d}limitDropdownIfNeeded(e,t){if(t>e){let r=0,n=0,s=0,i=null;do{s=this.htEditor.getRowHeight(n)||this.htEditor.view.getDefaultRowHeight(),r+=s,n+=1}while(rt)).reduce(((e,t)=>e+this.htEditor.getRowHeight(t)),0)+t+1}getWidth(){const e=this.hot.rootWindow.getComputedStyle(this.htContainer.querySelector(".htCore")),t=parseInt(e.borderInlineStartWidth,10)+parseInt(e.borderInlineEndWidth,10);return this.htEditor.getColWidth(0)+t}stripValueIfNeeded(e){return this.stripValuesIfNeeded([e])[0]}stripValuesIfNeeded(e){const{allowHtml:t}=this.cellProperties,r=(0,o.arrayMap)(e,(e=>(0,l.stringify)(e)));return(0,o.arrayMap)(r,(e=>t?e:(0,h.stripTags)(e)))}allowKeyEventPropagation(e){const t=this.htEditor.getSelectedRangeLast(),r=t?t.from.row:-1;let n=!1;return e===u.KEY_CODES.ARROW_DOWN&&r>0&&r-1&&(n=!0),n}onBeforeKeyDown(e){if((0,u.isPrintableChar)(e.keyCode)||e.keyCode===u.KEY_CODES.BACKSPACE||e.keyCode===u.KEY_CODES.DELETE||e.keyCode===u.KEY_CODES.INSERT){let t=10;if(e.keyCode===u.KEY_CODES.C&&(e.ctrlKey||e.metaKey))return;this.isOpened()||(t+=10),this.htEditor&&this.hot._registerTimeout((()=>{this.queryChoices(this.TEXTAREA.value)}),t)}}}t.AutocompleteEditor=y},10463:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(28474);t.EDITOR_TYPE=n.EDITOR_TYPE,t.AutocompleteEditor=n.AutocompleteEditor},60448:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834);var s=n(r(85707)),i=r(70505),o=r(25499),a=n(r(70292)),l=r(62577);const h=t.EDITOR_TYPE="base",u=t.EDITOR_STATE=Object.freeze({VIRGIN:"STATE_VIRGIN",EDITING:"STATE_EDITING",WAITING:"STATE_WAITING",FINISHED:"STATE_FINISHED"});class c{static get EDITOR_TYPE(){return h}constructor(e){(0,s.default)(this,"hot",void 0),(0,s.default)(this,"state",u.VIRGIN),(0,s.default)(this,"_opened",!1),(0,s.default)(this,"_fullEditMode",!1),(0,s.default)(this,"_closeCallback",null),(0,s.default)(this,"TD",null),(0,s.default)(this,"row",null),(0,s.default)(this,"col",null),(0,s.default)(this,"prop",null),(0,s.default)(this,"originalValue",null),(0,s.default)(this,"cellProperties",null),this.hot=e,this.init()}_fireCallbacks(e){this._closeCallback&&(this._closeCallback(e),this._closeCallback=null)}init(){}getValue(){throw Error("Editor getValue() method unimplemented")}setValue(){throw Error("Editor setValue() method unimplemented")}open(){throw Error("Editor open() method unimplemented")}close(){throw Error("Editor close() method unimplemented")}prepare(e,t,r,n,s,i){this.TD=n,this.row=e,this.col=t,this.prop=r,this.originalValue=s,this.cellProperties=i,this.state=this.isOpened()?this.state:u.VIRGIN}extend(){return class extends this.constructor{}}saveValue(e,t){let r,n,s,i;if(t){const e=this.hot.getSelectedLast();r=Math.max(Math.min(e[0],e[2]),0),n=Math.max(Math.min(e[1],e[3]),0),s=Math.max(e[0],e[2]),i=Math.max(e[1],e[3])}else[r,n,s,i]=[this.row,this.col,null,null];const o=this.hot.runHooks("modifyGetCellCoords",r,n,!1,"meta");Array.isArray(o)&&([r,n]=o),this.hot.populateFromArray(r,n,e,s,i,"edit")}beginEditing(e,t){if(this.state!==u.VIRGIN)return;const r=this.hot,n=r.rowIndexMapper.getRenderableFromVisualIndex(this.row),s=r.columnIndexMapper.getRenderableFromVisualIndex(this.col),o=()=>{if(this.state=u.EDITING,this.isInFullEditMode()){const t="string"==typeof e?e:(0,i.stringify)(this.originalValue);this.setValue(t)}this.open(t),this._opened=!0,this.focus(),r.view.render(),r.runHooks("afterBeginEditing",this.row,this.col)};this.hot.addHookOnce("afterScroll",o);r.view.scrollViewport(r._createCellCoords(n,s))||(this.hot.removeHook("afterScroll",o),o())}finishEditing(e,t,r){let n;if(r){const e=this._closeCallback;this._closeCallback=t=>{e&&e(t),r(t),this.hot.view.render()}}if(!this.isWaiting())if(this.state!==u.VIRGIN){if(this.state===u.EDITING){if(e)return this.cancelChanges(),void this.hot.view.render();const r=this.getValue();n=this.cellProperties.trimWhitespace?[["string"==typeof r?String.prototype.trim.call(r||""):r]]:[[r]],this.state=u.WAITING,this.saveValue(n,t),this.hot.getCellValidator(this.cellProperties)?this.hot.addHookOnce("postAfterValidate",(e=>{this.state=u.FINISHED,this.discardEditor(e)})):(this.state=u.FINISHED,this.discardEditor(!0))}}else this.hot._registerTimeout((()=>{this._fireCallbacks(!0)}))}cancelChanges(){this.state=u.FINISHED,this.discardEditor()}discardEditor(e){if(this.state===u.FINISHED)if(!1===e&&!0!==this.cellProperties.allowInvalid)this.hot.selectCell(this.row,this.col),this.focus(),this.state=u.EDITING,this._fireCallbacks(!1);else{this.close(),this._opened=!1,this._fullEditMode=!1,this.state=u.VIRGIN,this._fireCallbacks(!0);this.hot.getShortcutManager().setActiveContextName("grid")}}enableFullEditMode(){this._fullEditMode=!0}isInFullEditMode(){return this._fullEditMode}isOpened(){return this._opened}isWaiting(){return this.state===u.WAITING}getEditedCellRect(){var e;const t=this.getEditedCell();if(!t)return;const{wtOverlays:r,wtViewport:n}=this.hot.view._wt,s=this.hot.rootWindow,i=(0,l.offset)(t),o=(0,l.outerWidth)(t),a=(0,l.offset)(this.hot.rootElement),h=(0,l.outerWidth)(this.hot.rootElement),u=r.topOverlay.holder,c=r.inlineStartOverlay.holder,d=u!==s?u.scrollTop:0,p=c!==s?c.scrollLeft:0,g=s.innerWidth-a.left-h,{wtTable:f}=null!==(e=r.getParentOverlay(t))&&void 0!==e?e:this.hot.view._wt,m=f.name,y=["master","inline_start"].includes(m)?d:0,E=["master","top","bottom"].includes(m)?p:0,w=i.top===a.top?0:1;let C=i.top-a.top-w-y,v=0;v=this.hot.isRtl()?s.innerWidth-i.left-o-g-1+E:i.left-a.left-1-E,["top","top_inline_start_corner"].includes(m)&&(C+=r.topOverlay.getOverlayOffset()),["inline_start","top_inline_start_corner"].includes(m)&&(v+=Math.abs(r.inlineStartOverlay.getOverlayOffset()));const R=this.hot.hasColHeaders(),S=this.hot.rowIndexMapper.getRenderableFromVisualIndex(this.row),T=this.hot.columnIndexMapper.getRenderableFromVisualIndex(this.col),N=this.hot.rowIndexMapper.getRenderableIndexesLength()-this.hot.view._wt.getSetting("fixedRowsBottom");(R&&S<=0||S===N)&&(C+=1),T<=0&&(v+=1);const M=n.rowsRenderCalculator.startPosition,_=n.columnsRenderCalculator.startPosition,b=Math.abs(r.inlineStartOverlay.getScrollPosition()),O=r.topOverlay.getScrollPosition(),A=(0,l.getScrollbarWidth)(this.hot.rootDocument);let I=t.offsetTop;if(["inline_start","master"].includes(m)&&(I+=M-O),["bottom","bottom_inline_start_corner"].includes(m)){const{wtViewport:e,wtTable:t}=r.bottomOverlay.clone;I+=e.getWorkspaceHeight()-t.getHeight()-A}let x=t.offsetLeft;this.hot.isRtl()?(x=x>=0?f.getWidth()-t.offsetLeft:Math.abs(x),x+=_-b-o):["top","master","bottom"].includes(m)&&(x+=_-b);const P=s.getComputedStyle(this.TD),L=this.hot.isRtl()?"borderRightWidth":"borderLeftWidth",D=parseInt(P[L],10)>0?0:1,k=parseInt(P.borderTopWidth,10)>0?0:1,H=(0,l.outerWidth)(t)+D,F=(0,l.outerHeight)(t)+k,U=(0,l.hasVerticalScrollbar)(u)?A:0,V=(0,l.hasHorizontalScrollbar)(c)?A:0,B=this.hot.view.maximumVisibleElementWidth(x)-U+D;return{top:C,start:v,height:F,maxHeight:Math.max(this.hot.view.maximumVisibleElementHeight(I)-V+k,this.hot.view.getDefaultRowHeight()),width:H,maxWidth:B}}getEditedCellsLayerClass(){switch(this.checkEditorSection()){case"inline-start":return"ht_clone_left ht_clone_inline_start";case"bottom":return"ht_clone_bottom";case"bottom-inline-start-corner":return"ht_clone_bottom_left_corner ht_clone_bottom_inline_start_corner";case"top":return"ht_clone_top";case"top-inline-start-corner":return"ht_clone_top_left_corner ht_clone_top_inline_start_corner";default:return"ht_clone_master"}}getEditedCell(){return this.hot.getCell(this.row,this.col,!0)}checkEditorSection(){const e=this.hot.countRows();let t="";return this.row=e-this.hot.getSettings().fixedRowsBottom?t=this.col{"use strict";t.__esModule=!0;var n=r(60448);t.EDITOR_STATE=n.EDITOR_STATE,t.EDITOR_TYPE=n.EDITOR_TYPE,t.BaseEditor=n.BaseEditor},11476:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(74854),s=r(62577);const i=t.EDITOR_TYPE="checkbox";class o extends n.BaseEditor{static get EDITOR_TYPE(){return i}beginEditing(e,t){if(t&&"mouseup"===t.type&&"TD"===t.target.nodeName){const e=this.TD.querySelector('input[type="checkbox"]');(0,s.hasClass)(e,"htBadValue")||e.click()}}finishEditing(){}init(){}open(){}close(){}getValue(){}setValue(){}focus(){}}t.CheckboxEditor=o},12302:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(11476);t.EDITOR_TYPE=n.EDITOR_TYPE,t.CheckboxEditor=n.CheckboxEditor},28150:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834);var s=n(r(85707)),i=n(r(6671)),o=n(r(44499)),a=r(74854),l=r(66420),h=r(62577),u=r(25499),c=r(83445),d=r(25046);const p=t.EDITOR_TYPE="date",g="dateEditor";class f extends l.TextEditor{constructor(){super(...arguments),(0,s.default)(this,"defaultDateFormat","DD/MM/YYYY"),(0,s.default)(this,"parentDestroyed",!1),(0,s.default)(this,"$datePicker",null)}static get EDITOR_TYPE(){return p}init(){if("function"!=typeof i.default)throw new Error("You need to include moment.js to your project.");if("function"!=typeof o.default)throw new Error("You need to include Pikaday to your project.");super.init(),this.hot.addHook("afterDestroy",(()=>{this.parentDestroyed=!0,this.destroyElements()})),this.hot.addHook("afterSetTheme",((e,t)=>{t||((0,h.removeClass)(this.datePicker,/ht-theme-.*/g),(0,h.addClass)(this.datePicker,e))}))}createElements(){super.createElements(),this.datePicker=this.hot.rootDocument.createElement("DIV"),this.datePickerStyle=this.datePicker.style,this.datePickerStyle.position="absolute",this.datePickerStyle.top=0,this.datePickerStyle.left=0,this.datePickerStyle.zIndex=9999,this.datePicker.setAttribute("dir",this.hot.isRtl()?"rtl":"ltr"),(0,h.addClass)(this.datePicker,"htDatepickerHolder");const e=this.hot.getCurrentThemeName();(0,h.removeClass)(this.datePicker,/ht-theme-.*/g),(0,h.addClass)(this.datePicker,e),this.hot.rootDocument.body.appendChild(this.datePicker),this.eventManager.addEventListener(this.datePicker,"mousedown",(e=>{(0,h.hasClass)(e.target,"pika-day")&&this.hideDatepicker(),e.stopPropagation()}))}destroyElements(){const e=this.datePicker.parentNode;this.$datePicker&&this.$datePicker.destroy(),e&&e.removeChild(this.datePicker)}prepare(e,t,r,n,s,i){super.prepare(e,t,r,n,s,i)}open(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;const t=this.hot.getShortcutManager().getContext("editor");this.showDatepicker(e),super.open(),t.addShortcuts([{keys:[["ArrowLeft"]],callback:()=>{this.$datePicker.adjustDate("subtract",1)}},{keys:[["ArrowRight"]],callback:()=>{this.$datePicker.adjustDate("add",1)}},{keys:[["ArrowUp"]],callback:()=>{this.$datePicker.adjustDate("subtract",7)}},{keys:[["ArrowDown"]],callback:()=>{this.$datePicker.adjustDate("add",7)}}],{group:g})}close(){var e;this._opened=!1,null!==(e=this.$datePicker)&&void 0!==e&&e.destroy&&this.$datePicker.destroy(),this.hot._registerTimeout((()=>{const e=this.hot._getEditorManager();e.closeEditor(),this.hot.view.render(),e.prepareEditor()}));this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(g),super.close()}finishEditing(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];super.finishEditing(e,t)}showDatepicker(e){const t=this.cellProperties.dateFormat||this.defaultDateFormat,r=this.hot.view.isMouseDown(),n=!!e&&(0,c.isFunctionKey)(e.keyCode);let s;this.datePicker.style.display="block",this.$datePicker=new o.default(this.getDatePickerConfig()),"function"==typeof this.$datePicker.useMoment&&this.$datePicker.useMoment(i.default),this.$datePicker._onInputFocus=function(){},this.originalValue?(s=this.originalValue,(0,i.default)(s,t,!0).isValid()&&this.$datePicker.setMoment((0,i.default)(s,t),!0),this.getValue()!==this.originalValue&&this.setValue(this.originalValue),n||r||this.setValue("")):this.cellProperties.defaultDate?(s=this.cellProperties.defaultDate,(0,i.default)(s,t,!0).isValid()&&this.$datePicker.setMoment((0,i.default)(s,t),!0),n||r||this.setValue("")):this.$datePicker.gotoToday()}hideDatepicker(){this.datePickerStyle.display="none",this.$datePicker.hide()}getDatePickerConfig(){const e=this.TEXTAREA,t={};this.cellProperties&&this.cellProperties.datePickerConfig&&(0,u.deepExtend)(t,this.cellProperties.datePickerConfig);const r=t.onSelect,n=t.onClose;return t.field=e,t.trigger=e,t.container=this.datePicker,t.bound=!1,t.keyboardInput=!1,t.format=t.format||this.defaultDateFormat,t.reposition=t.reposition||!1,t.isRTL=!1,t.onSelect=e=>{let t=e;isNaN(t.getTime())||(t=(0,i.default)(t).format(this.cellProperties.dateFormat||this.defaultDateFormat)),this.setValue(t),r&&r(),(0,d.isMobileBrowser)()&&this.hideDatepicker()},t.onClose=()=>{this.parentDestroyed||this.finishEditing(!1),n&&n()},t}refreshDimensions(e){var t;if(super.refreshDimensions(e),this.state!==a.EDITOR_STATE.EDITING)return;if(this.TD=this.getEditedCell(),!this.TD)return void this.hideDatepicker();const{rowIndexMapper:r,columnIndexMapper:n}=this.hot,{wtOverlays:s}=this.hot.view._wt,{wtTable:i}=null!==(t=s.getParentOverlay(this.TD))&&void 0!==t?t:this.hot.view._wt,o=r.getVisualFromRenderableIndex(i.getFirstPartiallyVisibleRow()),l=r.getVisualFromRenderableIndex(i.getLastPartiallyVisibleRow()),u=n.getVisualFromRenderableIndex(i.getFirstPartiallyVisibleColumn()),c=n.getVisualFromRenderableIndex(i.getLastPartiallyVisibleColumn());if(this.row>=o&&this.row<=l&&this.col>=u&&this.col<=c){const e=this.TD.getBoundingClientRect();this.datePickerStyle.top=`${this.hot.rootWindow.pageYOffset+e.top+(0,h.outerHeight)(this.TD)}px`;let t=this.hot.rootWindow.pageXOffset;this.hot.isRtl()?t+=e.right-(0,h.outerWidth)(this.datePicker):t+=e.left,this.datePickerStyle.left=`${t}px`}else this.hideDatepicker()}}t.DateEditor=f},16339:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(28150);t.EDITOR_TYPE=n.EDITOR_TYPE,t.DateEditor=n.DateEditor},97328:(e,t,r)=>{"use strict";t.__esModule=!0,r(14846),r(27458);var n=r(10463);const s=t.EDITOR_TYPE="dropdown";class i extends n.AutocompleteEditor{static get EDITOR_TYPE(){return s}prepare(e,t,r,n,s,i){i.filter=!1,i.strict=!0,super.prepare(e,t,r,n,s,i)}}t.DropdownEditor=i},51034:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(97328);t.EDITOR_TYPE=n.EDITOR_TYPE,t.DropdownEditor=n.DropdownEditor},37300:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(66420),s=r(62577),i=r(77661),o=r(25499),a=r(92399);const l="handsontableEditor",h=t.EDITOR_TYPE="handsontable";class u extends n.TextEditor{static get EDITOR_TYPE(){return h}open(){super.open();const e=this.htContainer.style;this.htEditor&&(this.htEditor.destroy(),e.width="",e.height="",e.overflow=""),"none"===e.display&&(e.display=""),this.htEditor=new this.hot.constructor(this.htContainer,this.htOptions),this.htEditor.init(),this.htEditor.rootElement.style.display="",this.cellProperties.strict?this.htEditor.selectCell(0,0):this.htEditor.deselectCell(),(0,s.setCaretPosition)(this.TEXTAREA,0,this.TEXTAREA.value.length),this.htEditor.updateSettings({width:this.getWidth(),height:this.getHeight()}),this.refreshDimensions()}close(){this.htEditor&&(this.htEditor.rootElement.style.display="none"),this.removeHooksByKey("beforeKeyDown"),super.close()}prepare(e,t,r,n,s,i){super.prepare(e,t,r,n,s,i);const a=this,l={startRows:0,startCols:0,minRows:0,minCols:0,className:"listbox",copyPaste:!1,autoColumnSize:!1,autoRowSize:!1,readOnly:!0,fillHandle:!1,autoWrapCol:!1,autoWrapRow:!1,ariaTags:!1,themeName:this.hot.getCurrentThemeName(),afterOnCellMouseDown(e,t){const r=this.getSourceData(t.row,t.col);void 0!==r&&a.setValue(r),a.hot.destroyEditor()},preventWheel:!0,layoutDirection:this.hot.isRtl()?"rtl":"ltr"};this.cellProperties.handsontable&&(0,o.extend)(l,i.handsontable),this.htOptions=l}beginEditing(e,t){const r=this.hot.getSettings().onBeginEditing;r&&!1===r()||super.beginEditing(e,t)}createElements(){super.createElements();const e=this.hot.rootDocument.createElement("DIV");e.className="handsontableEditor",this.TEXTAREA_PARENT.appendChild(e),this.htContainer=e,this.assignHooks()}finishEditing(e,t,r){if(this.htEditor&&this.htEditor.isListening()&&this.hot.listen(),this.htEditor&&this.htEditor.getSelectedLast()){const e=this.htEditor.getValue();void 0!==e&&this.setValue(e)}super.finishEditing(e,t,r)}getHeight(){return this.htEditor.view.getTableHeight()+1}getWidth(){return this.htEditor.view.getTableWidth()}assignHooks(){this.hot.addHook("afterDestroy",(()=>{var e;null===(e=this.htEditor)||void 0===e||e.destroy()})),this.hot.addHook("afterSetTheme",((e,t)=>{var r;t||(null===(r=this.htEditor)||void 0===r||r.useTheme(e))}))}registerShortcuts(){const e=this.hot.getShortcutManager().getContext("editor");super.registerShortcuts();const t={group:l,relativeToGroup:a.EDITOR_EDIT_GROUP,position:"before"},r=(e,t)=>{const r=this.htEditor;if(void 0!==e&&(e<0||r.flipped&&e>r.countRows()-1?r.deselectCell():r.selectCell(e,0),r.getData().length))return t.preventDefault(),(0,i.stopImmediatePropagation)(t),this.hot.listen(),this.TEXTAREA.focus(),!1};e.addShortcuts([{keys:[["ArrowUp"]],callback:e=>{const t=this.htEditor;let n,s;return!t.getSelectedLast()&&t.flipped?n=t.countRows()-1:t.getSelectedLast()&&(t.flipped?(s=t.getSelectedLast()[0],n=Math.max(0,s-1)):(s=t.getSelectedLast()[0],n=s-1)),r(n,e)},preventDefault:!1},{keys:[["ArrowDown"]],callback:e=>{const t=this.htEditor;let n,s;if(t.getSelectedLast()||t.flipped){if(t.getSelectedLast())if(t.flipped)n=t.getSelectedLast()[0]+1;else if(!t.flipped){const e=t.countRows()-1;s=t.getSelectedLast()[0],n=Math.min(e,s+1)}}else n=0;return r(n,e)},preventDefault:!1}],t)}unregisterShortcuts(){super.unregisterShortcuts();this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(l)}}t.HandsontableEditor=u},82518:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(37300);t.EDITOR_TYPE=n.EDITOR_TYPE,t.HandsontableEditor=n.HandsontableEditor},14417:(e,t,r)=>{"use strict";t.__esModule=!0,t.registerAllEditors=function(){(0,g.registerEditor)(s.BaseEditor),(0,g.registerEditor)(n.AutocompleteEditor),(0,g.registerEditor)(i.CheckboxEditor),(0,g.registerEditor)(o.DateEditor),(0,g.registerEditor)(a.DropdownEditor),(0,g.registerEditor)(l.HandsontableEditor),(0,g.registerEditor)(h.NumericEditor),(0,g.registerEditor)(u.PasswordEditor),(0,g.registerEditor)(c.SelectEditor),(0,g.registerEditor)(d.TextEditor),(0,g.registerEditor)(p.TimeEditor)};var n=r(10463);t.AutocompleteEditor=n.AutocompleteEditor,t.AUTOCOMPLETE_EDITOR=n.EDITOR_TYPE;var s=r(74854);t.BaseEditor=s.BaseEditor,t.BASE_EDITOR=s.EDITOR_TYPE;var i=r(12302);t.CheckboxEditor=i.CheckboxEditor,t.CHECKBOX_EDITOR=i.EDITOR_TYPE;var o=r(16339);t.DateEditor=o.DateEditor,t.DATE_EDITOR=o.EDITOR_TYPE;var a=r(51034);t.DropdownEditor=a.DropdownEditor,t.DROPDOWN_EDITOR=a.EDITOR_TYPE;var l=r(82518);t.HandsontableEditor=l.HandsontableEditor,t.HANDSONTABLE_EDITOR=l.EDITOR_TYPE;var h=r(82304);t.NumericEditor=h.NumericEditor,t.NUMERIC_EDITOR=h.EDITOR_TYPE;var u=r(14150);t.PasswordEditor=u.PasswordEditor,t.PASSWORD_EDITOR=u.EDITOR_TYPE;var c=r(63303);t.SelectEditor=c.SelectEditor,t.SELECT_EDITOR=c.EDITOR_TYPE;var d=r(66420);t.TextEditor=d.TextEditor,t.TEXT_EDITOR=d.EDITOR_TYPE;var p=r(35442);t.TimeEditor=p.TimeEditor,t.TIME_EDITOR=p.EDITOR_TYPE;var g=r(8266);t.registerEditor=g.registerEditor,t.RegisteredEditor=g.RegisteredEditor,t._getEditorInstance=g._getEditorInstance,t.getEditor=g.getEditor,t.getEditorInstance=g.getEditorInstance,t.getRegisteredEditorNames=g.getRegisteredEditorNames,t.getRegisteredEditors=g.getRegisteredEditors,t.hasEditor=g.hasEditor},82304:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(90146);t.EDITOR_TYPE=n.EDITOR_TYPE,t.NumericEditor=n.NumericEditor},90146:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(66420);const s=t.EDITOR_TYPE="numeric";class i extends n.TextEditor{static get EDITOR_TYPE(){return s}}t.NumericEditor=i},14150:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(93884);t.EDITOR_TYPE=n.EDITOR_TYPE,t.PasswordEditor=n.PasswordEditor},93884:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0;var s=n(r(85707)),i=r(66420),o=r(17207),a=r(62577);const l=t.EDITOR_TYPE="password";class h extends i.TextEditor{constructor(){super(...arguments),(0,s.default)(this,"autoResize",(0,o.createInputElementResizer)(this.hot.rootDocument,{textContent:e=>"•".repeat(e.value.length)}))}static get EDITOR_TYPE(){return l}createElements(){super.createElements(),this.TEXTAREA=this.hot.rootDocument.createElement("input"),this.TEXTAREA.setAttribute("type","password"),this.TEXTAREA.setAttribute("data-hot-input",""),this.TEXTAREA.className="handsontableInput",this.textareaStyle=this.TEXTAREA.style,this.textareaStyle.width=0,this.textareaStyle.height=0,(0,a.empty)(this.TEXTAREA_PARENT),this.TEXTAREA_PARENT.appendChild(this.TEXTAREA)}}t.PasswordEditor=h},8266:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,t.RegisteredEditor=d,t.getEditorInstance=t._getEditorInstance=function(e,t){let r;if("function"==typeof e)o.get(e)||p(null,e),r=o.get(e);else{if("string"!=typeof e)throw Error('Only strings and functions can be passed as "editor" parameter');r=l(e)}if(!r)throw Error(`No editor registered under name "${e}"`);return r.getInstance(t)},t.getEditor=function(e){if("function"==typeof e)return e;if(!h(e))throw Error(`No registered editor found under "${e}" name`);return l(e).getConstructor()},t.registerEditor=p,r(67834);var s=r(28197),i=n(r(28651));const o=new WeakMap,{register:a,getItem:l,hasItem:h,getNames:u,getValues:c}=(0,i.default)("editors");function d(e){const t={},r=e;this.getConstructor=function(){return e},this.getInstance=function(e){return e.guid in t||(t[e.guid]=new r(e)),t[e.guid]},s.Hooks.getSingleton().add("afterDestroy",(function(){t[this.guid]=null}))}function p(e,t){e&&"string"!=typeof e&&(e=(t=e).EDITOR_TYPE);const r=new d(t);"string"==typeof e&&a(e,r),o.set(t,r)}t.getRegisteredEditors=c,t.getRegisteredEditorNames=u,t.hasEditor=h},63303:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(70638);t.EDITOR_TYPE=n.EDITOR_TYPE,t.SelectEditor=n.SelectEditor},70638:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(74854),s=r(62577),i=r(25499),o=r(71120);const a="ht_editor_visible",l="selectEditor",h=t.EDITOR_TYPE="select";class u extends n.BaseEditor{static get EDITOR_TYPE(){return h}init(){this.selectWrapper=this.hot.rootDocument.createElement("div"),this.select=this.hot.rootDocument.createElement("select"),this.select.setAttribute("data-hot-input","true"),this.selectWrapper.style.display="none";const e=this.hot.rootDocument.createElement("DIV"),t=this.hot.getSettings().ariaTags;e.className="htAutocompleteArrow",t&&e.setAttribute(...(0,o.A11Y_HIDDEN)()),e.appendChild(this.hot.rootDocument.createTextNode(String.fromCharCode(9660))),(0,s.addClass)(this.selectWrapper,"htSelectEditor"),this.selectWrapper.appendChild(this.select),this.selectWrapper.insertBefore(e,this.selectWrapper.firstChild),this.hot.rootElement.appendChild(this.selectWrapper),this.registerHooks()}getValue(){return this.select.value}setValue(e){this.select.value=e}open(){this._opened=!0,this.refreshDimensions(),this.selectWrapper.style.display="";this.hot.getShortcutManager().setActiveContextName("editor"),this.registerShortcuts()}close(){this._opened=!1,this.selectWrapper.style.display="none",(0,s.hasClass)(this.selectWrapper,a)&&(0,s.removeClass)(this.selectWrapper,a),this.unregisterShortcuts(),this.clearHooks()}focus(){this.select.focus()}registerHooks(){this.addHook("afterScrollHorizontally",(()=>this.refreshDimensions())),this.addHook("afterScrollVertically",(()=>this.refreshDimensions())),this.addHook("afterColumnResize",(()=>this.refreshDimensions())),this.addHook("afterRowResize",(()=>this.refreshDimensions()))}prepare(e,t,r,n,o,a){super.prepare(e,t,r,n,o,a);const l=this.cellProperties.selectOptions;let h;h="function"==typeof l?this.prepareOptions(l(this.row,this.col,this.prop)):this.prepareOptions(l),(0,s.empty)(this.select),(0,i.objectEach)(h,((e,t)=>{const r=this.hot.rootDocument.createElement("OPTION");r.value=t,(0,s.fastInnerHTML)(r,e),this.select.appendChild(r)}))}prepareOptions(e){let t={};if(Array.isArray(e))for(let r=0,n=e.length;r{const e=this.select.selectedIndex-1;e>=0&&(this.select[e].selected=!0)}},{keys:[["ArrowDown"]],callback:()=>{const e=this.select.selectedIndex+1;e<=this.select.length-1&&(this.select[e].selected=!0)}}],t)}unregisterShortcuts(){this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(l)}}t.SelectEditor=u},96667:(e,t,r)=>{"use strict";t.__esModule=!0,t.updateCaretPosition=function(e,t){const r=(0,n.getCaretPosition)(t),s=t.value.split("\n");let i=r,o=0;for(let t=0;t{"use strict";t.__esModule=!0;var n=r(85856);t.EDITOR_TYPE=n.EDITOR_TYPE,t.TextEditor=n.TextEditor},85856:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0;var s=n(r(85707)),i=r(74854),o=n(r(3849)),a=r(25046),l=r(62577),h=r(22137),u=r(17207),c=r(70505),d=r(96667),p=r(71120);const g="ht_editor_hidden",f="textEditor",m=t.EDITOR_TYPE="text";class y extends i.BaseEditor{static get EDITOR_TYPE(){return m}constructor(e){super(e),(0,s.default)(this,"eventManager",new o.default(this)),(0,s.default)(this,"autoResize",(0,u.createInputElementResizer)(this.hot.rootDocument)),(0,s.default)(this,"TEXTAREA",void 0),(0,s.default)(this,"textareaStyle",void 0),(0,s.default)(this,"TEXTAREA_PARENT",void 0),(0,s.default)(this,"textareaParentStyle",void 0),(0,s.default)(this,"layerClass",void 0),this.eventManager=new o.default(this),this.createElements(),this.bindEvents(),this.hot.addHookOnce("afterDestroy",(()=>this.destroy()))}getValue(){return this.TEXTAREA.value}setValue(e){this.TEXTAREA.value=e}open(){this.refreshDimensions(),this.showEditableElement(),this.hot.getShortcutManager().setActiveContextName("editor"),this.registerShortcuts()}close(){this.autoResize.unObserve(),(0,l.isThisHotChild)(this.hot.rootDocument.activeElement,this.hot.rootElement)&&this.hot.listen(),this.hideEditableElement(),this.unregisterShortcuts()}prepare(e,t,r,n,s,o){const a=this.state;if(super.prepare(e,t,r,n,s,o),!o.readOnly){this.refreshDimensions(!0);const{allowInvalid:e}=o;e&&!this.isOpened()&&(this.TEXTAREA.value=""),a===i.EDITOR_STATE.FINISHED||this.isOpened()||this.hideEditableElement()}}beginEditing(e,t){this.state===i.EDITOR_STATE.VIRGIN&&(this.TEXTAREA.value="",super.beginEditing(e,t))}focus(){this.TEXTAREA.select(),(0,l.setCaretPosition)(this.TEXTAREA,this.TEXTAREA.value.length)}createElements(){const{rootDocument:e}=this.hot;this.TEXTAREA=e.createElement("TEXTAREA"),(0,l.setAttribute)(this.TEXTAREA,[["data-hot-input",""],(0,p.A11Y_TABINDEX)(-1)]),(0,l.addClass)(this.TEXTAREA,"handsontableInput"),this.textareaStyle=this.TEXTAREA.style,this.textareaStyle.width=0,this.textareaStyle.height=0,this.textareaStyle.overflowY="visible",this.TEXTAREA_PARENT=e.createElement("DIV"),(0,l.addClass)(this.TEXTAREA_PARENT,"handsontableInputHolder"),(0,l.hasClass)(this.TEXTAREA_PARENT,this.layerClass)&&(0,l.removeClass)(this.TEXTAREA_PARENT,this.layerClass),(0,l.addClass)(this.TEXTAREA_PARENT,g),this.textareaParentStyle=this.TEXTAREA_PARENT.style,this.TEXTAREA_PARENT.appendChild(this.TEXTAREA),this.hot.rootElement.appendChild(this.TEXTAREA_PARENT)}hideEditableElement(){(0,a.isEdge)()&&(this.textareaStyle.textIndent="-99999px"),this.textareaStyle.overflowY="visible",this.textareaParentStyle.opacity="0",this.textareaParentStyle.height="1px",(0,l.removeClass)(this.TEXTAREA_PARENT,this.layerClass),(0,l.addClass)(this.TEXTAREA_PARENT,g)}showEditableElement(){this.textareaParentStyle.height="",this.textareaParentStyle.overflow="",this.textareaParentStyle.position="",this.textareaParentStyle[this.hot.isRtl()?"left":"right"]="auto",this.textareaParentStyle.opacity="1",this.textareaStyle.textIndent="";const e=this.TEXTAREA_PARENT.childNodes;let t=!1;(0,h.rangeEach)(e.length-1,(r=>{const n=e[r];if((0,l.hasClass)(n,"handsontableEditor"))return t=!0,!1})),(0,l.hasClass)(this.TEXTAREA_PARENT,g)&&(0,l.removeClass)(this.TEXTAREA_PARENT,g),t?(this.layerClass="ht_editor_visible",(0,l.addClass)(this.TEXTAREA_PARENT,this.layerClass)):(this.layerClass=this.getEditedCellsLayerClass(),(0,l.addClass)(this.TEXTAREA_PARENT,this.layerClass))}refreshValue(){const e=this.hot.toPhysicalRow(this.row),t=this.hot.getSourceDataAtCell(e,this.col);this.originalValue=t,this.setValue(t),this.refreshDimensions()}refreshDimensions(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.state!==i.EDITOR_STATE.EDITING&&!e)return;if(this.TD=this.getEditedCell(),!this.TD)return void(e||this.close());const{top:t,start:r,width:n,maxWidth:s,height:o,maxHeight:a}=this.getEditedCellRect();this.textareaParentStyle.top=`${t}px`,this.textareaParentStyle[this.hot.isRtl()?"right":"left"]=`${r}px`,this.showEditableElement();const l=this.hot.rootWindow.getComputedStyle(this.TD);this.TEXTAREA.style.fontSize=l.fontSize,this.TEXTAREA.style.fontFamily=l.fontFamily,this.TEXTAREA.style.backgroundColor=this.TD.style.backgroundColor,this.autoResize.init(this.TEXTAREA,{minWidth:Math.min(n,s),minHeight:Math.min(o,a),maxWidth:s,maxHeight:a},!0)}bindEvents(){(0,a.isIOS)()&&this.eventManager.addEventListener(this.TEXTAREA,"focusout",(()=>this.finishEditing(!1))),this.addHook("afterScrollHorizontally",(()=>this.refreshDimensions())),this.addHook("afterScrollVertically",(()=>this.refreshDimensions())),this.addHook("afterColumnResize",(()=>{this.refreshDimensions(),this.state===i.EDITOR_STATE.EDITING&&this.focus()})),this.addHook("afterRowResize",(()=>{this.refreshDimensions(),this.state===i.EDITOR_STATE.EDITING&&this.focus()}))}allowKeyEventPropagation(){}destroy(){this.eventManager.destroy(),this.clearHooks()}registerShortcuts(){const e=this.hot.getShortcutManager().getContext("editor"),t={runOnlyIf:()=>(0,c.isDefined)(this.hot.getSelected()),group:f},r=()=>{this.hot.rootDocument.execCommand("insertText",!1,"\n")};e.addShortcuts([{keys:[["Control","Enter"]],callback:()=>(r(),!1),runOnlyIf:e=>!this.hot.selection.isMultiple()&&!e.altKey},{keys:[["Meta","Enter"]],callback:()=>(r(),!1),runOnlyIf:()=>!this.hot.selection.isMultiple()},{keys:[["Alt","Enter"]],callback:()=>(r(),!1)},{keys:[["Home"]],callback:(e,t)=>{let[r]=t;(0,d.updateCaretPosition)(r,this.TEXTAREA)}},{keys:[["End"]],callback:(e,t)=>{let[r]=t;(0,d.updateCaretPosition)(r,this.TEXTAREA)}}],t)}unregisterShortcuts(){this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(f)}}t.TextEditor=y},35442:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(55736);t.EDITOR_TYPE=n.EDITOR_TYPE,t.TimeEditor=n.TimeEditor},55736:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(66420);const s=t.EDITOR_TYPE="time";class i extends n.TextEditor{static get EDITOR_TYPE(){return s}prepare(e,t,r,n,s,i){super.prepare(e,t,r,n,s,i),this.TEXTAREA.dir="ltr"}}t.TimeEditor=i},3849:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,t.getListenersCounter=function(){return o},r(15724);var s=n(r(85707)),i=r(77661);let o=0;t.default=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;(0,s.default)(this,"context",void 0),this.context=e||this,this.context.eventListeners||(this.context.eventListeners=[])}addEventListener(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];function s(e){r.call(this,function(e){const t=e.stopImmediatePropagation;return e.stopImmediatePropagation=function(){t.apply(this),(0,i.stopImmediatePropagation)(this)},e}(e))}return this.context.eventListeners.push({element:e,event:t,callback:r,callbackProxy:s,options:n,eventManager:this}),e.addEventListener(t,s,n),o+=1,()=>{this.removeEventListener(e,t,r)}}removeEventListener(e,t,r){let n,s=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=this.context.eventListeners.length;for(;i;)if(i-=1,n=this.context.eventListeners[i],n.event===t&&n.element===e){if(r&&r!==n.callback)continue;if(s&&n.eventManager!==this)continue;this.context.eventListeners.splice(i,1),n.element.removeEventListener(n.event,n.callbackProxy,n.options),o-=1}}clearEvents(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.context)return;let t=this.context.eventListeners.length;for(;t;){t-=1;const r=this.context.eventListeners[t];e&&r.eventManager!==this||(this.context.eventListeners.splice(t,1),r.element.removeEventListener(r.event,r.callbackProxy,r.options),o-=1)}}clear(){this.clearEvents()}destroy(){this.clearEvents(),this.context=null}destroyWithOwnEventsOnly(){this.clearEvents(!0),this.context=null}fireEvent(e,t){let r=e.document,n=e;r||(r=e.ownerDocument?e.ownerDocument:e,n=r.defaultView);const s={bubbles:!0,cancelable:"mousemove"!==t,view:n,detail:0,screenX:0,screenY:0,clientX:1,clientY:1,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:void 0};let i;r.createEvent?(i=r.createEvent("MouseEvents"),i.initMouseEvent(t,s.bubbles,s.cancelable,s.view,s.detail,s.screenX,s.screenY,s.clientX,s.clientY,s.ctrlKey,s.altKey,s.shiftKey,s.metaKey,s.button,s.relatedTarget||r.body.parentNode)):i=r.createEventObject(),e.dispatchEvent?e.dispatchEvent(i):e.fireEvent(`on${t}`,i)}}},19053:(e,t,r)=>{"use strict";t.__esModule=!0,r(67834);var n=r(14859),s=r(62577),i=r(89804);function o(e,t,r){a(e,t),t.set(e,r)}function a(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function l(e,t){return e.get(u(e,t))}function h(e,t,r){return e.set(u(e,t),r),r}function u(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}const c=Object.freeze({CELL:"cell",MIXED:"mixed"});var d=new WeakMap,p=new WeakMap,g=new WeakMap,f=new WeakMap,m=new WeakMap,y=new WeakSet;function E(e){var t;const r=null===(t=l(d,this).getSelectedRangeLast())||void 0===t?void 0:t.highlight;if(!r||!l(d,this).selection.isCellVisible(r))return void e(null);const n=l(d,this).getCell(r.row,r.col,!0);null===n?l(d,this).addHookOnce("afterScroll",(()=>{e(l(d,this).getCell(r.row,r.col,!0))})):e(n)}function w(){u(y,this,E).call(this,(e=>{const{activeElement:t}=l(d,this).rootDocument;t&&(0,s.isOutsideInput)(t)&&t.blur(),this.focusOnHighlightedCell(e)}))}function C(){u(y,this,E).call(this,(e=>{this.getFocusMode()===c.MIXED&&"TD"===(null==e?void 0:e.nodeName)&&this.refocusToEditorTextarea()}))}function v(e){"boolean"==typeof e.imeFastEdit&&this.setFocusMode(e.imeFastEdit?c.MIXED:c.CELL)}t.FocusManager=class{constructor(e){var t,r,n=this;a(t=this,r=y),r.add(t),o(this,d,void 0),o(this,p,void 0),o(this,g,1),o(this,f,null),o(this,m,new Map);const s=e.getSettings();h(d,this,e),h(p,this,s.imeFastEdit?c.MIXED:c.CELL),l(d,this).addHook("afterUpdateSettings",(function(){for(var e=arguments.length,t=new Array(e),r=0;r{var t,r;const n=null===(t=l(d,this).getSelectedRangeLast())||void 0===t?void 0:t.highlight;if(!n)return;let s=l(d,this).runHooks("modifyFocusedElement",n.row,n.col,e);s instanceof HTMLElement||(s=e),!s||null!==(r=l(d,this).getActiveEditor())&&void 0!==r&&r.isOpened()||s.focus({preventScroll:!0})};e?t(e):u(y,this,E).call(this,(e=>t(e)))}refocusToEditorTextarea(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l(g,this);!l(d,this).getSettings().imeFastEdit||null!==(e=l(d,this).getActiveEditor())&&void 0!==e&&e.isOpened()||(l(m,this).has(t)||l(m,this).set(t,(0,i.debounce)((()=>{var e;null===(e=this.getRefocusElement())||void 0===e||e.select()}),t)),l(m,this).get(t)())}}},71120:(e,t)=>{"use strict";t.__esModule=!0;t.A11Y_TABINDEX=e=>["tabindex",e];t.A11Y_TREEGRID=()=>["role","treegrid"];t.A11Y_PRESENTATION=()=>["role","presentation"];t.A11Y_GRIDCELL=()=>["role","gridcell"];t.A11Y_ROWHEADER=()=>["role","rowheader"];t.A11Y_ROWGROUP=()=>["role","rowgroup"];t.A11Y_COLUMNHEADER=()=>["role","columnheader"];t.A11Y_ROW=()=>["role","row"];t.A11Y_MENU=()=>["role","menu"];t.A11Y_MENU_ITEM=()=>["role","menuitem"];t.A11Y_MENU_ITEM_CHECKBOX=()=>["role","menuitemcheckbox"];t.A11Y_COMBOBOX=()=>["role","combobox"];t.A11Y_LISTBOX=()=>["role","listbox"];t.A11Y_OPTION=()=>["role","option"];t.A11Y_CHECKBOX=()=>["role","checkbox"];t.A11Y_SCOPE_COL=()=>["scope","col"];t.A11Y_SCOPE_ROW=()=>["scope","row"];t.A11Y_TEXT=()=>["type","text"];t.A11Y_LABEL=e=>["aria-label",e];t.A11Y_HIDDEN=()=>["aria-hidden","true"];t.A11Y_DISABLED=()=>["aria-disabled","true"];t.A11Y_MULTISELECTABLE=()=>["aria-multiselectable","true"];t.A11Y_HASPOPUP=e=>["aria-haspopup",e];t.A11Y_ROWCOUNT=e=>["aria-rowcount",e];t.A11Y_COLCOUNT=e=>["aria-colcount",e];t.A11Y_ROWINDEX=e=>["aria-rowindex",e];t.A11Y_COLINDEX=e=>["aria-colindex",e];t.A11Y_EXPANDED=e=>["aria-expanded",e];t.A11Y_SORT=e=>["aria-sort",e];t.A11Y_READONLY=()=>["aria-readonly","true"];t.A11Y_INVALID=()=>["aria-invalid","true"];t.A11Y_CHECKED=e=>["aria-checked",e];t.A11Y_SELECTED=()=>["aria-selected","true"];t.A11Y_AUTOCOMPLETE=()=>["aria-autocomplete","list"];t.A11Y_CONTROLS=e=>["aria-controls",e];t.A11Y_ACTIVEDESCENDANT=e=>["aria-activedescendant",e];t.A11Y_LIVE=e=>["aria-live",e];t.A11Y_RELEVANT=e=>["aria-relevant",e];t.A11Y_SETSIZE=e=>["aria-setsize",e];t.A11Y_POSINSET=e=>["aria-posinset",e]},10587:(e,t,r)=>{"use strict";function n(e,t,r,n){let s=-1,i=e,o=r;Array.isArray(e)||(i=Array.from(e));const a=i.length;for(n&&a&&(s+=1,o=i[s]),s+=1;se+t),0)}t.__esModule=!0,t.arrayAvg=function(e){if(!e.length)return 0;return i(e)/e.length},t.arrayEach=s,t.arrayFilter=function(e,t){let r=0,n=e;Array.isArray(e)||(n=Array.from(e));const s=n.length,i=[];let o=-1;for(;rt.concat(Array.isArray(r)?e(r):r)),[])},t.arrayMap=function(e,t){let r=0,n=e;Array.isArray(e)||(n=Array.from(e));const s=n.length,i=[];let o=-1;for(;re>t?e:t),Array.isArray(e)?e[0]:void 0)},t.arrayMin=function(e){return n(e,((e,t)=>e{-1===t.indexOf(e)&&t.push(e)})),t},t.extendArray=function(e,t){const r=t.length;let n=0;for(;n{o=o.filter((t=>!e.includes(t)))})),o},t.getIntersectionOfArrays=function(){for(var e=arguments.length,t=new Array(e),r=0;r{o=o.filter((t=>e.includes(t)))})),o},t.getUnionOfArrays=function(){for(var e=arguments.length,t=new Array(e),r=0;r{s(e,(e=>{o.has(e)||o.add(e)}))})),Array.from(o)},t.pivot=function(e){const t=[];if(!e||0===e.length||!e[0]||0===e[0].length)return t;const r=e.length,n=e[0].length;for(let s=0;s1&&void 0!==arguments[1]?arguments[1]:" ";return e.split(t)},t.to2dArray=function(e){const t=e.length;let r=0;for(;r{"use strict";t.__esModule=!0,t.isChrome=function(){return o.chrome.value},t.isChromeWebKit=function(){return o.chromeWebKit.value},t.isEdge=function(){return o.edge.value},t.isEdgeWebKit=function(){return o.edgeWebKit.value},t.isFirefox=function(){return o.firefox.value},t.isFirefoxWebKit=function(){return o.firefoxWebKit.value},t.isIOS=function(){return a.ios.value},t.isIpadOS=function(){let{maxTouchPoints:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:navigator;return e>2&&a.mac.value},t.isLinuxOS=function(){return a.linux.value},t.isMacOS=function(){return a.mac.value},t.isMobileBrowser=function(){return o.mobile.value},t.isSafari=function(){return o.safari.value},t.isWindowsOS=function(){return a.win.value},t.setBrowserMeta=l,t.setPlatformMeta=h;var n=r(25499),s=r(85992);const i=e=>{const t={value:!1,test:(r,n)=>{t.value=e(r,n)}};return t},o={chrome:i(((e,t)=>/Chrome/.test(e)&&/Google/.test(t))),chromeWebKit:i((e=>/CriOS/.test(e))),edge:i((e=>/Edge/.test(e))),edgeWebKit:i((e=>/EdgiOS/.test(e))),firefox:i((e=>/Firefox/.test(e))),firefoxWebKit:i((e=>/FxiOS/.test(e))),mobile:i((e=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(e))),safari:i(((e,t)=>/Safari/.test(e)&&/Apple Computer/.test(t)))},a={mac:i((e=>/^Mac/.test(e))),win:i((e=>/^Win/.test(e))),linux:i((e=>/^Linux/.test(e))),ios:i((e=>/iPhone|iPad|iPod/i.test(e)))};function l(){let{userAgent:e=navigator.userAgent,vendor:t=navigator.vendor}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,n.objectEach)(o,(r=>{let{test:n}=r;n(e,t)}))}function h(){let{platform:e=navigator.platform}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,n.objectEach)(a,(t=>{let{test:r}=t;r(e)}))}(0,s.isCSR)()&&(l(),h())},14859:(e,t,r)=>{"use strict";t.__esModule=!0,t.error=function(){(0,n.isDefined)(console)&&console.error(...arguments)},t.info=function(){(0,n.isDefined)(console)&&console.info(...arguments)},t.log=function(){(0,n.isDefined)(console)&&console.log(...arguments)},t.warn=function(){(0,n.isDefined)(console)&&console.warn(...arguments)};var n=r(70505)},87124:(e,t,r)=>{"use strict";t.__esModule=!0,t.countFirstRowKeys=function(e){let t=0;Array.isArray(e)&&(e[0]&&Array.isArray(e[0])?t=e[0].length:e[0]&&(0,n.isObject)(e[0])&&(t=(0,n.deepObjectSize)(e[0])));return t},t.createEmptySpreadsheetData=function(e,t){const r=[];let n;for(let s=0;s0&&void 0!==arguments[0]?arguments[0]:100,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4;const r=[];let n,s;for(n=0;n0&&void 0!==arguments[0]?arguments[0]:100,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4;const r=[];let n,s;for(n=0;n1&&void 0!==arguments[1]?arguments[1]:0,r=e;const n=[];Array.isArray(e)&&Array.isArray(e[0])||(r=[e]);return r.forEach(((e,r)=>{Array.isArray(e)?e.forEach(((e,s)=>{n.push([r+t,s,e])})):Object.keys(e).forEach((s=>{n.push([r+t,s,e[s]])}))})),n},t.isArrayOfArrays=function(e){return!!(Array.isArray(e)&&e.length&&e.every((e=>Array.isArray(e))))},t.isArrayOfObjects=function(e){return!!(Array.isArray(e)&&e.length&&e.every((e=>"object"==typeof e&&!Array.isArray(e)&&null!==e)))},t.spreadsheetColumnIndex=function(e){let t=0;if(e)for(let r=0,n=e.length-1;r0;)t=(r-1)%i,n=String.fromCharCode(65+t)+n,r=parseInt((r-t)/i,10);return n}},95976:(e,t)=>{"use strict";t.__esModule=!0,t.getNormalizedDate=function(e){const t=new Date(e);if(!isNaN(new Date(`${e}T00:00`).getDate()))return new Date(t.getTime()+6e4*t.getTimezoneOffset());return t}},62577:(e,t,r)=>{"use strict";t.__esModule=!0,t.addClass=h,t.addEvent=function(e,t,r){e.addEventListener(t,r,!1)},t.clearTextSelection=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;e.getSelection&&(e.getSelection().empty?e.getSelection().empty():e.getSelection().removeAllRanges&&e.getSelection().removeAllRanges())},t.closest=o,t.closestDown=function(e,t,r){const n=[];let s=e;for(;s&&(s=o(s,t,r),s&&(!r||r.contains(s)));)n.push(s),s=s.host&&s.nodeType===Node.DOCUMENT_FRAGMENT_NODE?s.host:s.parentNode;const i=n.length;return i?n[i-1]:null},t.empty=d,t.fastInnerHTML=function(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];p.test(t)?e.innerHTML=r?(0,n.sanitize)(t):t:g(e,t)},t.fastInnerText=g,t.findFirstParentWithClass=function(e,t){const r={element:void 0,classNames:[]};let n=e;for(;null!==n&&n!==e.ownerDocument.documentElement&&!r.element;){if("string"==typeof t&&n.classList.contains(t))r.element=n,r.classNames.push(t);else if(t instanceof RegExp){const e=Array.from(n.classList).filter((e=>t.test(e)));e.length&&(r.element=n,r.classNames.push(...e))}n=n.parentElement}return r},t.getCaretPosition=function(e){if(e.selectionStart)return e.selectionStart;return 0},t.getCssTransform=function(e){let t;if(e.style.transform&&""!==(t=e.style.transform))return["transform",t];return-1},t.getFrameElement=i,t.getMaximumScrollLeft=function(e){return e.scrollWidth-e.clientWidth},t.getMaximumScrollTop=function(e){return e.scrollHeight-e.clientHeight},t.getParent=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=-1,n=null,s=e;for(;null!==s;){if(r===t){n=s;break}s.host&&s.nodeType===Node.DOCUMENT_FRAGMENT_NODE?s=s.host:(r+=1,s=s.parentNode)}return n},t.getParentWindow=function(e){return i(e)&&e.parent},t.getScrollLeft=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window;if(e===t)return m(t);return e.scrollLeft},t.getScrollTop=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window;if(e===t)return f(t);return e.scrollTop},t.getScrollableElement=function(e){let t=e.ownerDocument,r=t?t.defaultView:void 0;t||(t=e.document?e.document:e,r=t.defaultView);const n=["auto","scroll"];let s=e.parentNode;for(;s&&s.style&&t.body!==s;){let{overflow:e,overflowX:t,overflowY:i}=s.style;if([e,t,i].includes("scroll"))return s;if(({overflow:e,overflowX:t,overflowY:i}=r.getComputedStyle(s)),n.includes(e)||n.includes(t)||n.includes(i))return s;if(s.clientHeight<=s.scrollHeight+1&&(n.includes(i)||n.includes(e)))return s;if(s.clientWidth<=s.scrollWidth+1&&(n.includes(t)||n.includes(e)))return s;s=s.parentNode}return r},t.getScrollbarWidth=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document;void 0===y&&(y=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document;const t=e.createElement("div");t.style.height="200px",t.style.width="100%";const r=e.createElement("div");r.style.boxSizing="content-box",r.style.height="150px",r.style.left="0px",r.style.overflow="hidden",r.style.position="absolute",r.style.top="0px",r.style.width="200px",r.style.visibility="hidden",r.appendChild(t),(e.body||e.documentElement).appendChild(r);const n=t.offsetWidth;r.style.overflow="scroll";let s=t.offsetWidth;n===s&&(s=r.clientWidth);return(e.body||e.documentElement).removeChild(r),n-s}(e));return y},t.getSelectionEndPosition=function(e){if(e.selectionEnd)return e.selectionEnd;return 0},t.getSelectionText=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;const t=e.document;let r="";e.getSelection?r=e.getSelection().toString():t.selection&&"Control"!==t.selection.type&&(r=t.selection.createRange().text);return r},t.getStyle=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window;if(!e)return;if(e===r)return"width"===t?`${r.innerWidth}px`:"height"===t?`${r.innerHeight}px`:void 0;const n=e.style[t];if(""!==n&&void 0!==n)return n;const s=r.getComputedStyle(e);if(""!==s[t]&&void 0!==s[t])return s[t]},t.getTrimmingContainer=function(e){const t=e.ownerDocument,r=t.defaultView;let n=e.parentNode;for(;n&&n.style&&t.body!==n;){if("visible"!==n.style.overflow&&""!==n.style.overflow)return n;const e=r.getComputedStyle(n),t=["scroll","hidden","auto"],s=e.getPropertyValue("overflow"),i=e.getPropertyValue("overflow-y"),o=e.getPropertyValue("overflow-x");if(t.includes(s)||t.includes(i)||t.includes(o))return n;n=n.parentNode}return r},t.getWindowScrollLeft=m,t.getWindowScrollTop=f,t.hasAccessToParentWindow=function(e){return!!Object.getPrototypeOf(e.parent)},t.hasClass=function(e,t){if(void 0===e.classList||"string"!=typeof t||""===t)return!1;return e.classList.contains(t)},t.hasHorizontalScrollbar=function(e){return e.offsetHeight!==e.clientHeight},t.hasVerticalScrollbar=function(e){return e.offsetWidth!==e.clientWidth},t.index=function(e){let t=0,r=e;if(r.previousSibling)for(;r=r.previousSibling;)t+=1;return t},t.innerHeight=function(e){return e.clientHeight||e.innerHeight},t.innerWidth=function(e){return e.clientWidth||e.innerWidth},t.isChildOf=function(e,t){let r=e.parentNode,n=[];"string"==typeof t?n=e.defaultView?Array.prototype.slice.call(e.querySelectorAll(t),0):Array.prototype.slice.call(e.ownerDocument.querySelectorAll(t),0):n.push(t);for(;null!==r;){if(n.indexOf(r)>-1)return!0;r=r.parentNode}return!1},t.isDetached=function(e){return!e.parentNode},t.isInput=E,t.isOutsideInput=w,t.isThisHotChild=function(e,t){const r=e.closest(".handsontable");return!!r&&(r.parentNode===t||r===t)},t.isVisible=function e(t){const r=t.ownerDocument.documentElement,n=t.ownerDocument.defaultView;let s=t;for(;s!==r;){if(null===s)return!1;if(s.nodeType===Node.DOCUMENT_FRAGMENT_NODE){if(s.host){if(s.host.impl)return e(s.host.impl);if(s.host)return e(s.host);throw new Error("Lost in Web Components world")}return!1}if("none"===n.getComputedStyle(s).display)return!1;s=s.parentNode}return!0},t.makeElementContentEditableAndSelectItsContent=C,t.matchesCSSRules=function(e,t){const{selectorText:r}=t;let n=!1;t.type===CSSRule.STYLE_RULE&&r&&(e.msMatchesSelector?n=e.msMatchesSelector(r):e.matches&&(n=e.matches(r)));return n},t.observeVisibilityChangeOnce=function(e,t){new IntersectionObserver(((r,n)=>{r.forEach((r=>{r.isIntersecting&&null!==e.offsetParent&&(t(),n.unobserve(e))}))}),{root:e.ownerDocument.body}).observe(e)},t.offset=function(e){const t=e.ownerDocument,r=t.defaultView,n=t.documentElement;let s,i,o,a=e;s=a.offsetLeft,i=a.offsetTop,o=a;for(;(a=a.offsetParent)&&a!==t.body&&"offsetLeft"in a;)s+=a.offsetLeft,i+=a.offsetTop,o=a;o&&"fixed"===o.style.position&&(s+=r.pageXOffset||n.scrollLeft,i+=r.pageYOffset||n.scrollTop);return{left:s,top:i}},t.outerHeight=function(e){return e.offsetHeight},t.outerWidth=function(e){return e.offsetWidth},t.overlayContainsElement=function(e,t,r){const n=r.parentElement.querySelector(`.ht_clone_${e}`);return n?n.contains(t):null},t.removeAttribute=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];"string"==typeof t?t=t.split(" "):t instanceof RegExp&&(t=[t]);const{regexFree:r,regexes:n}=l(t,!0);r.forEach((t=>{""!==t&&e.removeAttribute(t)})),n.forEach((t=>{e.getAttributeNames().forEach((r=>{t.test(r)&&e.removeAttribute(r)}))}))},t.removeClass=u,t.removeContentEditableFromElementAndDeselect=v,t.removeEvent=function(e,t,r){e.removeEventListener(t,r,!1)},t.removeTextNodes=function e(t){if(3===t.nodeType)t.parentNode.removeChild(t);else if(["TABLE","THEAD","TBODY","TFOOT","TR"].indexOf(t.nodeName)>-1){const r=t.childNodes;for(let t=r.length-1;t>=0;t--)e(r[t])}},t.resetCssTransform=function(e){e.style.transform&&""!==e.style.transform&&(e.style.transform="")},t.runWithSelectedContendEditableElement=function(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];C(e,r),t(),v(e,r)},t.selectElementIfAllowed=function(e){w(e.ownerDocument.activeElement)||e.select()},t.setAttribute=c,t.setCaretPosition=function(e,t,r){void 0===r&&(r=t);if(e.setSelectionRange){e.focus();try{e.setSelectionRange(t,r)}catch(n){const s=e.parentNode,i=s.style.display;s.style.display="block",e.setSelectionRange(t,r),s.style.display=i}}},t.setOverlayPosition=function(e,t,r){e.style.transform=`translate3d(${t},${r},0)`},r(67834),r(15724),r(14846),r(27458),r(69655);var n=r(5893),s=r(71120);function i(e){return Object.getPrototypeOf(e.parent)&&e.frameElement}function o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;const{ELEMENT_NODE:n,DOCUMENT_FRAGMENT_NODE:s}=Node;let i=e;for(;null!=i&&i!==r;){const{nodeType:e,nodeName:r}=i;if(e===n&&(t.includes(r)||t.includes(i)))return i;const{host:o}=i;i=o&&e===s?o:i.parentNode}return null}function a(e){return e&&e.length?e.filter((e=>!!e)):[]}function l(e,t){if(!e||!e.length)return t?{regexFree:[],regexes:[]}:[];const r=[],n=[];return n.push(...e.filter((e=>{const n=e instanceof RegExp;return n&&t&&r.push(e),!n}))),t?{regexFree:n,regexes:r}:n}function h(e,t){"string"==typeof t&&(t=t.split(" ")),(t=a(t)).length>0&&e.classList.add(...t)}function u(e,t){"string"==typeof t?t=t.split(" "):t instanceof RegExp&&(t=[t]);let{regexFree:r,regexes:n}=l(t,!0);r=a(r),r.length>0&&e.classList.remove(...r),n.forEach((t=>{e.classList.forEach((r=>{t.test(r)&&e.classList.remove(r)}))}))}function c(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;Array.isArray(t)||(t=[[t,r]]),t.forEach((t=>{Array.isArray(t)&&""!==t[0]&&e.setAttribute(...t)}))}function d(e){let t;for(;t=e.lastChild;)e.removeChild(t)}const p=t.HTML_CHARACTERS=/(<(.*)>|&(.*);)/;function g(e,t){const r=e.firstChild;r&&3===r.nodeType&&null===r.nextSibling?r.textContent=t:(d(e),e.appendChild(e.ownerDocument.createTextNode(t)))}function f(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window).scrollY}function m(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window).scrollX}let y;function E(e){return e&&(["INPUT","SELECT","TEXTAREA"].indexOf(e.nodeName)>-1||"true"===e.contentEditable)}function w(e){return E(e)&&!1===e.hasAttribute("data-hot-input")}function C(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const n=e.ownerDocument,i=n.createRange(),o=n.defaultView.getSelection();c(e,"contenteditable",!0),r&&c(e,...(0,s.A11Y_HIDDEN)()),t&&h(e,"invisibleSelection"),i.selectNodeContents(e),o.removeAllRanges(),o.addRange(i)}function v(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const r=e.ownerDocument.defaultView.getSelection();e.hasAttribute("aria-hidden")&&e.removeAttribute("aria-hidden"),r.removeAllRanges(),t&&u(e,"invisibleSelection"),e.removeAttribute("contenteditable")}},77661:(e,t)=>{"use strict";t.__esModule=!0,t.isImmediatePropagationStopped=function(e){return!1===e.isImmediatePropagationEnabled},t.isLeftClick=function(e){return 0===e.button},t.isRightClick=function(e){return 2===e.button},t.isTouchEvent=function(e){return e instanceof TouchEvent},t.offsetRelativeTo=function(e,t){const r={x:e.offsetX,y:e.offsetY};let n=e.target;if(!(t instanceof HTMLElement)||n!==t&&n.contains(t))return r;for(;n!==t;)r.x+=n.offsetLeft,r.y+=n.offsetTop,n=n.offsetParent;return r},t.stopImmediatePropagation=function(e){e.isImmediatePropagationEnabled=!1,e.cancelBubble=!0}},85992:(e,t)=>{"use strict";let r;t.__esModule=!0,t.cancelAnimationFrame=function(e){window.cancelAnimationFrame(e)},t.getComparisonFunction=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(r)return r;r="object"==typeof Intl?new Intl.Collator(e,t).compare:"function"==typeof String.prototype.localeCompare?(e,t)=>`${e}`.localeCompare(t):(e,t)=>e===t?0:e>t?-1:1;return r},t.isCSR=function(){return"undefined"!=typeof window},t.isTouchSupported=function(){return"ontouchstart"in window},t.requestAnimationFrame=function(e){return window.requestAnimationFrame(e)}},89804:(e,t,r)=>{"use strict";t.__esModule=!0,t.curry=function(e){const t=e.length;return function r(n){return function(){for(var s=arguments.length,i=new Array(s),o=0;o=t?e.apply(this,a):r(a),l}}([])},t.curryRight=function(e){const t=e.length;return function r(n){return function(){for(var s=arguments.length,i=new Array(s),o=0;o=t?e.apply(this,a):r(a),l}}([])},t.debounce=function(e){let t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:200,n=null;return function(){for(var s=arguments.length,i=new Array(s),o=0;o{t=e.apply(this,i)}),r),t}},t.fastCall=function(e,t,r,n,i,o,a,l){if((0,s.isDefined)(l))return e.call(t,r,n,i,o,a,l);if((0,s.isDefined)(a))return e.call(t,r,n,i,o,a);if((0,s.isDefined)(o))return e.call(t,r,n,i,o);if((0,s.isDefined)(i))return e.call(t,r,n,i);if((0,s.isDefined)(n))return e.call(t,r,n);if((0,s.isDefined)(r))return e.call(t,r);return e.call(t)},t.isFunction=function(e){return"function"==typeof e},t.partial=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;nt(e)),s.apply(this,t))}},t.throttle=i,t.throttleAfterHits=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:200,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;const n=i(e,t);let s=r;function o(){for(var t=arguments.length,r=new Array(t),i=0;i1&&void 0!==arguments[1]?arguments[1]:200,r=0;const n={lastCallThrottled:!0};let s=null;return function(){for(var i=arguments.length,o=new Array(i),a=0;a{n.lastCallThrottled=!1,e.apply(this,o),r=0,s=void 0}),u)),n}}},70505:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,t._injectProductInfo=function(e,t){const r=!a(e),n="string"==typeof e&&"non-commercial-and-evaluation"===e.toLowerCase(),i="15.1.0";let o,w="invalid",C="invalid";const v=function(e){let t=[][l],r=t;if(e[l]!==d("Z"))return!1;for(let t="",n="B>1:t=c(e,s,s?1===n[l]?9:8:6);return r===t}(e=p(e||""));if(r||n||v)if(v){const t=(0,s.default)("20/02/2025","DD/MM/YYYY"),r=Math.floor(t.toDate().getTime()/864e5),n=g(e);o=(0,s.default)(864e5*(n+1),"x").format("MMMM DD, YYYY"),r>n?(w="expired",C="expired"):(w="valid",C="valid")}else n?(w="non_commercial",C="valid"):(w="invalid",C="invalid");else w="missing",C="missing";f()&&(w="valid",C="valid");if(!m&&"valid"!==w){y[w]({keyValidityDate:o,hotVersion:i})&&console["non_commercial"===w?"info":"warn"](y[w]({keyValidityDate:o,hotVersion:i})),m=!0}if("valid"!==C&&t.parentNode){if(E[C]({keyValidityDate:o,hotVersion:i})){const e=document.createElement("div");e.className="handsontable hot-display-license-info",e.innerHTML=E[C]({keyValidityDate:o,hotVersion:i}),t.parentNode.insertBefore(e,t.nextSibling)}}},t.isDefined=function(e){return void 0!==e},t.isEmpty=a,t.isRegExp=function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},t.isUndefined=o,t.stringify=function(e){let t;switch(typeof e){case"string":case"number":t=`${e}`;break;case"object":t=null===e?"":e.toString();break;case"undefined":t="";break;default:t=e.toString()}return t};var s=n(r(6671)),i=r(21595);function o(e){return void 0===e}function a(e){return null===e||""===e||o(e)}const l="length",h=e=>parseInt(e,16),u=e=>parseInt(e,10),c=(e,t,r)=>e.substr(t,r),d=e=>e.codePointAt(0)-65,p=e=>`${e}`.replace(/\-/g,""),g=e=>h(c(p(e),h("12"),d("F")))/(h(c(p(e),d("B"),~~![][l]))||9),f=()=>"undefined"!=typeof location&&/^([a-z0-9\-]+\.)?\x68\x61\x6E\x64\x73\x6F\x6E\x74\x61\x62\x6C\x65\x2E\x63\x6F\x6D$/i.test(location.host);let m=!1;const y={invalid:()=>i.toSingleLine` + The license key for Handsontable is invalid.\x20 + If you need any help, contact us at support@handsontable.com.`,expired:e=>{let{keyValidityDate:t,hotVersion:r}=e;return i.toSingleLine` + The license key for Handsontable expired on ${t}, and is not valid for the installed\x20 + version ${r}. Renew your license key at handsontable.com or downgrade to a version released prior\x20 + to ${t}. If you need any help, contact us at sales@handsontable.com.`},missing:()=>i.toSingleLine` + The license key for Handsontable is missing. Use your purchased key to activate the product.\x20 + Alternatively, you can activate Handsontable to use for non-commercial purposes by\x20 + passing the key: 'non-commercial-and-evaluation'. If you need any help, contact\x20 + us at support@handsontable.com.`,non_commercial:()=>""},E={invalid:()=>i.toSingleLine` + The license key for Handsontable is invalid.\x20 + Read more on how to\x20 + install it properly or contact us at support@handsontable.com.`,expired:e=>{let{keyValidityDate:t,hotVersion:r}=e;return i.toSingleLine` + The license key for Handsontable expired on ${t}, and is not valid for the installed\x20 + version ${r}. Renew your\x20 + license key or downgrade to a version released prior to ${t}. If you need any\x20 + help, contact us at sales@handsontable.com.`},missing:()=>i.toSingleLine` + The license key for Handsontable is missing. Use your purchased key to activate the product.\x20 + Alternatively, you can activate Handsontable to use for non-commercial purposes by\x20 + passing the key: 'non-commercial-and-evaluation'.\x20 + Read more about it in\x20 + the documentation or contact us at support@handsontable.com.`,non_commercial:()=>""}},4980:(e,t,r)=>{"use strict";t.__esModule=!0,t.getMoves=function(e,t,r){return function(e){return e.forEach(((t,r)=>{e.slice(r+1).forEach((e=>{const r=e.fromt.from&&r&&(e.from-=1)}))})),e}(function(e,t){const r=[];return e.forEach((e=>{const n={from:e,to:t};r.forEach((e=>{const t=e.from>e.to,r=e.to<=n.from;e.from>n.from&&r&&t&&(n.from+=1)})),n.from>=t&&(t+=1),r.push(n)})),r}(e,function(e,t,r){const n=Array.from(Array(r).keys()).filter((t=>!1===e.includes(t)));var s;return 0===t?null!==(s=n[t])&&void 0!==s?s:0:n[t-1]+1}(e,t,r)))},r(15724),r(14846),r(27458),r(69655)},22137:(e,t,r)=>{"use strict";function n(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const r=typeof e;if("number"===r)return!isNaN(e)&&isFinite(e);if("string"===r){if(0===e.length)return!1;if(1===e.length)return/\d/.test(e);const r=Array.from(new Set([".",...t])).map((e=>`\\${e}`)).join("|");return new RegExp(`^[+-]?(((${r})?\\d+((${r})\\d+)?(e[+-]?\\d+)?)|(0x[a-f\\d]+))$`,"i").test(e.trim())}return"object"===r&&!(!e||"number"!=typeof e.valueOf()||e instanceof Date)}t.__esModule=!0,t.clamp=function(e,t,r){if(Math.min(e,t)===e)return t;if(Math.max(e,r)===e)return r;return e},t.isNumeric=n,t.isNumericLike=function(e){return n(e,[","])},t.rangeEach=function(e,t,r){let n=-1;"function"==typeof t?(r=t,t=e):n=e-1;for(;++n<=t&&!1!==r(n););},t.rangeEachReverse=function(e,t,r){let n=e+1;"function"==typeof t&&(r=t,t=0);for(;--n>=t&&!1!==r(n););},t.valueAccordingPercent=function(e,t){return t=parseInt(t.toString().replace("%",""),10),t=isNaN(t)?0:t,parseInt(e*t/100,10)},r(71336),r(41558),r(17663),r(68630),r(79645),r(89858),r(8620),r(94364)},25499:(e,t,r)=>{"use strict";t.__esModule=!0,t.clone=function(e){const t={};return o(e,((e,r)=>{t[r]=e})),t},t.createObjectPropListener=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"value";const r=`_${t}`,n={_touched:!1,[r]:e,isTouched(){return this._touched}};return Object.defineProperty(n,t,{get(){return this[r]},set(e){this._touched=!0,this[r]=e},enumerable:!0,configurable:!0}),n},t.deepClone=s,t.deepExtend=function e(t,r){o(r,((n,s)=>{r[s]&&"object"==typeof r[s]?(t[s]||(Array.isArray(r[s])?t[s]=[]:"[object Date]"===Object.prototype.toString.call(r[s])?t[s]=r[s]:t[s]={}),e(t[s],r[s])):t[s]=r[s]}))},t.deepObjectSize=function(e){if(!i(e))return 0;const t=function(e){let r=0;return i(e)?o(e,((e,n)=>{"__children"!==n&&(r+=t(e))})):r+=1,r};return t(e)},t.defineGetter=function(e,t,r,n){n.value=r,n.writable=!1!==n.writable,n.enumerable=!1!==n.enumerable,n.configurable=!1!==n.configurable,Object.defineProperty(e,t,n)},t.duckSchema=function e(t){let r;Array.isArray(t)?r=t.length?new Array(t.length).fill(null):[]:(r={},o(t,((t,n)=>{"__children"!==n&&(t&&"object"==typeof t&&!Array.isArray(t)?r[n]=e(t):Array.isArray(t)?t.length&&"object"==typeof t[0]&&!Array.isArray(t[0])?r[n]=[e(t[0])]:r[n]=[]:r[n]=null)})));return r},t.extend=function(e,t,r){const n=Array.isArray(r);return o(t,((t,s)=>{(!1===n||r.includes(s))&&(e[s]=t)})),e},t.getProperty=function(e,t){const r=t.split(".");let n=e;return o(r,(e=>{if(n=n[e],void 0===n)return n=void 0,!1})),n},t.hasOwnProperty=a,t.inherit=function(e,t){return t.prototype.constructor=t,e.prototype=new t,e.prototype.constructor=e,e},t.isObject=i,t.isObjectEqual=function(e,t){return JSON.stringify(e)===JSON.stringify(t)},t.mixin=function(e){e.MIXINS||(e.MIXINS=[]);for(var t=arguments.length,r=new Array(t>1?t-1:0),a=1;a{e.MIXINS.push(t.MIXIN_NAME),o(t,((t,r)=>{if(void 0!==e.prototype[r])throw new Error(`Mixin conflict. Property '${r}' already exist and cannot be overwritten.`);if("function"==typeof t)e.prototype[r]=t;else{const n=function(e,t){const r=`_${e}`;return function(){return void 0===this[r]&&(this[r]=(e=>{let t=e;return(Array.isArray(t)||i(t))&&(t=s(t)),t})(t)),this[r]}},o=function(e){const t=`_${e}`;return function(e){this[t]=e}};Object.defineProperty(e.prototype,r,{get:n(r,t),set:o(r),configurable:!0})}}))})),e},t.objectEach=o,t.setProperty=function(e,t,r){const n=t.split(".");let s=e;n.forEach(((e,t)=>{"__proto__"!==e&&"constructor"!==e&&"prototype"!==e&&(t!==n.length-1?(a(s,e)||(s[e]={}),s=s[e]):s[e]=r)}))},r(67834),r(15724),r(66184),r(14846),r(69655);var n=r(10587);function s(e){return"object"==typeof e?JSON.parse(JSON.stringify(e)):e}function i(e){return"[object Object]"===Object.prototype.toString.call(e)}function o(e,t){for(const r in e)if((!e.hasOwnProperty||e.hasOwnProperty&&Object.prototype.hasOwnProperty.call(e,r))&&!1===t(e[r],r,e))break;return e}function a(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},5893:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,t.equalsIgnoreCase=function(){const e=[];for(var t=arguments.length,r=new Array(t),n=0;n1&&void 0!==arguments[1]?arguments[1]:{};return`${e}`.replace(/(?:\\)?\[([^[\]]+)]/g,((e,r)=>"\\"===e.charAt(0)?e.substr(1,e.length-1):void 0===t[r]?"":t[r]))},t.toUpperCaseFirst=function(e){return e[0].toUpperCase()+e.substr(1)},r(15724);var s=n(r(98339)),i=r(70505);function o(e,t){return s.default.sanitize(e,t)}},21595:(e,t,r)=>{"use strict";t.__esModule=!0,t.toSingleLine=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),s=1;se+t.replace(/\r?\n\s*/g,"")+(r[n]?r[n]:"")),"").trim()};var n=r(10587)},73618:(e,t,r)=>{"use strict";t.__esModule=!0,t.getThemeClassName=function(e){const{classNames:t}=(0,n.findFirstParentWithClass)(e,/ht-theme-[a-zA-Z0-9_-]+/);return t.pop()};var n=r(62577)},83445:(e,t,r)=>{"use strict";t.__esModule=!0,t.isCtrlKey=function(e){const t=[];(0,s.isMacOS)()?t.push(i.COMMAND_LEFT,i.COMMAND_RIGHT,i.COMMAND_FIREFOX):t.push(i.CONTROL);return t.includes(e)},t.isCtrlMetaKey=function(e){return[i.CONTROL,i.COMMAND_LEFT,i.COMMAND_RIGHT,i.COMMAND_FIREFOX].includes(e)},t.isFunctionKey=function(e){return o.includes(e)},t.isKey=function(e,t){const r=t.split("|");let s=!1;return(0,n.arrayEach)(r,(t=>{if(e===i[t])return s=!0,!1})),s},t.isPrintableChar=function(e){return 32===e||e>=48&&e<=57||e>=96&&e<=111||e>=186&&e<=192||e>=219&&e<=222||e>=226||e>=65&&e<=90},r(15724);var n=r(10587),s=r(25046);const i=t.KEY_CODES={ALT:18,ARROW_DOWN:40,ARROW_LEFT:37,ARROW_RIGHT:39,ARROW_UP:38,AUDIO_DOWN:(0,s.isFirefox)()?182:174,AUDIO_MUTE:(0,s.isFirefox)()?181:173,AUDIO_UP:(0,s.isFirefox)()?183:175,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND_LEFT:91,COMMAND_RIGHT:93,COMMAND_FIREFOX:224,CONTROL:17,DELETE:46,END:35,ENTER:13,ESCAPE:27,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,F13:124,F14:125,F15:126,F16:127,F17:128,F18:129,F19:130,HOME:36,INSERT:45,MEDIA_NEXT:176,MEDIA_PLAY_PAUSE:179,MEDIA_PREV:177,MEDIA_STOP:178,NULL:0,NUM_LOCK:144,PAGE_DOWN:34,PAGE_UP:33,PAUSE:19,PERIOD:190,SCROLL_LOCK:145,SHIFT:16,SPACE:32,TAB:9,A:65,C:67,D:68,F:70,L:76,O:79,P:80,S:83,V:86,X:88,Y:89,Z:90},o=[i.ALT,i.ARROW_DOWN,i.ARROW_LEFT,i.ARROW_RIGHT,i.ARROW_UP,i.AUDIO_DOWN,i.AUDIO_MUTE,i.AUDIO_UP,i.BACKSPACE,i.CAPS_LOCK,i.DELETE,i.END,i.ENTER,i.ESCAPE,i.F1,i.F2,i.F3,i.F4,i.F5,i.F6,i.F7,i.F8,i.F9,i.F10,i.F11,i.F12,i.F13,i.F14,i.F15,i.F16,i.F17,i.F18,i.F19,i.HOME,i.INSERT,i.MEDIA_NEXT,i.MEDIA_PLAY_PAUSE,i.MEDIA_PREV,i.MEDIA_STOP,i.NULL,i.NUM_LOCK,i.PAGE_DOWN,i.PAGE_UP,i.PAUSE,i.SCROLL_LOCK,i.SHIFT,i.TAB]},29861:(e,t,r)=>{"use strict";t.__esModule=!0,t.default=function(e){const t="undefined"!=typeof window&&window.jQuery;if(!t)return;t.fn.handsontable=function(t){const r=this.first();let n,s=r.data("handsontable");if("string"!=typeof t){const n=t||{};return s?s.updateSettings(n):(s=new e.Core(r[0],n),r.data("handsontable",s),s.init()),r}if(s){if(void 0===s[t])throw new Error(`Handsontable do not provide action: ${t}`);for(var i=arguments.length,o=new Array(i>1?i-1:0),a=1;a{"use strict";t.__esModule=!0;const r=t.CONTEXT_MENU_ITEMS_NAMESPACE="ContextMenu:items",n=(t.CONTEXTMENU_ITEMS_NO_ITEMS=`${r}.noItems`,t.CONTEXTMENU_ITEMS_ROW_ABOVE=`${r}.insertRowAbove`,t.CONTEXTMENU_ITEMS_ROW_BELOW=`${r}.insertRowBelow`,t.CONTEXTMENU_ITEMS_INSERT_LEFT=`${r}.insertColumnOnTheLeft`,t.CONTEXTMENU_ITEMS_INSERT_RIGHT=`${r}.insertColumnOnTheRight`,t.CONTEXTMENU_ITEMS_REMOVE_ROW=`${r}.removeRow`,t.CONTEXTMENU_ITEMS_REMOVE_COLUMN=`${r}.removeColumn`,t.CONTEXTMENU_ITEMS_UNDO=`${r}.undo`,t.CONTEXTMENU_ITEMS_REDO=`${r}.redo`,t.CONTEXTMENU_ITEMS_READ_ONLY=`${r}.readOnly`,t.CONTEXTMENU_ITEMS_CLEAR_COLUMN=`${r}.clearColumn`,t.CONTEXTMENU_ITEMS_COPY=`${r}.copy`,t.CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_HEADERS=`${r}.copyWithHeaders`,t.CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_GROUP_HEADERS=`${r}.copyWithGroupHeaders`,t.CONTEXTMENU_ITEMS_COPY_COLUMN_HEADERS_ONLY=`${r}.copyHeadersOnly`,t.CONTEXTMENU_ITEMS_CUT=`${r}.cut`,t.CONTEXTMENU_ITEMS_FREEZE_COLUMN=`${r}.freezeColumn`,t.CONTEXTMENU_ITEMS_UNFREEZE_COLUMN=`${r}.unfreezeColumn`,t.CONTEXTMENU_ITEMS_MERGE_CELLS=`${r}.mergeCells`,t.CONTEXTMENU_ITEMS_UNMERGE_CELLS=`${r}.unmergeCells`,t.CONTEXTMENU_ITEMS_ADD_COMMENT=`${r}.addComment`,t.CONTEXTMENU_ITEMS_EDIT_COMMENT=`${r}.editComment`,t.CONTEXTMENU_ITEMS_REMOVE_COMMENT=`${r}.removeComment`,t.CONTEXTMENU_ITEMS_READ_ONLY_COMMENT=`${r}.readOnlyComment`,t.CONTEXTMENU_ITEMS_ALIGNMENT=`${r}.align`,t.CONTEXTMENU_ITEMS_ALIGNMENT_LEFT=`${r}.align.left`,t.CONTEXTMENU_ITEMS_ALIGNMENT_CENTER=`${r}.align.center`,t.CONTEXTMENU_ITEMS_ALIGNMENT_RIGHT=`${r}.align.right`,t.CONTEXTMENU_ITEMS_ALIGNMENT_JUSTIFY=`${r}.align.justify`,t.CONTEXTMENU_ITEMS_ALIGNMENT_TOP=`${r}.align.top`,t.CONTEXTMENU_ITEMS_ALIGNMENT_MIDDLE=`${r}.align.middle`,t.CONTEXTMENU_ITEMS_ALIGNMENT_BOTTOM=`${r}.align.bottom`,t.CONTEXTMENU_ITEMS_BORDERS=`${r}.borders`,t.CONTEXTMENU_ITEMS_BORDERS_TOP=`${r}.borders.top`,t.CONTEXTMENU_ITEMS_BORDERS_RIGHT=`${r}.borders.right`,t.CONTEXTMENU_ITEMS_BORDERS_BOTTOM=`${r}.borders.bottom`,t.CONTEXTMENU_ITEMS_BORDERS_LEFT=`${r}.borders.left`,t.CONTEXTMENU_ITEMS_REMOVE_BORDERS=`${r}.borders.remove`,t.CONTEXTMENU_ITEMS_NESTED_ROWS_INSERT_CHILD=`${r}.nestedHeaders.insertChildRow`,t.CONTEXTMENU_ITEMS_NESTED_ROWS_DETACH_CHILD=`${r}.nestedHeaders.detachFromParent`,t.CONTEXTMENU_ITEMS_HIDE_COLUMN=`${r}.hideColumn`,t.CONTEXTMENU_ITEMS_SHOW_COLUMN=`${r}.showColumn`,t.CONTEXTMENU_ITEMS_HIDE_ROW=`${r}.hideRow`,t.CONTEXTMENU_ITEMS_SHOW_ROW=`${r}.showRow`,t.FILTERS_NAMESPACE="Filters:"),s=t.FILTERS_CONDITIONS_NAMESPACE=`${n}conditions`,i=(t.FILTERS_CONDITIONS_NONE=`${s}.none`,t.FILTERS_CONDITIONS_EMPTY=`${s}.isEmpty`,t.FILTERS_CONDITIONS_NOT_EMPTY=`${s}.isNotEmpty`,t.FILTERS_CONDITIONS_EQUAL=`${s}.isEqualTo`,t.FILTERS_CONDITIONS_NOT_EQUAL=`${s}.isNotEqualTo`,t.FILTERS_CONDITIONS_BEGINS_WITH=`${s}.beginsWith`,t.FILTERS_CONDITIONS_ENDS_WITH=`${s}.endsWith`,t.FILTERS_CONDITIONS_CONTAINS=`${s}.contains`,t.FILTERS_CONDITIONS_NOT_CONTAIN=`${s}.doesNotContain`,t.FILTERS_CONDITIONS_BY_VALUE=`${s}.byValue`,t.FILTERS_CONDITIONS_GREATER_THAN=`${s}.greaterThan`,t.FILTERS_CONDITIONS_GREATER_THAN_OR_EQUAL=`${s}.greaterThanOrEqualTo`,t.FILTERS_CONDITIONS_LESS_THAN=`${s}.lessThan`,t.FILTERS_CONDITIONS_LESS_THAN_OR_EQUAL=`${s}.lessThanOrEqualTo`,t.FILTERS_CONDITIONS_BETWEEN=`${s}.isBetween`,t.FILTERS_CONDITIONS_NOT_BETWEEN=`${s}.isNotBetween`,t.FILTERS_CONDITIONS_AFTER=`${s}.after`,t.FILTERS_CONDITIONS_BEFORE=`${s}.before`,t.FILTERS_CONDITIONS_TODAY=`${s}.today`,t.FILTERS_CONDITIONS_TOMORROW=`${s}.tomorrow`,t.FILTERS_CONDITIONS_YESTERDAY=`${s}.yesterday`,t.FILTERS_DIVS_FILTER_BY_CONDITION=`${n}labels.filterByCondition`,t.FILTERS_DIVS_FILTER_BY_VALUE=`${n}labels.filterByValue`,t.FILTERS_LABELS_CONJUNCTION=`${n}labels.conjunction`,t.FILTERS_LABELS_DISJUNCTION=`${n}labels.disjunction`,t.FILTERS_VALUES_BLANK_CELLS=`${n}values.blankCells`,t.FILTERS_BUTTONS_SELECT_ALL=`${n}buttons.selectAll`,t.FILTERS_BUTTONS_CLEAR=`${n}buttons.clear`,t.FILTERS_BUTTONS_OK=`${n}buttons.ok`,t.FILTERS_BUTTONS_CANCEL=`${n}buttons.cancel`,t.FILTERS_BUTTONS_PLACEHOLDER_SEARCH=`${n}buttons.placeholder.search`,t.FILTERS_BUTTONS_PLACEHOLDER_VALUE=`${n}buttons.placeholder.value`,t.FILTERS_BUTTONS_PLACEHOLDER_SECOND_VALUE=`${n}buttons.placeholder.secondValue`,t.CHECKBOX_RENDERER_NAMESPACE="CheckboxRenderer:");t.CHECKBOX_CHECKED=`${i}checked`,t.CHECKBOX_UNCHECKED=`${i}unchecked`},42303:(e,t,r)=>{"use strict";t.__esModule=!0;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=s(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n +/** + * @preserve + * Authors: Handsoncode + * Last updated: Nov 15, 2017 + * + * Description: Definition file for English - United States language-country. + */}(r(23384));function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(s=function(e){return e?r:t})(e)}const i={languageCode:"en-US",[n.CONTEXTMENU_ITEMS_NO_ITEMS]:"No available options",[n.CONTEXTMENU_ITEMS_ROW_ABOVE]:"Insert row above",[n.CONTEXTMENU_ITEMS_ROW_BELOW]:"Insert row below",[n.CONTEXTMENU_ITEMS_INSERT_LEFT]:"Insert column left",[n.CONTEXTMENU_ITEMS_INSERT_RIGHT]:"Insert column right",[n.CONTEXTMENU_ITEMS_REMOVE_ROW]:["Remove row","Remove rows"],[n.CONTEXTMENU_ITEMS_REMOVE_COLUMN]:["Remove column","Remove columns"],[n.CONTEXTMENU_ITEMS_UNDO]:"Undo",[n.CONTEXTMENU_ITEMS_REDO]:"Redo",[n.CONTEXTMENU_ITEMS_READ_ONLY]:"Read only",[n.CONTEXTMENU_ITEMS_CLEAR_COLUMN]:"Clear column",[n.CONTEXTMENU_ITEMS_ALIGNMENT]:"Alignment",[n.CONTEXTMENU_ITEMS_ALIGNMENT_LEFT]:"Left",[n.CONTEXTMENU_ITEMS_ALIGNMENT_CENTER]:"Center",[n.CONTEXTMENU_ITEMS_ALIGNMENT_RIGHT]:"Right",[n.CONTEXTMENU_ITEMS_ALIGNMENT_JUSTIFY]:"Justify",[n.CONTEXTMENU_ITEMS_ALIGNMENT_TOP]:"Top",[n.CONTEXTMENU_ITEMS_ALIGNMENT_MIDDLE]:"Middle",[n.CONTEXTMENU_ITEMS_ALIGNMENT_BOTTOM]:"Bottom",[n.CONTEXTMENU_ITEMS_FREEZE_COLUMN]:"Freeze column",[n.CONTEXTMENU_ITEMS_UNFREEZE_COLUMN]:"Unfreeze column",[n.CONTEXTMENU_ITEMS_BORDERS]:"Borders",[n.CONTEXTMENU_ITEMS_BORDERS_TOP]:"Top",[n.CONTEXTMENU_ITEMS_BORDERS_RIGHT]:"Right",[n.CONTEXTMENU_ITEMS_BORDERS_BOTTOM]:"Bottom",[n.CONTEXTMENU_ITEMS_BORDERS_LEFT]:"Left",[n.CONTEXTMENU_ITEMS_REMOVE_BORDERS]:"Remove border(s)",[n.CONTEXTMENU_ITEMS_ADD_COMMENT]:"Add comment",[n.CONTEXTMENU_ITEMS_EDIT_COMMENT]:"Edit comment",[n.CONTEXTMENU_ITEMS_REMOVE_COMMENT]:"Delete comment",[n.CONTEXTMENU_ITEMS_READ_ONLY_COMMENT]:"Read-only comment",[n.CONTEXTMENU_ITEMS_MERGE_CELLS]:"Merge cells",[n.CONTEXTMENU_ITEMS_UNMERGE_CELLS]:"Unmerge cells",[n.CONTEXTMENU_ITEMS_COPY]:"Copy",[n.CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_HEADERS]:["Copy with header","Copy with headers"],[n.CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_GROUP_HEADERS]:["Copy with group header","Copy with group headers"],[n.CONTEXTMENU_ITEMS_COPY_COLUMN_HEADERS_ONLY]:["Copy header only","Copy headers only"],[n.CONTEXTMENU_ITEMS_CUT]:"Cut",[n.CONTEXTMENU_ITEMS_NESTED_ROWS_INSERT_CHILD]:"Insert child row",[n.CONTEXTMENU_ITEMS_NESTED_ROWS_DETACH_CHILD]:"Detach from parent",[n.CONTEXTMENU_ITEMS_HIDE_COLUMN]:["Hide column","Hide columns"],[n.CONTEXTMENU_ITEMS_SHOW_COLUMN]:["Show column","Show columns"],[n.CONTEXTMENU_ITEMS_HIDE_ROW]:["Hide row","Hide rows"],[n.CONTEXTMENU_ITEMS_SHOW_ROW]:["Show row","Show rows"],[n.FILTERS_CONDITIONS_NONE]:"None",[n.FILTERS_CONDITIONS_EMPTY]:"Is empty",[n.FILTERS_CONDITIONS_NOT_EMPTY]:"Is not empty",[n.FILTERS_CONDITIONS_EQUAL]:"Is equal to",[n.FILTERS_CONDITIONS_NOT_EQUAL]:"Is not equal to",[n.FILTERS_CONDITIONS_BEGINS_WITH]:"Begins with",[n.FILTERS_CONDITIONS_ENDS_WITH]:"Ends with",[n.FILTERS_CONDITIONS_CONTAINS]:"Contains",[n.FILTERS_CONDITIONS_NOT_CONTAIN]:"Does not contain",[n.FILTERS_CONDITIONS_GREATER_THAN]:"Greater than",[n.FILTERS_CONDITIONS_GREATER_THAN_OR_EQUAL]:"Greater than or equal to",[n.FILTERS_CONDITIONS_LESS_THAN]:"Less than",[n.FILTERS_CONDITIONS_LESS_THAN_OR_EQUAL]:"Less than or equal to",[n.FILTERS_CONDITIONS_BETWEEN]:"Is between",[n.FILTERS_CONDITIONS_NOT_BETWEEN]:"Is not between",[n.FILTERS_CONDITIONS_AFTER]:"After",[n.FILTERS_CONDITIONS_BEFORE]:"Before",[n.FILTERS_CONDITIONS_TODAY]:"Today",[n.FILTERS_CONDITIONS_TOMORROW]:"Tomorrow",[n.FILTERS_CONDITIONS_YESTERDAY]:"Yesterday",[n.FILTERS_VALUES_BLANK_CELLS]:"Blank cells",[n.FILTERS_DIVS_FILTER_BY_CONDITION]:"Filter by condition",[n.FILTERS_DIVS_FILTER_BY_VALUE]:"Filter by value",[n.FILTERS_LABELS_CONJUNCTION]:"And",[n.FILTERS_LABELS_DISJUNCTION]:"Or",[n.FILTERS_BUTTONS_SELECT_ALL]:"Select all",[n.FILTERS_BUTTONS_CLEAR]:"Clear",[n.FILTERS_BUTTONS_OK]:"OK",[n.FILTERS_BUTTONS_CANCEL]:"Cancel",[n.FILTERS_BUTTONS_PLACEHOLDER_SEARCH]:"Search",[n.FILTERS_BUTTONS_PLACEHOLDER_VALUE]:"Value",[n.FILTERS_BUTTONS_PLACEHOLDER_SECOND_VALUE]:"Second value",[n.CHECKBOX_CHECKED]:"Checked",[n.CHECKBOX_UNCHECKED]:"Unchecked"};t.default=i},83048:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,t.getPhraseFormatters=t.getAll=function(){return a()},t.registerPhraseFormatter=t.register=l;var s=n(r(28651)),i=n(r(11796));const{register:o,getValues:a}=(0,s.default)("phraseFormatters");function l(e,t){o(e,t)}l("pluralize",i.default)},11796:(e,t)=>{"use strict";t.__esModule=!0,t.default=function(e,t){if(Array.isArray(e)&&Number.isInteger(t))return e[t];return e}},58570:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,t.getDefaultLanguageDictionary=function(){return u.default},t.getLanguageDictionary=w,t.getLanguagesDictionaries=function(){return y()},t.getTranslatedPhrase=function(e,t,r){const n=w(e);if(null===n)return null;const s=n[t];if((0,o.isUndefined)(s))return null;const a=function(e,t){let r=e;return(0,i.arrayEach)((0,h.getPhraseFormatters)(),(n=>{r=n(e,t)})),r}(s,r);if(Array.isArray(a))return a[0];return a},t.getValidLanguageCode=function(e){let t=(0,a.normalizeLanguageCode)(e);C(t)||(t=p,(0,a.warnUserAboutLanguageRegistration)(e));return t},t.hasLanguageDictionary=C,t.registerLanguageDictionary=E;var s=r(25499),i=r(10587),o=r(70505),a=r(1052),l=n(r(28651)),h=r(83048),u=n(r(42303)),c=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=d(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var o=s?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(n,i,o):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n}(r(23384));function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(d=function(e){return e?r:t})(e)}t.dictionaryKeys=c;const p=t.DEFAULT_LANGUAGE_CODE=u.default.languageCode,{register:g,getItem:f,hasItem:m,getValues:y}=(0,l.default)("languagesDictionaries");function E(e,t){let r=e,n=t;return(0,s.isObject)(e)&&(n=e,r=n.languageCode),function(e,t){e!==p&&(0,a.extendNotExistingKeys)(t,f(p))}(r,n),g(r,(0,s.deepClone)(n)),(0,s.deepClone)(n)}function w(e){return C(e)?(0,s.deepClone)(f(e)):null}function C(e){return m(e)}E(u.default)},1052:(e,t,r)=>{"use strict";t.__esModule=!0,t.createCellHeadersRange=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t,[s,i]=[r,n];e>t&&([s,i]=[i,s]);return`${s}-${i}`},t.extendNotExistingKeys=function(e,t){return(0,s.objectEach)(t,((t,r)=>{(0,n.isUndefined)(e[r])&&(e[r]=t)})),e},t.normalizeLanguageCode=function(e){const t=/^([a-zA-Z]{2})-([a-zA-Z]{2})$/.exec(e);if(t)return`${t[1].toLowerCase()}-${t[2].toUpperCase()}`;return e},t.warnUserAboutLanguageRegistration=function(e){(0,n.isDefined)(e)&&(0,i.error)(o.toSingleLine`Language with code "${e}" was not found. You should register particular language\x20 + before using it. Read more about this issue at: https://docs.handsontable.com/i18n/missing-language-code.`)};var n=r(70505),s=r(25499),i=r(14859),o=r(21595)},70292:(e,t,r)=>{"use strict";t.__esModule=!0,r(15724);var n=r(10587),s=r(25499);const i={_hooksStorage:Object.create(null),addHook(e,t){return this._hooksStorage[e]||(this._hooksStorage[e]=[]),this.hot.addHook(e,t),this._hooksStorage[e].push(t),this},removeHooksByKey(e){(0,n.arrayEach)(this._hooksStorage[e]||[],(t=>{this.hot.removeHook(e,t)}))},clearHooks(){(0,s.objectEach)(this._hooksStorage,((e,t)=>this.removeHooksByKey(t))),this._hooksStorage={}}};(0,s.defineGetter)(i,"MIXIN_NAME","hooksRefRegisterer",{writable:!1,enumerable:!1});t.default=i},16050:(e,t,r)=>{"use strict";t.__esModule=!0,r(15724);var n=r(25499),s=r(89804);const i={_localHooks:Object.create(null),addLocalHook(e,t){return this._localHooks[e]||(this._localHooks[e]=[]),this._localHooks[e].push(t),this},runLocalHooks(e,t,r,n,i,o,a){if(this._localHooks[e]){const l=this._localHooks[e].length;for(let h=0;h{"use strict";var n=r(96784);t.__esModule=!0,r(67834),r(15724),r(14846),r(27458),r(69655),r(90458);var s=n(r(85707)),i=r(75089),o=r(85992),a=n(r(4965)),l=r(28197),h=r(25499),u=r(22137),c=n(r(93968)),d=r(5893),p=r(50206),g=r(61149);function f(e,t,r){m(e,t),t.set(e,r)}function m(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function y(e,t){return e.get(w(e,t))}function E(e,t,r){return e.set(w(e,t),r),r}function w(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}l.Hooks.getSingleton().register("modifyAutoColumnSizeSeed");const C=t.PLUGIN_KEY="autoColumnSize",v=t.PLUGIN_PRIORITY=10;var R=new WeakMap,S=new WeakMap,T=new WeakSet;class N extends i.BasePlugin{static get PLUGIN_KEY(){return C}static get PLUGIN_PRIORITY(){return v}static get SETTING_KEYS(){return!0}static get DEFAULT_SETTINGS(){return{useHeaders:!0,samplingRatio:null,allowSampleDuplicates:!1}}static get CALCULATION_STEP(){return 50}static get SYNC_CALCULATION_LIMIT(){return 50}constructor(e){var t,r;super(e),m(t=this,r=T),r.add(t),(0,s.default)(this,"ghostTable",new a.default(this.hot)),(0,s.default)(this,"samplesGenerator",new c.default(((e,t)=>{const r=this.hot.toPhysicalRow(e),n=this.hot.toPhysicalColumn(t);if(this.hot.rowIndexMapper.isHidden(r)||this.hot.columnIndexMapper.isHidden(n))return!1;const s=this.hot.getCellMeta(e,t);let i="";s.spanned||(i=this.hot.getDataAtCell(e,t));let o="";return this.hot.hasHook("modifyAutoColumnSizeSeed")&&(o=this.hot.runHooks("modifyAutoColumnSizeSeed",o,s,i)),{value:i,bundleSeed:o}}))),(0,s.default)(this,"inProgress",!1),(0,s.default)(this,"measuredColumns",0),(0,s.default)(this,"columnWidthsMap",new g.PhysicalIndexToValueMap),f(this,R,[]),f(this,S,[]),this.hot.columnIndexMapper.registerMap("autoColumnSize",this.columnWidthsMap),this.addHook("beforeColumnResize",((e,t,r)=>w(T,this,A).call(this,e,t,r)))}isEnabled(){return!1!==this.hot.getSettings()[C]&&!this.hot.getSettings().colWidths}enablePlugin(){var e=this;if(this.enabled)return;this.ghostTable.setSetting("useHeaders",this.getSetting("useHeaders")),this.samplesGenerator.setAllowDuplicates(this.getSetting("allowSampleDuplicates"));const t=this.getSetting("samplingRatio");t&&!isNaN(t)&&this.samplesGenerator.setSampleCount(parseInt(t,10)),this.addHook("afterLoadData",(function(){for(var t=arguments.length,r=new Array(t),n=0;nw(T,this,_).call(this))),this.addHook("modifyColWidth",((e,t)=>this.getColumnWidth(t,e))),this.addHook("init",(()=>w(T,this,I).call(this))),super.enablePlugin()}updatePlugin(){E(S,this,this.findColumnsWhereHeaderWasChanged()),super.updatePlugin()}disablePlugin(){super.disablePlugin(),this.addHook("beforeColumnResize",((e,t,r)=>w(T,this,A).call(this,e,t,r)))}calculateVisibleColumnsWidth(){if(!this.hot.countRows())return;const e=this.getFirstVisibleColumn(),t=this.getLastVisibleColumn();if(-1===e||-1===t)return;const r=this.hot.renderCall;this.calculateColumnsWidth({from:e,to:t},void 0,r)}calculateColumnsWidth(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countCols()-1},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{from:0,to:this.hot.countRows()-1},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const n="number"==typeof e?{from:e,to:e}:e,s="number"==typeof t?{from:t,to:t}:t;(0,u.rangeEach)(n.from,n.to,(e=>{let t=this.hot.toPhysicalColumn(e);if(null===t&&(t=e),r||null===this.columnWidthsMap.getValueAtIndex(t)&&!this.hot._getColWidthFromSettings(t)){this.samplesGenerator.generateColumnSamples(e,s).forEach(((e,t)=>this.ghostTable.addColumn(t,e)))}})),this.ghostTable.columns.length&&(this.hot.batchExecution((()=>{this.ghostTable.getWidths(((e,t)=>{const r=this.hot.toPhysicalColumn(e);this.columnWidthsMap.setValueAtIndex(r,t)}))}),!0),this.measuredColumns=n.to+1,this.ghostTable.clean())}calculateAllColumnsWidth(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countRows()-1},t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=0;const n=this.hot.countCols()-1;let s=null;this.inProgress=!0;const i=()=>{if(!this.hot)return(0,o.cancelAnimationFrame)(s),void(this.inProgress=!1);this.calculateColumnsWidth({from:r,to:Math.min(r+N.CALCULATION_STEP,n)},e,t),r=r+N.CALCULATION_STEP+1,r=0&&(this.calculateColumnsWidth({from:0,to:a},e,t),r=a+1),r>=0),Math.min(t,r)}getColumnWidth(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=t;return void 0===n&&(n=this.columnWidthsMap.getValueAtIndex(this.hot.toPhysicalColumn(e)),r&&"number"==typeof n&&(n=Math.max(n,p.DEFAULT_COLUMN_WIDTH))),n}getFirstVisibleColumn(){var e;return null!==(e=this.hot.getFirstRenderedVisibleColumn())&&void 0!==e?e:-1}getLastVisibleColumn(){var e;return null!==(e=this.hot.getLastRenderedVisibleColumn())&&void 0!==e?e:-1}findColumnsWhereHeaderWasChanged(){return this.hot.getColHeader().reduce(((e,t,r)=>{const n=y(R,this).length;return(n-1{e.forEach((e=>{this.columnWidthsMap.setValueAtIndex(e,null)}))}),!0):this.columnWidthsMap.clear()}isNeedRecalculate(){return!!this.columnWidthsMap.getValues().slice(0,this.measuredColumns).filter((e=>null===e)).length}destroy(){this.ghostTable.clean(),super.destroy()}}function M(e){const t={from:0,to:this.hot.countRows()-1};e.forEach((e=>{const r=this.hot.toPhysicalColumn(e);if(null!==r&&!this.hot._getColWidthFromSettings(r)){this.samplesGenerator.generateColumnSamples(e,t).forEach(((e,t)=>this.ghostTable.addColumn(t,e)))}})),this.ghostTable.columns.length&&(this.hot.batchExecution((()=>{this.ghostTable.getWidths(((e,t)=>{const r=this.hot.toPhysicalColumn(e);this.columnWidthsMap.setValueAtIndex(r,t)}))}),!0),this.ghostTable.clean())}function _(){this.calculateVisibleColumnsWidth(),this.inProgress||(w(T,this,M).call(this,y(S,this)),E(S,this,[]))}function b(e,t){t||this.recalculateAllColumnsWidth()}function O(e){const t=e.reduce(((e,t)=>{let[,r]=t;const n=this.hot.propToCol(r);return Number.isInteger(n)&&-1===e.indexOf(n)&&e.push(n),e}),[]);y(S,this).push(...t)}function A(e,t,r){let n=e;return r&&(this.calculateColumnsWidth(t,void 0,!0),n=this.getColumnWidth(t,void 0,!1)),n}function I(){E(R,this,this.hot.getColHeader()),this.recalculateAllColumnsWidth()}function x(e){const t=e.reduce(((e,t)=>{var r;const n=null===(r=t.address)||void 0===r?void 0:r.col;if(Number.isInteger(n)){const t=this.hot.toVisualColumn(n);-1===e.indexOf(t)&&e.push(t)}return e}),[]);y(S,this).push(...t)}t.AutoColumnSize=N},49912:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(2998);t.PLUGIN_KEY=n.PLUGIN_KEY,t.PLUGIN_PRIORITY=n.PLUGIN_PRIORITY,t.AutoColumnSize=n.AutoColumnSize},7496:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834),r(15724),r(14846),r(27458),r(69655),r(90458);var s=n(r(85707)),i=r(75089),o=r(85992),a=n(r(4965)),l=r(25499),h=r(22137),u=n(r(93968)),c=r(5893),d=r(61149);function p(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function g(e,t){return e.get(f(e,t))}function f(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}const m=t.PLUGIN_KEY="autoRowSize",y=t.PLUGIN_PRIORITY=40;var E=new WeakMap,w=new WeakSet;class C extends i.BasePlugin{static get PLUGIN_KEY(){return m}static get PLUGIN_PRIORITY(){return y}static get SETTING_KEYS(){return!0}static get DEFAULT_SETTINGS(){return{useHeaders:!0,samplingRatio:null,allowSampleDuplicates:!1}}static get CALCULATION_STEP(){return 50}static get SYNC_CALCULATION_LIMIT(){return 500}constructor(e){var t,r;super(e),p(t=this,r=w),r.add(t),(0,s.default)(this,"headerHeight",null),(0,s.default)(this,"ghostTable",new a.default(this.hot)),(0,s.default)(this,"samplesGenerator",new u.default(((e,t)=>{const r=this.hot.toPhysicalRow(e),n=this.hot.toPhysicalColumn(t);if(this.hot.rowIndexMapper.isHidden(r)||this.hot.columnIndexMapper.isHidden(n))return!1;if(e>=0&&t>=0){if(this.hot.getCellMeta(e,t).hidden)return!1}let s;return e>=0?s=this.hot.getDataAtCell(e,t):-1===e&&(s=this.hot.getColHeader(t)),{value:s}}))),(0,s.default)(this,"inProgress",!1),(0,s.default)(this,"measuredRows",0),(0,s.default)(this,"rowHeightsMap",new d.PhysicalIndexToValueMap),function(e,t,r){p(e,t),t.set(e,r)}(this,E,[]),this.hot.rowIndexMapper.registerMap("autoRowSize",this.rowHeightsMap),this.addHook("beforeRowResize",((e,t,r)=>f(w,this,S).call(this,e,t,r)))}isEnabled(){const e=this.hot.getSettings()[m];return!0===e||(0,l.isObject)(e)}enablePlugin(){var e=this;if(this.enabled)return;this.samplesGenerator.setAllowDuplicates(this.getSetting("allowSampleDuplicates"));const t=this.getSetting("samplingRatio");t&&!isNaN(t)&&this.samplesGenerator.setSampleCount(parseInt(t,10)),this.addHook("afterLoadData",(function(){for(var t=arguments.length,r=new Array(t),n=0;nthis.recalculateAllRowsHeight())),this.addHook("afterFormulasValuesUpdate",(function(){for(var t=arguments.length,r=new Array(t),n=0;nf(w,this,R).call(this))),this.addHook("modifyRowHeight",((e,t)=>this.getRowHeight(t,e))),this.addHook("init",(()=>f(w,this,M).call(this))),this.addHook("modifyColumnHeaderHeight",(()=>this.getColumnHeaderHeight())),super.enablePlugin()}disablePlugin(){this.headerHeight=null,super.disablePlugin(),this.addHook("beforeRowResize",((e,t,r)=>f(w,this,S).call(this,e,t,r)))}calculateVisibleRowsHeight(){if(!this.hot.countCols())return;const e=this.getFirstVisibleRow(),t=this.getLastVisibleRow();if(-1===e||-1===t)return;const r=this.hot.renderCall;this.calculateRowsHeight({from:e,to:t},void 0,r)}calculateRowsHeight(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countRows()-1},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{from:0,to:this.hot.countCols()-1},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const n="number"==typeof e?{from:e,to:e}:e,s="number"==typeof t?{from:t,to:t}:t;if(null!==this.hot.getColHeader(0)){const e=this.samplesGenerator.generateRowSamples(-1,s);this.ghostTable.addColumnHeadersRow(e.get(-1))}(0,h.rangeEach)(n.from,n.to,(e=>{let t=this.hot.toPhysicalRow(e);if(null===t&&(t=e),r||null===this.rowHeightsMap.getValueAtIndex(t)){this.samplesGenerator.generateRowSamples(e,s).forEach(((e,t)=>this.ghostTable.addRow(t,e)))}})),this.ghostTable.rows.length&&(this.hot.batchExecution((()=>{this.ghostTable.getHeights(((e,t)=>{e<0?this.headerHeight=t:this.rowHeightsMap.setValueAtIndex(this.hot.toPhysicalRow(e),t)}))}),!0),this.measuredRows=n.to+1,this.ghostTable.clean())}calculateAllRowsHeight(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countCols()-1},t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=0;const n=this.hot.countRows()-1;let s=null;this.inProgress=!0;const i=()=>{if(!this.hot)return(0,o.cancelAnimationFrame)(s),void(this.inProgress=!1);this.calculateRowsHeight({from:r,to:Math.min(r+C.CALCULATION_STEP,n)},e,t),r=r+C.CALCULATION_STEP+1,r=0&&(this.calculateRowsHeight({from:0,to:a},e,t),r=a+1),r>=0),Math.min(t,r)}getRowHeight(e,t){const r=e<0?this.headerHeight:this.rowHeightsMap.getValueAtIndex(this.hot.toPhysicalRow(e));let n=t;return null!==r&&r>(t||0)&&(n=r),n}getColumnHeaderHeight(){return this.headerHeight}getFirstVisibleRow(){var e;return null!==(e=this.hot.getFirstRenderedVisibleRow())&&void 0!==e?e:-1}getLastVisibleRow(){var e;return null!==(e=this.hot.getLastRenderedVisibleRow())&&void 0!==e?e:-1}clearCache(e){this.headerHeight=null,Array.isArray(e)?this.hot.batchExecution((()=>{e.forEach((e=>{this.rowHeightsMap.setValueAtIndex(e,null)}))}),!0):this.rowHeightsMap.clear()}clearCacheByRange(e){const{from:t,to:r}="number"==typeof e?{from:e,to:e}:e;this.hot.batchExecution((()=>{(0,h.rangeEach)(Math.min(t,r),Math.max(t,r),(e=>{this.rowHeightsMap.setValueAtIndex(e,null)}))}),!0)}isNeedRecalculate(){return!!this.rowHeightsMap.getValues().slice(0,this.measuredRows).filter((e=>null===e)).length}destroy(){this.ghostTable.clean(),super.destroy()}}function v(e){const t={from:0,to:this.hot.countCols()-1};e.forEach((e=>{this.samplesGenerator.generateRowSamples(e,t).forEach(((e,t)=>this.ghostTable.addRow(t,e)))})),this.ghostTable.rows.length&&(this.hot.batchExecution((()=>{this.ghostTable.getHeights(((e,t)=>{const r=this.hot.toPhysicalRow(e);this.rowHeightsMap.setValueAtIndex(r,t)}))}),!0),this.ghostTable.clean())}function R(){var e,t,r;this.calculateVisibleRowsHeight(),this.inProgress||(f(w,this,v).call(this,g(E,this)),t=this,r=[],(e=E).set(f(e,t),r))}function S(e,t,r){let n=e;return r&&(this.calculateRowsHeight(t,void 0,!0),n=this.getRowHeight(t)),n}function T(e,t){t||this.recalculateAllRowsHeight()}function N(e){const t=e.reduce(((e,t)=>{let[r]=t;return-1===e.indexOf(r)&&e.push(r),e}),[]);g(E,this).push(...t)}function M(){this.recalculateAllRowsHeight()}function _(e){const t=e.reduce(((e,t)=>{var r;const n=null===(r=t.address)||void 0===r?void 0:r.row;if(Number.isInteger(n)){const t=this.hot.toVisualRow(n);-1===e.indexOf(t)&&e.push(t)}return e}),[]);g(E,this).push(...t)}t.AutoRowSize=C},27864:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(7496);t.PLUGIN_KEY=n.PLUGIN_KEY,t.PLUGIN_PRIORITY=n.PLUGIN_PRIORITY,t.AutoRowSize=n.AutoRowSize},46222:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834),r(15724);var s=n(r(85707)),i=r(75089),o=r(28197),a=r(62577),l=r(10587),h=r(70505),u=r(69615);function c(e,t){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.add(e)}function d(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}o.Hooks.getSingleton().register("modifyAutofillRange"),o.Hooks.getSingleton().register("beforeAutofill"),o.Hooks.getSingleton().register("afterAutofill");const p=t.PLUGIN_KEY="autofill",g=t.PLUGIN_PRIORITY=20,f=["fillHandle"];var m=new WeakSet;class y extends i.BasePlugin{constructor(){super(...arguments),c(this,m),(0,s.default)(this,"addingStarted",!1),(0,s.default)(this,"mouseDownOnCellCorner",!1),(0,s.default)(this,"mouseDragOutside",!1),(0,s.default)(this,"handleDraggedCells",0),(0,s.default)(this,"directions",[]),(0,s.default)(this,"autoInsertRow",!1)}static get PLUGIN_KEY(){return p}static get PLUGIN_PRIORITY(){return g}static get SETTING_KEYS(){return[p,...f]}isEnabled(){return this.hot.getSettings().fillHandle}enablePlugin(){this.enabled||(this.mapSettings(),this.registerEvents(),this.addHook("afterOnCellCornerMouseDown",(e=>d(m,this,w).call(this,e))),this.addHook("afterOnCellCornerDblClick",(e=>d(m,this,E).call(this,e))),this.addHook("beforeOnCellMouseOver",((e,t)=>d(m,this,C).call(this,t))),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.clearMappedSettings(),super.disablePlugin()}getSelectionData(){const e=this.hot.getSelectedRangeLast(),{row:t,col:r}=e.getTopStartCorner(),{row:n,col:s}=e.getBottomEndCorner(),i=this.hot.runHooks("modifyCopyableRange",[{startRow:t,startCol:r,endRow:n,endCol:s}]),o=[],a=[],h=[];return(0,l.arrayEach)(i,(e=>{for(let t=e.startRow;t<=e.endRow;t+=1)-1===o.indexOf(t)&&o.push(t);for(let t=e.startCol;t<=e.endCol;t+=1)-1===a.indexOf(t)&&a.push(t)})),(0,l.arrayEach)(o,(e=>{const t=[];(0,l.arrayEach)(a,(r=>{t.push(this.hot.getCopyableData(e,r))})),h.push(t)})),h}fillIn(){if(this.hot.selection.highlight.getFill().isEmpty())return!1;const[e,t,r,n]=this.hot.selection.highlight.getFill().getVisualCorners(),s=this.hot.getSelectedRangeLast(),i=s.getTopStartCorner(),o=s.getBottomEndCorner();this.resetSelectionOfDraggedArea();const a=[i.row,i.col,o.row,o.col],l=this.hot.runHooks("modifyAutofillRange",[Math.min(i.row,e),Math.min(i.col,t),Math.max(o.row,r),Math.max(o.col,n)],a),{directionOfDrag:h,startOfDragCoords:c,endOfDragCoords:d}=(0,u.getDragDirectionAndRange)(a,l,((e,t)=>this.hot._createCellCoords(e,t)));if(c&&c.row>-1&&c.col>-1){const e=this.getSelectionData(),t=s.clone(),r=this.hot._createCellRange(c,c,d),n=this.hot.runHooks("beforeAutofill",e,t,r,h);if(!1===n)return this.hot.selection.highlight.getFill().clear(),this.hot.render(),!1;let i=n;const o=n;if(["up","left"].indexOf(h)>-1&&(1!==o.length||0!==o[0].length))if(i=[],"up"===h){const e=d.row-c.row+1,t=e%o.length;for(let r=0;r=e.col)&&(n=this.hot._createCellCoords(r.row,e.col)),(r.rowe.row)&&(n=this.hot._createCellCoords(e.row,r.col))}else if(this.directions.includes(u.DIRECTIONS.vertical))n=this.hot._createCellCoords(e.row,r.col);else{if(!this.directions.includes(u.DIRECTIONS.horizontal))return;n=this.hot._createCellCoords(r.row,e.col)}return this.reduceSelectionAreaIfNeeded(n)}showBorder(e){const t=this.getCoordsOfDragAndDropBorders(e);t&&this.redrawBorders(t)}addRow(){this.hot._registerTimeout((()=>{this.hot.alter("insert_row_below",void 0,1,`${this.pluginName}.fill`),this.addingStarted=!1}),200)}addNewRowIfNeeded(){if(!this.hot.selection.highlight.getFill().isEmpty()&&!1===this.addingStarted&&this.autoInsertRow){const e=this.hot.getSelectedLast(),t=this.hot.selection.highlight.getFill().getVisualCorners(),r=this.hot.countRows();e[2]Math.max(e,0))),!1,!1)}selectAdjacent(){const e=this.hot.getSelectedLast(),t=this.getIndexOfLastAdjacentFilledInRow(e);return-1!==t&&void 0!==t&&(this.addSelectionFromStartAreaToSpecificRowIndex(e,t),!0)}resetSelectionOfDraggedArea(){this.handleDraggedCells=0,this.hot.selection.highlight.getFill().clear()}redrawBorders(e){this.hot.selection.highlight.getFill().clear().add(this.hot.getSelectedRangeLast().from).add(this.hot.getSelectedRangeLast().to).add(e).commit(),this.hot.view.render()}getIfMouseWasDraggedOutside(e){const{documentElement:t}=this.hot.rootDocument,r=(0,a.offset)(this.hot.table).top-(this.hot.rootWindow.pageYOffset||t.scrollTop)+(0,a.outerHeight)(this.hot.table),n=(0,a.offset)(this.hot.table).left-(this.hot.rootWindow.pageXOffset||t.scrollLeft)+(0,a.outerWidth)(this.hot.table);return e.clientY>r&&e.clientX<=n}registerEvents(){const{documentElement:e}=this.hot.rootDocument;this.eventManager.addEventListener(e,"mouseup",(()=>d(m,this,v).call(this))),this.eventManager.addEventListener(e,"mousemove",(e=>d(m,this,R).call(this,e)))}clearMappedSettings(){this.directions.length=0,this.autoInsertRow=!1}mapSettings(){const e=(0,u.getMappedFillHandleSetting)(this.hot.getSettings().fillHandle);this.directions=e.directions,this.autoInsertRow=e.autoInsertRow}destroy(){super.destroy()}}function E(){this.selectAdjacent()&&this.fillIn()}function w(){this.handleDraggedCells=1,this.mouseDownOnCellCorner=!0}function C(e){this.mouseDownOnCellCorner&&!this.hot.view.isMouseDown()&&this.handleDraggedCells&&(this.handleDraggedCells+=1,this.showBorder(e),this.addNewRowIfNeeded())}function v(){this.handleDraggedCells&&(this.handleDraggedCells>1&&this.fillIn(),this.handleDraggedCells=0,this.mouseDownOnCellCorner=!1)}function R(e){const t=this.getIfMouseWasDraggedOutside(e);!1===this.addingStarted&&this.handleDraggedCells>0&&t?(this.mouseDragOutside=!0,this.addingStarted=!0):this.mouseDragOutside=!1,this.mouseDragOutside&&this.autoInsertRow&&this.addRow()}t.Autofill=y},32894:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(46222);t.PLUGIN_KEY=n.PLUGIN_KEY,t.PLUGIN_PRIORITY=n.PLUGIN_PRIORITY,t.Autofill=n.Autofill},69615:(e,t,r)=>{"use strict";t.__esModule=!0,t.getDragDirectionAndRange=function(e,t,r){let n,s,i;t[0]===e[0]&&t[1]e[3]?(i="right",n=r(t[0],e[3]+1),s=r(t[2],t[3])):t[0]e[2]&&t[1]===e[1]&&(i="down",n=r(e[2]+1,t[1]),s=r(t[2],t[3]));n&&n.normalize();s&&s.normalize();return{directionOfDrag:i,startOfDragCoords:n,endOfDragCoords:s}},t.getMappedFillHandleSetting=function(e){const t={};!0===e?(t.directions=Object.keys(i),t.autoInsertRow=!0):(0,n.isObject)(e)?((0,s.isDefined)(e.autoInsertRow)?e.direction===i.horizontal?t.autoInsertRow=!1:t.autoInsertRow=e.autoInsertRow:t.autoInsertRow=!1,(0,s.isDefined)(e.direction)?t.directions=[e.direction]:t.directions=Object.keys(i)):"string"==typeof e?(t.directions=[e],t.autoInsertRow=!0):(t.directions=[],t.autoInsertRow=!1);return t};var n=r(25499),s=r(70505);const i=t.DIRECTIONS={horizontal:"horizontal",vertical:"vertical"}},57764:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834),r(15724),r(14846),r(69655);var s=n(r(85707)),i=r(25499),o=r(10587),a=r(74672),l=r(1791),h=r(8266),u=r(54852),c=r(17027),d=n(r(3849));function p(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function g(e,t){return e.get(f(e,t))}function f(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}const m=new Map([["plugin",a.hasPlugin],["cell-type",l.hasCellType],["editor",h.hasEditor],["renderer",u.hasRenderer],["validator",c.hasValidator]]),y=t.defaultMainSettingSymbol=Symbol("mainSetting"),E=t.PLUGIN_KEY="base",w=[];let C=null;var v=new WeakMap,R=new WeakSet;function S(e){if(!e)return!1;const t=this.constructor.SETTING_KEYS;if("boolean"==typeof t)return t;for(let r=0;rthis.onAfterPluginsInitialized())),this.hot.addHook("afterUpdateSettings",(e=>this.onUpdateSettings(e))),this.hot.addHook("beforeInit",(()=>this.init()))}init(){this.pluginName=this.hot.getPluginName(this);const e=this.constructor.PLUGIN_DEPS,t=Array.isArray(e)?e:[];if(t.length>0){const e=[];if(t.forEach((t=>{const[r,n]=t.split(":");if(!m.has(r))throw new Error(`Unknown plugin dependency type "${r}" was found.`);m.get(r)(n)||e.push(` - ${n} (${r})`)})),e.length>0){const t=[`The ${this.pluginName} plugin requires the following modules:\n`,`${e.join("\n")}\n`].join("");w.push(t)}}C||(C=(0,a.getPluginsNames)()),C.indexOf(this.pluginName)>=0&&C.splice(C.indexOf(this.pluginName),1),this.hot.addHookOnce("afterPluginsInitialized",(()=>{this.isEnabled&&this.isEnabled()&&this.enablePlugin()}));if(0===C.length){if(w.length>0){const e=[`${w.join("\n")}\n`,"You have to import and register them manually."].join("");throw w.length=0,new Error(e)}this.hot.runHooks("afterPluginsInitialized")}this.initialized=!0}enablePlugin(){this.enabled=!0}disablePlugin(){var e;null===(e=this.eventManager)||void 0===e||e.clear(),this.clearHooks(),this.enabled=!1}getSetting(e){const t=this.hot.getSettings()[this.constructor.PLUGIN_KEY];if(void 0===e)return t;const r=this.constructor.DEFAULT_SETTINGS;var n,s;return(Array.isArray(t)||(0,i.isObject)(t))&&r[y]===e?Array.isArray(t)?t:null!==(n=t[e])&&void 0!==n?n:r[e]:(0,i.isObject)(t)&&null!==(s=t[e])&&void 0!==s?s:r[e]}addHook(e,t,r){g(v,this)[e]=g(v,this)[e]||[];const n=g(v,this)[e];this.hot.addHook(e,t,r),n.push(t),g(v,this)[e]=n}removeHooks(e){(0,o.arrayEach)(g(v,this)[e]||[],(t=>{this.hot.removeHook(e,t)}))}clearHooks(){const e=g(v,this);(0,i.objectEach)(e,((e,t)=>this.removeHooks(t))),e.length=0}callOnPluginsReady(e){this.isPluginsReady?e():this.pluginsInitializedCallbacks.push(e)}onAfterPluginsInitialized(){(0,o.arrayEach)(this.pluginsInitializedCallbacks,(e=>e())),this.pluginsInitializedCallbacks.length=0,this.isPluginsReady=!0}onUpdateSettings(e){const t=f(R,this,S).call(this,e);this.isEnabled&&(this.enabled&&!this.isEnabled()&&this.disablePlugin(),!this.enabled&&this.isEnabled()&&this.enablePlugin(),this.enabled&&this.isEnabled()&&t&&this.updatePlugin(e))}updatePlugin(){}destroy(){var e;null===(e=this.eventManager)||void 0===e||e.destroy(),this.clearHooks(),(0,i.objectEach)(this,((e,t)=>{"hot"!==t&&(this[t]=null)})),delete this.t,delete this.hot}}},75089:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(57764);t.PLUGIN_KEY=n.PLUGIN_KEY,t.BasePlugin=n.BasePlugin,t.defaultMainSettingSymbol=n.defaultMainSettingSymbol},73296:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834);var s=n(r(85707)),i=r(75089),o=n(r(32022)),a=n(r(44147));function l(e,t){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.add(e)}const h=t.PLUGIN_KEY="bindRowsWithHeaders",u=t.PLUGIN_PRIORITY=210,c=new Map([["loose",o.default],["strict",a.default]]);var d=new WeakSet;class p extends i.BasePlugin{constructor(){super(...arguments),l(this,d),(0,s.default)(this,"headerIndexes",null)}static get PLUGIN_KEY(){return h}static get PLUGIN_PRIORITY(){return u}isEnabled(){return!!this.hot.getSettings()[h]}enablePlugin(){var e;if(this.enabled)return;const t=null!==(e=c.get(this.getSetting()))&&void 0!==e?e:c.get("loose");this.headerIndexes=this.hot.rowIndexMapper.registerMap("bindRowsWithHeaders",new t),this.addHook("modifyRowHeader",(e=>function(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}(d,this,g).call(this,e))),super.enablePlugin()}disablePlugin(){this.hot.rowIndexMapper.unregisterMap("bindRowsWithHeaders"),super.disablePlugin()}destroy(){super.destroy()}}function g(e){return this.headerIndexes.getValueAtIndex(this.hot.toPhysicalRow(e))}t.BindRowsWithHeaders=p},816:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(73296);t.PLUGIN_KEY=n.PLUGIN_KEY,t.PLUGIN_PRIORITY=n.PLUGIN_PRIORITY,t.BindRowsWithHeaders=n.BindRowsWithHeaders},32022:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(61149);const{getListWithInsertedItems:s,getListWithRemovedItems:i}=(0,n.alterUtilsFactory)("physicallyIndexed");class o extends n.IndexMap{constructor(){super((e=>e))}insert(e,t){const r=(0,n.getIncreasedIndexes)(this.indexedValues,t);this.indexedValues=s(r,e,t,this.initValueOrFn),super.insert(e,t)}remove(e){const t=i(this.indexedValues,e);this.indexedValues=(0,n.getDecreasedIndexes)(t,e),super.remove(e)}}t.default=o},44147:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(61149);const{getListWithInsertedItems:s,getListWithRemovedItems:i}=(0,n.alterUtilsFactory)("physicallyIndexed");class o extends n.IndexMap{constructor(){super((e=>e))}insert(e,t){this.indexedValues=s(this.indexedValues,e,t,((e,t)=>this.getNextValue(t))),super.insert(e,t)}remove(e){this.indexedValues=i(this.indexedValues,e),super.remove(e)}getNextValue(e){return Math.max(...this.getValues())+1+e}}t.default=o},39152:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834),r(15724);var s=n(r(85707)),i=r(75089),o=r(10587),a=r(22137),l=r(14859),h=r(62577),u=r(77661),c=r(92399),d=r(71120);function p(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function g(e,t){return e.get(m(e,t))}function f(e,t,r){return e.set(m(e,t),r),r}function m(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}const y=t.PLUGIN_KEY="collapsibleColumns",E=t.PLUGIN_PRIORITY=290,w=["nestedHeaders"],C="collapsibleIndicator",v=y,R=new Map([["collapse",{hideColumn:!0,beforeHook:"beforeColumnCollapse",afterHook:"afterColumnCollapse"}],["expand",{hideColumn:!1,beforeHook:"beforeColumnExpand",afterHook:"afterColumnExpand"}]]);var S=new WeakMap,T=new WeakSet;class N extends i.BasePlugin{constructor(){var e,t;super(...arguments),p(e=this,t=T),t.add(e),(0,s.default)(this,"nestedHeadersPlugin",null),(0,s.default)(this,"headerStateManager",null),function(e,t,r){p(e,t),t.set(e,r)}(this,S,null)}static get PLUGIN_KEY(){return y}static get PLUGIN_PRIORITY(){return E}static get PLUGIN_DEPS(){return["plugin:NestedHeaders"]}static get SETTING_KEYS(){return[y,...w]}isEnabled(){return!!this.hot.getSettings()[y]}enablePlugin(){var e=this;if(this.enabled)return;const{nestedHeaders:t}=this.hot.getSettings();t||(0,l.warn)("You need to configure the Nested Headers plugin in order to use collapsible headers."),f(S,this,this.hot.columnIndexMapper.createAndRegisterIndexMap(this.pluginName,"hiding")),this.nestedHeadersPlugin=this.hot.getPlugin("nestedHeaders"),this.headerStateManager=this.nestedHeadersPlugin.getStateManager(),this.addHook("init",(()=>m(T,this,b).call(this))),this.addHook("afterLoadData",(function(){for(var t=arguments.length,r=new Array(t),n=0;nm(T,this,_).call(this,e,t,r))),this.registerShortcuts(),super.enablePlugin(),this.updatePlugin()}updatePlugin(){if(this.hot.view){if(!this.nestedHeadersPlugin.detectedOverlappedHeaders){const{collapsibleColumns:e}=this.hot.getSettings();"boolean"==typeof e?this.headerStateManager.mapState((e=>({collapsible:e.origColspan>1}))):Array.isArray(e)&&(this.headerStateManager.mapState((()=>({collapsible:!1}))),this.headerStateManager.mergeStateWith(e))}super.updatePlugin()}}disablePlugin(){this.hot.columnIndexMapper.unregisterMap(this.pluginName),f(S,this,null),this.nestedHeadersPlugin=null,this.unregisterShortcuts(),this.clearButtons(),super.disablePlugin()}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Enter"]],callback:()=>{var e;const{row:t,col:r}=this.hot.getSelectedRangeLast().highlight,{collapsible:n,isCollapsed:s,columnIndex:i}=null!==(e=this.headerStateManager.getHeaderTreeNodeData(t,r))&&void 0!==e?e:{};if(n)return s?this.expandSection({row:t,col:i}):this.collapseSection({row:t,col:i}),!1},runOnlyIf:()=>{var e,t;return(null===(e=this.hot.getSelectedRangeLast())||void 0===e?void 0:e.isSingle())&&(null===(t=this.hot.getSelectedRangeLast())||void 0===t?void 0:t.highlight.isHeader())},group:v,relativeToGroup:c.EDITOR_EDIT_GROUP,position:"before"})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(v)}clearButtons(){if(!this.hot.view)return;const e=this.hot.view._wt.getSetting("columnHeaders").length,t=this.hot.view._wt.wtTable.THEAD,r=this.hot.view._wt.wtOverlays.topOverlay.clone.wtTable.THEAD,n=this.hot.view._wt.wtOverlays.topInlineStartCornerOverlay?this.hot.view._wt.wtOverlays.topInlineStartCornerOverlay.clone.wtTable.THEAD:null,s=function(e){e&&e.parentNode.removeChild(e)};(0,a.rangeEach)(0,e-1,(e=>{const i=t.childNodes[e],o=r.childNodes[e],l=n?n.childNodes[e]:null;(0,a.rangeEach)(0,i.childNodes.length-1,(e=>{let t=i.childNodes[e].querySelector(`.${C}`);s(t),o&&o.childNodes[e]&&(t=o.childNodes[e].querySelector(`.${C}`),s(t)),n&&l&&l.childNodes[e]&&(t=l.childNodes[e].querySelector(`.${C}`),s(t))}))}),!0)}expandSection(e){this.toggleCollapsibleSection([e],"expand")}collapseSection(e){this.toggleCollapsibleSection([e],"collapse")}toggleAllCollapsibleSections(e){const t=this.headerStateManager.mapNodes((t=>{const{collapsible:r,origColspan:n,headerLevel:s,columnIndex:i,isCollapsed:o}=t;if(!0===r&&n>1&&(o&&"expand"===e||!o&&"collapse"===e))return{row:this.headerStateManager.levelToRowCoords(s),col:i}}));this.toggleCollapsibleSection(t,e)}collapseAll(){this.toggleAllCollapsibleSections("collapse")}expandAll(){this.toggleAllCollapsibleSections("expand")}toggleCollapsibleSection(e,t){if(!R.has(t))throw new Error(`Unsupported action is passed (${t}).`);if(!Array.isArray(e))return;const r=(0,o.arrayFilter)(e,(e=>{let{row:t}=e;return t<0}));let n=r.length>0;(0,o.arrayEach)(r,(e=>{var r;let{row:s,col:i}=e;const{collapsible:o,isCollapsed:a}=null!==(r=this.headerStateManager.getHeaderSettings(s,i))&&void 0!==r?r:{};if(!o||a&&"collapse"===t||!a&&"expand"===t)return n=!1,!1}));const s=[],i=[];n&&(0,o.arrayEach)(r,(e=>{let{row:r,col:n}=e;const{colspanCompensation:o,affectedColumns:a,rollbackModification:l}=this.headerStateManager.triggerNodeModification(t,r,n);o>0&&(i.push(...a),s.push(l))}));const a=this.getCollapsedColumns();let l=[];"collapse"===t?l=(0,o.arrayUnique)([...a,...i]):"expand"===t&&(l=(0,o.arrayFilter)(a,(e=>!i.includes(e))));const h=R.get(t);if(!1===this.hot.runHooks(h.beforeHook,a,l,n))return void(0,o.arrayEach)(s,(e=>{e()}));this.hot.batchExecution((()=>{(0,o.arrayEach)(i,(e=>{g(S,this).setValueAtIndex(this.hot.toPhysicalColumn(e),h.hideColumn)}))}),!0);const u=this.getCollapsedColumns().length!==a.length,c=this.hot.getSelectedRangeLast();if("collapse"===t&&u&&c){const{row:e,col:t}=c.highlight;if((this.hot.rowIndexMapper.isHidden(e)||this.hot.columnIndexMapper.isHidden(t))&&i.includes(t)){const r=e>=0?this.hot.rowIndexMapper.getNearestNotHiddenIndex(e,1,!0):e,n=t>=0?this.hot.columnIndexMapper.getNearestNotHiddenIndex(t,1,!0):t;null!==r&&null!==n&&this.hot.selectCell(r,n)}}this.hot.runHooks(h.afterHook,a,l,n,u),this.hot.render(),this.hot.view.adjustElementsSize()}getCollapsedColumns(){return g(S,this).getHiddenIndexes()}destroy(){f(S,this,null),super.destroy()}}function M(e,t,r){var n;const{collapsible:s,origColspan:i,isCollapsed:o}=null!==(n=this.headerStateManager.getHeaderSettings(r,e))&&void 0!==n?n:{},a=s&&i>1&&e>=this.hot.getSettings().fixedColumnsStart,l=this.hot.getSettings().ariaTags;let u=t.querySelector(`.${C}`);var c;((0,h.removeAttribute)(t,[(0,d.A11Y_EXPANDED)("")[0]]),a)?(u||(u=this.hot.rootDocument.createElement("div"),(0,h.addClass)(u,C),t.querySelector("div:first-child").appendChild(u)),(0,h.removeClass)(u,["collapsed","expanded"]),o?((0,h.addClass)(u,"collapsed"),(0,h.fastInnerText)(u,"+"),l&&(0,h.setAttribute)(t,...(0,d.A11Y_EXPANDED)(!1))):((0,h.addClass)(u,"expanded"),(0,h.fastInnerText)(u,"-"),l&&(0,h.setAttribute)(t,...(0,d.A11Y_EXPANDED)(!0))),l&&(0,h.setAttribute)(u,...(0,d.A11Y_HIDDEN)())):null===(c=u)||void 0===c||c.remove()}function _(e,t){(0,h.hasClass)(e.target,C)&&((0,h.hasClass)(e.target,"expanded")?(this.eventManager.fireEvent(e.target,"mouseup"),this.toggleCollapsibleSection([t],"collapse")):(0,h.hasClass)(e.target,"collapsed")&&(this.eventManager.fireEvent(e.target,"mouseup"),this.toggleCollapsibleSection([t],"expand")),(0,u.stopImmediatePropagation)(e))}function b(){this.updatePlugin()}function O(e,t){t||this.updatePlugin()}t.CollapsibleColumns=N},96987:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(39152);t.PLUGIN_KEY=n.PLUGIN_KEY,t.PLUGIN_PRIORITY=n.PLUGIN_PRIORITY,t.CollapsibleColumns=n.CollapsibleColumns},72036:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834),r(15724),r(14846),r(63333);var s=n(r(85707)),i=r(62577),o=r(70505),a=r(25499),l=r(89804),h=r(10587),u=r(75089),c=r(61149),d=r(28197),p=r(6433),g=r(92399),f=r(41191),m=r(72061),y=r(4968),E=r(80118),w=r(71120);function C(e,t){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.add(e)}function v(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}const R=t.PLUGIN_KEY="columnSorting",S=t.PLUGIN_PRIORITY=50,T=t.APPEND_COLUMN_CONFIG_STRATEGY="append",N=t.REPLACE_COLUMN_CONFIG_STRATEGY="replace",M=R;(0,E.registerRootComparator)(R,y.rootComparator),d.Hooks.getSingleton().register("beforeColumnSort"),d.Hooks.getSingleton().register("afterColumnSort");var _=new WeakSet;class b extends u.BasePlugin{constructor(){super(...arguments),C(this,_),(0,s.default)(this,"columnStatesManager",null),(0,s.default)(this,"columnMetaCache",null),(0,s.default)(this,"pluginKey",R),(0,s.default)(this,"indexesSequenceCache",null)}static get PLUGIN_KEY(){return R}static get PLUGIN_PRIORITY(){return S}isEnabled(){return!!this.hot.getSettings()[this.pluginKey]}enablePlugin(){var e=this;this.enabled||(this.columnStatesManager=new p.ColumnStatesManager(this.hot,`${this.pluginKey}.sortingStates`),this.columnMetaCache=new c.PhysicalIndexToValueMap((e=>{let t=this.hot.toVisualColumn(e);return null===t&&(t=e),this.getMergedPluginSettings(t)})),this.hot.columnIndexMapper.registerMap(`${this.pluginKey}.columnMeta`,this.columnMetaCache),this.addHook("afterGetColHeader",((e,t)=>v(_,this,A).call(this,e,t))),this.addHook("beforeOnCellMouseDown",(function(){for(var t=arguments.length,r=new Array(t),n=0;nthis.onAfterOnCellMouseDown(e,t))),this.addHook("afterInit",(()=>v(_,this,O).call(this))),this.addHook("afterLoadData",(function(){for(var t=arguments.length,r=new Array(t),n=0;n{const r=(0,f.getHeaderSpanElement)(t);!1!==(0,f.isFirstLevelColumnHeader)(e,t)&&null!==r&&this.updateHeaderClasses(r)};this.hot.addHook("afterGetColHeader",e),this.hot.addHookOnce("afterViewRender",(()=>{this.hot.removeHook("afterGetColHeader",e)})),this.hot.batchExecution((()=>{null!==this.indexesSequenceCache&&(this.hot.rowIndexMapper.setIndexesSequence(this.indexesSequenceCache.getValues()),this.hot.rowIndexMapper.unregisterMap(this.pluginKey),this.indexesSequenceCache=null)}),!0),this.hot.columnIndexMapper.unregisterMap(`${this.pluginKey}.columnMeta`),this.columnStatesManager.destroy(),this.columnMetaCache=null,this.columnStatesManager=null,this.unregisterShortcuts(),super.disablePlugin()}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Enter"]],callback:()=>{const{highlight:e}=this.hot.getSelectedRangeLast();return this.sort(this.getColumnNextConfig(e.col)),!1},runOnlyIf:()=>{var e,t;const r=null===(e=this.hot.getSelectedRangeLast())||void 0===e?void 0:e.highlight;return r&&(null===(t=this.hot.getSelectedRangeLast())||void 0===t?void 0:t.isSingle())&&this.hot.selection.isCellVisible(r)&&-1===r.row&&r.col>=0},relativeToGroup:g.EDITOR_EDIT_GROUP,position:"before",group:M})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(M)}sort(e){const t=this.getSortConfig(),r=this.getNormalizedSortConfigs(e),n=this.areValidSortConfigs(r);!1!==this.hot.runHooks("beforeColumnSort",t,r,n)&&(0===t.length&&null===this.indexesSequenceCache&&(this.indexesSequenceCache=this.hot.rowIndexMapper.registerMap(this.pluginKey,new c.IndexesSequence),this.indexesSequenceCache.setValues(this.hot.rowIndexMapper.getIndexesSequence())),n&&(this.columnStatesManager.setSortStates(r),this.sortByPresetSortStates(r),this.saveAllSortSettings(r)),this.hot.runHooks("afterColumnSort",t,n?r:t,n),n&&(this.hot.render(),this.hot.forceFullRender=!1,this.hot.view.render()))}clearSort(){this.sort([])}isSorted(){return this.enabled&&!this.columnStatesManager.isListOfSortedColumnsEmpty()}getSortConfig(e){return(0,o.isDefined)(e)?this.columnStatesManager.getColumnSortState(e):this.columnStatesManager.getSortStates()}setSortConfig(e){const t=this.getNormalizedSortConfigs(e);this.areValidSortConfigs(t)&&this.columnStatesManager.setSortStates(t)}getNormalizedSortConfigs(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return Array.isArray(e)?e.slice(0,1):[e]}areValidSortConfigs(e){const t=this.hot.countCols();return(0,f.areValidSortStates)(e)&&e.every((e=>{let{column:r}=e;return r<=t&&r>=0}))}saveAllSortSettings(e){const t=this.columnStatesManager.getAllColumnsProperties();t.initialConfig=(0,h.arrayMap)(e,(e=>{let{column:t,...r}=e;return{column:this.hot.toPhysicalColumn(t),...r}})),this.hot.runHooks("persistentStateSave","columnSorting",t)}getAllSavedSortSettings(){const e={};this.hot.runHooks("persistentStateLoad","columnSorting",e);const t=e.value,r=e=>{let{column:t,...r}=e;return{column:this.hot.toVisualColumn(t),...r}};return(0,o.isDefined)(t)&&Array.isArray(t.initialConfig)&&(t.initialConfig=(0,h.arrayMap)(t.initialConfig,r)),t}getColumnNextConfig(e){const t=this.columnStatesManager.getSortOrderOfColumn(e);if((0,o.isDefined)(t)){const r=(0,f.getNextSortOrder)(t);return(0,o.isDefined)(r)?{column:e,sortOrder:r}:void 0}const r=this.hot.countCols();if(Number.isInteger(e)&&e>=0&&e1&&void 0!==arguments[1]?arguments[1]:T;const r=this.columnStatesManager.getIndexOfColumnInSortQueue(e),n=-1!==r,s=this.getSortConfig(),i=this.getColumnNextConfig(e);if(n){if((0,o.isUndefined)(i))return[...s.slice(0,r),...s.slice(r+1)];if(t===T)return[...s.slice(0,r),...s.slice(r+1),i];if(t===N)return[...s.slice(0,r),i,...s.slice(r+1)]}return(0,o.isDefined)(i)?s.concat(i):s}getPluginColumnConfig(e){if((0,a.isObject)(e)){const t=e[this.pluginKey];if((0,a.isObject)(t))return t}return{}}getMergedPluginSettings(e){const t=this.hot.getSettings()[this.pluginKey],r=this.columnStatesManager.getAllColumnsProperties(),n=this.hot.getCellMeta(0,e),s=Object.getPrototypeOf(n);return Array.isArray(s.columns)?Object.assign(r,t,this.getPluginColumnConfig(s.columns[e])):(0,l.isFunction)(s.columns)?Object.assign(r,t,this.getPluginColumnConfig(s.columns(e))):Object.assign(r,t)}getFirstCellSettings(e){const t=this.hot.getCellMeta(0,e),r=Object.create(t);return r[this.pluginKey]=this.columnMetaCache.getValueAtIndex(this.hot.toPhysicalColumn(e)),r}getNumberOfRowsToSort(e){const t=this.hot.getSettings();return t.maxRows<=e?t.maxRows:e-t.minSpareRows}sortByPresetSortStates(e){if(this.hot.rowIndexMapper.setIndexesSequence(this.indexesSequenceCache.getValues()),0===e.length)return;const t=[],r=this.hot.countRows(),n=t=>(0,h.arrayMap)(e,(e=>this.hot.getDataAtCell(t,e.column)));for(let e=0;ee[0]));(0,E.sort)(t,this.pluginKey,(0,h.arrayMap)(e,(e=>e.sortOrder)),(0,h.arrayMap)(e,(e=>this.getFirstCellSettings(e.column))));for(let e=t.length;ee[0])),o=new Map((0,h.arrayMap)(s,((e,t)=>[e,i[t]]))),a=(0,h.arrayMap)(this.hot.rowIndexMapper.getIndexesSequence(),(e=>o.has(e)?o.get(e):e));this.hot.rowIndexMapper.setIndexesSequence(a)}sortBySettings(e){if((0,a.isObject)(e)){this.columnStatesManager.updateAllColumnsProperties(e);const t=e.initialConfig;(Array.isArray(t)||(0,a.isObject)(t))&&this.sort(t)}else this.hot.render()}updateHeaderClasses(e){if((0,i.removeClass)(e,(0,m.getClassesToRemove)(e)),!1!==this.enabled){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n{this.sort(r)})):this.sort(r)}}destroy(){var e;null===(e=this.columnStatesManager)||void 0===e||e.destroy(),super.destroy()}}function O(){const e=this.getAllSavedSortSettings();if((0,a.isObject)(e))this.sortBySettings(e);else{const e=this.hot.getSettings()[this.pluginKey];this.sortBySettings(e)}}function A(e,t){const r=(0,f.getHeaderSpanElement)(t);if(!1===(0,f.isFirstLevelColumnHeader)(e,t)||null===r)return;const n=this.getFirstCellSettings(e)[this.pluginKey],s=n.indicator,o=n.headerAction;if(this.updateHeaderClasses(r,this.columnStatesManager,e,s,o),this.hot.getSettings().ariaTags){const r=this.columnStatesManager.getSortOrderOfColumn(e);(0,i.setAttribute)(t,...(0,w.A11Y_SORT)(r?`${r}ending`:"none"))}}function I(e){!0===e&&this.hot.view&&v(_,this,O).call(this)}function x(e,t,r,n){!1!==(0,f.wasHeaderClickedProperly)(t.row,t.col,e)&&this.wasClickableHeaderClicked(e,t.col)&&this.hot.getShortcutManager().isCtrlPressed()&&(n.column=!0)}t.ColumnSorting=b},6433:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(94364);var s=n(r(85707)),i=r(25499),o=r(61149),a=r(70505);const l=["sortEmptyCells","indicator","headerAction","compareFunctionFactory"];t.ColumnStatesManager=class{constructor(e,t){(0,s.default)(this,"hot",void 0),(0,s.default)(this,"sortingStates",new o.LinkedPhysicalIndexToValueMap),(0,s.default)(this,"sortEmptyCells",false),(0,s.default)(this,"indicator",true),(0,s.default)(this,"headerAction",true),(0,s.default)(this,"compareFunctionFactory",void 0),(0,s.default)(this,"mapName",void 0),this.hot=e,this.mapName=t,this.hot.columnIndexMapper.registerMap(t,this.sortingStates)}updateAllColumnsProperties(e){(0,i.isObject)(e)&&(0,i.objectEach)(e,((e,t)=>{l.includes(t)&&(this[t]=e)}))}getAllColumnsProperties(){const e={sortEmptyCells:this.sortEmptyCells,indicator:this.indicator,headerAction:this.headerAction};return"function"==typeof this.compareFunctionFactory&&(e.compareFunctionFactory=this.compareFunctionFactory),e}getSortOrderOfColumn(e){var t;return null===(t=this.sortingStates.getValueAtIndex(this.hot.toPhysicalColumn(e)))||void 0===t?void 0:t.sortOrder}getIndexOfColumnInSortQueue(e){return e=this.hot.toPhysicalColumn(e),this.sortingStates.getEntries().findIndex((t=>{let[r]=t;return r===e}))}getNumberOfSortedColumns(){return this.sortingStates.getLength()}isListOfSortedColumnsEmpty(){return 0===this.getNumberOfSortedColumns()}isColumnSorted(e){return(0,i.isObject)(this.sortingStates.getValueAtIndex(this.hot.toPhysicalColumn(e)))}getSortStates(){if(null===this.sortingStates)return[];return this.sortingStates.getEntries().map((e=>{let[t,r]=e;return{column:this.hot.toVisualColumn(t),...r}}))}getColumnSortState(e){const t=this.getSortOrderOfColumn(e);if((0,a.isDefined)(t))return{column:e,sortOrder:t}}setSortStates(e){this.sortingStates.clear();for(let t=0;t{"use strict";t.__esModule=!0,t.getClassesToAdd=function(e,t,r,s){const h=[o];s&&h.push(a);if(!1===r)return h.push(i),h;const u=e.getSortOrderOfColumn(t);(0,n.isDefined)(u)&&h.push(l.get(u));return h},t.getClassesToRemove=function(){return Array.from(l.values()).concat(a,i,o)},r(15724);var n=r(70505),s=r(41191);const i="indicatorDisabled",o="columnSorting",a="sortAction",l=new Map([[s.ASC_SORT_STATE,"ascending"],[s.DESC_SORT_STATE,"descending"]])},51206:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(72036);t.PLUGIN_KEY=n.PLUGIN_KEY,t.PLUGIN_PRIORITY=n.PLUGIN_PRIORITY,t.ColumnSorting=n.ColumnSorting,t.APPEND_COLUMN_CONFIG_STRATEGY=n.APPEND_COLUMN_CONFIG_STRATEGY,t.REPLACE_COLUMN_CONFIG_STRATEGY=n.REPLACE_COLUMN_CONFIG_STRATEGY},4968:(e,t,r)=>{"use strict";t.__esModule=!0,t.rootComparator=function(e,t){return function(r,s){const[,...i]=r,[,...o]=s;return function(r){const s=e[r],a=t[r],l=i[r],h=o[r],u=a.columnSorting;return(u.compareFunctionFactory?u.compareFunctionFactory:(0,n.getCompareFunctionFactory)(a.type))(s,a,u)(l,h)}(0)}};var n=r(80118)},54626:(e,t,r)=>{"use strict";t.__esModule=!0,t.compareFunctionFactory=function(e,t,r){const o=t.checkedTemplate,a=t.uncheckedTemplate,{sortEmptyCells:l}=r;return function(h,u){const c=(0,i.isEmpty)(h),d=(0,i.isEmpty)(u),p=c?a:h,g=d?a:u,f=p===a||p===o,m=g===a||g===o;if(!1===l){if(c&&!1===d)return n.FIRST_AFTER_SECOND;if(!1===c&&d)return n.FIRST_BEFORE_SECOND}return!1===f&&m?"asc"===e?n.FIRST_BEFORE_SECOND:n.FIRST_AFTER_SECOND:f&&!1===m?"asc"===e?n.FIRST_AFTER_SECOND:n.FIRST_BEFORE_SECOND:!1===f&&!1===m?(0,s.compareFunctionFactory)(e,t,r)(h,u):p===a&&g===o?"asc"===e?n.FIRST_BEFORE_SECOND:n.FIRST_AFTER_SECOND:p===o&&g===a?"asc"===e?n.FIRST_AFTER_SECOND:n.FIRST_BEFORE_SECOND:n.DO_NOT_SWAP}};var n=r(80118),s=r(36654),i=r(70505);t.COLUMN_DATA_TYPE="checkbox"},57355:(e,t,r)=>{"use strict";t.__esModule=!0,t.compareFunctionFactory=function(e,t,r){return(0,n.createDateTimeCompareFunction)(e,t.dateFormat,r)};var n=r(41191);t.COLUMN_DATA_TYPE="date"},36654:(e,t,r)=>{"use strict";t.__esModule=!0,t.compareFunctionFactory=function(e,t,r){const i=t.locale;return function(t,o){const{sortEmptyCells:a}=r;return"string"==typeof t&&(t=t.toLocaleLowerCase(i)),"string"==typeof o&&(o=o.toLocaleLowerCase(i)),t===o?s.DO_NOT_SWAP:(0,n.isEmpty)(t)?(0,n.isEmpty)(o)?s.DO_NOT_SWAP:a&&"asc"===e?s.FIRST_BEFORE_SECOND:s.FIRST_AFTER_SECOND:(0,n.isEmpty)(o)?a&&"asc"===e?s.FIRST_AFTER_SECOND:s.FIRST_BEFORE_SECOND:isNaN(t)&&!isNaN(o)?"asc"===e?s.FIRST_AFTER_SECOND:s.FIRST_BEFORE_SECOND:!isNaN(t)&&isNaN(o)?"asc"===e?s.FIRST_BEFORE_SECOND:s.FIRST_AFTER_SECOND:(isNaN(t)||isNaN(o)||(t=parseFloat(t),o=parseFloat(o)),to?"asc"===e?s.FIRST_AFTER_SECOND:s.FIRST_BEFORE_SECOND:s.DO_NOT_SWAP)}};var n=r(70505),s=r(80118);t.COLUMN_DATA_TYPE="default"},10144:(e,t,r)=>{"use strict";t.__esModule=!0,t.compareFunctionFactory=function(e,t,r){return function(t,i){const o=parseFloat(t),a=parseFloat(i),{sortEmptyCells:l}=r;if(o===a||isNaN(o)&&isNaN(a))return s.DO_NOT_SWAP;if(l){if((0,n.isEmpty)(t))return"asc"===e?s.FIRST_BEFORE_SECOND:s.FIRST_AFTER_SECOND;if((0,n.isEmpty)(i))return"asc"===e?s.FIRST_AFTER_SECOND:s.FIRST_BEFORE_SECOND}return isNaN(o)?s.FIRST_AFTER_SECOND:isNaN(a)?s.FIRST_BEFORE_SECOND:oa?"asc"===e?s.FIRST_AFTER_SECOND:s.FIRST_BEFORE_SECOND:s.DO_NOT_SWAP}};var n=r(70505),s=r(80118);t.COLUMN_DATA_TYPE="numeric"},64706:(e,t,r)=>{"use strict";t.__esModule=!0,t.compareFunctionFactory=function(e,t,r){return(0,n.createDateTimeCompareFunction)(e,t.timeFormat,r)};var n=r(41191);t.COLUMN_DATA_TYPE="time"},76242:(e,t,r)=>{"use strict";t.__esModule=!0,t.sort=function(e,t){const r=(0,n.getRootComparator)(t);for(var s=arguments.length,i=new Array(s>2?s-2:0),o=2;o{"use strict";t.__esModule=!0;var n=r(33263);t.registerRootComparator=n.registerRootComparator,t.getRootComparator=n.getRootComparator,t.getCompareFunctionFactory=n.getCompareFunctionFactory;var s=r(76242);t.FIRST_AFTER_SECOND=s.FIRST_AFTER_SECOND,t.FIRST_BEFORE_SECOND=s.FIRST_BEFORE_SECOND,t.DO_NOT_SWAP=s.DO_NOT_SWAP,t.sort=s.sort},33263:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,t.getCompareFunctionFactory=function(e){if(d(e))return c(e);return c(s.COLUMN_DATA_TYPE)};var s=r(36654),i=r(10144),o=r(54626),a=r(57355),l=r(64706),h=n(r(28651));const{register:u,getItem:c,hasItem:d}=(0,h.default)("sorting.compareFunctionFactory"),{register:p,getItem:g}=(0,h.default)("sorting.mainSortComparator");t.getRootComparator=g,t.registerRootComparator=p,u(o.COLUMN_DATA_TYPE,o.compareFunctionFactory),u(a.COLUMN_DATA_TYPE,a.compareFunctionFactory),u(s.COLUMN_DATA_TYPE,s.compareFunctionFactory),u(i.COLUMN_DATA_TYPE,i.compareFunctionFactory),u(l.COLUMN_DATA_TYPE,l.compareFunctionFactory)},41191:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,t.areValidSortStates=function(e){if(e.some((e=>!1===function(e){if(!1===(0,i.isObject)(e))return!1;const{column:t,sortOrder:r}=e;return Number.isInteger(t)&&[h,u].includes(r)}(e))))return!1;const t=e.map((e=>{let{column:t}=e;return t}));return new Set(t).size===t.length},t.createDateTimeCompareFunction=function(e,t,r){return function(n,i){const{sortEmptyCells:o}=r;if(n===i)return l.DO_NOT_SWAP;if((0,a.isEmpty)(n))return(0,a.isEmpty)(i)?l.DO_NOT_SWAP:o&&"asc"===e?l.FIRST_BEFORE_SECOND:l.FIRST_AFTER_SECOND;if((0,a.isEmpty)(i))return o&&"asc"===e?l.FIRST_AFTER_SECOND:l.FIRST_BEFORE_SECOND;const h=(0,s.default)(n,t),u=(0,s.default)(i,t);return h.isValid()?u.isValid()?u.isAfter(h)?"asc"===e?l.FIRST_BEFORE_SECOND:l.FIRST_AFTER_SECOND:u.isBefore(h)?"asc"===e?l.FIRST_AFTER_SECOND:l.FIRST_BEFORE_SECOND:l.DO_NOT_SWAP:l.FIRST_BEFORE_SECOND:l.FIRST_AFTER_SECOND}},t.getHeaderSpanElement=function(e){return e.querySelector(`.${c}`)},t.getNextSortOrder=function(e){if(e===u)return;if(e===h)return u;return h},t.isFirstLevelColumnHeader=function(e,t){if(e<0||!t.parentNode)return!1;const r=t.parentNode.parentNode.childNodes;if(Array.from(r).indexOf(t.parentNode)-r.length!=-1)return!1;return!0},t.wasHeaderClickedProperly=function(e,t,r){return-1===e&&t>=0&&!1===(0,o.isRightClick)(r)},r(71336),r(41558),r(17663),r(68630),r(79645),r(89858),r(8620),r(14846),r(94364),r(75568);var s=n(r(6671)),i=r(25499),o=r(77661),a=r(70505),l=r(80118);const h=t.ASC_SORT_STATE="asc",u=t.DESC_SORT_STATE="desc",c=t.HEADER_SPAN_CLASS="colHeader"},25288:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834);var s=n(r(85707)),i=r(75089),o=r(25499),a=n(r(29664)),l=r(21595),h=r(19831);function u(e,t){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.add(e)}function c(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}const d=t.PLUGIN_KEY="columnSummary",p=t.PLUGIN_PRIORITY=220;var g=new WeakSet;class f extends i.BasePlugin{constructor(){super(...arguments),u(this,g),(0,s.default)(this,"endpoints",null)}static get PLUGIN_KEY(){return d}static get PLUGIN_PRIORITY(){return p}isEnabled(){return!!this.hot.getSettings()[d]}enablePlugin(){var e=this;this.enabled||(this.settings=this.hot.getSettings()[d],this.endpoints=new a.default(this,this.settings),this.addHook("afterInit",(function(){for(var t=arguments.length,r=new Array(t),n=0;nthis.endpoints.resetSetupBeforeStructureAlteration("insert_row",e,t,null,r))),this.addHook("beforeCreateCol",((e,t,r)=>this.endpoints.resetSetupBeforeStructureAlteration("insert_col",e,t,null,r))),this.addHook("beforeRemoveRow",(function(){for(var t=arguments.length,r=new Array(t),n=0;nthis.endpoints.resetSetupAfterStructureAlteration("insert_row",e,t,null,r))),this.addHook("afterCreateCol",((e,t,r)=>this.endpoints.resetSetupAfterStructureAlteration("insert_col",e,t,null,r))),this.addHook("afterRemoveRow",(function(){for(var t=arguments.length,r=new Array(t),n=0;n{t+=this.getPartialSum(r,e.sourceColumn)})),t}getPartialSum(e,t){let r=0,n=e[1]||e[0],s=null,i=0;do{if(s=this.getCellValue(n,t),s=(0,h.isNullishOrNaN)(s)?null:s,null!==s){const e=(`${s}`.split(".")[1]||[]).length||1;e>i&&(i=e)}r+=s||0,n-=1}while(n>=e[0]);return Math.round(r*10**i)/10**i}calculateMinMax(e,t){let r=null;return(0,o.objectEach)(e.ranges,(n=>{const s=this.getPartialMinMax(n,e.sourceColumn,t);if(null===r&&null!==s&&(r=s),null!==s)switch(t){case"min":r=Math.min(r,s);break;case"max":r=Math.max(r,s)}})),null===r?"Not enough data":r}getPartialMinMax(e,t,r){let n,s=null,i=e[1]||e[0];do{if(n=this.getCellValue(i,t),n=(0,h.isNullishOrNaN)(n)?null:n,null===s)s=n;else if(null!==n)switch(r){case"min":s=Math.min(s,n);break;case"max":s=Math.max(s,n)}i-=1}while(i>=e[0]);return s}countEmpty(e,t){let r,n=0,s=e[1]||e[0];do{r=this.getCellValue(s,t),r=(0,h.isNullishOrNaN)(r)?null:r,null===r&&(n+=1),s-=1}while(s>=e[0]);return n}countEntries(e){let t=0;const r=e.ranges;return(0,o.objectEach)(r,(r=>{const n=void 0===r[1]?1:r[1]-r[0]+1,s=this.countEmpty(r,e.sourceColumn);t+=n,t-=s})),t}calculateAverage(e){return this.calculateSum(e)/this.countEntries(e)}getCellValue(e,t){const r=this.hot.toVisualRow(e),n=this.hot.toVisualColumn(t);let s=this.hot.getSourceDataAtCell(e,t),i="";if(null!==r&&null!==n&&(i=this.hot.getCellMeta(r,n).className||""),i.indexOf("columnSummaryResult")>-1)return null;if(this.endpoints.currentEndpoint.forceNumeric&&("string"==typeof s&&(s=s.replace(/,/,".")),s=parseFloat(s)),isNaN(s)&&!this.endpoints.currentEndpoint.suppressDataTypeErrors)throw new Error(l.toSingleLine`ColumnSummary plugin: cell at (${e}, ${t}) is not in a\x20 + numeric format. Cannot do the calculation.`);return s}}function m(){this.endpoints.initEndpoints()}function y(e){void 0!==e.columns&&this.endpoints.refreshCellMetas()}function E(e,t){e&&"ColumnSummary.reset"!==t&&"ColumnSummary.set"!==t&&"loadData"!==t&&this.endpoints.refreshChangedEndpoints(e)}function w(e,t){this.endpoints.resetSetupBeforeStructureAlteration("move_row",e[0],e.length,e,this.pluginName),this.endpoints.resetSetupAfterStructureAlteration("move_row",t,e.length,e,this.pluginName)}t.ColumnSummary=f},29664:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834),r(15724),r(14846),r(69655),r(75568);var s=n(r(85707)),i=r(10587),o=r(14859);t.default=class{constructor(e,t){(0,s.default)(this,"plugin",void 0),(0,s.default)(this,"hot",void 0),(0,s.default)(this,"endpoints",[]),(0,s.default)(this,"settings",void 0),(0,s.default)(this,"settingsType","array"),(0,s.default)(this,"currentEndpoint",null),(0,s.default)(this,"cellsToSetCache",[]),this.plugin=e,this.hot=this.plugin.hot,this.settings=t}initEndpoints(){this.endpoints=this.parseSettings(),this.refreshAllEndpoints()}getEndpoint(e){return"function"===this.settingsType?this.fillMissingEndpointData(this.settings)[e]:this.endpoints[e]}getAllEndpoints(){return"function"===this.settingsType?this.fillMissingEndpointData(this.settings):this.endpoints}fillMissingEndpointData(e){return this.parseSettings(e.call(this))}parseSettings(e){const t=[];let r=e;if(r||"function"!=typeof this.settings)return r||(r=this.settings),(0,i.arrayEach)(r,(e=>{const r={};this.assignSetting(e,r,"ranges",[[0,this.hot.countRows()-1]]),this.assignSetting(e,r,"reversedRowCoords",!1),this.assignSetting(e,r,"destinationRow",new Error("\n You must provide a destination row for the Column Summary plugin in order to work properly!\n ")),this.assignSetting(e,r,"destinationColumn",new Error("\n You must provide a destination column for the Column Summary plugin in order to work properly!\n ")),this.assignSetting(e,r,"sourceColumn",e.destinationColumn),this.assignSetting(e,r,"type","sum"),this.assignSetting(e,r,"forceNumeric",!1),this.assignSetting(e,r,"suppressDataTypeErrors",!0),this.assignSetting(e,r,"customFunction",null),this.assignSetting(e,r,"readOnly",!0),this.assignSetting(e,r,"roundFloat",!1),t.push(r)})),t;this.settingsType="function"}assignSetting(e,t,r,n){if("ranges"!==r||void 0!==e[r]){if("ranges"!==r||0!==e[r].length)if(void 0===e[r]){if(n instanceof Error)throw n;t[r]=n}else"destinationRow"===r&&t.reversedRowCoords?t[r]=this.hot.countRows()-e[r]-1:t[r]=e[r]}else t[r]=n}resetSetupBeforeStructureAlteration(e,t,r){if("function"!==this.settingsType)return;const n=e.indexOf("row")>-1?"row":"col",s=this.getAllEndpoints();(0,i.arrayEach)(s,(s=>{"row"===n&&s.destinationRow>=t&&("insert_row"===e?s.alterRowOffset=r:"remove_row"===e&&(s.alterRowOffset=-1*r)),"col"===n&&s.destinationColumn>=t&&("insert_col"===e?s.alterColumnOffset=r:"remove_col"===e&&(s.alterColumnOffset=-1*r))})),this.resetAllEndpoints(s,!1)}resetSetupAfterStructureAlteration(e,t,r,n,s){let o=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];if("function"===this.settingsType){const e=()=>(this.hot.removeHook("beforeViewRender",e),this.refreshAllEndpoints());return void this.hot.addHookOnce("beforeViewRender",e)}const a=e.indexOf("row")>-1?"row":"col",l=e.indexOf("remove")>-1?-1:1,h=this.getAllEndpoints(),u=0===e.indexOf("move_row"),c=t;(0,i.arrayEach)(h,(e=>{"row"===a&&e.destinationRow>=c&&(e.alterRowOffset=l*r),"col"===a&&e.destinationColumn>=c&&(e.alterColumnOffset=l*r)})),this.resetAllEndpoints(h,!u),u?(0,i.arrayEach)(h,(e=>{this.extendEndpointRanges(e,c,n[0],n.length),this.recreatePhysicalRanges(e),this.clearOffsetInformation(e)})):(0,i.arrayEach)(h,(e=>{this.shiftEndpointCoordinates(e,c)})),o&&this.refreshAllEndpoints()}clearOffsetInformation(e){e.alterRowOffset=void 0,e.alterColumnOffset=void 0}extendEndpointRanges(e,t,r,n){(0,i.arrayEach)(e.ranges,(e=>{e[1]&&(t>=e[0]&&t<=e[1]?r>e[1]?e[1]+=n:r=e[0]&&r<=e[1]&&(e[1]-=n,t<=e[0]&&(e[0]+=1,e[1]+=1)))}))}recreatePhysicalRanges(e){const t=e.ranges,r=[],n=[];(0,i.arrayEach)(t,(e=>{const t=[];if(e[1])for(let r=e[0];r<=e[1];r++)t.push(this.hot.toPhysicalRow(r));else t.push(this.hot.toPhysicalRow(e[0]));n.push(t)})),(0,i.arrayEach)(n,(e=>{let t=[];(0,i.arrayEach)(e,((n,s)=>{0===s?t.push(n):e[s]!==e[s-1]+1&&(t.push(e[s-1]),r.push(t),t=[],t.push(n)),s===e.length-1&&(t.push(n),r.push(t))}))})),e.ranges=r}shiftEndpointCoordinates(e,t){e.alterRowOffset&&0!==e.alterRowOffset?(e.destinationRow+=e.alterRowOffset||0,(0,i.arrayEach)(e.ranges,(r=>{(0,i.arrayEach)(r,((n,s)=>{n>=t&&(r[s]+=e.alterRowOffset||0)}))}))):e.alterColumnOffset&&0!==e.alterColumnOffset&&(e.destinationColumn+=e.alterColumnOffset||0,e.sourceColumn+=e.alterColumnOffset||0)}resetAllEndpoints(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getAllEndpoints(),t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e.some((e=>{const t=e.alterRowOffset||0,r=e.alterColumnOffset||0;return e.destinationRow+t>=this.hot.countRows()||e.destinationColumn+r>=this.hot.countCols()}))||(this.cellsToSetCache=[],(0,i.arrayEach)(e,(e=>{this.resetEndpointValue(e,t)})),this.hot.setDataAtCell(this.cellsToSetCache,"ColumnSummary.reset"),this.cellsToSetCache=[])}refreshAllEndpoints(){this.cellsToSetCache=[],(0,i.arrayEach)(this.getAllEndpoints(),(e=>{this.currentEndpoint=e,this.plugin.calculate(e),this.setEndpointValue(e,"init")})),this.currentEndpoint=null,this.hot.setDataAtCell(this.cellsToSetCache,"ColumnSummary.reset"),this.cellsToSetCache=[]}refreshChangedEndpoints(e){const t=[];this.cellsToSetCache=[],(0,i.arrayEach)(e,((e,r,n)=>{`${e[2]||""}`!=`${e[3]}`&&(0,i.arrayEach)(this.getAllEndpoints(),((e,s)=>{this.hot.propToCol(n[r][1])===e.sourceColumn&&-1===t.indexOf(s)&&t.push(s)}))})),(0,i.arrayEach)(t,(e=>{this.refreshEndpoint(this.getEndpoint(e))})),this.hot.setDataAtCell(this.cellsToSetCache,"ColumnSummary.reset"),this.cellsToSetCache=[]}refreshCellMetas(){this.endpoints.forEach((e=>{const t=this.hot.toVisualRow(e.destinationRow);if(null!==t){const r=this.hot.getCellMeta(t,e.destinationColumn);r.readOnly=e.readOnly,r.className="columnSummaryResult"}}))}refreshEndpoint(e){this.currentEndpoint=e,this.plugin.calculate(e),this.setEndpointValue(e),this.currentEndpoint=null}resetEndpointValue(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const r=e.alterRowOffset||0,n=e.alterColumnOffset||0;this.cellsToSetCache.push([this.hot.toVisualRow(e.destinationRow+(t?r:0)),this.hot.toVisualColumn(e.destinationColumn+(t?n:0)),""])}setEndpointValue(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const n=this.hot.toVisualRow(e.destinationRow);if(e.destinationRow>=this.hot.countRows()||e.destinationColumn>=this.hot.countCols())return void this.throwOutOfBoundsWarning();const s=this.hot.toVisualRow(e.destinationRow);if(null!==s){const r=this.hot.getCellMeta(s,e.destinationColumn);"init"!==t&&r.readOnly===e.readOnly||(r.readOnly=e.readOnly,r.className="columnSummaryResult")}if((!0===e.roundFloat||Number.isInteger(e.roundFloat))&&!isNaN(e.result)){const t=e.roundFloat;let r=0;Number.isInteger(t)&&(r=Math.min(Math.max(0,t),100)),e.result=e.result.toFixed(r)}r?this.hot.setDataAtCell(n,e.destinationColumn,e.result,"ColumnSummary.set"):this.cellsToSetCache.push([n,e.destinationColumn,e.result]),e.alterRowOffset=void 0,e.alterColumnOffset=void 0}throwOutOfBoundsWarning(){(0,o.warn)("One of the Column Summary plugins' destination points you provided is beyond the table boundaries!")}}},66518:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(25288);t.PLUGIN_KEY=n.PLUGIN_KEY,t.PLUGIN_PRIORITY=n.PLUGIN_PRIORITY,t.ColumnSummary=n.ColumnSummary},19831:(e,t)=>{"use strict";t.__esModule=!0,t.isNullishOrNaN=function(e){return null==e||isNaN(e)}},21262:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834);var s=r(62577),i=r(25499),o=n(r(16050)),a=r(3899);function l(e,t,r){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}function h(e,t){return e.get(c(e,t))}function u(e,t,r){return e.set(c(e,t),r),r}function c(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var d=new WeakMap,p=new WeakMap,g=new WeakMap,f=new WeakMap,m=new WeakMap,y=new WeakMap,E=new WeakMap;class w{static get CLASS_EDITOR_CONTAINER(){return"htCommentsContainer"}static get CLASS_EDITOR(){return"htComments"}static get CLASS_INPUT(){return"htCommentTextArea"}static get CLASS_CELL(){return"htCommentCell"}constructor(e,t){var r=this;l(this,d,void 0),l(this,p,!1),l(this,g,null),l(this,f,void 0),l(this,m,void 0),l(this,y,!0),l(this,E,new a.EditorResizeObserver),u(d,this,e),u(p,this,t),u(f,this,this.createEditor()),u(m,this,h(f,this).style),h(E,this).setObservedElement(this.getInputElement()),h(E,this).addLocalHook("resize",(function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:"")||"";this.getInputElement().value=e}getValue(){return this.getInputElement().value}isFocused(){return h(d,this).activeElement===this.getInputElement()}focus(){this.getInputElement().focus()}createEditor(){const e=h(d,this).createElement("div"),t=h(d,this).createElement("textarea");return e.style.display="none",u(g,this,h(d,this).createElement("div")),h(g,this).setAttribute("dir",h(p,this)?"rtl":"ltr"),(0,s.addClass)(h(g,this),w.CLASS_EDITOR_CONTAINER),h(d,this).body.appendChild(h(g,this)),(0,s.addClass)(e,w.CLASS_EDITOR),(0,s.addClass)(t,w.CLASS_INPUT),t.setAttribute("data-hot-input",!0),e.appendChild(t),h(g,this).appendChild(e),e}getInputElement(){return h(f,this).querySelector(`.${w.CLASS_INPUT}`)}getEditorElement(){return h(f,this)}destroy(){const e=h(g,this)?h(g,this).parentNode:null;h(f,this).parentNode.removeChild(h(f,this)),u(f,this,null),u(m,this,null),h(E,this).destroy(),e&&e.removeChild(h(g,this))}}(0,i.mixin)(w,o.default);t.default=w},28062:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834),r(15724);var s=n(r(85707)),i=r(62577),o=r(77661),a=r(25499),l=r(75089),h=n(r(21262)),u=n(r(75912)),c=r(30889),d=n(r(8924)),p=n(r(98423)),g=n(r(57757));function f(e,t,r){m(e,t),t.set(e,r)}function m(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function y(e,t,r){return e.set(w(e,t),r),r}function E(e,t){return e.get(w(e,t))}function w(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}const C=t.PLUGIN_KEY="comments",v=t.PLUGIN_PRIORITY=60,R=t.META_COMMENT="comment",S=t.META_COMMENT_VALUE="value",T=t.META_STYLE="style",N=t.META_READONLY="readOnly",M=C,_=`plugin:${C}`;var b=new WeakMap,O=new WeakMap,A=new WeakMap,I=new WeakMap,x=new WeakMap,P=new WeakMap,L=new WeakSet;class D extends l.BasePlugin{constructor(){var e,t;super(...arguments),m(e=this,t=L),t.add(e),(0,s.default)(this,"range",{}),f(this,b,null),f(this,O,null),f(this,A,!1),f(this,I,!1),f(this,x,null),f(this,P,"")}static get PLUGIN_KEY(){return C}static get PLUGIN_PRIORITY(){return v}static get DEFAULT_SETTINGS(){return{displayDelay:250}}isEnabled(){return!!this.hot.getSettings()[C]}enablePlugin(){var e=this;this.enabled||(E(b,this)||(y(b,this,new h.default(this.hot.rootDocument,this.hot.isRtl())),E(b,this).addLocalHook("resize",(function(){for(var t=arguments.length,r=new Array(t),n=0;nthis.addToContextMenu(e))),this.addHook("afterRenderer",((e,t,r,n,s,i)=>w(L,this,V).call(this,e,i))),this.addHook("afterScroll",(()=>w(L,this,j).call(this))),this.addHook("afterBeginEditing",(()=>this.hide())),this.addHook("afterDocumentKeyDown",(e=>w(L,this,G).call(this,e))),this.addHook("afterSetTheme",(function(){for(var t=arguments.length,r=new Array(t),n=0;nthis.hide())),E(O,this).addLocalHook("show",((e,t)=>this.showAtCell(e,t))),this.registerShortcuts(),this.registerListeners(),super.enablePlugin())}updatePlugin(){E(O,this).updateDelay(this.getSetting("displayDelay")),super.updatePlugin()}disablePlugin(){this.unregisterShortcuts(),super.disablePlugin()}registerShortcuts(){const e=this.hot.getShortcutManager(),t=e.getContext("grid"),r=e.addContext(_);t.addShortcut({keys:[["Control","Alt","M"]],callback:()=>{const t=this.hot.getSelectedRangeLast();y(I,this,!0),this.hot.scrollToFocusedCell((()=>{this.setRange(t),this.show(),this.focusEditor(),e.setActiveContextName(_),this.hot._registerTimeout((()=>{y(I,this,!1)}))}))},stopPropagation:!0,runOnlyIf:()=>{var e;return null===(e=this.hot.getSelectedRangeLast())||void 0===e?void 0:e.highlight.isCell()},group:M}),r.addShortcut({keys:[["Escape"]],callback:()=>{E(b,this).setValue(E(P,this)),this.hide(),e.setActiveContextName("grid")},runOnlyIf:()=>E(b,this).isVisible()&&E(b,this).isFocused(),group:M}),r.addShortcut({keys:[["Control/Meta","Enter"]],callback:()=>{this.hide(),e.setActiveContextName("grid")},runOnlyIf:()=>E(b,this).isVisible()&&E(b,this).isFocused(),group:M}),r.addShortcut({keys:[["Shift","Tab"],["Tab"]],forwardToContext:e.getContext("grid"),callback:()=>{E(b,this).setValue(E(b,this).getValue()),this.hide(),e.setActiveContextName("grid")},group:M})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(M)}registerListeners(){const{rootDocument:e}=this.hot,t=this.getEditorInputElement();this.eventManager.addEventListener(e,"mouseover",(e=>w(L,this,F).call(this,e))),this.eventManager.addEventListener(e,"mousedown",(e=>w(L,this,k).call(this,e))),this.eventManager.addEventListener(e,"mouseup",(()=>w(L,this,U).call(this))),this.eventManager.addEventListener(t,"focus",(()=>w(L,this,W).call(this))),this.eventManager.addEventListener(t,"blur",(()=>w(L,this,B).call(this))),this.eventManager.addEventListener(this.getEditorInputElement(),"mousedown",(e=>w(L,this,H).call(this,e)))}setRange(e){this.range=e}clearRange(){this.range={}}targetIsCellWithComment(e){const t=(0,i.closest)(e.target,"TD","TBODY");return!!(t&&(0,i.hasClass)(t,"htCommentCell")&&(0,i.closest)(t,[this.hot.rootElement]))}targetIsCommentTextArea(e){return this.getEditorInputElement()===e.target}setComment(e){if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');const t=E(b,this).getValue();let r="";null!=e?r=e:null!=t&&(r=t);const n=this.range.from.row,s=this.range.from.col;this.updateCommentMeta(n,s,{[S]:r}),this.hot.render()}setCommentAtCell(e,t,r){this.setRange({from:this.hot._createCellCoords(e,t)}),this.setComment(r)}removeComment(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');this.hot.setCellMeta(this.range.from.row,this.range.from.col,R),e&&this.hot.render(),this.hide()}removeCommentAtCell(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.setRange({from:this.hot._createCellCoords(e,t)}),this.removeComment(r)}getComment(){const e=this.range.from.row,t=this.range.from.col;return this.getCommentMeta(e,t,S)}getCommentAtCell(e,t){return this.getCommentMeta(e,t,S)}show(){var e;if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');const{from:{row:t,col:r}}=this.range;if(t<0||t>this.hot.countSourceRows()-1||r<0||r>this.hot.countSourceCols()-1)return!1;const n=this.hot.getCellMeta(this.range.from.row,this.range.from.col);return E(O,this).cancelHiding(),E(b,this).setValue(null!==(e=n[R]?n[R][S]:null)&&void 0!==e?e:""),E(b,this).show(),this.refreshEditor(!0),!0}showAtCell(e,t){return this.setRange({from:this.hot._createCellCoords(e,t)}),this.show()}hide(){E(b,this).hide()}refreshEditor(){if(!(arguments.length>0&&void 0!==arguments[0]&&arguments[0]||this.range.from&&E(b,this).isVisible()))return;const{rowIndexMapper:e,columnIndexMapper:t}=this.hot,{row:r,col:n}=this.range.from;let s=e.getRenderableFromVisualIndex(r),o=t.getRenderableFromVisualIndex(n);const a=null===s;E(b,this).setPosition(0,0),null===s&&(s=e.getRenderableFromVisualIndex(e.getNearestNotHiddenIndex(r,-1))),null===o&&(o=t.getRenderableFromVisualIndex(t.getNearestNotHiddenIndex(n,-1)));const l=null===s,h=null===o;s=null!=s?s:0,o=null!=o?o:0;const{rootWindow:u,view:{_wt:c}}=this.hot,{wtTable:d}=c,p=c.getCell({row:s,col:o},!0),g=this.getCommentMeta(r,n,T);g?E(b,this).setSize(g.width,g.height):E(b,this).resetSize();const f=h?0:d.getColumnWidth(o),m=a&&!l?(0,i.outerHeight)(p):0,{left:y,top:w,width:C,height:v}=p.getBoundingClientRect(),{width:R,height:S}=E(b,this).getSize(),{innerWidth:M,innerHeight:_}=this.hot.rootWindow,O=this.hot.rootDocument.documentElement;let A=y+u.scrollX+f,I=w+u.scrollY+m;this.hot.isRtl()&&(A-=R+f),this.hot.isLtr()&&y+C+R>M?A=y+u.scrollX-R-1:this.hot.isRtl()&&A<-(O.scrollWidth-O.clientWidth)&&(A=y+u.scrollX+f+1),w+S>_&&(I-=S-v+1),E(b,this).setPosition(A,I),E(b,this).setReadOnlyState(this.getCommentMeta(r,n,N)),E(b,this).observeSize()}focusEditor(){E(b,this).focus()}updateCommentMeta(e,t,r){const n=this.hot.getCellMeta(e,t)[R];let s;n?(s=(0,a.deepClone)(n),(0,a.deepExtend)(s,r)):s=r,this.hot.setCellMeta(e,t,R,s)}getCommentMeta(e,t,r){const n=this.hot.getCellMeta(e,t);if(n[R])return n[R][r]}addToContextMenu(e){e.items.push({name:c.SEPARATOR},(0,d.default)(this),(0,p.default)(this),(0,g.default)(this))}getEditorInputElement(){return E(b,this).getInputElement()}destroy(){var e,t;null===(e=E(b,this))||void 0===e||e.destroy(),null===(t=E(O,this))||void 0===t||t.destroy(),super.destroy()}}function k(e){if(this.hot.view&&this.hot.view._wt&&!E(A,this)&&!this.targetIsCommentTextArea(e)){const t=(0,i.closest)(e.target,"TD","TBODY");let r=null;t&&(r=this.hot.getCoords(t)),(!t||this.range.from&&r&&(this.range.from.row!==r.row||this.range.from.col!==r.col))&&this.hide()}}function H(e){e.stopPropagation()}function F(e){const{rootDocument:t}=this.hot;if(!(E(A,this)||E(b,this).isFocused()||(0,i.hasClass)(e.target,"wtBorder")||E(x,this)===e.target)&&E(b,this))if(y(x,this,t.elementFromPoint(e.clientX,e.clientY)),this.targetIsCellWithComment(e)){const t=this.hot._createCellRange(this.hot.getCoords(e.target));E(O,this).show(t)}else(0,i.isChildOf)(e.target,t)&&!this.targetIsCommentTextArea(e)&&E(O,this).hide()}function U(){y(A,this,!1)}function V(e,t){t[R]&&t[R][S]&&(0,i.addClass)(e,t.commentedCellClassName)}function B(){y(P,this,""),this.hot.getShortcutManager().setActiveContextName("grid"),this.setComment()}function W(){y(P,this,this.getComment()),this.hot.listen(),this.hot.getShortcutManager().setActiveContextName(_)}function Y(e,t){this.updateCommentMeta(this.range.from.row,this.range.from.col,{[T]:{width:e,height:t}})}function G(e){E(b,this).isFocused()&&(0,o.stopImmediatePropagation)(e)}function j(){E(I,this)||this.hide()}function z(){const e=E(b,this).getEditorElement();(0,i.removeClass)(e,/ht-theme-.*/g),(0,i.addClass)(e,this.hot.getCurrentThemeName())}t.Comments=D},8924:(e,t,r)=>{"use strict";t.__esModule=!0,t.default=function(e){return{key:"commentsAddEdit",name(){var t;const r=null===(t=this.getSelectedRangeLast())||void 0===t?void 0:t.highlight;return null!=r&&r.isCell()&&e.getCommentAtCell(r.row,r.col)?this.getTranslatedPhrase(n.CONTEXTMENU_ITEMS_EDIT_COMMENT):this.getTranslatedPhrase(n.CONTEXTMENU_ITEMS_ADD_COMMENT)},callback(){const t=this.getSelectedRangeLast();e.setRange(t),e.show(),e.focusEditor()},disabled(){const e=this.getSelectedRangeLast();return!!(!e||e.highlight.isHeader()||this.selection.isEntireRowSelected()&&this.selection.isEntireColumnSelected()||0===this.countRenderedRows()||0===this.countRenderedCols())}}};var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=s(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(r(23384));function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(s=function(e){return e?r:t})(e)}},57757:(e,t,r)=>{"use strict";t.__esModule=!0,t.default=function(e){return{key:"commentsReadOnly",name(){const t=this.getTranslatedPhrase(n.CONTEXTMENU_ITEMS_READ_ONLY_COMMENT);return(0,s.checkSelectionConsistency)(this.getSelectedRange(),((t,r)=>e.getCommentMeta(t,r,i.META_READONLY)))?(0,s.markLabelAsSelected)(t):t},callback(){this.getSelectedRangeLast().forAll(((t,r)=>{if(t>=0&&r>=0){const n=!!e.getCommentMeta(t,r,i.META_READONLY);e.updateCommentMeta(t,r,{[i.META_READONLY]:!n})}}))},disabled(){const t=this.getSelectedRangeLast();return!!(!t||t.highlight.isHeader()||!e.getCommentAtCell(t.highlight.row,t.highlight.col)||this.selection.isEntireRowSelected()&&this.selection.isEntireColumnSelected()||0===this.countRenderedRows()||0===this.countRenderedCols())}}};var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=o(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var a=s?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n}(r(23384)),s=r(21577),i=r(28062);function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(o=function(e){return e?r:t})(e)}},98423:(e,t,r)=>{"use strict";t.__esModule=!0,t.default=function(e){return{key:"commentsRemove",name(){return this.getTranslatedPhrase(n.CONTEXTMENU_ITEMS_REMOVE_COMMENT)},callback(){this.getSelectedRangeLast().forAll(((t,r)=>{t>=0&&r>=0&&e.removeCommentAtCell(t,r,!1)})),this.render()},disabled(){const e=this.getSelectedRangeLast();return!!(!e||e.highlight.isHeader()||this.selection.isEntireRowSelected()&&this.selection.isEntireColumnSelected()||0===this.countRenderedRows()||0===this.countRenderedCols())}}};var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=s(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(r(23384));function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(s=function(e){return e?r:t})(e)}},75912:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0;var s=n(r(85707)),i=r(89804),o=r(25499),a=n(r(16050));class l{constructor(e){(0,s.default)(this,"wasLastActionShow",!0),(0,s.default)(this,"showDebounced",null),(0,s.default)(this,"hidingTimer",null),this.updateDelay(e)}hide(){this.wasLastActionShow=!1,this.hidingTimer=setTimeout((()=>{!1===this.wasLastActionShow&&this.runLocalHooks("hide")}),250)}show(e){this.wasLastActionShow=!0,this.showDebounced(e)}cancelHiding(){this.wasLastActionShow=!0,clearTimeout(this.hidingTimer),this.hidingTimer=null}updateDelay(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:250;this.showDebounced=(0,i.debounce)((e=>{this.wasLastActionShow&&this.runLocalHooks("show",e.from.row,e.from.col)}),e)}destroy(){this.clearLocalHooks()}}(0,o.mixin)(l,a.default);t.default=l},3899:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834),r(14846),r(69655);var s=r(25499),i=n(r(16050));function o(e,t,r){a(e,t),t.set(e,r)}function a(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function l(e,t){return e.get(u(e,t))}function h(e,t,r){return e.set(u(e,t),r),r}function u(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var c=new WeakMap,d=new WeakMap,p=new WeakMap,g=new WeakSet;class f{constructor(){var e,t;a(e=this,t=g),t.add(e),o(this,c,!0),o(this,d,null),o(this,p,new ResizeObserver((e=>u(g,this,m).call(this,e))))}setObservedElement(e){h(d,this,e)}unobserve(){l(p,this).unobserve(l(d,this))}observe(){h(c,this,!0),l(p,this).observe(l(d,this))}destroy(){l(p,this).disconnect()}}function m(e){!l(c,this)&&Array.isArray(e)&&e.length?e.forEach((e=>{let{borderBoxSize:t}=e;const{inlineSize:r,blockSize:n}=t[0];this.runLocalHooks("resize",r,n)})):h(c,this,!1)}t.EditorResizeObserver=f,(0,s.mixin)(f,i.default)},85290:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(28062);t.PLUGIN_KEY=n.PLUGIN_KEY,t.PLUGIN_PRIORITY=n.PLUGIN_PRIORITY,t.Comments=n.Comments},90352:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834),r(15724),r(54999);var s=n(r(85707)),i=r(10587),o=r(25499);t.CommandExecutor=class{constructor(e){(0,s.default)(this,"hot",void 0),(0,s.default)(this,"commands",{}),(0,s.default)(this,"commonCallback",null),this.hot=e}registerCommand(e,t){this.commands[e]=t}setCommonCallback(e){this.commonCallback=e}execute(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n{const n=t.key?t.key.split(":"):null;if(Array.isArray(n)&&n[1]===e)return r=t,!1})),r}(l,h.submenu.items)),!0===h.disabled)return;if("function"==typeof h.disabled&&!0===h.disabled.call(this.hot))return;if((0,o.hasOwnProperty)(h,"submenu"))return;const u=[];"function"==typeof h.callback&&u.push(h.callback),"function"==typeof this.commonCallback&&u.push(this.commonCallback),r.unshift(s.join(":")),(0,i.arrayEach)(u,(e=>e.apply(this.hot,r)))}}},15784:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834);var s=n(r(85707)),i=r(75089),o=r(28197),a=r(10587),l=r(25499),h=r(90352),u=r(27040),c=r(57446),d=r(21577),p=r(62577),g=r(30889);function f(e,t){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.add(e)}function m(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}const y=t.PLUGIN_KEY="contextMenu",E=t.PLUGIN_PRIORITY=70,w=y;o.Hooks.getSingleton().register("afterContextMenuDefaultOptions"),o.Hooks.getSingleton().register("beforeContextMenuShow"),o.Hooks.getSingleton().register("afterContextMenuShow"),o.Hooks.getSingleton().register("afterContextMenuHide"),o.Hooks.getSingleton().register("afterContextMenuExecute");var C=new WeakSet;class v extends i.BasePlugin{constructor(){super(...arguments),f(this,C),(0,s.default)(this,"commandExecutor",new h.CommandExecutor(this.hot)),(0,s.default)(this,"itemsFactory",null),(0,s.default)(this,"menu",null)}static get PLUGIN_KEY(){return y}static get PLUGIN_PRIORITY(){return E}static get PLUGIN_DEPS(){return["plugin:AutoColumnSize"]}static get DEFAULT_ITEMS(){return[g.ROW_ABOVE,g.ROW_BELOW,g.SEPARATOR,g.COLUMN_LEFT,g.COLUMN_RIGHT,g.SEPARATOR,g.REMOVE_ROW,g.REMOVE_COLUMN,g.SEPARATOR,g.UNDO,g.REDO,g.SEPARATOR,g.READ_ONLY,g.SEPARATOR,g.ALIGNMENT]}isEnabled(){return!!this.hot.getSettings()[y]}enablePlugin(){var e=this;if(this.enabled)return;const t=this.hot.getSettings()[y];"function"==typeof t.callback&&this.commandExecutor.setCommonCallback(t.callback),this.menu=new c.Menu(this.hot,{className:"htContextMenu",keepInViewport:!0,container:t.uiContainer||this.hot.rootDocument.body}),this.menu.addLocalHook("beforeOpen",(()=>m(C,this,S).call(this))),this.menu.addLocalHook("afterOpen",(()=>m(C,this,T).call(this))),this.menu.addLocalHook("afterClose",(()=>m(C,this,N).call(this))),this.menu.addLocalHook("executeCommand",(function(){for(var t=arguments.length,r=new Array(t),n=0;nm(C,this,R).call(this,e))),this.registerShortcuts(),super.enablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.close(),this.menu&&(this.menu.destroy(),this.menu=null),this.unregisterShortcuts(),super.disablePlugin()}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Control/Meta","Shift","Backslash"],["Shift","F10"]],callback:()=>{const{highlight:e}=this.hot.getSelectedRangeLast();this.hot.scrollToFocusedCell();const t=this.hot.getCell(e.row,e.col,!0).getBoundingClientRect(),r=(0,d.getDocumentOffsetByElement)(this.menu.container,this.hot.rootDocument);this.open({left:t.left+r.left,top:t.top+r.top-1+t.height},{left:t.width,above:-t.height}),this.menu.getNavigator().toFirstItem()},runOnlyIf:()=>{var e;const t=null===(e=this.hot.getSelectedRangeLast())||void 0===e?void 0:e.highlight;return t&&this.hot.selection.isCellVisible(t)&&!this.menu.isOpened()},group:w})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(w)}open(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{above:0,below:0,left:0,right:0};if(null!==(t=this.menu)&&void 0!==t&&t.isOpened())return;this.prepareMenuItems(),this.menu.open();const n=this.menu.tableBorderWidth>0;(0,l.objectEach)(r,((e,t)=>{const r=["below","right"].includes(t)?e+1:e-1;this.menu.setOffset(t,n?e:r)})),this.menu.setPosition(e)}close(){var e;null===(e=this.menu)||void 0===e||e.close(),this.itemsFactory=null}executeCommand(e){null===this.itemsFactory&&this.prepareMenuItems();for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;nthis.commandExecutor.registerCommand(e.key,e)))}destroy(){this.close(),this.menu&&this.menu.destroy(),super.destroy()}}function R(e){const t=this.hot.getSettings(),r=t.rowHeaders,n=t.colHeaders;const s=e.target;if(this.close(),(0,p.hasClass)(s,"handsontableInput"))return;if(e.preventDefault(),e.stopPropagation(),!r&&!n&&!(function(e){return"TD"===e.nodeName||"TD"===e.parentNode.nodeName}(s)||(0,p.hasClass)(s,"current")&&(0,p.hasClass)(s,"wtBorder")))return;const i=(0,d.getDocumentOffsetByElement)(this.menu.container,this.hot.rootDocument);this.open({top:e.clientY+i.top,left:e.clientX+i.left})}function S(){this.hot.runHooks("beforeContextMenuShow",this)}function T(){this.hot.runHooks("afterContextMenuShow",this)}function N(){this.hot.listen(),this.hot.runHooks("afterContextMenuHide",this)}t.ContextMenu=v,v.SEPARATOR={name:g.SEPARATOR}},92560:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(15784);t.PLUGIN_KEY=n.PLUGIN_KEY,t.PLUGIN_PRIORITY=n.PLUGIN_PRIORITY,t.ContextMenu=n.ContextMenu},27040:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(15724);var s=n(r(85707)),i=r(25499),o=r(10587),a=r(30889);t.ItemsFactory=class{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;(0,s.default)(this,"hot",void 0),(0,s.default)(this,"predefinedItems",(0,a.predefinedItems)()),(0,s.default)(this,"defaultOrderPattern",void 0),this.hot=e,this.defaultOrderPattern=t}setPredefinedItems(e){const t={};this.defaultOrderPattern.length=0,(0,i.objectEach)(e,((e,r)=>{let n="";e.name===a.SEPARATOR?(t[a.SEPARATOR]=e,n=a.SEPARATOR):isNaN(parseInt(r,10))?(e.key=void 0===e.key?r:e.key,t[r]=e,n=e.key):(t[e.key]=e,n=e.key),this.defaultOrderPattern.push(n)})),this.predefinedItems=t}getItems(){return function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=[];let s=e;s&&s.items?s=s.items:Array.isArray(s)||(s=t);(0,i.isObject)(s)?(0,i.objectEach)(s,((e,t)=>{let s=r["string"==typeof e?e:t];s||(s=e),(0,i.isObject)(e)?(0,i.extend)(s,e):"string"==typeof s&&(s={name:s}),void 0===s.key&&(s.key=t),n.push(s)})):(0,o.arrayEach)(s,((e,t)=>{let s=r[e];!s&&a.ITEMS.indexOf(e)>=0||(s||(s={name:e,key:`${t}`}),(0,i.isObject)(e)&&(0,i.extend)(s,e),void 0===s.key&&(s.key=t),n.push(s))}));return n}(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,this.defaultOrderPattern,this.predefinedItems)}}},32574:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0;var s=n(r(85707));t.Cursor=class{constructor(e,t){(0,s.default)(this,"top",void 0),(0,s.default)(this,"topRelative",void 0),(0,s.default)(this,"left",void 0),(0,s.default)(this,"leftRelative",void 0),(0,s.default)(this,"scrollTop",void 0),(0,s.default)(this,"scrollLeft",void 0),(0,s.default)(this,"cellHeight",void 0),(0,s.default)(this,"cellWidth",void 0);const r=t.scrollY,n=t.scrollX;let i,o,a,l,h,u;this.rootWindow=t,this.type=this.getSourceType(e),"literal"===this.type?(i=parseInt(e.top,10),a=parseInt(e.left,10),h=e.height||0,u=e.width||0,o=i,l=a,i+=r,a+=n):"event"===this.type&&(i=parseInt(e.pageY,10),a=parseInt(e.pageX,10),h=e.target.clientHeight,u=e.target.clientWidth,o=i-r,l=a-n),this.top=i,this.topRelative=o,this.left=a,this.leftRelative=l,this.scrollTop=r,this.scrollLeft=n,this.cellHeight=h,this.cellWidth=u}getSourceType(e){let t="literal";return e instanceof Event&&(t="event"),t}fitsAbove(e){return this.topRelative>=e.offsetHeight}fitsBelow(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.rootWindow.innerHeight;return this.topRelative+e.offsetHeight<=t}fitsOnRight(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.rootWindow.innerWidth;return this.leftRelative+this.cellWidth+e.offsetWidth<=t}fitsOnLeft(e){return this.leftRelative>=e.offsetWidth}}},81480:(e,t)=>{"use strict";t.__esModule=!0,t.createDefaultShortcutsList=function(e){const{hot:t,hotMenu:r}=e;return[{keys:[["Control/Meta","A"]],forwardToContext:t.getShortcutManager().getContext("grid"),callback:()=>e.close(!0)},{keys:[["Tab"],["Shift","Tab"]],callback:(r,n)=>{const s=t.getSettings(),i="function"==typeof s.tabMoves?s.tabMoves(r):s.tabMoves;n.includes("shift")?t.selection.transformStart(-i.row,-i.col):t.selection.transformStart(i.row,i.col),e.close(!0)}},{keys:[["Escape"]],callback:()=>e.close()},{keys:[["ArrowDown"]],callback:()=>e.getNavigator().toNextItem()},{keys:[["ArrowUp"]],callback:()=>e.getNavigator().toPreviousItem()},{keys:[["ArrowRight"]],callback:()=>{const t=r.getSelectedLast();if(t){const r=e.openSubMenu(t[0]);r&&r.getNavigator().toFirstItem()}}},{keys:[["ArrowLeft"]],callback:()=>{r.getSelectedLast()&&e.isSubMenu()&&(e.close(),e.isSubMenu()&&e.parentMenu.hotMenu.listen())}},{keys:[["Control/Meta","ArrowUp"],["Home"]],callback:()=>e.getNavigator().toFirstItem()},{keys:[["Control/Meta","ArrowDown"],["End"]],callback:()=>e.getNavigator().toLastItem()},{keys:[["Enter"],["Space"]],callback:t=>{const n=r.getSelectedLast();n&&(r.getSourceDataAtRow(n[0]).submenu?e.openSubMenu(n[0]).getNavigator().toFirstItem():(e.executeCommand(t),e.close(!0)))}},{keys:[["PageUp"]],callback:()=>{r.getSelectedLast()?r.selection.transformStart(-r.countVisibleRows(),0):e.getNavigator().toFirstItem()}},{keys:[["PageDown"]],callback:()=>{r.getSelectedLast()?r.selection.transformStart(r.countVisibleRows(),0):e.getNavigator().toLastItem()}}]}},57446:(e,t,r)=>{"use strict";r(14846),r(69655),t.__esModule=!0;var n=r(28943);Object.keys(n).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===n[e]||(t[e]=n[e]))}))},28943:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834),r(15724);var s=n(r(85707)),i=r(63496),o=r(95591),a=r(76821),l=r(30889),h=r(55815),u=n(r(3849)),c=r(10587),d=r(25046),p=r(62577),g=r(77661),f=r(89804),m=r(70505),y=r(25499),E=n(r(16050)),w=r(24895),C=r(71120);function v(e,t,r){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}function R(e,t,r){return e.set(T(e,t),r),r}function S(e,t){return e.get(T(e,t))}function T(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var N=new WeakMap,M=new WeakMap,_=new WeakMap;class b{get tableBorderWidth(){return void 0===S(_,this)&&this.hotMenu&&R(_,this,parseInt(this.hotMenu.rootWindow.getComputedStyle(this.hotMenu.view._wt.wtTable.TABLE).borderWidth,10)),S(_,this)}constructor(e,t){var r=this;(0,s.default)(this,"hot",void 0),(0,s.default)(this,"options",void 0),(0,s.default)(this,"eventManager",new u.default(this)),(0,s.default)(this,"container",void 0),(0,s.default)(this,"positioner",void 0),(0,s.default)(this,"hotMenu",null),(0,s.default)(this,"hotSubMenus",{}),(0,s.default)(this,"parentMenu",void 0),(0,s.default)(this,"menuItems",null),(0,s.default)(this,"origOutsideClickDeselects",null),v(this,N,void 0),v(this,M,void 0),v(this,_,void 0),this.hot=e,this.options=t||{parent:null,name:null,className:"",keepInViewport:!0,standalone:!1,minWidth:215,container:this.hot.rootDocument.documentElement},this.container=this.createContainer(this.options.name),this.positioner=new i.Positioner(this.options.keepInViewport),this.parentMenu=this.options.parent||null,this.registerEvents(),this.isSubMenu()&&this.addLocalHook("afterSelectionChange",(function(){for(var e=arguments.length,t=new Array(e),n=0;n{var r;t||(null===(r=this.hotMenu)||void 0===r||r.useTheme(e))}))}registerEvents(){let e=this.hot.rootWindow;for(;e;)this.eventManager.addEventListener(e.document,"mousedown",(e=>this.onDocumentMouseDown(e))),this.eventManager.addEventListener(e.document,"touchstart",(e=>this.onDocumentMouseDown(e))),this.eventManager.addEventListener(e.document,"contextmenu",(e=>this.onDocumentContextMenu(e))),e=(0,p.getParentWindow)(e)}setMenuItems(e){this.menuItems=e}getNavigator(){return S(N,this)}getKeyboardShortcutsCtrl(){return S(M,this)}getSelectedItem(){return this.hasSelectedItem()?this.hotMenu.getSourceDataAtRow(this.hotMenu.getSelectedLast()[0]):null}hasSelectedItem(){return Array.isArray(this.hotMenu.getSelectedLast())}isSubMenu(){return null!==this.parentMenu}open(){this.runLocalHooks("beforeOpen"),this.container.removeAttribute("style"),this.container.style.display="block";const e=(0,f.debounce)((e=>this.openSubMenu(e)),300),t=this.options.minWidth||215;let r=!1,n=(0,c.arrayFilter)(this.menuItems,(e=>(e.key===l.NO_ITEMS&&(r=!0),(0,h.isItemHidden)(e,this.hot))));if(n.length<1&&!r)n.push((0,l.predefinedItems)()[l.NO_ITEMS]);else if(0===n.length)return;n=(0,h.filterSeparators)(n,l.SEPARATOR);let s=!1;const i={data:n,colHeaders:!1,autoColumnSize:!0,autoWrapRow:!1,modifyColWidth:e=>(0,m.isDefined)(e)&&e{S(N,this).setCurrentPage(t.row)},afterOnCellMouseOver:(t,r)=>{this.isAllSubMenusClosed()?e(r.row):this.openSubMenu(r.row)},rowHeights:e=>n[e].name===l.SEPARATOR?1:void 0,afterOnCellContextMenu:e=>{e.preventDefault(),(0,d.isWindowsOS)()&&s&&this.hasSelectedItem()&&this.close(!0)},afterSelection:(e,t,r,n,s)=>{this.hotMenu.view.isMouseDown()&&(s.value=!0),this.runLocalHooks("afterSelectionChange",this.getSelectedItem())},beforeOnCellMouseUp:e=>{this.hasSelectedItem()&&(s=!this.isCommandPassive(this.getSelectedItem()),this.executeCommand(e))},afterOnCellMouseUp:e=>{(0,d.isWindowsOS)()&&(0,g.isRightClick)(e)||!s||!this.hasSelectedItem()||((0,d.isMobileBrowser)()||(0,d.isIpadOS)()?this.hot._registerTimeout((()=>this.close(!0)),325):this.close(!0))},afterUnlisten:()=>{!this.hasSelectedItem()&&this.isOpened()&&this.hotMenu.listen()}};this.origOutsideClickDeselects=this.hot.getSettings().outsideClickDeselects,this.hot.getSettings().outsideClickDeselects=!1,this.hotMenu=new this.hot.constructor(this.container,i),this.hotMenu.addHook("afterInit",(()=>this.onAfterInit())),this.hotMenu.init(),R(N,this,(0,o.createMenuNavigator)(this.hotMenu)),R(M,this,(0,a.createKeyboardShortcutsCtrl)(this)),S(M,this).listen(),this.focus(),this.isSubMenu()&&this.addLocalHook("afterOpen",(()=>this.parentMenu.runLocalHooks("afterSubmenuOpen",this))),this.runLocalHooks("afterOpen",this)}close(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isOpened())if(e&&this.isSubMenu())this.parentMenu.close();else if(S(N,this).clear(),this.closeAllSubMenus(),this.container.style.display="none",this.hotMenu.destroy(),this.hotMenu=null,this.hot.getSettings().outsideClickDeselects=this.origOutsideClickDeselects,this.runLocalHooks("afterClose"),this.isSubMenu()){if(this.hot.getSettings().ariaTags){const e=this.parentMenu.hotMenu.getSelectedLast();if(e){const t=this.parentMenu.hotMenu.getCell(e[0],0);(0,p.setAttribute)(t,[(0,C.A11Y_EXPANDED)(!1)])}}this.parentMenu.hotMenu.listen()}}openSubMenu(e){if(!this.hotMenu)return!1;const t=this.hotMenu.getCell(e,0);if(this.closeAllSubMenus(),!t||!(0,h.hasSubMenu)(t))return!1;const r=this.hotMenu.getSourceDataAtRow(e),n=new b(this.hot,{parent:this,name:r.name,className:this.options.className,keepInViewport:!0,container:this.options.container});return n.setMenuItems(r.submenu.items),n.open(),n.setPosition(t.getBoundingClientRect()),this.hotSubMenus[r.key]=n,this.hot.getSettings().ariaTags&&(0,p.setAttribute)(t,[(0,C.A11Y_EXPANDED)(!0)]),n}closeSubMenu(e){const t=this.hotMenu.getSourceDataAtRow(e),r=this.hotSubMenus[t.key];if(r){r.destroy(),delete this.hotSubMenus[t.key];const n=this.hotMenu.getCell(e,0);this.hot.getSettings().ariaTags&&(0,p.setAttribute)(n,[(0,C.A11Y_EXPANDED)(!1)])}}closeAllSubMenus(){(0,c.arrayEach)(this.hotMenu.getData(),((e,t)=>this.closeSubMenu(t)))}isAllSubMenusClosed(){return 0===Object.keys(this.hotSubMenus).length}focus(){this.isOpened()&&(this.hotMenu.rootElement.focus({preventScroll:!0}),this.getKeyboardShortcutsCtrl().listen(),this.hotMenu.listen())}destroy(){const e=this.container.parentNode;this.clearLocalHooks(),this.close(),this.parentMenu=null,this.eventManager.destroy(),e&&e.removeChild(this.container)}isOpened(){return null!==this.hotMenu}executeCommand(e){if(!this.isOpened()||!this.hasSelectedItem())return;const t=this.getSelectedItem();if(this.runLocalHooks("select",t,e),this.isCommandPassive(t))return;const r=this.hot.getSelectedRange(),n=r?(0,h.normalizeSelection)(r):[];this.runLocalHooks("executeCommand",t.key,n,e),this.isSubMenu()&&this.parentMenu.runLocalHooks("executeCommand",t.key,n,e)}isCommandPassive(e){return!1===e.isCommand||(0,h.isItemSeparator)(e)||(0,h.isItemDisabled)(e,this.hot)||(0,h.isItemSubMenu)(e)}setOffset(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.positioner.setOffset(e,t)}setPosition(e){this.isSubMenu()&&this.positioner.setParentElement(this.parentMenu.container),this.positioner.setElement(this.container).updatePosition(e)}updateMenuDimensions(){const{wtTable:e}=this.hotMenu.view._wt,t=this.hotMenu.getSettings().data,r=e.hider.style,n=e.holder.style,s=parseInt(r.width,10),i=(0,c.arrayReduce)(t,((e,t,r)=>{const n=this.hotMenu.getCell(r,0)?(0,p.outerHeight)(this.hotMenu.getCell(r,0)):0;return e+(t.name===l.SEPARATOR?1:n)}),0);n.width=`${s}px`,n.height=`${i}px`,r.height=n.height}createContainer(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;const t=this.options.container.ownerDocument;let r,n=e;return n&&((0,f.isFunction)(n)&&(n=n.call(this.hot),n=null===n||(0,m.isUndefined)(n)?"":n.toString()),n=n.replace(/[^A-Za-z0-9]/g,"_"),n=`${this.options.className}Sub_${n}`,r=t.querySelector(`.${this.options.className}.${n}`)),r||(r=t.createElement("div"),(0,p.addClass)(r,`htMenu handsontable ${this.options.className}`),n&&(0,p.addClass)(r,n),this.options.container.appendChild(r)),r}onAfterInit(){this.updateMenuDimensions(),this.hot.getSettings().ariaTags&&(0,p.setAttribute)(this.hotMenu.rootElement,[(0,C.A11Y_MENU)(),(0,C.A11Y_TABINDEX)(-1)])}onDocumentMouseDown(e){this.isOpened()&&(this.options.standalone&&this.hotMenu&&!(0,p.isChildOf)(e.target,this.hotMenu.rootElement)?this.close(!0):!this.isAllSubMenusClosed()&&!this.isSubMenu()||(0,p.isChildOf)(e.target,".htMenu")||this.close(!0))}onDocumentContextMenu(e){this.isOpened()&&(0,p.hasClass)(e.target,"htCore")&&(0,p.isChildOf)(e.target,this.hotMenu.rootElement)&&e.preventDefault()}}t.Menu=b,(0,y.mixin)(b,E.default)},24895:(e,t,r)=>{"use strict";t.__esModule=!0,t.createMenuItemRenderer=function(e){return(t,r,o,a,l,h)=>{const u=t.getSourceDataAtRow(o),c=e.rootDocument.createElement("div"),d="function"==typeof h?h.call(e):h,p="function"==typeof u.ariaLabel?u.ariaLabel.call(e):u.ariaLabel,g="function"==typeof u.ariaChecked?u.ariaChecked.call(e):u.ariaChecked;if((0,s.empty)(r),(0,s.addClass)(c,"htItemWrapper"),e.getSettings().ariaTags){const t=!(0,n.isItemDisabled)(u,e)&&!(0,n.isItemSelectionDisabled)(u)&&!(0,n.isItemSeparator)(u);(0,s.setAttribute)(r,[...(0,n.isItemCheckable)(u)?[(0,i.A11Y_MENU_ITEM_CHECKBOX)(),(0,i.A11Y_LABEL)(p),(0,i.A11Y_CHECKED)(g)]:[(0,i.A11Y_MENU_ITEM)(),(0,i.A11Y_LABEL)(d)],...t?[(0,i.A11Y_TABINDEX)(-1)]:[],...(0,n.isItemDisabled)(u,e)?[(0,i.A11Y_DISABLED)()]:[],...(0,n.isItemSubMenu)(u)?[(0,i.A11Y_EXPANDED)(!1)]:[]])}r.className="",r.appendChild(c),(0,n.isItemSeparator)(u)?(0,s.addClass)(r,"htSeparator"):"function"==typeof u.renderer?((0,s.addClass)(r,"htCustomMenuRenderer"),r.appendChild(u.renderer(t,c,o,a,l,d))):(0,s.fastInnerHTML)(c,d),(0,n.isItemDisabled)(u,e)?(0,s.addClass)(r,"htDisabled"):(0,n.isItemSelectionDisabled)(u)?(0,s.addClass)(r,"htSelectionDisabled"):(0,n.isItemSubMenu)(u)&&(0,s.addClass)(r,"htSubmenu")}};var n=r(55815),s=r(62577),i=r(71120)},95591:(e,t,r)=>{"use strict";t.__esModule=!0,t.createMenuNavigator=function(e){return(0,n.createPaginator)({size:()=>e.countRows(),onItemSelect(t,r){const n=e.getCell(t,0);if(!n||(0,s.isSeparator)(n)||(0,s.isDisabled)(n)||(0,s.isSelectionDisabled)(n))return!1;e.selectCell(t,0,...r?[t,0,!1,!1]:[])},onClear(){e.deselectCell()}})};var n=r(27453),s=r(55815)},63496:(e,t,r)=>{"use strict";t.__esModule=!0,r(67834);var n=r(32574);function s(e,t,r){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}function i(e,t){return e.get(a(e,t))}function o(e,t,r){return e.set(a(e,t),r),r}function a(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var l=new WeakMap,h=new WeakMap,u=new WeakMap,c=new WeakMap,d=new WeakMap;t.Positioner=class{constructor(e){s(this,l,void 0),s(this,h,void 0),s(this,u,void 0),s(this,c,!1),s(this,d,{above:0,below:0,left:0,right:0}),o(c,this,e)}setOffset(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return i(d,this)[e]=t,this}setElement(e){return o(l,this,e),this}setParentElement(e){return o(h,this,e),this}updatePosition(e){o(u,this,new n.Cursor(e,i(l,this).ownerDocument.defaultView)),i(c,this)?(i(u,this).fitsBelow(i(l,this))?this.setPositionBelowCursor():i(u,this).fitsAbove(i(l,this))?this.setPositionAboveCursor():this.setPositionBelowCursor(),this.updateHorizontalPosition()):(this.setPositionBelowCursor(),this.setPositionOnRightOfCursor())}updateHorizontalPosition(){"rtl"===i(l,this).dir?i(u,this).fitsOnLeft(i(l,this))?this.setPositionOnLeftOfCursor():this.setPositionOnRightOfCursor():i(u,this).fitsOnRight(i(l,this))?this.setPositionOnRightOfCursor():this.setPositionOnLeftOfCursor()}setPositionAboveCursor(){let e=i(d,this).above+i(u,this).top-i(l,this).offsetHeight;i(h,this)&&(e=i(u,this).top+i(u,this).cellHeight-i(l,this).offsetHeight+3),i(l,this).style.top=`${e}px`}setPositionBelowCursor(){let e=i(d,this).below+i(u,this).top+1;i(h,this)&&(e=i(u,this).top-1),i(l,this).style.top=`${e}px`}setPositionOnRightOfCursor(){let e=i(u,this).left;if(i(h,this)){const t=i(h,this).ownerDocument.defaultView,r=Number.parseInt(t.getComputedStyle(i(h,this).querySelector(".htCore")).borderRightWidth,10);e+=i(u,this).cellWidth+r}else e+=i(d,this).right;i(l,this).style.left=`${e}px`}setPositionOnLeftOfCursor(){let e=i(d,this).left+i(u,this).left-i(l,this).offsetWidth;if(i(h,this)){const t=i(h,this).ownerDocument.defaultView;e-=Number.parseInt(t.getComputedStyle(i(h,this).querySelector(".htCore")).borderLeftWidth,10)}i(l,this).style.left=`${e}px`}}},76821:(e,t,r)=>{"use strict";t.__esModule=!0,t.createKeyboardShortcutsCtrl=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const r=[];function o(e,t){h(t).addShortcuts(e,{group:s})}function a(e,t){const n=h(t);e.forEach((e=>{let{keys:t}=e;t.forEach((e=>n.removeShortcutsByKeys(e)))})),r.push({shortcuts:e,contextName:t}),o(e,t)}function l(e){return e?`${i}:${e}`:i}function h(t){var r;const n=e.hotMenu.getShortcutManager(),s=l(t);return null!==(r=n.getContext(s))&&void 0!==r?r:n.addContext(s)}return o((0,n.createDefaultShortcutsList)(e)),t.forEach((e=>{let{shortcuts:t,contextName:r}=e;a(t,r)})),{addCustomShortcuts:a,getCustomShortcuts:function(){return[...r]},getContext:h,listen:function(t){e.hotMenu.getShortcutManager().setActiveContextName(l(t))}}},r(15724),r(14846),r(69655);var n=r(81480);const s="menu",i=s},55815:(e,t,r)=>{"use strict";t.__esModule=!0,t.filterSeparators=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.SEPARATOR,r=e.slice(0);return r=a(r,t),r=function(e,t){let r=e.slice(0);return r.reverse(),r=a(r,t),r.reverse(),r}(r,t),r=function(e){const t=[];return(0,n.arrayEach)(e,((e,r)=>{r>0?t[t.length-1].name!==e.name&&t.push(e):t.push(e)})),t}(r),r},t.hasSubMenu=function(e){return(0,i.hasClass)(e,"htSubmenu")},t.isDisabled=function(e){return(0,i.hasClass)(e,"htDisabled")},t.isItemCheckable=function(e){return!0===e.checkable},t.isItemDisabled=function(e,t){return!0===e.disabled||"function"==typeof e.disabled&&!0===e.disabled.call(t)},t.isItemHidden=function(e,t){return!e.hidden||!("function"==typeof e.hidden&&e.hidden.call(t))},t.isItemSelectionDisabled=function(e){return(0,s.hasOwnProperty)(e,"disableSelection")},t.isItemSeparator=function(e){return new RegExp(o.SEPARATOR,"i").test(e.name)},t.isItemSubMenu=function(e){return(0,s.hasOwnProperty)(e,"submenu")},t.isSelectionDisabled=function(e){return(0,i.hasClass)(e,"htSelectionDisabled")},t.isSeparator=function(e){return(0,i.hasClass)(e,"htSeparator")},t.normalizeSelection=function(e){return(0,n.arrayMap)(e,(e=>({start:e.getTopStartCorner(),end:e.getBottomEndCorner()})))},r(15724);var n=r(10587),s=r(25499),i=r(62577),o=r(30889);function a(e,t){const r=e.slice(0);for(let e=0;e{"use strict";t.__esModule=!0,t.default=function(){return{key:a,name(){return this.getTranslatedPhrase(i.CONTEXTMENU_ITEMS_ALIGNMENT)},disabled(){if(0===this.countRows()||0===this.countCols())return!0;const e=this.getSelectedRangeLast();return!e||(!!e.isSingleHeader()||!(this.getSelectedRange()&&!this.selection.isSelectedByCorner()))},submenu:{items:[{key:`${a}:left`,name(){return this.getTranslatedPhrase(i.CONTEXTMENU_ITEMS_ALIGNMENT_LEFT)},callback(){const e=this.getSelectedRange(),t=(0,n.getAlignmentClasses)(e,((e,t)=>this.getCellMeta(e,t).className)),r="horizontal",s="htLeft";this.runHooks("beforeCellAlignment",t,e,r,s),(0,n.align)(e,r,s,((e,t)=>this.getCellMeta(e,t)),((e,t,r,n)=>this.setCellMeta(e,t,r,n))),this.render()},disabled:!1},{key:`${a}:center`,name(){return this.getTranslatedPhrase(i.CONTEXTMENU_ITEMS_ALIGNMENT_CENTER)},callback(){const e=this.getSelectedRange(),t=(0,n.getAlignmentClasses)(e,((e,t)=>this.getCellMeta(e,t).className)),r="horizontal",s="htCenter";this.runHooks("beforeCellAlignment",t,e,r,s),(0,n.align)(e,r,s,((e,t)=>this.getCellMeta(e,t)),((e,t,r,n)=>this.setCellMeta(e,t,r,n))),this.render()},disabled:!1},{key:`${a}:right`,name(){return this.getTranslatedPhrase(i.CONTEXTMENU_ITEMS_ALIGNMENT_RIGHT)},callback(){const e=this.getSelectedRange(),t=(0,n.getAlignmentClasses)(e,((e,t)=>this.getCellMeta(e,t).className)),r="horizontal",s="htRight";this.runHooks("beforeCellAlignment",t,e,r,s),(0,n.align)(e,r,s,((e,t)=>this.getCellMeta(e,t)),((e,t,r,n)=>this.setCellMeta(e,t,r,n))),this.render()},disabled:!1},{key:`${a}:justify`,name(){return this.getTranslatedPhrase(i.CONTEXTMENU_ITEMS_ALIGNMENT_JUSTIFY)},callback(){const e=this.getSelectedRange(),t=(0,n.getAlignmentClasses)(e,((e,t)=>this.getCellMeta(e,t).className)),r="horizontal",s="htJustify";this.runHooks("beforeCellAlignment",t,e,r,s),(0,n.align)(e,r,s,((e,t)=>this.getCellMeta(e,t)),((e,t,r,n)=>this.setCellMeta(e,t,r,n))),this.render()},disabled:!1},{name:s.KEY},{key:`${a}:top`,name(){return this.getTranslatedPhrase(i.CONTEXTMENU_ITEMS_ALIGNMENT_TOP)},callback(){const e=this.getSelectedRange(),t=(0,n.getAlignmentClasses)(e,((e,t)=>this.getCellMeta(e,t).className)),r="vertical",s="htTop";this.runHooks("beforeCellAlignment",t,e,r,s),(0,n.align)(e,r,s,((e,t)=>this.getCellMeta(e,t)),((e,t,r,n)=>this.setCellMeta(e,t,r,n))),this.render()},disabled:!1},{key:`${a}:middle`,name(){return this.getTranslatedPhrase(i.CONTEXTMENU_ITEMS_ALIGNMENT_MIDDLE)},callback(){const e=this.getSelectedRange(),t=(0,n.getAlignmentClasses)(e,((e,t)=>this.getCellMeta(e,t).className)),r="vertical",s="htMiddle";this.runHooks("beforeCellAlignment",t,e,r,s),(0,n.align)(e,r,s,((e,t)=>this.getCellMeta(e,t)),((e,t,r,n)=>this.setCellMeta(e,t,r,n))),this.render()},disabled:!1},{key:`${a}:bottom`,name(){return this.getTranslatedPhrase(i.CONTEXTMENU_ITEMS_ALIGNMENT_BOTTOM)},callback(){const e=this.getSelectedRange(),t=(0,n.getAlignmentClasses)(e,((e,t)=>this.getCellMeta(e,t).className)),r="vertical",s="htBottom";this.runHooks("beforeCellAlignment",t,e,r,s),(0,n.align)(e,r,s,((e,t)=>this.getCellMeta(e,t)),((e,t,r,n)=>this.setCellMeta(e,t,r,n))),this.render()},disabled:!1}]}}};var n=r(21577),s=r(68094),i=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=o(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var a=s?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n}(r(23384));function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(o=function(e){return e?r:t})(e)}const a=t.KEY="alignment"},67234:(e,t,r)=>{"use strict";t.__esModule=!0,t.default=function(){return{key:i,name(){return this.getTranslatedPhrase(n.CONTEXTMENU_ITEMS_CLEAR_COLUMN)},callback(e,t){const r=t[0].start.col,n=t[0].end.col;this.countRows()&&this.populateFromArray(0,r,[[null]],Math.max(t[0].start.row,t[0].end.row),n,"ContextMenu.clearColumn")},disabled(){const e=this.getSelectedRangeLast();if(!e||e.isSingleHeader()&&e.highlight.col<0||!this.selection.isSelectedByColumnHeader())return!0;let t=!1;return e.forAll(((e,r)=>{if(e<0||r<0)return!0;const{readOnly:n}=this.getCellMeta(e,r);return!!n||(t=!0,!1)})),!t}}};var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=s(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(r(23384));function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(s=function(e){return e?r:t})(e)}const i=t.KEY="clear_column"},41514:(e,t,r)=>{"use strict";t.__esModule=!0,t.default=function(){return{key:i,name(){return this.getTranslatedPhrase(n.CONTEXTMENU_ITEMS_INSERT_LEFT)},callback(){const e=this.getSelectedRangeLast().getTopLeftCorner(),t=this.isRtl()?"insert_col_end":"insert_col_start";this.alter(t,e.col,1,"ContextMenu.columnLeft")},disabled(){if(!this.isColumnModificationAllowed())return!0;const e=this.getSelectedRangeLast();if(!e)return!0;if(e.isSingleHeader()&&e.highlight.col<0)return!0;if(this.selection.isSelectedByCorner()){return 0===this.countCols()}return this.selection.isSelectedByRowHeader()||this.countCols()>=this.getSettings().maxCols},hidden(){return!this.getSettings().allowInsertColumn}}};var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=s(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(r(23384));function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(s=function(e){return e?r:t})(e)}const i=t.KEY="col_left"},19373:(e,t,r)=>{"use strict";t.__esModule=!0,t.default=function(){return{key:i,name(){return this.getTranslatedPhrase(n.CONTEXTMENU_ITEMS_INSERT_RIGHT)},callback(){const e=this.getSelectedRangeLast().getTopRightCorner(),t=this.isRtl()?"insert_col_start":"insert_col_end";this.alter(t,e.col,1,"ContextMenu.columnRight")},disabled(){if(!this.isColumnModificationAllowed())return!0;const e=this.getSelectedRangeLast();return!e||(!!(e.isSingleHeader()&&e.highlight.col<0)||!this.selection.isSelectedByCorner()&&(this.selection.isSelectedByRowHeader()||this.countCols()>=this.getSettings().maxCols))},hidden(){return!this.getSettings().allowInsertColumn}}};var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=s(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(r(23384));function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(s=function(e){return e?r:t})(e)}const i=t.KEY="col_right"},30889:(e,t,r)=>{"use strict";t.__esModule=!0,t.addItem=function(e,t){-1===w.indexOf(e)&&(C[e]=t)},t.predefinedItems=function(){const e={};return(0,n.objectEach)(C,((t,r)=>{e[r]=t()})),e};var n=r(25499),s=E(r(17244));t.ALIGNMENT=s.KEY;var i=E(r(67234));t.CLEAR_COLUMN=i.KEY;var o=E(r(41514));t.COLUMN_LEFT=o.KEY;var a=E(r(19373));t.COLUMN_RIGHT=a.KEY;var l=E(r(33491));t.READ_ONLY=l.KEY;var h=E(r(70253));t.REDO=h.KEY;var u=E(r(7611));t.REMOVE_COLUMN=u.KEY;var c=E(r(41557));t.REMOVE_ROW=c.KEY;var d=E(r(67980));t.ROW_ABOVE=d.KEY;var p=E(r(67456));t.ROW_BELOW=p.KEY;var g=E(r(68094));t.SEPARATOR=g.KEY;var f=E(r(72952));t.NO_ITEMS=f.KEY;var m=E(r(79383));function y(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(y=function(e){return e?r:t})(e)}function E(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=y(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var o=s?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(n,i,o):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n}t.UNDO=m.KEY;const w=t.ITEMS=[d.KEY,p.KEY,o.KEY,a.KEY,i.KEY,c.KEY,u.KEY,m.KEY,h.KEY,l.KEY,s.KEY,g.KEY,f.KEY],C={[g.KEY]:g.default,[f.KEY]:f.default,[d.KEY]:d.default,[p.KEY]:p.default,[o.KEY]:o.default,[a.KEY]:a.default,[i.KEY]:i.default,[c.KEY]:c.default,[u.KEY]:u.default,[m.KEY]:m.default,[h.KEY]:h.default,[l.KEY]:l.default,[s.KEY]:s.default}},72952:(e,t,r)=>{"use strict";t.__esModule=!0,t.default=function(){return{key:s,name(){return this.getTranslatedPhrase(n.CONTEXTMENU_ITEMS_NO_ITEMS)},disabled:!0,isCommand:!1}};var n=r(23384);const s=t.KEY="no_items"},33491:(e,t,r)=>{"use strict";t.__esModule=!0,t.default=function(){return{key:a,checkable:!0,ariaChecked(){return(0,n.checkSelectionConsistency)(this.getSelectedRange(),((e,t)=>this.getCellMeta(e,t).readOnly))},ariaLabel(){return this.getTranslatedPhrase(i.CONTEXTMENU_ITEMS_READ_ONLY)},name(){let e=this.getTranslatedPhrase(i.CONTEXTMENU_ITEMS_READ_ONLY);return(0,n.checkSelectionConsistency)(this.getSelectedRange(),((e,t)=>this.getCellMeta(e,t).readOnly))&&(e=(0,n.markLabelAsSelected)(e)),e},callback(){const e=this.getSelectedRange(),t=(0,n.checkSelectionConsistency)(e,((e,t)=>this.getCellMeta(e,t).readOnly));(0,s.arrayEach)(e,(e=>{e.forAll(((e,r)=>{e>=0&&r>=0&&this.setCellMeta(e,r,"readOnly",!t)}))})),this.render()},disabled(){const e=this.getSelectedRangeLast();return!e||(!!e.isSingleHeader()||(!!this.selection.isSelectedByCorner()||(0===this.countRows()||0===this.countCols()||(!this.getSelectedRange()||0===this.getSelectedRange().length))))}}};var n=r(21577),s=r(10587),i=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=o(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var a=s?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n}(r(23384));function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(o=function(e){return e?r:t})(e)}const a=t.KEY="make_read_only"},70253:(e,t,r)=>{"use strict";t.__esModule=!0,t.default=function(){return{key:i,name(){return this.getTranslatedPhrase(n.CONTEXTMENU_ITEMS_REDO)},callback(){this.redo()},hidden(){const e=this.getPlugin("undoRedo");return!e||!e.isEnabled()},disabled(){return!this.getPlugin("undoRedo").isRedoAvailable()}}};var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=s(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(r(23384));function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(s=function(e){return e?r:t})(e)}const i=t.KEY="redo"},7611:(e,t,r)=>{"use strict";t.__esModule=!0,t.default=function(){return{key:o,name(){const e=this.getSelected();let t=0;if(e)if(e.length>1)t=1;else{const[,r,,n]=e[0];r-n!=0&&(t=1)}return this.getTranslatedPhrase(s.CONTEXTMENU_ITEMS_REMOVE_COLUMN,t)},callback(){this.alter("remove_col",(0,n.transformSelectionToColumnDistance)(this),null,"ContextMenu.removeColumn")},disabled(){if(!this.isColumnModificationAllowed())return!0;const e=this.getSelectedRangeLast();if(!e)return!0;if(e.isSingleHeader()&&e.highlight.col<0)return!0;const t=this.countCols();return this.selection.isSelectedByCorner()?0===t:this.selection.isSelectedByRowHeader()||0===t},hidden(){return!this.getSettings().allowRemoveColumn}}};var n=r(13208),s=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=i(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=s?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(r(23384));function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(i=function(e){return e?r:t})(e)}const o=t.KEY="remove_col"},41557:(e,t,r)=>{"use strict";t.__esModule=!0,t.default=function(){return{key:o,name(){const e=this.getSelected();let t=0;if(e)if(e.length>1)t=1;else{const[r,,n]=e[0];r-n!=0&&(t=1)}return this.getTranslatedPhrase(s.CONTEXTMENU_ITEMS_REMOVE_ROW,t)},callback(){this.alter("remove_row",(0,n.transformSelectionToRowDistance)(this),1,"ContextMenu.removeRow")},disabled(){const e=this.getSelectedRangeLast();if(!e)return!0;if(e.isSingleHeader()&&e.highlight.row<0)return!0;const t=this.countRows();return this.selection.isSelectedByCorner()?0===t:this.selection.isSelectedByColumnHeader()||0===t},hidden(){return!this.getSettings().allowRemoveRow}}};var n=r(13208),s=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=i(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=s?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(r(23384));function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(i=function(e){return e?r:t})(e)}const o=t.KEY="remove_row"},67980:(e,t,r)=>{"use strict";t.__esModule=!0,t.default=function(){return{key:i,name(){return this.getTranslatedPhrase(n.CONTEXTMENU_ITEMS_ROW_ABOVE)},callback(){const e=this.getSelectedRangeLast().getTopLeftCorner();this.alter("insert_row_above",e.row,1,"ContextMenu.rowAbove")},disabled(){const e=this.getSelectedRangeLast();if(!e)return!0;if(e.isSingleHeader()&&e.highlight.row<0)return!0;if(this.selection.isSelectedByCorner()){return 0===this.countRows()}return this.selection.isSelectedByColumnHeader()||this.countRows()>=this.getSettings().maxRows},hidden(){return!this.getSettings().allowInsertRow}}};var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=s(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(r(23384));function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(s=function(e){return e?r:t})(e)}const i=t.KEY="row_above"},67456:(e,t,r)=>{"use strict";t.__esModule=!0,t.default=function(){return{key:i,name(){return this.getTranslatedPhrase(n.CONTEXTMENU_ITEMS_ROW_BELOW)},callback(){const e=this.getSelectedRangeLast().getBottomRightCorner();this.alter("insert_row_below",e.row,1,"ContextMenu.rowBelow")},disabled(){const e=this.getSelectedRangeLast();return!e||(!!(e.isSingleHeader()&&e.highlight.row<0)||!this.selection.isSelectedByCorner()&&(this.selection.isSelectedByColumnHeader()||this.countRows()>=this.getSettings().maxRows))},hidden(){return!this.getSettings().allowInsertRow}}};var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=s(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(r(23384));function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(s=function(e){return e?r:t})(e)}const i=t.KEY="row_below"},68094:(e,t)=>{"use strict";t.__esModule=!0,t.default=function(){return{name:r}};const r=t.KEY="---------"},79383:(e,t,r)=>{"use strict";t.__esModule=!0,t.default=function(){return{key:i,name(){return this.getTranslatedPhrase(n.CONTEXTMENU_ITEMS_UNDO)},callback(){this.undo()},hidden(){const e=this.getPlugin("undoRedo");return!e||!e.isEnabled()},disabled(){return!this.getPlugin("undoRedo").isUndoAvailable()}}};var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=s(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(r(23384));function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(s=function(e){return e?r:t})(e)}const i=t.KEY="undo"},21577:(e,t,r)=>{"use strict";t.__esModule=!0,t.align=function(e,t,r,o,a){(0,n.arrayEach)(e,(e=>{e.forAll(((e,n)=>{e>=0&&n>=0&&function(e,t,r,n,o,a){const l=o(e,t);let h=n;l.className&&(h="vertical"===r?s(l.className,n):i(l.className,n));a(e,t,"className",h)}(e,n,t,r,o,a)}))}))},t.checkSelectionConsistency=function(e,t){let r=!1;Array.isArray(e)&&(0,n.arrayEach)(e,(e=>(e.forAll(((e,n)=>{if(e>=0&&n>=0&&t(e,n))return r=!0,!1})),r)));return r},t.getAlignmentClasses=function(e,t){const r={};return(0,n.arrayEach)(e,(e=>{e.forAll(((e,n)=>{e>=0&&n>=0&&(r[e]||(r[e]=[]),r[e][n]=t(e,n))}))})),r},t.getAlignmentComparatorByClass=function(e){return function(t,r){const n=this.getCellMeta(t,r).className;return n&&-1!==n.indexOf(e)}},t.getDocumentOffsetByElement=function(e,t){const r={top:0,left:0};if(t!==e.ownerDocument){const{frameElement:e}=t.defaultView,{top:n,left:s}=e.getBoundingClientRect();r.top=n,r.left=s}return r},t.markLabelAsSelected=function(e){return`${String.fromCharCode(10003)}${e}`},t.prepareHorizontalAlignClass=i,t.prepareVerticalAlignClass=s;var n=r(10587);function s(e,t){if(-1!==e.indexOf(t))return e;return`${e.replace("htTop","").replace("htMiddle","").replace("htBottom","").replace(" ","")} ${t}`}function i(e,t){if(-1!==e.indexOf(t))return e;return`${e.replace("htLeft","").replace("htCenter","").replace("htRight","").replace("htJustify","").replace(" ","")} ${t}`}},21422:(e,t)=>{"use strict";t.__esModule=!0;t.default=class{constructor(){this.data={}}setData(e,t){this.data[e]=t}getData(e){return this.data[e]||void 0}}},74475:(e,t,r)=>{"use strict";t.__esModule=!0,t.default=function(e){return{key:"copy",name(){return this.getTranslatedPhrase(n.CONTEXTMENU_ITEMS_COPY)},callback(){e.copyCellsOnly()},disabled(){if(0===this.countRows()||0===this.countCols())return!0;const e=this.getSelectedRangeLast();if(!e)return!0;if(e.isSingleHeader())return!0;const t=this.getSelected();return!t||t.length>1},hidden:!1}};var n=r(23384)},40465:(e,t,r)=>{"use strict";t.__esModule=!0,t.default=function(e){return{key:"copy_column_headers_only",name(){const e=this.getSelectedRangeLast(),t=e?(0,s.clamp)(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(n.CONTEXTMENU_ITEMS_COPY_COLUMN_HEADERS_ONLY,t)},callback(){e.copyColumnHeadersOnly()},disabled(){if(!this.hasColHeaders())return!0;const e=this.getSelectedRangeLast();if(!e)return!0;if(e.isSingleHeader())return!0;const t=this.getSelected();return!t||t.length>1},hidden:!1}};var n=r(23384),s=r(22137)},85710:(e,t,r)=>{"use strict";t.__esModule=!0,t.default=function(e){return{key:"copy_with_column_group_headers",name(){const e=this.getSelectedRangeLast(),t=e?(0,s.clamp)(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(n.CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_GROUP_HEADERS,t)},callback(){e.copyWithAllColumnHeaders()},disabled(){if(!this.hasColHeaders()||!this.getSettings().nestedHeaders)return!0;const e=this.getSelectedRangeLast();if(!e)return!0;if(e.isSingleHeader())return!0;const t=this.getSelected();return!t||t.length>1},hidden:!1}};var n=r(23384),s=r(22137)},47011:(e,t,r)=>{"use strict";t.__esModule=!0,t.default=function(e){return{key:"copy_with_column_headers",name(){const e=this.getSelectedRangeLast(),t=e?(0,s.clamp)(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(n.CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_HEADERS,t)},callback(){e.copyWithColumnHeaders()},disabled(){if(!this.hasColHeaders())return!0;const e=this.getSelectedRangeLast();if(!e)return!0;if(e.isSingleHeader())return!0;const t=this.getSelected();return!t||t.length>1},hidden:!1}};var n=r(23384),s=r(22137)},60104:(e,t,r)=>{"use strict";t.__esModule=!0,t.default=function(e){return{key:"cut",name(){return this.getTranslatedPhrase(n.CONTEXTMENU_ITEMS_CUT)},callback(){e.cut()},disabled(){if(0===this.countRows()||0===this.countCols())return!0;const e=this.getSelectedRangeLast();if(!e)return!0;if(e.isSingleHeader())return!0;const t=this.getSelected();return!t||t.length>1},hidden:!1}};var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=s(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(r(23384));function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(s=function(e){return e?r:t})(e)}},23176:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834),r(15724),r(14846),r(27458),r(94364);var s=n(r(85707)),i=r(75089),o=r(28197),a=r(42354),l=r(10587),h=r(5893),u=r(62577),c=r(25046),d=n(r(74475)),p=n(r(40465)),g=n(r(85710)),f=n(r(47011)),m=n(r(60104)),y=n(r(18467)),E=r(25525),w=r(96173);function C(e,t,r){v(e,t),t.set(e,r)}function v(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function R(e,t){return e.get(T(e,t))}function S(e,t,r){return e.set(T(e,t),r),r}function T(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}o.Hooks.getSingleton().register("afterCopyLimit"),o.Hooks.getSingleton().register("modifyCopyableRange"),o.Hooks.getSingleton().register("beforeCut"),o.Hooks.getSingleton().register("afterCut"),o.Hooks.getSingleton().register("beforePaste"),o.Hooks.getSingleton().register("afterPaste"),o.Hooks.getSingleton().register("beforeCopy"),o.Hooks.getSingleton().register("afterCopy");const N=t.PLUGIN_KEY="copyPaste",M=t.PLUGIN_PRIORITY=80,_=["fragmentSelection"],b=['',''].join("");var O=new WeakMap,A=new WeakMap,I=new WeakMap,x=new WeakMap,P=new WeakMap,L=new WeakMap,D=new WeakMap,k=new WeakMap,H=new WeakSet;class F extends i.BasePlugin{constructor(){var e,t;super(...arguments),v(e=this,t=H),t.add(e),(0,s.default)(this,"columnsLimit",1/0),(0,s.default)(this,"rowsLimit",1/0),(0,s.default)(this,"pasteMode","overwrite"),(0,s.default)(this,"uiContainer",this.hot.rootDocument.body),C(this,O,!1),C(this,A,!1),C(this,I,!1),C(this,x,"cells-only"),C(this,P,!1),C(this,L,!1),C(this,D,new E.CopyableRangesFactory({countRows:()=>this.hot.countRows(),countColumns:()=>this.hot.countCols(),rowsLimit:()=>this.rowsLimit,columnsLimit:()=>this.columnsLimit,countColumnHeaders:()=>this.hot.view.getColumnHeadersCount()})),C(this,k,!1),(0,s.default)(this,"copyableRanges",[])}static get PLUGIN_KEY(){return N}static get SETTING_KEYS(){return[N,..._]}static get PLUGIN_PRIORITY(){return M}static get DEFAULT_SETTINGS(){return{pasteMode:"overwrite",rowsLimit:1/0,columnsLimit:1/0,copyColumnHeaders:!1,copyColumnGroupHeaders:!1,copyColumnHeadersOnly:!1}}isEnabled(){return!!this.hot.getSettings()[N]}enablePlugin(){var e,t,r=this;this.enabled||(this.pasteMode=null!==(e=this.getSetting("pasteMode"))&&void 0!==e?e:this.pasteMode,this.rowsLimit=isNaN(this.getSetting("rowsLimit"))?this.rowsLimit:this.getSetting("rowsLimit"),this.columnsLimit=isNaN(this.getSetting("columnsLimit"))?this.columnsLimit:this.getSetting("columnsLimit"),S(O,this,this.getSetting("copyColumnHeaders")),S(A,this,this.getSetting("copyColumnGroupHeaders")),S(I,this,this.getSetting("copyColumnHeadersOnly")),this.uiContainer=null!==(t=this.getSetting("uiContainer"))&&void 0!==t?t:this.uiContainer,this.addHook("afterContextMenuDefaultOptions",(e=>T(H,this,Y).call(this,e))),this.addHook("afterSelection",(function(){for(var e=arguments.length,t=new Array(e),n=0;nT(H,this,j).call(this))),this.eventManager.addEventListener(this.hot.rootDocument,"copy",(function(){return r.onCopy(...arguments)})),this.eventManager.addEventListener(this.hot.rootDocument,"cut",(function(){return r.onCut(...arguments)})),this.eventManager.addEventListener(this.hot.rootDocument,"paste",(function(){return r.onPaste(...arguments)})),(0,c.isSafari)()&&(this.eventManager.addEventListener(this.hot.rootDocument.body,"mouseenter",(function(){for(var e=arguments.length,t=new Array(e),n=0;nT(H,this,K).call(this)))),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){super.disablePlugin()}copy(){S(x,this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:"cells-only"),S(P,this,!0),T(H,this,U).call(this,"copy")}copyCellsOnly(){this.copy("cells-only")}copyColumnHeadersOnly(){this.copy("column-headers-only")}copyWithAllColumnHeaders(){this.copy("with-column-group-headers")}copyWithColumnHeaders(){this.copy("with-column-headers")}cut(){S(L,this,!0),T(H,this,U).call(this,"cut")}getRangedCopyableData(e){return(0,a.stringify)(this.getRangedData(e))}getRangedData(e){const t=[],{rows:r,columns:n}=(0,E.normalizeRanges)(e);return(0,l.arrayEach)(r,(e=>{const r=[];(0,l.arrayEach)(n,(t=>{e<0?r.push(this.hot.getColHeader(t,e)):r.push(this.hot.getCopyableData(e,t))})),t.push(r)})),t}paste(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;if(!e&&!t)return;const r=new y.default;e&&r.clipboardData.setData("text/plain",e),t&&r.clipboardData.setData("text/html",t),this.onPaste(r)}setCopyableText(){const e=this.hot.getSelectedRangeLast();if(!e)return;if(e.isSingleHeader())return void(this.copyableRanges=[]);R(D,this).setSelectedRange(e);const t=new Map([["headers",null],["cells",null]]);"column-headers-only"===R(x,this)?t.set("headers",R(D,this).getMostBottomColumnHeadersRange()):("with-column-headers"===R(x,this)?t.set("headers",R(D,this).getMostBottomColumnHeadersRange()):"with-column-group-headers"===R(x,this)&&t.set("headers",R(D,this).getAllColumnHeadersRange()),t.set("cells",R(D,this).getCellsRange())),this.copyableRanges=Array.from(t.values()).filter((e=>null!==e)).map((e=>{let{startRow:t,startCol:r,endRow:n,endCol:s}=e;return{startRow:t,startCol:r,endRow:n,endCol:s}})),this.copyableRanges=this.hot.runHooks("modifyCopyableRange",this.copyableRanges);const r=t.get("cells");if(null!==r&&r.isRangeTrimmed){const{startRow:e,startCol:t,endRow:n,endCol:s}=r;this.hot.runHooks("afterCopyLimit",n-e+1,s-t+1,this.rowsLimit,this.columnsLimit)}}isEditorOpened(){var e;return null===(e=this.hot.getActiveEditor())||void 0===e?void 0:e.isOpened()}populateValues(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.hot.getSelectedRangeLast();if(!e.length)return;const r=e.length,n=e[0].length,s=[],{row:i,col:o}=t.getTopStartCorner(),{row:a,col:l}=t.getBottomEndCorner();let h=i,u=o,c=i,d=o;for(;s.length{this.hot.rootDocument.execCommand(e)}))}}else this.hot.rootDocument.execCommand(e)}function V(e){const{rows:t}=(0,E.normalizeRanges)(e);let r=0;for(let e=0;e=0);e++)r+=1;return{columnHeadersCount:r}}function B(){if(this.hot.isListening()){const e=this.hot.getSelectedRangeLast();if(e){const{row:t,col:r}=e.highlight,n=this.hot.getCell(t,r,!0);n&&(0,u.makeElementContentEditableAndSelectItsContent)(n)}}}function W(){if(this.hot.isListening()){const e=this.hot.getSelectedRangeLast();if(e){const{row:t,col:r}=e.highlight,n=this.hot.getCell(t,r,!0);null!=n&&n.hasAttribute("contenteditable")&&(0,u.removeContentEditableFromElementAndDeselect)(n)}}}function Y(e){e.items.push({name:"---------"},(0,d.default)(this)),R(O,this)&&e.items.push((0,f.default)(this)),R(A,this)&&e.items.push((0,g.default)(this)),R(I,this)&&e.items.push((0,p.default)(this)),e.items.push((0,m.default)(this))}function G(e,t,r,n,s){R(k,this)&&(s.value=!0),S(k,this,!1)}function j(){this.isEditorOpened()||this.hot.getSettings().fragmentSelection||this.setCopyableText()}function z(){T(H,this,W).call(this)}function $(){T(H,this,B).call(this)}function K(){T(H,this,W).call(this)}t.CopyPaste=F},25525:(e,t,r)=>{"use strict";t.__esModule=!0,t.normalizeRanges=function(e){const t=[],r=[];return(0,n.arrayEach)(e,(e=>{const n=Math.min(e.startRow,e.endRow),i=Math.max(e.startRow,e.endRow);(0,s.rangeEach)(n,i,(e=>{-1===t.indexOf(e)&&t.push(e)}));const o=Math.min(e.startCol,e.endCol),a=Math.max(e.startCol,e.endCol);(0,s.rangeEach)(o,a,(e=>{-1===r.indexOf(e)&&r.push(e)}))})),{rows:t,columns:r}},r(67834),r(15724);var n=r(10587),s=r(22137);function i(e,t,r){o(e,t),t.set(e,r)}function o(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function a(e,t){return e.get(h(e,t))}function l(e,t,r){return e.set(h(e,t),r),r}function h(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var u=new WeakMap,c=new WeakMap,d=new WeakMap,p=new WeakMap,g=new WeakMap,f=new WeakMap,m=new WeakSet;function y(e,t){return Math.min(t,Math.max(e+a(g,this).call(this)-1,e))}function E(e,t){return Math.min(t,Math.max(e+a(p,this).call(this)-1,e))}t.CopyableRangesFactory=class{constructor(e){let{countRows:t,countColumns:r,rowsLimit:n,columnsLimit:s,countColumnHeaders:a}=e;var h,y;o(h=this,y=m),y.add(h),i(this,u,void 0),i(this,c,void 0),i(this,d,void 0),i(this,p,void 0),i(this,g,void 0),i(this,f,void 0),l(c,this,t),l(d,this,r),l(p,this,n),l(g,this,s),l(f,this,a)}setSelectedRange(e){l(u,this,e)}getCellsRange(){if(0===a(c,this).call(this)||0===a(d,this).call(this))return null;const{row:e,col:t}=a(u,this).getTopStartCorner(),{row:r,col:n}=a(u,this).getBottomEndCorner(),s=h(m,this,E).call(this,e,r),i=h(m,this,y).call(this,t,n);return{isRangeTrimmed:r!==s||n!==i,startRow:e,startCol:t,endRow:s,endCol:i}}getMostBottomColumnHeadersRange(){if(0===a(d,this).call(this)||0===a(f,this).call(this))return null;const{col:e}=a(u,this).getTopStartCorner(),{col:t}=a(u,this).getBottomEndCorner(),r=h(m,this,y).call(this,e,t);return{isRangeTrimmed:t!==r,startRow:-1,startCol:e,endRow:-1,endCol:r}}getAllColumnHeadersRange(){if(0===a(d,this).call(this)||0===a(f,this).call(this))return null;const{col:e}=a(u,this).getTopStartCorner(),{col:t}=a(u,this).getBottomEndCorner(),r=h(m,this,y).call(this,e,t);return{isRangeTrimmed:t!==r,startRow:-a(f,this).call(this),startCol:e,endRow:-1,endCol:r}}}},88980:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(23176);t.PLUGIN_KEY=n.PLUGIN_KEY,t.PLUGIN_PRIORITY=n.PLUGIN_PRIORITY,t.CopyPaste=n.CopyPaste},18467:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0;var s=n(r(21422));t.default=class{constructor(){this.clipboardData=new s.default}preventDefault(){}}},96947:(e,t,r)=>{"use strict";t.__esModule=!0,t.default=function(e){return{key:"borders:bottom",name(){let e=this.getTranslatedPhrase(n.CONTEXTMENU_ITEMS_BORDERS_BOTTOM);return(0,s.checkSelectionBorders)(this,"bottom")&&(e=(0,s.markSelected)(e)),e},callback(t,r){const n=(0,s.checkSelectionBorders)(this,"bottom");e.prepareBorder(r,"bottom",n)}}};var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=i(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=s?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(r(23384)),s=r(86675);function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(i=function(e){return e?r:t})(e)}},27642:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0;var s=n(r(96947));t.bottom=s.default;var i=n(r(51013));t.left=i.default;var o=n(r(31012));t.noBorders=o.default;var a=n(r(6116));t.right=a.default;var l=n(r(51485));t.top=l.default},51013:(e,t,r)=>{"use strict";t.__esModule=!0,t.default=function(e){const t=e.hot.isRtl()?"end":"start";return{key:"borders:left",name(){let e=this.getTranslatedPhrase(n.CONTEXTMENU_ITEMS_BORDERS_LEFT);return(0,s.checkSelectionBorders)(this,t)&&(e=(0,s.markSelected)(e)),e},callback(r,n){const i=(0,s.checkSelectionBorders)(this,t);e.prepareBorder(n,t,i)}}};var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=i(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=s?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(r(23384)),s=r(86675);function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(i=function(e){return e?r:t})(e)}},31012:(e,t,r)=>{"use strict";t.__esModule=!0,t.default=function(e){return{key:"borders:no_borders",name(){return this.getTranslatedPhrase(n.CONTEXTMENU_ITEMS_REMOVE_BORDERS)},callback(t,r){e.prepareBorder(r,"noBorders")},disabled(){return!(0,s.checkSelectionBorders)(this)}}};var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=i(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=s?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(r(23384)),s=r(86675);function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(i=function(e){return e?r:t})(e)}},6116:(e,t,r)=>{"use strict";t.__esModule=!0,t.default=function(e){const t=e.hot.isRtl()?"start":"end";return{key:"borders:right",name(){let e=this.getTranslatedPhrase(n.CONTEXTMENU_ITEMS_BORDERS_RIGHT);return(0,s.checkSelectionBorders)(this,t)&&(e=(0,s.markSelected)(e)),e},callback(r,n){const i=(0,s.checkSelectionBorders)(this,t);e.prepareBorder(n,t,i)}}};var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=i(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=s?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(r(23384)),s=r(86675);function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(i=function(e){return e?r:t})(e)}},51485:(e,t,r)=>{"use strict";t.__esModule=!0,t.default=function(e){return{key:"borders:top",name(){let e=this.getTranslatedPhrase(n.CONTEXTMENU_ITEMS_BORDERS_TOP);return(0,s.checkSelectionBorders)(this,"top")&&(e=(0,s.markSelected)(e)),e},callback(t,r){const n=(0,s.checkSelectionBorders)(this,"top");e.prepareBorder(r,"top",n)}}};var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=i(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=s?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(r(23384)),s=r(86675);function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(i=function(e){return e?r:t})(e)}},23108:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834),r(15724);var s=n(r(85707)),i=r(75089),o=r(25499),a=r(22137),l=r(10587),h=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=p(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var o=s?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(n,i,o):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n}(r(23384)),u=r(27642),c=r(86675),d=r(76717);function p(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(p=function(e){return e?r:t})(e)}function g(e,t){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.add(e)}function f(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}const m=t.PLUGIN_KEY="customBorders",y=t.PLUGIN_PRIORITY=90;var E=new WeakSet;class w extends i.BasePlugin{constructor(){super(...arguments),g(this,E),(0,s.default)(this,"savedBorders",[])}static get PLUGIN_KEY(){return m}static get PLUGIN_PRIORITY(){return y}isEnabled(){return!!this.hot.getSettings()[m]}enablePlugin(){this.enabled||(this.addHook("afterContextMenuDefaultOptions",(e=>f(E,this,C).call(this,e))),this.addHook("init",(()=>f(E,this,v).call(this))),super.enablePlugin())}disablePlugin(){this.hideBorders(),super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.changeBorderSettings(),super.updatePlugin()}setBorders(e,t){let r=["top","bottom","start","end"],n=null;t&&(this.checkSettingsCohesion([t]),r=Object.keys(t),n=(0,c.normalizeBorder)(t));const s=(0,d.detectSelectionType)(e),i=(0,d.normalizeSelectionFactory)(s,{createCellCoords:this.hot._createCellCoords.bind(this.hot),createCellRange:this.hot._createCellRange.bind(this.hot)});(0,l.arrayEach)(e,(e=>{i(e).forAll(((e,t)=>{(0,l.arrayEach)(r,(r=>{this.prepareBorderFromCustomAdded(e,t,n,(0,c.toInlinePropName)(r))}))}))})),this.hot.view.render()}getBorders(e){if(!Array.isArray(e))return this.savedBorders;const t=(0,d.detectSelectionType)(e),r=(0,d.normalizeSelectionFactory)(t,{createCellCoords:this.hot._createCellCoords.bind(this.hot),createCellRange:this.hot._createCellRange.bind(this.hot)}),n=[];return(0,l.arrayEach)(e,(e=>{r(e).forAll(((e,t)=>{(0,l.arrayEach)(this.savedBorders,(r=>{r.row===e&&r.col===t&&n.push((0,c.denormalizeBorder)(r))}))}))})),n}clearBorders(e){e?this.setBorders(e):((0,l.arrayEach)(this.savedBorders,(e=>{this.clearBordersFromSelectionSettings(e.id),this.clearNullCellRange(),this.hot.removeCellMeta(e.row,e.col,"borders")})),this.savedBorders.length=0)}insertBorderIntoSettings(e,t){this.checkSavedBorders(e)||this.savedBorders.push(e);const r=this.hot._createCellRange(this.hot._createCellCoords(e.row,e.col));this.checkCustomSelections(e,r,t)||this.hot.selection.highlight.addCustomSelection({border:e,visualCellRange:r})}prepareBorderFromCustomAdded(e,t,r,n){const s=this.hot.countRows(),i=this.hot.countCols();if(e>=s||t>=i)return;let o=(0,c.createEmptyBorders)(e,t);r&&(o=(0,c.extendDefaultBorder)(o,r),(0,l.arrayEach)(this.hot.selection.highlight.customSelections,(e=>{if(o.id===e.settings.id)return Object.assign(e.settings,r),o.id=e.settings.id,o.top=e.settings.top,o.bottom=e.settings.bottom,o.start=e.settings.start,o.end=e.settings.end,!1}))),this.hot.setCellMeta(e,t,"borders",(0,c.denormalizeBorder)(o)),this.insertBorderIntoSettings(o,n)}prepareBorderFromCustomAddedRange(e,t){const r=Math.min(e.to.row,this.hot.countRows()-1),n=Math.min(e.to.col,this.hot.countCols()-1);(0,a.rangeEach)(e.from.row,r,(r=>{(0,a.rangeEach)(e.from.col,n,(n=>{const s=(0,c.createEmptyBorders)(r,n);let i=0;r===e.from.row&&(0,o.hasOwnProperty)(t,"top")&&(i+=1,s.top=t.top),r===e.to.row&&(0,o.hasOwnProperty)(t,"bottom")&&(i+=1,s.bottom=t.bottom),n===e.from.col&&(0,o.hasOwnProperty)(t,"start")&&(i+=1,s.start=t.start),n===e.to.col&&(0,o.hasOwnProperty)(t,"end")&&(i+=1,s.end=t.end),i>0&&(this.hot.setCellMeta(r,n,"borders",(0,c.denormalizeBorder)(s)),this.insertBorderIntoSettings(s))}))}))}removeAllBorders(e,t){const r=(0,c.createId)(e,t);this.spliceBorder(r),this.clearBordersFromSelectionSettings(r),this.clearNullCellRange(),this.hot.removeCellMeta(e,t,"borders")}setBorder(e,t,r,n){let s=this.hot.getCellMeta(e,t).borders;if(s=s&&void 0!==s.border?(0,c.normalizeBorder)(s):(0,c.createEmptyBorders)(e,t),n){s[r]=(0,c.createSingleEmptyBorder)();if(4===this.countHide(s))this.removeAllBorders(e,t);else{this.checkCustomSelectionsFromContextMenu(s,r,n)||this.insertBorderIntoSettings(s),this.hot.setCellMeta(e,t,"borders",(0,c.denormalizeBorder)(s))}}else{s[r]=(0,c.createDefaultCustomBorder)();this.checkCustomSelectionsFromContextMenu(s,r,n)||this.insertBorderIntoSettings(s),this.hot.setCellMeta(e,t,"borders",(0,c.denormalizeBorder)(s))}}prepareBorder(e,t,r){(0,l.arrayEach)(e,(e=>{let{start:n,end:s}=e;if(n.row===s.row&&n.col===s.col)"noBorders"===t?this.removeAllBorders(n.row,n.col):this.setBorder(n.row,n.col,t,r);else switch(t){case"noBorders":(0,a.rangeEach)(n.col,s.col,(e=>{(0,a.rangeEach)(n.row,s.row,(t=>{this.removeAllBorders(t,e)}))}));break;case"top":(0,a.rangeEach)(n.col,s.col,(e=>{this.setBorder(n.row,e,t,r)}));break;case"bottom":(0,a.rangeEach)(n.col,s.col,(e=>{this.setBorder(s.row,e,t,r)}));break;case"start":(0,a.rangeEach)(n.row,s.row,(e=>{this.setBorder(e,n.col,t,r)}));break;case"end":(0,a.rangeEach)(n.row,s.row,(e=>{this.setBorder(e,s.col,t,r)}))}}))}createCustomBorders(e){(0,l.arrayEach)(e,(e=>{const t=(0,c.normalizeBorder)(e);e.range?this.prepareBorderFromCustomAddedRange(e.range,t):this.prepareBorderFromCustomAdded(e.row,e.col,t)}))}countHide(e){const{top:t,bottom:r,start:n,end:s}=e,i=[t,r,n,s];return(0,l.arrayReduce)(i,((e,t)=>{let r=e;return t&&t.hide&&(r+=1),r}),0)}clearBordersFromSelectionSettings(e){const t=(0,l.arrayMap)(this.hot.selection.highlight.customSelections,(e=>e.settings.id)).indexOf(e);t>-1&&this.hot.selection.highlight.customSelections[t].clear()}clearNullCellRange(){(0,l.arrayEach)(this.hot.selection.highlight.customSelections,((e,t)=>{if(null===e.cellRange)return this.hot.selection.highlight.customSelections[t].destroy(),this.hot.selection.highlight.customSelections.splice(t,1),!1}))}hideBorders(){(0,l.arrayEach)(this.savedBorders,(e=>{this.clearBordersFromSelectionSettings(e.id),this.clearNullCellRange()}))}spliceBorder(e){const t=(0,l.arrayMap)(this.savedBorders,(e=>e.id)).indexOf(e);t>-1&&this.savedBorders.splice(t,1)}checkSavedBorders(e){let t=!1;return 4===this.countHide(e)?(this.spliceBorder(e.id),t=!0):(0,l.arrayEach)(this.savedBorders,((r,n)=>{if(e.id===r.id)return this.savedBorders[n]=e,t=!0,!1})),t}checkCustomSelectionsFromContextMenu(e,t,r){let n=!1;return(0,l.arrayEach)(this.hot.selection.highlight.customSelections,(s=>{if(e.id===s.settings.id){const e=this.hot.view._wt.selectionManager.getBorderInstances(s);return(0,l.arrayEach)(e,(e=>{e.toggleHiddenClass(t,r)})),n=!0,!1}})),n}checkCustomSelections(e,t,r){const n=this.countHide(e);let s=!1;return 4===n?(this.removeAllBorders(e.row,e.col),s=!0):(0,l.arrayEach)(this.hot.selection.highlight.customSelections,(n=>{if(e.id===n.settings.id){if(n.visualCellRange=t,n.commit(),r){const t=this.hot.view._wt.selectionManager.getBorderInstances(n);(0,l.arrayEach)(t,(t=>{t.changeBorderStyle(r,e)}))}return s=!0,!1}})),s}changeBorderSettings(){const e=this.hot.getSettings()[m];if(Array.isArray(e)){const t=(0,o.deepClone)(e);this.checkSettingsCohesion(t),t.length||(this.savedBorders=t),this.createCustomBorders(t)}else void 0!==e&&this.createCustomBorders(this.savedBorders)}checkSettingsCohesion(e){const t=(0,c.hasLeftRightTypeOptions)(e),r=(0,c.hasStartEndTypeOptions)(e);if(t&&r)throw new Error('The "left"/"right" and "start"/"end" options should not be used together. Please use only the option "start"/"end".');if(this.hot.isRtl()&&t)throw new Error('The "left"/"right" properties are not supported for RTL. Please use option "start"/"end".')}destroy(){super.destroy()}}function C(e){this.hot.getSettings()[m]&&e.items.push({name:"---------"},{key:"borders",name(){return this.getTranslatedPhrase(h.CONTEXTMENU_ITEMS_BORDERS)},disabled(){const e=this.getSelectedRangeLast();return!e||(!!e.isSingleHeader()||this.selection.isSelectedByCorner())},submenu:{items:[(0,u.top)(this),(0,u.right)(this),(0,u.bottom)(this),(0,u.left)(this),(0,u.noBorders)(this)]}})}function v(){this.changeBorderSettings()}t.CustomBorders=w},60402:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(23108);t.PLUGIN_KEY=n.PLUGIN_KEY,t.PLUGIN_PRIORITY=n.PLUGIN_PRIORITY,t.CustomBorders=n.CustomBorders},86675:(e,t,r)=>{"use strict";t.__esModule=!0,t.checkSelectionBorders=function(e,t){let r=!1;return(0,i.arrayEach)(e.getSelectedRange(),(s=>{s.forAll(((s,i)=>{if(s<0||i<0)return;const o=e.getCellMeta(s,i).borders;if(o){if(!t)return r=!0,!1;if(!(0,n.hasOwnProperty)(o[t],"hide")||!1===o[t].hide)return r=!0,!1}}))})),r},t.createDefaultCustomBorder=a,t.createDefaultHtBorder=h,t.createEmptyBorders=function(e,t){return{id:o(e,t),border:{width:1,color:"#000",cornerVisible:!1},row:e,col:t,top:{hide:!0},bottom:{hide:!0},start:{hide:!0},end:{hide:!0}}},t.createId=o,t.createSingleEmptyBorder=l,t.denormalizeBorder=function(e){(0,s.isDefined)(e.start)&&(e.left=e.start);(0,s.isDefined)(e.end)&&(e.right=e.end);return e},t.extendDefaultBorder=function(e,t){(0,n.hasOwnProperty)(t,"border")&&t.border&&(e.border=t.border);(0,n.hasOwnProperty)(t,"top")&&(0,s.isDefined)(t.top)&&(t.top?((0,n.isObject)(t.top)||(t.top={width:1,color:"#000"}),e.top=t.top):(t.top={hide:!0},e.top=t.top));(0,n.hasOwnProperty)(t,"bottom")&&(0,s.isDefined)(t.bottom)&&(t.bottom?((0,n.isObject)(t.bottom)||(t.bottom={width:1,color:"#000"}),e.bottom=t.bottom):(t.bottom={hide:!0},e.bottom=t.bottom));(0,n.hasOwnProperty)(t,"start")&&(0,s.isDefined)(t.start)&&(t.start?((0,n.isObject)(t.start)||(t.start={width:1,color:"#000"}),e.start=t.start):(t.start={hide:!0},e.start=t.start));(0,n.hasOwnProperty)(t,"end")&&(0,s.isDefined)(t.end)&&(t.end?((0,n.isObject)(t.end)||(t.end={width:1,color:"#000"}),e.end=t.end):(t.end={hide:!0},e.end=t.end));return e},t.hasLeftRightTypeOptions=function(e){return e.some((e=>(0,s.isDefined)(e.left)||(0,s.isDefined)(e.right)))},t.hasStartEndTypeOptions=function(e){return e.some((e=>(0,s.isDefined)(e.start)||(0,s.isDefined)(e.end)))},t.markSelected=function(e){return`${String.fromCharCode(10003)}${e}`},t.normalizeBorder=function(e){var t,r;((0,s.isDefined)(e.start)||(0,s.isDefined)(e.left))&&(e.start=null!==(t=e.start)&&void 0!==t?t:e.left);((0,s.isDefined)(e.end)||(0,s.isDefined)(e.right))&&(e.end=null!==(r=e.end)&&void 0!==r?r:e.right);return delete e.left,delete e.right,e},t.toInlinePropName=function(e){var t;return null!==(t=u.get(e))&&void 0!==t?t:e},r(14846),r(75568);var n=r(25499),s=r(70505),i=r(10587);function o(e,t){return`border_row${e}col${t}`}function a(){return{width:1,color:"#000"}}function l(){return{hide:!0}}function h(){return{width:1,color:"#000",cornerVisible:!1}}const u=new Map([["left","start"],["right","end"]])},55502:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834);var s=n(r(85707)),i=r(75089),o=r(77661),a=r(62577);function l(e,t){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.add(e)}function h(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}const u=t.PLUGIN_KEY="dragToScroll",c=t.PLUGIN_PRIORITY=100;var d=new WeakSet;class p extends i.BasePlugin{constructor(){super(...arguments),l(this,d),(0,s.default)(this,"boundaries",null),(0,s.default)(this,"callback",null),(0,s.default)(this,"listening",!1)}static get PLUGIN_KEY(){return u}static get PLUGIN_PRIORITY(){return c}isEnabled(){return!!this.hot.getSettings()[u]}enablePlugin(){this.enabled||(this.addHook("afterOnCellMouseDown",(e=>h(d,this,g).call(this,e))),this.addHook("afterOnCellCornerMouseDown",(e=>h(d,this,g).call(this,e))),this.registerEvents(),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.unregisterEvents(),super.disablePlugin()}setBoundaries(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{left:0,right:this.hot.rootWindow.innerWidth,top:0,bottom:this.hot.rootWindow.innerHeight};this.boundaries=e}setCallback(e){this.callback=e}check(e,t){let r=0,n=0;tthis.boundaries.bottom&&(n=t-this.boundaries.bottom),ethis.boundaries.right&&(r=e-this.boundaries.right),this.callback(r,n)}listen(){this.listening=!0}unlisten(){this.listening=!1}isListening(){return this.listening}registerEvents(){const{rootWindow:e}=this.hot;let t=e;for(;t;)this.eventManager.addEventListener(t.document,"contextmenu",(()=>this.unlisten())),this.eventManager.addEventListener(t.document,"mouseup",(()=>this.unlisten())),this.eventManager.addEventListener(t.document,"mousemove",(e=>this.onMouseMove(e))),t=(0,a.getParentWindow)(t)}unregisterEvents(){this.eventManager.clear()}onMouseMove(e){this.isListening()&&this.check(e.clientX,e.clientY)}destroy(){super.destroy()}}function g(e){if((0,o.isRightClick)(e))return;const t=this.hot.view._wt.wtOverlays.topOverlay.mainTableScrollableElement;this.setBoundaries(t!==this.hot.rootWindow?t.getBoundingClientRect():void 0),this.setCallback(((e,r)=>{var n,s;const i=null!==(n=t.scrollLeft)&&void 0!==n?n:t.scrollX,o=null!==(s=t.scrollTop)&&void 0!==s?s:t.scrollY;t.scroll(i+50*Math.sign(e),o+20*Math.sign(r))})),this.listen()}t.DragToScroll=p},47126:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(55502);t.PLUGIN_KEY=n.PLUGIN_KEY,t.PLUGIN_PRIORITY=n.PLUGIN_PRIORITY,t.DragToScroll=n.DragToScroll},33214:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834);var s=n(r(85707)),i=r(75089),o=r(10587),a=r(25499),l=r(90352),h=r(21577),u=r(62577),c=r(27040),d=r(57446),p=r(28197),g=r(30889),f=r(71120);function m(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function y(e,t,r){return e.set(E(e,t),r),r}function E(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}p.Hooks.getSingleton().register("afterDropdownMenuDefaultOptions"),p.Hooks.getSingleton().register("beforeDropdownMenuShow"),p.Hooks.getSingleton().register("afterDropdownMenuShow"),p.Hooks.getSingleton().register("afterDropdownMenuHide"),p.Hooks.getSingleton().register("afterDropdownMenuExecute");const w=t.PLUGIN_KEY="dropdownMenu",C=t.PLUGIN_PRIORITY=230,v="changeType",R=w;var S=new WeakMap,T=new WeakSet;class N extends i.BasePlugin{static get PLUGIN_KEY(){return w}static get PLUGIN_PRIORITY(){return C}static get PLUGIN_DEPS(){return["plugin:AutoColumnSize"]}static get DEFAULT_ITEMS(){return[g.COLUMN_LEFT,g.COLUMN_RIGHT,g.SEPARATOR,g.REMOVE_COLUMN,g.SEPARATOR,g.CLEAR_COLUMN,g.SEPARATOR,g.READ_ONLY,g.SEPARATOR,g.ALIGNMENT]}constructor(e){var t,r;super(e),m(t=this,r=T),r.add(t),(0,s.default)(this,"commandExecutor",new l.CommandExecutor(this.hot)),(0,s.default)(this,"itemsFactory",null),(0,s.default)(this,"menu",null),function(e,t,r){m(e,t),t.set(e,r)}(this,S,!1),this.hot.addHook("afterGetColHeader",((e,t)=>E(T,this,b).call(this,e,t)))}isEnabled(){return this.hot.getSettings()[w]}enablePlugin(){var e=this;if(this.enabled)return;this.itemsFactory=new c.ItemsFactory(this.hot,N.DEFAULT_ITEMS),this.addHook("beforeOnCellMouseDown",(function(){for(var t=arguments.length,r=new Array(t),n=0;n{this.hot.runHooks("afterDropdownMenuDefaultOptions",r),this.itemsFactory.setPredefinedItems(r.items);const n=this.itemsFactory.getItems(t);this.menu&&this.menu.destroy(),this.menu=new d.Menu(this.hot,{className:"htDropdownMenu",keepInViewport:!0,container:t.uiContainer||this.hot.rootDocument.body}),this.hot.runHooks("beforeDropdownMenuSetItems",n),this.menu.setMenuItems(n),this.menu.addLocalHook("beforeOpen",(()=>E(T,this,O).call(this))),this.menu.addLocalHook("afterOpen",(()=>E(T,this,A).call(this))),this.menu.addLocalHook("afterSubmenuOpen",(e=>E(T,this,I).call(this,e))),this.menu.addLocalHook("afterClose",(()=>E(T,this,x).call(this))),this.menu.addLocalHook("executeCommand",(function(){for(var t=arguments.length,r=new Array(t),n=0;nthis.commandExecutor.registerCommand(e.key,e)))}))}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.close(),this.menu&&this.menu.destroy(),this.unregisterShortcuts(),super.disablePlugin()}registerShortcuts(){const e=()=>{const{highlight:e}=this.hot.getSelectedRangeLast();if((e.isHeader()&&-1===e.row||e.isCell())&&e.col>=0){this.hot.selectColumns(e.col,e.col,-1);const{from:t}=this.hot.getSelectedRangeLast(),r=(0,h.getDocumentOffsetByElement)(this.menu.container,this.hot.rootDocument),n=this.hot.getCell(-1,t.col,!0).querySelector(`.${v}`),s=n.getBoundingClientRect();this.open({left:s.left+r.left,top:s.top+n.offsetHeight+r.top},{left:s.width,right:0,above:0,below:3}),this.menu.getNavigator().toFirstItem()}};this.hot.getShortcutManager().getContext("grid").addShortcuts([{keys:[["Shift","Alt","ArrowDown"],["Control/Meta","Enter"]],callback:e,runOnlyIf:()=>{var e;const t=null===(e=this.hot.getSelectedRangeLast())||void 0===e?void 0:e.highlight;return t&&this.hot.selection.isCellVisible(t)&&t.isHeader()&&!this.menu.isOpened()},captureCtrl:!0,group:R},{keys:[["Shift","Alt","ArrowDown"]],callback:e,runOnlyIf:()=>{var e;const t=null===(e=this.hot.getSelectedRangeLast())||void 0===e?void 0:e.highlight;return t&&this.hot.selection.isCellVisible(t)&&t.isCell()&&!this.menu.isOpened()},group:R}])}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(R)}registerEvents(){this.eventManager.addEventListener(this.hot.rootElement,"click",(e=>E(T,this,_).call(this,e)))}open(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{above:0,below:0,left:0,right:0};null!==(t=this.menu)&&void 0!==t&&t.isOpened()||(this.menu.open(),(0,a.objectEach)(r,((e,t)=>{this.menu.setOffset(t,e)})),this.menu.setPosition(e))}close(){var e;null===(e=this.menu)||void 0===e||e.close()}executeCommand(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n0&&void 0!==arguments[0])||arguments[0];this.menu.isOpened()&&(e?this.menu.hotMenu.listen():this.menu.hotMenu.unlisten())}destroy(){this.close(),this.menu&&this.menu.destroy(),super.destroy()}}function M(e){e.getKeyboardShortcutsCtrl().addCustomShortcuts([{keys:[["Control/Meta","A"]],callback:()=>!1}])}function _(e){if((0,u.hasClass)(e.target,v)){const t=(0,h.getDocumentOffsetByElement)(this.menu.container,this.hot.rootDocument),r=e.target.getBoundingClientRect();e.stopPropagation(),y(S,this,!1),this.open({left:r.left+t.left,top:r.top+e.target.offsetHeight+t.top},{left:r.width,right:0,above:0,below:3})}}function b(e,t){const r=t.parentNode;if(!r)return;const n=r.parentNode.childNodes,s=Array.prototype.indexOf.call(n,r);if(e<0||s!==n.length-1)return;const i=t.querySelector(`.${v}`);if(this.enabled&&i)return;if(!this.enabled)return void(i&&i.parentNode.removeChild(i));const o=this.hot.rootDocument.createElement("button");o.className=v,o.type="button",o.tabIndex=-1,this.hot.getSettings().ariaTags&&((0,u.setAttribute)(o,[(0,f.A11Y_HIDDEN)(),(0,f.A11Y_LABEL)(" ")]),(0,u.setAttribute)(t,[(0,f.A11Y_HASPOPUP)("menu")])),o.onclick=function(){return!1},t.firstChild.insertBefore(o,t.firstChild.firstChild)}function O(){this.hot.runHooks("beforeDropdownMenuShow",this)}function A(){this.hot.runHooks("afterDropdownMenuShow",this),E(T,this,M).call(this,this.menu)}function I(e){E(T,this,M).call(this,e)}function x(){this.hot.listen(),this.hot.runHooks("afterDropdownMenuHide",this)}function P(e){return r=this,(t=S).get(E(t,r))?null:e;var t,r}function L(e){(0,u.hasClass)(e.target,v)&&y(S,this,!0)}t.DropdownMenu=N,N.SEPARATOR={name:g.SEPARATOR}},81658:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(33214);t.PLUGIN_KEY=n.PLUGIN_KEY,t.PLUGIN_PRIORITY=n.PLUGIN_PRIORITY,t.DropdownMenu=n.DropdownMenu},23271:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(15724);var s=n(r(85707)),i=r(22137);t.default=class{constructor(e){(0,s.default)(this,"hot",void 0),(0,s.default)(this,"options",{}),this.hot=e}setOptions(e){this.options=e}getData(){const{startRow:e,startCol:t,endRow:r,endCol:n}=this._getDataRange(),s=this.options,o=[];return(0,i.rangeEach)(e,r,(e=>{const r=[];!s.exportHiddenRows&&this._isHiddenRow(e)||((0,i.rangeEach)(t,n,(t=>{!s.exportHiddenColumns&&this._isHiddenColumn(t)||r.push(this.hot.getDataAtCell(e,t))})),o.push(r))})),o}getRowHeaders(){const e=[];if(this.options.rowHeaders){const{startRow:t,endRow:r}=this._getDataRange(),n=this.hot.getRowHeader();(0,i.rangeEach)(t,r,(t=>{!this.options.exportHiddenRows&&this._isHiddenRow(t)||e.push(n[t])}))}return e}getColumnHeaders(){const e=[];if(this.options.columnHeaders){const{startCol:t,endCol:r}=this._getDataRange(),n=this.hot.getColHeader();(0,i.rangeEach)(t,r,(t=>{!this.options.exportHiddenColumns&&this._isHiddenColumn(t)||e.push(n[t])}))}return e}_getDataRange(){const e=this.hot.countCols()-1,t=this.hot.countRows()-1;let[r=0,n=0,s=t,i=e]=this.options.range;return r=Math.max(r,0),n=Math.max(n,0),s=Math.min(s,t),i=Math.min(i,e),{startRow:r,startCol:n,endRow:s,endCol:i}}_isHiddenRow(e){return this.hot.rowIndexMapper.isHidden(this.hot.toPhysicalRow(e))}_isHiddenColumn(e){return this.hot.columnIndexMapper.isHidden(this.hot.toPhysicalColumn(e))}}},73842:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834);var s=r(75089),i=n(r(23271)),o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=a(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var o=s?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(n,i,o):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n}(r(74506));function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(a=function(e){return e?r:t})(e)}const l=t.PLUGIN_KEY="exportFile",h=t.PLUGIN_PRIORITY=240;class u extends s.BasePlugin{static get PLUGIN_KEY(){return l}static get PLUGIN_PRIORITY(){return h}isEnabled(){return!0}exportAsString(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._createTypeFormatter(e,t).export()}exportAsBlob(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._createBlob(this._createTypeFormatter(e,t))}downloadFile(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{rootDocument:r,rootWindow:n}=this.hot,s=this._createTypeFormatter(e,t),i=this._createBlob(s),o=n.URL||n.webkitURL,a=r.createElement("a"),l=`${s.options.filename}.${s.options.fileExtension}`;if(void 0!==a.download){const e=o.createObjectURL(i);a.style.display="none",a.setAttribute("href",e),a.setAttribute("download",l),r.body.appendChild(a),a.dispatchEvent(new MouseEvent("click")),r.body.removeChild(a),setTimeout((()=>{o.revokeObjectURL(e)}),100)}else navigator.msSaveOrOpenBlob&&navigator.msSaveOrOpenBlob(i,l)}_createTypeFormatter(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!o.EXPORT_TYPES[e])throw new Error(`Export format type "${e}" is not supported.`);return(0,o.default)(e,new i.default(this.hot),t)}_createBlob(e){let t=null;return"undefined"!=typeof Blob&&(t=new Blob([e.export()],{type:`${e.options.mimeType};charset=${e.options.encoding}`})),t}}t.ExportFile=u},99364:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(73842);t.PLUGIN_KEY=n.PLUGIN_KEY,t.PLUGIN_PRIORITY=n.PLUGIN_PRIORITY,t.ExportFile=n.ExportFile},74506:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,t.default=function(e,t,r){if("function"==typeof o[e])return new o[e](t,r);return null};var s=n(r(78150));const i=t.TYPE_CSV="csv",o=(t.TYPE_EXCEL="excel",t.TYPE_PDF="pdf",t.EXPORT_TYPES={[i]:s.default})},73178:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0;var s=n(r(85707)),i=r(25499),o=r(5893);class a{static get DEFAULT_OPTIONS(){return{mimeType:"text/plain",fileExtension:"txt",filename:"Handsontable [YYYY]-[MM]-[DD]",encoding:"utf-8",bom:!1,columnHeaders:!1,rowHeaders:!1,exportHiddenColumns:!1,exportHiddenRows:!1,range:[]}}constructor(e,t){(0,s.default)(this,"dataProvider",void 0),(0,s.default)(this,"options",void 0),this.dataProvider=e,this.options=this._mergeOptions(t),this.dataProvider.setOptions(this.options)}_mergeOptions(e){let t=(0,i.clone)(this.constructor.DEFAULT_OPTIONS);const r=new Date;return t=(0,i.extend)((0,i.clone)(a.DEFAULT_OPTIONS),t),t=(0,i.extend)(t,e),t.filename=(0,o.substitute)(t.filename,{YYYY:r.getFullYear(),MM:`${r.getMonth()+1}`.padStart(2,"0"),DD:`${r.getDate()}`.padStart(2,"0")}),t}}t.default=a},78150:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(94364);var s=r(10587),i=r(70505),o=n(r(73178));const a=String.fromCharCode(13),l=String.fromCharCode(34),h=String.fromCharCode(10);class u extends o.default{static get DEFAULT_OPTIONS(){return{mimeType:"text/csv",fileExtension:"csv",bom:!0,columnDelimiter:",",rowDelimiter:"\r\n"}}export(){const e=this.options,t=this.dataProvider.getData();let r=this.dataProvider.getColumnHeaders();const n=r.length>0,i=this.dataProvider.getRowHeaders(),o=i.length>0;let a=e.bom?String.fromCharCode(65279):"";return n&&(r=(0,s.arrayMap)(r,(e=>this._escapeCell(e,!0))),o&&(a+=e.columnDelimiter),a+=r.join(e.columnDelimiter),a+=e.rowDelimiter),(0,s.arrayEach)(t,((t,r)=>{r>0&&(a+=e.rowDelimiter),o&&(a+=this._escapeCell(i[r])+e.columnDelimiter),a+=t.map((e=>this._escapeCell(e))).join(e.columnDelimiter)})),a}_escapeCell(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=(0,i.stringify)(e);return""!==r&&(t||r.indexOf(a)>=0||r.indexOf(l)>=0||r.indexOf(h)>=0||r.indexOf(this.options.columnDelimiter)>=0)&&(r=r.replace(new RegExp('"',"g"),'""'),r=`"${r}"`),r}}t.default=u},62095:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834);var s=n(r(85707)),i=r(10587),o=r(25499),a=n(r(16050)),l=r(61149);class h{constructor(e,t){let{id:r,stateless:n=!0}=t;(0,s.default)(this,"hot",void 0),(0,s.default)(this,"id",void 0),(0,s.default)(this,"elements",[]),(0,s.default)(this,"hidden",!1),(0,s.default)(this,"stateId",""),(0,s.default)(this,"state",void 0),this.hot=e,this.id=r,this.stateId=`Filters.component.${this.id}`,this.state=n?null:this.hot.columnIndexMapper.registerMap(this.stateId,new l.LinkedPhysicalIndexToValueMap)}getElements(){return this.elements}reset(){(0,i.arrayEach)(this.elements,(e=>e.reset()))}hide(){this.hidden=!0}show(){this.hidden=!1}isHidden(){return null===this.hot||this.hidden}restoreState(e){this.state&&this.setState(this.state.getValueAtIndex(e))}setState(){throw new Error("The state setting logic is not implemented")}saveState(e){this.state&&this.state.setValueAtIndex(e,this.getState())}getState(){throw new Error("The state gathering logic is not implemented")}destroy(){this.hot.columnIndexMapper.unregisterMap(this.stateId),this.clearLocalHooks(),(0,i.arrayEach)(this.elements,(e=>e.destroy())),this.state=null,this.elements=null,this.hot=null}}t.BaseComponent=h,(0,o.mixin)(h,a.default)},73048:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834),r(15724);var s,i=n(r(85707)),o=r(62577),a=r(10587),l=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=c(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var o=s?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(n,i,o):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n}(r(23384)),h=r(62095),u=r(24054);function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(c=function(e){return e?r:t})(e)}function d(e,t){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.add(e)}var p=new WeakSet;class g extends h.BaseComponent{static get BUTTON_OK(){return"ok"}static get BUTTON_CANCEL(){return"cancel"}constructor(e,t){super(e,{id:t.id,stateless:!0}),d(this,p),(0,i.default)(this,"name",""),this.name=t.name,this.elements.push(new u.InputUI(this.hot,{type:"button",value:l.FILTERS_BUTTONS_OK,className:"htUIButton htUIButtonOK",identifier:g.BUTTON_OK})),this.elements.push(new u.InputUI(this.hot,{type:"button",value:l.FILTERS_BUTTONS_CANCEL,className:"htUIButton htUIButtonCancel",identifier:g.BUTTON_CANCEL})),this.registerHooks()}registerHooks(){(0,a.arrayEach)(this.elements,(e=>{e.addLocalHook("click",((e,t)=>function(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}(p,this,f).call(this,e,t)))}))}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,t)=>((0,o.addClass)(t.parentNode,"htFiltersMenuActionBar"),(0,a.arrayEach)(this.elements,(e=>t.appendChild(e.element))),t)}}accept(){this.runLocalHooks("accept")}cancel(){this.runLocalHooks("cancel")}}function f(e,t){t.options.identifier===s.BUTTON_OK?this.accept():this.cancel()}t.ActionBarComponent=g,s=g},65686:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834),r(15724),r(14846),r(27458);var s=n(r(85707)),i=r(62577),o=r(77661),a=r(10587),l=r(83445),h=r(25499),u=y(r(23384)),c=r(62095),d=y(r(33582)),p=r(24054),g=r(71620),f=r(69196);function m(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(m=function(e){return e?r:t})(e)}function y(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=m(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var o=s?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(n,i,o):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n}function E(e,t){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.add(e)}function w(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var C=new WeakSet;class v extends c.BaseComponent{constructor(e,t){super(e,{id:t.id,stateless:!1}),E(this,C),(0,s.default)(this,"name",""),(0,s.default)(this,"addSeparator",!1),this.name=t.name,this.addSeparator=t.addSeparator,this.elements.push(new g.SelectUI(this.hot,{menuContainer:t.menuContainer})),this.elements.push(new p.InputUI(this.hot,{placeholder:u.FILTERS_BUTTONS_PLACEHOLDER_VALUE})),this.elements.push(new p.InputUI(this.hot,{placeholder:u.FILTERS_BUTTONS_PLACEHOLDER_SECOND_VALUE})),this.registerHooks()}registerHooks(){this.getSelectElement().addLocalHook("select",(e=>w(C,this,R).call(this,e))).addLocalHook("afterClose",(()=>this.runLocalHooks("afterClose"))).addLocalHook("tabKeydown",(e=>this.runLocalHooks("selectTabKeydown",e))),(0,a.arrayEach)(this.getInputElements(),(e=>{e.addLocalHook("keydown",(e=>w(C,this,S).call(this,e)))}))}setState(e){if(this.reset(),!e)return;const t=(0,h.clone)(e.command);t.name.startsWith(u.FILTERS_CONDITIONS_NAMESPACE)&&(t.name=this.hot.getTranslatedPhrase(t.name)),this.getSelectElement().setValue(t),(0,a.arrayEach)(e.args,((e,r)=>{if(r>t.inputsCount-1)return!1;const n=this.getInputElement(r);n.setValue(e),n[t.inputsCount>r?"show":"hide"](),r||this.hot._registerTimeout((()=>n.focus()),10)}))}getState(){const e=this.getSelectElement().getValue()||(0,f.getConditionDescriptor)(d.CONDITION_NONE),t=[];return(0,a.arrayEach)(this.getInputElements(),((r,n)=>{e.inputsCount>n&&t.push(r.getValue())})),{command:e,args:t}}updateState(e,t){const r=e?(0,f.getConditionDescriptor)(e.name):(0,f.getConditionDescriptor)(d.CONDITION_NONE);this.state.setValueAtIndex(t,{command:r,args:e?e.args:[]}),e||(0,a.arrayEach)(this.getInputElements(),(e=>e.setValue(null)))}getSelectElement(){return this.elements.filter((e=>e instanceof g.SelectUI))[0]}getInputElement(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.getInputElements()[e]}getInputElements(){return this.elements.filter((e=>e instanceof p.InputUI))}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,t,r,n,s,o)=>{(0,i.addClass)(t.parentNode,"htFiltersMenuCondition"),this.addSeparator&&(0,i.addClass)(t.parentNode,"border");const l=this.hot.rootDocument.createElement("div");return(0,i.addClass)(l,"htFiltersMenuLabel"),l.textContent=o,t.appendChild(l),t.parentElement.hasAttribute("ghost-table")||(0,a.arrayEach)(this.elements,(e=>t.appendChild(e.element))),t}}}reset(){const e=this.hot.getPlugin("filters").getSelectedColumn();let t=[(0,f.getConditionDescriptor)(d.CONDITION_NONE)];if(null!==e){const{visualIndex:r}=e;t=(0,d.default)(this.hot.getDataType(0,r,this.hot.countRows(),r))}(0,a.arrayEach)(this.getInputElements(),(e=>e.hide())),this.getSelectElement().setItems(t),super.reset(),this.getSelectElement().setValue(t[0])}}function R(e){(0,a.arrayEach)(this.getInputElements(),((t,r)=>{t[e.inputsCount>r?"show":"hide"](),0===r&&this.hot._registerTimeout((()=>t.focus()),10)})),this.runLocalHooks("change",e)}function S(e){(0,l.isKey)(e.keyCode,"ESCAPE")&&(this.runLocalHooks("cancel"),(0,o.stopImmediatePropagation)(e))}t.ConditionComponent=v},45698:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834),r(15724),r(14846),r(6211);var s=n(r(85707)),i=r(62577),o=r(10587),a=r(21595),l=r(62095),h=r(2933),u=r(7233),c=r(96609),d=r(57737),p=r(63433);function g(e,t){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.add(e)}var f=new WeakSet;class m extends l.BaseComponent{constructor(e,t){super(e,{id:t.id,stateless:!1}),g(this,f),(0,s.default)(this,"name",""),this.name=t.name,this.buildOperatorsElement()}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,t)=>((0,i.addClass)(t.parentNode,"htFiltersMenuOperators"),(0,o.arrayEach)(this.elements,(e=>t.appendChild(e.element))),t)}}buildOperatorsElement(){const e=[u.OPERATION_ID,c.OPERATION_ID];(0,o.arrayEach)(e,(t=>{const r=new p.RadioInputUI(this.hot,{name:"operator",label:{htmlFor:t,textContent:(0,h.getOperationName)(t)},value:t,checked:t===e[0],id:t});r.addLocalHook("change",(e=>function(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}(f,this,y).call(this,e))),this.elements.push(r)}))}setChecked(e){if(this.elements.length{t.setChecked(r===e)}))}getActiveOperationId(){const e=this.elements.find((e=>e instanceof p.RadioInputUI&&e.isChecked()));return e?e.getValue():u.OPERATION_ID}getState(){return this.getActiveOperationId()}setState(e){this.reset(),e&&this.getActiveOperationId()!==e&&(0,o.arrayEach)(this.elements,(t=>{t.setChecked(t.getValue()===e)}))}updateState(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u.OPERATION_ID,t=arguments.length>1?arguments[1]:void 0,r=e;r===d.OPERATION_ID&&(r=c.OPERATION_ID),this.state.setValueAtIndex(t,r)}reset(){this.setChecked(0)}}function y(e){this.setState(e.target.value)}t.OperatorsComponent=m},75482:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834),r(15724),r(14846),r(27458),r(94364);var s=n(r(85707)),i=r(62577),o=r(77661),a=r(10587),l=r(83445),h=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=m(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var o=s?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(n,i,o):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n}(r(23384)),u=r(87094),c=r(62095),d=r(68312),p=r(33582),g=r(69196),f=r(17756);function m(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(m=function(e){return e?r:t})(e)}function y(e,t){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.add(e)}function E(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var w=new WeakSet;class C extends c.BaseComponent{constructor(e,t){super(e,{id:t.id,stateless:!1}),y(this,w),(0,s.default)(this,"name",""),this.name=t.name,this.elements.push(new d.MultipleSelectUI(this.hot)),this.registerHooks()}registerHooks(){this.getMultipleSelectElement().addLocalHook("keydown",(e=>E(w,this,v).call(this,e))).addLocalHook("listTabKeydown",(e=>this.runLocalHooks("listTabKeydown",e))),this.hot.addHook("modifyFiltersMultiSelectValue",((e,t)=>E(w,this,S).call(this,e,t)))}getElements(){const e=this.getMultipleSelectElement();return[e.getSearchInputElement(),e.getSelectAllElement(),e.getClearAllElement(),this.getMultipleSelectElement()]}setState(e){if(this.reset(),e&&e.command.key===p.CONDITION_BY_VALUE){const t=this.getMultipleSelectElement();t.setItems(e.itemsSnapshot),t.setValue(e.args[0]),t.setLocale(e.locale)}}getState(){const e=this.getMultipleSelectElement(),t=e.getItems();return{command:{key:e.isSelectedAllValues()||!t.length?p.CONDITION_NONE:p.CONDITION_BY_VALUE},args:[e.getValue()],itemsSnapshot:t}}updateState(e){const t=(t,r,n,s,i)=>{const[o]=(0,a.arrayFilter)(r,(e=>e.name===p.CONDITION_BY_VALUE)),l={},c=this.hot.getTranslatedPhrase(h.FILTERS_VALUES_BLANK_CELLS);if(o){const r=s(t,i),h=(0,a.arrayMap)(r,(e=>e.value)),d=new Map(r.map((e=>[e.value,this.hot.getCellMeta(e.meta.visualRow,e.meta.visualCol)]))),f=(0,u.unifyColumnValues)(h);n&&(o.args[0]=n);const m=[],y=(0,u.intersectValues)(f,o.args[0],c,(e=>{e.checked&&m.push(e.value),E(w,this,R).call(this,e,d)})),C=e.editedConditionStack.column;l.locale=this.hot.getCellMeta(0,C).locale,l.args=[m],l.command=(0,g.getConditionDescriptor)(p.CONDITION_BY_VALUE),l.itemsSnapshot=y}else l.args=[],l.command=(0,g.getConditionDescriptor)(p.CONDITION_NONE);this.state.setValueAtIndex(t,l)};t(e.editedConditionStack.column,e.editedConditionStack.conditions,e.conditionArgsChange,e.filteredRowsFactory),e.dependentConditionStacks.length&&t(e.dependentConditionStacks[0].column,e.dependentConditionStacks[0].conditions,e.conditionArgsChange,e.filteredRowsFactory,e.editedConditionStack)}getMultipleSelectElement(){return this.elements.filter((e=>e instanceof d.MultipleSelectUI))[0]}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,t,r,n,s,o)=>{(0,i.addClass)(t.parentNode,"htFiltersMenuValue");const l=this.hot.rootDocument.createElement("div");return(0,i.addClass)(l,"htFiltersMenuLabel"),l.textContent=o,t.appendChild(l),t.parentElement.hasAttribute("ghost-table")||(0,a.arrayEach)(this.elements,(e=>t.appendChild(e.element))),t}}}reset(){const e=this.hot.getTranslatedPhrase(h.FILTERS_VALUES_BLANK_CELLS),t=this._getColumnVisibleValues(),r=t.map((e=>e.value)),n=new Map(t.map((e=>[e.value,e.meta]))),s=(0,u.unifyColumnValues)(r),i=(0,u.intersectValues)(s,s,e,(e=>{E(w,this,R).call(this,e,n)}));this.getMultipleSelectElement().setItems(i),super.reset(),this.getMultipleSelectElement().setValue(s);const o=this.hot.getPlugin("filters").getSelectedColumn();null!==o&&this.getMultipleSelectElement().setLocale(this.hot.getCellMeta(0,o.visualIndex).locale)}_getColumnVisibleValues(){const e=this.hot.getPlugin("filters").getSelectedColumn();return null===e?[]:(0,a.arrayMap)(this.hot.getDataAtCol(e.visualIndex),((t,r)=>({value:(0,u.toEmptyString)(t),meta:this.hot.getCellMeta(r,e.visualIndex)})))}}function v(e){(0,l.isKey)(e.keyCode,"ESCAPE")&&(this.runLocalHooks("cancel"),(0,o.stopImmediatePropagation)(e))}function R(e,t){this.hot.hasHook("modifyFiltersMultiSelectValue")&&(e.visualValue=this.hot.runHooks("modifyFiltersMultiSelectValue",e.visualValue,t.get(e.value)))}function S(e,t){return"numeric"===t.type?(0,f.getRenderedValue)(e,t):e}t.ValueComponent=C},78911:(e,t,r)=>{"use strict";t.__esModule=!0,t.condition=l;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=o(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var a=s?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n}(r(23384)),s=r(70505),i=r(69196);function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(o=function(e){return e?r:t})(e)}const a=t.CONDITION_NAME="begins_with";function l(e,t){let[r]=t;return(0,s.stringify)(e.value).toLocaleLowerCase(e.meta.locale).startsWith((0,s.stringify)(r))}(0,i.registerCondition)(a,l,{name:n.FILTERS_CONDITIONS_BEGINS_WITH,inputsCount:1,showOperators:!0})},68833:(e,t,r)=>{"use strict";t.__esModule=!0,t.condition=h;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=a(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var o=s?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(n,i,o):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n}(r(23384)),s=r(69196),i=r(22220),o=r(76047);function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(a=function(e){return e?r:t})(e)}const l=t.CONDITION_NAME="between";function h(e,t){let[r,n]=t,a=r,l=n;if("numeric"===e.meta.type){const e=parseFloat(a,10),t=parseFloat(l,10);a=Math.min(e,t),l=Math.max(e,t)}else if("date"===e.meta.type){const t=(0,s.getCondition)(o.CONDITION_NAME,[l]),r=(0,s.getCondition)(i.CONDITION_NAME,[a]);return t(e)&&r(e)}return e.value>=a&&e.value<=l}(0,s.registerCondition)(l,h,{name:n.FILTERS_CONDITIONS_BETWEEN,inputsCount:2,showOperators:!0})},37115:(e,t,r)=>{"use strict";t.__esModule=!0,t.condition=o;var n=r(69196),s=r(87094);const i=t.CONDITION_NAME="by_value";function o(e,t){let[r]=t;return r(e.value)}(0,n.registerCondition)(i,o,{name:"By value",inputsCount:0,inputValuesDecorator(e){let[t]=e;return[(0,s.createArrayAssertion)(t)]},showOperators:!1})},37504:(e,t,r)=>{"use strict";t.__esModule=!0,t.condition=l;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=o(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var a=s?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n}(r(23384)),s=r(70505),i=r(69196);function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(o=function(e){return e?r:t})(e)}const a=t.CONDITION_NAME="contains";function l(e,t){let[r]=t;return(0,s.stringify)(e.value).toLocaleLowerCase(e.meta.locale).indexOf((0,s.stringify)(r))>=0}(0,i.registerCondition)(a,l,{name:n.FILTERS_CONDITIONS_CONTAINS,inputsCount:1,showOperators:!0})},22220:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,t.condition=h;var s=n(r(6671)),i=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=a(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var o=s?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(n,i,o):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n}(r(23384)),o=r(69196);function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(a=function(e){return e?r:t})(e)}const l=t.CONDITION_NAME="date_after";function h(e,t){let[r]=t;const n=(0,s.default)(e.value,e.meta.dateFormat),i=(0,s.default)(r,e.meta.dateFormat);return!(!n.isValid()||!i.isValid())&&n.diff(i)>=0}(0,o.registerCondition)(l,h,{name:i.FILTERS_CONDITIONS_AFTER,inputsCount:1,showOperators:!0})},76047:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,t.condition=h;var s=n(r(6671)),i=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=a(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var o=s?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(n,i,o):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n}(r(23384)),o=r(69196);function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(a=function(e){return e?r:t})(e)}const l=t.CONDITION_NAME="date_before";function h(e,t){let[r]=t;const n=(0,s.default)(e.value,e.meta.dateFormat),i=(0,s.default)(r,e.meta.dateFormat);return!(!n.isValid()||!i.isValid())&&n.diff(i)<=0}(0,o.registerCondition)(l,h,{name:i.FILTERS_CONDITIONS_BEFORE,inputsCount:1,showOperators:!0})},14383:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,t.condition=h;var s=n(r(6671)),i=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=a(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var o=s?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(n,i,o):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n}(r(23384)),o=r(69196);function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(a=function(e){return e?r:t})(e)}const l=t.CONDITION_NAME="date_today";function h(e){const t=(0,s.default)(e.value,e.meta.dateFormat);return!!t.isValid()&&t.isSame((0,s.default)().startOf("day"),"d")}(0,o.registerCondition)(l,h,{name:i.FILTERS_CONDITIONS_TODAY,inputsCount:0})},94855:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,t.condition=h;var s=n(r(6671)),i=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=a(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var o=s?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(n,i,o):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n}(r(23384)),o=r(69196);function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(a=function(e){return e?r:t})(e)}const l=t.CONDITION_NAME="date_tomorrow";function h(e){const t=(0,s.default)(e.value,e.meta.dateFormat);return!!t.isValid()&&t.isSame((0,s.default)().subtract(-1,"days").startOf("day"),"d")}(0,o.registerCondition)(l,h,{name:i.FILTERS_CONDITIONS_TOMORROW,inputsCount:0})},99006:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,t.condition=h;var s=n(r(6671)),i=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=a(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var o=s?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(n,i,o):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n}(r(23384)),o=r(69196);function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(a=function(e){return e?r:t})(e)}const l=t.CONDITION_NAME="date_yesterday";function h(e){const t=(0,s.default)(e.value,e.meta.dateFormat);return!!t.isValid()&&t.isSame((0,s.default)().subtract(1,"days").startOf("day"),"d")}(0,o.registerCondition)(l,h,{name:i.FILTERS_CONDITIONS_YESTERDAY,inputsCount:0})},53080:(e,t,r)=>{"use strict";t.__esModule=!0,t.condition=l;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=o(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var a=s?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n}(r(23384)),s=r(69196),i=r(70505);function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(o=function(e){return e?r:t})(e)}const a=t.CONDITION_NAME="empty";function l(e){return(0,i.isEmpty)(e.value)}(0,s.registerCondition)(a,l,{name:n.FILTERS_CONDITIONS_EMPTY,inputsCount:0,showOperators:!0})},36263:(e,t,r)=>{"use strict";t.__esModule=!0,t.condition=l;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=o(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var a=s?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n}(r(23384)),s=r(70505),i=r(69196);function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(o=function(e){return e?r:t})(e)}const a=t.CONDITION_NAME="ends_with";function l(e,t){let[r]=t;return(0,s.stringify)(e.value).toLocaleLowerCase(e.meta.locale).endsWith((0,s.stringify)(r))}(0,i.registerCondition)(a,l,{name:n.FILTERS_CONDITIONS_ENDS_WITH,inputsCount:1,showOperators:!0})},19941:(e,t,r)=>{"use strict";t.__esModule=!0,t.condition=l;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=o(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var a=s?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n}(r(23384)),s=r(70505),i=r(69196);function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(o=function(e){return e?r:t})(e)}const a=t.CONDITION_NAME="eq";function l(e,t){let[r]=t;return(0,s.stringify)(e.value).toLocaleLowerCase(e.meta.locale)===(0,s.stringify)(r)}(0,i.registerCondition)(a,l,{name:n.FILTERS_CONDITIONS_EQUAL,inputsCount:1,showOperators:!0})},44294:(e,t,r)=>{"use strict";t.__esModule=!0,t.condition=i;var n=r(69196);const s=t.CONDITION_NAME="false";function i(){return!1}(0,n.registerCondition)(s,i,{name:"False"})},85476:(e,t,r)=>{"use strict";t.__esModule=!0,t.condition=a;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=i(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=s?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(r(23384)),s=r(69196);function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(i=function(e){return e?r:t})(e)}const o=t.CONDITION_NAME="gt";function a(e,t){let[r]=t,n=r;return"numeric"===e.meta.type&&(n=parseFloat(n,10)),e.value>n}(0,s.registerCondition)(o,a,{name:n.FILTERS_CONDITIONS_GREATER_THAN,inputsCount:1,showOperators:!0})},96557:(e,t,r)=>{"use strict";t.__esModule=!0,t.condition=a;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=i(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=s?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(r(23384)),s=r(69196);function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(i=function(e){return e?r:t})(e)}const o=t.CONDITION_NAME="gte";function a(e,t){let[r]=t,n=r;return"numeric"===e.meta.type&&(n=parseFloat(n,10)),e.value>=n}(0,s.registerCondition)(o,a,{name:n.FILTERS_CONDITIONS_GREATER_THAN_OR_EQUAL,inputsCount:1,showOperators:!0})},39079:(e,t,r)=>{"use strict";t.__esModule=!0,t.condition=a;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=i(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=s?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(r(23384)),s=r(69196);function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(i=function(e){return e?r:t})(e)}const o=t.CONDITION_NAME="lt";function a(e,t){let[r]=t,n=r;return"numeric"===e.meta.type&&(n=parseFloat(n,10)),e.value{"use strict";t.__esModule=!0,t.condition=a;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=i(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=s?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(r(23384)),s=r(69196);function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(i=function(e){return e?r:t})(e)}const o=t.CONDITION_NAME="lte";function a(e,t){let[r]=t,n=r;return"numeric"===e.meta.type&&(n=parseFloat(n,10)),e.value<=n}(0,s.registerCondition)(o,a,{name:n.FILTERS_CONDITIONS_LESS_THAN_OR_EQUAL,inputsCount:1,showOperators:!0})},1915:(e,t,r)=>{"use strict";t.__esModule=!0,t.condition=a;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=i(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=s?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(r(23384)),s=r(69196);function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(i=function(e){return e?r:t})(e)}const o=t.CONDITION_NAME="none";function a(){return!0}(0,s.registerCondition)(o,a,{name:n.FILTERS_CONDITIONS_NONE,inputsCount:0,showOperators:!1})},1758:(e,t,r)=>{"use strict";t.__esModule=!0,t.condition=l;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=o(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var a=s?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n}(r(23384)),s=r(69196),i=r(68833);function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(o=function(e){return e?r:t})(e)}const a=t.CONDITION_NAME="not_between";function l(e,t){return!(0,s.getCondition)(i.CONDITION_NAME,t)(e)}(0,s.registerCondition)(a,l,{name:n.FILTERS_CONDITIONS_NOT_BETWEEN,inputsCount:2,showOperators:!0})},51477:(e,t,r)=>{"use strict";t.__esModule=!0,t.condition=l;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=o(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var a=s?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n}(r(23384)),s=r(69196),i=r(37504);function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(o=function(e){return e?r:t})(e)}const a=t.CONDITION_NAME="not_contains";function l(e,t){return!(0,s.getCondition)(i.CONDITION_NAME,t)(e)}(0,s.registerCondition)(a,l,{name:n.FILTERS_CONDITIONS_NOT_CONTAIN,inputsCount:1,showOperators:!0})},12551:(e,t,r)=>{"use strict";t.__esModule=!0,t.condition=l;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=o(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var a=s?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n}(r(23384)),s=r(69196),i=r(53080);function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(o=function(e){return e?r:t})(e)}const a=t.CONDITION_NAME="not_empty";function l(e,t){return!(0,s.getCondition)(i.CONDITION_NAME,t)(e)}(0,s.registerCondition)(a,l,{name:n.FILTERS_CONDITIONS_NOT_EMPTY,inputsCount:0,showOperators:!0})},99034:(e,t,r)=>{"use strict";t.__esModule=!0,t.condition=l;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=o(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var a=s?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n}(r(23384)),s=r(69196),i=r(19941);function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(o=function(e){return e?r:t})(e)}const a=t.CONDITION_NAME="neq";function l(e,t){return!(0,s.getCondition)(i.CONDITION_NAME,t)(e)}(0,s.registerCondition)(a,l,{name:n.FILTERS_CONDITIONS_NOT_EQUAL,inputsCount:1,showOperators:!0})},76893:(e,t,r)=>{"use strict";t.__esModule=!0,t.condition=i;var n=r(69196);const s=t.CONDITION_NAME="true";function i(){return!0}(0,n.registerCondition)(s,i,{name:"True"})},24242:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834),r(15724),r(14846),r(69655),r(94364),r(90458),r(75568);var s=n(r(85707)),i=r(25499),o=r(21595),a=n(r(16050)),l=r(69196),h=r(7233),u=r(2933),c=r(70505),d=r(61149);const p="ConditionCollection.filteringStates";class g{constructor(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];(0,s.default)(this,"hot",void 0),(0,s.default)(this,"isMapRegistrable",void 0),(0,s.default)(this,"filteringStates",new d.LinkedPhysicalIndexToValueMap),(0,s.default)(this,"previousConditionStack",null),this.hot=e,this.isMapRegistrable=t,!0===this.isMapRegistrable?this.hot.columnIndexMapper.registerMap(p,this.filteringStates):this.filteringStates.init(this.hot.columnIndexMapper.getNumberOfIndexes())}isEmpty(){return 0===this.getFilteredColumns().length}isMatch(e,t){var r;const n=this.filteringStates.getValueAtIndex(t),s=null!==(r=null==n?void 0:n.conditions)&&void 0!==r?r:[],i=null==n?void 0:n.operation;return this.isMatchInConditions(s,e,i)}isMatchInConditions(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:h.OPERATION_ID;return!e.length||(0,u.getOperationFunc)(r)(e,t)}addCondition(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:h.OPERATION_ID,n=arguments.length>3?arguments[3]:void 0;const s=this.hot.getCellMeta(0,e).locale,i=t.args.map((e=>"string"==typeof e?e.toLocaleLowerCase(s):e)),a=t.name||t.command.key;null===this.previousConditionStack&&this.setPreviousConditionStack(this.exportAllConditions()),this.runLocalHooks("beforeAdd",e);const d=this.getOperation(e);if(d){if(d!==r)throw Error(o.toSingleLine`The column of index ${e} has been already applied with a \`${d}\`\x20 + filter operation. Use \`removeConditions\` to clear the current conditions and then add new ones.\x20 + Mind that you cannot mix different types of operations (for instance, if you use \`conjunction\`,\x20 + use it consequently for a particular column).`)}else if((0,c.isUndefined)(u.operations[r]))throw new Error(o.toSingleLine`Unexpected operation named \`${r}\`. Possible ones are\x20 + \`disjunction\` and \`conjunction\`.`);const p=this.getConditions(e);0===p.length?this.filteringStates.setValueAtIndex(e,{operation:r,conditions:[{name:a,args:i,func:(0,l.getCondition)(a,i)}]},n):p.push({name:a,args:i,func:(0,l.getCondition)(a,i)}),this.runLocalHooks("afterAdd",e)}getConditions(e){var t,r;return null!==(t=null===(r=this.filteringStates.getValueAtIndex(e))||void 0===r?void 0:r.conditions)&&void 0!==t?t:[]}getOperation(e){var t;return null===(t=this.filteringStates.getValueAtIndex(e))||void 0===t?void 0:t.operation}getFilteredColumns(){return this.filteringStates.getEntries().map((e=>{let[t]=e;return t}))}getColumnStackPosition(e){return this.getFilteredColumns().indexOf(e)}exportAllConditions(){return this.filteringStates.getEntries().reduce(((e,t)=>{let[r,{operation:n,conditions:s}]=t;return e.push({column:r,operation:n,conditions:s.map((e=>{let{name:t,args:r}=e;return{name:t,args:[...r]}}))}),e}),[])}importAllConditions(e){this.clean(),e.forEach((e=>{e.conditions.forEach((t=>this.addCondition(e.column,t)))}))}removeConditions(e){this.setPreviousConditionStack(this.exportAllConditions()),this.runLocalHooks("beforeRemove",e),this.filteringStates.clearValue(e),this.runLocalHooks("afterRemove",e)}clean(){this.runLocalHooks("beforeClean"),this.filteringStates.clear(),this.runLocalHooks("afterClean")}hasConditions(e,t){const r=this.getConditions(e);return t?r.some((e=>e.name===t)):r.length>0}setPreviousConditionStack(e){this.previousConditionStack=e}destroy(){this.isMapRegistrable&&this.hot.columnIndexMapper.unregisterMap(p),this.filteringStates=null,this.clearLocalHooks()}}(0,i.mixin)(g,a.default);t.default=g},69196:(e,t,r)=>{"use strict";t.__esModule=!0,t.getCondition=function(e,t){if(!n[e])throw Error(`Filter condition "${e}" does not exist.`);const{condition:r,descriptor:s}=n[e];let i=t;s.inputValuesDecorator&&(i=s.inputValuesDecorator(i));return function(e){return r.apply(e.meta.instance,[].concat([e],[i]))}},t.getConditionDescriptor=function(e){if(!n[e])throw Error(`Filter condition "${e}" does not exist.`);return n[e].descriptor},t.registerCondition=function(e,t,r){r.key=e,n[e]={condition:t,descriptor:r}},r(67834);const n=t.conditions={}},53177:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834),r(15724),r(14846),r(27458);var s=n(r(85707)),i=r(10587),o=r(25499),a=r(89804),l=n(r(16050)),h=n(r(24242)),u=n(r(96213)),c=r(87094);function d(e,t){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.add(e)}function p(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var g=new WeakSet;class f{constructor(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:()=>[];d(this,g),(0,s.default)(this,"hot",void 0),(0,s.default)(this,"conditionCollection",void 0),(0,s.default)(this,"columnDataFactory",void 0),(0,s.default)(this,"changes",[]),(0,s.default)(this,"grouping",!1),(0,s.default)(this,"latestEditedColumnPosition",-1),(0,s.default)(this,"latestOrderStack",[]),this.hot=e,this.conditionCollection=t,this.columnDataFactory=r,this.conditionCollection.addLocalHook("beforeRemove",(e=>p(g,this,m).call(this,e))),this.conditionCollection.addLocalHook("afterRemove",(e=>this.updateStatesAtColumn(e))),this.conditionCollection.addLocalHook("afterAdd",(e=>this.updateStatesAtColumn(e))),this.conditionCollection.addLocalHook("beforeClean",(()=>p(g,this,y).call(this))),this.conditionCollection.addLocalHook("afterClean",(()=>p(g,this,E).call(this)))}groupChanges(){this.grouping=!0}flush(){this.grouping=!1,(0,i.arrayEach)(this.changes,(e=>{this.updateStatesAtColumn(e)})),this.changes.length=0}updateStatesAtColumn(e,t){var r=this;if(this.grouping)return void(-1===this.changes.indexOf(e)&&this.changes.push(e));const n=this.conditionCollection.exportAllConditions();let s=this.conditionCollection.getColumnStackPosition(e);-1===s&&(s=this.latestEditedColumnPosition);const o=n.slice(0,s),l=n.slice(s);l.length&&l[0].column===e&&l.shift();const d=(0,a.curry)((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const s=new h.default(r.hot,!1),o=[].concat(e,n);s.importAllConditions(o);const a=r.columnDataFactory(t);let l;l=s.isEmpty()?a:new u.default(s,(e=>r.columnDataFactory(e))).filter(),l=(0,i.arrayMap)(l,(e=>e.meta.visualRow));const d=(0,c.createArrayAssertion)(l);return s.destroy(),(0,i.arrayFilter)(a,(e=>d(e.meta.visualRow)))}))(o),p=[].concat(this.conditionCollection.getConditions(e));this.runLocalHooks("update",{editedConditionStack:{column:e,conditions:p},dependentConditionStacks:l,filteredRowsFactory:d,conditionArgsChange:t})}destroy(){this.clearLocalHooks(),(0,o.objectEach)(this,((e,t)=>{this[t]=null}))}}function m(e){this.latestEditedColumnPosition=this.conditionCollection.getColumnStackPosition(e)}function y(){this.latestOrderStack=this.conditionCollection.getFilteredColumns()}function E(){(0,i.arrayEach)(this.latestOrderStack,(e=>{this.updateStatesAtColumn(e)}))}(0,o.mixin)(f,l.default);t.default=f},33582:(e,t,r)=>{"use strict";t.__esModule=!0,t.default=function(e){const t=[];let r=e;k[r]||(r=L);return(0,s.arrayEach)(k[r],(e=>{let r;r=e===i.SEPARATOR?{name:i.SEPARATOR}:(0,n.clone)((0,o.getConditionDescriptor)(e)),t.push(r)})),t},r(15724);var n=r(25499),s=r(10587),i=r(30889),o=r(69196),a=r(1915);t.CONDITION_NONE=a.CONDITION_NAME;var l=r(53080);t.CONDITION_EMPTY=l.CONDITION_NAME;var h=r(12551);t.CONDITION_NOT_EMPTY=h.CONDITION_NAME;var u=r(19941);t.CONDITION_EQUAL=u.CONDITION_NAME;var c=r(99034);t.CONDITION_NOT_EQUAL=c.CONDITION_NAME;var d=r(85476);t.CONDITION_GREATER_THAN=d.CONDITION_NAME;var p=r(96557);t.CONDITION_GREATER_THAN_OR_EQUAL=p.CONDITION_NAME;var g=r(39079);t.CONDITION_LESS_THAN=g.CONDITION_NAME;var f=r(16900);t.CONDITION_LESS_THAN_OR_EQUAL=f.CONDITION_NAME;var m=r(68833);t.CONDITION_BETWEEN=m.CONDITION_NAME;var y=r(1758);t.CONDITION_NOT_BETWEEN=y.CONDITION_NAME;var E=r(78911);t.CONDITION_BEGINS_WITH=E.CONDITION_NAME;var w=r(36263);t.CONDITION_ENDS_WITH=w.CONDITION_NAME;var C=r(37504);t.CONDITION_CONTAINS=C.CONDITION_NAME;var v=r(51477);t.CONDITION_NOT_CONTAINS=v.CONDITION_NAME;var R=r(76047);t.CONDITION_DATE_BEFORE=R.CONDITION_NAME;var S=r(22220);t.CONDITION_DATE_AFTER=S.CONDITION_NAME;var T=r(94855);t.CONDITION_TOMORROW=T.CONDITION_NAME;var N=r(14383);t.CONDITION_TODAY=N.CONDITION_NAME;var M=r(99006);t.CONDITION_YESTERDAY=M.CONDITION_NAME;var _=r(37115);t.CONDITION_BY_VALUE=_.CONDITION_NAME;var b=r(76893);t.CONDITION_TRUE=b.CONDITION_NAME;var O=r(44294);t.CONDITION_FALSE=O.CONDITION_NAME;var A=r(7233);t.OPERATION_AND=A.OPERATION_ID;var I=r(96609);t.OPERATION_OR=I.OPERATION_ID;var x=r(57737);t.OPERATION_OR_THEN_VARIABLE=x.OPERATION_ID;const P=t.TYPE_NUMERIC="numeric",L=t.TYPE_TEXT="text",D=t.TYPE_DATE="date",k=t.TYPES={[P]:[a.CONDITION_NAME,i.SEPARATOR,l.CONDITION_NAME,h.CONDITION_NAME,i.SEPARATOR,u.CONDITION_NAME,c.CONDITION_NAME,i.SEPARATOR,d.CONDITION_NAME,p.CONDITION_NAME,g.CONDITION_NAME,f.CONDITION_NAME,m.CONDITION_NAME,y.CONDITION_NAME],[L]:[a.CONDITION_NAME,i.SEPARATOR,l.CONDITION_NAME,h.CONDITION_NAME,i.SEPARATOR,u.CONDITION_NAME,c.CONDITION_NAME,i.SEPARATOR,E.CONDITION_NAME,w.CONDITION_NAME,i.SEPARATOR,C.CONDITION_NAME,v.CONDITION_NAME],[D]:[a.CONDITION_NAME,i.SEPARATOR,l.CONDITION_NAME,h.CONDITION_NAME,i.SEPARATOR,u.CONDITION_NAME,c.CONDITION_NAME,i.SEPARATOR,R.CONDITION_NAME,S.CONDITION_NAME,m.CONDITION_NAME,i.SEPARATOR,T.CONDITION_NAME,N.CONDITION_NAME,M.CONDITION_NAME]}},96213:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(15724);var s=n(r(85707)),i=r(10587);t.default=class{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>[];(0,s.default)(this,"conditionCollection",void 0),(0,s.default)(this,"columnDataFactory",void 0),this.conditionCollection=e,this.columnDataFactory=t}filter(){let e=[];return(0,i.arrayEach)(this.conditionCollection.getFilteredColumns(),((t,r)=>{let n=this.columnDataFactory(t);r&&(n=this._getIntersectData(n,e)),e=this.filterByColumn(t,n)})),e}filterByColumn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const r=[];return(0,i.arrayEach)(t,(t=>{void 0!==t&&this.conditionCollection.isMatch(t,e)&&r.push(t)})),r}_getIntersectData(e,t){const r=[];return(0,i.arrayEach)(t,(t=>{const n=t.meta.visualRow;void 0!==e[n]&&(r[n]=e[n])})),r}}},72328:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834),r(15724),r(25352),r(14846),r(27458),r(69655),r(94364);var s=n(r(85707)),i=r(75089),o=r(10587),a=r(21595),l=r(14859),h=r(22137),u=r(62577),c=r(83445),d=r(30889),p=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=N(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var o=s?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(n,i,o):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n}(r(23384)),g=r(65686),f=r(45698),m=r(75482),y=r(73048),E=n(r(24242)),w=n(r(96213)),C=n(r(53177)),v=r(87094),R=r(4679),S=r(33582),T=r(61149);function N(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(N=function(e){return e?r:t})(e)}function M(e,t,r){_(e,t),t.set(e,r)}function _(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function b(e,t){return e.get(O(e,t))}function O(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}const A=t.PLUGIN_KEY="filters",I=t.PLUGIN_PRIORITY=250,x=A;var P=new WeakMap,L=new WeakMap,D=new WeakSet;class k extends i.BasePlugin{static get PLUGIN_KEY(){return A}static get PLUGIN_PRIORITY(){return I}static get PLUGIN_DEPS(){return["plugin:DropdownMenu","plugin:HiddenRows","cell-type:checkbox"]}constructor(e){var t,r,n;super(e),t=this,_(r=this,n=D),n.add(r),(0,s.default)(this,"dropdownMenuPlugin",null),(0,s.default)(this,"conditionCollection",null),(0,s.default)(this,"conditionUpdateObserver",null),(0,s.default)(this,"components",new Map([["filter_by_condition",null],["filter_operators",null],["filter_by_condition2",null],["filter_by_value",null],["filter_action_bar",null]])),(0,s.default)(this,"filtersRowsMap",null),M(this,P,void 0),M(this,L,new WeakSet),this.hot.addHook("afterGetColHeader",(function(){for(var e=arguments.length,r=new Array(e),n=0;n(e.addLocalHook("accept",(()=>O(D,this,W).call(this,"accept"))),e.addLocalHook("cancel",(()=>O(D,this,W).call(this,"cancel"))),e.addLocalHook("change",(t=>O(D,this,Y).call(this,e,t))),e),s=()=>`${this.hot.getTranslatedPhrase(p.FILTERS_DIVS_FILTER_BY_CONDITION)}:`,i=()=>`${this.hot.getTranslatedPhrase(p.FILTERS_DIVS_FILTER_BY_VALUE)}:`;if(!this.components.get("filter_by_condition")){const e=new g.ConditionComponent(this.hot,{id:"filter_by_condition",name:s,addSeparator:!1,menuContainer:r});e.addLocalHook("afterClose",(()=>O(D,this,G).call(this))),this.components.set("filter_by_condition",n(e))}if(this.components.get("filter_operators")||this.components.set("filter_operators",new f.OperatorsComponent(this.hot,{id:"filter_operators",name:"Operators"})),!this.components.get("filter_by_condition2")){const e=new g.ConditionComponent(this.hot,{id:"filter_by_condition2",name:"",addSeparator:!0,menuContainer:r});e.addLocalHook("afterClose",(()=>O(D,this,G).call(this))),this.components.set("filter_by_condition2",n(e))}if(this.components.get("filter_by_value")||this.components.set("filter_by_value",n(new m.ValueComponent(this.hot,{id:"filter_by_value",name:i}))),this.components.get("filter_action_bar")||this.components.set("filter_action_bar",n(new y.ActionBarComponent(this.hot,{id:"filter_action_bar",name:"Action bar"}))),this.conditionCollection||(this.conditionCollection=new E.default(this.hot)),this.conditionUpdateObserver||(this.conditionUpdateObserver=new C.default(this.hot,this.conditionCollection,(e=>this.getDataMapAtColumn(e))),this.conditionUpdateObserver.addLocalHook("update",(e=>O(D,this,z).call(this,e)))),this.components.forEach((e=>e.show())),this.addHook("afterDropdownMenuDefaultOptions",(function(){for(var t=arguments.length,r=new Array(t),n=0;nO(D,this,V).call(this))),this.addHook("afterDropdownMenuShow",(()=>O(D,this,F).call(this))),this.addHook("afterDropdownMenuHide",(()=>O(D,this,U).call(this))),this.addHook("afterChange",(e=>O(D,this,H).call(this,e))),this.hot.getSettings().dropdownMenu&&this.dropdownMenuPlugin&&(this.dropdownMenuPlugin.disablePlugin(),this.dropdownMenuPlugin.enablePlugin()),!b(P,this)&&this.dropdownMenuPlugin.enabled){const e=[{focus:()=>{const e=b(P,this).getMenu(),t=e.getNavigator(),r=b(P,this).getLastMenuPage();e.focus(),r>0?t.setCurrentPage(r):t.toFirstItem()}},...Array.from(this.components).map((e=>{let[,t]=e;return t.getElements()})).flat()];o=P,a=this,l=(0,R.createMenuFocusController)(this.dropdownMenuPlugin.menu,e),o.set(O(o,a),l);const t=e=>{b(P,this).listen(),e.preventDefault(),(0,c.isKey)(e.keyCode,"TAB")&&(e.shiftKey?b(P,this).toPreviousItem():b(P,this).toNextItem())};this.components.get("filter_by_value").addLocalHook("listTabKeydown",t),this.components.get("filter_by_condition").addLocalHook("selectTabKeydown",t)}var o,a,l;this.registerShortcuts(),super.enablePlugin()}disablePlugin(){var e;this.enabled&&(null!==(e=this.dropdownMenuPlugin)&&void 0!==e&&e.enabled&&this.dropdownMenuPlugin.menu.clearLocalHooks(),this.components.forEach(((e,t)=>{e.destroy(),this.components.set(t,null)})),this.conditionCollection.destroy(),this.conditionCollection=null,this.hot.rowIndexMapper.unregisterMap(this.pluginName));this.unregisterShortcuts(),super.disablePlugin()}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Alt","A"]],stopPropagation:!0,callback:()=>{const e=this.hot.getSelected();this.clearConditions(),this.filter(),e&&this.hot.selectCells(e)},group:x})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(x)}addCondition(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:S.OPERATION_AND;const s=this.hot.toPhysicalColumn(e);this.conditionCollection.addCondition(s,{command:{key:t},args:r},n)}removeConditions(e){const t=this.hot.toPhysicalColumn(e);this.conditionCollection.removeConditions(t)}clearConditions(e){if(void 0===e)this.conditionCollection.clean();else{const t=this.hot.toPhysicalColumn(e);this.conditionCollection.removeConditions(t)}}filter(){const{navigableHeaders:e}=this.hot.getSettings(),t=this._createDataFilter(),r=!this.conditionCollection.isEmpty();let n=[];const s=this.conditionCollection.exportAllConditions();if(!1!==this.hot.runHooks("beforeFilter",s,this.conditionCollection.previousConditionStack))if(r){const r=[];this.hot.batchExecution((()=>{this.filtersRowsMap.clear(),n=(0,o.arrayMap)(t.filter(),(e=>e.meta.visualRow));const e=(0,v.createArrayAssertion)(n);(0,h.rangeEach)(this.hot.countSourceRows()-1,(t=>{e(t)||r.push(t)})),(0,o.arrayEach)(r,(e=>{this.filtersRowsMap.setValueAtIndex(e,!0)}))}),!0),e||n.length||this.hot.deselectCell()}else this.filtersRowsMap.clear();this.hot.runHooks("afterFilter",s),this.conditionCollection.setPreviousConditionStack(null),this.hot.view.adjustElementsSize(),this.hot.render(),this.hot.selection.isSelected()&&this.hot.selectCell(e?-1:0,this.hot.getSelectedRangeLast().highlight.col)}getSelectedColumn(){var e;const t=null===(e=this.hot.getSelectedRangeLast())||void 0===e?void 0:e.highlight;return t?{visualIndex:t.col,physicalIndex:this.hot.toPhysicalColumn(t.col)}:null}getDataMapAtColumn(e){const t=this.hot.toVisualColumn(e),r=[];return(0,o.arrayEach)(this.hot.getSourceDataAtCol(t),((e,n)=>{var s;const{row:i,col:o,visualCol:a,visualRow:l,type:h,instance:u,dateFormat:c,locale:d}=this.hot.getCellMeta(n,t),p=null!==(s=this.hot.getDataAtCell(this.hot.toVisualRow(n),t))&&void 0!==s?s:e;r.push({meta:{row:i,col:o,visualCol:a,visualRow:l,type:h,instance:u,dateFormat:c,locale:d},value:(0,v.toEmptyString)(p)})})),r}updateValueComponentCondition(e){const t=this.hot.getDataAtCol(e),r=(0,v.unifyColumnValues)(t);this.conditionUpdateObserver.updateStatesAtColumn(e,r)}restoreComponents(e){var t;const r=null===(t=this.getSelectedColumn())||void 0===t?void 0:t.physicalIndex;e.forEach((e=>{e.isHidden()||e.restoreState(r)})),this.updateDependentComponentsVisibility()}getOperationBasedOnArguments(e,t,r,n){let s=e;return s===S.OPERATION_OR&&t.command.key!==S.CONDITION_NONE&&r.command.key!==S.CONDITION_NONE&&n.command.key!==S.CONDITION_NONE?s=S.OPERATION_OR_THEN_VARIABLE:n.command.key!==S.CONDITION_NONE&&(t.command.key!==S.CONDITION_NONE&&r.command.key!==S.CONDITION_NONE||(s=S.OPERATION_AND)),s}setListeningDropdownMenu(){this.dropdownMenuPlugin&&this.dropdownMenuPlugin.setListening()}updateDependentComponentsVisibility(){const e=this.components.get("filter_by_condition"),{command:t}=e.getState(),r=[this.components.get("filter_by_condition2"),this.components.get("filter_operators")];t.showOperators?this.showComponents(...r):this.hideComponents(...r)}_createDataFilter(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.conditionCollection;return new w.default(e,(e=>this.getDataMapAtColumn(e)))}getIndexesOfComponents(){const e=[];if(!this.dropdownMenuPlugin)return e;const t=this.dropdownMenuPlugin.menu;for(var r=arguments.length,n=new Array(r),s=0;s{(0,o.arrayEach)(t.menuItems,((t,n)=>{t.key===r.getMenuItemDescriptor().key&&e.push(n)}))})),e}changeComponentsVisibility(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(!this.dropdownMenuPlugin)return;const t=this.dropdownMenuPlugin.menu.hotMenu,r=t.getPlugin("hiddenRows");for(var n=arguments.length,s=new Array(n>1?n-1:0),i=1;i{null!==e&&(e.destroy(),this.components.set(t,null))})),this.conditionCollection.destroy(),this.conditionUpdateObserver.destroy(),this.hot.rowIndexMapper.unregisterMap(this.pluginName)),super.destroy()}}function H(e){e&&(0,o.arrayEach)(e,(e=>{const[,t]=e,r=this.hot.propToCol(t);this.conditionCollection.hasConditions(r)&&this.updateValueComponentCondition(r)}))}function F(){const e=this.dropdownMenuPlugin.menu;this.restoreComponents(Array.from(this.components.values())),e.updateMenuDimensions()}function U(){this.components.get("filter_by_condition").getSelectElement().closeOptions(),this.components.get("filter_by_condition2").getSelectElement().closeOptions()}function V(){const e=this.dropdownMenuPlugin.menu;b(L,this).has(e)||b(P,this).setMenu(e),b(L,this).add(e)}function B(e){e.items.push({name:d.SEPARATOR}),this.components.forEach((t=>{e.items.push(t.getMenuItemDescriptor())}))}function W(e){var t;if("accept"===e){const e=this.getSelectedColumn();var r;if(null===e)return void(null===(r=this.dropdownMenuPlugin)||void 0===r||r.close());const{physicalIndex:t}=e,n=this.components.get("filter_by_condition").getState(),s=this.components.get("filter_by_condition2").getState(),i=this.components.get("filter_by_value").getState(),o=this.getOperationBasedOnArguments(this.components.get("filter_operators").getActiveOperationId(),n,s,i);this.conditionUpdateObserver.groupChanges();let a=this.conditionCollection.getColumnStackPosition(t);-1===a&&(a=void 0),this.conditionCollection.removeConditions(t),n.command.key!==S.CONDITION_NONE&&(this.conditionCollection.addCondition(t,n,o,a),s.command.key!==S.CONDITION_NONE&&this.conditionCollection.addCondition(t,s,o,a)),i.command.key!==S.CONDITION_NONE&&this.conditionCollection.addCondition(t,i,o,a),this.conditionUpdateObserver.flush(),this.components.forEach((e=>e.saveState(t))),this.filtersRowsMap.clear(),this.filter()}null===(t=this.dropdownMenuPlugin)||void 0===t||t.close()}function Y(e,t){const r=this.dropdownMenuPlugin.menu;this.updateDependentComponentsVisibility(),e.constructor!==g.ConditionComponent||t.inputsCount||this.setListeningDropdownMenu(),r.updateMenuDimensions()}function G(){this.setListeningDropdownMenu()}function j(e,t,r){const n=this.hot.toPhysicalColumn(e);this.enabled&&this.conditionCollection.hasConditions(n)&&r===this.hot.view.getColumnHeadersCount()-1?(0,u.addClass)(t,"htFiltersActive"):(0,u.removeClass)(t,"htFiltersActive")}function z(e){var t;if(null===(t=this.dropdownMenuPlugin)||void 0===t||!t.enabled)return;const{editedConditionStack:{conditions:r,column:n}}=e,s=r.filter((e=>e.name===S.CONDITION_BY_VALUE)),i=r.filter((e=>e.name!==S.CONDITION_BY_VALUE));if(s.length>=2||i.length>=3)(0,l.warn)(a.toSingleLine`The filter conditions have been applied properly, but couldn’t be displayed visually.\x20 + The overall amount of conditions exceed the capability of the dropdown menu.\x20 + For more details see the documentation.`);else{const t=this.conditionCollection.getOperation(n);this.components.get("filter_by_condition").updateState(i[0],n),this.components.get("filter_by_condition2").updateState(i[1],n),this.components.get("filter_operators").updateState(t,n),this.components.get("filter_by_value").updateState(e)}}t.Filters=k},80971:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(72328);t.PLUGIN_KEY=n.PLUGIN_KEY,t.PLUGIN_PRIORITY=n.PLUGIN_PRIORITY,t.Filters=n.Filters},2933:(e,t,r)=>{"use strict";t.__esModule=!0,t.getOperationFunc=function(e){if(!n[e])throw Error(`Operation with id "${e}" does not exist.`);const t=n[e].func;return function(e,r){return t(e,r)}},t.getOperationName=function(e){return n[e].name},t.registerOperation=function(e,t,r){n[e]={name:t,func:r}},r(67834);const n=t.operations={}},7233:(e,t,r)=>{"use strict";t.__esModule=!0,t.operationResult=l,r(14846),r(63333);var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=i(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=s?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(r(23384)),s=r(2933);function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(i=function(e){return e?r:t})(e)}const o=t.OPERATION_ID="conjunction",a=t.SHORT_NAME_FOR_COMPONENT=n.FILTERS_LABELS_CONJUNCTION;function l(e,t){return e.every((e=>e.func(t)))}(0,s.registerOperation)(o,a,l)},96609:(e,t,r)=>{"use strict";t.__esModule=!0,t.operationResult=l,r(14846),r(75568);var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=i(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=s?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(r(23384)),s=r(2933);function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(i=function(e){return e?r:t})(e)}const o=t.OPERATION_ID="disjunction",a=t.SHORT_NAME_FOR_COMPONENT=n.FILTERS_LABELS_DISJUNCTION;function l(e,t){return e.some((e=>e.func(t)))}(0,s.registerOperation)(o,a,l)},57737:(e,t,r)=>{"use strict";t.__esModule=!0,t.operationResult=l,r(67834),r(14846),r(75568);var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=i(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=s?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(r(23384)),s=r(2933);function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(i=function(e){return e?r:t})(e)}const o=t.OPERATION_ID="disjunctionWithExtraCondition",a=t.SHORT_NAME_FOR_COMPONENT=n.FILTERS_LABELS_DISJUNCTION;function l(e,t){if(e.length<3)throw Error("Operation doesn't work on less then three conditions.");return e.slice(0,e.length-1).some((e=>e.func(t)))&&e[e.length-1].func(t)}(0,s.registerOperation)(o,a,l)},4679:(e,t,r)=>{"use strict";t.__esModule=!0,t.createMenuFocusController=function(e,t){let r,l=-1;const h=(0,n.createFocusNavigator)(t),u=e=>()=>{r.isOpened()&&r.getKeyboardShortcutsCtrl().listen(a),h.setCurrentPage(t.indexOf(e))};function c(e){const n=r.getKeyboardShortcutsCtrl(),u=e.getKeyboardShortcutsCtrl();h.clear(),u.addCustomShortcuts([{keys:[["Tab"],["Shift","Tab"]],forwardToContext:n.getContext(a),callback:()=>{e.isSubMenu()&&e.close(),n.listen(a)}}]),e.isSubMenu()||n.addCustomShortcuts([{keys:[["Tab"],["Shift","Tab"]],callback:e=>{const t=r.getNavigator();t.getCurrentPage()>-1&&(l=t.getCurrentPage()),t.clear(),e.shiftKey?h.toPreviousItem():h.toNextItem()}},{keys:[["Escape"]],callback:()=>{r.close()}},{keys:[["Enter"],["Space"]],preventDefault:!1,callback:e=>{const r=t[h.getCurrentPage()];r instanceof s.SelectUI&&(r.openOptions(),e.preventDefault()),r instanceof o.LinkUI&&(r.activate(),e.preventDefault()),r instanceof i.BaseUI||e.preventDefault()}}],a)}function d(e){e.addLocalHook("afterSelectionChange",(e=>{e.key.startsWith("filter_")||h.clear()})),e.addLocalHook("afterSubmenuOpen",c),e.addLocalHook("afterOpen",c),r=e}return t.forEach((e=>{e instanceof i.BaseUI&&(e.addLocalHook("click",u(e)),e.addLocalHook("focus",u(e)),e.addLocalHook("afterClose",u(e)))})),d(e),{...h,listen:function(){r.focus(),r.getKeyboardShortcutsCtrl().listen(a)},setMenu:d,getMenu:function(){return r},getLastMenuPage:function(){return l}}},r(14846),r(69655);var n=r(98666),s=r(71620),i=r(69942),o=r(34688);const a="filters"},98666:(e,t,r)=>{"use strict";t.__esModule=!0,t.createFocusNavigator=function(e){return(0,n.createPaginator)({initialPage:0,size:()=>e.length,onItemSelect:(t,r)=>{const n=e[t];return n instanceof i.MultipleSelectUI?r:!(n.element&&!(0,s.isVisible)(n.element))&&void n.focus()}})};var n=r(27453),s=r(62577),i=r(68312)},69942:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0;var s=n(r(85707)),i=r(25499),o=n(r(16050)),a=n(r(3849)),l=r(62577),h=r(10587),u=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=c(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var o=s?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(n,i,o):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n}(r(23384));function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(c=function(e){return e?r:t})(e)}const d="built",p="building",g=["click","input","keydown","keypress","keyup","focus","blur","change"];class f{static get DEFAULTS(){return(0,i.clone)({className:"",value:"",tagName:"div",children:[],wrapIt:!0})}constructor(e,t){(0,s.default)(this,"hot",void 0),(0,s.default)(this,"eventManager",new a.default(this)),(0,s.default)(this,"options",void 0),(0,s.default)(this,"_element",void 0),(0,s.default)(this,"buildState",void 0),this.hot=e,this.options=(0,i.extend)(f.DEFAULTS,t),this._element=this.hot.rootDocument.createElement(this.options.wrapIt?"div":this.options.tagName)}setValue(e){this.options.value=e,this.update()}getValue(){return this.options.value}get element(){return this.buildState===p?this._element:this.buildState===d?(this.update(),this._element):(this.buildState=p,this.build(),this.buildState=d,this._element)}isBuilt(){return this.buildState===d}translateIfPossible(e){return"string"==typeof e&&e.startsWith(u.FILTERS_NAMESPACE)?this.hot.getTranslatedPhrase(e):e}build(){const e=(e,t)=>{this.eventManager.addEventListener(e,t,(e=>this.runLocalHooks(t,e,this)))};if(this.buildState||(this.buildState=p),this._element.setAttribute("data-hot-input",!0),void 0!==this.options.tabIndex&&this._element.setAttribute("tabindex",this.options.tabIndex),void 0!==this.options.role&&this._element.setAttribute("role",this.options.role),this.options.className&&(0,l.addClass)(this._element,this.options.className),this.options.children.length)(0,h.arrayEach)(this.options.children,(e=>this._element.appendChild(e.element)));else if(this.options.wrapIt){const t=this.hot.rootDocument.createElement(this.options.tagName);t.setAttribute("data-hot-input",!0),(0,i.objectEach)(this.options,((e,r)=>{void 0!==t[r]&&"className"!==r&&"tagName"!==r&&"children"!==r&&(t[r]=this.translateIfPossible(e))})),this._element.appendChild(t),(0,h.arrayEach)(g,(r=>e(t,r)))}else(0,h.arrayEach)(g,(t=>e(this._element,t)))}update(){}reset(){this.options.value="",this.update()}show(){this.element.style.display=""}hide(){this.element.style.display="none"}focus(){}destroy(){this.eventManager.destroy(),this.eventManager=null,this.hot=null,this._element.parentNode&&this._element.parentNode.removeChild(this._element),this._element=null}}t.BaseUI=f,(0,i.mixin)(f,o.default)},24054:(e,t,r)=>{"use strict";t.__esModule=!0,r(67834);var n=r(62577),s=r(25499),i=r(69942);function o(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function a(e,t){return e.get(l(e,t))}function l(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var h=new WeakMap,u=new WeakSet;class c extends i.BaseUI{static get DEFAULTS(){return(0,s.clone)({placeholder:"",type:"text",tagName:"input",tabIndex:-1})}constructor(e,t){var r,n;super(e,(0,s.extend)(c.DEFAULTS,t)),o(r=this,n=u),n.add(r),function(e,t,r){o(e,t),t.set(e,r)}(this,h,void 0),this.registerHooks()}registerHooks(){this.addLocalHook("keyup",(e=>l(u,this,d).call(this,e)))}build(){super.build();const e=this.hot.rootDocument.createElement("div");var t,r,s;t=h,r=this,s=this._element.firstChild,t.set(l(t,r),s),(0,n.addClass)(this._element,"htUIInput"),(0,n.addClass)(e,"htUIInputIcon"),this._element.appendChild(e),this.update()}update(){this.isBuilt()&&(a(h,this).type=this.options.type,a(h,this).placeholder=this.translateIfPossible(this.options.placeholder),a(h,this).value=this.translateIfPossible(this.options.value))}focus(){this.isBuilt()&&a(h,this).focus()}}function d(e){this.options.value=e.target.value}t.InputUI=c},34688:(e,t,r)=>{"use strict";t.__esModule=!0,r(67834);var n=r(25499),s=r(69942);function i(e,t,r){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}function o(e,t){return e.get(a(e,t))}function a(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var l=new WeakMap;class h extends s.BaseUI{static get DEFAULTS(){return(0,n.clone)({href:"#",tagName:"a",tabIndex:-1,role:"button"})}constructor(e,t){super(e,(0,n.extend)(h.DEFAULTS,t)),i(this,l,void 0)}build(){var e,t,r;super.build(),e=l,t=this,r=this._element.firstChild,e.set(a(e,t),r)}update(){this.isBuilt()&&(o(l,this).textContent=this.translateIfPossible(this.options.textContent))}focus(){this.isBuilt()&&o(l,this).focus()}activate(){o(l,this).click()}}t.LinkUI=h},68312:(e,t,r)=>{"use strict";t.__esModule=!0,r(67834),r(15724),r(14846),r(27458),r(69655),r(94364);var n=r(62577),s=r(25499),i=r(83445),o=r(89804),a=r(87124),l=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=g(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var o=s?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(n,i,o):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n}(r(23384)),h=r(77661),u=r(69942),c=r(24054),d=r(34688),p=r(87094);function g(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(g=function(e){return e?r:t})(e)}function f(e,t,r){m(e,t),t.set(e,r)}function m(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function y(e,t){return e.get(w(e,t))}function E(e,t,r){return e.set(w(e,t),r),r}function w(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}const C="multipleSelect.itemBox";var v=new WeakMap,R=new WeakMap,S=new WeakMap,T=new WeakMap,N=new WeakMap,M=new WeakMap,_=new WeakSet;class b extends u.BaseUI{static get DEFAULTS(){return(0,s.clone)({className:"htUIMultipleSelect",value:[]})}constructor(e,t){var r,n;super(e,(0,s.extend)(b.DEFAULTS,t)),m(r=this,n=_),n.add(r),f(this,v,[]),f(this,R,void 0),f(this,S,void 0),f(this,T,void 0),f(this,N,void 0),f(this,M,void 0),E(T,this,new c.InputUI(this.hot,{placeholder:l.FILTERS_BUTTONS_PLACEHOLDER_SEARCH,className:"htUIMultipleSelectSearch"})),E(N,this,new d.LinkUI(this.hot,{textContent:l.FILTERS_BUTTONS_SELECT_ALL,className:"htUISelectAll"})),E(M,this,new d.LinkUI(this.hot,{textContent:l.FILTERS_BUTTONS_CLEAR,className:"htUIClearAll"})),this.registerHooks()}getItemsBox(){return y(R,this)}registerHooks(){y(T,this).addLocalHook("keydown",(e=>w(_,this,A).call(this,e))),y(T,this).addLocalHook("input",(e=>w(_,this,O).call(this,e))),y(N,this).addLocalHook("click",(e=>w(_,this,I).call(this,e))),y(M,this).addLocalHook("click",(e=>w(_,this,x).call(this,e)))}setItems(e){var t;E(v,this,e),null===(t=y(R,this))||void 0===t||t.loadData(y(v,this))}setLocale(e){E(S,this,e)}getLocale(){return y(S,this)}getItems(){return[...y(v,this)]}getValue(){return function(e){const t=[];return e.forEach((e=>{e.checked&&t.push(e.value)})),t}(y(v,this))}getSearchInputElement(){return y(T,this)}getSelectAllElement(){return y(N,this)}getClearAllElement(){return y(M,this)}isSelectedAllValues(){return y(v,this).length===this.getValue().length}build(){super.build();const{rootDocument:e}=this.hot,t=e.createElement("div"),r=new u.BaseUI(this.hot,{className:"htUISelectionControls",children:[y(N,this),y(M,this)]});this._element.appendChild(y(T,this).element),this._element.appendChild(r.element),this._element.appendChild(t);const s=t=>{var r;if(!this._element)return;null===(r=y(R,this))||void 0===r||r.destroy(),(0,n.addClass)(t,"htUIMultipleSelectHot"),E(R,this,new this.hot.constructor(t,{data:y(v,this),columns:[{data:"checked",type:"checkbox",label:{property:"visualValue",position:"after"}}],beforeRenderer:(e,t,r,n,s,i)=>{e.title=i.instance.getDataAtRowProp(t,i.label.property)},afterListen:()=>{this.runLocalHooks("focus",this)},beforeOnCellMouseUp:()=>{y(R,this).listen()},colWidths:()=>y(R,this).container.scrollWidth-(0,n.getScrollbarWidth)(e),maxCols:1,autoWrapCol:!0,height:110,copyPaste:!1,disableVisualSelection:"area",fillHandle:!1,fragmentSelection:"cell",tabMoves:{row:1,col:0},themeName:this.hot.getCurrentThemeName(),layoutDirection:this.hot.isRtl()?"rtl":"ltr"})),y(R,this).init(),this.hot.addHook("afterSetTheme",((e,t)=>{t||y(R,this).useTheme(e)}));const s=y(R,this).getShortcutManager().getContext("grid");s.removeShortcutsByKeys(["Tab"]),s.removeShortcutsByKeys(["Shift","Tab"]),s.addShortcut({keys:[["Escape"]],callback:e=>{this.runLocalHooks("keydown",e,this)},group:C}),s.addShortcut({keys:[["Tab"],["Shift","Tab"]],callback:e=>{y(R,this).deselectCell(),this.runLocalHooks("keydown",e,this),this.runLocalHooks("listTabKeydown",e,this)},group:C})};s(t),this.hot._registerTimeout((()=>s(t)),100)}focus(){this.isBuilt()&&y(R,this).listen()}reset(){y(T,this).reset(),y(N,this).reset(),y(M,this).reset()}update(){this.isBuilt()&&(y(R,this).loadData(function(e,t){const r=(0,p.createArrayAssertion)(t);return e.map((e=>(e.checked=r(e.value),e)))}(y(v,this),this.options.value)),super.update())}destroy(){var e;null===(e=y(R,this))||void 0===e||e.destroy(),y(T,this).destroy(),y(M,this).destroy(),y(N,this).destroy(),E(T,this,null),E(M,this,null),E(N,this,null),E(R,this,null),E(v,this,null),super.destroy()}}function O(e){const t=e.target.value.toLocaleLowerCase(this.getLocale());let r;r=""===t?[...y(v,this)]:y(v,this).filter((e=>`${e.value}`.toLocaleLowerCase(this.getLocale()).indexOf(t)>=0)),y(R,this).loadData(r)}function A(e){this.runLocalHooks("keydown",e,this);(0,o.partial)(i.isKey,e.keyCode)("ARROW_DOWN")&&(e.preventDefault(),(0,h.stopImmediatePropagation)(e),y(R,this).listen(),y(R,this).selectCell(0,0))}function I(e){const t=[];e.preventDefault(),y(R,this).getSourceData().forEach(((e,r)=>{e.checked=!0,t.push((0,a.dataRowToChangesArray)(e,r)[0])})),y(R,this).setSourceDataAtCell(t)}function x(e){const t=[];e.preventDefault(),y(R,this).getSourceData().forEach(((e,r)=>{e.checked=!1,t.push((0,a.dataRowToChangesArray)(e,r)[0])})),y(R,this).setSourceDataAtCell(t)}t.MultipleSelectUI=b;t.default=b},63433:(e,t,r)=>{"use strict";t.__esModule=!0,r(67834);var n=r(25499),s=r(69942);function i(e,t,r){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}function o(e,t){return e.get(l(e,t))}function a(e,t,r){return e.set(l(e,t),r),r}function l(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var h=new WeakMap,u=new WeakMap;class c extends s.BaseUI{static get DEFAULTS(){return(0,n.clone)({type:"radio",tagName:"input",className:"htUIRadio",label:{}})}constructor(e,t){super(e,(0,n.extend)(c.DEFAULTS,t)),i(this,h,void 0),i(this,u,void 0)}build(){super.build();const e=this.hot.rootDocument.createElement("label");e.textContent=this.translateIfPossible(this.options.label.textContent),e.htmlFor=this.translateIfPossible(this.options.label.htmlFor),a(u,this,e),a(h,this,this._element.firstChild),o(h,this).checked=this.options.checked,this._element.appendChild(e),this.update()}update(){this.isBuilt()&&(o(u,this).textContent=this.translateIfPossible(this.options.label.textContent))}isChecked(){return!!this.isBuilt()&&o(h,this).checked}setChecked(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.isBuilt()&&(o(h,this).checked=e)}focus(){this.isBuilt()&&o(h,this).focus()}}t.RadioInputUI=c},71620:(e,t,r)=>{"use strict";t.__esModule=!0,r(67834);var n=r(57446),s=r(25499),i=r(10587),o=r(62577),a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=c(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var o=s?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(n,i,o):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n}(r(23384)),l=r(30889),h=r(69942),u=r(71120);function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(c=function(e){return e?r:t})(e)}function d(e,t,r){p(e,t),t.set(e,r)}function p(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function g(e,t,r){return e.set(m(e,t),r),r}function f(e,t){return e.get(m(e,t))}function m(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var y=new WeakMap,E=new WeakMap,w=new WeakMap,C=new WeakMap,v=new WeakMap,R=new WeakSet;class S extends h.BaseUI{static get DEFAULTS(){return(0,s.clone)({className:"htUISelect",wrapIt:!1,tabIndex:-1})}constructor(e,t){var r,n;super(e,(0,s.extend)(S.DEFAULTS,t)),p(r=this,n=R),n.add(r),d(this,y,null),d(this,E,[]),d(this,w,void 0),d(this,C,void 0),d(this,v,void 0),this.registerHooks()}getMenu(){return f(y,this)}registerHooks(){this.addLocalHook("click",(()=>m(R,this,M).call(this)))}setItems(e){g(E,this,this.translateNames(e)),f(y,this)&&f(y,this).setMenuItems(f(E,this))}translateNames(e){return(0,i.arrayEach)(e,(e=>{e.name=this.translateIfPossible(e.name)})),e}build(){super.build(),g(y,this,new n.Menu(this.hot,{className:"htSelectUI htFiltersConditionsMenu",keepInViewport:!1,standalone:!0,container:this.options.menuContainer})),f(y,this).setMenuItems(f(E,this));const e=new h.BaseUI(this.hot,{className:"htUISelectCaption"}),t=new h.BaseUI(this.hot,{className:"htUISelectDropdown"});g(w,this,e),g(C,this,e.element),g(v,this,t),this.hot.getSettings().ariaTags&&((0,o.setAttribute)(t.element,[(0,u.A11Y_HIDDEN)()]),(0,o.setAttribute)(this._element,[(0,u.A11Y_LISTBOX)()])),(0,i.arrayEach)([e,t],(e=>this._element.appendChild(e.element))),f(y,this).addLocalHook("select",(e=>m(R,this,T).call(this,e))),f(y,this).addLocalHook("afterClose",(()=>m(R,this,N).call(this))),this.update()}update(){if(!this.isBuilt())return;let e;e=this.options.value?this.options.value.name:f(y,this).hot.getTranslatedPhrase(a.FILTERS_CONDITIONS_NONE),f(C,this).textContent=e,super.update()}openOptions(){const e=this.element.getBoundingClientRect();f(y,this)&&(f(y,this).open(),f(y,this).setPosition({left:this.hot.isLtr()?e.left-5:e.left-31,top:e.top-1,width:e.width,height:e.height}),f(y,this).getNavigator().toFirstItem(),f(y,this).getKeyboardShortcutsCtrl().addCustomShortcuts([{keys:[["Tab"],["Shift","Tab"]],callback:e=>{this.closeOptions(),this.runLocalHooks("tabKeydown",e)}},{keys:[["Control/Meta","A"]],callback:()=>!1}]))}closeOptions(){f(y,this)&&f(y,this).close()}focus(){this.isBuilt()&&this.element.focus()}destroy(){f(y,this)&&(f(y,this).destroy(),g(y,this,null)),f(w,this)&&f(w,this).destroy(),f(v,this)&&f(v,this).destroy(),super.destroy()}}function T(e){e.name!==l.SEPARATOR&&(this.options.value=e,this.update(),this.runLocalHooks("select",this.options.value))}function N(){this.runLocalHooks("afterClose")}function M(){this.openOptions()}t.SelectUI=S},87094:(e,t,r)=>{"use strict";t.__esModule=!0,t.createArrayAssertion=i,t.intersectValues=function(e,t,r,n){const o=[],a=e===t;let l;a||(l=i(t));return e.forEach((e=>{let t=!1;(a||l(e))&&(t=!0);const i={checked:t,value:e,visualValue:s(e,r)};n&&n(i),o.push(i)})),o},t.sortComparison=function(e,t){if("number"==typeof e&&"number"==typeof t)return e-t;return n(e,t)},t.toEmptyString=o,t.toVisualValue=s,t.unifyColumnValues=function(e){return Array.from(new Set(e)).map((e=>o(e))).sort(((e,t)=>"number"==typeof e&&"number"==typeof t?e-t:e===t?0:e>t?1:-1))},r(15724),r(71336),r(41558),r(17663),r(68630),r(79645),r(89858),r(8620),r(14846),r(69655),r(94364);const n=(0,r(85992).getComparisonFunction)();function s(e,t){let r=e;return""===r&&(r=`(${t})`),r}function i(e){const t=new Set(e);return function(e){return t.has(e)}}function o(e){return null==e?"":e}},37765:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,t.getRegisteredHotInstances=function(e){var t;const r=c(),n=0===r.size?[]:Array.from(null!==(t=r.get(e))&&void 0!==t?t:[]);return new Map(n.map((e=>[e.getPlugin("formulas").sheetId,e])))},t.registerCustomFunctions=g,t.registerEngine=p,t.registerLanguage=f,t.registerNamedExpressions=m,t.setupEngine=function(e){const t=e.getSettings(),r=t[h.PLUGIN_KEY],n=null==r?void 0:r.engine;if(!0===r)return null;if((0,i.isUndefined)(n))return null;var s;if("function"==typeof n.hyperformula||"function"==typeof n)return p(null!==(s=n.hyperformula)&&void 0!==s?s:n,t,e);if("object"==typeof n&&(0,i.isUndefined)(n.hyperformula)){const t=c(),r=d().get(n);return t.has(n)||t.set(n,[]),t.get(n).push(e),r&&r.push(e.guid),n.getConfig().licenseKey||n.updateConfig({licenseKey:u.DEFAULT_LICENSE_KEY}),n.getConfig().leapYear1900===u.DEFAULT_SETTINGS.leapYear1900&&!1!==(0,l.isObjectEqual)(n.getConfig().nullDate,u.DEFAULT_SETTINGS.nullDate)||(0,a.warn)(o.toSingleLine`If you use HyperFormula with Handsontable, keep the default \`leapYear1900\` and \`nullDate\` + settings. Otherwise, HyperFormula's dates may not sync correctly with Handsontable's dates.`),n}return null},t.setupSheet=function(e,t){!(0,i.isUndefined)(t)&&e.doesSheetExist(t)||(t=e.addSheet(t));return t},t.unregisterEngine=function(e,t){if(e){const r=c(),n=r.get(e),s=d(),i=s.get(e);n&&n.includes(t)&&(n.splice(n.indexOf(t),1),0===n.length&&r.delete(e)),i&&i.includes(t.guid)&&(i.splice(i.indexOf(t.guid),1),0===i.length&&(s.delete(e),e.destroy()))}},r(15724),r(14846),r(69655),r(94364);var s=n(r(28651)),i=r(70505),o=r(21595),a=r(14859),l=r(25499),h=r(94344),u=r(6701);function c(){const e="engine_relationship",t=(0,s.default)(h.PLUGIN_KEY);return t.hasItem(e)||t.register(e,new Map),t.getItem(e)}function d(){const e="shared_engine_usage",t=(0,s.default)(h.PLUGIN_KEY);return t.hasItem(e)||t.register(e,new Map),t.getItem(e)}function p(e,t,r){const n=t[h.PLUGIN_KEY],s=(0,u.getEngineSettingsWithDefaultsAndOverrides)(t),i=c(),o=d();g(e,n.functions),f(e,n.language);const a=e.buildEmpty(s);return i.set(a,[r]),o.set(a,[r.guid]),m(a,n.namedExpressions),a.on("sheetAdded",(()=>{a.rebuildAndRecalculate()})),a.on("sheetRemoved",(()=>{a.rebuildAndRecalculate()})),a}function g(e,t){t&&t.forEach((t=>{const{name:r,plugin:n,translations:s}=t;try{e.registerFunction(r,n,s)}catch(e){(0,a.warn)(e.message)}}))}function f(e,t){if(t){const{langCode:r}=t;try{e.registerLanguage(r,t)}catch(e){(0,a.warn)(e.message)}}}function m(e,t){t&&(e.suspendEvaluation(),t.forEach((t=>{const{name:r,expression:n,scope:s,options:i}=t;try{e.addNamedExpression(r,n,s,i)}catch(e){(0,a.warn)(e.message)}})),e.resumeEvaluation())}},6701:(e,t,r)=>{"use strict";t.__esModule=!0,t.getEngineSettingsOverrides=o,t.getEngineSettingsWithDefaultsAndOverrides=function(e){var t;const r=e[n.PLUGIN_KEY],s=a(null!=r&&null!==(t=r.engine)&&void 0!==t&&t.hyperformula?r.engine:{}),l=o(e);return{...i,...s,...l}},t.getEngineSettingsWithOverrides=function(e){var t;const r=e[n.PLUGIN_KEY],s=a(null!=r&&null!==(t=r.engine)&&void 0!==t&&t.hyperformula?r.engine:{}),i=o(e);return{...s,...i}},t.haveEngineSettingsChanged=function(e,t){return Object.keys(t).some((r=>void 0!==t[r]&&t[r]!==e[r]))},r(14846),r(90458),r(75568);var n=r(94344);const s=t.DEFAULT_LICENSE_KEY="internal-use-in-handsontable",i=t.DEFAULT_SETTINGS={licenseKey:s,useArrayArithmetic:!0,useColumnIndex:!1,useStats:!1,evaluateNullToZero:!0,precisionEpsilon:1e-13,precisionRounding:14,smartRounding:!0,leapYear1900:!1,nullDate:{year:1899,month:12,day:30},nullYear:30,dateFormats:["DD/MM/YYYY","DD/MM/YY"],timeFormats:["hh:mm","hh:mm:ss.sss"],matchWholeCell:!0,useRegularExpressions:!1,useWildcards:!0,functionArgSeparator:",",thousandSeparator:"",decimalSeparator:".",language:"enGB"};function o(e){var t;return{maxColumns:e.maxColumns,maxRows:e.maxRows,language:null===(t=e[n.PLUGIN_KEY])||void 0===t||null===(t=t.language)||void 0===t?void 0:t.langCode}}function a(e){return Object.keys(e).reduce(((t,r)=>("hyperformula"!==r&&(t[r]=e[r]),t)),{})}},94344:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834),r(15724),r(66184),r(71336),r(41558),r(17663),r(68630),r(79645),r(89858),r(8620),r(14846),r(63333),r(6211),r(69655),r(94364);var s=n(r(85707)),i=r(75089),o=n(r(28651)),a=r(14859),l=r(22137),h=r(70505),u=r(37765),c=r(59070),d=r(6701),p=r(87124),g=r(5893),f=r(28197),m=n(r(51556));function y(e,t,r){E(e,t),t.set(e,r)}function E(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function w(e,t,r){return e.set(v(e,t),r),r}function C(e,t){return e.get(v(e,t))}function v(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}const R=t.PLUGIN_KEY="formulas",S=t.SETTING_KEYS=["maxRows","maxColumns","language"],T=t.PLUGIN_PRIORITY=260;f.Hooks.getSingleton().register("afterNamedExpressionAdded"),f.Hooks.getSingleton().register("afterNamedExpressionRemoved"),f.Hooks.getSingleton().register("afterSheetAdded"),f.Hooks.getSingleton().register("afterSheetRemoved"),f.Hooks.getSingleton().register("afterSheetRenamed"),f.Hooks.getSingleton().register("afterFormulasValuesUpdate");const N=e=>"UndoRedo.undo"===e||"UndoRedo.redo"===e||"auto"===e;var M=new WeakMap,_=new WeakMap,b=new WeakMap,O=new WeakSet;class A extends i.BasePlugin{constructor(){var e,t,r;super(...arguments),e=this,E(t=this,r=O),r.add(t),y(this,M,!1),y(this,_,!1),y(this,b,[["valuesUpdated",function(){for(var t=arguments.length,r=new Array(t),n=0;n{this.hot.addHookOnce("init",(()=>{e()}))})),this.rowAxisSyncer=this.indexSyncer.getForAxis("row"),this.columnAxisSyncer=this.indexSyncer.getForAxis("column"),this.hot.addHook("afterRowSequenceChange",this.rowAxisSyncer.getIndexesChangeSyncMethod()),this.hot.addHook("afterColumnSequenceChange",this.columnAxisSyncer.getIndexesChangeSyncMethod()),this.hot.addHook("beforeRowMove",((e,t,r,n)=>{this.rowAxisSyncer.storeMovesInformation(e,t,n)})),this.hot.addHook("beforeColumnMove",((e,t,r,n)=>{this.columnAxisSyncer.storeMovesInformation(e,t,n)})),this.hot.addHook("afterRowMove",((e,t,r,n,s)=>{this.rowAxisSyncer.calculateAndSyncMoves(n,s)})),this.hot.addHook("afterColumnMove",((e,t,r,n,s)=>{this.columnAxisSyncer.calculateAndSyncMoves(n,s)})),this.hot.addHook("beforeColumnFreeze",((e,t)=>{this.columnAxisSyncer.storeMovesInformation([e],this.hot.getSettings().fixedColumnsStart,t)})),this.hot.addHook("afterColumnFreeze",((e,t)=>{this.columnAxisSyncer.calculateAndSyncMoves(t,t)})),this.hot.addHook("beforeColumnUnfreeze",((e,t)=>{this.columnAxisSyncer.storeMovesInformation([e],this.hot.getSettings().fixedColumnsStart-1,t)})),this.hot.addHook("afterColumnUnfreeze",((e,t)=>{this.columnAxisSyncer.calculateAndSyncMoves(t,t)})),this.addHook("afterCellMetaReset",(function(){for(var e=arguments.length,r=new Array(e),n=0;n{this.indexSyncer.setPerformUndo(!0),this.engine.undo()})),this.addHook("beforeRedo",(()=>{this.indexSyncer.setPerformRedo(!0),this.engine.redo()})),this.addHook("afterUndo",(()=>{this.indexSyncer.setPerformUndo(!1)})),this.addHook("afterUndo",(()=>{this.indexSyncer.setPerformRedo(!1)})),this.addHook("afterDetachChild",(function(){for(var e=arguments.length,r=new Array(e),n=0;n{let[t,r]=e;return this.engine.on(t,r)})),super.enablePlugin()}else(0,a.warn)("Missing the required `engine` key in the Formulas settings. Please fill it with either an engine class or an engine instance.")}disablePlugin(){C(b,this).forEach((e=>{let[t,r]=e;return this.engine.off(t,r)})),(0,u.unregisterEngine)(this.engine,this.hot),this.engine=null,super.disablePlugin()}updatePlugin(e){const t=(0,d.getEngineSettingsWithOverrides)(this.hot.getSettings());(0,d.haveEngineSettingsChanged)(this.engine.getConfig(),t)&&this.engine.updateConfig(t);const r=this.hot.getSettings()[R];if((0,h.isDefined)(r)&&(0,h.isDefined)(r.sheetName)&&r.sheetName!==this.sheetName&&this.switchSheet(r.sheetName),!e.data&&null===this.sheetName){const e=this.hot.getSettings()[R].sheetName;e&&this.engine.doesSheetExist(e)?this.switchSheet(this.sheetName):this.sheetName=this.addSheet(null!=e?e:void 0,this.hot.getSourceDataArray())}super.updatePlugin(e)}destroy(){C(b,this).forEach((e=>{var t;let[r,n]=e;return null===(t=this.engine)||void 0===t?void 0:t.off(r,n)})),w(b,this,null),(0,u.unregisterEngine)(this.engine,this.hot),this.engine=null,super.destroy()}addSheet(e,t){if((0,h.isDefined)(t)&&!(0,p.isArrayOfArrays)(t))return(0,a.warn)("The provided data should be an array of arrays."),!1;if(null!=e&&this.engine.doesSheetExist(e))return(0,a.warn)("Sheet with the provided name already exists."),!1;try{const r=this.engine.addSheet(null!=e?e:void 0);return t&&this.engine.setSheetContent(this.engine.getSheetId(r),t),r}catch(e){return(0,a.warn)(e.message),!1}}switchSheet(e){if(!this.engine.doesSheetExist(e))return void(0,a.error)(`The sheet named \`${e}\` does not exist, switch aborted.`);this.sheetName=e;const t=this.engine.getSheetSerialized(this.sheetId);t.length>0&&this.hot.loadData(t,`${(0,g.toUpperCaseFirst)(R)}.switchSheet`)}getCellType(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.sheetId;const n=this.hot.toPhysicalRow(e),s=this.hot.toPhysicalColumn(t);return null!==n&&null!==s?this.engine.getCellType({sheet:r,row:this.rowAxisSyncer.getHfIndexFromVisualIndex(e),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(t)}):"EMPTY"}isFormulaCellType(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.sheetId;return this.engine.doesCellHaveFormula({sheet:r,row:this.rowAxisSyncer.getHfIndexFromVisualIndex(e),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(t)})}renderDependentSheets(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const r=new Set;e.forEach((e=>{var t;const n=null==e||null===(t=e.address)||void 0===t?void 0:t.sheet;void 0!==n&&(r.has(n)||r.add(n))})),(0,u.getRegisteredHotInstances)(this.engine).forEach(((e,n)=>{var s;(t||n!==this.sheetId)&&r.has(n)&&(e.render(),null===(s=e.view)||void 0===s||s.adjustElementsSize())}))}validateDependentCells(e){const t=e=>{var t;const{row:r,col:n,sheet:s}=null!==(t=null==e?void 0:e.address)&&void 0!==t?t:{};return(0,h.isDefined)(s)?`${s}:${r}x${n}`:""},r=new Set((arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]).map((e=>t(e))));e.forEach((e=>{var n,s;const{row:i,col:o}=null!==(n=e.address)&&void 0!==n?n:{};if(!1===(0,h.isDefined)(i)||!1===(0,h.isDefined)(o)||i>=this.hot.countRows()||o>=this.hot.countCols())return;const a=null==e||null===(s=e.address)||void 0===s?void 0:s.sheet,l=t(e);if(void 0!==a&&!r.has(l)){const e=(0,u.getRegisteredHotInstances)(this.engine).get(a);if(!e)return;e.validateCell(e.getDataAtCell(i,o),e.getCellMeta(i,o),(()=>{}))}}))}syncChangeWithEngine(e,t,r){const n={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(e),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(t),sheet:this.sheetId};if(!this.engine.isItPossibleToSetCellContents(n))return void(0,a.warn)(`Not possible to set cell data at ${JSON.stringify(n)}`);const s=this.hot.getCellMeta(e,t);return(0,c.isDate)(r,s.type)&&((0,c.isDateValid)(r,s.dateFormat)?r=(0,c.getDateInHfFormat)(r,s.dateFormat):!1===(0,c.isFormula)(r)&&(r=`'${r}`)),this.engine.setCellContents(n,r)}}function I(e,t,r){const n=this.hot.propToCol(r);if(this.isFormulaCellType(t,n)){const e={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(t),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(n),sheet:this.sheetId},r=this.hot.getCellMeta(t,n);let s=this.engine.getCellValue(e);return"date"===r.type&&(0,l.isNumeric)(s)&&(s=(0,c.getDateFromExcelDate)(s,r.dateFormat)),"object"==typeof s&&null!==s?s.value:s}return e}function x(e,t,r){const{row:n,col:s}=t.getTopStartCorner(),{row:i,col:o}=t.getBottomEndCorner(),{row:a,col:l}=r.getTopStartCorner(),{row:h,col:u}=r.getBottomEndCorner(),d={start:{row:this.rowAxisSyncer.getHfIndexFromVisualIndex(n),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(s),sheet:this.sheetId},end:{row:this.rowAxisSyncer.getHfIndexFromVisualIndex(i),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(o),sheet:this.sheetId}},p={start:{row:this.rowAxisSyncer.getHfIndexFromVisualIndex(a),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(l),sheet:this.sheetId},end:{row:this.rowAxisSyncer.getHfIndexFromVisualIndex(h),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(u),sheet:this.sheetId}};if(!1===this.engine.isItPossibleToSetCellContents(p))return!1;const g=this.engine.getFillRangeData(d,p),{row:f,col:m}=d.start,{row:y,col:E}=d.end,w=y-f+1,C=E-m+1;for(let e=0;e2&&void 0!==arguments[2]?arguments[2]:"").includes((0,g.toUpperCaseFirst)(R))||w(_,this,(0,h.isUndefined)(this.hot.getSettings().data))}function L(){const e=this.hot.getSourceDataArray();let t=!1;e.forEach(((r,n)=>{r.forEach(((r,s)=>{const i=this.hot.getCellMeta(n,s),o=i.dateFormat;(0,c.isDate)(r,i.type)&&(t=!0,(0,c.isDateValid)(r,o)?e[n][s]=(0,c.getDateInHfFormat)(r,o):!1===this.isFormulaCellType(n,s)&&(e[n][s]=`'${r}`))}))})),!0===t&&(w(M,this,!0),this.engine.setSheetContent(this.sheetId,e),w(M,this,!1))}function D(e,t){if(!(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"").includes((0,g.toUpperCaseFirst)(R)))if(this.sheetName=(0,u.setupSheet)(this.engine,this.hot.getSettings()[R].sheetName),C(_,this))this.switchSheet(this.sheetName);else{const e=this.hot.getSourceDataArray();if(this.engine.isItPossibleToReplaceSheetContent(this.sheetId,e)){w(M,this,!0);const t=this.engine.setSheetContent(this.sheetId,e);this.indexSyncer.setupSyncEndpoint(this.engine,this.sheetId),this.renderDependentSheets(t),w(M,this,!1)}}}function k(e,t,r,n){if("get"!==n||C(M,this)||null===this.sheetName||!this.engine.doesSheetExist(this.sheetName))return;const s=this.hot.toVisualRow(e);if(null===s||null===t)return;if(!this.isFormulaCellType(s,t)){if("ARRAY"!==this.getCellType(s,t))return void((0,c.isEscapedFormulaExpression)(r.value)&&(r.value=(0,c.unescapeFormulaExpression)(r.value)))}const i={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(s),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(t),sheet:this.sheetId};let o=this.engine.getCellValue(i),a=this.hot.getCellsMeta().find((e=>e.visualRow===s&&e.visualCol===t));void 0===a&&(a={}),"date"===a.type&&(0,l.isNumeric)(o)&&(o=(0,c.getDateFromExcelDate)(o,a.dateFormat));const h="object"==typeof o&&null!==o?o.value:o;r.value=h}function H(e,t,r,n){if("get"!==n||C(M,this)||null===this.sheetName||!this.engine.doesSheetExist(this.sheetName))return;const s=this.hot.toVisualRow(e),i=this.hot.propToCol(t);if(null===s||null===i)return;if(!this.isFormulaCellType(s,i)){if("ARRAY"!==this.getCellType(s,i))return}const o=this.engine.getSheetDimensions(this.engine.getSheetId(this.sheetName));if(0===o.width&&0===o.height)return;const a={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(s),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(i),sheet:this.sheetId};r.value=this.engine.getCellSerialized(a)}function F(e,t){if(N(t))return;const r=[],n=[],s=this.engine.batch((()=>{e.forEach((e=>{let[t,s,,i]=e;const o=this.hot.propToCol(s),a=this.hot.toPhysicalRow(t),l=this.hot.toPhysicalColumn(o),h={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(t),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(o),sheet:this.sheetId};null!==a&&null!==l?this.syncChangeWithEngine(t,o,i):r.push([t,o,i]),n.push({address:h})}))}));r.length&&this.hot.addHookOnce("afterChange",(()=>{const e=this.engine.batch((()=>{r.forEach((e=>{let[t,r,n]=e;this.syncChangeWithEngine(t,r,n)}))}));this.renderDependentSheets(e,!0)})),this.renderDependentSheets(s),this.validateDependentCells(s,n)}function U(e,t){if(N(t))return;const r=[],n=[];e.forEach((e=>{let[t,s,,i]=e;const o=this.hot.propToCol(s);if(!(0,l.isNumeric)(o))return;const h={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(t),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(o),sheet:this.sheetId};this.engine.isItPossibleToSetCellContents(h)?(n.push({address:h}),r.push(...this.engine.setCellContents(h,i))):(0,a.warn)(`Not possible to set source cell data at ${JSON.stringify(h)}`)})),this.renderDependentSheets(r),this.validateDependentCells(r,n)}function V(e,t){let r=this.rowAxisSyncer.getHfIndexFromVisualIndex(e);if(e>=this.hot.countRows()&&(r=e),null===this.sheetId||!this.engine.doesSheetExist(this.sheetName)||!this.engine.isItPossibleToAddRows(this.sheetId,[r,t]))return!1}function B(e,t){let r=this.columnAxisSyncer.getHfIndexFromVisualIndex(e);if(e>=this.hot.countCols()&&(r=e),null===this.sheetId||!this.engine.doesSheetExist(this.sheetName)||!this.engine.isItPossibleToAddColumns(this.sheetId,[r,t]))return!1}function W(e,t,r){return!1!==this.rowAxisSyncer.setRemovedHfIndexes(r).every((e=>this.engine.isItPossibleToRemoveRows(this.sheetId,[e,1])))&&void 0}function Y(e,t,r){return!1!==this.columnAxisSyncer.setRemovedHfIndexes(r).every((e=>this.engine.isItPossibleToRemoveColumns(this.sheetId,[e,1])))&&void 0}function G(e,t,r){if(N(r))return;const n=this.engine.addRows(this.sheetId,[this.rowAxisSyncer.getHfIndexFromVisualIndex(e),t]);this.renderDependentSheets(n)}function j(e,t,r){if(N(r))return;const n=this.engine.addColumns(this.sheetId,[this.columnAxisSyncer.getHfIndexFromVisualIndex(e),t]);this.renderDependentSheets(n)}function z(e,t,r,n){if(N(n))return;const s=this.rowAxisSyncer.getRemovedHfIndexes().sort(((e,t)=>t-e)),i=this.engine.batch((()=>{s.forEach((e=>{this.engine.removeRows(this.sheetId,[e,1])}))}));this.renderDependentSheets(i)}function $(e,t,r,n){if(N(n))return;const s=this.columnAxisSyncer.getRemovedHfIndexes().sort(((e,t)=>t-e)),i=this.engine.batch((()=>{s.forEach((e=>{this.engine.removeColumns(this.sheetId,[e,1])}))}));this.renderDependentSheets(i)}function K(e,t,r){var n;w(M,this,!0);const s=this.hot.getSourceDataArray(r,0,r+((null===(n=t.__children)||void 0===n?void 0:n.length)||0),this.hot.countSourceCols());w(M,this,!1),s.forEach(((e,t)=>{e.forEach(((e,n)=>{this.engine.setCellContents({col:n,row:r+t,sheet:this.sheetId},[[e]])}))}))}function X(e){this.hot.runHooks("afterFormulasValuesUpdate",e)}function q(e,t){this.hot.runHooks("afterNamedExpressionAdded",e,t)}function Q(e,t){this.hot.runHooks("afterNamedExpressionRemoved",e,t)}function Z(e){this.hot.runHooks("afterSheetAdded",e)}function J(e,t){this.sheetName=t,this.hot.runHooks("afterSheetRenamed",e,t)}function ee(e,t){this.hot.runHooks("afterSheetRemoved",e,t)}t.Formulas=A},84291:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(94344);t.PLUGIN_KEY=n.PLUGIN_KEY,t.PLUGIN_PRIORITY=n.PLUGIN_PRIORITY,t.Formulas=n.Formulas},98967:(e,t,r)=>{"use strict";t.__esModule=!0,r(67834),r(15724),r(14846),r(69655),r(94364);var n=r(5893),s=r(4980);function i(e,t,r){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}function o(e,t){return e.get(l(e,t))}function a(e,t,r){return e.set(l(e,t),r),r}function l(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var h=new WeakMap,u=new WeakMap,c=new WeakMap,d=new WeakMap,p=new WeakMap,g=new WeakMap,f=new WeakMap;t.default=class{constructor(e,t,r){i(this,h,void 0),i(this,u,void 0),i(this,c,void 0),i(this,d,[]),i(this,p,[]),i(this,g,void 0),i(this,f,[]),a(h,this,e),a(u,this,t),a(c,this,r)}setRemovedHfIndexes(e){return a(f,this,e.map((e=>{const t=o(u,this).getVisualFromPhysicalIndex(e);return this.getHfIndexFromVisualIndex(t)}))),o(f,this)}getRemovedHfIndexes(){return o(f,this)}getHfIndexFromVisualIndex(e){const t=o(u,this).getIndexesSequence(),r=o(u,this).getNotTrimmedIndexes();return t.indexOf(r[e])}syncMoves(e){const t=`move${(0,n.toUpperCaseFirst)(o(h,this))}s`;o(c,this).getEngine().batch((()=>{e.forEach((e=>{const r=e.from!==e.to,n=e.from+1!==e.to;r&&n&&o(c,this).getEngine()[t](o(c,this).getSheetId(),e.from,1,e.to)}))}))}storeMovesInformation(e,t,r){!1!==r&&(a(p,this,e.map((e=>this.getHfIndexFromVisualIndex(e)))),a(g,this,this.getHfIndexFromVisualIndex(t)))}calculateAndSyncMoves(e,t){if(o(c,this).isPerformingUndoRedo())return;if(!1===e||!1===t)return;const r=(0,s.getMoves)(o(p,this),o(g,this),o(u,this).getNumberOfIndexes());null===o(c,this).getSheetId()?o(c,this).getPostponeAction((()=>this.syncMoves(r))):this.syncMoves(r)}getIndexesChangeSyncMethod(){const e=`set${(0,n.toUpperCaseFirst)(o(h,this))}Order`;return t=>{if(o(c,this).isPerformingUndoRedo())return;const r=o(u,this).getIndexesSequence();if("update"===t&&r.length>0){const t=o(d,this).map((e=>r.indexOf(e))),n=o(c,this).getEngine().getSheetDimensions(o(c,this).getSheetId());let s;s="row"===o(h,this)?n.height:n.width;for(let e=t.length;e{"use strict";var n=r(96784);t.__esModule=!0,r(67834);var s=n(r(98967));function i(e,t,r){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}function o(e,t){return e.get(l(e,t))}function a(e,t,r){return e.set(l(e,t),r),r}function l(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var h=new WeakMap,u=new WeakMap,c=new WeakMap,d=new WeakMap,p=new WeakMap,g=new WeakMap,f=new WeakMap;t.default=class{constructor(e,t,r){i(this,h,void 0),i(this,u,void 0),i(this,c,void 0),i(this,d,!1),i(this,p,!1),i(this,g,null),i(this,f,null),a(h,this,new s.default("row",e,this)),a(u,this,new s.default("column",t,this)),a(c,this,r)}getForAxis(e){return o("row"===e?h:u,this)}setPerformUndo(e){a(d,this,e)}setPerformRedo(e){a(p,this,e)}isPerformingUndoRedo(){return o(d,this)||o(p,this)}getSheetId(){return o(f,this)}getEngine(){return o(g,this)}getPostponeAction(){return o(c,this)}setupSyncEndpoint(e,t){a(g,this,e),a(f,this,t),o(h,this).init(),o(u,this).init()}}},59070:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,t.getDateFromExcelDate=function(e,t){const r=new Date(Date.UTC(0,0,e+-1));return(0,s.default)(r).format(t)},t.getDateInHfFormat=function(e,t){return(0,s.default)(e,t,!0).format(i)},t.getDateInHotFormat=function(e,t){return(0,s.default)(e,i,!0).format(t)},t.isDate=function(e,t){return"string"==typeof e&&"date"===t},t.isDateValid=function(e,t){return(0,s.default)(e,t,!0).isValid()},t.isEscapedFormulaExpression=o,t.isFormula=function(e){return"string"==typeof e&&e.startsWith("=")},t.unescapeFormulaExpression=function(e){return o(e)?e.substr(1):e};var s=n(r(6671));const i="DD/MM/YYYY";function o(e){return"string"==typeof e&&"'"===e.charAt(0)&&"="===e.charAt(1)}},79349:(e,t,r)=>{"use strict";t.__esModule=!0,t.default=function(e){return{key:"hidden_columns_hide",name(){const e=this.getSelectedLast();let t=0;if(Array.isArray(e)){const[,r,,n]=e;r-n!=0&&(t=1)}return this.getTranslatedPhrase(n.CONTEXTMENU_ITEMS_HIDE_COLUMN,t)},callback(){const{from:t,to:r}=this.getSelectedRangeLast(),n=Math.max(Math.min(t.col,r.col),0),s=Math.max(t.col,r.col),i=[];for(let e=n;e<=s;e+=1)i.push(e);e.hideColumns(i);const o=i[i.length-1],a=this.columnIndexMapper.getNearestNotHiddenIndex(o,1,!0);Number.isInteger(a)&&a>=0?this.selectColumns(a):this.deselectCell(),this.render(),this.view.adjustElementsSize()},disabled:!1,hidden(){return!(this.selection.isSelectedByColumnHeader()||this.selection.isSelectedByCorner())}}},r(15724);var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=s(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(r(23384));function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(s=function(e){return e?r:t})(e)}},24048:(e,t,r)=>{"use strict";t.__esModule=!0,t.default=function(e){const t=[];return{key:"hidden_columns_show",name(){const e=t.length>1?1:0;return this.getTranslatedPhrase(s.CONTEXTMENU_ITEMS_SHOW_COLUMN,e)},callback(){var r,n;if(0===t.length)return;let s=t[0],i=t[t.length-1];s=null!==(r=this.columnIndexMapper.getNearestNotHiddenIndex(s-1,-1))&&void 0!==r?r:0,i=null!==(n=this.columnIndexMapper.getNearestNotHiddenIndex(i+1,1))&&void 0!==n?n:this.countCols()-1,e.showColumns(t),this.render(),this.view.adjustElementsSize();i-s+1===this.countCols()||this.selectColumns(s,i)},disabled:!1,hidden(){const r=(0,n.arrayMap)(e.getHiddenColumns(),(e=>this.toPhysicalColumn(e)));if(!this.selection.isSelectedByColumnHeader()&&!this.selection.isSelectedByCorner()||r.length<1)return!0;t.length=0;const s=this.getSelectedRangeLast(),i=s.getTopStartCorner().col,o=s.getBottomEndCorner().col,a=this.columnIndexMapper,l=a.getRenderableFromVisualIndex(i),h=a.getRenderableFromVisualIndex(o),u=a.getNotTrimmedIndexes(),c=[];if(i!==o){if(o-i+1>h-l+1){const e=u.slice(i,o+1);c.push(...e.filter((e=>r.includes(e))))}}else if(0===l&&lo&&c.push(...u.slice(o+1))}return(0,n.arrayEach)(c,(e=>{t.push(this.toVisualColumn(e))})),0===t.length}}},r(15724),r(14846),r(27458);var n=r(10587),s=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=i(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=s?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(r(23384));function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(i=function(e){return e?r:t})(e)}},312:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834),r(15724),r(71336),r(41558),r(17663),r(68630),r(79645),r(89858),r(8620),r(14846),r(63333),r(94364);var s=r(75089),i=r(62577),o=r(22137),a=r(10587),l=r(30889),h=r(28197),u=n(r(79349)),c=n(r(24048)),d=r(61149);function p(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function g(e,t){return e.get(m(e,t))}function f(e,t,r){return e.set(m(e,t),r),r}function m(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}h.Hooks.getSingleton().register("beforeHideColumns"),h.Hooks.getSingleton().register("afterHideColumns"),h.Hooks.getSingleton().register("beforeUnhideColumns"),h.Hooks.getSingleton().register("afterUnhideColumns");const y=t.PLUGIN_KEY="hiddenColumns",E=t.PLUGIN_PRIORITY=310;var w=new WeakMap,C=new WeakSet;class v extends s.BasePlugin{constructor(){var e,t;super(...arguments),p(e=this,t=C),t.add(e),function(e,t,r){p(e,t),t.set(e,r)}(this,w,null)}static get PLUGIN_KEY(){return y}static get PLUGIN_PRIORITY(){return E}static get DEFAULT_SETTINGS(){return{copyPasteEnabled:!0,indicators:!1,columns:[]}}isEnabled(){return!!this.hot.getSettings()[y]}enablePlugin(){var e=this;this.enabled||(f(w,this,new d.HidingMap),g(w,this).addLocalHook("init",(()=>m(C,this,_).call(this))),this.hot.columnIndexMapper.registerMap(this.pluginName,g(w,this)),this.addHook("afterContextMenuDefaultOptions",(function(){for(var t=arguments.length,r=new Array(t),n=0;nm(C,this,S).call(this,e,t,r))),this.addHook("modifyColWidth",((e,t)=>m(C,this,R).call(this,e,t)),2),this.addHook("afterGetColHeader",(function(){for(var t=arguments.length,r=new Array(t),n=0;nm(C,this,T).call(this,e))),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.hot.columnIndexMapper.unregisterMap(this.pluginName),super.disablePlugin(),this.resetCellsMeta()}showColumns(e){const t=this.getHiddenColumns(),r=this.isValidConfig(e);let n=t;const s=g(w,this).getValues().slice(),i=e.length>0;if(r&&i){const t=e.map((e=>this.hot.toPhysicalColumn(e)));(0,a.arrayEach)(t,(e=>{s[e]=!1})),n=(0,a.arrayReduce)(s,((e,t,r)=>(t&&e.push(this.hot.toVisualColumn(r)),e)),[])}!1!==this.hot.runHooks("beforeUnhideColumns",t,n,r&&i)&&(r&&i&&g(w,this).setValues(s),this.hot.view.adjustElementsSize(),this.hot.runHooks("afterUnhideColumns",t,n,r&&i,r&&n.length{(0,a.arrayEach)(e,(e=>{g(w,this).setValueAtIndex(this.hot.toPhysicalColumn(e),!0)}))}),!0),this.hot.runHooks("afterHideColumns",t,n,r,r&&n.length>t.length))}hideColumn(){for(var e=arguments.length,t=new Array(e),r=0;rthis.hot.toVisualColumn(e)))}isHidden(e){return g(w,this).getValueAtIndex(this.hot.toPhysicalColumn(e))||!1}isValidConfig(e){const t=this.hot.countCols();return!!(Array.isArray(e)&&e.length>0)&&e.every((e=>Number.isInteger(e)&&e>=0&&e{e.skipColumnOnPaste=!1}))}destroy(){f(w,this,null),super.destroy()}}function R(e,t){return this.isHidden(t)?0:this.getSetting("indicators")&&(this.isHidden(t+1)||this.isHidden(t-1))&&"number"==typeof e&&this.hot.hasColHeaders()?e+15:void 0}function S(e,t,r){if(!1===this.getSetting("copyPasteEnabled")&&this.isHidden(t)&&(r.skipColumnOnPaste=!0),this.isHidden(t-1))r.className=r.className||"",-1===r.className.indexOf("afterHiddenColumn")&&(r.className+=" afterHiddenColumn");else if(r.className){const e=r.className.split(" ");if(e.length>0){const t=e.indexOf("afterHiddenColumn");t>-1&&e.splice(t,1),r.className=e.join(" ")}}}function T(e){if(this.getSetting("copyPasteEnabled"))return e;const t=[],r=(e,r,n,s)=>{t.push({startRow:e,endRow:r,startCol:n,endCol:s})};return(0,a.arrayEach)(e,(e=>{let t=!0,n=0;(0,o.rangeEach)(e.startCol,e.endCol,(s=>{this.isHidden(s)?(t||r(e.startRow,e.endRow,n,s-1),t=!0):(t&&(n=s),s===e.endCol&&r(e.startRow,e.endRow,n,s),t=!1)}))})),t}function N(e,t){if(!this.getSetting("indicators")||e<0)return;const r=[];e>=1&&this.isHidden(e-1)&&r.push("afterHiddenColumn"),e{"use strict";t.__esModule=!0;var n=r(312);t.PLUGIN_KEY=n.PLUGIN_KEY,t.PLUGIN_PRIORITY=n.PLUGIN_PRIORITY,t.HiddenColumns=n.HiddenColumns},54565:(e,t,r)=>{"use strict";t.__esModule=!0,t.default=function(e){return{key:"hidden_rows_hide",name(){const e=this.getSelectedLast();let t=0;if(Array.isArray(e)){const[r,,n]=e;r-n!=0&&(t=1)}return this.getTranslatedPhrase(n.CONTEXTMENU_ITEMS_HIDE_ROW,t)},callback(){const{from:t,to:r}=this.getSelectedRangeLast(),n=Math.max(Math.min(t.row,r.row),0),s=Math.max(t.row,r.row),i=[];for(let e=n;e<=s;e+=1)i.push(e);e.hideRows(i);const o=i[i.length-1],a=this.rowIndexMapper.getNearestNotHiddenIndex(o,1,!0);Number.isInteger(a)&&a>=0?this.selectRows(a):this.deselectCell(),this.render(),this.view.adjustElementsSize()},disabled:!1,hidden(){return!(this.selection.isSelectedByRowHeader()||this.selection.isSelectedByCorner())}}},r(15724);var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=s(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(r(23384));function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(s=function(e){return e?r:t})(e)}},93602:(e,t,r)=>{"use strict";t.__esModule=!0,t.default=function(e){const t=[];return{key:"hidden_rows_show",name(){const e=t.length>1?1:0;return this.getTranslatedPhrase(s.CONTEXTMENU_ITEMS_SHOW_ROW,e)},callback(){var r,n;if(0===t.length)return;let s=t[0],i=t[t.length-1];s=null!==(r=this.rowIndexMapper.getNearestNotHiddenIndex(s-1,-1))&&void 0!==r?r:0,i=null!==(n=this.rowIndexMapper.getNearestNotHiddenIndex(i+1,1))&&void 0!==n?n:this.countRows()-1,e.showRows(t),this.render(),this.view.adjustElementsSize();i-s+1===this.countRows()||this.selectRows(s,i)},disabled:!1,hidden(){const r=(0,n.arrayMap)(e.getHiddenRows(),(e=>this.toPhysicalRow(e)));if(!this.selection.isSelectedByRowHeader()&&!this.selection.isSelectedByCorner()||r.length<1)return!0;t.length=0;const s=this.getSelectedRangeLast(),i=s.getTopStartCorner().row,o=s.getBottomEndCorner().row,a=this.rowIndexMapper,l=a.getRenderableFromVisualIndex(i),h=a.getRenderableFromVisualIndex(o),u=a.getNotTrimmedIndexes(),c=[];if(i!==o){if(o-i+1>h-l+1){const e=u.slice(i,o+1);c.push(...e.filter((e=>r.includes(e))))}}else if(0===l&&lo&&c.push(...u.slice(o+1))}return(0,n.arrayEach)(c,(e=>{t.push(this.toVisualRow(e))})),0===t.length}}},r(15724),r(14846),r(27458);var n=r(10587),s=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=i(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=s?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(r(23384));function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(i=function(e){return e?r:t})(e)}},60568:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834),r(15724),r(71336),r(41558),r(17663),r(68630),r(79645),r(89858),r(8620),r(14846),r(63333),r(94364);var s=r(75089),i=r(62577),o=r(22137),a=r(10587),l=r(30889),h=r(28197),u=n(r(54565)),c=n(r(93602)),d=r(61149);function p(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function g(e,t){return e.get(m(e,t))}function f(e,t,r){return e.set(m(e,t),r),r}function m(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}h.Hooks.getSingleton().register("beforeHideRows"),h.Hooks.getSingleton().register("afterHideRows"),h.Hooks.getSingleton().register("beforeUnhideRows"),h.Hooks.getSingleton().register("afterUnhideRows");const y=t.PLUGIN_KEY="hiddenRows",E=t.PLUGIN_PRIORITY=320;var w=new WeakMap,C=new WeakSet;class v extends s.BasePlugin{constructor(){var e,t;super(...arguments),p(e=this,t=C),t.add(e),function(e,t,r){p(e,t),t.set(e,r)}(this,w,null)}static get PLUGIN_KEY(){return y}static get PLUGIN_PRIORITY(){return E}static get DEFAULT_SETTINGS(){return{copyPasteEnabled:!0,indicators:!1,rows:[]}}isEnabled(){return!!this.hot.getSettings()[y]}enablePlugin(){var e=this;this.enabled||(f(w,this,new d.HidingMap),g(w,this).addLocalHook("init",(()=>m(C,this,_).call(this))),this.hot.rowIndexMapper.registerMap(this.pluginName,g(w,this)),this.addHook("afterContextMenuDefaultOptions",(function(){for(var t=arguments.length,r=new Array(t),n=0;nm(C,this,S).call(this,e,t,r))),this.addHook("modifyRowHeight",((e,t)=>m(C,this,R).call(this,e,t))),this.addHook("afterGetRowHeader",(function(){for(var t=arguments.length,r=new Array(t),n=0;nm(C,this,T).call(this,e))),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.hot.rowIndexMapper.unregisterMap(this.pluginName),super.disablePlugin(),this.resetCellsMeta()}showRows(e){const t=this.getHiddenRows(),r=this.isValidConfig(e);let n=t;const s=g(w,this).getValues().slice(),i=e.length>0;if(r&&i){const t=e.map((e=>this.hot.toPhysicalRow(e)));(0,a.arrayEach)(t,(e=>{s[e]=!1})),n=(0,a.arrayReduce)(s,((e,t,r)=>(t&&e.push(this.hot.toVisualRow(r)),e)),[])}!1!==this.hot.runHooks("beforeUnhideRows",t,n,r&&i)&&(r&&i&&g(w,this).setValues(s),this.hot.runHooks("afterUnhideRows",t,n,r&&i,r&&n.length{(0,a.arrayEach)(e,(e=>{g(w,this).setValueAtIndex(this.hot.toPhysicalRow(e),!0)}))}),!0),this.hot.runHooks("afterHideRows",t,n,r,r&&n.length>t.length))}hideRow(){for(var e=arguments.length,t=new Array(e),r=0;rthis.hot.toVisualRow(e)))}isHidden(e){return g(w,this).getValueAtIndex(this.hot.toPhysicalRow(e))||!1}isValidConfig(e){const t=this.hot.countRows();return!!(Array.isArray(e)&&e.length>0)&&e.every((e=>Number.isInteger(e)&&e>=0&&e{e.skipRowOnPaste=!1}))}destroy(){f(w,this,null),super.destroy()}}function R(e,t){return this.isHidden(t)?0:e}function S(e,t,r){if(!1===this.getSetting("copyPasteEnabled")&&this.isHidden(e)&&(r.skipRowOnPaste=!0),this.isHidden(e-1))r.className=r.className||"",-1===r.className.indexOf("afterHiddenRow")&&(r.className+=" afterHiddenRow");else if(r.className){const e=r.className.split(" ");if(e.length>0){const t=e.indexOf("afterHiddenRow");t>-1&&e.splice(t,1),r.className=e.join(" ")}}}function T(e){if(this.getSetting("copyPasteEnabled"))return e;const t=[],r=(e,r,n,s)=>{t.push({startRow:e,endRow:r,startCol:n,endCol:s})};return(0,a.arrayEach)(e,(e=>{let t=!0,n=0;(0,o.rangeEach)(e.startRow,e.endRow,(s=>{this.isHidden(s)?(t||r(n,s-1,e.startCol,e.endCol),t=!0):(t&&(n=s),s===e.endRow&&r(n,s,e.startCol,e.endCol),t=!1)}))})),t}function N(e,t){if(!this.getSetting("indicators")||e<0)return;const r=[];e>=1&&this.isHidden(e-1)&&r.push("afterHiddenRow"),e{"use strict";t.__esModule=!0;var n=r(60568);t.PLUGIN_KEY=n.PLUGIN_KEY,t.PLUGIN_PRIORITY=n.PLUGIN_PRIORITY,t.HiddenRows=n.HiddenRows},50927:(e,t,r)=>{"use strict";t.__esModule=!0,t.registerAllPlugins=function(){(0,F.registerPlugin)(n.AutoColumnSize),(0,F.registerPlugin)(s.Autofill),(0,F.registerPlugin)(i.AutoRowSize),(0,F.registerPlugin)(a.BindRowsWithHeaders),(0,F.registerPlugin)(l.CollapsibleColumns),(0,F.registerPlugin)(h.ColumnSorting),(0,F.registerPlugin)(u.ColumnSummary),(0,F.registerPlugin)(c.Comments),(0,F.registerPlugin)(d.ContextMenu),(0,F.registerPlugin)(p.CopyPaste),(0,F.registerPlugin)(g.CustomBorders),(0,F.registerPlugin)(f.DragToScroll),(0,F.registerPlugin)(m.DropdownMenu),(0,F.registerPlugin)(y.ExportFile),(0,F.registerPlugin)(E.Filters),(0,F.registerPlugin)(w.Formulas),(0,F.registerPlugin)(C.HiddenColumns),(0,F.registerPlugin)(v.HiddenRows),(0,F.registerPlugin)(R.ManualColumnFreeze),(0,F.registerPlugin)(S.ManualColumnMove),(0,F.registerPlugin)(T.ManualColumnResize),(0,F.registerPlugin)(N.ManualRowMove),(0,F.registerPlugin)(M.ManualRowResize),(0,F.registerPlugin)(_.MergeCells),(0,F.registerPlugin)(b.MultiColumnSorting),(0,F.registerPlugin)(O.MultipleSelectionHandles),(0,F.registerPlugin)(A.NestedHeaders),(0,F.registerPlugin)(I.NestedRows),(0,F.registerPlugin)(x.PersistentState),(0,F.registerPlugin)(P.Search),(0,F.registerPlugin)(L.StretchColumns),(0,F.registerPlugin)(D.TouchScroll),(0,F.registerPlugin)(k.TrimRows),(0,F.registerPlugin)(H.UndoRedo)};var n=r(49912);t.AutoColumnSize=n.AutoColumnSize;var s=r(32894);t.Autofill=s.Autofill;var i=r(27864);t.AutoRowSize=i.AutoRowSize;var o=r(75089);t.BasePlugin=o.BasePlugin;var a=r(816);t.BindRowsWithHeaders=a.BindRowsWithHeaders;var l=r(96987);t.CollapsibleColumns=l.CollapsibleColumns;var h=r(51206);t.ColumnSorting=h.ColumnSorting;var u=r(66518);t.ColumnSummary=u.ColumnSummary;var c=r(85290);t.Comments=c.Comments;var d=r(92560);t.ContextMenu=d.ContextMenu;var p=r(88980);t.CopyPaste=p.CopyPaste;var g=r(60402);t.CustomBorders=g.CustomBorders;var f=r(47126);t.DragToScroll=f.DragToScroll;var m=r(81658);t.DropdownMenu=m.DropdownMenu;var y=r(99364);t.ExportFile=y.ExportFile;var E=r(80971);t.Filters=E.Filters;var w=r(84291);t.Formulas=w.Formulas;var C=r(28511);t.HiddenColumns=C.HiddenColumns;var v=r(53437);t.HiddenRows=v.HiddenRows;var R=r(29583);t.ManualColumnFreeze=R.ManualColumnFreeze;var S=r(12597);t.ManualColumnMove=S.ManualColumnMove;var T=r(52536);t.ManualColumnResize=T.ManualColumnResize;var N=r(85391);t.ManualRowMove=N.ManualRowMove;var M=r(25014);t.ManualRowResize=M.ManualRowResize;var _=r(75501);t.MergeCells=_.MergeCells;var b=r(76941);t.MultiColumnSorting=b.MultiColumnSorting;var O=r(98129);t.MultipleSelectionHandles=O.MultipleSelectionHandles;var A=r(11859);t.NestedHeaders=A.NestedHeaders;var I=r(58886);t.NestedRows=I.NestedRows;var x=r(56326);t.PersistentState=x.PersistentState;var P=r(64296);t.Search=P.Search;var L=r(25392);t.StretchColumns=L.StretchColumns;var D=r(51958);t.TouchScroll=D.TouchScroll;var k=r(47237);t.TrimRows=k.TrimRows;var H=r(79262);t.UndoRedo=H.UndoRedo;var F=r(74672);t.registerPlugin=F.registerPlugin,t.getPlugin=F.getPlugin,t.getPluginsNames=F.getPluginsNames},8514:(e,t,r)=>{"use strict";t.__esModule=!0,t.default=function(e){return{key:"freeze_column",name(){return this.getTranslatedPhrase(n.CONTEXTMENU_ITEMS_FREEZE_COLUMN)},callback(t,r){const[{start:{col:n}}]=r;e.freezeColumn(n),this.render(),this.view.adjustElementsSize()},hidden(){const e=this.getSelectedRange();let t=!1;return(void 0===e||e.length>1||e[0].from.col!==e[0].to.col||e[0].from.col<=this.getSettings().fixedColumnsStart-1)&&(t=!0),t}}};var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=s(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(r(23384));function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(s=function(e){return e?r:t})(e)}},93433:(e,t,r)=>{"use strict";t.__esModule=!0,t.default=function(e){return{key:"unfreeze_column",name(){return this.getTranslatedPhrase(n.CONTEXTMENU_ITEMS_UNFREEZE_COLUMN)},callback(t,r){const[{start:{col:n}}]=r;e.unfreezeColumn(n),this.render(),this.view.adjustElementsSize()},hidden(){const e=this.getSelectedRange();let t=!1;return(void 0===e||e.length>1||e[0].from.col!==e[0].to.col||e[0].from.col>=this.getSettings().fixedColumnsStart)&&(t=!0),t}}};var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=s(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}(r(23384));function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(s=function(e){return e?r:t})(e)}},29583:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(35096);t.PLUGIN_KEY=n.PLUGIN_KEY,t.PLUGIN_PRIORITY=n.PLUGIN_PRIORITY,t.ManualColumnFreeze=n.ManualColumnFreeze},35096:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834),r(15724),r(14846),r(75568);var s=r(75089),i=r(28197),o=n(r(8514)),a=n(r(93433));function l(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function h(e,t){return e.get(c(e,t))}function u(e,t,r){return e.set(c(e,t),r),r}function c(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}i.Hooks.getSingleton().register("beforeColumnFreeze"),i.Hooks.getSingleton().register("afterColumnFreeze"),i.Hooks.getSingleton().register("beforeColumnUnfreeze"),i.Hooks.getSingleton().register("afterColumnUnfreeze");const d=t.PLUGIN_KEY="manualColumnFreeze",p=t.PLUGIN_PRIORITY=110;var g=new WeakMap,f=new WeakSet;class m extends s.BasePlugin{constructor(){var e,t;super(...arguments),l(e=this,t=f),t.add(e),function(e,t,r){l(e,t),t.set(e,r)}(this,g,!1)}static get PLUGIN_KEY(){return d}static get PLUGIN_PRIORITY(){return p}isEnabled(){return!!this.hot.getSettings()[d]}enablePlugin(){this.enabled||(this.addHook("afterContextMenuDefaultOptions",(e=>c(f,this,y).call(this,e))),this.addHook("beforeColumnMove",((e,t)=>c(f,this,E).call(this,e,t))),super.enablePlugin())}disablePlugin(){u(g,this,!1),super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}freezeColumn(e){const t=this.hot.getSettings(),r=t.fixedColumnsStartt.fixedColumnsStart-1;h(g,this)||u(g,this,!0);!1!==this.hot.runHooks("beforeColumnFreeze",e,r)&&(r&&(this.hot.columnIndexMapper.moveIndexes(e,t.fixedColumnsStart),t._fixedColumnsStart+=1),this.hot.runHooks("afterColumnFreeze",e,r))}unfreezeColumn(e){const t=this.hot.getSettings(),r=t.fixedColumnsStart>0&&e<=t.fixedColumnsStart-1;h(g,this)||u(g,this,!0);!1!==this.hot.runHooks("beforeColumnUnfreeze",e,r)&&(r&&(t._fixedColumnsStart-=1,this.hot.columnIndexMapper.moveIndexes(e,t.fixedColumnsStart)),this.hot.runHooks("afterColumnUnfreeze",e,r))}}function y(e){e.items.push({name:"---------"},(0,o.default)(this),(0,a.default)(this))}function E(e,t){if(h(g,this)){const r=this.hot.getSettings().fixedColumnsStart;if(te{"use strict";t.__esModule=!0;var n=r(37308);t.PLUGIN_KEY=n.PLUGIN_KEY,t.PLUGIN_PRIORITY=n.PLUGIN_PRIORITY,t.ManualColumnMove=n.ManualColumnMove},37308:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834),r(15724),r(14846),r(75568);var s=r(75089),i=r(28197),o=r(10587),a=r(62577),l=r(77661),h=r(22137),u=n(r(87177)),c=n(r(69234));function d(e,t,r){p(e,t),t.set(e,r)}function p(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function g(e,t,r){return e.set(m(e,t),r),r}function f(e,t){return e.get(m(e,t))}function m(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}i.Hooks.getSingleton().register("beforeColumnMove"),i.Hooks.getSingleton().register("afterColumnMove");const y=t.PLUGIN_KEY="manualColumnMove",E=t.PLUGIN_PRIORITY=120,w="ht__manualColumnMove",C="show-ui",v="on-moving--columns",R="after-selection--columns";var S=new WeakMap,T=new WeakMap,N=new WeakMap,M=new WeakMap,_=new WeakMap,b=new WeakMap,O=new WeakMap,A=new WeakMap,I=new WeakMap,x=new WeakMap,P=new WeakMap,L=new WeakSet;class D extends s.BasePlugin{constructor(){var e,t;super(...arguments),p(e=this,t=L),t.add(e),d(this,S,new u.default(this.hot)),d(this,T,new c.default(this.hot)),d(this,N,[]),d(this,M,0),d(this,_,!1),d(this,b,{}),d(this,O,void 0),d(this,A,void 0),d(this,I,void 0),d(this,x,void 0),d(this,P,void 0)}static get PLUGIN_KEY(){return y}static get PLUGIN_PRIORITY(){return E}isEnabled(){return!!this.hot.getSettings()[y]}enablePlugin(){var e=this;this.enabled||(this.addHook("beforeOnCellMouseDown",(function(){for(var t=arguments.length,r=new Array(t),n=0;nm(L,this,V).call(this))),this.addHook("afterLoadData",(function(){for(var t=arguments.length,r=new Array(t),n=0;nr,s=t<0,i=e.some((e=>e<0)),o=e.some((e=>e>=r));return!(n||s||i||o)}isColumnOrderChanged(e,t){return e.some(((e,r)=>e-r!==t))}countFinalIndex(e,t){const r=(0,o.arrayReduce)(e,((e,r)=>(r{r.push(e)})),r}refreshPositions(){const e=this.hot.view.getFirstFullyVisibleColumn();this.isFixedColumnsStart(f(A,this))&&e>0&&this.hot.scrollViewportTo({col:this.hot.columnIndexMapper.getNearestNotHiddenIndex(e-1,-1)});const t=this.hot.view._wt.wtTable,r=this.hot.view._wt.wtOverlays.scrollableElement,n="number"==typeof r.scrollX?r.scrollX:r.scrollLeft;let s=this.hot.view.THEAD.offsetLeft+this.getColumnsWidth(0,f(A,this)-1);const i=t.hider.offsetWidth,o=t.TBODY.offsetLeft,l=f(S,this).getOffset().start,h=f(S,this).getSize().width;let u=0,c=0;if(this.hot.isRtl()){const e=this.hot.rootWindow,t=(0,a.outerWidth)(this.hot.rootElement),s=e.innerWidth-f(I,this)-t;c=e.innerWidth-f(b,this).eventPageX-s-(void 0===r.scrollX?n:0)}else c=f(b,this).eventPageX-(f(I,this)-(void 0===r.scrollX?n:0));if(f(x,this)&&(u=this.hot.view._wt.wtOverlays.inlineStartOverlay.clone.wtTable.getColumnHeader(-1).offsetWidth),this.isFixedColumnsStart(f(A,this))&&(s+=n),s+=u,f(A,this)<0)f(P,this)>0?f(b,this).col=0:f(b,this).col=e>0?e-1:e;else if(f(b,this).TD.offsetWidth/2+s<=c){const e=f(A,this)>=f(M,this)?f(M,this)-1:f(A,this);f(b,this).col=e+1,s+=f(b,this).TD.offsetWidth}else f(b,this).col=f(A,this);let d=c,p=s;c+h+l>=i?d=i-h-l:c+l=i-1?p=i-1:0===p?p=1:void 0!==r.scrollX&&f(A,this)m(L,this,H).call(this,e))),this.eventManager.addEventListener(e,"mouseup",(()=>m(L,this,U).call(this)))}unregisterEvents(){this.eventManager.clear()}buildPluginUI(){f(S,this).build(),f(T,this).build()}destroy(){f(S,this).destroy(),f(T,this).destroy(),super.destroy()}}function k(e,t,r,n){const s=this.hot.view._wt.wtTable,i=this.hot.selection.isSelectedByColumnHeader(),o=this.hot.getSelectedRangeLast(),h=(0,a.hasClass)(e.target,"sortAction");if(!o||!i||f(_,this)||0!==e.button||h)return g(_,this,!1),f(N,this).length=0,void(0,a.removeClass)(this.hot.rootElement,[v,C]);const u=f(T,this).isBuilt()&&!f(T,this).isAppended(),c=f(S,this).isBuilt()&&!f(S,this).isAppended();u&&c&&(f(T,this).appendTo(s.hider),f(S,this).appendTo(s.hider));const{from:d,to:p}=o,m=Math.min(d.col,p.col),y=Math.max(d.col,p.col);if(t.row<0&&t.col>=m&&t.col<=y){n.column=!0,g(_,this,!0);const i=r.firstChild?(0,l.offsetRelativeTo)(e,r.firstChild).x:e.offsetX;f(b,this).eventPageX=e.pageX,g(A,this,t.col),f(b,this).TD=r,f(b,this).col=t.col,g(N,this,this.prepareColumnsToMoving(m,y)),g(x,this,!!this.hot.getSettings().rowHeaders),g(M,this,this.hot.countCols()),g(P,this,this.hot.getSettings().fixedColumnsStart),g(I,this,(0,a.offset)(this.hot.rootElement).left);const o=f(x,this)?-1:0,h=s.holder.scrollTop+s.getColumnHeaderHeight(0)+1,u=t.col-1?(0,a.removeClass)(this.hot.rootElement,C):(0,a.addClass)(this.hot.rootElement,C),n.row=!0,n.column=!0,n.cell=!0,g(A,this,t.col),f(b,this).TD=r)}function U(){const e=f(b,this).col,t=f(N,this).length;if(g(A,this,void 0),g(_,this,!1),(0,a.removeClass)(this.hot.rootElement,[v,C,R]),this.hot.selection.isSelectedByColumnHeader()&&(0,a.addClass)(this.hot.rootElement,R),t<1||void 0===e)return;const r=f(N,this)[0],n=this.hot.toPhysicalColumn(r),s=this.dragColumns(f(N,this),e);if(f(N,this).length=0,!0===s){this.persistentStateSave(),this.hot.render(),this.hot.view.adjustElementsSize();const e=this.hot.toVisualColumn(n),r=e+t-1;this.hot.selectColumns(e,r)}}function V(){const e=this.hot.view._wt.wtTable,t=e.getColumnHeaderHeight(0)+1+e.holder.scrollTop;f(S,this).setPosition(t),f(S,this).setSize(null,e.hider.offsetHeight-t)}function B(){this.moveBySettingsOrLoad()}t.ManualColumnMove=D},53976:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0;var s=n(r(85707)),i=r(22137),o=r(5893);const a="px";t.default=class{constructor(e){(0,s.default)(this,"hot",void 0),(0,s.default)(this,"_element",null),(0,s.default)(this,"state",0),(0,s.default)(this,"inlineProperty",void 0),this.hot=e,this.inlineProperty=e.isRtl()?"right":"left"}appendTo(e){e.appendChild(this._element),this.state=2}build(){0===this.state&&(this._element=this.hot.rootDocument.createElement("div"),this.state=1)}destroy(){this.isAppended()&&this._element.parentElement.removeChild(this._element),this._element=null,this.state=0}isAppended(){return 2===this.state}isBuilt(){return this.state>=1}setPosition(e,t){(0,i.isNumeric)(e)&&(this._element.style.top=e+a),(0,i.isNumeric)(t)&&(this._element.style[this.inlineProperty]=t+a)}getPosition(){const e=this._element.style;return{top:e.top?parseInt(e.top,10):0,start:e[this.inlineProperty]?parseInt(e[this.inlineProperty],10):0}}setSize(e,t){(0,i.isNumeric)(e)&&(this._element.style.width=e+a),(0,i.isNumeric)(t)&&(this._element.style.height=t+a)}getSize(){return{width:this._element.style.width?parseInt(this._element.style.width,10):0,height:this._element.style.height?parseInt(this._element.style.height,10):0}}setOffset(e,t){(0,i.isNumeric)(e)&&(this._element.style.marginTop=e+a),(0,i.isNumeric)(t)&&(this._element.style[`margin${(0,o.toUpperCaseFirst)(this.inlineProperty)}`]=t+a)}getOffset(){const e=this._element.style,t=`margin${(0,o.toUpperCaseFirst)(this.inlineProperty)}`;return{top:e.marginTop?parseInt(e.marginTop,10):0,start:e[t]?parseInt(e[t],10):0}}}},87177:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0;var s=n(r(53976)),i=r(62577);class o extends s.default{build(){super.build(),(0,i.addClass)(this._element,"ht__manualColumnMove--backlight")}}t.default=o},69234:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0;var s=n(r(53976)),i=r(62577);class o extends s.default{build(){super.build(),(0,i.addClass)(this._element,"ht__manualColumnMove--guideline")}}t.default=o},52536:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(50278);t.PLUGIN_KEY=n.PLUGIN_KEY,t.PLUGIN_PRIORITY=n.PLUGIN_PRIORITY,t.ManualColumnResize=n.ManualColumnResize},50278:(e,t,r)=>{"use strict";t.__esModule=!0,r(67834),r(15724),r(14846),r(69655);var n=r(75089),s=r(62577),i=r(10587),o=r(22137),a=r(61149);function l(e,t,r){h(e,t),t.set(e,r)}function h(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function u(e,t,r){return e.set(d(e,t),r),r}function c(e,t){return e.get(d(e,t))}function d(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}const p=t.PLUGIN_KEY="manualColumnResize",g=t.PLUGIN_PRIORITY=130,f="manualColumnWidths";var m=new WeakMap,y=new WeakMap,E=new WeakMap,w=new WeakMap,C=new WeakMap,v=new WeakMap,R=new WeakMap,S=new WeakMap,T=new WeakMap,N=new WeakMap,M=new WeakMap,_=new WeakMap,b=new WeakMap,O=new WeakMap,A=new WeakMap,I=new WeakMap,x=new WeakSet;class P extends n.BasePlugin{static get PLUGIN_KEY(){return p}static get PLUGIN_PRIORITY(){return g}constructor(e){var t,r;super(e),h(t=this,r=x),r.add(t),l(this,m,null),l(this,y,null),l(this,E,[]),l(this,w,null),l(this,C,null),l(this,v,null),l(this,R,null),l(this,S,null),l(this,T,this.hot.rootDocument.createElement("DIV")),l(this,N,this.hot.rootDocument.createElement("DIV")),l(this,M,null),l(this,_,!1),l(this,b,0),l(this,O,null),l(this,A,void 0),l(this,I,void 0),(0,s.addClass)(c(T,this),"manualColumnResizer"),(0,s.addClass)(c(N,this),"manualColumnResizerGuide")}get inlineDir(){return this.hot.isRtl()?"right":"left"}isEnabled(){return this.hot.getSettings()[p]}enablePlugin(){var e=this;this.enabled||(u(A,this,new a.PhysicalIndexToValueMap),c(A,this).addLocalHook("init",(()=>d(x,this,L).call(this))),this.hot.columnIndexMapper.registerMap(this.pluginName,c(A,this)),this.addHook("modifyColWidth",(function(){for(var t=arguments.length,r=new Array(t),n=0;n{const t=e.getTopStartCorner().col,r=e.getBottomEndCorner().col;(0,o.rangeEach)(t,r,(e=>{c(E,this).includes(e)||c(E,this).push(e)}))}))}c(E,this).includes(c(y,this))||u(E,this,[c(y,this)]),u(S,this,h.start-6),u(R,this,parseInt(l.width,10)),c(T,this).style.top=`${h.top}px`,c(T,this).style[this.inlineDir]=`${c(S,this)+c(R,this)}px`,c(T,this).style.height=`${a}px`,this.hot.rootElement.appendChild(c(T,this))}refreshHandlePosition(){c(T,this).style[this.inlineDir]=`${c(S,this)+c(w,this)}px`}setupGuidePosition(){const e=parseInt((0,s.outerHeight)(c(T,this)),10),t=parseInt(c(T,this).style.top,10)+e,r=parseInt(this.hot.view.maximumVisibleElementHeight(0),10);(0,s.addClass)(c(T,this),"active"),(0,s.addClass)(c(N,this),"active"),c(N,this).style.top=`${t}px`,this.refreshGuidePosition(),c(N,this).style.height=r-e+"px",this.hot.rootElement.appendChild(c(N,this))}refreshGuidePosition(){c(N,this).style[this.inlineDir]=c(T,this).style[this.inlineDir]}hideHandleAndGuide(){(0,s.removeClass)(c(T,this),"active"),(0,s.removeClass)(c(N,this),"active")}checkIfColumnHeader(e){const t=(0,s.closest)(e,["THEAD"],this.hot.rootElement),{topOverlay:r,topInlineStartCornerOverlay:n}=this.hot.view._wt.wtOverlays;return[r.clone.wtTable.THEAD,n.clone.wtTable.THEAD].includes(t)}getClosestTHParent(e){return"TABLE"!==e.tagName?"TH"===e.tagName?e:this.getClosestTHParent(e.parentNode):null}afterMouseDownTimeout(){const e=()=>{this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.adjustElementsSize()},t=(t,r)=>{const n=this.hot.runHooks("beforeColumnResize",c(C,this),t,!0);void 0!==n&&u(C,this,n),this.setManualSize(t,c(C,this)),this.saveManualColumnWidths(),this.hot.runHooks("afterColumnResize",c(C,this),t,!0),r&&e()};if(c(b,this)>=2){c(E,this).length>1?((0,i.arrayEach)(c(E,this),(e=>{t(e)})),e()):(0,i.arrayEach)(c(E,this),(e=>{t(e,!0)}))}u(b,this,0),u(O,this,null)}bindEvents(){const{rootWindow:e,rootElement:t}=this.hot;this.eventManager.addEventListener(t,"mouseover",(e=>d(x,this,D).call(this,e))),this.eventManager.addEventListener(t,"mousedown",(e=>d(x,this,k).call(this,e))),this.eventManager.addEventListener(e,"mousemove",(e=>d(x,this,H).call(this,e))),this.eventManager.addEventListener(e,"mouseup",(()=>d(x,this,F).call(this))),this.eventManager.addEventListener(c(T,this),"contextmenu",(()=>d(x,this,U).call(this)))}destroy(){super.destroy()}}function L(){const e=this.hot.getSettings()[p],t=this.loadManualColumnWidths();void 0!==t?this.hot.batchExecution((()=>{t.forEach(((e,t)=>{c(A,this).setValueAtIndex(t,e)}))}),!0):Array.isArray(e)?(this.hot.batchExecution((()=>{e.forEach(((e,t)=>{c(A,this).setValueAtIndex(t,e)}))}),!0),u(I,this,e)):!0===e&&Array.isArray(c(I,this))&&this.hot.batchExecution((()=>{c(I,this).forEach(((e,t)=>{c(A,this).setValueAtIndex(t,e)}))}),!0)}function D(e){if(!(0,s.isDetached)(e.target)&&!0!==c(_,this)&&this.checkIfColumnHeader(e.target)){const t=this.getClosestTHParent(e.target);if(!t)return;const r=t.getAttribute("colspan");!t||null!==r&&"1"!==r||c(M,this)||this.setupHandlePosition(t)}}function k(e){e.target.parentNode===this.hot.rootElement&&(0,s.hasClass)(e.target,"manualColumnResizer")&&(this.setupHandlePosition(c(m,this)),this.setupGuidePosition(),u(M,this,!0),null===c(O,this)&&(u(O,this,setTimeout((()=>this.afterMouseDownTimeout()),500)),this.hot._registerTimeout(c(O,this))),u(b,this,c(b,this)+1),this.startX=e.pageX,u(C,this,c(R,this)))}function H(e){if(c(M,this)){const t=(e.pageX-this.startX)*this.hot.getDirectionFactor();u(w,this,c(R,this)+t),(0,i.arrayEach)(c(E,this),(e=>{u(C,this,this.setManualSize(e,c(w,this)))})),this.refreshHandlePosition(),this.refreshGuidePosition()}}function F(){const e=()=>{this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.adjustElementsSize()},t=(t,r)=>{this.hot.runHooks("beforeColumnResize",c(C,this),t,!1),r&&e(),this.saveManualColumnWidths(),this.hot.runHooks("afterColumnResize",c(C,this),t,!1)};if(c(M,this)){if(this.hideHandleAndGuide(),u(M,this,!1),c(C,this)!==c(R,this)){c(E,this).length>1?((0,i.arrayEach)(c(E,this),(e=>{t(e)})),e()):(0,i.arrayEach)(c(E,this),(e=>{t(e,!0)}))}this.setupHandlePosition(c(m,this))}}function U(){this.hideHandleAndGuide(),this.hot.rootElement.removeChild(c(T,this)),this.hot.rootElement.removeChild(c(N,this)),u(M,this,!1),u(_,this,!0),this.hot._registerImmediate((()=>{u(_,this,!1)}))}function V(e,t){let r=e;if(this.enabled){const e=this.hot.toPhysicalColumn(t),n=c(A,this).getValueAtIndex(e);this.hot.getSettings()[p]&&n&&(r=n)}return r}function B(e,t){const r=c(A,this).getValueAtIndex(this.hot.toPhysicalColumn(t));return"number"==typeof r?r:e}function W(){this.hot.view._wt.wtViewport.resetHasOversizedColumnHeadersMarked()}t.ManualColumnResize=P},85391:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(68856);t.PLUGIN_KEY=n.PLUGIN_KEY,t.PLUGIN_PRIORITY=n.PLUGIN_PRIORITY,t.ManualRowMove=n.ManualRowMove},68856:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834),r(15724),r(14846),r(75568);var s=r(75089),i=r(28197),o=r(10587),a=r(62577),l=r(22137),h=n(r(12535)),u=n(r(8592));function c(e,t,r){d(e,t),t.set(e,r)}function d(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function p(e,t,r){return e.set(f(e,t),r),r}function g(e,t){return e.get(f(e,t))}function f(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}i.Hooks.getSingleton().register("beforeRowMove"),i.Hooks.getSingleton().register("afterRowMove");const m=t.PLUGIN_KEY="manualRowMove",y=t.PLUGIN_PRIORITY=140,E="ht__manualRowMove",w="show-ui",C="on-moving--rows",v="after-selection--rows";var R=new WeakMap,S=new WeakMap,T=new WeakMap,N=new WeakMap,M=new WeakMap,_=new WeakMap,b=new WeakSet;class O extends s.BasePlugin{constructor(){var e,t;super(...arguments),d(e=this,t=b),t.add(e),c(this,R,new h.default(this.hot)),c(this,S,new u.default(this.hot)),c(this,T,[]),c(this,N,void 0),c(this,M,{}),c(this,_,void 0)}static get PLUGIN_KEY(){return m}static get PLUGIN_PRIORITY(){return y}isEnabled(){return!!this.hot.getSettings()[m]}enablePlugin(){var e=this;this.enabled||(this.addHook("beforeOnCellMouseDown",(function(){for(var t=arguments.length,r=new Array(t),n=0;nf(b,this,L).call(this))),this.addHook("afterLoadData",(function(){for(var t=arguments.length,r=new Array(t),n=0;nr,s=t<0,i=e.some((e=>e<0)),o=e.some((e=>e>=r));return!(n||s||i||o)}isRowOrderChanged(e,t){return e.some(((e,r)=>e-r!==t))}countFinalIndex(e,t){const r=(0,o.arrayReduce)(e,((e,r)=>(rthis.hot.countRows()-1-this.hot.getSettings().fixedRowsBottom}persistentStateSave(){this.hot.runHooks("persistentStateSave","manualRowMove",this.hot.rowIndexMapper.getIndexesSequence())}persistentStateLoad(){const e={};return this.hot.runHooks("persistentStateLoad","manualRowMove",e),e.value?e.value:[]}prepareRowsToMoving(){const e=this.hot.getSelectedRangeLast(),t=[];if(!e)return t;const{from:r,to:n}=e,s=Math.min(r.row,n.row),i=Math.max(r.row,n.row);return(0,l.rangeEach)(s,i,(e=>{t.push(e)})),t}refreshPositions(){const e=g(M,this).coords,t=this.hot.getFirstFullyVisibleRow(),r=this.hot.getLastFullyVisibleRow(),n=this.hot.countRows();this.isFixedRowTop(e.row)&&t>0&&this.hot.scrollViewportTo(this.hot.rowIndexMapper.getNearestNotHiddenIndex(t-1,-1)),this.isFixedRowBottom(e.row)&&r=v+w;this.isFixedRowTop(e.row)&&(v+=this.hot.view._wt.wtOverlays.topOverlay.getOverlayOffset()),e.row<0?g(M,this).row=t>0?t-1:t:T?(g(M,this).row=e.row+1,v+=0===e.row?C-1:C):g(M,this).row=e.row;let N=p,_=v;p+E+y>=f?N=f-E-y:p+y=f-1&&(_=f-1),g(R,this).setPosition(N),g(S,this).setPosition(_)}registerEvents(){const{documentElement:e}=this.hot.rootDocument;this.eventManager.addEventListener(e,"mousemove",(e=>f(b,this,I).call(this,e))),this.eventManager.addEventListener(e,"mouseup",(()=>f(b,this,P).call(this)))}unregisterEvents(){this.eventManager.clear()}buildPluginUI(){g(R,this).build(),g(S,this).build()}destroy(){g(R,this).destroy(),g(S,this).destroy(),super.destroy()}}function A(e,t,r,n){const{wtTable:s,wtViewport:i}=this.hot.view._wt,o=this.hot.selection.isSelectedByRowHeader(),l=this.hot.getSelectedRangeLast();if(!l||!o||g(N,this)||0!==e.button)return p(N,this,!1),g(T,this).length=0,void(0,a.removeClass)(this.hot.rootElement,[C,w]);const h=g(S,this).isBuilt()&&!g(S,this).isAppended(),u=g(R,this).isBuilt()&&!g(R,this).isAppended();h&&u&&(g(S,this).appendTo(s.hider),g(R,this).appendTo(s.hider));const{from:c,to:d}=l,f=Math.min(c.row,d.row),m=Math.max(c.row,d.row);if(t.col<0&&t.row>=f&&t.row<=m){n.row=!0,p(N,this,!0),g(M,this).eventPageY=e.pageY,g(M,this).coords=t,g(M,this).TD=r,p(T,this,this.prepareRowsToMoving());const o=s.holder.scrollLeft+i.getRowHeaderWidth(),l=this.getRowsHeight(f,t.row-1)+(e.clientY-r.getBoundingClientRect().top);g(R,this).setPosition(null,o),g(R,this).setSize(s.hider.offsetWidth-o,this.getRowsHeight(f,m)),g(R,this).setOffset(-l,null),(0,a.addClass)(this.hot.rootElement,C),this.refreshPositions()}else(0,a.removeClass)(this.hot.rootElement,v),p(N,this,!1),g(T,this).length=0}function I(e){g(N,this)&&(g(M,this).eventPageY=e.pageY,this.refreshPositions())}function x(e,t,r,n){this.hot.getSelectedRangeLast()&&g(N,this)&&(g(T,this).indexOf(t.row)>-1?(0,a.removeClass)(this.hot.rootElement,w):(0,a.addClass)(this.hot.rootElement,w),n.row=!0,n.column=!0,n.cell=!0,g(M,this).coords=t,g(M,this).TD=r)}function P(){const e=g(M,this).row,t=g(T,this).length;if(p(N,this,!1),(0,a.removeClass)(this.hot.rootElement,[C,w,v]),this.hot.selection.isSelectedByRowHeader()&&(0,a.addClass)(this.hot.rootElement,v),t<1||void 0===e)return;const r=g(T,this)[0],n=this.hot.toPhysicalRow(r),s=this.dragRows(g(T,this),e);if(g(T,this).length=0,!0===s){this.persistentStateSave(),this.hot.render(),this.hot.view.adjustElementsSize();const e=this.hot.toVisualRow(n),r=e+t-1;this.hot.selectRows(e,r)}}function L(){const e=this.hot.view._wt.wtTable,t=this.hot.view._wt.wtViewport.getRowHeaderWidth()+e.holder.scrollLeft;g(R,this).setPosition(null,t),g(R,this).setSize(e.hider.offsetWidth-t)}function D(){this.moveBySettingsOrLoad()}t.ManualRowMove=O},44378:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0;var s=n(r(85707));const i="px";t.default=class{constructor(e){(0,s.default)(this,"hot",void 0),(0,s.default)(this,"_element",null),(0,s.default)(this,"state",0),this.hot=e}appendTo(e){e.appendChild(this._element),this.state=2}build(){0===this.state&&(this._element=this.hot.rootDocument.createElement("div"),this.state=1)}destroy(){this.isAppended()&&this._element.parentElement.removeChild(this._element),this._element=null,this.state=0}isAppended(){return 2===this.state}isBuilt(){return this.state>=1}setPosition(e,t){void 0!==e&&(this._element.style.top=e+i),void 0!==t&&(this._element.style.left=t+i)}getPosition(){return{top:this._element.style.top?parseInt(this._element.style.top,10):0,left:this._element.style.left?parseInt(this._element.style.left,10):0}}setSize(e,t){e&&(this._element.style.width=e+i),t&&(this._element.style.height=t+i)}getSize(){return{width:this._element.style.width?parseInt(this._element.style.width,10):0,height:this._element.style.height?parseInt(this._element.style.height,10):0}}setOffset(e,t){e&&(this._element.style.marginTop=e+i),t&&(this._element.style.marginLeft=t+i)}getOffset(){return{top:this._element.style.marginTop?parseInt(this._element.style.marginTop,10):0,left:this._element.style.marginLeft?parseInt(this._element.style.marginLeft,10):0}}}},12535:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0;var s=n(r(44378)),i=r(62577);class o extends s.default{build(){super.build(),(0,i.addClass)(this._element,"ht__manualRowMove--backlight")}}t.default=o},8592:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0;var s=n(r(44378)),i=r(62577);class o extends s.default{build(){super.build(),(0,i.addClass)(this._element,"ht__manualRowMove--guideline")}}t.default=o},25014:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(36380);t.PLUGIN_KEY=n.PLUGIN_KEY,t.PLUGIN_PRIORITY=n.PLUGIN_PRIORITY,t.ManualRowResize=n.ManualRowResize},36380:(e,t,r)=>{"use strict";t.__esModule=!0,r(67834),r(15724),r(14846),r(69655);var n=r(75089),s=r(62577),i=r(10587),o=r(22137),a=r(61149);function l(e,t,r){h(e,t),t.set(e,r)}function h(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function u(e,t,r){return e.set(d(e,t),r),r}function c(e,t){return e.get(d(e,t))}function d(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}const p=t.PLUGIN_KEY="manualRowResize",g=t.PLUGIN_PRIORITY=30,f="manualRowHeights";var m=new WeakMap,y=new WeakMap,E=new WeakMap,w=new WeakMap,C=new WeakMap,v=new WeakMap,R=new WeakMap,S=new WeakMap,T=new WeakMap,N=new WeakMap,M=new WeakMap,_=new WeakMap,b=new WeakMap,O=new WeakMap,A=new WeakMap,I=new WeakMap,x=new WeakSet;class P extends n.BasePlugin{static get PLUGIN_KEY(){return p}static get PLUGIN_PRIORITY(){return g}constructor(e){var t,r;super(e),h(t=this,r=x),r.add(t),l(this,m,null),l(this,y,null),l(this,E,[]),l(this,w,null),l(this,C,null),l(this,v,null),l(this,R,null),l(this,S,null),l(this,T,this.hot.rootDocument.createElement("DIV")),l(this,N,this.hot.rootDocument.createElement("DIV")),l(this,M,!1),l(this,_,!1),l(this,b,0),l(this,O,null),l(this,A,void 0),l(this,I,void 0),(0,s.addClass)(c(T,this),"manualRowResizer"),(0,s.addClass)(c(N,this),"manualRowResizerGuide")}get inlineDir(){return this.hot.isRtl()?"right":"left"}isEnabled(){return this.hot.getSettings()[p]}enablePlugin(){this.enabled||(u(A,this,new a.PhysicalIndexToValueMap),c(A,this).addLocalHook("init",(()=>d(x,this,V).call(this))),this.hot.rowIndexMapper.registerMap(this.pluginName,c(A,this)),this.addHook("modifyRowHeight",((e,t)=>d(x,this,U).call(this,e,t))),this.bindEvents(),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){u(I,this,c(A,this).getValues()),this.hot.rowIndexMapper.unregisterMap(this.pluginName),super.disablePlugin()}saveManualRowHeights(){this.hot.runHooks("persistentStateSave",f,c(A,this).getValues())}loadManualRowHeights(){const e={};return this.hot.runHooks("persistentStateLoad",f,e),e.value}setManualSize(e,t){const r=this.hot.toPhysicalRow(e),n=Math.max(t,this.hot.view.getDefaultRowHeight());return c(A,this).setValueAtIndex(r,n),n}getLastDesiredRowHeight(){return c(w,this)}setupHandlePosition(e){u(m,this,e);const{view:t}=this.hot,{_wt:r}=t,n=r.wtTable.getCoords(c(m,this)),a=n.row;if(a<0)return;const l=(0,s.outerWidth)(c(m,this)),h=c(m,this).getBoundingClientRect(),d=a=t.countNotHiddenRowIndexes(0,1)-r.getSetting("fixedRowsBottom");let g;d?g=r.wtOverlays.topInlineStartCornerOverlay.getRelativeCellPosition(c(m,this),n.row,n.col):p&&(g=r.wtOverlays.bottomInlineStartCornerOverlay.getRelativeCellPosition(c(m,this),n.row,n.col)),g||(g=r.wtOverlays.inlineStartOverlay.getRelativeCellPosition(c(m,this),n.row,n.col)),u(y,this,this.hot.rowIndexMapper.getVisualFromRenderableIndex(a)),u(E,this,[]);const f=this.hot.selection.isSelectedByCorner()||this.hot.selection.isSelectedByRowHeader();if(this.hot.selection.isSelected()&&f){const e=this.hot.getSelectedRange();(0,i.arrayEach)(e,(e=>{const t=e.getTopStartCorner().row,r=e.getBottomStartCorner().row;(0,o.rangeEach)(t,r,(e=>{c(E,this).includes(e)||c(E,this).push(e)}))}))}c(E,this).includes(c(y,this))||u(E,this,[c(y,this)]),u(S,this,g.top-6),u(R,this,parseInt(h.height,10)),c(T,this).style.top=`${c(S,this)+c(R,this)}px`,c(T,this).style[this.inlineDir]=`${g.start}px`,c(T,this).style.width=`${l}px`,this.hot.rootElement.appendChild(c(T,this))}refreshHandlePosition(){c(T,this).style.top=`${c(S,this)+c(w,this)}px`}setupGuidePosition(){const e=parseInt((0,s.outerWidth)(c(T,this)),10),t=parseInt(c(T,this).style[this.inlineDir],10)+e,r=parseInt(this.hot.view.maximumVisibleElementWidth(0),10);(0,s.addClass)(c(T,this),"active"),(0,s.addClass)(c(N,this),"active"),c(N,this).style.top=c(T,this).style.top,c(N,this).style[this.inlineDir]=`${t}px`,c(N,this).style.width=r-e+"px",this.hot.rootElement.appendChild(c(N,this))}refreshGuidePosition(){c(N,this).style.top=c(T,this).style.top}hideHandleAndGuide(){(0,s.removeClass)(c(T,this),"active"),(0,s.removeClass)(c(N,this),"active")}checkIfRowHeader(e){const t=(0,s.closest)(e,["TBODY"],this.hot.rootElement),{inlineStartOverlay:r,topInlineStartCornerOverlay:n,bottomInlineStartCornerOverlay:i}=this.hot.view._wt.wtOverlays;return[r.clone.wtTable.TBODY,n.clone.wtTable.TBODY,i.clone.wtTable.TBODY].includes(t)}getClosestTHParent(e){return"TABLE"!==e.tagName?"TH"===e.tagName?e:this.getClosestTHParent(e.parentNode):null}getActualRowHeight(e){const t=this.hot.view._wt.wtTable.getRowHeight(e);return void 0!==t&&c(C,this){this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.adjustElementsSize()},t=(t,r)=>{const n=this.hot.runHooks("beforeRowResize",this.getActualRowHeight(t),t,!0);void 0!==n&&u(C,this,n),this.setManualSize(t,c(C,this)),this.hot.runHooks("afterRowResize",this.getActualRowHeight(t),t,!0),r&&e()};if(c(b,this)>=2){c(E,this).length>1?((0,i.arrayEach)(c(E,this),(e=>{t(e)})),e()):(0,i.arrayEach)(c(E,this),(e=>{t(e,!0)}))}u(b,this,0),u(O,this,null)}bindEvents(){const{rootElement:e,rootWindow:t}=this.hot;this.eventManager.addEventListener(e,"mouseover",(e=>d(x,this,L).call(this,e))),this.eventManager.addEventListener(e,"mousedown",(e=>d(x,this,D).call(this,e))),this.eventManager.addEventListener(t,"mousemove",(e=>d(x,this,k).call(this,e))),this.eventManager.addEventListener(t,"mouseup",(()=>d(x,this,H).call(this))),this.eventManager.addEventListener(c(T,this),"contextmenu",(()=>d(x,this,F).call(this)))}destroy(){super.destroy()}}function L(e){if(!(0,s.isDetached)(e.target)&&!0!==c(_,this)&&this.checkIfRowHeader(e.target)){const t=this.getClosestTHParent(e.target);t&&(c(M,this)||this.setupHandlePosition(t))}}function D(e){(0,s.hasClass)(e.target,"manualRowResizer")&&(this.setupHandlePosition(c(m,this)),this.setupGuidePosition(),u(M,this,!0),null===c(O,this)&&(u(O,this,setTimeout((()=>this.afterMouseDownTimeout()),500)),this.hot._registerTimeout(c(O,this))),u(b,this,c(b,this)+1),u(v,this,e.pageY),u(C,this,c(R,this)))}function k(e){c(M,this)&&(u(w,this,c(R,this)+(e.pageY-c(v,this))),(0,i.arrayEach)(c(E,this),(e=>{u(C,this,this.setManualSize(e,c(w,this)))})),this.refreshHandlePosition(),this.refreshGuidePosition())}function H(){const e=()=>{this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.adjustElementsSize()},t=(t,r)=>{this.hot.runHooks("beforeRowResize",this.getActualRowHeight(t),t,!1),r&&e(),this.saveManualRowHeights(),this.hot.runHooks("afterRowResize",this.getActualRowHeight(t),t,!1)};if(c(M,this)){if(this.hideHandleAndGuide(),u(M,this,!1),c(C,this)!==c(R,this)){c(E,this).length>1?((0,i.arrayEach)(c(E,this),(e=>{t(e)})),e()):(0,i.arrayEach)(c(E,this),(e=>{t(e,!0)}))}this.setupHandlePosition(c(m,this))}}function F(){this.hideHandleAndGuide(),this.hot.rootElement.removeChild(c(T,this)),this.hot.rootElement.removeChild(c(N,this)),u(M,this,!1),u(_,this,!0),this.hot._registerImmediate((()=>{u(_,this,!1)}))}function U(e,t){let r=e;if(this.enabled){const e=this.hot.toPhysicalRow(t),n=c(A,this).getValueAtIndex(e);this.hot.getSettings()[p]&&n&&(r=n)}return r}function V(){const e=this.hot.getSettings()[p],t=this.loadManualRowHeights();this.hot.batchExecution((()=>{void 0!==t?t.forEach(((e,t)=>{c(A,this).setValueAtIndex(t,e)})):Array.isArray(e)?(e.forEach(((e,t)=>{c(A,this).setValueAtIndex(t,e)})),u(I,this,e)):!0===e&&Array.isArray(c(I,this))&&c(I,this).forEach(((e,t)=>{c(A,this).setValueAtIndex(t,e)}))}),!0)}t.ManualRowResize=P},75424:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(14846),r(63333);var s=n(r(85707)),i=r(25499),o=r(10587);t.default=class{constructor(e){(0,s.default)(this,"plugin",void 0),(0,s.default)(this,"mergedCellsCollection",void 0),(0,s.default)(this,"currentFillData",null),this.plugin=e,this.mergedCellsCollection=this.plugin.mergedCellsCollection}getDirection(e,t){let r=null;return r=t[0]===e[0]&&t[1]===e[1]&&t[3]===e[3]?"down":t[2]===e[2]&&t[1]===e[1]&&t[3]===e[3]?"up":t[1]===e[1]&&t[2]===e[2]?"right":"left",r}snapDragArea(e,t,r,n){const s=t.slice(0),i=this.getAutofillSize(e,t,r),[o,a,l,h]=e,u=["up","down"].indexOf(r)>-1?l-o+1:h-a+1,c=i-Math.floor(i/u)*u,d=this.getFarthestCollection(e,t,r,n);if(d)if("down"===r){const e=d.row+d.rowspan-o-c;s[2]+e>=this.plugin.hot.countRows()?s[2]-=c:s[2]+=c?e:0}else if("right"===r){const e=d.col+d.colspan-a-c;s[3]+e>=this.plugin.hot.countCols()?s[3]-=c:s[3]+=c?e:0}else if("up"===r){const e=l-c-d.row+1;s[0]+e<0?s[0]+=c:s[0]-=c?e:0}else if("left"===r){const e=h-c-d.col+1;s[1]+e<0?s[1]+=c:s[1]-=c?e:0}return this.updateCurrentFillCache({baseArea:e,dragDirection:r,foundMergedCells:n,fillSize:i,dragArea:s,cycleLength:u}),s}updateCurrentFillCache(e){this.currentFillData||(this.currentFillData={}),(0,i.extend)(this.currentFillData,e)}getAutofillSize(e,t,r){const[n,s,i,o]=e,[a,l,h,u]=t;switch(r){case"up":return n-a;case"down":return h-i;case"left":return s-l;case"right":return u-o;default:return null}}getDragArea(e,t,r){const[n,s,i,o]=e,[a,l,h,u]=t;switch(r){case"up":return[a,l,n-1,o];case"down":{const e=this.mergedCellsCollection.get(h,o);return[i+1,s,h+(e?e.rowspan-1:0),o]}case"left":return[a,l,i,s-1];case"right":{const e=this.mergedCellsCollection.get(h,o);return[n,o+(e?e.colspan-1:0),h,u]}default:return null}}getFarthestCollection(e,t,r,n){const[s,i,a,l]=e,h=["up","down"].indexOf(r)>-1,u=h?a:l,c=h?s:i,d=this.getAutofillSize(e,t,r),p=h?a-s+1:l-i+1,g=d-Math.floor(d/p)*p;let f=null,m=null,y=null;switch(r){case"up":f="includesVertically",y=u-g+1;break;case"left":f="includesHorizontally",y=u-g+1;break;case"down":f="includesVertically",y=c+g-1;break;case"right":f="includesHorizontally",y=c+g-1}return(0,o.arrayEach)(n,(e=>{e[f](y)&&e.isFarther(m,r)&&(m=e)})),m}recreateAfterDataPopulation(e){if(!this.currentFillData)return;const t=this.getRangeFromChanges(e),r=this.currentFillData.foundMergedCells,n=this.currentFillData.dragDirection,s=(e,r)=>{switch(n){case"up":return e.row-r>=t.from.row;case"down":return e.row+e.rowspan-1+r<=t.to.row;case"left":return e.col-r>=t.from.column;case"right":return e.col+e.colspan-1+r<=t.to.column;default:return null}};let i=0,o=null,a=1;do{for(let e=0;e0&&this.plugin.ifChromeForceRepaint()}getRangeFromChanges(e){const t={min:null,max:null},r={min:null,max:null};return(0,o.arrayEach)(e,(e=>{const n=e[0],s=this.plugin.hot.propToCol(e[1]);(null===t.min||nt.max)&&(t.max=n),(null===r.min||sr.max)&&(r.max=s)})),{from:{row:t.min,column:r.min},to:{row:t.max,column:r.max}}}dragAreaOverlapsCollections(e,t,r){const n=this.getDragArea(e,t,r),[s,i,o,a]=n,l=this.plugin.hot._createCellCoords(s,i),h=this.plugin.hot._createCellCoords(o,a),u=this.plugin.hot._createCellRange(l,l,h);if(0===this.mergedCellsCollection.getWithinRange(u,!0).length)return!1;const c=this.mergedCellsCollection.getWithinRange(u,!1);return 0===c.length||("up"===r||"down"===r?!c.every((e=>{let{colspan:t}=e;return t===u.getWidth()})):!c.every((e=>{let{rowspan:t}=e;return t===u.getHeight()})))}}},90974:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(15724);var s=n(r(85707));t.default=class{constructor(e){(0,s.default)(this,"plugin",void 0),(0,s.default)(this,"hot",void 0),(0,s.default)(this,"fullySelectedMergedCellClassName","fullySelectedMergedCell"),this.plugin=e,this.hot=e.hot}getSelectedMergedCellClassName(e,t,r,n){const s=Math.min(r[0],r[2]),i=Math.min(r[1],r[3]),o=Math.max(r[0],r[2]),a=Math.max(r[1],r[3]);if(void 0===n)return;if(!this.plugin.mergedCellsCollection.isFirstRenderableMergedCell(e,t))return;const l=this.plugin.mergedCellsCollection.get(e,t);if(!l)return;const h=l.getLastRow(),u=l.getLastColumn();return s<=l.row&&i<=l.col&&o>=h&&a>=u?`${this.fullySelectedMergedCellClassName}-${n}`:this.isMergeCellFullySelected(l,this.plugin.hot.getSelectedRange())?`${this.fullySelectedMergedCellClassName}-multiple`:void 0}isMergeCellFullySelected(e,t){const r=[];if(!t||!e)return!1;for(let t=0;t{"use strict";var n=r(96784);t.__esModule=!0,r(67834);var s=n(r(85707)),i=r(21595);function o(e,t,r){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}function a(e,t){return e.get(h(e,t))}function l(e,t,r){return e.set(h(e,t),r),r}function h(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var u=new WeakMap;t.default=class{constructor(e,t,r,n,i,a){(0,s.default)(this,"row",void 0),(0,s.default)(this,"col",void 0),(0,s.default)(this,"rowspan",void 0),(0,s.default)(this,"colspan",void 0),(0,s.default)(this,"removed",!1),(0,s.default)(this,"cellCoordsFactory",void 0),(0,s.default)(this,"cellRangeFactory",void 0),o(this,u,null),this.row=e,this.col=t,this.rowspan=r,this.colspan=n,this.cellCoordsFactory=i,this.cellRangeFactory=a}static NEGATIVE_VALUES_WARNING(e){let{row:t,col:r,rowspan:n,colspan:s}=e;return i.toSingleLine`The merged cell declared with {row: ${t}, col: ${r},\x20 + rowspan: ${n}, colspan: ${s}} contains negative values, which is\x20 + not supported. It will not be added to the collection.`}static IS_OUT_OF_BOUNDS_WARNING(e){let{row:t,col:r}=e;return i.toSingleLine`The merged cell declared at [${t}, ${r}] is positioned\x20 + (or positioned partially) outside of the table range. It was not added to the table, please fix your setup.`}static IS_SINGLE_CELL(e){let{row:t,col:r}=e;return i.toSingleLine`The merged cell declared at [${t}, ${r}] has both "rowspan"\x20 + and "colspan" declared as "1", which makes it a single cell. It cannot be added to the collection.`}static ZERO_SPAN_WARNING(e){let{row:t,col:r}=e;return i.toSingleLine`The merged cell declared at [${t}, ${r}] has "rowspan"\x20 + or "colspan" declared as "0", which is not supported. It cannot be added to the collection.`}static containsNegativeValues(e){let{row:t,col:r,rowspan:n,colspan:s}=e;return t<0||r<0||n<0||s<0}static isSingleCell(e){let{rowspan:t,colspan:r}=e;return 1===r&&1===t}static containsZeroSpan(e){let{rowspan:t,colspan:r}=e;return 0===r||0===t}static isOutOfBounds(e,t,r){return e.row<0||e.col<0||e.row>=t||e.row+e.rowspan-1>=t||e.col>=r||e.col+e.colspan-1>=r}normalize(e){const t=e.countRows(),r=e.countCols();this.row<0?this.row=0:this.row>t-1&&(this.row=t-1),this.col<0?this.col=0:this.col>r-1&&(this.col=r-1),this.row+this.rowspan>t-1&&(this.rowspan=t-this.row),this.col+this.colspan>r-1&&(this.colspan=r-this.col),l(u,this,null)}includes(e,t){return this.row<=e&&this.col<=t&&this.row+this.rowspan-1>=e&&this.col+this.colspan-1>=t}includesHorizontally(e){return this.col<=e&&this.col+this.colspan-1>=e}includesVertically(e){return this.row<=e&&this.row+this.rowspan-1>=e}shift(e,t){const r=e[0]||e[1],n=t+Math.abs(e[0]||e[1])-1,s=e[0]?"colspan":"rowspan",i=e[0]?"col":"row",o=Math.min(t,n),a=Math.max(t,n),h=this[i],c=this[i]+this[s]-1;if(h>=t&&(this[i]+=r),r>0)t<=c&&t>h&&(this[s]+=r);else if(r<0){if(o<=h&&a>=c)return this.removed=!0,l(u,this,null),!1;if(h>=o&&h<=a){const e=a-h+1,t=Math.abs(r)-e;this[i]-=t+r,this[s]-=e}else if(h<=o&&c>=a)this[s]+=r;else if(h<=o&&c>=o&&cthis.row:"right"===t?e.col+e.colspan-1this.col:null)}getLastRow(){return this.row+this.rowspan-1}getLastColumn(){return this.col+this.colspan-1}getRange(){return a(u,this)||l(u,this,this.cellRangeFactory(this.cellCoordsFactory(this.row,this.col),this.cellCoordsFactory(this.row,this.col),this.cellCoordsFactory(this.getLastRow(),this.getLastColumn()))),a(u,this)}}},60044:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834),r(15724),r(63979),r(71336),r(41558),r(17663),r(68630),r(79645),r(89858),r(8620),r(14846),r(27458),r(49748),r(69655);var s=n(r(85707)),i=n(r(33423)),o=r(22137),a=r(14859),l=r(10587),h=r(21595);function u(e,t){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.add(e)}function c(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var d=new WeakSet;class p{constructor(e){u(this,d),(0,s.default)(this,"plugin",void 0),(0,s.default)(this,"mergedCells",[]),(0,s.default)(this,"mergedCellsMatrix",new Map),(0,s.default)(this,"hot",void 0),this.plugin=e,this.hot=e.hot}static IS_OVERLAPPING_WARNING(e){let{row:t,col:r}=e;return h.toSingleLine`The merged cell declared at [${t}, ${r}], overlaps\x20 + with the other declared merged cell. The overlapping merged cell was not added to the table, please\x20 + fix your setup.`}get(e,t){var r;return!!this.mergedCellsMatrix.has(e)&&(null!==(r=this.mergedCellsMatrix.get(e).get(t))&&void 0!==r&&r)}getByRange(e){const{row:t,col:r}=e.getTopStartCorner(),{row:n,col:s}=e.getBottomEndCorner(),i=this.mergedCells.length;let o=!1;for(let e=0;e=t&&a+h-1<=n&&l>=r&&l+u-1<=s){o=i;break}}return o}filterOverlappingMergeCells(e){const t=new Set;this.mergedCells.forEach((e=>{const{row:r,col:n,colspan:s,rowspan:i}=e;for(let e=r;e{const{row:r,col:n,colspan:s,rowspan:i}=e,o=new Set;let l=!1;for(let h=r;h1&&void 0!==arguments[1]&&arguments[1];const{row:r,col:n}=e.getTopStartCorner(),{row:s,col:i}=e.getBottomEndCorner(),o=[];for(let e=r;e<=s;e++)for(let r=n;r<=i;r++){const n=this.get(e,r);n&&(t||!t&&n.row===e&&n.col===r)&&o.push(n)}return o}add(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const r=e.row,n=e.col,s=e.rowspan,o=e.colspan,l=new i.default(r,n,s,o,this.hot._createCellCoords,this.hot._createCellRange),h=this.get(r,n),u=!t&&this.isOverlapping(l);return h||u?(u&&(0,a.warn)(p.IS_OVERLAPPING_WARNING(l)),!1):(this.hot&&l.normalize(this.hot),this.mergedCells.push(l),c(d,this,f).call(this,l),l)}remove(e,t){const r=this.get(e,t),n=r?this.mergedCells.indexOf(r):-1;return!(!r||-1===n)&&(this.mergedCells.splice(n,1),c(d,this,m).call(this,r),r)}clear(){(0,l.arrayEach)(this.mergedCells,(e=>{let{row:t,col:r,rowspan:n,colspan:s}=e;(0,o.rangeEach)(t,t+n,(e=>{(0,o.rangeEach)(r,r+s,(t=>{const r=this.hot.getCell(e,t);r&&(r.removeAttribute("rowspan"),r.removeAttribute("colspan"),r.style.display="")}))}))})),this.mergedCells.length=0,this.mergedCellsMatrix=new Map}isOverlapping(e){const t=e.getRange();for(let e=0;e=t){n=r[e];break}return n}getTopMostRowIndex(e,t){const r=c(d,this,g).call(this,e,"row",-1);let n=t;for(let e=0;e=t){n=r[e];break}return n}shiftCollections(e,t,r){const n=[0,0];switch(e){case"right":n[0]+=r;break;case"left":n[0]-=r;break;case"down":n[1]+=r;break;case"up":n[1]-=r}const s=[];this.mergedCells.forEach((e=>{e.shift(n,t),e.removed&&s.push(e)})),s.forEach((e=>{this.mergedCells.splice(this.mergedCells.indexOf(e),1)})),this.mergedCellsMatrix.clear(),this.mergedCells.forEach((e=>{c(d,this,f).call(this,e)}))}}function g(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;const n=new Map,s=1===r?e.getTopStartCorner():e.getBottomEndCorner(),i=1===r?e.getBottomEndCorner():e.getTopStartCorner();for(let e=s.row;1===r?e<=i.row:e>=i.row;e+=r)for(let o=s.col;1===r?o<=i.col:o>=i.col;o+=r){const s="row"===t?e:o,i=this.get(e,o);let a=s;i&&(a=1===r?i[t]+i[`${t}span`]-1:i[t]),n.has(s)||n.set(s,new Set),n.get(s).add(a)}return Array.from(new Set(Array.from(n.entries()).filter((e=>{let[,t]=e;return 1===t.size})).flatMap((e=>{let[,t]=e;return Array.from(t)}))))}function f(e){for(let t=e.row;t{"use strict";var n=r(96784);t.__esModule=!0,t.default=function(e){return{key:"mergeCells",name(){const t=this.getSelectedLast();if(t){const r=e.mergedCellsCollection.get(t[0],t[1]);if(r.row===t[0]&&r.col===t[1]&&r.row+r.rowspan-1===t[2]&&r.col+r.colspan-1===t[3])return this.getTranslatedPhrase(s.CONTEXTMENU_ITEMS_UNMERGE_CELLS)}return this.getTranslatedPhrase(s.CONTEXTMENU_ITEMS_MERGE_CELLS)},callback(){const t=this.getSelectedRangeLast();if(!t)return;t.setDirection(this.isRtl()?"NE-SW":"NW-SE");const{from:r,to:n}=t;e.toggleMerge(t),this.selectCell(r.row,r.col,n.row,n.col,!1)},disabled(){const e=this.getSelectedLast();if(!e)return!0;return i.default.isSingleCell({row:e[0],col:e[1],rowspan:e[2]-e[0]+1,colspan:e[3]-e[1]+1})||this.selection.isSelectedByCorner()},hidden:!1}};var s=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=o(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var a=s?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n}(r(23384)),i=n(r(33423));function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(o=function(e){return e?r:t})(e)}},3557:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834),r(15724);var s=n(r(30480));function i(e,t,r){o(e,t),t.set(e,r)}function o(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function a(e,t){return e.get(h(e,t))}function l(e,t,r){return e.set(h(e,t),r),r}function h(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var u=new WeakMap,c=new WeakMap,d=new WeakMap,p=new WeakMap,g=new WeakMap,f=new WeakMap,m=new WeakMap,y=new WeakSet;function E(e,t,r,n,s){const i=e.getTopStartCorner(),o=e.getBottomEndCorner(),l=e.highlight.clone().normalize(),h=a(g,this).call(this,n,s);if(h&&r.has(h))return null;const u={colStart:s,colEnd:s,rowStart:n,rowEnd:n};if(h){if(r.add(h),h.rowo.row||h.colo.col)return null;u.colStart=h.col,u.colEnd=h.col+h.colspan-1,u.rowStart=h.row,u.rowEnd=h.row+h.rowspan-1}const c=t.push(u);return n===l.row&&s===l.col||h&&l.row>=h.row&&l.row<=h.row+h.rowspan-1&&l.col>=h.col&&l.col<=h.col+h.colspan-1?c:null}t.FocusOrder=class{constructor(e){let{mergedCellsGetter:t,rowIndexMapper:r,columnIndexMapper:n}=e;var a,h;o(a=this,h=y),h.add(a),i(this,u,new s.default),i(this,c,new s.default),i(this,d,null),i(this,p,null),i(this,g,null),i(this,f,null),i(this,m,null),l(g,this,t),l(f,this,r),l(m,this,n)}getCurrentVerticalNode(){return a(p,this).data}getFirstVerticalNode(){return a(c,this).first.data}getNextVerticalNode(){return a(p,this).next.data}getPrevVerticalNode(){return a(p,this).prev.data}getCurrentHorizontalNode(){return a(d,this).data}getFirstHorizontalNode(){return a(u,this).first.data}getNextHorizontalNode(){return a(d,this).next.data}getPrevHorizontalNode(){return a(d,this).prev.data}setPrevNodeAsActive(){l(p,this,a(p,this).prev),l(d,this,a(d,this).prev)}setNextNodeAsActive(){l(p,this,a(p,this).next),l(d,this,a(d,this).next)}buildFocusOrder(e){const t=e.getTopStartCorner(),r=e.getBottomEndCorner(),n=new WeakSet;l(u,this,new s.default);for(let s=t.row;s<=r.row;s++)if(!a(f,this).isHidden(s))for(let i=t.col;i<=r.col;i++){if(a(m,this).isHidden(i))continue;const t=h(y,this,E).call(this,e,a(u,this),n,s,i);t&&l(d,this,t)}a(u,this).first&&(a(u,this).first.prev=a(u,this).last,a(u,this).last.next=a(u,this).first);const i=new WeakSet;l(c,this,new s.default);for(let n=t.col;n<=r.col;n++)if(!a(m,this).isHidden(n))for(let s=t.row;s<=r.row;s++){if(a(f,this).isHidden(s))continue;const t=h(y,this,E).call(this,e,a(c,this),i,s,n);t&&l(p,this,t)}a(c,this).first&&(a(c,this).first.prev=a(c,this).last,a(c,this).last.next=a(c,this).first)}setActiveNode(e,t){return a(u,this).inorder((r=>{const{rowStart:n,rowEnd:s,colStart:i,colEnd:o}=r.data;if(e>=n&&e<=s&&t>=i&&t<=o)return l(d,this,r),!1})),a(c,this).inorder((r=>{const{rowStart:n,rowEnd:s,colStart:i,colEnd:o}=r.data;if(e>=n&&e<=s&&t>=i&&t<=o)return l(p,this,r),!1})),this}}},75501:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(16524);t.PLUGIN_KEY=n.PLUGIN_KEY,t.PLUGIN_PRIORITY=n.PLUGIN_PRIORITY,t.MergeCells=n.MergeCells},16524:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834),r(15724),r(71336),r(41558),r(17663),r(68630),r(79645),r(89858),r(8620),r(14846),r(27458),r(69655),r(94364),r(90458);var s=n(r(85707)),i=r(75089),o=r(28197),a=n(r(60044)),l=n(r(33423)),h=n(r(75424)),u=n(r(90974)),c=n(r(57297)),d=r(10587),p=r(25499),g=r(14859),f=r(22137),m=r(62577),y=r(25046),E=r(3557),w=r(23734);function C(e,t,r){v(e,t),t.set(e,r)}function v(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function R(e,t,r){return e.set(T(e,t),r),r}function S(e,t){return e.get(T(e,t))}function T(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}o.Hooks.getSingleton().register("beforeMergeCells"),o.Hooks.getSingleton().register("afterMergeCells"),o.Hooks.getSingleton().register("beforeUnmergeCells"),o.Hooks.getSingleton().register("afterUnmergeCells");const N=t.PLUGIN_KEY="mergeCells",M=t.PLUGIN_PRIORITY=150,_=N;var b=new WeakMap,O=new WeakMap,A=new WeakMap,I=new WeakMap,x=new WeakSet;class P extends i.BasePlugin{constructor(){var e,t;super(...arguments),v(e=this,t=x),t.add(e),(0,s.default)(this,"mergedCellsCollection",null),(0,s.default)(this,"autofillCalculations",null),(0,s.default)(this,"selectionCalculations",null),C(this,b,null),C(this,O,{row:0,col:0}),C(this,A,new E.FocusOrder({mergedCellsGetter:(e,t)=>this.mergedCellsCollection.get(e,t),rowIndexMapper:this.hot.rowIndexMapper,columnIndexMapper:this.hot.columnIndexMapper})),C(this,I,(0,w.createMergeCellRenderer)(this))}static get PLUGIN_KEY(){return N}static get PLUGIN_PRIORITY(){return M}static get DEFAULT_SETTINGS(){return{[i.defaultMainSettingSymbol]:"cells",virtualized:!1,cells:[]}}isEnabled(){return!!this.hot.getSettings()[N]}enablePlugin(){var e=this;this.enabled||(this.mergedCellsCollection=new a.default(this),this.autofillCalculations=new h.default(this),this.selectionCalculations=new u.default(this),this.addHook("afterInit",(function(){for(var t=arguments.length,r=new Array(t),n=0;n{if("MergeCells"===t)return!1})),this.registerShortcuts(),super.enablePlugin())}disablePlugin(){this.clearCollections(),this.unregisterShortcuts(),this.hot.render(),super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.generateFromSettings(),super.updatePlugin()}ifChromeForceRepaint(){if(!(0,y.isChrome)())return;const e=[];let t=[];this.mergedCellsCollection.mergedCells.forEach((e=>{const{row:r,rowspan:n}=e;for(let e=r+1;e{const r=this.hot.rowIndexMapper.getRenderableFromVisualIndex(t);this.hot.view._wt.wtOverlays.getOverlays(!0).map((e=>"master"===(null==e?void 0:e.name)?e:e.clone.wtTable)).forEach((t=>{const n=t.getRow(r);n&&(n.style.background=(0,m.getStyle)(n,"backgroundColor").replace(")",", 0.99)"),e.push(n))}))})),this.hot._registerTimeout((()=>{e.forEach((e=>{e.style.background=(0,m.getStyle)(e,"backgroundColor").replace(", 0.99)",")")}))}),1)}validateSetting(e){return!!e&&(l.default.containsNegativeValues(e)?((0,g.warn)(l.default.NEGATIVE_VALUES_WARNING(e)),!1):l.default.isOutOfBounds(e,this.hot.countRows(),this.hot.countCols())?((0,g.warn)(l.default.IS_OUT_OF_BOUNDS_WARNING(e)),!1):l.default.isSingleCell(e)?((0,g.warn)(l.default.IS_SINGLE_CELL(e)),!1):!l.default.containsZeroSpan(e)||((0,g.warn)(l.default.ZERO_SPAN_WARNING(e)),!1))}generateFromSettings(){const e=this.getSetting("cells").filter((e=>this.validateSetting(e))),t=this.mergedCellsCollection.filterOverlappingMergeCells(e),r=[];t.forEach((e=>{const{row:t,col:n,rowspan:s,colspan:i}=e,o=this.hot._createCellCoords(t,n),a=this.hot._createCellCoords(t+s-1,n+i-1),l=this.hot._createCellRange(o,o,a);this.mergeRange(l,!0,!0);for(let e=t;e1&&void 0!==arguments[1]&&arguments[1])||this.validateSetting(e)}mergeSelection(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.hot.getSelectedRangeLast();if(!e)return;e.setDirection(this.hot.isRtl()?"NE-SW":"NW-SE");const{from:t,to:r}=e;this.unmergeRange(e,!0),this.mergeRange(e),this.hot.selectCell(t.row,t.col,r.row,r.col,!1)}unmergeSelection(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.hot.getSelectedRangeLast();if(!e)return;const{from:t,to:r}=e;this.unmergeRange(e,!0),this.hot.selectCell(t.row,t.col,r.row,r.col,!1)}mergeRange(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const n=e.getTopStartCorner(),s=e.getBottomEndCorner(),i={row:n.row,col:n.col,rowspan:s.row-n.row+1,colspan:s.col-n.col+1},o=[];let a=null;if(!this.canMergeRange(i,t))return!1;this.hot.runHooks("beforeMergeCells",e,t),(0,f.rangeEach)(0,i.rowspan-1,(e=>{(0,f.rangeEach)(0,i.colspan-1,(t=>{let r=null;o[e]||(o[e]=[]),0===e&&0===t?r=this.hot.getSourceDataAtCell(this.hot.toPhysicalRow(i.row),this.hot.toPhysicalColumn(i.col)):this.hot.setCellMeta(i.row+e,i.col+t,"hidden",!0),o[e][t]=r}))})),this.hot.setCellMeta(i.row,i.col,"spanned",!0);return!this.mergedCellsCollection.add(i,t)||(r?a=[i.row,i.col,o]:this.hot.populateFromArray(i.row,i.col,o,void 0,void 0,this.pluginName),t||this.ifChromeForceRepaint(),this.hot.runHooks("afterMergeCells",e,i,t),a)}unmergeRange(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const r=this.mergedCellsCollection.getWithinRange(e);0!==r.length&&(this.hot.runHooks("beforeUnmergeCells",e,t),(0,d.arrayEach)(r,(e=>{this.mergedCellsCollection.remove(e.row,e.col),(0,f.rangeEach)(0,e.rowspan-1,(t=>{(0,f.rangeEach)(0,e.colspan-1,(r=>{this.hot.removeCellMeta(e.row+t,e.col+r,"hidden"),this.hot.removeCellMeta(e.row+t,e.col+r,"copyable")}))})),this.hot.removeCellMeta(e.row,e.col,"spanned")})),this.hot.runHooks("afterUnmergeCells",e,t),this.hot.render())}toggleMerge(e){const t=this.mergedCellsCollection.get(e.from.row,e.from.col);t.row===e.from.row&&t.col===e.from.col&&t.row+t.rowspan-1===e.to.row&&t.col+t.colspan-1===e.to.col?this.unmergeRange(e):this.mergeSelection(e)}merge(e,t,r,n){const s=this.hot._createCellCoords(e,t),i=this.hot._createCellCoords(r,n);this.mergeRange(this.hot._createCellRange(s,s,i))}unmerge(e,t,r,n){const s=this.hot._createCellCoords(e,t),i=this.hot._createCellCoords(r,n);this.unmergeRange(this.hot._createCellRange(s,s,i))}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Control","m"]],callback:()=>{const e=this.hot.getSelectedRangeLast();e&&!e.isSingleHeader()&&(this.toggleMerge(e),this.hot.render())},runOnlyIf:e=>!e.altKey,group:_})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(_)}modifyViewportRowStart(e,t){const r=this.hot.rowIndexMapper,n=r.getVisualFromRenderableIndex(e.startRow);for(let s=0;se.endRow)return e.endRow=s,void this.modifyViewportRowEnd(e,t)}}}modifyViewportColumnStart(e,t){const r=this.hot.columnIndexMapper,n=r.getVisualFromRenderableIndex(e.startColumn);for(let s=0;se.endColumn)return e.endColumn=s,void this.modifyViewportColumnEnd(e,t)}}}translateMergedCellToRenderable(e,t,r,n){const{rowIndexMapper:s,columnIndexMapper:i}=this.hot;let o,a;o=0===t?s.getNearestNotHiddenIndex(e,1):s.getNearestNotHiddenIndex(e+t-1,-1),a=0===n?i.getNearestNotHiddenIndex(r,1):i.getNearestNotHiddenIndex(r+n-1,-1);return[e>=0?s.getRenderableFromVisualIndex(o):e,r>=0?i.getRenderableFromVisualIndex(a):r]}}function L(){this.generateFromSettings(),this.hot.render()}function D(e){if(e){const e=this.mergedCellsCollection.mergedCells,t=this.hot.getSelectedRangeLast(),r=t.getTopStartCorner(),n=t.getBottomEndCorner();for(let t=0;t=o&&r.col<=a?o-1:a,s=n.getNearestNotHiddenIndex(t,-1);e.col=null===s?-this.hot.view.countRenderableColumnsInRange(0,r.col):-Math.max(this.hot.view.countRenderableColumnsInRange(s,r.col)-1,1)}else if(e.col>0){const t=r.col>=o&&r.col<=a?a+1:o,s=n.getNearestNotHiddenIndex(t,1);e.col=null===s?this.hot.view.countRenderableColumnsInRange(r.col,this.hot.countCols()):Math.max(this.hot.view.countRenderableColumnsInRange(r.col,s)-1,1)}const l=i.row,h=i.row+i.rowspan-1;if(e.row<0){const t=r.row>=l&&r.row<=h?l-1:h,n=s.getNearestNotHiddenIndex(t,-1);e.row=null===n?-this.hot.view.countRenderableRowsInRange(0,r.row):-Math.max(this.hot.view.countRenderableRowsInRange(n,r.row)-1,1)}else if(e.row>0){const t=r.row>=l&&r.row<=h?h+1:l,n=s.getNearestNotHiddenIndex(t,1);e.row=null===n?this.hot.view.countRenderableRowsInRange(r.row,this.hot.countRows()):Math.max(this.hot.view.countRenderableRowsInRange(r.row,n)-1,1)}}function F(e){const t=this.hot.getSelectedRangeLast(),r=t.clone(),{to:n}=t,{columnIndexMapper:s,rowIndexMapper:i}=this.hot,o=(e,t)=>{r.expand(this.hot._createCellCoords(e,t));for(let e=0;e0){let i=this.mergedCellsCollection.getEndMostColumnIndex(t,n.col)+e.col;o(n.row,i),"W-E"===t.getHorizontalDirection()&&"W-E"===r.getHorizontalDirection()&&(i=r.getBottomEndCorner().col);const a=s.getNearestNotHiddenIndex(i,-1);null!==a&&(e.col=Math.max(this.hot.view.countRenderableColumnsInRange(n.col,a)-1,1))}if(e.row<0){let s=this.mergedCellsCollection.getTopMostRowIndex(t,n.row)+e.row;o(s,n.col),"S-N"===t.getVerticalDirection()&&"S-N"===r.getVerticalDirection()&&(s=r.getTopStartCorner().row);const a=i.getNearestNotHiddenIndex(s,1);null!==a&&(e.row=-Math.max(this.hot.view.countRenderableRowsInRange(a,n.row)-1,1))}else if(e.row>0){let s=this.mergedCellsCollection.getBottomMostRowIndex(t,n.row)+e.row;o(s,n.col),"N-S"===t.getVerticalDirection()&&"N-S"===r.getVerticalDirection()&&(s=r.getBottomStartCorner().row);const a=i.getNearestNotHiddenIndex(s,-1);null!==a&&(e.row=Math.max(this.hot.view.countRenderableRowsInRange(n.row,a)-1,1))}}function U(){const e=this.hot.getSelectedRangeLast(),{highlight:t}=e;if(this.hot.selection.isSelectedByColumnHeader()||this.hot.selection.isSelectedByRowHeader())return void R(b,this,t.clone());for(let t=0;t0||S(O,this).col>0?S(A,this).setPrevNodeAsActive():("E-W"===r&&S(O,this).col<0||"S-N"===t&&S(O,this).row<0)&&S(A,this).setNextNodeAsActive()}function G(e,t){const r=this.hot.getSelectedRangeLast(),{columnIndexMapper:n,rowIndexMapper:s}=this.hot;let i=null,o=null;if(S(O,this).col<0){const{rowEnd:e,colEnd:t}=S(A,this).getPrevHorizontalNode();o=n.getNearestNotHiddenIndex(t,-1),i=s.getNearestNotHiddenIndex(e,-1)}else if(S(O,this).col>0){const{rowStart:e,colStart:t}=S(A,this).getNextHorizontalNode();o=n.getNearestNotHiddenIndex(t,1),i=s.getNearestNotHiddenIndex(e,1)}else if(S(O,this).row<0){const{rowEnd:e,colEnd:t}=S(A,this).getPrevVerticalNode();o=n.getNearestNotHiddenIndex(t,-1),i=s.getNearestNotHiddenIndex(e,-1)}else if(S(O,this).row>0){const{rowStart:e,colStart:t}=S(A,this).getNextVerticalNode();o=n.getNearestNotHiddenIndex(t,1),i=s.getNearestNotHiddenIndex(e,1)}if(null!==i||null!==o){const n=this.hot._createCellCoords(i,o),s=this.mergedCellsCollection.get(n.row,n.col),a=this.hot.selection.highlight.getFocus();e=n.row,t=n.col,s?r.highlight.assign({row:this.hot.rowIndexMapper.getNearestNotHiddenIndex(s.row,1),col:this.hot.columnIndexMapper.getNearestNotHiddenIndex(s.col,1)}):r.highlight.assign(n),a.clear(),a.add(n).commit()}S(A,this).setActiveNode(e,t),R(O,this,{row:0,col:0})}function j(){this.hot.getSelectedRangeLast().isHeader()||S(A,this).buildFocusOrder(this.hot.getSelectedRangeLast())}function z(e,t,r){const n=this.mergedCellsCollection.get(e,t);n&&(n.row!==e||n.col!==t?r.copyable=!1:(r.rowspan=n.rowspan,r.colspan=n.colspan))}function $(e){if(this.getSetting("virtualized"))return;const t=this.hot.countCols();this.modifyViewportRowStart(e,t),this.modifyViewportRowEnd(e,t)}function K(e){if(this.getSetting("virtualized"))return;const t=this.hot.countRows();this.modifyViewportColumnStart(e,t),this.modifyViewportColumnEnd(e,t)}function X(e,t){const r=this.autofillCalculations.getDirection(t,e);if(this.autofillCalculations.dragAreaOverlapsCollections(t,e,r))return t;const n=this.hot._createCellCoords(t[0],t[1]),s=this.hot._createCellCoords(t[2],t[3]),i=this.hot._createCellRange(n,n,s),o=this.mergedCellsCollection.getWithinRange(i);return 0===o.length?e:this.autofillCalculations.snapDragArea(t,e,r,o)}function q(e,t){this.mergedCellsCollection.shiftCollections("right",e,t)}function Q(e,t){this.mergedCellsCollection.shiftCollections("left",e,t)}function Z(e,t,r){"auto"!==r&&this.mergedCellsCollection.shiftCollections("down",e,t)}function J(e,t){this.mergedCellsCollection.shiftCollections("up",e,t)}function ee(e,t){"Autofill.fill"===t&&this.autofillCalculations.recreateAfterDataPopulation(e)}function te(e,t){if(t&&"area"===t){const t=this.hot.getSelectedRangeLast(),r=this.mergedCellsCollection.getWithinRange(t);(0,d.arrayEach)(r,(r=>{t.getBottomEndCorner().row===r.getLastRow()&&t.getBottomEndCorner().col===r.getLastColumn()&&(e[2]=r.row,e[3]=r.col)}))}}function re(e,t,r,n){if(r)return this.selectionCalculations.getSelectedMergedCellClassName(e,t,r,n)}function ne(){return this.selectionCalculations.getSelectedMergedCellClassNameToRemove()}function se(e,t,r,n){if(!(n instanceof MouseEvent))return;const s=this.hot.getSelectedRangeLast(),i=this.mergedCellsCollection.getByRange(s);if(!i)return;const o=this.hot._createCellCoords(i.row,i.col),a=this.hot._createCellCoords(i.row+i.rowspan-1,i.col+i.colspan-1);return 0===this.hot.selection.getLayerLevel()&&s.isEqual(this.hot._createCellRange(o,o,a))}function ie(e,t,r){if(this.hot.getSettings().rowHeaders||"bottom"===r||"bottom_inline_start_corner"===r)return e;let n,s;if("master"===r)n=this.hot.getFirstRenderedVisibleColumn(),s=this.hot.getLastRenderedVisibleColumn();else{const e=this.hot.view.getOverlayByName(r);n=this.hot.columnIndexMapper.getVisualFromRenderableIndex(e.clone.wtTable.getFirstRenderedColumn()),s=this.hot.columnIndexMapper.getVisualFromRenderableIndex(e.clone.wtTable.getLastRenderedColumn())}if(!this.mergedCellsCollection.get(t,n))return e;const i=this.hot._createCellCoords(t,n),o=this.hot._createCellCoords(t,s),a=this.hot._createCellRange(i,i,o),l=this.mergedCellsCollection.getWithinRange(a,!0),h=l.reduce(((e,t)=>{let{rowspan:r}=t;return Math.max(e,r)}),1);let u=0;return l.length>1&&l[0].rowspan{let{rowspan:s}=n,i=0;i="top"===r||"top_inline_start_corner"===r?Math.min(h,this.hot.view.countNotHiddenFixedRowsTop()-t):s-u,e=Math.max(null!=e?e:0,T(x,this,oe).call(this,t,i))})),e}function oe(e,t){const r=this.hot.view.getStylesHandler(),n=this.hot.view.getDefaultRowHeight(),s=this.hot.getPlugin("autoRowSize");let i=0;for(let a=e;a{"use strict";t.__esModule=!0,t.createMergeCellRenderer=function(e){const{hot:t}=e,{rowIndexMapper:r,columnIndexMapper:s}=t;return{before:function(){},after:function(i,o,a){const l=e.mergedCellsCollection.get(o,a);if(!(0,n.isObject)(l))return i.removeAttribute("rowspan"),i.removeAttribute("colspan"),void(i.style.display="");const{row:h,col:u,colspan:c,rowspan:d}=l,[p,g]=e.translateMergedCellToRenderable(h,d,u,c),f=e.getSetting("virtualized"),m=p-r.getRenderableFromVisualIndex(o)+1,y=g-s.getRenderableFromVisualIndex(a)+1;let E=r.getNearestNotHiddenIndex(h,1),w=s.getNearestNotHiddenIndex(u,1);if(f){const e=t.view.getActiveOverlayName();["top","top_inline_start_corner"].includes(e)||(E=Math.max(E,t.getFirstRenderedVisibleRow())),["inline_start","top_inline_start_corner","bottom_inline_start_corner"].includes(e)||(w=Math.max(w,t.getFirstRenderedVisibleColumn()))}const C=Math.min(d,m),v=Math.min(c,y);E===o&&w===a?(i.setAttribute("rowspan",C),i.setAttribute("colspan",v)):(i.removeAttribute("rowspan"),i.removeAttribute("colspan"),i.style.display="none")}}};var n=r(25499)},5388:(e,t,r)=>{"use strict";t.__esModule=!0,t.getClassesToAdd=function(e,t,r){const s=[];if(!1===r)return s;e.isColumnSorted(t)&&e.getNumberOfSortedColumns()>1&&s.push(`${n}-${e.getIndexOfColumnInSortQueue(t)+1}`);return s},t.getClassesToRemove=function(e){const t=e.className.split(" "),r=new RegExp(`^${n}-[0-9]{1,2}$`);return t.filter((e=>r.test(e)))},r(15724),r(14846),r(27458);const n="sort"},76941:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(73500);t.PLUGIN_KEY=n.PLUGIN_KEY,t.PLUGIN_PRIORITY=n.PLUGIN_PRIORITY,t.MultiColumnSorting=n.MultiColumnSorting},73500:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0;var s=n(r(85707)),i=r(51206),o=r(80118),a=r(41191),l=r(62577),h=r(93645),u=r(97624),c=r(5388),d=r(92399);const p=t.PLUGIN_KEY="multiColumnSorting",g=t.PLUGIN_PRIORITY=170,f="columnSorting",m=p;(0,o.registerRootComparator)(p,h.rootComparator);class y extends i.ColumnSorting{constructor(){super(...arguments),(0,s.default)(this,"pluginKey",p)}static get PLUGIN_KEY(){return p}static get PLUGIN_PRIORITY(){return g}isEnabled(){return super.isEnabled()}enablePlugin(){!this.enabled&&this.hot.getSettings()[this.pluginKey]&&this.hot.getSettings()[f]&&((0,u.warnAboutPluginsConflict)(),this.hot.getPlugin(f).disablePlugin()),super.enablePlugin()}disablePlugin(){super.disablePlugin()}registerShortcuts(){super.registerShortcuts(),this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Shift","Enter"]],callback:()=>{const{highlight:e}=this.hot.getSelectedRangeLast();return-1===e.row&&e.col>=0&&this.sort(this.getNextSortConfig(e.col,i.APPEND_COLUMN_CONFIG_STRATEGY)),!1},runOnlyIf:()=>{var e,t;const r=null===(e=this.hot.getSelectedRangeLast())||void 0===e?void 0:e.highlight;return r&&(null===(t=this.hot.getSelectedRangeLast())||void 0===t?void 0:t.isSingle())&&this.hot.selection.isCellVisible(r)&&r.isHeader()},relativeToGroup:d.EDITOR_EDIT_GROUP,position:"before",group:m})}unregisterShortcuts(){super.unregisterShortcuts(),this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(m)}sort(e){super.sort(e)}clearSort(){super.clearSort()}isSorted(){return super.isSorted()}getSortConfig(e){return super.getSortConfig(e)}setSortConfig(e){super.setSortConfig(e)}getNormalizedSortConfigs(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return Array.isArray(e)?e:[e]}updateHeaderClasses(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n{"use strict";t.__esModule=!0,t.rootComparator=function(e,t){return function(r,s){const[,...i]=r,[,...o]=s;return function r(s){const a=e[s],l=t[s],h=i[s],u=o[s],c=l.multiColumnSorting,d=(c.compareFunctionFactory?c.compareFunctionFactory:(0,n.getCompareFunctionFactory)(l.type))(a,l,c)(h,u);if(d===n.DO_NOT_SWAP){const e=s+1;if(void 0!==t[e])return r(e)}return d}(0)}};var n=r(80118)},97624:(e,t,r)=>{"use strict";t.__esModule=!0,t.warnAboutPluginsConflict=function(){(0,n.warn)(s.toSingleLine`Plugins \`columnSorting\` and \`multiColumnSorting\` should not be enabled simultaneously. + Only \`multiColumnSorting\` will work. The \`columnSorting\` plugin will be disabled.`)};var n=r(14859),s=r(21595)},98129:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(24148);t.PLUGIN_KEY=n.PLUGIN_KEY,t.PLUGIN_PRIORITY=n.PLUGIN_PRIORITY,t.MultipleSelectionHandles=n.MultipleSelectionHandles},24148:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(15724);var s=n(r(85707)),i=r(62577),o=r(25046),a=r(75089);const l=t.PLUGIN_KEY="multipleSelectionHandles",h=t.PLUGIN_PRIORITY=160;class u extends a.BasePlugin{constructor(){super(...arguments),(0,s.default)(this,"dragged",[]),(0,s.default)(this,"lastSetCell",null)}static get PLUGIN_KEY(){return l}static get PLUGIN_PRIORITY(){return h}isEnabled(){return(0,o.isMobileBrowser)()}enablePlugin(){this.enabled||(this.registerListeners(),super.enablePlugin())}registerListeners(){const e=this,{rootElement:t}=this.hot;function r(t){if(1===e.dragged.length)return e.dragged.splice(0,e.dragged.length),!0;const r=e.dragged.indexOf(t);if(-1===r)return!1;0===r?e.dragged=e.dragged.slice(0,1):1===r&&(e.dragged=e.dragged.slice(-1))}this.eventManager.addEventListener(t,"touchstart",(t=>{let r;return(0,i.hasClass)(t.target,"topSelectionHandle-HitArea")?(r=e.hot.getSelectedRangeLast(),e.dragged.push("top"),e.touchStartRange={width:r.getWidth(),height:r.getHeight(),direction:r.getDirection()},t.preventDefault(),!1):(0,i.hasClass)(t.target,"bottomSelectionHandle-HitArea")?(r=e.hot.getSelectedRangeLast(),e.dragged.push("bottom"),e.touchStartRange={width:r.getWidth(),height:r.getHeight(),direction:r.getDirection()},t.preventDefault(),!1):void 0})),this.eventManager.addEventListener(t,"touchend",(t=>(0,i.hasClass)(t.target,"topSelectionHandle-HitArea")?(r.call(e,"top"),e.touchStartRange=void 0,t.preventDefault(),!1):(0,i.hasClass)(t.target,"bottomSelectionHandle-HitArea")?(r.call(e,"bottom"),e.touchStartRange=void 0,t.preventDefault(),!1):void 0)),this.eventManager.addEventListener(t,"touchmove",(t=>{const{rootDocument:r}=this.hot;let n,s,i,o,a,l;if(0===e.dragged.length)return;const h=r.elementFromPoint(t.touches[0].clientX,t.touches[0].clientY);h&&h!==e.lastSetCell&&("TD"!==h.nodeName&&"TH"!==h.nodeName||(n=e.hot.getCoords(h),-1===n.col&&(n.col=0),s=e.hot.getSelectedRangeLast(),i=s.getWidth(),o=s.getHeight(),a=s.getDirection(),1===i&&1===o&&e.hot.selection.setRangeEnd(n),l=e.getCurrentRangeCoords(s,n,e.touchStartRange.direction,a,e.dragged[0]),null!==l.start&&e.hot.selection.setRangeStart(l.start),e.hot.selection.setRangeEnd(l.end),e.lastSetCell=h),t.preventDefault())}))}getCurrentRangeCoords(e,t,r,n,s){const i=e.getTopStartCorner(),o=e.getBottomEndCorner(),a=e.getBottomStartCorner(),l=e.getTopEndCorner();let h={start:null,end:null};switch(r){case"NE-SW":switch(n){case"NE-SW":case"NW-SE":h="top"===s?{start:this.hot._createCellCoords(t.row,e.highlight.col),end:this.hot._createCellCoords(a.row,t.col)}:{start:this.hot._createCellCoords(e.highlight.row,t.col),end:this.hot._createCellCoords(t.row,i.col)};break;case"SE-NW":"bottom"===s&&(h={start:this.hot._createCellCoords(o.row,t.col),end:this.hot._createCellCoords(t.row,i.col)})}break;case"NW-SE":switch(n){case"NE-SW":"top"===s?h={start:t,end:a}:h.end=t;break;case"NW-SE":"top"===s?h={start:t,end:o}:h.end=t;break;case"SE-NW":"top"===s?h={start:t,end:i}:h.end=t;break;case"SW-NE":"top"===s?h={start:t,end:l}:h.end=t}break;case"SW-NE":switch(n){case"NW-SE":h="bottom"===s?{start:this.hot._createCellCoords(t.row,i.col),end:this.hot._createCellCoords(a.row,t.col)}:{start:this.hot._createCellCoords(i.row,t.col),end:this.hot._createCellCoords(t.row,o.col)};break;case"SW-NE":h="top"===s?{start:this.hot._createCellCoords(e.highlight.row,t.col),end:this.hot._createCellCoords(t.row,o.col)}:{start:this.hot._createCellCoords(t.row,i.col),end:this.hot._createCellCoords(i.row,t.col)};break;case"SE-NW":"bottom"===s?h={start:this.hot._createCellCoords(t.row,l.col),end:this.hot._createCellCoords(i.row,t.col)}:"top"===s&&(h={start:a,end:t})}break;case"SE-NW":switch(n){case"NW-SE":case"NE-SW":case"SW-NE":"top"===s&&(h.end=t);break;case"SE-NW":"top"===s?h.end=t:h={start:t,end:i}}}return h}isDragged(){return this.dragged.length>0}}t.MultipleSelectionHandles=u},11859:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(80632);t.PLUGIN_KEY=n.PLUGIN_KEY,t.PLUGIN_PRIORITY=n.PLUGIN_PRIORITY,t.NestedHeaders=n.NestedHeaders},80632:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834),r(15724),r(14846),r(69655);var s=n(r(85707)),i=r(62577),o=r(22137),a=r(21595),l=r(77661),h=r(14859),u=r(76717),c=r(75089),d=n(r(94612)),p=n(r(94484));function g(e,t,r){f(e,t),t.set(e,r)}function f(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function m(e,t,r){return e.set(E(e,t),r),r}function y(e,t){return e.get(E(e,t))}function E(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}const w=t.PLUGIN_KEY="nestedHeaders",C=t.PLUGIN_PRIORITY=280;var v=new WeakMap,R=new WeakMap,S=new WeakMap,T=new WeakMap,N=new WeakMap,M=new WeakSet;class _ extends c.BasePlugin{constructor(){var e,t;super(...arguments),f(e=this,t=M),t.add(e),g(this,v,new d.default),g(this,R,null),g(this,S,null),g(this,T,!1),g(this,N,null),(0,s.default)(this,"ghostTable",new p.default(this.hot,((e,t)=>this.getHeaderSettings(e,t)))),(0,s.default)(this,"detectedOverlappedHeaders",!1)}static get PLUGIN_KEY(){return w}static get PLUGIN_PRIORITY(){return C}isEnabled(){return!!this.hot.getSettings()[w]}enablePlugin(){var e=this;if(this.enabled)return;const{nestedHeaders:t}=this.hot.getSettings();Array.isArray(t)&&Array.isArray(t[0])||(0,h.warn)(a.toSingleLine`Your Nested Headers plugin configuration is invalid. The settings has to be\x20 + passed as an array of arrays e.q. [['A1', { label: 'A2', colspan: 2 }]]`),this.addHook("init",(()=>E(M,this,G).call(this))),this.addHook("afterLoadData",(function(){for(var t=arguments.length,r=new Array(t),n=0;nE(M,this,b).call(this))),this.addHook("afterSelectionFocusSet",(()=>E(M,this,b).call(this))),this.addHook("beforeViewportScrollHorizontally",(function(){for(var t=arguments.length,r=new Array(t),n=0;nE(M,this,U).call(this,e))),this.addHook("modifyColWidth",(function(){for(var t=arguments.length,r=new Array(t),n=0;nE(M,this,b).call(this))),this.hot.rowIndexMapper.addLocalHook("cacheUpdated",(()=>E(M,this,b).call(this))),super.enablePlugin(),this.updatePlugin()}updatePlugin(){if(!this.hot.view)return;const{nestedHeaders:e}=this.hot.getSettings();y(v,this).setColumnsLimit(this.hot.countCols()),Array.isArray(e)&&(this.detectedOverlappedHeaders=y(v,this).setState(e)),this.detectedOverlappedHeaders&&(0,h.warn)(a.toSingleLine`Your Nested Headers plugin setup contains overlapping headers. This kind of configuration\x20 + is currently not supported.`),this.enabled&&this.hot.columnIndexMapper.hidingMapsCollection.getMergedValues().forEach(((e,t)=>{const r=!0===e?"hide-column":"show-column";y(v,this).triggerColumnModification(r,t)})),!y(R,this)&&this.enabled&&m(R,this,this.hot.columnIndexMapper.createChangesObserver("hiding").subscribe((e=>{e.forEach((e=>{let{op:t,index:r,newValue:n}=e;if("replace"===t){const e=!0===n?"hide-column":"show-column";y(v,this).triggerColumnModification(e,r)}})),this.ghostTable.buildWidthsMap()}))),this.ghostTable.setLayersCount(this.getLayersCount()).buildWidthsMap(),super.updatePlugin()}disablePlugin(){this.clearColspans(),y(v,this).clear(),y(R,this).unsubscribe(),m(R,this,null),this.ghostTable.clear(),super.disablePlugin()}getStateManager(){return y(v,this)}getLayersCount(){return y(v,this).getLayersCount()}getHeaderSettings(e,t){return y(v,this).getHeaderSettings(e,t)}clearColspans(){if(!this.hot.view)return;const{_wt:e}=this.hot.view,t=e.getSetting("columnHeaders").length,r=e.wtTable.THEAD,n=e.wtOverlays.topOverlay.clone.wtTable.THEAD,s=e.wtOverlays.topInlineStartCornerOverlay?e.wtOverlays.topInlineStartCornerOverlay.clone.wtTable.THEAD:null;for(let e=0;e{var o;const{columnIndexMapper:a,view:l}=this.hot;let h=a.getVisualFromRenderableIndex(n);null===h&&(h=n),s.removeAttribute("colspan"),(0,i.removeClass)(s,"hiddenHeader"),(0,i.removeClass)(s,"hiddenHeaderText");const{colspan:u,isHidden:c,isPlaceholder:d,headerClassNames:p}=null!==(o=y(v,this).getHeaderSettings(e,h))&&void 0!==o?o:{label:""};if(d||c)(0,i.addClass)(s,"hiddenHeader");else if(u>1){var g,f,m;const{wtOverlays:e}=l._wt,t=null===(g=e.topInlineStartCornerOverlay)||void 0===g?void 0:g.clone.wtTable.THEAD.contains(s),o=null===(f=e.inlineStartOverlay)||void 0===f?void 0:f.clone.wtTable.THEAD.contains(s);(null===(m=e.topOverlay)||void 0===m?void 0:m.clone.wtTable.THEAD.contains(s))&&h1&&s.setAttribute("colspan",a)}if(this.hot.view.appendColHeader(h,s,(function(){return t.getColumnHeaderValue(...arguments)}),e),!d&&!c){const e=s.querySelector("div.relative");e&&p&&p.length>0&&((0,i.removeClass)(e,this.hot.getColumnMeta(h).headerClassName),(0,i.addClass)(e,p))}}}getColumnHeaderValue(e,t){var r;const{isHidden:n,isPlaceholder:s}=null!==(r=y(v,this).getHeaderSettings(t,e))&&void 0!==r?r:{};return s||n?"":this.hot.getColHeader(e,t)}destroy(){m(v,this,null),null!==y(R,this)&&(y(R,this).unsubscribe(),m(R,this,null)),super.destroy()}_getHeaderTreeNodeDataByCoords(e){if(!(e.row>=0||e.col<0))return y(v,this).getHeaderTreeNodeData(e.row,e.col)}}function b(){var e;const t=null===(e=this.hot)||void 0===e?void 0:e.getSelectedRangeLast();if(!t)return;const{highlight:r}=t;if(r.isHeader()&&r.col>=0){const e=y(v,this).findLeftMostColumnIndex(r.row,r.col),t=this.hot.selection.highlight.getFocus();t.visualCellRange.highlight.col=e,t.visualCellRange.from.col=e,t.visualCellRange.to.col=e,t.commit()}}function O(e,t){var r;const n=this.hot.getSelectedRangeLast();if(!n)return e;const{highlight:s}=n,{navigableHeaders:i}=this.hot.getSettings(),o=this.hot.selection.isSelectedByColumnHeader(),a=i?s.row:null===(r=y(N,this))||void 0===r?void 0:r.row,l=o?e:s.col,h=a<0&&l>=0;if(m(N,this,null),!h)return e;const u=this.hot.getFirstFullyVisibleColumn(),c=this.hot.getLastFullyVisibleColumn(),d=c-u+1,p=y(v,this).findLeftMostColumnIndex(a,l),g=y(v,this).findRightMostColumnIndex(a,l),f=g-p+1;if(pc)return p;if(o){let e=null;return p>=u&&g>c?f>d?(t.value="start",e=p):(t.value="end",e=g):pd?(t.value="end",e=g):(t.value="start",e=p)),e}return p<=u?p:g}function A(e,t,r){const n=y(v,this).getHeaderTreeNodeData(t,e);if(!n)return e;const{columnCursor:s,selectionType:i,selectionWidth:o}=r,{isRoot:a,colspan:l}=y(v,this).getHeaderSettings(t,e);if(i===u.HEADER_TYPE){if(!a)return n.columnIndex}else if(i===u.ACTIVE_HEADER_TYPE&&(l>o-s||!a))return null;return e}function I(e,t,r){let{columnHeadersCount:n}=r;if(0!==n)for(let r=0;r=0||1===i-a+1)break;for(let t=i;t<=a;t++)for(let r=n;r<=o;r++){var s;const n=l+r,o=t-i;if(0===o)continue;!1===(null===(s=y(v,this).getHeaderTreeNodeData(r,t))||void 0===s?void 0:s.isRoot)&&(e[n][o]="")}}}function x(e,t,r,n){this._getHeaderTreeNodeDataByCoords(t)&&(n.column=!0)}function P(e,t){const r=this._getHeaderTreeNodeDataByCoords(t);if(!r)return;m(S,this,t.clone()),m(T,this,!0);const{selection:n}=this.hot,s=n.isSelected()?n.getSelectedRange().current():null,i=[],{columnIndex:o,origColspan:a}=r,h=!n.inInSelection(t);e.shiftKey&&s?t.cols.from.col?i.push(s.getTopStartCorner().col,o+a-1,t.row):i.push(o,o+a-1,t.row):((0,l.isLeftClick)(e)||(0,l.isRightClick)(e)&&h||(0,l.isTouchEvent)(e))&&i.push(o,o+a-1,t.row),n.selectColumns(...i)}function L(e,t,r,n){if(!this.hot.view.isMouseDown()||n.column)return;const s=this._getHeaderTreeNodeDataByCoords(t);if(!s)return;const{columnIndex:i,origColspan:a}=s,l=this.hot.getSelectedRangeLast(),h=l.getTopStartCorner(),u=l.getBottomEndCorner(),{from:c}=l;n.column=!0,n.cell=!0;const d=[],p=(0,o.clamp)(t.row,-1/0,-1);t.colc.col?d.push(h.col,i+a-1,p):d.push(i,i+a-1,p),this.hot.selection.selectColumns(...d)}function D(){m(T,this,!1)}function k(){const{navigableHeaders:e}=this.hot.getSettings();if(!this.hot.view.isMouseDown()||!y(T,this)||!e)return;const t=this.hot.getSelectedRangeLast(),r=t.getTopStartCorner().col,n=t.getBottomEndCorner().col,{columnIndex:s,origColspan:i}=y(v,this).getHeaderTreeNodeData(y(S,this).row,y(S,this).col);if(t.setHighlight(y(S,this)),i>t.getWidth()||sn){const e=y(v,this).findTopMostEntireHeaderLevel((0,o.clamp)(r,s,s+i-1),(0,o.clamp)(n,s,s+i-1));t.highlight.row=e,t.highlight.col=t.from.col}}function H(e){const{highlight:t}=this.hot.getSelectedRangeLast(),r=this.hot._createCellCoords(t.row+e.row,t.col+e.col);if(!(r.isHeader()&&r.col>=0))return;const n=y(v,this).findLeftMostColumnIndex(r.row,r.col),s=y(v,this).findRightMostColumnIndex(r.row,r.col);if(e.col<0){const r=t.col>=n&&t.col<=s?n-1:s,i=this.hot.columnIndexMapper.getNearestNotHiddenIndex(r,-1);e.col=null===i?-this.hot.view.countRenderableColumnsInRange(0,t.col):-Math.max(this.hot.view.countRenderableColumnsInRange(i,t.col)-1,1)}else if(e.col>0){const r=t.col>=n&&t.col<=s?s+1:n,i=this.hot.columnIndexMapper.getNearestNotHiddenIndex(r,1);e.col=null===i?this.hot.view.countRenderableColumnsInRange(t.col,this.hot.countCols()):Math.max(this.hot.view.countRenderableColumnsInRange(t.col,i)-1,1)}}function F(e,t,r){const n=e.row,s=this._getHeaderTreeNodeDataByCoords({row:n,col:e.col}),i=this._getHeaderTreeNodeDataByCoords({row:n,col:t.col});m(N,this,r.clone()),t.col=e.col&&(s&&(e.col=s.columnIndex),i&&(t.col=i.columnIndex+i.origColspan-1))}function U(e){e.length=0;for(let t=0;t=0&&(n=!1),(0,o.isNumeric)(i)&&ir?e:r}function W(e,t,r){var n;const{label:s}=null!==(n=y(v,this).getHeaderTreeNodeData(r,t))&&void 0!==n?n:{label:""};return s}function Y(e,t){if(e<0)return this.hot.getCell(e,y(v,this).findLeftMostColumnIndex(e,t),!0)}function G(){this.updatePlugin()}function j(e,t){t||this.updatePlugin()}t.NestedHeaders=_},94574:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834);var s=r(10587),i=n(r(51097));function o(e,t,r){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}function a(e,t){return e.get(l(e,t))}function l(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var h=new WeakMap,u=new WeakMap,c=new WeakMap;t.default=class{constructor(e){var t,r,n;o(this,h,new Map),o(this,u,new Map),o(this,c,null),r=this,n=e,(t=c).set(l(t,r),n)}getRoots(){return Array.from(a(h,this).values())}getRootByColumn(e){let t;return a(u,this).has(e)&&(t=a(h,this).get(a(u,this).get(e))),t}getNode(e,t){const r=this.getRootByColumn(t);if(!r)return;const n=t-a(u,this).get(t);let s,i=0;return r.walkDown((r=>{const{data:{origColspan:o,headerLevel:a}}=r;if(e===a){if(n>=i&&n<=i+o-1)return s=r,s.data.isRoot=t===s.data.columnIndex,!1;i+=o}})),s}rebuildTreeIndex(){let e=0;a(u,this).clear(),(0,s.arrayEach)(a(h,this),(t=>{let[,{data:{colspan:r}}]=t;for(let t=e;t3&&void 0!==arguments[3]?arguments[3]:1;const o=a(c,this).getHeadersSettings(r,t,n);r+=1,(0,s.arrayEach)(o,(n=>{const s={...n,headerLevel:r-1,columnIndex:t};let o;1===r?(e.data=s,o=e):(o=new i.default(s),e.addChild(o)),r{"use strict";var n=r(96784);t.__esModule=!0,r(67834),r(15724),r(94364);var s=r(10587),i=n(r(67082)),o=n(r(94574)),a=r(95901),l=r(69390),h=r(51097);function u(e,t,r){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}function c(e,t,r){return e.set(p(e,t),r),r}function d(e,t){return e.get(p(e,t))}function p(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var g=new WeakMap,f=new WeakMap,m=new WeakMap;t.default=class{constructor(){u(this,g,new i.default),u(this,f,new o.default(d(g,this))),u(this,m,[[]])}setState(e){d(g,this).setData(e);let t=!1;try{d(f,this).buildTree()}catch(e){d(f,this).clear(),d(g,this).clear(),t=!0}return c(m,this,(0,l.generateMatrix)(d(f,this).getRoots())),t}setColumnsLimit(e){d(g,this).setColumnsLimit(e)}mergeStateWith(e){const t=(0,s.arrayMap)(e,(e=>{let{row:t,...r}=e;return{row:t<0?this.rowCoordsToLevel(t):t,...r}}));d(g,this).mergeWith(t),d(f,this).buildTree(),c(m,this,(0,l.generateMatrix)(d(f,this).getRoots()))}mapState(e){d(g,this).map(e),d(f,this).buildTree(),c(m,this,(0,l.generateMatrix)(d(f,this).getRoots()))}mapNodes(e){return(0,s.arrayReduce)(d(f,this).getRoots(),((t,r)=>(r.walkDown((r=>{const n=e(r.data);void 0!==n&&t.push(n)})),t)),[])}triggerNodeModification(e,t,r){t<0&&(t=this.rowCoordsToLevel(t));const n=d(f,this).getNode(t,r);let s;return n&&(s=(0,a.triggerNodeModification)(e,n,r),c(m,this,(0,l.generateMatrix)(d(f,this).getRoots()))),s}triggerColumnModification(e,t){return this.triggerNodeModification(e,-1,t)}rowCoordsToLevel(e){if(e>=0)return null;const t=e+Math.max(this.getLayersCount(),1);return t<0?null:t}levelToRowCoords(e){if(e<0)return null;const t=e-Math.max(this.getLayersCount(),1);return t>=0?null:t}getHeaderSettings(e,t){var r,n;return e<0&&(e=this.rowCoordsToLevel(e)),null===e||e>=this.getLayersCount()?null:null!==(r=null===(n=d(m,this)[e])||void 0===n?void 0:n[t])&&void 0!==r?r:null}getHeaderTreeNodeData(e,t){const r=this.getHeaderTreeNode(e,t);return r?{...r.data}:null}getHeaderTreeNode(e,t){if(e<0&&(e=this.rowCoordsToLevel(e)),null===e||e>=this.getLayersCount())return null;const r=d(f,this).getNode(e,t);return r||null}findTopMostEntireHeaderLevel(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;const r=t-e+1;let n=!1,s=null;for(let i=e;i<=t;i++){const o=d(f,this).getRootByColumn(i);if(!o)break;n=!0,o.walkDown((n=>{const{columnIndex:i,headerLevel:o,origColspan:a,isHidden:l}=n.data;l||a<=r&&i>=e&&i+a-1<=t&&(null===s||o=0;){var i;const{isRoot:t}=null!==(i=this.getHeaderSettings(e,s))&&void 0!==i?i:{isRoot:!0};if(t)break;s-=1}return s}findRightMostColumnIndex(e,t){var r;const{isRoot:n,origColspan:s}=null!==(r=this.getHeaderSettings(e,t))&&void 0!==r?r:{isRoot:!0,origColspan:1};if(n)return t+s-1;let i=t+1;for(;i{"use strict";t.__esModule=!0,t.generateMatrix=function(e){const t=[];return(0,n.arrayEach)(e,(e=>{e.walkDown((e=>{const r=e.data,{origColspan:n,columnIndex:o,headerLevel:a,crossHiddenColumns:l}=r,h=function(e,t){let r;Array.isArray(e[t])?r=e[t]:(r=[],e[t]=r);return r}(t,a);let u=!1;for(let e=o;e{"use strict";t.__esModule=!0,t.collapseNode=function e(t){var r;const{data:o,childs:a}=t;if(o.isCollapsed||o.isHidden||o.origColspan<=1)return{rollbackModification:()=>{},affectedColumns:[],colspanCompensation:0};if((0,i.isNodeReflectsFirstChildColspan)(t))return e(a[0]);o.isCollapsed=!0;const l=a.slice(1),h=new Set;if(l.length>0)(0,n.arrayEach)(l,(e=>{(0,i.traverseHiddenNodeColumnIndexes)(e,(e=>{h.add(e)})),e.data.clonedTree=e.cloneTree(),e.walkDown((e=>{let{data:t}=e;t.isHidden=!0}))}));else{const{origColspan:e,columnIndex:t}=o;for(let r=1;r{const{data:t}=e;t.colspan-=u,t.colspan<=1?(t.colspan=1,t.isCollapsed=!0):(0,i.isNodeReflectsFirstChildColspan)(e)&&(t.isCollapsed=(0,i.getFirstChildProperty)(e,"isCollapsed"))})),{rollbackModification:()=>(0,s.expandNode)(t),affectedColumns:Array.from(h),colspanCompensation:u}},r(71336),r(41558),r(17663),r(68630),r(79645),r(89858),r(8620);var n=r(10587),s=r(28061),i=r(13715)},28061:(e,t,r)=>{"use strict";t.__esModule=!0,t.expandNode=function e(t){const{data:r,childs:o}=t;if(!r.isCollapsed||r.isHidden||r.origColspan<=1)return{rollbackModification:()=>{},affectedColumns:[],colspanCompensation:0};if((0,i.isNodeReflectsFirstChildColspan)(t))return e(o[0]);r.isCollapsed=!1;const a=o.slice(1),l=new Set;let h=0;if(a.length>0)(0,n.arrayEach)(a,(e=>{e.replaceTreeWith(e.data.clonedTree),e.data.clonedTree=null;const t=e.data;h+=t.colspan,(0,i.traverseHiddenNodeColumnIndexes)(e,(e=>{l.add(e)}))}));else{const{colspan:e,origColspan:t,columnIndex:n}=r;h=t-e;for(let e=1;e{const{data:t}=e;t.colspan+=h,t.colspan>=t.origColspan?(t.colspan=t.origColspan,t.isCollapsed=!1):(0,i.isNodeReflectsFirstChildColspan)(e)&&(t.isCollapsed=(0,i.getFirstChildProperty)(e,"isCollapsed"))})),{rollbackModification:()=>(0,s.collapseNode)(t),affectedColumns:Array.from(l),colspanCompensation:h}},r(71336),r(41558),r(17663),r(68630),r(79645),r(89858),r(8620);var n=r(10587),s=r(29826),i=r(13715)},90187:(e,t,r)=>{"use strict";t.__esModule=!0,t.hideColumn=function(e,t){if(!Number.isInteger(t))throw new Error("The passed gridColumnIndex argument has invalid type.");if(e.childs.length>0)throw new Error(n.toSingleLine`The passed node is not the last node on the tree. Only for\x20 +the last node, the hide column modification can be applied.`);const{crossHiddenColumns:r}=e.data;if(r.includes(t))return;let s=!1;if(e.walkUp((e=>{const{data:{collapsible:t}}=e;if(t)return s=!0,!1})),s)return;e.walkUp((e=>{const{data:r}=e;r.crossHiddenColumns.push(t),r.colspan>1?r.colspan-=1:r.isHidden=!0}))},r(67834),r(15724);var n=r(21595)},95901:(e,t,r)=>{"use strict";t.__esModule=!0,t.triggerNodeModification=function(e,t,r){if(!a.has(e))throw new Error(`The node modifier action ("${e}") does not exist.`);return a.get(e)(t,r)},r(67834);var n=r(29826),s=r(28061),i=r(90187),o=r(65346);const a=new Map([["collapse",n.collapseNode],["expand",s.expandNode],["hide-column",i.hideColumn],["show-column",o.showColumn]])},65346:(e,t,r)=>{"use strict";t.__esModule=!0,t.showColumn=function(e,t){if(!Number.isInteger(t))throw new Error("The passed gridColumnIndex argument has invalid type.");if(e.childs.length>0)throw new Error(n.toSingleLine`The passed node is not the last node on the tree. Only for\x20 +the last node, the show column modification can be applied.`);const{crossHiddenColumns:r}=e.data;if(!r.includes(t))return;let s=!1;if(e.walkUp((e=>{const{data:{collapsible:t}}=e;if(t)return s=!0,!1})),s)return;e.walkUp((e=>{const{data:r}=e;r.crossHiddenColumns.splice(r.crossHiddenColumns.indexOf(t),1),!r.isHidden&&r.colspan{"use strict";function r(e,t){let{childs:r}=e;if(0!==r.length)return r[0].data[t]}t.__esModule=!0,t.getFirstChildProperty=r,t.isNodeReflectsFirstChildColspan=function(e){return r(e,"origColspan")===e.data.origColspan},t.traverseHiddenNodeColumnIndexes=function(e,t){e.walkDown((e=>{let{data:r,childs:n}=e;if(!r.isHidden&&(t(r.columnIndex),0===n.length))for(let e=1;e{"use strict";t.__esModule=!0,t.normalizeSettings=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1/0;const r=[];if(0===t)return r;(0,n.arrayEach)(e,(e=>{const a=[];let l=0;r.push(a),(0,n.arrayEach)(e,(e=>{const r=(0,o.createDefaultHeaderSettings)();if((0,s.isObject)(e)){const{label:t,colspan:n,headerClassName:s}=e;r.label=(0,i.stringify)(t),"number"==typeof n&&n>1&&(r.colspan=n,r.origColspan=n),"string"==typeof s&&(r.headerClassNames=[...s.split(" ")])}else r.label=(0,i.stringify)(e);l+=r.origColspan;let n=!1;if(l>=t&&(r.colspan=r.origColspan-(l-t),r.origColspan=r.colspan,n=!0),a.push(r),r.colspan>1)for(let e=0;ee.length)));return(0,n.arrayEach)(r,(e=>{if(e.length(0,o.createDefaultHeaderSettings)()));e.splice(e.length,0,...t)}})),r},r(15724);var n=r(10587),s=r(25499),i=r(70505),o=r(12701)},67082:(e,t,r)=>{"use strict";t.__esModule=!0,r(67834),r(15724);var n=r(25499),s=r(10587),i=r(28524);function o(e,t,r){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}function a(e,t){return e.get(h(e,t))}function l(e,t,r){return e.set(h(e,t),r),r}function h(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}const u=t.HEADER_CONFIGURABLE_PROPS=["label","collapsible"];var c=new WeakMap,d=new WeakMap,p=new WeakMap;t.default=class{constructor(){o(this,c,[]),o(this,d,0),o(this,p,1/0)}setColumnsLimit(e){l(p,this,e)}setData(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];l(c,this,(0,i.normalizeSettings)(e,a(p,this))),l(d,this,a(c,this).length)}getData(){return a(c,this)}mergeWith(e){(0,s.arrayEach)(e,(e=>{let{row:t,col:r,...s}=e;const i=this.getHeaderSettings(t,r);null!==i&&(0,n.extend)(i,s,u)}))}map(e){(0,s.arrayEach)(a(c,this),(t=>{(0,s.arrayEach)(t,(t=>{const r=e({...t});(0,n.isObject)(r)&&(0,n.extend)(t,r,u)}))}))}getHeaderSettings(e,t){var r;if(e>=a(d,this)||e<0)return null;const n=a(c,this)[e];return!1===Array.isArray(n)||t>=n.length?null:null!==(r=n[t])&&void 0!==r?r:null}getHeadersSettings(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;const n=[];if(e>=a(d,this)||e<0)return n;const s=a(c,this)[e];let i=0;for(let e=t;e1&&(e+=t.colspan-1),i===r)break;if(i>r)throw new Error("The last column settings cannot overlap the other header layers")}return n}getLayersCount(){return a(d,this)}getColumnsCount(){return a(d,this)>0?a(c,this)[0].length:0}clear(){l(c,this,[]),l(d,this,0)}}},12701:(e,t)=>{"use strict";t.__esModule=!0,t.createDefaultHeaderSettings=function(){let{label:e="",colspan:t=1,origColspan:r=1,collapsible:n=!1,crossHiddenColumns:s=[],isCollapsed:i=!1,isHidden:o=!1,isRoot:a=!1,isPlaceholder:l=!1,headerClassNames:h=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{label:e,colspan:t,origColspan:r,collapsible:n,isCollapsed:i,crossHiddenColumns:s,isHidden:o,isRoot:a,isPlaceholder:l,headerClassNames:h}},t.createPlaceholderHeaderSettings=function(){return{label:"",isPlaceholder:!0}}},94484:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0;var s=n(r(85707)),i=r(62577);t.default=class{constructor(e,t){(0,s.default)(this,"hot",void 0),(0,s.default)(this,"nestedHeaderSettingsGetter",void 0),(0,s.default)(this,"layersCount",0),(0,s.default)(this,"container",void 0),(0,s.default)(this,"widthsMap",void 0),this.hot=e,this.nestedHeaderSettingsGetter=t,this.widthsMap=this.hot.columnIndexMapper.createAndRegisterIndexMap("nestedHeaders.widthsMap","physicalIndexToValue")}setLayersCount(e){return this.layersCount=e,this}getWidth(e){return this.widthsMap.getValueAtIndex(this.hot.toPhysicalColumn(e))}buildWidthsMap(){const e=this.hot.getCurrentThemeName();this.container=this.hot.rootDocument.createElement("div"),this.container.classList.add("handsontable","htGhostTable","htAutoSize"),e&&this.container.classList.add(e),this._buildGhostTable(this.container),this.hot.rootDocument.body.appendChild(this.container);const t=this.container.querySelectorAll("tr:last-of-type th"),r=t.length;this.widthsMap.clear();for(let e=0;e'),(0,i.fastInnerHTML)(l,e),l.colSpan=h.colspan,n.appendChild(l)}}s.appendChild(n)}n.appendChild(s),e.appendChild(n)}clear(){this.widthsMap.clear(),this.container=null}}},60932:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(15724);var s=n(r(85707)),i=r(22137),o=r(25499),a=r(10587);t.default=class{constructor(e,t){(0,s.default)(this,"hot",void 0),(0,s.default)(this,"data",null),(0,s.default)(this,"plugin",void 0),(0,s.default)(this,"parentReference",new WeakMap),(0,s.default)(this,"cache",{levels:[],levelCount:0,rows:[],nodeInfo:new WeakMap}),this.hot=t,this.plugin=e}setData(e){this.data=e}getData(){return this.data}getRawSourceData(){let e=null;return this.plugin.disableCoreAPIModifiers(),e=this.hot.getSourceData(),this.plugin.enableCoreAPIModifiers(),e}updateWithData(e){this.setData(e),this.rewriteCache()}rewriteCache(){this.cache={levels:[],levelCount:0,rows:[],nodeInfo:new WeakMap},(0,i.rangeEach)(0,this.data.length-1,(e=>{this.cacheNode(this.data[e],0,null)}))}cacheNode(e,t,r){this.cache.levels[t]||(this.cache.levels[t]=[],this.cache.levelCount+=1),this.cache.levels[t].push(e),this.cache.rows.push(e),this.cache.nodeInfo.set(e,{parent:r,row:this.cache.rows.length-1,level:t}),this.hasChildren(e)&&(0,a.arrayEach)(e.__children,(r=>{this.cacheNode(r,t+1,e)}))}getDataObject(e){return null==e?null:this.cache.rows[e]}readTreeNodes(e,t,r,n){let s=!1,i=t;if(isNaN(i)&&i.end)return i;let o=e;return o||(o={__children:this.data},s=!0,i-=1),null!=r&&i===r?{result:o,end:!0}:null!=n&&o===n?{result:i,end:!0}:(i+=1,o.__children&&(0,a.arrayEach)(o.__children,(e=>{if(this.parentReference.set(e,s?null:o),i=this.readTreeNodes(e,i,r,n),isNaN(i)&&i.end)return!1})),i)}mockParent(){const e=this.mockNode();return e.__children=this.data,e}mockNode(){const e={};return(0,o.objectEach)(this.data[0],((t,r)=>{e[r]=null})),e}getRowIndex(e){return null==e?null:this.cache.nodeInfo.get(e).row}getRowIndexWithinParent(e){let t=null;t=isNaN(e)?e:this.getDataObject(e);const r=this.getRowParent(e);return null==r?this.data.indexOf(t):r.__children.indexOf(t)}countAllRows(){const e={__children:this.data};return this.countChildren(e)}countChildren(e){let t=0,r=e;return isNaN(r)||(r=this.getDataObject(r)),r&&r.__children?((0,a.arrayEach)(r.__children,(e=>{t+=1,e.__children&&(t+=this.countChildren(e))})),t):0}getRowParent(e){let t;return t=isNaN(e)?e:this.getDataObject(e),this.getRowObjectParent(t)}getRowObjectParent(e){return e&&"object"==typeof e?this.cache.nodeInfo.get(e).parent:null}getRowLevel(e){let t=null;return t=isNaN(e)?e:this.getDataObject(e),t?this.getRowObjectLevel(t):null}getRowObjectLevel(e){return null==e?null:this.cache.nodeInfo.get(e).level}hasChildren(e){let t=e;return isNaN(t)||(t=this.getDataObject(t)),!(!t.__children||!t.__children.length)}isChild(e){return null!==this.getRowParent(e)}getChild(e,t){var r;return(null===(r=e.__children)||void 0===r?void 0:r[t])||null}isRowHighestLevel(e){return!this.isChild(e)}isParent(e){var t;let r=e;return isNaN(r)||(r=this.getDataObject(r)),r&&!!r.__children&&0!==(null===(t=r.__children)||void 0===t?void 0:t.length)}addChild(e,t){let r=t;this.hot.runHooks("beforeAddChild",e,r);let n=null;e&&(n=this.getRowIndex(e)),this.hot.runHooks("beforeCreateRow",n+this.countChildren(e)+1,1);let s=e;e||(s=this.mockParent()),s.__children||(s.__children=[]),r||(r=this.mockNode()),s.__children.push(r),this.rewriteCache();const i=this.getRowIndex(r);this.hot.rowIndexMapper.insertIndexes(i,1),this.hot.runHooks("afterCreateRow",i,1),this.hot.runHooks("afterAddChild",e,r)}addChildAtIndex(e,t,r){let n,s=r;if(s||(s=this.mockNode()),this.hot.runHooks("beforeAddChild",e,s,t),e){const r=this.getRowIndex(e)+t+1;this.hot.runHooks("beforeCreateRow",r,1),e.__children.splice(t,null,s),this.rewriteCache(),this.plugin.disableCoreAPIModifiers(),this.hot.setSourceDataAtCell(this.getRowIndexWithinParent(e),"__children",e.__children,"NestedRows.addChildAtIndex"),this.hot.rowIndexMapper.insertIndexes(r,1),this.plugin.enableCoreAPIModifiers(),this.hot.runHooks("afterCreateRow",r,1),n=r}else this.plugin.disableCoreAPIModifiers(),this.hot.alter("insert_row_above",t,1,"NestedRows.addChildAtIndex"),this.plugin.enableCoreAPIModifiers(),n=this.getRowIndex(this.data[t]);s=this.getDataObject(n),this.hot.runHooks("afterAddChild",e,s,t)}addSibling(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"below";const r=this.translateTrimmedRow(e),n=this.getRowParent(r),s=this.getRowIndexWithinParent(r);switch(t){case"below":this.addChildAtIndex(n,s+1,null);break;case"above":this.addChildAtIndex(n,s,null)}}detachFromParent(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=null;const n=[];Array.isArray(e)?((0,i.rangeEach)(e[0],e[2],(e=>{const t=this.translateTrimmedRow(e);n.push(this.getDataObject(t))})),(0,i.rangeEach)(0,n.length-2,(e=>{this.detachFromParent(n[e],!1)})),r=n[n.length-1]):r=e;const s=this.getRowIndex(r),o=this.countChildren(r),a=this.getRowIndexWithinParent(r),l=this.getRowParent(r),h=this.getRowParent(l),u=this.getRowIndex(h);let c=null;if(this.hot.runHooks("beforeDetachChild",l,r),null!=a){const e=Array.from(new Array(s+o+1).keys()).splice(-1*(o+1));if(this.hot.runHooks("beforeRemoveRow",s,o+1,e,this.plugin.pluginName),l.__children.splice(a,1),this.rewriteCache(),this.hot.runHooks("afterRemoveRow",s,o+1,e,this.plugin.pluginName),h){c=u+this.countChildren(h);const e=this.getChild(h,this.countChildren(h)-1),t=this.getRowIndex(e);this.hot.runHooks("beforeCreateRow",t+1,o+1,this.plugin.pluginName),h.__children.push(r)}else c=this.hot.countRows()+1,this.hot.runHooks("beforeCreateRow",c-2,o+1,this.plugin.pluginName),this.data.push(r)}this.rewriteCache(),this.hot.runHooks("afterCreateRow",c-2,o+1,this.plugin.pluginName),this.hot.runHooks("afterDetachChild",l,r,this.getRowIndex(r)),t&&this.hot.render()}filterData(e,t,r){const n=[];(0,a.arrayEach)(r,(e=>{n.push(this.getDataObject(e))})),(0,a.arrayEach)(n,(e=>{const t=this.getRowIndexWithinParent(e),r=this.getRowParent(e);null===r?this.data.splice(t,1):r.__children.splice(t,1)})),this.rewriteCache()}spliceData(e,t,r){const n=this.getDataObject(e-1);let s=null,i=e;n&&n.__children&&0===n.__children.length?(s=n,i=0):et;let h=s?this.getRowParent(t-1):this.getRowParent(t);null==h&&(h=this.getRowParent(t-1)),null==h&&(h=this.getDataObject(t-1)),h?h.__children||(h.__children=[]):(h=this.getDataObject(t),h.__children=[]);const u=s||r||n?h.__children.length:this.getRowIndexWithinParent(t),c=i===h;h.__children.splice(u,0,a[0]),i.__children.splice(o+(l&&c?1:0),1),this.syncRowWithRawSource(i),c||this.syncRowWithRawSource(h)}translateTrimmedRow(e){return this.plugin.collapsingUI?this.plugin.collapsingUI.translateTrimmedRow(e):e}untranslateTrimmedRow(e){return this.plugin.collapsingUI?this.plugin.collapsingUI.untranslateTrimmedRow(e):e}}},58886:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(28962);t.PLUGIN_KEY=n.PLUGIN_KEY,t.PLUGIN_PRIORITY=n.PLUGIN_PRIORITY,t.NestedRows=n.NestedRows},28962:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834),r(15724),r(71336),r(41558),r(17663),r(68630),r(79645),r(89858),r(8620),r(14846),r(69655),r(90458);var s=n(r(85707)),i=r(75089),o=n(r(60932)),a=n(r(25605)),l=n(r(39363)),h=n(r(90369)),u=r(14859),c=r(87124),d=r(61149),p=r(92399),g=n(r(74461));function f(e,t,r){m(e,t),t.set(e,r)}function m(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function y(e,t){return e.get(w(e,t))}function E(e,t,r){return e.set(w(e,t),r),r}function w(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}const C=t.PLUGIN_KEY="nestedRows",v=t.PLUGIN_PRIORITY=300,R=C;var S=new WeakMap,T=new WeakMap,N=new WeakSet;class M extends i.BasePlugin{constructor(){var e,t;super(...arguments),m(e=this,t=N),t.add(e),(0,s.default)(this,"dataManager",null),(0,s.default)(this,"headersUI",null),(0,s.default)(this,"collapsedRowsMap",null),f(this,S,!1),f(this,T,!1)}static get PLUGIN_KEY(){return C}static get PLUGIN_PRIORITY(){return v}isEnabled(){return!!this.hot.getSettings()[C]}enablePlugin(){var e=this;this.enabled||(this.collapsedRowsMap=this.hot.rowIndexMapper.registerMap("nestedRows",new d.TrimmingMap),this.dataManager=new o.default(this,this.hot),this.collapsingUI=new a.default(this,this.hot),this.headersUI=new l.default(this,this.hot),this.contextMenuUI=new h.default(this,this.hot),this.rowMoveController=new g.default(this),this.addHook("afterInit",(function(){for(var t=arguments.length,r=new Array(t),n=0;nw(N,this,W).call(this,e))),this.addHook("beforeUpdateData",(e=>w(N,this,W).call(this,e))),this.registerShortcuts(),super.enablePlugin())}disablePlugin(){this.hot.rowIndexMapper.unregisterMap("nestedRows"),this.unregisterShortcuts(),super.disablePlugin()}updatePlugin(){this.disablePlugin();const e=this.dataManager.getData();this.enablePlugin(),this.dataManager.updateWithData(e),super.updatePlugin()}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Enter"]],callback:()=>{const{highlight:e}=this.hot.getSelectedRangeLast(),t=this.collapsingUI.translateTrimmedRow(e.row);return this.collapsingUI.areChildrenCollapsed(t)?this.collapsingUI.expandChildren(t):this.collapsingUI.collapseChildren(t),!1},runOnlyIf:()=>{var e,t;const r=null===(e=this.hot.getSelectedRangeLast())||void 0===e?void 0:e.highlight;return r&&(null===(t=this.hot.getSelectedRangeLast())||void 0===t?void 0:t.isSingle())&&this.hot.selection.isCellVisible(r)&&-1===r.col&&r.row>=0},group:R,relativeToGroup:p.EDITOR_EDIT_GROUP,position:"before"})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(R)}disableCoreAPIModifiers(){E(T,this,!0)}enableCoreAPIModifiers(){E(T,this,!1)}onModifyRowData(e){if(!y(T,this))return this.dataManager.getDataObject(e)}onModifySourceLength(){if(!y(T,this))return this.dataManager.countAllRows()}onBeforeDataSplice(e,t,r){return!(!y(T,this)&&!this.dataManager.isRowHighestLevel(e))||(this.dataManager.spliceData(e,t,r),!1)}destroy(){super.destroy()}}function _(e,t,r,n){return this.rowMoveController.onBeforeRowMove(e,t,r,n)}function b(e,t,r){this.collapsingUI.toggleState(e,t,r)}function O(e,t,r){return this.collapsingUI.collapsedRowsStash.stash(),this.collapsingUI.collapsedRowsStash.trimStash(r[0],t),this.collapsingUI.collapsedRowsStash.shiftStash(r[0],null,-1*t),this.dataManager.filterData(e,t,r),E(S,this,!0),this.dataManager.getData().slice()}function A(e){return this.contextMenuUI.appendOptions(e)}function I(e,t){this.headersUI.appendLevelIndicators(e,t)}function x(e){return Math.max(this.headersUI.rowHeaderWidthCache,e)}function P(e,t,r,n){n!==this.pluginName&&this.hot._registerTimeout((()=>{E(S,this,!1),this.headersUI.updateRowHeaderWidth(),this.collapsingUI.collapsedRowsStash.applyStash()}))}function L(e,t,r){const n=Array.from(r.reduce(((e,t)=>{if(this.dataManager.isParent(t)){const r=this.dataManager.getDataObject(t).__children;return e.add(t),Array.isArray(r)&&r.forEach((t=>e.add(this.dataManager.getRowIndex(t)))),e}return e.add(t)}),new Set));r.length=0,r.push(...n)}function D(){this.collapsingUI.collapsedRowsStash.stash()}function k(e,t){this.collapsingUI.collapsedRowsStash.shiftStash(this.dataManager.getRowIndex(t)),this.collapsingUI.collapsedRowsStash.applyStash(),this.headersUI.updateRowHeaderWidth()}function H(){this.collapsingUI.collapsedRowsStash.stash()}function F(e,t,r){this.collapsingUI.collapsedRowsStash.shiftStash(r,null,-1),this.collapsingUI.collapsedRowsStash.applyStash(),this.headersUI.updateRowHeaderWidth()}function U(){this.dataManager.rewriteCache()}function V(){this.headersUI.updateRowHeaderWidth()}function B(e,t){y(S,this)&&(t.skipRender=!0)}function W(e){if(!(0,c.isArrayOfObjects)(e))return(0,u.error)("The Nested Rows plugin requires an Array of Objects as a dataset to be provided. The plugin has been disabled."),this.hot.getSettings()[C]=!1,void this.disablePlugin();this.dataManager.setData(e),this.dataManager.rewriteCache()}t.NestedRows=M},48041:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0;var s=n(r(85707));t.default=class{constructor(e,t){(0,s.default)(this,"hot",void 0),(0,s.default)(this,"plugin",void 0),this.hot=t,this.plugin=e}}},25605:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(15724);var s=r(77661),i=r(10587),o=r(22137),a=r(62577),l=n(r(48041)),h=n(r(39363));class u extends l.default{constructor(e,t){var r;super(e,t),r=this,this.dataManager=this.plugin.dataManager,this.collapsedRows=[],this.collapsedRowsStash={stash:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];r.lastCollapsedRows=r.collapsedRows.slice(0),r.expandMultipleChildren(r.lastCollapsedRows,e)},shiftStash:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;null==t&&(t=1/0),(0,i.arrayEach)(r.lastCollapsedRows,((s,i)=>{s>=e&&s0&&void 0!==arguments[0])||arguments[0];r.collapseMultipleChildren(r.lastCollapsedRows,e),r.lastCollapsedRows=void 0},trimStash:(e,t)=>{(0,o.rangeEach)(e,e+t-1,(e=>{const t=this.lastCollapsedRows.indexOf(e);t>-1&&this.lastCollapsedRows.splice(t,1)}))}}}collapseChildren(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const n=[];let s=null,o=null,a=null;return isNaN(e)?(s=e,o=this.dataManager.getRowIndex(s)):(s=this.dataManager.getDataObject(e),o=e),this.dataManager.hasChildren(s)&&(0,i.arrayEach)(s.__children,(e=>{n.push(this.dataManager.getRowIndex(e))})),a=this.collapseRows(n,!0,!1),r&&this.trimRows(a),t&&this.renderAndAdjust(),-1===this.collapsedRows.indexOf(o)&&this.collapsedRows.push(o),a}collapseMultipleChildren(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const n=[];(0,i.arrayEach)(e,(e=>{n.push(...this.collapseChildren(e,!1,!1))})),r&&this.trimRows(n),t&&this.renderAndAdjust()}collapseRow(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.collapseRows([e],t)}collapseRows(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const n=[];return(0,i.arrayEach)(e,(e=>{n.push(e),t&&this.collapseChildRows(e,n)})),r&&this.trimRows(n),n}collapseChildRows(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(this.dataManager.hasChildren(e)){const r=this.dataManager.getDataObject(e);(0,i.arrayEach)(r.__children,(e=>{const r=this.dataManager.getRowIndex(e);t.push(r),this.collapseChildRows(r,t)}))}r&&this.trimRows(t)}expandRow(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.expandRows([e],t)}expandRows(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const n=[];return(0,i.arrayEach)(e,(e=>{n.push(e),t&&this.expandChildRows(e,n)})),r&&this.untrimRows(n),n}expandChildRows(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(this.dataManager.hasChildren(e)){const r=this.dataManager.getDataObject(e);(0,i.arrayEach)(r.__children,(e=>{if(!this.isAnyParentCollapsed(e)){const r=this.dataManager.getRowIndex(e);t.push(r),this.expandChildRows(r,t)}}))}r&&this.untrimRows(t)}expandChildren(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const n=[];let s=null,o=null,a=null;return isNaN(e)?(s=e,o=this.dataManager.getRowIndex(e)):(s=this.dataManager.getDataObject(e),o=e),this.collapsedRows.splice(this.collapsedRows.indexOf(o),1),this.dataManager.hasChildren(s)&&(0,i.arrayEach)(s.__children,(e=>{const t=this.dataManager.getRowIndex(e);n.push(t)})),a=this.expandRows(n,!0,!1),r&&this.untrimRows(a),t&&this.renderAndAdjust(),a}expandMultipleChildren(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const n=[];(0,i.arrayEach)(e,(e=>{n.push(...this.expandChildren(e,!1,!1))})),r&&this.untrimRows(n),t&&this.renderAndAdjust()}collapseAll(){const e=this.dataManager.getData(),t=[];(0,i.arrayEach)(e,(e=>{this.dataManager.hasChildren(e)&&t.push(e)})),this.collapseMultipleChildren(t),this.renderAndAdjust()}expandAll(){const e=this.dataManager.getData(),t=[];(0,i.arrayEach)(e,(e=>{this.dataManager.hasChildren(e)&&t.push(e)})),this.expandMultipleChildren(t),this.renderAndAdjust()}trimRows(e){this.hot.batchExecution((()=>{(0,i.arrayEach)(e,(e=>{this.plugin.collapsedRowsMap.setValueAtIndex(e,!0)}))}),!0)}untrimRows(e){this.hot.batchExecution((()=>{(0,i.arrayEach)(e,(e=>{this.plugin.collapsedRowsMap.setValueAtIndex(e,!1)}))}),!0)}areChildrenCollapsed(e){let t=isNaN(e)?e:this.dataManager.getDataObject(e),r=!0;return null===t&&(t={__children:this.dataManager.data}),this.dataManager.hasChildren(t)&&(0,i.arrayEach)(t.__children,(e=>{const t=this.dataManager.getRowIndex(e);if(!this.plugin.collapsedRowsMap.getValueAtIndex(t))return r=!1,!1})),r}isAnyParentCollapsed(e){let t=e;for(;null!==t;){t=this.dataManager.getRowParent(t);const e=this.dataManager.getRowIndex(t);if(this.collapsedRows.indexOf(e)>-1)return!0}return!1}toggleState(e,t){if(t.col>=0)return;const r=this.translateTrimmedRow(t.row);(0,a.hasClass)(e.target,h.default.CSS_CLASSES.button)&&(this.areChildrenCollapsed(r)?this.expandChildren(r):this.collapseChildren(r),(0,s.stopImmediatePropagation)(e))}translateTrimmedRow(e){return this.hot.toPhysicalRow(e)}untranslateTrimmedRow(e){return this.hot.toVisualRow(e)}renderAndAdjust(){this.hot.render(),this.hot.view.adjustElementsSize()}}t.default=u},90369:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834);var s=n(r(85707)),i=r(22137),o=r(10587),a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=h(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var o=s?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(n,i,o):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n}(r(23384)),l=n(r(48041));function h(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(h=function(e){return e?r:t})(e)}function u(e,t,r){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}function c(e,t){return e.get(function(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}(e,t))}var d=new WeakMap;class p extends l.default{constructor(){super(...arguments),(0,s.default)(this,"dataManager",this.plugin.dataManager),u(this,d,{row_above:(e,t)=>{const r=t[t.length-1];this.dataManager.addSibling(r.start.row,"above")},row_below:(e,t)=>{const r=t[t.length-1];this.dataManager.addSibling(r.start.row,"below")}})}appendOptions(e){const t=[{key:"add_child",name(){return this.getTranslatedPhrase(a.CONTEXTMENU_ITEMS_NESTED_ROWS_INSERT_CHILD)},callback:()=>{const e=this.dataManager.translateTrimmedRow(this.hot.getSelectedLast()[0]),t=this.dataManager.getDataObject(e);this.dataManager.addChild(t)},disabled:()=>{const e=this.hot.getSelectedLast();return!e||e[0]<0||this.hot.selection.isSelectedByColumnHeader()||this.hot.countRows()>=this.hot.getSettings().maxRows}},{key:"detach_from_parent",name(){return this.getTranslatedPhrase(a.CONTEXTMENU_ITEMS_NESTED_ROWS_DETACH_CHILD)},callback:()=>{this.dataManager.detachFromParent(this.hot.getSelectedLast())},disabled:()=>{const e=this.hot.getSelectedLast(),t=this.dataManager.translateTrimmedRow(e[0]);return!this.dataManager.getRowParent(t)||!e||e[0]<0||this.hot.selection.isSelectedByColumnHeader()||this.hot.countRows()>=this.hot.getSettings().maxRows}},{name:"---------"}];return(0,i.rangeEach)(0,e.items.length-1,(r=>{if(0===r)return(0,o.arrayEach)(t,((t,n)=>{e.items.splice(r+n,0,t)})),!1})),this.modifyRowInsertingOptions(e)}modifyRowInsertingOptions(e){return(0,i.rangeEach)(0,e.items.length-1,(t=>{const r=c(d,this)[e.items[t].key];null!=r&&(e.items[t].callback=r)})),e}}t.default=p},39363:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0;var s=r(10587),i=r(22137),o=r(62577),a=n(r(48041)),l=r(71120);class h extends a.default{static get CSS_CLASSES(){return{indicatorContainer:"ht_nestingLevels",parent:"ht_nestingParent",indicator:"ht_nestingLevel",emptyIndicator:"ht_nestingLevel_empty",button:"ht_nestingButton",expandButton:"ht_nestingExpand",collapseButton:"ht_nestingCollapse"}}constructor(e,t){super(e,t),this.dataManager=this.plugin.dataManager,this.collapsingUI=this.plugin.collapsingUI,this.rowHeaderWidthCache=null}appendLevelIndicators(e,t){const r=this.hot.toPhysicalRow(e),n=this.dataManager.getRowLevel(r),a=this.dataManager.getDataObject(r),u=t.getElementsByTagName("DIV")[0],c=u.querySelector("span.rowHeader"),d=u.querySelectorAll('[class^="ht_nesting"]'),p=this.hot.getSettings().ariaTags;if((0,s.arrayEach)(d,(e=>{e&&u.removeChild(e)})),(0,o.addClass)(t,h.CSS_CLASSES.indicatorContainer),n){const{rootDocument:e}=this.hot,t=c.cloneNode(!0);u.innerHTML="",(0,i.rangeEach)(0,n-1,(()=>{const t=e.createElement("SPAN");(0,o.addClass)(t,h.CSS_CLASSES.emptyIndicator),u.appendChild(t)})),u.appendChild(t)}if(this.dataManager.hasChildren(a)){const e=this.hot.rootDocument.createElement("DIV");p&&(0,o.setAttribute)(e,[(0,l.A11Y_HIDDEN)()]),(0,o.addClass)(t,h.CSS_CLASSES.parent),this.collapsingUI.areChildrenCollapsed(r)?((0,o.addClass)(e,`${h.CSS_CLASSES.button} ${h.CSS_CLASSES.expandButton}`),p&&(0,o.setAttribute)(t,[(0,l.A11Y_EXPANDED)(!1)])):((0,o.addClass)(e,`${h.CSS_CLASSES.button} ${h.CSS_CLASSES.collapseButton}`),p&&(0,o.setAttribute)(t,[(0,l.A11Y_EXPANDED)(!0)])),u.appendChild(e)}}updateRowHeaderWidth(e){let t=e;t||(t=this.dataManager.cache.levelCount);const r=this.hot.view.getStylesHandler();let n=11;if(!r.isClassicTheme()){n=2*r.getCSSVariableValue("cell-horizontal-padding")}this.rowHeaderWidthCache=Math.max(50,n+10*t+25),this.hot.render()}}t.default=h},74461:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(15724),r(14846),r(69655),r(94364),r(75568);var s=n(r(85707)),i=r(70505),o=r(14859),a=r(21595);t.default=class{constructor(e){(0,s.default)(this,"plugin",void 0),(0,s.default)(this,"hot",void 0),(0,s.default)(this,"dataManager",void 0),(0,s.default)(this,"collapsingUI",void 0),this.plugin=e,this.hot=e.hot,this.dataManager=e.dataManager,this.collapsingUI=e.collapsingUI}onBeforeRowMove(e,t,r,n){if(this.displayAPICompatibilityWarning({rows:e,finalIndex:t,dropIndex:r,movePossible:n}))return!1;this.movedToCollapsed=!1;const s=r===this.hot.countRows(),i=s?this.hot.countSourceRows():this.dataManager.translateTrimmedRow(r);let o=!0;const a=e.map((e=>{if(!o)return!1;const t=this.dataManager.translateTrimmedRow(e);return o=this.shouldAllowMoving(t,i),t})),l=-1===a.indexOf(i);if(!o||!l)return!1;const h=this.getBaseParent(a),u=this.getTargetParent(s,i),c=h===u;return this.movedToCollapsed=this.collapsingUI.areChildrenCollapsed(u),this.collapsingUI.collapsedRowsStash.stash(),this.shiftCollapsibleParentsLocations(a,i,c),this.moveRows(a,i,u),this.dataManager.rewriteCache(),this.moveCellsMeta(a,i),this.collapsingUI.collapsedRowsStash.applyStash(!1),this.hot.runHooks("afterRowMove",e,t,r,n,n&&this.isRowOrderChanged(e,t)),this.hot.render(),this.selectCells(e,r),!1}displayAPICompatibilityWarning(e){const{rows:t,finalIndex:r,dropIndex:n,movePossible:s}=e;let l=!1;return(0,i.isUndefined)(n)&&((0,o.warn)(a.toSingleLine`Since version 8.0.0 of the Handsontable the 'moveRows' method isn't used for moving rows\x20 + when the NestedRows plugin is enabled. Please use the 'dragRows' method instead.`),this.hot.runHooks("afterRowMove",t,r,n,s,!1),l=!0),l}shouldAllowMoving(e,t){return!(this.dataManager.isParent(e)||this.dataManager.isRowHighestLevel(e)||e===t||0===t)}getBaseParent(e){return this.dataManager.getRowParent(e[0])}getTargetParent(e,t){let r=this.dataManager.getRowParent(e?t-1:t);return null==r&&(r=this.dataManager.getRowParent(t-1)),r}shiftCollapsibleParentsLocations(e,t,r){r||(Math.max(...e)<=t?this.collapsingUI.collapsedRowsStash.shiftStash(e[0],t,-1*e.length):this.collapsingUI.collapsedRowsStash.shiftStash(t,e[0],e.length))}moveRows(e,t,r){const n=t===this.dataManager.getRowIndex(r)+this.dataManager.countChildren(r)+1;this.hot.batchRender((()=>{e.forEach((e=>{this.dataManager.moveRow(e,t,this.movedToCollapsed,n)}))}))}moveCellsMeta(e,t){const r=[],n=Math.max(...e){r.push(this.hot.getCellMetaAtRow(e))})),this.hot.spliceCellsMeta(e[0],e.length),this.hot.spliceCellsMeta(t-(n?r.length:0),0,...r)}selectCells(e,t){const r=e.length;let n=0,s=0;if(this.movedToCollapsed){let i=null;i=e[r-1]e-r!==t))}}},56326:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(27468);t.PLUGIN_KEY=n.PLUGIN_KEY,t.PLUGIN_PRIORITY=n.PLUGIN_PRIORITY,t.PersistentState=n.PersistentState},27468:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0;var s=n(r(85707)),i=r(75089),o=n(r(98835)),a=r(28197);a.Hooks.getSingleton().register("persistentStateSave"),a.Hooks.getSingleton().register("persistentStateLoad"),a.Hooks.getSingleton().register("persistentStateReset");const l=t.PLUGIN_KEY="persistentState",h=t.PLUGIN_PRIORITY=0;class u extends i.BasePlugin{constructor(){super(...arguments),(0,s.default)(this,"storage",void 0)}static get PLUGIN_KEY(){return l}static get PLUGIN_PRIORITY(){return h}isEnabled(){return!!this.hot.getSettings()[l]}enablePlugin(){this.enabled||(this.storage||(this.storage=new o.default(this.hot.rootElement.id,this.hot.rootWindow)),this.addHook("persistentStateSave",((e,t)=>this.saveValue(e,t))),this.addHook("persistentStateLoad",((e,t)=>this.loadValue(e,t))),this.addHook("persistentStateReset",(()=>this.resetValue())),super.enablePlugin())}disablePlugin(){this.storage=void 0,super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}loadValue(e,t){t.value=this.storage.loadValue(e)}saveValue(e,t){this.storage.saveValue(e,t)}resetValue(e){void 0===e?this.storage.resetAll():this.storage.reset(e)}destroy(){super.destroy()}}t.PersistentState=u},98835:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(15724),r(66184);var s=n(r(85707)),i=r(10587);t.default=class{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window;(0,s.default)(this,"rootWindow",void 0),(0,s.default)(this,"prefix",void 0),(0,s.default)(this,"savedKeys",[]),this.rootWindow=t,this.prefix=e,this.loadSavedKeys()}saveValue(e,t){this.rootWindow.localStorage.setItem(`${this.prefix}_${e}`,JSON.stringify(t)),-1===this.savedKeys.indexOf(e)&&(this.savedKeys.push(e),this.saveSavedKeys())}loadValue(e,t){const r=void 0===e?t:e,n=this.rootWindow.localStorage.getItem(`${this.prefix}_${r}`);return null===n?void 0:JSON.parse(n)}reset(e){this.rootWindow.localStorage.removeItem(`${this.prefix}_${e}`)}resetAll(){(0,i.arrayEach)(this.savedKeys,((e,t)=>{this.rootWindow.localStorage.removeItem(`${this.prefix}_${this.savedKeys[t]}`)})),this.clearSavedKeys()}loadSavedKeys(){const e=this.rootWindow.localStorage.getItem(`${this.prefix}__persistentStateKeys`),t="string"==typeof e?JSON.parse(e):void 0;this.savedKeys=t||[]}saveSavedKeys(){this.rootWindow.localStorage.setItem(`${this.prefix}__persistentStateKeys`,JSON.stringify(this.savedKeys))}clearSavedKeys(){this.savedKeys.length=0,this.saveSavedKeys()}}},74672:(e,t,r)=>{"use strict";t.__esModule=!0,t.getPlugin=c,t.getPluginsNames=function(){return[...l.getItems(),...h.getItems()]},t.hasPlugin=function(e){return!!c(e)},t.registerPlugin=function(e,t,r){[e,t,r]=function(e,t,r){"function"==typeof e&&(e=(t=e).PLUGIN_KEY,r=t.PLUGIN_PRIORITY);return[e,t,r]}(e,t,r),void 0===c(e)&&function(e,t,r){const s=(0,n.toUpperCaseFirst)(e);if(u.hasItem(s))throw new Error(a(s));void 0===r?h.addItem(s):l.addItem(r,s);u.addItem(s,t)}(e,t,r)},r(67834);var n=r(5893),s=r(38439),i=r(54394),o=r(74784);const a=e=>`There is already registered "${e}" plugin.`,l=(0,s.createPriorityMap)({errorPriorityExists:e=>`There is already registered plugin on priority "${e}".`,errorPriorityNaN:e=>`The priority "${e}" is not a number.`}),h=(0,o.createUniqueSet)({errorItemExists:a}),u=(0,i.createUniqueMap)({errorIdExists:a});function c(e){const t=(0,n.toUpperCaseFirst)(e);return u.getItem(t)}},64296:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(56866);t.PLUGIN_KEY=n.PLUGIN_KEY,t.PLUGIN_PRIORITY=n.PLUGIN_PRIORITY,t.Search=n.Search},56866:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834),r(15724);var s=n(r(85707)),i=r(75089),o=r(25499),a=r(22137),l=r(70505);function h(e,t){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.add(e)}function u(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}const c=t.PLUGIN_KEY="search",d=t.PLUGIN_PRIORITY=190,p=function(e,t,r,n,s){e.getCellMeta(t,r).isSearchResult=s},g=function(e,t,r){return!((0,l.isUndefined)(e)||null===e||!e.toLocaleLowerCase||0===e.length)&&(!(0,l.isUndefined)(t)&&null!==t&&-1!==t.toString().toLocaleLowerCase(r.locale).indexOf(e.toLocaleLowerCase(r.locale)))};var f=new WeakSet;class m extends i.BasePlugin{constructor(){super(...arguments),h(this,f),(0,s.default)(this,"callback",p),(0,s.default)(this,"queryMethod",g),(0,s.default)(this,"searchResultClass","htSearchResult")}static get PLUGIN_KEY(){return c}static get PLUGIN_PRIORITY(){return d}isEnabled(){return this.hot.getSettings()[c]}enablePlugin(){var e=this;if(this.enabled)return;const t=this.hot.getSettings()[c];this.updatePluginSettings(t),this.addHook("beforeRenderer",(function(){for(var t=arguments.length,r=new Array(t),n=0;n{this.hot.removeHook("beforeRenderer",t)})),super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}query(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getCallback(),r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.getQueryMethod();const n=this.hot.countRows(),s=this.hot.countCols(),i=[],o=this.hot;return(0,a.rangeEach)(0,n-1,(n=>{(0,a.rangeEach)(0,s-1,(s=>{const a=this.hot.getDataAtCell(n,s),l=this.hot.getCellMeta(n,s),h=l.search.callback||t,u=(l.search.queryMethod||r)(e,a,l);if(u){const e={row:n,col:s,data:a};i.push(e)}h&&h(o,n,s,a,u)}))})),i}getCallback(){return this.callback}setCallback(e){this.callback=e}getQueryMethod(){return this.queryMethod}setQueryMethod(e){this.queryMethod=e}getSearchResultClass(){return this.searchResultClass}setSearchResultClass(e){this.searchResultClass=e}updatePluginSettings(e){(0,o.isObject)(e)&&(e.searchResultClass&&this.setSearchResultClass(e.searchResultClass),e.queryMethod&&this.setQueryMethod(e.queryMethod),e.callback&&this.setCallback(e.callback))}destroy(){super.destroy()}}function y(e,t,r,n,s,i){const o=i.className||[];let a=[];"string"==typeof o?a=o.split(" "):a.push(...o),this.isEnabled()&&i.isSearchResult?a.includes(this.searchResultClass)||a.push(`${this.searchResultClass}`):a.includes(this.searchResultClass)&&a.splice(a.indexOf(this.searchResultClass),1),i.className=a.join(" ")}t.Search=m},74358:(e,t,r)=>{"use strict";t.__esModule=!0,r(67834),r(14846),r(69655);var n=r(50206),s=r(62577),i=r(45603),o=r(6514);function a(e,t,r){l(e,t),t.set(e,r)}function l(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function h(e,t){return e.get(c(e,t))}function u(e,t,r){return e.set(c(e,t),r),r}function c(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var d=new WeakMap,p=new WeakMap,g=new WeakMap,f=new WeakMap,m=new WeakSet;function y(){const{view:e}=h(d,this);if(e.isVerticallyScrollableByWindow())return!1;const t=e.getViewportHeight(),r=h(d,this).countRows(),n=e.getStylesHandler().getDefaultRowHeight();let s=0,i=!1;for(let e=0;et){i=!0;break}}return i}function E(e){var t;return null!==(t=h(d,this).getColWidth(e,"StretchColumns"))&&void 0!==t?t:n.DEFAULT_COLUMN_WIDTH}function w(e,t){return h(d,this).runHooks("beforeStretchingColumnWidth",e,t)}t.StretchCalculator=class{constructor(e){var t,r;l(t=this,r=m),r.add(t),a(this,d,void 0),a(this,p,void 0),a(this,g,new Map([["all",new i.StretchAllStrategy(c(m,this,w).bind(this))],["last",new o.StretchLastStrategy(c(m,this,w).bind(this))]])),a(this,f,"none"),u(d,this,e),u(p,this,h(d,this).columnIndexMapper.createAndRegisterIndexMap("stretchColumns","physicalIndexToValue"))}useStrategy(e){u(f,this,h(g,this).has(e)?e:"none")}refreshStretching(){"none"!==h(f,this)?h(d,this).batchExecution((()=>{h(p,this).clear();const e=h(g,this).get(h(f,this));let t=h(d,this).view.getViewportWidth();c(m,this,y).call(this)&&(t-=(0,s.getScrollbarWidth)(h(d,this).rootDocument)),e.prepare({viewportWidth:t});for(let t=0;t{let[t,r]=e;h(p,this).setValueAtIndex(h(d,this).toPhysicalColumn(t),r)}))}),!0):h(p,this).clear()}getStretchedWidth(e){return h(p,this).getValueAtIndex(h(d,this).toPhysicalColumn(e))}}},25392:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(61130);t.PLUGIN_KEY=n.PLUGIN_KEY,t.PLUGIN_PRIORITY=n.PLUGIN_PRIORITY,t.StretchColumns=n.StretchColumns},1104:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0;var s=n(r(85707));t.StretchStrategy=class{constructor(e){(0,s.default)(this,"viewportWidth",void 0),(0,s.default)(this,"overwriteColumnWidthFn",void 0),(0,s.default)(this,"baseWidths",new Map),(0,s.default)(this,"stretchedWidths",new Map),this.overwriteColumnWidthFn=e}prepare(e){let{viewportWidth:t}=e;this.viewportWidth=t,this.baseWidths.clear(),this.stretchedWidths.clear()}setColumnBaseWidth(e,t){this.baseWidths.set(e,t)}calculate(){}getWidths(){return Array.from(this.stretchedWidths)}}},45603:(e,t,r)=>{"use strict";t.__esModule=!0,r(15724),r(14846),r(69655),r(90458);var n=r(50206),s=r(1104);class i extends s.StretchStrategy{calculate(){const e=Array.from(this.baseWidths).reduce(((e,t)=>{let[,r]=t;return e+r}),0);if(this.viewportWidth-e<0)return void this.stretchedWidths.clear();const t=this.viewportWidth/e,r=[],s=[];let i=this.viewportWidth,o=0;if(this.baseWidths.forEach(((e,a)=>{const l=Math.round(e*t),h=this.overwriteColumnWidthFn(l,a);l===h&&l>=n.DEFAULT_COLUMN_WIDTH?(r.push([a,h]),o+=h):l!==h&&(r.push([a,h]),s.push(a),i-=h)})),i<=n.DEFAULT_COLUMN_WIDTH)return void this.stretchedWidths.clear();const a=i/o;let l=-1,h=0;r.forEach(((e,t)=>{let[n,i]=e,o=i;s.includes(n)||(o=Math.round(i*a)),this.stretchedWidths.set(n,o),l=n,t1&&this.stretchedWidths.set(l,Math.round(this.viewportWidth-h))}}t.StretchAllStrategy=i},6514:(e,t,r)=>{"use strict";t.__esModule=!0,r(67834),r(14846),r(90458);var n=r(1104);function s(e,t,r){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}function i(e,t){return e.get(a(e,t))}function o(e,t,r){return e.set(a(e,t),r),r}function a(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var l=new WeakMap,h=new WeakMap;class u extends n.StretchStrategy{constructor(){super(...arguments),s(this,l,0),s(this,h,-1)}prepare(e){super.prepare(e),o(l,this,0),o(h,this,-1)}setColumnBaseWidth(e,t){super.setColumnBaseWidth(e,t),o(h,this,e),o(l,this,t)}calculate(){if(-1===i(h,this))return;const e=Array.from(this.baseWidths).reduce(((e,t)=>{let[,r]=t;return e+r}),0),t=Math.max(this.viewportWidth-e+i(l,this),0);this.stretchedWidths.set(i(h,this),t)}}t.StretchLastStrategy=u},61130:(e,t,r)=>{"use strict";t.__esModule=!0,r(67834),r(14846),r(69655);var n=r(75089),s=r(74358);function i(e,t,r){o(e,t),t.set(e,r)}function o(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function a(e,t,r){return e.set(h(e,t),r),r}function l(e,t){return e.get(h(e,t))}function h(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}const u=t.PLUGIN_KEY="stretchColumns",c=t.PLUGIN_PRIORITY=155;var d=new WeakMap,p=new WeakMap,g=new WeakMap,f=new WeakSet;class m extends n.BasePlugin{constructor(){var e,t;super(...arguments),o(e=this,t=f),t.add(e),i(this,d,new s.StretchCalculator(this.hot)),i(this,p,null),i(this,g,new ResizeObserver((e=>{requestAnimationFrame((()=>{var t;null!==(t=this.hot)&&void 0!==t&&t.view.isHorizontallyScrollableByWindow()&&e.forEach((e=>{let{contentRect:t}=e;null!==l(p,this)&&l(p,this)!==t.width&&(this.hot.refreshDimensions(),this.hot.view.adjustElementsSize()),a(p,this,t.width)}))}))})))}static get PLUGIN_KEY(){return u}static get PLUGIN_PRIORITY(){return c}static get SETTING_KEYS(){return!0}isEnabled(){return["all","last"].includes(this.hot.getSettings().stretchH)}enablePlugin(){var e=this;this.enabled||(l(d,this).useStrategy(this.hot.getSettings().stretchH),l(g,this).observe(this.hot.rootElement),this.addHook("beforeRender",(function(){for(var t=arguments.length,r=new Array(t),n=0;n{"use strict";t.__esModule=!0;var n=r(79884);t.PLUGIN_KEY=n.PLUGIN_KEY,t.PLUGIN_PRIORITY=n.PLUGIN_PRIORITY,t.TouchScroll=n.TouchScroll},79884:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834),r(15724);var s=n(r(85707)),i=r(62577),o=r(10587),a=r(75089),l=r(85992);function h(e,t){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.add(e)}function u(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}const c=t.PLUGIN_KEY="touchScroll",d=t.PLUGIN_PRIORITY=200;var p=new WeakSet;class g extends a.BasePlugin{constructor(){super(...arguments),h(this,p),(0,s.default)(this,"scrollbars",[]),(0,s.default)(this,"clones",[]),(0,s.default)(this,"lockedCollection",!1),(0,s.default)(this,"freezeOverlays",!1)}static get PLUGIN_KEY(){return c}static get PLUGIN_PRIORITY(){return d}static get SETTING_KEYS(){return!0}isEnabled(){return(0,l.isTouchSupported)()}enablePlugin(){this.enabled||(this.addHook("afterViewRender",(()=>u(p,this,f).call(this))),this.registerEvents(),super.enablePlugin())}updatePlugin(){this.lockedCollection=!1,super.updatePlugin()}disablePlugin(){super.disablePlugin()}registerEvents(){this.addHook("beforeTouchScroll",(()=>u(p,this,m).call(this))),this.addHook("afterMomentumScroll",(()=>u(p,this,y).call(this)))}}function f(){if(this.lockedCollection)return;const{topOverlay:e,bottomOverlay:t,inlineStartOverlay:r,topInlineStartCornerOverlay:n,bottomInlineStartCornerOverlay:s}=this.hot.view._wt.wtOverlays;this.lockedCollection=!0,this.scrollbars.length=0,this.scrollbars.push(e),t.clone&&this.scrollbars.push(t),this.scrollbars.push(r),n&&this.scrollbars.push(n),s&&s.clone&&this.scrollbars.push(s),this.clones=[],e.needFullRender&&this.clones.push(e.clone.wtTable.holder.parentNode),t.needFullRender&&this.clones.push(t.clone.wtTable.holder.parentNode),r.needFullRender&&this.clones.push(r.clone.wtTable.holder.parentNode),n&&this.clones.push(n.clone.wtTable.holder.parentNode),s&&s.clone&&this.clones.push(s.clone.wtTable.holder.parentNode)}function m(){this.freezeOverlays=!0,(0,o.arrayEach)(this.clones,(e=>{(0,i.addClass)(e,"hide-tween")}))}function y(){this.freezeOverlays=!1,(0,o.arrayEach)(this.clones,(e=>{(0,i.removeClass)(e,"hide-tween"),(0,i.addClass)(e,"show-tween")})),this.hot._registerTimeout((()=>{(0,o.arrayEach)(this.clones,(e=>{(0,i.removeClass)(e,"show-tween")}))}),400),(0,o.arrayEach)(this.scrollbars,(e=>{e.refresh(),e.resetFixedPosition()})),this.hot.view._wt.wtOverlays.syncScrollWithMaster()}t.TouchScroll=g},47237:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(88248);t.PLUGIN_KEY=n.PLUGIN_KEY,t.PLUGIN_PRIORITY=n.PLUGIN_PRIORITY,t.TrimRows=n.TrimRows},88248:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834),r(15724),r(71336),r(41558),r(17663),r(68630),r(79645),r(89858),r(8620),r(14846),r(63333);var s=n(r(85707)),i=r(75089),o=r(61149),a=r(10587);function l(e,t){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.add(e)}const h=t.PLUGIN_KEY="trimRows",u=t.PLUGIN_PRIORITY=330;var c=new WeakSet;class d extends i.BasePlugin{constructor(){super(...arguments),l(this,c),(0,s.default)(this,"trimmedRowsMap",null)}static get PLUGIN_KEY(){return h}static get PLUGIN_PRIORITY(){return u}isEnabled(){return!!this.hot.getSettings()[h]}enablePlugin(){this.enabled||(this.trimmedRowsMap=this.hot.rowIndexMapper.registerMap("trimRows",new o.TrimmingMap),this.trimmedRowsMap.addLocalHook("init",(()=>function(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}(c,this,p).call(this))),super.enablePlugin())}updatePlugin(){const e=this.hot.getSettings()[h];Array.isArray(e)&&this.hot.batchExecution((()=>{this.trimmedRowsMap.clear(),(0,a.arrayEach)(e,(e=>{this.trimmedRowsMap.setValueAtIndex(e,!0)}))}),!0),super.updatePlugin()}disablePlugin(){this.hot.rowIndexMapper.unregisterMap("trimRows"),super.disablePlugin()}getTrimmedRows(){return this.trimmedRowsMap.getTrimmedIndexes()}trimRows(e){const t=this.getTrimmedRows(),r=this.isValidConfig(e);let n=t;r&&(n=Array.from(new Set(t.concat(e))));!1!==this.hot.runHooks("beforeTrimRow",t,n,r)&&(r&&this.hot.batchExecution((()=>{(0,a.arrayEach)(e,(e=>{this.trimmedRowsMap.setValueAtIndex(e,!0)}))}),!0),this.hot.runHooks("afterTrimRow",t,n,r,r&&n.length>t.length))}trimRow(){for(var e=arguments.length,t=new Array(e),r=0;r0;r&&i&&((0,a.arrayEach)(e,(e=>{s[e]=!1})),n=(0,a.arrayReduce)(s,((e,t,r)=>(t&&e.push(r),e)),[]));!1!==this.hot.runHooks("beforeUntrimRow",t,n,r&&i)&&(r&&i&&this.trimmedRowsMap.setValues(s),this.hot.runHooks("afterUntrimRow",t,n,r&&i,r&&n.lengthNumber.isInteger(e)&&e>=0&&e{(0,a.arrayEach)(e,(e=>{this.trimmedRowsMap.setValueAtIndex(e,!0)}))}),!0)}t.TrimRows=d},88814:(e,t,r)=>{"use strict";t.__esModule=!0,r(67834);t.BaseAction=class{undo(){throw new Error("Not implemented")}redo(){throw new Error("Not implemented")}}},71659:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0;var s=n(r(85707)),i=r(88814),o=r(21577),a=r(10587);class l extends i.BaseAction{constructor(e){let{stateBefore:t,range:r,type:n,alignment:i}=e;super(),(0,s.default)(this,"stateBefore",void 0),(0,s.default)(this,"range",void 0),(0,s.default)(this,"type",void 0),(0,s.default)(this,"alignment",void 0),this.stateBefore=t,this.range=r,this.type=n,this.alignment=i}static startRegisteringEvents(e,t){e.addHook("beforeCellAlignment",((e,r,n,s)=>{t.done((()=>new l({stateBefore:e,range:r,type:n,alignment:s})))}))}undo(e,t){(0,a.arrayEach)(this.range,(t=>{t.forAll(((t,r)=>{t>=0&&r>=0&&e.setCellMeta(t,r,"className",this.stateBefore[t][r]||" htLeft")}))})),e.addHookOnce("afterViewRender",t),e.render()}redo(e,t){(0,o.align)(this.range,this.type,this.alignment,((t,r)=>e.getCellMeta(t,r)),((t,r,n,s)=>e.setCellMeta(t,r,n,s))),e.addHookOnce("afterViewRender",t),e.render()}}t.CellAlignmentAction=l},44395:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(14846),r(69655);var s=n(r(85707)),i=r(88814),o=r(4980);class a extends i.BaseAction{constructor(e){let{columns:t,finalIndex:r}=e;super(),(0,s.default)(this,"columns",void 0),(0,s.default)(this,"finalColumnIndex",void 0),this.columns=t.slice(),this.finalColumnIndex=r}static startRegisteringEvents(e,t){e.addHook("beforeColumnMove",((e,r)=>{!1!==e&&t.done((()=>new a({columns:e,finalIndex:r})))}))}undo(e,t){const r=e.getPlugin("manualColumnMove");e.addHookOnce("afterViewRender",t);(0,o.getMoves)(this.columns,this.finalColumnIndex,e.columnIndexMapper.getNumberOfIndexes()).reverse().forEach((e=>{let{from:t,to:n}=e;t{"use strict";var n=r(96784);t.__esModule=!0;var s=n(r(85707)),i=r(88814);class o extends i.BaseAction{constructor(e){let{currentSortState:t,newSortState:r}=e;super(),(0,s.default)(this,"previousSortState",void 0),(0,s.default)(this,"nextSortState",void 0),this.previousSortState=t,this.nextSortState=r}static startRegisteringEvents(e,t){e.addHook("beforeColumnSort",((e,r,n)=>{n&&t.done((()=>new o({currentSortState:e,newSortState:r})))}))}undo(e,t){const r=e.getPlugin("columnSorting"),n=e.getPlugin("multiColumnSorting"),s=n.isEnabled()?n:r;this.previousSortState.length?s.sort(this.previousSortState):s.clearSort(),t()}redo(e,t){const r=e.getPlugin("columnSorting"),n=e.getPlugin("multiColumnSorting");(n.isEnabled()?n:r).sort(this.nextSortState),t()}}t.ColumnSortAction=o},47430:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0;var s=n(r(85707)),i=r(88814);class o extends i.BaseAction{constructor(e){let{index:t,amount:r}=e;super(),(0,s.default)(this,"index",void 0),(0,s.default)(this,"amount",void 0),this.index=t,this.amount=r}static startRegisteringEvents(e,t){e.addHook("afterCreateCol",((e,r,n)=>{t.done((()=>new o({index:e,amount:r})),n)}))}undo(e,t){e.addHookOnce("afterRemoveCol",t),e.alter("remove_col",this.index,this.amount,"UndoRedo.undo")}redo(e,t){e.addHookOnce("afterCreateCol",t),e.alter("insert_col_start",this.index,this.amount,"UndoRedo.redo")}}t.CreateColumnAction=o},78246:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0;var s=n(r(85707)),i=r(88814);class o extends i.BaseAction{constructor(e){let{index:t,amount:r}=e;super(),(0,s.default)(this,"index",void 0),(0,s.default)(this,"amount",void 0),this.index=t,this.amount=r}static startRegisteringEvents(e,t){e.addHook("afterCreateRow",((e,r,n)=>{t.done((()=>new o({index:e,amount:r})),n)}))}undo(e,t){const r=e.countRows(),n=e.getSettings().minSpareRows;this.index>=r&&this.index-n{"use strict";var n=r(96784);t.__esModule=!0,r(15724),r(14846),r(6211),r(69655),r(90458);var s=n(r(85707)),i=r(88814),o=r(25499);class a extends i.BaseAction{constructor(e){let{changes:t,selected:r,countCols:n,countRows:i}=e;super(),(0,s.default)(this,"changes",void 0),(0,s.default)(this,"selected",void 0),(0,s.default)(this,"countCols",void 0),(0,s.default)(this,"countRows",void 0),this.changes=t,this.selected=r,this.countCols=n,this.countRows=i}static startRegisteringEvents(e,t){e.addHook("beforeChange",(function(r,n){const s=r&&r.length;if(!s)return;if(!r.find((e=>{const[,,t,r]=e;return t!==r})))return;t.done((()=>{const t=r.reduce(((e,t)=>(e.push([...t]),e)),[]);t.forEach((t=>{t[1]=e.propToCol(t[1])}));const n=s>1?this.getSelected():[[t[0][0],t[0][1]]];return new a({changes:t,selected:n,countCols:e.countCols(),countRows:e.countRows()})}),n)}))}undo(e,t){const r=(0,o.deepClone)(this.changes);for(let e=0,t=r.length;e0&&e.alter("remove_row",null,n,"UndoRedo.undo");const s=e.countCols()-this.countCols;s>0&&e.isColumnModificationAllowed()&&e.alter("remove_col",null,s,"UndoRedo.undo"),e.scrollToFocusedCell(),e.selectCells(this.selected,!1,!1)}redo(e,t){const r=(0,o.deepClone)(this.changes);for(let e=0,t=r.length;e{"use strict";var n=r(96784);t.__esModule=!0,r(14846),r(27458);var s=n(r(85707)),i=r(88814);class o extends i.BaseAction{constructor(e){let{conditionsStack:t,previousConditionsStack:r}=e;super(),(0,s.default)(this,"conditionsStack",void 0),(0,s.default)(this,"previousConditionsStack",void 0),this.conditionsStack=t,this.previousConditionsStack=r}static startRegisteringEvents(e,t){e.addHook("beforeFilter",((e,r)=>{t.done((()=>new o({conditionsStack:e,previousConditionsStack:r})))}))}undo(e,t){const r=e.getPlugin("filters");e.addHookOnce("afterViewRender",t),r.conditionCollection.importAllConditions(this.previousConditionsStack),r.filter()}redo(e,t){const r=e.getPlugin("filters");e.addHookOnce("afterViewRender",t),r.conditionCollection.importAllConditions(this.conditionsStack),r.filter()}}t.FiltersAction=o},37990:(e,t,r)=>{"use strict";t.__esModule=!0,t.registerActions=function(e,t){[n.CellAlignmentAction,s.ColumnMoveAction,i.ColumnSortAction,o.CreateColumnAction,a.CreateRowAction,l.DataChangeAction,h.FiltersAction,u.MergeCellsAction,c.RemoveColumnAction,d.RemoveRowAction,p.RowMoveAction,g.UnmergeCellsAction].forEach((r=>r.startRegisteringEvents(e,t)))},r(14846),r(69655);var n=r(71659),s=r(44395),i=r(13258),o=r(47430),a=r(78246),l=r(43424),h=r(3809),u=r(25789),c=r(23378),d=r(99506),p=r(44587),g=r(21050)},25789:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0;var s=n(r(85707)),i=r(88814);class o extends i.BaseAction{constructor(e){let{data:t,cellRange:r}=e;super(),(0,s.default)(this,"cellRange",void 0),this.cellRange=r,this.data=t}static startRegisteringEvents(e,t){e.addHook("beforeMergeCells",((r,n)=>{if(n)return;const s=r.getTopStartCorner(),i=r.getBottomEndCorner(),a=e.getData(s.row,s.col,i.row,i.col);t.done((()=>new o({data:a,cellRange:r})))}))}undo(e,t){const r=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",t),r.unmergeRange(this.cellRange,!0);const n=this.cellRange.getTopStartCorner();e.populateFromArray(n.row,n.col,this.data,void 0,void 0,"MergeCells")}redo(e,t){const r=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",t),r.mergeRange(this.cellRange)}}t.MergeCellsAction=o},23378:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(15724),r(14846),r(69655);var s=n(r(85707)),i=r(88814),o=r(38364),a=r(22137),l=r(10587);class h extends i.BaseAction{constructor(e){let{index:t,indexes:r,data:n,headers:i,columnPositions:o,rowPositions:a,fixedColumnsStart:l,removedCellMetas:h}=e;super(),(0,s.default)(this,"index",void 0),(0,s.default)(this,"indexes",void 0),(0,s.default)(this,"data",void 0),(0,s.default)(this,"amount",void 0),(0,s.default)(this,"headers",void 0),(0,s.default)(this,"columnPositions",void 0),(0,s.default)(this,"rowPositions",void 0),(0,s.default)(this,"fixedColumnsStart",void 0),(0,s.default)(this,"removedCellMetas",void 0),this.index=t,this.indexes=r,this.data=n,this.amount=this.data[0].length,this.headers=i,this.columnPositions=o.slice(0),this.rowPositions=a.slice(0),this.fixedColumnsStart=l,this.removedCellMetas=h}static startRegisteringEvents(e,t){e.addHook("beforeRemoveCol",((r,n,s,i)=>{t.done((()=>{const t=e.getSourceDataArray(),s=(e.countCols()+r)%e.countCols(),i=s+n-1,l=[],u=[],c=[];(0,a.rangeEach)(t.length-1,(r=>{const n=[],o=t[r];(0,a.rangeEach)(s,i,(t=>{n.push(o[e.toPhysicalColumn(t)])})),l.push(n)})),(0,a.rangeEach)(n-1,(t=>{c.push(e.toPhysicalColumn(s+t))})),Array.isArray(e.getSettings().colHeaders)&&(0,a.rangeEach)(n-1,(t=>{u.push(e.getSettings().colHeaders[e.toPhysicalColumn(s+t)]||null)}));const d=e.columnIndexMapper.getIndexesSequence(),p=e.rowIndexMapper.getIndexesSequence();return new h({index:s,indexes:c,data:l,headers:u,columnPositions:d,rowPositions:p,fixedColumnsStart:e.getSettings().fixedColumnsStart,removedCellMetas:(0,o.getCellMetas)(e,0,e.countRows(),s,i)})}),i)}))}undo(e,t){e.getSettings().fixedColumnsStart=this.fixedColumnsStart;const r=this.indexes.slice(0).sort(),n=(e,t,n)=>n[this.indexes.indexOf(r[t])],s=this.data.length,i=[];for(let e=0;e{(0,l.arrayEach)(r,((r,n)=>{e[r]=i[t][n],a.push([t,r,e[r]])}))})),e.setSourceDataAtCell(a,void 0,void 0,"UndoRedo.undo"),void 0!==this.headers&&(0,l.arrayEach)(o,((t,n)=>{e.getSettings().colHeaders[r[n]]=t})),this.removedCellMetas.forEach((t=>{let[r,n,s]=t;e.setCellMetaObject(r,n,s)})),e.batchExecution((()=>{e.rowIndexMapper.setIndexesSequence(this.rowPositions),e.columnIndexMapper.setIndexesSequence(this.columnPositions)}),!0),e.addHookOnce("afterViewRender",t),e.render()}redo(e,t){e.addHookOnce("afterRemoveCol",t),e.alter("remove_col",this.index,this.amount,"UndoRedo.redo")}}t.RemoveColumnAction=h},99506:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(15724),r(14846),r(69655);var s=n(r(85707)),i=r(88814),o=r(38364),a=r(25499);class l extends i.BaseAction{constructor(e){let{index:t,data:r,fixedRowsBottom:n,fixedRowsTop:i,rowIndexesSequence:o,removedCellMetas:a}=e;super(),(0,s.default)(this,"index",void 0),(0,s.default)(this,"data",void 0),(0,s.default)(this,"fixedRowsBottom",void 0),(0,s.default)(this,"fixedRowsTop",void 0),(0,s.default)(this,"rowIndexesSequence",void 0),(0,s.default)(this,"removedCellMetas",void 0),this.index=t,this.data=r,this.fixedRowsBottom=n,this.fixedRowsTop=i,this.rowIndexesSequence=o,this.removedCellMetas=a}static startRegisteringEvents(e,t){e.addHook("beforeRemoveRow",((r,n,s,i)=>{t.done((()=>{const t=e.toPhysicalRow(r),s=t+n-1,i=(0,a.deepClone)(e.getSourceData(t,0,t+n-1,e.countSourceCols()-1));return new l({index:t,data:i,fixedRowsBottom:e.getSettings().fixedRowsBottom,fixedRowsTop:e.getSettings().fixedRowsTop,rowIndexesSequence:e.rowIndexMapper.getIndexesSequence(),removedCellMetas:(0,o.getCellMetas)(e,t,s,0,e.countCols()-1)})}),i)}))}undo(e,t){const r=e.getSettings(),n=[];r.fixedRowsBottom=this.fixedRowsBottom,r.fixedRowsTop=this.fixedRowsTop,this.data.forEach(((e,t)=>{Object.keys(e).forEach((r=>{const s=parseInt(r,10);n.push([this.index+t,isNaN(s)?r:s,e[r]])}))})),e.alter("insert_row_above",this.index,this.data.length,"UndoRedo.undo"),this.removedCellMetas.forEach((t=>{let[r,n,s]=t;e.setCellMetaObject(r,n,s)})),e.addHookOnce("afterViewRender",t),e.setSourceDataAtCell(n,null,null,"UndoRedo.undo"),e.rowIndexMapper.setIndexesSequence(this.rowIndexesSequence)}redo(e,t){e.addHookOnce("afterRemoveRow",t),e.alter("remove_row",this.index,this.data.length,"UndoRedo.redo")}}t.RemoveRowAction=l},44587:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(14846),r(69655);var s=n(r(85707)),i=r(88814),o=r(4980);class a extends i.BaseAction{constructor(e){let{rows:t,finalIndex:r}=e;super(),(0,s.default)(this,"rows",void 0),(0,s.default)(this,"finalRowIndex",void 0),this.rows=t.slice(),this.finalRowIndex=r}static startRegisteringEvents(e,t){e.addHook("beforeRowMove",((e,r)=>{!1!==e&&t.done((()=>new a({rows:e,finalIndex:r})))}))}undo(e,t){const r=e.getPlugin("manualRowMove");e.addHookOnce("afterViewRender",t);(0,o.getMoves)(this.rows,this.finalRowIndex,e.rowIndexMapper.getNumberOfIndexes()).reverse().forEach((e=>{let{from:t,to:n}=e;t{"use strict";var n=r(96784);t.__esModule=!0;var s=n(r(85707)),i=r(88814);class o extends i.BaseAction{constructor(e){let{cellRange:t}=e;super(),(0,s.default)(this,"cellRange",void 0),this.cellRange=t}static startRegisteringEvents(e,t){e.addHook("afterUnmergeCells",((e,r)=>{r||t.done((()=>new o({cellRange:e})))}))}undo(e,t){const r=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",t),r.mergeRange(this.cellRange,!0)}redo(e,t){const r=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",t),r.unmergeRange(this.cellRange,!0),e.render()}}t.UnmergeCellsAction=o},79262:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(49590);t.PLUGIN_KEY=n.PLUGIN_KEY,t.PLUGIN_PRIORITY=n.PLUGIN_PRIORITY,t.UndoRedo=n.UndoRedo},49590:(e,t,r)=>{"use strict";r(67834);var n=r(96784);t.__esModule=!0;var s=n(r(85707));r(15724),r(71336),r(41558),r(17663),r(68630),r(79645),r(89858),r(8620);var i=r(75089),o=r(28197),a=r(25499),l=r(21595),h=r(14859),u=r(37990);function c(e,t){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.add(e)}function d(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}const p="undoRedo",g=t.PLUGIN_KEY="undoRedo",f=t.PLUGIN_PRIORITY=1e3;o.Hooks.getSingleton().register("beforeUndo"),o.Hooks.getSingleton().register("afterUndo"),o.Hooks.getSingleton().register("beforeRedo"),o.Hooks.getSingleton().register("afterRedo");const m=new Set;var y=new WeakSet;class E extends i.BasePlugin{static get PLUGIN_KEY(){return g}static get PLUGIN_PRIORITY(){return f}static get SETTING_KEYS(){return!0}constructor(e){super(e),c(this,y),(0,s.default)(this,"doneActions",[]),(0,s.default)(this,"undoneActions",[]),(0,s.default)(this,"ignoreNewActions",!1),(0,u.registerActions)(e,this)}isEnabled(){return!!this.hot.getSettings().undo}enablePlugin(){var e=this;this.enabled||(this.addHook("afterChange",(function(){for(var t=arguments.length,r=new Array(t),n=0;n!e.altKey,group:p};e.addShortcuts([{keys:[["Control/Meta","z"]],callback:()=>{this.undo()}},{keys:[["Control/Meta","y"],["Control/Meta","Shift","z"]],callback:()=>{this.redo()}}],t)}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(p)}done(e,t){if(this.ignoreNewActions)return;if("UndoRedo.undo"===t||"UndoRedo.redo"===t||"auto"===t)return;const r=this.doneActions.slice();if(!1===this.hot.runHooks("beforeUndoStackChange",r,t))return;const n=e(),s=this.undoneActions.slice();this.doneActions.push(n),this.hot.runHooks("afterUndoStackChange",r,this.doneActions.slice()),this.hot.runHooks("beforeRedoStackChange",s),this.undoneActions.length=0,this.hot.runHooks("afterRedoStackChange",s,this.undoneActions.slice())}undo(){if(!this.isUndoAvailable())return;const e=this.doneActions.slice();this.hot.runHooks("beforeUndoStackChange",e);const t=this.doneActions.pop();this.hot.runHooks("afterUndoStackChange",e,this.doneActions.slice());const r=(0,a.deepClone)(t);if(!1===this.hot.runHooks("beforeUndo",r))return;this.ignoreNewActions=!0;const n=this.undoneActions.slice();this.hot.runHooks("beforeRedoStackChange",n),t.undo(this.hot,(()=>{this.ignoreNewActions=!1,this.undoneActions.push(t)})),this.hot.runHooks("afterRedoStackChange",n,this.undoneActions.slice()),this.hot.runHooks("afterUndo",r)}redo(){if(!this.isRedoAvailable())return;const e=this.undoneActions.slice();this.hot.runHooks("beforeRedoStackChange",e);const t=this.undoneActions.pop();this.hot.runHooks("afterRedoStackChange",e,this.undoneActions.slice());const r=(0,a.deepClone)(t);if(!1===this.hot.runHooks("beforeRedo",r))return;this.ignoreNewActions=!0;const n=this.doneActions.slice();this.hot.runHooks("beforeUndoStackChange",n),t.redo(this.hot,(()=>{this.ignoreNewActions=!1,this.doneActions.push(t)})),this.hot.runHooks("afterUndoStackChange",n,this.doneActions.slice()),this.hot.runHooks("afterRedo",r)}isUndoAvailable(){return this.doneActions.length>0}isRedoAvailable(){return this.undoneActions.length>0}clear(){this.doneActions.length=0,this.undoneActions.length=0}destroy(){this.clear(),this.doneActions=null,this.undoneActions=null,super.destroy()}}function w(e,t){"loadData"===t&&this.clear()}function C(){const e=e=>{m.has(e)||((0,h.warn)(l.toSingleLine`The "${e}" method is deprecated and it will be removed\x20 + from the Core API in the future. Please use the method from the UndoRedo plugin\x20 + (e.g. \`hotInstance.getPlugin("undoRedo").${e}()\`).`),m.add(e))};this.hot.undo=()=>{e("undo"),this.undo()},this.hot.redo=()=>{e("redo"),this.redo()},this.hot.isUndoAvailable=()=>(e("isUndoAvailable"),this.isUndoAvailable()),this.hot.isRedoAvailable=()=>(e("isRedoAvailable"),this.isRedoAvailable()),this.hot.clearUndo=()=>{e("clear"),this.clear()},this.hot.undoRedo=this}function v(){delete this.hot.undo,delete this.hot.redo,delete this.hot.isUndoAvailable,delete this.hot.isRedoAvailable,delete this.hot.clearUndo,delete this.hot.undoRedo}t.UndoRedo=E},38364:(e,t,r)=>{"use strict";t.__esModule=!0,t.getCellMetas=function(e,t,r,s,i){const o=["visualRow","visualCol","row","col","prop"],a=o.length,l=[];return(0,n.rangeEach)(s,i,(s=>{(0,n.rangeEach)(t,r,(t=>{const r=e.getCellMeta(t,s);if(Object.keys(r).length!==a){const e=Object.fromEntries(Object.entries(r).filter((e=>{let[t]=e;return!1===o.includes(t)})));l.push([r.visualRow,r.visualCol,e])}}))})),l},r(15724),r(75339),r(14846),r(27458);var n=r(22137)},45793:(e,t,r)=>{"use strict";t.__esModule=!0,t.registerAllModules=function(){(0,n.registerAllEditors)(),(0,s.registerAllRenderers)(),(0,i.registerAllValidators)(),(0,o.registerAllCellTypes)(),(0,a.registerAllPlugins)()};var n=r(14417);t.registerAllEditors=n.registerAllEditors;var s=r(14955);t.registerAllRenderers=s.registerAllRenderers;var i=r(41602);t.registerAllValidators=i.registerAllValidators;var o=r(14758);t.registerAllCellTypes=o.registerAllCellTypes;var a=r(50927);t.registerAllPlugins=a.registerAllPlugins},53420:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,t.autocompleteRenderer=u;var s=r(17242),i=r(85096),o=n(r(3849)),a=r(62577),l=r(71120);const h=t.RENDERER_TYPE="autocomplete";function u(e,t,r,n,h,u,c){const{rootDocument:d}=e,p=c.allowHtml?s.htmlRenderer:i.textRenderer,g=d.createElement("DIV"),f=e.getSettings().ariaTags;if(g.className="htAutocompleteArrow",f&&g.setAttribute(...(0,l.A11Y_HIDDEN)()),g.appendChild(d.createTextNode(String.fromCharCode(9660))),p.apply(this,[e,t,r,n,h,u,c]),t.firstChild||t.appendChild(d.createTextNode(String.fromCharCode(160))),t.insertBefore(g,t.firstChild),(0,a.addClass)(t,"htAutocomplete"),!e.acArrowListener){const s=new o.default(e);e.acArrowListener=function(s){(0,a.hasClass)(s.target,"htAutocompleteArrow")&&e.view._wt.getSetting("onCellDblClick",null,e._createCellCoords(r,n),t)},s.addEventListener(e.rootElement,"mousedown",e.acArrowListener),e.addHookOnce("afterDestroy",(()=>{s.destroy()}))}}u.RENDERER_TYPE=h},36759:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(53420);t.RENDERER_TYPE=n.RENDERER_TYPE,t.autocompleteRenderer=n.autocompleteRenderer},33518:(e,t,r)=>{"use strict";t.__esModule=!0,t.baseRenderer=o,r(15724);var n=r(62577),s=r(71120);const i=t.RENDERER_TYPE="base";function o(e,t,r,i,o,a,l){const h=l.ariaTags,u=[],c=[],d=[],p=[];l.className&&(0,n.addClass)(t,l.className),l.readOnly?(u.push(l.readOnlyCellClassName),h&&p.push((0,s.A11Y_READONLY)())):h&&d.push((0,s.A11Y_READONLY)()[0]),!1===l.valid&&l.invalidCellClassName?(u.push(l.invalidCellClassName),h&&p.push((0,s.A11Y_INVALID)())):(c.push(l.invalidCellClassName),h&&d.push((0,s.A11Y_INVALID)()[0])),!1===l.wordWrap&&l.noWordWrapClassName&&u.push(l.noWordWrapClassName),!a&&l.placeholder&&u.push(l.placeholderCellClassName),(0,n.removeClass)(t,c),(0,n.addClass)(t,u),(0,n.removeAttribute)(t,d),(0,n.setAttribute)(t,p)}o.RENDERER_TYPE=i},84250:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(33518);t.RENDERER_TYPE=n.RENDERER_TYPE,t.baseRenderer=n.baseRenderer},53942:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,t.checkboxRenderer=w,r(15724),r(14846),r(63333),r(94364);var s=r(84250),i=n(r(3849)),o=r(62577),a=r(70505),l=r(92399),h=r(28197),u=r(71120),c=r(23384);const d=new WeakMap,p=new WeakMap,g="htBadValue",f="data-row",m="data-col",y="checkboxRenderer",E=t.RENDERER_TYPE="checkbox";function w(e,t,r,n,h,E,w){const{rootDocument:v}=e,R=e.getSettings().ariaTags;s.baseRenderer.apply(this,[e,t,r,n,h,E,w]),function(e){let t=p.get(e);if(!t){const{rootElement:r}=e;t=new i.default(e),t.addEventListener(r,"click",(t=>function(e,t){const{target:r}=e;if(!C(r))return;if(!r.hasAttribute(f)||!r.hasAttribute(m))return;const n=parseInt(r.getAttribute(f),10),s=parseInt(r.getAttribute(m),10),i=t.getCellMeta(n,s);i.readOnly&&e.preventDefault()}(t,e))),t.addEventListener(r,"mouseup",(t=>function(e,t){const{target:r}=e;if(!C(r))return;if(!r.hasAttribute(f)||!r.hasAttribute(m))return;setTimeout(t.listen,10)}(t,e))),t.addEventListener(r,"change",(t=>function(e,t){const{target:r}=e;if(!C(r))return;if(!r.hasAttribute(f)||!r.hasAttribute(m))return;const n=parseInt(r.getAttribute(f),10),s=parseInt(r.getAttribute(m),10),i=t.getCellMeta(n,s);if(!i.readOnly){let r=null;r=e.target.checked?void 0===i.uncheckedTemplate||i.checkedTemplate:void 0!==i.uncheckedTemplate&&i.uncheckedTemplate,t.setDataAtCell(n,s,r)}}(t,e))),p.set(e,t)}}(e);let S=function(e){const t=e.createElement("input");return t.className="htCheckboxRendererInput",t.type="checkbox",t.setAttribute("tabindex","-1"),t.cloneNode(!1)}(v);const T=w.label;let N=!1;if(void 0===w.checkedTemplate&&(w.checkedTemplate=!0),void 0===w.uncheckedTemplate&&(w.uncheckedTemplate=!1),(0,o.empty)(t),E===w.checkedTemplate||(0,a.stringify)(E).toLocaleLowerCase(w.locale)===(0,a.stringify)(w.checkedTemplate).toLocaleLowerCase(w.locale)?S.checked=!0:E===w.uncheckedTemplate||(0,a.stringify)(E).toLocaleLowerCase(w.locale)===(0,a.stringify)(w.uncheckedTemplate).toLocaleLowerCase(w.locale)?S.checked=!1:(0,a.isEmpty)(E)?(0,o.addClass)(S,"noValue"):(S.style.display="none",(0,o.addClass)(S,g),N=!0),(0,o.setAttribute)(S,[[f,r],[m,n]]),R&&(0,o.setAttribute)(S,[(0,u.A11Y_LABEL)(S.checked?e.getTranslatedPhrase(c.CHECKBOX_CHECKED):e.getTranslatedPhrase(c.CHECKBOX_UNCHECKED)),(0,u.A11Y_CHECKED)(S.checked),(0,u.A11Y_CHECKBOX)()]),!N&&T){let s="";if(T.value)s="function"==typeof T.value?T.value.call(this,r,n,h,E):T.value;else if(T.property){const t=e.getDataAtRowProp(r,T.property);s=null!==t?t:""}const i=function(e,t,r){const n=e.createElement("label");n.className="htCheckboxRendererLabel "+(r?"fullWidth":"");const s=e.createTextNode(t);if(r){const t=e.createElement("span");t.appendChild(s),n.appendChild(t)}else n.appendChild(s);return n.cloneNode(!0)}(v,s,!0!==T.separated);"before"===T.position?T.separated?(t.appendChild(i),t.appendChild(S)):(i.appendChild(S),S=i):T.position&&"after"!==T.position||(T.separated?(t.appendChild(S),t.appendChild(i)):(i.insertBefore(S,i.firstChild),S=i))}function M(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const r=e.getSelectedRange(),n=[],s=new Map;let i=[],o=0;if(r){for(let a=0;a{let[,,t]=e;return t===i[0][2]}))?i.map((e=>{let[t,r,n]=e;return[t,r,n]})):i.map((e=>{let[t,r,,n]=e;return[t,r,n.checkedTemplate]})),i.length>0&&n.forEach(((t,r)=>{let n=i.splice(0,t);s.size&&s.has(r)&&(n=[...n,...s.get(r)]),e.setDataAtCell(n)}))}}function _(){const t=e.getSelectedRange();if(t){for(let r=0;r0)return!0}}}return!1}}(!T||T&&!T.separated)&&t.appendChild(S),N&&t.appendChild(v.createTextNode("#bad-value#")),d.has(e)||(d.set(e,!0),function(){const t=e.getShortcutManager().getContext("grid"),r={group:y,relativeToGroup:l.EDITOR_EDIT_GROUP,position:"before"};t.addShortcuts([{keys:[["space"]],callback:()=>(M(),!_()),runOnlyIf:()=>{var t;return null===(t=e.getSelectedRangeLast())||void 0===t?void 0:t.highlight.isCell()}},{keys:[["enter"]],callback:()=>(M(),!_()),runOnlyIf:()=>{const t=e.getSelectedRangeLast();return e.getSettings().enterBeginsEditing&&(null==t?void 0:t.highlight.isCell())&&!e.selection.isMultiple()}},{keys:[["delete"],["backspace"]],callback:()=>(M(!0),!_()),runOnlyIf:()=>{var t;return null===(t=e.getSelectedRangeLast())||void 0===t?void 0:t.highlight.isCell()}}],r)}())}function C(e){return"INPUT"===e.tagName&&"checkbox"===e.getAttribute("type")}h.Hooks.getSingleton().add("modifyAutoColumnSizeSeed",(function(e,t,r){const{label:n,type:s,row:i,column:o,prop:a}=t;if(s===E){if(n){const{value:t,property:s}=n;let l=r;if(t)l="function"==typeof t?t(i,o,a,r):t;else if(s){const e=this.getDataAtRowProp(i,s);l=null!==e?e:r}e=l}return e}})),w.RENDERER_TYPE=E},86510:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(53942);t.RENDERER_TYPE=n.RENDERER_TYPE,t.checkboxRenderer=n.checkboxRenderer},24668:(e,t,r)=>{"use strict";t.__esModule=!0,t.dateRenderer=i;var n=r(36759);const s=t.RENDERER_TYPE="date";function i(e,t,r,s,i,o,a){n.autocompleteRenderer.apply(this,[e,t,r,s,i,o,a])}i.RENDERER_TYPE=s},72375:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(24668);t.RENDERER_TYPE=n.RENDERER_TYPE,t.dateRenderer=n.dateRenderer},89914:(e,t,r)=>{"use strict";t.__esModule=!0,t.dropdownRenderer=i;var n=r(36759);const s=t.RENDERER_TYPE="dropdown";function i(e,t,r,s,i,o,a){n.autocompleteRenderer.apply(this,[e,t,r,s,i,o,a])}i.RENDERER_TYPE=s},24682:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(89914);t.RENDERER_TYPE=n.RENDERER_TYPE,t.dropdownRenderer=n.dropdownRenderer},46646:(e,t,r)=>{"use strict";t.__esModule=!0,t.handsontableRenderer=i;var n=r(36759);const s=t.RENDERER_TYPE="handsontable";function i(e,t,r,s,i,o,a){n.autocompleteRenderer.apply(this,[e,t,r,s,i,o,a])}i.RENDERER_TYPE=s},32278:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(46646);t.RENDERER_TYPE=n.RENDERER_TYPE,t.handsontableRenderer=n.handsontableRenderer},45662:(e,t,r)=>{"use strict";t.__esModule=!0,t.htmlRenderer=o;var n=r(84250),s=r(62577);const i=t.RENDERER_TYPE="html";function o(e,t,r,i,o,a,l){n.baseRenderer.apply(this,[e,t,r,i,o,a,l]),(0,s.fastInnerHTML)(t,null==a?"":a,!1)}o.RENDERER_TYPE=i},17242:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(45662);t.RENDERER_TYPE=n.RENDERER_TYPE,t.htmlRenderer=n.htmlRenderer},14955:(e,t,r)=>{"use strict";t.__esModule=!0,t.registerAllRenderers=function(){(0,g.registerRenderer)(n.autocompleteRenderer),(0,g.registerRenderer)(s.baseRenderer),(0,g.registerRenderer)(o.checkboxRenderer),(0,g.registerRenderer)(i.dropdownRenderer),(0,g.registerRenderer)(a.handsontableRenderer),(0,g.registerRenderer)(l.htmlRenderer),(0,g.registerRenderer)(h.numericRenderer),(0,g.registerRenderer)(u.passwordRenderer),(0,g.registerRenderer)(c.selectRenderer),(0,g.registerRenderer)(d.textRenderer),(0,g.registerRenderer)(p.timeRenderer)};var n=r(36759);t.autocompleteRenderer=n.autocompleteRenderer,t.AUTOCOMPLETE_RENDERER=n.RENDERER_TYPE;var s=r(84250);t.baseRenderer=s.baseRenderer,t.BASE_RENDERER=s.RENDERER_TYPE;var i=r(24682);t.dropdownRenderer=i.dropdownRenderer,t.DROPDOWN_RENDERER=i.RENDERER_TYPE;var o=r(86510);t.checkboxRenderer=o.checkboxRenderer,t.CHECKBOX_RENDERER=o.RENDERER_TYPE;var a=r(32278);t.handsontableRenderer=a.handsontableRenderer,t.HANDSONTABLE_RENDERER=a.RENDERER_TYPE;var l=r(17242);t.htmlRenderer=l.htmlRenderer,t.HTML_RENDERER=l.RENDERER_TYPE;var h=r(17756);t.numericRenderer=h.numericRenderer,t.NUMERIC_RENDERER=h.RENDERER_TYPE;var u=r(64910);t.passwordRenderer=u.passwordRenderer,t.PASSWORD_RENDERER=u.RENDERER_TYPE;var c=r(15651);t.selectRenderer=c.selectRenderer,t.SELECT_RENDERER=c.RENDERER_TYPE;var d=r(85096);t.textRenderer=d.textRenderer,t.TEXT_RENDERER=d.RENDERER_TYPE;var p=r(70350);t.timeRenderer=p.timeRenderer,t.TIME_RENDERER=p.RENDERER_TYPE;var g=r(54852);t.registerRenderer=g.registerRenderer,t.getRegisteredRendererNames=g.getRegisteredRendererNames,t.getRegisteredRenderers=g.getRegisteredRenderers,t.getRenderer=g.getRenderer,t.hasRenderer=g.hasRenderer},17756:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(8376);t.RENDERER_TYPE=n.RENDERER_TYPE,t.numericRenderer=n.numericRenderer,t.getRenderedValue=n.getRenderedValue},8376:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,t.getRenderedValue=l,t.numericRenderer=h,r(15724);var s=n(r(80586)),i=r(85096),o=r(22137);const a=t.RENDERER_TYPE="numeric";function l(e,t){if((0,o.isNumeric)(e)){const r=t.numericFormat,n=r&&r.culture||"-",i=r&&r.pattern;if(void 0!==n&&!s.default.languages()[n]){const e=n.replace("-",""),t=s.default.allLanguages?s.default.allLanguages[n]:s.default[e];t&&s.default.registerLanguage(t)}s.default.setLanguage(n),e=(0,s.default)(e).format(i||"0")}return e}function h(e,t,r,n,s,a,h){let u=a;if((0,o.isNumeric)(u)){const e=h.className||"",r=e.length?e.split(" "):[];u=l(u,h),r.indexOf("htLeft")<0&&r.indexOf("htCenter")<0&&r.indexOf("htRight")<0&&r.indexOf("htJustify")<0&&r.push("htRight"),r.indexOf("htNumeric")<0&&r.push("htNumeric"),h.className=r.join(" "),t.dir="ltr"}(0,i.textRenderer)(e,t,r,n,s,u,h)}h.RENDERER_TYPE=a},64910:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(30774);t.RENDERER_TYPE=n.RENDERER_TYPE,t.passwordRenderer=n.passwordRenderer},30774:(e,t,r)=>{"use strict";t.__esModule=!0,t.passwordRenderer=a;var n=r(85096),s=r(62577),i=r(22137);const o=t.RENDERER_TYPE="password";function a(e,t,r,o,a,l,h){n.textRenderer.apply(this,[e,t,r,o,a,l,h]);const u=h.hashLength||t.innerHTML.length,c=h.hashSymbol||"*";let d="";(0,i.rangeEach)(u-1,(()=>{d+=c})),(0,s.fastInnerHTML)(t,d)}a.RENDERER_TYPE=o},54852:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,t.getRenderer=function(e){if("function"==typeof e)return e;if(!a(e))throw Error(`No registered renderer found under "${e}" name`);return o(e)},t.registerRenderer=function(e,t){"string"!=typeof e&&(e=(t=e).RENDERER_TYPE);i(e,t)},r(67834);var s=n(r(28651));const{register:i,getItem:o,hasItem:a,getNames:l,getValues:h}=(0,s.default)("renderers");t.getRegisteredRenderers=h,t.getRegisteredRendererNames=l,t.hasRenderer=a},15651:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(26084);t.RENDERER_TYPE=n.RENDERER_TYPE,t.selectRenderer=n.selectRenderer},26084:(e,t,r)=>{"use strict";t.__esModule=!0,t.selectRenderer=i;var n=r(85096);const s=t.RENDERER_TYPE="select";function i(e,t,r,s,i,o,a){n.textRenderer.apply(this,[e,t,r,s,i,o,a])}i.RENDERER_TYPE=s},85096:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(56398);t.RENDERER_TYPE=n.RENDERER_TYPE,t.textRenderer=n.textRenderer},56398:(e,t,r)=>{"use strict";t.__esModule=!0,t.textRenderer=a;var n=r(84250),s=r(62577),i=r(70505);const o=t.RENDERER_TYPE="text";function a(e,t,r,o,a,l,h){n.baseRenderer.apply(this,[e,t,r,o,a,l,h]);let u=l;if(!u&&h.placeholder&&(u=h.placeholder),u=(0,i.stringify)(u),h.trimWhitespace&&(u=u.trim()),h.rendererTemplate){(0,s.empty)(t);const n=e.rootDocument.createElement("TEMPLATE");n.setAttribute("bind","{{}}"),n.innerHTML=h.rendererTemplate,HTMLTemplateElement.decorate(n),n.model=e.getSourceDataAtRow(r),t.appendChild(n)}else(0,s.fastInnerText)(t,u)}a.RENDERER_TYPE=o},70350:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(94286);t.RENDERER_TYPE=n.RENDERER_TYPE,t.timeRenderer=n.timeRenderer},94286:(e,t,r)=>{"use strict";t.__esModule=!0,t.timeRenderer=i;var n=r(85096);const s=t.RENDERER_TYPE="time";function i(e,t,r,s,i,o,a){n.textRenderer.apply(this,[e,t,r,s,i,o,a]),t.dir="ltr"}i.RENDERER_TYPE=s},40206:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834),r(15724);var s=n(r(85707)),i=r(92109),o=r(74355),a=r(51751),l=r(62208),h=r(32004),u=r(59107),c=r(42611),d=r(43915),p=r(63660),g=r(50206);t.ACTIVE_HEADER_TYPE=g.HIGHLIGHT_ACTIVE_HEADER_TYPE,t.AREA_TYPE=g.HIGHLIGHT_AREA_TYPE,t.FOCUS_TYPE=g.HIGHLIGHT_FOCUS_TYPE,t.CUSTOM_SELECTION_TYPE=g.HIGHLIGHT_CUSTOM_SELECTION_TYPE,t.FILL_TYPE=g.HIGHLIGHT_FILL_TYPE,t.HEADER_TYPE=g.HIGHLIGHT_HEADER_TYPE,t.ROW_TYPE=g.HIGHLIGHT_ROW_TYPE,t.COLUMN_TYPE=g.HIGHLIGHT_COLUMN_TYPE;var f=r(10587);function m(e,t){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.add(e)}function y(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var E=new WeakSet;class w{constructor(e){m(this,E),(0,s.default)(this,"options",void 0),(0,s.default)(this,"layerLevel",0),(0,s.default)(this,"focus",void 0),(0,s.default)(this,"fill",void 0),(0,s.default)(this,"layeredAreas",new Map),(0,s.default)(this,"areas",new Map),(0,s.default)(this,"rowHeaders",new Map),(0,s.default)(this,"columnHeaders",new Map),(0,s.default)(this,"activeRowHeaders",new Map),(0,s.default)(this,"activeColumnHeaders",new Map),(0,s.default)(this,"activeCornerHeaders",new Map),(0,s.default)(this,"rowHighlights",new Map),(0,s.default)(this,"columnHighlights",new Map),(0,s.default)(this,"customSelections",[]),this.options=e,this.focus=(0,h.createHighlight)(e),this.fill=(0,c.createHighlight)(e)}isEnabledFor(e,t){let r=e;e===g.HIGHLIGHT_FOCUS_TYPE&&(r="current");let n=this.options.disabledCellSelection(t.row,t.col);return"string"==typeof n&&(n=[n]),!1===n||Array.isArray(n)&&!n.includes(r)}useLayerLevel(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.layerLevel=e,this}getFocus(){return this.focus}getFill(){return this.fill}createLayeredArea(){return y(E,this,C).call(this,this.layeredAreas,o.createHighlight)}getLayeredAreas(){return[...this.layeredAreas.values()]}createArea(){return y(E,this,C).call(this,this.areas,a.createHighlight)}getAreas(){return[...this.areas.values()]}createRowHeader(){return y(E,this,C).call(this,this.rowHeaders,d.createHighlight)}getRowHeaders(){return[...this.rowHeaders.values()]}createColumnHeader(){return y(E,this,C).call(this,this.columnHeaders,d.createHighlight)}getColumnHeaders(){return[...this.columnHeaders.values()]}createActiveRowHeader(){return y(E,this,C).call(this,this.activeRowHeaders,i.createHighlight)}getActiveRowHeaders(){return[...this.activeRowHeaders.values()]}createActiveColumnHeader(){return y(E,this,C).call(this,this.activeColumnHeaders,i.createHighlight)}getActiveColumnHeaders(){return[...this.activeColumnHeaders.values()]}createActiveCornerHeader(){return y(E,this,C).call(this,this.activeCornerHeaders,i.createHighlight)}getActiveCornerHeaders(){return[...this.activeCornerHeaders.values()]}createRowHighlight(){return y(E,this,C).call(this,this.rowHighlights,p.createHighlight)}getRowHighlights(){return[...this.rowHighlights.values()]}createColumnHighlight(){return y(E,this,C).call(this,this.columnHighlights,l.createHighlight)}getColumnHighlights(){return[...this.columnHighlights.values()]}getCustomSelections(){return[...this.customSelections.values()]}addCustomSelection(e){this.customSelections.push((0,u.createHighlight)({...this.options,...e}))}clear(){this.focus.clear(),this.fill.clear(),(0,f.arrayEach)(this.areas.values(),(e=>{e.clear()})),(0,f.arrayEach)(this.layeredAreas.values(),(e=>{e.clear()})),(0,f.arrayEach)(this.rowHeaders.values(),(e=>{e.clear()})),(0,f.arrayEach)(this.columnHeaders.values(),(e=>{e.clear()})),(0,f.arrayEach)(this.activeRowHeaders.values(),(e=>{e.clear()})),(0,f.arrayEach)(this.activeColumnHeaders.values(),(e=>{e.clear()})),(0,f.arrayEach)(this.activeCornerHeaders.values(),(e=>{e.clear()})),(0,f.arrayEach)(this.rowHighlights.values(),(e=>{e.clear()})),(0,f.arrayEach)(this.columnHighlights.values(),(e=>{e.clear()}))}[Symbol.iterator](){return[this.focus,this.fill,...this.areas.values(),...this.layeredAreas.values(),...this.rowHeaders.values(),...this.columnHeaders.values(),...this.activeRowHeaders.values(),...this.activeColumnHeaders.values(),...this.activeCornerHeaders.values(),...this.rowHighlights.values(),...this.columnHighlights.values(),...this.customSelections][Symbol.iterator]()}}function C(e,t){const r=this.layerLevel;if(e.has(r))return e.get(r);const n=t({layerLevel:r,...this.options});return e.set(r,n),n}t.default=w},92109:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,t.createHighlight=function(e){let{activeHeaderClassName:t,...r}=e;return new i.default({className:t,...r,selectionType:s.HIGHLIGHT_ACTIVE_HEADER_TYPE})};var s=r(50206),i=n(r(11724))},51751:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,t.createHighlight=function(e){let{...t}=e;return new i.default({className:"highlight",...t,selectionType:s.HIGHLIGHT_AREA_TYPE})};var s=r(50206),i=n(r(11724))},74355:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,t.createHighlight=function(e){let{areaCornerVisible:t,...r}=e;return new i.default({className:"area",createLayers:!0,border:{width:1,color:"#4b89ff",cornerVisible:t},...r,selectionType:s.HIGHLIGHT_AREA_TYPE})};var s=r(50206),i=n(r(11724))},62208:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,t.createHighlight=function(e){let{columnClassName:t,...r}=e;return new i.default({className:t,...r,selectionType:s.HIGHLIGHT_COLUMN_TYPE})};var s=r(50206),i=n(r(11724))},59107:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,t.createHighlight=function(e){let{border:t,visualCellRange:r,...n}=e;return new i.default({...t,...n,selectionType:s.HIGHLIGHT_CUSTOM_SELECTION_TYPE},r)};var s=r(50206),i=n(r(11724))},42611:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,t.createHighlight=function(e){let{...t}=e;return new i.default({className:"fill",border:{width:1,color:"#ff0000"},...t,selectionType:s.HIGHLIGHT_FILL_TYPE})};var s=r(50206),i=n(r(11724))},32004:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,t.createHighlight=function(e){let{cellCornerVisible:t,...r}=e;return new i.default({className:"current",headerAttributes:[(0,o.A11Y_SELECTED)()],border:{width:2,color:"#4b89ff",cornerVisible:t},...r,selectionType:s.HIGHLIGHT_FOCUS_TYPE})};var s=r(50206),i=n(r(11724)),o=r(71120)},43915:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,t.createHighlight=function(e){let{headerClassName:t,...r}=e;return new i.default({className:t,...r,selectionType:s.HIGHLIGHT_HEADER_TYPE})};var s=r(50206),i=n(r(11724))},63660:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,t.createHighlight=function(e){let{rowClassName:t,...r}=e;return new i.default({className:t,...r,selectionType:s.HIGHLIGHT_ROW_TYPE})};var s=r(50206),i=n(r(11724))},11724:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0;var s=n(r(85707)),i=r(50206);class o extends i.Selection{constructor(e,t){super(e,null),(0,s.default)(this,"visualCellRange",null),this.visualCellRange=t||null,this.commit()}add(e){return null===this.visualCellRange?this.visualCellRange=this.settings.createCellRange(e):this.visualCellRange.expand(e),this}clear(){return this.visualCellRange=null,super.clear()}trimToVisibleCellsRangeOnly(e){let{from:t,to:r}=e,n=this.getNearestNotHiddenCoords(t,1),s=this.getNearestNotHiddenCoords(r,-1);return null===n||null===s?null:((n.row>s.row||n.col>s.col)&&(n=t,s=r),this.settings.createCellRange(n,n,s))}getNearestNotHiddenCoords(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t;const n=this.getNearestNotHiddenIndex(this.settings.rowIndexMapper,e.row,t);if(null===n)return null;const s=this.getNearestNotHiddenIndex(this.settings.columnIndexMapper,e.col,r);return null===s?null:this.settings.createCellCoords(n,s)}getNearestNotHiddenIndex(e,t,r){return t<0?t:e.getNearestNotHiddenIndex(t,r)}commit(){if(null===this.visualCellRange)return this;const e=this.trimToVisibleCellsRangeOnly(this.visualCellRange);return this.cellRange=null===e?null:this.createRenderableCellRange(e.from,e.to),this}syncWith(e){const t=e.from.clone().normalize(),r="N-S"===e.getVerticalDirection()?1:-1,n="W-E"===e.getHorizontalDirection()?1:-1,s=this.settings.visualToRenderableCoords(this.visualCellRange.highlight);let i=null;if(null!==s&&null!==s.col&&null!==s.row||(i=this.getNearestNotHiddenCoords(t,r,n)),null!==i&&e.overlaps(i)){const t=e.highlight.clone();if(t.row>=0&&(t.row=i.row),t.col>=0&&(t.col=i.col),null===this.cellRange){const e=this.settings.visualToRenderableCoords(t);this.cellRange=this.settings.createCellRange(e)}e.setHighlight(t)}return"focus"===this.settings.selectionType&&null!==s&&null===i&&e.setHighlight(this.visualCellRange.highlight),this}getCorners(){const{from:e,to:t}=this.cellRange;return[Math.min(e.row,t.row),Math.min(e.col,t.col),Math.max(e.row,t.row),Math.max(e.col,t.col)]}getVisualCorners(){const e=this.settings.renderableToVisualCoords(this.cellRange.getTopStartCorner()),t=this.settings.renderableToVisualCoords(this.cellRange.getBottomEndCorner());return[e.row,e.col,t.row,t.col]}createRenderableCellRange(e,t){const r=this.settings.visualToRenderableCoords(e),n=this.settings.visualToRenderableCoords(t);return null===r.row||null===r.col||null===n.row||null===n.col?null:this.settings.createCellRange(r,r,n)}}t.default=o},76717:(e,t,r)=>{"use strict";r(14846),r(69655);var n=r(96784);t.__esModule=!0;var s={Selection:!0,handleMouseEvent:!0,detectSelectionType:!0,normalizeSelectionFactory:!0},i=n(r(67751));t.Selection=i.default;var o=r(87642);t.handleMouseEvent=o.handleMouseEvent;var a=r(13208);t.detectSelectionType=a.detectSelectionType,t.normalizeSelectionFactory=a.normalizeSelectionFactory;var l=r(40206);Object.keys(l).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(s,e)||e in t&&t[e]===l[e]||(t[e]=l[e]))}))},87642:(e,t,r)=>{"use strict";t.__esModule=!0,t.handleMouseEvent=function(e,t){let{coords:r,selection:s,controller:i,cellCoordsFactory:a}=t;o.get(e.type)({coords:r,selection:s,controller:i,cellCoordsFactory:a,isShiftKey:e.shiftKey,isLeftClick:(0,n.isLeftClick)(e)||"touchstart"===e.type,isRightClick:(0,n.isRightClick)(e)})},t.mouseDown=s,t.mouseOver=i;var n=r(77661);function s(e){let{isShiftKey:t,isLeftClick:r,isRightClick:n,coords:s,selection:i,controller:o,cellCoordsFactory:a}=e;const l=i.isSelected()?i.getSelectedRange().current():null,h=i.isSelectedByCorner(),u=i.isSelectedByRowHeader();if(i.markSource("mouse"),t&&l)s.row>=0&&s.col>=0&&!o.cell?i.setRangeEnd(s):(h||u)&&s.row>=0&&s.col>=0&&!o.cell?i.setRangeEnd(a(s.row,s.col)):h&&s.row<0&&!o.column?i.setRangeEnd(a(l.to.row,s.col)):u&&s.col<0&&!o.row?i.setRangeEnd(a(s.row,l.to.col)):(!h&&!u&&s.col<0||h&&s.col<0)&&!o.row?i.selectRows(Math.max(l.from.row,0),s.row,s.col):(!h&&!u&&s.row<0||u&&s.row<0)&&!o.column&&i.selectColumns(Math.max(l.from.col,0),s.col,s.row);else{const e=!i.inInSelection(s),t=r||n&&e;s.row<0&&s.col>=0&&!o.column?t&&i.selectColumns(s.col,s.col,s.row):s.col<0&&s.row>=0&&!o.row?t&&i.selectRows(s.row,s.row,s.col):s.col>=0&&s.row>=0&&!o.cell?t&&i.setRangeStart(s):s.col<0&&s.row<0&&i.selectAll(!0,!0,{disableHeadersHighlight:!0,focusPosition:{row:0,col:0}})}i.markEndSource()}function i(e){let{isLeftClick:t,coords:r,selection:n,controller:s,cellCoordsFactory:i}=e;if(!t)return;const o=n.isSelectedByRowHeader(),a=n.isSelectedByColumnHeader(),l=n.tableProps.countCols(),h=n.tableProps.countRows();n.markSource("mouse"),a&&!s.column?n.setRangeEnd(i(h-1,r.col)):o&&!s.row?n.setRangeEnd(i(r.row,l-1)):s.cell||n.setRangeEnd(r),n.markEndSource()}const o=new Map([["mousedown",s],["mouseover",i],["touchstart",s]])},6232:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(15724),r(14846),r(75568);var s=n(r(85707));class i{constructor(e){(0,s.default)(this,"ranges",[]),(0,s.default)(this,"createCellRange",void 0),this.createCellRange=e}isEmpty(){return 0===this.size()}set(e){return this.clear(),this.ranges.push(this.createCellRange(e)),this}add(e){return this.ranges.push(this.createCellRange(e)),this}pop(){return this.ranges.pop(),this}current(){return this.peekByIndex(this.size()-1)}previous(){return this.peekByIndex(this.size()-2)}includes(e){return this.ranges.some((t=>t.includes(e)))}clear(){return this.ranges.length=0,this}size(){return this.ranges.length}peekByIndex(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return t>=0&&t{"use strict";var n=r(96784);t.__esModule=!0,r(67834),r(15724),r(71336),r(41558),r(17663),r(68630),r(79645),r(89858),r(8620),r(14846),r(69655),r(75568);var s=n(r(85707)),i=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=m(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var o=s?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(n,i,o):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n}(r(40206)),o=n(r(6232)),a=r(25499),l=r(70505),h=r(22137),u=r(10587),c=n(r(16050)),d=n(r(88988)),p=r(13208),g=r(21595),f=r(71120);function m(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(m=function(e){return e?r:t})(e)}function y(e,t,r){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}function E(e,t){return e.get(C(e,t))}function w(e,t,r){return e.set(C(e,t),r),r}function C(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var v=new WeakMap,R=new WeakMap,S=new WeakMap,T=new WeakMap,N=new WeakMap,M=new WeakMap;class _{constructor(e,t){var r=this;(0,s.default)(this,"settings",void 0),(0,s.default)(this,"tableProps",void 0),(0,s.default)(this,"inProgress",!1),(0,s.default)(this,"selectedRange",new o.default(((e,t,r)=>this.tableProps.createCellRange(e,t,r)))),(0,s.default)(this,"highlight",void 0),y(this,v,void 0),y(this,R,void 0),(0,s.default)(this,"selectedByRowHeader",new Set),(0,s.default)(this,"selectedByColumnHeader",new Set),y(this,S,!1),y(this,T,!1),y(this,N,"unknown"),y(this,M,-1),this.settings=e,this.tableProps=t,this.highlight=new i.default({headerClassName:e.currentHeaderClassName,activeHeaderClassName:e.activeHeaderClassName,rowClassName:e.currentRowClassName,columnClassName:e.currentColClassName,cellAttributes:[(0,f.A11Y_SELECTED)()],rowIndexMapper:this.tableProps.rowIndexMapper,columnIndexMapper:this.tableProps.columnIndexMapper,disabledCellSelection:(e,t)=>this.tableProps.isDisabledCellSelection(e,t),cellCornerVisible:function(){return r.isCellCornerVisible(...arguments)},areaCornerVisible:function(){return r.isAreaCornerVisible(...arguments)},visualToRenderableCoords:e=>this.tableProps.visualToRenderableCoords(e),renderableToVisualCoords:e=>this.tableProps.renderableToVisualCoords(e),createCellCoords:(e,t)=>this.tableProps.createCellCoords(e,t),createCellRange:(e,t,r)=>this.tableProps.createCellRange(e,t,r)}),w(v,this,new d.default(this.selectedRange,{rowIndexMapper:this.tableProps.rowIndexMapper,columnIndexMapper:this.tableProps.columnIndexMapper,countRenderableRows:()=>this.tableProps.countRenderableRows(),countRenderableColumns:()=>this.tableProps.countRenderableColumns(),visualToRenderableCoords:e=>this.tableProps.visualToRenderableCoords(e),renderableToVisualCoords:e=>this.tableProps.renderableToVisualCoords(e),findFirstNonHiddenRenderableRow:function(){return r.tableProps.findFirstNonHiddenRenderableRow(...arguments)},findFirstNonHiddenRenderableColumn:function(){return r.tableProps.findFirstNonHiddenRenderableColumn(...arguments)},createCellCoords:(e,t)=>this.tableProps.createCellCoords(e,t),fixedRowsBottom:()=>e.fixedRowsBottom,minSpareRows:()=>e.minSpareRows,minSpareCols:()=>e.minSpareCols,autoWrapRow:()=>e.autoWrapRow,autoWrapCol:()=>e.autoWrapCol})),w(R,this,new d.default(this.selectedRange,{rowIndexMapper:this.tableProps.rowIndexMapper,columnIndexMapper:this.tableProps.columnIndexMapper,countRenderableRows:()=>{const e=this.selectedRange.current();return this.tableProps.countRenderableRowsInRange(0,e.getOuterBottomEndCorner().row)},countRenderableColumns:()=>{const e=this.selectedRange.current();return this.tableProps.countRenderableColumnsInRange(0,e.getOuterBottomEndCorner().col)},visualToRenderableCoords:e=>this.tableProps.visualToRenderableCoords(e),renderableToVisualCoords:e=>this.tableProps.renderableToVisualCoords(e),findFirstNonHiddenRenderableRow:function(){return r.tableProps.findFirstNonHiddenRenderableRow(...arguments)},findFirstNonHiddenRenderableColumn:function(){return r.tableProps.findFirstNonHiddenRenderableColumn(...arguments)},createCellCoords:(e,t)=>this.tableProps.createCellCoords(e,t),fixedRowsBottom:()=>0,minSpareRows:()=>0,minSpareCols:()=>0,autoWrapRow:()=>!0,autoWrapCol:()=>!0})),E(v,this).addLocalHook("beforeTransformStart",(function(){for(var e=arguments.length,t=new Array(e),n=0;n2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e;const s="multiple"===this.settings.selectionMode,i=(0,l.isUndefined)(t)?this.tableProps.getShortcutManager().isCtrlPressed():t,o=e.clone();w(S,this,!1),this.runLocalHooks("beforeSetRangeStart"+(r?"Only":""),o),(!s||s&&!i&&(0,l.isUndefined)(t))&&this.selectedRange.clear(),this.selectedRange.add(o).current().setHighlight(n.clone()),0===this.getLayerLevel()&&(this.selectedByRowHeader.clear(),this.selectedByColumnHeader.clear()),r||this.setRangeEnd(e)}setRangeStartOnly(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e;this.setRangeStart(e,t,!0,r)}setRangeEnd(e){if(this.selectedRange.isEmpty())return;const t=e.clone(),r=this.tableProps.countRows(),n=this.tableProps.countCols(),s=this.selectedRange.current().clone().setTo(e).isSingleHeader();if((r>0||n>0)&&(0===r&&t.col<0&&!s||0===n&&t.row<0&&!s))return;this.runLocalHooks("beforeSetRangeEnd",t),this.begin();const i=this.selectedRange.current();if(this.settings.navigableHeaders||i.highlight.normalize(),"single"===this.settings.selectionMode)i.setFrom(i.highlight),i.setTo(i.highlight);else{const e=i.getHorizontalDirection(),r=i.getVerticalDirection(),n=this.isMultiple();i.setTo(t),n&&(e!==i.getHorizontalDirection()||1===i.getWidth()&&!i.includes(i.highlight))&&i.from.assign({col:i.highlight.col}),n&&(r!==i.getVerticalDirection()||1===i.getHeight()&&!i.includes(i.highlight))&&i.from.assign({row:i.highlight.row})}r>0&&n>0&&(!this.settings.navigableHeaders||this.settings.navigableHeaders&&!i.isSingleHeader())&&i.to.normalize(),this.runLocalHooks("beforeHighlightSet"),this.setRangeFocus(this.selectedRange.current().highlight),this.applyAndCommit();const o=-1===E(M,this)||this.selectedRange.size()===E(M,this);this.runLocalHooks("afterSetRangeEnd",e,o)}applyAndCommit(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.selectedRange.current(),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLayerLevel();const r=this.tableProps.countRows(),n=this.tableProps.countCols();t{e.clear()})),(0,u.arrayEach)(this.highlight.getLayeredAreas(),(e=>{e.clear()})),(0,u.arrayEach)(this.highlight.getRowHeaders(),(e=>{e.clear()})),(0,u.arrayEach)(this.highlight.getColumnHeaders(),(e=>{e.clear()})),(0,u.arrayEach)(this.highlight.getActiveRowHeaders(),(e=>{e.clear()})),(0,u.arrayEach)(this.highlight.getActiveColumnHeaders(),(e=>{e.clear()})),(0,u.arrayEach)(this.highlight.getActiveCornerHeaders(),(e=>{e.clear()})),(0,u.arrayEach)(this.highlight.getRowHighlights(),(e=>{e.clear()})),(0,u.arrayEach)(this.highlight.getColumnHighlights(),(e=>{e.clear()}))),this.highlight.useLayerLevel(t);const s=this.highlight.createArea(),o=this.highlight.createLayeredArea(),a=this.highlight.createRowHeader(),l=this.highlight.createColumnHeader(),h=this.highlight.createActiveRowHeader(),c=this.highlight.createActiveColumnHeader(),d=this.highlight.createActiveCornerHeader(),p=this.highlight.createRowHighlight(),g=this.highlight.createColumnHighlight();if(s.clear(),o.clear(),a.clear(),l.clear(),h.clear(),c.clear(),d.clear(),p.clear(),g.clear(),this.highlight.isEnabledFor(i.AREA_TYPE,e.highlight)&&(this.isMultiple()||t>=1)&&(s.add(e.from).add(e.to).commit(),o.add(e.from).add(e.to).commit(),1===t)){const e=this.selectedRange.previous();this.highlight.useLayerLevel(t-1),this.highlight.createArea().add(e.from).commit().syncWith(e),this.highlight.createLayeredArea().add(e.from).commit().syncWith(e),this.highlight.useLayerLevel(t)}if(this.highlight.isEnabledFor(i.HEADER_TYPE,e.highlight)){if(!e.isSingleHeader()){const t=this.tableProps.createCellCoords(Math.max(e.from.row,0),-1),r=this.tableProps.createCellCoords(e.to.row,-1),n=this.tableProps.createCellCoords(-1,Math.max(e.from.col,0)),s=this.tableProps.createCellCoords(-1,e.to.col);"single"===this.settings.selectionMode?(a.add(t).commit(),l.add(n).commit(),p.add(t).commit(),g.add(n).commit()):(a.add(t).add(r).commit(),l.add(n).add(s).commit(),p.add(t).add(r).commit(),g.add(n).add(s).commit())}const t=!E(T,this)&&this.isEntireRowSelected()&&(n>0&&n===e.getWidth()||0===n&&this.isSelectedByRowHeader()),s=!E(T,this)&&this.isEntireColumnSelected()&&(r>0&&r===e.getHeight()||0===r&&this.isSelectedByColumnHeader());t&&h.add(this.tableProps.createCellCoords(Math.max(e.from.row,0),Math.min(-this.tableProps.countRowHeaders(),-1))).add(this.tableProps.createCellCoords(Math.max(e.to.row,0),-1)).commit(),s&&c.add(this.tableProps.createCellCoords(Math.min(-this.tableProps.countColHeaders(),-1),Math.max(e.from.col,0))).add(this.tableProps.createCellCoords(-1,Math.max(e.to.col,0))).commit(),t&&s&&d.add(this.tableProps.createCellCoords(-this.tableProps.countColHeaders(),-this.tableProps.countRowHeaders())).add(this.tableProps.createCellCoords(-1,-1)).commit()}}setRangeFocus(e){if(this.selectedRange.isEmpty())return;const t=this.selectedRange.current();this.inProgress||this.runLocalHooks("beforeSetFocus",e);const r=this.highlight.getFocus();r.clear(),t.setHighlight(e),this.inProgress||this.runLocalHooks("beforeHighlightSet"),this.highlight.isEnabledFor(i.FOCUS_TYPE,t.highlight)&&r.add(t.highlight).commit().syncWith(t),this.inProgress||(w(S,this,!0),this.runLocalHooks("afterSetFocus",t.highlight))}transformStart(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.settings.navigableHeaders?E(v,this).setOffsetSize({x:this.tableProps.countRowHeaders(),y:this.tableProps.countColHeaders()}):E(v,this).resetOffsetSize(),this.setRangeStart(E(v,this).transformStart(e,t,r))}transformEnd(e,t){this.settings.navigableHeaders?E(v,this).setOffsetSize({x:this.tableProps.countRowHeaders(),y:this.tableProps.countColHeaders()}):E(v,this).resetOffsetSize(),this.setRangeEnd(E(v,this).transformEnd(e,t))}transformFocus(e,t){const r=this.selectedRange.current(),{row:n,col:s}=r.getOuterTopStartCorner(),i=this.tableProps.countRenderableColumnsInRange(0,s-1),o=this.tableProps.countRenderableRowsInRange(0,n-1);r.highlight.isHeader()?E(R,this).setOffsetSize({x:s<0?Math.abs(s):-i,y:n<0?Math.abs(n):-o}):E(R,this).setOffsetSize({x:s<0?0:-i,y:n<0?0:-o});const a=E(R,this).transformStart(e,t);this.setRangeFocus(a.normalize())}shiftRows(e,t){if(!this.isSelected())return;const r=this.selectedRange.current();if(this.isSelectedByCorner())this.selectAll(!0,!0,{disableHeadersHighlight:!0});else if(this.isSelectedByColumnHeader()||r.getOuterTopStartCorner().row>=e){const{from:n,to:s,highlight:i}=r,o=this.tableProps.countRows(),a=this.isSelectedByRowHeader(),l=this.isSelectedByColumnHeader(),u=l?-1:0,c=l?0:t;this.getSelectedRange().pop();const d=this.tableProps.createCellCoords((0,h.clamp)(n.row+c,u,o-1),n.col),p=this.tableProps.createCellCoords((0,h.clamp)(s.row+t,u,o-1),s.col);this.markSource("shift"),i.row>=e?this.setRangeStartOnly(d,!0,this.tableProps.createCellCoords((0,h.clamp)(i.row+t,0,o-1),i.col)):this.setRangeStartOnly(d,!0),a&&this.selectedByRowHeader.add(this.getLayerLevel()),l&&this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(p),this.markEndSource()}}shiftColumns(e,t){if(!this.isSelected())return;const r=this.selectedRange.current();if(this.isSelectedByCorner())this.selectAll(!0,!0,{disableHeadersHighlight:!0});else if(this.isSelectedByRowHeader()||r.getOuterTopStartCorner().col>=e){const{from:n,to:s,highlight:i}=r,o=this.tableProps.countCols(),a=this.isSelectedByRowHeader(),l=this.isSelectedByColumnHeader(),u=a?-1:0,c=a?0:t;this.getSelectedRange().pop();const d=this.tableProps.createCellCoords(n.row,(0,h.clamp)(n.col+c,u,o-1)),p=this.tableProps.createCellCoords(s.row,(0,h.clamp)(s.col+t,u,o-1));this.markSource("shift"),i.col>=e?this.setRangeStartOnly(d,!0,this.tableProps.createCellCoords(i.row,(0,h.clamp)(i.col+t,0,o-1))):this.setRangeStartOnly(d,!0),a&&this.selectedByRowHeader.add(this.getLayerLevel()),l&&this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(p),this.markEndSource()}}getLayerLevel(){return this.selectedRange.size()-1}isSelected(){return!this.selectedRange.isEmpty()}isMultiple(){if(!this.isSelected())return!1;const e=(0,a.createObjectPropListener)(!this.selectedRange.current().isSingle());return this.runLocalHooks("afterIsMultipleSelection",e),e.value}isFocusSelectionChanged(){return this.isSelected()&&E(S,this)}isSelectedByRowHeader(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getLayerLevel();return!this.isSelectedByCorner(e)&&(-1===e?this.selectedByRowHeader.size>0:this.selectedByRowHeader.has(e))}isEntireRowSelected(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getLayerLevel();const t=e=>{const{col:t}=e.getOuterTopStartCorner(),r=this.tableProps.countRowHeaders(),n=this.tableProps.countCols();return(r>0&&t<0||0===r)&&e.getWidth()===n};if(-1===e)return Array.from(this.selectedRange).some((e=>t(e)));const r=this.selectedRange.peekByIndex(e);return!!r&&t(r)}isSelectedByColumnHeader(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getLayerLevel();return!this.isSelectedByCorner()&&(-1===e?this.selectedByColumnHeader.size>0:this.selectedByColumnHeader.has(e))}isEntireColumnSelected(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getLayerLevel();const t=e=>{const{row:t}=e.getOuterTopStartCorner(),r=this.tableProps.countColHeaders(),n=this.tableProps.countRows();return(r>0&&t<0||0===r)&&e.getHeight()===n};if(-1===e)return Array.from(this.selectedRange).some((e=>t(e)));const r=this.selectedRange.peekByIndex(e);return!!r&&t(r)}isSelectedByAnyHeader(){return this.isSelectedByRowHeader(-1)||this.isSelectedByColumnHeader(-1)||this.isSelectedByCorner()}isSelectedByCorner(){return this.selectedByColumnHeader.has(this.getLayerLevel())&&this.selectedByRowHeader.has(this.getLayerLevel())}inInSelection(e){return this.selectedRange.includes(e)}isCellCornerVisible(){return this.settings.fillHandle&&!this.tableProps.isEditorOpened()&&!this.isMultiple()}isCellVisible(e){const t=this.tableProps.visualToRenderableCoords(e);return null!==t.row&&null!==t.col}isAreaCornerVisible(e){return(!Number.isInteger(e)||e===this.getLayerLevel())&&(this.settings.fillHandle&&!this.tableProps.isEditorOpened()&&this.isMultiple())}clear(){this.selectedRange.clear(),this.highlight.clear()}deselect(){this.isSelected()&&(this.inProgress=!1,this.clear(),this.runLocalHooks("afterDeselect"))}selectAll(){var e;let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{focusPosition:!1,disableHeadersHighlight:!1};const s=this.tableProps.countRows(),i=this.tableProps.countCols(),o=this.tableProps.countRowHeaders(),a=this.tableProps.countColHeaders(),l=r?-a:0,u=t?-o:0;if(0===l&&0===u&&(0===s||0===i))return;let c=null===(e=this.getSelectedRange().current())||void 0===e?void 0:e.highlight;const{focusPosition:d,disableHeadersHighlight:p}=n;w(T,this,p),d&&Number.isInteger(null==d?void 0:d.row)&&Number.isInteger(null==d?void 0:d.col)&&(c=this.tableProps.createCellCoords((0,h.clamp)(d.row,l,s-1),(0,h.clamp)(d.col,u,i-1)));const g=this.tableProps.createCellCoords(l,u),f=this.tableProps.createCellCoords(s-1,i-1);this.clear(),this.setRangeStartOnly(g,void 0,c),u<0&&this.selectedByRowHeader.add(this.getLayerLevel()),l<0&&this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(f),this.finish(),w(T,this,!1)}selectCells(e){var t=this;const r=(0,p.detectSelectionType)(e);if(r===p.SELECTION_TYPE_EMPTY)return!1;if(r===p.SELECTION_TYPE_UNRECOGNIZED)throw new Error(g.toSingleLine`Unsupported format of the selection ranges was passed. To select cells pass\x20 + the coordinates as an array of arrays ([[rowStart, columnStart/columnPropStart, rowEnd,\x20 + columnEnd/columnPropEnd]]) or as an array of CellRange objects.`);const n=(0,p.normalizeSelectionFactory)(r,{createCellCoords:function(){return t.tableProps.createCellCoords(...arguments)},createCellRange:function(){return t.tableProps.createCellRange(...arguments)},propToCol:e=>this.tableProps.propToCol(e),keepDirection:!0}),s=this.settings.navigableHeaders,i={countRows:this.tableProps.countRows(),countCols:this.tableProps.countCols(),countRowHeaders:s?this.tableProps.countRowHeaders():0,countColHeaders:s?this.tableProps.countColHeaders():0},o=!e.some((e=>{const t=n(e),r=t.isValid(i);return!(r&&!t.containsHeaders()||r&&t.containsHeaders()&&t.isSingleHeader())}));return o&&(this.clear(),this.setExpectedLayers(e.length),(0,u.arrayEach)(e,(e=>{const{from:t,to:r}=n(e);this.setRangeStartOnly(t.clone(),!1),this.setRangeEnd(r.clone())})),this.finish()),o}selectColumns(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const n="string"==typeof e?this.tableProps.propToCol(e):e,s="string"==typeof t?this.tableProps.propToCol(t):t,i=this.tableProps.countRows(),o=this.tableProps.countCols(),a=this.tableProps.countColHeaders(),l=0===a?0:-a,u=this.tableProps.createCellCoords(l,n),c=this.tableProps.createCellCoords(i-1,s),d=this.tableProps.createCellRange(u,u,c).isValid({countRows:i,countCols:o,countRowHeaders:0,countColHeaders:a});if(d){let e=0,t=0;Number.isInteger(null==r?void 0:r.row)&&Number.isInteger(null==r?void 0:r.col)?(e=(0,h.clamp)(r.row,l,i-1),t=(0,h.clamp)(r.col,Math.min(n,s),Math.max(n,s))):(e=(0,h.clamp)(r,l,i-1),t=n);const o=this.tableProps.createCellCoords(e,t),u=0===a?0:(0,h.clamp)(o.row,l,-1),c=i-1,d=this.tableProps.createCellCoords(u,n),p=this.tableProps.createCellCoords(c,s);this.runLocalHooks("beforeSelectColumns",d,p,o),d.row=u,p.row=c,this.setRangeStartOnly(d,void 0,o),this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(p),this.runLocalHooks("afterSelectColumns",d,p,o),this.finish()}return d}selectRows(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const n=this.tableProps.countRows(),s=this.tableProps.countCols(),i=this.tableProps.countRowHeaders(),o=0===i?0:-i,a=this.tableProps.createCellCoords(e,o),l=this.tableProps.createCellCoords(t,s-1),u=this.tableProps.createCellRange(a,a,l).isValid({countRows:n,countCols:s,countRowHeaders:i,countColHeaders:0});if(u){let n=0,a=0;Number.isInteger(null==r?void 0:r.row)&&Number.isInteger(null==r?void 0:r.col)?(n=(0,h.clamp)(r.row,Math.min(e,t),Math.max(e,t)),a=(0,h.clamp)(r.col,o,s-1)):(n=e,a=(0,h.clamp)(r,o,s-1));const l=this.tableProps.createCellCoords(n,a),u=0===i?0:(0,h.clamp)(l.col,o,-1),c=s-1,d=this.tableProps.createCellCoords(e,u),p=this.tableProps.createCellCoords(t,c);this.runLocalHooks("beforeSelectRows",d,p,l),d.col=u,p.col=c,this.setRangeStartOnly(d,void 0,l),this.selectedByRowHeader.add(this.getLayerLevel()),this.setRangeEnd(p),this.runLocalHooks("afterSelectRows",d,p,l),this.finish()}return u}refresh(){if(!this.isSelected())return;const e=this.tableProps.countRows(),t=this.tableProps.countCols();if(0===e||0===t)return void this.deselect();const r=this.selectedRange.peekByIndex(this.selectedRange.size()-1),{from:n,to:s,highlight:i}=r;this.clear(),i.assign({row:(0,h.clamp)(i.row,-1/0,e-1),col:(0,h.clamp)(i.col,-1/0,t-1)}),n.assign({row:(0,h.clamp)(n.row,-1/0,e-1),col:(0,h.clamp)(n.col,-1/0,t-1)}),s.assign({row:(0,h.clamp)(s.row,0,e-1),col:(0,h.clamp)(s.col,0,t-1)}),this.selectedRange.ranges.push(r),this.highlight.getFocus().add(i).commit().syncWith(r),this.applyAndCommit(r)}commit(){if(this.highlight.getCustomSelections().forEach((e=>{e.commit()})),!this.isSelected())return;const e=this.getLayerLevel(),t=this.selectedRange.current();this.highlight.isEnabledFor(i.FOCUS_TYPE,t.highlight)&&this.highlight.getFocus().commit().syncWith(t);for(let e=0;e{"use strict";var n=r(96784);t.__esModule=!0,r(67834);var s=r(25499),i=n(r(16050));function o(e,t,r){a(e,t),t.set(e,r)}function a(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function l(e,t){return e.get(u(e,t))}function h(e,t,r){return e.set(u(e,t),r),r}function u(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var c=new WeakMap,d=new WeakMap,p=new WeakMap,g=new WeakSet;class f{constructor(e,t){var r,n;a(r=this,n=g),n.add(r),o(this,c,void 0),o(this,d,void 0),o(this,p,{x:0,y:0}),h(c,this,e),h(d,this,t)}transformStart(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const n=l(d,this).createCellCoords(e,t);let i=l(c,this).current().highlight;const o=l(d,this).visualToRenderableCoords(i);let a=0,h=0;if(this.runLocalHooks("beforeTransformStart",n),null!==o.row&&null!==o.col){const{width:e,height:t}=u(g,this,y).call(this),{row:o,col:c}=u(g,this,C).call(this,i),p=l(d,this).fixedRowsBottom(),f=l(d,this).minSpareRows(),E=l(d,this).minSpareCols(),w=l(d,this).autoWrapRow(),R=l(d,this).autoWrapCol(),S=l(d,this).createCellCoords(o+n.row,c+n.col);if(S.row>=t){const n=(0,s.createObjectPropListener)(r&&f>0&&0===p),i=S.col+1,o=l(d,this).createCellCoords(S.row-t,i>=e?i-e:i);this.runLocalHooks("beforeColumnWrap",n,u(g,this,v).call(this,o),i>=e),n.value?this.runLocalHooks("insertRowRequire",l(d,this).countRenderableRows()):R&&S.assign(o)}else if(S.row<0){const r=(0,s.createObjectPropListener)(R),n=S.col-1,i=l(d,this).createCellCoords(t+S.row,n<0?e+n:n);this.runLocalHooks("beforeColumnWrap",r,u(g,this,v).call(this,i),n<0),R&&S.assign(i)}if(S.col>=e){const n=(0,s.createObjectPropListener)(r&&E>0),i=S.row+1,o=l(d,this).createCellCoords(i>=t?i-t:i,S.col-e);this.runLocalHooks("beforeRowWrap",n,u(g,this,v).call(this,o),i>=t),n.value?this.runLocalHooks("insertColRequire",l(d,this).countRenderableColumns()):w&&S.assign(o)}else if(S.col<0){const r=(0,s.createObjectPropListener)(w),n=S.row-1,i=l(d,this).createCellCoords(n<0?t+n:n,e+S.col);this.runLocalHooks("beforeRowWrap",r,u(g,this,v).call(this,i),n<0),w&&S.assign(i)}const{rowDir:T,colDir:N}=u(g,this,m).call(this,S);a=T,h=N,i=u(g,this,v).call(this,S)}return this.runLocalHooks("afterTransformStart",i,a,h),i}transformEnd(e,t){const r=l(d,this).createCellCoords(e,t),n=l(c,this).current(),s=l(d,this).visualToRenderableCoords(n.highlight),i=u(g,this,E).call(this,n.to.row,n.from.row),o=u(g,this,w).call(this,n.to.col,n.from.col),a=n.to.clone();let h=0,p=0;if(this.runLocalHooks("beforeTransformEnd",r),null!==s.row&&null!==s.col&&null!==i&&null!==o){const{row:e,col:t}=u(g,this,C).call(this,n.highlight),s=l(d,this).createCellCoords(i+r.row,o+r.col),c=n.getTopStartCorner(),f=n.getTopEndCorner(),y=n.getBottomEndCorner();if(r.col<0&&o>=t&&s.col0&&o<=t&&s.col>t){const e=u(g,this,w).call(this,f.col,c.col),t=Math.max(s.col-e,1);s.col=e+t}if(r.row<0&&i>=e&&s.row0&&i<=e&&s.row>e){const e=u(g,this,E).call(this,y.row,c.row),t=Math.max(s.row-e,1);s.row=e+t}const{rowDir:R,colDir:S}=u(g,this,m).call(this,s);h=R,p=S;const T=u(g,this,v).call(this,s);0===r.row&&0!==r.col?a.col=T.col:0!==r.row&&0===r.col?a.row=T.row:(a.row=T.row,a.col=T.col)}return this.runLocalHooks("afterTransformEnd",a,h,p),a}setOffsetSize(e){let{x:t,y:r}=e;h(p,this,{x:t,y:r})}resetOffsetSize(){h(p,this,{x:0,y:0})}}function m(e){const{width:t,height:r}=u(g,this,y).call(this);let n=0,s=0;return e.row<0?(n=-1,e.row=0):e.row>0&&e.row>=r&&(n=1,e.row=r-1),e.col<0?(s=-1,e.col=0):e.col>0&&e.col>=t&&(s=1,e.col=t-1),{rowDir:n,colDir:s}}function y(){return{width:l(p,this).x+l(d,this).countRenderableColumns(),height:l(p,this).y+l(d,this).countRenderableRows()}}function E(e,t){const r=l(d,this).findFirstNonHiddenRenderableRow(e,t);return null===r?null:l(p,this).y+r}function w(e,t){const r=l(d,this).findFirstNonHiddenRenderableColumn(e,t);return null===r?null:l(p,this).x+r}function C(e){const{row:t,col:r}=l(d,this).visualToRenderableCoords(e);if(null===t||null===r)throw new Error("Renderable coords are not visible.");return l(d,this).createCellCoords(l(p,this).y+t,l(p,this).x+r)}function v(e){const t=e.clone();return t.col=e.col-l(p,this).x,t.row=e.row-l(p,this).y,l(d,this).renderableToVisualCoords(t)}(0,s.mixin)(f,i.default);t.default=f},13208:(e,t,r)=>{"use strict";t.__esModule=!0,t.detectSelectionType=g,t.normalizeSelectionFactory=f,t.transformSelectionToColumnDistance=function(e){const t=g(e.getSelected());if(t===o||t===a)return[];const r=f(t,{createCellCoords:e._createCellCoords.bind(e),createCellRange:e._createCellRange.bind(e)}),n=new Set;(0,s.arrayEach)(e.getSelected(),(e=>{const{from:t,to:i}=r(e),o=Math.max(t.col,0),a=i.col-o+1;(0,s.arrayEach)(Array.from(new Array(a),((e,t)=>o+t)),(e=>{n.has(e)||n.add(e)}))}));const i=Array.from(n).sort(((e,t)=>e-t));return(0,s.arrayReduce)(i,((e,t,r,n)=>(0!==r&&t===n[r-1]+1?e[e.length-1][1]+=1:e.push([t,1]),e)),[])},t.transformSelectionToRowDistance=function(e){const t=g(e.getSelected());if(t===o||t===a)return[];const r=f(t,{createCellCoords:e._createCellCoords.bind(e),createCellRange:e._createCellRange.bind(e)}),n=new Set;(0,s.arrayEach)(e.getSelected(),(e=>{const{from:t,to:i}=r(e),o=Math.max(t.row,0),a=i.row-o+1;(0,s.arrayEach)(Array.from(new Array(a),((e,t)=>o+t)),(e=>{n.has(e)||n.add(e)}))}));const i=Array.from(n).sort(((e,t)=>e-t));return(0,s.arrayReduce)(i,((e,t,r,n)=>(0!==r&&t===n[r-1]+1?e[e.length-1][1]+=1:e.push([t,1]),e)),[])},r(67834),r(15724),r(71336),r(41558),r(17663),r(68630),r(79645),r(89858),r(8620),r(14846),r(75568);var n=r(50206),s=r(10587),i=r(70505);const o=t.SELECTION_TYPE_UNRECOGNIZED=0,a=t.SELECTION_TYPE_EMPTY=1,l=t.SELECTION_TYPE_ARRAY=2,h=t.SELECTION_TYPE_OBJECT=3,u=t.SELECTION_TYPES=[h,l],c=[["number"],["number","string"],["number","undefined"],["number","string","undefined"]],d=Symbol("root"),p=Symbol("child");function g(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:d;if(t!==d&&t!==p)throw new Error("The second argument is used internally only and cannot be overwritten.");const r=Array.isArray(e),s=t===d;let i=o;if(r){const t=e[0];if(0===e.length)i=a;else if(s&&t instanceof n.CellRange)i=h;else if(s&&Array.isArray(t))i=g(t,p);else if(e.length>=2&&e.length<=4){!e.some(((e,t)=>!c[t].includes(typeof e)))&&(i=l)}}return i}function f(e){let{createCellCoords:t,createCellRange:r,keepDirection:n=!1,propToCol:s}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!u.includes(e))throw new Error("Unsupported selection ranges schema type was provided.");return function(o){const a=e===h;let l=a?o.from.row:o[0],u=a?o.from.col:o[1],c=a?o.to.row:o[2],d=a?o.to.col:o[3];if("function"==typeof s&&("string"==typeof u&&(u=s(u)),"string"==typeof d&&(d=s(d))),(0,i.isUndefined)(c)&&(c=l),(0,i.isUndefined)(d)&&(d=u),!n){const e=l,t=u,r=c,n=d;l=Math.min(e,r),u=Math.min(t,n),c=Math.max(e,r),d=Math.max(t,n)}const p=t(l,u),g=t(c,d);return r(p,p,g)}}},22016:(e,t)=>{"use strict";t.__esModule=!0;t.command={name:"editorCloseAndSave",callback(e){e._getEditorManager().closeEditorAndSaveChanges()}}},86952:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(74854);t.command={name:"editorCloseAndSaveByArrowKeys",callback(e,t,r){const s=e._getEditorManager(),i=s.getActiveEditor();i.isInFullEditMode()&&i.state===n.EDITOR_STATE.EDITING||(s.closeEditorAndSaveChanges(),e.getSelected()&&(r.includes("arrowdown")?e.selection.transformStart(1,0):r.includes("arrowup")?e.selection.transformStart(-1,0):r.includes("arrowleft")?e.selection.transformStart(0,-1*e.getDirectionFactor()):r.includes("arrowright")&&e.selection.transformStart(0,e.getDirectionFactor())),t.preventDefault())}}},59399:(e,t)=>{"use strict";t.__esModule=!0;t.command={name:"editorCloseAndSaveByEnter",callback(e,t){const r=e._getEditorManager();r.closeEditorAndSaveChanges(t.ctrlKey||t.metaKey),r.moveSelectionAfterEnter(t)}}},298:(e,t)=>{"use strict";t.__esModule=!0;t.command={name:"editorCloseWithoutSaving",callback(e){const t=e._getEditorManager();t.closeEditorAndRestoreOriginalValue(e.getShortcutManager().isCtrlPressed()),t.activeEditor.focus()}}},86446:(e,t)=>{"use strict";t.__esModule=!0;t.command={name:"editorFastOpen",callback(e,t){const{highlight:r}=e.getSelectedRangeLast();r.isHeader()||e._getEditorManager().openEditor(null,t,!0)}}},53558:(e,t,r)=>{"use strict";t.__esModule=!0,t.getAllCommands=function(){return[n.command,s.command,i.command,o.command,a.command,l.command]};var n=r(22016),s=r(86952),i=r(59399),o=r(298),a=r(86446),l=r(53936)},53936:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(77661);t.command={name:"editorOpen",callback(e,t,r){const s=e._getEditorManager(),i=e.getSelectedRangeLast(),{highlight:o}=i;if(e.selection.isMultiple()&&!i.isHeader()&&e.countRenderedCols()>0&&e.countRenderedRows()>0){const n=e.getSettings(),s="function"==typeof n.enterMoves?n.enterMoves(t):n.enterMoves;r.includes("shift")?e.selection.transformFocus(-s.row,-s.col):e.selection.transformFocus(s.row,s.col)}else o.isHeader()||(e.getSettings().enterBeginsEditing?s.cellProperties.readOnly?s.moveSelectionAfterEnter(t):s.openEditor(null,t,!0):s.moveSelectionAfterEnter(t),(0,n.stopImmediatePropagation)(t))}}},34413:(e,t)=>{"use strict";t.__esModule=!0;t.command={name:"emptySelectedCells",callback(e){e.emptySelectedCells(),e._getEditorManager().prepareEditor()}}},6036:(e,t)=>{"use strict";t.__esModule=!0;t.command={name:"extendCellsSelectionDown",callback(e){const{highlight:t}=e.getSelectedRangeLast();e.selection.isSelectedByColumnHeader()||e.selection.isSelectedByCorner()||!(t.isCell()||t.isHeader()&&e.selection.isSelectedByRowHeader())||e.selection.transformEnd(1,0)}}},88900:(e,t)=>{"use strict";t.__esModule=!0;t.command={name:"extendCellsSelectionDownByViewportHeight",callback(e){const{to:t}=e.getSelectedRangeLast(),r=Math.min(t.row+e.countVisibleRows(),e.countRows()-1),n=e.rowIndexMapper.getNearestNotHiddenIndex(r,-1);if(null!==n){const r=e._createCellCoords(n,t.col),s=t.row-e.getFirstFullyVisibleRow(),i=Math.min(r.row-s,e.countRows()-1);e.selection.setRangeEnd(r),e.scrollViewportTo({row:i,verticalSnap:"top",horizontalSnap:"start"})}}}},51002:(e,t,r)=>{"use strict";t.__esModule=!0,t.getAllCommands=function(){return[n.command,s.command,i.command,o.command,a.command,l.command,h.command,u.command,c.command,d.command,p.command,g.command,f.command,m.command]};var n=r(6036),s=r(88900),i=r(34885),o=r(15076),a=r(28878),l=r(83269),h=r(5154),u=r(28703),c=r(17023),d=r(40574),p=r(20619),g=r(67616),f=r(9601),m=r(67525)},34885:(e,t)=>{"use strict";t.__esModule=!0;t.command={name:"extendCellsSelectionLeft",callback(e){const{highlight:t}=e.getSelectedRangeLast();e.selection.isSelectedByRowHeader()||e.selection.isSelectedByCorner()||!(t.isCell()||t.isHeader()&&e.selection.isSelectedByColumnHeader())||e.selection.transformEnd(0,-1*e.getDirectionFactor())}}},15076:(e,t)=>{"use strict";t.__esModule=!0;t.command={name:"extendCellsSelectionRight",callback(e){const{highlight:t}=e.getSelectedRangeLast();e.selection.isSelectedByRowHeader()||e.selection.isSelectedByCorner()||!(t.isCell()||t.isHeader()&&e.selection.isSelectedByColumnHeader())||e.selection.transformEnd(0,e.getDirectionFactor())}}},28878:(e,t)=>{"use strict";t.__esModule=!0;t.command={name:"extendCellsSelectionToColumns",callback(e){const{highlight:t,from:r,to:n}=e.getSelectedRangeLast();e.selection.isSelectedByRowHeader()?e.selection.selectAll(!0,!0):e.selectColumns(r.col,n.col,t)}}},83269:(e,t)=>{"use strict";t.__esModule=!0;t.command={name:"extendCellsSelectionToMostBottom",callback(e){const{selection:t,rowIndexMapper:r}=e,{highlight:n,from:s,to:i}=e.getSelectedRangeLast(),o=n.isHeader()&&e.selection.isSelectedByRowHeader();if(n.isCell()||o){const a=r.getNearestNotHiddenIndex(e.countRows()-1,-1),l=s.clone();l.row=n.row,t.setRangeStart(l,void 0,!1,n.clone()),o&&t.selectedByRowHeader.add(t.getLayerLevel()),t.setRangeEnd(e._createCellCoords(a,i.col))}}}},5154:(e,t)=>{"use strict";t.__esModule=!0;t.command={name:"extendCellsSelectionToMostInlineEnd",callback(e){const{selection:t,columnIndexMapper:r}=e,{highlight:n,from:s,to:i}=e.getSelectedRangeLast();if(!e.selection.isSelectedByRowHeader()&&!e.selection.isSelectedByCorner()&&n.isCell()){const o=r.getNearestNotHiddenIndex(e.countCols()-1,-1),a=s.clone();a.col=n.col,t.setRangeStart(a,void 0,!1,n.clone()),t.setRangeEnd(e._createCellCoords(i.row,o))}}}},28703:(e,t)=>{"use strict";t.__esModule=!0;t.command={name:"extendCellsSelectionToMostInlineStart",callback(e){const{selection:t,columnIndexMapper:r}=e,{highlight:n,from:s,to:i}=e.getSelectedRangeLast();if(!e.selection.isSelectedByRowHeader()&&!e.selection.isSelectedByCorner()&&n.isCell()){const o=parseInt(e.getSettings().fixedColumnsStart,10),a=r.getNearestNotHiddenIndex(o,1),l=s.clone();l.col=n.col,t.setRangeStart(l,void 0,!1,n.clone()),t.setRangeEnd(e._createCellCoords(i.row,a))}}}},17023:(e,t)=>{"use strict";t.__esModule=!0;t.command={name:"extendCellsSelectionToMostLeft",callback(e){const{selection:t,columnIndexMapper:r}=e,{highlight:n,from:s,to:i}=e.getSelectedRangeLast(),o=n.isHeader()&&e.selection.isSelectedByColumnHeader();if(n.isCell()||o){const a=r.getNearestNotHiddenIndex(...e.isRtl()?[e.countCols()-1,-1]:[0,1]),l=s.clone();l.col=n.col,t.setRangeStart(l,void 0,!1,n.clone()),o&&t.selectedByColumnHeader.add(t.getLayerLevel()),t.setRangeEnd(e._createCellCoords(i.row,a))}}}},40574:(e,t)=>{"use strict";t.__esModule=!0;t.command={name:"extendCellsSelectionToMostRight",callback(e){const{selection:t,columnIndexMapper:r}=e,{highlight:n,from:s,to:i}=e.getSelectedRangeLast(),o=n.isHeader()&&e.selection.isSelectedByColumnHeader();if(n.isCell()||o){const a=r.getNearestNotHiddenIndex(...e.isRtl()?[0,1]:[e.countCols()-1,-1]),l=s.clone();l.col=n.col,t.setRangeStart(l,void 0,!1,n.clone()),o&&t.selectedByColumnHeader.add(t.getLayerLevel()),t.setRangeEnd(e._createCellCoords(i.row,a))}}}},20619:(e,t)=>{"use strict";t.__esModule=!0;t.command={name:"extendCellsSelectionToMostTop",callback(e){const{selection:t,rowIndexMapper:r}=e,{highlight:n,from:s,to:i}=e.getSelectedRangeLast(),o=n.isHeader()&&e.selection.isSelectedByRowHeader();if(n.isCell()||o){const a=r.getNearestNotHiddenIndex(0,1),l=s.clone();l.row=n.row,t.setRangeStart(l,void 0,!1,n.clone()),o&&t.selectedByRowHeader.add(t.getLayerLevel()),t.setRangeEnd(e._createCellCoords(a,i.col))}}}},67616:(e,t)=>{"use strict";t.__esModule=!0;t.command={name:"extendCellsSelectionToRows",callback(e){const{highlight:t,from:r,to:n}=e.getSelectedRangeLast();e.selection.isSelectedByColumnHeader()?e.selection.selectAll(!0,!0):e.selectRows(r.row,n.row,t)}}},9601:(e,t)=>{"use strict";t.__esModule=!0;t.command={name:"extendCellsSelectionUp",callback(e){const{highlight:t}=e.getSelectedRangeLast();e.selection.isSelectedByColumnHeader()||e.selection.isSelectedByCorner()||!(t.isCell()||t.isHeader()&&e.selection.isSelectedByRowHeader())||e.selection.transformEnd(-1,0)}}},67525:(e,t)=>{"use strict";t.__esModule=!0;t.command={name:"extendCellsSelectionUpByViewportHeight",callback(e){const{to:t}=e.getSelectedRangeLast(),r=Math.max(t.row-e.countVisibleRows(),0),n=e.rowIndexMapper.getNearestNotHiddenIndex(r,1);if(null!==n){const r=e._createCellCoords(n,t.col),s=t.row-e.getFirstFullyVisibleRow(),i=Math.max(r.row-s,0);e.selection.setRangeEnd(r),e.scrollViewportTo({row:i,verticalSnap:"top",horizontalSnap:"start"})}}}},84302:(e,t,r)=>{"use strict";t.__esModule=!0,t.createKeyboardShortcutCommandsPool=function(e){const t={};return c.forEach((r=>{let{name:n,callback:s}=r;t[n]=function(){for(var t=arguments.length,r=new Array(t),n=0;n{"use strict";t.__esModule=!0;t.command={name:"moveCellSelectionDown",callback(e){let{selection:t}=e;t.transformStart(1,0)}}},36846:(e,t)=>{"use strict";t.__esModule=!0;t.command={name:"moveCellSelectionDownByViewportHeight",callback(e){const{navigableHeaders:t}=e.getSettings(),r=t?e.countColHeaders():0,{row:n}=e.getSelectedRangeLast().highlight;let s=e.countVisibleRows()+r;s=0===s?1:s,n===e.countRows()-1?s=1:n+s>e.countRows()&&(s=e.countRows()-n-1),e.selection.transformStart(s,0),e.getSelectedRangeLast().highlight.row<0&&e.scrollViewportTo({row:0})}}},4184:(e,t,r)=>{"use strict";t.__esModule=!0,t.getAllCommands=function(){return[n.command,s.command,i.command,o.command,a.command,l.command,h.command,u.command,c.command,d.command,p.command,g.command,f.command,m.command,y.command,E.command]};var n=r(77646),s=r(36846),i=r(53354),o=r(74007),a=r(76967),l=r(37830),h=r(72739),u=r(9033),c=r(71580),d=r(12677),p=r(98613),g=r(51572),f=r(14701),m=r(43702),y=r(47375),E=r(22763)},53354:(e,t)=>{"use strict";t.__esModule=!0;t.command={name:"moveCellSelectionInlineEnd",callback(e,t){const r=e.getSettings(),n=e.getSelectedRangeLast(),s="function"==typeof r.tabMoves?r.tabMoves(t):r.tabMoves;e.selection.isMultiple()&&!n.isHeader()&&e.countRenderedCols()>0&&e.countRenderedRows()>0?e.selection.transformFocus(-s.row,-s.col):e.selection.transformStart(-s.row,-s.col)}}},74007:(e,t)=>{"use strict";t.__esModule=!0;t.command={name:"moveCellSelectionInlineStart",callback(e,t){const r=e.getSettings(),n=e.getSelectedRangeLast(),s="function"==typeof r.tabMoves?r.tabMoves(t):r.tabMoves;e.selection.isMultiple()&&!n.isHeader()&&e.countRenderedCols()>0&&e.countRenderedRows()>0?e.selection.transformFocus(s.row,s.col):e.selection.transformStart(s.row,s.col)}}},76967:(e,t)=>{"use strict";t.__esModule=!0;t.command={name:"moveCellSelectionLeft",callback(e){e.selection.transformStart(0,-1*e.getDirectionFactor())}}},37830:(e,t)=>{"use strict";t.__esModule=!0;t.command={name:"moveCellSelectionRight",callback(e){e.selection.transformStart(0,e.getDirectionFactor())}}},72739:(e,t)=>{"use strict";t.__esModule=!0;t.command={name:"moveCellSelectionToMostBottom",callback(e){const{col:t}=e.getSelectedRangeLast().highlight;let r=e.rowIndexMapper.getNearestNotHiddenIndex(e.countRows()-1,-1);null===r&&(r=-1),e.selection.setRangeStart(e._createCellCoords(r,t))}}},9033:(e,t)=>{"use strict";t.__esModule=!0;t.command={name:"moveCellSelectionToMostBottomInlineEnd",callback(e){const{selection:t,rowIndexMapper:r,columnIndexMapper:n}=e,s=parseInt(e.getSettings().fixedRowsBottom,10),i=r.getNearestNotHiddenIndex(e.countRows()-s-1,-1),o=n.getNearestNotHiddenIndex(e.countCols()-1,-1);t.setRangeStart(e._createCellCoords(i,o))}}},71580:(e,t)=>{"use strict";t.__esModule=!0;t.command={name:"moveCellSelectionToMostInlineEnd",callback(e){const{selection:t,columnIndexMapper:r}=e;t.setRangeStart(e._createCellCoords(e.getSelectedRangeLast().highlight.row,r.getNearestNotHiddenIndex(e.countCols()-1,-1)))}}},12677:(e,t)=>{"use strict";t.__esModule=!0;t.command={name:"moveCellSelectionToMostInlineStart",callback(e){const{selection:t,columnIndexMapper:r}=e,n=parseInt(e.getSettings().fixedColumnsStart,10),s=e.getSelectedRangeLast().highlight.row,i=r.getNearestNotHiddenIndex(n,1);t.setRangeStart(e._createCellCoords(s,i))}}},98613:(e,t)=>{"use strict";t.__esModule=!0;t.command={name:"moveCellSelectionToMostLeft",callback(e){const{selection:t,columnIndexMapper:r}=e,n=e.getSelectedRangeLast().highlight.row;let s=r.getNearestNotHiddenIndex(...e.isRtl()?[e.countCols()-1,-1]:[0,1]);null===s&&(s=e.isRtl()?-1:-e.countRowHeaders()),t.setRangeStart(e._createCellCoords(n,s))}}},51572:(e,t)=>{"use strict";t.__esModule=!0;t.command={name:"moveCellSelectionToMostRight",callback(e){const{selection:t,columnIndexMapper:r}=e,{row:n}=e.getSelectedRangeLast().highlight;let s=r.getNearestNotHiddenIndex(...e.isRtl()?[0,1]:[e.countCols()-1,-1]);null===s&&(s=e.isRtl()?-e.countRowHeaders():-1),t.setRangeStart(e._createCellCoords(n,s))}}},14701:(e,t)=>{"use strict";t.__esModule=!0;t.command={name:"moveCellSelectionToMostTop",callback(e){const{col:t}=e.getSelectedRangeLast().highlight;let r=e.rowIndexMapper.getNearestNotHiddenIndex(0,1);null===r&&(r=-e.countColHeaders()),e.selection.setRangeStart(e._createCellCoords(r,t))}}},43702:(e,t)=>{"use strict";t.__esModule=!0;t.command={name:"moveCellSelectionToMostTopInlineStart",callback(e){const{selection:t,rowIndexMapper:r,columnIndexMapper:n}=e,s=parseInt(e.getSettings().fixedRowsTop,10),i=parseInt(e.getSettings().fixedColumnsStart,10),o=r.getNearestNotHiddenIndex(s,1),a=n.getNearestNotHiddenIndex(i,1);t.setRangeStart(e._createCellCoords(o,a))}}},47375:(e,t)=>{"use strict";t.__esModule=!0;t.command={name:"moveCellSelectionUp",callback(e){let{selection:t}=e;t.transformStart(-1,0)}}},22763:(e,t)=>{"use strict";t.__esModule=!0;t.command={name:"moveCellSelectionUpByViewportHight",callback(e){const{navigableHeaders:t}=e.getSettings(),r=t?e.countColHeaders():0,{row:n}=e.getSelectedRangeLast().highlight;let s=e.countVisibleRows()+r;s=0===s?-1:-s,n===-r?s=-1:n+s{"use strict";t.__esModule=!0;t.command={name:"populateSelectedCellsData",callback(e){const t=e.getSelectedRange(),{row:r,col:n}=t[t.length-1].highlight.normalize(),s=e.getDataAtCell(r,n),i=new Map;for(let o=0;o{if(t>=0&&o>=0&&(t!==r||o!==n)){const{readOnly:r}=e.getCellMeta(t,o);r||i.set(`${t}x${o}`,[t,o,s])}}));e.setDataAtCell(Array.from(i.values()))}}},29511:(e,t)=>{"use strict";t.__esModule=!0;t.command={name:"scrollToFocusedCell",callback(e){const{highlight:t}=e.getSelectedRangeLast(),r=e.getFirstFullyVisibleRow()-1,n=e.getFirstFullyVisibleColumn()-1,s=e.getLastFullyVisibleRow()+1,i=e.getLastFullyVisibleColumn()+1,o=e._createCellCoords(r,n),a=e._createCellCoords(s,i);if(!e._createCellRange(o,o,a).includes(t)&&(t.row>=0||t.col>=0)){const r={};if(t.col>=0){const n=Math.floor(e.countVisibleCols()/2);r.col=Math.max(t.col-n,0)}if(t.row>=0){const n=Math.floor(e.countVisibleRows()/2);r.row=Math.max(t.row-n,0)}e.scrollViewportTo({...r,verticalSnap:"top",horizontalSnap:"start"})}}}},74544:(e,t)=>{"use strict";t.__esModule=!0;t.command={name:"selectAllCells",callback(e){e.selection.selectAll(!0,!0,{disableHeadersHighlight:!0})}}},14001:(e,t)=>{"use strict";t.__esModule=!0;t.command={name:"selectAllCellsAndHeaders",callback(e){e.selection.selectAll(!0,!0,{disableHeadersHighlight:!1})}}},72466:(e,t)=>{"use strict";t.__esModule=!0;t.GRID_GROUP="gridDefault",t.EDITOR_EDIT_GROUP="editorManager.handlingEditor"},4894:(e,t,r)=>{"use strict";t.__esModule=!0,t.shortcutsEditorContext=function(e){const t=e.getShortcutManager().addContext("editor"),r=(0,s.createKeyboardShortcutCommandsPool)(e),i={group:n.EDITOR_EDIT_GROUP};t.addShortcuts([{keys:[["Enter"],["Enter","Shift"]],callback:(e,t)=>r.editorCloseAndSaveByEnter(e,t)},{keys:[["Enter","Control/Meta"],["Enter","Control/Meta","Shift"]],captureCtrl:!0,callback:(e,t)=>r.editorCloseAndSaveByEnter(e,t)},{keys:[["Tab"],["Tab","Shift"],["PageDown"],["PageUp"]],forwardToContext:e.getShortcutManager().getContext("grid"),callback:(e,t)=>r.editorCloseAndSave(e,t)},{keys:[["ArrowDown"],["ArrowUp"],["ArrowLeft"],["ArrowRight"]],preventDefault:!1,callback:(e,t)=>r.editorCloseAndSaveByArrowKeys(e,t)},{keys:[["Escape"],["Escape","Control/Meta"]],callback:()=>r.editorCloseWithoutSaving()}],i)};var n=r(72466),s=r(84302)},33803:(e,t,r)=>{"use strict";t.__esModule=!0,t.shortcutsGridContext=function(e){const t=e.getShortcutManager().addContext("grid"),r=(0,i.createKeyboardShortcutCommandsPool)(e),o={runOnlyIf:()=>{const{navigableHeaders:t}=e.getSettings();return(0,n.isDefined)(e.getSelected())&&(t||!t&&e.countRenderedRows()>0&&e.countRenderedCols()>0)},group:s.GRID_GROUP};t.addShortcuts([{keys:[["F2"]],callback:e=>r.editorFastOpen(e)},{keys:[["Enter"],["Enter","Shift"]],callback:(e,t)=>r.editorOpen(e,t)},{keys:[["Backspace"],["Delete"]],callback:()=>r.emptySelectedCells()}],{group:s.EDITOR_EDIT_GROUP,runOnlyIf:()=>(0,n.isDefined)(e.getSelected())}),t.addShortcuts([{keys:[["Control/Meta","A"]],callback:()=>r.selectAllCells(),runOnlyIf:()=>{var t;return!(null!==(t=e.getSelectedRangeLast())&&void 0!==t&&t.highlight.isHeader())}},{keys:[["Control/Meta","A"]],callback:()=>{},runOnlyIf:()=>{var t;return null===(t=e.getSelectedRangeLast())||void 0===t?void 0:t.highlight.isHeader()},preventDefault:!0},{keys:[["Control/Meta","Shift","Space"]],callback:()=>r.selectAllCellsAndHeaders()},{keys:[["Control/Meta","Enter"]],callback:()=>r.populateSelectedCellsData(),runOnlyIf:()=>{var t,r;return!(null!==(t=e.getSelectedRangeLast())&&void 0!==t&&t.highlight.isHeader())&&(null===(r=e.getSelectedRangeLast())||void 0===r?void 0:r.getCellsCount())>1}},{keys:[["Control","Space"]],captureCtrl:!0,callback:()=>r.extendCellsSelectionToColumns()},{keys:[["Shift","Space"]],stopPropagation:!0,callback:()=>r.extendCellsSelectionToRows()},{keys:[["ArrowUp"]],callback:()=>r.moveCellSelectionUp()},{keys:[["ArrowUp","Control/Meta"]],captureCtrl:!0,callback:()=>r.moveCellSelectionToMostTop()},{keys:[["ArrowUp","Shift"]],callback:()=>r.extendCellsSelectionUp()},{keys:[["ArrowUp","Shift","Control/Meta"]],captureCtrl:!0,callback:()=>r.extendCellsSelectionToMostTop(),runOnlyIf:()=>!(e.selection.isSelectedByCorner()||e.selection.isSelectedByColumnHeader())},{keys:[["ArrowDown"]],callback:()=>r.moveCellSelectionDown()},{keys:[["ArrowDown","Control/Meta"]],captureCtrl:!0,callback:()=>r.moveCellSelectionToMostBottom()},{keys:[["ArrowDown","Shift"]],callback:()=>r.extendCellsSelectionDown()},{keys:[["ArrowDown","Shift","Control/Meta"]],captureCtrl:!0,callback:()=>r.extendCellsSelectionToMostBottom(),runOnlyIf:()=>!(e.selection.isSelectedByCorner()||e.selection.isSelectedByColumnHeader())},{keys:[["ArrowLeft"]],callback:()=>r.moveCellSelectionLeft()},{keys:[["ArrowLeft","Control/Meta"]],captureCtrl:!0,callback:()=>r.moveCellSelectionToMostLeft()},{keys:[["ArrowLeft","Shift"]],callback:()=>r.extendCellsSelectionLeft()},{keys:[["ArrowLeft","Shift","Control/Meta"]],captureCtrl:!0,callback:()=>r.extendCellsSelectionToMostLeft(),runOnlyIf:()=>!(e.selection.isSelectedByCorner()||e.selection.isSelectedByRowHeader())},{keys:[["ArrowRight"]],callback:()=>r.moveCellSelectionRight()},{keys:[["ArrowRight","Control/Meta"]],captureCtrl:!0,callback:()=>r.moveCellSelectionToMostRight()},{keys:[["ArrowRight","Shift"]],callback:()=>r.extendCellsSelectionRight()},{keys:[["ArrowRight","Shift","Control/Meta"]],captureCtrl:!0,callback:()=>r.extendCellsSelectionToMostRight(),runOnlyIf:()=>!(e.selection.isSelectedByCorner()||e.selection.isSelectedByRowHeader())},{keys:[["Home"]],captureCtrl:!0,callback:()=>r.moveCellSelectionToMostInlineStart(),runOnlyIf:()=>e.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["Home","Shift"]],callback:()=>r.extendCellsSelectionToMostInlineStart()},{keys:[["Home","Control/Meta"]],captureCtrl:!0,callback:()=>r.moveCellSelectionToMostTopInlineStart(),runOnlyIf:()=>e.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["End"]],captureCtrl:!0,callback:()=>r.moveCellSelectionToMostInlineEnd(),runOnlyIf:()=>e.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["End","Shift"]],callback:()=>r.extendCellsSelectionToMostInlineEnd()},{keys:[["End","Control/Meta"]],captureCtrl:!0,callback:()=>r.moveCellSelectionToMostBottomInlineEnd(),runOnlyIf:()=>e.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["PageUp"]],callback:()=>r.moveCellSelectionUpByViewportHight()},{keys:[["PageUp","Shift"]],callback:()=>r.extendCellsSelectionUpByViewportHeight()},{keys:[["PageDown"]],callback:()=>r.moveCellSelectionDownByViewportHeight()},{keys:[["PageDown","Shift"]],callback:()=>r.extendCellsSelectionDownByViewportHeight()},{keys:[["Tab"]],preventDefault:!1,callback:e=>r.moveCellSelectionInlineStart(e)},{keys:[["Shift","Tab"]],preventDefault:!1,callback:e=>r.moveCellSelectionInlineEnd(e)},{keys:[["Control/Meta","Backspace"]],callback:()=>r.scrollToFocusedCell()}],o)};var n=r(70505),s=r(72466),i=r(84302)},92399:(e,t,r)=>{"use strict";t.__esModule=!0;var n={registerAllShortcutContexts:!0};t.registerAllShortcutContexts=function(e){[i.shortcutsGridContext,s.shortcutsEditorContext].forEach((t=>t(e)))},r(14846),r(69655);var s=r(4894),i=r(33803),o=r(72466);Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||e in t&&t[e]===o[e]||(t[e]=o[e]))}))},49491:(e,t,r)=>{"use strict";t.__esModule=!0,t.isContextObject=u,r(67834),r(15724),r(14846),r(27458),r(69655);var n=r(54394),s=r(17577),i=r(70505),o=r(89804),a=r(25499),l=r(21595);const h=Symbol("shortcut-context");function u(e){return(0,a.isObject)(e)&&e.__kindOf===h}t.createContext=e=>{const t=(0,n.createUniqueMap)({errorIdExists:t=>`The "${t}" shortcut is already registered in the "${e}" context.`}),r=function(){let{keys:e,callback:r,group:n,runOnlyIf:a=()=>!0,captureCtrl:h=!1,preventDefault:c=!0,stopPropagation:d=!1,relativeToGroup:p,position:g,forwardToContext:f}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if((0,i.isUndefined)(n))throw new Error("You need to define the shortcut's group.");if(!1===(0,o.isFunction)(r))throw new Error("The shortcut's callback needs to be a function.");if(!1===Array.isArray(e))throw new Error(l.toSingleLine`Pass the shortcut\'s keys as an array of arrays,\x20 + using the KeyboardEvent.key properties:\x20 + https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values.`);const m={callback:r,group:n,runOnlyIf:a,captureCtrl:h,preventDefault:c,stopPropagation:d};(0,i.isDefined)(p)&&(m.relativeToGroup=p,m.position=g),u(f)&&(m.forwardToContext=f),e.forEach((e=>{const r=(0,s.normalizeKeys)(e);if(t.hasItem(r)){const e=t.getItem(r);let n=e.findIndex((e=>e.group===p));-1!==n?"before"===g?n-=1:n+=1:n=e.length,e.splice(n,0,m)}else t.addItem(r,[m])}))},c=e=>{const r=(0,s.normalizeKeys)(e);t.removeItem(r)};return{__kindOf:h,addShortcut:r,addShortcuts:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.forEach((e=>{(0,a.objectEach)(t,((r,n)=>{!1===Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=t[n])})),r(e)}))},getShortcuts:e=>{const r=(0,s.normalizeKeys)(e),n=t.getItem(r);return(0,i.isDefined)(n)?n.slice():[]},hasShortcut:e=>{const r=(0,s.normalizeKeys)(e);return t.hasItem(r)},removeShortcutsByKeys:c,removeShortcutsByGroup:e=>{t.getItems().forEach((t=>{let[r,n]=t;const i=n.filter((t=>t.group!==e));0===i.length?c((0,s.getKeysList)(r)):(n.length=0,n.push(...i))}))}}}},89616:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(94747);t.createShortcutManager=n.createShortcutManager},86353:(e,t,r)=>{"use strict";t.__esModule=!0,t.createKeysObserver=function(){const e=new Set;return{press(t){e.add(t)},release(t){e.delete(t)},releaseAll(){e.clear()},isPressed:t=>e.has(t)}},r(71336),r(41558),r(17663),r(68630),r(79645),r(89858),r(8620)},94747:(e,t,r)=>{"use strict";t.__esModule=!0,r(67834);var n=r(54394),s=r(77661),i=r(49491),o=r(1584),a=r(21595);t.createShortcutManager=e=>{let{ownerWindow:t,handleEvent:r,beforeKeyDown:l,afterKeyDown:h}=e;const u=(0,n.createUniqueMap)({errorIdExists:e=>`The "${e}" context name is already registered.`});let c="grid";const d=()=>c,p=e=>u.getItem(e);let g=!1;const f=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:d();const n=(0,i.isContextObject)(r)?r:p(r);let o=!1;if(!n.hasShortcut(t))return o;const a=n.getShortcuts(t);for(let r=0;r{const t=(0,i.createContext)(e);return u.addItem(e,t),t},getActiveContextName:d,getContext:p,setActiveContextName:e=>{if(!u.hasItem(e))throw new Error(a.toSingleLine`You've tried to activate the "${e}" shortcut context\x20 + that does not exist. Before activation, register the context using the "addContext" method.`);c=e},isCtrlPressed:()=>!g&&(m.isPressed("control")||m.isPressed("meta")),releasePressedKeys:()=>m.releasePressedKeys(),destroy:()=>m.unmount()}}},1584:(e,t,r)=>{"use strict";t.__esModule=!0,t.useRecorder=function(e,t,r,n,d){const p=e=>l.includes(e),g=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const r=[];return e.altKey&&r.push("alt"),t&&(e.ctrlKey||e.metaKey)?r.push("control/meta"):(e.ctrlKey&&r.push("control"),e.metaKey&&r.push("meta")),e.shiftKey&&r.push("shift"),r},f=e=>{if(!1===t(e))return;if(!1===r(e)||229===e.keyCode||"string"!=typeof e.key||(0,i.isImmediatePropagationStopped)(e))return;const o=(0,s.normalizeEventKey)(e);let l=[];p(o)||(l=g(e));const h=[o].concat(l);!d(e,h)&&((0,a.isMacOS)()&&l.includes("meta")||!(0,a.isMacOS)()&&l.includes("control"))&&d(e,[o].concat(g(e,!0))),n(e)},m=e=>{if("string"==typeof e.key){const t=(0,s.normalizeEventKey)(e);p(t)&&h.press(t)}},y=e=>{if("string"==typeof e.key){const t=(0,s.normalizeEventKey)(e);p(t)&&h.release(t)}},E=()=>{h.releaseAll()};return{mount:()=>{let t=e;for(c+=1;t;)1===c&&(t.document.documentElement.addEventListener("keydown",m),u.push({event:"keydown",listener:m}),t.document.documentElement.addEventListener("keyup",y),u.push({event:"keyup",listener:y})),t.document.documentElement.addEventListener("keydown",f),t.document.documentElement.addEventListener("blur",E),t=(0,o.getParentWindow)(t)},unmount:()=>{let t=e;for(c-=1;t;){if(0===c){for(let e=0;eh.isPressed(e),releasePressedKeys:()=>h.releaseAll()}},r(15724);var n=r(86353),s=r(17577),i=r(77661),o=r(62577),a=r(25046);const l=["meta","alt","shift","control"],h=(0,n.createKeysObserver)(),u=[];let c=0},17577:(e,t,r)=>{"use strict";t.__esModule=!0,r(94364);const n=new Map([[" ","space"],["spacebar","space"],["scroll","scrolllock"],["del","delete"],["esc","escape"],["medianexttrack","mediatracknext"],["mediaprevioustrack","mediatrackprevious"],["volumeup","audiovolumeup"],["volumedown","audiovolumedown"],["volumemute","audiovolumemute"],["multiply","*"],["add","+"],["divide","/"],["subtract","-"],["left","arrowleft"],["right","arrowright"],["up","arrowup"],["down","arrowdown"]]);t.normalizeKeys=e=>e.map((e=>{const t=e.toLowerCase();return n.has(t)?n.get(t):t})).sort().join("+");t.getKeysList=e=>e.split("+");const s=new Map([[96,"numpad0"],[97,"numpad1"],[98,"numpad2"],[99,"numpad3"],[100,"numpad4"],[101,"numpad5"],[102,"numpad6"],[103,"numpad7"],[104,"numpad8"],[105,"numpad9"],[106,"multiply"],[107,"add"],[108,"decimal"],[109,"subtract"],[110,"decimal"],[111,"divide"],[112,"f1"],[113,"f2"],[114,"f3"],[115,"f4"],[116,"f5"],[117,"f6"],[118,"f7"],[119,"f8"],[120,"f9"],[121,"f10"],[122,"f11"],[123,"f12"],[186,"semicolon"],[187,"equal"],[188,"comma"],[189,"minus"],[190,"period"],[191,"slash"],[192,"backquote"],[219,"bracketleft"],[220,"backslash"],[221,"bracketright"],[222,"quote"]]);t.normalizeEventKey=e=>{let{which:t,key:r}=e;if(s.has(t))return s.get(t);const n=String.fromCharCode(t).toLowerCase();return/^[a-z0-9]$/.test(n)?n:r.toLowerCase()}},33925:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834),r(15724);var s=n(r(85707)),i=r(62577),o=n(r(3849)),a=r(77661),l=n(r(50206)),h=r(87642),u=r(45435),c=r(71120);function d(e,t,r){p(e,t),t.set(e,r)}function p(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function g(e,t){return e.get(m(e,t))}function f(e,t,r){return e.set(m(e,t),r),r}function m(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var y=new WeakMap,E=new WeakMap,w=new WeakMap,C=new WeakMap,v=new WeakMap,R=new WeakMap,S=new WeakMap,T=new WeakMap,N=new WeakSet;function M(){return parseInt(this.hot.rootElement.getAttribute((0,c.A11Y_COLCOUNT)()[0]),10)}function _(e){const t=m(N,this,M).call(this)+e;(0,i.setAttribute)(this.hot.rootElement,...(0,c.A11Y_COLCOUNT)(t))}function b(){const e=this.hot.rootElement;this.hasVerticalScroll()?(0,i.addClass)(e,"htHasScrollY"):(0,i.removeClass)(e,"htHasScrollY"),this.hasHorizontalScroll()?(0,i.addClass)(e,"htHasScrollX"):(0,i.removeClass)(e,"htHasScrollX")}t.default=class{constructor(e){var t,r;p(t=this,r=N),r.add(t),(0,s.default)(this,"hot",void 0),(0,s.default)(this,"eventManager",void 0),(0,s.default)(this,"settings",void 0),(0,s.default)(this,"THEAD",void 0),(0,s.default)(this,"TBODY",void 0),(0,s.default)(this,"_wt",void 0),(0,s.default)(this,"activeWt",void 0),d(this,y,0),d(this,E,0),(0,s.default)(this,"postponedAdjustElementsSize",!1),d(this,w,!1),d(this,C,void 0),d(this,v,void 0),d(this,R,0),d(this,S,0),d(this,T,null),this.hot=e,this.eventManager=new o.default(this.hot),this.settings=this.hot.getSettings(),this.createElements(),this.registerEvents(),this.initializeWalkontable()}render(){this.hot.isRenderSuspended()||(this.hot.runHooks("beforeRender",this.hot.forceFullRender),this.postponedAdjustElementsSize&&(this.postponedAdjustElementsSize=!1,this.adjustElementsSize()),this._wt.draw(!this.hot.forceFullRender),m(N,this,b).call(this),this.hot.runHooks("afterRender",this.hot.forceFullRender),this.hot.forceFullRender=!1,this.hot.renderCall=!1)}adjustElementsSize(){this.hot.isRenderSuspended()?this.postponedAdjustElementsSize=!0:this._wt.wtOverlays.adjustElementsSize()}getCellAtCoords(e,t){const r=this._wt.getCell(e,t);return r<0?null:r}scrollViewport(e,t,r){return this._wt.scrollViewport(e,t,r)}scrollViewportHorizontally(e,t){return this._wt.scrollViewportHorizontally(e,t)}scrollViewportVertically(e,t){return this._wt.scrollViewportVertically(e,t)}createElements(){const{rootElement:e,rootDocument:t}=this.hot,r=e.getAttribute("style");r&&e.setAttribute("data-originalstyle",r),(0,i.addClass)(e,"handsontable"),f(v,this,t.createElement("TABLE")),(0,i.addClass)(g(v,this),"htCore"),this.hot.getSettings().tableClassName&&(0,i.addClass)(g(v,this),this.hot.getSettings().tableClassName),this.settings.ariaTags&&((0,i.setAttribute)(g(v,this),[(0,c.A11Y_PRESENTATION)()]),(0,i.setAttribute)(e,[(0,c.A11Y_TREEGRID)(),(0,c.A11Y_ROWCOUNT)(-1),(0,c.A11Y_COLCOUNT)(this.hot.countCols()),(0,c.A11Y_MULTISELECTABLE)()])),this.THEAD=t.createElement("THEAD"),g(v,this).appendChild(this.THEAD),this.TBODY=t.createElement("TBODY"),g(v,this).appendChild(this.TBODY),this.hot.table=g(v,this),this.hot.container.insertBefore(g(v,this),this.hot.container.firstChild)}registerEvents(){const{rootElement:e,rootDocument:t,selection:r,rootWindow:n}=this.hot,s=t.documentElement;this.eventManager.addEventListener(e,"mousedown",(e=>{f(w,this,!0),this.isTextSelectionAllowed(e.target)||((0,i.clearTextSelection)(n),e.preventDefault(),n.focus())})),this.eventManager.addEventListener(e,"mouseup",(()=>{f(w,this,!1)})),this.eventManager.addEventListener(e,"mousemove",(e=>{g(w,this)&&!this.isTextSelectionAllowed(e.target)&&(this.settings.fragmentSelection&&(0,i.clearTextSelection)(n),e.preventDefault())})),this.eventManager.addEventListener(s,"keyup",(e=>{r.isInProgress()&&!e.shiftKey&&r.finish()})),this.eventManager.addEventListener(s,"mouseup",(n=>{r.isInProgress()&&(0,a.isLeftClick)(n)&&r.finish(),f(C,this,!1);const s=(0,i.isOutsideInput)(t.activeElement);(0,i.isInput)(t.activeElement)&&!s||!s&&(r.isSelected()||r.isSelectedByAnyHeader()||e.contains(n.target)||(0,a.isRightClick)(n))||this.hot.unlisten()})),this.eventManager.addEventListener(s,"contextmenu",(e=>{r.isInProgress()&&(0,a.isRightClick)(e)&&(r.finish(),f(C,this,!1))})),this.eventManager.addEventListener(s,"touchend",(()=>{r.isInProgress()&&r.finish(),f(C,this,!1)})),this.eventManager.addEventListener(s,"mousedown",(r=>{const n=r.target,o=r.x||r.clientX,a=r.y||r.clientY;let l=r.target;if(g(C,this)||!e||!this.hot.view)return;const{holder:h}=this._wt.wtTable;if(l===h){const e=(0,i.getScrollbarWidth)(t);if(t.elementFromPoint(o+e,a)!==h||t.elementFromPoint(o,a+e)!==h)return}else for(;l!==s;){if(null===l){if(r.isTargetWebComponent)break;return}if(l===e)return;l=l.parentNode}("function"==typeof this.settings.outsideClickDeselects?this.settings.outsideClickDeselects(n):this.settings.outsideClickDeselects)?this.hot.deselectCell():this.hot.destroyEditor(!1,!1)}));let o=(0,i.getParentWindow)(n);for(;null!==o;)this.eventManager.addEventListener(o.document.documentElement,"click",(()=>{this.hot.unlisten()})),o=(0,i.getParentWindow)(o);this.eventManager.addEventListener(g(v,this),"selectstart",(e=>{this.settings.fragmentSelection||(0,i.isInput)(e.target)||e.preventDefault()}))}translateFromRenderableToVisualCoords(e){let{row:t,col:r}=e;return this.hot._createCellCoords(...this.translateFromRenderableToVisualIndex(t,r))}translateFromRenderableToVisualIndex(e,t){let r=e>=0?this.hot.rowIndexMapper.getVisualFromRenderableIndex(e):e,n=t>=0?this.hot.columnIndexMapper.getVisualFromRenderableIndex(t):t;return null===r&&(r=e),null===n&&(n=t),[r,n]}countRenderableIndexes(e,t){const r=Math.min(e.getNotTrimmedIndexesLength(),t),n=e.getNearestNotHiddenIndex(r-1,-1);return null===n?0:e.getRenderableFromVisualIndex(n)+1}countRenderableColumns(){return this.countRenderableIndexes(this.hot.columnIndexMapper,this.settings.maxCols)}countRenderableRows(){return this.countRenderableIndexes(this.hot.rowIndexMapper,this.settings.maxRows)}countNotHiddenRowIndexes(e,t){return this.countNotHiddenIndexes(e,t,this.hot.rowIndexMapper,this.countRenderableRows())}countNotHiddenColumnIndexes(e,t){return this.countNotHiddenIndexes(e,t,this.hot.columnIndexMapper,this.countRenderableColumns())}countNotHiddenIndexes(e,t,r,n){if(isNaN(e)||e<0)return 0;const s=r.getNearestNotHiddenIndex(e,t),i=r.getRenderableFromVisualIndex(s);if(!Number.isInteger(i))return 0;let o=0;return t<0?o=i+1:t>0&&(o=n-i),o}countNotHiddenFixedColumnsStart(){const e=this.hot.countCols(),t=Math.min(parseInt(this.settings.fixedColumnsStart,10),e)-1;return this.countNotHiddenColumnIndexes(t,-1)}countNotHiddenFixedRowsTop(){const e=this.hot.countRows(),t=Math.min(parseInt(this.settings.fixedRowsTop,10),e)-1;return this.countNotHiddenRowIndexes(t,-1)}countNotHiddenFixedRowsBottom(){const e=this.hot.countRows(),t=Math.max(e-parseInt(this.settings.fixedRowsBottom,10),0);return this.countNotHiddenRowIndexes(t,1)}countRenderableColumnsInRange(e,t){let r=0;for(let n=e;n<=t;n++)null!==this.hot.columnIndexMapper.getRenderableFromVisualIndex(n)&&(r+=1);return r}countRenderableRowsInRange(e,t){let r=0;for(let n=e;n<=t;n++)null!==this.hot.rowIndexMapper.getRenderableFromVisualIndex(n)&&(r+=1);return r}getStylesHandler(){return this._wt.stylesHandler}getDefaultRowHeight(){return this._wt.stylesHandler.getDefaultRowHeight()}addClassNameToLicenseElement(e){var t;const r=null===(t=this.hot.rootElement.parentNode)||void 0===t?void 0:t.querySelector(".hot-display-license-info");r&&(0,i.addClass)(r,e)}removeClassNameFromLicenseElement(e){var t;const r=null===(t=this.hot.rootElement.parentNode)||void 0===t?void 0:t.querySelector(".hot-display-license-info");r&&(0,i.removeClass)(r,e)}isMainTableNotFullyCoveredByOverlays(){const e=this.countNotHiddenFixedRowsTop()+this.countNotHiddenFixedRowsBottom(),t=this.countNotHiddenFixedColumnsStart();return this.hot.countRenderedRows()>e&&this.hot.countRenderedCols()>t}initializeWalkontable(){const e={ariaTags:this.settings.ariaTags,rtlMode:this.hot.isRtl(),externalRowCalculator:this.hot.getPlugin("autoRowSize")&&this.hot.getPlugin("autoRowSize").isEnabled(),table:g(v,this),isDataViewInstance:()=>(0,u.isRootInstance)(this.hot),preventOverflow:()=>this.settings.preventOverflow,preventWheel:()=>this.settings.preventWheel,viewportColumnRenderingThreshold:()=>this.settings.viewportColumnRenderingThreshold,viewportRowRenderingThreshold:()=>this.settings.viewportRowRenderingThreshold,data:(e,t)=>this.hot.getDataAtCell(...this.translateFromRenderableToVisualIndex(e,t)),totalRows:()=>this.countRenderableRows(),totalColumns:()=>this.countRenderableColumns(),fixedColumnsStart:()=>this.countNotHiddenFixedColumnsStart(),fixedRowsTop:()=>this.countNotHiddenFixedRowsTop(),fixedRowsBottom:()=>this.countNotHiddenFixedRowsBottom(),shouldRenderInlineStartOverlay:()=>this.settings.fixedColumnsStart>0||e.rowHeaders().length>0,shouldRenderTopOverlay:()=>this.settings.fixedRowsTop>0||e.columnHeaders().length>0,shouldRenderBottomOverlay:()=>this.settings.fixedRowsBottom>0,minSpareRows:()=>this.settings.minSpareRows,renderAllRows:this.settings.renderAllRows,renderAllColumns:this.settings.renderAllColumns,rowHeaders:()=>{const e=[];return this.hot.hasRowHeaders()&&e.push(((e,t)=>{const r=e>=0?this.hot.rowIndexMapper.getVisualFromRenderableIndex(e):e;this.appendRowHeader(r,t)})),this.hot.runHooks("afterGetRowHeaderRenderers",e),f(E,this,e.length),this.hot.getSettings().ariaTags&&m(N,this,M).call(this)===this.hot.countCols()&&m(N,this,_).call(this,g(E,this)),e},columnHeaders:()=>{const e=[];return this.hot.hasColHeaders()&&e.push(((e,t)=>{const r=e>=0?this.hot.columnIndexMapper.getVisualFromRenderableIndex(e):e;this.appendColHeader(r,t)})),this.hot.runHooks("afterGetColumnHeaderRenderers",e),f(y,this,e.length),e},columnWidth:e=>{const t=this.hot.columnIndexMapper.getVisualFromRenderableIndex(e);return this.hot.getColWidth(null===t?e:t)},rowHeight:e=>{const t=this.hot.rowIndexMapper.getVisualFromRenderableIndex(e);return this.hot.getRowHeight(null===t?e:t)},rowHeightByOverlayName:(e,t)=>{const r=this.hot.rowIndexMapper.getVisualFromRenderableIndex(e),n=null===r?e:r;return this.hot.runHooks("modifyRowHeightByOverlayName",this.hot.getRowHeight(n),n,t)},cellRenderer:(e,t,r)=>{const[n,s]=this.translateFromRenderableToVisualIndex(e,t),i=this.hot.runHooks("modifyGetCellCoords",n,s,!1,"meta");let o=n,a=s;Array.isArray(i)&&([o,a]=i);const l=this.hot.getCellMeta(o,a),h=this.hot.colToProp(a);let u=this.hot.getDataAtRowProp(o,h);this.hot.hasHook("beforeValueRender")&&(u=this.hot.runHooks("beforeValueRender",u,l)),this.hot.runHooks("beforeRenderer",r,n,s,h,u,l),this.hot.getCellRenderer(l)(this.hot,r,n,s,h,u,l),this.hot.runHooks("afterRenderer",r,n,s,h,u,l)},selections:this.hot.selection.highlight,hideBorderOnMouseDownOver:()=>this.settings.fragmentSelection,onWindowResize:()=>{this.hot&&!this.hot.isDestroyed&&this.hot.refreshDimensions()},onContainerElementResize:()=>{this.hot&&!this.hot.isDestroyed&&(0,i.isVisible)(this.hot.rootElement)&&this.hot.refreshDimensions()},onCellMouseDown:(e,t,r,n)=>{const s=this.translateFromRenderableToVisualCoords(t),i={row:!1,column:!1,cell:!1};this.hot.listen(),this.activeWt=n,f(C,this,!0),f(T,this,{x:e.clientX,y:e.clientY}),this.hot.runHooks("beforeOnCellMouseDown",e,s,r,i),(0,a.isImmediatePropagationStopped)(e)||((0,h.handleMouseEvent)(e,{coords:s,selection:this.hot.selection,controller:i,cellCoordsFactory:(e,t)=>this.hot._createCellCoords(e,t)}),this.hot.runHooks("afterOnCellMouseDown",e,s,r),this.activeWt=this._wt)},onCellContextMenu:(e,t,r,n)=>{const s=this.translateFromRenderableToVisualCoords(t);this.activeWt=n,f(C,this,!1),this.hot.selection.isInProgress()&&this.hot.selection.finish(),this.hot.runHooks("beforeOnCellContextMenu",e,s,r),(0,a.isImmediatePropagationStopped)(e)||(this.hot.runHooks("afterOnCellContextMenu",e,s,r),this.activeWt=this._wt)},onCellMouseOut:(e,t,r,n)=>{const s=this.translateFromRenderableToVisualCoords(t);this.activeWt=n,this.hot.runHooks("beforeOnCellMouseOut",e,s,r),(0,a.isImmediatePropagationStopped)(e)||(this.hot.runHooks("afterOnCellMouseOut",e,s,r),this.activeWt=this._wt)},onCellMouseOver:(e,t,r,n)=>{const s=this.translateFromRenderableToVisualCoords(t),i={row:!1,column:!1,cell:!1};this.activeWt=n,this.hot.runHooks("beforeOnCellMouseOver",e,s,r,i),(0,a.isImmediatePropagationStopped)(e)||(!g(C,this)||g(T,this)&&g(T,this).x===e.clientX&&g(T,this).y===e.clientY||(0,h.handleMouseEvent)(e,{coords:s,selection:this.hot.selection,controller:i,cellCoordsFactory:(e,t)=>this.hot._createCellCoords(e,t)}),this.hot.runHooks("afterOnCellMouseOver",e,s,r),this.activeWt=this._wt,f(T,this,null))},onCellMouseUp:(e,t,r,n)=>{const s=this.translateFromRenderableToVisualCoords(t);this.activeWt=n,this.hot.runHooks("beforeOnCellMouseUp",e,s,r),(0,a.isImmediatePropagationStopped)(e)||this.hot.isDestroyed||(this.hot.runHooks("afterOnCellMouseUp",e,s,r),this.activeWt=this._wt)},onCellCornerMouseDown:e=>{e.preventDefault(),this.hot.runHooks("afterOnCellCornerMouseDown",e)},onCellCornerDblClick:e=>{e.preventDefault(),this.hot.runHooks("afterOnCellCornerDblClick",e)},beforeDraw:(e,t)=>this.beforeRender(e,t),onDraw:e=>this.afterRender(e),onBeforeViewportScrollVertically:(e,t)=>{const r=this.hot.rowIndexMapper,n=e<0;let s=e;return n||(s=r.getVisualFromRenderableIndex(e),null!==s)?(s=this.hot.runHooks("beforeViewportScrollVertically",s,t),this.hot.runHooks("beforeViewportScroll"),n?s:r.getRenderableFromVisualIndex(s)):e},onBeforeViewportScrollHorizontally:(e,t)=>{const r=this.hot.columnIndexMapper,n=e<0;let s=e;return n||(s=r.getVisualFromRenderableIndex(e),null!==s)?(s=this.hot.runHooks("beforeViewportScrollHorizontally",s,t),this.hot.runHooks("beforeViewportScroll"),n?s:r.getRenderableFromVisualIndex(s)):e},onScrollVertically:()=>{this.hot.runHooks("afterScrollVertically"),this.hot.runHooks("afterScroll")},onScrollHorizontally:()=>{this.hot.runHooks("afterScrollHorizontally"),this.hot.runHooks("afterScroll")},onBeforeRemoveCellClassNames:()=>this.hot.runHooks("beforeRemoveCellClassNames"),onBeforeHighlightingRowHeader:(e,t,r)=>{const n=this.hot.rowIndexMapper,s=e<0;let i=e;s||(i=n.getVisualFromRenderableIndex(e));const o=this.hot.runHooks("beforeHighlightingRowHeader",i,t,r);return s?o:n.getRenderableFromVisualIndex(n.getNearestNotHiddenIndex(o,1))},onBeforeHighlightingColumnHeader:(e,t,r)=>{const n=this.hot.columnIndexMapper,s=e<0;let i=e;s||(i=n.getVisualFromRenderableIndex(e));const o=this.hot.runHooks("beforeHighlightingColumnHeader",i,t,r);return s?o:n.getRenderableFromVisualIndex(n.getNearestNotHiddenIndex(o,1))},onAfterDrawSelection:(e,t,r)=>{let n;const[s,i]=this.translateFromRenderableToVisualIndex(e,t),o=this.hot.selection.getSelectedRange();if(o.size()>0){const e=o.peekByIndex(null!=r?r:0);n=[e.from.row,e.from.col,e.to.row,e.to.col]}return this.hot.runHooks("afterDrawSelection",s,i,n,r)},onBeforeDrawBorders:(e,t)=>{const[r,n,s,i]=e,o=[this.hot.rowIndexMapper.getVisualFromRenderableIndex(r),this.hot.columnIndexMapper.getVisualFromRenderableIndex(n),this.hot.rowIndexMapper.getVisualFromRenderableIndex(s),this.hot.columnIndexMapper.getVisualFromRenderableIndex(i)];return this.hot.runHooks("beforeDrawBorders",o,t)},onBeforeTouchScroll:()=>this.hot.runHooks("beforeTouchScroll"),onAfterMomentumScroll:()=>this.hot.runHooks("afterMomentumScroll"),onModifyRowHeaderWidth:e=>this.hot.runHooks("modifyRowHeaderWidth",e),onModifyGetCellCoords:(e,t,r,n)=>{const s=this.hot.rowIndexMapper,i=this.hot.columnIndexMapper,o=t>=0?i.getVisualFromRenderableIndex(t):t,a=e>=0?s.getVisualFromRenderableIndex(e):e,l=this.hot.runHooks("modifyGetCellCoords",a,o,r,n);if(Array.isArray(l)){const[e,t,r,n]=l;return[e>=0?s.getRenderableFromVisualIndex(s.getNearestNotHiddenIndex(e,1)):e,t>=0?i.getRenderableFromVisualIndex(i.getNearestNotHiddenIndex(t,1)):t,r>=0?s.getRenderableFromVisualIndex(s.getNearestNotHiddenIndex(r,-1)):r,n>=0?i.getRenderableFromVisualIndex(i.getNearestNotHiddenIndex(n,-1)):n]}},onModifyGetCoordsElement:(e,t)=>{const r=this.hot.rowIndexMapper,n=this.hot.columnIndexMapper,s=t>=0?n.getVisualFromRenderableIndex(t):t,i=e>=0?r.getVisualFromRenderableIndex(e):e,o=this.hot.runHooks("modifyGetCoordsElement",i,s);if(Array.isArray(o)){const[e,t]=o;return[e>=0?r.getRenderableFromVisualIndex(r.getNearestNotHiddenIndex(e,1)):e,t>=0?n.getRenderableFromVisualIndex(n.getNearestNotHiddenIndex(t,1)):t]}},viewportRowCalculatorOverride:e=>{let t=this.settings.viewportRowRenderingOffset;if("auto"===t&&this.settings.fixedRowsTop&&(t=10),t>0||"auto"===t){const r=this.countRenderableRows(),n=e.startRow,s=e.endRow;if("number"==typeof t)e.startRow=Math.max(n-t,0),e.endRow=Math.min(s+t,r-1);else if("auto"===t){const t=Math.max(1,Math.ceil(s/r*12));e.startRow=Math.max(n-t,0),e.endRow=Math.min(s+t,r-1)}}this.hot.runHooks("afterViewportRowCalculatorOverride",e)},viewportColumnCalculatorOverride:e=>{let t=this.settings.viewportColumnRenderingOffset;if("auto"===t&&this.settings.fixedColumnsStart&&(t=10),t>0||"auto"===t){const r=this.countRenderableColumns(),n=e.startColumn,s=e.endColumn;if("number"==typeof t&&(e.startColumn=Math.max(n-t,0),e.endColumn=Math.min(s+t,r-1)),"auto"===t){const t=Math.max(1,Math.ceil(s/r*6));e.startColumn=Math.max(n-t,0),e.endColumn=Math.min(s+t,r-1)}}this.hot.runHooks("afterViewportColumnCalculatorOverride",e)},rowHeaderWidth:()=>this.settings.rowHeaderWidth,columnHeaderHeight:()=>{const e=this.hot.runHooks("modifyColumnHeaderHeight");return this.settings.columnHeaderHeight||e}};this.hot.runHooks("beforeInitWalkontable",e),this._wt=new l.default(e),this.activeWt=this._wt;const t=this._wt.wtTable.spreader,{width:r,height:n}=this.hot.rootElement.getBoundingClientRect();this.setLastSize(r,n),this.eventManager.addEventListener(t,"mousedown",(e=>{e.target===t&&3===e.which&&e.stopPropagation()})),this.eventManager.addEventListener(t,"contextmenu",(e=>{e.target===t&&3===e.which&&e.stopPropagation()})),this.eventManager.addEventListener(this.hot.rootDocument.documentElement,"click",(()=>{this.settings.observeDOMVisibility&&this._wt.drawInterrupted&&(this.hot.forceFullRender=!0,this.render())}))}isTextSelectionAllowed(e){if((0,i.isInput)(e))return!0;const t=(0,i.isChildOf)(e,this._wt.wtTable.spreader);return!(!0!==this.settings.fragmentSelection||!t)||(!("cell"!==this.settings.fragmentSelection||!this.isSelectedOnlyCell()||!t)||!(this.settings.fragmentSelection||!this.isCellEdited()||!this.isSelectedOnlyCell()))}isMouseDown(){return g(C,this)}isSelectedOnlyCell(){var e,t;return null!==(e=null===(t=this.hot.getSelectedRangeLast())||void 0===t?void 0:t.isSingleCell())&&void 0!==e&&e}isCellEdited(){const e=this.hot.getActiveEditor();return e&&e.isOpened()}beforeRender(e,t){e&&this.hot.runHooks("beforeViewRender",this.hot.forceFullRender,t)}afterRender(e){e&&this.hot.runHooks("afterViewRender",this.hot.forceFullRender)}appendRowHeader(e,t){if(t.firstChild){const r=t.firstChild;if(!(0,i.hasClass)(r,"relative"))return(0,i.empty)(t),void this.appendRowHeader(e,t);this.updateCellHeader(r.querySelector(".rowHeader"),e,this.hot.getRowHeader)}else{const{rootDocument:r,getRowHeader:n}=this.hot,s=r.createElement("div"),i=r.createElement("span");s.className="relative",i.className="rowHeader",this.updateCellHeader(i,e,n),s.appendChild(i),t.appendChild(s)}this.hot.runHooks("afterGetRowHeader",e,t)}appendColHeader(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hot.getColHeader,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const s=()=>{const t=e>=0?this.hot.getColumnMeta(e).headerClassName:null;return t?t.split(" "):[]};if(t.firstChild){const o=t.firstChild;(0,i.hasClass)(o,"relative")?(this.updateCellHeader(o.querySelector(".colHeader"),e,r,n),o.className="",(0,i.addClass)(o,["relative",...s()])):((0,i.empty)(t),this.appendColHeader(e,t,r,n))}else{const{rootDocument:o}=this.hot,a=o.createElement("div"),l=o.createElement("span"),h=s();a.classList.add("relative",...h),l.className="colHeader",this.settings.ariaTags&&((0,i.setAttribute)(a,...(0,c.A11Y_PRESENTATION)()),(0,i.setAttribute)(l,...(0,c.A11Y_PRESENTATION)())),this.updateCellHeader(l,e,r,n),a.appendChild(l),t.appendChild(a)}this.hot.runHooks("afterGetColHeader",e,t,n)}updateCellHeader(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=t;const o=this._wt.wtOverlays.getParentOverlay(e)||this._wt;e.parentNode&&((0,i.hasClass)(e,"colHeader")?s=o.wtTable.columnFilter.sourceToRendered(t):(0,i.hasClass)(e,"rowHeader")&&(s=o.wtTable.rowFilter.sourceToRendered(t))),s>-1?(0,i.fastInnerHTML)(e,r(t,n)):((0,i.fastInnerText)(e,String.fromCharCode(160)),(0,i.addClass)(e,"cornerHeader"))}maximumVisibleElementWidth(e){const t=this._wt.wtViewport.getWorkspaceWidth()-e;return t>0?t:0}maximumVisibleElementHeight(e){const t=this._wt.wtViewport.getWorkspaceHeight()-e;return t>0?t:0}setLastSize(e,t){f(R,this,e),f(S,this,t)}getLastSize(){return{width:g(R,this),height:g(S,this)}}getFirstRenderedVisibleRow(){if(!this._wt.wtViewport.rowsRenderCalculator)return null;const e=this.hot.rowIndexMapper,t=e.getVisualFromRenderableIndex(this._wt.wtTable.getFirstRenderedRow());return e.getNearestNotHiddenIndex(null!=t?t:0,1)}getLastRenderedVisibleRow(){if(!this._wt.wtViewport.rowsRenderCalculator)return null;const e=this.hot.rowIndexMapper,t=e.getVisualFromRenderableIndex(this._wt.wtTable.getLastRenderedRow());return e.getNearestNotHiddenIndex(null!=t?t:this.hot.countRows()-1,-1)}getFirstRenderedVisibleColumn(){if(!this._wt.wtViewport.columnsRenderCalculator)return null;const e=this.hot.columnIndexMapper,t=e.getVisualFromRenderableIndex(this._wt.wtTable.getFirstRenderedColumn());return e.getNearestNotHiddenIndex(null!=t?t:0,1)}getLastRenderedVisibleColumn(){if(!this._wt.wtViewport.columnsRenderCalculator)return null;const e=this.hot.columnIndexMapper,t=e.getVisualFromRenderableIndex(this._wt.wtTable.getLastRenderedColumn());return e.getNearestNotHiddenIndex(null!=t?t:this.hot.countCols()-1,-1)}getFirstFullyVisibleRow(){return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getFirstVisibleRow())}getLastFullyVisibleRow(){return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getLastVisibleRow())}getFirstFullyVisibleColumn(){return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getFirstVisibleColumn())}getLastFullyVisibleColumn(){return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getLastVisibleColumn())}getFirstPartiallyVisibleRow(){return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getFirstPartiallyVisibleRow())}getLastPartiallyVisibleRow(){return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getLastPartiallyVisibleRow())}getFirstPartiallyVisibleColumn(){return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getFirstPartiallyVisibleColumn())}getLastPartiallyVisibleColumn(){return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getLastPartiallyVisibleColumn())}getColumnHeadersCount(){return g(y,this)}getRowHeadersCount(){return g(E,this)}getViewportWidth(){return this._wt.wtViewport.getViewportWidth()}getWorkspaceWidth(){return this._wt.wtViewport.getWorkspaceWidth()}getViewportHeight(){return this._wt.wtViewport.getViewportHeight()}getWorkspaceHeight(){return this._wt.wtViewport.getWorkspaceHeight()}getElementOverlayName(e){var t;return(null!==(t=this._wt.wtOverlays.getParentOverlay(e))&&void 0!==t?t:this._wt).wtTable.name}getOverlayByName(e){return this._wt.getOverlayByName(e)}getActiveOverlayName(){return this._wt.activeOverlayName}isVisible(){return this._wt.wtTable.isVisible()}hasVerticalScroll(){return this._wt.wtViewport.hasVerticalScroll()}hasHorizontalScroll(){return this._wt.wtViewport.hasHorizontalScroll()}getTableWidth(){return this._wt.wtTable.getWidth()}getTableHeight(){return this._wt.wtTable.getHeight()}getRowHeaderWidth(){return this._wt.wtViewport.getRowHeaderWidth()}getColumnHeaderHeight(){return this._wt.wtViewport.getColumnHeaderHeight()}isVerticallyScrollableByWindow(){return this._wt.wtViewport.isVerticallyScrollableByWindow()}isHorizontallyScrollableByWindow(){return this._wt.wtViewport.isHorizontallyScrollableByWindow()}destroy(){this._wt.destroy(),this.eventManager.destroy()}}},73001:(e,t,r)=>{"use strict";t.__esModule=!0,r(67834),r(71336),r(41558),r(17663),r(68630),r(79645),r(89858),r(8620),r(14846),r(69655);var n=r(68838),s=r(89027);function i(e,t,r){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}function o(e,t){return e.get(l(e,t))}function a(e,t,r){return e.set(l(e,t),r),r}function l(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var h=new WeakMap,u=new WeakMap,c=new WeakMap,d=new WeakMap,p=new WeakMap;t.ChangesObservable=class{constructor(){let{initialIndexValue:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(this,h,new Set),i(this,u,[]),i(this,c,[]),i(this,d,!1),i(this,p,!1),a(p,this,null!=e&&e)}createObserver(){const e=new n.ChangesObserver;return o(h,this).add(e),e.addLocalHook("unsubscribe",(()=>{o(h,this).delete(e)})),e._writeInitialChanges((0,s.arrayDiff)(o(u,this),o(c,this))),e}emit(e){let t=o(c,this);o(d,this)&&o(u,this).length===e.length||(0===e.length?e=new Array(t.length).fill(o(p,this)):a(u,this,new Array(e.length).fill(o(p,this))),o(d,this)||(a(d,this,!0),t=o(u,this)));const r=(0,s.arrayDiff)(t,e);o(h,this).forEach((e=>e._write(r))),a(c,this,e)}}},68838:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834);var s=r(25499),i=n(r(16050));function o(e,t,r){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}function a(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var l=new WeakMap;class h{constructor(){o(this,l,[])}subscribe(e){var t,r;return this.addLocalHook("change",e),this._write((r=this,(t=l).get(a(t,r)))),this}unsubscribe(){return this.runLocalHooks("unsubscribe"),this.clearLocalHooks(),this}_write(e){return e.length>0&&this.runLocalHooks("change",e),this}_writeInitialChanges(e){var t,r,n;r=this,n=e,(t=l).set(a(t,r),n)}}t.ChangesObserver=h,(0,s.mixin)(h,i.default)},89027:(e,t,r)=>{"use strict";t.__esModule=!0,t.arrayDiff=function(e,t){const r=[];let n=0,s=0;for(;n{"use strict";r(14846),r(69655),t.__esModule=!0;var n={IndexMapper:!0,getRegisteredMapsCounter:!0,getIncreasedIndexes:!0,getDecreasedIndexes:!0,alterUtilsFactory:!0},s=r(81667);t.IndexMapper=s.IndexMapper;var i=r(47675);t.getRegisteredMapsCounter=i.getRegisteredMapsCounter;var o=r(88795);t.getIncreasedIndexes=o.getIncreasedIndexes,t.getDecreasedIndexes=o.getDecreasedIndexes,t.alterUtilsFactory=o.alterUtilsFactory;var a=r(74761);Object.keys(a).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||e in t&&t[e]===a[e]||(t[e]=a[e]))}))},81667:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0;var s=n(r(85707));r(67834),r(71336),r(41558),r(17663),r(68630),r(79645),r(89858),r(8620),r(14846),r(27458),r(94364),r(75568);var i=r(10587),o=r(74761),a=r(98045),l=n(r(16050)),h=r(25499),u=r(70505),c=r(73001);new Set;class d{constructor(){(0,s.default)(this,"indexesSequence",new o.IndexesSequence),(0,s.default)(this,"trimmingMapsCollection",new a.AggregatedCollection((e=>e.some((e=>!0===e))),!1)),(0,s.default)(this,"hidingMapsCollection",new a.AggregatedCollection((e=>e.some((e=>!0===e))),!1)),(0,s.default)(this,"variousMapsCollection",new a.MapCollection),(0,s.default)(this,"hidingChangesObservable",new c.ChangesObservable({initialIndexValue:!1})),(0,s.default)(this,"notTrimmedIndexesCache",[]),(0,s.default)(this,"notHiddenIndexesCache",[]),(0,s.default)(this,"isBatched",!1),(0,s.default)(this,"indexesSequenceChanged",!1),(0,s.default)(this,"indexesChangeSource",void 0),(0,s.default)(this,"trimmedIndexesChanged",!1),(0,s.default)(this,"hiddenIndexesChanged",!1),(0,s.default)(this,"renderablePhysicalIndexesCache",[]),(0,s.default)(this,"fromPhysicalToVisualIndexesCache",new Map),(0,s.default)(this,"fromVisualToRenderableIndexesCache",new Map),this.indexesSequence.addLocalHook("change",(()=>{this.indexesSequenceChanged=!0,this.updateCache(),this.runLocalHooks("indexesSequenceChange",this.indexesChangeSource),this.runLocalHooks("change",this.indexesSequence,null)})),this.trimmingMapsCollection.addLocalHook("change",(e=>{this.trimmedIndexesChanged=!0,this.updateCache(),this.runLocalHooks("change",e,this.trimmingMapsCollection)})),this.hidingMapsCollection.addLocalHook("change",(e=>{this.hiddenIndexesChanged=!0,this.updateCache(),this.runLocalHooks("change",e,this.hidingMapsCollection)})),this.variousMapsCollection.addLocalHook("change",(e=>{this.runLocalHooks("change",e,this.variousMapsCollection)}))}suspendOperations(){this.isBatched=!0}resumeOperations(){this.isBatched=!1,this.updateCache()}createChangesObserver(e){if("hiding"!==e)throw new Error(`Unsupported index map type "${e}".`);return this.hidingChangesObservable.createObserver()}createAndRegisterIndexMap(e,t,r){return this.registerMap(e,(0,o.createIndexMap)(t,r))}registerMap(e,t){if(this.trimmingMapsCollection.get(e)||this.hidingMapsCollection.get(e)||this.variousMapsCollection.get(e))throw Error(`Map with name "${e}" has been already registered.`);t instanceof o.TrimmingMap?this.trimmingMapsCollection.register(e,t):t instanceof o.HidingMap?this.hidingMapsCollection.register(e,t):this.variousMapsCollection.register(e,t);const r=this.getNumberOfIndexes();return r>0&&t.init(r),t}unregisterMap(e){this.trimmingMapsCollection.unregister(e),this.hidingMapsCollection.unregister(e),this.variousMapsCollection.unregister(e)}unregisterAll(){this.trimmingMapsCollection.unregisterAll(),this.hidingMapsCollection.unregisterAll(),this.variousMapsCollection.unregisterAll()}getPhysicalFromVisualIndex(e){const t=this.notTrimmedIndexesCache[e];return(0,u.isDefined)(t)?t:null}getPhysicalFromRenderableIndex(e){const t=this.renderablePhysicalIndexesCache[e];return(0,u.isDefined)(t)?t:null}getVisualFromPhysicalIndex(e){const t=this.fromPhysicalToVisualIndexesCache.get(e);return(0,u.isDefined)(t)?t:null}getVisualFromRenderableIndex(e){return this.getVisualFromPhysicalIndex(this.getPhysicalFromRenderableIndex(e))}getRenderableFromVisualIndex(e){const t=this.fromVisualToRenderableIndexesCache.get(e);return(0,u.isDefined)(t)?t:null}getNearestNotHiddenIndex(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(null===this.getPhysicalFromVisualIndex(e))return null;if(this.fromVisualToRenderableIndexesCache.has(e))return e;const n=Array.from(this.fromVisualToRenderableIndexesCache.keys());let s=-1;return s=t>0?n.findIndex((t=>t>e)):n.reverse().findIndex((t=>t0&&void 0!==arguments[0]?arguments[0]:this.getNumberOfIndexes();this.notTrimmedIndexesCache=[...new Array(e).keys()],this.notHiddenIndexesCache=[...new Array(e).keys()],this.suspendOperations(),this.indexesChangeSource="init",this.indexesSequence.init(e),this.indexesChangeSource=void 0,this.trimmingMapsCollection.initEvery(e),this.resumeOperations(),this.suspendOperations(),this.hidingMapsCollection.initEvery(e),this.variousMapsCollection.initEvery(e),this.resumeOperations(),this.runLocalHooks("init")}fitToLength(e){const t=this.getNumberOfIndexes();if(et+e));this.removeIndexes(t)}else this.insertIndexes(t,e-t)}getIndexesSequence(){return this.indexesSequence.getValues()}setIndexesSequence(e){void 0===this.indexesChangeSource&&(this.indexesChangeSource="update"),this.indexesSequence.setValues(e),"update"===this.indexesChangeSource&&(this.indexesChangeSource=void 0)}getNotTrimmedIndexes(){if(!0===(!(arguments.length>0&&void 0!==arguments[0])||arguments[0]))return this.notTrimmedIndexesCache;return this.getIndexesSequence().filter((e=>!1===this.isTrimmed(e)))}getNotTrimmedIndexesLength(){return this.getNotTrimmedIndexes().length}getNotHiddenIndexes(){if(!0===(!(arguments.length>0&&void 0!==arguments[0])||arguments[0]))return this.notHiddenIndexesCache;return this.getIndexesSequence().filter((e=>!1===this.isHidden(e)))}getNotHiddenIndexesLength(){return this.getNotHiddenIndexes().length}getRenderableIndexes(){if(!0===(!(arguments.length>0&&void 0!==arguments[0])||arguments[0]))return this.renderablePhysicalIndexesCache;return this.getNotTrimmedIndexes().filter((e=>!1===this.isHidden(e)))}getRenderableIndexesLength(){return this.getRenderableIndexes().length}getNumberOfIndexes(){return this.getIndexesSequence().length}moveIndexes(e,t){"number"==typeof e&&(e=[e]);const r=(0,i.arrayMap)(e,(e=>this.getPhysicalFromVisualIndex(e))),n=this.getNotTrimmedIndexesLength(),s=e.length,a=(0,o.getListWithRemovedItems)(this.getIndexesSequence(),r),l=a.filter((e=>!1===this.isTrimmed(e)));let h=a.indexOf(l[l.length-1])+1;if(t+se+t));this.suspendOperations(),this.indexesChangeSource="insert",this.indexesSequence.insert(s,o),this.indexesChangeSource=void 0,this.trimmingMapsCollection.insertToEvery(s,o),this.hidingMapsCollection.insertToEvery(s,o),this.variousMapsCollection.insertToEvery(s,o),this.resumeOperations()}removeIndexes(e){this.suspendOperations(),this.indexesChangeSource="remove",this.indexesSequence.remove(e),this.indexesChangeSource=void 0,this.trimmingMapsCollection.removeFromEvery(e),this.hidingMapsCollection.removeFromEvery(e),this.variousMapsCollection.removeFromEvery(e),this.resumeOperations()}updateCache(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=this.indexesSequenceChanged||this.trimmedIndexesChanged||this.hiddenIndexesChanged;(!0===e||!1===this.isBatched&&!0===t)&&(this.trimmingMapsCollection.updateCache(),this.hidingMapsCollection.updateCache(),this.notTrimmedIndexesCache=this.getNotTrimmedIndexes(!1),this.notHiddenIndexesCache=this.getNotHiddenIndexes(!1),this.renderablePhysicalIndexesCache=this.getRenderableIndexes(!1),this.cacheFromPhysicalToVisualIndexes(),this.cacheFromVisualToRenderableIndexes(),this.hiddenIndexesChanged&&this.hidingChangesObservable.emit(this.hidingMapsCollection.getMergedValues()),this.runLocalHooks("cacheUpdated",{indexesSequenceChanged:this.indexesSequenceChanged,trimmedIndexesChanged:this.trimmedIndexesChanged,hiddenIndexesChanged:this.hiddenIndexesChanged}),this.indexesSequenceChanged=!1,this.trimmedIndexesChanged=!1,this.hiddenIndexesChanged=!1)}cacheFromPhysicalToVisualIndexes(){const e=this.getNotTrimmedIndexesLength();this.fromPhysicalToVisualIndexesCache.clear();for(let t=0;t{"use strict";var n=r(96784);t.__esModule=!0,r(15724);var s=n(r(85707)),i=r(47675),o=r(10587),a=r(70505);class l extends i.MapCollection{constructor(e,t){super(),(0,s.default)(this,"mergedValuesCache",[]),(0,s.default)(this,"aggregationFunction",void 0),(0,s.default)(this,"fallbackValue",void 0),this.aggregationFunction=e,this.fallbackValue=t}getMergedValues(){if(!0===(!(arguments.length>0&&void 0!==arguments[0])||arguments[0]))return this.mergedValuesCache;if(0===this.getLength())return[];const e=(0,o.arrayMap)(this.get(),(e=>e.getValues())),t=[],r=(0,a.isDefined)(e[0])&&e[0].length||0;for(let n=0;n{"use strict";r(14846),r(69655),t.__esModule=!0;var n=r(21928);Object.keys(n).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===n[e]||(t[e]=n[e]))}));var s=r(47675);Object.keys(s).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===s[e]||(t[e]=s[e]))}))},47675:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,t.getRegisteredMapsCounter=function(){return l},r(14846),r(69655);var s=n(r(85707)),i=r(70505),o=r(25499),a=n(r(16050));let l=0;class h{constructor(){(0,s.default)(this,"collection",new Map)}register(e,t){!1===this.collection.has(e)&&(this.collection.set(e,t),t.addLocalHook("change",(()=>this.runLocalHooks("change",t))),l+=1)}unregister(e){const t=this.collection.get(e);(0,i.isDefined)(t)&&(t.destroy(),this.collection.delete(e),this.runLocalHooks("change",t),l-=1)}unregisterAll(){this.collection.forEach(((e,t)=>this.unregister(t))),this.collection.clear()}get(e){return(0,i.isUndefined)(e)?Array.from(this.collection.values()):this.collection.get(e)}getLength(){return this.collection.size}removeFromEvery(e){this.collection.forEach((t=>{t.remove(e)}))}insertToEvery(e,t){this.collection.forEach((r=>{r.insert(e,t)}))}initEvery(e){this.collection.forEach((t=>{t.init(e)}))}}t.MapCollection=h,(0,o.mixin)(h,a.default)},72810:(e,t,r)=>{"use strict";t.__esModule=!0,r(15724);var n=r(15898),s=r(10587);class i extends n.PhysicalIndexToValueMap{constructor(){super(arguments.length>0&&void 0!==arguments[0]&&arguments[0])}getHiddenIndexes(){return(0,s.arrayReduce)(this.getValues(),((e,t,r)=>(t&&e.push(r),e)),[])}}t.HidingMap=i},74761:(e,t,r)=>{"use strict";r(14846),r(69655),t.__esModule=!0;var n={createIndexMap:!0,HidingMap:!0,IndexMap:!0,LinkedPhysicalIndexToValueMap:!0,PhysicalIndexToValueMap:!0,TrimmingMap:!0};t.createIndexMap=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!c.has(e))throw new Error(`The provided map type ("${e}") does not exist.`);return new(c.get(e))(t)},r(67834);var s=r(72810);t.HidingMap=s.HidingMap;var i=r(17783);t.IndexMap=i.IndexMap;var o=r(38189);t.LinkedPhysicalIndexToValueMap=o.LinkedPhysicalIndexToValueMap;var a=r(15898);t.PhysicalIndexToValueMap=a.PhysicalIndexToValueMap;var l=r(90008);t.TrimmingMap=l.TrimmingMap;var h=r(70836);Object.keys(h).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||e in t&&t[e]===h[e]||(t[e]=h[e]))}));var u=r(18046);Object.keys(u).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||e in t&&t[e]===u[e]||(t[e]=u[e]))}));const c=new Map([["hiding",s.HidingMap],["index",i.IndexMap],["linkedPhysicalIndexToValue",o.LinkedPhysicalIndexToValueMap],["physicalIndexToValue",a.PhysicalIndexToValueMap],["trimming",l.TrimmingMap]])},17783:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(15724);var s=n(r(85707)),i=r(22137),o=r(25499),a=r(89804),l=n(r(16050));class h{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;(0,s.default)(this,"indexedValues",[]),(0,s.default)(this,"initValueOrFn",void 0),this.initValueOrFn=e}getValues(){return this.indexedValues}getValueAtIndex(e){const t=this.indexedValues;if(e0&&void 0!==arguments[0]?arguments[0]:this.indexedValues.length;this.indexedValues.length=0,(0,a.isFunction)(this.initValueOrFn)?(0,i.rangeEach)(e-1,(e=>this.indexedValues.push(this.initValueOrFn(e)))):(0,i.rangeEach)(e-1,(()=>this.indexedValues.push(this.initValueOrFn))),this.runLocalHooks("change")}init(e){return this.setDefaultValues(e),this.runLocalHooks("init"),this}insert(){this.runLocalHooks("change")}remove(){this.runLocalHooks("change")}destroy(){this.clearLocalHooks(),this.indexedValues=null,this.initValueOrFn=null}}t.IndexMap=h,(0,o.mixin)(h,l.default)},70836:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(17783),s=r(18046),i=r(88795);class o extends n.IndexMap{constructor(){super((e=>e))}insert(e,t){const r=(0,i.getIncreasedIndexes)(this.indexedValues,t);this.indexedValues=(0,s.getListWithInsertedItems)(r,e,t),super.insert(e,t)}remove(e){const t=(0,s.getListWithRemovedItems)(this.indexedValues,e);this.indexedValues=(0,i.getDecreasedIndexes)(t,e),super.remove(e)}}t.IndexesSequence=o},38189:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(94364);var s=n(r(85707)),i=r(17783),o=r(4440),a=r(18046),l=r(15501),h=r(89804);class u extends i.IndexMap{constructor(){super(...arguments),(0,s.default)(this,"orderOfIndexes",[])}getValues(){return this.orderOfIndexes.map((e=>this.indexedValues[e]))}setValues(e){this.orderOfIndexes=[...Array(e.length).keys()],super.setValues(e)}setValueAtIndex(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.orderOfIndexes.length;return e0&&void 0!==arguments[0]?arguments[0]:this.indexedValues.length;this.orderOfIndexes.length=0,super.setDefaultValues(e)}insert(e,t){this.indexedValues=(0,o.getListWithInsertedItems)(this.indexedValues,e,t,this.initValueOrFn),this.orderOfIndexes=(0,l.getIncreasedIndexes)(this.orderOfIndexes,t),super.insert(e,t)}remove(e){this.indexedValues=(0,o.getListWithRemovedItems)(this.indexedValues,e),this.orderOfIndexes=(0,a.getListWithRemovedItems)(this.orderOfIndexes,e),this.orderOfIndexes=(0,l.getDecreasedIndexes)(this.orderOfIndexes,e),super.remove(e)}getEntries(){return this.orderOfIndexes.map((e=>[e,this.getValueAtIndex(e)]))}}t.LinkedPhysicalIndexToValueMap=u},15898:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(17783),s=r(4440);class i extends n.IndexMap{insert(e,t){this.indexedValues=(0,s.getListWithInsertedItems)(this.indexedValues,e,t,this.initValueOrFn),super.insert(e,t)}remove(e){this.indexedValues=(0,s.getListWithRemovedItems)(this.indexedValues,e),super.remove(e)}}t.PhysicalIndexToValueMap=i},90008:(e,t,r)=>{"use strict";t.__esModule=!0,r(15724);var n=r(15898),s=r(10587);class i extends n.PhysicalIndexToValueMap{constructor(){super(arguments.length>0&&void 0!==arguments[0]&&arguments[0])}getTrimmedIndexes(){return(0,s.arrayReduce)(this.getValues(),((e,t,r)=>(t&&e.push(r),e)),[])}}t.TrimmingMap=i},15501:(e,t,r)=>{"use strict";t.__esModule=!0,t.getDecreasedIndexes=function(e,t){return(0,n.arrayMap)(e,(e=>e-t.filter((t=>te>=r?e+s:e))},r(14846),r(27458);var n=r(10587)},88795:(e,t,r)=>{"use strict";t.__esModule=!0,r(67834);var n=r(15501);t.getDecreasedIndexes=n.getDecreasedIndexes,t.getIncreasedIndexes=n.getIncreasedIndexes;var s=r(18046),i=r(4440);const o=new Map([["indexesSequence",{getListWithInsertedItems:s.getListWithInsertedItems,getListWithRemovedItems:s.getListWithRemovedItems}],["physicallyIndexed",{getListWithInsertedItems:i.getListWithInsertedItems,getListWithRemovedItems:i.getListWithRemovedItems}]]);t.alterUtilsFactory=e=>{if(!1===o.has(e))throw new Error(`Alter strategy with ID '${e}' does not exist.`);return o.get(e)}},18046:(e,t,r)=>{"use strict";t.__esModule=!0,t.getListWithInsertedItems=function(e,t,r){return[...e.slice(0,t),...r,...e.slice(t)]},t.getListWithRemovedItems=function(e,t){return(0,n.arrayFilter)(e,(e=>!1===t.includes(e)))};var n=r(10587)},4440:(e,t,r)=>{"use strict";t.__esModule=!0,t.getListWithInsertedItems=function(e,t,r,s){const i=r.length?r[0]:void 0;return[...e.slice(0,i),...r.map(((e,t)=>(0,n.isFunction)(s)?s(e,t):s)),...void 0===i?[]:e.slice(i)]},t.getListWithRemovedItems=function(e,t){return(0,s.arrayFilter)(e,((e,r)=>!1===t.includes(r)))},r(94364);var n=r(89804),s=r(10587)},17207:(e,t)=>{"use strict";function r(e,t,r){e.addEventListener(t,r,!1)}function n(e,t,r){e.removeEventListener(t,r,!1)}function s(e){return e.ownerDocument.defaultView.getComputedStyle(e)}t.__esModule=!0,t.createInputElementResizer=function(e){const t={minHeight:200,maxHeight:300,minWidth:100,maxWidth:300,textContent:e=>e.value,...arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}},i=e.body,o=e.createTextNode(""),a=e.createElement("span");let l;function h(){var e,r;o.textContent=t.textContent(l),a.style.position="absolute",a.style.fontSize=s(l).fontSize,a.style.fontFamily=s(l).fontFamily,a.style.whiteSpace="pre",i.appendChild(a);const n=parseInt((null===(e=s(l))||void 0===e?void 0:e.paddingInlineStart)||0,10),h=parseInt((null===(r=s(l))||void 0===r?void 0:r.paddingInlineEnd)||0,10),u=a.clientWidth+n+h+1;i.removeChild(a);const c=l.style;c.height=`${t.minHeight}px`,t.minWidth>u?c.width=`${t.minWidth}px`:u>t.maxWidth?c.width=`${t.maxWidth}px`:c.width=`${u}px`;const d=l.scrollHeight?l.scrollHeight-1:0;t.minHeight>d?c.height=`${t.minHeight}px`:t.maxHeight2&&void 0!==arguments[2]&&arguments[2];l=e,function(e){if(e&&e.minHeight)if("inherit"===e.minHeight)t.minHeight=l.clientHeight;else{const r=parseInt(e.minHeight,10);isNaN(r)||(t.minHeight=r)}if(e&&e.maxHeight)if("inherit"===e.maxHeight)t.maxHeight=l.clientHeight;else{const r=parseInt(e.maxHeight,10);isNaN(r)||(t.maxHeight=r)}if(e&&e.minWidth)if("inherit"===e.minWidth)t.minWidth=l.clientWidth;else{const r=parseInt(e.minWidth,10);isNaN(r)||(t.minWidth=r)}if(e&&e.maxWidth)if("inherit"===e.maxWidth)t.maxWidth=l.clientWidth;else{const r=parseInt(e.maxWidth,10);isNaN(r)||(t.maxWidth=r)}a.firstChild||(a.className="autoResize",a.style.display="inline-block",a.appendChild(o))}(n),"TEXTAREA"===l.nodeName&&(l.style.resize="none",l.style.height=`${t.minHeight}px`,l.style.minWidth=`${t.minWidth}px`,l.style.maxWidth=`${t.maxWidth}px`,l.style.overflowY="hidden"),s&&(r(l,"input",h),r(l,"keydown",u)),h()},resize:h,unObserve(){n(l,"input",h),n(l,"keydown",u)}}}},30480:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0;var s=n(r(85707));class i{constructor(e){(0,s.default)(this,"data",void 0),(0,s.default)(this,"next",null),(0,s.default)(this,"prev",null),this.data=e}}t.NodeStructure=i;t.default=class{constructor(){(0,s.default)(this,"first",null),(0,s.default)(this,"last",null)}push(e){const t=new i(e);if(null===this.first)this.first=t,this.last=t;else{const e=this.last;this.last=t,t.prev=e,e.next=t}return t}unshift(e){const t=new i(e);if(null===this.first)this.first=t,this.last=t;else{const e=this.first;this.first=t,t.next=e,e.prev=t}}inorder(e){let t=this.first;for(;t;){const r=e(t);if(t===this.last||!0===r)break;t=t.next}}remove(e){if(null===this.first)return!1;let t,r,n=this.first;for(;n;){if(n.data===e)return t=n.next,r=n.prev,t&&(t.prev=r),r&&(r.next=t),n===this.first&&(this.first=t),n===this.last&&(this.last=r),!0;n=n.next}return!1}hasCycle(){let e=this.first,t=this.first;for(;;){if(null===e)return!1;if(e=e.next,null===e)return!1;if(e=e.next,t=t.next,e===t)return!0}}pop(){if(null===this.last)return null;const e=this.last;return this.last=this.last.prev,e}shift(){if(null===this.first)return null;const e=this.first;return this.first=this.first.next,e}recursiveReverse(){if(!this.first)return;!function e(t,r){r&&(e(r,r.next),r.next=t)}(this.first,this.first.next),this.first.next=null;const e=this.first;this.first=this.last,this.last=e}reverse(){if(!this.first||!this.first.next)return;let e,t=this.first.next,r=this.first;for(;t;)e=t.next,t.next=r,r.prev=t,r=t,t=e;this.first.next=null,this.last.prev=null,e=this.first,this.first=r,this.last=e}}},38439:(e,t,r)=>{"use strict";t.__esModule=!0,t.createPriorityMap=function(){let{errorPriorityExists:e,errorPriorityNaN:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=new Map;return e=(0,s.isFunction)(e)?e:l,t=(0,s.isFunction)(t)?t:h,{addItem:function(s,i){if(!(0,n.isNumeric)(s))throw new Error(t(s));if(r.has(s))throw new Error(e(s));r.set(s,i)},getItems:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i;const[t,n]=a.get(e)||a.get(i);return[...r].sort(((e,r)=>e[0]e[1]))}}},r(67834),r(94364);var n=r(22137),s=r(89804);const i=t.ASC="asc",o=t.DESC="desc",a=new Map([[i,[-1,1]],[o,[1,-1]]]),l=e=>`The priority '${e}' is already declared in a map.`,h=e=>`The priority '${e}' is not a number.`},51097:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,t.depthFirstPreOrder=o;var s=n(r(85707));r(67834),r(15724);const i=t.TRAVERSAL_DF_PRE="DF-pre-order";function o(e,t){let r=e.call(t,this);for(let n=0;n0&&void 0!==arguments[0]?arguments[0]:this;const t=new c({...e.data});for(let r=0;r1&&void 0!==arguments[1]?arguments[1]:h;if(!u.has(t))throw new Error(`Traversal strategy "${t}" does not exist`);u.get(t).call(this,e,this)}walkUp(e){const t=this,r=n=>{!1!==e.call(t,n)&&null!==n.parent&&r(n.parent)};r(this)}}t.default=c},54394:(e,t,r)=>{"use strict";t.__esModule=!0,t.createUniqueMap=function(){let{errorIdExists:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=new Map;function r(){return[...t]}function i(e){return t.has(e)}return e=(0,n.isFunction)(e)?e:s,{addItem:function(r,n){if(i(r))throw new Error(e(r));t.set(r,n)},clear:function(){t.clear()},getId:function(e){const[t]=r().find((t=>{let[r,n]=t;return e===n&&r}))||[null];return t},getItem:function(e){return t.get(e)},getItems:r,hasItem:i,removeItem:function(e){return t.delete(e)}}},r(67834),r(14846),r(6211);var n=r(89804);const s=e=>`The id '${e}' is already declared in a map.`},74784:(e,t,r)=>{"use strict";t.__esModule=!0,t.createUniqueSet=function(){let{errorItemExists:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=new Set;return e=(0,n.isFunction)(e)?e:s,{addItem:function(r){if(t.has(r))throw new Error(e(r));t.add(r)},clear:function(){t.clear()},getItems:function(){return[...t]}}},r(67834),r(71336),r(41558),r(17663),r(68630),r(79645),r(89858),r(8620);var n=r(89804);const s=e=>`'${e}' value is already declared in a unique set.`},4965:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834),r(15724),r(14846),r(69655);var s=n(r(85707)),i=r(62577),o=r(10587);t.default=class{constructor(e){(0,s.default)(this,"hot",null),(0,s.default)(this,"container",null),(0,s.default)(this,"injected",!1),(0,s.default)(this,"rows",[]),(0,s.default)(this,"columns",[]),(0,s.default)(this,"samples",null),(0,s.default)(this,"settings",{useHeaders:!0}),this.hot=e}addRow(e,t){if(this.columns.length)throw new Error("Doesn't support multi-dimensional table");this.rows.length||(this.container=this.createContainer(this.hot.rootElement.className));const r={row:e};this.rows.push(r),this.samples=t,this.table=this.createTable(this.hot.table.className),this.table.colGroup.appendChild(this.createColGroupsCol(e)),this.table.tr.appendChild(this.createRow(e)),this.container.container.appendChild(this.table.fragment),r.table=this.table.table}addColumnHeadersRow(e){const t=this.hot.getColHeader(0);if(null!=t){const t={row:-1};this.rows.push(t),this.container=this.createContainer(this.hot.rootElement.className),this.samples=e,this.table=this.createTable(this.hot.table.className),this.table.colGroup.appendChild(this.createColGroupsCol()),this.appendColumnHeadersRow(),this.container.container.appendChild(this.table.fragment),t.table=this.table.table}}addColumn(e,t){if(this.rows.length)throw new Error("Doesn't support multi-dimensional table");this.columns.length||(this.container=this.createContainer(this.hot.rootElement.className));const r={col:e};this.columns.push(r),this.samples=t,this.table=this.createTable(this.hot.table.className),this.getSetting("useHeaders")&&null!==this.hot.getColHeader(e)&&this.hot.view.appendColHeader(e,this.table.th,void 0,-1),this.table.tBody.appendChild(this.createCol(e)),this.container.container.appendChild(this.table.fragment),r.table=this.table.table}getHeights(e){this.injected||this.injectTable(),(0,o.arrayEach)(this.rows,(t=>{const{height:r}=t.table.getBoundingClientRect();e(t.row,Math.ceil(r))}))}getWidths(e){this.injected||this.injectTable(),(0,o.arrayEach)(this.columns,(t=>{const{width:r}=t.table.getBoundingClientRect();e(t.col,Math.ceil(r))}))}setSettings(e){this.settings=e}setSetting(e,t){this.settings||(this.settings={}),this.settings[e]=t}getSettings(){return this.settings}getSetting(e){return this.settings?this.settings[e]:null}createColGroupsCol(e){const t=this.hot.rootDocument.createDocumentFragment();return this.hot.hasRowHeaders()&&t.appendChild(this.createColElement(-1,-1)),this.samples.forEach((r=>{(0,o.arrayEach)(r.strings,(r=>{t.appendChild(this.createColElement(r.col,e))}))})),t}createRow(e){const{rootDocument:t}=this.hot,r=t.createDocumentFragment(),n=t.createElement("th");return this.hot.hasRowHeaders()&&(this.hot.view.appendRowHeader(e,n),r.appendChild(n)),this.samples.forEach((n=>{(0,o.arrayEach)(n.strings,(n=>{const s=n.col,i=this.hot.getCellMeta(e,s),o=this.hot.getCellRenderer(i),a=t.createElement("td");a.setAttribute("ghost-table",1),o(this.hot,a,e,s,this.hot.colToProp(s),n.value,i),r.appendChild(a)}))})),r}appendColumnHeadersRow(){const{rootDocument:e}=this.hot,t=e.createDocumentFragment(),r=[];if(this.hot.hasRowHeaders()){const n=e.createElement("th");r.push([-1,n]),t.appendChild(n)}this.samples.forEach((n=>{(0,o.arrayEach)(n.strings,(n=>{const s=n.col,i=e.createElement("th");r.push([s,i]),t.appendChild(i)}))})),this.table.tHead.appendChild(t),(0,o.arrayEach)(r,(e=>{const[t,r]=e;this.hot.view.appendColHeader(t,r)}))}createCol(e){const{rootDocument:t}=this.hot,r=t.createDocumentFragment();return this.samples.forEach((n=>{(0,o.arrayEach)(n.strings,(n=>{const s=n.row,i=this.hot.getCellMeta(s,e),o=this.hot.getCellRenderer(i),a=t.createElement("td"),l=t.createElement("tr");a.setAttribute("ghost-table",1),o(this.hot,a,s,e,this.hot.colToProp(e),n.value,i),l.appendChild(a),r.appendChild(l)}))})),r}clean(){this.rows.length=0,this.rows[-1]=void 0,this.columns.length=0,this.samples&&this.samples.clear(),this.samples=null,this.removeTable()}injectTable(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.injected||((e||this.hot.rootElement).appendChild(this.container.fragment),this.injected=!0)}removeTable(){this.injected&&this.container.container.parentNode&&(this.container.container.parentNode.removeChild(this.container.container),this.container=null,this.injected=!1)}createColElement(e,t){const r=this.hot.rootDocument.createElement("col");let n=0;t>=0&&e>=0&&(n=this.hot.getCellMeta(t,e).colspan);let s=this.hot.getColWidth(e);if(n>1)for(let t=e+1;t0&&void 0!==arguments[0]?arguments[0]:"";const{rootDocument:t}=this.hot,r=t.createDocumentFragment(),n=t.createElement("table"),s=t.createElement("thead"),o=t.createElement("tbody"),a=t.createElement("colgroup"),l=t.createElement("tr"),h=t.createElement("th");return this.isVertical()&&n.appendChild(a),this.isHorizontal()&&(l.appendChild(h),s.appendChild(l),n.style.tableLayout="auto",n.style.width="auto"),n.appendChild(s),this.isVertical()&&o.appendChild(l),n.appendChild(o),(0,i.addClass)(n,e),r.appendChild(n),{fragment:r,table:n,tHead:s,tBody:o,colGroup:a,tr:l,th:h}}createContainer(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const{rootDocument:t}=this.hot,r=t.createDocumentFragment(),n=t.createElement("div"),s=`htGhostTable htAutoSize ${e.trim()}`;return(0,i.addClass)(n,s),r.appendChild(n),{fragment:r,container:n}}isVertical(){return!(!this.rows.length||this.columns.length)}isHorizontal(){return!(!this.columns.length||this.rows.length)}}},27453:(e,t,r)=>{"use strict";t.__esModule=!0,t.createPaginator=function(e){let{initialPage:t=-1,size:r=()=>0,onItemSelect:s=()=>{},onClear:i=()=>{}}=e;const o=new Set;let a=(0,n.clamp)(t,-1,h()-1);function l(e,t){const r=h()-1;if(e<0&&(e=r),e>r&&(e=0),o.has(e))return-1;o.add(e);return!1===s(e,!1)&&(e=l(1===t?++e:--e,t)),e}function h(){return Math.max(r(),0)}return{setCurrentPage:function(e){e>-1&&e0&&(o.clear(),a=l(0,1))},toLastItem:function(){h()>0&&(o.clear(),a=l(h()-1,-1))},toNextItem:function(){h()>0&&(o.clear(),a=l(++a,1))},toPreviousItem:function(){h()>0&&(o.clear(),a=l(--a,-1))},getSize:h,clear:function(){o.clear(),a=t,i()}}},r(71336),r(41558),r(17663),r(68630),r(79645),r(89858),r(8620);var n=r(22137)},96173:(e,t,r)=>{"use strict";t.__esModule=!0,t._dataToHTML=function(e){const t=e.length,r=[""];for(let s=0;s");for(let e=0;e/g,">").replace(/((\r\n|\n)?|\r\n|\n)/g,"
\r\n").replace(/\x20{2,}/gi,(e=>`${" ".repeat(e.length-1)} `)).replace(/\t/gi," ");a.push(`
`)}r.push("",...a,""),s+1===t&&r.push("")}return r.push("
${r}
"),r.join("")},t.htmlToGridSettings=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;const r={},n=t.createDocumentFragment(),o=t.createElement("div");n.appendChild(o);let a=e;if("string"==typeof a){const e=a.replace(/]*?>([\s\S]*?)<\/\s*td>/g,(e=>{const t=e.match(/]*?>/g)[0];return`${t}${e.substring(t.length,e.lastIndexOf("<")).trim().replaceAll(/\n\s+/g," ").replaceAll(//g,"\n").replace("\n","").replaceAll(/<\/(.*)>\s+$/gm,"").replace(/(<(?!br)([^>]+)>)/gi,"").replaceAll(/^ $/gm,"")}`}));o.insertAdjacentHTML("afterbegin",`${e}`),a=o.querySelector("table")}if(!a||!function(e){return"TABLE"===(e&&e.nodeName||"")}(a))return;const l=o.querySelector('meta[name$="enerator"]'),h=null!==a.querySelector("tbody th"),u=a.querySelector("tr"),c=u?Array.from(u.cells).reduce(((e,t)=>e+t.colSpan),0)-(h?1:0):0,d=a.tFoot&&Array.from(a.tFoot.rows)||[],p=[];let g=!1,f=0,m=0;if(a.tHead){const e=Array.from(a.tHead.rows).filter((e=>{const t=null!==e.querySelector("td");return t&&p.push(e),!t}));f=e.length,g=f>0,f>1?r.nestedHeaders=Array.from(e).reduce(((e,t)=>{const r=Array.from(t.cells).reduce(((e,t,r)=>{if(h&&0===r)return e;const{colSpan:n,innerHTML:s}=t,i=n>1?{label:s,colspan:n}:s;return e.push(i),e}),[]);return e.push(r),e}),[]):g&&(r.colHeaders=Array.from(e[0].children).reduce(((e,t,r)=>(h&&0===r||e.push(t.innerHTML),e)),[]))}p.length&&(r.fixedRowsTop=p.length);d.length&&(r.fixedRowsBottom=d.length);const y=[...p,...Array.from(a.tBodies).reduce(((e,t)=>(e.push(...Array.from(t.rows)),e)),[]),...d];m=y.length;const E=new Array(m);for(let e=0;evoid 0===e));if("TD"===o){if(h>1||u>1){for(let t=e;t[\r\n]?[\x20]{0,3}/gim,"\r\n"):a.replace(/[\r\n]?/gim,"\r\n"),E[e][c]=t.replace(i,(e=>s[e]))}else C.push(a)}}w.length&&(r.mergeCells=w);C.length&&(r.rowHeaders=C);E.length&&(r.data=E);return r},t.instanceToHTML=function(e){const t=e.hasColHeaders(),r=e.hasRowHeaders(),s=[t?-1:0,r?-1:0,e.countRows()-1,e.countCols()-1],i=e.getData(...s),o=i.length,a=o>0?i[0].length:0,l=["","
"],h=t?["",""]:[],u=["",""],c=r?1:0,d=t?1:0;for(let s=0;s${e.getColHeader(t-c)}`;else if(a)h=`${e.getRowHeader(s-d)}`;else{const r=i[s][t],{hidden:o,rowspan:a,colspan:l}=e.getCellMeta(s-d,t-c);if(!o){const e=[];if(a&&e.push(`rowspan="${a}"`),l&&e.push(`colspan="${l}"`),(0,n.isEmpty)(r))h=``;else{const t=r.toString().replace(//g,">").replace(/((\r\n|\n)?|\r\n|\n)/g,"
\r\n").replace(/\x20/gi," ").replace(/\t/gi," ");h=`${t}`}}}l.push(h)}const p=["",...l,""].join("");o?h.splice(1,0,p):u.splice(-1,0,p)}return l.splice(1,0,h.join(""),u.join("")),l.join("")},r(15724),r(64552),r(14846),r(27458),r(94364),r(90458);var n=r(70505);const s={" ":" ","&":"&","<":"<",">":">"},i=new RegExp(Object.keys(s).map((e=>`(${e})`)).join("|"),"gi")},45435:(e,t)=>{"use strict";t.__esModule=!0,t.hasValidParameter=function(e){return e===n},t.isRootInstance=function(e){return r.has(e)},t.registerAsRootInstance=function(e){r.set(e,!0)};const r=t.holder=new WeakMap,n=t.rootInstanceSymbol=Symbol("rootInstance")},93968:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,r(67834),r(15724);var s=n(r(85707)),i=r(25499),o=r(22137),a=r(70505);class l{static get SAMPLE_COUNT(){return 3}constructor(e){(0,s.default)(this,"samples",null),(0,s.default)(this,"dataFactory",null),(0,s.default)(this,"customSampleCount",null),(0,s.default)(this,"allowDuplicates",!1),this.dataFactory=e}getSampleCount(){return this.customSampleCount?this.customSampleCount:l.SAMPLE_COUNT}setSampleCount(e){this.customSampleCount=e}setAllowDuplicates(e){this.allowDuplicates=e}generateRowSamples(e,t){return this.generateSamples("row",t,e)}generateColumnSamples(e,t){return this.generateSamples("col",t,e)}generateSamples(e,t,r){const n=new Map,{from:s,to:i}="number"==typeof r?{from:r,to:r}:r;return(0,o.rangeEach)(s,i,(r=>{const s=this.generateSample(e,t,r);n.set(r,s)})),n}generateSample(e,t,r){if("row"!==e&&"col"!==e)throw new Error("Unsupported sample type");const n=new Map,s="row"===e?"col":"row",l=[];return(0,o.rangeEach)(t.from,t.to,(t=>{const o="row"===e?this.dataFactory(r,t):this.dataFactory(t,r);if(!1===o)return;const{value:h,bundleSeed:u}=o,c="string"==typeof u&&u.length>0;let d;d=c?u:(0,i.isObject)(h)?`${Object.keys(h).length}`:Array.isArray(h)?`${h.length}`:`${(0,a.stringify)(h).length}`,n.has(d)||n.set(d,{needed:this.getSampleCount(),strings:[]});const p=n.get(d);if(p.needed){(!(l.indexOf(h)>-1)||this.allowDuplicates||c)&&(p.strings.push({value:h,[s]:t}),l.push(h),p.needed-=1)}})),n}}t.default=l},28651:(e,t)=>{"use strict";t.__esModule=!0,t.default=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"common";r.has(e)||r.set(e,new Map);const t=r.get(e);return{register:function(e,r){t.set(e,r)},getItem:function(e){return t.get(e)},hasItem:function(e){return t.has(e)},getNames:function(){return[...t.keys()]},getValues:function(){return[...t.values()]}}};const r=t.collection=new Map},39385:(e,t)=>{"use strict";t.__esModule=!0,t.autocompleteValidator=n;const r=t.VALIDATOR_TYPE="autocomplete";function n(e,t){let r=e;null==r&&(r=""),this.allowEmpty&&""===r?t(!0):this.strict&&this.source?"function"==typeof this.source?this.source(r,s(r,t)):s(r,t)(this.source):t(!0)}function s(e,t){const r=e;return function(e){let n=!1;for(let t=0,s=e.length;t{"use strict";t.__esModule=!0;var n=r(39385);t.VALIDATOR_TYPE=n.VALIDATOR_TYPE,t.autocompleteValidator=n.autocompleteValidator},88993:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,t.correctFormat=u,t.dateValidator=h;var s=n(r(6671)),i=r(8266),o=r(16339),a=r(95976);const l=t.VALIDATOR_TYPE="date";function h(e,t){const r=(0,i.getEditorInstance)(o.EDITOR_TYPE,this.instance);let n=e,a=!0;null==n&&(n="");let l=(0,s.default)(n,this.dateFormat||r.defaultDateFormat,!0).isValid(),h=(0,s.default)(new Date(n)).isValid()||l;if(this.allowEmpty&&""===n&&(h=!0,l=!0),h||(a=!1),!h&&l&&(a=!0),h&&!l)if(!0===this.correctFormat){const e=u(n,this.dateFormat);this.instance.setDataAtCell(this.visualRow,this.visualCol,e,"dateValidator"),a=!0}else a=!1;t(a)}function u(e,t){const r=(0,s.default)((0,a.getNormalizedDate)(e)),n=(0,s.default)(e,t),i=e.search(/[A-Za-z]/g)>-1;let o;return o=r.isValid()&&r.format("x")===n.format("x")||!n.isValid()||i?r:n,o.format(t)}h.VALIDATOR_TYPE=l},5535:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(88993);t.VALIDATOR_TYPE=n.VALIDATOR_TYPE,t.correctFormat=n.correctFormat,t.dateValidator=n.dateValidator},5105:(e,t,r)=>{"use strict";t.__esModule=!0,t.dropdownValidator=i;var n=r(39385);const s=t.VALIDATOR_TYPE="dropdown";function i(e,t){n.autocompleteValidator.apply(this,[e,t])}i.VALIDATOR_TYPE=s},96:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(5105);t.VALIDATOR_TYPE=n.VALIDATOR_TYPE,t.dropdownValidator=n.dropdownValidator},41602:(e,t,r)=>{"use strict";t.__esModule=!0,t.registerAllValidators=function(){(0,l.registerValidator)(n.autocompleteValidator),(0,l.registerValidator)(i.dropdownValidator),(0,l.registerValidator)(s.dateValidator),(0,l.registerValidator)(o.numericValidator),(0,l.registerValidator)(a.timeValidator)};var n=r(25799);t.autocompleteValidator=n.autocompleteValidator,t.AUTOCOMPLETE_VALIDATOR=n.VALIDATOR_TYPE;var s=r(5535);t.dateValidator=s.dateValidator,t.DATE_VALIDATOR=s.VALIDATOR_TYPE;var i=r(96);t.dropdownValidator=i.dropdownValidator,t.DROPDOWN_VALIDATOR=i.VALIDATOR_TYPE;var o=r(48636);t.numericValidator=o.numericValidator,t.NUMERIC_VALIDATOR=o.VALIDATOR_TYPE;var a=r(68864);t.timeValidator=a.timeValidator,t.TIME_VALIDATOR=a.VALIDATOR_TYPE;var l=r(17027);t.registerValidator=l.registerValidator,t.getRegisteredValidatorNames=l.getRegisteredValidatorNames,t.getRegisteredValidators=l.getRegisteredValidators,t.getValidator=l.getValidator,t.hasValidator=l.hasValidator},48636:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(62365);t.VALIDATOR_TYPE=n.VALIDATOR_TYPE,t.numericValidator=n.numericValidator},62365:(e,t,r)=>{"use strict";t.__esModule=!0,t.numericValidator=i;var n=r(22137);const s=t.VALIDATOR_TYPE="numeric";function i(e,t){let r=e;null==r&&(r=""),this.allowEmpty&&""===r?t(!0):t(""!==r&&(0,n.isNumeric)(e))}i.VALIDATOR_TYPE=s},17027:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,t.getValidator=function(e){if("function"==typeof e)return e;if(!a(e))throw Error(`No registered validator found under "${e}" name`);return o(e)},t.registerValidator=function(e,t){"string"!=typeof e&&(e=(t=e).VALIDATOR_TYPE);i(e,t)},r(67834);var s=n(r(28651));const{register:i,getItem:o,hasItem:a,getNames:l,getValues:h}=(0,s.default)("validators");t.getRegisteredValidators=h,t.getRegisteredValidatorNames=l,t.hasValidator=a},68864:(e,t,r)=>{"use strict";t.__esModule=!0;var n=r(94845);t.VALIDATOR_TYPE=n.VALIDATOR_TYPE,t.timeValidator=n.timeValidator},94845:(e,t,r)=>{"use strict";var n=r(96784);t.__esModule=!0,t.timeValidator=a;var s=n(r(6671));const i=["YYYY-MM-DDTHH:mm:ss.SSSZ","X","x"],o=t.VALIDATOR_TYPE="time";function a(e,t){const r=this.timeFormat||"h:mm:ss a";let n=!0,o=e;null===o&&(o=""),o=/^\d{3,}$/.test(o)?parseInt(o,10):o;const a=/^\d{1,2}$/.test(o);a&&(o+=":00");const l=(0,s.default)(o,i,!0).isValid()?(0,s.default)(o):(0,s.default)(o,r);let h=l.isValid(),u=(0,s.default)(o,r,!0).isValid()&&!a;if(this.allowEmpty&&""===o&&(h=!0,u=!0),h||(n=!1),!h&&u&&(n=!0),h&&!u)if(!0===this.correctFormat){const e=l.format(r);this.instance.setDataAtCell(this.visualRow,this.visualCol,e,"timeValidator"),n=!0}else n=!1;t(n)}a.VALIDATOR_TYPE=o},83012:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Alternation:()=>Me,CstParser:()=>Hr,EMPTY_ALT:()=>Dr,EOF:()=>pe,EarlyExitException:()=>Qt,EmbeddedActionsParser:()=>Fr,Flat:()=>Ce,GAstVisitor:()=>xe,Lexer:()=>J,LexerDefinitionErrorType:()=>q,MismatchedTokenException:()=>Kt,NoViableAltException:()=>Xt,NonTerminal:()=>Ee,NotAllInputParsedException:()=>qt,Option:()=>ve,Parser:()=>kr,ParserDefinitionErrorType:()=>xr,Repetition:()=>Te,RepetitionMandatory:()=>Re,RepetitionMandatoryWithSeparator:()=>Se,RepetitionWithSeparator:()=>Ne,Rule:()=>we,Terminal:()=>_e,VERSION:()=>n,assignOccurrenceIndices:()=>Bt,clearCache:()=>qr,createSyntaxDiagramsCode:()=>Ur,createToken:()=>de,createTokenInstance:()=>ge,defaultGrammarResolverErrorProvider:()=>Dt,defaultGrammarValidatorErrorProvider:()=>kt,defaultLexerErrorProvider:()=>Q,defaultParserErrorProvider:()=>Lt,generateParserFactory:()=>Kr,generateParserModule:()=>Xr,isRecognitionException:()=>$t,resolveGrammar:()=>Ut,serializeGrammar:()=>be,serializeProduction:()=>Oe,tokenLabel:()=>ee,tokenMatcher:()=>fe,tokenName:()=>te,validateGrammar:()=>Vt});var n="6.5.0",s=r(86596),i=r(49879),o={},a=new i.RegExpParser;function l(e){var t=e.toString();if(o.hasOwnProperty(t))return o[t];var r=a.pattern(t);return o[t]=r,r}var h,u=(h=function(e,t){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},h(e,t)},function(e,t){function r(){this.constructor=e}h(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),c="Complement Sets are not supported for first char optimization",d='Unable to use "first char" lexer optimizations:\n';function p(e,t){void 0===t&&(t=!1);try{var r=l(e);return g(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===c)t&&(0,s.x5)(d+"\tUnable to optimize: < "+e.toString()+" >\n\tComplement Sets cannot be automatically optimized.\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.");else{var n="";t&&(n="\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details."),(0,s.Zi)(d+"\n\tFailed parsing: < "+e.toString()+" >\n\tUsing the regexp-to-ast library version: "+i.VERSION+"\n\tPlease open an issue at: https://github.com/bd82/regexp-to-ast/issues"+n)}}return[]}function g(e,t,r){switch(e.type){case"Disjunction":for(var n=0;n=F)for(var i=n.from>=F?n.from:F,o=n.to,a=U(i),l=U(o),h=a;h<=l;h++)t[h]=h}}}));break;case"Group":g(a.value,t,r);break;default:throw Error("Non Exhaustive Match")}var l=void 0!==a.quantifier&&0===a.quantifier.atLeast;if("Group"===a.type&&!1===y(a)||"Group"!==a.type&&!1===l)break}break;default:throw Error("non exhaustive match!")}return(0,s.zu)(t)}function f(e,t,r){var n=U(e);t[n]=n,!0===r&&function(e,t){var r=String.fromCharCode(e),n=r.toUpperCase();if(n!==r){t[s=U(n.charCodeAt(0))]=s}else{var s,i=r.toLowerCase();if(i!==r)t[s=U(i.charCodeAt(0))]=s}}(e,t)}function m(e,t){return(0,s.I6)(e.value,(function(e){if("number"==typeof e)return(0,s.gR)(t,e);var r=e;return void 0!==(0,s.I6)(t,(function(e){return r.from<=e&&e<=r.to}))}))}function y(e){return!(!e.quantifier||0!==e.quantifier.atLeast)||!!e.value&&((0,s.cy)(e.value)?(0,s.Si)(e.value,y):y(e.value))}var E=function(e){function t(t){var r=e.call(this)||this;return r.targetCharCodes=t,r.found=!1,r}return u(t,e),t.prototype.visitChildren=function(t){if(!0!==this.found){switch(t.type){case"Lookahead":return void this.visitLookahead(t);case"NegativeLookahead":return void this.visitNegativeLookahead(t)}e.prototype.visitChildren.call(this,t)}},t.prototype.visitCharacter=function(e){(0,s.gR)(this.targetCharCodes,e.value)&&(this.found=!0)},t.prototype.visitSet=function(e){e.complement?void 0===m(e,this.targetCharCodes)&&(this.found=!0):void 0!==m(e,this.targetCharCodes)&&(this.found=!0)},t}(i.BaseRegExpVisitor);function w(e,t){if(t instanceof RegExp){var r=l(t),n=new E(e);return n.visit(r),n.found}return void 0!==(0,s.I6)(t,(function(t){return(0,s.gR)(e,t.charCodeAt(0))}))}var C=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),v="PATTERN",R="defaultMode",S="modes",T="boolean"==typeof new RegExp("(?:)").sticky;function N(e,t){var r,n=(t=(0,s.NT)(t,{useSticky:T,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r","\n"],tracer:function(e,t){return t()}})).tracer;n("initCharCodeToOptimizedIndexMap",(function(){!function(){if((0,s.Im)(V)){V=new Array(65536);for(var e=0;e<65536;e++)V[e]=e>255?255+~~(e/255):e}}()})),n("Reject Lexer.NA",(function(){r=(0,s.ku)(e,(function(e){return e[v]===J.NA}))}));var i,o,a,l,h,u,c,g,f,m,y,E=!1;n("Transform Patterns",(function(){E=!1,i=(0,s.Tj)(r,(function(e){var r=e[v];if((0,s.gd)(r)){var n=r.source;return 1===n.length&&"^"!==n&&"$"!==n&&"."!==n?n:2!==n.length||"\\"!==n[0]||(0,s.gR)(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],n[1])?t.useSticky?A(r):O(r):n[1]}if((0,s.Tn)(r))return E=!0,{exec:r};if((0,s.zy)(r,"exec"))return E=!0,r;if("string"==typeof r){if(1===r.length)return r;var i=r.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),o=new RegExp(i);return t.useSticky?A(o):O(o)}throw Error("non exhaustive match")}))})),n("misc mapping",(function(){o=(0,s.Tj)(r,(function(e){return e.tokenTypeIdx})),a=(0,s.Tj)(r,(function(e){var t=e.GROUP;if(t!==J.SKIPPED){if((0,s.Kg)(t))return t;if((0,s.b0)(t))return!1;throw Error("non exhaustive match")}})),l=(0,s.Tj)(r,(function(e){var t=e.LONGER_ALT;if(t)return(0,s.qh)(r,t)})),h=(0,s.Tj)(r,(function(e){return e.PUSH_MODE})),u=(0,s.Tj)(r,(function(e){return(0,s.zy)(e,"POP_MODE")}))})),n("Line Terminator Handling",(function(){var e=k(t.lineTerminatorCharacters);c=(0,s.Tj)(r,(function(e){return!1})),"onlyOffset"!==t.positionTracking&&(c=(0,s.Tj)(r,(function(t){return(0,s.zy)(t,"LINE_BREAKS")?t.LINE_BREAKS:!1===D(t,e)?w(e,t.PATTERN):void 0})))})),n("Misc Mapping #2",(function(){g=(0,s.Tj)(r,x),f=(0,s.Tj)(i,P),m=(0,s.TS)(r,(function(e,t){var r=t.GROUP;return(0,s.Kg)(r)&&r!==J.SKIPPED&&(e[r]=[]),e}),{}),y=(0,s.Tj)(i,(function(e,t){return{pattern:i[t],longerAlt:l[t],canLineTerminator:c[t],isCustom:g[t],short:f[t],group:a[t],push:h[t],pop:u[t],tokenTypeIdx:o[t],tokenType:r[t]}}))}));var C=!0,R=[];return t.safeMode||n("First Char Optimization",(function(){R=(0,s.TS)(r,(function(e,r,n){if("string"==typeof r.PATTERN){var i=U(r.PATTERN.charCodeAt(0));H(e,i,y[n])}else if((0,s.cy)(r.START_CHARS_HINT)){var o;(0,s.jJ)(r.START_CHARS_HINT,(function(t){var r=U("string"==typeof t?t.charCodeAt(0):t);o!==r&&(o=r,H(e,r,y[n]))}))}else if((0,s.gd)(r.PATTERN))if(r.PATTERN.unicode)C=!1,t.ensureOptimizations&&(0,s.Zi)(d+"\tUnable to analyze < "+r.PATTERN.toString()+" > pattern.\n\tThe regexp unicode flag is not currently supported by the regexp-to-ast library.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE");else{var a=p(r.PATTERN,t.ensureOptimizations);(0,s.Im)(a)&&(C=!1),(0,s.jJ)(a,(function(t){H(e,t,y[n])}))}else t.ensureOptimizations&&(0,s.Zi)(d+"\tTokenType: <"+r.name+"> is using a custom token pattern without providing parameter.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE"),C=!1;return e}),[])})),n("ArrayPacking",(function(){R=(0,s.VS)(R)})),{emptyGroups:m,patternIdxToConfig:y,charCodeToPatternIdxToConfig:R,hasCustom:E,canBeOptimized:C}}function M(e,t){var r=[],n=function(e){var t=(0,s.pb)(e,(function(e){return!(0,s.zy)(e,v)})),r=(0,s.Tj)(t,(function(e){return{message:"Token Type: ->"+e.name+"<- missing static 'PATTERN' property",type:q.MISSING_PATTERN,tokenTypes:[e]}})),n=(0,s.iv)(e,t);return{errors:r,valid:n}}(e);r=r.concat(n.errors);var o=function(e){var t=(0,s.pb)(e,(function(e){var t=e[v];return!((0,s.gd)(t)||(0,s.Tn)(t)||(0,s.zy)(t,"exec")||(0,s.Kg)(t))})),r=(0,s.Tj)(t,(function(e){return{message:"Token Type: ->"+e.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:q.INVALID_PATTERN,tokenTypes:[e]}})),n=(0,s.iv)(e,t);return{errors:r,valid:n}}(n.valid),a=o.valid;return r=(r=r.concat(o.errors)).concat(function(e){var t=[],r=(0,s.pb)(e,(function(e){return(0,s.gd)(e[v])}));return t=t.concat(function(e){var t=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.found=!1,t}return C(t,e),t.prototype.visitEndAnchor=function(e){this.found=!0},t}(i.BaseRegExpVisitor),r=(0,s.pb)(e,(function(e){var r=e[v];try{var n=l(r),s=new t;return s.visit(n),s.found}catch(e){return _.test(r.source)}})),n=(0,s.Tj)(r,(function(e){return{message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain end of input anchor '$'\n\tSee sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:q.EOI_ANCHOR_FOUND,tokenTypes:[e]}}));return n}(r)),t=t.concat(function(e){var t=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.found=!1,t}return C(t,e),t.prototype.visitStartAnchor=function(e){this.found=!0},t}(i.BaseRegExpVisitor),r=(0,s.pb)(e,(function(e){var r=e[v];try{var n=l(r),s=new t;return s.visit(n),s.found}catch(e){return b.test(r.source)}})),n=(0,s.Tj)(r,(function(e){return{message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain start of input anchor '^'\n\tSee https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:q.SOI_ANCHOR_FOUND,tokenTypes:[e]}}));return n}(r)),t=t.concat(function(e){var t=(0,s.pb)(e,(function(e){var t=e[v];return t instanceof RegExp&&(t.multiline||t.global)})),r=(0,s.Tj)(t,(function(e){return{message:"Token Type: ->"+e.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:q.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[e]}}));return r}(r)),t=t.concat(function(e){var t=[],r=(0,s.Tj)(e,(function(r){return(0,s.TS)(e,(function(e,n){return r.PATTERN.source!==n.PATTERN.source||(0,s.gR)(t,n)||n.PATTERN===J.NA||(t.push(n),e.push(n)),e}),[])}));r=(0,s.oE)(r);var n=(0,s.pb)(r,(function(e){return e.length>1})),i=(0,s.Tj)(n,(function(e){var t=(0,s.Tj)(e,(function(e){return e.name}));return{message:"The same RegExp pattern ->"+(0,s.$1)(e).PATTERN+"<-has been used in all of the following Token Types: "+t.join(", ")+" <-",type:q.DUPLICATE_PATTERNS_FOUND,tokenTypes:e}}));return i}(r)),t=t.concat(function(e){var t=(0,s.pb)(e,(function(e){return e[v].test("")})),r=(0,s.Tj)(t,(function(e){return{message:"Token Type: ->"+e.name+"<- static 'PATTERN' must not match an empty string",type:q.EMPTY_MATCH_PATTERN,tokenTypes:[e]}}));return r}(r)),t}(a)),r=r.concat(function(e){var t=(0,s.pb)(e,(function(e){if(!(0,s.zy)(e,"GROUP"))return!1;var t=e.GROUP;return t!==J.SKIPPED&&t!==J.NA&&!(0,s.Kg)(t)})),r=(0,s.Tj)(t,(function(e){return{message:"Token Type: ->"+e.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:q.INVALID_GROUP_TYPE_FOUND,tokenTypes:[e]}}));return r}(a)),r=r.concat(function(e,t){var r=(0,s.pb)(e,(function(e){return void 0!==e.PUSH_MODE&&!(0,s.gR)(t,e.PUSH_MODE)})),n=(0,s.Tj)(r,(function(e){return{message:"Token Type: ->"+e.name+"<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->"+e.PUSH_MODE+"<-which does not exist",type:q.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[e]}}));return n}(a,t)),r=r.concat(function(e){var t=[],r=(0,s.TS)(e,(function(e,t,r){var n,i,o=t.PATTERN;return o===J.NA||((0,s.Kg)(o)?e.push({str:o,idx:r,tokenType:t}):(0,s.gd)(o)&&(n=o,i=[".","\\","[","]","|","^","$","(",")","?","*","+","{"],void 0===(0,s.I6)(i,(function(e){return-1!==n.source.indexOf(e)})))&&e.push({str:o.source,idx:r,tokenType:t})),e}),[]);return(0,s.jJ)(e,(function(e,n){(0,s.jJ)(r,(function(r){var i=r.str,o=r.idx,a=r.tokenType;if(n"+e.name+"<-in the lexer's definition.\nSee https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#UNREACHABLE";t.push({message:l,type:q.UNREACHABLE_PATTERN,tokenTypes:[e,a]})}}))})),t}(a)),r}var _=/[^\\][\$]/;var b=/[^\\[][\^]|^\^/;function O(e){var t=e.ignoreCase?"i":"";return new RegExp("^(?:"+e.source+")",t)}function A(e){var t=e.ignoreCase?"iy":"y";return new RegExp(""+e.source,t)}function I(e,t,r){var n=[],i=!1,o=(0,s.oE)((0,s.Bq)((0,s.LG)(e.modes,(function(e){return e})))),a=(0,s.ku)(o,(function(e){return e[v]===J.NA})),l=k(r);return t&&(0,s.jJ)(a,(function(e){var t=D(e,l);if(!1!==t){var r=function(e,t){if(t.issue===q.IDENTIFY_TERMINATOR)return"Warning: unable to identify line terminator usage in pattern.\n\tThe problem is in the <"+e.name+"> Token Type\n\t Root cause: "+t.errMsg+".\n\tFor details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR";if(t.issue===q.CUSTOM_LINE_BREAK)return"Warning: A Custom Token Pattern should specify the option.\n\tThe problem is in the <"+e.name+"> Token Type\n\tFor details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK";throw Error("non exhaustive match")}(e,t),o={message:r,type:t.issue,tokenType:e};n.push(o)}else(0,s.zy)(e,"LINE_BREAKS")?!0===e.LINE_BREAKS&&(i=!0):w(l,e.PATTERN)&&(i=!0)})),t&&!i&&n.push({message:"Warning: No LINE_BREAKS Found.\n\tThis Lexer has been defined to track line and column information,\n\tBut none of the Token Types can be identified as matching a line terminator.\n\tSee https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#LINE_BREAKS \n\tfor details.",type:q.NO_LINE_BREAKS_FLAGS}),n}function x(e){var t=e.PATTERN;if((0,s.gd)(t))return!1;if((0,s.Tn)(t))return!0;if((0,s.zy)(t,"exec"))return!0;if((0,s.Kg)(t))return!1;throw Error("non exhaustive match")}function P(e){return!(!(0,s.Kg)(e)||1!==e.length)&&e.charCodeAt(0)}var L={test:function(e){for(var t=e.length,r=this.lastIndex;r0?e.charCodeAt(0):e}))}function H(e,t,r){void 0===e[t]?e[t]=[r]:e[t].push(r)}var F=256;function U(e){return e0}))}function z(e,t){(0,s.jJ)(e,(function(e){t.categoryMatchesMap[e.tokenTypeIdx]=!0})),(0,s.jJ)(t.CATEGORIES,(function(r){var n=e.concat(t);(0,s.gR)(n,r)||z(n,r)}))}function $(e){return(0,s.zy)(e,"tokenTypeIdx")}function K(e){return(0,s.zy)(e,"CATEGORIES")}function X(e){return(0,s.zy)(e,"tokenTypeIdx")}var q,Q={buildUnableToPopLexerModeMessage:function(e){return"Unable to pop Lexer Mode after encountering Token ->"+e.image+"<- The Mode Stack is empty"},buildUnexpectedCharactersMessage:function(e,t,r,n,s){return"unexpected character: ->"+e.charAt(t)+"<- at offset: "+t+", skipped "+r+" characters."}};!function(e){e[e.MISSING_PATTERN=0]="MISSING_PATTERN",e[e.INVALID_PATTERN=1]="INVALID_PATTERN",e[e.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",e[e.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",e[e.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",e[e.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",e[e.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",e[e.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",e[e.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",e[e.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",e[e.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",e[e.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",e[e.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",e[e.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",e[e.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",e[e.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",e[e.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK"}(q||(q={}));var Z={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:["\n","\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:Q,traceInitPerf:!1,skipValidations:!1};Object.freeze(Z);var J=function(){function e(e,t){var r=this;if(void 0===t&&(t=Z),this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.config=void 0,this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},"boolean"==typeof t)throw Error("The second argument to the Lexer constructor is now an ILexerConfig Object.\na boolean 2nd argument is no longer supported");this.config=(0,s.h1)(Z,t);var n=this.config.traceInitPerf;!0===n?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):"number"==typeof n&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",(function(){var n,i=!0;r.TRACE_INIT("Lexer Config handling",(function(){if(r.config.lineTerminatorsPattern===Z.lineTerminatorsPattern)r.config.lineTerminatorsPattern=L;else if(r.config.lineTerminatorCharacters===Z.lineTerminatorCharacters)throw Error("Error: Missing property on the Lexer config.\n\tFor details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS");if(t.safeMode&&t.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');r.trackStartLines=/full|onlyStart/i.test(r.config.positionTracking),r.trackEndLines=/full/i.test(r.config.positionTracking),(0,s.cy)(e)?((n={modes:{}}).modes[R]=(0,s.T9)(e),n[R]=R):(i=!1,n=(0,s.lR)(e))})),!1===r.config.skipValidations&&(r.TRACE_INIT("performRuntimeChecks",(function(){r.lexerDefinitionErrors=r.lexerDefinitionErrors.concat(function(e){var t=[];return(0,s.zy)(e,R)||t.push({message:"A MultiMode Lexer cannot be initialized without a <"+R+"> property in its definition\n",type:q.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),(0,s.zy)(e,S)||t.push({message:"A MultiMode Lexer cannot be initialized without a property in its definition\n",type:q.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),(0,s.zy)(e,S)&&(0,s.zy)(e,R)&&!(0,s.zy)(e.modes,e.defaultMode)&&t.push({message:"A MultiMode Lexer cannot be initialized with a "+R+": <"+e.defaultMode+">which does not exist\n",type:q.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),(0,s.zy)(e,S)&&(0,s.jJ)(e.modes,(function(e,r){(0,s.jJ)(e,(function(e,n){(0,s.b0)(e)&&t.push({message:"A Lexer cannot be initialized using an undefined Token Type. Mode:<"+r+"> at index: <"+n+">\n",type:q.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED})}))})),t}(n,r.trackStartLines,r.config.lineTerminatorCharacters))})),r.TRACE_INIT("performWarningRuntimeChecks",(function(){r.lexerDefinitionWarning=r.lexerDefinitionWarning.concat(I(n,r.trackStartLines,r.config.lineTerminatorCharacters))}))),n.modes=n.modes?n.modes:{},(0,s.jJ)(n.modes,(function(e,t){n.modes[t]=(0,s.ku)(e,(function(e){return(0,s.b0)(e)}))}));var a=(0,s.HP)(n.modes);if((0,s.jJ)(n.modes,(function(e,n){r.TRACE_INIT("Mode: <"+n+"> processing",(function(){var i;(r.modes.push(n),!1===r.config.skipValidations&&r.TRACE_INIT("validatePatterns",(function(){r.lexerDefinitionErrors=r.lexerDefinitionErrors.concat(M(e,a))})),(0,s.Im)(r.lexerDefinitionErrors))&&(j(e),r.TRACE_INIT("analyzeTokenTypes",(function(){i=N(e,{lineTerminatorCharacters:r.config.lineTerminatorCharacters,positionTracking:t.positionTracking,ensureOptimizations:t.ensureOptimizations,safeMode:t.safeMode,tracer:r.TRACE_INIT.bind(r)})})),r.patternIdxToConfig[n]=i.patternIdxToConfig,r.charCodeToPatternIdxToConfig[n]=i.charCodeToPatternIdxToConfig,r.emptyGroups=(0,s.h1)(r.emptyGroups,i.emptyGroups),r.hasCustom=i.hasCustom||r.hasCustom,r.canModeBeOptimized[n]=i.canBeOptimized)}))})),r.defaultMode=n.defaultMode,!(0,s.Im)(r.lexerDefinitionErrors)&&!r.config.deferDefinitionErrorsHandling){var l=(0,s.Tj)(r.lexerDefinitionErrors,(function(e){return e.message})).join("-----------------------\n");throw new Error("Errors detected in definition of Lexer:\n"+l)}(0,s.jJ)(r.lexerDefinitionWarning,(function(e){(0,s.x5)(e.message)})),r.TRACE_INIT("Choosing sub-methods implementations",(function(){if(T?(r.chopInput=s.zK,r.match=r.matchWithTest):(r.updateLastIndex=s.tE,r.match=r.matchWithExec),i&&(r.handleModes=s.tE),!1===r.trackStartLines&&(r.computeNewColumn=s.zK),!1===r.trackEndLines&&(r.updateTokenEndLineColumnLocation=s.tE),/full/i.test(r.config.positionTracking))r.createTokenInstance=r.createFullToken;else if(/onlyStart/i.test(r.config.positionTracking))r.createTokenInstance=r.createStartOnlyToken;else{if(!/onlyOffset/i.test(r.config.positionTracking))throw Error('Invalid config option: "'+r.config.positionTracking+'"');r.createTokenInstance=r.createOffsetOnlyToken}r.hasCustom?(r.addToken=r.addTokenUsingPush,r.handlePayload=r.handlePayloadWithCustom):(r.addToken=r.addTokenUsingMemberAccess,r.handlePayload=r.handlePayloadNoCustom)})),r.TRACE_INIT("Failed Optimization Warnings",(function(){var e=(0,s.TS)(r.canModeBeOptimized,(function(e,t,r){return!1===t&&e.push(r),e}),[]);if(t.ensureOptimizations&&!(0,s.Im)(e))throw Error("Lexer Modes: < "+e.join(", ")+' > cannot be optimized.\n\t Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.\n\t Or inspect the console log for details on how to resolve these issues.')})),r.TRACE_INIT("clearRegExpParserCache",(function(){o={}})),r.TRACE_INIT("toFastProperties",(function(){(0,s.Bl)(r)}))}))}return e.prototype.tokenize=function(e,t){if(void 0===t&&(t=this.defaultMode),!(0,s.Im)(this.lexerDefinitionErrors)){var r=(0,s.Tj)(this.lexerDefinitionErrors,(function(e){return e.message})).join("-----------------------\n");throw new Error("Unable to Tokenize because Errors detected in definition of Lexer:\n"+r)}return this.tokenizeInternal(e,t)},e.prototype.tokenizeInternal=function(e,t){var r,n,i,o,a,l,h,u,c,d,p,g,f,m,y,E,w,C=this,v=e,R=v.length,S=0,T=0,N=this.hasCustom?0:Math.floor(e.length/10),M=new Array(N),_=[],b=this.trackStartLines?1:void 0,O=this.trackStartLines?1:void 0,A=(y=this.emptyGroups,E={},w=(0,s.HP)(y),(0,s.jJ)(w,(function(e){var t=y[e];if(!(0,s.cy)(t))throw Error("non exhaustive match");E[e]=[]})),E),I=this.trackStartLines,x=this.config.lineTerminatorsPattern,P=0,L=[],D=[],k=[],H=[];Object.freeze(H);var F=void 0;function V(){return L}function B(e){var t=U(e),r=D[t];return void 0===r?H:r}var W,Y=function(e){if(1===k.length&&void 0===e.tokenType.PUSH_MODE){var t=C.config.errorMessageProvider.buildUnableToPopLexerModeMessage(e);_.push({offset:e.startOffset,line:void 0!==e.startLine?e.startLine:void 0,column:void 0!==e.startColumn?e.startColumn:void 0,length:e.image.length,message:t})}else{k.pop();var r=(0,s.HV)(k);L=C.patternIdxToConfig[r],D=C.charCodeToPatternIdxToConfig[r],P=L.length;var n=C.canModeBeOptimized[r]&&!1===C.config.safeMode;F=D&&n?B:V}};function G(e){k.push(e),D=this.charCodeToPatternIdxToConfig[e],L=this.patternIdxToConfig[e],P=L.length,P=L.length;var t=this.canModeBeOptimized[e]&&!1===this.config.safeMode;F=D&&t?B:V}for(G.call(this,t);Sa.length&&(a=i,l=h,W=X)}break}}if(null!==a){if(u=a.length,void 0!==(c=W.group)&&(d=W.tokenTypeIdx,p=this.createTokenInstance(a,S,d,W.tokenType,b,O,u),this.handlePayload(p,l),!1===c?T=this.addToken(M,T,p):A[c].push(p)),e=this.chopInput(e,u),S+=u,O=this.computeNewColumn(O,u),!0===I&&!0===W.canLineTerminator){var Q=0,Z=void 0,J=void 0;x.lastIndex=0;do{!0===(Z=x.test(a))&&(J=x.lastIndex-1,Q++)}while(!0===Z);0!==Q&&(b+=Q,O=u-J,this.updateTokenEndLineColumnLocation(p,c,J,Q,b,O,u))}this.handleModes(W,Y,G,p)}else{for(var ee=S,te=b,re=O,ne=!1;!ne&&S");var n=(0,s.O1)(t),i=n.time,o=n.value,a=i>10?console.warn:console.log;return this.traceInitIndent time: "+i+"ms"),this.traceInitIndent--,o}return t()},e.SKIPPED="This marks a skipped Token pattern, this means each token identified by it willbe consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.",e.NA=/NOT_APPLICABLE/,e}();function ee(e){return re(e)?e.LABEL:e.name}function te(e){return e.name}function re(e){return(0,s.Kg)(e.LABEL)&&""!==e.LABEL}var ne="parent",se="categories",ie="label",oe="group",ae="push_mode",le="pop_mode",he="longer_alt",ue="line_breaks",ce="start_chars_hint";function de(e){return function(e){var t=e.pattern,r={};r.name=e.name,(0,s.b0)(t)||(r.PATTERN=t);if((0,s.zy)(e,ne))throw"The parent property is no longer supported.\nSee: https://github.com/SAP/chevrotain/issues/564#issuecomment-349062346 for details.";(0,s.zy)(e,se)&&(r.CATEGORIES=e[se]);j([r]),(0,s.zy)(e,ie)&&(r.LABEL=e[ie]);(0,s.zy)(e,oe)&&(r.GROUP=e[oe]);(0,s.zy)(e,le)&&(r.POP_MODE=e[le]);(0,s.zy)(e,ae)&&(r.PUSH_MODE=e[ae]);(0,s.zy)(e,he)&&(r.LONGER_ALT=e[he]);(0,s.zy)(e,ue)&&(r.LINE_BREAKS=e[ue]);(0,s.zy)(e,ce)&&(r.START_CHARS_HINT=e[ce]);return r}(e)}var pe=de({name:"EOF",pattern:J.NA});function ge(e,t,r,n,s,i,o,a){return{image:t,startOffset:r,endOffset:n,startLine:s,endLine:i,startColumn:o,endColumn:a,tokenTypeIdx:e.tokenTypeIdx,tokenType:e}}function fe(e,t){return B(e,t)}j([pe]);var me=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ye=function(){function e(e){this.definition=e}return e.prototype.accept=function(e){e.visit(this),(0,s.jJ)(this.definition,(function(t){t.accept(e)}))},e}(),Ee=function(e){function t(t){var r=e.call(this,[])||this;return r.idx=1,(0,s.kp)(r,(0,s.Up)(t,(function(e){return void 0!==e}))),r}return me(t,e),Object.defineProperty(t.prototype,"definition",{get:function(){return void 0!==this.referencedRule?this.referencedRule.definition:[]},set:function(e){},enumerable:!0,configurable:!0}),t.prototype.accept=function(e){e.visit(this)},t}(ye),we=function(e){function t(t){var r=e.call(this,t.definition)||this;return r.orgText="",(0,s.kp)(r,(0,s.Up)(t,(function(e){return void 0!==e}))),r}return me(t,e),t}(ye),Ce=function(e){function t(t){var r=e.call(this,t.definition)||this;return r.ignoreAmbiguities=!1,(0,s.kp)(r,(0,s.Up)(t,(function(e){return void 0!==e}))),r}return me(t,e),t}(ye),ve=function(e){function t(t){var r=e.call(this,t.definition)||this;return r.idx=1,(0,s.kp)(r,(0,s.Up)(t,(function(e){return void 0!==e}))),r}return me(t,e),t}(ye),Re=function(e){function t(t){var r=e.call(this,t.definition)||this;return r.idx=1,(0,s.kp)(r,(0,s.Up)(t,(function(e){return void 0!==e}))),r}return me(t,e),t}(ye),Se=function(e){function t(t){var r=e.call(this,t.definition)||this;return r.idx=1,(0,s.kp)(r,(0,s.Up)(t,(function(e){return void 0!==e}))),r}return me(t,e),t}(ye),Te=function(e){function t(t){var r=e.call(this,t.definition)||this;return r.idx=1,(0,s.kp)(r,(0,s.Up)(t,(function(e){return void 0!==e}))),r}return me(t,e),t}(ye),Ne=function(e){function t(t){var r=e.call(this,t.definition)||this;return r.idx=1,(0,s.kp)(r,(0,s.Up)(t,(function(e){return void 0!==e}))),r}return me(t,e),t}(ye),Me=function(e){function t(t){var r=e.call(this,t.definition)||this;return r.idx=1,r.ignoreAmbiguities=!1,r.hasPredicates=!1,(0,s.kp)(r,(0,s.Up)(t,(function(e){return void 0!==e}))),r}return me(t,e),t}(ye),_e=function(){function e(e){this.idx=1,(0,s.kp)(this,(0,s.Up)(e,(function(e){return void 0!==e})))}return e.prototype.accept=function(e){e.visit(this)},e}();function be(e){return(0,s.Tj)(e,Oe)}function Oe(e){function t(e){return(0,s.Tj)(e,Oe)}if(e instanceof Ee)return{type:"NonTerminal",name:e.nonTerminalName,idx:e.idx};if(e instanceof Ce)return{type:"Flat",definition:t(e.definition)};if(e instanceof ve)return{type:"Option",idx:e.idx,definition:t(e.definition)};if(e instanceof Re)return{type:"RepetitionMandatory",name:e.name,idx:e.idx,definition:t(e.definition)};if(e instanceof Se)return{type:"RepetitionMandatoryWithSeparator",name:e.name,idx:e.idx,separator:Oe(new _e({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof Ne)return{type:"RepetitionWithSeparator",name:e.name,idx:e.idx,separator:Oe(new _e({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof Te)return{type:"Repetition",name:e.name,idx:e.idx,definition:t(e.definition)};if(e instanceof Me)return{type:"Alternation",name:e.name,idx:e.idx,definition:t(e.definition)};if(e instanceof _e){var r={type:"Terminal",name:e.terminalType.name,label:ee(e.terminalType),idx:e.idx},n=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(r.pattern=(0,s.gd)(n)?n.source:n),r}if(e instanceof we)return{type:"Rule",name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error("non exhaustive match")}var Ae=function(){function e(){}return e.prototype.walk=function(e,t){var r=this;void 0===t&&(t=[]),(0,s.jJ)(e.definition,(function(n,i){var o=(0,s.gv)(e.definition,i+1);if(n instanceof Ee)r.walkProdRef(n,o,t);else if(n instanceof _e)r.walkTerminal(n,o,t);else if(n instanceof Ce)r.walkFlat(n,o,t);else if(n instanceof ve)r.walkOption(n,o,t);else if(n instanceof Re)r.walkAtLeastOne(n,o,t);else if(n instanceof Se)r.walkAtLeastOneSep(n,o,t);else if(n instanceof Ne)r.walkManySep(n,o,t);else if(n instanceof Te)r.walkMany(n,o,t);else{if(!(n instanceof Me))throw Error("non exhaustive match");r.walkOr(n,o,t)}}))},e.prototype.walkTerminal=function(e,t,r){},e.prototype.walkProdRef=function(e,t,r){},e.prototype.walkFlat=function(e,t,r){var n=t.concat(r);this.walk(e,n)},e.prototype.walkOption=function(e,t,r){var n=t.concat(r);this.walk(e,n)},e.prototype.walkAtLeastOne=function(e,t,r){var n=[new ve({definition:e.definition})].concat(t,r);this.walk(e,n)},e.prototype.walkAtLeastOneSep=function(e,t,r){var n=Ie(e,t,r);this.walk(e,n)},e.prototype.walkMany=function(e,t,r){var n=[new ve({definition:e.definition})].concat(t,r);this.walk(e,n)},e.prototype.walkManySep=function(e,t,r){var n=Ie(e,t,r);this.walk(e,n)},e.prototype.walkOr=function(e,t,r){var n=this,i=t.concat(r);(0,s.jJ)(e.definition,(function(e){var t=new Ce({definition:[e]});n.walk(t,i)}))},e}();function Ie(e,t,r){return[new ve({definition:[new _e({terminalType:e.separator})].concat(e.definition)})].concat(t,r)}var xe=function(){function e(){}return e.prototype.visit=function(e){var t=e;switch(t.constructor){case Ee:return this.visitNonTerminal(t);case Ce:return this.visitFlat(t);case ve:return this.visitOption(t);case Re:return this.visitRepetitionMandatory(t);case Se:return this.visitRepetitionMandatoryWithSeparator(t);case Ne:return this.visitRepetitionWithSeparator(t);case Te:return this.visitRepetition(t);case Me:return this.visitAlternation(t);case _e:return this.visitTerminal(t);case we:return this.visitRule(t);default:throw Error("non exhaustive match")}},e.prototype.visitNonTerminal=function(e){},e.prototype.visitFlat=function(e){},e.prototype.visitOption=function(e){},e.prototype.visitRepetition=function(e){},e.prototype.visitRepetitionMandatory=function(e){},e.prototype.visitRepetitionMandatoryWithSeparator=function(e){},e.prototype.visitRepetitionWithSeparator=function(e){},e.prototype.visitAlternation=function(e){},e.prototype.visitTerminal=function(e){},e.prototype.visitRule=function(e){},e}(),Pe=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function Le(e,t){return void 0===t&&(t=[]),!!(e instanceof ve||e instanceof Te||e instanceof Ne)||(e instanceof Me?(0,s.zN)(e.definition,(function(e){return Le(e,t)})):!(e instanceof Ee&&(0,s.gR)(t,e))&&(e instanceof ye&&(e instanceof Ee&&t.push(e),(0,s.Si)(e.definition,(function(e){return Le(e,t)})))))}function De(e){if(e instanceof Ee)return"SUBRULE";if(e instanceof ve)return"OPTION";if(e instanceof Me)return"OR";if(e instanceof Re)return"AT_LEAST_ONE";if(e instanceof Se)return"AT_LEAST_ONE_SEP";if(e instanceof Ne)return"MANY_SEP";if(e instanceof Te)return"MANY";if(e instanceof _e)return"CONSUME";throw Error("non exhaustive match")}var ke=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.separator="-",t.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]},t}return Pe(t,e),t.prototype.reset=function(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}},t.prototype.visitTerminal=function(e){var t=e.terminalType.name+this.separator+"Terminal";(0,s.zy)(this.dslMethods,t)||(this.dslMethods[t]=[]),this.dslMethods[t].push(e)},t.prototype.visitNonTerminal=function(e){var t=e.nonTerminalName+this.separator+"Terminal";(0,s.zy)(this.dslMethods,t)||(this.dslMethods[t]=[]),this.dslMethods[t].push(e)},t.prototype.visitOption=function(e){this.dslMethods.option.push(e)},t.prototype.visitRepetitionWithSeparator=function(e){this.dslMethods.repetitionWithSeparator.push(e)},t.prototype.visitRepetitionMandatory=function(e){this.dslMethods.repetitionMandatory.push(e)},t.prototype.visitRepetitionMandatoryWithSeparator=function(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)},t.prototype.visitRepetition=function(e){this.dslMethods.repetition.push(e)},t.prototype.visitAlternation=function(e){this.dslMethods.alternation.push(e)},t}(xe),He=new ke;function Fe(e){if(e instanceof Ee)return Fe(e.referencedRule);if(e instanceof _e)return[e.terminalType];if(function(e){return e instanceof Ce||e instanceof ve||e instanceof Te||e instanceof Re||e instanceof Se||e instanceof Ne||e instanceof _e||e instanceof we}(e))return function(e){var t,r=[],n=e.definition,i=0,o=n.length>i,a=!0;for(;o&&a;)a=Le(t=n[i]),r=r.concat(Fe(t)),i+=1,o=n.length>i;return(0,s.sb)(r)}(e);if(function(e){return e instanceof Me}(e))return function(e){var t=(0,s.Tj)(e.definition,(function(e){return Fe(e)}));return(0,s.sb)((0,s.Bq)(t))}(e);throw Error("non exhaustive match")}var Ue="_~IN~_",Ve=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Be=function(e){function t(t){var r=e.call(this)||this;return r.topProd=t,r.follows={},r}return Ve(t,e),t.prototype.startWalking=function(){return this.walk(this.topProd),this.follows},t.prototype.walkTerminal=function(e,t,r){},t.prototype.walkProdRef=function(e,t,r){var n,s,i=(n=e.referencedRule,s=e.idx,n.name+s+Ue+this.topProd.name),o=t.concat(r),a=Fe(new Ce({definition:o}));this.follows[i]=a},t}(Ae);var We=256,Ye=512,Ge=768,je=1024,ze=1280,$e=1536;function Ke(e,t,r){return r|t|e}function Xe(e,t,r,n){var s=n+1<<24;return Ke(e,t,r)|s}var qe=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function Qe(e,t){!0===isNaN(e.startOffset)?(e.startOffset=t.startOffset,e.endOffset=t.endOffset):e.endOffset1;(0,s.jJ)(e.definition,(function(n,i){if(!(0,s.b0)(n.name)){var o=n.definition;o=r?[new ve({definition:n.definition})]:n.definition;var a=Xe(t.ruleIdx,We,e.idx,i);t.result.push({def:o,key:a,name:n.name,orgProd:n})}}))},t}(xe);var tt=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),rt=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.path=r,n.nextTerminalName="",n.nextTerminalOccurrence=0,n.nextTerminalName=n.path.lastTok.name,n.nextTerminalOccurrence=n.path.lastTokOccurrence,n}return tt(t,e),t.prototype.walkTerminal=function(e,t,r){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){var n=t.concat(r),s=new Ce({definition:n});this.possibleTokTypes=Fe(s),this.found=!0}},t}(function(e){function t(t,r){var n=e.call(this)||this;return n.topProd=t,n.path=r,n.possibleTokTypes=[],n.nextProductionName="",n.nextProductionOccurrence=0,n.found=!1,n.isAtEndOfPath=!1,n}return tt(t,e),t.prototype.startWalking=function(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=(0,s.T9)(this.path.ruleStack).reverse(),this.occurrenceStack=(0,s.T9)(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes},t.prototype.walk=function(t,r){void 0===r&&(r=[]),this.found||e.prototype.walk.call(this,t,r)},t.prototype.walkProdRef=function(e,t,r){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){var n=t.concat(r);this.updateExpectedNext(),this.walk(e.referencedRule,n)}},t.prototype.updateExpectedNext=function(){(0,s.Im)(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())},t}(Ae)),nt=function(e){function t(t,r){var n=e.call(this)||this;return n.topRule=t,n.occurrence=r,n.result={token:void 0,occurrence:void 0,isEndOfRule:void 0},n}return tt(t,e),t.prototype.startWalking=function(){return this.walk(this.topRule),this.result},t}(Ae),st=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return tt(t,e),t.prototype.walkMany=function(t,r,n){if(t.idx===this.occurrence){var i=(0,s.$1)(r.concat(n));this.result.isEndOfRule=void 0===i,i instanceof _e&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else e.prototype.walkMany.call(this,t,r,n)},t}(nt),it=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return tt(t,e),t.prototype.walkManySep=function(t,r,n){if(t.idx===this.occurrence){var i=(0,s.$1)(r.concat(n));this.result.isEndOfRule=void 0===i,i instanceof _e&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else e.prototype.walkManySep.call(this,t,r,n)},t}(nt),ot=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return tt(t,e),t.prototype.walkAtLeastOne=function(t,r,n){if(t.idx===this.occurrence){var i=(0,s.$1)(r.concat(n));this.result.isEndOfRule=void 0===i,i instanceof _e&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else e.prototype.walkAtLeastOne.call(this,t,r,n)},t}(nt),at=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return tt(t,e),t.prototype.walkAtLeastOneSep=function(t,r,n){if(t.idx===this.occurrence){var i=(0,s.$1)(r.concat(n));this.result.isEndOfRule=void 0===i,i instanceof _e&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else e.prototype.walkAtLeastOneSep.call(this,t,r,n)},t}(nt);function lt(e,t,r){void 0===r&&(r=[]),r=(0,s.T9)(r);var n=[],i=0;function o(o){var a=lt(o.concat((0,s.gv)(e,i+1)),t,r);return n.concat(a)}for(;r.length=0;b--){var O={idx:f,def:E.definition[b].definition.concat((0,s.gv)(g)),ruleStack:m,occurrenceStack:y};d.push(O),d.push(a)}else if(E instanceof Ce)d.push({idx:f,def:E.definition.concat((0,s.gv)(g)),ruleStack:m,occurrenceStack:y});else{if(!(E instanceof we))throw Error("non exhaustive match");d.push(ut(E,f,m,y))}}}else l&&(0,s.HV)(d).idx<=u&&d.pop()}return c}function ut(e,t,r,n){var i=(0,s.T9)(r);i.push(e.name);var o=(0,s.T9)(n);return o.push(1),{idx:t,def:e.definition,ruleStack:i,occurrenceStack:o}}var ct,dt=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(e){e[e.OPTION=0]="OPTION",e[e.REPETITION=1]="REPETITION",e[e.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",e[e.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",e[e.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",e[e.ALTERNATION=5]="ALTERNATION"}(ct||(ct={}));var pt=function(e){function t(t,r,n){var s=e.call(this)||this;return s.topProd=t,s.targetOccurrence=r,s.targetProdType=n,s}return dt(t,e),t.prototype.startWalking=function(){return this.walk(this.topProd),this.restDef},t.prototype.checkIsTarget=function(e,t,r,n){return e.idx===this.targetOccurrence&&this.targetProdType===t&&(this.restDef=r.concat(n),!0)},t.prototype.walkOption=function(t,r,n){this.checkIsTarget(t,ct.OPTION,r,n)||e.prototype.walkOption.call(this,t,r,n)},t.prototype.walkAtLeastOne=function(t,r,n){this.checkIsTarget(t,ct.REPETITION_MANDATORY,r,n)||e.prototype.walkOption.call(this,t,r,n)},t.prototype.walkAtLeastOneSep=function(t,r,n){this.checkIsTarget(t,ct.REPETITION_MANDATORY_WITH_SEPARATOR,r,n)||e.prototype.walkOption.call(this,t,r,n)},t.prototype.walkMany=function(t,r,n){this.checkIsTarget(t,ct.REPETITION,r,n)||e.prototype.walkOption.call(this,t,r,n)},t.prototype.walkManySep=function(t,r,n){this.checkIsTarget(t,ct.REPETITION_WITH_SEPARATOR,r,n)||e.prototype.walkOption.call(this,t,r,n)},t}(Ae),gt=function(e){function t(t,r,n){var s=e.call(this)||this;return s.targetOccurrence=t,s.targetProdType=r,s.targetRef=n,s.result=[],s}return dt(t,e),t.prototype.checkIsTarget=function(e,t){e.idx!==this.targetOccurrence||this.targetProdType!==t||void 0!==this.targetRef&&e!==this.targetRef||(this.result=e.definition)},t.prototype.visitOption=function(e){this.checkIsTarget(e,ct.OPTION)},t.prototype.visitRepetition=function(e){this.checkIsTarget(e,ct.REPETITION)},t.prototype.visitRepetitionMandatory=function(e){this.checkIsTarget(e,ct.REPETITION_MANDATORY)},t.prototype.visitRepetitionMandatoryWithSeparator=function(e){this.checkIsTarget(e,ct.REPETITION_MANDATORY_WITH_SEPARATOR)},t.prototype.visitRepetitionWithSeparator=function(e){this.checkIsTarget(e,ct.REPETITION_WITH_SEPARATOR)},t.prototype.visitAlternation=function(e){this.checkIsTarget(e,ct.ALTERNATION)},t}(xe);function ft(e){for(var t=new Array(e),r=0;r1})),a=s.Tj(s.zu(o),(function(r){var n=s.$1(r),i=t.buildDuplicateFoundError(e,r),o=De(n),a={message:i,type:xr.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:o,occurrence:n.idx},l=Mt(n);return l&&(a.parameter=l),a}));return a}(e,i)})),l=s.Tj(e,(function(e){return At(e,e,i)})),h=[],u=[],c=[];(0,s.Si)(l,s.Im)&&(h=(0,s.Tj)(e,(function(e){return function(e,t){var r=new xt;e.accept(r);var n=r.alternations,i=s.TS(n,(function(r,n){var i=s.gc(n.definition),o=s.Tj(i,(function(r,i){var o=ht([r],[],null,1);return s.Im(o)?{message:t.buildEmptyAlternationError({topLevelRule:e,alternation:n,emptyChoiceIdx:i}),type:xr.NONE_LAST_EMPTY_ALT,ruleName:e.name,occurrence:n.idx,alternative:i+1}:null}));return r.concat(s.oE(o))}),[]);return i}(e,i)})),u=(0,s.Tj)(e,(function(e){return function(e,t,r,n){var i=new xt;e.accept(i);var o=i.alternations,a=r[e.name];a&&(o=(0,s.ku)(o,(function(e){return a[De(e)+(0===e.idx?"":e.idx)]})));o=(0,s.ku)(o,(function(e){return!0===e.ignoreAmbiguities}));var l=s.TS(o,(function(r,i){var o=i.idx,a=i.maxLookahead||t,l=wt(o,e,a,i),h=function(e,t,r,n){var i=[],o=(0,s.TS)(e,(function(r,n,o){return!0===t.definition[o].ignoreAmbiguities||(0,s.jJ)(n,(function(n){var a=[o];(0,s.jJ)(e,(function(e,r){o!==r&&vt(e,n)&&!0!==t.definition[r].ignoreAmbiguities&&a.push(r)})),a.length>1&&!vt(i,n)&&(i.push(n),r.push({alts:a,path:n}))})),r}),[]),a=s.Tj(o,(function(e){var i=(0,s.Tj)(e.alts,(function(e){return e+1}));return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:xr.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:t.idx,alternatives:[e.alts]}}));return a}(l,i,e,n),u=function(e,t,r,n){var i=[],o=(0,s.TS)(e,(function(e,t,r){var n=(0,s.Tj)(t,(function(e){return{idx:r,path:e}}));return e.concat(n)}),[]);return(0,s.jJ)(o,(function(e){if(!0!==t.definition[e.idx].ignoreAmbiguities){var a=e.idx,l=e.path,h=(0,s.JW)(o,(function(e){return!0!==t.definition[e.idx].ignoreAmbiguities&&e.idx1}));(0,s.jJ)((0,s.zu)(o),(function(n){var i=(0,s.Tj)(n,(function(e){return e.orgProd})),o=t.buildDuplicateNestedRuleNameError(e,i);r.push({message:o,type:xr.DUPLICATE_NESTED_NAME,ruleName:e.name})}))})),r}(e,i),m=(0,s.Tj)(e,(function(e){return function(e,t){var r=new xt;e.accept(r);var n=r.alternations,i=s.TS(n,(function(r,n){return n.definition.length>255&&r.push({message:t.buildTooManyAlternativesError({topLevelRule:e,alternation:n}),type:xr.TOO_MANY_ALTS,ruleName:e.name,occurrence:n.idx}),r}),[]);return i}(e,i)})),y=(0,s.Tj)(e,(function(e){return function(e,t){var r=[],n=e.name;n.match(bt)||r.push({message:t.buildInvalidRuleNameError({topLevelRule:e,expectedPattern:bt}),type:xr.INVALID_RULE_NAME,ruleName:n});return r}(e,i)})),E=(0,s.Tj)(e,(function(t){return function(e,t,r,n){var i=[],o=(0,s.TS)(t,(function(t,r){return r.name===e.name?t+1:t}),0);if(o>1){var a=n.buildDuplicateRuleNameError({topLevelRule:e,grammarName:r});i.push({message:a,type:xr.DUPLICATE_RULE_NAME,ruleName:e.name})}return i}(t,e,o,i)}));return s.Bq(a.concat(p,g,f,c,l,h,u,d,m,y,E))}function Nt(e){return De(e)+"_#_"+e.idx+"_#_"+Mt(e)}function Mt(e){return e instanceof _e?e.terminalType.name:e instanceof Ee?e.nonTerminalName:""}var _t=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.allProductions=[],t}return St(t,e),t.prototype.visitNonTerminal=function(e){this.allProductions.push(e)},t.prototype.visitOption=function(e){this.allProductions.push(e)},t.prototype.visitRepetitionWithSeparator=function(e){this.allProductions.push(e)},t.prototype.visitRepetitionMandatory=function(e){this.allProductions.push(e)},t.prototype.visitRepetitionMandatoryWithSeparator=function(e){this.allProductions.push(e)},t.prototype.visitRepetition=function(e){this.allProductions.push(e)},t.prototype.visitAlternation=function(e){this.allProductions.push(e)},t.prototype.visitTerminal=function(e){this.allProductions.push(e)},t}(xe),bt=/^[a-zA-Z_]\w*$/,Ot=new RegExp(bt.source.replace("^","^\\$"));function At(e,t,r,n){void 0===n&&(n=[]);var i=[],o=It(t.definition);if(s.Im(o))return[];var a=e.name;s.gR(o,e)&&i.push({message:r.buildLeftRecursionError({topLevelRule:e,leftRecursionPath:n}),type:xr.LEFT_RECURSION,ruleName:a});var l=s.iv(o,n.concat([e])),h=s.Tj(l,(function(t){var i=s.T9(n);return i.push(t),At(e,t,r,i)}));return i.concat(s.Bq(h))}function It(e){var t=[];if(s.Im(e))return t;var r=s.$1(e);if(r instanceof Ee)t.push(r.referencedRule);else if(r instanceof Ce||r instanceof ve||r instanceof Re||r instanceof Se||r instanceof Ne||r instanceof Te)t=t.concat(It(r.definition));else if(r instanceof Me)t=s.Bq(s.Tj(r.definition,(function(e){return It(e.definition)})));else if(!(r instanceof _e))throw Error("non exhaustive match");var n=Le(r),i=e.length>1;if(n&&i){var o=s.gv(e);return t.concat(It(o))}return t}var xt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.alternations=[],t}return St(t,e),t.prototype.visitAlternation=function(e){this.alternations.push(e)},t}(xe);var Pt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.allProductions=[],t}return St(t,e),t.prototype.visitRepetitionWithSeparator=function(e){this.allProductions.push(e)},t.prototype.visitRepetitionMandatory=function(e){this.allProductions.push(e)},t.prototype.visitRepetitionMandatoryWithSeparator=function(e){this.allProductions.push(e)},t.prototype.visitRepetition=function(e){this.allProductions.push(e)},t}(xe);var Lt={buildMismatchTokenMessage:function(e){var t=e.expected,r=e.actual;e.previous,e.ruleName;return"Expecting "+(re(t)?"--\x3e "+ee(t)+" <--":"token of type --\x3e "+t.name+" <--")+" but found --\x3e '"+r.image+"' <--"},buildNotAllInputParsedMessage:function(e){var t=e.firstRedundant;e.ruleName;return"Redundant input, expecting EOF but found: "+t.image},buildNoViableAltMessage:function(e){var t=e.expectedPathsPerAlt,r=e.actual,n=(e.previous,e.customUserDescription),i=(e.ruleName,"Expecting: "),o="\nbut found: '"+(0,s.$1)(r).image+"'";if(n)return i+n+o;var a=(0,s.TS)(t,(function(e,t){return e.concat(t)}),[]),l=(0,s.Tj)(a,(function(e){return"["+(0,s.Tj)(e,(function(e){return ee(e)})).join(", ")+"]"}));return i+("one of these possible Token sequences:\n"+(0,s.Tj)(l,(function(e,t){return" "+(t+1)+". "+e})).join("\n"))+o},buildEarlyExitMessage:function(e){var t=e.expectedIterationPaths,r=e.actual,n=e.customUserDescription,i=(e.ruleName,"Expecting: "),o="\nbut found: '"+(0,s.$1)(r).image+"'";return n?i+n+o:i+("expecting at least one iteration which starts with one of these possible Token sequences::\n <"+(0,s.Tj)(t,(function(e){return"["+(0,s.Tj)(e,(function(e){return ee(e)})).join(",")+"]"})).join(" ,")+">")+o}};Object.freeze(Lt);var Dt={buildRuleNotFoundError:function(e,t){return"Invalid grammar, reference to a rule which is not defined: ->"+t.nonTerminalName+"<-\ninside top level rule: ->"+e.name+"<-"}},kt={buildDuplicateFoundError:function(e,t){var r,n=e.name,i=(0,s.$1)(t),o=i.idx,a=De(i),l=(r=i)instanceof _e?r.terminalType.name:r instanceof Ee?r.nonTerminalName:"",h="->"+a+(o>0?o:"")+"<- "+(l?"with argument: ->"+l+"<-":"")+"\n appears more than once ("+t.length+" times) in the top level rule: ->"+n+"<-. \n For further details see: https://sap.github.io/chevrotain/docs/FAQ.html#NUMERICAL_SUFFIXES \n ";return h=(h=h.replace(/[ \t]+/g," ")).replace(/\s\s+/g,"\n")},buildInvalidNestedRuleNameError:function(e,t){return"Invalid nested rule name: ->"+t.name+"<- inside rule: ->"+e.name+"<-\nit must match the pattern: ->"+Ot.toString()+"<-.\nNote that this means a nested rule name must start with the '$'(dollar) sign."},buildDuplicateNestedRuleNameError:function(e,t){return"Duplicate nested rule name: ->"+(0,s.$1)(t).name+"<- inside rule: ->"+e.name+"<-\nA nested name must be unique in the scope of a top level grammar rule."},buildNamespaceConflictError:function(e){return"Namespace conflict found in grammar.\nThe grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <"+e.name+">.\nTo resolve this make sure each Terminal and Non-Terminal names are unique\nThis is easy to accomplish by using the convention that Terminal names start with an uppercase letter\nand Non-Terminal names start with a lower case letter."},buildAlternationPrefixAmbiguityError:function(e){var t=(0,s.Tj)(e.prefixPath,(function(e){return ee(e)})).join(", "),r=0===e.alternation.idx?"":e.alternation.idx;return"Ambiguous alternatives: <"+e.ambiguityIndices.join(" ,")+"> due to common lookahead prefix\nin inside <"+e.topLevelRule.name+"> Rule,\n<"+t+"> may appears as a prefix path in all these alternatives.\nSee: https://sap.github.io/chevrotain/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX\nFor Further details."},buildAlternationAmbiguityError:function(e){var t=(0,s.Tj)(e.prefixPath,(function(e){return ee(e)})).join(", "),r=0===e.alternation.idx?"":e.alternation.idx,n="Ambiguous Alternatives Detected: <"+e.ambiguityIndices.join(" ,")+"> in inside <"+e.topLevelRule.name+"> Rule,\n<"+t+"> may appears as a prefix path in all these alternatives.\n";return n+="See: https://sap.github.io/chevrotain/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details."},buildEmptyRepetitionError:function(e){var t=De(e.repetition);return 0!==e.repetition.idx&&(t+=e.repetition.idx),"The repetition <"+t+"> within Rule <"+e.topLevelRule.name+"> can never consume any tokens.\nThis could lead to an infinite loop."},buildTokenNameError:function(e){return"Invalid Grammar Token name: ->"+e.tokenType.name+"<- it must match the pattern: ->"+e.expectedPattern.toString()+"<-"},buildEmptyAlternationError:function(e){return"Ambiguous empty alternative: <"+(e.emptyChoiceIdx+1)+"> in inside <"+e.topLevelRule.name+"> Rule.\nOnly the last alternative may be an empty alternative."},buildTooManyAlternativesError:function(e){return"An Alternation cannot have more than 256 alternatives:\n inside <"+e.topLevelRule.name+"> Rule.\n has "+(e.alternation.definition.length+1)+" alternatives."},buildLeftRecursionError:function(e){var t=e.topLevelRule.name;return"Left Recursion found in grammar.\nrule: <"+t+"> can be invoked from itself (directly or indirectly)\nwithout consuming any Tokens. The grammar path that causes this is: \n "+(t+" --\x3e "+s.Tj(e.leftRecursionPath,(function(e){return e.name})).concat([t]).join(" --\x3e "))+"\n To fix this refactor your grammar to remove the left recursion.\nsee: https://en.wikipedia.org/wiki/LL_parser#Left_Factoring."},buildInvalidRuleNameError:function(e){return"Invalid grammar rule name: ->"+e.topLevelRule.name+"<- it must match the pattern: ->"+e.expectedPattern.toString()+"<-"},buildDuplicateRuleNameError:function(e){return"Duplicate definition, rule: ->"+(e.topLevelRule instanceof we?e.topLevelRule.name:e.topLevelRule)+"<- is already defined in the grammar: ->"+e.grammarName+"<-"}},Ht=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();var Ft=function(e){function t(t,r){var n=e.call(this)||this;return n.nameToTopRule=t,n.errMsgProvider=r,n.errors=[],n}return Ht(t,e),t.prototype.resolveRefs=function(){var e=this;(0,s.jJ)((0,s.zu)(this.nameToTopRule),(function(t){e.currTopLevel=t,t.accept(e)}))},t.prototype.visitNonTerminal=function(e){var t=this.nameToTopRule[e.nonTerminalName];if(t)e.referencedRule=t;else{var r=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:r,type:xr.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}},t}(xe);function Ut(e){e=(0,s.NT)(e,{errMsgProvider:Dt});var t,r,n,i={};return(0,s.jJ)(e.rules,(function(e){i[e.name]=e})),t=i,r=e.errMsgProvider,(n=new Ft(t,r)).resolveRefs(),n.errors}function Vt(e){return Tt((e=(0,s.NT)(e,{errMsgProvider:kt,ignoredIssues:{}})).rules,e.maxLookahead,e.tokenTypes,e.ignoredIssues,e.errMsgProvider,e.grammarName)}function Bt(e){(0,s.jJ)(e.rules,(function(e){var t=new ke;e.accept(t),(0,s.jJ)(t.dslMethods,(function(e){(0,s.jJ)(e,(function(e,t){e.idx=t+1}))}))}))}var Wt="MismatchedTokenException",Yt="NoViableAltException",Gt="EarlyExitException",jt="NotAllInputParsedException",zt=[Wt,Yt,Gt,jt];function $t(e){return(0,s.gR)(zt,e.name)}function Kt(e,t,r){this.name=Wt,this.message=e,this.token=t,this.previousToken=r,this.resyncedTokens=[]}function Xt(e,t,r){this.name=Yt,this.message=e,this.token=t,this.previousToken=r,this.resyncedTokens=[]}function qt(e,t){this.name=jt,this.message=e,this.token=t,this.resyncedTokens=[]}function Qt(e,t,r){this.name=Gt,this.message=e,this.token=t,this.previousToken=r,this.resyncedTokens=[]}Object.freeze(zt),Kt.prototype=Error.prototype,Xt.prototype=Error.prototype,qt.prototype=Error.prototype,Qt.prototype=Error.prototype;var Zt={},Jt="InRuleRecoveryException";function er(e){this.name=Jt,this.message=e}er.prototype=Error.prototype;var tr=function(){function e(){}return e.prototype.initRecoverable=function(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=(0,s.zy)(e,"recoveryEnabled")?e.recoveryEnabled:Pr.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=rr)},e.prototype.getTokenToInsert=function(e){var t=ge(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return t.isInsertedInRecovery=!0,t},e.prototype.canTokenTypeBeInsertedInRecovery=function(e){return!0},e.prototype.tryInRepetitionRecovery=function(e,t,r,n){for(var i=this,o=this.findReSyncTokenType(),a=this.exportLexerState(),l=[],h=!1,u=this.LA(1),c=this.LA(1),d=function(){var e=i.LA(0),t=new Kt(i.errorMessageProvider.buildMismatchTokenMessage({expected:n,actual:u,previous:e,ruleName:i.getCurrRuleFullName()}),u,i.LA(0));t.resyncedTokens=(0,s.gc)(l),i.SAVE_ERROR(t)};!h;){if(this.tokenMatcher(c,n))return void d();if(r.call(this))return d(),void e.apply(this,t);this.tokenMatcher(c,o)?h=!0:(c=this.SKIP_TOKEN(),this.addToResyncTokens(c,l))}this.importLexerState(a)},e.prototype.shouldInRepetitionRecoveryBeTried=function(e,t,r){return!1!==r&&(void 0!==e&&void 0!==t&&(!this.tokenMatcher(this.LA(1),e)&&(!this.isBackTracking()&&!this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t)))))},e.prototype.getFollowsForInRuleRecovery=function(e,t){var r=this.getCurrentGrammarPath(e,t);return this.getNextPossibleTokenTypes(r)},e.prototype.tryInRuleRecovery=function(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){var r=this.SKIP_TOKEN();return this.consumeToken(),r}throw new er("sad sad panda")},e.prototype.canPerformInRuleRecovery=function(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)},e.prototype.canRecoverWithSingleTokenInsertion=function(e,t){var r=this;if(!this.canTokenTypeBeInsertedInRecovery(e))return!1;if((0,s.Im)(t))return!1;var n=this.LA(1);return void 0!==(0,s.I6)(t,(function(e){return r.tokenMatcher(n,e)}))},e.prototype.canRecoverWithSingleTokenDeletion=function(e){return this.tokenMatcher(this.LA(2),e)},e.prototype.isInCurrentRuleReSyncSet=function(e){var t=this.getCurrFollowKey(),r=this.getFollowSetFromFollowKey(t);return(0,s.gR)(r,e)},e.prototype.findReSyncTokenType=function(){for(var e=this.flattenFollowSet(),t=this.LA(1),r=2;;){var n=t.tokenType;if((0,s.gR)(e,n))return n;t=this.LA(r),r++}},e.prototype.getCurrFollowKey=function(){if(1===this.RULE_STACK.length)return Zt;var e=this.getLastExplicitRuleShortName(),t=this.getLastExplicitRuleOccurrenceIndex(),r=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:t,inRule:this.shortRuleNameToFullName(r)}},e.prototype.buildFullFollowKeyStack=function(){var e=this,t=this.RULE_STACK,r=this.RULE_OCCURRENCE_STACK;return(0,s.Im)(this.LAST_EXPLICIT_RULE_STACK)||(t=(0,s.Tj)(this.LAST_EXPLICIT_RULE_STACK,(function(t){return e.RULE_STACK[t]})),r=(0,s.Tj)(this.LAST_EXPLICIT_RULE_STACK,(function(t){return e.RULE_OCCURRENCE_STACK[t]}))),(0,s.Tj)(t,(function(n,s){return 0===s?Zt:{ruleName:e.shortRuleNameToFullName(n),idxInCallingRule:r[s],inRule:e.shortRuleNameToFullName(t[s-1])}}))},e.prototype.flattenFollowSet=function(){var e=this,t=(0,s.Tj)(this.buildFullFollowKeyStack(),(function(t){return e.getFollowSetFromFollowKey(t)}));return(0,s.Bq)(t)},e.prototype.getFollowSetFromFollowKey=function(e){if(e===Zt)return[pe];var t=e.ruleName+e.idxInCallingRule+Ue+e.inRule;return this.resyncFollows[t]},e.prototype.addToResyncTokens=function(e,t){return this.tokenMatcher(e,pe)||t.push(e),t},e.prototype.reSyncTo=function(e){for(var t=[],r=this.LA(1);!1===this.tokenMatcher(r,e);)r=this.SKIP_TOKEN(),this.addToResyncTokens(r,t);return(0,s.gc)(t)},e.prototype.attemptInRepetitionRecovery=function(e,t,r,n,s,i,o){},e.prototype.getCurrentGrammarPath=function(e,t){return{ruleStack:this.getHumanReadableRuleStack(),occurrenceStack:(0,s.T9)(this.RULE_OCCURRENCE_STACK),lastTok:e,lastTokOccurrence:t}},e.prototype.getHumanReadableRuleStack=function(){var e=this;return(0,s.Im)(this.LAST_EXPLICIT_RULE_STACK)?(0,s.Tj)(this.RULE_STACK,(function(t){return e.shortRuleNameToFullName(t)})):(0,s.Tj)(this.LAST_EXPLICIT_RULE_STACK,(function(t){return e.shortRuleNameToFullName(e.RULE_STACK[t])}))},e}();function rr(e,t,r,n,s,i,o){var a=this.getKeyForAutomaticLookahead(n,s),l=this.firstAfterRepMap[a];if(void 0===l){var h=this.getCurrRuleFullName();l=new i(this.getGAstProductions()[h],s).startWalking(),this.firstAfterRepMap[a]=l}var u=l.token,c=l.occurrence,d=l.isEndOfRule;1===this.RULE_STACK.length&&d&&void 0===u&&(u=pe,c=1),this.shouldInRepetitionRecoveryBeTried(u,c,o)&&this.tryInRepetitionRecovery(e,t,r,u)}var nr=function(){function e(){}return e.prototype.initLooksAhead=function(e){this.dynamicTokensEnabled=(0,s.zy)(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:Pr.dynamicTokensEnabled,this.maxLookahead=(0,s.zy)(e,"maxLookahead")?e.maxLookahead:Pr.maxLookahead,this.lookAheadFuncsCache=(0,s.rF)()?new Map:[],(0,s.rF)()?(this.getLaFuncFromCache=this.getLaFuncFromMap,this.setLaFuncCache=this.setLaFuncCacheUsingMap):(this.getLaFuncFromCache=this.getLaFuncFromObj,this.setLaFuncCache=this.setLaFuncUsingObj)},e.prototype.preComputeLookaheadFunctions=function(e){var t=this;(0,s.jJ)(e,(function(e){t.TRACE_INIT(e.name+" Rule Lookahead",(function(){var r=function(e){He.reset(),e.accept(He);var t=He.dslMethods;return He.reset(),t}(e),n=r.alternation,i=r.repetition,o=r.option,a=r.repetitionMandatory,l=r.repetitionMandatoryWithSeparator,h=r.repetitionWithSeparator;(0,s.jJ)(n,(function(r){var n=0===r.idx?"":r.idx;t.TRACE_INIT(""+De(r)+n,(function(){var n,s,i,o,a,l,h,u=(n=r.idx,s=e,i=r.maxLookahead||t.maxLookahead,o=r.hasPredicates,a=t.dynamicTokensEnabled,l=t.lookAheadBuilderForAlternatives,h=wt(n,s,i),l(h,o,Rt(h)?W:B,a)),c=Ke(t.fullRuleNameToShort[e.name],We,r.idx);t.setLaFuncCache(c,u)}))})),(0,s.jJ)(i,(function(r){t.computeLookaheadFunc(e,r.idx,Ge,ct.REPETITION,r.maxLookahead,De(r))})),(0,s.jJ)(o,(function(r){t.computeLookaheadFunc(e,r.idx,Ye,ct.OPTION,r.maxLookahead,De(r))})),(0,s.jJ)(a,(function(r){t.computeLookaheadFunc(e,r.idx,je,ct.REPETITION_MANDATORY,r.maxLookahead,De(r))})),(0,s.jJ)(l,(function(r){t.computeLookaheadFunc(e,r.idx,$e,ct.REPETITION_MANDATORY_WITH_SEPARATOR,r.maxLookahead,De(r))})),(0,s.jJ)(h,(function(r){t.computeLookaheadFunc(e,r.idx,ze,ct.REPETITION_WITH_SEPARATOR,r.maxLookahead,De(r))}))}))}))},e.prototype.computeLookaheadFunc=function(e,t,r,n,s,i){var o=this;this.TRACE_INIT(""+i+(0===t?"":t),(function(){var i=function(e,t,r,n,s,i){var o=Ct(e,t,s,r),a=Rt(o)?W:B;return i(o[0],a,n)}(t,e,s||o.maxLookahead,o.dynamicTokensEnabled,n,o.lookAheadBuilderForOptional),a=Ke(o.fullRuleNameToShort[e.name],r,t);o.setLaFuncCache(a,i)}))},e.prototype.lookAheadBuilderForOptional=function(e,t,r){return function(e,t,r){var n=(0,s.Si)(e,(function(e){return 1===e.length})),i=e.length;if(n&&!r){var o=(0,s.Bq)(e);if(1===o.length&&(0,s.Im)(o[0].categoryMatches)){var a=o[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===a}}var l=(0,s.TS)(o,(function(e,t,r){return e[t.tokenTypeIdx]=!0,(0,s.jJ)(t.categoryMatches,(function(t){e[t]=!0})),e}),[]);return function(){var e=this.LA(1);return!0===l[e.tokenTypeIdx]}}return function(){e:for(var r=0;r on "+ar(e.constructor)+" CST Visitor.",type:sr.MISSING_METHOD,methodName:t}}));return(0,s.oE)(r)}(e,t),n=function(e,t){var r=[];for(var n in e)bt.test(n)&&(0,s.Tn)(e[n])&&!(0,s.gR)(cr,n)&&!(0,s.gR)(t,n)&&r.push({msg:"Redundant visitor method: <"+n+"> on "+ar(e.constructor)+" CST Visitor\nThere is no Grammar Rule corresponding to this method's name.\nFor utility methods on visitor classes use methods names that do not match /"+bt.source+"/.",type:sr.REDUNDANT_METHOD,methodName:n});return r}(e,t);return r.concat(n)}(this,t);if(!(0,s.Im)(e)){var r=(0,s.Tj)(e,(function(e){return e.msg}));throw Error("Errors Detected in CST Visitor <"+ar(this.constructor)+">:\n\t"+r.join("\n\n").replace(/\n/g,"\n\t"))}}};return(r.prototype=n).constructor=r,r._RULE_NAMES=t,r}!function(e){e[e.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",e[e.MISSING_METHOD=1]="MISSING_METHOD"}(sr||(sr={}));var cr=["constructor","visit","validateVisitor"];var dr=function(){function e(){}return e.prototype.initTreeBuilder=function(e){if(this.LAST_EXPLICIT_RULE_STACK=[],this.CST_STACK=[],this.outputCst=(0,s.zy)(e,"outputCst")?e.outputCst:Pr.outputCst,this.nodeLocationTracking=(0,s.zy)(e,"nodeLocationTracking")?e.nodeLocationTracking:Pr.nodeLocationTracking,this.outputCst)if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Ze,this.setNodeLocationFromNode=Ze,this.cstPostRule=s.tE,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=s.tE,this.setNodeLocationFromNode=s.tE,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Qe,this.setNodeLocationFromNode=Qe,this.cstPostRule=s.tE,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=s.tE,this.setNodeLocationFromNode=s.tE,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else{if(!/none/i.test(this.nodeLocationTracking))throw Error('Invalid config option: "'+e.nodeLocationTracking+'"');this.setNodeLocationFromToken=s.tE,this.setNodeLocationFromNode=s.tE,this.cstPostRule=s.tE,this.setInitialNodeLocation=s.tE}else this.cstInvocationStateUpdate=s.tE,this.cstFinallyStateUpdate=s.tE,this.cstPostTerminal=s.tE,this.cstPostNonTerminal=s.tE,this.cstPostRule=s.tE,this.getLastExplicitRuleShortName=this.getLastExplicitRuleShortNameNoCst,this.getPreviousExplicitRuleShortName=this.getPreviousExplicitRuleShortNameNoCst,this.getLastExplicitRuleOccurrenceIndex=this.getLastExplicitRuleOccurrenceIndexNoCst,this.manyInternal=this.manyInternalNoCst,this.orInternal=this.orInternalNoCst,this.optionInternal=this.optionInternalNoCst,this.atLeastOneInternal=this.atLeastOneInternalNoCst,this.manySepFirstInternal=this.manySepFirstInternalNoCst,this.atLeastOneSepFirstInternal=this.atLeastOneSepFirstInternalNoCst},e.prototype.setInitialNodeLocationOnlyOffsetRecovery=function(e){e.location={startOffset:NaN,endOffset:NaN}},e.prototype.setInitialNodeLocationOnlyOffsetRegular=function(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}},e.prototype.setInitialNodeLocationFullRecovery=function(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}},e.prototype.setInitialNodeLocationFullRegular=function(e){var t=this.LA(1);e.location={startOffset:t.startOffset,startLine:t.startLine,startColumn:t.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}},e.prototype.cstNestedInvocationStateUpdate=function(e,t){var r={name:e,fullName:this.shortRuleNameToFull[this.getLastExplicitRuleShortName()]+e,children:{}};this.setInitialNodeLocation(r),this.CST_STACK.push(r)},e.prototype.cstInvocationStateUpdate=function(e,t){this.LAST_EXPLICIT_RULE_STACK.push(this.RULE_STACK.length-1);var r={name:e,children:{}};this.setInitialNodeLocation(r),this.CST_STACK.push(r)},e.prototype.cstFinallyStateUpdate=function(){this.LAST_EXPLICIT_RULE_STACK.pop(),this.CST_STACK.pop()},e.prototype.cstNestedFinallyStateUpdate=function(){var e=this.CST_STACK.pop();this.cstPostRule(e)},e.prototype.cstPostRuleFull=function(e){var t=this.LA(0),r=e.location;r.startOffset<=t.startOffset==!0?(r.endOffset=t.endOffset,r.endLine=t.endLine,r.endColumn=t.endColumn):(r.startOffset=NaN,r.startLine=NaN,r.startColumn=NaN)},e.prototype.cstPostRuleOnlyOffset=function(e){var t=this.LA(0),r=e.location;r.startOffset<=t.startOffset==!0?r.endOffset=t.endOffset:r.startOffset=NaN},e.prototype.cstPostTerminal=function(e,t){var r,n,s,i=this.CST_STACK[this.CST_STACK.length-1];n=t,s=e,void 0===(r=i).children[s]?r.children[s]=[n]:r.children[s].push(n),this.setNodeLocationFromToken(i.location,t)},e.prototype.cstPostNonTerminal=function(e,t){if(!0!==this.isBackTracking()){var r=this.CST_STACK[this.CST_STACK.length-1];Je(r,t,e),this.setNodeLocationFromNode(r.location,e.location)}},e.prototype.getBaseCstVisitorConstructor=function(){if((0,s.b0)(this.baseCstVisitorConstructor)){var e=ur(this.className,this.allRuleNames);return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor},e.prototype.getBaseCstVisitorConstructorWithDefaults=function(){if((0,s.b0)(this.baseCstVisitorWithDefaultsConstructor)){var e=function(e,t,r){var n=function(){};lr(n,e+"BaseSemanticsWithDefaults");var i=Object.create(r.prototype);return(0,s.jJ)(t,(function(e){i[e]=hr})),(n.prototype=i).constructor=n,n}(this.className,this.allRuleNames,this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor},e.prototype.nestedRuleBeforeClause=function(e,t){var r;return void 0!==e.NAME?(r=e.NAME,this.nestedRuleInvocationStateUpdate(r,t),r):void 0},e.prototype.nestedAltBeforeClause=function(e,t,r,n){var s,i=Xe(this.getLastExplicitRuleShortName(),r,t,n);return void 0!==e.NAME?(s=e.NAME,this.nestedRuleInvocationStateUpdate(s,i),{shortName:i,nestedName:s}):void 0},e.prototype.nestedRuleFinallyClause=function(e,t){var r=this.CST_STACK,n=r[r.length-1];this.nestedRuleFinallyStateUpdate();var s=r[r.length-1];Je(s,t,n),this.setNodeLocationFromNode(s.location,n.location)},e.prototype.getLastExplicitRuleShortName=function(){var e=this.LAST_EXPLICIT_RULE_STACK[this.LAST_EXPLICIT_RULE_STACK.length-1];return this.RULE_STACK[e]},e.prototype.getLastExplicitRuleShortNameNoCst=function(){var e=this.RULE_STACK;return e[e.length-1]},e.prototype.getPreviousExplicitRuleShortName=function(){var e=this.LAST_EXPLICIT_RULE_STACK[this.LAST_EXPLICIT_RULE_STACK.length-2];return this.RULE_STACK[e]},e.prototype.getPreviousExplicitRuleShortNameNoCst=function(){var e=this.RULE_STACK;return e[e.length-2]},e.prototype.getLastExplicitRuleOccurrenceIndex=function(){var e=this.LAST_EXPLICIT_RULE_STACK[this.LAST_EXPLICIT_RULE_STACK.length-1];return this.RULE_OCCURRENCE_STACK[e]},e.prototype.getLastExplicitRuleOccurrenceIndexNoCst=function(){var e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]},e.prototype.nestedRuleInvocationStateUpdate=function(e,t){this.RULE_OCCURRENCE_STACK.push(1),this.RULE_STACK.push(t),this.cstNestedInvocationStateUpdate(e,t)},e.prototype.nestedRuleFinallyStateUpdate=function(){this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstNestedFinallyStateUpdate()},e}(),pr=function(){function e(){}return e.prototype.initLexerAdapter=function(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1},Object.defineProperty(e.prototype,"input",{get:function(){return this.tokVector},set:function(e){if(!0!==this.selfAnalysisDone)throw Error("Missing invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length},enumerable:!0,configurable:!0}),e.prototype.SKIP_TOKEN=function(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):Ir},e.prototype.LA=function(e){var t=this.currIdx+e;return t<0||this.tokVectorLength<=t?Ir:this.tokVector[t]},e.prototype.consumeToken=function(){this.currIdx++},e.prototype.exportLexerState=function(){return this.currIdx},e.prototype.importLexerState=function(e){this.currIdx=e},e.prototype.resetLexerState=function(){this.currIdx=-1},e.prototype.moveToTerminatedState=function(){this.currIdx=this.tokVector.length-1},e.prototype.getLexerPosition=function(){return this.exportLexerState()},e}(),gr=function(){function e(){}return e.prototype.ACTION=function(e){return e.call(this)},e.prototype.consume=function(e,t,r){return this.consumeInternal(t,e,r)},e.prototype.subrule=function(e,t,r){return this.subruleInternal(t,e,r)},e.prototype.option=function(e,t){return this.optionInternal(t,e)},e.prototype.or=function(e,t){return this.orInternal(t,e)},e.prototype.many=function(e,t){return this.manyInternal(e,t)},e.prototype.atLeastOne=function(e,t){return this.atLeastOneInternal(e,t)},e.prototype.CONSUME=function(e,t){return this.consumeInternal(e,0,t)},e.prototype.CONSUME1=function(e,t){return this.consumeInternal(e,1,t)},e.prototype.CONSUME2=function(e,t){return this.consumeInternal(e,2,t)},e.prototype.CONSUME3=function(e,t){return this.consumeInternal(e,3,t)},e.prototype.CONSUME4=function(e,t){return this.consumeInternal(e,4,t)},e.prototype.CONSUME5=function(e,t){return this.consumeInternal(e,5,t)},e.prototype.CONSUME6=function(e,t){return this.consumeInternal(e,6,t)},e.prototype.CONSUME7=function(e,t){return this.consumeInternal(e,7,t)},e.prototype.CONSUME8=function(e,t){return this.consumeInternal(e,8,t)},e.prototype.CONSUME9=function(e,t){return this.consumeInternal(e,9,t)},e.prototype.SUBRULE=function(e,t){return this.subruleInternal(e,0,t)},e.prototype.SUBRULE1=function(e,t){return this.subruleInternal(e,1,t)},e.prototype.SUBRULE2=function(e,t){return this.subruleInternal(e,2,t)},e.prototype.SUBRULE3=function(e,t){return this.subruleInternal(e,3,t)},e.prototype.SUBRULE4=function(e,t){return this.subruleInternal(e,4,t)},e.prototype.SUBRULE5=function(e,t){return this.subruleInternal(e,5,t)},e.prototype.SUBRULE6=function(e,t){return this.subruleInternal(e,6,t)},e.prototype.SUBRULE7=function(e,t){return this.subruleInternal(e,7,t)},e.prototype.SUBRULE8=function(e,t){return this.subruleInternal(e,8,t)},e.prototype.SUBRULE9=function(e,t){return this.subruleInternal(e,9,t)},e.prototype.OPTION=function(e){return this.optionInternal(e,0)},e.prototype.OPTION1=function(e){return this.optionInternal(e,1)},e.prototype.OPTION2=function(e){return this.optionInternal(e,2)},e.prototype.OPTION3=function(e){return this.optionInternal(e,3)},e.prototype.OPTION4=function(e){return this.optionInternal(e,4)},e.prototype.OPTION5=function(e){return this.optionInternal(e,5)},e.prototype.OPTION6=function(e){return this.optionInternal(e,6)},e.prototype.OPTION7=function(e){return this.optionInternal(e,7)},e.prototype.OPTION8=function(e){return this.optionInternal(e,8)},e.prototype.OPTION9=function(e){return this.optionInternal(e,9)},e.prototype.OR=function(e){return this.orInternal(e,0)},e.prototype.OR1=function(e){return this.orInternal(e,1)},e.prototype.OR2=function(e){return this.orInternal(e,2)},e.prototype.OR3=function(e){return this.orInternal(e,3)},e.prototype.OR4=function(e){return this.orInternal(e,4)},e.prototype.OR5=function(e){return this.orInternal(e,5)},e.prototype.OR6=function(e){return this.orInternal(e,6)},e.prototype.OR7=function(e){return this.orInternal(e,7)},e.prototype.OR8=function(e){return this.orInternal(e,8)},e.prototype.OR9=function(e){return this.orInternal(e,9)},e.prototype.MANY=function(e){this.manyInternal(0,e)},e.prototype.MANY1=function(e){this.manyInternal(1,e)},e.prototype.MANY2=function(e){this.manyInternal(2,e)},e.prototype.MANY3=function(e){this.manyInternal(3,e)},e.prototype.MANY4=function(e){this.manyInternal(4,e)},e.prototype.MANY5=function(e){this.manyInternal(5,e)},e.prototype.MANY6=function(e){this.manyInternal(6,e)},e.prototype.MANY7=function(e){this.manyInternal(7,e)},e.prototype.MANY8=function(e){this.manyInternal(8,e)},e.prototype.MANY9=function(e){this.manyInternal(9,e)},e.prototype.MANY_SEP=function(e){this.manySepFirstInternal(0,e)},e.prototype.MANY_SEP1=function(e){this.manySepFirstInternal(1,e)},e.prototype.MANY_SEP2=function(e){this.manySepFirstInternal(2,e)},e.prototype.MANY_SEP3=function(e){this.manySepFirstInternal(3,e)},e.prototype.MANY_SEP4=function(e){this.manySepFirstInternal(4,e)},e.prototype.MANY_SEP5=function(e){this.manySepFirstInternal(5,e)},e.prototype.MANY_SEP6=function(e){this.manySepFirstInternal(6,e)},e.prototype.MANY_SEP7=function(e){this.manySepFirstInternal(7,e)},e.prototype.MANY_SEP8=function(e){this.manySepFirstInternal(8,e)},e.prototype.MANY_SEP9=function(e){this.manySepFirstInternal(9,e)},e.prototype.AT_LEAST_ONE=function(e){this.atLeastOneInternal(0,e)},e.prototype.AT_LEAST_ONE1=function(e){return this.atLeastOneInternal(1,e)},e.prototype.AT_LEAST_ONE2=function(e){this.atLeastOneInternal(2,e)},e.prototype.AT_LEAST_ONE3=function(e){this.atLeastOneInternal(3,e)},e.prototype.AT_LEAST_ONE4=function(e){this.atLeastOneInternal(4,e)},e.prototype.AT_LEAST_ONE5=function(e){this.atLeastOneInternal(5,e)},e.prototype.AT_LEAST_ONE6=function(e){this.atLeastOneInternal(6,e)},e.prototype.AT_LEAST_ONE7=function(e){this.atLeastOneInternal(7,e)},e.prototype.AT_LEAST_ONE8=function(e){this.atLeastOneInternal(8,e)},e.prototype.AT_LEAST_ONE9=function(e){this.atLeastOneInternal(9,e)},e.prototype.AT_LEAST_ONE_SEP=function(e){this.atLeastOneSepFirstInternal(0,e)},e.prototype.AT_LEAST_ONE_SEP1=function(e){this.atLeastOneSepFirstInternal(1,e)},e.prototype.AT_LEAST_ONE_SEP2=function(e){this.atLeastOneSepFirstInternal(2,e)},e.prototype.AT_LEAST_ONE_SEP3=function(e){this.atLeastOneSepFirstInternal(3,e)},e.prototype.AT_LEAST_ONE_SEP4=function(e){this.atLeastOneSepFirstInternal(4,e)},e.prototype.AT_LEAST_ONE_SEP5=function(e){this.atLeastOneSepFirstInternal(5,e)},e.prototype.AT_LEAST_ONE_SEP6=function(e){this.atLeastOneSepFirstInternal(6,e)},e.prototype.AT_LEAST_ONE_SEP7=function(e){this.atLeastOneSepFirstInternal(7,e)},e.prototype.AT_LEAST_ONE_SEP8=function(e){this.atLeastOneSepFirstInternal(8,e)},e.prototype.AT_LEAST_ONE_SEP9=function(e){this.atLeastOneSepFirstInternal(9,e)},e.prototype.RULE=function(e,t,r){if(void 0===r&&(r=Lr),(0,s.gR)(this.definedRulesNames,e)){var n={message:kt.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:xr.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(n)}this.definedRulesNames.push(e);var i=this.defineRule(e,t,r);return this[e]=i,i},e.prototype.OVERRIDE_RULE=function(e,t,r){void 0===r&&(r=Lr);var n,i,o,a,l,h=[];h=h.concat((n=e,i=this.definedRulesNames,o=this.className,l=[],s.gR(i,n)||(a="Invalid rule override, rule: ->"+n+"<- cannot be overridden in the grammar: ->"+o+"<-as it is not defined in any of the super grammars ",l.push({message:a,type:xr.INVALID_RULE_OVERRIDE,ruleName:n})),l)),this.definitionErrors.push.apply(this.definitionErrors,h);var u=this.defineRule(e,t,r);return this[e]=u,u},e.prototype.BACKTRACK=function(e,t){return function(){this.isBackTrackingStack.push(1);var r=this.saveRecogState();try{return e.apply(this,t),!0}catch(e){if($t(e))return!1;throw e}finally{this.reloadRecogState(r),this.isBackTrackingStack.pop()}}},e.prototype.getGAstProductions=function(){return this.gastProductionsCache},e.prototype.getSerializedGastProductions=function(){return be((0,s.zu)(this.gastProductionsCache))},e}(),fr=function(){function e(){}return e.prototype.initRecognizerEngine=function(e,t){if(this.className=ar(this.constructor),this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=W,this.definedRulesNames=[],this.tokensMap={},this.allRuleNames=[],this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},(0,s.zy)(t,"serializedGrammar"))throw Error("The Parser's configuration can no longer contain a property.\n\tSee: https://sap.github.io/chevrotain/docs/changes/BREAKING_CHANGES.html#_6-0-0\n\tFor Further details.");if((0,s.cy)(e)){if((0,s.Im)(e))throw Error("A Token Vocabulary cannot be empty.\n\tNote that the first argument for the parser constructor\n\tis no longer a Token vector (since v4.0).");if("number"==typeof e[0].startOffset)throw Error("The Parser constructor no longer accepts a token vector as the first argument.\n\tSee: https://sap.github.io/chevrotain/docs/changes/BREAKING_CHANGES.html#_4-0-0\n\tFor Further details.")}if((0,s.cy)(e))this.tokensMap=(0,s.TS)(e,(function(e,t){return e[t.name]=t,e}),{});else if((0,s.zy)(e,"modes")&&(0,s.Si)((0,s.Bq)((0,s.zu)(e.modes)),X)){var r=(0,s.Bq)((0,s.zu)(e.modes)),n=(0,s.sb)(r);this.tokensMap=(0,s.TS)(n,(function(e,t){return e[t.name]=t,e}),{})}else{if(!(0,s.Gv)(e))throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap=(0,s.lR)(e)}this.tokensMap.EOF=pe;var i=(0,s.Si)((0,s.zu)(e),(function(e){return(0,s.Im)(e.categoryMatches)}));this.tokenMatcher=i?W:B,j((0,s.zu)(this.tokensMap))},e.prototype.defineRule=function(e,t,r){if(this.selfAnalysisDone)throw Error("Grammar rule <"+e+"> may not be defined after the 'performSelfAnalysis' method has been called'\nMake sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.");var n,i=(0,s.zy)(r,"resyncEnabled")?r.resyncEnabled:Lr.resyncEnabled,o=(0,s.zy)(r,"recoveryValueFunc")?r.recoveryValueFunc:Lr.recoveryValueFunc,a=this.ruleShortNameIdx<<12;function l(e){try{if(!0===this.outputCst){t.apply(this,e);var r=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(r),r}return t.apply(this,e)}catch(e){return this.invokeRuleCatch(e,i,o)}finally{this.ruleFinallyStateUpdate()}}this.ruleShortNameIdx++,this.shortRuleNameToFull[a]=e,this.fullRuleNameToShort[e]=a;return(n=function(t,r){return void 0===t&&(t=0),this.ruleInvocationStateUpdate(a,e,t),l.call(this,r)}).ruleName=e,n.originalGrammarAction=t,n},e.prototype.invokeRuleCatch=function(e,t,r){var n=1===this.RULE_STACK.length,s=t&&!this.isBackTracking()&&this.recoveryEnabled;if($t(e)){var i=e;if(s){var o,a=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(a))return i.resyncedTokens=this.reSyncTo(a),this.outputCst?((o=this.CST_STACK[this.CST_STACK.length-1]).recoveredNode=!0,o):r();throw this.outputCst&&((o=this.CST_STACK[this.CST_STACK.length-1]).recoveredNode=!0,i.partialCstResult=o),i}if(n)return this.moveToTerminatedState(),r();throw i}throw e},e.prototype.optionInternal=function(e,t){var r=this.getKeyForAutomaticLookahead(Ye,t),n=this.nestedRuleBeforeClause(e,r);try{return this.optionInternalLogic(e,t,r)}finally{void 0!==n&&this.nestedRuleFinallyClause(r,n)}},e.prototype.optionInternalNoCst=function(e,t){var r=this.getKeyForAutomaticLookahead(Ye,t);return this.optionInternalLogic(e,t,r)},e.prototype.optionInternalLogic=function(e,t,r){var n,s,i=this,o=this.getLaFuncFromCache(r);if(void 0!==e.DEF){if(n=e.DEF,void 0!==(s=e.GATE)){var a=o;o=function(){return s.call(i)&&a.call(i)}}}else n=e;if(!0===o.call(this))return n.call(this)},e.prototype.atLeastOneInternal=function(e,t){var r=this.getKeyForAutomaticLookahead(je,e),n=this.nestedRuleBeforeClause(t,r);try{return this.atLeastOneInternalLogic(e,t,r)}finally{void 0!==n&&this.nestedRuleFinallyClause(r,n)}},e.prototype.atLeastOneInternalNoCst=function(e,t){var r=this.getKeyForAutomaticLookahead(je,e);this.atLeastOneInternalLogic(e,t,r)},e.prototype.atLeastOneInternalLogic=function(e,t,r){var n,s,i=this,o=this.getLaFuncFromCache(r);if(void 0!==t.DEF){if(n=t.DEF,void 0!==(s=t.GATE)){var a=o;o=function(){return s.call(i)&&a.call(i)}}}else n=t;if(!0!==o.call(this))throw this.raiseEarlyExitException(e,ct.REPETITION_MANDATORY,t.ERR_MSG);for(var l=this.doSingleRepetition(n);!0===o.call(this)&&!0===l;)l=this.doSingleRepetition(n);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,t],o,je,e,ot)},e.prototype.atLeastOneSepFirstInternal=function(e,t){var r=this.getKeyForAutomaticLookahead($e,e),n=this.nestedRuleBeforeClause(t,r);try{this.atLeastOneSepFirstInternalLogic(e,t,r)}finally{void 0!==n&&this.nestedRuleFinallyClause(r,n)}},e.prototype.atLeastOneSepFirstInternalNoCst=function(e,t){var r=this.getKeyForAutomaticLookahead($e,e);this.atLeastOneSepFirstInternalLogic(e,t,r)},e.prototype.atLeastOneSepFirstInternalLogic=function(e,t,r){var n=this,s=t.DEF,i=t.SEP;if(!0!==this.getLaFuncFromCache(r).call(this))throw this.raiseEarlyExitException(e,ct.REPETITION_MANDATORY_WITH_SEPARATOR,t.ERR_MSG);s.call(this);for(var o=function(){return n.tokenMatcher(n.LA(1),i)};!0===this.tokenMatcher(this.LA(1),i);)this.CONSUME(i),s.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,o,s,at],o,$e,e,at)},e.prototype.manyInternal=function(e,t){var r=this.getKeyForAutomaticLookahead(Ge,e),n=this.nestedRuleBeforeClause(t,r);try{return this.manyInternalLogic(e,t,r)}finally{void 0!==n&&this.nestedRuleFinallyClause(r,n)}},e.prototype.manyInternalNoCst=function(e,t){var r=this.getKeyForAutomaticLookahead(Ge,e);return this.manyInternalLogic(e,t,r)},e.prototype.manyInternalLogic=function(e,t,r){var n,s,i=this,o=this.getLaFuncFromCache(r);if(void 0!==t.DEF){if(n=t.DEF,void 0!==(s=t.GATE)){var a=o;o=function(){return s.call(i)&&a.call(i)}}}else n=t;for(var l=!0;!0===o.call(this)&&!0===l;)l=this.doSingleRepetition(n);this.attemptInRepetitionRecovery(this.manyInternal,[e,t],o,Ge,e,st,l)},e.prototype.manySepFirstInternal=function(e,t){var r=this.getKeyForAutomaticLookahead(ze,e),n=this.nestedRuleBeforeClause(t,r);try{this.manySepFirstInternalLogic(e,t,r)}finally{void 0!==n&&this.nestedRuleFinallyClause(r,n)}},e.prototype.manySepFirstInternalNoCst=function(e,t){var r=this.getKeyForAutomaticLookahead(ze,e);this.manySepFirstInternalLogic(e,t,r)},e.prototype.manySepFirstInternalLogic=function(e,t,r){var n=this,s=t.DEF,i=t.SEP;if(!0===this.getLaFuncFromCache(r).call(this)){s.call(this);for(var o=function(){return n.tokenMatcher(n.LA(1),i)};!0===this.tokenMatcher(this.LA(1),i);)this.CONSUME(i),s.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,o,s,it],o,ze,e,it)}},e.prototype.repetitionSepSecondInternal=function(e,t,r,n,s){for(;r();)this.CONSUME(t),n.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,t,r,n,s],r,$e,e,s)},e.prototype.doSingleRepetition=function(e){var t=this.getLexerPosition();return e.call(this),this.getLexerPosition()>t},e.prototype.orInternalNoCst=function(e,t){var r=(0,s.cy)(e)?e:e.DEF,n=this.getKeyForAutomaticLookahead(We,t),i=this.getLaFuncFromCache(n).call(this,r);if(void 0!==i)return r[i].ALT.call(this);this.raiseNoAltException(t,e.ERR_MSG)},e.prototype.orInternal=function(e,t){var r=this.getKeyForAutomaticLookahead(We,t),n=this.nestedRuleBeforeClause(e,r);try{var i=(0,s.cy)(e)?e:e.DEF,o=this.getLaFuncFromCache(r).call(this,i);if(void 0!==o){var a=i[o],l=this.nestedAltBeforeClause(a,t,We,o);try{return a.ALT.call(this)}finally{void 0!==l&&this.nestedRuleFinallyClause(l.shortName,l.nestedName)}}this.raiseNoAltException(t,e.ERR_MSG)}finally{void 0!==n&&this.nestedRuleFinallyClause(r,n)}},e.prototype.ruleFinallyStateUpdate=function(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),0===this.RULE_STACK.length&&!1===this.isAtEndOfInput()){var e=this.LA(1),t=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new qt(t,e))}},e.prototype.subruleInternal=function(e,t,r){var n;try{var s=void 0!==r?r.ARGS:void 0;return n=e.call(this,t,s),this.cstPostNonTerminal(n,void 0!==r&&void 0!==r.LABEL?r.LABEL:e.ruleName),n}catch(t){this.subruleInternalError(t,r,e.ruleName)}},e.prototype.subruleInternalError=function(e,t,r){throw $t(e)&&void 0!==e.partialCstResult&&(this.cstPostNonTerminal(e.partialCstResult,void 0!==t&&void 0!==t.LABEL?t.LABEL:r),delete e.partialCstResult),e},e.prototype.consumeInternal=function(e,t,r){var n;try{var s=this.LA(1);!0===this.tokenMatcher(s,e)?(this.consumeToken(),n=s):this.consumeInternalError(e,s,r)}catch(r){n=this.consumeInternalRecovery(e,t,r)}return this.cstPostTerminal(void 0!==r&&void 0!==r.LABEL?r.LABEL:e.name,n),n},e.prototype.consumeInternalError=function(e,t,r){var n,s=this.LA(0);throw n=void 0!==r&&r.ERR_MSG?r.ERR_MSG:this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:t,previous:s,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new Kt(n,t,s))},e.prototype.consumeInternalRecovery=function(e,t,r){if(!this.recoveryEnabled||"MismatchedTokenException"!==r.name||this.isBackTracking())throw r;var n=this.getFollowsForInRuleRecovery(e,t);try{return this.tryInRuleRecovery(e,n)}catch(e){throw e.name===Jt?r:e}},e.prototype.saveRecogState=function(){var e=this.errors,t=(0,s.T9)(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:t,CST_STACK:this.CST_STACK,LAST_EXPLICIT_RULE_STACK:this.LAST_EXPLICIT_RULE_STACK}},e.prototype.reloadRecogState=function(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK},e.prototype.ruleInvocationStateUpdate=function(e,t,r){this.RULE_OCCURRENCE_STACK.push(r),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(t,e)},e.prototype.isBackTracking=function(){return 0!==this.isBackTrackingStack.length},e.prototype.getCurrRuleFullName=function(){var e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]},e.prototype.shortRuleNameToFullName=function(e){return this.shortRuleNameToFull[e]},e.prototype.isAtEndOfInput=function(){return this.tokenMatcher(this.LA(1),pe)},e.prototype.reset=function(){this.resetLexerState(),this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.LAST_EXPLICIT_RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]},e}(),mr=function(){function e(){}return e.prototype.initErrorHandler=function(e){this._errors=[],this.errorMessageProvider=(0,s.NT)(e.errorMessageProvider,Pr.errorMessageProvider)},e.prototype.SAVE_ERROR=function(e){if($t(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:(0,s.T9)(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")},Object.defineProperty(e.prototype,"errors",{get:function(){return(0,s.T9)(this._errors)},set:function(e){this._errors=e},enumerable:!0,configurable:!0}),e.prototype.raiseEarlyExitException=function(e,t,r){for(var n=this.getCurrRuleFullName(),s=Ct(e,this.getGAstProductions()[n],t,this.maxLookahead)[0],i=[],o=1;o<=this.maxLookahead;o++)i.push(this.LA(o));var a=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:s,actual:i,previous:this.LA(0),customUserDescription:r,ruleName:n});throw this.SAVE_ERROR(new Qt(a,this.LA(1),this.LA(0)))},e.prototype.raiseNoAltException=function(e,t){for(var r=this.getCurrRuleFullName(),n=wt(e,this.getGAstProductions()[r],this.maxLookahead),s=[],i=1;i<=this.maxLookahead;i++)s.push(this.LA(i));var o=this.LA(0),a=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:n,actual:s,previous:o,customUserDescription:t,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new Xt(a,this.LA(1),o))},e}(),yr=function(){function e(){}return e.prototype.initContentAssist=function(){},e.prototype.computeContentAssist=function(e,t){var r=this.gastProductionsCache[e];if((0,s.b0)(r))throw Error("Rule ->"+e+"<- does not exist in this grammar.");return ht([r],t,this.tokenMatcher,this.maxLookahead)},e.prototype.getNextPossibleTokenTypes=function(e){var t=(0,s.$1)(e.ruleStack),r=this.getGAstProductions()[t];return new rt(r,e).startWalking()},e}(),Er={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(Er);var wr=!0,Cr=Math.pow(2,8)-1,vr=de({name:"RECORDING_PHASE_TOKEN",pattern:J.NA});j([vr]);var Rr=ge(vr,"This IToken indicates the Parser is in Recording Phase\n\tSee: https://sap.github.io/chevrotain/docs/guide/internals.html#grammar-recording for details",-1,-1,-1,-1,-1,-1);Object.freeze(Rr);var Sr={name:"This CSTNode indicates the Parser is in Recording Phase\n\tSee: https://sap.github.io/chevrotain/docs/guide/internals.html#grammar-recording for details",children:{}},Tr=function(){function e(){}return e.prototype.initGastRecorder=function(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1},e.prototype.enableRecording=function(){var e=this;this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",(function(){for(var t=function(t){var r=t>0?t:"";e["CONSUME"+r]=function(e,r){return this.consumeInternalRecord(e,t,r)},e["SUBRULE"+r]=function(e,r){return this.subruleInternalRecord(e,t,r)},e["OPTION"+r]=function(e){return this.optionInternalRecord(e,t)},e["OR"+r]=function(e){return this.orInternalRecord(e,t)},e["MANY"+r]=function(e){this.manyInternalRecord(t,e)},e["MANY_SEP"+r]=function(e){this.manySepFirstInternalRecord(t,e)},e["AT_LEAST_ONE"+r]=function(e){this.atLeastOneInternalRecord(t,e)},e["AT_LEAST_ONE_SEP"+r]=function(e){this.atLeastOneSepFirstInternalRecord(t,e)}},r=0;r<10;r++)t(r);e.consume=function(e,t,r){return this.consumeInternalRecord(t,e,r)},e.subrule=function(e,t,r){return this.subruleInternalRecord(t,e,r)},e.option=function(e,t){return this.optionInternalRecord(t,e)},e.or=function(e,t){return this.orInternalRecord(t,e)},e.many=function(e,t){this.manyInternalRecord(e,t)},e.atLeastOne=function(e,t){this.atLeastOneInternalRecord(e,t)},e.ACTION=e.ACTION_RECORD,e.BACKTRACK=e.BACKTRACK_RECORD,e.LA=e.LA_RECORD}))},e.prototype.disableRecording=function(){var e=this;this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",(function(){for(var t=0;t<10;t++){var r=t>0?t:"";delete e["CONSUME"+r],delete e["SUBRULE"+r],delete e["OPTION"+r],delete e["OR"+r],delete e["MANY"+r],delete e["MANY_SEP"+r],delete e["AT_LEAST_ONE"+r],delete e["AT_LEAST_ONE_SEP"+r]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA}))},e.prototype.ACTION_RECORD=function(e){},e.prototype.BACKTRACK_RECORD=function(e,t){return function(){return!0}},e.prototype.LA_RECORD=function(e){return Ir},e.prototype.topLevelRuleRecord=function(e,t){try{var r=new we({definition:[],name:e});return r.name=e,this.recordingProdStack.push(r),t.call(this),this.recordingProdStack.pop(),r}catch(e){if(!0!==e.KNOWN_RECORDER_ERROR)try{e.message=e.message+'\n\t This error was thrown during the "grammar recording phase" For more info see:\n\thttps://sap.github.io/chevrotain/docs/guide/internals.html#grammar-recording'}catch(t){throw e}throw e}},e.prototype.optionInternalRecord=function(e,t){return Nr.call(this,ve,e,t)},e.prototype.atLeastOneInternalRecord=function(e,t){Nr.call(this,Re,t,e)},e.prototype.atLeastOneSepFirstInternalRecord=function(e,t){Nr.call(this,Se,t,e,wr)},e.prototype.manyInternalRecord=function(e,t){Nr.call(this,Te,t,e)},e.prototype.manySepFirstInternalRecord=function(e,t){Nr.call(this,Ne,t,e,wr)},e.prototype.orInternalRecord=function(e,t){return Mr.call(this,e,t)},e.prototype.subruleInternalRecord=function(e,t,r){if(br(t),!e||!1===(0,s.zy)(e,"ruleName")){var n=new Error(" argument is invalid expecting a Parser method reference but got: <"+JSON.stringify(e)+">\n inside top level rule: <"+this.recordingProdStack[0].name+">");throw n.KNOWN_RECORDER_ERROR=!0,n}var i=(0,s.se)(this.recordingProdStack),o=e.ruleName,a=new Ee({idx:t,nonTerminalName:o,referencedRule:void 0});return i.definition.push(a),this.outputCst?Sr:Er},e.prototype.consumeInternalRecord=function(e,t,r){if(br(t),!$(e)){var n=new Error(" argument is invalid expecting a TokenType reference but got: <"+JSON.stringify(e)+">\n inside top level rule: <"+this.recordingProdStack[0].name+">");throw n.KNOWN_RECORDER_ERROR=!0,n}var i=(0,s.se)(this.recordingProdStack),o=new _e({idx:t,terminalType:e});return i.definition.push(o),Rr},e}();function Nr(e,t,r,n){void 0===n&&(n=!1),br(r);var i=(0,s.se)(this.recordingProdStack),o=(0,s.Tn)(t)?t:t.DEF,a=new e({definition:[],idx:r});return(0,s.zy)(t,"NAME")&&(a.name=t.NAME),n&&(a.separator=t.SEP),(0,s.zy)(t,"MAX_LOOKAHEAD")&&(a.maxLookahead=t.MAX_LOOKAHEAD),this.recordingProdStack.push(a),o.call(this),i.definition.push(a),this.recordingProdStack.pop(),Er}function Mr(e,t){var r=this;br(t);var n=(0,s.se)(this.recordingProdStack),i=!1===(0,s.cy)(e),o=!1===i?e:e.DEF,a=new Me({definition:[],idx:t,ignoreAmbiguities:i&&!0===e.IGNORE_AMBIGUITIES});(0,s.zy)(e,"NAME")&&(a.name=e.NAME),(0,s.zy)(e,"MAX_LOOKAHEAD")&&(a.maxLookahead=e.MAX_LOOKAHEAD);var l=(0,s.zN)(o,(function(e){return(0,s.Tn)(e.GATE)}));return a.hasPredicates=l,n.definition.push(a),(0,s.jJ)(o,(function(e){var t=new Ce({definition:[]});a.definition.push(t),(0,s.zy)(e,"NAME")&&(t.name=e.NAME),(0,s.zy)(e,"IGNORE_AMBIGUITIES")?t.ignoreAmbiguities=e.IGNORE_AMBIGUITIES:(0,s.zy)(e,"GATE")&&(t.ignoreAmbiguities=!0),r.recordingProdStack.push(t),e.ALT.call(r),r.recordingProdStack.pop()})),Er}function _r(e){return 0===e?"":""+e}function br(e){if(e<0||e>Cr){var t=new Error("Invalid DSL Method idx value: <"+e+">\n\tIdx value must be a none negative value smaller than "+(Cr+1));throw t.KNOWN_RECORDER_ERROR=!0,t}}var Or=function(){function e(){}return e.prototype.initPerformanceTracer=function(e){if((0,s.zy)(e,"traceInitPerf")){var t=e.traceInitPerf,r="number"==typeof t;this.traceInitMaxIdent=r?t:1/0,this.traceInitPerf=r?t>0:t}else this.traceInitMaxIdent=0,this.traceInitPerf=Pr.traceInitPerf;this.traceInitIndent=-1},e.prototype.TRACE_INIT=function(e,t){if(!0===this.traceInitPerf){this.traceInitIndent++;var r=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent");var n=(0,s.O1)(t),i=n.time,o=n.value,a=i>10?console.warn:console.log;return this.traceInitIndent time: "+i+"ms"),this.traceInitIndent--,o}return t()},e}(),Ar=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ir=ge(pe,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(Ir);var xr,Pr=Object.freeze({recoveryEnabled:!1,maxLookahead:4,ignoredIssues:{},dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Lt,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),Lr=Object.freeze({recoveryValueFunc:function(){},resyncEnabled:!0});function Dr(e){return void 0===e&&(e=void 0),function(){return e}}!function(e){e[e.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",e[e.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",e[e.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",e[e.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",e[e.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",e[e.LEFT_RECURSION=5]="LEFT_RECURSION",e[e.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",e[e.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",e[e.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",e[e.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",e[e.INVALID_NESTED_RULE_NAME=10]="INVALID_NESTED_RULE_NAME",e[e.DUPLICATE_NESTED_NAME=11]="DUPLICATE_NESTED_NAME",e[e.NO_NON_EMPTY_LOOKAHEAD=12]="NO_NON_EMPTY_LOOKAHEAD",e[e.AMBIGUOUS_PREFIX_ALTS=13]="AMBIGUOUS_PREFIX_ALTS",e[e.TOO_MANY_ALTS=14]="TOO_MANY_ALTS"}(xr||(xr={}));var kr=function(){function e(e,t){void 0===t&&(t=Pr),this.ignoredIssues=Pr.ignoredIssues,this.definitionErrors=[],this.selfAnalysisDone=!1;var r=this;r.initErrorHandler(t),r.initLexerAdapter(),r.initLooksAhead(t),r.initRecognizerEngine(e,t),r.initRecoverable(t),r.initTreeBuilder(t),r.initContentAssist(),r.initGastRecorder(t),r.initPerformanceTracer(t),(0,s.zy)(t,"ignoredIssues")&&t.ignoredIssues!==Pr.ignoredIssues&&(0,s.x5)("The IParserConfig property is soft-deprecated and will be removed in future versions.\n\tPlease use the flag on the relevant DSL method instead."),this.ignoredIssues=(0,s.zy)(t,"ignoredIssues")?t.ignoredIssues:Pr.ignoredIssues,this.skipValidations=(0,s.zy)(t,"skipValidations")?t.skipValidations:Pr.skipValidations}return e.performSelfAnalysis=function(e){e.performSelfAnalysis()},e.prototype.performSelfAnalysis=function(){var t=this;this.TRACE_INIT("performSelfAnalysis",(function(){var r;t.selfAnalysisDone=!0;var n=t.className;t.TRACE_INIT("toFastProps",(function(){(0,s.Bl)(t)})),t.TRACE_INIT("Grammar Recording",(function(){try{t.enableRecording(),(0,s.jJ)(t.definedRulesNames,(function(e){var r=t[e].originalGrammarAction,n=void 0;t.TRACE_INIT(e+" Rule",(function(){n=t.topLevelRuleRecord(e,r)})),t.gastProductionsCache[e]=n}))}finally{t.disableRecording()}}));var i=[];if(t.TRACE_INIT("Grammar Resolving",(function(){i=Ut({rules:(0,s.zu)(t.gastProductionsCache)}),t.definitionErrors.push.apply(t.definitionErrors,i)})),t.TRACE_INIT("Grammar Validations",(function(){if((0,s.Im)(i)&&!1===t.skipValidations){var e=Vt({rules:(0,s.zu)(t.gastProductionsCache),maxLookahead:t.maxLookahead,tokenTypes:(0,s.zu)(t.tokensMap),ignoredIssues:t.ignoredIssues,errMsgProvider:kt,grammarName:n});t.definitionErrors.push.apply(t.definitionErrors,e)}})),(0,s.Im)(t.definitionErrors)&&(t.recoveryEnabled&&t.TRACE_INIT("computeAllProdsFollows",(function(){var e,r,n=(e=(0,s.zu)(t.gastProductionsCache),r={},(0,s.jJ)(e,(function(e){var t=new Be(e).startWalking();(0,s.kp)(r,t)})),r);t.resyncFollows=n})),t.TRACE_INIT("ComputeLookaheadFunctions",(function(){t.preComputeLookaheadFunctions((0,s.zu)(t.gastProductionsCache))}))),t.TRACE_INIT("expandAllNestedRuleNames",(function(){var e,r,n,i=(e=(0,s.zu)(t.gastProductionsCache),r=t.fullRuleNameToShort,n={allRuleNames:[]},(0,s.jJ)(e,(function(e){var t=r[e.name];n.allRuleNames.push(e.name);var i=new et(t);e.accept(i),(0,s.jJ)(i.result,(function(t){t.def,t.key;var r=t.name;n.allRuleNames.push(e.name+r)}))})),n);t.allRuleNames=i.allRuleNames})),!e.DEFER_DEFINITION_ERRORS_HANDLING&&!(0,s.Im)(t.definitionErrors))throw r=(0,s.Tj)(t.definitionErrors,(function(e){return e.message})),new Error("Parser Definition Errors detected:\n "+r.join("\n-------------------------------\n"))}))},e.DEFER_DEFINITION_ERRORS_HANDLING=!1,e}();(0,s.XJ)(kr,[tr,nr,dr,pr,fr,gr,mr,yr,Tr,Or]);var Hr=function(e){function t(t,r){void 0===r&&(r=Pr);var n=(0,s.lR)(r);return n.outputCst=!0,e.call(this,t,n)||this}return Ar(t,e),t}(kr),Fr=function(e){function t(t,r){void 0===r&&(r=Pr);var n=(0,s.lR)(r);return n.outputCst=!1,e.call(this,t,n)||this}return Ar(t,e),t}(kr);function Ur(e,t){var r=void 0===t?{}:t,s=r.resourceBase,i=void 0===s?"https://unpkg.com/chevrotain@"+n+"/diagrams/":s,o=r.css;return'\n\x3c!-- This is a generated file --\x3e\n\n\n\n\n'+("\n\n")+("\n + + + + + + + + + - - IP KVM & OC Tuner - - - -
- + + + IP KVM & OC Tuner + + + +
+
+ +
+
+
+
- - - - - - -
-
- - Your browser is unfortunately not supported. - +
+
+ + + + + + + +
+
+ +
+
+
+
+
+ + Your browser is unfortunately not supported. + +
+
+
- +
+ + \ No newline at end of file diff --git a/webui/ipkvm/util/graphs.py b/webui/ipkvm/util/graphs.py new file mode 100644 index 0000000..7b7c984 --- /dev/null +++ b/webui/ipkvm/util/graphs.py @@ -0,0 +1,75 @@ +import networkx as nx +from networkx import Graph +from typing import Any +from ipkvm import esp32_serial +from ipkvm.util.mkb import ASCII2JS +import time +import tomlkit + +# Type checker lunacy! +type MultiDiGraph = Graph[Any] +visited_edges: list[set[str | int]] = [] + +with open("OC/test_oc_profile.toml") as file: + settings = tomlkit.parse(file.read()) + +key_delay = 0.1 + +def traverse_path(graph: MultiDiGraph, node_a: str, node_b: str, visited_edges: list[set[str | int]]): + path = nx.shortest_path(graph, node_a, node_b) + path_edges = list(zip(path[:-1], path[1:])) + edge_path= [(u, v, graph[u][v]) for u, v in path_edges] + + for step in edge_path: + if "initial_keypath" in step[2][0] and step[2][0]["visited"] == "false": + keys = step[2][0]["initial_keypath"].split(',') + # Type checker is simply wrong! This is the correct usage! + graph.edges[step[0], step[1], 0]["visited"] = "true" # type: ignore + + else: + keys = step[2][0]["keypath"].split(',') + + for key in keys: + time.sleep(key_delay) + esp32_serial.ez_press_key(key) + +def apply_setting(graph: MultiDiGraph, setting_node: str, new_value: str): + if graph.nodes[setting_node]["option_type"] == "list": + possible_values = graph.nodes[setting_node]["options"].split(',') + key = graph.nodes[setting_node]["traversal_key"] + + time.sleep(key_delay) + esp32_serial.ez_press_key("Enter") + + for value in possible_values: + time.sleep(key_delay) + if value == new_value: + esp32_serial.ez_press_key("Enter") + break + + else: + esp32_serial.ez_press_key(key) + + elif graph.nodes[setting_node]["option_type"] == "field": + for key in new_value: + time.sleep(key_delay) + esp32_serial.ez_press_key(ASCII2JS[key]) + time.sleep(key_delay) + esp32_serial.ez_press_key("Enter") + + print(f"Changed {setting_node} from {graph.nodes[setting_node]["value"]} to {new_value}!") + graph.nodes[setting_node]["value"] = new_value + + + +def test_route(): + graph: MultiDiGraph = nx.nx_agraph.read_dot("bios-maps/asrock/b650e-riptide-wifi.gv") + + current_node = "Main" + + for category in settings: + for setting_node in settings[category]: + if graph.nodes[setting_node]["value"] != settings[category][setting_node]: + traverse_path(graph, current_node, setting_node, visited_edges) + current_node = setting_node + apply_setting(graph, setting_node, settings[category][setting_node]) diff --git a/webui/ipkvm/util/mkb.py b/webui/ipkvm/util/mkb.py index 8f729b2..36908a8 100644 --- a/webui/ipkvm/util/mkb.py +++ b/webui/ipkvm/util/mkb.py @@ -11,6 +11,280 @@ from collections.abc import Mapping # python can't use NUMBERS as enum keys?! +PoweredUpCodeDef = { + 1: "System is entering S1 sleep state", + 2: "System is entering S2 sleep state", + 3: "System is entering S3 sleep state", + 4: "System is entering S4 sleep state", + 5: "System is entering S5 sleep state", + 16: "System is waking up from the S1 sleep state", + 32: "System is waking up from the S2 sleep state", + 48: "System is waking up from the S3 sleep state", + 64: "System is waking up from the S4 sleep state", + 170: "System has transitioned into ACPI mode. Interrupt controller is in APIC mode", + 172: "System has transitioned into ACPI mode. Interrupt controller is in APIC mode", + 255: "Indicates a failure has occurred" +} + +POSTTextDef = { + 0: "Not used", + 1: "Power on. Reset type detection (soft/hard)", + 2: "AP initialization before microcode loading", + 3: "System Agent initialization before microcode loading", + 4: "PCH initialization before microcode loading", + 5: "OEM initialization before microcode loading", + 6: "Microcode loading", + 7: "AP initialization after microcode loading", + 8: "System Agent initialization after microcode loading", + 9: "PCH initialization after microcode loading", + 10: "OEM initialization after microcode loading", + 11: "Cache initialization", + 12: "Reserved for future AMI SEC error codes", + 13: "Reserved for future AMI SEC error codes", + 14: "Microcode not found", + 15: "Microcode not loaded", + 16: "PEI Core is started", + 17: "Pre-memory CPU initialization is started", + 18: "Pre-memory CPU initialization (CPU module specific)", + 19: "Pre-memory CPU initialization (CPU module specific)", + 20: "Pre-memory CPU initialization (CPU module specific)", + 21: "Pre-memory System Agent initialization is started", + 22: "Pre-Memory System Agent initialization (System Agent module specific)", + 23: "Pre-Memory System Agent initialization (System Agent module specific)", + 24: "Pre-Memory System Agent initialization (System Agent module specific)", + 25: "Pre-memory PCH initialization is started", + 26: "Pre-memory PCH initialization (PCH module specific)", + 27: "Pre-memory PCH initialization (PCH module specific)", + 28: "Pre-memory PCH initialization (PCH module specific)", + 29: "OEM pre-memory initialization codes", + 30: "OEM pre-memory initialization codes", + 31: "OEM pre-memory initialization codes", + 32: "OEM pre-memory initialization codes", + 33: "OEM pre-memory initialization codes", + 34: "OEM pre-memory initialization codes", + 35: "OEM pre-memory initialization codes", + 36: "OEM pre-memory initialization codes", + 37: "OEM pre-memory initialization codes", + 38: "OEM pre-memory initialization codes", + 39: "OEM pre-memory initialization codes", + 40: "OEM pre-memory initialization codes", + 41: "OEM pre-memory initialization codes", + 42: "OEM pre-memory initialization codes", + 43: "Memory initialization. Serial Presence Detect (SPD) data reading", + 44: "Memory initialization. Memory presence detection", + 45: "Memory initialization. Programming memory timing information", + 46: "Memory initialization. Confi guring memory", + 47: "Memory initialization (other)", + 48: "Reserved for ASL", + 49: "Memory Installed", + 50: "CPU post-memory initialization is started", + 51: "CPU post-memory initialization. Cache initialization", + 52: "CPU post-memory initialization. Application Processor(s) (AP) initialization", + 53: "CPU post-memory initialization. Boot Strap Processor (BSP) selection", + 54: "CPU post-memory initialization. System Management Mode (SMM) initialization", + 55: "Post-Memory System Agent initialization is started", + 56: "Post-Memory System Agent initialization (System Agent module specific)", + 57: "Post-Memory System Agent initialization (System Agent module specific)", + 58: "Post-Memory System Agent initialization (System Agent module specific)", + 59: "Post-Memory PCH initialization is started", + 60: "Post-Memory PCH initialization (PCH module specific)", + 61: "Post-Memory PCH initialization (PCH module specific)", + 62: "Post-Memory PCH initialization (PCH module specific)", + 63: "OEM post memory initialization codes", + 64: "OEM post memory initialization codes", + 65: "OEM post memory initialization codes", + 66: "OEM post memory initialization codes", + 67: "OEM post memory initialization codes", + 68: "OEM post memory initialization codes", + 69: "OEM post memory initialization codes", + 70: "OEM post memory initialization codes", + 71: "OEM post memory initialization codes", + 72: "OEM post memory initialization codes", + 73: "OEM post memory initialization codes", + 74: "OEM post memory initialization codes", + 75: "OEM post memory initialization codes", + 76: "OEM post memory initialization codes", + 77: "OEM post memory initialization codes", + 78: "OEM post memory initialization codes", + 79: "DXE IPL is started", + 80: "Memory initialization error. Invalid memory type or incompatible memory speed", + 81: "Memory initialization error. SPD reading has failed", + 82: "Memory initialization error. Invalid memory size or memory modules do not match", + 83: "Memory initialization error. No usable memory detected", + 84: "Unspecified memory initialization error", + 85: "Memory not installed", + 86: "Invalid CPU type or Speed", + 87: "CPU mismatch", + 88: "CPU self test failed or possible CPU cache error", + 89: "CPU micro-code is not found or micro-code update is failed", + 90: "Internal CPU error", + 91: "reset PPI is not available", + 92: "Reserved for future AMI error codes", + 93: "Reserved for future AMI error codes", + 94: "Reserved for future AMI error codes", + 95: "Reserved for future AMI error codes", + 96: "DXE Core is started", + 97: "NVRAM initialization", + 98: "Installation of the PCH Runtime Services", + 99: "CPU DXE initialization is started", + 100: "CPU DXE initialization (CPU module specific)", + 101: "CPU DXE initialization (CPU module specific)", + 102: "CPU DXE initialization (CPU module specific)", + 103: "CPU DXE initialization (CPU module specific)", + 104: "PCI host bridge initialization", + 105: "System Agent DXE initialization is started", + 106: "System Agent DXE SMM initialization is started", + 107: "System Agent DXE initialization (System Agent module specific)", + 108: "System Agent DXE initialization (System Agent module specific)", + 109: "System Agent DXE initialization (System Agent module specific)", + 110: "System Agent DXE initialization (System Agent module specific)", + 111: "System Agent DXE initialization (System Agent module specific)", + 112: "PCH DXE initialization is started", + 113: "PCH DXE SMM initialization is started", + 114: "PCH devices initialization", + 115: "PCH DXE Initialization (PCH module specific)", + 116: "PCH DXE Initialization (PCH module specific)", + 117: "PCH DXE Initialization (PCH module specific)", + 118: "PCH DXE Initialization (PCH module specific)", + 119: "PCH DXE Initialization (PCH module specific)", + 120: "ACPI module initialization", + 121: "CSM initialization", + 122: "Reserved for future AMI DXE codes", + 123: "Reserved for future AMI DXE codes", + 124: "Reserved for future AMI DXE codes", + 125: "Reserved for future AMI DXE codes", + 126: "Reserved for future AMI DXE codes", + 127: "Reserved for future AMI DXE codes", + 128: "OEM DXE initialization codes", + 129: "OEM DXE initialization codes", + 130: "OEM DXE initialization codes", + 131: "OEM DXE initialization codes", + 132: "OEM DXE initialization codes", + 133: "OEM DXE initialization codes", + 134: "OEM DXE initialization codes", + 135: "OEM DXE initialization codes", + 136: "OEM DXE initialization codes", + 137: "OEM DXE initialization codes", + 138: "OEM DXE initialization codes", + 139: "OEM DXE initialization codes", + 140: "OEM DXE initialization codes", + 141: "OEM DXE initialization codes", + 142: "OEM DXE initialization codes", + 143: "OEM DXE initialization codes", + 144: "Boot Device Selection (BDS) phase is started", + 145: "Driver connecting is started", + 146: "PCI Bus initialization is started", + 147: "PCI Bus Hot Plug Controller Initialization", + 148: "PCI Bus Enumeration 32", + 149: "PCI Bus Request Resources", + 150: "PCI Bus Assign Resources", + 151: "Console Output devices connect", + 152: "Console input devices connect", + 153: "Super IO Initialization", + 154: "USB initialization is started", + 155: "USB Reset", + 156: "USB Detect", + 157: "USB Enable", + 158: "Reserved for future AMI codes", + 159: "Reserved for future AMI codes", + 160: "IDE initialization is started", + 161: "IDE Reset", + 162: "IDE Detect", + 163: "IDE Enable", + 164: "SCSI initialization is started", + 165: "SCSI Reset", + 166: "SCSI Detect", + 167: "SCSI Enable", + 168: "Setup Verifying Password", + 169: "Start of Setup", + 170: "Reserved for ASL", + 171: "Setup Input Wait", + 172: "Reserved for ASL", + 173: "Ready To Boot event", + 174: "Legacy Boot event", + 175: "Exit Boot Services event", + 176: "Runtime Set Virtual Address MAP Begin", + 177: "Runtime Set Virtual Address MAP End", + 178: "Legacy Option ROM Initialization", + 179: "System Reset", + 180: "USB hot plug", + 181: "PCI bus hot plug", + 182: "Clean-up of NVRAM", + 183: "Confi guration Reset (reset of NVRAM settings)", + 184: "Reserved for future AMI codes", + 185: "Reserved for future AMI codes", + 186: "Reserved for future AMI codes", + 187: "Reserved for future AMI codes", + 188: "Reserved for future AMI codes", + 189: "Reserved for future AMI codes", + 190: "Reserved for future AMI codes", + 191: "Reserved for future AMI codes", + 192: "OEM BDS initialization codes", + 193: "OEM BDS initialization codes", + 194: "OEM BDS initialization codes", + 195: "OEM BDS initialization codes", + 196: "OEM BDS initialization codes", + 197: "OEM BDS initialization codes", + 198: "OEM BDS initialization codes", + 199: "OEM BDS initialization codes", + 200: "OEM BDS initialization codes", + 201: "OEM BDS initialization codes", + 202: "OEM BDS initialization codes", + 203: "OEM BDS initialization codes", + 204: "OEM BDS initialization codes", + 205: "OEM BDS initialization codes", + 206: "OEM BDS initialization codes", + 207: "OEM BDS initialization codes", + 208: "CPU initialization error", + 209: "System Agent initialization error", + 210: "PCH initialization error", + 211: "Some of the Architectural Protocols are not available", + 212: "PCI resource allocation error. Out of Resources", + 213: "No Space for Legacy Option ROM", + 214: "No Console Output Devices are found", + 215: "No Console Input Devices are found", + 216: "Invalid password", + 217: "Error loading Boot Option (LoadImage returned error)", + 218: "Boot Option is failed (StartImage returned error)", + 219: "Flash update is failed", + 220: "Reset protocol is not available", + 221: "Reserved for future AMI progress codes", + 222: "Reserved for future AMI progress codes", + 223: "Reserved for future AMI progress codes", + 224: "S3 Resume is stared (S3 Resume PPI is called by the DXE IPL)", + 225: "S3 Boot Script execution", + 226: "Video repost", + 227: "OS S3 wake vector call", + 228: "Reserved for future AMI progress codes", + 229: "Reserved for future AMI progress codes", + 230: "Reserved for future AMI progress codes", + 231: "Reserved for future AMI progress codes", + 232: "S3 Resume Failed", + 233: "S3 Resume PPI not Found", + 234: "S3 Resume Boot Script Error", + 235: "S3 OS Wake Error", + 236: "Reserved for future AMI error codes 31", + 237: "Reserved for future AMI error codes 31", + 238: "Reserved for future AMI error codes 31", + 239: "Reserved for future AMI error codes 31", + 240: "Recovery condition triggered by firmware (Auto recovery)", + 241: "Recovery condition triggered by user (Forced recovery)", + 242: "Recovery process started", + 243: "Recovery firmware image is found", + 244: "Recovery firmware image is loaded", + 245: "Reserved for future AMI progress codes", + 246: "Reserved for future AMI progress codes", + 247: "Reserved for future AMI progress codes", + 248: "Recovery PPI is not available", + 249: "Recovery capsule is not found", + 250: "Invalid recovery capsule", + 251: "Reserved for future AMI error codes", + 252: "Reserved for future AMI error codes", + 253: "Reserved for future AMI error codes", + 254: "Reserved for future AMI error codes", + 255: "Indicates a failure has occurred" +} + POSTHex7Segment = { 0: "00", 1: "01", @@ -278,6 +552,21 @@ HIDMouseScanCodes = { 4: 16 } +ASCII2JS= { + "1": "Digit1", + "2": "Digit2", + "3": "Digit3", + "4": "Digit4", + "5": "Digit5", + "6": "Digit6", + "7": "Digit7", + "8": "Digit8", + "9": "Digit9", + "0": "Digit0", + + ".": "Period" +} + class GPIO(IntEnum): LOW = 0 HIGH = 1 @@ -422,8 +711,11 @@ class Esp32Serial(threading.Thread): self.mkb_queue: Queue[Mapping[str, int | str | Mapping[str, int]]] = Queue() self.change_serial_device = threading.Event() self.device = self.get_device() - self.bios_timer = time.time() - self.power_status = None + self._power_status = False + self._last_post_code = "00" + self.notify_code: str + self.active_notification_request = threading.Event() + self.post_code_notify = threading.Event() self.start() @@ -443,16 +735,18 @@ class Esp32Serial(threading.Thread): line = json.loads(ser.readline().decode().strip()) if "pwr" in line: - self.power_status = line["pwr"] + self._power_status = line["pwr"] elif "post_code" in line: - # This code is what presents when you are in BIOS, but also... Other times. - # In another part of the script, we'll check to see if it's hung around for a few - # seconds. If so, we are in BIOS. - if POSTHex7Segment[line["post_code"]] != "Ab": - self.bios_timer = time.time() + self._last_post_code = POSTHex7Segment[line["post_code"]] ui.emit("update_seven_segment", POSTHex7Segment[line["post_code"]]) + ui.emit("update_post_log", f"{POSTTextDef[line["post_code"]]}: {POSTHex7Segment[line["post_code"]]}") + + if self.active_notification_request.is_set(): + if self._last_post_code == self.notify_code: + self.post_code_notify.set() + self.active_notification_request.clear() except json.JSONDecodeError: continue @@ -465,8 +759,29 @@ class Esp32Serial(threading.Thread): def get_device(self): if name == "posix": - return serial.Serial(f"/dev/serial/by-id/{profile["esp32_serial"]}", 115200, bytesize=serial.EIGHTBITS, + return serial.Serial(f"/dev/serial/by-id/{profile["server"]["esp32_serial"]}", 115200, bytesize=serial.EIGHTBITS, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE) else: raise RuntimeError("Your OS is unsupported!") + + def ez_press_key(self, key: str): + msg = msg = { + "key_down": HIDKeyCode[key].value + } + + self.mkb_queue.put(msg) + + msg = msg = { + "key_up": HIDKeyCode[key].value + } + + self.mkb_queue.put(msg) + + @property + def power_status(self): + return self._power_status + + @property + def last_post_code(self): + return self._last_post_code diff --git a/webui/ipkvm/util/video.py b/webui/ipkvm/util/video.py index 7f653eb..6559e8c 100644 --- a/webui/ipkvm/util/video.py +++ b/webui/ipkvm/util/video.py @@ -8,7 +8,6 @@ import av import av.container import cv2 from ipkvm import logger -from ipkvm import profile @dataclasses.dataclass class VideoDevice: diff --git a/webui/launch.py b/webui/launch.py index edc8f1e..1ded817 100644 --- a/webui/launch.py +++ b/webui/launch.py @@ -1,4 +1,5 @@ -from ipkvm import app, ui +from ipkvm import app, ui, states if __name__ == '__main__': ui.run(app, host='0.0.0.0', port=5000) + #pass \ No newline at end of file diff --git a/webui/state_test.py b/webui/state_test.py new file mode 100644 index 0000000..6e34d50 --- /dev/null +++ b/webui/state_test.py @@ -0,0 +1,47 @@ +from enum import Enum + +from transitions.experimental.utils import with_model_definitions, event, add_transitions, transition +from transitions import Machine + + +class State(Enum): + A = "A" + B = "B" + C = "C" + + +class Model: + + state: State = State.A + + @add_transitions(transition(source=State.B, dest=State.A)) + def foo(self): ... + + @add_transitions(transition(source=State.C, dest=State.A)) + def fod(self): ... + + @add_transitions(transition(source=State.A, dest=State.B)) + def fud(self): ... + + bar = event( + {"source": State.B, "dest": State.A, "conditions": lambda: False}, + transition(source=State.B, dest=State.C) + ) + + +@with_model_definitions # don't forget to define your model with this decorator! +class MyMachine(Machine): + pass + + +model = Model() +machine = MyMachine(model, states=State, initial=model.state) +print(model.state) +model.fud() +print(model.state) +model.bar() +print(model.state) +assert model.state == State.C +model.fod() +print(model.state) +assert model.state == State.A \ No newline at end of file