diff --git a/UI/xindi_800_480.HMI b/UI/xindi_800_480.HMI index 3d6801d..7d2a9d2 100644 Binary files a/UI/xindi_800_480.HMI and b/UI/xindi_800_480.HMI differ diff --git a/UI/xindi_800_480.tft b/UI/xindi_800_480.tft index 6ca8bdc..2fc26c7 100644 Binary files a/UI/xindi_800_480.tft and b/UI/xindi_800_480.tft differ diff --git a/config/gcode_macro.cfg b/config/gcode_macro.cfg index ca90b75..bf83376 100644 --- a/config/gcode_macro.cfg +++ b/config/gcode_macro.cfg @@ -1,9 +1,4 @@ -# QIDI Plus4 V1.6.0 -#20241102 -#1. 起始代码腔室加热将在调平后开启 -#2. 腔室加热开启必须带着热床升温 -#3. M141和M191宏定义修改,热床低于70会开启热床加热 -#4. 擦料时取消打印,会先移动一点出来 +# QIDI Plus4 V1.0.0 [gcode_macro _CG28] gcode: @@ -205,28 +200,194 @@ gcode: M400 M118 Nozzle cooled +[gcode_macro MOVE_TO_TRASH] +gcode: + _CG28 + M204 S10000 + {% if (printer.gcode_move.position.y) > 305 %} + G1 X82 Y324 F6000 + G1 X95 + {% else %} + G1 X82 F12000 + G1 Y310 F12000 + G1 Y324 F600 + G1 X95 F6000 + {% endif %} + # Excute when start printing, prior to gcode file [gcode_macro PRINT_START] gcode: AUTOTUNE_SHAPERS + TOOL_CHANGE_END + DISABLE_ALL_SENSOR + CLEAR_PAUSE {% set bedtemp = params.BED|int %} {% set hotendtemp = params.HOTEND|int %} {% set chambertemp = params.CHAMBER|default(0)|int %} + {% set extruder = params.EXTRUDER|default(0)|int %} set_zoffset M104 S0 M106 P2 S0 M106 P3 S0 M106 S255 + {% if "xyz" in printer.toolhead.homed_axes %} + G0 X50 Y50 F6000 + {% endif %} G28 M141 S0 M140 S{bedtemp} M106 S0 + {% if printer.save_variables.variables.box_count >= 1 %} + SAVE_VARIABLE VARIABLE=load_retry_num VALUE=0 + SAVE_VARIABLE VARIABLE=retry_step VALUE=None + SAVE_VARIABLE VARIABLE=is_tool_change VALUE=0 + {% for i in range(16) %} + SAVE_VARIABLE VARIABLE=runout_{i} VALUE=0 + G4 P100 + {% endfor %} + {% if printer.save_variables.variables.enable_box == 1 %} + {% set last_load_slot = printer.save_variables.variables.last_load_slot|default("slot-1") %} + {% set value_t = printer.save_variables.variables["value_t" ~ extruder]|default("slot" ~ extruder) %} + {% if printer['hall_filament_width_sensor'].Diameter > 0.5 %} + {% if last_load_slot != value_t and last_load_slot != "slot-1" %} + CUT_FILAMENT + MOVE_TO_TRASH + M109 S{hotendtemp} + EXTRUDER_UNLOAD SLOT={last_load_slot} + M83 + G1 E18 F300 + T{extruder} + G1 E1 F50 + G1 E28.13 F611 + G1 E0.97 F50 + G1 E8.73 F611 + G1 E0.97 F50 + G1 E8.73 F611 + G1 E0.97 F50 + G1 E-2 F1800 + {% for i in range(1,5) %} + M106 S255 + M400 + G91 + G1 X-3 F60 + G1 X3 F60 + G90 + CLEAR_FLUSH + M106 S60 + G1 E34.8 F611 + G1 E1.2 F50 + G1 E10.8 F611 + G1 E1.2 F50 + G1 E10.8 F611 + G1 E1.2 F50 + G1 E-2 F1800 + {% endfor %} + {% elif last_load_slot == value_t and printer.save_variables.variables.slot_sync == "slot-1" %} + MOVE_TO_TRASH + M109 S{hotendtemp} + T{extruder} + M83 + G1 E1 F50 + G1 E28.13 F611 + G1 E0.97 F50 + G1 E8.73 F611 + G1 E0.97 F50 + G1 E8.73 F611 + G1 E0.97 F50 + G1 E-2 F1800 + {% for i in range(1,5) %} + M106 S255 + M400 + G91 + G1 X-3 F60 + G1 X3 F60 + G90 + CLEAR_FLUSH + M106 S60 + G1 E34.8 F611 + G1 E1.2 F50 + G1 E10.8 F611 + G1 E1.2 F50 + G1 E10.8 F611 + G1 E1.2 F50 + G1 E-2 F1800 + {% endfor %} + {% endif %} + {% else %} + {% if last_load_slot != "slot-1" %} + MOVE_TO_TRASH + M109 S{hotendtemp} + M400 + EXTRUDER_UNLOAD SLOT={last_load_slot} + T{extruder} + M83 + G1 E1 F50 + G1 E28.13 F611 + G1 E0.97 F50 + G1 E8.73 F611 + G1 E0.97 F50 + G1 E8.73 F611 + G1 E0.97 F50 + G1 E-2 F1800 + {% for i in range(1,5) %} + M106 S255 + M400 + G91 + G1 X-3 F60 + G1 X3 F60 + G90 + CLEAR_FLUSH + M106 S60 + G1 E34.8 F611 + G1 E1.2 F50 + G1 E10.8 F611 + G1 E1.2 F50 + G1 E10.8 F611 + G1 E1.2 F50 + G1 E-2 F1800 + {% endfor %} + {% else %} + MOVE_TO_TRASH + M109 S{hotendtemp} + T{extruder} + M83 + G1 E1 F50 + G1 E28.13 F611 + G1 E0.97 F50 + G1 E8.73 F611 + G1 E0.97 F50 + G1 E8.73 F611 + G1 E0.97 F50 + G1 E-2 F1800 + {% for i in range(1,5) %} + M106 S255 + M400 + G91 + G1 X-3 F60 + G1 X3 F60 + G90 + CLEAR_FLUSH + M106 S60 + G1 E34.8 F611 + G1 E1.2 F50 + G1 E10.8 F611 + G1 E1.2 F50 + G1 E10.8 F611 + G1 E1.2 F50 + G1 E-2 F1800 + {% endfor %} + {% endif %} + {% endif %} + {% endif %} + {% endif %} + M106 S0 CLEAR_NOZZLE HOTEND={hotendtemp} M190 S{bedtemp} # M141 S{chambertemp} M104 S140 + Z_TILT_ADJUST G29 G0 Z50 F600 G0 X5 Y5 F6000 @@ -247,13 +408,19 @@ gcode: RESET_FILAMENT_WIDTH_SENSOR query_filament_width SET_FILAMENT_SENSOR SENSOR=fila ENABLE=1 + {% if printer["filament_motion_sensor box_motion_sensor"] and printer.save_variables.variables.enable_box == 1 %} + CLEAR_MOTION_DATA + SET_FILAMENT_SENSOR SENSOR=box_motion_sensor ENABLE=1 + {% endif %} [gcode_macro DISABLE_ALL_SENSOR] gcode: SET_FILAMENT_SENSOR SENSOR=fila ENABLE=0 + {% if printer["filament_motion_sensor box_motion_sensor"] %} + SET_FILAMENT_SENSOR SENSOR=box_motion_sensor ENABLE=0 + {% endif %} DISABLE_FILAMENT_WIDTH_SENSOR - [gcode_macro AUTOTUNE_SHAPERS] variable_autotune_shapers: 'ei' gcode: @@ -285,7 +452,7 @@ gcode: SET_STEPPER_ENABLE STEPPER=stepper_z enable=1 SET_STEPPER_ENABLE STEPPER=stepper_z1 enable=1 BED_MESH_CLEAR - SET_FILAMENT_SENSOR SENSOR=fila ENABLE=0 + DISABLE_ALL_SENSOR [homing_override] axes:xyz @@ -342,7 +509,7 @@ gcode: G1 Y5 F2400 G4 P2000 - SET_TMC_CURRENT STEPPER=stepper_x CURRENT={HOME_CUR * 0.8} + SET_TMC_CURRENT STEPPER=stepper_x CURRENT={HOME_CUR * 0.8} G28 X SET_TMC_CURRENT STEPPER=stepper_x CURRENT={HOME_CUR} BEEP I=1 DUR=100 @@ -395,6 +562,7 @@ gcode: M106 P2 S0 M106 P0 S0 M106 P3 S0 + DISABLE_BOX_HEATER M104 S0 M140 S0 @@ -418,6 +586,7 @@ gcode: [gcode_macro CANCEL_PRINT] rename_existing: BASE_CANCEL_PRINT gcode: + TOOL_CHANGE_END {% if (printer.gcode_move.position.z) < 200 %} G1 Z200 F600 {% endif %} @@ -436,6 +605,7 @@ gcode: M104 S0 M140 S0 M141 S0 + DISABLE_BOX_HEATER M220 S100 M221 S100 @@ -461,12 +631,11 @@ gcode: {% set z = params.Z|default(35)|int %} {% if printer['pause_resume'].is_paused|int == 0 %} - SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=zhop VALUE={z} - SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=etemp VALUE={printer['extruder'].target} - SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=efan VALUE={printer["fan_generic cooling_fan"].speed *255} + SET_GCODE_VARIABLE MACRO=RESUME_PRINT VARIABLE=zhop VALUE={z} + SET_GCODE_VARIABLE MACRO=RESUME_PRINT VARIABLE=etemp VALUE={printer['extruder'].target} + SET_GCODE_VARIABLE MACRO=RESUME_PRINT VARIABLE=efan VALUE={printer["fan_generic cooling_fan"].speed *255} - DISABLE_FILAMENT_WIDTH_SENSOR - SET_FILAMENT_SENSOR SENSOR=fila ENABLE=0 + DISABLE_ALL_SENSOR SAVE_GCODE_STATE NAME=PAUSE BASE_PAUSE G92 E0 @@ -477,7 +646,7 @@ gcode: {% else %} G91 G1 Z{5} F900 - SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=zhop VALUE=0 + SET_GCODE_VARIABLE MACRO=RESUME_PRINT VARIABLE=zhop VALUE=0 {% endif %} SAVE_GCODE_STATE NAME=PAUSEPARK2 G90 @@ -490,67 +659,130 @@ gcode: M104 S0 SET_IDLE_TIMEOUT TIMEOUT=86400 SET_STEPPER_ENABLE STEPPER=extruder enable=0 + {% set slot_sync = printer.save_variables.variables.slot_sync|default("slot-1") %} + {% if printer['box_stepper ' ~ slot_sync] %} + SET_STEPPER_ENABLE STEPPER='box_stepper '{slot_sync} enable=0 + {% endif %} {% endif %} -[gcode_macro RESUME] -rename_existing: BASE_RESUME +[gcode_macro RESUME_PRINT] variable_zhop: 0 variable_etemp: 0 variable_efan: 0 gcode: {% set e = params.E|default(5)|int %} + {% set tool_change = params.TOOL_CHANGE|default(0)|int %} {% if printer['pause_resume'].is_paused|int == 1 %} - SET_IDLE_TIMEOUT TIMEOUT={printer.configfile.settings.idle_timeout.timeout} - {% if etemp > 0 %} - M109 S{etemp|int} + {% if printer.save_variables.variables.box_count >= 1 and printer.save_variables.variables.enable_box == 1 and printer.save_variables.variables.is_tool_change == 1%} + SET_IDLE_TIMEOUT TIMEOUT={printer.configfile.settings.idle_timeout.timeout} + MOVE_TO_TRASH + {% if etemp > 0 %} + M109 S{etemp|int} + {% endif %} + M83 + RESTORE_GCODE_STATE NAME=PAUSEPARK2 MOVE=1 MOVE_SPEED=200 + RESTORE_GCODE_STATE NAME=PAUSE MOVE=1 MOVE_SPEED=15 + BASE_RESUME + {% else %} + SET_IDLE_TIMEOUT TIMEOUT={printer.configfile.settings.idle_timeout.timeout} + {% if etemp > 0 %} + M109 S{etemp|int} + {% endif %} + {% if printer.save_variables.variables.box_count >= 1 %} + SAVE_VARIABLE VARIABLE=retry_step VALUE=None + {% endif %} + M83 + M106 S0 + G1 X95 F12000 + G1 Y324 F12000 + G92 E0 + G1 E5 F50 + G92 E0 + G1 E50 F200 + G92 E0 + G1 E-0.8 F200 + G4 P300 + + M106 S{efan} + + G1 Y318 F30000 + G1 Y322 F3000 + G1 Y318 F30000 + G1 Y322 F3000 + G1 Y318 F30000 + G1 Y322 F3000 + G1 Y324 F600 + + G1 X58 F12000 + G1 X78 F12000 + G1 X58 F12000 + G1 X78 F12000 + G1 X58 F12000 + G1 X78 F12000 + G1 X58 F12000 + G1 X78 F12000 + G1 X58 F12000 + G1 X78 F12000 + G1 X58 F12000 + G1 X78 F12000 + G1 X95 F12000 + + G1 Y316 F9000 + G1 Y312 F600 + G1 Y260 F12000 + RESTORE_GCODE_STATE NAME=PAUSEPARK2 MOVE=1 MOVE_SPEED=200 + RESTORE_GCODE_STATE NAME=PAUSE MOVE=1 MOVE_SPEED=15 + BASE_RESUME + {% if tool_change == 0 %} + ENABLE_ALL_SENSOR + {% endif %} {% endif %} - M83 - M106 S0 - G1 X95 F12000 - G1 Y324 F12000 - G92 E0 - G1 E5 F50 - G92 E0 - G1 E50 F200 - G92 E0 - G1 E-0.8 F200 - G4 P300 + {% endif %} - M106 S{efan} - - G1 Y318 F30000 - G1 Y322 F3000 - G1 Y318 F30000 - G1 Y322 F3000 - G1 Y318 F30000 - G1 Y322 F3000 - G1 Y324 F600 - - G1 X58 F12000 - G1 X78 F12000 - G1 X58 F12000 - G1 X78 F12000 - G1 X58 F12000 - G1 X78 F12000 - G1 X58 F12000 - G1 X78 F12000 - G1 X58 F12000 - G1 X78 F12000 - G1 X58 F12000 - G1 X78 F12000 - G1 X95 F12000 - - G1 Y316 F9000 - G1 Y312 F600 - G1 Y260 F12000 - RESTORE_GCODE_STATE NAME=PAUSEPARK2 MOVE=1 MOVE_SPEED=200 - RESTORE_GCODE_STATE NAME=PAUSE MOVE=1 MOVE_SPEED=15 - BASE_RESUME - ENABLE_FILAMENT_WIDTH_SENSOR - RESET_FILAMENT_WIDTH_SENSOR - query_filament_width - SET_FILAMENT_SENSOR SENSOR=fila ENABLE=1 +[gcode_macro RESUME] +rename_existing: BASE_RESUME +gcode: + {% if printer['pause_resume'].is_paused|int == 1 %} + {% if printer.save_variables.variables.box_count >= 1 %} + {% if printer.save_variables.variables.enable_box == 1 %} + {% set retry_val = printer.save_variables.variables.retry_step %} + {% if retry_val == None %} + {% if printer['hall_filament_width_sensor'].Diameter > 0.5 %} + RESUME_PRINT + {% else %} + {% if printer.save_variables.variables.is_tool_change == 1 %} + RESUME_PRINT + {% endif %} + {% endif %} + {% else %} + {% if (retry_val.startswith('QDE_004_002') + or retry_val.startswith('QDE_004_003') + or retry_val.startswith('QDE_004_004') + or retry_val.startswith('QDE_004_005') + or retry_val.startswith('QDE_004_006') + or retry_val.startswith('QDE_004_009')) %} + TRY_MOVE_AGAIN + {% else %} + {% if printer['hall_filament_width_sensor'].Diameter > 0.5 %} + RESUME_PRINT + {% else %} + {% if printer.save_variables.variables.is_tool_change == 1 %} + RESUME_PRINT + {% endif %} + {% endif %} + {% endif %} + {% endif %} + {% else %} + {% if printer['hall_filament_width_sensor'].Diameter > 0.5 %} + RESUME_PRINT + {% endif %} + {% endif %} + {% else %} + {% if printer['hall_filament_width_sensor'].Diameter > 0.5 %} + RESUME_PRINT + {% endif %} + {% endif %} {% endif %} [gcode_macro BEEP] diff --git a/config/printer.cfg b/config/printer.cfg index 2d98f6b..f49a483 100644 --- a/config/printer.cfg +++ b/config/printer.cfg @@ -7,6 +7,7 @@ # Plugins [include timelapse.cfg] [include KAMP_Settings.cfg] +[include box.cfg] [mcu] serial: /dev/ttyS2 @@ -66,6 +67,10 @@ pause_on_runout:True runout_gcode: RESET_FILAMENT_WIDTH_SENSOR M118 Filament run out + {% set can_auto_reload = printer.save_variables.variables.auto_reload_detect|default(0) %} + {% if can_auto_reload == 1 %} + AUTO_RELOAD_FILAMENT + {% endif %} event_delay: 3.0 pause_delay: 0.5 diff --git a/fluidd/assets/DeviceCamera-BD1S1a_T.js b/fluidd/assets/DeviceCamera-BD1S1a_T.js new file mode 100644 index 0000000..da19610 --- /dev/null +++ b/fluidd/assets/DeviceCamera-BD1S1a_T.js @@ -0,0 +1 @@ +var l=Object.defineProperty;var _=(r,e,a)=>e in r?l(r,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[e]=a;var c=(r,e,a)=>_(r,typeof e!="symbol"?e+"":e,a);import{m as p,C as v,f,R as d,j as u}from"./index-4UonB8GV.js";var y=Object.defineProperty,C=Object.getOwnPropertyDescriptor,m=(r,e,a,s)=>{for(var t=s>1?void 0:s?C(e,a):e,o=r.length-1,i;o>=0;o--)(i=r[o])&&(t=(s?i(e,a,t):i(t))||t);return s&&t&&y(e,a,t),t};let n=class extends p(v){constructor(){super(...arguments);c(this,"cameraVideo")}startPlayback(){navigator.mediaDevices.getUserMedia({video:!0}).then(a=>this.cameraVideo.srcObject=a).then(()=>this.$emit("playback"))}stopPlayback(){this.cameraVideo.srcObject=null}};m([d("streamingElement")],n.prototype,"cameraVideo",2);n=m([f({})],n);var P=function(){var e=this,a=e._self._c;return e._self._setupProxy,a("video",{ref:"streamingElement",style:e.cameraStyle,attrs:{autoplay:"",muted:""},domProps:{muted:!0}})},b=[],h=u(n,P,b,!1,null,null);const j=h.exports;export{j as default}; diff --git a/fluidd/assets/DeviceCamera-CuTKJuOZ.js b/fluidd/assets/DeviceCamera-CuTKJuOZ.js new file mode 100644 index 0000000..67a3f4e --- /dev/null +++ b/fluidd/assets/DeviceCamera-CuTKJuOZ.js @@ -0,0 +1 @@ +var l=Object.defineProperty;var _=(r,e,a)=>e in r?l(r,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[e]=a;var c=(r,e,a)=>_(r,typeof e!="symbol"?e+"":e,a);import{m as p,C as v,f,R as d,j as u}from"./index-CuYiwiAV.js";var y=Object.defineProperty,C=Object.getOwnPropertyDescriptor,m=(r,e,a,s)=>{for(var t=s>1?void 0:s?C(e,a):e,o=r.length-1,i;o>=0;o--)(i=r[o])&&(t=(s?i(e,a,t):i(t))||t);return s&&t&&y(e,a,t),t};let n=class extends p(v){constructor(){super(...arguments);c(this,"cameraVideo")}startPlayback(){navigator.mediaDevices.getUserMedia({video:!0}).then(a=>this.cameraVideo.srcObject=a).then(()=>this.$emit("playback"))}stopPlayback(){this.cameraVideo.srcObject=null}};m([d("streamingElement")],n.prototype,"cameraVideo",2);n=m([f({})],n);var P=function(){var e=this,a=e._self._c;return e._self._setupProxy,a("video",{ref:"streamingElement",style:e.cameraStyle,attrs:{autoplay:"",muted:""},domProps:{muted:!0}})},b=[],h=u(n,P,b,!1,null,null);const j=h.exports;export{j as default}; diff --git a/fluidd/assets/DeviceCamera-D8KEfdbM.js b/fluidd/assets/DeviceCamera-D8KEfdbM.js new file mode 100644 index 0000000..2efb2f4 --- /dev/null +++ b/fluidd/assets/DeviceCamera-D8KEfdbM.js @@ -0,0 +1 @@ +var l=Object.defineProperty;var _=(r,e,a)=>e in r?l(r,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[e]=a;var c=(r,e,a)=>_(r,typeof e!="symbol"?e+"":e,a);import{m as p,C as v,f,R as d,j as u}from"./index-DNWTsqTH.js";var y=Object.defineProperty,C=Object.getOwnPropertyDescriptor,m=(r,e,a,s)=>{for(var t=s>1?void 0:s?C(e,a):e,o=r.length-1,i;o>=0;o--)(i=r[o])&&(t=(s?i(e,a,t):i(t))||t);return s&&t&&y(e,a,t),t};let n=class extends p(v){constructor(){super(...arguments);c(this,"cameraVideo")}startPlayback(){navigator.mediaDevices.getUserMedia({video:!0}).then(a=>this.cameraVideo.srcObject=a).then(()=>this.$emit("playback"))}stopPlayback(){this.cameraVideo.srcObject=null}};m([d("streamingElement")],n.prototype,"cameraVideo",2);n=m([f({})],n);var P=function(){var e=this,a=e._self._c;return e._self._setupProxy,a("video",{ref:"streamingElement",style:e.cameraStyle,attrs:{autoplay:"",muted:""},domProps:{muted:!0}})},b=[],h=u(n,P,b,!1,null,null);const j=h.exports;export{j as default}; diff --git a/fluidd/assets/HlsstreamCamera-BwaV2una.js b/fluidd/assets/HlsstreamCamera-BwaV2una.js new file mode 100644 index 0000000..3793376 --- /dev/null +++ b/fluidd/assets/HlsstreamCamera-BwaV2una.js @@ -0,0 +1,26 @@ +var Xr=Object.defineProperty;var Qr=(a,e,t)=>e in a?Xr(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var Nt=(a,e,t)=>Qr(a,typeof e!="symbol"?e+"":e,t);import{m as Jr,C as Zr,f as en,R as tn,j as sn}from"./index-4UonB8GV.js";function rn(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var $i={exports:{}};(function(a,e){(function(t){var s=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,i=/^(?=([^\/?#]*))\1([^]*)$/,r=/(?:\/|^)\.(?=\/)/g,n=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,o={buildAbsoluteURL:function(l,c,h){if(h=h||{},l=l.trim(),c=c.trim(),!c){if(!h.alwaysNormalize)return l;var u=o.parseURL(l);if(!u)throw new Error("Error trying to parse base URL.");return u.path=o.normalizePath(u.path),o.buildURLFromParts(u)}var d=o.parseURL(c);if(!d)throw new Error("Error trying to parse relative URL.");if(d.scheme)return h.alwaysNormalize?(d.path=o.normalizePath(d.path),o.buildURLFromParts(d)):c;var g=o.parseURL(l);if(!g)throw new Error("Error trying to parse base URL.");if(!g.netLoc&&g.path&&g.path[0]!=="/"){var f=i.exec(g.path);g.netLoc=f[1],g.path=f[2]}g.netLoc&&!g.path&&(g.path="/");var m={scheme:g.scheme,netLoc:d.netLoc,path:null,params:d.params,query:d.query,fragment:d.fragment};if(!d.netLoc&&(m.netLoc=g.netLoc,d.path[0]!=="/"))if(!d.path)m.path=g.path,d.params||(m.params=g.params,d.query||(m.query=g.query));else{var T=g.path,E=T.substring(0,T.lastIndexOf("/")+1)+d.path;m.path=o.normalizePath(E)}return m.path===null&&(m.path=h.alwaysNormalize?o.normalizePath(d.path):d.path),o.buildURLFromParts(m)},parseURL:function(l){var c=s.exec(l);return c?{scheme:c[1]||"",netLoc:c[2]||"",path:c[3]||"",params:c[4]||"",query:c[5]||"",fragment:c[6]||""}:null},normalizePath:function(l){for(l=l.split("").reverse().join("").replace(r,"");l.length!==(l=l.replace(n,"")).length;);return l.split("").reverse().join("")},buildURLFromParts:function(l){return l.scheme+l.netLoc+l.path+l.params+l.query+l.fragment}};a.exports=o})()})($i);var xs=$i.exports;function Us(a,e){var t=Object.keys(a);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(a);e&&(s=s.filter(function(i){return Object.getOwnPropertyDescriptor(a,i).enumerable})),t.push.apply(t,s)}return t}function oe(a){for(var e=1;e`):Oe}function un(a,...e){e.forEach(function(t){Ze[t]=a[t]?a[t].bind(a):hn(t)})}function dn(a,e){if(typeof console=="object"&&a===!0||typeof a=="object"){un(a,"debug","log","info","warn","error");try{Ze.log(`Debug logs enabled for "${e}" in hls.js version 1.5.14`)}catch{Ze=ns}}else Ze=ns}const v=Ze,fn=/^(\d+)x(\d+)$/,Bs=/(.+?)=(".*?"|.*?)(?:,|$)/g;class ee{constructor(e){typeof e=="string"&&(e=ee.parseAttrList(e)),se(this,e)}get clientAttrs(){return Object.keys(this).filter(e=>e.substring(0,2)==="X-")}decimalInteger(e){const t=parseInt(this[e],10);return t>Number.MAX_SAFE_INTEGER?1/0:t}hexadecimalInteger(e){if(this[e]){let t=(this[e]||"0x").slice(2);t=(t.length&1?"0":"")+t;const s=new Uint8Array(t.length/2);for(let i=0;iNumber.MAX_SAFE_INTEGER?1/0:t}decimalFloatingPoint(e){return parseFloat(this[e])}optionalFloat(e,t){const s=this[e];return s?parseFloat(s):t}enumeratedString(e){return this[e]}bool(e){return this[e]==="YES"}decimalResolution(e){const t=fn.exec(this[e]);if(t!==null)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}static parseAttrList(e){let t;const s={},i='"';for(Bs.lastIndex=0;(t=Bs.exec(e))!==null;){let r=t[2];r.indexOf(i)===0&&r.lastIndexOf(i)===r.length-1&&(r=r.slice(1,-1));const n=t[1].trim();s[n]=r}return s}}function gn(a){return a!=="ID"&&a!=="CLASS"&&a!=="START-DATE"&&a!=="DURATION"&&a!=="END-DATE"&&a!=="END-ON-NEXT"}function mn(a){return a==="SCTE35-OUT"||a==="SCTE35-IN"}class Gi{constructor(e,t){if(this.attr=void 0,this._startDate=void 0,this._endDate=void 0,this._badValueForSameId=void 0,t){const s=t.attr;for(const i in s)if(Object.prototype.hasOwnProperty.call(e,i)&&e[i]!==s[i]){v.warn(`DATERANGE tag attribute: "${i}" does not match for tags with ID: "${e.ID}"`),this._badValueForSameId=i;break}e=se(new ee({}),s,e)}if(this.attr=e,this._startDate=new Date(e["START-DATE"]),"END-DATE"in this.attr){const s=new Date(this.attr["END-DATE"]);O(s.getTime())&&(this._endDate=s)}}get id(){return this.attr.ID}get class(){return this.attr.CLASS}get startDate(){return this._startDate}get endDate(){if(this._endDate)return this._endDate;const e=this.duration;return e!==null?new Date(this._startDate.getTime()+e*1e3):null}get duration(){if("DURATION"in this.attr){const e=this.attr.decimalFloatingPoint("DURATION");if(O(e))return e}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}get plannedDuration(){return"PLANNED-DURATION"in this.attr?this.attr.decimalFloatingPoint("PLANNED-DURATION"):null}get endOnNext(){return this.attr.bool("END-ON-NEXT")}get isValid(){return!!this.id&&!this._badValueForSameId&&O(this.startDate.getTime())&&(this.duration===null||this.duration>=0)&&(!this.endOnNext||!!this.class)}}class Ft{constructor(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}}var X={AUDIO:"audio",VIDEO:"video",AUDIOVIDEO:"audiovideo"};class Ki{constructor(e){this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams={[X.AUDIO]:null,[X.VIDEO]:null,[X.AUDIOVIDEO]:null},this.baseurl=e}setByteRange(e,t){const s=e.split("@",2);let i;s.length===1?i=(t==null?void 0:t.byteRangeEndOffset)||0:i=parseInt(s[1]),this._byteRange=[i,parseInt(s[0])+i]}get byteRange(){return this._byteRange?this._byteRange:[]}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=xs.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(e){this._url=e}}class Ut extends Ki{constructor(e,t){super(t),this._decryptdata=null,this.rawProgramDateTime=null,this.programDateTime=null,this.tagList=[],this.duration=0,this.sn=0,this.levelkeys=void 0,this.type=void 0,this.loader=null,this.keyLoader=null,this.level=-1,this.cc=0,this.startPTS=void 0,this.endPTS=void 0,this.startDTS=void 0,this.endDTS=void 0,this.start=0,this.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,this.stats=new Ft,this.data=void 0,this.bitrateTest=!1,this.title=null,this.initSegment=null,this.endList=void 0,this.gap=void 0,this.urlId=0,this.type=e}get decryptdata(){const{levelkeys:e}=this;if(!e&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkeys&&!this.levelkeys.NONE){const t=this.levelkeys.identity;if(t)this._decryptdata=t.getDecryptData(this.sn);else{const s=Object.keys(this.levelkeys);if(s.length===1)return this._decryptdata=this.levelkeys[s[0]].getDecryptData(this.sn)}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(this.programDateTime===null||!O(this.programDateTime))return null;const e=O(this.duration)?this.duration:0;return this.programDateTime+e*1e3}get encrypted(){var e;if((e=this._decryptdata)!=null&&e.encrypted)return!0;if(this.levelkeys){const t=Object.keys(this.levelkeys),s=t.length;if(s>1||s===1&&this.levelkeys[t[0]].encrypted)return!0}return!1}setKeyFormat(e){if(this.levelkeys){const t=this.levelkeys[e];t&&!this._decryptdata&&(this._decryptdata=t.getDecryptData(this.sn))}}abortRequests(){var e,t;(e=this.loader)==null||e.abort(),(t=this.keyLoader)==null||t.abort()}setElementaryStreamInfo(e,t,s,i,r,n=!1){const{elementaryStreams:o}=this,l=o[e];if(!l){o[e]={startPTS:t,endPTS:s,startDTS:i,endDTS:r,partial:n};return}l.startPTS=Math.min(l.startPTS,t),l.endPTS=Math.max(l.endPTS,s),l.startDTS=Math.min(l.startDTS,i),l.endDTS=Math.max(l.endDTS,r)}clearElementaryStreamInfo(){const{elementaryStreams:e}=this;e[X.AUDIO]=null,e[X.VIDEO]=null,e[X.AUDIOVIDEO]=null}}class pn extends Ki{constructor(e,t,s,i,r){super(s),this.fragOffset=0,this.duration=0,this.gap=!1,this.independent=!1,this.relurl=void 0,this.fragment=void 0,this.index=void 0,this.stats=new Ft,this.duration=e.decimalFloatingPoint("DURATION"),this.gap=e.bool("GAP"),this.independent=e.bool("INDEPENDENT"),this.relurl=e.enumeratedString("URI"),this.fragment=t,this.index=i;const n=e.enumeratedString("BYTERANGE");n&&this.setByteRange(n,r),r&&(this.fragOffset=r.fragOffset+r.duration)}get start(){return this.fragment.start+this.fragOffset}get end(){return this.start+this.duration}get loaded(){const{elementaryStreams:e}=this;return!!(e.audio||e.video||e.audiovideo)}}const Tn=10;class En{constructor(e){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.dateRanges=void 0,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.encryptedFragments=void 0,this.playlistParsingError=null,this.variableList=null,this.hasVariableRefs=!1,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=e}reloaded(e){if(!e){this.advanced=!0,this.updated=!0;return}const t=this.lastPartSn-e.lastPartSn,s=this.lastPartIndex-e.lastPartIndex;this.updated=this.endSN!==e.endSN||!!s||!!t||!this.live,this.advanced=this.endSN>e.endSN||t>0||t===0&&s>0,this.updated||this.advanced?this.misses=Math.floor(e.misses*.6):this.misses=e.misses+1,this.availabilityDelay=e.availabilityDelay}get hasProgramDateTime(){return this.fragments.length?O(this.fragments[this.fragments.length-1].programDateTime):!1}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||Tn}get drift(){const e=this.driftEndTime-this.driftStartTime;return e>0?(this.driftEnd-this.driftStart)*1e3/e:1}get edge(){return this.partEnd||this.fragmentEnd}get partEnd(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].end:this.fragmentEnd}get fragmentEnd(){var e;return(e=this.fragments)!=null&&e.length?this.fragments[this.fragments.length-1].end:0}get age(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}get lastPartIndex(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].index:-1}get lastPartSn(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}function Ss(a){return Uint8Array.from(atob(a),e=>e.charCodeAt(0))}function yn(a){const e=as(a).subarray(0,16),t=new Uint8Array(16);return t.set(e,16-e.length),t}function xn(a){const e=function(s,i,r){const n=s[i];s[i]=s[r],s[r]=n};e(a,0,3),e(a,1,2),e(a,4,5),e(a,6,7)}function Sn(a){const e=a.split(":");let t=null;if(e[0]==="data"&&e.length===2){const s=e[1].split(";"),i=s[s.length-1].split(",");if(i.length===2){const r=i[0]==="base64",n=i[1];r?(s.splice(-1,1),t=Ss(n)):t=yn(n)}}return t}function as(a){return Uint8Array.from(unescape(encodeURIComponent(a)),e=>e.charCodeAt(0))}const qe=typeof self<"u"?self:void 0;var Z={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},de={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.streamingkeydelivery",PLAYREADY:"com.microsoft.playready",WIDEVINE:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"};function $s(a){switch(a){case de.FAIRPLAY:return Z.FAIRPLAY;case de.PLAYREADY:return Z.PLAYREADY;case de.WIDEVINE:return Z.WIDEVINE;case de.CLEARKEY:return Z.CLEARKEY}}var Vi={WIDEVINE:"edef8ba979d64acea3c827dcd51d21ed"};function vn(a){if(a===Vi.WIDEVINE)return Z.WIDEVINE}function Gs(a){switch(a){case Z.FAIRPLAY:return de.FAIRPLAY;case Z.PLAYREADY:return de.PLAYREADY;case Z.WIDEVINE:return de.WIDEVINE;case Z.CLEARKEY:return de.CLEARKEY}}function Bt(a){const{drmSystems:e,widevineLicenseUrl:t}=a,s=e?[Z.FAIRPLAY,Z.WIDEVINE,Z.PLAYREADY,Z.CLEARKEY].filter(i=>!!e[i]):[];return!s[Z.WIDEVINE]&&t&&s.push(Z.WIDEVINE),s}const Hi=function(a){return qe!=null&&(a=qe.navigator)!=null&&a.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}();function An(a,e,t,s){let i;switch(a){case Z.FAIRPLAY:i=["cenc","sinf"];break;case Z.WIDEVINE:case Z.PLAYREADY:i=["cenc"];break;case Z.CLEARKEY:i=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${a}`)}return Ln(i,e,t,s)}function Ln(a,e,t,s){return[{initDataTypes:a,persistentState:s.persistentState||"optional",distinctiveIdentifier:s.distinctiveIdentifier||"optional",sessionTypes:s.sessionTypes||[s.sessionType||"temporary"],audioCapabilities:e.map(r=>({contentType:`audio/mp4; codecs="${r}"`,robustness:s.audioRobustness||"",encryptionScheme:s.audioEncryptionScheme||null})),videoCapabilities:t.map(r=>({contentType:`video/mp4; codecs="${r}"`,robustness:s.videoRobustness||"",encryptionScheme:s.videoEncryptionScheme||null}))}]}function Ne(a,e,t){return Uint8Array.prototype.slice?a.slice(e,t):new Uint8Array(Array.prototype.slice.call(a,e,t))}const vs=(a,e)=>e+10<=a.length&&a[e]===73&&a[e+1]===68&&a[e+2]===51&&a[e+3]<255&&a[e+4]<255&&a[e+6]<128&&a[e+7]<128&&a[e+8]<128&&a[e+9]<128,Wi=(a,e)=>e+10<=a.length&&a[e]===51&&a[e+1]===68&&a[e+2]===73&&a[e+3]<255&&a[e+4]<255&&a[e+6]<128&&a[e+7]<128&&a[e+8]<128&&a[e+9]<128,et=(a,e)=>{const t=e;let s=0;for(;vs(a,e);){s+=10;const i=Ot(a,e+6);s+=i,Wi(a,e+10)&&(s+=10),e+=s}if(s>0)return a.subarray(t,t+s)},Ot=(a,e)=>{let t=0;return t=(a[e]&127)<<21,t|=(a[e+1]&127)<<14,t|=(a[e+2]&127)<<7,t|=a[e+3]&127,t},Rn=(a,e)=>vs(a,e)&&Ot(a,e+6)+10<=a.length-e,As=a=>{const e=qi(a);for(let t=0;ta&&a.key==="PRIV"&&a.info==="com.apple.streaming.transportStreamTimestamp",In=a=>{const e=String.fromCharCode(a[0],a[1],a[2],a[3]),t=Ot(a,4),s=10;return{type:e,size:t,data:a.subarray(s,s+t)}},qi=a=>{let e=0;const t=[];for(;vs(a,e);){const s=Ot(a,e+6);e+=10;const i=e+s;for(;e+8a.type==="PRIV"?Dn(a):a.type[0]==="W"?_n(a):Cn(a),Dn=a=>{if(a.size<2)return;const e=Re(a.data,!0),t=new Uint8Array(a.data.subarray(e.length+1));return{key:a.type,info:e,data:t.buffer}},Cn=a=>{if(a.size<2)return;if(a.type==="TXXX"){let t=1;const s=Re(a.data.subarray(t),!0);t+=s.length+1;const i=Re(a.data.subarray(t));return{key:a.type,info:s,data:i}}const e=Re(a.data.subarray(1));return{key:a.type,data:e}},_n=a=>{if(a.type==="WXXX"){if(a.size<2)return;let t=1;const s=Re(a.data.subarray(t),!0);t+=s.length+1;const i=Re(a.data.subarray(t));return{key:a.type,info:s,data:i}}const e=Re(a.data);return{key:a.type,data:e}},wn=a=>{if(a.data.byteLength===8){const e=new Uint8Array(a.data),t=e[3]&1;let s=(e[4]<<23)+(e[5]<<15)+(e[6]<<7)+e[7];return s/=45,t&&(s+=4772185884e-2),Math.round(s)}},Re=(a,e=!1)=>{const t=kn();if(t){const c=t.decode(a);if(e){const h=c.indexOf("\0");return h!==-1?c.substring(0,h):c}return c.replace(/\0/g,"")}const s=a.length;let i,r,n,o="",l=0;for(;l>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:o+=String.fromCharCode(i);break;case 12:case 13:r=a[l++],o+=String.fromCharCode((i&31)<<6|r&63);break;case 14:r=a[l++],n=a[l++],o+=String.fromCharCode((i&15)<<12|(r&63)<<6|(n&63)<<0);break}}return o};let $t;function kn(){if(!navigator.userAgent.includes("PlayStation 4"))return!$t&&typeof self.TextDecoder<"u"&&($t=new self.TextDecoder("utf-8")),$t}const Se={hexDump:function(a){let e="";for(let t=0;t>24,a[e+1]=t>>16&255,a[e+2]=t>>8&255,a[e+3]=t&255}function Fn(a){const e=a.byteLength;for(let t=0;t8&&a[t+4]===109&&a[t+5]===111&&a[t+6]===111&&a[t+7]===102)return!0;t=s>1?t+s:e}return!1}function H(a,e){const t=[];if(!e.length)return t;const s=a.byteLength;for(let i=0;i1?i+r:s;if(n===e[0])if(e.length===1)t.push(a.subarray(i+8,o));else{const l=H(a.subarray(i+8,o),e.slice(1));l.length&&Pn.apply(t,l)}i=o}return t}function On(a){const e=[],t=a[0];let s=8;const i=N(a,s);s+=4;let r=0,n=0;t===0?(r=N(a,s),n=N(a,s+4),s+=8):(r=Ks(a,s),n=Ks(a,s+8),s+=16),s+=2;let o=a.length+n;const l=zi(a,s);s+=2;for(let c=0;c>>31===1)return v.warn("SIDX has hierarchical references (not supported)"),null;const f=N(a,h);h+=4,e.push({referenceSize:d,subsegmentDuration:f,info:{duration:f/i,start:o,end:o+d-1}}),o+=d,h+=4,s=h}return{earliestPresentationTime:r,timescale:i,version:t,referencesCount:l,references:e}}function Qi(a){const e=[],t=H(a,["moov","trak"]);for(let i=0;i{const r=N(i,4),n=e[r];n&&(n.default={duration:N(i,12),flags:N(i,20)})}),e}function Mn(a){const e=a.subarray(8),t=e.subarray(86),s=ie(e.subarray(4,8));let i=s;const r=s==="enca"||s==="encv";if(r){const o=H(e,[s])[0].subarray(s==="enca"?28:78);H(o,["sinf"]).forEach(c=>{const h=H(c,["schm"])[0];if(h){const u=ie(h.subarray(4,8));if(u==="cbcs"||u==="cenc"){const d=H(c,["frma"])[0];d&&(i=ie(d))}}})}switch(i){case"avc1":case"avc2":case"avc3":case"avc4":{const n=H(t,["avcC"])[0];i+="."+it(n[1])+it(n[2])+it(n[3]);break}case"mp4a":{const n=H(e,[s])[0],o=H(n.subarray(28),["esds"])[0];if(o&&o.length>12){let l=4;if(o[l++]!==3)break;l=Kt(o,l),l+=2;const c=o[l++];if(c&128&&(l+=2),c&64&&(l+=o[l++]),o[l++]!==4)break;l=Kt(o,l);const h=o[l++];if(h===64)i+="."+it(h);else break;if(l+=12,o[l++]!==5)break;l=Kt(o,l);const u=o[l++];let d=(u&248)>>3;d===31&&(d+=1+((u&7)<<3)+((o[l]&224)>>5)),i+="."+d}break}case"hvc1":case"hev1":{const n=H(t,["hvcC"])[0],o=n[1],l=["","A","B","C"][o>>6],c=o&31,h=N(n,2),u=(o&32)>>5?"H":"L",d=n[12],g=n.subarray(6,12);i+="."+l+c,i+="."+h.toString(16).toUpperCase(),i+="."+u+d;let f="";for(let m=g.length;m--;){const T=g[m];(T||f)&&(f="."+T.toString(16).toUpperCase()+f)}i+=f;break}case"dvh1":case"dvhe":{const n=H(t,["dvcC"])[0],o=n[2]>>1&127,l=n[2]<<5&32|n[3]>>3&31;i+="."+xe(o)+"."+xe(l);break}case"vp09":{const n=H(t,["vpcC"])[0],o=n[4],l=n[5],c=n[6]>>4&15;i+="."+xe(o)+"."+xe(l)+"."+xe(c);break}case"av01":{const n=H(t,["av1C"])[0],o=n[1]>>>5,l=n[1]&31,c=n[2]>>>7?"H":"M",h=(n[2]&64)>>6,u=(n[2]&32)>>5,d=o===2&&h?u?12:10:h?10:8,g=(n[2]&16)>>4,f=(n[2]&8)>>3,m=(n[2]&4)>>2,T=n[2]&3;i+="."+o+"."+xe(l)+c+"."+xe(d)+"."+g+"."+f+m+T+"."+xe(1)+"."+xe(1)+"."+xe(1)+"."+0;break}}return{codec:i,encrypted:r}}function Kt(a,e){const t=e+5;for(;a[e++]&128&&e{const n=H(i,["mdia","minf","stbl","stsd"])[0].subarray(8);let o=H(n,["enca"]);const l=o.length>0;l||(o=H(n,["encv"])),o.forEach(c=>{const h=l?c.subarray(28):c.subarray(78);H(h,["sinf"]).forEach(d=>{const g=Ji(d);if(g){const f=g.subarray(8,24);f.some(m=>m!==0)||(v.log(`[eme] Patching keyId in 'enc${l?"a":"v"}>sinf>>tenc' box: ${Se.hexDump(f)} -> ${Se.hexDump(t)}`),g.set(t,8))}})})}),a}function Ji(a){const e=H(a,["schm"])[0];if(e){const t=ie(e.subarray(4,8));if(t==="cbcs"||t==="cenc")return H(a,["schi","tenc"])[0]}return v.error("[eme] missing 'schm' box"),null}function Un(a,e){return H(e,["moof","traf"]).reduce((t,s)=>{const i=H(s,["tfdt"])[0],r=i[0],n=H(s,["tfhd"]).reduce((o,l)=>{const c=N(l,4),h=a[c];if(h){let u=N(i,4);if(r===1){if(u===vt)return v.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"),o;u*=vt+1,u+=N(i,8)}const d=h.timescale||9e4,g=u/d;if(O(g)&&(o===null||gg+f.info.duration||0,0);o=Math.max(o,d+u.earliestPresentationTime/u.timescale),l=o-n}}if(l&&O(l))return l}return s||i}function $n(a){const e=N(a,0);let t=8;e&1&&(t+=4),e&4&&(t+=4);let s=0;const i=N(a,4);for(let r=0;r{H(s,["tfhd"]).forEach(i=>{const r=N(i,4),n=a[r];if(!n)return;const o=n.timescale||9e4;H(s,["tfdt"]).forEach(l=>{const c=l[0],h=t*o;if(h){let u=N(l,4);if(c===0)u-=h,u=Math.max(u,0),Gt(l,4,u);else{u*=Math.pow(2,32),u+=N(l,8),u-=h,u=Math.max(u,0);const d=Math.floor(u/(vt+1)),g=Math.floor(u%(vt+1));Gt(l,4,d),Gt(l,8,g)}}})})})}function Kn(a){const e={valid:null,remainder:null},t=H(a,["moof"]);if(t.length<2)return e.remainder=a,e;const s=t[t.length-1];return e.valid=Ne(a,0,s.byteOffset-8),e.remainder=Ne(a,s.byteOffset-8),e}function pe(a,e){const t=new Uint8Array(a.length+e.length);return t.set(a),t.set(e,a.length),t}function Vs(a,e){const t=[],s=e.samples,i=e.timescale,r=e.id;let n=!1;return H(s,["moof"]).map(l=>{const c=l.byteOffset-8;H(l,["traf"]).map(u=>{const d=H(u,["tfdt"]).map(g=>{const f=g[0];let m=N(g,4);return f===1&&(m*=Math.pow(2,32),m+=N(g,8)),m/i})[0];return d!==void 0&&(a=d),H(u,["tfhd"]).map(g=>{const f=N(g,4),m=N(g,0)&16777215,T=(m&1)!==0,E=(m&2)!==0,x=(m&8)!==0;let y=0;const I=(m&16)!==0;let S=0;const D=(m&32)!==0;let R=8;f===r&&(T&&(R+=8),E&&(R+=4),x&&(y=N(g,R),R+=4),I&&(S=N(g,R),R+=4),D&&(R+=4),e.type==="video"&&(n=Vn(e.codec)),H(u,["trun"]).map(_=>{const k=_[0],b=N(_,0)&16777215,w=(b&1)!==0;let V=0;const P=(b&4)!==0,K=(b&256)!==0;let G=0;const B=(b&512)!==0;let q=0;const Q=(b&1024)!==0,M=(b&2048)!==0;let F=0;const j=N(_,4);let W=8;w&&(V=N(_,W),W+=4),P&&(W+=4);let z=V+c;for(let te=0;te>1&63;return t===39||t===40}else return(e&31)===6}function Zi(a,e,t,s){const i=er(a);let r=0;r+=e;let n=0,o=0,l=0;for(;r=i.length)break;l=i[r++],n+=l}while(l===255);o=0;do{if(r>=i.length)break;l=i[r++],o+=l}while(l===255);const c=i.length-r;let h=r;if(oc){v.error(`Malformed SEI payload. ${o} is too small, only ${c} bytes left to parse.`);break}if(n===4){if(i[h++]===181){const d=zi(i,h);if(h+=2,d===49){const g=N(i,h);if(h+=4,g===1195456820){const f=i[h++];if(f===3){const m=i[h++],T=31&m,E=64&m,x=E?2+T*3:0,y=new Uint8Array(x);if(E){y[0]=m;for(let I=1;I16){const u=[];for(let f=0;f<16;f++){const m=i[h++].toString(16);u.push(m.length==1?"0"+m:m),(f===3||f===5||f===7||f===9)&&u.push("-")}const d=o-16,g=new Uint8Array(d);for(let f=0;f>24&255,r[1]=s>>16&255,r[2]=s>>8&255,r[3]=s&255,r.set(a,4),i=0,s=8;i0?(r=new Uint8Array(4),e.length>0&&new DataView(r.buffer).setUint32(0,e.length,!1)):r=new Uint8Array;const n=new Uint8Array(4);return t&&t.byteLength>0&&new DataView(n.buffer).setUint32(0,t.byteLength,!1),Yn([112,115,115,104],new Uint8Array([s,0,0,0]),a,r,i,n,t||new Uint8Array)}function jn(a){if(!(a instanceof ArrayBuffer)||a.byteLength<32)return null;const e={version:0,systemId:"",kids:null,data:null},t=new DataView(a),s=t.getUint32(0);if(a.byteLength!==s&&s>44||t.getUint32(4)!==1886614376||(e.version=t.getUint32(8)>>>24,e.version>1))return null;e.systemId=Se.hexDump(new Uint8Array(a,12,16));const r=t.getUint32(28);if(e.version===0){if(s-32=22&&(this.keyId=t.subarray(t.length-22,t.length-6));break;case de.PLAYREADY:{const s=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=qn(s,null,t);const i=new Uint16Array(t.buffer,t.byteOffset,t.byteLength/2),r=String.fromCharCode.apply(null,Array.from(i)),n=r.substring(r.indexOf("<"),r.length),c=new DOMParser().parseFromString(n,"text/xml").getElementsByTagName("KID")[0];if(c){const h=c.childNodes[0]?c.childNodes[0].nodeValue:c.getAttribute("VALUE");if(h){const u=Ss(h).subarray(0,16);xn(u),this.keyId=u}}break}default:{let s=t.subarray(0,16);if(s.length!==16){const i=new Uint8Array(16);i.set(s,16-s.length),s=i}this.keyId=s;break}}if(!this.keyId||this.keyId.byteLength!==16){let s=rt[this.uri];if(!s){const i=Object.keys(rt).length%Number.MAX_SAFE_INTEGER;s=new Uint8Array(16),new DataView(s.buffer,12,4).setUint32(0,i),rt[this.uri]=s}this.keyId=s}return this}}function zn(a){const e=new Uint8Array(16);for(let t=12;t<16;t++)e[t]=a>>8*(15-t)&255;return e}const tr=/\{\$([a-zA-Z0-9-_]+)\}/g;function Hs(a){return tr.test(a)}function ue(a,e,t){if(a.variableList!==null||a.hasVariableRefs)for(let s=t.length;s--;){const i=t[s],r=e[i];r&&(e[i]=os(a,r))}}function os(a,e){if(a.variableList!==null||a.hasVariableRefs){const t=a.variableList;return e.replace(tr,s=>{const i=s.substring(2,s.length-1),r=t==null?void 0:t[i];return r===void 0?(a.playlistParsingError||(a.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${i}"`)),s):r})}return e}function Ws(a,e,t){let s=a.variableList;s||(a.variableList=s={});let i,r;if("QUERYPARAM"in e){i=e.QUERYPARAM;try{const n=new self.URL(t).searchParams;if(n.has(i))r=n.get(i);else throw new Error(`"${i}" does not match any query parameter in URI: "${t}"`)}catch(n){a.playlistParsingError||(a.playlistParsingError=new Error(`EXT-X-DEFINE QUERYPARAM: ${n.message}`))}}else i=e.NAME,r=e.VALUE;i in s?a.playlistParsingError||(a.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${i}"`)):s[i]=r||""}function Xn(a,e,t){const s=e.IMPORT;if(t&&s in t){let i=a.variableList;i||(a.variableList=i={}),i[s]=t[s]}else a.playlistParsingError||(a.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${s}"`))}function Ue(a=!0){return typeof self>"u"?void 0:(a||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function Qn(a){return typeof self<"u"&&a===self.ManagedMediaSource}const At={audio:{a3ds:1,"ac-3":.95,"ac-4":1,alac:.9,alaw:1,dra1:1,"dts+":1,"dts-":1,dtsc:1,dtse:1,dtsh:1,"ec-3":.9,enca:1,fLaC:.9,flac:.9,FLAC:.9,g719:1,g726:1,m4ae:1,mha1:1,mha2:1,mhm1:1,mhm2:1,mlpa:1,mp4a:1,"raw ":1,Opus:1,opus:1,samr:1,sawb:1,sawp:1,sevc:1,sqcp:1,ssmv:1,twos:1,ulaw:1},video:{avc1:1,avc2:1,avc3:1,avc4:1,avcp:1,av01:.8,drac:1,dva1:1,dvav:1,dvh1:.7,dvhe:.7,encv:1,hev1:.75,hvc1:.75,mjp2:1,mp4v:1,mvc1:1,mvc2:1,mvc3:1,mvc4:1,resv:1,rv60:1,s263:1,svc1:1,svc2:1,"vc-1":1,vp08:1,vp09:.9},text:{stpp:1,wvtt:1}};function Jn(a,e){const t=At[e];return!!t&&!!t[a.slice(0,4)]}function Vt(a,e,t=!0){return!a.split(",").some(s=>!sr(s,e,t))}function sr(a,e,t=!0){var s;const i=Ue(t);return(s=i==null?void 0:i.isTypeSupported(st(a,e)))!=null?s:!1}function st(a,e){return`${e}/mp4;codecs="${a}"`}function Ys(a){if(a){const e=a.substring(0,4);return At.video[e]}return 2}function Lt(a){return a.split(",").reduce((e,t)=>{const s=At.video[t];return s?(s*2+e)/(e?3:2):(At.audio[t]+e)/(e?2:1)},0)}const Ht={};function Zn(a,e=!0){if(Ht[a])return Ht[a];const t={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"]}[a];for(let s=0;sZn(t.toLowerCase(),e))}function qs(a,e){return a&&a!=="mp4a"?a:e&&e.split(",")[0]}function ta(a){const e=a.split(",");for(let t=0;t2){let i=s.shift()+".";i+=parseInt(s.shift()).toString(16),i+=("000"+parseInt(s.shift()).toString(16)).slice(-4),e[t]=i}}return e.join(",")}const js=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-(SESSION-DATA|SESSION-KEY|DEFINE|CONTENT-STEERING|START):([^\r\n]*)[\r\n]+/g,zs=/#EXT-X-MEDIA:(.*)/g,sa=/^#EXT(?:INF|-X-TARGETDURATION):/m,Xs=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[^\r\n]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),ia=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(DATERANGE|DEFINE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)/.source,/#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|VERSION): *(\d+)/.source,/#EXT-X-(DISCONTINUITY|ENDLIST|GAP|INDEPENDENT-SEGMENTS)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|"));class Ae{static findGroup(e,t){for(let s=0;s0&&r.length({id:c.attrs.AUDIO,audioCodec:c.audioCodec})),SUBTITLES:n.map(c=>({id:c.attrs.SUBTITLES,textCodec:c.textCodec})),"CLOSED-CAPTIONS":[]};let l=0;for(zs.lastIndex=0;(i=zs.exec(e))!==null;){const c=new ee(i[1]),h=c.TYPE;if(h){const u=o[h],d=r[h]||[];r[h]=d,ue(s,c,["URI","GROUP-ID","LANGUAGE","ASSOC-LANGUAGE","STABLE-RENDITION-ID","NAME","INSTREAM-ID","CHARACTERISTICS","CHANNELS"]);const g=c.LANGUAGE,f=c["ASSOC-LANGUAGE"],m=c.CHANNELS,T=c.CHARACTERISTICS,E=c["INSTREAM-ID"],x={attrs:c,bitrate:0,id:l++,groupId:c["GROUP-ID"]||"",name:c.NAME||g||"",type:h,default:c.bool("DEFAULT"),autoselect:c.bool("AUTOSELECT"),forced:c.bool("FORCED"),lang:g,url:c.URI?Ae.resolve(c.URI,t):""};if(f&&(x.assocLang=f),m&&(x.channels=m),T&&(x.characteristics=T),E&&(x.instreamId=E),u!=null&&u.length){const y=Ae.findGroup(u,x.groupId)||u[0];Zs(x,y,"audioCodec"),Zs(x,y,"textCodec")}d.push(x)}}return r}static parseLevelPlaylist(e,t,s,i,r,n){const o=new En(t),l=o.fragments;let c=null,h=0,u=0,d=0,g=0,f=null,m=new Ut(i,t),T,E,x,y=-1,I=!1,S=null;for(Xs.lastIndex=0,o.m3u8=e,o.hasVariableRefs=Hs(e);(T=Xs.exec(e))!==null;){I&&(I=!1,m=new Ut(i,t),m.start=d,m.sn=h,m.cc=g,m.level=s,c&&(m.initSegment=c,m.rawProgramDateTime=c.rawProgramDateTime,c.rawProgramDateTime=null,S&&(m.setByteRange(S),S=null)));const k=T[1];if(k){m.duration=parseFloat(k);const b=(" "+T[2]).slice(1);m.title=b||null,m.tagList.push(b?["INF",k,b]:["INF",k])}else if(T[3]){if(O(m.duration)){m.start=d,x&&si(m,x,o),m.sn=h,m.level=s,m.cc=g,l.push(m);const b=(" "+T[3]).slice(1);m.relurl=os(o,b),ei(m,f),f=m,d+=m.duration,h++,u=0,I=!0}}else if(T[4]){const b=(" "+T[4]).slice(1);f?m.setByteRange(b,f):m.setByteRange(b)}else if(T[5])m.rawProgramDateTime=(" "+T[5]).slice(1),m.tagList.push(["PROGRAM-DATE-TIME",m.rawProgramDateTime]),y===-1&&(y=l.length);else{if(T=T[0].match(ia),!T){v.warn("No matches on slow regex match for level playlist!");continue}for(E=1;E0&&P.bool("CAN-SKIP-DATERANGES"),o.partHoldBack=P.optionalFloat("PART-HOLD-BACK",0),o.holdBack=P.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{const P=new ee(w);o.partTarget=P.decimalFloatingPoint("PART-TARGET");break}case"PART":{let P=o.partList;P||(P=o.partList=[]);const K=u>0?P[P.length-1]:void 0,G=u++,B=new ee(w);ue(o,B,["BYTERANGE","URI"]);const q=new pn(B,m,t,G,K);P.push(q),m.duration+=q.duration;break}case"PRELOAD-HINT":{const P=new ee(w);ue(o,P,["URI"]),o.preloadHint=P;break}case"RENDITION-REPORT":{const P=new ee(w);ue(o,P,["URI"]),o.renditionReports=o.renditionReports||[],o.renditionReports.push(P);break}default:v.warn(`line parsed but not handled: ${T}`);break}}}f&&!f.relurl?(l.pop(),d-=f.duration,o.partList&&(o.fragmentHint=f)):o.partList&&(ei(m,f),m.cc=g,o.fragmentHint=m,x&&si(m,x,o));const D=l.length,R=l[0],_=l[D-1];if(d+=o.skippedSegments*o.targetduration,d>0&&D&&_){o.averagetargetduration=d/D;const k=_.sn;o.endSN=k!=="initSegment"?k:0,o.live||(_.endList=!0),R&&(o.startCC=R.cc)}else o.endSN=0,o.startCC=0;return o.fragmentHint&&(d+=o.fragmentHint.duration),o.totalduration=d,o.endCC=g,y>0&&na(l,y),o}}function Qs(a,e,t){var s,i;const r=new ee(a);ue(t,r,["KEYFORMAT","KEYFORMATVERSIONS","URI","IV","URI"]);const n=(s=r.METHOD)!=null?s:"",o=r.URI,l=r.hexadecimalInteger("IV"),c=r.KEYFORMATVERSIONS,h=(i=r.KEYFORMAT)!=null?i:"identity";o&&r.IV&&!l&&v.error(`Invalid IV: ${r.IV}`);const u=o?Ae.resolve(o,e):"",d=(c||"1").split("/").map(Number).filter(Number.isFinite);return new tt(n,u,h,d,l)}function Js(a){const t=new ee(a).decimalFloatingPoint("TIME-OFFSET");return O(t)?t:null}function ra(a,e){let t=(a||"").split(/[ ,]+/).filter(s=>s);["video","audio","text"].forEach(s=>{const i=t.filter(r=>Jn(r,s));i.length&&(e[`${s}Codec`]=i.join(","),t=t.filter(r=>i.indexOf(r)===-1))}),e.unknownCodecs=t}function Zs(a,e,t){const s=e[t];s&&(a[t]=s)}function na(a,e){let t=a[e];for(let s=e;s--;){const i=a[s];if(!i)return;i.programDateTime=t.programDateTime-i.duration*1e3,t=i}}function ei(a,e){a.rawProgramDateTime?a.programDateTime=Date.parse(a.rawProgramDateTime):e!=null&&e.programDateTime&&(a.programDateTime=e.endProgramDateTime),O(a.programDateTime)||(a.programDateTime=null,a.rawProgramDateTime=null)}function ti(a,e,t,s){a.relurl=e.URI,e.BYTERANGE&&a.setByteRange(e.BYTERANGE),a.level=t,a.sn="initSegment",s&&(a.levelkeys=s),a.initSegment=null}function si(a,e,t){a.levelkeys=e;const{encryptedFragments:s}=t;(!s.length||s[s.length-1].levelkeys!==e)&&Object.keys(e).some(i=>e[i].isCommonEncryption)&&s.push(a)}var Y={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},U={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};function ii(a){const{type:e}=a;switch(e){case Y.AUDIO_TRACK:return U.AUDIO;case Y.SUBTITLE_TRACK:return U.SUBTITLE;default:return U.MAIN}}function Wt(a,e){let t=a.url;return(t===void 0||t.indexOf("data:")===0)&&(t=e.url),t}class aa{constructor(e){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.hls=e,this.registerListeners()}startLoad(e){}stopLoad(){this.destroyInternalLoaders()}registerListeners(){const{hls:e}=this;e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.LEVEL_LOADING,this.onLevelLoading,this),e.on(p.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(p.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}unregisterListeners(){const{hls:e}=this;e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.LEVEL_LOADING,this.onLevelLoading,this),e.off(p.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(p.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}createInternalLoader(e){const t=this.hls.config,s=t.pLoader,i=t.loader,r=s||i,n=new r(t);return this.loaders[e.type]=n,n}getInternalLoader(e){return this.loaders[e.type]}resetInternalLoader(e){this.loaders[e]&&delete this.loaders[e]}destroyInternalLoaders(){for(const e in this.loaders){const t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}}destroy(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}onManifestLoading(e,t){const{url:s}=t;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:Y.MANIFEST,url:s,deliveryDirectives:null})}onLevelLoading(e,t){const{id:s,level:i,pathwayId:r,url:n,deliveryDirectives:o}=t;this.load({id:s,level:i,pathwayId:r,responseType:"text",type:Y.LEVEL,url:n,deliveryDirectives:o})}onAudioTrackLoading(e,t){const{id:s,groupId:i,url:r,deliveryDirectives:n}=t;this.load({id:s,groupId:i,level:null,responseType:"text",type:Y.AUDIO_TRACK,url:r,deliveryDirectives:n})}onSubtitleTrackLoading(e,t){const{id:s,groupId:i,url:r,deliveryDirectives:n}=t;this.load({id:s,groupId:i,level:null,responseType:"text",type:Y.SUBTITLE_TRACK,url:r,deliveryDirectives:n})}load(e){var t;const s=this.hls.config;let i=this.getInternalLoader(e);if(i){const c=i.context;if(c&&c.url===e.url&&c.level===e.level){v.trace("[playlist-loader]: playlist request ongoing");return}v.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`),i.abort()}let r;if(e.type===Y.MANIFEST?r=s.manifestLoadPolicy.default:r=se({},s.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),i=this.createInternalLoader(e),O((t=e.deliveryDirectives)==null?void 0:t.part)){let c;if(e.type===Y.LEVEL&&e.level!==null?c=this.hls.levels[e.level].details:e.type===Y.AUDIO_TRACK&&e.id!==null?c=this.hls.audioTracks[e.id].details:e.type===Y.SUBTITLE_TRACK&&e.id!==null&&(c=this.hls.subtitleTracks[e.id].details),c){const h=c.partTarget,u=c.targetduration;if(h&&u){const d=Math.max(h*3,u*.8)*1e3;r=se({},r,{maxTimeToFirstByteMs:Math.min(d,r.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(d,r.maxTimeToFirstByteMs)})}}}const n=r.errorRetry||r.timeoutRetry||{},o={loadPolicy:r,timeout:r.maxLoadTimeMs,maxRetry:n.maxNumRetry||0,retryDelay:n.retryDelayMs||0,maxRetryDelay:n.maxRetryDelayMs||0},l={onSuccess:(c,h,u,d)=>{const g=this.getInternalLoader(u);this.resetInternalLoader(u.type);const f=c.data;if(f.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(c,u,new Error("no EXTM3U delimiter"),d||null,h);return}h.parsing.start=performance.now(),Ae.isMediaPlaylist(f)?this.handleTrackOrLevelPlaylist(c,h,u,d||null,g):this.handleMasterPlaylist(c,h,u,d)},onError:(c,h,u,d)=>{this.handleNetworkError(h,u,!1,c,d)},onTimeout:(c,h,u)=>{this.handleNetworkError(h,u,!0,void 0,c)}};i.load(e,o,l)}handleMasterPlaylist(e,t,s,i){const r=this.hls,n=e.data,o=Wt(e,s),l=Ae.parseMasterPlaylist(n,o);if(l.playlistParsingError){this.handleManifestParsingError(e,s,l.playlistParsingError,i,t);return}const{contentSteering:c,levels:h,sessionData:u,sessionKeys:d,startTimeOffset:g,variableList:f}=l;this.variableList=f;const{AUDIO:m=[],SUBTITLES:T,"CLOSED-CAPTIONS":E}=Ae.parseMasterPlaylistMedia(n,o,l);m.length&&!m.some(y=>!y.url)&&h[0].audioCodec&&!h[0].attrs.AUDIO&&(v.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),m.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new ee({}),bitrate:0,url:""})),r.trigger(p.MANIFEST_LOADED,{levels:h,audioTracks:m,subtitles:T,captions:E,contentSteering:c,url:o,stats:t,networkDetails:i,sessionData:u,sessionKeys:d,startTimeOffset:g,variableList:f})}handleTrackOrLevelPlaylist(e,t,s,i,r){const n=this.hls,{id:o,level:l,type:c}=s,h=Wt(e,s),u=0,d=O(l)?l:O(o)?o:0,g=ii(s),f=Ae.parseLevelPlaylist(e.data,h,d,g,u,this.variableList);if(c===Y.MANIFEST){const m={attrs:new ee({}),bitrate:0,details:f,name:"",url:h};n.trigger(p.MANIFEST_LOADED,{levels:[m],audioTracks:[],url:h,stats:t,networkDetails:i,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),s.levelDetails=f,this.handlePlaylistLoaded(f,e,t,s,i,r)}handleManifestParsingError(e,t,s,i,r){this.hls.trigger(p.ERROR,{type:$.NETWORK_ERROR,details:L.MANIFEST_PARSING_ERROR,fatal:t.type===Y.MANIFEST,url:e.url,err:s,error:s,reason:s.message,response:e,context:t,networkDetails:i,stats:r})}handleNetworkError(e,t,s=!1,i,r){let n=`A network ${s?"timeout":"error"+(i?" (status "+i.code+")":"")} occurred while loading ${e.type}`;e.type===Y.LEVEL?n+=`: ${e.level} id: ${e.id}`:(e.type===Y.AUDIO_TRACK||e.type===Y.SUBTITLE_TRACK)&&(n+=` id: ${e.id} group-id: "${e.groupId}"`);const o=new Error(n);v.warn(`[playlist-loader]: ${n}`);let l=L.UNKNOWN,c=!1;const h=this.getInternalLoader(e);switch(e.type){case Y.MANIFEST:l=s?L.MANIFEST_LOAD_TIMEOUT:L.MANIFEST_LOAD_ERROR,c=!0;break;case Y.LEVEL:l=s?L.LEVEL_LOAD_TIMEOUT:L.LEVEL_LOAD_ERROR,c=!1;break;case Y.AUDIO_TRACK:l=s?L.AUDIO_TRACK_LOAD_TIMEOUT:L.AUDIO_TRACK_LOAD_ERROR,c=!1;break;case Y.SUBTITLE_TRACK:l=s?L.SUBTITLE_TRACK_LOAD_TIMEOUT:L.SUBTITLE_LOAD_ERROR,c=!1;break}h&&this.resetInternalLoader(e.type);const u={type:$.NETWORK_ERROR,details:l,fatal:c,url:e.url,loader:h,context:e,error:o,networkDetails:t,stats:r};if(i){const d=(t==null?void 0:t.url)||e.url;u.response=oe({url:d,data:void 0},i)}this.hls.trigger(p.ERROR,u)}handlePlaylistLoaded(e,t,s,i,r,n){const o=this.hls,{type:l,level:c,id:h,groupId:u,deliveryDirectives:d}=i,g=Wt(t,i),f=ii(i),m=typeof i.level=="number"&&f===U.MAIN?c:void 0;if(!e.fragments.length){const E=new Error("No Segments found in Playlist");o.trigger(p.ERROR,{type:$.NETWORK_ERROR,details:L.LEVEL_EMPTY_ERROR,fatal:!1,url:g,error:E,reason:E.message,response:t,context:i,level:m,parent:f,networkDetails:r,stats:s});return}e.targetduration||(e.playlistParsingError=new Error("Missing Target Duration"));const T=e.playlistParsingError;if(T){o.trigger(p.ERROR,{type:$.NETWORK_ERROR,details:L.LEVEL_PARSING_ERROR,fatal:!1,url:g,error:T,reason:T.message,response:t,context:i,level:m,parent:f,networkDetails:r,stats:s});return}switch(e.live&&n&&(n.getCacheAge&&(e.ageHeader=n.getCacheAge()||0),(!n.getCacheAge||isNaN(e.ageHeader))&&(e.ageHeader=0)),l){case Y.MANIFEST:case Y.LEVEL:o.trigger(p.LEVEL_LOADED,{details:e,level:m||0,id:h||0,stats:s,networkDetails:r,deliveryDirectives:d});break;case Y.AUDIO_TRACK:o.trigger(p.AUDIO_TRACK_LOADED,{details:e,id:h||0,groupId:u||"",stats:s,networkDetails:r,deliveryDirectives:d});break;case Y.SUBTITLE_TRACK:o.trigger(p.SUBTITLE_TRACK_LOADED,{details:e,id:h||0,groupId:u||"",stats:s,networkDetails:r,deliveryDirectives:d});break}}}function ir(a,e){let t;try{t=new Event("addtrack")}catch{t=document.createEvent("Event"),t.initEvent("addtrack",!1,!1)}t.track=a,e.dispatchEvent(t)}function rr(a,e){const t=a.mode;if(t==="disabled"&&(a.mode="hidden"),a.cues&&!a.cues.getCueById(e.id))try{if(a.addCue(e),!a.cues.getCueById(e.id))throw new Error(`addCue is failed for: ${e}`)}catch(s){v.debug(`[texttrack-utils]: ${s}`);try{const i=new self.TextTrackCue(e.startTime,e.endTime,e.text);i.id=e.id,a.addCue(i)}catch(i){v.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${i}`)}}t==="disabled"&&(a.mode=t)}function He(a){const e=a.mode;if(e==="disabled"&&(a.mode="hidden"),a.cues)for(let t=a.cues.length;t--;)a.removeCue(a.cues[t]);e==="disabled"&&(a.mode=e)}function ls(a,e,t,s){const i=a.mode;if(i==="disabled"&&(a.mode="hidden"),a.cues&&a.cues.length>0){const r=la(a.cues,e,t);for(let n=0;na[t].endTime)return-1;let s=0,i=t;for(;s<=i;){const r=Math.floor((i+s)/2);if(ea[r].startTime&&s-1)for(let r=i,n=a.length;r=e&&o.endTime<=t)s.push(o);else if(o.startTime>t)return s}return s}function gt(a){const e=[];for(let t=0;t"u"))return self.VTTCue||self.TextTrackCue}function ri(a,e,t,s,i){let r=new a(e,t,"");try{r.value=s,i&&(r.type=i)}catch{r=new a(e,t,JSON.stringify(i?oe({type:i},s):s))}return r}const nt=(()=>{const a=cs();try{a&&new a(0,Number.POSITIVE_INFINITY,"")}catch{return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();function Yt(a,e){return a.getTime()/1e3-e}function ha(a){return Uint8Array.from(a.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}class ua{constructor(e){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=e,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=null}_registerListeners(){const{hls:e}=this;e.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(p.LEVEL_UPDATED,this.onLevelUpdated,this)}_unregisterListeners(){const{hls:e}=this;e.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(p.LEVEL_UPDATED,this.onLevelUpdated,this)}onMediaAttached(e,t){this.media=t.media}onMediaDetaching(){this.id3Track&&(He(this.id3Track),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={})}onManifestLoading(){this.dateRangeCuesAppended={}}createTrack(e){const t=this.getID3Track(e.textTracks);return t.mode="hidden",t}getID3Track(e){if(this.media){for(let t=0;tnt&&(u=nt),u-h<=0&&(u=h+ca);for(let g=0;gh.type===ye.audioId3&&l:i==="video"?c=h=>h.type===ye.emsg&&o:c=h=>h.type===ye.audioId3&&l||h.type===ye.emsg&&o,ls(r,t,s,c)}}onLevelUpdated(e,{details:t}){if(!this.media||!t.hasProgramDateTime||!this.hls.config.enableDateRangeMetadataCues)return;const{dateRangeCuesAppended:s,id3Track:i}=this,{dateRanges:r}=t,n=Object.keys(r);if(i){const h=Object.keys(s).filter(u=>!n.includes(u));for(let u=h.length;u--;){const d=h[u];Object.keys(s[d].cues).forEach(g=>{i.removeCue(s[d].cues[g])}),delete s[d]}}const o=t.fragments[t.fragments.length-1];if(n.length===0||!O(o==null?void 0:o.programDateTime))return;this.id3Track||(this.id3Track=this.createTrack(this.media));const l=o.programDateTime/1e3-o.start,c=cs();for(let h=0;h{if(D!==d.id){const R=r[D];if(R.class===d.class&&R.startDate>d.startDate&&(!S||d.startDatethis.timeupdate(),this.hls=e,this.config=e.config,this.registerListeners()}get latency(){return this._latency||0}get maxLatency(){const{config:e,levelDetails:t}=this;return e.liveMaxLatencyDuration!==void 0?e.liveMaxLatencyDuration:t?e.liveMaxLatencyDurationCount*t.targetduration:0}get targetLatency(){const{levelDetails:e}=this;if(e===null)return null;const{holdBack:t,partHoldBack:s,targetduration:i}=e,{liveSyncDuration:r,liveSyncDurationCount:n,lowLatencyMode:o}=this.config,l=this.hls.userConfig;let c=o&&s||t;(l.liveSyncDuration||l.liveSyncDurationCount||c===0)&&(c=r!==void 0?r:n*i);const h=i;return c+Math.min(this.stallCount*1,h)}get liveSyncPosition(){const e=this.estimateLiveEdge(),t=this.targetLatency,s=this.levelDetails;if(e===null||t===null||s===null)return null;const i=s.edge,r=e-t-this.edgeStalled,n=i-s.totalduration,o=i-(this.config.lowLatencyMode&&s.partTarget||s.targetduration);return Math.min(Math.max(n,r),o)}get drift(){const{levelDetails:e}=this;return e===null?1:e.drift}get edgeStalled(){const{levelDetails:e}=this;if(e===null)return 0;const t=(this.config.lowLatencyMode&&e.partTarget||e.targetduration)*3;return Math.max(e.age-t,0)}get forwardBufferLength(){const{media:e,levelDetails:t}=this;if(!e||!t)return 0;const s=e.buffered.length;return(s?e.buffered.end(s-1):t.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null}registerListeners(){this.hls.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(p.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(p.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(p.ERROR,this.onError,this)}unregisterListeners(){this.hls.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.off(p.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(p.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.off(p.ERROR,this.onError,this)}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)}onMediaDetaching(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)}onManifestLoading(){this.levelDetails=null,this._latency=null,this.stallCount=0}onLevelUpdated(e,{details:t}){this.levelDetails=t,t.advanced&&this.timeupdate(),!t.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)}onError(e,t){var s;t.details===L.BUFFER_STALLED_ERROR&&(this.stallCount++,(s=this.levelDetails)!=null&&s.live&&v.warn("[playback-rate-controller]: Stall detected, adjusting target latency"))}timeupdate(){const{media:e,levelDetails:t}=this;if(!e||!t)return;this.currentTime=e.currentTime;const s=this.computeLatency();if(s===null)return;this._latency=s;const{lowLatencyMode:i,maxLiveSyncPlaybackRate:r}=this.config;if(!i||r===1||!t.live)return;const n=this.targetLatency;if(n===null)return;const o=s-n,l=Math.min(this.maxLatency,n+t.targetduration);if(o.05&&this.forwardBufferLength>1){const h=Math.min(2,Math.max(1,r)),u=Math.round(2/(1+Math.exp(-.75*o-this.edgeStalled))*20)/20;e.playbackRate=Math.min(h,Math.max(1,u))}else e.playbackRate!==1&&e.playbackRate!==0&&(e.playbackRate=1)}estimateLiveEdge(){const{levelDetails:e}=this;return e===null?null:e.edge+e.age}computeLatency(){const e=this.estimateLiveEdge();return e===null?null:e-this.currentTime}}const hs=["NONE","TYPE-0","TYPE-1",null];function fa(a){return hs.indexOf(a)>-1}const It=["SDR","PQ","HLG"];function ga(a){return!!a&&It.indexOf(a)>-1}var mt={No:"",Yes:"YES",v2:"v2"};function ni(a){const{canSkipUntil:e,canSkipDateRanges:t,age:s}=a,i=s!!t).map(t=>t.substring(0,4)).join(","),this.addGroupId("audio",e.attrs.AUDIO),this.addGroupId("text",e.attrs.SUBTITLES)}get maxBitrate(){return Math.max(this.realBitrate,this.bitrate)}get averageBitrate(){return this._avgBitrate||this.realBitrate||this.bitrate}get attrs(){return this._attrs[0]}get codecs(){return this.attrs.CODECS||""}get pathwayId(){return this.attrs["PATHWAY-ID"]||"."}get videoRange(){return this.attrs["VIDEO-RANGE"]||"SDR"}get score(){return this.attrs.optionalFloat("SCORE",0)}get uri(){return this.url[0]||""}hasAudioGroup(e){return oi(this._audioGroups,e)}hasSubtitleGroup(e){return oi(this._subtitleGroups,e)}get audioGroups(){return this._audioGroups}get subtitleGroups(){return this._subtitleGroups}addGroupId(e,t){if(t){if(e==="audio"){let s=this._audioGroups;s||(s=this._audioGroups=[]),s.indexOf(t)===-1&&s.push(t)}else if(e==="text"){let s=this._subtitleGroups;s||(s=this._subtitleGroups=[]),s.indexOf(t)===-1&&s.push(t)}}}get urlId(){return 0}set urlId(e){}get audioGroupIds(){return this.audioGroups?[this.audioGroupId]:void 0}get textGroupIds(){return this.subtitleGroups?[this.textGroupId]:void 0}get audioGroupId(){var e;return(e=this.audioGroups)==null?void 0:e[0]}get textGroupId(){var e;return(e=this.subtitleGroups)==null?void 0:e[0]}addFallback(){}}function oi(a,e){return!e||!a?!1:a.indexOf(e)!==-1}function qt(a,e){const t=e.startPTS;if(O(t)){let s=0,i;e.sn>a.sn?(s=t-a.start,i=a):(s=a.start-t,i=e),i.duration!==s&&(i.duration=s)}else e.sn>a.sn?a.cc===e.cc&&a.minEndPTS?e.start=a.start+(a.minEndPTS-a.start):e.start=a.start+a.duration:e.start=Math.max(a.start-e.duration,0)}function nr(a,e,t,s,i,r){s-t<=0&&(v.warn("Fragment should have a positive duration",e),s=t+e.duration,r=i+e.duration);let o=t,l=s;const c=e.startPTS,h=e.endPTS;if(O(c)){const T=Math.abs(c-t);O(e.deltaPTS)?e.deltaPTS=Math.max(T,e.deltaPTS):e.deltaPTS=T,o=Math.max(t,c),t=Math.min(t,c),i=Math.min(i,e.startDTS),l=Math.min(s,h),s=Math.max(s,h),r=Math.max(r,e.endDTS)}const u=t-e.start;e.start!==0&&(e.start=t),e.duration=s-e.start,e.startPTS=t,e.maxStartPTS=o,e.startDTS=i,e.endPTS=s,e.minEndPTS=l,e.endDTS=r;const d=e.sn;if(!a||da.endSN)return 0;let g;const f=d-a.startSN,m=a.fragments;for(m[f]=e,g=f;g>0;g--)qt(m[g],m[g-1]);for(g=f;g=0;l--){const c=s[l].initSegment;if(c){t=c;break}}a.fragmentHint&&delete a.fragmentHint.endPTS;let i=0,r;if(Ea(a,e,(l,c)=>{l.relurl&&(i=l.cc-c.cc),O(l.startPTS)&&O(l.endPTS)&&(c.start=c.startPTS=l.startPTS,c.startDTS=l.startDTS,c.maxStartPTS=l.maxStartPTS,c.endPTS=l.endPTS,c.endDTS=l.endDTS,c.minEndPTS=l.minEndPTS,c.duration=l.endPTS-l.startPTS,c.duration&&(r=c),e.PTSKnown=e.alignedSliding=!0),c.elementaryStreams=l.elementaryStreams,c.loader=l.loader,c.stats=l.stats,l.initSegment&&(c.initSegment=l.initSegment,t=l.initSegment)}),t&&(e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments).forEach(c=>{var h;c&&(!c.initSegment||c.initSegment.relurl===((h=t)==null?void 0:h.relurl))&&(c.initSegment=t)}),e.skippedSegments)if(e.deltaUpdateFailed=e.fragments.some(l=>!l),e.deltaUpdateFailed){v.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let l=e.skippedSegments;l--;)e.fragments.shift();e.startSN=e.fragments[0].sn,e.startCC=e.fragments[0].cc}else e.canSkipDateRanges&&(e.dateRanges=pa(a.dateRanges,e.dateRanges,e.recentlyRemovedDateranges));const n=e.fragments;if(i){v.warn("discontinuity sliding from playlist, take drift into account");for(let l=0;l{c.elementaryStreams=l.elementaryStreams,c.stats=l.stats}),r?nr(e,r,r.startPTS,r.endPTS,r.startDTS,r.endDTS):ar(a,e),n.length&&(e.totalduration=e.edge-n[0].start),e.driftStartTime=a.driftStartTime,e.driftStart=a.driftStart;const o=e.advancedDateTime;if(e.advanced&&o){const l=e.edge;e.driftStart||(e.driftStartTime=o,e.driftStart=l),e.driftEndTime=o,e.driftEnd=l}else e.driftEndTime=a.driftEndTime,e.driftEnd=a.driftEnd,e.advancedDateTime=a.advancedDateTime}function pa(a,e,t){const s=se({},a);return t&&t.forEach(i=>{delete s[i]}),Object.keys(e).forEach(i=>{const r=new Gi(e[i].attr,s[i]);r.isValid?s[i]=r:v.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${JSON.stringify(e[i].attr)}"`)}),s}function Ta(a,e,t){if(a&&e){let s=0;for(let i=0,r=a.length;i<=r;i++){const n=a[i],o=e[i+s];n&&o&&n.index===o.index&&n.fragment.sn===o.fragment.sn?t(n,o):s--}}}function Ea(a,e,t){const s=e.skippedSegments,i=Math.max(a.startSN,e.startSN)-e.startSN,r=(a.fragmentHint?1:0)+(s?e.endSN:Math.min(a.endSN,e.endSN))-e.startSN,n=e.startSN-a.startSN,o=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,l=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments;for(let c=i;c<=r;c++){const h=l[n+c];let u=o[c];s&&!u&&c=s.length||us(e,s[t].start)}function us(a,e){if(e){const t=a.fragments;for(let s=a.skippedSegments;se){const r=s[s.length-1].duration*1e3;r{const{details:s}=e;s!=null&&s.fragments&&s.fragments.forEach(i=>{i.level=t})})}function bt(a){switch(a.details){case L.FRAG_LOAD_TIMEOUT:case L.KEY_LOAD_TIMEOUT:case L.LEVEL_LOAD_TIMEOUT:case L.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function ci(a,e){const t=bt(e);return a.default[`${t?"timeout":"error"}Retry`]}function Ls(a,e){const t=a.backoff==="linear"?1:Math.pow(2,e);return Math.min(t*a.retryDelayMs,a.maxRetryDelayMs)}function hi(a){return oe(oe({},a),{errorRetry:null,timeoutRetry:null})}function Dt(a,e,t,s){if(!a)return!1;const i=s==null?void 0:s.code,r=e499)}const cr={search:function(a,e){let t=0,s=a.length-1,i=null,r=null;for(;t<=s;){i=(t+s)/2|0,r=a[i];const n=e(r);if(n>0)t=i+1;else if(n<0)s=i-1;else return r}return null}};function va(a,e,t){if(e===null||!Array.isArray(a)||!a.length||!O(e))return null;const s=a[0].programDateTime;if(e<(s||0))return null;const i=a[a.length-1].endProgramDateTime;if(e>=(i||0))return null;t=t||0;for(let r=0;r0&&o<15e-7&&(t+=15e-7)}else t===0&&e[0].start===0&&(r=e[0]);if(r&&((!a||a.level===r.level)&&ds(t,s,r)===0||Aa(r,a,Math.min(i,s))))return r;const n=cr.search(e,ds.bind(null,t,s));return n&&(n!==a||!r)?n:r}function Aa(a,e,t){if(e&&e.start===0&&e.level0){const s=e.tagList.reduce((i,r)=>(r[0]==="INF"&&(i+=parseFloat(r[1])),i),t);return a.start<=s}return!1}function ds(a=0,e=0,t){if(t.start<=a&&t.start+t.duration>a)return 0;const s=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0));return t.start+t.duration-s<=a?1:t.start-s>a&&t.start?-1:0}function La(a,e,t){const s=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0))*1e3;return(t.endProgramDateTime||0)-s>a}function Ra(a,e){return cr.search(a,t=>t.cce?-1:0)}var ce={DoNothing:0,SendEndCallback:1,SendAlternateToPenaltyBox:2,RemoveAlternatePermanently:3,InsertDiscontinuity:4,RetryRequest:5},Te={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2,SwitchToSDR:4};class Ia{constructor(e){this.hls=void 0,this.playlistError=0,this.penalizedRenditions={},this.log=void 0,this.warn=void 0,this.error=void 0,this.hls=e,this.log=v.log.bind(v,"[info]:"),this.warn=v.warn.bind(v,"[warning]:"),this.error=v.error.bind(v,"[error]:"),this.registerListeners()}registerListeners(){const e=this.hls;e.on(p.ERROR,this.onError,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const e=this.hls;e&&(e.off(p.ERROR,this.onError,this),e.off(p.ERROR,this.onErrorOut,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.LEVEL_UPDATED,this.onLevelUpdated,this))}destroy(){this.unregisterListeners(),this.hls=null,this.penalizedRenditions={}}startLoad(e){}stopLoad(){this.playlistError=0}getVariantLevelIndex(e){return(e==null?void 0:e.type)===U.MAIN?e.level:this.hls.loadLevel}onManifestLoading(){this.playlistError=0,this.penalizedRenditions={}}onLevelUpdated(){this.playlistError=0}onError(e,t){var s,i;if(t.fatal)return;const r=this.hls,n=t.context;switch(t.details){case L.FRAG_LOAD_ERROR:case L.FRAG_LOAD_TIMEOUT:case L.KEY_LOAD_ERROR:case L.KEY_LOAD_TIMEOUT:t.errorAction=this.getFragRetryOrSwitchAction(t);return;case L.FRAG_PARSING_ERROR:if((s=t.frag)!=null&&s.gap){t.errorAction={action:ce.DoNothing,flags:Te.None};return}case L.FRAG_GAP:case L.FRAG_DECRYPT_ERROR:{t.errorAction=this.getFragRetryOrSwitchAction(t),t.errorAction.action=ce.SendAlternateToPenaltyBox;return}case L.LEVEL_EMPTY_ERROR:case L.LEVEL_PARSING_ERROR:{var o,l;const c=t.parent===U.MAIN?t.level:r.loadLevel;t.details===L.LEVEL_EMPTY_ERROR&&((o=t.context)!=null&&(l=o.levelDetails)!=null&&l.live)?t.errorAction=this.getPlaylistRetryOrSwitchAction(t,c):(t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,c))}return;case L.LEVEL_LOAD_ERROR:case L.LEVEL_LOAD_TIMEOUT:typeof(n==null?void 0:n.level)=="number"&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,n.level));return;case L.AUDIO_TRACK_LOAD_ERROR:case L.AUDIO_TRACK_LOAD_TIMEOUT:case L.SUBTITLE_LOAD_ERROR:case L.SUBTITLE_TRACK_LOAD_TIMEOUT:if(n){const c=r.levels[r.loadLevel];if(c&&(n.type===Y.AUDIO_TRACK&&c.hasAudioGroup(n.groupId)||n.type===Y.SUBTITLE_TRACK&&c.hasSubtitleGroup(n.groupId))){t.errorAction=this.getPlaylistRetryOrSwitchAction(t,r.loadLevel),t.errorAction.action=ce.SendAlternateToPenaltyBox,t.errorAction.flags=Te.MoveAllAlternatesMatchingHost;return}}return;case L.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:{const c=r.levels[r.loadLevel],h=c==null?void 0:c.attrs["HDCP-LEVEL"];h?t.errorAction={action:ce.SendAlternateToPenaltyBox,flags:Te.MoveAllAlternatesMatchingHDCP,hdcpLevel:h}:this.keySystemError(t)}return;case L.BUFFER_ADD_CODEC_ERROR:case L.REMUX_ALLOC_ERROR:case L.BUFFER_APPEND_ERROR:t.errorAction=this.getLevelSwitchAction(t,(i=t.level)!=null?i:r.loadLevel);return;case L.INTERNAL_EXCEPTION:case L.BUFFER_APPENDING_ERROR:case L.BUFFER_FULL_ERROR:case L.LEVEL_SWITCH_ERROR:case L.BUFFER_STALLED_ERROR:case L.BUFFER_SEEK_OVER_HOLE:case L.BUFFER_NUDGE_ON_STALL:t.errorAction={action:ce.DoNothing,flags:Te.None};return}t.type===$.KEY_SYSTEM_ERROR&&this.keySystemError(t)}keySystemError(e){const t=this.getVariantLevelIndex(e.frag);e.levelRetry=!1,e.errorAction=this.getLevelSwitchAction(e,t)}getPlaylistRetryOrSwitchAction(e,t){const s=this.hls,i=ci(s.config.playlistLoadPolicy,e),r=this.playlistError++;if(Dt(i,r,bt(e),e.response))return{action:ce.RetryRequest,flags:Te.None,retryConfig:i,retryCount:r};const o=this.getLevelSwitchAction(e,t);return i&&(o.retryConfig=i,o.retryCount=r),o}getFragRetryOrSwitchAction(e){const t=this.hls,s=this.getVariantLevelIndex(e.frag),i=t.levels[s],{fragLoadPolicy:r,keyLoadPolicy:n}=t.config,o=ci(e.details.startsWith("key")?n:r,e),l=t.levels.reduce((h,u)=>h+u.fragmentError,0);if(i&&(e.details!==L.FRAG_GAP&&i.fragmentError++,Dt(o,l,bt(e),e.response)))return{action:ce.RetryRequest,flags:Te.None,retryConfig:o,retryCount:l};const c=this.getLevelSwitchAction(e,s);return o&&(c.retryConfig=o,c.retryCount=l),c}getLevelSwitchAction(e,t){const s=this.hls;t==null&&(t=s.loadLevel);const i=this.hls.levels[t];if(i){var r,n;const c=e.details;i.loadError++,c===L.BUFFER_APPEND_ERROR&&i.fragmentError++;let h=-1;const{levels:u,loadLevel:d,minAutoLevel:g,maxAutoLevel:f}=s;s.autoLevelEnabled||(s.loadLevel=-1);const m=(r=e.frag)==null?void 0:r.type,E=(m===U.AUDIO&&c===L.FRAG_PARSING_ERROR||e.sourceBufferName==="audio"&&(c===L.BUFFER_ADD_CODEC_ERROR||c===L.BUFFER_APPEND_ERROR))&&u.some(({audioCodec:D})=>i.audioCodec!==D),y=e.sourceBufferName==="video"&&(c===L.BUFFER_ADD_CODEC_ERROR||c===L.BUFFER_APPEND_ERROR)&&u.some(({codecSet:D,audioCodec:R})=>i.codecSet!==D&&i.audioCodec===R),{type:I,groupId:S}=(n=e.context)!=null?n:{};for(let D=u.length;D--;){const R=(D+d)%u.length;if(R!==d&&R>=g&&R<=f&&u[R].loadError===0){var o,l;const _=u[R];if(c===L.FRAG_GAP&&m===U.MAIN&&e.frag){const k=u[R].details;if(k){const b=Ct(e.frag,k.fragments,e.frag.start);if(b!=null&&b.gap)continue}}else{if(I===Y.AUDIO_TRACK&&_.hasAudioGroup(S)||I===Y.SUBTITLE_TRACK&&_.hasSubtitleGroup(S))continue;if(m===U.AUDIO&&(o=i.audioGroups)!=null&&o.some(k=>_.hasAudioGroup(k))||m===U.SUBTITLE&&(l=i.subtitleGroups)!=null&&l.some(k=>_.hasSubtitleGroup(k))||E&&i.audioCodec===_.audioCodec||!E&&i.audioCodec!==_.audioCodec||y&&i.codecSet===_.codecSet)continue}h=R;break}}if(h>-1&&s.loadLevel!==h)return e.levelRetry=!0,this.playlistError=0,{action:ce.SendAlternateToPenaltyBox,flags:Te.None,nextAutoLevel:h}}return{action:ce.SendAlternateToPenaltyBox,flags:Te.MoveAllAlternatesMatchingHost}}onErrorOut(e,t){var s;switch((s=t.errorAction)==null?void 0:s.action){case ce.DoNothing:break;case ce.SendAlternateToPenaltyBox:this.sendAlternateToPenaltyBox(t),!t.errorAction.resolved&&t.details!==L.FRAG_GAP?t.fatal=!0:/MediaSource readyState: ended/.test(t.error.message)&&(this.warn(`MediaSource ended after "${t.sourceBufferName}" sourceBuffer append error. Attempting to recover from media error.`),this.hls.recoverMediaError());break}if(t.fatal){this.hls.stopLoad();return}}sendAlternateToPenaltyBox(e){const t=this.hls,s=e.errorAction;if(!s)return;const{flags:i,hdcpLevel:r,nextAutoLevel:n}=s;switch(i){case Te.None:this.switchLevel(e,n);break;case Te.MoveAllAlternatesMatchingHDCP:r&&(t.maxHdcpLevel=hs[hs.indexOf(r)-1],s.resolved=!0),this.warn(`Restricting playback to HDCP-LEVEL of "${t.maxHdcpLevel}" or lower`);break}s.resolved||this.switchLevel(e,n)}switchLevel(e,t){t!==void 0&&e.errorAction&&(this.warn(`switching to level ${t} after ${e.details}`),this.hls.nextAutoLevel=t,e.errorAction.resolved=!0,this.hls.nextLoadLevel=this.hls.nextAutoLevel)}}class Rs{constructor(e,t){this.hls=void 0,this.timer=-1,this.requestScheduled=-1,this.canLoad=!1,this.log=void 0,this.warn=void 0,this.log=v.log.bind(v,`${t}:`),this.warn=v.warn.bind(v,`${t}:`),this.hls=e}destroy(){this.clearTimer(),this.hls=this.log=this.warn=null}clearTimer(){this.timer!==-1&&(self.clearTimeout(this.timer),this.timer=-1)}startLoad(){this.canLoad=!0,this.requestScheduled=-1,this.loadPlaylist()}stopLoad(){this.canLoad=!1,this.clearTimer()}switchParams(e,t,s){const i=t==null?void 0:t.renditionReports;if(i){let r=-1;for(let n=0;n=0&&h>t.partTarget&&(l+=1)}const c=s&&ni(s);return new ai(o,l>=0?l:void 0,c)}}}loadPlaylist(e){this.requestScheduled===-1&&(this.requestScheduled=self.performance.now())}shouldLoadPlaylist(e){return this.canLoad&&!!e&&!!e.url&&(!e.details||e.details.live)}shouldReloadPlaylist(e){return this.timer===-1&&this.requestScheduled===-1&&this.shouldLoadPlaylist(e)}playlistLoaded(e,t,s){const{details:i,stats:r}=t,n=self.performance.now(),o=r.loading.first?Math.max(0,n-r.loading.first):0;if(i.advancedDateTime=Date.now()-o,i.live||s!=null&&s.live){if(i.reloaded(s),s&&this.log(`live playlist ${e} ${i.advanced?"REFRESHED "+i.lastPartSn+"-"+i.lastPartIndex:i.updated?"UPDATED":"MISSED"}`),s&&i.fragments.length>0&&ma(s,i),!this.canLoad||!i.live)return;let l,c,h;if(i.canBlockReload&&i.endSN&&i.advanced){const T=this.hls.config.lowLatencyMode,E=i.lastPartSn,x=i.endSN,y=i.lastPartIndex,I=y!==-1,S=E===x,D=T?0:y;I?(c=S?x+1:E,h=S?D:y+1):c=x+1;const R=i.age,_=R+i.ageHeader;let k=Math.min(_-i.partTarget,i.targetduration*1.5);if(k>0){if(s&&k>s.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${s.tuneInGoal} to: ${k} with playlist age: ${i.age}`),k=0;else{const b=Math.floor(k/i.targetduration);if(c+=b,h!==void 0){const w=Math.round(k%i.targetduration/i.partTarget);h+=w}this.log(`CDN Tune-in age: ${i.ageHeader}s last advanced ${R.toFixed(2)}s goal: ${k} skip sn ${b} to part ${h}`)}i.tuneInGoal=k}if(l=this.getDeliveryDirectives(i,t.deliveryDirectives,c,h),T||!S){this.loadPlaylist(l);return}}else(i.canBlockReload||i.canSkipUntil)&&(l=this.getDeliveryDirectives(i,t.deliveryDirectives,c,h));const u=this.hls.mainForwardBufferInfo,d=u?u.end-u.len:0,g=(i.edge-d)*1e3,f=ya(i,g);i.updated&&n>this.requestScheduled+f&&(this.requestScheduled=r.loading.start),c!==void 0&&i.canBlockReload?this.requestScheduled=r.loading.first+f-(i.partTarget*1e3||1e3):this.requestScheduled===-1||this.requestScheduled+fthis.loadPlaylist(l),m)}else this.clearTimer()}getDeliveryDirectives(e,t,s,i){let r=ni(e);return t!=null&&t.skip&&e.deltaUpdateFailed&&(s=t.msn,i=t.part,r=mt.No),new ai(s,i,r)}checkRetry(e){const t=e.details,s=bt(e),i=e.errorAction,{action:r,retryCount:n=0,retryConfig:o}=i||{},l=!!i&&!!o&&(r===ce.RetryRequest||!i.resolved&&r===ce.SendAlternateToPenaltyBox);if(l){var c;if(this.requestScheduled=-1,n>=o.maxNumRetry)return!1;if(s&&(c=e.context)!=null&&c.deliveryDirectives)this.warn(`Retrying playlist loading ${n+1}/${o.maxNumRetry} after "${t}" without delivery-directives`),this.loadPlaylist();else{const h=Ls(o,n);this.timer=self.setTimeout(()=>this.loadPlaylist(),h),this.warn(`Retrying playlist loading ${n+1}/${o.maxNumRetry} after "${t}" in ${h}ms`)}e.levelRetry=!0,i.resolved=!0}return l}}class Be{constructor(e,t=0,s=0){this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=e,this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=t,this.totalWeight_=s}sample(e,t){const s=Math.pow(this.alpha_,e);this.estimate_=t*(1-s)+s*this.estimate_,this.totalWeight_+=e}getTotalWeight(){return this.totalWeight_}getEstimate(){if(this.alpha_){const e=1-Math.pow(this.alpha_,this.totalWeight_);if(e)return this.estimate_/e}return this.estimate_}}class ba{constructor(e,t,s,i=100){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=s,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new Be(e),this.fast_=new Be(t),this.defaultTTFB_=i,this.ttfb_=new Be(e)}update(e,t){const{slow_:s,fast_:i,ttfb_:r}=this;s.halfLife!==e&&(this.slow_=new Be(e,s.getEstimate(),s.getTotalWeight())),i.halfLife!==t&&(this.fast_=new Be(t,i.getEstimate(),i.getTotalWeight())),r.halfLife!==e&&(this.ttfb_=new Be(e,r.getEstimate(),r.getTotalWeight()))}sample(e,t){e=Math.max(e,this.minDelayMs_);const s=8*t,i=e/1e3,r=s/i;this.fast_.sample(i,r),this.slow_.sample(i,r)}sampleTTFB(e){const t=e/1e3,s=Math.sqrt(2)*Math.exp(-Math.pow(t,2)/2);this.ttfb_.sample(s,Math.max(e,5))}canEstimate(){return this.fast_.getTotalWeight()>=this.minWeight_}getEstimate(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}getEstimateTTFB(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_}destroy(){}}const hr={supported:!0,configurations:[],decodingInfoResults:[{supported:!0,powerEfficient:!0,smooth:!0}]},ui={};function Da(a,e,t,s,i,r){const n=a.audioCodec?a.audioGroups:null,o=r==null?void 0:r.audioCodec,l=r==null?void 0:r.channels,c=l?parseInt(l):o?1/0:2;let h=null;if(n!=null&&n.length)try{n.length===1&&n[0]?h=e.groups[n[0]].channels:h=n.reduce((u,d)=>{if(d){const g=e.groups[d];if(!g)throw new Error(`Audio track group ${d} not found`);Object.keys(g.channels).forEach(f=>{u[f]=(u[f]||0)+g.channels[f]})}return u},{2:0})}catch{return!0}return a.videoCodec!==void 0&&(a.width>1920&&a.height>1088||a.height>1920&&a.width>1088||a.frameRate>Math.max(s,30)||a.videoRange!=="SDR"&&a.videoRange!==t||a.bitrate>Math.max(i,8e6))||!!h&&O(c)&&Object.keys(h).some(u=>parseInt(u)>c)}function Ca(a,e,t){const s=a.videoCodec,i=a.audioCodec;if(!s||!i||!t)return Promise.resolve(hr);const r={width:a.width,height:a.height,bitrate:Math.ceil(Math.max(a.bitrate*.9,a.averageBitrate)),framerate:a.frameRate||30},n=a.videoRange;n!=="SDR"&&(r.transferFunction=n.toLowerCase());const o=s.split(",").map(l=>({type:"media-source",video:oe(oe({},r),{},{contentType:st(l,"video")})}));return i&&a.audioGroups&&a.audioGroups.forEach(l=>{var c;l&&((c=e.groups[l])==null||c.tracks.forEach(h=>{if(h.groupId===l){const u=h.channels||"",d=parseFloat(u);O(d)&&d>2&&o.push.apply(o,i.split(",").map(g=>({type:"media-source",audio:{contentType:st(g,"audio"),channels:""+d}})))}}))}),Promise.all(o.map(l=>{const c=_a(l);return ui[c]||(ui[c]=t.decodingInfo(l))})).then(l=>({supported:!l.some(c=>!c.supported),configurations:o,decodingInfoResults:l})).catch(l=>({supported:!1,configurations:o,decodingInfoResults:[],error:l}))}function _a(a){const{audio:e,video:t}=a,s=t||e;if(s){const i=s.contentType.split('"')[1];if(t)return`r${t.height}x${t.width}f${Math.ceil(t.framerate)}${t.transferFunction||"sd"}_${i}_${Math.ceil(t.bitrate/1e5)}`;if(e)return`c${e.channels}${e.spatialRendering?"s":"n"}_${i}`}return""}function wa(){if(typeof matchMedia=="function"){const a=matchMedia("(dynamic-range: high)"),e=matchMedia("bad query");if(a.media!==e.media)return a.matches===!0}return!1}function ka(a,e){let t=!1,s=[];return a&&(t=a!=="SDR",s=[a]),e&&(s=e.allowedVideoRanges||It.slice(0),t=e.preferHDR!==void 0?e.preferHDR:wa(),t?s=s.filter(i=>i!=="SDR"):s=["SDR"]),{preferHDR:t,allowedVideoRanges:s}}function Pa(a,e,t,s,i){const r=Object.keys(a),n=s==null?void 0:s.channels,o=s==null?void 0:s.audioCodec,l=n&&parseInt(n)===2;let c=!0,h=!1,u=1/0,d=1/0,g=1/0,f=0,m=[];const{preferHDR:T,allowedVideoRanges:E}=ka(e,i);for(let S=r.length;S--;){const D=a[r[S]];c=D.channels[2]>0,u=Math.min(u,D.minHeight),d=Math.min(d,D.minFramerate),g=Math.min(g,D.minBitrate);const R=E.filter(_=>D.videoRanges[_]>0);R.length>0&&(h=!0,m=R)}u=O(u)?u:0,d=O(d)?d:0;const x=Math.max(1080,u),y=Math.max(30,d);return g=O(g)?g:t,t=Math.max(g,t),h||(e=void 0,m=[]),{codecSet:r.reduce((S,D)=>{const R=a[D];if(D===S)return S;if(R.minBitrate>t)return be(D,`min bitrate of ${R.minBitrate} > current estimate of ${t}`),S;if(!R.hasDefaultAudio)return be(D,"no renditions with default or auto-select sound found"),S;if(o&&D.indexOf(o.substring(0,4))%5!==0)return be(D,`audio codec preference "${o}" not found`),S;if(n&&!l){if(!R.channels[n])return be(D,`no renditions with ${n} channel sound found (channels options: ${Object.keys(R.channels)})`),S}else if((!o||l)&&c&&R.channels[2]===0)return be(D,"no renditions with stereo sound found"),S;return R.minHeight>x?(be(D,`min resolution of ${R.minHeight} > maximum of ${x}`),S):R.minFramerate>y?(be(D,`min framerate of ${R.minFramerate} > maximum of ${y}`),S):m.some(_=>R.videoRanges[_]>0)?R.maxScore=Lt(S)||R.fragmentError>a[S].fragmentError)?S:(f=R.maxScore,D):(be(D,`no variants with VIDEO-RANGE of ${JSON.stringify(m)} found`),S)},void 0),videoRanges:m,preferHDR:T,minFramerate:d,minBitrate:g}}function be(a,e){v.log(`[abr] start candidates with "${a}" ignored because ${e}`)}function Fa(a){return a.reduce((e,t)=>{let s=e.groups[t.groupId];s||(s=e.groups[t.groupId]={tracks:[],channels:{2:0},hasDefault:!1,hasAutoSelect:!1}),s.tracks.push(t);const i=t.channels||"2";return s.channels[i]=(s.channels[i]||0)+1,s.hasDefault=s.hasDefault||t.default,s.hasAutoSelect=s.hasAutoSelect||t.autoselect,s.hasDefault&&(e.hasDefaultAudio=!0),s.hasAutoSelect&&(e.hasAutoSelectAudio=!0),e},{hasDefaultAudio:!1,hasAutoSelectAudio:!1,groups:{}})}function Oa(a,e,t,s){return a.slice(t,s+1).reduce((i,r)=>{if(!r.codecSet)return i;const n=r.audioGroups;let o=i[r.codecSet];o||(i[r.codecSet]=o={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!n,fragmentError:0}),o.minBitrate=Math.min(o.minBitrate,r.bitrate);const l=Math.min(r.height,r.width);return o.minHeight=Math.min(o.minHeight,l),o.minFramerate=Math.min(o.minFramerate,r.frameRate),o.maxScore=Math.max(o.maxScore,r.score),o.fragmentError+=r.fragmentError,o.videoRanges[r.videoRange]=(o.videoRanges[r.videoRange]||0)+1,n&&n.forEach(c=>{if(!c)return;const h=e.groups[c];h&&(o.hasDefaultAudio=o.hasDefaultAudio||e.hasDefaultAudio?h.hasDefault:h.hasAutoSelect||!e.hasDefaultAudio&&!e.hasAutoSelectAudio,Object.keys(h.channels).forEach(u=>{o.channels[u]=(o.channels[u]||0)+h.channels[u]}))}),i},{})}function Le(a,e,t){if("attrs"in a){const s=e.indexOf(a);if(s!==-1)return s}for(let s=0;ss.indexOf(i)===-1)}function $e(a,e){const{audioCodec:t,channels:s}=a;return(t===void 0||(e.audioCodec||"").substring(0,4)===t.substring(0,4))&&(s===void 0||s===(e.channels||"2"))}function Na(a,e,t,s,i){const r=e[s],o=e.reduce((d,g,f)=>{const m=g.uri;return(d[m]||(d[m]=[])).push(f),d},{})[r.uri];o.length>1&&(s=Math.max.apply(Math,o));const l=r.videoRange,c=r.frameRate,h=r.codecSet.substring(0,4),u=di(e,s,d=>{if(d.videoRange!==l||d.frameRate!==c||d.codecSet.substring(0,4)!==h)return!1;const g=d.audioGroups,f=t.filter(m=>!g||g.indexOf(m.groupId)!==-1);return Le(a,f,i)>-1});return u>-1?u:di(e,s,d=>{const g=d.audioGroups,f=t.filter(m=>!g||g.indexOf(m.groupId)!==-1);return Le(a,f,i)>-1})}function di(a,e,t){for(let s=e;s;s--)if(t(a[s]))return s;for(let s=e+1;s{const{fragCurrent:t,partCurrent:s,hls:i}=this,{autoLevelEnabled:r,media:n}=i;if(!t||!n)return;const o=performance.now(),l=s?s.stats:t.stats,c=s?s.duration:t.duration,h=o-l.loading.start,u=i.minAutoLevel;if(l.aborted||l.loaded&&l.loaded===l.total||t.level<=u){this.clearTimer(),this._nextAutoLevel=-1;return}if(!r||n.paused||!n.playbackRate||!n.readyState)return;const d=i.mainForwardBufferInfo;if(d===null)return;const g=this.bwEstimator.getEstimateTTFB(),f=Math.abs(n.playbackRate);if(h<=Math.max(g,1e3*(c/(f*2))))return;const m=d.len/f,T=l.loading.first?l.loading.first-l.loading.start:-1,E=l.loaded&&T>-1,x=this.getBwEstimate(),y=i.levels,I=y[t.level],S=l.total||Math.max(l.loaded,Math.round(c*I.averageBitrate/8));let D=E?h-T:h;D<1&&E&&(D=Math.min(h,l.loaded*8/x));const R=E?l.loaded*1e3/D:0,_=R?(S-l.loaded)/R:S*8/x+g/1e3;if(_<=m)return;const k=R?R*8:x;let b=Number.POSITIVE_INFINITY,w;for(w=t.level-1;w>u;w--){const P=y[w].maxBitrate;if(b=this.getTimeToLoadFrag(g/1e3,k,c*P,!y[w].details),b=_||b>c*10)return;i.nextLoadLevel=i.nextAutoLevel=w,E?this.bwEstimator.sample(h-Math.min(g,T),l.loaded):this.bwEstimator.sampleTTFB(h);const V=y[w].maxBitrate;this.getBwEstimate()*this.hls.config.abrBandWidthUpFactor>V&&this.resetEstimator(V),this.clearTimer(),v.warn(`[abr] Fragment ${t.sn}${s?" part "+s.index:""} of level ${t.level} is loading too slowly; + Time to underbuffer: ${m.toFixed(3)} s + Estimated load time for current fragment: ${_.toFixed(3)} s + Estimated load time for down switch fragment: ${b.toFixed(3)} s + TTFB estimate: ${T|0} ms + Current BW estimate: ${O(x)?x|0:"Unknown"} bps + New BW estimate: ${this.getBwEstimate()|0} bps + Switching to level ${w} @ ${V|0} bps`),i.trigger(p.FRAG_LOAD_EMERGENCY_ABORTED,{frag:t,part:s,stats:l})},this.hls=e,this.bwEstimator=this.initEstimator(),this.registerListeners()}resetEstimator(e){e&&(v.log(`setting initial bwe to ${e}`),this.hls.config.abrEwmaDefaultEstimate=e),this.firstSelection=-1,this.bwEstimator=this.initEstimator()}initEstimator(){const e=this.hls.config;return new ba(e.abrEwmaSlowVoD,e.abrEwmaFastVoD,e.abrEwmaDefaultEstimate)}registerListeners(){const{hls:e}=this;e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.FRAG_LOADING,this.onFragLoading,this),e.on(p.FRAG_LOADED,this.onFragLoaded,this),e.on(p.FRAG_BUFFERED,this.onFragBuffered,this),e.on(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(p.LEVEL_LOADED,this.onLevelLoaded,this),e.on(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(p.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.on(p.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e&&(e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.FRAG_LOADING,this.onFragLoading,this),e.off(p.FRAG_LOADED,this.onFragLoaded,this),e.off(p.FRAG_BUFFERED,this.onFragBuffered,this),e.off(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(p.LEVEL_LOADED,this.onLevelLoaded,this),e.off(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(p.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.off(p.ERROR,this.onError,this))}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this._abandonRulesCheck=null,this.fragCurrent=this.partCurrent=null}onManifestLoading(e,t){this.lastLoadedFragLevel=-1,this.firstSelection=-1,this.lastLevelLoadSec=0,this.fragCurrent=this.partCurrent=null,this.onLevelsUpdated(),this.clearTimer()}onLevelsUpdated(){this.lastLoadedFragLevel>-1&&this.fragCurrent&&(this.lastLoadedFragLevel=this.fragCurrent.level),this._nextAutoLevel=-1,this.onMaxAutoLevelUpdated(),this.codecTiers=null,this.audioTracksByGroup=null}onMaxAutoLevelUpdated(){this.firstSelection=-1,this.nextAutoLevelKey=""}onFragLoading(e,t){const s=t.frag;if(!this.ignoreFragment(s)){if(!s.bitrateTest){var i;this.fragCurrent=s,this.partCurrent=(i=t.part)!=null?i:null}this.clearTimer(),this.timer=self.setInterval(this._abandonRulesCheck,100)}}onLevelSwitching(e,t){this.clearTimer()}onError(e,t){if(!t.fatal)switch(t.details){case L.BUFFER_ADD_CODEC_ERROR:case L.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1;break;case L.FRAG_LOAD_TIMEOUT:{const s=t.frag,{fragCurrent:i,partCurrent:r}=this;if(s&&i&&s.sn===i.sn&&s.level===i.level){const n=performance.now(),o=r?r.stats:s.stats,l=n-o.loading.start,c=o.loading.first?o.loading.first-o.loading.start:-1;if(o.loaded&&c>-1){const u=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(l-Math.min(u,c),o.loaded)}else this.bwEstimator.sampleTTFB(l)}break}}}getTimeToLoadFrag(e,t,s,i){const r=e+s/t,n=i?this.lastLevelLoadSec:0;return r+n}onLevelLoaded(e,t){const s=this.hls.config,{loading:i}=t.stats,r=i.end-i.start;O(r)&&(this.lastLevelLoadSec=r/1e3),t.details.live?this.bwEstimator.update(s.abrEwmaSlowLive,s.abrEwmaFastLive):this.bwEstimator.update(s.abrEwmaSlowVoD,s.abrEwmaFastVoD)}onFragLoaded(e,{frag:t,part:s}){const i=s?s.stats:t.stats;if(t.type===U.MAIN&&this.bwEstimator.sampleTTFB(i.loading.first-i.loading.start),!this.ignoreFragment(t)){if(this.clearTimer(),t.level===this._nextAutoLevel&&(this._nextAutoLevel=-1),this.firstSelection=-1,this.hls.config.abrMaxWithRealBitrate){const r=s?s.duration:t.duration,n=this.hls.levels[t.level],o=(n.loaded?n.loaded.bytes:0)+i.loaded,l=(n.loaded?n.loaded.duration:0)+r;n.loaded={bytes:o,duration:l},n.realBitrate=Math.round(8*o/l)}if(t.bitrateTest){const r={stats:i,frag:t,part:s,id:t.type};this.onFragBuffered(p.FRAG_BUFFERED,r),t.bitrateTest=!1}else this.lastLoadedFragLevel=t.level}}onFragBuffered(e,t){const{frag:s,part:i}=t,r=i!=null&&i.stats.loaded?i.stats:s.stats;if(r.aborted||this.ignoreFragment(s))return;const n=r.parsing.end-r.loading.start-Math.min(r.loading.first-r.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(n,r.loaded),r.bwEstimate=this.getBwEstimate(),s.bitrateTest?this.bitrateTestDelay=n/1e3:this.bitrateTestDelay=0}ignoreFragment(e){return e.type!==U.MAIN||e.sn==="initSegment"}clearTimer(){this.timer>-1&&(self.clearInterval(this.timer),this.timer=-1)}get firstAutoLevel(){const{maxAutoLevel:e,minAutoLevel:t}=this.hls,s=this.getBwEstimate(),i=this.hls.config.maxStarvationDelay,r=this.findBestLevel(s,t,e,0,i,1,1);if(r>-1)return r;const n=this.hls.firstLevel,o=Math.min(Math.max(n,t),e);return v.warn(`[abr] Could not find best starting auto level. Defaulting to first in playlist ${n} clamped to ${o}`),o}get forcedAutoLevel(){return this.nextAutoLevelKey?-1:this._nextAutoLevel}get nextAutoLevel(){const e=this.forcedAutoLevel,s=this.bwEstimator.canEstimate(),i=this.lastLoadedFragLevel>-1;if(e!==-1&&(!s||!i||this.nextAutoLevelKey===this.getAutoLevelKey()))return e;const r=s&&i?this.getNextABRAutoLevel():this.firstAutoLevel;if(e!==-1){const n=this.hls.levels;if(n.length>Math.max(e,r)&&n[e].loadError<=n[r].loadError)return e}return this._nextAutoLevel=r,this.nextAutoLevelKey=this.getAutoLevelKey(),r}getAutoLevelKey(){return`${this.getBwEstimate()}_${this.getStarvationDelay().toFixed(2)}`}getNextABRAutoLevel(){const{fragCurrent:e,partCurrent:t,hls:s}=this,{maxAutoLevel:i,config:r,minAutoLevel:n}=s,o=t?t.duration:e?e.duration:0,l=this.getBwEstimate(),c=this.getStarvationDelay();let h=r.abrBandWidthFactor,u=r.abrBandWidthUpFactor;if(c){const T=this.findBestLevel(l,n,i,c,0,h,u);if(T>=0)return T}let d=o?Math.min(o,r.maxStarvationDelay):r.maxStarvationDelay;if(!c){const T=this.bitrateTestDelay;T&&(d=(o?Math.min(o,r.maxLoadingDelay):r.maxLoadingDelay)-T,v.info(`[abr] bitrate test took ${Math.round(1e3*T)}ms, set first fragment max fetchDuration to ${Math.round(1e3*d)} ms`),h=u=1)}const g=this.findBestLevel(l,n,i,c,d,h,u);if(v.info(`[abr] ${c?"rebuffering expected":"buffer is empty"}, optimal quality level ${g}`),g>-1)return g;const f=s.levels[n],m=s.levels[s.loadLevel];return(f==null?void 0:f.bitrate)<(m==null?void 0:m.bitrate)?n:s.loadLevel}getStarvationDelay(){const e=this.hls,t=e.media;if(!t)return 1/0;const s=t&&t.playbackRate!==0?Math.abs(t.playbackRate):1,i=e.mainForwardBufferInfo;return(i?i.len:0)/s}getBwEstimate(){return this.bwEstimator.canEstimate()?this.bwEstimator.getEstimate():this.hls.config.abrEwmaDefaultEstimate}findBestLevel(e,t,s,i,r,n,o){var l;const c=i+r,h=this.lastLoadedFragLevel,u=h===-1?this.hls.firstLevel:h,{fragCurrent:d,partCurrent:g}=this,{levels:f,allAudioTracks:m,loadLevel:T,config:E}=this.hls;if(f.length===1)return 0;const x=f[u],y=!!(x!=null&&(l=x.details)!=null&&l.live),I=T===-1||h===-1;let S,D="SDR",R=(x==null?void 0:x.frameRate)||0;const{audioPreference:_,videoPreference:k}=E,b=this.audioTracksByGroup||(this.audioTracksByGroup=Fa(m));if(I){if(this.firstSelection!==-1)return this.firstSelection;const G=this.codecTiers||(this.codecTiers=Oa(f,b,t,s)),B=Pa(G,D,e,_,k),{codecSet:q,videoRanges:Q,minFramerate:M,minBitrate:F,preferHDR:j}=B;S=q,D=j?Q[Q.length-1]:Q[0],R=M,e=Math.max(e,F),v.log(`[abr] picked start tier ${JSON.stringify(B)}`)}else S=x==null?void 0:x.codecSet,D=x==null?void 0:x.videoRange;const w=g?g.duration:d?d.duration:0,V=this.bwEstimator.getEstimateTTFB()/1e3,P=[];for(let G=s;G>=t;G--){var K;const B=f[G],q=G>u;if(!B)continue;if(E.useMediaCapabilities&&!B.supportedResult&&!B.supportedPromise){const te=navigator.mediaCapabilities;typeof(te==null?void 0:te.decodingInfo)=="function"&&Da(B,b,D,R,e,_)?(B.supportedPromise=Ca(B,b,te),B.supportedPromise.then(re=>{if(!this.hls)return;B.supportedResult=re;const le=this.hls.levels,fe=le.indexOf(B);re.error?v.warn(`[abr] MediaCapabilities decodingInfo error: "${re.error}" for level ${fe} ${JSON.stringify(re)}`):re.supported||(v.warn(`[abr] Unsupported MediaCapabilities decodingInfo result for level ${fe} ${JSON.stringify(re)}`),fe>-1&&le.length>1&&(v.log(`[abr] Removing unsupported level ${fe}`),this.hls.removeLevel(fe)))})):B.supportedResult=hr}if(S&&B.codecSet!==S||D&&B.videoRange!==D||q&&R>B.frameRate||!q&&R>0&&R=w*2&&r===0?f[G].averageBitrate:f[G].maxBitrate,W=this.getTimeToLoadFrag(V,F,j*M,Q===void 0);if(F>=j&&(G===h||B.loadError===0&&B.fragmentError===0)&&(W<=V||!O(W)||y&&!this.bitrateTestDelay||W${G} adjustedbw(${Math.round(F)})-bitrate=${Math.round(F-j)} ttfb:${V.toFixed(1)} avgDuration:${M.toFixed(1)} maxFetchDuration:${c.toFixed(1)} fetchDuration:${W.toFixed(1)} firstSelection:${I} codecSet:${S} videoRange:${D} hls.loadLevel:${T}`)),I&&(this.firstSelection=G),G}}return-1}set nextAutoLevel(e){const{maxAutoLevel:t,minAutoLevel:s}=this.hls,i=Math.min(Math.max(e,s),t);this._nextAutoLevel!==i&&(this.nextAutoLevelKey="",this._nextAutoLevel=i)}}class Ba{constructor(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}destroy(){this.onHandlerDestroying(),this.onHandlerDestroyed()}onHandlerDestroying(){this.clearNextTick(),this.clearInterval()}onHandlerDestroyed(){}hasInterval(){return!!this._tickInterval}hasNextTick(){return!!this._tickTimer}setInterval(e){return this._tickInterval?!1:(this._tickCallCount=0,this._tickInterval=self.setInterval(this._boundTick,e),!0)}clearInterval(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1}clearNextTick(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1}tick(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)}tickImmediate(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)}doTick(){}}var ae={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};class $a{constructor(e){this.activePartLists=Object.create(null),this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hasGaps=!1,this.hls=e,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(p.BUFFER_APPENDED,this.onBufferAppended,this),e.on(p.FRAG_BUFFERED,this.onFragBuffered,this),e.on(p.FRAG_LOADED,this.onFragLoaded,this)}_unregisterListeners(){const{hls:e}=this;e.off(p.BUFFER_APPENDED,this.onBufferAppended,this),e.off(p.FRAG_BUFFERED,this.onFragBuffered,this),e.off(p.FRAG_LOADED,this.onFragLoaded,this)}destroy(){this._unregisterListeners(),this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null}getAppendedFrag(e,t){const s=this.activePartLists[t];if(s)for(let i=s.length;i--;){const r=s[i];if(!r)break;const n=r.end;if(r.start<=e&&n!==null&&e<=n)return r}return this.getBufferedFrag(e,t)}getBufferedFrag(e,t){const{fragments:s}=this,i=Object.keys(s);for(let r=i.length;r--;){const n=s[i[r]];if((n==null?void 0:n.body.type)===t&&n.buffered){const o=n.body;if(o.start<=e&&e<=o.end)return o}}return null}detectEvictedFragments(e,t,s,i){this.timeRanges&&(this.timeRanges[e]=t);const r=(i==null?void 0:i.fragment.sn)||-1;Object.keys(this.fragments).forEach(n=>{const o=this.fragments[n];if(!o||r>=o.body.sn)return;if(!o.buffered&&!o.loaded){o.body.type===s&&this.removeFragment(o.body);return}const l=o.range[e];l&&l.time.some(c=>{const h=!this.isTimeBuffered(c.startPTS,c.endPTS,t);return h&&this.removeFragment(o.body),h})})}detectPartialFragments(e){const t=this.timeRanges,{frag:s,part:i}=e;if(!t||s.sn==="initSegment")return;const r=Ge(s),n=this.fragments[r];if(!n||n.buffered&&s.gap)return;const o=!s.relurl;Object.keys(t).forEach(l=>{const c=s.elementaryStreams[l];if(!c)return;const h=t[l],u=o||c.partial===!0;n.range[l]=this.getBufferedTimes(s,i,u,h)}),n.loaded=null,Object.keys(n.range).length?(n.buffered=!0,(n.body.endList=s.endList||n.body.endList)&&(this.endListFragments[n.body.type]=n),at(n)||this.removeParts(s.sn-1,s.type)):this.removeFragment(n.body)}removeParts(e,t){const s=this.activePartLists[t];s&&(this.activePartLists[t]=s.filter(i=>i.fragment.sn>=e))}fragBuffered(e,t){const s=Ge(e);let i=this.fragments[s];!i&&t&&(i=this.fragments[s]={body:e,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},e.gap&&(this.hasGaps=!0)),i&&(i.loaded=null,i.buffered=!0)}getBufferedTimes(e,t,s,i){const r={time:[],partial:s},n=e.start,o=e.end,l=e.minEndPTS||o,c=e.maxStartPTS||n;for(let h=0;h=u&&l<=d){r.time.push({startPTS:Math.max(n,i.start(h)),endPTS:Math.min(o,i.end(h))});break}else if(nu){const g=Math.max(n,i.start(h)),f=Math.min(o,i.end(h));f>g&&(r.partial=!0,r.time.push({startPTS:g,endPTS:f}))}else if(o<=u)break}return r}getPartialFragment(e){let t=null,s,i,r,n=0;const{bufferPadding:o,fragments:l}=this;return Object.keys(l).forEach(c=>{const h=l[c];h&&at(h)&&(i=h.body.start-o,r=h.body.end+o,e>=i&&e<=r&&(s=Math.min(e-i,r-e),n<=s&&(t=h.body,n=s)))}),t}isEndListAppended(e){const t=this.endListFragments[e];return t!==void 0&&(t.buffered||at(t))}getState(e){const t=Ge(e),s=this.fragments[t];return s?s.buffered?at(s)?ae.PARTIAL:ae.OK:ae.APPENDING:ae.NOT_LOADED}isTimeBuffered(e,t,s){let i,r;for(let n=0;n=i&&t<=r)return!0;if(t<=i)return!1}return!1}onFragLoaded(e,t){const{frag:s,part:i}=t;if(s.sn==="initSegment"||s.bitrateTest)return;const r=i?null:t,n=Ge(s);this.fragments[n]={body:s,appendedPTS:null,loaded:r,buffered:!1,range:Object.create(null)}}onBufferAppended(e,t){const{frag:s,part:i,timeRanges:r}=t;if(s.sn==="initSegment")return;const n=s.type;if(i){let o=this.activePartLists[n];o||(this.activePartLists[n]=o=[]),o.push(i)}this.timeRanges=r,Object.keys(r).forEach(o=>{const l=r[o];this.detectEvictedFragments(o,l,n,i)})}onFragBuffered(e,t){this.detectPartialFragments(t)}hasFragment(e){const t=Ge(e);return!!this.fragments[t]}hasParts(e){var t;return!!((t=this.activePartLists[e])!=null&&t.length)}removeFragmentsInRange(e,t,s,i,r){i&&!this.hasGaps||Object.keys(this.fragments).forEach(n=>{const o=this.fragments[n];if(!o)return;const l=o.body;l.type!==s||i&&!l.gap||l.starte&&(o.buffered||r)&&this.removeFragment(l)})}removeFragment(e){const t=Ge(e);e.stats.loaded=0,e.clearElementaryStreamInfo();const s=this.activePartLists[e.type];if(s){const i=e.sn;this.activePartLists[e.type]=s.filter(r=>r.fragment.sn!==i)}delete this.fragments[t],e.endList&&delete this.endListFragments[e.type]}removeAllFragments(){this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1}}function at(a){var e,t,s;return a.buffered&&(a.body.gap||((e=a.range.video)==null?void 0:e.partial)||((t=a.range.audio)==null?void 0:t.partial)||((s=a.range.audiovideo)==null?void 0:s.partial))}function Ge(a){return`${a.type}_${a.level}_${a.sn}`}const Ga={length:0,start:()=>0,end:()=>0};class J{static isBuffered(e,t){try{if(e){const s=J.getBuffered(e);for(let i=0;i=s.start(i)&&t<=s.end(i))return!0}}catch{}return!1}static bufferInfo(e,t,s){try{if(e){const i=J.getBuffered(e),r=[];let n;for(n=0;nu&&(i[h-1].end=e[c].end):i.push(e[c])}else i.push(e[c])}else i=e;let r=0,n,o=t,l=t;for(let c=0;c=h&&tt.startCC||a&&a.cc{if(this.loader&&this.loader.destroy(),e.gap)if(e.tagList.some(g=>g[0]==="GAP")){l(pi(e));return}else e.gap=!1;const c=this.loader=e.loader=r?new r(i):new n(i),h=mi(e),u=hi(i.fragLoadPolicy.default),d={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:e.sn==="initSegment"?1/0:gi};e.stats=c.stats,c.load(h,d,{onSuccess:(g,f,m,T)=>{this.resetLoader(e,c);let E=g.data;m.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(E.slice(0,16)),E=E.slice(16)),o({frag:e,part:null,payload:E,networkDetails:T})},onError:(g,f,m,T)=>{this.resetLoader(e,c),l(new Ce({type:$.NETWORK_ERROR,details:L.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:oe({url:s,data:void 0},g),error:new Error(`HTTP Error ${g.code} ${g.text}`),networkDetails:m,stats:T}))},onAbort:(g,f,m)=>{this.resetLoader(e,c),l(new Ce({type:$.NETWORK_ERROR,details:L.INTERNAL_ABORTED,fatal:!1,frag:e,error:new Error("Aborted"),networkDetails:m,stats:g}))},onTimeout:(g,f,m)=>{this.resetLoader(e,c),l(new Ce({type:$.NETWORK_ERROR,details:L.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error(`Timeout after ${d.timeout}ms`),networkDetails:m,stats:g}))},onProgress:(g,f,m,T)=>{t&&t({frag:e,part:null,payload:m,networkDetails:T})}})})}loadPart(e,t,s){this.abort();const i=this.config,r=i.fLoader,n=i.loader;return new Promise((o,l)=>{if(this.loader&&this.loader.destroy(),e.gap||t.gap){l(pi(e,t));return}const c=this.loader=e.loader=r?new r(i):new n(i),h=mi(e,t),u=hi(i.fragLoadPolicy.default),d={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:gi};t.stats=c.stats,c.load(h,d,{onSuccess:(g,f,m,T)=>{this.resetLoader(e,c),this.updateStatsFromPart(e,t);const E={frag:e,part:t,payload:g.data,networkDetails:T};s(E),o(E)},onError:(g,f,m,T)=>{this.resetLoader(e,c),l(new Ce({type:$.NETWORK_ERROR,details:L.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:oe({url:h.url,data:void 0},g),error:new Error(`HTTP Error ${g.code} ${g.text}`),networkDetails:m,stats:T}))},onAbort:(g,f,m)=>{e.stats.aborted=t.stats.aborted,this.resetLoader(e,c),l(new Ce({type:$.NETWORK_ERROR,details:L.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,error:new Error("Aborted"),networkDetails:m,stats:g}))},onTimeout:(g,f,m)=>{this.resetLoader(e,c),l(new Ce({type:$.NETWORK_ERROR,details:L.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,error:new Error(`Timeout after ${d.timeout}ms`),networkDetails:m,stats:g}))}})})}updateStatsFromPart(e,t){const s=e.stats,i=t.stats,r=i.total;if(s.loaded+=i.loaded,r){const l=Math.round(e.duration/t.duration),c=Math.min(Math.round(s.loaded/r),l),u=(l-c)*Math.round(s.loaded/c);s.total=s.loaded+u}else s.total=Math.max(s.loaded,s.total);const n=s.loading,o=i.loading;n.start?n.first+=o.first-o.start:(n.start=o.start,n.first=o.first),n.end=o.end}resetLoader(e,t){e.loader=null,this.loader===t&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),t.destroy()}}function mi(a,e=null){const t=e||a,s={frag:a,part:e,responseType:"arraybuffer",url:t.url,headers:{},rangeStart:0,rangeEnd:0},i=t.byteRangeStartOffset,r=t.byteRangeEndOffset;if(O(i)&&O(r)){var n;let o=i,l=r;if(a.sn==="initSegment"&&((n=a.decryptdata)==null?void 0:n.method)==="AES-128"){const c=r-i;c%16&&(l=r+(16-c%16)),i!==0&&(s.resetIV=!0,o=i-16)}s.rangeStart=o,s.rangeEnd=l}return s}function pi(a,e){const t=new Error(`GAP ${a.gap?"tag":"attribute"} found`),s={type:$.MEDIA_ERROR,details:L.FRAG_GAP,fatal:!1,frag:a,error:t,networkDetails:null};return e&&(s.part=e),(e||a).stats.aborted=!0,new Ce(s)}class Ce extends Error{constructor(e){super(e.error.message),this.data=void 0,this.data=e}}class qa{constructor(e,t){this.subtle=void 0,this.aesIV=void 0,this.subtle=e,this.aesIV=t}decrypt(e,t){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e)}}class ja{constructor(e,t){this.subtle=void 0,this.key=void 0,this.subtle=e,this.key=t}expandKey(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])}}function za(a){const e=a.byteLength,t=e&&new DataView(a.buffer).getUint8(e-1);return t?Ne(a,0,e-t):a}class Xa{constructor(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}uint8ArrayToUint32Array_(e){const t=new DataView(e),s=new Uint32Array(4);for(let i=0;i<4;i++)s[i]=t.getUint32(i*4);return s}initTable(){const e=this.sBox,t=this.invSBox,s=this.subMix,i=s[0],r=s[1],n=s[2],o=s[3],l=this.invSubMix,c=l[0],h=l[1],u=l[2],d=l[3],g=new Uint32Array(256);let f=0,m=0,T=0;for(T=0;T<256;T++)T<128?g[T]=T<<1:g[T]=T<<1^283;for(T=0;T<256;T++){let E=m^m<<1^m<<2^m<<3^m<<4;E=E>>>8^E&255^99,e[f]=E,t[E]=f;const x=g[f],y=g[x],I=g[y];let S=g[E]*257^E*16843008;i[f]=S<<24|S>>>8,r[f]=S<<16|S>>>16,n[f]=S<<8|S>>>24,o[f]=S,S=I*16843009^y*65537^x*257^f*16843008,c[E]=S<<24|S>>>8,h[E]=S<<16|S>>>16,u[E]=S<<8|S>>>24,d[E]=S,f?(f=x^g[g[g[I^x]]],m^=g[g[m]]):f=m=1}}expandKey(e){const t=this.uint8ArrayToUint32Array_(e);let s=!0,i=0;for(;ithis.subtle?(this.logOnce("WebCrypto AES decrypt"),new qa(this.subtle,new Uint8Array(s)).decrypt(e.buffer,i)):Promise.reject(new Error("web crypto not initialized"))).catch(i=>(v.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${i.name}: ${i.message}`),this.onWebCryptoError(e,t,s)))}onWebCryptoError(e,t,s){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(e,t,s);const i=this.flush();if(i)return i.buffer;throw new Error("WebCrypto and softwareDecrypt: failed to decrypt data")}getValidChunk(e){let t=e;const s=e.length-e.length%Qa;return s!==e.length&&(t=Ne(e,0,s),this.remainderData=Ne(e,s)),t}logOnce(e){this.logEnabled&&(v.log(`[decrypter]: ${e}`),this.logEnabled=!1)}}const Ja={toString:function(a){let e="";const t=a.length;for(let s=0;so.end){const u=n>h;(n{if(this.fragContextChanged(e)){this.warn(`Fragment ${e.sn}${r.part?" p: "+r.part.index:""} of level ${e.level} was dropped during download.`),this.fragmentTracker.removeFragment(e);return}e.stats.chunkCount++,this._handleFragmentLoadProgress(r)};this._doFragLoad(e,t,s,i).then(r=>{if(!r)return;const n=this.state;if(this.fragContextChanged(e)){(n===C.FRAG_LOADING||!this.fragCurrent&&n===C.PARSING)&&(this.fragmentTracker.removeFragment(e),this.state=C.IDLE);return}"payload"in r&&(this.log(`Loaded fragment ${e.sn} of level ${e.level}`),this.hls.trigger(p.FRAG_LOADED,r)),this._handleFragmentLoadComplete(r)}).catch(r=>{this.state===C.STOPPED||this.state===C.ERROR||(this.warn(`Frag error: ${(r==null?void 0:r.message)||r}`),this.resetFragmentLoading(e))})}clearTrackerIfNeeded(e){var t;const{fragmentTracker:s}=this;if(s.getState(e)===ae.APPENDING){const r=e.type,n=this.getFwdBufferInfo(this.mediaBuffer,r),o=Math.max(e.duration,n?n.len:this.config.maxBufferLength),l=this.backtrackFragment;((l?e.sn-l.sn:0)===1||this.reduceMaxBufferLength(o,e.duration))&&s.removeFragment(e)}else((t=this.mediaBuffer)==null?void 0:t.buffered.length)===0?s.removeAllFragments():s.hasParts(e.type)&&(s.detectPartialFragments({frag:e,part:null,stats:e.stats,id:e.type}),s.getState(e)===ae.PARTIAL&&s.removeFragment(e))}checkLiveUpdate(e){if(e.updated&&!e.live){const t=e.fragments[e.fragments.length-1];this.fragmentTracker.detectPartialFragments({frag:t,part:null,stats:t.stats,id:t.type})}e.fragments[0]||(e.deltaUpdateFailed=!0)}flushMainBuffer(e,t,s=null){if(!(e-t))return;const i={startOffset:e,endOffset:t,type:s};this.hls.trigger(p.BUFFER_FLUSHING,i)}_loadInitSegment(e,t){this._doFragLoad(e,t).then(s=>{if(!s||this.fragContextChanged(e)||!this.levels)throw new Error("init load aborted");return s}).then(s=>{const{hls:i}=this,{payload:r}=s,n=e.decryptdata;if(r&&r.byteLength>0&&n!=null&&n.key&&n.iv&&n.method==="AES-128"){const o=self.performance.now();return this.decrypter.decrypt(new Uint8Array(r),n.key.buffer,n.iv.buffer).catch(l=>{throw i.trigger(p.ERROR,{type:$.MEDIA_ERROR,details:L.FRAG_DECRYPT_ERROR,fatal:!1,error:l,reason:l.message,frag:e}),l}).then(l=>{const c=self.performance.now();return i.trigger(p.FRAG_DECRYPTED,{frag:e,payload:l,stats:{tstart:o,tdecrypt:c}}),s.payload=l,this.completeInitSegmentLoad(s)})}return this.completeInitSegmentLoad(s)}).catch(s=>{this.state===C.STOPPED||this.state===C.ERROR||(this.warn(s),this.resetFragmentLoading(e))})}completeInitSegmentLoad(e){const{levels:t}=this;if(!t)throw new Error("init load aborted, missing levels");const s=e.frag.stats;this.state=C.IDLE,e.frag.data=new Uint8Array(e.payload),s.parsing.start=s.buffering.start=self.performance.now(),s.parsing.end=s.buffering.end=self.performance.now(),this.tick()}fragContextChanged(e){const{fragCurrent:t}=this;return!e||!t||e.sn!==t.sn||e.level!==t.level}fragBufferedComplete(e,t){var s,i,r,n;const o=this.mediaBuffer?this.mediaBuffer:this.media;if(this.log(`Buffered ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.playlistType===U.MAIN?"level":"track"} ${e.level} (frag:[${((s=e.startPTS)!=null?s:NaN).toFixed(3)}-${((i=e.endPTS)!=null?i:NaN).toFixed(3)}] > buffer:${o?Ja.toString(J.getBuffered(o)):"(detached)"})`),e.sn!=="initSegment"){var l;if(e.type!==U.SUBTITLE){const h=e.elementaryStreams;if(!Object.keys(h).some(u=>!!h[u])){this.state=C.IDLE;return}}const c=(l=this.levels)==null?void 0:l[e.level];c!=null&&c.fragmentError&&(this.log(`Resetting level fragment error count of ${c.fragmentError} on frag buffered`),c.fragmentError=0)}this.state=C.IDLE,o&&(!this.loadedmetadata&&e.type==U.MAIN&&o.buffered.length&&((r=this.fragCurrent)==null?void 0:r.sn)===((n=this.fragPrevious)==null?void 0:n.sn)&&(this.loadedmetadata=!0,this.seekToStartPos()),this.tick())}seekToStartPos(){}_handleFragmentLoadComplete(e){const{transmuxer:t}=this;if(!t)return;const{frag:s,part:i,partsLoaded:r}=e,n=!r||r.length===0||r.some(l=>!l),o=new Is(s.level,s.sn,s.stats.chunkCount+1,0,i?i.index:-1,!n);t.flush(o)}_handleFragmentLoadProgress(e){}_doFragLoad(e,t,s=null,i){var r;const n=t==null?void 0:t.details;if(!this.levels||!n)throw new Error(`frag load aborted, missing level${n?"":" detail"}s`);let o=null;if(e.encrypted&&!((r=e.decryptdata)!=null&&r.key)?(this.log(`Loading key for ${e.sn} of [${n.startSN}-${n.endSN}], ${this.logPrefix==="[stream-controller]"?"level":"track"} ${e.level}`),this.state=C.KEY_LOADING,this.fragCurrent=e,o=this.keyLoader.load(e).then(h=>{if(!this.fragContextChanged(h.frag))return this.hls.trigger(p.KEY_LOADED,h),this.state===C.KEY_LOADING&&(this.state=C.IDLE),h}),this.hls.trigger(p.KEY_LOADING,{frag:e}),this.fragCurrent===null&&(o=Promise.reject(new Error("frag load aborted, context changed in KEY_LOADING")))):!e.encrypted&&n.encryptedFragments.length&&this.keyLoader.loadClear(e,n.encryptedFragments),s=Math.max(e.start,s||0),this.config.lowLatencyMode&&e.sn!=="initSegment"){const h=n.partList;if(h&&i){s>e.end&&n.fragmentHint&&(e=n.fragmentHint);const u=this.getNextPart(h,e,s);if(u>-1){const d=h[u];this.log(`Loading part sn: ${e.sn} p: ${d.index} cc: ${e.cc} of playlist [${n.startSN}-${n.endSN}] parts [0-${u}-${h.length-1}] ${this.logPrefix==="[stream-controller]"?"level":"track"}: ${e.level}, target: ${parseFloat(s.toFixed(3))}`),this.nextLoadPosition=d.start+d.duration,this.state=C.FRAG_LOADING;let g;return o?g=o.then(f=>!f||this.fragContextChanged(f.frag)?null:this.doFragPartsLoad(e,d,t,i)).catch(f=>this.handleFragLoadError(f)):g=this.doFragPartsLoad(e,d,t,i).catch(f=>this.handleFragLoadError(f)),this.hls.trigger(p.FRAG_LOADING,{frag:e,part:d,targetBufferTime:s}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):g}else if(!e.url||this.loadedEndOfParts(h,s))return Promise.resolve(null)}}this.log(`Loading fragment ${e.sn} cc: ${e.cc} ${n?"of ["+n.startSN+"-"+n.endSN+"] ":""}${this.logPrefix==="[stream-controller]"?"level":"track"}: ${e.level}, target: ${parseFloat(s.toFixed(3))}`),O(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=C.FRAG_LOADING;const l=this.config.progressive;let c;return l&&o?c=o.then(h=>!h||this.fragContextChanged(h==null?void 0:h.frag)?null:this.fragmentLoader.load(e,i)).catch(h=>this.handleFragLoadError(h)):c=Promise.all([this.fragmentLoader.load(e,l?i:void 0),o]).then(([h])=>(!l&&h&&i&&i(h),h)).catch(h=>this.handleFragLoadError(h)),this.hls.trigger(p.FRAG_LOADING,{frag:e,targetBufferTime:s}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):c}doFragPartsLoad(e,t,s,i){return new Promise((r,n)=>{var o;const l=[],c=(o=s.details)==null?void 0:o.partList,h=u=>{this.fragmentLoader.loadPart(e,u,i).then(d=>{l[u.index]=d;const g=d.part;this.hls.trigger(p.FRAG_LOADED,d);const f=li(s,e.sn,u.index+1)||or(c,e.sn,u.index+1);if(f)h(f);else return r({frag:e,part:g,partsLoaded:l})}).catch(n)};h(t)})}handleFragLoadError(e){if("data"in e){const t=e.data;e.data&&t.details===L.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):this.hls.trigger(p.ERROR,t)}else this.hls.trigger(p.ERROR,{type:$.OTHER_ERROR,details:L.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0});return null}_handleTransmuxerFlush(e){const t=this.getCurrentContext(e);if(!t||this.state!==C.PARSING){!this.fragCurrent&&this.state!==C.STOPPED&&this.state!==C.ERROR&&(this.state=C.IDLE);return}const{frag:s,part:i,level:r}=t,n=self.performance.now();s.stats.parsing.end=n,i&&(i.stats.parsing.end=n),this.updateLevelTiming(s,i,r,e.partial)}getCurrentContext(e){const{levels:t,fragCurrent:s}=this,{level:i,sn:r,part:n}=e;if(!(t!=null&&t[i]))return this.warn(`Levels object was unset while buffering fragment ${r} of level ${i}. The current chunk will not be buffered.`),null;const o=t[i],l=n>-1?li(o,r,n):null,c=l?l.fragment:xa(o,r,s);return c?(s&&s!==c&&(c.stats=s.stats),{frag:c,part:l,level:o}):null}bufferFragmentData(e,t,s,i,r){var n;if(!e||this.state!==C.PARSING)return;const{data1:o,data2:l}=e;let c=o;if(o&&l&&(c=pe(o,l)),!((n=c)!=null&&n.length))return;const h={type:e.type,frag:t,part:s,chunkMeta:i,parent:t.type,data:c};if(this.hls.trigger(p.BUFFER_APPENDING,h),e.dropped&&e.independent&&!s){if(r)return;this.flushBufferGap(t)}}flushBufferGap(e){const t=this.media;if(!t)return;if(!J.isBuffered(t,t.currentTime)){this.flushMainBuffer(0,e.start);return}const s=t.currentTime,i=J.bufferInfo(t,s,0),r=e.duration,n=Math.min(this.config.maxFragLookUpTolerance*2,r*.25),o=Math.max(Math.min(e.start-n,i.end-n),s+n);e.start-o>n&&this.flushMainBuffer(o,e.start)}getFwdBufferInfo(e,t){const s=this.getLoadPosition();return O(s)?this.getFwdBufferInfoAtPos(e,s,t):null}getFwdBufferInfoAtPos(e,t,s){const{config:{maxBufferHole:i}}=this,r=J.bufferInfo(e,t,i);if(r.len===0&&r.nextStart!==void 0){const n=this.fragmentTracker.getBufferedFrag(t,s);if(n&&r.nextStart=i?(s.maxMaxBufferLength=r,this.warn(`Reduce max buffer length to ${r}s`),!0):!1}getAppendedFrag(e,t=U.MAIN){const s=this.fragmentTracker.getAppendedFrag(e,U.MAIN);return s&&"fragment"in s?s.fragment:s}getNextFragment(e,t){const s=t.fragments,i=s.length;if(!i)return null;const{config:r}=this,n=s[0].start;let o;if(t.live){const l=r.initialLiveManifestSize;if(it}getNextFragmentLoopLoading(e,t,s,i,r){const n=e.gap,o=this.getNextFragment(this.nextLoadPosition,t);if(o===null)return o;if(e=o,n&&e&&!e.gap&&s.nextStart){const l=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,s.nextStart,i);if(l!==null&&s.len+l.len>=r)return this.log(`buffer full after gaps in "${i}" playlist starting at sn: ${e.sn}`),null}return e}mapToInitFragWhenRequired(e){return e!=null&&e.initSegment&&!(e!=null&&e.initSegment.data)&&!this.bitrateTest?e.initSegment:e}getNextPart(e,t,s){let i=-1,r=!1,n=!0;for(let o=0,l=e.length;o-1&&ss.start&&s.loaded}getInitialLiveFragment(e,t){const s=this.fragPrevious;let i=null;if(s){if(e.hasProgramDateTime&&(this.log(`Live playlist, switching playlist, load frag with same PDT: ${s.programDateTime}`),i=va(t,s.endProgramDateTime,this.config.maxFragLookUpTolerance)),!i){const r=s.sn+1;if(r>=e.startSN&&r<=e.endSN){const n=t[r-e.startSN];s.cc===n.cc&&(i=n,this.log(`Live playlist, switching playlist, load frag with next SN: ${i.sn}`))}i||(i=Ra(t,s.cc),i&&this.log(`Live playlist, switching playlist, load frag with same CC: ${i.sn}`))}}else{const r=this.hls.liveSyncPosition;r!==null&&(i=this.getFragmentAtPosition(r,this.bitrateTest?e.fragmentEnd:e.edge,e))}return i}getFragmentAtPosition(e,t,s){const{config:i}=this;let{fragPrevious:r}=this,{fragments:n,endSN:o}=s;const{fragmentHint:l}=s,{maxFragLookUpTolerance:c}=i,h=s.partList,u=!!(i.lowLatencyMode&&h!=null&&h.length&&l);u&&l&&!this.bitrateTest&&(n=n.concat(l),o=l.sn);let d;if(et-c?0:c;d=Ct(r,n,e,g)}else d=n[n.length-1];if(d){const g=d.sn-s.startSN,f=this.fragmentTracker.getState(d);if((f===ae.OK||f===ae.PARTIAL&&d.gap)&&(r=d),r&&d.sn===r.sn&&(!u||h[0].fragment.sn>d.sn)&&r&&d.level===r.level){const T=n[g+1];d.sn=n-t.maxFragLookUpTolerance&&r<=o;if(i!==null&&s.duration>i&&(r${e.startSN} prev-sn: ${l?l.sn:"na"} fragments: ${i}`),c}return r}waitForCdnTuneIn(e){return e.live&&e.canBlockReload&&e.partTarget&&e.tuneInGoal>Math.max(e.partHoldBack,e.partTarget*3)}setStartPosition(e,t){let s=this.startPosition;if(s ${(i=this.fragCurrent)==null?void 0:i.url}`);return}const r=t.details===L.FRAG_GAP;r&&this.fragmentTracker.fragBuffered(s,!0);const n=t.errorAction,{action:o,retryCount:l=0,retryConfig:c}=n||{};if(n&&o===ce.RetryRequest&&c){this.resetStartWhenNotLoaded(this.levelLastLoaded);const h=Ls(c,l);this.warn(`Fragment ${s.sn} of ${e} ${s.level} errored with ${t.details}, retrying loading ${l+1}/${c.maxNumRetry} in ${h}ms`),n.resolved=!0,this.retryDate=self.performance.now()+h,this.state=C.FRAG_LOADING_WAITING_RETRY}else if(c&&n)if(this.resetFragmentErrors(e),l.5;r&&this.reduceMaxBufferLength(i.len,(t==null?void 0:t.duration)||10);const n=!r;return n&&this.warn(`Buffer full error while media.currentTime is not buffered, flush ${s} buffer`),t&&(this.fragmentTracker.removeFragment(t),this.nextLoadPosition=t.start),this.resetLoadingState(),n}return!1}resetFragmentErrors(e){e===U.AUDIO&&(this.fragCurrent=null),this.loadedmetadata||(this.startFragRequested=!1),this.state!==C.STOPPED&&(this.state=C.IDLE)}afterBufferFlushed(e,t,s){if(!e)return;const i=J.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,i,s),this.state===C.ENDED&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state=C.IDLE}resetStartWhenNotLoaded(e){if(!this.loadedmetadata){this.startFragRequested=!1;const t=e?e.details:null;t!=null&&t.live?(this.startPosition=-1,this.setStartPosition(t,0),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}}resetWhenMissingContext(e){this.warn(`The loading context changed while buffering fragment ${e.sn} of level ${e.level}. This chunk will not be buffered.`),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded(this.levelLastLoaded),this.resetLoadingState()}removeUnbufferedFrags(e=0){this.fragmentTracker.removeFragmentsInRange(e,1/0,this.playlistType,!1,!0)}updateLevelTiming(e,t,s,i){var r;const n=s.details;if(!n){this.warn("level.details undefined");return}if(!Object.keys(e.elementaryStreams).reduce((l,c)=>{const h=e.elementaryStreams[c];if(h){const u=h.endPTS-h.startPTS;if(u<=0)return this.warn(`Could not parse fragment ${e.sn} ${c} duration reliably (${u})`),l||!1;const d=i?0:nr(n,e,h.startPTS,h.endPTS,h.startDTS,h.endDTS);return this.hls.trigger(p.LEVEL_PTS_UPDATED,{details:n,level:s,drift:d,type:c,frag:e,start:h.startPTS,end:h.endPTS}),!0}return l},!1)&&((r=this.transmuxer)==null?void 0:r.error)===null){const l=new Error(`Found no media in fragment ${e.sn} of level ${e.level} resetting transmuxer to fallback to playlist timing`);if(s.fragmentError===0&&(s.fragmentError++,e.gap=!0,this.fragmentTracker.removeFragment(e),this.fragmentTracker.fragBuffered(e,!0)),this.warn(l.message),this.hls.trigger(p.ERROR,{type:$.MEDIA_ERROR,details:L.FRAG_PARSING_ERROR,fatal:!1,error:l,frag:e,reason:`Found no media in msn ${e.sn} of level "${s.url}"`}),!this.hls)return;this.resetTransmuxer()}this.state=C.PARSED,this.hls.trigger(p.FRAG_PARSED,{frag:e,part:t})}resetTransmuxer(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)}recoverWorkerError(e){e.event==="demuxerWorker"&&(this.fragmentTracker.removeAllFragments(),this.resetTransmuxer(),this.resetStartWhenNotLoaded(this.levelLastLoaded),this.resetLoadingState())}set state(e){const t=this._state;t!==e&&(this._state=e,this.log(`${t}->${e}`))}get state(){return this._state}}class dr{constructor(){this.chunks=[],this.dataLength=0}push(e){this.chunks.push(e),this.dataLength+=e.length}flush(){const{chunks:e,dataLength:t}=this;let s;if(e.length)e.length===1?s=e[0]:s=Za(e,t);else return new Uint8Array(0);return this.reset(),s}reset(){this.chunks.length=0,this.dataLength=0}}function Za(a,e){const t=new Uint8Array(e);let s=0;for(let i=0;i0&&o.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:s,type:ye.audioId3,duration:Number.POSITIVE_INFINITY});i{if(O(a))return a*90;const s=t?t.baseTime*9e4/t.timescale:0;return e*9e4+s};function ro(a,e,t,s){let i,r,n,o;const l=navigator.userAgent.toLowerCase(),c=s,h=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];i=((e[t+2]&192)>>>6)+1;const u=(e[t+2]&60)>>>2;if(u>h.length-1){const d=new Error(`invalid ADTS sampling index:${u}`);a.emit(p.ERROR,p.ERROR,{type:$.MEDIA_ERROR,details:L.FRAG_PARSING_ERROR,fatal:!0,error:d,reason:d.message});return}return n=(e[t+2]&1)<<2,n|=(e[t+3]&192)>>>6,v.log(`manifest codec:${s}, ADTS type:${i}, samplingIndex:${u}`),/firefox/i.test(l)?u>=6?(i=5,o=new Array(4),r=u-3):(i=2,o=new Array(2),r=u):l.indexOf("android")!==-1?(i=2,o=new Array(2),r=u):(i=5,o=new Array(4),s&&(s.indexOf("mp4a.40.29")!==-1||s.indexOf("mp4a.40.5")!==-1)||!s&&u>=6?r=u-3:((s&&s.indexOf("mp4a.40.2")!==-1&&(u>=6&&n===1||/vivaldi/i.test(l))||!s&&n===1)&&(i=2,o=new Array(2)),r=u)),o[0]=i<<3,o[0]|=(u&14)>>1,o[1]|=(u&1)<<7,o[1]|=n<<3,i===5&&(o[1]|=(r&14)>>1,o[2]=(r&1)<<7,o[2]|=8,o[3]=0),{config:o,samplerate:h[u],channelCount:n,codec:"mp4a.40."+i,manifestCodec:c}}function fr(a,e){return a[e]===255&&(a[e+1]&246)===240}function gr(a,e){return a[e+1]&1?7:9}function _s(a,e){return(a[e+3]&3)<<11|a[e+4]<<3|(a[e+5]&224)>>>5}function no(a,e){return e+5=a.length)return!1;const s=_s(a,e);if(s<=t)return!1;const i=e+s;return i===a.length||wt(a,i)}return!1}function mr(a,e,t,s,i){if(!a.samplerate){const r=ro(e,t,s,i);if(!r)return;a.config=r.config,a.samplerate=r.samplerate,a.channelCount=r.channelCount,a.codec=r.codec,a.manifestCodec=r.manifestCodec,v.log(`parsed codec:${a.codec}, rate:${r.samplerate}, channels:${r.channelCount}`)}}function pr(a){return 1024*9e4/a}function lo(a,e){const t=gr(a,e);if(e+t<=a.length){const s=_s(a,e)-t;if(s>0)return{headerLength:t,frameLength:s}}}function Tr(a,e,t,s,i){const r=pr(a.samplerate),n=s+i*r,o=lo(e,t);let l;if(o){const{frameLength:u,headerLength:d}=o,g=d+u,f=Math.max(0,t+g-e.length);f?(l=new Uint8Array(g-d),l.set(e.subarray(t+d,e.length),0)):l=e.subarray(t+d,t+g);const m={unit:l,pts:n};return f||a.samples.push(m),{sample:m,length:g,missing:f}}const c=e.length-t;return l=new Uint8Array(c),l.set(e.subarray(t,e.length),0),{sample:{unit:l,pts:n},length:c,missing:-1}}let lt=null;const co=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],ho=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],uo=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],fo=[0,1,1,4];function Er(a,e,t,s,i){if(t+24>e.length)return;const r=yr(e,t);if(r&&t+r.frameLength<=e.length){const n=r.samplesPerFrame*9e4/r.sampleRate,o=s+i*n,l={unit:e.subarray(t,t+r.frameLength),pts:o,dts:o};return a.config=[],a.channelCount=r.channelCount,a.samplerate=r.sampleRate,a.samples.push(l),{sample:l,length:r.frameLength,missing:0}}}function yr(a,e){const t=a[e+1]>>3&3,s=a[e+1]>>1&3,i=a[e+2]>>4&15,r=a[e+2]>>2&3;if(t!==1&&i!==0&&i!==15&&r!==3){const n=a[e+2]>>1&1,o=a[e+3]>>6,l=t===3?3-s:s===3?3:4,c=co[l*14+i-1]*1e3,u=ho[(t===3?0:t===2?1:2)*3+r],d=o===3?1:2,g=uo[t][s],f=fo[s],m=g*8*f,T=Math.floor(g*c/u+n)*f;if(lt===null){const y=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);lt=y?parseInt(y[1]):0}return!!lt&<<=87&&s===2&&c>=224e3&&o===0&&(a[e+3]=a[e+3]|128),{sampleRate:u,channelCount:d,frameLength:T,samplesPerFrame:m}}}function ws(a,e){return a[e]===255&&(a[e+1]&224)===224&&(a[e+1]&6)!==0}function xr(a,e){return e+1{const n=Wn(r);if(po.test(n.schemeIdUri)){const o=O(n.presentationTime)?n.presentationTime/n.timeScale:t+n.presentationTimeDelta/n.timeScale;let l=n.eventDuration===4294967295?Number.POSITIVE_INFINITY:n.eventDuration/n.timeScale;l<=.001&&(l=Number.POSITIVE_INFINITY);const c=n.payload;s.samples.push({data:c,len:c.byteLength,dts:o,pts:o,type:ye.emsg,duration:l})}})}return s}demuxSampleAes(e,t,s){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))}destroy(){}}const vr=(a,e)=>{let t=0,s=5;e+=s;const i=new Uint32Array(1),r=new Uint32Array(1),n=new Uint8Array(1);for(;s>0;){n[0]=a[e];const o=Math.min(s,8),l=8-o;r[0]=4278190080>>>24+l<>l,t=t?t<e.length||e[t]!==11||e[t+1]!==119)return-1;const r=e[t+4]>>6;if(r>=3)return-1;const o=[48e3,44100,32e3][r],l=e[t+4]&63,h=[64,69,96,64,70,96,80,87,120,80,88,120,96,104,144,96,105,144,112,121,168,112,122,168,128,139,192,128,140,192,160,174,240,160,175,240,192,208,288,192,209,288,224,243,336,224,244,336,256,278,384,256,279,384,320,348,480,320,349,480,384,417,576,384,418,576,448,487,672,448,488,672,512,557,768,512,558,768,640,696,960,640,697,960,768,835,1152,768,836,1152,896,975,1344,896,976,1344,1024,1114,1536,1024,1115,1536,1152,1253,1728,1152,1254,1728,1280,1393,1920,1280,1394,1920][l*3+r]*2;if(t+h>e.length)return-1;const u=e[t+6]>>5;let d=0;u===2?d+=2:(u&1&&u!==1&&(d+=2),u&4&&(d+=2));const g=(e[t+6]<<8|e[t+7])>>12-d&1,m=[2,1,2,3,3,4,4,5][u]+g,T=e[t+5]>>3,E=e[t+5]&7,x=new Uint8Array([r<<6|T<<1|E>>2,(E&3)<<6|u<<3|g<<2|l>>4,l<<4&224]),y=1536/o*9e4,I=s+i*y,S=e.subarray(t,t+h);return a.config=x,a.channelCount=m,a.samplerate=o,a.samples.push({unit:S,pts:I}),h}class yo{constructor(){this.VideoSample=null}createVideoSample(e,t,s,i){return{key:e,frame:!1,pts:t,dts:s,units:[],debug:i,length:0}}getLastNalUnit(e){var t;let s=this.VideoSample,i;if((!s||s.units.length===0)&&(s=e[e.length-1]),(t=s)!=null&&t.units){const r=s.units;i=r[r.length-1]}return i}pushAccessUnit(e,t){if(e.units.length&&e.frame){if(e.pts===void 0){const s=t.samples,i=s.length;if(i){const r=s[i-1];e.pts=r.pts,e.dts=r.dts}else{t.dropped++;return}}t.samples.push(e)}e.debug.length&&v.log(e.pts+"/"+e.dts+":"+e.debug)}}class Ti{constructor(e){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=e,this.bytesAvailable=e.byteLength,this.word=0,this.bitsAvailable=0}loadWord(){const e=this.data,t=this.bytesAvailable,s=e.byteLength-t,i=new Uint8Array(4),r=Math.min(4,t);if(r===0)throw new Error("no bytes available");i.set(e.subarray(s,s+r)),this.word=new DataView(i.buffer).getUint32(0),this.bitsAvailable=r*8,this.bytesAvailable-=r}skipBits(e){let t;e=Math.min(e,this.bytesAvailable*8+this.bitsAvailable),this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,t=e>>3,e-=t<<3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)}readBits(e){let t=Math.min(this.bitsAvailable,e);const s=this.word>>>32-t;if(e>32&&v.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0)this.word<<=t;else if(this.bytesAvailable>0)this.loadWord();else throw new Error("no bits available");return t=e-t,t>0&&this.bitsAvailable?s<>>e)return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()}skipUEG(){this.skipBits(1+this.skipLZ())}skipEG(){this.skipBits(1+this.skipLZ())}readUEG(){const e=this.skipLZ();return this.readBits(e+1)-1}readEG(){const e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)}readBoolean(){return this.readBits(1)===1}readUByte(){return this.readBits(8)}readUShort(){return this.readBits(16)}readUInt(){return this.readBits(32)}skipScalingList(e){let t=8,s=8,i;for(let r=0;r{var u;switch(h.type){case 1:{let m=!1;l=!0;const T=h.data;if(c&&T.length>4){const E=new Ti(T).readSliceType();(E===2||E===4||E===7||E===9)&&(m=!0)}if(m){var d;(d=o)!=null&&d.frame&&!o.key&&(this.pushAccessUnit(o,e),o=this.VideoSample=null)}o||(o=this.VideoSample=this.createVideoSample(!0,s.pts,s.dts,"")),o.frame=!0,o.key=m;break}case 5:l=!0,(u=o)!=null&&u.frame&&!o.key&&(this.pushAccessUnit(o,e),o=this.VideoSample=null),o||(o=this.VideoSample=this.createVideoSample(!0,s.pts,s.dts,"")),o.key=!0,o.frame=!0;break;case 6:{l=!0,Zi(h.data,1,s.pts,t.samples);break}case 7:{var g,f;l=!0,c=!0;const m=h.data,E=new Ti(m).readSPS();if(!e.sps||e.width!==E.width||e.height!==E.height||((g=e.pixelRatio)==null?void 0:g[0])!==E.pixelRatio[0]||((f=e.pixelRatio)==null?void 0:f[1])!==E.pixelRatio[1]){e.width=E.width,e.height=E.height,e.pixelRatio=E.pixelRatio,e.sps=[m],e.duration=r;const x=m.subarray(1,4);let y="avc1.";for(let I=0;I<3;I++){let S=x[I].toString(16);S.length<2&&(S="0"+S),y+=S}e.codec=y}break}case 8:l=!0,e.pps=[h.data];break;case 9:l=!0,e.audFound=!0,o&&this.pushAccessUnit(o,e),o=this.VideoSample=this.createVideoSample(!1,s.pts,s.dts,"");break;case 12:l=!0;break;default:l=!1,o&&(o.debug+="unknown NAL "+h.type+" ");break}o&&l&&o.units.push(h)}),i&&o&&(this.pushAccessUnit(o,e),this.VideoSample=null)}parseAVCNALu(e,t){const s=t.byteLength;let i=e.naluState||0;const r=i,n=[];let o=0,l,c,h,u=-1,d=0;for(i===-1&&(u=0,d=t[0]&31,i=0,o=1);o=0){const g={data:t.subarray(u,c),type:d};n.push(g)}else{const g=this.getLastNalUnit(e.samples);g&&(r&&o<=4-r&&g.state&&(g.data=g.data.subarray(0,g.data.byteLength-r)),c>0&&(g.data=pe(g.data,t.subarray(0,c)),g.state=0))}o=0&&i>=0){const g={data:t.subarray(u,s),type:d,state:i};n.push(g)}if(n.length===0){const g=this.getLastNalUnit(e.samples);g&&(g.data=pe(g.data,t))}return e.naluState=i,n}}class So{constructor(e,t,s){this.keyData=void 0,this.decrypter=void 0,this.keyData=s,this.decrypter=new bs(t,{removePKCS7Padding:!1})}decryptBuffer(e){return this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer)}decryptAacSample(e,t,s){const i=e[t].unit;if(i.length<=16)return;const r=i.subarray(16,i.length-i.length%16),n=r.buffer.slice(r.byteOffset,r.byteOffset+r.length);this.decryptBuffer(n).then(o=>{const l=new Uint8Array(o);i.set(l,16),this.decrypter.isSync()||this.decryptAacSamples(e,t+1,s)})}decryptAacSamples(e,t,s){for(;;t++){if(t>=e.length){s();return}if(!(e[t].unit.length<32)&&(this.decryptAacSample(e,t,s),!this.decrypter.isSync()))return}}getAvcEncryptedData(e){const t=Math.floor((e.length-48)/160)*16+16,s=new Int8Array(t);let i=0;for(let r=32;r{r.data=this.getAvcDecryptedUnit(n,l),this.decrypter.isSync()||this.decryptAvcSamples(e,t,s+1,i)})}decryptAvcSamples(e,t,s,i){if(e instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;t++,s=0){if(t>=e.length){i();return}const r=e[t].units;for(;!(s>=r.length);s++){const n=r[s];if(!(n.data.length<=48||n.type!==1&&n.type!==5)&&(this.decryptAvcSample(e,t,s,i,n),!this.decrypter.isSync()))return}}}}const ne=188;class Pe{constructor(e,t,s){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this._pmtId=-1,this._videoTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.remainderData=null,this.videoParser=void 0,this.observer=e,this.config=t,this.typeSupported=s,this.videoParser=new xo}static probe(e){const t=Pe.syncOffset(e);return t>0&&v.warn(`MPEG2-TS detected but first sync word found @ offset ${t}`),t!==-1}static syncOffset(e){const t=e.length;let s=Math.min(ne*5,t-ne)+1,i=0;for(;i1&&(n===0&&o>2||l+ne>s))return n}else{if(o)return-1;break}i++}return-1}static createTrack(e,t){return{container:e==="video"||e==="audio"?"video/mp2t":void 0,type:e,id:ji[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:e==="audio"?t:void 0}}resetInitSegment(e,t,s,i){this.pmtParsed=!1,this._pmtId=-1,this._videoTrack=Pe.createTrack("video"),this._audioTrack=Pe.createTrack("audio",i),this._id3Track=Pe.createTrack("id3"),this._txtTrack=Pe.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.remainderData=null,this.audioCodec=t,this.videoCodec=s,this._duration=i}resetTimeStamp(){}resetContiguity(){const{_audioTrack:e,_videoTrack:t,_id3Track:s}=this;e&&(e.pesData=null),t&&(t.pesData=null),s&&(s.pesData=null),this.aacOverFlow=null,this.remainderData=null}demux(e,t,s=!1,i=!1){s||(this.sampleAes=null);let r;const n=this._videoTrack,o=this._audioTrack,l=this._id3Track,c=this._txtTrack;let h=n.pid,u=n.pesData,d=o.pid,g=l.pid,f=o.pesData,m=l.pesData,T=null,E=this.pmtParsed,x=this._pmtId,y=e.length;if(this.remainderData&&(e=pe(this.remainderData,e),y=e.length,this.remainderData=null),y>4;let w;if(b>1){if(w=R+5+e[R+4],w===R+ne)continue}else w=R+4;switch(k){case h:_&&(u&&(r=Ke(u))&&this.videoParser.parseAVCPES(n,c,r,!1,this._duration),u={data:[],size:0}),u&&(u.data.push(e.subarray(w,R+ne)),u.size+=R+ne-w);break;case d:if(_){if(f&&(r=Ke(f)))switch(o.segmentCodec){case"aac":this.parseAACPES(o,r);break;case"mp3":this.parseMPEGPES(o,r);break;case"ac3":this.parseAC3PES(o,r);break}f={data:[],size:0}}f&&(f.data.push(e.subarray(w,R+ne)),f.size+=R+ne-w);break;case g:_&&(m&&(r=Ke(m))&&this.parseID3PES(l,r),m={data:[],size:0}),m&&(m.data.push(e.subarray(w,R+ne)),m.size+=R+ne-w);break;case 0:_&&(w+=e[w]+1),x=this._pmtId=vo(e,w);break;case x:{_&&(w+=e[w]+1);const V=Ao(e,w,this.typeSupported,s,this.observer);h=V.videoPid,h>0&&(n.pid=h,n.segmentCodec=V.segmentVideoCodec),d=V.audioPid,d>0&&(o.pid=d,o.segmentCodec=V.segmentAudioCodec),g=V.id3Pid,g>0&&(l.pid=g),T!==null&&!E&&(v.warn(`MPEG-TS PMT found at ${R} after unknown PID '${T}'. Backtracking to sync byte @${I} to parse all TS packets.`),T=null,R=I-188),E=this.pmtParsed=!0;break}case 17:case 8191:break;default:T=k;break}}else S++;S>0&&kt(this.observer,new Error(`Found ${S} TS packet/s that do not start with 0x47`)),n.pesData=u,o.pesData=f,l.pesData=m;const D={audioTrack:o,videoTrack:n,id3Track:l,textTrack:c};return i&&this.extractRemainingSamples(D),D}flush(){const{remainderData:e}=this;this.remainderData=null;let t;return e?t=this.demux(e,-1,!1,!0):t={videoTrack:this._videoTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(t),this.sampleAes?this.decrypt(t,this.sampleAes):t}extractRemainingSamples(e){const{audioTrack:t,videoTrack:s,id3Track:i,textTrack:r}=e,n=s.pesData,o=t.pesData,l=i.pesData;let c;if(n&&(c=Ke(n))?(this.videoParser.parseAVCPES(s,r,c,!0,this._duration),s.pesData=null):s.pesData=n,o&&(c=Ke(o))){switch(t.segmentCodec){case"aac":this.parseAACPES(t,c);break;case"mp3":this.parseMPEGPES(t,c);break;case"ac3":this.parseAC3PES(t,c);break}t.pesData=null}else o!=null&&o.size&&v.log("last AAC PES packet truncated,might overlap between fragments"),t.pesData=o;l&&(c=Ke(l))?(this.parseID3PES(i,c),i.pesData=null):i.pesData=l}demuxSampleAes(e,t,s){const i=this.demux(e,s,!0,!this.config.progressive),r=this.sampleAes=new So(this.observer,this.config,t);return this.decrypt(i,r)}decrypt(e,t){return new Promise(s=>{const{audioTrack:i,videoTrack:r}=e;i.samples&&i.segmentCodec==="aac"?t.decryptAacSamples(i.samples,0,()=>{r.samples?t.decryptAvcSamples(r.samples,0,0,()=>{s(e)}):s(e)}):r.samples&&t.decryptAvcSamples(r.samples,0,0,()=>{s(e)})})}destroy(){this._duration=0}parseAACPES(e,t){let s=0;const i=this.aacOverFlow;let r=t.data;if(i){this.aacOverFlow=null;const u=i.missing,d=i.sample.unit.byteLength;if(u===-1)r=pe(i.sample.unit,r);else{const g=d-u;i.sample.unit.set(r.subarray(0,u),g),e.samples.push(i.sample),s=i.missing}}let n,o;for(n=s,o=r.length;n0;)o+=l}}parseID3PES(e,t){if(t.pts===void 0){v.warn("[tsdemuxer]: ID3 PES unknown PTS");return}const s=se({},t,{type:this._videoTrack?ye.emsg:ye.audioId3,duration:Number.POSITIVE_INFINITY});e.samples.push(s)}}function fs(a,e){return((a[e+1]&31)<<8)+a[e+2]}function vo(a,e){return(a[e+10]&31)<<8|a[e+11]}function Ao(a,e,t,s,i){const r={audioPid:-1,videoPid:-1,id3Pid:-1,segmentVideoCodec:"avc",segmentAudioCodec:"aac"},n=(a[e+1]&15)<<8|a[e+2],o=e+3+n-4,l=(a[e+10]&15)<<8|a[e+11];for(e+=12+l;e0){let u=e+5,d=h;for(;d>2;){switch(a[u]){case 106:t.ac3!==!0?v.log("AC-3 audio found, not supported in this browser for now"):(r.audioPid=c,r.segmentAudioCodec="ac3");break}const f=a[u+1]+2;u+=f,d-=f}}break;case 194:case 135:return kt(i,new Error("Unsupported EC-3 in M2TS found")),r;case 36:return kt(i,new Error("Unsupported HEVC in M2TS found")),r}e+=h+5}return r}function kt(a,e,t){v.warn(`parsing error: ${e.message}`),a.emit(p.ERROR,p.ERROR,{type:$.MEDIA_ERROR,details:L.FRAG_PARSING_ERROR,fatal:!1,levelRetry:t,error:e,reason:e.message})}function jt(a){v.log(`${a} with AES-128-CBC encryption found in unencrypted stream`)}function Ke(a){let e=0,t,s,i,r,n;const o=a.data;if(!a||a.size===0)return null;for(;o[0].length<19&&o.length>1;)o[0]=pe(o[0],o[1]),o.splice(1,1);if(t=o[0],(t[0]<<16)+(t[1]<<8)+t[2]===1){if(s=(t[4]<<8)+t[5],s&&s>a.size-6)return null;const c=t[7];c&192&&(r=(t[9]&14)*536870912+(t[10]&255)*4194304+(t[11]&254)*16384+(t[12]&255)*128+(t[13]&254)/2,c&64?(n=(t[14]&14)*536870912+(t[15]&255)*4194304+(t[16]&254)*16384+(t[17]&255)*128+(t[18]&254)/2,r-n>60*9e4&&(v.warn(`${Math.round((r-n)/9e4)}s delta between PTS and DTS, align them`),r=n)):n=r),i=t[8];let h=i+9;if(a.size<=h)return null;a.size-=h;const u=new Uint8Array(a.size);for(let d=0,g=o.length;df){h-=f;continue}else t=t.subarray(h),f-=h,h=0;u.set(t,e),e+=f}return s&&(s-=i+3),{data:u,pts:r,dts:n,len:s}}return null}class Lo extends Cs{resetInitSegment(e,t,s,i){super.resetInitSegment(e,t,s,i),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:t,duration:i,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;const t=et(e,0);let s=(t==null?void 0:t.length)||0;if(t&&e[s]===11&&e[s+1]===119&&As(t)!==void 0&&vr(e,s)<=16)return!1;for(let i=e.length;s>24&255,n[1]=s>>16&255,n[2]=s>>8&255,n[3]=s&255,n.set(e,4),i=0,s=8;i>24&255,e>>16&255,e>>8&255,e&255,s>>24,s>>16&255,s>>8&255,s&255,i>>24,i>>16&255,i>>8&255,i&255,85,196,0,0]))}static mdia(e){return A.box(A.types.mdia,A.mdhd(e.timescale,e.duration),A.hdlr(e.type),A.minf(e))}static mfhd(e){return A.box(A.types.mfhd,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,e&255]))}static minf(e){return e.type==="audio"?A.box(A.types.minf,A.box(A.types.smhd,A.SMHD),A.DINF,A.stbl(e)):A.box(A.types.minf,A.box(A.types.vmhd,A.VMHD),A.DINF,A.stbl(e))}static moof(e,t,s){return A.box(A.types.moof,A.mfhd(e),A.traf(s,t))}static moov(e){let t=e.length;const s=[];for(;t--;)s[t]=A.trak(e[t]);return A.box.apply(null,[A.types.moov,A.mvhd(e[0].timescale,e[0].duration)].concat(s).concat(A.mvex(e)))}static mvex(e){let t=e.length;const s=[];for(;t--;)s[t]=A.trex(e[t]);return A.box.apply(null,[A.types.mvex,...s])}static mvhd(e,t){t*=e;const s=Math.floor(t/(ke+1)),i=Math.floor(t%(ke+1)),r=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,e&255,s>>24,s>>16&255,s>>8&255,s&255,i>>24,i>>16&255,i>>8&255,i&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return A.box(A.types.mvhd,r)}static sdtp(e){const t=e.samples||[],s=new Uint8Array(4+t.length);let i,r;for(i=0;i>>8&255),t.push(n&255),t=t.concat(Array.prototype.slice.call(r));for(i=0;i>>8&255),s.push(n&255),s=s.concat(Array.prototype.slice.call(r));const o=A.box(A.types.avcC,new Uint8Array([1,t[3],t[4],t[5],255,224|e.sps.length].concat(t).concat([e.pps.length]).concat(s))),l=e.width,c=e.height,h=e.pixelRatio[0],u=e.pixelRatio[1];return A.box(A.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,l>>8&255,l&255,c>>8&255,c&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),o,A.box(A.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),A.box(A.types.pasp,new Uint8Array([h>>24,h>>16&255,h>>8&255,h&255,u>>24,u>>16&255,u>>8&255,u&255])))}static esds(e){const t=e.config.length;return new Uint8Array([0,0,0,0,3,23+t,0,1,0,4,15+t,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([t]).concat(e.config).concat([6,1,2]))}static audioStsd(e){const t=e.samplerate;return new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,t>>8&255,t&255,0,0])}static mp4a(e){return A.box(A.types.mp4a,A.audioStsd(e),A.box(A.types.esds,A.esds(e)))}static mp3(e){return A.box(A.types[".mp3"],A.audioStsd(e))}static ac3(e){return A.box(A.types["ac-3"],A.audioStsd(e),A.box(A.types.dac3,e.config))}static stsd(e){return e.type==="audio"?e.segmentCodec==="mp3"&&e.codec==="mp3"?A.box(A.types.stsd,A.STSD,A.mp3(e)):e.segmentCodec==="ac3"?A.box(A.types.stsd,A.STSD,A.ac3(e)):A.box(A.types.stsd,A.STSD,A.mp4a(e)):A.box(A.types.stsd,A.STSD,A.avc1(e))}static tkhd(e){const t=e.id,s=e.duration*e.timescale,i=e.width,r=e.height,n=Math.floor(s/(ke+1)),o=Math.floor(s%(ke+1));return A.box(A.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,t&255,0,0,0,0,n>>24,n>>16&255,n>>8&255,n&255,o>>24,o>>16&255,o>>8&255,o&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,i>>8&255,i&255,0,0,r>>8&255,r&255,0,0]))}static traf(e,t){const s=A.sdtp(e),i=e.id,r=Math.floor(t/(ke+1)),n=Math.floor(t%(ke+1));return A.box(A.types.traf,A.box(A.types.tfhd,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,i&255])),A.box(A.types.tfdt,new Uint8Array([1,0,0,0,r>>24,r>>16&255,r>>8&255,r&255,n>>24,n>>16&255,n>>8&255,n&255])),A.trun(e,s.length+16+20+8+16+8+8),s)}static trak(e){return e.duration=e.duration||4294967295,A.box(A.types.trak,A.tkhd(e),A.mdia(e))}static trex(e){const t=e.id;return A.box(A.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,t&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}static trun(e,t){const s=e.samples||[],i=s.length,r=12+16*i,n=new Uint8Array(r);let o,l,c,h,u,d;for(t+=8+r,n.set([e.type==="video"?1:0,0,15,1,i>>>24&255,i>>>16&255,i>>>8&255,i&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255],0),o=0;o>>24&255,c>>>16&255,c>>>8&255,c&255,h>>>24&255,h>>>16&255,h>>>8&255,h&255,u.isLeading<<2|u.dependsOn,u.isDependedOn<<6|u.hasRedundancy<<4|u.paddingValue<<1|u.isNonSync,u.degradPrio&61440,u.degradPrio&15,d>>>24&255,d>>>16&255,d>>>8&255,d&255],12+16*o);return A.box(A.types.trun,n)}static initSegment(e){A.types||A.init();const t=A.moov(e);return pe(A.FTYP,t)}}A.types=void 0;A.HDLR_TYPES=void 0;A.STTS=void 0;A.STSC=void 0;A.STCO=void 0;A.STSZ=void 0;A.VMHD=void 0;A.SMHD=void 0;A.STSD=void 0;A.FTYP=void 0;A.DINF=void 0;const Lr=9e4;function ks(a,e,t=1,s=!1){const i=a*e*t;return s?Math.round(i):i}function Ro(a,e,t=1,s=!1){return ks(a,e,1/t,s)}function Je(a,e=!1){return ks(a,1e3,1/Lr,e)}function Io(a,e=1){return ks(a,Lr,1/e)}const bo=10*1e3,yi=1024,Do=1152,Co=1536;let Ve=null,zt=null;class Tt{constructor(e,t,s,i=""){if(this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextAvcDts=null,this.nextAudioPts=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.videoTrackConfig=void 0,this.observer=e,this.config=t,this.typeSupported=s,this.ISGenerated=!1,Ve===null){const n=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Ve=n?parseInt(n[1]):0}if(zt===null){const r=navigator.userAgent.match(/Safari\/(\d+)/i);zt=r?parseInt(r[1]):0}}destroy(){this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null}resetTimeStamp(e){v.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=e}resetNextTimestamp(){v.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){v.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1,this.videoTrackConfig=void 0}getVideoStartPts(e){let t=!1;const s=e.reduce((i,r)=>{const n=r.pts-i;return n<-4294967296?(t=!0,me(i,r.pts)):n>0?i:r.pts},e[0].pts);return t&&v.debug("PTS rollover detected"),s}remux(e,t,s,i,r,n,o,l){let c,h,u,d,g,f,m=r,T=r;const E=e.pid>-1,x=t.pid>-1,y=t.samples.length,I=e.samples.length>0,S=o&&y>0||y>1;if((!E||I)&&(!x||S)||this.ISGenerated||o){if(this.ISGenerated){var R,_,k,b;const K=this.videoTrackConfig;K&&(t.width!==K.width||t.height!==K.height||((R=t.pixelRatio)==null?void 0:R[0])!==((_=K.pixelRatio)==null?void 0:_[0])||((k=t.pixelRatio)==null?void 0:k[1])!==((b=K.pixelRatio)==null?void 0:b[1]))&&this.resetInitSegment()}else u=this.generateIS(e,t,r,n);const w=this.isVideoContiguous;let V=-1,P;if(S&&(V=_o(t.samples),!w&&this.config.forceKeyFrameOnDiscontinuity))if(f=!0,V>0){v.warn(`[mp4-remuxer]: Dropped ${V} out of ${y} video samples due to a missing keyframe`);const K=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(V),t.dropped+=V,T+=(t.samples[0].pts-K)/t.inputTimeScale,P=T}else V===-1&&(v.warn(`[mp4-remuxer]: No keyframe found out of ${y} video samples`),f=!1);if(this.ISGenerated){if(I&&S){const K=this.getVideoStartPts(t.samples),B=(me(e.samples[0].pts,K)-K)/t.inputTimeScale;m+=Math.max(0,B),T+=Math.max(0,-B)}if(I){if(e.samplerate||(v.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),u=this.generateIS(e,t,r,n)),h=this.remuxAudio(e,m,this.isAudioContiguous,n,x||S||l===U.AUDIO?T:void 0),S){const K=h?h.endPTS-h.startPTS:0;t.inputTimeScale||(v.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),u=this.generateIS(e,t,r,n)),c=this.remuxVideo(t,T,w,K)}}else S&&(c=this.remuxVideo(t,T,w,0));c&&(c.firstKeyFrame=V,c.independent=V!==-1,c.firstKeyFramePTS=P)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(s.samples.length&&(g=Rr(s,r,this._initPTS,this._initDTS)),i.samples.length&&(d=Ir(i,r,this._initPTS))),{audio:h,video:c,initSegment:u,independent:f,text:d,id3:g}}generateIS(e,t,s,i){const r=e.samples,n=t.samples,o=this.typeSupported,l={},c=this._initPTS;let h=!c||i,u="audio/mp4",d,g,f;if(h&&(d=g=1/0),e.config&&r.length){switch(e.timescale=e.samplerate,e.segmentCodec){case"mp3":o.mpeg?(u="audio/mpeg",e.codec=""):o.mp3&&(e.codec="mp3");break;case"ac3":e.codec="ac-3";break}l.audio={id:"audio",container:u,codec:e.codec,initSegment:e.segmentCodec==="mp3"&&o.mpeg?new Uint8Array(0):A.initSegment([e]),metadata:{channelCount:e.channelCount}},h&&(f=e.inputTimeScale,!c||f!==c.timescale?d=g=r[0].pts-Math.round(f*s):h=!1)}if(t.sps&&t.pps&&n.length){if(t.timescale=t.inputTimeScale,l.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:A.initSegment([t]),metadata:{width:t.width,height:t.height}},h)if(f=t.inputTimeScale,!c||f!==c.timescale){const m=this.getVideoStartPts(n),T=Math.round(f*s);g=Math.min(g,me(n[0].dts,m)-T),d=Math.min(d,m-T)}else h=!1;this.videoTrackConfig={width:t.width,height:t.height,pixelRatio:t.pixelRatio}}if(Object.keys(l).length)return this.ISGenerated=!0,h?(this._initPTS={baseTime:d,timescale:f},this._initDTS={baseTime:g,timescale:f}):d=f=void 0,{tracks:l,initPTS:d,timescale:f}}remuxVideo(e,t,s,i){const r=e.inputTimeScale,n=e.samples,o=[],l=n.length,c=this._initPTS;let h=this.nextAvcDts,u=8,d=this.videoSampleDuration,g,f,m=Number.POSITIVE_INFINITY,T=Number.NEGATIVE_INFINITY,E=!1;if(!s||h===null){const M=t*r,F=n[0].pts-me(n[0].dts,n[0].pts);Ve&&h!==null&&Math.abs(M-F-h)<15e3?s=!0:h=M-F}const x=c.baseTime*r/c.timescale;for(let M=0;M0?M-1:M].dts&&(E=!0)}E&&n.sort(function(M,F){const j=M.dts-F.dts,W=M.pts-F.pts;return j||W}),g=n[0].dts,f=n[n.length-1].dts;const y=f-g,I=y?Math.round(y/(l-1)):d||e.inputTimeScale/30;if(s){const M=g-h,F=M>I,j=M<-1;if((F||j)&&(F?v.warn(`AVC: ${Je(M,!0)} ms (${M}dts) hole between fragments detected at ${t.toFixed(3)}`):v.warn(`AVC: ${Je(-M,!0)} ms (${M}dts) overlapping between fragments detected at ${t.toFixed(3)}`),!j||h>=n[0].pts||Ve)){g=h;const W=n[0].pts-M;if(F)n[0].dts=g,n[0].pts=W;else for(let z=0;zW);z++)n[z].dts-=M,n[z].pts-=M;v.log(`Video: Initial PTS/DTS adjusted: ${Je(W,!0)}/${Je(g,!0)}, delta: ${Je(M,!0)} ms`)}}g=Math.max(0,g);let S=0,D=0,R=g;for(let M=0;M0?F.dts-n[M-1].dts:I;if(z=M>0?F.pts-n[M-1].pts:I,re.stretchShortVideoTrack&&this.nextAudioPts!==null){const fe=Math.floor(re.maxBufferHole*r),Qe=(i?m+i*r:this.nextAudioPts)-F.pts;Qe>fe?(d=Qe-le,d<0?d=le:w=!0,v.log(`[mp4-remuxer]: It is approximately ${Qe/90} ms to the next segment; using duration ${d/90} ms for the last video frame.`)):d=le}else d=le}const te=Math.round(F.pts-F.dts);V=Math.min(V,d),K=Math.max(K,d),P=Math.min(P,z),G=Math.max(G,z),o.push(new xi(F.key,d,W,te))}if(o.length){if(Ve){if(Ve<70){const M=o[0].flags;M.dependsOn=2,M.isNonSync=0}}else if(zt&&G-P0&&(i&&Math.abs(x-E)<9e3||Math.abs(me(m[0].pts-y,x)-E)<20*h),m.forEach(function(B){B.pts=me(B.pts-y,x)}),!s||E<0){if(m=m.filter(B=>B.pts>=0),!m.length)return;r===0?E=0:i&&!f?E=Math.max(0,x):E=m[0].pts}if(e.segmentCodec==="aac"){const B=this.config.maxAudioFramesDrift;for(let q=0,Q=E;q=B*h&&W0){R+=T;try{D=new Uint8Array(R)}catch(W){this.observer.emit(p.ERROR,p.ERROR,{type:$.MUX_ERROR,details:L.REMUX_ALLOC_ERROR,fatal:!1,error:W,bytes:R,reason:`fail allocating audio mdat ${R}`});return}d||(new DataView(D.buffer).setUint32(0,R),D.set(A.types.mdat,4))}else return;D.set(M,T);const j=M.byteLength;T+=j,g.push(new xi(!0,c,j,0)),S=F}const k=g.length;if(!k)return;const b=g[g.length-1];this.nextAudioPts=E=S+l*b.duration;const w=d?new Uint8Array(0):A.moof(e.sequenceNumber++,I/l,se({},e,{samples:g}));e.samples=[];const V=I/n,P=E/n,G={data1:w,data2:D,startPTS:V,endPTS:P,startDTS:V,endDTS:P,type:"audio",hasAudio:!0,hasVideo:!1,nb:k};return this.isAudioContiguous=!0,G}remuxEmptyAudio(e,t,s,i){const r=e.inputTimeScale,n=e.samplerate?e.samplerate:r,o=r/n,l=this.nextAudioPts,c=this._initDTS,h=c.baseTime*9e4/c.timescale,u=(l!==null?l:i.startDTS*r)+h,d=i.endDTS*r+h,g=o*yi,f=Math.ceil((d-u)/g),m=Ei.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);if(v.warn("[mp4-remuxer]: remux empty Audio"),!m){v.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}const T=[];for(let E=0;E4294967296;)a+=t;return a}function _o(a){for(let e=0;en.pts-o.pts);const r=a.samples;return a.samples=[],{samples:r}}class xi{constructor(e,t,s,i){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=t,this.size=s,this.cts=i,this.flags={isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:e?2:1,isNonSync:e?0:1}}}class wo{constructor(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=null,this.initTracks=void 0,this.lastEndTime=null}destroy(){}resetTimeStamp(e){this.initPTS=e,this.lastEndTime=null}resetNextTimestamp(){this.lastEndTime=null}resetInitSegment(e,t,s,i){this.audioCodec=t,this.videoCodec=s,this.generateInitSegment(Nn(e,i)),this.emitInitSegment=!0}generateInitSegment(e){let{audioCodec:t,videoCodec:s}=this;if(!(e!=null&&e.byteLength)){this.initTracks=void 0,this.initData=void 0;return}const i=this.initData=Qi(e);i.audio&&(t=Si(i.audio,X.AUDIO)),i.video&&(s=Si(i.video,X.VIDEO));const r={};i.audio&&i.video?r.audiovideo={container:"video/mp4",codec:t+","+s,initSegment:e,id:"main"}:i.audio?r.audio={container:"audio/mp4",codec:t,initSegment:e,id:"audio"}:i.video?r.video={container:"video/mp4",codec:s,initSegment:e,id:"main"}:v.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=r}remux(e,t,s,i,r,n){var o,l;let{initPTS:c,lastEndTime:h}=this;const u={audio:void 0,video:void 0,text:i,id3:s,initSegment:void 0};O(h)||(h=this.lastEndTime=r||0);const d=t.samples;if(!(d!=null&&d.length))return u;const g={initPTS:void 0,timescale:1};let f=this.initData;if((o=f)!=null&&o.length||(this.generateInitSegment(d),f=this.initData),!((l=f)!=null&&l.length))return v.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),u;this.emitInitSegment&&(g.tracks=this.initTracks,this.emitInitSegment=!1);const m=Bn(d,f),T=Un(f,d),E=T===null?r:T;(ko(c,E,r,m)||g.timescale!==c.timescale&&n)&&(g.initPTS=E-r,c&&c.timescale===1&&v.warn(`Adjusting initPTS by ${g.initPTS-c.baseTime}`),this.initPTS=c={baseTime:g.initPTS,timescale:1});const x=e?E-c.baseTime/c.timescale:h,y=x+m;Gn(f,d,c.baseTime/c.timescale),m>0?this.lastEndTime=y:(v.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const I=!!f.audio,S=!!f.video;let D="";I&&(D+="audio"),S&&(D+="video");const R={data1:d,startPTS:x,startDTS:x,endPTS:y,endDTS:y,type:D,hasAudio:I,hasVideo:S,nb:1,dropped:0};return u.audio=R.type==="audio"?R:void 0,u.video=R.type!=="audio"?R:void 0,u.initSegment=g,u.id3=Rr(s,r,c,c),i.samples.length&&(u.text=Ir(i,r,c)),u}}function ko(a,e,t,s){if(a===null)return!0;const i=Math.max(s,1),r=e-a.baseTime/a.timescale;return Math.abs(r-t)>i}function Si(a,e){const t=a==null?void 0:a.codec;if(t&&t.length>4)return t;if(e===X.AUDIO){if(t==="ec-3"||t==="ac-3"||t==="alac")return t;if(t==="fLaC"||t==="Opus")return Rt(t,!1);const s="mp4a.40.5";return v.info(`Parsed audio codec "${t}" or audio object type not handled. Using "${s}"`),s}return v.warn(`Unhandled video codec "${t}"`),t==="hvc1"||t==="hev1"?"hvc1.1.6.L120.90":t==="av01"?"av01.0.04M.08":"avc1.42e01e"}let _e;try{_e=self.performance.now.bind(self.performance)}catch{v.debug("Unable to use Performance API on this environment"),_e=qe==null?void 0:qe.Date.now}const Et=[{demux:To,remux:wo},{demux:Pe,remux:Tt},{demux:mo,remux:Tt},{demux:Lo,remux:Tt}];Et.splice(2,0,{demux:Eo,remux:Tt});class vi{constructor(e,t,s,i,r){this.async=!1,this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.observer=e,this.typeSupported=t,this.config=s,this.vendor=i,this.id=r}configure(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()}push(e,t,s,i){const r=s.transmuxing;r.executeStart=_e();let n=new Uint8Array(e);const{currentTransmuxState:o,transmuxConfig:l}=this;i&&(this.currentTransmuxState=i);const{contiguous:c,discontinuity:h,trackSwitch:u,accurateTimeOffset:d,timeOffset:g,initSegmentChange:f}=i||o,{audioCodec:m,videoCodec:T,defaultInitPts:E,duration:x,initSegmentData:y}=l,I=Po(n,t);if(I&&I.method==="AES-128"){const _=this.getDecrypter();if(_.isSync()){let k=_.softwareDecrypt(n,I.key.buffer,I.iv.buffer);if(s.part>-1&&(k=_.flush()),!k)return r.executeEnd=_e(),Xt(s);n=new Uint8Array(k)}else return this.decryptionPromise=_.webCryptoDecrypt(n,I.key.buffer,I.iv.buffer).then(k=>{const b=this.push(k,null,s);return this.decryptionPromise=null,b}),this.decryptionPromise}const S=this.needsProbing(h,u);if(S){const _=this.configureTransmuxer(n);if(_)return v.warn(`[transmuxer] ${_.message}`),this.observer.emit(p.ERROR,p.ERROR,{type:$.MEDIA_ERROR,details:L.FRAG_PARSING_ERROR,fatal:!1,error:_,reason:_.message}),r.executeEnd=_e(),Xt(s)}(h||u||f||S)&&this.resetInitSegment(y,m,T,x,t),(h||f||S)&&this.resetInitialTimestamp(E),c||this.resetContiguity();const D=this.transmux(n,I,g,d,s),R=this.currentTransmuxState;return R.contiguous=!0,R.discontinuity=!1,R.trackSwitch=!1,r.executeEnd=_e(),D}flush(e){const t=e.transmuxing;t.executeStart=_e();const{decrypter:s,currentTransmuxState:i,decryptionPromise:r}=this;if(r)return r.then(()=>this.flush(e));const n=[],{timeOffset:o}=i;if(s){const u=s.flush();u&&n.push(this.push(u,null,e))}const{demuxer:l,remuxer:c}=this;if(!l||!c)return t.executeEnd=_e(),[Xt(e)];const h=l.flush(o);return yt(h)?h.then(u=>(this.flushRemux(n,u,e),n)):(this.flushRemux(n,h,e),n)}flushRemux(e,t,s){const{audioTrack:i,videoTrack:r,id3Track:n,textTrack:o}=t,{accurateTimeOffset:l,timeOffset:c}=this.currentTransmuxState;v.log(`[transmuxer.ts]: Flushed fragment ${s.sn}${s.part>-1?" p: "+s.part:""} of level ${s.level}`);const h=this.remuxer.remux(i,r,n,o,c,l,!0,this.id);e.push({remuxResult:h,chunkMeta:s}),s.transmuxing.executeEnd=_e()}resetInitialTimestamp(e){const{demuxer:t,remuxer:s}=this;!t||!s||(t.resetTimeStamp(e),s.resetTimeStamp(e))}resetContiguity(){const{demuxer:e,remuxer:t}=this;!e||!t||(e.resetContiguity(),t.resetNextTimestamp())}resetInitSegment(e,t,s,i,r){const{demuxer:n,remuxer:o}=this;!n||!o||(n.resetInitSegment(e,t,s,i),o.resetInitSegment(e,t,s,r))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(e,t,s,i,r){let n;return t&&t.method==="SAMPLE-AES"?n=this.transmuxSampleAes(e,t,s,i,r):n=this.transmuxUnencrypted(e,s,i,r),n}transmuxUnencrypted(e,t,s,i){const{audioTrack:r,videoTrack:n,id3Track:o,textTrack:l}=this.demuxer.demux(e,t,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(r,n,o,l,t,s,!1,this.id),chunkMeta:i}}transmuxSampleAes(e,t,s,i,r){return this.demuxer.demuxSampleAes(e,t,s).then(n=>({remuxResult:this.remuxer.remux(n.audioTrack,n.videoTrack,n.id3Track,n.textTrack,s,i,!1,this.id),chunkMeta:r}))}configureTransmuxer(e){const{config:t,observer:s,typeSupported:i,vendor:r}=this;let n;for(let d=0,g=Et.length;d0&&(e==null?void 0:e.key)!=null&&e.iv!==null&&e.method!=null&&(t=e),t}const Xt=a=>({remuxResult:{},chunkMeta:a});function yt(a){return"then"in a&&a.then instanceof Function}class Fo{constructor(e,t,s,i,r){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=e,this.videoCodec=t,this.initSegmentData=s,this.duration=i,this.defaultInitPts=r||null}}class Oo{constructor(e,t,s,i,r,n){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.initSegmentChange=void 0,this.discontinuity=e,this.contiguous=t,this.accurateTimeOffset=s,this.trackSwitch=i,this.timeOffset=r,this.initSegmentChange=n}}var br={exports:{}};(function(a){var e=Object.prototype.hasOwnProperty,t="~";function s(){}Object.create&&(s.prototype=Object.create(null),new s().__proto__||(t=!1));function i(l,c,h){this.fn=l,this.context=c,this.once=h||!1}function r(l,c,h,u,d){if(typeof h!="function")throw new TypeError("The listener must be a function");var g=new i(h,u||l,d),f=t?t+c:c;return l._events[f]?l._events[f].fn?l._events[f]=[l._events[f],g]:l._events[f].push(g):(l._events[f]=g,l._eventsCount++),l}function n(l,c){--l._eventsCount===0?l._events=new s:delete l._events[c]}function o(){this._events=new s,this._eventsCount=0}o.prototype.eventNames=function(){var c=[],h,u;if(this._eventsCount===0)return c;for(u in h=this._events)e.call(h,u)&&c.push(t?u.slice(1):u);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(h)):c},o.prototype.listeners=function(c){var h=t?t+c:c,u=this._events[h];if(!u)return[];if(u.fn)return[u.fn];for(var d=0,g=u.length,f=new Array(g);d{h=h||{},h.frag=this.frag,h.id=this.id,c===p.ERROR&&(this.error=h.error),this.hls.trigger(c,h)};this.observer=new Ps,this.observer.on(p.FRAG_DECRYPTED,n),this.observer.on(p.ERROR,n);const o=Ue(r.preferManagedMediaSource)||{isTypeSupported:()=>!1},l={mpeg:o.isTypeSupported("audio/mpeg"),mp3:o.isTypeSupported('audio/mp4; codecs="mp3"'),ac3:o.isTypeSupported('audio/mp4; codecs="ac-3"')};if(this.useWorker&&typeof Worker<"u"&&(r.workerPath||eo())){try{r.workerPath?(v.log(`loading Web Worker ${r.workerPath} for "${t}"`),this.workerContext=so(r.workerPath)):(v.log(`injecting Web Worker for "${t}"`),this.workerContext=to()),this.onwmsg=u=>this.onWorkerMessage(u);const{worker:h}=this.workerContext;h.addEventListener("message",this.onwmsg),h.onerror=u=>{const d=new Error(`${u.message} (${u.filename}:${u.lineno})`);r.enableWorker=!1,v.warn(`Error in "${t}" Web Worker, fallback to inline`),this.hls.trigger(p.ERROR,{type:$.OTHER_ERROR,details:L.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:d})},h.postMessage({cmd:"init",typeSupported:l,vendor:"",id:t,config:JSON.stringify(r)})}catch(h){v.warn(`Error setting up "${t}" Web Worker, fallback to inline`,h),this.resetWorker(),this.error=null,this.transmuxer=new vi(this.observer,l,r,"",t)}return}this.transmuxer=new vi(this.observer,l,r,"",t)}resetWorker(){if(this.workerContext){const{worker:e,objectURL:t}=this.workerContext;t&&self.URL.revokeObjectURL(t),e.removeEventListener("message",this.onwmsg),e.onerror=null,e.terminate(),this.workerContext=null}}destroy(){if(this.workerContext)this.resetWorker(),this.onwmsg=void 0;else{const t=this.transmuxer;t&&(t.destroy(),this.transmuxer=null)}const e=this.observer;e&&e.removeAllListeners(),this.frag=null,this.observer=null,this.hls=null}push(e,t,s,i,r,n,o,l,c,h){var u,d;c.transmuxing.start=self.performance.now();const{transmuxer:g}=this,f=n?n.start:r.start,m=r.decryptdata,T=this.frag,E=!(T&&r.cc===T.cc),x=!(T&&c.level===T.level),y=T?c.sn-T.sn:-1,I=this.part?c.part-this.part.index:-1,S=y===0&&c.id>1&&c.id===(T==null?void 0:T.stats.chunkCount),D=!x&&(y===1||y===0&&(I===1||S&&I<=0)),R=self.performance.now();(x||y||r.stats.parsing.start===0)&&(r.stats.parsing.start=R),n&&(I||!D)&&(n.stats.parsing.start=R);const _=!(T&&((u=r.initSegment)==null?void 0:u.url)===((d=T.initSegment)==null?void 0:d.url)),k=new Oo(E,D,l,x,f,_);if(!D||E||_){v.log(`[transmuxer-interface, ${r.type}]: Starting new transmux session for sn: ${c.sn} p: ${c.part} level: ${c.level} id: ${c.id} + discontinuity: ${E} + trackSwitch: ${x} + contiguous: ${D} + accurateTimeOffset: ${l} + timeOffset: ${f} + initSegmentChange: ${_}`);const b=new Fo(s,i,t,o,h);this.configureTransmuxer(b)}if(this.frag=r,this.part=n,this.workerContext)this.workerContext.worker.postMessage({cmd:"demux",data:e,decryptdata:m,chunkMeta:c,state:k},e instanceof ArrayBuffer?[e]:[]);else if(g){const b=g.push(e,m,c,k);yt(b)?(g.async=!0,b.then(w=>{this.handleTransmuxComplete(w)}).catch(w=>{this.transmuxerError(w,c,"transmuxer-interface push error")})):(g.async=!1,this.handleTransmuxComplete(b))}}flush(e){e.transmuxing.start=self.performance.now();const{transmuxer:t}=this;if(this.workerContext)this.workerContext.worker.postMessage({cmd:"flush",chunkMeta:e});else if(t){let s=t.flush(e);yt(s)||t.async?(yt(s)||(s=Promise.resolve(s)),s.then(r=>{this.handleFlushResult(r,e)}).catch(r=>{this.transmuxerError(r,e,"transmuxer-interface flush error")})):this.handleFlushResult(s,e)}}transmuxerError(e,t,s){this.hls&&(this.error=e,this.hls.trigger(p.ERROR,{type:$.MEDIA_ERROR,details:L.FRAG_PARSING_ERROR,chunkMeta:t,frag:this.frag||void 0,fatal:!1,error:e,err:e,reason:s}))}handleFlushResult(e,t){e.forEach(s=>{this.handleTransmuxComplete(s)}),this.onFlush(t)}onWorkerMessage(e){const t=e.data;if(!(t!=null&&t.event)){v.warn(`worker message received with no ${t?"event name":"data"}`);return}const s=this.hls;if(this.hls)switch(t.event){case"init":{var i;const r=(i=this.workerContext)==null?void 0:i.objectURL;r&&self.URL.revokeObjectURL(r);break}case"transmuxComplete":{this.handleTransmuxComplete(t.data);break}case"flush":{this.onFlush(t.data);break}case"workerLog":v[t.data.logType]&&v[t.data.logType](t.data.message);break;default:{t.data=t.data||{},t.data.frag=this.frag,t.data.id=this.id,s.trigger(t.event,t.data);break}}}configureTransmuxer(e){const{transmuxer:t}=this;this.workerContext?this.workerContext.worker.postMessage({cmd:"configure",config:e}):t&&t.configure(e)}handleTransmuxComplete(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)}}function Cr(a,e){if(a.length!==e.length)return!1;for(let t=0;ta[i]!==e[i])}function gs(a,e){return e.label.toLowerCase()===a.name.toLowerCase()&&(!e.language||e.language.toLowerCase()===(a.lang||"").toLowerCase())}const Ai=100;class No extends Ds{constructor(e,t,s){super(e,t,s,"[audio-stream-controller]",U.AUDIO),this.videoBuffer=null,this.videoTrackCC=-1,this.waitingVideoCC=-1,this.bufferedTrack=null,this.switchingTrack=null,this.trackId=-1,this.waitingData=null,this.mainDetails=null,this.flushing=!1,this.bufferFlushed=!1,this.cachedTrackLoadedData=null,this._registerListeners()}onHandlerDestroying(){this._unregisterListeners(),super.onHandlerDestroying(),this.mainDetails=null,this.bufferedTrack=null,this.switchingTrack=null}_registerListeners(){const{hls:e}=this;e.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.LEVEL_LOADED,this.onLevelLoaded,this),e.on(p.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.on(p.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(p.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(p.ERROR,this.onError,this),e.on(p.BUFFER_RESET,this.onBufferReset,this),e.on(p.BUFFER_CREATED,this.onBufferCreated,this),e.on(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(p.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(p.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(p.FRAG_BUFFERED,this.onFragBuffered,this)}_unregisterListeners(){const{hls:e}=this;e.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.LEVEL_LOADED,this.onLevelLoaded,this),e.off(p.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.off(p.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(p.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(p.ERROR,this.onError,this),e.off(p.BUFFER_RESET,this.onBufferReset,this),e.off(p.BUFFER_CREATED,this.onBufferCreated,this),e.off(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(p.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(p.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(p.FRAG_BUFFERED,this.onFragBuffered,this)}onInitPtsFound(e,{frag:t,id:s,initPTS:i,timescale:r}){if(s==="main"){const n=t.cc;this.initPTS[t.cc]={baseTime:i,timescale:r},this.log(`InitPTS for cc: ${n} found from main: ${i}`),this.videoTrackCC=n,this.state===C.WAITING_INIT_PTS&&this.tick()}}startLoad(e){if(!this.levels){this.startPosition=e,this.state=C.STOPPED;return}const t=this.lastCurrentTime;this.stopLoad(),this.setInterval(Ai),t>0&&e===-1?(this.log(`Override startPosition with lastCurrentTime @${t.toFixed(3)}`),e=t,this.state=C.IDLE):(this.loadedmetadata=!1,this.state=C.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}doTick(){switch(this.state){case C.IDLE:this.doTickIdle();break;case C.WAITING_TRACK:{var e;const{levels:s,trackId:i}=this,r=s==null||(e=s[i])==null?void 0:e.details;if(r){if(this.waitForCdnTuneIn(r))break;this.state=C.WAITING_INIT_PTS}break}case C.FRAG_LOADING_WAITING_RETRY:{var t;const s=performance.now(),i=this.retryDate;if(!i||s>=i||(t=this.media)!=null&&t.seeking){const{levels:r,trackId:n}=this;this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded((r==null?void 0:r[n])||null),this.state=C.IDLE}break}case C.WAITING_INIT_PTS:{const s=this.waitingData;if(s){const{frag:i,part:r,cache:n,complete:o}=s;if(this.initPTS[i.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=C.FRAG_LOADING;const l=n.flush(),c={frag:i,part:r,payload:l,networkDetails:null};this._handleFragmentLoadProgress(c),o&&super._handleFragmentLoadComplete(c)}else if(this.videoTrackCC!==this.waitingVideoCC)this.log(`Waiting fragment cc (${i.cc}) cancelled because video is at cc ${this.videoTrackCC}`),this.clearWaitingFragment();else{const l=this.getLoadPosition(),c=J.bufferInfo(this.mediaBuffer,l,this.config.maxBufferHole);ds(c.end,this.config.maxFragLookUpTolerance,i)<0&&(this.log(`Waiting fragment cc (${i.cc}) @ ${i.start} cancelled because another fragment at ${c.end} is needed`),this.clearWaitingFragment())}}else this.state=C.IDLE}}this.onTickEnd()}clearWaitingFragment(){const e=this.waitingData;e&&(this.fragmentTracker.removeFragment(e.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=C.IDLE)}resetLoadingState(){this.clearWaitingFragment(),super.resetLoadingState()}onTickEnd(){const{media:e}=this;e!=null&&e.readyState&&(this.lastCurrentTime=e.currentTime)}doTickIdle(){const{hls:e,levels:t,media:s,trackId:i}=this,r=e.config;if(!s&&(this.startFragRequested||!r.startFragPrefetch)||!(t!=null&&t[i]))return;const n=t[i],o=n.details;if(!o||o.live&&this.levelLastLoaded!==n||this.waitForCdnTuneIn(o)){this.state=C.WAITING_TRACK;return}const l=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&l&&(this.bufferFlushed=!1,this.afterBufferFlushed(l,X.AUDIO,U.AUDIO));const c=this.getFwdBufferInfo(l,U.AUDIO);if(c===null)return;const{bufferedTrack:h,switchingTrack:u}=this;if(!u&&this._streamEnded(c,o)){e.trigger(p.BUFFER_EOS,{type:"audio"}),this.state=C.ENDED;return}const d=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,U.MAIN),g=c.len,f=this.getMaxBufferLength(d==null?void 0:d.len),m=o.fragments,T=m[0].start;let E=this.flushing?this.getLoadPosition():c.end;if(u&&s){const S=this.getLoadPosition();h&&!ze(u.attrs,h.attrs)&&(E=S),o.PTSKnown&&ST||c.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),s.currentTime=T+.05)}if(g>=f&&!u&&Ed.end+o.targetduration;if(I||!(d!=null&&d.len)&&c.len){const S=this.getAppendedFrag(x.start,U.MAIN);if(S===null||(y||(y=!!S.gap||!!I&&d.len===0),I&&!y||y&&c.nextStart&&c.nextStartnew je(s))}onAudioTrackSwitching(e,t){const s=!!t.url;this.trackId=t.id;const{fragCurrent:i}=this;i&&(i.abortRequests(),this.removeUnbufferedFrags(i.start)),this.resetLoadingState(),s?this.setInterval(Ai):this.resetTransmuxer(),s?(this.switchingTrack=t,this.state=C.IDLE,this.flushAudioIfNeeded(t)):(this.switchingTrack=null,this.bufferedTrack=t,this.state=C.STOPPED),this.tick()}onManifestLoading(){this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=this.flushing=!1,this.levels=this.mainDetails=this.waitingData=this.bufferedTrack=this.cachedTrackLoadedData=this.switchingTrack=null,this.startFragRequested=!1,this.trackId=this.videoTrackCC=this.waitingVideoCC=-1}onLevelLoaded(e,t){this.mainDetails=t.details,this.cachedTrackLoadedData!==null&&(this.hls.trigger(p.AUDIO_TRACK_LOADED,this.cachedTrackLoadedData),this.cachedTrackLoadedData=null)}onAudioTrackLoaded(e,t){var s;if(this.mainDetails==null){this.cachedTrackLoadedData=t;return}const{levels:i}=this,{details:r,id:n}=t;if(!i){this.warn(`Audio tracks were reset while loading level ${n}`);return}this.log(`Audio track ${n} loaded [${r.startSN},${r.endSN}]${r.lastPartSn?`[part-${r.lastPartSn}-${r.lastPartIndex}]`:""},duration:${r.totalduration}`);const o=i[n];let l=0;if(r.live||(s=o.details)!=null&&s.live){this.checkLiveUpdate(r);const h=this.mainDetails;if(r.deltaUpdateFailed||!h)return;if(!o.details&&r.hasProgramDateTime&&h.hasProgramDateTime)_t(r,h),l=r.fragments[0].start;else{var c;l=this.alignPlaylists(r,o.details,(c=this.levelLastLoaded)==null?void 0:c.details)}}o.details=r,this.levelLastLoaded=o,!this.startFragRequested&&(this.mainDetails||!r.live)&&this.setStartPosition(this.mainDetails||r,l),this.state===C.WAITING_TRACK&&!this.waitForCdnTuneIn(r)&&(this.state=C.IDLE),this.tick()}_handleFragmentLoadProgress(e){var t;const{frag:s,part:i,payload:r}=e,{config:n,trackId:o,levels:l}=this;if(!l){this.warn(`Audio tracks were reset while fragment load was in progress. Fragment ${s.sn} of level ${s.level} will not be buffered`);return}const c=l[o];if(!c){this.warn("Audio track is undefined on fragment load progress");return}const h=c.details;if(!h){this.warn("Audio track details undefined on fragment load progress"),this.removeUnbufferedFrags(s.start);return}const u=n.defaultAudioCodec||c.audioCodec||"mp4a.40.2";let d=this.transmuxer;d||(d=this.transmuxer=new Dr(this.hls,U.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const g=this.initPTS[s.cc],f=(t=s.initSegment)==null?void 0:t.data;if(g!==void 0){const T=i?i.index:-1,E=T!==-1,x=new Is(s.level,s.sn,s.stats.chunkCount,r.byteLength,T,E);d.push(r,f,u,"",s,i,h.totalduration,!1,x,g)}else{this.log(`Unknown video PTS for cc ${s.cc}, waiting for video PTS before demuxing audio frag ${s.sn} of [${h.startSN} ,${h.endSN}],track ${o}`);const{cache:m}=this.waitingData=this.waitingData||{frag:s,part:i,cache:new dr,complete:!1};m.push(new Uint8Array(r)),this.waitingVideoCC=this.videoTrackCC,this.state=C.WAITING_INIT_PTS}}_handleFragmentLoadComplete(e){if(this.waitingData){this.waitingData.complete=!0;return}super._handleFragmentLoadComplete(e)}onBufferReset(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1}onBufferCreated(e,t){const s=t.tracks.audio;s&&(this.mediaBuffer=s.buffer||null),t.tracks.video&&(this.videoBuffer=t.tracks.video.buffer||null)}onFragBuffered(e,t){const{frag:s,part:i}=t;if(s.type!==U.AUDIO){if(!this.loadedmetadata&&s.type===U.MAIN){const r=this.videoBuffer||this.media;r&&J.getBuffered(r).length&&(this.loadedmetadata=!0)}return}if(this.fragContextChanged(s)){this.warn(`Fragment ${s.sn}${i?" p: "+i.index:""} of level ${s.level} finished buffering, but was aborted. state: ${this.state}, audioSwitch: ${this.switchingTrack?this.switchingTrack.name:"false"}`);return}if(s.sn!=="initSegment"){this.fragPrevious=s;const r=this.switchingTrack;r&&(this.bufferedTrack=r,this.switchingTrack=null,this.hls.trigger(p.AUDIO_TRACK_SWITCHED,oe({},r)))}this.fragBufferedComplete(s,i)}onError(e,t){var s;if(t.fatal){this.state=C.ERROR;return}switch(t.details){case L.FRAG_GAP:case L.FRAG_PARSING_ERROR:case L.FRAG_DECRYPT_ERROR:case L.FRAG_LOAD_ERROR:case L.FRAG_LOAD_TIMEOUT:case L.KEY_LOAD_ERROR:case L.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(U.AUDIO,t);break;case L.AUDIO_TRACK_LOAD_ERROR:case L.AUDIO_TRACK_LOAD_TIMEOUT:case L.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===C.WAITING_TRACK&&((s=t.context)==null?void 0:s.type)===Y.AUDIO_TRACK&&(this.state=C.IDLE);break;case L.BUFFER_APPEND_ERROR:case L.BUFFER_FULL_ERROR:if(!t.parent||t.parent!=="audio")return;if(t.details===L.BUFFER_APPEND_ERROR){this.resetLoadingState();return}this.reduceLengthAndFlushBuffer(t)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case L.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onBufferFlushing(e,{type:t}){t!==X.VIDEO&&(this.flushing=!0)}onBufferFlushed(e,{type:t}){if(t!==X.VIDEO){this.flushing=!1,this.bufferFlushed=!0,this.state===C.ENDED&&(this.state=C.IDLE);const s=this.mediaBuffer||this.media;s&&(this.afterBufferFlushed(s,t,U.AUDIO),this.tick())}}_handleTransmuxComplete(e){var t;const s="audio",{hls:i}=this,{remuxResult:r,chunkMeta:n}=e,o=this.getCurrentContext(n);if(!o){this.resetWhenMissingContext(n);return}const{frag:l,part:c,level:h}=o,{details:u}=h,{audio:d,text:g,id3:f,initSegment:m}=r;if(this.fragContextChanged(l)||!u){this.fragmentTracker.removeFragment(l);return}if(this.state=C.PARSING,this.switchingTrack&&d&&this.completeAudioSwitch(this.switchingTrack),m!=null&&m.tracks){const T=l.initSegment||l;this._bufferInitSegment(h,m.tracks,T,n),i.trigger(p.FRAG_PARSING_INIT_SEGMENT,{frag:T,id:s,tracks:m.tracks})}if(d){const{startPTS:T,endPTS:E,startDTS:x,endDTS:y}=d;c&&(c.elementaryStreams[X.AUDIO]={startPTS:T,endPTS:E,startDTS:x,endDTS:y}),l.setElementaryStreamInfo(X.AUDIO,T,E,x,y),this.bufferFragmentData(d,l,c,n)}if(f!=null&&(t=f.samples)!=null&&t.length){const T=se({id:s,frag:l,details:u},f);i.trigger(p.FRAG_PARSING_METADATA,T)}if(g){const T=se({id:s,frag:l,details:u},g);i.trigger(p.FRAG_PARSING_USERDATA,T)}}_bufferInitSegment(e,t,s,i){if(this.state!==C.PARSING)return;t.video&&delete t.video;const r=t.audio;if(!r)return;r.id="audio";const n=e.audioCodec;this.log(`Init audio buffer, container:${r.container}, codecs[level/parsed]=[${n}/${r.codec}]`),n&&n.split(",").length===1&&(r.levelCodec=n),this.hls.trigger(p.BUFFER_CODECS,t);const o=r.initSegment;if(o!=null&&o.byteLength){const l={type:"audio",frag:s,part:null,chunkMeta:i,parent:s.type,data:o};this.hls.trigger(p.BUFFER_APPENDING,l)}this.tickImmediate()}loadFragment(e,t,s){const i=this.fragmentTracker.getState(e);if(this.fragCurrent=e,this.switchingTrack||i===ae.NOT_LOADED||i===ae.PARTIAL){var r;if(e.sn==="initSegment")this._loadInitSegment(e,t);else if((r=t.details)!=null&&r.live&&!this.initPTS[e.cc]){this.log(`Waiting for video PTS in continuity counter ${e.cc} of live stream before loading audio fragment ${e.sn} of level ${this.trackId}`),this.state=C.WAITING_INIT_PTS;const n=this.mainDetails;n&&n.fragments[0].start!==t.details.fragments[0].start&&_t(t.details,n)}else this.startFragRequested=!0,super.loadFragment(e,t,s)}else this.clearTrackerIfNeeded(e)}flushAudioIfNeeded(e){const{media:t,bufferedTrack:s}=this,i=s==null?void 0:s.attrs,r=e.attrs;t&&i&&(i.CHANNELS!==r.CHANNELS||s.name!==e.name||s.lang!==e.lang)&&(this.log("Switching audio track : flushing all audio"),super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"),this.bufferedTrack=null)}completeAudioSwitch(e){const{hls:t}=this;this.flushAudioIfNeeded(e),this.bufferedTrack=e,this.switchingTrack=null,t.trigger(p.AUDIO_TRACK_SWITCHED,oe({},e))}}class Uo extends Rs{constructor(e){super(e,"[audio-track-controller]"),this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.registerListeners()}registerListeners(){const{hls:e}=this;e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_PARSED,this.onManifestParsed,this),e.on(p.LEVEL_LOADING,this.onLevelLoading,this),e.on(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(p.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(p.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_PARSED,this.onManifestParsed,this),e.off(p.LEVEL_LOADING,this.onLevelLoading,this),e.off(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(p.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(p.ERROR,this.onError,this)}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,super.destroy()}onManifestLoading(){this.tracks=[],this.tracksInGroup=[],this.groupIds=null,this.currentTrack=null,this.trackId=-1,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.audioTracks||[]}onAudioTrackLoaded(e,t){const{id:s,groupId:i,details:r}=t,n=this.tracksInGroup[s];if(!n||n.groupId!==i){this.warn(`Audio track with id:${s} and group:${i} not found in active group ${n==null?void 0:n.groupId}`);return}const o=n.details;n.details=t.details,this.log(`Audio track ${s} "${n.name}" lang:${n.lang} group:${i} loaded [${r.startSN}-${r.endSN}]`),s===this.trackId&&this.playlistLoaded(s,t,o)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const s=t.audioGroups||null,i=this.groupIds;let r=this.currentTrack;if(!s||(i==null?void 0:i.length)!==(s==null?void 0:s.length)||s!=null&&s.some(o=>(i==null?void 0:i.indexOf(o))===-1)){this.groupIds=s,this.trackId=-1,this.currentTrack=null;const o=this.tracks.filter(d=>!s||s.indexOf(d.groupId)!==-1);if(o.length)this.selectDefaultTrack&&!o.some(d=>d.default)&&(this.selectDefaultTrack=!1),o.forEach((d,g)=>{d.id=g});else if(!r&&!this.tracksInGroup.length)return;this.tracksInGroup=o;const l=this.hls.config.audioPreference;if(!r&&l){const d=Le(l,o,$e);if(d>-1)r=o[d];else{const g=Le(l,this.tracks);r=this.tracks[g]}}let c=this.findTrackId(r);c===-1&&r&&(c=this.findTrackId(null));const h={audioTracks:o};this.log(`Updating audio tracks, ${o.length} track(s) found in group(s): ${s==null?void 0:s.join(",")}`),this.hls.trigger(p.AUDIO_TRACKS_UPDATED,h);const u=this.trackId;if(c!==-1&&u===-1)this.setAudioTrack(c);else if(o.length&&u===-1){var n;const d=new Error(`No audio track selected for current audio group-ID(s): ${(n=this.groupIds)==null?void 0:n.join(",")} track count: ${o.length}`);this.warn(d.message),this.hls.trigger(p.ERROR,{type:$.MEDIA_ERROR,details:L.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:d})}}else this.shouldReloadPlaylist(r)&&this.setAudioTrack(this.trackId)}onError(e,t){t.fatal||!t.context||t.context.type===Y.AUDIO_TRACK&&t.context.id===this.trackId&&(!this.groupIds||this.groupIds.indexOf(t.context.groupId)!==-1)&&(this.requestScheduled=-1,this.checkRetry(t))}get allAudioTracks(){return this.tracks}get audioTracks(){return this.tracksInGroup}get audioTrack(){return this.trackId}set audioTrack(e){this.selectDefaultTrack=!1,this.setAudioTrack(e)}setAudioOption(e){const t=this.hls;if(t.config.audioPreference=e,e){const s=this.allAudioTracks;if(this.selectDefaultTrack=!1,s.length){const i=this.currentTrack;if(i&&We(e,i,$e))return i;const r=Le(e,this.tracksInGroup,$e);if(r>-1){const n=this.tracksInGroup[r];return this.setAudioTrack(r),n}else if(i){let n=t.loadLevel;n===-1&&(n=t.firstAutoLevel);const o=Na(e,t.levels,s,n,$e);if(o===-1)return null;t.nextLoadLevel=o}if(e.channels||e.audioCodec){const n=Le(e,s);if(n>-1)return s[n]}}}return null}setAudioTrack(e){const t=this.tracksInGroup;if(e<0||e>=t.length){this.warn(`Invalid audio track id: ${e}`);return}this.clearTimer(),this.selectDefaultTrack=!1;const s=this.currentTrack,i=t[e],r=i.details&&!i.details.live;if(e===this.trackId&&i===s&&r||(this.log(`Switching to audio-track ${e} "${i.name}" lang:${i.lang} group:${i.groupId} channels:${i.channels}`),this.trackId=e,this.currentTrack=i,this.hls.trigger(p.AUDIO_TRACK_SWITCHING,oe({},i)),r))return;const n=this.switchParams(i.url,s==null?void 0:s.details,i.details);this.loadPlaylist(n)}findTrackId(e){const t=this.tracksInGroup;for(let s=0;s=r[c].start&&o<=r[c].end){n=r[c];break}const l=s.start+s.duration;n?n.end=l:(n={start:o,end:l},r.push(n)),this.fragmentTracker.fragBuffered(s),this.fragBufferedComplete(s,null)}onBufferFlushing(e,t){const{startOffset:s,endOffset:i}=t;if(s===0&&i!==Number.POSITIVE_INFINITY){const r=i-1;if(r<=0)return;t.endOffsetSubtitles=Math.max(0,r),this.tracksBuffered.forEach(n=>{for(let o=0;onew je(s));return}this.tracksBuffered=[],this.levels=t.map(s=>{const i=new je(s);return this.tracksBuffered[i.id]=[],i}),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,U.SUBTITLE),this.fragPrevious=null,this.mediaBuffer=null}onSubtitleTrackSwitch(e,t){var s;if(this.currentTrackId=t.id,!((s=this.levels)!=null&&s.length)||this.currentTrackId===-1){this.clearInterval();return}const i=this.levels[this.currentTrackId];i!=null&&i.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,i&&this.setInterval(Li)}onSubtitleTrackLoaded(e,t){var s;const{currentTrackId:i,levels:r}=this,{details:n,id:o}=t;if(!r){this.warn(`Subtitle tracks were reset while loading level ${o}`);return}const l=r[o];if(o>=r.length||!l)return;this.log(`Subtitle track ${o} loaded [${n.startSN},${n.endSN}]${n.lastPartSn?`[part-${n.lastPartSn}-${n.lastPartIndex}]`:""},duration:${n.totalduration}`),this.mediaBuffer=this.mediaBufferTimeRanges;let c=0;if(n.live||(s=l.details)!=null&&s.live){const u=this.mainDetails;if(n.deltaUpdateFailed||!u)return;const d=u.fragments[0];if(!l.details)n.hasProgramDateTime&&u.hasProgramDateTime?(_t(n,u),c=n.fragments[0].start):d&&(c=d.start,us(n,c));else{var h;c=this.alignPlaylists(n,l.details,(h=this.levelLastLoaded)==null?void 0:h.details),c===0&&d&&(c=d.start,us(n,c))}}l.details=n,this.levelLastLoaded=l,o===i&&(!this.startFragRequested&&(this.mainDetails||!n.live)&&this.setStartPosition(this.mainDetails||n,c),this.tick(),n.live&&!this.fragCurrent&&this.media&&this.state===C.IDLE&&(Ct(null,n.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),l.details=void 0)))}_handleFragmentLoadComplete(e){const{frag:t,payload:s}=e,i=t.decryptdata,r=this.hls;if(!this.fragContextChanged(t)&&s&&s.byteLength>0&&i!=null&&i.key&&i.iv&&i.method==="AES-128"){const n=performance.now();this.decrypter.decrypt(new Uint8Array(s),i.key.buffer,i.iv.buffer).catch(o=>{throw r.trigger(p.ERROR,{type:$.MEDIA_ERROR,details:L.FRAG_DECRYPT_ERROR,fatal:!1,error:o,reason:o.message,frag:t}),o}).then(o=>{const l=performance.now();r.trigger(p.FRAG_DECRYPTED,{frag:t,payload:o,stats:{tstart:n,tdecrypt:l}})}).catch(o=>{this.warn(`${o.name}: ${o.message}`),this.state=C.IDLE})}}doTick(){if(!this.media){this.state=C.IDLE;return}if(this.state===C.IDLE){const{currentTrackId:e,levels:t}=this,s=t==null?void 0:t[e];if(!s||!t.length||!s.details)return;const{config:i}=this,r=this.getLoadPosition(),n=J.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],r,i.maxBufferHole),{end:o,len:l}=n,c=this.getFwdBufferInfo(this.media,U.MAIN),h=s.details,u=this.getMaxBufferLength(c==null?void 0:c.len)+h.levelTargetDuration;if(l>u)return;const d=h.fragments,g=d.length,f=h.edge;let m=null;const T=this.fragPrevious;if(of-E?0:E;m=Ct(T,d,Math.max(d[0].start,o),x),!m&&T&&T.start{if(i=i>>>0,i>r-1)throw new DOMException(`Failed to execute '${s}' on 'TimeRanges': The index provided (${i}) is greater than the maximum bound (${r})`);return e[i][s]};this.buffered={get length(){return e.length},end(s){return t("end",s,e.length)},start(s){return t("start",s,e.length)}}}}class Go extends Rs{constructor(e){super(e,"[subtitle-track-controller]"),this.media=null,this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.queuedDefaultTrack=-1,this.asyncPollTrackChange=()=>this.pollTrackChange(0),this.useTextTrackPolling=!1,this.subtitlePollingInterval=-1,this._subtitleDisplay=!0,this.onTextTracksChanged=()=>{if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;let t=null;const s=gt(this.media.textTracks);for(let r=0;r-1&&this.toggleTrackModes()}registerListeners(){const{hls:e}=this;e.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_PARSED,this.onManifestParsed,this),e.on(p.LEVEL_LOADING,this.onLevelLoading,this),e.on(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(p.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(p.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_PARSED,this.onManifestParsed,this),e.off(p.LEVEL_LOADING,this.onLevelLoading,this),e.off(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(p.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(p.ERROR,this.onError,this)}onMediaAttached(e,t){this.media=t.media,this.media&&(this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange))}pollTrackChange(e){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.onTextTracksChanged,e)}onMediaDetaching(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),gt(this.media.textTracks).forEach(t=>{He(t)}),this.subtitleTrack=-1,this.media=null}onManifestLoading(){this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.subtitleTracks}onSubtitleTrackLoaded(e,t){const{id:s,groupId:i,details:r}=t,n=this.tracksInGroup[s];if(!n||n.groupId!==i){this.warn(`Subtitle track with id:${s} and group:${i} not found in active group ${n==null?void 0:n.groupId}`);return}const o=n.details;n.details=t.details,this.log(`Subtitle track ${s} "${n.name}" lang:${n.lang} group:${i} loaded [${r.startSN}-${r.endSN}]`),s===this.trackId&&this.playlistLoaded(s,t,o)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const s=t.subtitleGroups||null,i=this.groupIds;let r=this.currentTrack;if(!s||(i==null?void 0:i.length)!==(s==null?void 0:s.length)||s!=null&&s.some(n=>(i==null?void 0:i.indexOf(n))===-1)){this.groupIds=s,this.trackId=-1,this.currentTrack=null;const n=this.tracks.filter(h=>!s||s.indexOf(h.groupId)!==-1);if(n.length)this.selectDefaultTrack&&!n.some(h=>h.default)&&(this.selectDefaultTrack=!1),n.forEach((h,u)=>{h.id=u});else if(!r&&!this.tracksInGroup.length)return;this.tracksInGroup=n;const o=this.hls.config.subtitlePreference;if(!r&&o){this.selectDefaultTrack=!1;const h=Le(o,n);if(h>-1)r=n[h];else{const u=Le(o,this.tracks);r=this.tracks[u]}}let l=this.findTrackId(r);l===-1&&r&&(l=this.findTrackId(null));const c={subtitleTracks:n};this.log(`Updating subtitle tracks, ${n.length} track(s) found in "${s==null?void 0:s.join(",")}" group-id`),this.hls.trigger(p.SUBTITLE_TRACKS_UPDATED,c),l!==-1&&this.trackId===-1&&this.setSubtitleTrack(l)}else this.shouldReloadPlaylist(r)&&this.setSubtitleTrack(this.trackId)}findTrackId(e){const t=this.tracksInGroup,s=this.selectDefaultTrack;for(let i=0;i-1){const r=this.tracksInGroup[i];return this.setSubtitleTrack(i),r}else{if(s)return null;{const r=Le(e,t);if(r>-1)return t[r]}}}}return null}loadPlaylist(e){super.loadPlaylist();const t=this.currentTrack;if(this.shouldLoadPlaylist(t)&&t){const s=t.id,i=t.groupId;let r=t.url;if(e)try{r=e.addDirectives(r)}catch(n){this.warn(`Could not construct new URL with HLS Delivery Directives: ${n}`)}this.log(`Loading subtitle playlist for id ${s}`),this.hls.trigger(p.SUBTITLE_TRACK_LOADING,{url:r,id:s,groupId:i,deliveryDirectives:e||null})}}toggleTrackModes(){const{media:e}=this;if(!e)return;const t=gt(e.textTracks),s=this.currentTrack;let i;if(s&&(i=t.filter(r=>gs(s,r))[0],i||this.warn(`Unable to find subtitle TextTrack with name "${s.name}" and language "${s.lang}"`)),[].slice.call(t).forEach(r=>{r.mode!=="disabled"&&r!==i&&(r.mode="disabled")}),i){const r=this.subtitleDisplay?"showing":"hidden";i.mode!==r&&(i.mode=r)}}setSubtitleTrack(e){const t=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=e;return}if(e<-1||e>=t.length||!O(e)){this.warn(`Invalid subtitle track id: ${e}`);return}this.clearTimer(),this.selectDefaultTrack=!1;const s=this.currentTrack,i=t[e]||null;if(this.trackId=e,this.currentTrack=i,this.toggleTrackModes(),!i){this.hls.trigger(p.SUBTITLE_TRACK_SWITCH,{id:e});return}const r=!!i.details&&!i.details.live;if(e===this.trackId&&i===s&&r)return;this.log(`Switching to subtitle-track ${e}`+(i?` "${i.name}" lang:${i.lang} group:${i.groupId}`:""));const{id:n,groupId:o="",name:l,type:c,url:h}=i;this.hls.trigger(p.SUBTITLE_TRACK_SWITCH,{id:n,groupId:o,name:l,type:c,url:h});const u=this.switchParams(i.url,s==null?void 0:s.details,i.details);this.loadPlaylist(u)}}class Ko{constructor(e){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=e}append(e,t,s){const i=this.queues[t];i.push(e),i.length===1&&!s&&this.executeNext(t)}insertAbort(e,t){this.queues[t].unshift(e),this.executeNext(t)}appendBlocker(e){let t;const s=new Promise(r=>{t=r}),i={execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};return this.append(i,e),s}executeNext(e){const t=this.queues[e];if(t.length){const s=t[0];try{s.execute()}catch(i){v.warn(`[buffer-operation-queue]: Exception executing "${e}" SourceBuffer operation: ${i}`),s.onError(i);const r=this.buffers[e];r!=null&&r.updating||this.shiftAndExecuteNext(e)}}}shiftAndExecuteNext(e){this.queues[e].shift(),this.executeNext(e)}current(e){return this.queues[e][0]}}const Ri=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/;class Vo{constructor(e){this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.lastMpegAudioChunk=null,this.appendSource=void 0,this.appendErrors={audio:0,video:0,audiovideo:0},this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this.log=void 0,this.warn=void 0,this.error=void 0,this._onEndStreaming=s=>{this.hls&&this.hls.pauseBuffering()},this._onStartStreaming=s=>{this.hls&&this.hls.resumeBuffering()},this._onMediaSourceOpen=()=>{const{media:s,mediaSource:i}=this;this.log("Media source opened"),s&&(s.removeEventListener("emptied",this._onMediaEmptied),this.updateMediaElementDuration(),this.hls.trigger(p.MEDIA_ATTACHED,{media:s,mediaSource:i})),i&&i.removeEventListener("sourceopen",this._onMediaSourceOpen),this.checkPendingTracks()},this._onMediaSourceClose=()=>{this.log("Media source closed")},this._onMediaSourceEnded=()=>{this.log("Media source ended")},this._onMediaEmptied=()=>{const{mediaSrc:s,_objectUrl:i}=this;s!==i&&v.error(`Media element src was set while attaching MediaSource (${i} > ${s})`)},this.hls=e;const t="[buffer-controller]";this.appendSource=Qn(Ue(e.config.preferManagedMediaSource)),this.log=v.log.bind(v,t),this.warn=v.warn.bind(v,t),this.error=v.error.bind(v,t),this._initSourceBuffer(),this.registerListeners()}hasSourceTypes(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0}destroy(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=null,this.hls=null}registerListeners(){const{hls:e}=this;e.on(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_PARSED,this.onManifestParsed,this),e.on(p.BUFFER_RESET,this.onBufferReset,this),e.on(p.BUFFER_APPENDING,this.onBufferAppending,this),e.on(p.BUFFER_CODECS,this.onBufferCodecs,this),e.on(p.BUFFER_EOS,this.onBufferEos,this),e.on(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(p.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(p.FRAG_PARSED,this.onFragParsed,this),e.on(p.FRAG_CHANGED,this.onFragChanged,this)}unregisterListeners(){const{hls:e}=this;e.off(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_PARSED,this.onManifestParsed,this),e.off(p.BUFFER_RESET,this.onBufferReset,this),e.off(p.BUFFER_APPENDING,this.onBufferAppending,this),e.off(p.BUFFER_CODECS,this.onBufferCodecs,this),e.off(p.BUFFER_EOS,this.onBufferEos,this),e.off(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(p.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(p.FRAG_PARSED,this.onFragParsed,this),e.off(p.FRAG_CHANGED,this.onFragChanged,this)}_initSourceBuffer(){this.sourceBuffer={},this.operationQueue=new Ko(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]},this.appendErrors={audio:0,video:0,audiovideo:0},this.lastMpegAudioChunk=null}onManifestLoading(){this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=0,this.details=null}onManifestParsed(e,t){let s=2;(t.audio&&!t.video||!t.altAudio)&&(s=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=s,this.log(`${this.bufferCodecEventsExpected} bufferCodec event(s) expected`)}onMediaAttaching(e,t){const s=this.media=t.media,i=Ue(this.appendSource);if(s&&i){var r;const n=this.mediaSource=new i;this.log(`created media source: ${(r=n.constructor)==null?void 0:r.name}`),n.addEventListener("sourceopen",this._onMediaSourceOpen),n.addEventListener("sourceended",this._onMediaSourceEnded),n.addEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(n.addEventListener("startstreaming",this._onStartStreaming),n.addEventListener("endstreaming",this._onEndStreaming));const o=this._objectUrl=self.URL.createObjectURL(n);if(this.appendSource)try{s.removeAttribute("src");const l=self.ManagedMediaSource;s.disableRemotePlayback=s.disableRemotePlayback||l&&n instanceof l,Ii(s),Ho(s,o),s.load()}catch{s.src=o}else s.src=o;s.addEventListener("emptied",this._onMediaEmptied)}}onMediaDetaching(){const{media:e,mediaSource:t,_objectUrl:s}=this;if(t){if(this.log("media source detaching"),t.readyState==="open")try{t.endOfStream()}catch(i){this.warn(`onMediaDetaching: ${i.message} while calling endOfStream`)}this.onBufferReset(),t.removeEventListener("sourceopen",this._onMediaSourceOpen),t.removeEventListener("sourceended",this._onMediaSourceEnded),t.removeEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(t.removeEventListener("startstreaming",this._onStartStreaming),t.removeEventListener("endstreaming",this._onEndStreaming)),e&&(e.removeEventListener("emptied",this._onMediaEmptied),s&&self.URL.revokeObjectURL(s),this.mediaSrc===s?(e.removeAttribute("src"),this.appendSource&&Ii(e),e.load()):this.warn("media|source.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(p.MEDIA_DETACHED,void 0)}onBufferReset(){this.getSourceBufferTypes().forEach(e=>{this.resetBuffer(e)}),this._initSourceBuffer()}resetBuffer(e){const t=this.sourceBuffer[e];try{if(t){var s;this.removeBufferListeners(e),this.sourceBuffer[e]=void 0,(s=this.mediaSource)!=null&&s.sourceBuffers.length&&this.mediaSource.removeSourceBuffer(t)}}catch(i){this.warn(`onBufferReset ${e}`,i)}}onBufferCodecs(e,t){const s=this.getSourceBufferTypes().length,i=Object.keys(t);if(i.forEach(n=>{if(s){const l=this.tracks[n];if(l&&typeof l.buffer.changeType=="function"){var o;const{id:c,codec:h,levelCodec:u,container:d,metadata:g}=t[n],f=qs(l.codec,l.levelCodec),m=f==null?void 0:f.replace(Ri,"$1");let T=qs(h,u);const E=(o=T)==null?void 0:o.replace(Ri,"$1");if(T&&m!==E){n.slice(0,5)==="audio"&&(T=Rt(T,this.appendSource));const x=`${d};codecs=${T}`;this.appendChangeType(n,x),this.log(`switching codec ${f} to ${T}`),this.tracks[n]={buffer:l.buffer,codec:h,container:d,levelCodec:u,metadata:g,id:c}}}}else this.pendingTracks[n]=t[n]}),s)return;const r=Math.max(this.bufferCodecEventsExpected-1,0);this.bufferCodecEventsExpected!==r&&(this.log(`${r} bufferCodec event(s) expected ${i.join(",")}`),this.bufferCodecEventsExpected=r),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()}appendChangeType(e,t){const{operationQueue:s}=this,i={execute:()=>{const r=this.sourceBuffer[e];r&&(this.log(`changing ${e} sourceBuffer type to ${t}`),r.changeType(t)),s.shiftAndExecuteNext(e)},onStart:()=>{},onComplete:()=>{},onError:r=>{this.warn(`Failed to change ${e} SourceBuffer type`,r)}};s.append(i,e,!!this.pendingTracks[e])}onBufferAppending(e,t){const{hls:s,operationQueue:i,tracks:r}=this,{data:n,type:o,frag:l,part:c,chunkMeta:h}=t,u=h.buffering[o],d=self.performance.now();u.start=d;const g=l.stats.buffering,f=c?c.stats.buffering:null;g.start===0&&(g.start=d),f&&f.start===0&&(f.start=d);const m=r.audio;let T=!1;o==="audio"&&(m==null?void 0:m.container)==="audio/mpeg"&&(T=!this.lastMpegAudioChunk||h.id===1||this.lastMpegAudioChunk.sn!==h.sn,this.lastMpegAudioChunk=h);const E=l.start,x={execute:()=>{if(u.executeStart=self.performance.now(),T){const y=this.sourceBuffer[o];if(y){const I=E-y.timestampOffset;Math.abs(I)>=.1&&(this.log(`Updating audio SourceBuffer timestampOffset to ${E} (delta: ${I}) sn: ${l.sn})`),y.timestampOffset=E)}}this.appendExecutor(n,o)},onStart:()=>{},onComplete:()=>{const y=self.performance.now();u.executeEnd=u.end=y,g.first===0&&(g.first=y),f&&f.first===0&&(f.first=y);const{sourceBuffer:I}=this,S={};for(const D in I)S[D]=J.getBuffered(I[D]);this.appendErrors[o]=0,o==="audio"||o==="video"?this.appendErrors.audiovideo=0:(this.appendErrors.audio=0,this.appendErrors.video=0),this.hls.trigger(p.BUFFER_APPENDED,{type:o,frag:l,part:c,chunkMeta:h,parent:l.type,timeRanges:S})},onError:y=>{const I={type:$.MEDIA_ERROR,parent:l.type,details:L.BUFFER_APPEND_ERROR,sourceBufferName:o,frag:l,part:c,chunkMeta:h,error:y,err:y,fatal:!1};if(y.code===DOMException.QUOTA_EXCEEDED_ERR)I.details=L.BUFFER_FULL_ERROR;else{const S=++this.appendErrors[o];I.details=L.BUFFER_APPEND_ERROR,this.warn(`Failed ${S}/${s.config.appendErrorMaxRetry} times to append segment in "${o}" sourceBuffer`),S>=s.config.appendErrorMaxRetry&&(I.fatal=!0)}s.trigger(p.ERROR,I)}};i.append(x,o,!!this.pendingTracks[o])}onBufferFlushing(e,t){const{operationQueue:s}=this,i=r=>({execute:this.removeExecutor.bind(this,r,t.startOffset,t.endOffset),onStart:()=>{},onComplete:()=>{this.hls.trigger(p.BUFFER_FLUSHED,{type:r})},onError:n=>{this.warn(`Failed to remove from ${r} SourceBuffer`,n)}});t.type?s.append(i(t.type),t.type):this.getSourceBufferTypes().forEach(r=>{s.append(i(r),r)})}onFragParsed(e,t){const{frag:s,part:i}=t,r=[],n=i?i.elementaryStreams:s.elementaryStreams;n[X.AUDIOVIDEO]?r.push("audiovideo"):(n[X.AUDIO]&&r.push("audio"),n[X.VIDEO]&&r.push("video"));const o=()=>{const l=self.performance.now();s.stats.buffering.end=l,i&&(i.stats.buffering.end=l);const c=i?i.stats:s.stats;this.hls.trigger(p.FRAG_BUFFERED,{frag:s,part:i,stats:c,id:s.type})};r.length===0&&this.warn(`Fragments must have at least one ElementaryStreamType set. type: ${s.type} level: ${s.level} sn: ${s.sn}`),this.blockBuffers(o,r)}onFragChanged(e,t){this.trimBuffers()}onBufferEos(e,t){this.getSourceBufferTypes().reduce((i,r)=>{const n=this.sourceBuffer[r];return n&&(!t.type||t.type===r)&&(n.ending=!0,n.ended||(n.ended=!0,this.log(`${r} sourceBuffer now EOS`))),i&&!!(!n||n.ended)},!0)&&(this.log("Queueing mediaSource.endOfStream()"),this.blockBuffers(()=>{this.getSourceBufferTypes().forEach(r=>{const n=this.sourceBuffer[r];n&&(n.ending=!1)});const{mediaSource:i}=this;if(!i||i.readyState!=="open"){i&&this.log(`Could not call mediaSource.endOfStream(). mediaSource.readyState: ${i.readyState}`);return}this.log("Calling mediaSource.endOfStream()"),i.endOfStream()}))}onLevelUpdated(e,{details:t}){t.fragments.length&&(this.details=t,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration())}trimBuffers(){const{hls:e,details:t,media:s}=this;if(!s||t===null||!this.getSourceBufferTypes().length)return;const r=e.config,n=s.currentTime,o=t.levelTargetDuration,l=t.live&&r.liveBackBufferLength!==null?r.liveBackBufferLength:r.backBufferLength;if(O(l)&&l>0){const c=Math.max(l,o),h=Math.floor(n/o)*o-c;this.flushBackBuffer(n,o,h)}if(O(r.frontBufferFlushThreshold)&&r.frontBufferFlushThreshold>0){const c=Math.max(r.maxBufferLength,r.frontBufferFlushThreshold),h=Math.max(c,o),u=Math.floor(n/o)*o+h;this.flushFrontBuffer(n,o,u)}}flushBackBuffer(e,t,s){const{details:i,sourceBuffer:r}=this;this.getSourceBufferTypes().forEach(o=>{const l=r[o];if(l){const c=J.getBuffered(l);if(c.length>0&&s>c.start(0)){if(this.hls.trigger(p.BACK_BUFFER_REACHED,{bufferEnd:s}),i!=null&&i.live)this.hls.trigger(p.LIVE_BACK_BUFFER_REACHED,{bufferEnd:s});else if(l.ended&&c.end(c.length-1)-e{const o=i[n];if(o){const l=J.getBuffered(o),c=l.length;if(c<2)return;const h=l.start(c-1),u=l.end(c-1);if(s>h||e>=h&&e<=u)return;if(o.ended&&e-u<2*t){this.log(`Cannot flush ${n} front buffer while SourceBuffer is in ended state`);return}this.hls.trigger(p.BUFFER_FLUSHING,{startOffset:h,endOffset:1/0,type:n})}})}updateMediaElementDuration(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;const{details:e,hls:t,media:s,mediaSource:i}=this,r=e.fragments[0].start+e.totalduration,n=s.duration,o=O(i.duration)?i.duration:0;e.live&&t.config.liveDurationInfinity?(i.duration=1/0,this.updateSeekableRange(e)):(r>o&&r>n||!O(n))&&(this.log(`Updating Media Source duration to ${r.toFixed(3)}`),i.duration=r)}updateSeekableRange(e){const t=this.mediaSource,s=e.fragments;if(s.length&&e.live&&t!=null&&t.setLiveSeekableRange){const r=Math.max(0,s[0].start),n=Math.max(r,r+e.totalduration);this.log(`Media Source duration is set to ${t.duration}. Setting seekable range to ${r}-${n}.`),t.setLiveSeekableRange(r,n)}}checkPendingTracks(){const{bufferCodecEventsExpected:e,operationQueue:t,pendingTracks:s}=this,i=Object.keys(s).length;if(i&&(!e||i===2||"audiovideo"in s)){this.createSourceBuffers(s),this.pendingTracks={};const r=this.getSourceBufferTypes();if(r.length)this.hls.trigger(p.BUFFER_CREATED,{tracks:this.tracks}),r.forEach(n=>{t.executeNext(n)});else{const n=new Error("could not create source buffer for media codec(s)");this.hls.trigger(p.ERROR,{type:$.MEDIA_ERROR,details:L.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:n,reason:n.message})}}}createSourceBuffers(e){const{sourceBuffer:t,mediaSource:s}=this;if(!s)throw Error("createSourceBuffers called when mediaSource was null");for(const r in e)if(!t[r]){var i;const n=e[r];if(!n)throw Error(`source buffer exists for track ${r}, however track does not`);let o=((i=n.levelCodec)==null?void 0:i.indexOf(","))===-1?n.levelCodec:n.codec;o&&r.slice(0,5)==="audio"&&(o=Rt(o,this.appendSource));const l=`${n.container};codecs=${o}`;this.log(`creating sourceBuffer(${l})`);try{const c=t[r]=s.addSourceBuffer(l),h=r;this.addBufferListener(h,"updatestart",this._onSBUpdateStart),this.addBufferListener(h,"updateend",this._onSBUpdateEnd),this.addBufferListener(h,"error",this._onSBUpdateError),this.appendSource&&this.addBufferListener(h,"bufferedchange",(u,d)=>{const g=d.removedRanges;g!=null&&g.length&&this.hls.trigger(p.BUFFER_FLUSHED,{type:r})}),this.tracks[r]={buffer:c,codec:o,container:n.container,levelCodec:n.levelCodec,metadata:n.metadata,id:n.id}}catch(c){this.error(`error while trying to add sourceBuffer: ${c.message}`),this.hls.trigger(p.ERROR,{type:$.MEDIA_ERROR,details:L.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:c,sourceBufferName:r,mimeType:l})}}}get mediaSrc(){var e,t;const s=((e=this.media)==null||(t=e.querySelector)==null?void 0:t.call(e,"source"))||this.media;return s==null?void 0:s.src}_onSBUpdateStart(e){const{operationQueue:t}=this;t.current(e).onStart()}_onSBUpdateEnd(e){var t;if(((t=this.mediaSource)==null?void 0:t.readyState)==="closed"){this.resetBuffer(e);return}const{operationQueue:s}=this;s.current(e).onComplete(),s.shiftAndExecuteNext(e)}_onSBUpdateError(e,t){var s;const i=new Error(`${e} SourceBuffer error. MediaSource readyState: ${(s=this.mediaSource)==null?void 0:s.readyState}`);this.error(`${i}`,t),this.hls.trigger(p.ERROR,{type:$.MEDIA_ERROR,details:L.BUFFER_APPENDING_ERROR,sourceBufferName:e,error:i,fatal:!1});const r=this.operationQueue.current(e);r&&r.onError(i)}removeExecutor(e,t,s){const{media:i,mediaSource:r,operationQueue:n,sourceBuffer:o}=this,l=o[e];if(!i||!r||!l){this.warn(`Attempting to remove from the ${e} SourceBuffer, but it does not exist`),n.shiftAndExecuteNext(e);return}const c=O(i.duration)?i.duration:1/0,h=O(r.duration)?r.duration:1/0,u=Math.max(0,t),d=Math.min(s,c,h);d>u&&(!l.ending||l.ended)?(l.ended=!1,this.log(`Removing [${u},${d}] from the ${e} SourceBuffer`),l.remove(u,d)):n.shiftAndExecuteNext(e)}appendExecutor(e,t){const s=this.sourceBuffer[t];if(!s){if(!this.pendingTracks[t])throw new Error(`Attempting to append to the ${t} SourceBuffer, but it does not exist`);return}s.ended=!1,s.appendBuffer(e)}blockBuffers(e,t=this.getSourceBufferTypes()){if(!t.length){this.log("Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(e);return}const{operationQueue:s}=this,i=t.map(r=>s.appendBlocker(r));Promise.all(i).then(()=>{e(),t.forEach(r=>{const n=this.sourceBuffer[r];n!=null&&n.updating||s.shiftAndExecuteNext(r)})})}getSourceBufferTypes(){return Object.keys(this.sourceBuffer)}addBufferListener(e,t,s){const i=this.sourceBuffer[e];if(!i)return;const r=s.bind(this,e);this.listeners[e].push({event:t,listener:r}),i.addEventListener(t,r)}removeBufferListeners(e){const t=this.sourceBuffer[e];t&&this.listeners[e].forEach(s=>{t.removeEventListener(s.event,s.listener)})}}function Ii(a){const e=a.querySelectorAll("source");[].slice.call(e).forEach(t=>{a.removeChild(t)})}function Ho(a,e){const t=self.document.createElement("source");t.type="video/mp4",t.src=e,a.appendChild(t)}const Wo={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},_r=a=>String.fromCharCode(Wo[a]||a),Ee=15,De=100,Yo={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},qo={17:2,18:4,21:6,22:8,23:10,19:13,20:15},jo={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},zo={25:2,26:4,29:6,30:8,31:10,27:13,28:15},Xo=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class Qo{constructor(){this.time=null,this.verboseLevel=0}log(e,t){if(this.verboseLevel>=e){const s=typeof t=="function"?t():t;v.log(`${this.time} [${e}] ${s}`)}}}const Fe=function(e){const t=[];for(let s=0;sDe&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=De)}moveCursor(e){const t=this.pos+e;if(e>1)for(let s=this.pos+1;s=144&&this.backSpace();const t=_r(e);if(this.pos>=De){this.logger.log(0,()=>"Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1)}clearFromPos(e){let t;for(t=e;t"pacData = "+JSON.stringify(e));let t=e.row-1;if(this.nrRollUpRows&&t"bkgData = "+JSON.stringify(e)),this.backSpace(),this.setPen(e),this.insertChar(32)}setRollUpRows(e){this.nrRollUpRows=e}rollUp(){if(this.nrRollUpRows===null){this.logger.log(3,"roll_up but nrRollUpRows not set yet");return}this.logger.log(1,()=>this.getDisplayText());const e=this.currRow+1-this.nrRollUpRows,t=this.rows.splice(e,1)[0];t.clear(),this.rows.splice(this.currRow,0,t),this.logger.log(2,"Rolling up")}getDisplayText(e){e=e||!1;const t=[];let s="",i=-1;for(let r=0;r0&&(e?s="["+t.join(" | ")+"]":s=t.join(` +`)),s}getTextAndFormat(){return this.rows}}class bi{constructor(e,t,s){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=e,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new Qt(s),this.nonDisplayedMemory=new Qt(s),this.lastOutputScreen=new Qt(s),this.currRollUpRow=this.displayedMemory.rows[Ee-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=s}reset(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[Ee-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}getHandler(){return this.outputFilter}setHandler(e){this.outputFilter=e}setPAC(e){this.writeScreen.setPAC(e)}setBkgData(e){this.writeScreen.setBkgData(e)}setMode(e){e!==this.mode&&(this.mode=e,this.logger.log(2,()=>"MODE="+e),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)}insertChars(e){for(let s=0;st+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(1,()=>"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())}ccRCL(){this.logger.log(2,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")}ccBS(){this.logger.log(2,"BS - BackSpace"),this.mode!=="MODE_TEXT"&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())}ccAOF(){}ccAON(){}ccDER(){this.logger.log(2,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()}ccRU(e){this.logger.log(2,"RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)}ccFON(){this.logger.log(2,"FON - Flash On"),this.writeScreen.setPen({flash:!0})}ccRDC(){this.logger.log(2,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")}ccTR(){this.logger.log(2,"TR"),this.setMode("MODE_TEXT")}ccRTD(){this.logger.log(2,"RTD"),this.setMode("MODE_TEXT")}ccEDM(){this.logger.log(2,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)}ccCR(){this.logger.log(2,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)}ccENM(){this.logger.log(2,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()}ccEOC(){if(this.logger.log(2,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){const e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,this.logger.log(1,()=>"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)}ccTO(e){this.logger.log(2,"TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)}ccMIDROW(e){const t={flash:!1};if(t.underline=e%2===1,t.italics=e>=46,t.italics)t.foreground="white";else{const s=Math.floor(e/2)-16,i=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=i[s]}this.logger.log(2,"MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)}outputDataUpdate(e=!1){const t=this.logger.time;t!==null&&this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=t:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,t,this.lastOutputScreen),e&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:t),this.lastOutputScreen.copy(this.displayedMemory))}cueSplitAtTime(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}}class Di{constructor(e,t,s){this.channels=void 0,this.currentChannel=0,this.cmdHistory=tl(),this.logger=void 0;const i=this.logger=new Qo;this.channels=[null,new bi(e,t,i),new bi(e+1,s,i)]}getHandler(e){return this.channels[e].getHandler()}setHandler(e,t){this.channels[e].setHandler(t)}addData(e,t){this.logger.time=e;for(let s=0;s"["+Fe([t[s],t[s+1]])+"] -> ("+Fe([i,r])+")");const l=this.cmdHistory;if(i>=16&&i<=31){if(el(i,r,l)){ct(null,null,l),this.logger.log(3,()=>"Repeated command ("+Fe([i,r])+") is dropped");continue}ct(i,r,this.cmdHistory),n=this.parseCmd(i,r),n||(n=this.parseMidrow(i,r)),n||(n=this.parsePAC(i,r)),n||(n=this.parseBackgroundAttributes(i,r))}else ct(null,null,l);if(!n&&(o=this.parseChars(i,r),o)){const h=this.currentChannel;h&&h>0?this.channels[h].insertChars(o):this.logger.log(2,"No channel found yet. TEXT-MODE?")}!n&&!o&&this.logger.log(2,()=>"Couldn't parse cleaned data "+Fe([i,r])+" orig: "+Fe([t[s],t[s+1]]))}}parseCmd(e,t){const s=(e===20||e===28||e===21||e===29)&&t>=32&&t<=47,i=(e===23||e===31)&&t>=33&&t<=35;if(!(s||i))return!1;const r=e===20||e===21||e===23?1:2,n=this.channels[r];return e===20||e===21||e===28||e===29?t===32?n.ccRCL():t===33?n.ccBS():t===34?n.ccAOF():t===35?n.ccAON():t===36?n.ccDER():t===37?n.ccRU(2):t===38?n.ccRU(3):t===39?n.ccRU(4):t===40?n.ccFON():t===41?n.ccRDC():t===42?n.ccTR():t===43?n.ccRTD():t===44?n.ccEDM():t===45?n.ccCR():t===46?n.ccENM():t===47&&n.ccEOC():n.ccTO(t-32),this.currentChannel=r,!0}parseMidrow(e,t){let s=0;if((e===17||e===25)&&t>=32&&t<=47){if(e===17?s=1:s=2,s!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;const i=this.channels[s];return i?(i.ccMIDROW(t),this.logger.log(3,()=>"MIDROW ("+Fe([e,t])+")"),!0):!1}return!1}parsePAC(e,t){let s;const i=(e>=17&&e<=23||e>=25&&e<=31)&&t>=64&&t<=127,r=(e===16||e===24)&&t>=64&&t<=95;if(!(i||r))return!1;const n=e<=23?1:2;t>=64&&t<=95?s=n===1?Yo[e]:jo[e]:s=n===1?qo[e]:zo[e];const o=this.channels[n];return o?(o.setPAC(this.interpretPAC(s,t)),this.currentChannel=n,!0):!1}interpretPAC(e,t){let s;const i={color:null,italics:!1,indent:null,underline:!1,row:e};return t>95?s=t-96:s=t-64,i.underline=(s&1)===1,s<=13?i.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(s/2)]:s<=15?(i.italics=!0,i.color="white"):i.indent=Math.floor((s-16)/2)*4,i}parseChars(e,t){let s,i=null,r=null;if(e>=25?(s=2,r=e-8):(s=1,r=e),r>=17&&r<=19){let n;r===17?n=t+80:r===18?n=t+112:n=t+144,this.logger.log(2,()=>"Special char '"+_r(n)+"' in channel "+s),i=[n]}else e>=32&&e<=127&&(i=t===0?[e]:[e,t]);return i&&this.logger.log(3,()=>"Char codes = "+Fe(i).join(",")),i}parseBackgroundAttributes(e,t){const s=(e===16||e===24)&&t>=32&&t<=47,i=(e===23||e===31)&&t>=45&&t<=47;if(!(s||i))return!1;let r;const n={};e===16||e===24?(r=Math.floor((t-32)/2),n.background=Xo[r],t%2===1&&(n.background=n.background+"_semi")):t===45?n.background="transparent":(n.foreground="black",t===47&&(n.underline=!0));const o=e<=23?1:2;return this.channels[o].setBkgData(n),!0}reset(){for(let e=0;ee)&&(this.startTime=e),this.endTime=t,this.screen=s,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}}var Fs=function(){if(qe!=null&&qe.VTTCue)return self.VTTCue;const a=["","lr","rl"],e=["start","middle","end","left","right"];function t(o,l){if(typeof l!="string"||!Array.isArray(o))return!1;const c=l.toLowerCase();return~o.indexOf(c)?c:!1}function s(o){return t(a,o)}function i(o){return t(e,o)}function r(o,...l){let c=1;for(;c100)throw new Error("Position must be between 0 and 100.");D=b,this.hasBeenReset=!0}})),Object.defineProperty(h,"positionAlign",r({},u,{get:function(){return R},set:function(b){const w=i(b);if(!w)throw new SyntaxError("An invalid or illegal string was specified.");R=w,this.hasBeenReset=!0}})),Object.defineProperty(h,"size",r({},u,{get:function(){return _},set:function(b){if(b<0||b>100)throw new Error("Size must be between 0 and 100.");_=b,this.hasBeenReset=!0}})),Object.defineProperty(h,"align",r({},u,{get:function(){return k},set:function(b){const w=i(b);if(!w)throw new SyntaxError("An invalid or illegal string was specified.");k=w,this.hasBeenReset=!0}})),h.displayState=void 0}return n.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},n}();class sl{decode(e,t){if(!e)return"";if(typeof e!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}function kr(a){function e(s,i,r,n){return(s|0)*3600+(i|0)*60+(r|0)+parseFloat(n||0)}const t=a.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return t?parseFloat(t[2])>59?e(t[2],t[3],0,t[4]):e(t[1],t[2],t[3],t[4]):null}class il{constructor(){this.values=Object.create(null)}set(e,t){!this.get(e)&&t!==""&&(this.values[e]=t)}get(e,t,s){return s?this.has(e)?this.values[e]:t[s]:this.has(e)?this.values[e]:t}has(e){return e in this.values}alt(e,t,s){for(let i=0;i=0&&s<=100)return this.set(e,s),!0}return!1}}function Pr(a,e,t,s){const i=s?a.split(s):[a];for(const r in i){if(typeof i[r]!="string")continue;const n=i[r].split(t);if(n.length!==2)continue;const o=n[0],l=n[1];e(o,l)}}const ms=new Fs(0,0,""),ut=ms.align==="middle"?"middle":"center";function rl(a,e,t){const s=a;function i(){const o=kr(a);if(o===null)throw new Error("Malformed timestamp: "+s);return a=a.replace(/^[^\sa-zA-Z-]+/,""),o}function r(o,l){const c=new il;Pr(o,function(d,g){let f;switch(d){case"region":for(let m=t.length-1;m>=0;m--)if(t[m].id===g){c.set(d,t[m].region);break}break;case"vertical":c.alt(d,g,["rl","lr"]);break;case"line":f=g.split(","),c.integer(d,f[0]),c.percent(d,f[0])&&c.set("snapToLines",!1),c.alt(d,f[0],["auto"]),f.length===2&&c.alt("lineAlign",f[1],["start",ut,"end"]);break;case"position":f=g.split(","),c.percent(d,f[0]),f.length===2&&c.alt("positionAlign",f[1],["start",ut,"end","line-left","line-right","auto"]);break;case"size":c.percent(d,g);break;case"align":c.alt(d,g,["start",ut,"end","left","right"]);break}},/:/,/\s/),l.region=c.get("region",null),l.vertical=c.get("vertical","");let h=c.get("line","auto");h==="auto"&&ms.line===-1&&(h=-1),l.line=h,l.lineAlign=c.get("lineAlign","start"),l.snapToLines=c.get("snapToLines",!0),l.size=c.get("size",100),l.align=c.get("align",ut);let u=c.get("position","auto");u==="auto"&&ms.position===50&&(u=l.align==="start"||l.align==="left"?0:l.align==="end"||l.align==="right"?100:50),l.position=u}function n(){a=a.replace(/^\s+/,"")}if(n(),e.startTime=i(),n(),a.slice(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+s);a=a.slice(3),n(),e.endTime=i(),n(),r(a,e)}function Fr(a){return a.replace(//gi,` +`)}class nl{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new sl,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}parse(e){const t=this;e&&(t.buffer+=t.decoder.decode(e,{stream:!0}));function s(){let r=t.buffer,n=0;for(r=Fr(r);n")===-1){t.cue.id=r;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{rl(r,t.cue,t.regionList)}catch{t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":{const o=r.indexOf("-->")!==-1;if(!r||o&&(n=!0)){t.oncue&&t.cue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}if(t.cue===null)continue;t.cue.text&&(t.cue.text+=` +`),t.cue.text+=r}continue;case"BADCUE":r||(t.state="ID")}}}catch{t.state==="CUETEXT"&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state=t.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this}flush(){const e=this;try{if((e.cue||e.state==="HEADER")&&(e.buffer+=` + +`,e.parse()),e.state==="INITIAL"||e.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(t){e.onparsingerror&&e.onparsingerror(t)}return e.onflush&&e.onflush(),this}}const al=/\r\n|\n\r|\n|\r/g,Jt=function(e,t,s=0){return e.slice(s,s+t.length)===t},ol=function(e){let t=parseInt(e.slice(-3));const s=parseInt(e.slice(-6,-4)),i=parseInt(e.slice(-9,-7)),r=e.length>9?parseInt(e.substring(0,e.indexOf(":"))):0;if(!O(t)||!O(s)||!O(i)||!O(r))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${e}`);return t+=1e3*s,t+=60*1e3*i,t+=60*60*1e3*r,t},Zt=function(e){let t=5381,s=e.length;for(;s;)t=t*33^e.charCodeAt(--s);return(t>>>0).toString()};function Os(a,e,t){return Zt(a.toString())+Zt(e.toString())+Zt(t)}const ll=function(e,t,s){let i=e[t],r=e[i.prevCC];if(!r||!r.new&&i.new){e.ccOffset=e.presentationOffset=i.start,i.new=!1;return}for(;(n=r)!=null&&n.new;){var n;e.ccOffset+=i.start-r.start,i.new=!1,i=r,r=e[i.prevCC]}e.presentationOffset=s};function cl(a,e,t,s,i,r,n){const o=new nl,l=Re(new Uint8Array(a)).trim().replace(al,` +`).split(` +`),c=[],h=e?Io(e.baseTime,e.timescale):0;let u="00:00.000",d=0,g=0,f,m=!0;o.oncue=function(T){const E=t[s];let x=t.ccOffset;const y=(d-h)/9e4;if(E!=null&&E.new&&(g!==void 0?x=t.ccOffset=E.start:ll(t,s,y)),y){if(!e){f=new Error("Missing initPTS for VTT MPEGTS");return}x=y-t.presentationOffset}const I=T.endTime-T.startTime,S=me((T.startTime+x-g)*9e4,i*9e4)/9e4;T.startTime=Math.max(S,0),T.endTime=Math.max(S+I,0);const D=T.text.trim();T.text=decodeURIComponent(encodeURIComponent(D)),T.id||(T.id=Os(T.startTime,T.endTime,D)),T.endTime>0&&c.push(T)},o.onparsingerror=function(T){f=T},o.onflush=function(){if(f){n(f);return}r(c)},l.forEach(T=>{if(m)if(Jt(T,"X-TIMESTAMP-MAP=")){m=!1,T.slice(16).split(",").forEach(E=>{Jt(E,"LOCAL:")?u=E.slice(6):Jt(E,"MPEGTS:")&&(d=parseInt(E.slice(7)))});try{g=ol(u)/1e3}catch(E){f=E}return}else T===""&&(m=!1);o.parse(T+` +`)}),o.flush()}const es="stpp.ttml.im1t",Or=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,Mr=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,hl={left:"start",center:"center",right:"end",start:"start",end:"end"};function Ci(a,e,t,s){const i=H(new Uint8Array(a),["mdat"]);if(i.length===0){s(new Error("Could not parse IMSC1 mdat"));return}const r=i.map(o=>Re(o)),n=Ro(e.baseTime,1,e.timescale);try{r.forEach(o=>t(ul(o,n)))}catch(o){s(o)}}function ul(a,e){const i=new DOMParser().parseFromString(a,"text/xml").getElementsByTagName("tt")[0];if(!i)throw new Error("Invalid ttml");const r={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},n=Object.keys(r).reduce((u,d)=>(u[d]=i.getAttribute(`ttp:${d}`)||r[d],u),{}),o=i.getAttribute("xml:space")!=="preserve",l=_i(ts(i,"styling","style")),c=_i(ts(i,"layout","region")),h=ts(i,"body","[begin]");return[].map.call(h,u=>{const d=Nr(u,o);if(!d||!u.hasAttribute("begin"))return null;const g=is(u.getAttribute("begin"),n),f=is(u.getAttribute("dur"),n);let m=is(u.getAttribute("end"),n);if(g===null)throw wi(u);if(m===null){if(f===null)throw wi(u);m=g+f}const T=new Fs(g-e,m-e,d);T.id=Os(T.startTime,T.endTime,T.text);const E=c[u.getAttribute("region")],x=l[u.getAttribute("style")],y=dl(E,x,l),{textAlign:I}=y;if(I){const S=hl[I];S&&(T.lineAlign=S),T.align=I}return se(T,y),T}).filter(u=>u!==null)}function ts(a,e,t){const s=a.getElementsByTagName(e)[0];return s?[].slice.call(s.querySelectorAll(t)):[]}function _i(a){return a.reduce((e,t)=>{const s=t.getAttribute("xml:id");return s&&(e[s]=t),e},{})}function Nr(a,e){return[].slice.call(a.childNodes).reduce((t,s,i)=>{var r;return s.nodeName==="br"&&i?t+` +`:(r=s.childNodes)!=null&&r.length?Nr(s,e):e?t+s.textContent.trim().replace(/\s+/g," "):t+s.textContent},"")}function dl(a,e,t){const s="http://www.w3.org/ns/ttml#styling";let i=null;const r=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],n=a!=null&&a.hasAttribute("style")?a.getAttribute("style"):null;return n&&t.hasOwnProperty(n)&&(i=t[n]),r.reduce((o,l)=>{const c=ss(e,s,l)||ss(a,s,l)||ss(i,s,l);return c&&(o[l]=c),o},{})}function ss(a,e,t){return a&&a.hasAttributeNS(e,t)?a.getAttributeNS(e,t):null}function wi(a){return new Error(`Could not parse ttml timestamp ${a}`)}function is(a,e){if(!a)return null;let t=kr(a);return t===null&&(Or.test(a)?t=fl(a,e):Mr.test(a)&&(t=gl(a,e))),t}function fl(a,e){const t=Or.exec(a),s=(t[4]|0)+(t[5]|0)/e.subFrameRate;return(t[1]|0)*3600+(t[2]|0)*60+(t[3]|0)+s/e.frameRate}function gl(a,e){const t=Mr.exec(a),s=Number(t[1]);switch(t[2]){case"h":return s*3600;case"m":return s*60;case"ms":return s*1e3;case"f":return s/e.frameRate;case"t":return s/e.tickRate}return s}class ml{constructor(e){this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=Pi(),this.captionsProperties=void 0,this.hls=e,this.config=e.config,this.Cues=e.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},e.on(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(p.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(p.FRAG_LOADING,this.onFragLoading,this),e.on(p.FRAG_LOADED,this.onFragLoaded,this),e.on(p.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(p.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(p.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(p.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(p.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:e}=this;e.off(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(p.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(p.FRAG_LOADING,this.onFragLoading,this),e.off(p.FRAG_LOADED,this.onFragLoaded,this),e.off(p.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(p.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(p.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(p.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(p.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=null,this.cea608Parser1=this.cea608Parser2=void 0}initCea608Parsers(){if(this.config.enableCEA708Captions&&(!this.cea608Parser1||!this.cea608Parser2)){const e=new ht(this,"textTrack1"),t=new ht(this,"textTrack2"),s=new ht(this,"textTrack3"),i=new ht(this,"textTrack4");this.cea608Parser1=new Di(1,e,t),this.cea608Parser2=new Di(3,s,i)}}addCues(e,t,s,i,r){let n=!1;for(let o=r.length;o--;){const l=r[o],c=pl(l[0],l[1],t,s);if(c>=0&&(l[0]=Math.min(l[0],t),l[1]=Math.max(l[1],s),n=!0,c/(s-t)>.5))return}if(n||r.push([t,s]),this.config.renderTextTracksNatively){const o=this.captionsTracks[e];this.Cues.newCue(o,t,s,i)}else{const o=this.Cues.newCue(null,t,s,i);this.hls.trigger(p.CUES_PARSED,{type:"captions",cues:o,track:e})}}onInitPtsFound(e,{frag:t,id:s,initPTS:i,timescale:r}){const{unparsedVttFrags:n}=this;s==="main"&&(this.initPTS[t.cc]={baseTime:i,timescale:r}),n.length&&(this.unparsedVttFrags=[],n.forEach(o=>{this.onFragLoaded(p.FRAG_LOADED,o)}))}getExistingTrack(e,t){const{media:s}=this;if(s)for(let i=0;i{He(e[t]),delete e[t]}),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=Pi(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=[],this.initPTS=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())}_cleanTracks(){const{media:e}=this;if(!e)return;const t=e.textTracks;if(t)for(let s=0;sr.textCodec===es);if(this.config.enableWebVTT||i&&this.config.enableIMSC1){if(Cr(this.tracks,s)){this.tracks=s;return}if(this.textTracks=[],this.tracks=s,this.config.renderTextTracksNatively){const n=this.media,o=n?gt(n.textTracks):null;if(this.tracks.forEach((l,c)=>{let h;if(o){let u=null;for(let d=0;dc!==null).map(c=>c.label);l.length&&v.warn(`Media element contains unused subtitle tracks: ${l.join(", ")}. Replace media element for each source to clear TextTracks and captions menu.`)}}else if(this.tracks.length){const n=this.tracks.map(o=>({label:o.name,kind:o.type.toLowerCase(),default:o.default,subtitleTrack:o}));this.hls.trigger(p.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:n})}}}onManifestLoaded(e,t){this.config.enableCEA708Captions&&t.captions&&t.captions.forEach(s=>{const i=/(?:CC|SERVICE)([1-4])/.exec(s.instreamId);if(!i)return;const r=`textTrack${i[1]}`,n=this.captionsProperties[r];n&&(n.label=s.name,s.lang&&(n.languageCode=s.lang),n.media=s)})}closedCaptionsForLevel(e){const t=this.hls.levels[e.level];return t==null?void 0:t.attrs["CLOSED-CAPTIONS"]}onFragLoading(e,t){if(this.enabled&&t.frag.type===U.MAIN){var s,i;const{cea608Parser1:r,cea608Parser2:n,lastSn:o}=this,{cc:l,sn:c}=t.frag,h=(s=(i=t.part)==null?void 0:i.index)!=null?s:-1;r&&n&&(c!==o+1||c===o&&h!==this.lastPartIndex+1||l!==this.lastCc)&&(r.reset(),n.reset()),this.lastCc=l,this.lastSn=c,this.lastPartIndex=h}}onFragLoaded(e,t){const{frag:s,payload:i}=t;if(s.type===U.SUBTITLE)if(i.byteLength){const r=s.decryptdata,n="stats"in t;if(r==null||!r.encrypted||n){const o=this.tracks[s.level],l=this.vttCCs;l[s.cc]||(l[s.cc]={start:s.start,prevCC:this.prevCC,new:!0},this.prevCC=s.cc),o&&o.textCodec===es?this._parseIMSC1(s,i):this._parseVTTs(t)}}else this.hls.trigger(p.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:s,error:new Error("Empty subtitle payload")})}_parseIMSC1(e,t){const s=this.hls;Ci(t,this.initPTS[e.cc],i=>{this._appendCues(i,e.level),s.trigger(p.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})},i=>{v.log(`Failed to parse IMSC1: ${i}`),s.trigger(p.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:i})})}_parseVTTs(e){var t;const{frag:s,payload:i}=e,{initPTS:r,unparsedVttFrags:n}=this,o=r.length-1;if(!r[s.cc]&&o===-1){n.push(e);return}const l=this.hls,c=(t=s.initSegment)!=null&&t.data?pe(s.initSegment.data,new Uint8Array(i)):i;cl(c,this.initPTS[s.cc],this.vttCCs,s.cc,s.start,h=>{this._appendCues(h,s.level),l.trigger(p.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:s})},h=>{const u=h.message==="Missing initPTS for VTT MPEGTS";u?n.push(e):this._fallbackToIMSC1(s,i),v.log(`Failed to parse VTT cue: ${h}`),!(u&&o>s.cc)&&l.trigger(p.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:s,error:h})})}_fallbackToIMSC1(e,t){const s=this.tracks[e.level];s.textCodec||Ci(t,this.initPTS[e.cc],()=>{s.textCodec=es,this._parseIMSC1(e,t)},()=>{s.textCodec="wvtt"})}_appendCues(e,t){const s=this.hls;if(this.config.renderTextTracksNatively){const i=this.textTracks[t];if(!i||i.mode==="disabled")return;e.forEach(r=>rr(i,r))}else{const i=this.tracks[t];if(!i)return;const r=i.default?"default":"subtitles"+t;s.trigger(p.CUES_PARSED,{type:"subtitles",cues:e,track:r})}}onFragDecrypted(e,t){const{frag:s}=t;s.type===U.SUBTITLE&&this.onFragLoaded(p.FRAG_LOADED,t)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(e,t){this.initCea608Parsers();const{cea608Parser1:s,cea608Parser2:i}=this;if(!this.enabled||!s||!i)return;const{frag:r,samples:n}=t;if(!(r.type===U.MAIN&&this.closedCaptionsForLevel(r)==="NONE"))for(let o=0;ols(o[l],t,s))}if(this.config.renderTextTracksNatively&&t===0&&i!==void 0){const{textTracks:o}=this;Object.keys(o).forEach(l=>ls(o[l],t,i))}}}extractCea608Data(e){const t=[[],[]],s=e[0]&31;let i=2;for(let r=0;rthis.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}}getMaxLevel(e){const t=this.hls.levels;if(!t.length)return-1;const s=t.filter((i,r)=>this.isLevelAllowed(i)&&r<=e);return this.clientRect=null,Ms.getMaxLevelByMediaSize(s,this.mediaWidth,this.mediaHeight)}startCapping(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())}stopCapping(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)}getDimensions(){if(this.clientRect)return this.clientRect;const e=this.media,t={width:0,height:0};if(e){const s=e.getBoundingClientRect();t.width=s.width,t.height=s.height,!t.width&&!t.height&&(t.width=s.right-s.left||e.width||0,t.height=s.bottom-s.top||e.height||0)}return this.clientRect=t,t}get mediaWidth(){return this.getDimensions().width*this.contentScaleFactor}get mediaHeight(){return this.getDimensions().height*this.contentScaleFactor}get contentScaleFactor(){let e=1;if(!this.hls.config.ignoreDevicePixelRatio)try{e=self.devicePixelRatio}catch{}return e}isLevelAllowed(e){return!this.restrictedLevels.some(s=>e.bitrate===s.bitrate&&e.width===s.width&&e.height===s.height)}static getMaxLevelByMediaSize(e,t,s){if(!(e!=null&&e.length))return-1;const i=(o,l)=>l?o.width!==l.width||o.height!==l.height:!0;let r=e.length-1;const n=Math.max(t,s);for(let o=0;o=n||l.height>=n)&&i(l,e[o+1])){r=o;break}}return r}}class Tl{constructor(e){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=e,this.registerListeners()}setStreamController(e){this.streamController=e}registerListeners(){this.hls.on(p.MEDIA_ATTACHING,this.onMediaAttaching,this)}unregisterListeners(){this.hls.off(p.MEDIA_ATTACHING,this.onMediaAttaching,this)}destroy(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}onMediaAttaching(e,t){const s=this.hls.config;if(s.capLevelOnFPSDrop){const i=t.media instanceof self.HTMLVideoElement?t.media:null;this.media=i,i&&typeof i.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),s.fpsDroppedMonitoringPeriod)}}checkFPS(e,t,s){const i=performance.now();if(t){if(this.lastTime){const r=i-this.lastTime,n=s-this.lastDroppedFrames,o=t-this.lastDecodedFrames,l=1e3*n/r,c=this.hls;if(c.trigger(p.FPS_DROP,{currentDropped:n,currentDecoded:o,totalDroppedFrames:s}),l>0&&n>c.config.fpsDroppedMonitoringThreshold*o){let h=c.currentLevel;v.warn("drop FPS ratio greater than max allowed value for currentLevel: "+h),h>0&&(c.autoLevelCapping===-1||c.autoLevelCapping>=h)&&(h=h-1,c.trigger(p.FPS_DROP_LEVEL_CAPPING,{level:h,droppedLevel:c.currentLevel}),c.autoLevelCapping=h,this.streamController.nextLevelSwitch())}}this.lastTime=i,this.lastDroppedFrames=s,this.lastDecodedFrames=t}}checkFPSInterval(){const e=this.media;if(e)if(this.isVideoPlaybackQualityAvailable){const t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)}}const dt="[eme]";class Ye{constructor(e){this.hls=void 0,this.config=void 0,this.media=null,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.setMediaKeysQueue=Ye.CDMCleanupPromise?[Ye.CDMCleanupPromise]:[],this.onMediaEncrypted=this._onMediaEncrypted.bind(this),this.onWaitingForKey=this._onWaitingForKey.bind(this),this.debug=v.debug.bind(v,dt),this.log=v.log.bind(v,dt),this.warn=v.warn.bind(v,dt),this.error=v.error.bind(v,dt),this.hls=e,this.config=e.config,this.registerListeners()}destroy(){this.unregisterListeners(),this.onMediaDetached();const e=this.config;e.requestMediaKeySystemAccessFunc=null,e.licenseXhrSetup=e.licenseResponseCallback=void 0,e.drmSystems=e.drmSystemOptions={},this.hls=this.onMediaEncrypted=this.onWaitingForKey=this.keyIdToKeySessionPromise=null,this.config=null}registerListeners(){this.hls.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(p.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(p.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(p.MANIFEST_LOADED,this.onManifestLoaded,this)}unregisterListeners(){this.hls.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(p.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(p.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(p.MANIFEST_LOADED,this.onManifestLoaded,this)}getLicenseServerUrl(e){const{drmSystems:t,widevineLicenseUrl:s}=this.config,i=t[e];if(i)return i.licenseUrl;if(e===Z.WIDEVINE&&s)return s;throw new Error(`no license server URL configured for key-system "${e}"`)}getServerCertificateUrl(e){const{drmSystems:t}=this.config,s=t[e];if(s)return s.serverCertificateUrl;this.log(`No Server Certificate in config.drmSystems["${e}"]`)}attemptKeySystemAccess(e){const t=this.hls.levels,s=(n,o,l)=>!!n&&l.indexOf(n)===o,i=t.map(n=>n.audioCodec).filter(s),r=t.map(n=>n.videoCodec).filter(s);return i.length+r.length===0&&r.push("avc1.42e01e"),new Promise((n,o)=>{const l=c=>{const h=c.shift();this.getMediaKeysPromise(h,i,r).then(u=>n({keySystem:h,mediaKeys:u})).catch(u=>{c.length?l(c):u instanceof ge?o(u):o(new ge({type:$.KEY_SYSTEM_ERROR,details:L.KEY_SYSTEM_NO_ACCESS,error:u,fatal:!0},u.message))})};l(e)})}requestMediaKeySystemAccess(e,t){const{requestMediaKeySystemAccessFunc:s}=this.config;if(typeof s!="function"){let i=`Configured requestMediaKeySystemAccess is not a function ${s}`;return Hi===null&&self.location.protocol==="http:"&&(i=`navigator.requestMediaKeySystemAccess is not available over insecure protocol ${location.protocol}`),Promise.reject(new Error(i))}return s(e,t)}getMediaKeysPromise(e,t,s){const i=An(e,t,s,this.config.drmSystemOptions),r=this.keySystemAccessPromises[e];let n=r==null?void 0:r.keySystemAccess;if(!n){this.log(`Requesting encrypted media "${e}" key-system access with config: ${JSON.stringify(i)}`),n=this.requestMediaKeySystemAccess(e,i);const o=this.keySystemAccessPromises[e]={keySystemAccess:n};return n.catch(l=>{this.log(`Failed to obtain access to key-system "${e}": ${l}`)}),n.then(l=>{this.log(`Access for key-system "${l.keySystem}" obtained`);const c=this.fetchServerCertificate(e);return this.log(`Create media-keys for "${e}"`),o.mediaKeys=l.createMediaKeys().then(h=>(this.log(`Media-keys created for "${e}"`),c.then(u=>u?this.setMediaKeysServerCertificate(h,e,u):h))),o.mediaKeys.catch(h=>{this.error(`Failed to create media-keys for "${e}"}: ${h}`)}),o.mediaKeys})}return n.then(()=>r.mediaKeys)}createMediaKeySessionContext({decryptdata:e,keySystem:t,mediaKeys:s}){this.log(`Creating key-system session "${t}" keyId: ${Se.hexDump(e.keyId||[])}`);const i=s.createSession(),r={decryptdata:e,keySystem:t,mediaKeys:s,mediaKeysSession:i,keyStatus:"status-pending"};return this.mediaKeySessions.push(r),r}renewKeySession(e){const t=e.decryptdata;if(t.pssh){const s=this.createMediaKeySessionContext(e),i=this.getKeyIdString(t),r="cenc";this.keyIdToKeySessionPromise[i]=this.generateRequestWithPreferredKeySession(s,r,t.pssh,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(e)}getKeyIdString(e){if(!e)throw new Error("Could not read keyId of undefined decryptdata");if(e.keyId===null)throw new Error("keyId is null");return Se.hexDump(e.keyId)}updateKeySession(e,t){var s;const i=e.mediaKeysSession;return this.log(`Updating key-session "${i.sessionId}" for keyID ${Se.hexDump(((s=e.decryptdata)==null?void 0:s.keyId)||[])} + } (data length: ${t&&t.byteLength})`),i.update(t)}selectKeySystemFormat(e){const t=Object.keys(e.levelkeys||{});return this.keyFormatPromise||(this.log(`Selecting key-system from fragment (sn: ${e.sn} ${e.type}: ${e.level}) key formats ${t.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(t)),this.keyFormatPromise}getKeyFormatPromise(e){return new Promise((t,s)=>{const i=Bt(this.config),r=e.map($s).filter(n=>!!n&&i.indexOf(n)!==-1);return this.getKeySystemSelectionPromise(r).then(({keySystem:n})=>{const o=Gs(n);o?t(o):s(new Error(`Unable to find format for key-system "${n}"`))}).catch(s)})}loadKey(e){const t=e.keyInfo.decryptdata,s=this.getKeyIdString(t),i=`(keyId: ${s} format: "${t.keyFormat}" method: ${t.method} uri: ${t.uri})`;this.log(`Starting session for key ${i}`);let r=this.keyIdToKeySessionPromise[s];return r||(r=this.keyIdToKeySessionPromise[s]=this.getKeySystemForKeyPromise(t).then(({keySystem:n,mediaKeys:o})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${e.frag.sn} ${e.frag.type}: ${e.frag.level} using key ${i}`),this.attemptSetMediaKeys(n,o).then(()=>{this.throwIfDestroyed();const l=this.createMediaKeySessionContext({keySystem:n,mediaKeys:o,decryptdata:t});return this.generateRequestWithPreferredKeySession(l,"cenc",t.pssh,"playlist-key")}))),r.catch(n=>this.handleError(n))),r}throwIfDestroyed(e="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(e){this.hls&&(this.error(e.message),e instanceof ge?this.hls.trigger(p.ERROR,e.data):this.hls.trigger(p.ERROR,{type:$.KEY_SYSTEM_ERROR,details:L.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0}))}getKeySystemForKeyPromise(e){const t=this.getKeyIdString(e),s=this.keyIdToKeySessionPromise[t];if(!s){const i=$s(e.keyFormat),r=i?[i]:Bt(this.config);return this.attemptKeySystemAccess(r)}return s}getKeySystemSelectionPromise(e){if(e.length||(e=Bt(this.config)),e.length===0)throw new ge({type:$.KEY_SYSTEM_ERROR,details:L.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${JSON.stringify({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(e)}_onMediaEncrypted(e){const{initDataType:t,initData:s}=e;if(this.debug(`"${e.type}" event: init data type: "${t}"`),s===null)return;let i,r;if(t==="sinf"&&this.config.drmSystems[Z.FAIRPLAY]){const h=ie(new Uint8Array(s));try{const u=Ss(JSON.parse(h).sinf),d=Ji(new Uint8Array(u));if(!d)return;i=d.subarray(8,24),r=Z.FAIRPLAY}catch{this.warn('Failed to parse sinf "encrypted" event message initData');return}}else{const h=jn(s);if(h===null)return;h.version===0&&h.systemId===Vi.WIDEVINE&&h.data&&(i=h.data.subarray(8,24)),r=vn(h.systemId)}if(!r||!i)return;const n=Se.hexDump(i),{keyIdToKeySessionPromise:o,mediaKeySessions:l}=this;let c=o[n];for(let h=0;hthis.generateRequestWithPreferredKeySession(u,t,s,"encrypted-event-key-match"));break}}c||(c=o[n]=this.getKeySystemSelectionPromise([r]).then(({keySystem:h,mediaKeys:u})=>{var d;this.throwIfDestroyed();const g=new tt("ISO-23001-7",n,(d=Gs(h))!=null?d:"");return g.pssh=new Uint8Array(s),g.keyId=i,this.attemptSetMediaKeys(h,u).then(()=>{this.throwIfDestroyed();const f=this.createMediaKeySessionContext({decryptdata:g,keySystem:h,mediaKeys:u});return this.generateRequestWithPreferredKeySession(f,t,s,"encrypted-event-no-match")})})),c.catch(h=>this.handleError(h))}_onWaitingForKey(e){this.log(`"${e.type}" event`)}attemptSetMediaKeys(e,t){const s=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${e}"`);const i=Promise.all(s).then(()=>{if(!this.media)throw new Error("Attempted to set mediaKeys without media element attached");return this.media.setMediaKeys(t)});return this.setMediaKeysQueue.push(i),i.then(()=>{this.log(`Media-keys set for "${e}"`),s.push(i),this.setMediaKeysQueue=this.setMediaKeysQueue.filter(r=>s.indexOf(r)===-1)})}generateRequestWithPreferredKeySession(e,t,s,i){var r,n;const o=(r=this.config.drmSystems)==null||(n=r[e.keySystem])==null?void 0:n.generateRequest;if(o)try{const f=o.call(this.hls,t,s,e);if(!f)throw new Error("Invalid response from configured generateRequest filter");t=f.initDataType,s=e.decryptdata.pssh=f.initData?new Uint8Array(f.initData):null}catch(f){var l;if(this.warn(f.message),(l=this.hls)!=null&&l.config.debug)throw f}if(s===null)return this.log(`Skipping key-session request for "${i}" (no initData)`),Promise.resolve(e);const c=this.getKeyIdString(e.decryptdata);this.log(`Generating key-session request for "${i}": ${c} (init data type: ${t} length: ${s?s.byteLength:null})`);const h=new Ps,u=e._onmessage=f=>{const m=e.mediaKeysSession;if(!m){h.emit("error",new Error("invalid state"));return}const{messageType:T,message:E}=f;this.log(`"${T}" message event for session "${m.sessionId}" message size: ${E.byteLength}`),T==="license-request"||T==="license-renewal"?this.renewLicense(e,E).catch(x=>{this.handleError(x),h.emit("error",x)}):T==="license-release"?e.keySystem===Z.FAIRPLAY&&(this.updateKeySession(e,as("acknowledged")),this.removeSession(e)):this.warn(`unhandled media key message type "${T}"`)},d=e._onkeystatuseschange=f=>{if(!e.mediaKeysSession){h.emit("error",new Error("invalid state"));return}this.onKeyStatusChange(e);const T=e.keyStatus;h.emit("keyStatus",T),T==="expired"&&(this.warn(`${e.keySystem} expired for key ${c}`),this.renewKeySession(e))};e.mediaKeysSession.addEventListener("message",u),e.mediaKeysSession.addEventListener("keystatuseschange",d);const g=new Promise((f,m)=>{h.on("error",m),h.on("keyStatus",T=>{T.startsWith("usable")?f():T==="output-restricted"?m(new ge({type:$.KEY_SYSTEM_ERROR,details:L.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):T==="internal-error"?m(new ge({type:$.KEY_SYSTEM_ERROR,details:L.KEY_SYSTEM_STATUS_INTERNAL_ERROR,fatal:!0},`key status changed to "${T}"`)):T==="expired"?m(new Error("key expired while generating request")):this.warn(`unhandled key status change "${T}"`)})});return e.mediaKeysSession.generateRequest(t,s).then(()=>{var f;this.log(`Request generated for key-session "${(f=e.mediaKeysSession)==null?void 0:f.sessionId}" keyId: ${c}`)}).catch(f=>{throw new ge({type:$.KEY_SYSTEM_ERROR,details:L.KEY_SYSTEM_NO_SESSION,error:f,fatal:!1},`Error generating key-session request: ${f}`)}).then(()=>g).catch(f=>{throw h.removeAllListeners(),this.removeSession(e),f}).then(()=>(h.removeAllListeners(),e))}onKeyStatusChange(e){e.mediaKeysSession.keyStatuses.forEach((t,s)=>{this.log(`key status change "${t}" for keyStatuses keyId: ${Se.hexDump("buffer"in s?new Uint8Array(s.buffer,s.byteOffset,s.byteLength):new Uint8Array(s))} session keyId: ${Se.hexDump(new Uint8Array(e.decryptdata.keyId||[]))} uri: ${e.decryptdata.uri}`),e.keyStatus=t})}fetchServerCertificate(e){const t=this.config,s=t.loader,i=new s(t),r=this.getServerCertificateUrl(e);return r?(this.log(`Fetching server certificate for "${e}"`),new Promise((n,o)=>{const l={responseType:"arraybuffer",url:r},c=t.certLoadPolicy.default,h={loadPolicy:c,timeout:c.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},u={onSuccess:(d,g,f,m)=>{n(d.data)},onError:(d,g,f,m)=>{o(new ge({type:$.KEY_SYSTEM_ERROR,details:L.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:f,response:oe({url:l.url,data:void 0},d)},`"${e}" certificate request failed (${r}). Status: ${d.code} (${d.text})`))},onTimeout:(d,g,f)=>{o(new ge({type:$.KEY_SYSTEM_ERROR,details:L.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:f,response:{url:l.url,data:void 0}},`"${e}" certificate request timed out (${r})`))},onAbort:(d,g,f)=>{o(new Error("aborted"))}};i.load(l,h,u)})):Promise.resolve()}setMediaKeysServerCertificate(e,t,s){return new Promise((i,r)=>{e.setServerCertificate(s).then(n=>{this.log(`setServerCertificate ${n?"success":"not supported by CDM"} (${s==null?void 0:s.byteLength}) on "${t}"`),i(e)}).catch(n=>{r(new ge({type:$.KEY_SYSTEM_ERROR,details:L.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:n,fatal:!0},n.message))})})}renewLicense(e,t){return this.requestLicense(e,new Uint8Array(t)).then(s=>this.updateKeySession(e,new Uint8Array(s)).catch(i=>{throw new ge({type:$.KEY_SYSTEM_ERROR,details:L.KEY_SYSTEM_SESSION_UPDATE_FAILED,error:i,fatal:!0},i.message)}))}unpackPlayReadyKeyMessage(e,t){const s=String.fromCharCode.apply(null,new Uint16Array(t.buffer));if(!s.includes("PlayReadyKeyMessage"))return e.setRequestHeader("Content-Type","text/xml; charset=utf-8"),t;const i=new DOMParser().parseFromString(s,"application/xml"),r=i.querySelectorAll("HttpHeader");if(r.length>0){let h;for(let u=0,d=r.length;u in key message");return as(atob(c))}setupLicenseXHR(e,t,s,i){const r=this.config.licenseXhrSetup;return r?Promise.resolve().then(()=>{if(!s.decryptdata)throw new Error("Key removed");return r.call(this.hls,e,t,s,i)}).catch(n=>{if(!s.decryptdata)throw n;return e.open("POST",t,!0),r.call(this.hls,e,t,s,i)}).then(n=>(e.readyState||e.open("POST",t,!0),{xhr:e,licenseChallenge:n||i})):(e.open("POST",t,!0),Promise.resolve({xhr:e,licenseChallenge:i}))}requestLicense(e,t){const s=this.config.keyLoadPolicy.default;return new Promise((i,r)=>{const n=this.getLicenseServerUrl(e.keySystem);this.log(`Sending license request to URL: ${n}`);const o=new XMLHttpRequest;o.responseType="arraybuffer",o.onreadystatechange=()=>{if(!this.hls||!e.mediaKeysSession)return r(new Error("invalid state"));if(o.readyState===4)if(o.status===200){this._requestLicenseFailureCount=0;let l=o.response;this.log(`License received ${l instanceof ArrayBuffer?l.byteLength:l}`);const c=this.config.licenseResponseCallback;if(c)try{l=c.call(this.hls,o,n,e)}catch(h){this.error(h)}i(l)}else{const l=s.errorRetry,c=l?l.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>c||o.status>=400&&o.status<500)r(new ge({type:$.KEY_SYSTEM_ERROR,details:L.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0,networkDetails:o,response:{url:n,data:void 0,code:o.status,text:o.statusText}},`License Request XHR failed (${n}). Status: ${o.status} (${o.statusText})`));else{const h=c-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${h} attempts left`),this.requestLicense(e,t).then(i,r)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=o,this.setupLicenseXHR(o,n,e,t).then(({xhr:l,licenseChallenge:c})=>{e.keySystem==Z.PLAYREADY&&(c=this.unpackPlayReadyKeyMessage(l,c)),l.send(c)})})}onMediaAttached(e,t){if(!this.config.emeEnabled)return;const s=t.media;this.media=s,s.addEventListener("encrypted",this.onMediaEncrypted),s.addEventListener("waitingforkey",this.onWaitingForKey)}onMediaDetached(){const e=this.media,t=this.mediaKeySessions;e&&(e.removeEventListener("encrypted",this.onMediaEncrypted),e.removeEventListener("waitingforkey",this.onWaitingForKey),this.media=null),this._requestLicenseFailureCount=0,this.setMediaKeysQueue=[],this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},tt.clearKeyUriToKeyIdMap();const s=t.length;Ye.CDMCleanupPromise=Promise.all(t.map(i=>this.removeSession(i)).concat(e==null?void 0:e.setMediaKeys(null).catch(i=>{this.log(`Could not clear media keys: ${i}`)}))).then(()=>{s&&(this.log("finished closing key sessions and clearing media keys"),t.length=0)}).catch(i=>{this.log(`Could not close sessions and clear media keys: ${i}`)})}onManifestLoading(){this.keyFormatPromise=null}onManifestLoaded(e,{sessionKeys:t}){if(!(!t||!this.config.emeEnabled)&&!this.keyFormatPromise){const s=t.reduce((i,r)=>(i.indexOf(r.keyFormat)===-1&&i.push(r.keyFormat),i),[]);this.log(`Selecting key-system from session-keys ${s.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(s)}}removeSession(e){const{mediaKeysSession:t,licenseXhr:s}=e;if(t){this.log(`Remove licenses and keys and close session ${t.sessionId}`),e._onmessage&&(t.removeEventListener("message",e._onmessage),e._onmessage=void 0),e._onkeystatuseschange&&(t.removeEventListener("keystatuseschange",e._onkeystatuseschange),e._onkeystatuseschange=void 0),s&&s.readyState!==XMLHttpRequest.DONE&&s.abort(),e.mediaKeysSession=e.decryptdata=e.licenseXhr=void 0;const i=this.mediaKeySessions.indexOf(e);return i>-1&&this.mediaKeySessions.splice(i,1),t.remove().catch(r=>{this.log(`Could not remove session: ${r}`)}).then(()=>t.close()).catch(r=>{this.log(`Could not close session: ${r}`)})}}}Ye.CDMCleanupPromise=void 0;class ge extends Error{constructor(e,t){super(t),this.data=void 0,e.error||(e.error=new Error(t)),this.data=e,e.err=e.error}}var he;(function(a){a.MANIFEST="m",a.AUDIO="a",a.VIDEO="v",a.MUXED="av",a.INIT="i",a.CAPTION="c",a.TIMED_TEXT="tt",a.KEY="k",a.OTHER="o"})(he||(he={}));var ps;(function(a){a.DASH="d",a.HLS="h",a.SMOOTH="s",a.OTHER="o"})(ps||(ps={}));var Me;(function(a){a.OBJECT="CMCD-Object",a.REQUEST="CMCD-Request",a.SESSION="CMCD-Session",a.STATUS="CMCD-Status"})(Me||(Me={}));const El={[Me.OBJECT]:["br","d","ot","tb"],[Me.REQUEST]:["bl","dl","mtp","nor","nrr","su"],[Me.SESSION]:["cid","pr","sf","sid","st","v"],[Me.STATUS]:["bs","rtp"]};class Xe{constructor(e,t){this.value=void 0,this.params=void 0,Array.isArray(e)&&(e=e.map(s=>s instanceof Xe?s:new Xe(s))),this.value=e,this.params=t}}class Br{constructor(e){this.description=void 0,this.description=e}}const yl="Dict";function xl(a){return Array.isArray(a)?JSON.stringify(a):a instanceof Map?"Map{}":a instanceof Set?"Set{}":typeof a=="object"?JSON.stringify(a):String(a)}function Sl(a,e,t,s){return new Error(`failed to ${a} "${xl(e)}" as ${t}`,{cause:s})}const Fi="Bare Item",vl="Boolean",Al="Byte Sequence",Ll="Decimal",Rl="Integer";function Il(a){return a<-999999999999999||99999999999999912)throw Ie(a,Ll);const t=e.toString();return t.includes(".")?t:`${t}.0`}const Ol="String";function Ml(a){if(bl.test(a))throw Ie(a,Ol);return`"${a.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function Nl(a){return a.description||a.toString().slice(7,-1)}function Oi(a){const e=Nl(a);if(/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(e)===!1)throw Ie(e,Dl);return e}function Ts(a){switch(typeof a){case"number":if(!O(a))throw Ie(a,Fi);return Number.isInteger(a)?$r(a):Fl(a);case"string":return Ml(a);case"symbol":return Oi(a);case"boolean":return _l(a);case"object":if(a instanceof Date)return Pl(a);if(a instanceof Uint8Array)return kl(a);if(a instanceof Br)return Oi(a);default:throw Ie(a,Fi)}}function Es(a){if(/^[a-z*][a-z0-9\-_.*]*$/.test(a)===!1)throw Ie(a,Cl);return a}function Ns(a){return a==null?"":Object.entries(a).map(([e,t])=>t===!0?`;${Es(e)}`:`;${Es(e)}=${Ts(t)}`).join("")}function Kr(a){return a instanceof Xe?`${Ts(a.value)}${Ns(a.params)}`:Ts(a)}function Ul(a){return`(${a.value.map(Kr).join(" ")})${Ns(a.params)}`}function Bl(a,e={whitespace:!0}){if(typeof a!="object")throw Ie(a,yl);const t=a instanceof Map?a.entries():Object.entries(a),s=e!=null&&e.whitespace?" ":"";return Array.from(t).map(([i,r])=>{r instanceof Xe||(r=new Xe(r));let n=Es(i);return r.value===!0?n+=Ns(r.params):(n+="=",Array.isArray(r.value)?n+=Ul(r):n+=Kr(r)),n}).join(`,${s}`)}function $l(a,e){return Bl(a,e)}const Gl=a=>a==="ot"||a==="sf"||a==="st",Kl=a=>typeof a=="number"?O(a):a!=null&&a!==""&&a!==!1;function Vl(a,e){const t=new URL(a),s=new URL(e);if(t.origin!==s.origin)return a;const i=t.pathname.split("/").slice(1),r=s.pathname.split("/").slice(1,-1);for(;i[0]===r[0];)i.shift(),r.shift();for(;r.length;)r.shift(),i.unshift("..");return i.join("/")}function Hl(){try{return crypto.randomUUID()}catch{try{const e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.slice(t.lastIndexOf("/")+1)}catch{let t=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,i=>{const r=(t+Math.random()*16)%16|0;return t=Math.floor(t/16),(i=="x"?r:r&3|8).toString(16)})}}}const xt=a=>Math.round(a),Wl=(a,e)=>(e!=null&&e.baseUrl&&(a=Vl(a,e.baseUrl)),encodeURIComponent(a)),ft=a=>xt(a/100)*100,Yl={br:xt,d:xt,bl:ft,dl:ft,mtp:ft,nor:Wl,rtp:ft,tb:xt};function ql(a,e){const t={};if(a==null||typeof a!="object")return t;const s=Object.keys(a).sort(),i=se({},Yl,e==null?void 0:e.formatters),r=e==null?void 0:e.filter;return s.forEach(n=>{if(r!=null&&r(n))return;let o=a[n];const l=i[n];l&&(o=l(o,e)),!(n==="v"&&o===1)&&(n=="pr"&&o===1||Kl(o)&&(Gl(n)&&typeof o=="string"&&(o=new Br(o)),t[n]=o))}),t}function Vr(a,e={}){return a?$l(ql(a,e),se({whitespace:!1},e)):""}function jl(a,e={}){if(!a)return{};const t=Object.entries(a),s=Object.entries(El).concat(Object.entries((e==null?void 0:e.customHeaderMap)||{})),i=t.reduce((r,n)=>{var o,l;const[c,h]=n,u=((o=s.find(d=>d[1].includes(c)))==null?void 0:o[0])||Me.REQUEST;return(l=r[u])!=null||(r[u]={}),r[u][c]=h,r},{});return Object.entries(i).reduce((r,[n,o])=>(r[n]=Vr(o,e),r),{})}function zl(a,e,t){return se(a,jl(e,t))}const Xl="CMCD";function Ql(a,e={}){if(!a)return"";const t=Vr(a,e);return`${Xl}=${encodeURIComponent(t)}`}const Mi=/CMCD=[^&#]+/;function Jl(a,e,t){const s=Ql(e,t);if(!s)return a;if(Mi.test(a))return a.replace(Mi,s);const i=a.includes("?")?"&":"?";return`${a}${i}${s}`}class Zl{constructor(e){this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.includeKeys=void 0,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=()=>{this.initialized&&(this.starved=!0),this.buffering=!0},this.onPlaying=()=>{this.initialized||(this.initialized=!0),this.buffering=!1},this.applyPlaylistData=i=>{try{this.apply(i,{ot:he.MANIFEST,su:!this.initialized})}catch(r){v.warn("Could not generate manifest CMCD data.",r)}},this.applyFragmentData=i=>{try{const r=i.frag,n=this.hls.levels[r.level],o=this.getObjectType(r),l={d:r.duration*1e3,ot:o};(o===he.VIDEO||o===he.AUDIO||o==he.MUXED)&&(l.br=n.bitrate/1e3,l.tb=this.getTopBandwidth(o)/1e3,l.bl=this.getBufferLength(o)),this.apply(i,l)}catch(r){v.warn("Could not generate segment CMCD data.",r)}},this.hls=e;const t=this.config=e.config,{cmcd:s}=t;s!=null&&(t.pLoader=this.createPlaylistLoader(),t.fLoader=this.createFragmentLoader(),this.sid=s.sessionId||Hl(),this.cid=s.contentId,this.useHeaders=s.useHeaders===!0,this.includeKeys=s.includeKeys,this.registerListeners())}registerListeners(){const e=this.hls;e.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(p.MEDIA_DETACHED,this.onMediaDetached,this),e.on(p.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const e=this.hls;e.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(p.MEDIA_DETACHED,this.onMediaDetached,this),e.off(p.BUFFER_CREATED,this.onBufferCreated,this)}destroy(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null,this.onWaiting=this.onPlaying=null}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)}onMediaDetached(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)}onBufferCreated(e,t){var s,i;this.audioBuffer=(s=t.tracks.audio)==null?void 0:s.buffer,this.videoBuffer=(i=t.tracks.video)==null?void 0:i.buffer}createData(){var e;return{v:1,sf:ps.HLS,sid:this.sid,cid:this.cid,pr:(e=this.media)==null?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(e,t={}){se(t,this.createData());const s=t.ot===he.INIT||t.ot===he.VIDEO||t.ot===he.MUXED;this.starved&&s&&(t.bs=!0,t.su=!0,this.starved=!1),t.su==null&&(t.su=this.buffering);const{includeKeys:i}=this;i&&(t=Object.keys(t).reduce((r,n)=>(i.includes(n)&&(r[n]=t[n]),r),{})),this.useHeaders?(e.headers||(e.headers={}),zl(e.headers,t)):e.url=Jl(e.url,t)}getObjectType(e){const{type:t}=e;if(t==="subtitle")return he.TIMED_TEXT;if(e.sn==="initSegment")return he.INIT;if(t==="audio")return he.AUDIO;if(t==="main")return this.hls.audioTracks.length?he.VIDEO:he.MUXED}getTopBandwidth(e){let t=0,s;const i=this.hls;if(e===he.AUDIO)s=i.audioTracks;else{const r=i.maxAutoLevel,n=r>-1?r+1:i.levels.length;s=i.levels.slice(0,n)}for(const r of s)r.bitrate>t&&(t=r.bitrate);return t>0?t:NaN}getBufferLength(e){const t=this.hls.media,s=e===he.AUDIO?this.audioBuffer:this.videoBuffer;return!s||!t?NaN:J.bufferInfo(s,t.currentTime,this.config.maxBufferHole).len*1e3}createPlaylistLoader(){const{pLoader:e}=this.config,t=this.applyPlaylistData,s=e||this.config.loader;return class{constructor(r){this.loader=void 0,this.loader=new s(r)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(r,n,o){t(r),this.loader.load(r,n,o)}}}createFragmentLoader(){const{fLoader:e}=this.config,t=this.applyFragmentData,s=e||this.config.loader;return class{constructor(r){this.loader=void 0,this.loader=new s(r)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(r,n,o){t(r),this.loader.load(r,n,o)}}}}const ec=3e5;class tc{constructor(e){this.hls=void 0,this.log=void 0,this.loader=null,this.uri=null,this.pathwayId=".",this.pathwayPriority=null,this.timeToLoad=300,this.reloadTimer=-1,this.updated=0,this.started=!1,this.enabled=!0,this.levels=null,this.audioTracks=null,this.subtitleTracks=null,this.penalizedPathways={},this.hls=e,this.log=v.log.bind(v,"[content-steering]:"),this.registerListeners()}registerListeners(){const e=this.hls;e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(p.MANIFEST_PARSED,this.onManifestParsed,this),e.on(p.ERROR,this.onError,this)}unregisterListeners(){const e=this.hls;e&&(e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(p.MANIFEST_PARSED,this.onManifestParsed,this),e.off(p.ERROR,this.onError,this))}startLoad(){if(this.started=!0,this.clearTimeout(),this.enabled&&this.uri){if(this.updated){const e=this.timeToLoad*1e3-(performance.now()-this.updated);if(e>0){this.scheduleRefresh(this.uri,e);return}}this.loadSteeringManifest(this.uri)}}stopLoad(){this.started=!1,this.loader&&(this.loader.destroy(),this.loader=null),this.clearTimeout()}clearTimeout(){this.reloadTimer!==-1&&(self.clearTimeout(this.reloadTimer),this.reloadTimer=-1)}destroy(){this.unregisterListeners(),this.stopLoad(),this.hls=null,this.levels=this.audioTracks=this.subtitleTracks=null}removeLevel(e){const t=this.levels;t&&(this.levels=t.filter(s=>s!==e))}onManifestLoading(){this.stopLoad(),this.enabled=!0,this.timeToLoad=300,this.updated=0,this.uri=null,this.pathwayId=".",this.levels=this.audioTracks=this.subtitleTracks=null}onManifestLoaded(e,t){const{contentSteering:s}=t;s!==null&&(this.pathwayId=s.pathwayId,this.uri=s.uri,this.started&&this.startLoad())}onManifestParsed(e,t){this.audioTracks=t.audioTracks,this.subtitleTracks=t.subtitleTracks}onError(e,t){const{errorAction:s}=t;if((s==null?void 0:s.action)===ce.SendAlternateToPenaltyBox&&s.flags===Te.MoveAllAlternatesMatchingHost){const i=this.levels;let r=this.pathwayPriority,n=this.pathwayId;if(t.context){const{groupId:o,pathwayId:l,type:c}=t.context;o&&i?n=this.getPathwayForGroupId(o,c,n):l&&(n=l)}n in this.penalizedPathways||(this.penalizedPathways[n]=performance.now()),!r&&i&&(r=i.reduce((o,l)=>(o.indexOf(l.pathwayId)===-1&&o.push(l.pathwayId),o),[])),r&&r.length>1&&(this.updatePathwayPriority(r),s.resolved=this.pathwayId!==n),s.resolved||v.warn(`Could not resolve ${t.details} ("${t.error.message}") with content-steering for Pathway: ${n} levels: ${i&&i.length} priorities: ${JSON.stringify(r)} penalized: ${JSON.stringify(this.penalizedPathways)}`)}}filterParsedLevels(e){this.levels=e;let t=this.getLevelsForPathway(this.pathwayId);if(t.length===0){const s=e[0].pathwayId;this.log(`No levels found in Pathway ${this.pathwayId}. Setting initial Pathway to "${s}"`),t=this.getLevelsForPathway(s),this.pathwayId=s}return t.length!==e.length?(this.log(`Found ${t.length}/${e.length} levels in Pathway "${this.pathwayId}"`),t):e}getLevelsForPathway(e){return this.levels===null?[]:this.levels.filter(t=>e===t.pathwayId)}updatePathwayPriority(e){this.pathwayPriority=e;let t;const s=this.penalizedPathways,i=performance.now();Object.keys(s).forEach(r=>{i-s[r]>ec&&delete s[r]});for(let r=0;r0){this.log(`Setting Pathway to "${n}"`),this.pathwayId=n,lr(t),this.hls.trigger(p.LEVELS_UPDATED,{levels:t});const c=this.hls.levels[o];l&&c&&this.levels&&(c.attrs["STABLE-VARIANT-ID"]!==l.attrs["STABLE-VARIANT-ID"]&&c.bitrate!==l.bitrate&&this.log(`Unstable Pathways change from bitrate ${l.bitrate} to ${c.bitrate}`),this.hls.nextLoadLevel=o);break}}}getPathwayForGroupId(e,t,s){const i=this.getLevelsForPathway(s).concat(this.levels||[]);for(let r=0;r{const{ID:n,"BASE-ID":o,"URI-REPLACEMENT":l}=r;if(t.some(h=>h.pathwayId===n))return;const c=this.getLevelsForPathway(o).map(h=>{const u=new ee(h.attrs);u["PATHWAY-ID"]=n;const d=u.AUDIO&&`${u.AUDIO}_clone_${n}`,g=u.SUBTITLES&&`${u.SUBTITLES}_clone_${n}`;d&&(s[u.AUDIO]=d,u.AUDIO=d),g&&(i[u.SUBTITLES]=g,u.SUBTITLES=g);const f=Hr(h.uri,u["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",l),m=new je({attrs:u,audioCodec:h.audioCodec,bitrate:h.bitrate,height:h.height,name:h.name,url:f,videoCodec:h.videoCodec,width:h.width});if(h.audioGroups)for(let T=1;T{this.log(`Loaded steering manifest: "${i}"`);const f=h.data;if(f.VERSION!==1){this.log(`Steering VERSION ${f.VERSION} not supported!`);return}this.updated=performance.now(),this.timeToLoad=f.TTL;const{"RELOAD-URI":m,"PATHWAY-CLONES":T,"PATHWAY-PRIORITY":E}=f;if(m)try{this.uri=new self.URL(m,i).href}catch{this.enabled=!1,this.log(`Failed to parse Steering Manifest RELOAD-URI: ${m}`);return}this.scheduleRefresh(this.uri||d.url),T&&this.clonePathways(T);const x={steeringManifest:f,url:i.toString()};this.hls.trigger(p.STEERING_MANIFEST_LOADED,x),E&&this.updatePathwayPriority(E)},onError:(h,u,d,g)=>{if(this.log(`Error loading steering manifest: ${h.code} ${h.text} (${u.url})`),this.stopLoad(),h.code===410){this.enabled=!1,this.log(`Steering manifest ${u.url} no longer available`);return}let f=this.timeToLoad*1e3;if(h.code===429){const m=this.loader;if(typeof(m==null?void 0:m.getResponseHeader)=="function"){const T=m.getResponseHeader("Retry-After");T&&(f=parseFloat(T)*1e3)}this.log(`Steering manifest ${u.url} rate limited`);return}this.scheduleRefresh(this.uri||u.url,f)},onTimeout:(h,u,d)=>{this.log(`Timeout loading steering manifest (${u.url})`),this.scheduleRefresh(this.uri||u.url)}};this.log(`Requesting steering manifest: ${i}`),this.loader.load(r,l,c)}scheduleRefresh(e,t=this.timeToLoad*1e3){this.clearTimeout(),this.reloadTimer=self.setTimeout(()=>{var s;const i=(s=this.hls)==null?void 0:s.media;if(i&&!i.ended){this.loadSteeringManifest(e);return}this.scheduleRefresh(e,this.timeToLoad*1e3)},t)}}function Ni(a,e,t,s){a&&Object.keys(e).forEach(i=>{const r=a.filter(n=>n.groupId===i).map(n=>{const o=se({},n);return o.details=void 0,o.attrs=new ee(o.attrs),o.url=o.attrs.URI=Hr(n.url,n.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",t),o.groupId=o.attrs["GROUP-ID"]=e[i],o.attrs["PATHWAY-ID"]=s,o});a.push(...r)})}function Hr(a,e,t,s){const{HOST:i,PARAMS:r,[t]:n}=s;let o;e&&(o=n==null?void 0:n[e],o&&(a=o));const l=new self.URL(a);return i&&!o&&(l.host=i),r&&Object.keys(r).sort().forEach(c=>{c&&l.searchParams.set(c,r[c])}),l.href}const sc=/^age:\s*[\d.]+\s*$/im;class Wr{constructor(e){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=null,this.loader=null,this.stats=void 0,this.xhrSetup=e&&e.xhrSetup||null,this.stats=new Ft,this.retryDelay=0}destroy(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null,this.context=null,this.xhrSetup=null}abortInternal(){const e=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),e&&(e.onreadystatechange=null,e.onprogress=null,e.readyState!==4&&(this.stats.aborted=!0,e.abort()))}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}load(e,t,s){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=e,this.config=t,this.callbacks=s,this.loadInternal()}loadInternal(){const{config:e,context:t}=this;if(!e||!t)return;const s=this.loader=new self.XMLHttpRequest,i=this.stats;i.loading.first=0,i.loaded=0,i.aborted=!1;const r=this.xhrSetup;r?Promise.resolve().then(()=>{if(!(this.loader!==s||this.stats.aborted))return r(s,t.url)}).catch(n=>{if(!(this.loader!==s||this.stats.aborted))return s.open("GET",t.url,!0),r(s,t.url)}).then(()=>{this.loader!==s||this.stats.aborted||this.openAndSendXhr(s,t,e)}).catch(n=>{this.callbacks.onError({code:s.status,text:n.message},t,s,i)}):this.openAndSendXhr(s,t,e)}openAndSendXhr(e,t,s){e.readyState||e.open("GET",t.url,!0);const i=t.headers,{maxTimeToFirstByteMs:r,maxLoadTimeMs:n}=s.loadPolicy;if(i)for(const o in i)e.setRequestHeader(o,i[o]);t.rangeEnd&&e.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,self.clearTimeout(this.requestTimeout),s.timeout=r&&O(r)?r:n,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),s.timeout),e.send()}readystatechange(){const{context:e,loader:t,stats:s}=this;if(!e||!t)return;const i=t.readyState,r=this.config;if(!s.aborted&&i>=2&&(s.loading.first===0&&(s.loading.first=Math.max(self.performance.now(),s.loading.start),r.timeout!==r.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),r.timeout=r.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),r.loadPolicy.maxLoadTimeMs-(s.loading.first-s.loading.start)))),i===4)){self.clearTimeout(this.requestTimeout),t.onreadystatechange=null,t.onprogress=null;const n=t.status,o=t.responseType!=="text";if(n>=200&&n<300&&(o&&t.response||t.responseText!==null)){s.loading.end=Math.max(self.performance.now(),s.loading.first);const l=o?t.response:t.responseText,c=t.responseType==="arraybuffer"?l.byteLength:l.length;if(s.loaded=s.total=c,s.bwEstimate=s.total*8e3/(s.loading.end-s.loading.first),!this.callbacks)return;const h=this.callbacks.onProgress;if(h&&h(s,e,l,t),!this.callbacks)return;const u={url:t.responseURL,data:l,code:n};this.callbacks.onSuccess(u,s,e,t)}else{const l=r.loadPolicy.errorRetry,c=s.retry,h={url:e.url,data:void 0,code:n};Dt(l,c,!1,h)?this.retry(l):(v.error(`${n} while loading ${e.url}`),this.callbacks.onError({code:n,text:t.statusText},e,t,s))}}}loadtimeout(){if(!this.config)return;const e=this.config.loadPolicy.timeoutRetry,t=this.stats.retry;if(Dt(e,t,!0))this.retry(e);else{var s;v.warn(`timeout while loading ${(s=this.context)==null?void 0:s.url}`);const i=this.callbacks;i&&(this.abortInternal(),i.onTimeout(this.stats,this.context,this.loader))}}retry(e){const{context:t,stats:s}=this;this.retryDelay=Ls(e,s.retry),s.retry++,v.warn(`${status?"HTTP Status "+status:"Timeout"} while loading ${t==null?void 0:t.url}, retrying ${s.retry}/${e.maxNumRetry} in ${this.retryDelay}ms`),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay)}loadprogress(e){const t=this.stats;t.loaded=e.loaded,e.lengthComputable&&(t.total=e.total)}getCacheAge(){let e=null;if(this.loader&&sc.test(this.loader.getAllResponseHeaders())){const t=this.loader.getResponseHeader("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.loader&&new RegExp(`^${e}:\\s*[\\d.]+\\s*$`,"im").test(this.loader.getAllResponseHeaders())?this.loader.getResponseHeader(e):null}}function ic(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch{}return!1}const rc=/(\d+)-(\d+)\/(\d+)/;class Ui{constructor(e){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=null,this.response=null,this.controller=void 0,this.context=null,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=e.fetchSetup||lc,this.controller=new self.AbortController,this.stats=new Ft}destroy(){this.loader=this.callbacks=this.context=this.config=this.request=null,this.abortInternal(),this.response=null,this.fetchSetup=this.controller=this.stats=null}abortInternal(){this.controller&&!this.stats.loading.end&&(this.stats.aborted=!0,this.controller.abort())}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)}load(e,t,s){const i=this.stats;if(i.loading.start)throw new Error("Loader can only be used once.");i.loading.start=self.performance.now();const r=nc(e,this.controller.signal),n=s.onProgress,o=e.responseType==="arraybuffer",l=o?"byteLength":"length",{maxTimeToFirstByteMs:c,maxLoadTimeMs:h}=t.loadPolicy;this.context=e,this.config=t,this.callbacks=s,this.request=this.fetchSetup(e,r),self.clearTimeout(this.requestTimeout),t.timeout=c&&O(c)?c:h,this.requestTimeout=self.setTimeout(()=>{this.abortInternal(),s.onTimeout(i,e,this.response)},t.timeout),self.fetch(this.request).then(u=>{this.response=this.loader=u;const d=Math.max(self.performance.now(),i.loading.start);if(self.clearTimeout(this.requestTimeout),t.timeout=h,this.requestTimeout=self.setTimeout(()=>{this.abortInternal(),s.onTimeout(i,e,this.response)},h-(d-i.loading.start)),!u.ok){const{status:g,statusText:f}=u;throw new cc(f||"fetch, bad network response",g,u)}return i.loading.first=d,i.total=oc(u.headers)||i.total,n&&O(t.highWaterMark)?this.loadProgressively(u,i,e,t.highWaterMark,n):o?u.arrayBuffer():e.responseType==="json"?u.json():u.text()}).then(u=>{const d=this.response;if(!d)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),i.loading.end=Math.max(self.performance.now(),i.loading.first);const g=u[l];g&&(i.loaded=i.total=g);const f={url:d.url,data:u,code:d.status};n&&!O(t.highWaterMark)&&n(i,e,u,d),s.onSuccess(f,i,e,d)}).catch(u=>{if(self.clearTimeout(this.requestTimeout),i.aborted)return;const d=u&&u.code||0,g=u?u.message:null;s.onError({code:d,text:g},e,u?u.details:null,i)})}getCacheAge(){let e=null;if(this.response){const t=this.response.headers.get("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.response?this.response.headers.get(e):null}loadProgressively(e,t,s,i=0,r){const n=new dr,o=e.body.getReader(),l=()=>o.read().then(c=>{if(c.done)return n.dataLength&&r(t,s,n.flush(),e),Promise.resolve(new ArrayBuffer(0));const h=c.value,u=h.length;return t.loaded+=u,u=i&&r(t,s,n.flush(),e)):r(t,s,h,e),l()}).catch(()=>Promise.reject());return l()}}function nc(a,e){const t={method:"GET",mode:"cors",credentials:"same-origin",signal:e,headers:new self.Headers(se({},a.headers))};return a.rangeEnd&&t.headers.set("Range","bytes="+a.rangeStart+"-"+String(a.rangeEnd-1)),t}function ac(a){const e=rc.exec(a);if(e)return parseInt(e[2])-parseInt(e[1])+1}function oc(a){const e=a.get("Content-Range");if(e){const s=ac(e);if(O(s))return s}const t=a.get("Content-Length");if(t)return parseInt(t)}function lc(a,e){return new self.Request(a.url,e)}class cc extends Error{constructor(e,t,s){super(e),this.code=void 0,this.details=void 0,this.code=t,this.details=s}}const hc=/\s/,uc={newCue(a,e,t,s){const i=[];let r,n,o,l,c;const h=self.VTTCue||self.TextTrackCue;for(let d=0;d=16?l--:l++;const g=Fr(c.trim()),f=Os(e,t,g);a!=null&&(u=a.cues)!=null&&u.getCueById(f)||(n=new h(e,t,g),n.id=f,n.line=d+1,n.align="left",n.position=10+Math.min(80,Math.floor(l*8/32)*10),i.push(n))}return a&&i.length&&(i.sort((d,g)=>d.line==="auto"||g.line==="auto"?0:d.line>8&&g.line>8?g.line-d.line:d.line-g.line),i.forEach(d=>rr(a,d))),i}},dc={maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null},Yr=oe(oe({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,preferManagedMediaSource:!0,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,frontBufferFlushThreshold:1/0,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,workerPath:null,enableSoftwareAES:!0,startLevel:void 0,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:Wr,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:Ua,bufferController:Vo,capLevelController:Ms,errorController:Ia,fpsController:Tl,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrEwmaDefaultEstimateMax:5e6,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystems:{},drmSystemOptions:{},requestMediaKeySystemAccessFunc:Hi,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableID3MetadataCues:!0,useMediaCapabilities:!0,certLoadPolicy:{default:dc},keyLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"},errorRetry:{maxNumRetry:8,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"}}},manifestLoadPolicy:{default:{maxTimeToFirstByteMs:1/0,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:2,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},fragLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:12e4,timeoutRetry:{maxNumRetry:4,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:6,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},steeringManifestLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3},fc()),{},{subtitleStreamController:Bo,subtitleTrackController:Go,timelineController:ml,audioStreamController:No,audioTrackController:Uo,emeController:Ye,cmcdController:Zl,contentSteeringController:tc});function fc(){return{cueHandler:uc,enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function gc(a,e){if((e.liveSyncDurationCount||e.liveMaxLatencyDurationCount)&&(e.liveSyncDuration||e.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(e.liveMaxLatencyDurationCount!==void 0&&(e.liveSyncDurationCount===void 0||e.liveMaxLatencyDurationCount<=e.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(e.liveMaxLatencyDuration!==void 0&&(e.liveSyncDuration===void 0||e.liveMaxLatencyDuration<=e.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');const t=ys(a),s=["manifest","level","frag"],i=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return s.forEach(r=>{const n=`${r==="level"?"playlist":r}LoadPolicy`,o=e[n]===void 0,l=[];i.forEach(c=>{const h=`${r}Loading${c}`,u=e[h];if(u!==void 0&&o){l.push(h);const d=t[n].default;switch(e[n]={default:d},c){case"TimeOut":d.maxLoadTimeMs=u,d.maxTimeToFirstByteMs=u;break;case"MaxRetry":d.errorRetry.maxNumRetry=u,d.timeoutRetry.maxNumRetry=u;break;case"RetryDelay":d.errorRetry.retryDelayMs=u,d.timeoutRetry.retryDelayMs=u;break;case"MaxRetryTimeout":d.errorRetry.maxRetryDelayMs=u,d.timeoutRetry.maxRetryDelayMs=u;break}}}),l.length&&v.warn(`hls.js config: "${l.join('", "')}" setting(s) are deprecated, use "${n}": ${JSON.stringify(e[n])}`)}),oe(oe({},t),e)}function ys(a){return a&&typeof a=="object"?Array.isArray(a)?a.map(ys):Object.keys(a).reduce((e,t)=>(e[t]=ys(a[t]),e),{}):a}function mc(a){const e=a.loader;e!==Ui&&e!==Wr?(v.log("[config]: Custom loader detected, cannot enable progressive streaming"),a.progressive=!1):ic()&&(a.loader=Ui,a.progressive=!0,a.enableSoftwareAES=!0,v.log("[config]: Progressive streaming enabled, using FetchLoader"))}let rs;class pc extends Rs{constructor(e,t){super(e,"[level-controller]"),this._levels=[],this._firstLevel=-1,this._maxAutoLevel=-1,this._startLevel=void 0,this.currentLevel=null,this.currentLevelIndex=-1,this.manualLevelIndex=-1,this.steering=void 0,this.onParsedComplete=void 0,this.steering=t,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(p.LEVEL_LOADED,this.onLevelLoaded,this),e.on(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(p.FRAG_BUFFERED,this.onFragBuffered,this),e.on(p.ERROR,this.onError,this)}_unregisterListeners(){const{hls:e}=this;e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(p.LEVEL_LOADED,this.onLevelLoaded,this),e.off(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(p.FRAG_BUFFERED,this.onFragBuffered,this),e.off(p.ERROR,this.onError,this)}destroy(){this._unregisterListeners(),this.steering=null,this.resetLevels(),super.destroy()}stopLoad(){this._levels.forEach(t=>{t.loadError=0,t.fragmentError=0}),super.stopLoad()}resetLevels(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[],this._maxAutoLevel=-1}onManifestLoading(e,t){this.resetLevels()}onManifestLoaded(e,t){const s=this.hls.config.preferManagedMediaSource,i=[],r={},n={};let o=!1,l=!1,c=!1;t.levels.forEach(h=>{var u,d;const g=h.attrs;let{audioCodec:f,videoCodec:m}=h;((u=f)==null?void 0:u.indexOf("mp4a.40.34"))!==-1&&(rs||(rs=/chrome|firefox/i.test(navigator.userAgent)),rs&&(h.audioCodec=f=void 0)),f&&(h.audioCodec=f=Rt(f,s)),((d=m)==null?void 0:d.indexOf("avc1"))===0&&(m=h.videoCodec=ta(m));const{width:T,height:E,unknownCodecs:x}=h;if(o||(o=!!(T&&E)),l||(l=!!m),c||(c=!!f),x!=null&&x.length||f&&!Vt(f,"audio",s)||m&&!Vt(m,"video",s))return;const{CODECS:y,"FRAME-RATE":I,"HDCP-LEVEL":S,"PATHWAY-ID":D,RESOLUTION:R,"VIDEO-RANGE":_}=g,b=`${`${D||"."}-`}${h.bitrate}-${R}-${I}-${y}-${_}-${S}`;if(r[b])if(r[b].uri!==h.url&&!h.attrs["PATHWAY-ID"]){const w=n[b]+=1;h.attrs["PATHWAY-ID"]=new Array(w+1).join(".");const V=new je(h);r[b]=V,i.push(V)}else r[b].addGroupId("audio",g.AUDIO),r[b].addGroupId("text",g.SUBTITLES);else{const w=new je(h);r[b]=w,n[b]=1,i.push(w)}}),this.filterAndSortMediaOptions(i,t,o,l,c)}filterAndSortMediaOptions(e,t,s,i,r){let n=[],o=[],l=e;if((s||i)&&r&&(l=l.filter(({videoCodec:f,videoRange:m,width:T,height:E})=>(!!f||!!(T&&E))&&ga(m))),l.length===0){Promise.resolve().then(()=>{if(this.hls){t.levels.length&&this.warn(`One or more CODECS in variant not supported: ${JSON.stringify(t.levels[0].attrs)}`);const f=new Error("no level with compatible codecs found in manifest");this.hls.trigger(p.ERROR,{type:$.MEDIA_ERROR,details:L.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:f,reason:f.message})}});return}if(t.audioTracks){const{preferManagedMediaSource:f}=this.hls.config;n=t.audioTracks.filter(m=>!m.audioCodec||Vt(m.audioCodec,"audio",f)),Bi(n)}t.subtitles&&(o=t.subtitles,Bi(o));const c=l.slice(0);l.sort((f,m)=>{if(f.attrs["HDCP-LEVEL"]!==m.attrs["HDCP-LEVEL"])return(f.attrs["HDCP-LEVEL"]||"")>(m.attrs["HDCP-LEVEL"]||"")?1:-1;if(s&&f.height!==m.height)return f.height-m.height;if(f.frameRate!==m.frameRate)return f.frameRate-m.frameRate;if(f.videoRange!==m.videoRange)return It.indexOf(f.videoRange)-It.indexOf(m.videoRange);if(f.videoCodec!==m.videoCodec){const T=Ys(f.videoCodec),E=Ys(m.videoCodec);if(T!==E)return E-T}if(f.uri===m.uri&&f.codecSet!==m.codecSet){const T=Lt(f.codecSet),E=Lt(m.codecSet);if(T!==E)return E-T}return f.averageBitrate!==m.averageBitrate?f.averageBitrate-m.averageBitrate:0});let h=c[0];if(this.steering&&(l=this.steering.filterParsedLevels(l),l.length!==c.length)){for(let f=0;fT&&T===Yr.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=E)}break}const d=r&&!i,g={levels:l,audioTracks:n,subtitleTracks:o,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:r,video:i,altAudio:!d&&n.some(f=>!!f.url)};this.hls.trigger(p.MANIFEST_PARSED,g),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}get levels(){return this._levels.length===0?null:this._levels}get level(){return this.currentLevelIndex}set level(e){const t=this._levels;if(t.length===0)return;if(e<0||e>=t.length){const h=new Error("invalid level idx"),u=e<0;if(this.hls.trigger(p.ERROR,{type:$.OTHER_ERROR,details:L.LEVEL_SWITCH_ERROR,level:e,fatal:u,error:h,reason:h.message}),u)return;e=Math.min(e,t.length-1)}const s=this.currentLevelIndex,i=this.currentLevel,r=i?i.attrs["PATHWAY-ID"]:void 0,n=t[e],o=n.attrs["PATHWAY-ID"];if(this.currentLevelIndex=e,this.currentLevel=n,s===e&&n.details&&i&&r===o)return;this.log(`Switching to level ${e} (${n.height?n.height+"p ":""}${n.videoRange?n.videoRange+" ":""}${n.codecSet?n.codecSet+" ":""}@${n.bitrate})${o?" with Pathway "+o:""} from level ${s}${r?" with Pathway "+r:""}`);const l={level:e,attrs:n.attrs,details:n.details,bitrate:n.bitrate,averageBitrate:n.averageBitrate,maxBitrate:n.maxBitrate,realBitrate:n.realBitrate,width:n.width,height:n.height,codecSet:n.codecSet,audioCodec:n.audioCodec,videoCodec:n.videoCodec,audioGroups:n.audioGroups,subtitleGroups:n.subtitleGroups,loaded:n.loaded,loadError:n.loadError,fragmentError:n.fragmentError,name:n.name,id:n.id,uri:n.uri,url:n.url,urlId:0,audioGroupIds:n.audioGroupIds,textGroupIds:n.textGroupIds};this.hls.trigger(p.LEVEL_SWITCHING,l);const c=n.details;if(!c||c.live){const h=this.switchParams(n.uri,i==null?void 0:i.details,c);this.loadPlaylist(h)}}get manualLevel(){return this.manualLevelIndex}set manualLevel(e){this.manualLevelIndex=e,this._startLevel===void 0&&(this._startLevel=e),e!==-1&&(this.level=e)}get firstLevel(){return this._firstLevel}set firstLevel(e){this._firstLevel=e}get startLevel(){if(this._startLevel===void 0){const e=this.hls.config.startLevel;return e!==void 0?e:this.hls.firstAutoLevel}return this._startLevel}set startLevel(e){this._startLevel=e}onError(e,t){t.fatal||!t.context||t.context.type===Y.LEVEL&&t.context.level===this.level&&this.checkRetry(t)}onFragBuffered(e,{frag:t}){if(t!==void 0&&t.type===U.MAIN){const s=t.elementaryStreams;if(!Object.keys(s).some(r=>!!s[r]))return;const i=this._levels[t.level];i!=null&&i.loadError&&(this.log(`Resetting level error count of ${i.loadError} on frag buffered`),i.loadError=0)}}onLevelLoaded(e,t){var s;const{level:i,details:r}=t,n=this._levels[i];if(!n){var o;this.warn(`Invalid level index ${i}`),(o=t.deliveryDirectives)!=null&&o.skip&&(r.deltaUpdateFailed=!0);return}i===this.currentLevelIndex?(n.fragmentError===0&&(n.loadError=0),this.playlistLoaded(i,t,n.details)):(s=t.deliveryDirectives)!=null&&s.skip&&(r.deltaUpdateFailed=!0)}loadPlaylist(e){super.loadPlaylist();const t=this.currentLevelIndex,s=this.currentLevel;if(s&&this.shouldLoadPlaylist(s)){let i=s.uri;if(e)try{i=e.addDirectives(i)}catch(n){this.warn(`Could not construct new URL with HLS Delivery Directives: ${n}`)}const r=s.attrs["PATHWAY-ID"];this.log(`Loading level index ${t}${(e==null?void 0:e.msn)!==void 0?" at sn "+e.msn+" part "+e.part:""} with${r?" Pathway "+r:""} ${i}`),this.clearTimer(),this.hls.trigger(p.LEVEL_LOADING,{url:i,level:t,pathwayId:s.attrs["PATHWAY-ID"],id:0,deliveryDirectives:e||null})}}get nextLoadLevel(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel}set nextLoadLevel(e){this.level=e,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=e)}removeLevel(e){var t;const s=this._levels.filter((i,r)=>r!==e?!0:(this.steering&&this.steering.removeLevel(i),i===this.currentLevel&&(this.currentLevel=null,this.currentLevelIndex=-1,i.details&&i.details.fragments.forEach(n=>n.level=-1)),!1));lr(s),this._levels=s,this.currentLevelIndex>-1&&(t=this.currentLevel)!=null&&t.details&&(this.currentLevelIndex=this.currentLevel.details.fragments[0].level),this.hls.trigger(p.LEVELS_UPDATED,{levels:s})}onLevelsUpdated(e,{levels:t}){this._levels=t}checkMaxAutoUpdated(){const{autoLevelCapping:e,maxAutoLevel:t,maxHdcpLevel:s}=this.hls;this._maxAutoLevel!==t&&(this._maxAutoLevel=t,this.hls.trigger(p.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:e,levels:this.levels,maxAutoLevel:t,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:s}))}}function Bi(a){const e={};a.forEach(t=>{const s=t.groupId||"";t.id=e[s]=e[s]||0,e[s]++})}class Tc{constructor(e){this.config=void 0,this.keyUriToKeyInfo={},this.emeController=null,this.config=e}abort(e){for(const s in this.keyUriToKeyInfo){const i=this.keyUriToKeyInfo[s].loader;if(i){var t;if(e&&e!==((t=i.context)==null?void 0:t.frag.type))return;i.abort()}}}detach(){for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e];(t.mediaKeySessionContext||t.decryptdata.isCommonEncryption)&&delete this.keyUriToKeyInfo[e]}}destroy(){this.detach();for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e].loader;t&&t.destroy()}this.keyUriToKeyInfo={}}createKeyLoadError(e,t=L.KEY_LOAD_ERROR,s,i,r){return new Ce({type:$.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:r,error:s,networkDetails:i})}loadClear(e,t){if(this.emeController&&this.config.emeEnabled){const{sn:s,cc:i}=e;for(let r=0;r{n.setKeyFormat(o)});break}}}}load(e){return!e.decryptdata&&e.encrypted&&this.emeController?this.emeController.selectKeySystemFormat(e).then(t=>this.loadInternal(e,t)):this.loadInternal(e)}loadInternal(e,t){var s,i;t&&e.setKeyFormat(t);const r=e.decryptdata;if(!r){const c=new Error(t?`Expected frag.decryptdata to be defined after setting format ${t}`:"Missing decryption data on fragment in onKeyLoading");return Promise.reject(this.createKeyLoadError(e,L.KEY_LOAD_ERROR,c))}const n=r.uri;if(!n)return Promise.reject(this.createKeyLoadError(e,L.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${n}"`)));let o=this.keyUriToKeyInfo[n];if((s=o)!=null&&s.decryptdata.key)return r.key=o.decryptdata.key,Promise.resolve({frag:e,keyInfo:o});if((i=o)!=null&&i.keyLoadPromise){var l;switch((l=o.mediaKeySessionContext)==null?void 0:l.keyStatus){case void 0:case"status-pending":case"usable":case"usable-in-future":return o.keyLoadPromise.then(c=>(r.key=c.keyInfo.decryptdata.key,{frag:e,keyInfo:o}))}}switch(o=this.keyUriToKeyInfo[n]={decryptdata:r,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},r.method){case"ISO-23001-7":case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return r.keyFormat==="identity"?this.loadKeyHTTP(o,e):this.loadKeyEME(o,e);case"AES-128":return this.loadKeyHTTP(o,e);default:return Promise.reject(this.createKeyLoadError(e,L.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${r.method}"`)))}}loadKeyEME(e,t){const s={frag:t,keyInfo:e};if(this.emeController&&this.config.emeEnabled){const i=this.emeController.loadKey(s);if(i)return(e.keyLoadPromise=i.then(r=>(e.mediaKeySessionContext=r,s))).catch(r=>{throw e.keyLoadPromise=null,r})}return Promise.resolve(s)}loadKeyHTTP(e,t){const s=this.config,i=s.loader,r=new i(s);return t.keyLoader=e.loader=r,e.keyLoadPromise=new Promise((n,o)=>{const l={keyInfo:e,frag:t,responseType:"arraybuffer",url:e.decryptdata.uri},c=s.keyLoadPolicy.default,h={loadPolicy:c,timeout:c.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},u={onSuccess:(d,g,f,m)=>{const{frag:T,keyInfo:E,url:x}=f;if(!T.decryptdata||E!==this.keyUriToKeyInfo[x])return o(this.createKeyLoadError(T,L.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),m));E.decryptdata.key=T.decryptdata.key=new Uint8Array(d.data),T.keyLoader=null,E.loader=null,n({frag:T,keyInfo:E})},onError:(d,g,f,m)=>{this.resetLoader(g),o(this.createKeyLoadError(t,L.KEY_LOAD_ERROR,new Error(`HTTP Error ${d.code} loading key ${d.text}`),f,oe({url:l.url,data:void 0},d)))},onTimeout:(d,g,f)=>{this.resetLoader(g),o(this.createKeyLoadError(t,L.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),f))},onAbort:(d,g,f)=>{this.resetLoader(g),o(this.createKeyLoadError(t,L.INTERNAL_ABORTED,new Error("key loading aborted"),f))}};r.load(l,h,u)})}resetLoader(e){const{frag:t,keyInfo:s,url:i}=e,r=s.loader;t.keyLoader===r&&(t.keyLoader=null,s.loader=null),delete this.keyUriToKeyInfo[i],r&&r.destroy()}}function qr(){return self.SourceBuffer||self.WebKitSourceBuffer}function jr(){if(!Ue())return!1;const e=qr();return!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function"}function Ec(){if(!jr())return!1;const a=Ue();return typeof(a==null?void 0:a.isTypeSupported)=="function"&&(["avc1.42E01E,mp4a.40.2","av01.0.01M.08","vp09.00.50.08"].some(e=>a.isTypeSupported(st(e,"video")))||["mp4a.40.2","fLaC"].some(e=>a.isTypeSupported(st(e,"audio"))))}function yc(){var a;const e=qr();return typeof(e==null||(a=e.prototype)==null?void 0:a.changeType)=="function"}const xc=250,St=2,Sc=.1,vc=.05;class Ac{constructor(e,t,s,i){this.config=void 0,this.media=null,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=e,this.media=t,this.fragmentTracker=s,this.hls=i}destroy(){this.media=null,this.hls=this.fragmentTracker=null}poll(e,t){const{config:s,media:i,stalled:r}=this;if(i===null)return;const{currentTime:n,seeking:o}=i,l=this.seeking&&!o,c=!this.seeking&&o;if(this.seeking=o,n!==e){if(this.moved=!0,o||(this.nudgeRetry=0),r!==null){if(this.stallReported){const T=self.performance.now()-r;v.warn(`playback not stuck anymore @${n}, after ${Math.round(T)}ms`),this.stallReported=!1}this.stalled=null}return}if(c||l){this.stalled=null;return}if(i.paused&&!o||i.ended||i.playbackRate===0||!J.getBuffered(i).length){this.nudgeRetry=0;return}const h=J.bufferInfo(i,n,0),u=h.nextStart||0;if(o){const T=h.len>St,E=!u||t&&t.start<=n||u-n>St&&!this.fragmentTracker.getPartialFragment(n);if(T||E)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var d;if(!(h.len>0)&&!u)return;const E=Math.max(u,h.start||0)-n,x=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,I=(x==null||(d=x.details)==null?void 0:d.live)?x.details.targetduration*2:St,S=this.fragmentTracker.getPartialFragment(n);if(E>0&&(E<=I||S)){i.paused||this._trySkipBufferHole(S);return}}const g=self.performance.now();if(r===null){this.stalled=g;return}const f=g-r;if(!o&&f>=xc&&(this._reportStall(h),!this.media))return;const m=J.bufferInfo(i,n,s.maxBufferHole);this._tryFixBufferStall(m,f)}_tryFixBufferStall(e,t){const{config:s,fragmentTracker:i,media:r}=this;if(r===null)return;const n=r.currentTime,o=i.getPartialFragment(n);o&&(this._trySkipBufferHole(o)||!this.media)||(e.len>s.maxBufferHole||e.nextStart&&e.nextStart-ns.highBufferWatchdogPeriod*1e3&&(v.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())}_reportStall(e){const{hls:t,media:s,stallReported:i}=this;if(!i&&s){this.stallReported=!0;const r=new Error(`Playback stalling at @${s.currentTime} due to low buffer (${JSON.stringify(e)})`);v.warn(r.message),t.trigger(p.ERROR,{type:$.MEDIA_ERROR,details:L.BUFFER_STALLED_ERROR,fatal:!1,error:r,buffer:e.len})}}_trySkipBufferHole(e){const{config:t,hls:s,media:i}=this;if(i===null)return 0;const r=i.currentTime,n=J.bufferInfo(i,r,0),o=r0&&n.len<1&&i.readyState<3,h=o-r;if(h>0&&(l||c)){if(h>t.maxBufferHole){const{fragmentTracker:d}=this;let g=!1;if(r===0){const f=d.getAppendedFrag(0,U.MAIN);f&&o1?(i=0,this.bitrateTest=!0):i=s.firstAutoLevel),s.nextLoadLevel=i,this.level=s.loadLevel,this.loadedmetadata=!1}t>0&&e===-1&&(this.log(`Override startPosition with lastCurrentTime @${t.toFixed(3)}`),e=t),this.state=C.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}else this._forceStartLoad=!0,this.state=C.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case C.WAITING_LEVEL:{const{levels:t,level:s}=this,i=t==null?void 0:t[s],r=i==null?void 0:i.details;if(r&&(!r.live||this.levelLastLoaded===i)){if(this.waitForCdnTuneIn(r))break;this.state=C.IDLE;break}else if(this.hls.nextLoadLevel!==this.level){this.state=C.IDLE;break}break}case C.FRAG_LOADING_WAITING_RETRY:{var e;const t=self.performance.now(),s=this.retryDate;if(!s||t>=s||(e=this.media)!=null&&e.seeking){const{levels:i,level:r}=this,n=i==null?void 0:i[r];this.resetStartWhenNotLoaded(n||null),this.state=C.IDLE}}break}this.state===C.IDLE&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){super.onTickEnd(),this.checkBuffer(),this.checkFragmentChanged()}doTickIdle(){const{hls:e,levelLastLoaded:t,levels:s,media:i}=this;if(t===null||!i&&(this.startFragRequested||!e.config.startFragPrefetch)||this.altAudio&&this.audioOnly)return;const r=e.nextLoadLevel;if(!(s!=null&&s[r]))return;const n=s[r],o=this.getMainFwdBufferInfo();if(o===null)return;const l=this.getLevelDetails();if(l&&this._streamEnded(o,l)){const m={};this.altAudio&&(m.type="video"),this.hls.trigger(p.BUFFER_EOS,m),this.state=C.ENDED;return}e.loadLevel!==r&&e.manualLevel===-1&&this.log(`Adapting to level ${r} from level ${this.level}`),this.level=e.nextLoadLevel=r;const c=n.details;if(!c||this.state===C.WAITING_LEVEL||c.live&&this.levelLastLoaded!==n){this.level=r,this.state=C.WAITING_LEVEL;return}const h=o.len,u=this.getMaxBufferLength(n.maxBitrate);if(h>=u)return;this.backtrackFragment&&this.backtrackFragment.start>o.end&&(this.backtrackFragment=null);const d=this.backtrackFragment?this.backtrackFragment.start:o.end;let g=this.getNextFragment(d,c);if(this.couldBacktrack&&!this.fragPrevious&&g&&g.sn!=="initSegment"&&this.fragmentTracker.getState(g)!==ae.OK){var f;const T=((f=this.backtrackFragment)!=null?f:g).sn-c.startSN,E=c.fragments[T-1];E&&g.cc===E.cc&&(g=E,this.fragmentTracker.removeFragment(E))}else this.backtrackFragment&&o.len&&(this.backtrackFragment=null);if(g&&this.isLoopLoading(g,d)){if(!g.gap){const T=this.audioOnly&&!this.altAudio?X.AUDIO:X.VIDEO,E=(T===X.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;E&&this.afterBufferFlushed(E,T,U.MAIN)}g=this.getNextFragmentLoopLoading(g,c,o,U.MAIN,u)}g&&(g.initSegment&&!g.initSegment.data&&!this.bitrateTest&&(g=g.initSegment),this.loadFragment(g,n,d))}loadFragment(e,t,s){const i=this.fragmentTracker.getState(e);this.fragCurrent=e,i===ae.NOT_LOADED||i===ae.PARTIAL?e.sn==="initSegment"?this._loadInitSegment(e,t):this.bitrateTest?(this.log(`Fragment ${e.sn} of level ${e.level} is being downloaded to test bitrate and will not be buffered`),this._loadBitrateTestFrag(e,t)):(this.startFragRequested=!0,super.loadFragment(e,t,s)):this.clearTrackerIfNeeded(e)}getBufferedFrag(e){return this.fragmentTracker.getBufferedFrag(e,U.MAIN)}followingBufferedFrag(e){return e?this.getBufferedFrag(e.end+.5):null}immediateLevelSwitch(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}nextLevelSwitch(){const{levels:e,media:t}=this;if(t!=null&&t.readyState){let s;const i=this.getAppendedFrag(t.currentTime);i&&i.start>1&&this.flushMainBuffer(0,i.start-1);const r=this.getLevelDetails();if(r!=null&&r.live){const o=this.getMainFwdBufferInfo();if(!o||o.len{const n=r.audioCodec;n&&(s=s||n.indexOf("mp4a.40.2")!==-1,i=i||n.indexOf("mp4a.40.5")!==-1)}),this.audioCodecSwitch=s&&i&&!yc(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=t.levels,this.startFragRequested=!1}onLevelLoading(e,t){const{levels:s}=this;if(!s||this.state!==C.IDLE)return;const i=s[t.level];(!i.details||i.details.live&&this.levelLastLoaded!==i||this.waitForCdnTuneIn(i.details))&&(this.state=C.WAITING_LEVEL)}onLevelLoaded(e,t){var s;const{levels:i}=this,r=t.level,n=t.details,o=n.totalduration;if(!i){this.warn(`Levels were reset while loading level ${r}`);return}this.log(`Level ${r} loaded [${n.startSN},${n.endSN}]${n.lastPartSn?`[part-${n.lastPartSn}-${n.lastPartIndex}]`:""}, cc [${n.startCC}, ${n.endCC}] duration:${o}`);const l=i[r],c=this.fragCurrent;c&&(this.state===C.FRAG_LOADING||this.state===C.FRAG_LOADING_WAITING_RETRY)&&c.level!==t.level&&c.loader&&this.abortCurrentFrag();let h=0;if(n.live||(s=l.details)!=null&&s.live){var u;if(this.checkLiveUpdate(n),n.deltaUpdateFailed)return;h=this.alignPlaylists(n,l.details,(u=this.levelLastLoaded)==null?void 0:u.details)}if(l.details=n,this.levelLastLoaded=l,this.hls.trigger(p.LEVEL_UPDATED,{details:n,level:r}),this.state===C.WAITING_LEVEL){if(this.waitForCdnTuneIn(n))return;this.state=C.IDLE}this.startFragRequested?n.live&&this.synchronizeToLiveEdge(n):this.setStartPosition(n,h),this.tick()}_handleFragmentLoadProgress(e){var t;const{frag:s,part:i,payload:r}=e,{levels:n}=this;if(!n){this.warn(`Levels were reset while fragment load was in progress. Fragment ${s.sn} of level ${s.level} will not be buffered`);return}const o=n[s.level],l=o.details;if(!l){this.warn(`Dropping fragment ${s.sn} of level ${s.level} after level details were reset`),this.fragmentTracker.removeFragment(s);return}const c=o.videoCodec,h=l.PTSKnown||!l.live,u=(t=s.initSegment)==null?void 0:t.data,d=this._getAudioCodec(o),g=this.transmuxer=this.transmuxer||new Dr(this.hls,U.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),f=i?i.index:-1,m=f!==-1,T=new Is(s.level,s.sn,s.stats.chunkCount,r.byteLength,f,m),E=this.initPTS[s.cc];g.push(r,u,d,c,s,i,l.totalduration,h,T,E)}onAudioTrackSwitching(e,t){const s=this.altAudio;if(!!!t.url){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;const n=this.fragCurrent;n&&(this.log("Switching to main audio track, cancel main fragment load"),n.abortRequests(),this.fragmentTracker.removeFragment(n)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();const r=this.hls;s&&(r.trigger(p.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null}),this.fragmentTracker.removeAllFragments()),r.trigger(p.AUDIO_TRACK_SWITCHED,t)}}onAudioTrackSwitched(e,t){const s=t.id,i=!!this.hls.audioTracks[s].url;if(i){const r=this.videoBuffer;r&&this.mediaBuffer!==r&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=r)}this.altAudio=i,this.tick()}onBufferCreated(e,t){const s=t.tracks;let i,r,n=!1;for(const o in s){const l=s[o];if(l.id==="main"){if(r=o,i=l,o==="video"){const c=s[o];c&&(this.videoBuffer=c.buffer)}}else n=!0}n&&i?(this.log(`Alternate track found, use ${r}.buffered to schedule main fragment loading`),this.mediaBuffer=i.buffer):this.mediaBuffer=this.media}onFragBuffered(e,t){const{frag:s,part:i}=t;if(s&&s.type!==U.MAIN)return;if(this.fragContextChanged(s)){this.warn(`Fragment ${s.sn}${i?" p: "+i.index:""} of level ${s.level} finished buffering, but was aborted. state: ${this.state}`),this.state===C.PARSED&&(this.state=C.IDLE);return}const r=i?i.stats:s.stats;this.fragLastKbps=Math.round(8*r.total/(r.buffering.end-r.loading.first)),s.sn!=="initSegment"&&(this.fragPrevious=s),this.fragBufferedComplete(s,i)}onError(e,t){var s;if(t.fatal){this.state=C.ERROR;return}switch(t.details){case L.FRAG_GAP:case L.FRAG_PARSING_ERROR:case L.FRAG_DECRYPT_ERROR:case L.FRAG_LOAD_ERROR:case L.FRAG_LOAD_TIMEOUT:case L.KEY_LOAD_ERROR:case L.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(U.MAIN,t);break;case L.LEVEL_LOAD_ERROR:case L.LEVEL_LOAD_TIMEOUT:case L.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===C.WAITING_LEVEL&&((s=t.context)==null?void 0:s.type)===Y.LEVEL&&(this.state=C.IDLE);break;case L.BUFFER_APPEND_ERROR:case L.BUFFER_FULL_ERROR:if(!t.parent||t.parent!=="main")return;if(t.details===L.BUFFER_APPEND_ERROR){this.resetLoadingState();return}this.reduceLengthAndFlushBuffer(t)&&this.flushMainBuffer(0,Number.POSITIVE_INFINITY);break;case L.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}checkBuffer(){const{media:e,gapController:t}=this;if(!(!e||!t||!e.readyState)){if(this.loadedmetadata||!J.getBuffered(e).length){const s=this.state!==C.IDLE?this.fragCurrent:null;t.poll(this.lastCurrentTime,s)}this.lastCurrentTime=e.currentTime}}onFragLoadEmergencyAborted(){this.state=C.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()}onBufferFlushed(e,{type:t}){if(t!==X.AUDIO||this.audioOnly&&!this.altAudio){const s=(t===X.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(s,t,U.MAIN),this.tick()}}onLevelsUpdated(e,t){this.level>-1&&this.fragCurrent&&(this.level=this.fragCurrent.level),this.levels=t.levels}swapAudioCodec(){this.audioCodecSwap=!this.audioCodecSwap}seekToStartPos(){const{media:e}=this;if(!e)return;const t=e.currentTime;let s=this.startPosition;if(s>=0&&t0&&(n{const{hls:i}=this;if(!s||this.fragContextChanged(e))return;t.fragmentError=0,this.state=C.IDLE,this.startFragRequested=!1,this.bitrateTest=!1;const r=e.stats;r.parsing.start=r.parsing.end=r.buffering.start=r.buffering.end=self.performance.now(),i.trigger(p.FRAG_LOADED,s),e.bitrateTest=!1})}_handleTransmuxComplete(e){var t;const s="main",{hls:i}=this,{remuxResult:r,chunkMeta:n}=e,o=this.getCurrentContext(n);if(!o){this.resetWhenMissingContext(n);return}const{frag:l,part:c,level:h}=o,{video:u,text:d,id3:g,initSegment:f}=r,{details:m}=h,T=this.altAudio?void 0:r.audio;if(this.fragContextChanged(l)){this.fragmentTracker.removeFragment(l);return}if(this.state=C.PARSING,f){if(f!=null&&f.tracks){const y=l.initSegment||l;this._bufferInitSegment(h,f.tracks,y,n),i.trigger(p.FRAG_PARSING_INIT_SEGMENT,{frag:y,id:s,tracks:f.tracks})}const E=f.initPTS,x=f.timescale;O(E)&&(this.initPTS[l.cc]={baseTime:E,timescale:x},i.trigger(p.INIT_PTS_FOUND,{frag:l,id:s,initPTS:E,timescale:x}))}if(u&&m&&l.sn!=="initSegment"){const E=m.fragments[l.sn-1-m.startSN],x=l.sn===m.startSN,y=!E||l.cc>E.cc;if(r.independent!==!1){const{startPTS:I,endPTS:S,startDTS:D,endDTS:R}=u;if(c)c.elementaryStreams[u.type]={startPTS:I,endPTS:S,startDTS:D,endDTS:R};else if(u.firstKeyFrame&&u.independent&&n.id===1&&!y&&(this.couldBacktrack=!0),u.dropped&&u.independent){const _=this.getMainFwdBufferInfo(),k=(_?_.end:this.getLoadPosition())+this.config.maxBufferHole,b=u.firstKeyFramePTS?u.firstKeyFramePTS:I;if(!x&&kSt&&(l.gap=!0);l.setElementaryStreamInfo(u.type,I,S,D,R),this.backtrackFragment&&(this.backtrackFragment=l),this.bufferFragmentData(u,l,c,n,x||y)}else if(x||y)l.gap=!0;else{this.backtrack(l);return}}if(T){const{startPTS:E,endPTS:x,startDTS:y,endDTS:I}=T;c&&(c.elementaryStreams[X.AUDIO]={startPTS:E,endPTS:x,startDTS:y,endDTS:I}),l.setElementaryStreamInfo(X.AUDIO,E,x,y,I),this.bufferFragmentData(T,l,c,n)}if(m&&g!=null&&(t=g.samples)!=null&&t.length){const E={id:s,frag:l,details:m,samples:g.samples};i.trigger(p.FRAG_PARSING_METADATA,E)}if(m&&d){const E={id:s,frag:l,details:m,samples:d.samples};i.trigger(p.FRAG_PARSING_USERDATA,E)}}_bufferInitSegment(e,t,s,i){if(this.state!==C.PARSING)return;this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&delete t.audio;const{audio:r,video:n,audiovideo:o}=t;if(r){let l=e.audioCodec;const c=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){l&&(l.indexOf("mp4a.40.5")!==-1?l="mp4a.40.2":l="mp4a.40.5");const h=r.metadata;h&&"channelCount"in h&&(h.channelCount||1)!==1&&c.indexOf("firefox")===-1&&(l="mp4a.40.5")}l&&l.indexOf("mp4a.40.5")!==-1&&c.indexOf("android")!==-1&&r.container!=="audio/mpeg"&&(l="mp4a.40.2",this.log(`Android: force audio codec to ${l}`)),e.audioCodec&&e.audioCodec!==l&&this.log(`Swapping manifest audio codec "${e.audioCodec}" for "${l}"`),r.levelCodec=l,r.id="main",this.log(`Init audio buffer, container:${r.container}, codecs[selected/level/parsed]=[${l||""}/${e.audioCodec||""}/${r.codec}]`)}n&&(n.levelCodec=e.videoCodec,n.id="main",this.log(`Init video buffer, container:${n.container}, codecs[level/parsed]=[${e.videoCodec||""}/${n.codec}]`)),o&&this.log(`Init audiovideo buffer, container:${o.container}, codecs[level/parsed]=[${e.codecs}/${o.codec}]`),this.hls.trigger(p.BUFFER_CODECS,t),Object.keys(t).forEach(l=>{const h=t[l].initSegment;h!=null&&h.byteLength&&this.hls.trigger(p.BUFFER_APPENDING,{type:l,data:h,frag:s,part:null,chunkMeta:i,parent:s.type})}),this.tickImmediate()}getMainFwdBufferInfo(){return this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,U.MAIN)}backtrack(e){this.couldBacktrack=!0,this.backtrackFragment=e,this.resetTransmuxer(),this.flushBufferGap(e),this.fragmentTracker.removeFragment(e),this.fragPrevious=null,this.nextLoadPosition=e.start,this.state=C.IDLE}checkFragmentChanged(){const e=this.media;let t=null;if(e&&e.readyState>1&&e.seeking===!1){const s=e.currentTime;if(J.isBuffered(e,s)?t=this.getAppendedFrag(s):J.isBuffered(e,s+.1)&&(t=this.getAppendedFrag(s+.1)),t){this.backtrackFragment=null;const i=this.fragPlaying,r=t.level;(!i||t.sn!==i.sn||i.level!==r)&&(this.fragPlaying=t,this.hls.trigger(p.FRAG_CHANGED,{frag:t}),(!i||i.level!==r)&&this.hls.trigger(p.LEVEL_SWITCHED,{level:r}))}}}get nextLevel(){const e=this.nextBufferedFrag;return e?e.level:-1}get currentFrag(){const e=this.media;return e?this.fragPlaying||this.getAppendedFrag(e.currentTime):null}get currentProgramDateTime(){const e=this.media;if(e){const t=e.currentTime,s=this.currentFrag;if(s&&O(t)&&O(s.programDateTime)){const i=s.programDateTime+(t-s.start)*1e3;return new Date(i)}}return null}get currentLevel(){const e=this.currentFrag;return e?e.level:-1}get nextBufferedFrag(){const e=this.currentFrag;return e?this.followingBufferedFrag(e):null}get forceStartLoad(){return this._forceStartLoad}}class we{static get version(){return"1.5.14"}static isMSESupported(){return jr()}static isSupported(){return Ec()}static getMediaSource(){return Ue()}static get Events(){return p}static get ErrorTypes(){return $}static get ErrorDetails(){return L}static get DefaultConfig(){return we.defaultConfig?we.defaultConfig:Yr}static set DefaultConfig(e){we.defaultConfig=e}constructor(e={}){this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this.started=!1,this._emitter=new Ps,this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null,this.triggeringException=void 0,dn(e.debug||!1,"Hls instance");const t=this.config=gc(we.DefaultConfig,e);this.userConfig=e,t.progressive&&mc(t);const{abrController:s,bufferController:i,capLevelController:r,errorController:n,fpsController:o}=t,l=new n(this),c=this.abrController=new s(this),h=this.bufferController=new i(this),u=this.capLevelController=new r(this),d=new o(this),g=new aa(this),f=new ua(this),m=t.contentSteeringController,T=m?new m(this):null,E=this.levelController=new pc(this,T),x=new $a(this),y=new Tc(this.config),I=this.streamController=new Rc(this,x,y);u.setStreamController(I),d.setStreamController(I);const S=[g,E,I];T&&S.splice(1,0,T),this.networkControllers=S;const D=[c,h,u,d,f,x];this.audioTrackController=this.createController(t.audioTrackController,S);const R=t.audioStreamController;R&&S.push(new R(this,x,y)),this.subtitleTrackController=this.createController(t.subtitleTrackController,S);const _=t.subtitleStreamController;_&&S.push(new _(this,x,y)),this.createController(t.timelineController,D),y.emeController=this.emeController=this.createController(t.emeController,D),this.cmcdController=this.createController(t.cmcdController,D),this.latencyController=this.createController(da,D),this.coreComponents=D,S.push(l);const k=l.onErrorOut;typeof k=="function"&&this.on(p.ERROR,k,l)}createController(e,t){if(e){const s=new e(this);return t&&t.push(s),s}return null}on(e,t,s=this){this._emitter.on(e,t,s)}once(e,t,s=this){this._emitter.once(e,t,s)}removeAllListeners(e){this._emitter.removeAllListeners(e)}off(e,t,s=this,i){this._emitter.off(e,t,s,i)}listeners(e){return this._emitter.listeners(e)}emit(e,t,s){return this._emitter.emit(e,t,s)}trigger(e,t){if(this.config.debug)return this.emit(e,e,t);try{return this.emit(e,e,t)}catch(s){if(v.error("An internal error happened while handling event "+e+'. Error message: "'+s.message+'". Here is a stacktrace:',s),!this.triggeringException){this.triggeringException=!0;const i=e===p.ERROR;this.trigger(p.ERROR,{type:$.OTHER_ERROR,details:L.INTERNAL_EXCEPTION,fatal:i,event:e,error:s}),this.triggeringException=!1}}return!1}listenerCount(e){return this._emitter.listenerCount(e)}destroy(){v.log("destroy"),this.trigger(p.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(t=>t.destroy()),this.networkControllers.length=0,this.coreComponents.forEach(t=>t.destroy()),this.coreComponents.length=0;const e=this.config;e.xhrSetup=e.fetchSetup=void 0,this.userConfig=null}attachMedia(e){v.log("attachMedia"),this._media=e,this.trigger(p.MEDIA_ATTACHING,{media:e})}detachMedia(){v.log("detachMedia"),this.trigger(p.MEDIA_DETACHING,void 0),this._media=null}loadSource(e){this.stopLoad();const t=this.media,s=this.url,i=this.url=xs.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,v.log(`loadSource:${i}`),t&&s&&(s!==i||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(t)),this.trigger(p.MANIFEST_LOADING,{url:e})}startLoad(e=-1){v.log(`startLoad(${e})`),this.started=!0,this.networkControllers.forEach(t=>{t.startLoad(e)})}stopLoad(){v.log("stopLoad"),this.started=!1,this.networkControllers.forEach(e=>{e.stopLoad()})}resumeBuffering(){this.started&&this.networkControllers.forEach(e=>{"fragmentLoader"in e&&e.startLoad(-1)})}pauseBuffering(){this.networkControllers.forEach(e=>{"fragmentLoader"in e&&e.stopLoad()})}swapAudioCodec(){v.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){v.log("recoverMediaError");const e=this._media;this.detachMedia(),e&&this.attachMedia(e)}removeLevel(e){this.levelController.removeLevel(e)}get levels(){const e=this.levelController.levels;return e||[]}get currentLevel(){return this.streamController.currentLevel}set currentLevel(e){v.log(`set currentLevel:${e}`),this.levelController.manualLevel=e,this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(e){v.log(`set nextLevel:${e}`),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(e){v.log(`set loadLevel:${e}`),this.levelController.manualLevel=e}get nextLoadLevel(){return this.levelController.nextLoadLevel}set nextLoadLevel(e){this.levelController.nextLoadLevel=e}get firstLevel(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)}set firstLevel(e){v.log(`set firstLevel:${e}`),this.levelController.firstLevel=e}get startLevel(){const e=this.levelController.startLevel;return e===-1&&this.abrController.forcedAutoLevel>-1?this.abrController.forcedAutoLevel:e}set startLevel(e){v.log(`set startLevel:${e}`),e!==-1&&(e=Math.max(e,this.minAutoLevel)),this.levelController.startLevel=e}get capLevelToPlayerSize(){return this.config.capLevelToPlayerSize}set capLevelToPlayerSize(e){const t=!!e;t!==this.config.capLevelToPlayerSize&&(t?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=t)}get autoLevelCapping(){return this._autoLevelCapping}get bandwidthEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimate():NaN}set bandwidthEstimate(e){this.abrController.resetEstimator(e)}get ttfbEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimateTTFB():NaN}set autoLevelCapping(e){this._autoLevelCapping!==e&&(v.log(`set autoLevelCapping:${e}`),this._autoLevelCapping=e,this.levelController.checkMaxAutoUpdated())}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(e){fa(e)&&this._maxHdcpLevel!==e&&(this._maxHdcpLevel=e,this.levelController.checkMaxAutoUpdated())}get autoLevelEnabled(){return this.levelController.manualLevel===-1}get manualLevel(){return this.levelController.manualLevel}get minAutoLevel(){const{levels:e,config:{minAutoBitrate:t}}=this;if(!e)return 0;const s=e.length;for(let i=0;i=t)return i;return 0}get maxAutoLevel(){const{levels:e,autoLevelCapping:t,maxHdcpLevel:s}=this;let i;if(t===-1&&e!=null&&e.length?i=e.length-1:i=t,s)for(let r=i;r--;){const n=e[r].attrs["HDCP-LEVEL"];if(n&&n<=s)return r}return i}get firstAutoLevel(){return this.abrController.firstAutoLevel}get nextAutoLevel(){return this.abrController.nextAutoLevel}set nextAutoLevel(e){this.abrController.nextAutoLevel=e}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}setAudioOption(e){var t;return(t=this.audioTrackController)==null?void 0:t.setAudioOption(e)}setSubtitleOption(e){var t;return(t=this.subtitleTrackController)==null||t.setSubtitleOption(e),null}get allAudioTracks(){const e=this.audioTrackController;return e?e.allAudioTracks:[]}get audioTracks(){const e=this.audioTrackController;return e?e.audioTracks:[]}get audioTrack(){const e=this.audioTrackController;return e?e.audioTrack:-1}set audioTrack(e){const t=this.audioTrackController;t&&(t.audioTrack=e)}get allSubtitleTracks(){const e=this.subtitleTrackController;return e?e.allSubtitleTracks:[]}get subtitleTracks(){const e=this.subtitleTrackController;return e?e.subtitleTracks:[]}get subtitleTrack(){const e=this.subtitleTrackController;return e?e.subtitleTrack:-1}get media(){return this._media}set subtitleTrack(e){const t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}get subtitleDisplay(){const e=this.subtitleTrackController;return e?e.subtitleDisplay:!1}set subtitleDisplay(e){const t=this.subtitleTrackController;t&&(t.subtitleDisplay=e)}get lowLatencyMode(){return this.config.lowLatencyMode}set lowLatencyMode(e){this.config.lowLatencyMode=e}get liveSyncPosition(){return this.latencyController.liveSyncPosition}get latency(){return this.latencyController.latency}get maxLatency(){return this.latencyController.maxLatency}get targetLatency(){return this.latencyController.targetLatency}get drift(){return this.latencyController.drift}get forceStartLoad(){return this.streamController.forceStartLoad}}we.defaultConfig=void 0;var Ic=Object.defineProperty,bc=Object.getOwnPropertyDescriptor,zr=(a,e,t,s)=>{for(var i=s>1?void 0:s?bc(e,t):e,r=a.length-1,n;r>=0;r--)(n=a[r])&&(i=(s?n(e,t,i):n(i))||i);return s&&i&&Ic(e,t,i),i};let Pt=class extends Jr(Zr){constructor(){super(...arguments);Nt(this,"cameraVideo");Nt(this,"hls",null)}startPlayback(){var s;const t=this.buildAbsoluteUrl(this.camera.stream_url||"").toString();we.isSupported()?((s=this.hls)==null||s.destroy(),this.hls=new we({enableWorker:!0,lowLatencyMode:!0,maxLiveSyncPlaybackRate:2,liveSyncDuration:.5,liveMaxLatencyDuration:2,backBufferLength:5}),this.hls.loadSource(t),this.hls.attachMedia(this.cameraVideo),this.hls.on(we.Events.MEDIA_ATTACHED,()=>{this.cameraVideo.play()})):this.cameraVideo.canPlayType("application/vnd.apple.mpegurl")&&(this.cameraVideo.src=t)}stopPlayback(){var t;(t=this.hls)==null||t.destroy(),this.hls=null,this.cameraVideo.src=""}};zr([tn("streamingElement")],Pt.prototype,"cameraVideo",2);Pt=zr([en({})],Pt);var Dc=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("video",{ref:"streamingElement",style:e.cameraStyle,attrs:{autoplay:"",muted:"",crossorigin:e.crossorigin},domProps:{muted:!0}})},Cc=[],_c=sn(Pt,Dc,Cc,!1,null,null);const Mc=_c.exports;export{Mc as default}; diff --git a/fluidd/assets/HlsstreamCamera-Doq-MNJ1.js b/fluidd/assets/HlsstreamCamera-Doq-MNJ1.js new file mode 100644 index 0000000..882b148 --- /dev/null +++ b/fluidd/assets/HlsstreamCamera-Doq-MNJ1.js @@ -0,0 +1,26 @@ +var Xr=Object.defineProperty;var Qr=(a,e,t)=>e in a?Xr(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var Nt=(a,e,t)=>Qr(a,typeof e!="symbol"?e+"":e,t);import{m as Jr,C as Zr,f as en,R as tn,j as sn}from"./index-DNWTsqTH.js";function rn(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var $i={exports:{}};(function(a,e){(function(t){var s=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,i=/^(?=([^\/?#]*))\1([^]*)$/,r=/(?:\/|^)\.(?=\/)/g,n=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,o={buildAbsoluteURL:function(l,c,h){if(h=h||{},l=l.trim(),c=c.trim(),!c){if(!h.alwaysNormalize)return l;var u=o.parseURL(l);if(!u)throw new Error("Error trying to parse base URL.");return u.path=o.normalizePath(u.path),o.buildURLFromParts(u)}var d=o.parseURL(c);if(!d)throw new Error("Error trying to parse relative URL.");if(d.scheme)return h.alwaysNormalize?(d.path=o.normalizePath(d.path),o.buildURLFromParts(d)):c;var g=o.parseURL(l);if(!g)throw new Error("Error trying to parse base URL.");if(!g.netLoc&&g.path&&g.path[0]!=="/"){var f=i.exec(g.path);g.netLoc=f[1],g.path=f[2]}g.netLoc&&!g.path&&(g.path="/");var m={scheme:g.scheme,netLoc:d.netLoc,path:null,params:d.params,query:d.query,fragment:d.fragment};if(!d.netLoc&&(m.netLoc=g.netLoc,d.path[0]!=="/"))if(!d.path)m.path=g.path,d.params||(m.params=g.params,d.query||(m.query=g.query));else{var T=g.path,E=T.substring(0,T.lastIndexOf("/")+1)+d.path;m.path=o.normalizePath(E)}return m.path===null&&(m.path=h.alwaysNormalize?o.normalizePath(d.path):d.path),o.buildURLFromParts(m)},parseURL:function(l){var c=s.exec(l);return c?{scheme:c[1]||"",netLoc:c[2]||"",path:c[3]||"",params:c[4]||"",query:c[5]||"",fragment:c[6]||""}:null},normalizePath:function(l){for(l=l.split("").reverse().join("").replace(r,"");l.length!==(l=l.replace(n,"")).length;);return l.split("").reverse().join("")},buildURLFromParts:function(l){return l.scheme+l.netLoc+l.path+l.params+l.query+l.fragment}};a.exports=o})()})($i);var xs=$i.exports;function Us(a,e){var t=Object.keys(a);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(a);e&&(s=s.filter(function(i){return Object.getOwnPropertyDescriptor(a,i).enumerable})),t.push.apply(t,s)}return t}function oe(a){for(var e=1;e`):Oe}function un(a,...e){e.forEach(function(t){Ze[t]=a[t]?a[t].bind(a):hn(t)})}function dn(a,e){if(typeof console=="object"&&a===!0||typeof a=="object"){un(a,"debug","log","info","warn","error");try{Ze.log(`Debug logs enabled for "${e}" in hls.js version 1.5.14`)}catch{Ze=ns}}else Ze=ns}const v=Ze,fn=/^(\d+)x(\d+)$/,Bs=/(.+?)=(".*?"|.*?)(?:,|$)/g;class ee{constructor(e){typeof e=="string"&&(e=ee.parseAttrList(e)),se(this,e)}get clientAttrs(){return Object.keys(this).filter(e=>e.substring(0,2)==="X-")}decimalInteger(e){const t=parseInt(this[e],10);return t>Number.MAX_SAFE_INTEGER?1/0:t}hexadecimalInteger(e){if(this[e]){let t=(this[e]||"0x").slice(2);t=(t.length&1?"0":"")+t;const s=new Uint8Array(t.length/2);for(let i=0;iNumber.MAX_SAFE_INTEGER?1/0:t}decimalFloatingPoint(e){return parseFloat(this[e])}optionalFloat(e,t){const s=this[e];return s?parseFloat(s):t}enumeratedString(e){return this[e]}bool(e){return this[e]==="YES"}decimalResolution(e){const t=fn.exec(this[e]);if(t!==null)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}static parseAttrList(e){let t;const s={},i='"';for(Bs.lastIndex=0;(t=Bs.exec(e))!==null;){let r=t[2];r.indexOf(i)===0&&r.lastIndexOf(i)===r.length-1&&(r=r.slice(1,-1));const n=t[1].trim();s[n]=r}return s}}function gn(a){return a!=="ID"&&a!=="CLASS"&&a!=="START-DATE"&&a!=="DURATION"&&a!=="END-DATE"&&a!=="END-ON-NEXT"}function mn(a){return a==="SCTE35-OUT"||a==="SCTE35-IN"}class Gi{constructor(e,t){if(this.attr=void 0,this._startDate=void 0,this._endDate=void 0,this._badValueForSameId=void 0,t){const s=t.attr;for(const i in s)if(Object.prototype.hasOwnProperty.call(e,i)&&e[i]!==s[i]){v.warn(`DATERANGE tag attribute: "${i}" does not match for tags with ID: "${e.ID}"`),this._badValueForSameId=i;break}e=se(new ee({}),s,e)}if(this.attr=e,this._startDate=new Date(e["START-DATE"]),"END-DATE"in this.attr){const s=new Date(this.attr["END-DATE"]);O(s.getTime())&&(this._endDate=s)}}get id(){return this.attr.ID}get class(){return this.attr.CLASS}get startDate(){return this._startDate}get endDate(){if(this._endDate)return this._endDate;const e=this.duration;return e!==null?new Date(this._startDate.getTime()+e*1e3):null}get duration(){if("DURATION"in this.attr){const e=this.attr.decimalFloatingPoint("DURATION");if(O(e))return e}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}get plannedDuration(){return"PLANNED-DURATION"in this.attr?this.attr.decimalFloatingPoint("PLANNED-DURATION"):null}get endOnNext(){return this.attr.bool("END-ON-NEXT")}get isValid(){return!!this.id&&!this._badValueForSameId&&O(this.startDate.getTime())&&(this.duration===null||this.duration>=0)&&(!this.endOnNext||!!this.class)}}class Ft{constructor(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}}var X={AUDIO:"audio",VIDEO:"video",AUDIOVIDEO:"audiovideo"};class Ki{constructor(e){this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams={[X.AUDIO]:null,[X.VIDEO]:null,[X.AUDIOVIDEO]:null},this.baseurl=e}setByteRange(e,t){const s=e.split("@",2);let i;s.length===1?i=(t==null?void 0:t.byteRangeEndOffset)||0:i=parseInt(s[1]),this._byteRange=[i,parseInt(s[0])+i]}get byteRange(){return this._byteRange?this._byteRange:[]}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=xs.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(e){this._url=e}}class Ut extends Ki{constructor(e,t){super(t),this._decryptdata=null,this.rawProgramDateTime=null,this.programDateTime=null,this.tagList=[],this.duration=0,this.sn=0,this.levelkeys=void 0,this.type=void 0,this.loader=null,this.keyLoader=null,this.level=-1,this.cc=0,this.startPTS=void 0,this.endPTS=void 0,this.startDTS=void 0,this.endDTS=void 0,this.start=0,this.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,this.stats=new Ft,this.data=void 0,this.bitrateTest=!1,this.title=null,this.initSegment=null,this.endList=void 0,this.gap=void 0,this.urlId=0,this.type=e}get decryptdata(){const{levelkeys:e}=this;if(!e&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkeys&&!this.levelkeys.NONE){const t=this.levelkeys.identity;if(t)this._decryptdata=t.getDecryptData(this.sn);else{const s=Object.keys(this.levelkeys);if(s.length===1)return this._decryptdata=this.levelkeys[s[0]].getDecryptData(this.sn)}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(this.programDateTime===null||!O(this.programDateTime))return null;const e=O(this.duration)?this.duration:0;return this.programDateTime+e*1e3}get encrypted(){var e;if((e=this._decryptdata)!=null&&e.encrypted)return!0;if(this.levelkeys){const t=Object.keys(this.levelkeys),s=t.length;if(s>1||s===1&&this.levelkeys[t[0]].encrypted)return!0}return!1}setKeyFormat(e){if(this.levelkeys){const t=this.levelkeys[e];t&&!this._decryptdata&&(this._decryptdata=t.getDecryptData(this.sn))}}abortRequests(){var e,t;(e=this.loader)==null||e.abort(),(t=this.keyLoader)==null||t.abort()}setElementaryStreamInfo(e,t,s,i,r,n=!1){const{elementaryStreams:o}=this,l=o[e];if(!l){o[e]={startPTS:t,endPTS:s,startDTS:i,endDTS:r,partial:n};return}l.startPTS=Math.min(l.startPTS,t),l.endPTS=Math.max(l.endPTS,s),l.startDTS=Math.min(l.startDTS,i),l.endDTS=Math.max(l.endDTS,r)}clearElementaryStreamInfo(){const{elementaryStreams:e}=this;e[X.AUDIO]=null,e[X.VIDEO]=null,e[X.AUDIOVIDEO]=null}}class pn extends Ki{constructor(e,t,s,i,r){super(s),this.fragOffset=0,this.duration=0,this.gap=!1,this.independent=!1,this.relurl=void 0,this.fragment=void 0,this.index=void 0,this.stats=new Ft,this.duration=e.decimalFloatingPoint("DURATION"),this.gap=e.bool("GAP"),this.independent=e.bool("INDEPENDENT"),this.relurl=e.enumeratedString("URI"),this.fragment=t,this.index=i;const n=e.enumeratedString("BYTERANGE");n&&this.setByteRange(n,r),r&&(this.fragOffset=r.fragOffset+r.duration)}get start(){return this.fragment.start+this.fragOffset}get end(){return this.start+this.duration}get loaded(){const{elementaryStreams:e}=this;return!!(e.audio||e.video||e.audiovideo)}}const Tn=10;class En{constructor(e){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.dateRanges=void 0,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.encryptedFragments=void 0,this.playlistParsingError=null,this.variableList=null,this.hasVariableRefs=!1,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=e}reloaded(e){if(!e){this.advanced=!0,this.updated=!0;return}const t=this.lastPartSn-e.lastPartSn,s=this.lastPartIndex-e.lastPartIndex;this.updated=this.endSN!==e.endSN||!!s||!!t||!this.live,this.advanced=this.endSN>e.endSN||t>0||t===0&&s>0,this.updated||this.advanced?this.misses=Math.floor(e.misses*.6):this.misses=e.misses+1,this.availabilityDelay=e.availabilityDelay}get hasProgramDateTime(){return this.fragments.length?O(this.fragments[this.fragments.length-1].programDateTime):!1}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||Tn}get drift(){const e=this.driftEndTime-this.driftStartTime;return e>0?(this.driftEnd-this.driftStart)*1e3/e:1}get edge(){return this.partEnd||this.fragmentEnd}get partEnd(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].end:this.fragmentEnd}get fragmentEnd(){var e;return(e=this.fragments)!=null&&e.length?this.fragments[this.fragments.length-1].end:0}get age(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}get lastPartIndex(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].index:-1}get lastPartSn(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}function Ss(a){return Uint8Array.from(atob(a),e=>e.charCodeAt(0))}function yn(a){const e=as(a).subarray(0,16),t=new Uint8Array(16);return t.set(e,16-e.length),t}function xn(a){const e=function(s,i,r){const n=s[i];s[i]=s[r],s[r]=n};e(a,0,3),e(a,1,2),e(a,4,5),e(a,6,7)}function Sn(a){const e=a.split(":");let t=null;if(e[0]==="data"&&e.length===2){const s=e[1].split(";"),i=s[s.length-1].split(",");if(i.length===2){const r=i[0]==="base64",n=i[1];r?(s.splice(-1,1),t=Ss(n)):t=yn(n)}}return t}function as(a){return Uint8Array.from(unescape(encodeURIComponent(a)),e=>e.charCodeAt(0))}const qe=typeof self<"u"?self:void 0;var Z={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},de={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.streamingkeydelivery",PLAYREADY:"com.microsoft.playready",WIDEVINE:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"};function $s(a){switch(a){case de.FAIRPLAY:return Z.FAIRPLAY;case de.PLAYREADY:return Z.PLAYREADY;case de.WIDEVINE:return Z.WIDEVINE;case de.CLEARKEY:return Z.CLEARKEY}}var Vi={WIDEVINE:"edef8ba979d64acea3c827dcd51d21ed"};function vn(a){if(a===Vi.WIDEVINE)return Z.WIDEVINE}function Gs(a){switch(a){case Z.FAIRPLAY:return de.FAIRPLAY;case Z.PLAYREADY:return de.PLAYREADY;case Z.WIDEVINE:return de.WIDEVINE;case Z.CLEARKEY:return de.CLEARKEY}}function Bt(a){const{drmSystems:e,widevineLicenseUrl:t}=a,s=e?[Z.FAIRPLAY,Z.WIDEVINE,Z.PLAYREADY,Z.CLEARKEY].filter(i=>!!e[i]):[];return!s[Z.WIDEVINE]&&t&&s.push(Z.WIDEVINE),s}const Hi=function(a){return qe!=null&&(a=qe.navigator)!=null&&a.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}();function An(a,e,t,s){let i;switch(a){case Z.FAIRPLAY:i=["cenc","sinf"];break;case Z.WIDEVINE:case Z.PLAYREADY:i=["cenc"];break;case Z.CLEARKEY:i=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${a}`)}return Ln(i,e,t,s)}function Ln(a,e,t,s){return[{initDataTypes:a,persistentState:s.persistentState||"optional",distinctiveIdentifier:s.distinctiveIdentifier||"optional",sessionTypes:s.sessionTypes||[s.sessionType||"temporary"],audioCapabilities:e.map(r=>({contentType:`audio/mp4; codecs="${r}"`,robustness:s.audioRobustness||"",encryptionScheme:s.audioEncryptionScheme||null})),videoCapabilities:t.map(r=>({contentType:`video/mp4; codecs="${r}"`,robustness:s.videoRobustness||"",encryptionScheme:s.videoEncryptionScheme||null}))}]}function Ne(a,e,t){return Uint8Array.prototype.slice?a.slice(e,t):new Uint8Array(Array.prototype.slice.call(a,e,t))}const vs=(a,e)=>e+10<=a.length&&a[e]===73&&a[e+1]===68&&a[e+2]===51&&a[e+3]<255&&a[e+4]<255&&a[e+6]<128&&a[e+7]<128&&a[e+8]<128&&a[e+9]<128,Wi=(a,e)=>e+10<=a.length&&a[e]===51&&a[e+1]===68&&a[e+2]===73&&a[e+3]<255&&a[e+4]<255&&a[e+6]<128&&a[e+7]<128&&a[e+8]<128&&a[e+9]<128,et=(a,e)=>{const t=e;let s=0;for(;vs(a,e);){s+=10;const i=Ot(a,e+6);s+=i,Wi(a,e+10)&&(s+=10),e+=s}if(s>0)return a.subarray(t,t+s)},Ot=(a,e)=>{let t=0;return t=(a[e]&127)<<21,t|=(a[e+1]&127)<<14,t|=(a[e+2]&127)<<7,t|=a[e+3]&127,t},Rn=(a,e)=>vs(a,e)&&Ot(a,e+6)+10<=a.length-e,As=a=>{const e=qi(a);for(let t=0;ta&&a.key==="PRIV"&&a.info==="com.apple.streaming.transportStreamTimestamp",In=a=>{const e=String.fromCharCode(a[0],a[1],a[2],a[3]),t=Ot(a,4),s=10;return{type:e,size:t,data:a.subarray(s,s+t)}},qi=a=>{let e=0;const t=[];for(;vs(a,e);){const s=Ot(a,e+6);e+=10;const i=e+s;for(;e+8a.type==="PRIV"?Dn(a):a.type[0]==="W"?_n(a):Cn(a),Dn=a=>{if(a.size<2)return;const e=Re(a.data,!0),t=new Uint8Array(a.data.subarray(e.length+1));return{key:a.type,info:e,data:t.buffer}},Cn=a=>{if(a.size<2)return;if(a.type==="TXXX"){let t=1;const s=Re(a.data.subarray(t),!0);t+=s.length+1;const i=Re(a.data.subarray(t));return{key:a.type,info:s,data:i}}const e=Re(a.data.subarray(1));return{key:a.type,data:e}},_n=a=>{if(a.type==="WXXX"){if(a.size<2)return;let t=1;const s=Re(a.data.subarray(t),!0);t+=s.length+1;const i=Re(a.data.subarray(t));return{key:a.type,info:s,data:i}}const e=Re(a.data);return{key:a.type,data:e}},wn=a=>{if(a.data.byteLength===8){const e=new Uint8Array(a.data),t=e[3]&1;let s=(e[4]<<23)+(e[5]<<15)+(e[6]<<7)+e[7];return s/=45,t&&(s+=4772185884e-2),Math.round(s)}},Re=(a,e=!1)=>{const t=kn();if(t){const c=t.decode(a);if(e){const h=c.indexOf("\0");return h!==-1?c.substring(0,h):c}return c.replace(/\0/g,"")}const s=a.length;let i,r,n,o="",l=0;for(;l>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:o+=String.fromCharCode(i);break;case 12:case 13:r=a[l++],o+=String.fromCharCode((i&31)<<6|r&63);break;case 14:r=a[l++],n=a[l++],o+=String.fromCharCode((i&15)<<12|(r&63)<<6|(n&63)<<0);break}}return o};let $t;function kn(){if(!navigator.userAgent.includes("PlayStation 4"))return!$t&&typeof self.TextDecoder<"u"&&($t=new self.TextDecoder("utf-8")),$t}const Se={hexDump:function(a){let e="";for(let t=0;t>24,a[e+1]=t>>16&255,a[e+2]=t>>8&255,a[e+3]=t&255}function Fn(a){const e=a.byteLength;for(let t=0;t8&&a[t+4]===109&&a[t+5]===111&&a[t+6]===111&&a[t+7]===102)return!0;t=s>1?t+s:e}return!1}function H(a,e){const t=[];if(!e.length)return t;const s=a.byteLength;for(let i=0;i1?i+r:s;if(n===e[0])if(e.length===1)t.push(a.subarray(i+8,o));else{const l=H(a.subarray(i+8,o),e.slice(1));l.length&&Pn.apply(t,l)}i=o}return t}function On(a){const e=[],t=a[0];let s=8;const i=N(a,s);s+=4;let r=0,n=0;t===0?(r=N(a,s),n=N(a,s+4),s+=8):(r=Ks(a,s),n=Ks(a,s+8),s+=16),s+=2;let o=a.length+n;const l=zi(a,s);s+=2;for(let c=0;c>>31===1)return v.warn("SIDX has hierarchical references (not supported)"),null;const f=N(a,h);h+=4,e.push({referenceSize:d,subsegmentDuration:f,info:{duration:f/i,start:o,end:o+d-1}}),o+=d,h+=4,s=h}return{earliestPresentationTime:r,timescale:i,version:t,referencesCount:l,references:e}}function Qi(a){const e=[],t=H(a,["moov","trak"]);for(let i=0;i{const r=N(i,4),n=e[r];n&&(n.default={duration:N(i,12),flags:N(i,20)})}),e}function Mn(a){const e=a.subarray(8),t=e.subarray(86),s=ie(e.subarray(4,8));let i=s;const r=s==="enca"||s==="encv";if(r){const o=H(e,[s])[0].subarray(s==="enca"?28:78);H(o,["sinf"]).forEach(c=>{const h=H(c,["schm"])[0];if(h){const u=ie(h.subarray(4,8));if(u==="cbcs"||u==="cenc"){const d=H(c,["frma"])[0];d&&(i=ie(d))}}})}switch(i){case"avc1":case"avc2":case"avc3":case"avc4":{const n=H(t,["avcC"])[0];i+="."+it(n[1])+it(n[2])+it(n[3]);break}case"mp4a":{const n=H(e,[s])[0],o=H(n.subarray(28),["esds"])[0];if(o&&o.length>12){let l=4;if(o[l++]!==3)break;l=Kt(o,l),l+=2;const c=o[l++];if(c&128&&(l+=2),c&64&&(l+=o[l++]),o[l++]!==4)break;l=Kt(o,l);const h=o[l++];if(h===64)i+="."+it(h);else break;if(l+=12,o[l++]!==5)break;l=Kt(o,l);const u=o[l++];let d=(u&248)>>3;d===31&&(d+=1+((u&7)<<3)+((o[l]&224)>>5)),i+="."+d}break}case"hvc1":case"hev1":{const n=H(t,["hvcC"])[0],o=n[1],l=["","A","B","C"][o>>6],c=o&31,h=N(n,2),u=(o&32)>>5?"H":"L",d=n[12],g=n.subarray(6,12);i+="."+l+c,i+="."+h.toString(16).toUpperCase(),i+="."+u+d;let f="";for(let m=g.length;m--;){const T=g[m];(T||f)&&(f="."+T.toString(16).toUpperCase()+f)}i+=f;break}case"dvh1":case"dvhe":{const n=H(t,["dvcC"])[0],o=n[2]>>1&127,l=n[2]<<5&32|n[3]>>3&31;i+="."+xe(o)+"."+xe(l);break}case"vp09":{const n=H(t,["vpcC"])[0],o=n[4],l=n[5],c=n[6]>>4&15;i+="."+xe(o)+"."+xe(l)+"."+xe(c);break}case"av01":{const n=H(t,["av1C"])[0],o=n[1]>>>5,l=n[1]&31,c=n[2]>>>7?"H":"M",h=(n[2]&64)>>6,u=(n[2]&32)>>5,d=o===2&&h?u?12:10:h?10:8,g=(n[2]&16)>>4,f=(n[2]&8)>>3,m=(n[2]&4)>>2,T=n[2]&3;i+="."+o+"."+xe(l)+c+"."+xe(d)+"."+g+"."+f+m+T+"."+xe(1)+"."+xe(1)+"."+xe(1)+"."+0;break}}return{codec:i,encrypted:r}}function Kt(a,e){const t=e+5;for(;a[e++]&128&&e{const n=H(i,["mdia","minf","stbl","stsd"])[0].subarray(8);let o=H(n,["enca"]);const l=o.length>0;l||(o=H(n,["encv"])),o.forEach(c=>{const h=l?c.subarray(28):c.subarray(78);H(h,["sinf"]).forEach(d=>{const g=Ji(d);if(g){const f=g.subarray(8,24);f.some(m=>m!==0)||(v.log(`[eme] Patching keyId in 'enc${l?"a":"v"}>sinf>>tenc' box: ${Se.hexDump(f)} -> ${Se.hexDump(t)}`),g.set(t,8))}})})}),a}function Ji(a){const e=H(a,["schm"])[0];if(e){const t=ie(e.subarray(4,8));if(t==="cbcs"||t==="cenc")return H(a,["schi","tenc"])[0]}return v.error("[eme] missing 'schm' box"),null}function Un(a,e){return H(e,["moof","traf"]).reduce((t,s)=>{const i=H(s,["tfdt"])[0],r=i[0],n=H(s,["tfhd"]).reduce((o,l)=>{const c=N(l,4),h=a[c];if(h){let u=N(i,4);if(r===1){if(u===vt)return v.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"),o;u*=vt+1,u+=N(i,8)}const d=h.timescale||9e4,g=u/d;if(O(g)&&(o===null||gg+f.info.duration||0,0);o=Math.max(o,d+u.earliestPresentationTime/u.timescale),l=o-n}}if(l&&O(l))return l}return s||i}function $n(a){const e=N(a,0);let t=8;e&1&&(t+=4),e&4&&(t+=4);let s=0;const i=N(a,4);for(let r=0;r{H(s,["tfhd"]).forEach(i=>{const r=N(i,4),n=a[r];if(!n)return;const o=n.timescale||9e4;H(s,["tfdt"]).forEach(l=>{const c=l[0],h=t*o;if(h){let u=N(l,4);if(c===0)u-=h,u=Math.max(u,0),Gt(l,4,u);else{u*=Math.pow(2,32),u+=N(l,8),u-=h,u=Math.max(u,0);const d=Math.floor(u/(vt+1)),g=Math.floor(u%(vt+1));Gt(l,4,d),Gt(l,8,g)}}})})})}function Kn(a){const e={valid:null,remainder:null},t=H(a,["moof"]);if(t.length<2)return e.remainder=a,e;const s=t[t.length-1];return e.valid=Ne(a,0,s.byteOffset-8),e.remainder=Ne(a,s.byteOffset-8),e}function pe(a,e){const t=new Uint8Array(a.length+e.length);return t.set(a),t.set(e,a.length),t}function Vs(a,e){const t=[],s=e.samples,i=e.timescale,r=e.id;let n=!1;return H(s,["moof"]).map(l=>{const c=l.byteOffset-8;H(l,["traf"]).map(u=>{const d=H(u,["tfdt"]).map(g=>{const f=g[0];let m=N(g,4);return f===1&&(m*=Math.pow(2,32),m+=N(g,8)),m/i})[0];return d!==void 0&&(a=d),H(u,["tfhd"]).map(g=>{const f=N(g,4),m=N(g,0)&16777215,T=(m&1)!==0,E=(m&2)!==0,x=(m&8)!==0;let y=0;const I=(m&16)!==0;let S=0;const D=(m&32)!==0;let R=8;f===r&&(T&&(R+=8),E&&(R+=4),x&&(y=N(g,R),R+=4),I&&(S=N(g,R),R+=4),D&&(R+=4),e.type==="video"&&(n=Vn(e.codec)),H(u,["trun"]).map(_=>{const k=_[0],b=N(_,0)&16777215,w=(b&1)!==0;let V=0;const P=(b&4)!==0,K=(b&256)!==0;let G=0;const B=(b&512)!==0;let q=0;const Q=(b&1024)!==0,M=(b&2048)!==0;let F=0;const j=N(_,4);let W=8;w&&(V=N(_,W),W+=4),P&&(W+=4);let z=V+c;for(let te=0;te>1&63;return t===39||t===40}else return(e&31)===6}function Zi(a,e,t,s){const i=er(a);let r=0;r+=e;let n=0,o=0,l=0;for(;r=i.length)break;l=i[r++],n+=l}while(l===255);o=0;do{if(r>=i.length)break;l=i[r++],o+=l}while(l===255);const c=i.length-r;let h=r;if(oc){v.error(`Malformed SEI payload. ${o} is too small, only ${c} bytes left to parse.`);break}if(n===4){if(i[h++]===181){const d=zi(i,h);if(h+=2,d===49){const g=N(i,h);if(h+=4,g===1195456820){const f=i[h++];if(f===3){const m=i[h++],T=31&m,E=64&m,x=E?2+T*3:0,y=new Uint8Array(x);if(E){y[0]=m;for(let I=1;I16){const u=[];for(let f=0;f<16;f++){const m=i[h++].toString(16);u.push(m.length==1?"0"+m:m),(f===3||f===5||f===7||f===9)&&u.push("-")}const d=o-16,g=new Uint8Array(d);for(let f=0;f>24&255,r[1]=s>>16&255,r[2]=s>>8&255,r[3]=s&255,r.set(a,4),i=0,s=8;i0?(r=new Uint8Array(4),e.length>0&&new DataView(r.buffer).setUint32(0,e.length,!1)):r=new Uint8Array;const n=new Uint8Array(4);return t&&t.byteLength>0&&new DataView(n.buffer).setUint32(0,t.byteLength,!1),Yn([112,115,115,104],new Uint8Array([s,0,0,0]),a,r,i,n,t||new Uint8Array)}function jn(a){if(!(a instanceof ArrayBuffer)||a.byteLength<32)return null;const e={version:0,systemId:"",kids:null,data:null},t=new DataView(a),s=t.getUint32(0);if(a.byteLength!==s&&s>44||t.getUint32(4)!==1886614376||(e.version=t.getUint32(8)>>>24,e.version>1))return null;e.systemId=Se.hexDump(new Uint8Array(a,12,16));const r=t.getUint32(28);if(e.version===0){if(s-32=22&&(this.keyId=t.subarray(t.length-22,t.length-6));break;case de.PLAYREADY:{const s=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=qn(s,null,t);const i=new Uint16Array(t.buffer,t.byteOffset,t.byteLength/2),r=String.fromCharCode.apply(null,Array.from(i)),n=r.substring(r.indexOf("<"),r.length),c=new DOMParser().parseFromString(n,"text/xml").getElementsByTagName("KID")[0];if(c){const h=c.childNodes[0]?c.childNodes[0].nodeValue:c.getAttribute("VALUE");if(h){const u=Ss(h).subarray(0,16);xn(u),this.keyId=u}}break}default:{let s=t.subarray(0,16);if(s.length!==16){const i=new Uint8Array(16);i.set(s,16-s.length),s=i}this.keyId=s;break}}if(!this.keyId||this.keyId.byteLength!==16){let s=rt[this.uri];if(!s){const i=Object.keys(rt).length%Number.MAX_SAFE_INTEGER;s=new Uint8Array(16),new DataView(s.buffer,12,4).setUint32(0,i),rt[this.uri]=s}this.keyId=s}return this}}function zn(a){const e=new Uint8Array(16);for(let t=12;t<16;t++)e[t]=a>>8*(15-t)&255;return e}const tr=/\{\$([a-zA-Z0-9-_]+)\}/g;function Hs(a){return tr.test(a)}function ue(a,e,t){if(a.variableList!==null||a.hasVariableRefs)for(let s=t.length;s--;){const i=t[s],r=e[i];r&&(e[i]=os(a,r))}}function os(a,e){if(a.variableList!==null||a.hasVariableRefs){const t=a.variableList;return e.replace(tr,s=>{const i=s.substring(2,s.length-1),r=t==null?void 0:t[i];return r===void 0?(a.playlistParsingError||(a.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${i}"`)),s):r})}return e}function Ws(a,e,t){let s=a.variableList;s||(a.variableList=s={});let i,r;if("QUERYPARAM"in e){i=e.QUERYPARAM;try{const n=new self.URL(t).searchParams;if(n.has(i))r=n.get(i);else throw new Error(`"${i}" does not match any query parameter in URI: "${t}"`)}catch(n){a.playlistParsingError||(a.playlistParsingError=new Error(`EXT-X-DEFINE QUERYPARAM: ${n.message}`))}}else i=e.NAME,r=e.VALUE;i in s?a.playlistParsingError||(a.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${i}"`)):s[i]=r||""}function Xn(a,e,t){const s=e.IMPORT;if(t&&s in t){let i=a.variableList;i||(a.variableList=i={}),i[s]=t[s]}else a.playlistParsingError||(a.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${s}"`))}function Ue(a=!0){return typeof self>"u"?void 0:(a||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function Qn(a){return typeof self<"u"&&a===self.ManagedMediaSource}const At={audio:{a3ds:1,"ac-3":.95,"ac-4":1,alac:.9,alaw:1,dra1:1,"dts+":1,"dts-":1,dtsc:1,dtse:1,dtsh:1,"ec-3":.9,enca:1,fLaC:.9,flac:.9,FLAC:.9,g719:1,g726:1,m4ae:1,mha1:1,mha2:1,mhm1:1,mhm2:1,mlpa:1,mp4a:1,"raw ":1,Opus:1,opus:1,samr:1,sawb:1,sawp:1,sevc:1,sqcp:1,ssmv:1,twos:1,ulaw:1},video:{avc1:1,avc2:1,avc3:1,avc4:1,avcp:1,av01:.8,drac:1,dva1:1,dvav:1,dvh1:.7,dvhe:.7,encv:1,hev1:.75,hvc1:.75,mjp2:1,mp4v:1,mvc1:1,mvc2:1,mvc3:1,mvc4:1,resv:1,rv60:1,s263:1,svc1:1,svc2:1,"vc-1":1,vp08:1,vp09:.9},text:{stpp:1,wvtt:1}};function Jn(a,e){const t=At[e];return!!t&&!!t[a.slice(0,4)]}function Vt(a,e,t=!0){return!a.split(",").some(s=>!sr(s,e,t))}function sr(a,e,t=!0){var s;const i=Ue(t);return(s=i==null?void 0:i.isTypeSupported(st(a,e)))!=null?s:!1}function st(a,e){return`${e}/mp4;codecs="${a}"`}function Ys(a){if(a){const e=a.substring(0,4);return At.video[e]}return 2}function Lt(a){return a.split(",").reduce((e,t)=>{const s=At.video[t];return s?(s*2+e)/(e?3:2):(At.audio[t]+e)/(e?2:1)},0)}const Ht={};function Zn(a,e=!0){if(Ht[a])return Ht[a];const t={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"]}[a];for(let s=0;sZn(t.toLowerCase(),e))}function qs(a,e){return a&&a!=="mp4a"?a:e&&e.split(",")[0]}function ta(a){const e=a.split(",");for(let t=0;t2){let i=s.shift()+".";i+=parseInt(s.shift()).toString(16),i+=("000"+parseInt(s.shift()).toString(16)).slice(-4),e[t]=i}}return e.join(",")}const js=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-(SESSION-DATA|SESSION-KEY|DEFINE|CONTENT-STEERING|START):([^\r\n]*)[\r\n]+/g,zs=/#EXT-X-MEDIA:(.*)/g,sa=/^#EXT(?:INF|-X-TARGETDURATION):/m,Xs=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[^\r\n]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),ia=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(DATERANGE|DEFINE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)/.source,/#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|VERSION): *(\d+)/.source,/#EXT-X-(DISCONTINUITY|ENDLIST|GAP|INDEPENDENT-SEGMENTS)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|"));class Ae{static findGroup(e,t){for(let s=0;s0&&r.length({id:c.attrs.AUDIO,audioCodec:c.audioCodec})),SUBTITLES:n.map(c=>({id:c.attrs.SUBTITLES,textCodec:c.textCodec})),"CLOSED-CAPTIONS":[]};let l=0;for(zs.lastIndex=0;(i=zs.exec(e))!==null;){const c=new ee(i[1]),h=c.TYPE;if(h){const u=o[h],d=r[h]||[];r[h]=d,ue(s,c,["URI","GROUP-ID","LANGUAGE","ASSOC-LANGUAGE","STABLE-RENDITION-ID","NAME","INSTREAM-ID","CHARACTERISTICS","CHANNELS"]);const g=c.LANGUAGE,f=c["ASSOC-LANGUAGE"],m=c.CHANNELS,T=c.CHARACTERISTICS,E=c["INSTREAM-ID"],x={attrs:c,bitrate:0,id:l++,groupId:c["GROUP-ID"]||"",name:c.NAME||g||"",type:h,default:c.bool("DEFAULT"),autoselect:c.bool("AUTOSELECT"),forced:c.bool("FORCED"),lang:g,url:c.URI?Ae.resolve(c.URI,t):""};if(f&&(x.assocLang=f),m&&(x.channels=m),T&&(x.characteristics=T),E&&(x.instreamId=E),u!=null&&u.length){const y=Ae.findGroup(u,x.groupId)||u[0];Zs(x,y,"audioCodec"),Zs(x,y,"textCodec")}d.push(x)}}return r}static parseLevelPlaylist(e,t,s,i,r,n){const o=new En(t),l=o.fragments;let c=null,h=0,u=0,d=0,g=0,f=null,m=new Ut(i,t),T,E,x,y=-1,I=!1,S=null;for(Xs.lastIndex=0,o.m3u8=e,o.hasVariableRefs=Hs(e);(T=Xs.exec(e))!==null;){I&&(I=!1,m=new Ut(i,t),m.start=d,m.sn=h,m.cc=g,m.level=s,c&&(m.initSegment=c,m.rawProgramDateTime=c.rawProgramDateTime,c.rawProgramDateTime=null,S&&(m.setByteRange(S),S=null)));const k=T[1];if(k){m.duration=parseFloat(k);const b=(" "+T[2]).slice(1);m.title=b||null,m.tagList.push(b?["INF",k,b]:["INF",k])}else if(T[3]){if(O(m.duration)){m.start=d,x&&si(m,x,o),m.sn=h,m.level=s,m.cc=g,l.push(m);const b=(" "+T[3]).slice(1);m.relurl=os(o,b),ei(m,f),f=m,d+=m.duration,h++,u=0,I=!0}}else if(T[4]){const b=(" "+T[4]).slice(1);f?m.setByteRange(b,f):m.setByteRange(b)}else if(T[5])m.rawProgramDateTime=(" "+T[5]).slice(1),m.tagList.push(["PROGRAM-DATE-TIME",m.rawProgramDateTime]),y===-1&&(y=l.length);else{if(T=T[0].match(ia),!T){v.warn("No matches on slow regex match for level playlist!");continue}for(E=1;E0&&P.bool("CAN-SKIP-DATERANGES"),o.partHoldBack=P.optionalFloat("PART-HOLD-BACK",0),o.holdBack=P.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{const P=new ee(w);o.partTarget=P.decimalFloatingPoint("PART-TARGET");break}case"PART":{let P=o.partList;P||(P=o.partList=[]);const K=u>0?P[P.length-1]:void 0,G=u++,B=new ee(w);ue(o,B,["BYTERANGE","URI"]);const q=new pn(B,m,t,G,K);P.push(q),m.duration+=q.duration;break}case"PRELOAD-HINT":{const P=new ee(w);ue(o,P,["URI"]),o.preloadHint=P;break}case"RENDITION-REPORT":{const P=new ee(w);ue(o,P,["URI"]),o.renditionReports=o.renditionReports||[],o.renditionReports.push(P);break}default:v.warn(`line parsed but not handled: ${T}`);break}}}f&&!f.relurl?(l.pop(),d-=f.duration,o.partList&&(o.fragmentHint=f)):o.partList&&(ei(m,f),m.cc=g,o.fragmentHint=m,x&&si(m,x,o));const D=l.length,R=l[0],_=l[D-1];if(d+=o.skippedSegments*o.targetduration,d>0&&D&&_){o.averagetargetduration=d/D;const k=_.sn;o.endSN=k!=="initSegment"?k:0,o.live||(_.endList=!0),R&&(o.startCC=R.cc)}else o.endSN=0,o.startCC=0;return o.fragmentHint&&(d+=o.fragmentHint.duration),o.totalduration=d,o.endCC=g,y>0&&na(l,y),o}}function Qs(a,e,t){var s,i;const r=new ee(a);ue(t,r,["KEYFORMAT","KEYFORMATVERSIONS","URI","IV","URI"]);const n=(s=r.METHOD)!=null?s:"",o=r.URI,l=r.hexadecimalInteger("IV"),c=r.KEYFORMATVERSIONS,h=(i=r.KEYFORMAT)!=null?i:"identity";o&&r.IV&&!l&&v.error(`Invalid IV: ${r.IV}`);const u=o?Ae.resolve(o,e):"",d=(c||"1").split("/").map(Number).filter(Number.isFinite);return new tt(n,u,h,d,l)}function Js(a){const t=new ee(a).decimalFloatingPoint("TIME-OFFSET");return O(t)?t:null}function ra(a,e){let t=(a||"").split(/[ ,]+/).filter(s=>s);["video","audio","text"].forEach(s=>{const i=t.filter(r=>Jn(r,s));i.length&&(e[`${s}Codec`]=i.join(","),t=t.filter(r=>i.indexOf(r)===-1))}),e.unknownCodecs=t}function Zs(a,e,t){const s=e[t];s&&(a[t]=s)}function na(a,e){let t=a[e];for(let s=e;s--;){const i=a[s];if(!i)return;i.programDateTime=t.programDateTime-i.duration*1e3,t=i}}function ei(a,e){a.rawProgramDateTime?a.programDateTime=Date.parse(a.rawProgramDateTime):e!=null&&e.programDateTime&&(a.programDateTime=e.endProgramDateTime),O(a.programDateTime)||(a.programDateTime=null,a.rawProgramDateTime=null)}function ti(a,e,t,s){a.relurl=e.URI,e.BYTERANGE&&a.setByteRange(e.BYTERANGE),a.level=t,a.sn="initSegment",s&&(a.levelkeys=s),a.initSegment=null}function si(a,e,t){a.levelkeys=e;const{encryptedFragments:s}=t;(!s.length||s[s.length-1].levelkeys!==e)&&Object.keys(e).some(i=>e[i].isCommonEncryption)&&s.push(a)}var Y={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},U={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};function ii(a){const{type:e}=a;switch(e){case Y.AUDIO_TRACK:return U.AUDIO;case Y.SUBTITLE_TRACK:return U.SUBTITLE;default:return U.MAIN}}function Wt(a,e){let t=a.url;return(t===void 0||t.indexOf("data:")===0)&&(t=e.url),t}class aa{constructor(e){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.hls=e,this.registerListeners()}startLoad(e){}stopLoad(){this.destroyInternalLoaders()}registerListeners(){const{hls:e}=this;e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.LEVEL_LOADING,this.onLevelLoading,this),e.on(p.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(p.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}unregisterListeners(){const{hls:e}=this;e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.LEVEL_LOADING,this.onLevelLoading,this),e.off(p.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(p.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}createInternalLoader(e){const t=this.hls.config,s=t.pLoader,i=t.loader,r=s||i,n=new r(t);return this.loaders[e.type]=n,n}getInternalLoader(e){return this.loaders[e.type]}resetInternalLoader(e){this.loaders[e]&&delete this.loaders[e]}destroyInternalLoaders(){for(const e in this.loaders){const t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}}destroy(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}onManifestLoading(e,t){const{url:s}=t;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:Y.MANIFEST,url:s,deliveryDirectives:null})}onLevelLoading(e,t){const{id:s,level:i,pathwayId:r,url:n,deliveryDirectives:o}=t;this.load({id:s,level:i,pathwayId:r,responseType:"text",type:Y.LEVEL,url:n,deliveryDirectives:o})}onAudioTrackLoading(e,t){const{id:s,groupId:i,url:r,deliveryDirectives:n}=t;this.load({id:s,groupId:i,level:null,responseType:"text",type:Y.AUDIO_TRACK,url:r,deliveryDirectives:n})}onSubtitleTrackLoading(e,t){const{id:s,groupId:i,url:r,deliveryDirectives:n}=t;this.load({id:s,groupId:i,level:null,responseType:"text",type:Y.SUBTITLE_TRACK,url:r,deliveryDirectives:n})}load(e){var t;const s=this.hls.config;let i=this.getInternalLoader(e);if(i){const c=i.context;if(c&&c.url===e.url&&c.level===e.level){v.trace("[playlist-loader]: playlist request ongoing");return}v.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`),i.abort()}let r;if(e.type===Y.MANIFEST?r=s.manifestLoadPolicy.default:r=se({},s.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),i=this.createInternalLoader(e),O((t=e.deliveryDirectives)==null?void 0:t.part)){let c;if(e.type===Y.LEVEL&&e.level!==null?c=this.hls.levels[e.level].details:e.type===Y.AUDIO_TRACK&&e.id!==null?c=this.hls.audioTracks[e.id].details:e.type===Y.SUBTITLE_TRACK&&e.id!==null&&(c=this.hls.subtitleTracks[e.id].details),c){const h=c.partTarget,u=c.targetduration;if(h&&u){const d=Math.max(h*3,u*.8)*1e3;r=se({},r,{maxTimeToFirstByteMs:Math.min(d,r.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(d,r.maxTimeToFirstByteMs)})}}}const n=r.errorRetry||r.timeoutRetry||{},o={loadPolicy:r,timeout:r.maxLoadTimeMs,maxRetry:n.maxNumRetry||0,retryDelay:n.retryDelayMs||0,maxRetryDelay:n.maxRetryDelayMs||0},l={onSuccess:(c,h,u,d)=>{const g=this.getInternalLoader(u);this.resetInternalLoader(u.type);const f=c.data;if(f.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(c,u,new Error("no EXTM3U delimiter"),d||null,h);return}h.parsing.start=performance.now(),Ae.isMediaPlaylist(f)?this.handleTrackOrLevelPlaylist(c,h,u,d||null,g):this.handleMasterPlaylist(c,h,u,d)},onError:(c,h,u,d)=>{this.handleNetworkError(h,u,!1,c,d)},onTimeout:(c,h,u)=>{this.handleNetworkError(h,u,!0,void 0,c)}};i.load(e,o,l)}handleMasterPlaylist(e,t,s,i){const r=this.hls,n=e.data,o=Wt(e,s),l=Ae.parseMasterPlaylist(n,o);if(l.playlistParsingError){this.handleManifestParsingError(e,s,l.playlistParsingError,i,t);return}const{contentSteering:c,levels:h,sessionData:u,sessionKeys:d,startTimeOffset:g,variableList:f}=l;this.variableList=f;const{AUDIO:m=[],SUBTITLES:T,"CLOSED-CAPTIONS":E}=Ae.parseMasterPlaylistMedia(n,o,l);m.length&&!m.some(y=>!y.url)&&h[0].audioCodec&&!h[0].attrs.AUDIO&&(v.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),m.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new ee({}),bitrate:0,url:""})),r.trigger(p.MANIFEST_LOADED,{levels:h,audioTracks:m,subtitles:T,captions:E,contentSteering:c,url:o,stats:t,networkDetails:i,sessionData:u,sessionKeys:d,startTimeOffset:g,variableList:f})}handleTrackOrLevelPlaylist(e,t,s,i,r){const n=this.hls,{id:o,level:l,type:c}=s,h=Wt(e,s),u=0,d=O(l)?l:O(o)?o:0,g=ii(s),f=Ae.parseLevelPlaylist(e.data,h,d,g,u,this.variableList);if(c===Y.MANIFEST){const m={attrs:new ee({}),bitrate:0,details:f,name:"",url:h};n.trigger(p.MANIFEST_LOADED,{levels:[m],audioTracks:[],url:h,stats:t,networkDetails:i,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),s.levelDetails=f,this.handlePlaylistLoaded(f,e,t,s,i,r)}handleManifestParsingError(e,t,s,i,r){this.hls.trigger(p.ERROR,{type:$.NETWORK_ERROR,details:L.MANIFEST_PARSING_ERROR,fatal:t.type===Y.MANIFEST,url:e.url,err:s,error:s,reason:s.message,response:e,context:t,networkDetails:i,stats:r})}handleNetworkError(e,t,s=!1,i,r){let n=`A network ${s?"timeout":"error"+(i?" (status "+i.code+")":"")} occurred while loading ${e.type}`;e.type===Y.LEVEL?n+=`: ${e.level} id: ${e.id}`:(e.type===Y.AUDIO_TRACK||e.type===Y.SUBTITLE_TRACK)&&(n+=` id: ${e.id} group-id: "${e.groupId}"`);const o=new Error(n);v.warn(`[playlist-loader]: ${n}`);let l=L.UNKNOWN,c=!1;const h=this.getInternalLoader(e);switch(e.type){case Y.MANIFEST:l=s?L.MANIFEST_LOAD_TIMEOUT:L.MANIFEST_LOAD_ERROR,c=!0;break;case Y.LEVEL:l=s?L.LEVEL_LOAD_TIMEOUT:L.LEVEL_LOAD_ERROR,c=!1;break;case Y.AUDIO_TRACK:l=s?L.AUDIO_TRACK_LOAD_TIMEOUT:L.AUDIO_TRACK_LOAD_ERROR,c=!1;break;case Y.SUBTITLE_TRACK:l=s?L.SUBTITLE_TRACK_LOAD_TIMEOUT:L.SUBTITLE_LOAD_ERROR,c=!1;break}h&&this.resetInternalLoader(e.type);const u={type:$.NETWORK_ERROR,details:l,fatal:c,url:e.url,loader:h,context:e,error:o,networkDetails:t,stats:r};if(i){const d=(t==null?void 0:t.url)||e.url;u.response=oe({url:d,data:void 0},i)}this.hls.trigger(p.ERROR,u)}handlePlaylistLoaded(e,t,s,i,r,n){const o=this.hls,{type:l,level:c,id:h,groupId:u,deliveryDirectives:d}=i,g=Wt(t,i),f=ii(i),m=typeof i.level=="number"&&f===U.MAIN?c:void 0;if(!e.fragments.length){const E=new Error("No Segments found in Playlist");o.trigger(p.ERROR,{type:$.NETWORK_ERROR,details:L.LEVEL_EMPTY_ERROR,fatal:!1,url:g,error:E,reason:E.message,response:t,context:i,level:m,parent:f,networkDetails:r,stats:s});return}e.targetduration||(e.playlistParsingError=new Error("Missing Target Duration"));const T=e.playlistParsingError;if(T){o.trigger(p.ERROR,{type:$.NETWORK_ERROR,details:L.LEVEL_PARSING_ERROR,fatal:!1,url:g,error:T,reason:T.message,response:t,context:i,level:m,parent:f,networkDetails:r,stats:s});return}switch(e.live&&n&&(n.getCacheAge&&(e.ageHeader=n.getCacheAge()||0),(!n.getCacheAge||isNaN(e.ageHeader))&&(e.ageHeader=0)),l){case Y.MANIFEST:case Y.LEVEL:o.trigger(p.LEVEL_LOADED,{details:e,level:m||0,id:h||0,stats:s,networkDetails:r,deliveryDirectives:d});break;case Y.AUDIO_TRACK:o.trigger(p.AUDIO_TRACK_LOADED,{details:e,id:h||0,groupId:u||"",stats:s,networkDetails:r,deliveryDirectives:d});break;case Y.SUBTITLE_TRACK:o.trigger(p.SUBTITLE_TRACK_LOADED,{details:e,id:h||0,groupId:u||"",stats:s,networkDetails:r,deliveryDirectives:d});break}}}function ir(a,e){let t;try{t=new Event("addtrack")}catch{t=document.createEvent("Event"),t.initEvent("addtrack",!1,!1)}t.track=a,e.dispatchEvent(t)}function rr(a,e){const t=a.mode;if(t==="disabled"&&(a.mode="hidden"),a.cues&&!a.cues.getCueById(e.id))try{if(a.addCue(e),!a.cues.getCueById(e.id))throw new Error(`addCue is failed for: ${e}`)}catch(s){v.debug(`[texttrack-utils]: ${s}`);try{const i=new self.TextTrackCue(e.startTime,e.endTime,e.text);i.id=e.id,a.addCue(i)}catch(i){v.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${i}`)}}t==="disabled"&&(a.mode=t)}function He(a){const e=a.mode;if(e==="disabled"&&(a.mode="hidden"),a.cues)for(let t=a.cues.length;t--;)a.removeCue(a.cues[t]);e==="disabled"&&(a.mode=e)}function ls(a,e,t,s){const i=a.mode;if(i==="disabled"&&(a.mode="hidden"),a.cues&&a.cues.length>0){const r=la(a.cues,e,t);for(let n=0;na[t].endTime)return-1;let s=0,i=t;for(;s<=i;){const r=Math.floor((i+s)/2);if(ea[r].startTime&&s-1)for(let r=i,n=a.length;r=e&&o.endTime<=t)s.push(o);else if(o.startTime>t)return s}return s}function gt(a){const e=[];for(let t=0;t"u"))return self.VTTCue||self.TextTrackCue}function ri(a,e,t,s,i){let r=new a(e,t,"");try{r.value=s,i&&(r.type=i)}catch{r=new a(e,t,JSON.stringify(i?oe({type:i},s):s))}return r}const nt=(()=>{const a=cs();try{a&&new a(0,Number.POSITIVE_INFINITY,"")}catch{return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();function Yt(a,e){return a.getTime()/1e3-e}function ha(a){return Uint8Array.from(a.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}class ua{constructor(e){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=e,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=null}_registerListeners(){const{hls:e}=this;e.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(p.LEVEL_UPDATED,this.onLevelUpdated,this)}_unregisterListeners(){const{hls:e}=this;e.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(p.LEVEL_UPDATED,this.onLevelUpdated,this)}onMediaAttached(e,t){this.media=t.media}onMediaDetaching(){this.id3Track&&(He(this.id3Track),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={})}onManifestLoading(){this.dateRangeCuesAppended={}}createTrack(e){const t=this.getID3Track(e.textTracks);return t.mode="hidden",t}getID3Track(e){if(this.media){for(let t=0;tnt&&(u=nt),u-h<=0&&(u=h+ca);for(let g=0;gh.type===ye.audioId3&&l:i==="video"?c=h=>h.type===ye.emsg&&o:c=h=>h.type===ye.audioId3&&l||h.type===ye.emsg&&o,ls(r,t,s,c)}}onLevelUpdated(e,{details:t}){if(!this.media||!t.hasProgramDateTime||!this.hls.config.enableDateRangeMetadataCues)return;const{dateRangeCuesAppended:s,id3Track:i}=this,{dateRanges:r}=t,n=Object.keys(r);if(i){const h=Object.keys(s).filter(u=>!n.includes(u));for(let u=h.length;u--;){const d=h[u];Object.keys(s[d].cues).forEach(g=>{i.removeCue(s[d].cues[g])}),delete s[d]}}const o=t.fragments[t.fragments.length-1];if(n.length===0||!O(o==null?void 0:o.programDateTime))return;this.id3Track||(this.id3Track=this.createTrack(this.media));const l=o.programDateTime/1e3-o.start,c=cs();for(let h=0;h{if(D!==d.id){const R=r[D];if(R.class===d.class&&R.startDate>d.startDate&&(!S||d.startDatethis.timeupdate(),this.hls=e,this.config=e.config,this.registerListeners()}get latency(){return this._latency||0}get maxLatency(){const{config:e,levelDetails:t}=this;return e.liveMaxLatencyDuration!==void 0?e.liveMaxLatencyDuration:t?e.liveMaxLatencyDurationCount*t.targetduration:0}get targetLatency(){const{levelDetails:e}=this;if(e===null)return null;const{holdBack:t,partHoldBack:s,targetduration:i}=e,{liveSyncDuration:r,liveSyncDurationCount:n,lowLatencyMode:o}=this.config,l=this.hls.userConfig;let c=o&&s||t;(l.liveSyncDuration||l.liveSyncDurationCount||c===0)&&(c=r!==void 0?r:n*i);const h=i;return c+Math.min(this.stallCount*1,h)}get liveSyncPosition(){const e=this.estimateLiveEdge(),t=this.targetLatency,s=this.levelDetails;if(e===null||t===null||s===null)return null;const i=s.edge,r=e-t-this.edgeStalled,n=i-s.totalduration,o=i-(this.config.lowLatencyMode&&s.partTarget||s.targetduration);return Math.min(Math.max(n,r),o)}get drift(){const{levelDetails:e}=this;return e===null?1:e.drift}get edgeStalled(){const{levelDetails:e}=this;if(e===null)return 0;const t=(this.config.lowLatencyMode&&e.partTarget||e.targetduration)*3;return Math.max(e.age-t,0)}get forwardBufferLength(){const{media:e,levelDetails:t}=this;if(!e||!t)return 0;const s=e.buffered.length;return(s?e.buffered.end(s-1):t.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null}registerListeners(){this.hls.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(p.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(p.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(p.ERROR,this.onError,this)}unregisterListeners(){this.hls.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.off(p.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(p.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.off(p.ERROR,this.onError,this)}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)}onMediaDetaching(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)}onManifestLoading(){this.levelDetails=null,this._latency=null,this.stallCount=0}onLevelUpdated(e,{details:t}){this.levelDetails=t,t.advanced&&this.timeupdate(),!t.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)}onError(e,t){var s;t.details===L.BUFFER_STALLED_ERROR&&(this.stallCount++,(s=this.levelDetails)!=null&&s.live&&v.warn("[playback-rate-controller]: Stall detected, adjusting target latency"))}timeupdate(){const{media:e,levelDetails:t}=this;if(!e||!t)return;this.currentTime=e.currentTime;const s=this.computeLatency();if(s===null)return;this._latency=s;const{lowLatencyMode:i,maxLiveSyncPlaybackRate:r}=this.config;if(!i||r===1||!t.live)return;const n=this.targetLatency;if(n===null)return;const o=s-n,l=Math.min(this.maxLatency,n+t.targetduration);if(o.05&&this.forwardBufferLength>1){const h=Math.min(2,Math.max(1,r)),u=Math.round(2/(1+Math.exp(-.75*o-this.edgeStalled))*20)/20;e.playbackRate=Math.min(h,Math.max(1,u))}else e.playbackRate!==1&&e.playbackRate!==0&&(e.playbackRate=1)}estimateLiveEdge(){const{levelDetails:e}=this;return e===null?null:e.edge+e.age}computeLatency(){const e=this.estimateLiveEdge();return e===null?null:e-this.currentTime}}const hs=["NONE","TYPE-0","TYPE-1",null];function fa(a){return hs.indexOf(a)>-1}const It=["SDR","PQ","HLG"];function ga(a){return!!a&&It.indexOf(a)>-1}var mt={No:"",Yes:"YES",v2:"v2"};function ni(a){const{canSkipUntil:e,canSkipDateRanges:t,age:s}=a,i=s!!t).map(t=>t.substring(0,4)).join(","),this.addGroupId("audio",e.attrs.AUDIO),this.addGroupId("text",e.attrs.SUBTITLES)}get maxBitrate(){return Math.max(this.realBitrate,this.bitrate)}get averageBitrate(){return this._avgBitrate||this.realBitrate||this.bitrate}get attrs(){return this._attrs[0]}get codecs(){return this.attrs.CODECS||""}get pathwayId(){return this.attrs["PATHWAY-ID"]||"."}get videoRange(){return this.attrs["VIDEO-RANGE"]||"SDR"}get score(){return this.attrs.optionalFloat("SCORE",0)}get uri(){return this.url[0]||""}hasAudioGroup(e){return oi(this._audioGroups,e)}hasSubtitleGroup(e){return oi(this._subtitleGroups,e)}get audioGroups(){return this._audioGroups}get subtitleGroups(){return this._subtitleGroups}addGroupId(e,t){if(t){if(e==="audio"){let s=this._audioGroups;s||(s=this._audioGroups=[]),s.indexOf(t)===-1&&s.push(t)}else if(e==="text"){let s=this._subtitleGroups;s||(s=this._subtitleGroups=[]),s.indexOf(t)===-1&&s.push(t)}}}get urlId(){return 0}set urlId(e){}get audioGroupIds(){return this.audioGroups?[this.audioGroupId]:void 0}get textGroupIds(){return this.subtitleGroups?[this.textGroupId]:void 0}get audioGroupId(){var e;return(e=this.audioGroups)==null?void 0:e[0]}get textGroupId(){var e;return(e=this.subtitleGroups)==null?void 0:e[0]}addFallback(){}}function oi(a,e){return!e||!a?!1:a.indexOf(e)!==-1}function qt(a,e){const t=e.startPTS;if(O(t)){let s=0,i;e.sn>a.sn?(s=t-a.start,i=a):(s=a.start-t,i=e),i.duration!==s&&(i.duration=s)}else e.sn>a.sn?a.cc===e.cc&&a.minEndPTS?e.start=a.start+(a.minEndPTS-a.start):e.start=a.start+a.duration:e.start=Math.max(a.start-e.duration,0)}function nr(a,e,t,s,i,r){s-t<=0&&(v.warn("Fragment should have a positive duration",e),s=t+e.duration,r=i+e.duration);let o=t,l=s;const c=e.startPTS,h=e.endPTS;if(O(c)){const T=Math.abs(c-t);O(e.deltaPTS)?e.deltaPTS=Math.max(T,e.deltaPTS):e.deltaPTS=T,o=Math.max(t,c),t=Math.min(t,c),i=Math.min(i,e.startDTS),l=Math.min(s,h),s=Math.max(s,h),r=Math.max(r,e.endDTS)}const u=t-e.start;e.start!==0&&(e.start=t),e.duration=s-e.start,e.startPTS=t,e.maxStartPTS=o,e.startDTS=i,e.endPTS=s,e.minEndPTS=l,e.endDTS=r;const d=e.sn;if(!a||da.endSN)return 0;let g;const f=d-a.startSN,m=a.fragments;for(m[f]=e,g=f;g>0;g--)qt(m[g],m[g-1]);for(g=f;g=0;l--){const c=s[l].initSegment;if(c){t=c;break}}a.fragmentHint&&delete a.fragmentHint.endPTS;let i=0,r;if(Ea(a,e,(l,c)=>{l.relurl&&(i=l.cc-c.cc),O(l.startPTS)&&O(l.endPTS)&&(c.start=c.startPTS=l.startPTS,c.startDTS=l.startDTS,c.maxStartPTS=l.maxStartPTS,c.endPTS=l.endPTS,c.endDTS=l.endDTS,c.minEndPTS=l.minEndPTS,c.duration=l.endPTS-l.startPTS,c.duration&&(r=c),e.PTSKnown=e.alignedSliding=!0),c.elementaryStreams=l.elementaryStreams,c.loader=l.loader,c.stats=l.stats,l.initSegment&&(c.initSegment=l.initSegment,t=l.initSegment)}),t&&(e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments).forEach(c=>{var h;c&&(!c.initSegment||c.initSegment.relurl===((h=t)==null?void 0:h.relurl))&&(c.initSegment=t)}),e.skippedSegments)if(e.deltaUpdateFailed=e.fragments.some(l=>!l),e.deltaUpdateFailed){v.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let l=e.skippedSegments;l--;)e.fragments.shift();e.startSN=e.fragments[0].sn,e.startCC=e.fragments[0].cc}else e.canSkipDateRanges&&(e.dateRanges=pa(a.dateRanges,e.dateRanges,e.recentlyRemovedDateranges));const n=e.fragments;if(i){v.warn("discontinuity sliding from playlist, take drift into account");for(let l=0;l{c.elementaryStreams=l.elementaryStreams,c.stats=l.stats}),r?nr(e,r,r.startPTS,r.endPTS,r.startDTS,r.endDTS):ar(a,e),n.length&&(e.totalduration=e.edge-n[0].start),e.driftStartTime=a.driftStartTime,e.driftStart=a.driftStart;const o=e.advancedDateTime;if(e.advanced&&o){const l=e.edge;e.driftStart||(e.driftStartTime=o,e.driftStart=l),e.driftEndTime=o,e.driftEnd=l}else e.driftEndTime=a.driftEndTime,e.driftEnd=a.driftEnd,e.advancedDateTime=a.advancedDateTime}function pa(a,e,t){const s=se({},a);return t&&t.forEach(i=>{delete s[i]}),Object.keys(e).forEach(i=>{const r=new Gi(e[i].attr,s[i]);r.isValid?s[i]=r:v.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${JSON.stringify(e[i].attr)}"`)}),s}function Ta(a,e,t){if(a&&e){let s=0;for(let i=0,r=a.length;i<=r;i++){const n=a[i],o=e[i+s];n&&o&&n.index===o.index&&n.fragment.sn===o.fragment.sn?t(n,o):s--}}}function Ea(a,e,t){const s=e.skippedSegments,i=Math.max(a.startSN,e.startSN)-e.startSN,r=(a.fragmentHint?1:0)+(s?e.endSN:Math.min(a.endSN,e.endSN))-e.startSN,n=e.startSN-a.startSN,o=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,l=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments;for(let c=i;c<=r;c++){const h=l[n+c];let u=o[c];s&&!u&&c=s.length||us(e,s[t].start)}function us(a,e){if(e){const t=a.fragments;for(let s=a.skippedSegments;se){const r=s[s.length-1].duration*1e3;r{const{details:s}=e;s!=null&&s.fragments&&s.fragments.forEach(i=>{i.level=t})})}function bt(a){switch(a.details){case L.FRAG_LOAD_TIMEOUT:case L.KEY_LOAD_TIMEOUT:case L.LEVEL_LOAD_TIMEOUT:case L.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function ci(a,e){const t=bt(e);return a.default[`${t?"timeout":"error"}Retry`]}function Ls(a,e){const t=a.backoff==="linear"?1:Math.pow(2,e);return Math.min(t*a.retryDelayMs,a.maxRetryDelayMs)}function hi(a){return oe(oe({},a),{errorRetry:null,timeoutRetry:null})}function Dt(a,e,t,s){if(!a)return!1;const i=s==null?void 0:s.code,r=e499)}const cr={search:function(a,e){let t=0,s=a.length-1,i=null,r=null;for(;t<=s;){i=(t+s)/2|0,r=a[i];const n=e(r);if(n>0)t=i+1;else if(n<0)s=i-1;else return r}return null}};function va(a,e,t){if(e===null||!Array.isArray(a)||!a.length||!O(e))return null;const s=a[0].programDateTime;if(e<(s||0))return null;const i=a[a.length-1].endProgramDateTime;if(e>=(i||0))return null;t=t||0;for(let r=0;r0&&o<15e-7&&(t+=15e-7)}else t===0&&e[0].start===0&&(r=e[0]);if(r&&((!a||a.level===r.level)&&ds(t,s,r)===0||Aa(r,a,Math.min(i,s))))return r;const n=cr.search(e,ds.bind(null,t,s));return n&&(n!==a||!r)?n:r}function Aa(a,e,t){if(e&&e.start===0&&e.level0){const s=e.tagList.reduce((i,r)=>(r[0]==="INF"&&(i+=parseFloat(r[1])),i),t);return a.start<=s}return!1}function ds(a=0,e=0,t){if(t.start<=a&&t.start+t.duration>a)return 0;const s=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0));return t.start+t.duration-s<=a?1:t.start-s>a&&t.start?-1:0}function La(a,e,t){const s=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0))*1e3;return(t.endProgramDateTime||0)-s>a}function Ra(a,e){return cr.search(a,t=>t.cce?-1:0)}var ce={DoNothing:0,SendEndCallback:1,SendAlternateToPenaltyBox:2,RemoveAlternatePermanently:3,InsertDiscontinuity:4,RetryRequest:5},Te={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2,SwitchToSDR:4};class Ia{constructor(e){this.hls=void 0,this.playlistError=0,this.penalizedRenditions={},this.log=void 0,this.warn=void 0,this.error=void 0,this.hls=e,this.log=v.log.bind(v,"[info]:"),this.warn=v.warn.bind(v,"[warning]:"),this.error=v.error.bind(v,"[error]:"),this.registerListeners()}registerListeners(){const e=this.hls;e.on(p.ERROR,this.onError,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const e=this.hls;e&&(e.off(p.ERROR,this.onError,this),e.off(p.ERROR,this.onErrorOut,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.LEVEL_UPDATED,this.onLevelUpdated,this))}destroy(){this.unregisterListeners(),this.hls=null,this.penalizedRenditions={}}startLoad(e){}stopLoad(){this.playlistError=0}getVariantLevelIndex(e){return(e==null?void 0:e.type)===U.MAIN?e.level:this.hls.loadLevel}onManifestLoading(){this.playlistError=0,this.penalizedRenditions={}}onLevelUpdated(){this.playlistError=0}onError(e,t){var s,i;if(t.fatal)return;const r=this.hls,n=t.context;switch(t.details){case L.FRAG_LOAD_ERROR:case L.FRAG_LOAD_TIMEOUT:case L.KEY_LOAD_ERROR:case L.KEY_LOAD_TIMEOUT:t.errorAction=this.getFragRetryOrSwitchAction(t);return;case L.FRAG_PARSING_ERROR:if((s=t.frag)!=null&&s.gap){t.errorAction={action:ce.DoNothing,flags:Te.None};return}case L.FRAG_GAP:case L.FRAG_DECRYPT_ERROR:{t.errorAction=this.getFragRetryOrSwitchAction(t),t.errorAction.action=ce.SendAlternateToPenaltyBox;return}case L.LEVEL_EMPTY_ERROR:case L.LEVEL_PARSING_ERROR:{var o,l;const c=t.parent===U.MAIN?t.level:r.loadLevel;t.details===L.LEVEL_EMPTY_ERROR&&((o=t.context)!=null&&(l=o.levelDetails)!=null&&l.live)?t.errorAction=this.getPlaylistRetryOrSwitchAction(t,c):(t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,c))}return;case L.LEVEL_LOAD_ERROR:case L.LEVEL_LOAD_TIMEOUT:typeof(n==null?void 0:n.level)=="number"&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,n.level));return;case L.AUDIO_TRACK_LOAD_ERROR:case L.AUDIO_TRACK_LOAD_TIMEOUT:case L.SUBTITLE_LOAD_ERROR:case L.SUBTITLE_TRACK_LOAD_TIMEOUT:if(n){const c=r.levels[r.loadLevel];if(c&&(n.type===Y.AUDIO_TRACK&&c.hasAudioGroup(n.groupId)||n.type===Y.SUBTITLE_TRACK&&c.hasSubtitleGroup(n.groupId))){t.errorAction=this.getPlaylistRetryOrSwitchAction(t,r.loadLevel),t.errorAction.action=ce.SendAlternateToPenaltyBox,t.errorAction.flags=Te.MoveAllAlternatesMatchingHost;return}}return;case L.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:{const c=r.levels[r.loadLevel],h=c==null?void 0:c.attrs["HDCP-LEVEL"];h?t.errorAction={action:ce.SendAlternateToPenaltyBox,flags:Te.MoveAllAlternatesMatchingHDCP,hdcpLevel:h}:this.keySystemError(t)}return;case L.BUFFER_ADD_CODEC_ERROR:case L.REMUX_ALLOC_ERROR:case L.BUFFER_APPEND_ERROR:t.errorAction=this.getLevelSwitchAction(t,(i=t.level)!=null?i:r.loadLevel);return;case L.INTERNAL_EXCEPTION:case L.BUFFER_APPENDING_ERROR:case L.BUFFER_FULL_ERROR:case L.LEVEL_SWITCH_ERROR:case L.BUFFER_STALLED_ERROR:case L.BUFFER_SEEK_OVER_HOLE:case L.BUFFER_NUDGE_ON_STALL:t.errorAction={action:ce.DoNothing,flags:Te.None};return}t.type===$.KEY_SYSTEM_ERROR&&this.keySystemError(t)}keySystemError(e){const t=this.getVariantLevelIndex(e.frag);e.levelRetry=!1,e.errorAction=this.getLevelSwitchAction(e,t)}getPlaylistRetryOrSwitchAction(e,t){const s=this.hls,i=ci(s.config.playlistLoadPolicy,e),r=this.playlistError++;if(Dt(i,r,bt(e),e.response))return{action:ce.RetryRequest,flags:Te.None,retryConfig:i,retryCount:r};const o=this.getLevelSwitchAction(e,t);return i&&(o.retryConfig=i,o.retryCount=r),o}getFragRetryOrSwitchAction(e){const t=this.hls,s=this.getVariantLevelIndex(e.frag),i=t.levels[s],{fragLoadPolicy:r,keyLoadPolicy:n}=t.config,o=ci(e.details.startsWith("key")?n:r,e),l=t.levels.reduce((h,u)=>h+u.fragmentError,0);if(i&&(e.details!==L.FRAG_GAP&&i.fragmentError++,Dt(o,l,bt(e),e.response)))return{action:ce.RetryRequest,flags:Te.None,retryConfig:o,retryCount:l};const c=this.getLevelSwitchAction(e,s);return o&&(c.retryConfig=o,c.retryCount=l),c}getLevelSwitchAction(e,t){const s=this.hls;t==null&&(t=s.loadLevel);const i=this.hls.levels[t];if(i){var r,n;const c=e.details;i.loadError++,c===L.BUFFER_APPEND_ERROR&&i.fragmentError++;let h=-1;const{levels:u,loadLevel:d,minAutoLevel:g,maxAutoLevel:f}=s;s.autoLevelEnabled||(s.loadLevel=-1);const m=(r=e.frag)==null?void 0:r.type,E=(m===U.AUDIO&&c===L.FRAG_PARSING_ERROR||e.sourceBufferName==="audio"&&(c===L.BUFFER_ADD_CODEC_ERROR||c===L.BUFFER_APPEND_ERROR))&&u.some(({audioCodec:D})=>i.audioCodec!==D),y=e.sourceBufferName==="video"&&(c===L.BUFFER_ADD_CODEC_ERROR||c===L.BUFFER_APPEND_ERROR)&&u.some(({codecSet:D,audioCodec:R})=>i.codecSet!==D&&i.audioCodec===R),{type:I,groupId:S}=(n=e.context)!=null?n:{};for(let D=u.length;D--;){const R=(D+d)%u.length;if(R!==d&&R>=g&&R<=f&&u[R].loadError===0){var o,l;const _=u[R];if(c===L.FRAG_GAP&&m===U.MAIN&&e.frag){const k=u[R].details;if(k){const b=Ct(e.frag,k.fragments,e.frag.start);if(b!=null&&b.gap)continue}}else{if(I===Y.AUDIO_TRACK&&_.hasAudioGroup(S)||I===Y.SUBTITLE_TRACK&&_.hasSubtitleGroup(S))continue;if(m===U.AUDIO&&(o=i.audioGroups)!=null&&o.some(k=>_.hasAudioGroup(k))||m===U.SUBTITLE&&(l=i.subtitleGroups)!=null&&l.some(k=>_.hasSubtitleGroup(k))||E&&i.audioCodec===_.audioCodec||!E&&i.audioCodec!==_.audioCodec||y&&i.codecSet===_.codecSet)continue}h=R;break}}if(h>-1&&s.loadLevel!==h)return e.levelRetry=!0,this.playlistError=0,{action:ce.SendAlternateToPenaltyBox,flags:Te.None,nextAutoLevel:h}}return{action:ce.SendAlternateToPenaltyBox,flags:Te.MoveAllAlternatesMatchingHost}}onErrorOut(e,t){var s;switch((s=t.errorAction)==null?void 0:s.action){case ce.DoNothing:break;case ce.SendAlternateToPenaltyBox:this.sendAlternateToPenaltyBox(t),!t.errorAction.resolved&&t.details!==L.FRAG_GAP?t.fatal=!0:/MediaSource readyState: ended/.test(t.error.message)&&(this.warn(`MediaSource ended after "${t.sourceBufferName}" sourceBuffer append error. Attempting to recover from media error.`),this.hls.recoverMediaError());break}if(t.fatal){this.hls.stopLoad();return}}sendAlternateToPenaltyBox(e){const t=this.hls,s=e.errorAction;if(!s)return;const{flags:i,hdcpLevel:r,nextAutoLevel:n}=s;switch(i){case Te.None:this.switchLevel(e,n);break;case Te.MoveAllAlternatesMatchingHDCP:r&&(t.maxHdcpLevel=hs[hs.indexOf(r)-1],s.resolved=!0),this.warn(`Restricting playback to HDCP-LEVEL of "${t.maxHdcpLevel}" or lower`);break}s.resolved||this.switchLevel(e,n)}switchLevel(e,t){t!==void 0&&e.errorAction&&(this.warn(`switching to level ${t} after ${e.details}`),this.hls.nextAutoLevel=t,e.errorAction.resolved=!0,this.hls.nextLoadLevel=this.hls.nextAutoLevel)}}class Rs{constructor(e,t){this.hls=void 0,this.timer=-1,this.requestScheduled=-1,this.canLoad=!1,this.log=void 0,this.warn=void 0,this.log=v.log.bind(v,`${t}:`),this.warn=v.warn.bind(v,`${t}:`),this.hls=e}destroy(){this.clearTimer(),this.hls=this.log=this.warn=null}clearTimer(){this.timer!==-1&&(self.clearTimeout(this.timer),this.timer=-1)}startLoad(){this.canLoad=!0,this.requestScheduled=-1,this.loadPlaylist()}stopLoad(){this.canLoad=!1,this.clearTimer()}switchParams(e,t,s){const i=t==null?void 0:t.renditionReports;if(i){let r=-1;for(let n=0;n=0&&h>t.partTarget&&(l+=1)}const c=s&&ni(s);return new ai(o,l>=0?l:void 0,c)}}}loadPlaylist(e){this.requestScheduled===-1&&(this.requestScheduled=self.performance.now())}shouldLoadPlaylist(e){return this.canLoad&&!!e&&!!e.url&&(!e.details||e.details.live)}shouldReloadPlaylist(e){return this.timer===-1&&this.requestScheduled===-1&&this.shouldLoadPlaylist(e)}playlistLoaded(e,t,s){const{details:i,stats:r}=t,n=self.performance.now(),o=r.loading.first?Math.max(0,n-r.loading.first):0;if(i.advancedDateTime=Date.now()-o,i.live||s!=null&&s.live){if(i.reloaded(s),s&&this.log(`live playlist ${e} ${i.advanced?"REFRESHED "+i.lastPartSn+"-"+i.lastPartIndex:i.updated?"UPDATED":"MISSED"}`),s&&i.fragments.length>0&&ma(s,i),!this.canLoad||!i.live)return;let l,c,h;if(i.canBlockReload&&i.endSN&&i.advanced){const T=this.hls.config.lowLatencyMode,E=i.lastPartSn,x=i.endSN,y=i.lastPartIndex,I=y!==-1,S=E===x,D=T?0:y;I?(c=S?x+1:E,h=S?D:y+1):c=x+1;const R=i.age,_=R+i.ageHeader;let k=Math.min(_-i.partTarget,i.targetduration*1.5);if(k>0){if(s&&k>s.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${s.tuneInGoal} to: ${k} with playlist age: ${i.age}`),k=0;else{const b=Math.floor(k/i.targetduration);if(c+=b,h!==void 0){const w=Math.round(k%i.targetduration/i.partTarget);h+=w}this.log(`CDN Tune-in age: ${i.ageHeader}s last advanced ${R.toFixed(2)}s goal: ${k} skip sn ${b} to part ${h}`)}i.tuneInGoal=k}if(l=this.getDeliveryDirectives(i,t.deliveryDirectives,c,h),T||!S){this.loadPlaylist(l);return}}else(i.canBlockReload||i.canSkipUntil)&&(l=this.getDeliveryDirectives(i,t.deliveryDirectives,c,h));const u=this.hls.mainForwardBufferInfo,d=u?u.end-u.len:0,g=(i.edge-d)*1e3,f=ya(i,g);i.updated&&n>this.requestScheduled+f&&(this.requestScheduled=r.loading.start),c!==void 0&&i.canBlockReload?this.requestScheduled=r.loading.first+f-(i.partTarget*1e3||1e3):this.requestScheduled===-1||this.requestScheduled+fthis.loadPlaylist(l),m)}else this.clearTimer()}getDeliveryDirectives(e,t,s,i){let r=ni(e);return t!=null&&t.skip&&e.deltaUpdateFailed&&(s=t.msn,i=t.part,r=mt.No),new ai(s,i,r)}checkRetry(e){const t=e.details,s=bt(e),i=e.errorAction,{action:r,retryCount:n=0,retryConfig:o}=i||{},l=!!i&&!!o&&(r===ce.RetryRequest||!i.resolved&&r===ce.SendAlternateToPenaltyBox);if(l){var c;if(this.requestScheduled=-1,n>=o.maxNumRetry)return!1;if(s&&(c=e.context)!=null&&c.deliveryDirectives)this.warn(`Retrying playlist loading ${n+1}/${o.maxNumRetry} after "${t}" without delivery-directives`),this.loadPlaylist();else{const h=Ls(o,n);this.timer=self.setTimeout(()=>this.loadPlaylist(),h),this.warn(`Retrying playlist loading ${n+1}/${o.maxNumRetry} after "${t}" in ${h}ms`)}e.levelRetry=!0,i.resolved=!0}return l}}class Be{constructor(e,t=0,s=0){this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=e,this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=t,this.totalWeight_=s}sample(e,t){const s=Math.pow(this.alpha_,e);this.estimate_=t*(1-s)+s*this.estimate_,this.totalWeight_+=e}getTotalWeight(){return this.totalWeight_}getEstimate(){if(this.alpha_){const e=1-Math.pow(this.alpha_,this.totalWeight_);if(e)return this.estimate_/e}return this.estimate_}}class ba{constructor(e,t,s,i=100){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=s,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new Be(e),this.fast_=new Be(t),this.defaultTTFB_=i,this.ttfb_=new Be(e)}update(e,t){const{slow_:s,fast_:i,ttfb_:r}=this;s.halfLife!==e&&(this.slow_=new Be(e,s.getEstimate(),s.getTotalWeight())),i.halfLife!==t&&(this.fast_=new Be(t,i.getEstimate(),i.getTotalWeight())),r.halfLife!==e&&(this.ttfb_=new Be(e,r.getEstimate(),r.getTotalWeight()))}sample(e,t){e=Math.max(e,this.minDelayMs_);const s=8*t,i=e/1e3,r=s/i;this.fast_.sample(i,r),this.slow_.sample(i,r)}sampleTTFB(e){const t=e/1e3,s=Math.sqrt(2)*Math.exp(-Math.pow(t,2)/2);this.ttfb_.sample(s,Math.max(e,5))}canEstimate(){return this.fast_.getTotalWeight()>=this.minWeight_}getEstimate(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}getEstimateTTFB(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_}destroy(){}}const hr={supported:!0,configurations:[],decodingInfoResults:[{supported:!0,powerEfficient:!0,smooth:!0}]},ui={};function Da(a,e,t,s,i,r){const n=a.audioCodec?a.audioGroups:null,o=r==null?void 0:r.audioCodec,l=r==null?void 0:r.channels,c=l?parseInt(l):o?1/0:2;let h=null;if(n!=null&&n.length)try{n.length===1&&n[0]?h=e.groups[n[0]].channels:h=n.reduce((u,d)=>{if(d){const g=e.groups[d];if(!g)throw new Error(`Audio track group ${d} not found`);Object.keys(g.channels).forEach(f=>{u[f]=(u[f]||0)+g.channels[f]})}return u},{2:0})}catch{return!0}return a.videoCodec!==void 0&&(a.width>1920&&a.height>1088||a.height>1920&&a.width>1088||a.frameRate>Math.max(s,30)||a.videoRange!=="SDR"&&a.videoRange!==t||a.bitrate>Math.max(i,8e6))||!!h&&O(c)&&Object.keys(h).some(u=>parseInt(u)>c)}function Ca(a,e,t){const s=a.videoCodec,i=a.audioCodec;if(!s||!i||!t)return Promise.resolve(hr);const r={width:a.width,height:a.height,bitrate:Math.ceil(Math.max(a.bitrate*.9,a.averageBitrate)),framerate:a.frameRate||30},n=a.videoRange;n!=="SDR"&&(r.transferFunction=n.toLowerCase());const o=s.split(",").map(l=>({type:"media-source",video:oe(oe({},r),{},{contentType:st(l,"video")})}));return i&&a.audioGroups&&a.audioGroups.forEach(l=>{var c;l&&((c=e.groups[l])==null||c.tracks.forEach(h=>{if(h.groupId===l){const u=h.channels||"",d=parseFloat(u);O(d)&&d>2&&o.push.apply(o,i.split(",").map(g=>({type:"media-source",audio:{contentType:st(g,"audio"),channels:""+d}})))}}))}),Promise.all(o.map(l=>{const c=_a(l);return ui[c]||(ui[c]=t.decodingInfo(l))})).then(l=>({supported:!l.some(c=>!c.supported),configurations:o,decodingInfoResults:l})).catch(l=>({supported:!1,configurations:o,decodingInfoResults:[],error:l}))}function _a(a){const{audio:e,video:t}=a,s=t||e;if(s){const i=s.contentType.split('"')[1];if(t)return`r${t.height}x${t.width}f${Math.ceil(t.framerate)}${t.transferFunction||"sd"}_${i}_${Math.ceil(t.bitrate/1e5)}`;if(e)return`c${e.channels}${e.spatialRendering?"s":"n"}_${i}`}return""}function wa(){if(typeof matchMedia=="function"){const a=matchMedia("(dynamic-range: high)"),e=matchMedia("bad query");if(a.media!==e.media)return a.matches===!0}return!1}function ka(a,e){let t=!1,s=[];return a&&(t=a!=="SDR",s=[a]),e&&(s=e.allowedVideoRanges||It.slice(0),t=e.preferHDR!==void 0?e.preferHDR:wa(),t?s=s.filter(i=>i!=="SDR"):s=["SDR"]),{preferHDR:t,allowedVideoRanges:s}}function Pa(a,e,t,s,i){const r=Object.keys(a),n=s==null?void 0:s.channels,o=s==null?void 0:s.audioCodec,l=n&&parseInt(n)===2;let c=!0,h=!1,u=1/0,d=1/0,g=1/0,f=0,m=[];const{preferHDR:T,allowedVideoRanges:E}=ka(e,i);for(let S=r.length;S--;){const D=a[r[S]];c=D.channels[2]>0,u=Math.min(u,D.minHeight),d=Math.min(d,D.minFramerate),g=Math.min(g,D.minBitrate);const R=E.filter(_=>D.videoRanges[_]>0);R.length>0&&(h=!0,m=R)}u=O(u)?u:0,d=O(d)?d:0;const x=Math.max(1080,u),y=Math.max(30,d);return g=O(g)?g:t,t=Math.max(g,t),h||(e=void 0,m=[]),{codecSet:r.reduce((S,D)=>{const R=a[D];if(D===S)return S;if(R.minBitrate>t)return be(D,`min bitrate of ${R.minBitrate} > current estimate of ${t}`),S;if(!R.hasDefaultAudio)return be(D,"no renditions with default or auto-select sound found"),S;if(o&&D.indexOf(o.substring(0,4))%5!==0)return be(D,`audio codec preference "${o}" not found`),S;if(n&&!l){if(!R.channels[n])return be(D,`no renditions with ${n} channel sound found (channels options: ${Object.keys(R.channels)})`),S}else if((!o||l)&&c&&R.channels[2]===0)return be(D,"no renditions with stereo sound found"),S;return R.minHeight>x?(be(D,`min resolution of ${R.minHeight} > maximum of ${x}`),S):R.minFramerate>y?(be(D,`min framerate of ${R.minFramerate} > maximum of ${y}`),S):m.some(_=>R.videoRanges[_]>0)?R.maxScore=Lt(S)||R.fragmentError>a[S].fragmentError)?S:(f=R.maxScore,D):(be(D,`no variants with VIDEO-RANGE of ${JSON.stringify(m)} found`),S)},void 0),videoRanges:m,preferHDR:T,minFramerate:d,minBitrate:g}}function be(a,e){v.log(`[abr] start candidates with "${a}" ignored because ${e}`)}function Fa(a){return a.reduce((e,t)=>{let s=e.groups[t.groupId];s||(s=e.groups[t.groupId]={tracks:[],channels:{2:0},hasDefault:!1,hasAutoSelect:!1}),s.tracks.push(t);const i=t.channels||"2";return s.channels[i]=(s.channels[i]||0)+1,s.hasDefault=s.hasDefault||t.default,s.hasAutoSelect=s.hasAutoSelect||t.autoselect,s.hasDefault&&(e.hasDefaultAudio=!0),s.hasAutoSelect&&(e.hasAutoSelectAudio=!0),e},{hasDefaultAudio:!1,hasAutoSelectAudio:!1,groups:{}})}function Oa(a,e,t,s){return a.slice(t,s+1).reduce((i,r)=>{if(!r.codecSet)return i;const n=r.audioGroups;let o=i[r.codecSet];o||(i[r.codecSet]=o={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!n,fragmentError:0}),o.minBitrate=Math.min(o.minBitrate,r.bitrate);const l=Math.min(r.height,r.width);return o.minHeight=Math.min(o.minHeight,l),o.minFramerate=Math.min(o.minFramerate,r.frameRate),o.maxScore=Math.max(o.maxScore,r.score),o.fragmentError+=r.fragmentError,o.videoRanges[r.videoRange]=(o.videoRanges[r.videoRange]||0)+1,n&&n.forEach(c=>{if(!c)return;const h=e.groups[c];h&&(o.hasDefaultAudio=o.hasDefaultAudio||e.hasDefaultAudio?h.hasDefault:h.hasAutoSelect||!e.hasDefaultAudio&&!e.hasAutoSelectAudio,Object.keys(h.channels).forEach(u=>{o.channels[u]=(o.channels[u]||0)+h.channels[u]}))}),i},{})}function Le(a,e,t){if("attrs"in a){const s=e.indexOf(a);if(s!==-1)return s}for(let s=0;ss.indexOf(i)===-1)}function $e(a,e){const{audioCodec:t,channels:s}=a;return(t===void 0||(e.audioCodec||"").substring(0,4)===t.substring(0,4))&&(s===void 0||s===(e.channels||"2"))}function Na(a,e,t,s,i){const r=e[s],o=e.reduce((d,g,f)=>{const m=g.uri;return(d[m]||(d[m]=[])).push(f),d},{})[r.uri];o.length>1&&(s=Math.max.apply(Math,o));const l=r.videoRange,c=r.frameRate,h=r.codecSet.substring(0,4),u=di(e,s,d=>{if(d.videoRange!==l||d.frameRate!==c||d.codecSet.substring(0,4)!==h)return!1;const g=d.audioGroups,f=t.filter(m=>!g||g.indexOf(m.groupId)!==-1);return Le(a,f,i)>-1});return u>-1?u:di(e,s,d=>{const g=d.audioGroups,f=t.filter(m=>!g||g.indexOf(m.groupId)!==-1);return Le(a,f,i)>-1})}function di(a,e,t){for(let s=e;s;s--)if(t(a[s]))return s;for(let s=e+1;s{const{fragCurrent:t,partCurrent:s,hls:i}=this,{autoLevelEnabled:r,media:n}=i;if(!t||!n)return;const o=performance.now(),l=s?s.stats:t.stats,c=s?s.duration:t.duration,h=o-l.loading.start,u=i.minAutoLevel;if(l.aborted||l.loaded&&l.loaded===l.total||t.level<=u){this.clearTimer(),this._nextAutoLevel=-1;return}if(!r||n.paused||!n.playbackRate||!n.readyState)return;const d=i.mainForwardBufferInfo;if(d===null)return;const g=this.bwEstimator.getEstimateTTFB(),f=Math.abs(n.playbackRate);if(h<=Math.max(g,1e3*(c/(f*2))))return;const m=d.len/f,T=l.loading.first?l.loading.first-l.loading.start:-1,E=l.loaded&&T>-1,x=this.getBwEstimate(),y=i.levels,I=y[t.level],S=l.total||Math.max(l.loaded,Math.round(c*I.averageBitrate/8));let D=E?h-T:h;D<1&&E&&(D=Math.min(h,l.loaded*8/x));const R=E?l.loaded*1e3/D:0,_=R?(S-l.loaded)/R:S*8/x+g/1e3;if(_<=m)return;const k=R?R*8:x;let b=Number.POSITIVE_INFINITY,w;for(w=t.level-1;w>u;w--){const P=y[w].maxBitrate;if(b=this.getTimeToLoadFrag(g/1e3,k,c*P,!y[w].details),b=_||b>c*10)return;i.nextLoadLevel=i.nextAutoLevel=w,E?this.bwEstimator.sample(h-Math.min(g,T),l.loaded):this.bwEstimator.sampleTTFB(h);const V=y[w].maxBitrate;this.getBwEstimate()*this.hls.config.abrBandWidthUpFactor>V&&this.resetEstimator(V),this.clearTimer(),v.warn(`[abr] Fragment ${t.sn}${s?" part "+s.index:""} of level ${t.level} is loading too slowly; + Time to underbuffer: ${m.toFixed(3)} s + Estimated load time for current fragment: ${_.toFixed(3)} s + Estimated load time for down switch fragment: ${b.toFixed(3)} s + TTFB estimate: ${T|0} ms + Current BW estimate: ${O(x)?x|0:"Unknown"} bps + New BW estimate: ${this.getBwEstimate()|0} bps + Switching to level ${w} @ ${V|0} bps`),i.trigger(p.FRAG_LOAD_EMERGENCY_ABORTED,{frag:t,part:s,stats:l})},this.hls=e,this.bwEstimator=this.initEstimator(),this.registerListeners()}resetEstimator(e){e&&(v.log(`setting initial bwe to ${e}`),this.hls.config.abrEwmaDefaultEstimate=e),this.firstSelection=-1,this.bwEstimator=this.initEstimator()}initEstimator(){const e=this.hls.config;return new ba(e.abrEwmaSlowVoD,e.abrEwmaFastVoD,e.abrEwmaDefaultEstimate)}registerListeners(){const{hls:e}=this;e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.FRAG_LOADING,this.onFragLoading,this),e.on(p.FRAG_LOADED,this.onFragLoaded,this),e.on(p.FRAG_BUFFERED,this.onFragBuffered,this),e.on(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(p.LEVEL_LOADED,this.onLevelLoaded,this),e.on(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(p.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.on(p.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e&&(e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.FRAG_LOADING,this.onFragLoading,this),e.off(p.FRAG_LOADED,this.onFragLoaded,this),e.off(p.FRAG_BUFFERED,this.onFragBuffered,this),e.off(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(p.LEVEL_LOADED,this.onLevelLoaded,this),e.off(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(p.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.off(p.ERROR,this.onError,this))}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this._abandonRulesCheck=null,this.fragCurrent=this.partCurrent=null}onManifestLoading(e,t){this.lastLoadedFragLevel=-1,this.firstSelection=-1,this.lastLevelLoadSec=0,this.fragCurrent=this.partCurrent=null,this.onLevelsUpdated(),this.clearTimer()}onLevelsUpdated(){this.lastLoadedFragLevel>-1&&this.fragCurrent&&(this.lastLoadedFragLevel=this.fragCurrent.level),this._nextAutoLevel=-1,this.onMaxAutoLevelUpdated(),this.codecTiers=null,this.audioTracksByGroup=null}onMaxAutoLevelUpdated(){this.firstSelection=-1,this.nextAutoLevelKey=""}onFragLoading(e,t){const s=t.frag;if(!this.ignoreFragment(s)){if(!s.bitrateTest){var i;this.fragCurrent=s,this.partCurrent=(i=t.part)!=null?i:null}this.clearTimer(),this.timer=self.setInterval(this._abandonRulesCheck,100)}}onLevelSwitching(e,t){this.clearTimer()}onError(e,t){if(!t.fatal)switch(t.details){case L.BUFFER_ADD_CODEC_ERROR:case L.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1;break;case L.FRAG_LOAD_TIMEOUT:{const s=t.frag,{fragCurrent:i,partCurrent:r}=this;if(s&&i&&s.sn===i.sn&&s.level===i.level){const n=performance.now(),o=r?r.stats:s.stats,l=n-o.loading.start,c=o.loading.first?o.loading.first-o.loading.start:-1;if(o.loaded&&c>-1){const u=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(l-Math.min(u,c),o.loaded)}else this.bwEstimator.sampleTTFB(l)}break}}}getTimeToLoadFrag(e,t,s,i){const r=e+s/t,n=i?this.lastLevelLoadSec:0;return r+n}onLevelLoaded(e,t){const s=this.hls.config,{loading:i}=t.stats,r=i.end-i.start;O(r)&&(this.lastLevelLoadSec=r/1e3),t.details.live?this.bwEstimator.update(s.abrEwmaSlowLive,s.abrEwmaFastLive):this.bwEstimator.update(s.abrEwmaSlowVoD,s.abrEwmaFastVoD)}onFragLoaded(e,{frag:t,part:s}){const i=s?s.stats:t.stats;if(t.type===U.MAIN&&this.bwEstimator.sampleTTFB(i.loading.first-i.loading.start),!this.ignoreFragment(t)){if(this.clearTimer(),t.level===this._nextAutoLevel&&(this._nextAutoLevel=-1),this.firstSelection=-1,this.hls.config.abrMaxWithRealBitrate){const r=s?s.duration:t.duration,n=this.hls.levels[t.level],o=(n.loaded?n.loaded.bytes:0)+i.loaded,l=(n.loaded?n.loaded.duration:0)+r;n.loaded={bytes:o,duration:l},n.realBitrate=Math.round(8*o/l)}if(t.bitrateTest){const r={stats:i,frag:t,part:s,id:t.type};this.onFragBuffered(p.FRAG_BUFFERED,r),t.bitrateTest=!1}else this.lastLoadedFragLevel=t.level}}onFragBuffered(e,t){const{frag:s,part:i}=t,r=i!=null&&i.stats.loaded?i.stats:s.stats;if(r.aborted||this.ignoreFragment(s))return;const n=r.parsing.end-r.loading.start-Math.min(r.loading.first-r.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(n,r.loaded),r.bwEstimate=this.getBwEstimate(),s.bitrateTest?this.bitrateTestDelay=n/1e3:this.bitrateTestDelay=0}ignoreFragment(e){return e.type!==U.MAIN||e.sn==="initSegment"}clearTimer(){this.timer>-1&&(self.clearInterval(this.timer),this.timer=-1)}get firstAutoLevel(){const{maxAutoLevel:e,minAutoLevel:t}=this.hls,s=this.getBwEstimate(),i=this.hls.config.maxStarvationDelay,r=this.findBestLevel(s,t,e,0,i,1,1);if(r>-1)return r;const n=this.hls.firstLevel,o=Math.min(Math.max(n,t),e);return v.warn(`[abr] Could not find best starting auto level. Defaulting to first in playlist ${n} clamped to ${o}`),o}get forcedAutoLevel(){return this.nextAutoLevelKey?-1:this._nextAutoLevel}get nextAutoLevel(){const e=this.forcedAutoLevel,s=this.bwEstimator.canEstimate(),i=this.lastLoadedFragLevel>-1;if(e!==-1&&(!s||!i||this.nextAutoLevelKey===this.getAutoLevelKey()))return e;const r=s&&i?this.getNextABRAutoLevel():this.firstAutoLevel;if(e!==-1){const n=this.hls.levels;if(n.length>Math.max(e,r)&&n[e].loadError<=n[r].loadError)return e}return this._nextAutoLevel=r,this.nextAutoLevelKey=this.getAutoLevelKey(),r}getAutoLevelKey(){return`${this.getBwEstimate()}_${this.getStarvationDelay().toFixed(2)}`}getNextABRAutoLevel(){const{fragCurrent:e,partCurrent:t,hls:s}=this,{maxAutoLevel:i,config:r,minAutoLevel:n}=s,o=t?t.duration:e?e.duration:0,l=this.getBwEstimate(),c=this.getStarvationDelay();let h=r.abrBandWidthFactor,u=r.abrBandWidthUpFactor;if(c){const T=this.findBestLevel(l,n,i,c,0,h,u);if(T>=0)return T}let d=o?Math.min(o,r.maxStarvationDelay):r.maxStarvationDelay;if(!c){const T=this.bitrateTestDelay;T&&(d=(o?Math.min(o,r.maxLoadingDelay):r.maxLoadingDelay)-T,v.info(`[abr] bitrate test took ${Math.round(1e3*T)}ms, set first fragment max fetchDuration to ${Math.round(1e3*d)} ms`),h=u=1)}const g=this.findBestLevel(l,n,i,c,d,h,u);if(v.info(`[abr] ${c?"rebuffering expected":"buffer is empty"}, optimal quality level ${g}`),g>-1)return g;const f=s.levels[n],m=s.levels[s.loadLevel];return(f==null?void 0:f.bitrate)<(m==null?void 0:m.bitrate)?n:s.loadLevel}getStarvationDelay(){const e=this.hls,t=e.media;if(!t)return 1/0;const s=t&&t.playbackRate!==0?Math.abs(t.playbackRate):1,i=e.mainForwardBufferInfo;return(i?i.len:0)/s}getBwEstimate(){return this.bwEstimator.canEstimate()?this.bwEstimator.getEstimate():this.hls.config.abrEwmaDefaultEstimate}findBestLevel(e,t,s,i,r,n,o){var l;const c=i+r,h=this.lastLoadedFragLevel,u=h===-1?this.hls.firstLevel:h,{fragCurrent:d,partCurrent:g}=this,{levels:f,allAudioTracks:m,loadLevel:T,config:E}=this.hls;if(f.length===1)return 0;const x=f[u],y=!!(x!=null&&(l=x.details)!=null&&l.live),I=T===-1||h===-1;let S,D="SDR",R=(x==null?void 0:x.frameRate)||0;const{audioPreference:_,videoPreference:k}=E,b=this.audioTracksByGroup||(this.audioTracksByGroup=Fa(m));if(I){if(this.firstSelection!==-1)return this.firstSelection;const G=this.codecTiers||(this.codecTiers=Oa(f,b,t,s)),B=Pa(G,D,e,_,k),{codecSet:q,videoRanges:Q,minFramerate:M,minBitrate:F,preferHDR:j}=B;S=q,D=j?Q[Q.length-1]:Q[0],R=M,e=Math.max(e,F),v.log(`[abr] picked start tier ${JSON.stringify(B)}`)}else S=x==null?void 0:x.codecSet,D=x==null?void 0:x.videoRange;const w=g?g.duration:d?d.duration:0,V=this.bwEstimator.getEstimateTTFB()/1e3,P=[];for(let G=s;G>=t;G--){var K;const B=f[G],q=G>u;if(!B)continue;if(E.useMediaCapabilities&&!B.supportedResult&&!B.supportedPromise){const te=navigator.mediaCapabilities;typeof(te==null?void 0:te.decodingInfo)=="function"&&Da(B,b,D,R,e,_)?(B.supportedPromise=Ca(B,b,te),B.supportedPromise.then(re=>{if(!this.hls)return;B.supportedResult=re;const le=this.hls.levels,fe=le.indexOf(B);re.error?v.warn(`[abr] MediaCapabilities decodingInfo error: "${re.error}" for level ${fe} ${JSON.stringify(re)}`):re.supported||(v.warn(`[abr] Unsupported MediaCapabilities decodingInfo result for level ${fe} ${JSON.stringify(re)}`),fe>-1&&le.length>1&&(v.log(`[abr] Removing unsupported level ${fe}`),this.hls.removeLevel(fe)))})):B.supportedResult=hr}if(S&&B.codecSet!==S||D&&B.videoRange!==D||q&&R>B.frameRate||!q&&R>0&&R=w*2&&r===0?f[G].averageBitrate:f[G].maxBitrate,W=this.getTimeToLoadFrag(V,F,j*M,Q===void 0);if(F>=j&&(G===h||B.loadError===0&&B.fragmentError===0)&&(W<=V||!O(W)||y&&!this.bitrateTestDelay||W${G} adjustedbw(${Math.round(F)})-bitrate=${Math.round(F-j)} ttfb:${V.toFixed(1)} avgDuration:${M.toFixed(1)} maxFetchDuration:${c.toFixed(1)} fetchDuration:${W.toFixed(1)} firstSelection:${I} codecSet:${S} videoRange:${D} hls.loadLevel:${T}`)),I&&(this.firstSelection=G),G}}return-1}set nextAutoLevel(e){const{maxAutoLevel:t,minAutoLevel:s}=this.hls,i=Math.min(Math.max(e,s),t);this._nextAutoLevel!==i&&(this.nextAutoLevelKey="",this._nextAutoLevel=i)}}class Ba{constructor(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}destroy(){this.onHandlerDestroying(),this.onHandlerDestroyed()}onHandlerDestroying(){this.clearNextTick(),this.clearInterval()}onHandlerDestroyed(){}hasInterval(){return!!this._tickInterval}hasNextTick(){return!!this._tickTimer}setInterval(e){return this._tickInterval?!1:(this._tickCallCount=0,this._tickInterval=self.setInterval(this._boundTick,e),!0)}clearInterval(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1}clearNextTick(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1}tick(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)}tickImmediate(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)}doTick(){}}var ae={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};class $a{constructor(e){this.activePartLists=Object.create(null),this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hasGaps=!1,this.hls=e,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(p.BUFFER_APPENDED,this.onBufferAppended,this),e.on(p.FRAG_BUFFERED,this.onFragBuffered,this),e.on(p.FRAG_LOADED,this.onFragLoaded,this)}_unregisterListeners(){const{hls:e}=this;e.off(p.BUFFER_APPENDED,this.onBufferAppended,this),e.off(p.FRAG_BUFFERED,this.onFragBuffered,this),e.off(p.FRAG_LOADED,this.onFragLoaded,this)}destroy(){this._unregisterListeners(),this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null}getAppendedFrag(e,t){const s=this.activePartLists[t];if(s)for(let i=s.length;i--;){const r=s[i];if(!r)break;const n=r.end;if(r.start<=e&&n!==null&&e<=n)return r}return this.getBufferedFrag(e,t)}getBufferedFrag(e,t){const{fragments:s}=this,i=Object.keys(s);for(let r=i.length;r--;){const n=s[i[r]];if((n==null?void 0:n.body.type)===t&&n.buffered){const o=n.body;if(o.start<=e&&e<=o.end)return o}}return null}detectEvictedFragments(e,t,s,i){this.timeRanges&&(this.timeRanges[e]=t);const r=(i==null?void 0:i.fragment.sn)||-1;Object.keys(this.fragments).forEach(n=>{const o=this.fragments[n];if(!o||r>=o.body.sn)return;if(!o.buffered&&!o.loaded){o.body.type===s&&this.removeFragment(o.body);return}const l=o.range[e];l&&l.time.some(c=>{const h=!this.isTimeBuffered(c.startPTS,c.endPTS,t);return h&&this.removeFragment(o.body),h})})}detectPartialFragments(e){const t=this.timeRanges,{frag:s,part:i}=e;if(!t||s.sn==="initSegment")return;const r=Ge(s),n=this.fragments[r];if(!n||n.buffered&&s.gap)return;const o=!s.relurl;Object.keys(t).forEach(l=>{const c=s.elementaryStreams[l];if(!c)return;const h=t[l],u=o||c.partial===!0;n.range[l]=this.getBufferedTimes(s,i,u,h)}),n.loaded=null,Object.keys(n.range).length?(n.buffered=!0,(n.body.endList=s.endList||n.body.endList)&&(this.endListFragments[n.body.type]=n),at(n)||this.removeParts(s.sn-1,s.type)):this.removeFragment(n.body)}removeParts(e,t){const s=this.activePartLists[t];s&&(this.activePartLists[t]=s.filter(i=>i.fragment.sn>=e))}fragBuffered(e,t){const s=Ge(e);let i=this.fragments[s];!i&&t&&(i=this.fragments[s]={body:e,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},e.gap&&(this.hasGaps=!0)),i&&(i.loaded=null,i.buffered=!0)}getBufferedTimes(e,t,s,i){const r={time:[],partial:s},n=e.start,o=e.end,l=e.minEndPTS||o,c=e.maxStartPTS||n;for(let h=0;h=u&&l<=d){r.time.push({startPTS:Math.max(n,i.start(h)),endPTS:Math.min(o,i.end(h))});break}else if(nu){const g=Math.max(n,i.start(h)),f=Math.min(o,i.end(h));f>g&&(r.partial=!0,r.time.push({startPTS:g,endPTS:f}))}else if(o<=u)break}return r}getPartialFragment(e){let t=null,s,i,r,n=0;const{bufferPadding:o,fragments:l}=this;return Object.keys(l).forEach(c=>{const h=l[c];h&&at(h)&&(i=h.body.start-o,r=h.body.end+o,e>=i&&e<=r&&(s=Math.min(e-i,r-e),n<=s&&(t=h.body,n=s)))}),t}isEndListAppended(e){const t=this.endListFragments[e];return t!==void 0&&(t.buffered||at(t))}getState(e){const t=Ge(e),s=this.fragments[t];return s?s.buffered?at(s)?ae.PARTIAL:ae.OK:ae.APPENDING:ae.NOT_LOADED}isTimeBuffered(e,t,s){let i,r;for(let n=0;n=i&&t<=r)return!0;if(t<=i)return!1}return!1}onFragLoaded(e,t){const{frag:s,part:i}=t;if(s.sn==="initSegment"||s.bitrateTest)return;const r=i?null:t,n=Ge(s);this.fragments[n]={body:s,appendedPTS:null,loaded:r,buffered:!1,range:Object.create(null)}}onBufferAppended(e,t){const{frag:s,part:i,timeRanges:r}=t;if(s.sn==="initSegment")return;const n=s.type;if(i){let o=this.activePartLists[n];o||(this.activePartLists[n]=o=[]),o.push(i)}this.timeRanges=r,Object.keys(r).forEach(o=>{const l=r[o];this.detectEvictedFragments(o,l,n,i)})}onFragBuffered(e,t){this.detectPartialFragments(t)}hasFragment(e){const t=Ge(e);return!!this.fragments[t]}hasParts(e){var t;return!!((t=this.activePartLists[e])!=null&&t.length)}removeFragmentsInRange(e,t,s,i,r){i&&!this.hasGaps||Object.keys(this.fragments).forEach(n=>{const o=this.fragments[n];if(!o)return;const l=o.body;l.type!==s||i&&!l.gap||l.starte&&(o.buffered||r)&&this.removeFragment(l)})}removeFragment(e){const t=Ge(e);e.stats.loaded=0,e.clearElementaryStreamInfo();const s=this.activePartLists[e.type];if(s){const i=e.sn;this.activePartLists[e.type]=s.filter(r=>r.fragment.sn!==i)}delete this.fragments[t],e.endList&&delete this.endListFragments[e.type]}removeAllFragments(){this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1}}function at(a){var e,t,s;return a.buffered&&(a.body.gap||((e=a.range.video)==null?void 0:e.partial)||((t=a.range.audio)==null?void 0:t.partial)||((s=a.range.audiovideo)==null?void 0:s.partial))}function Ge(a){return`${a.type}_${a.level}_${a.sn}`}const Ga={length:0,start:()=>0,end:()=>0};class J{static isBuffered(e,t){try{if(e){const s=J.getBuffered(e);for(let i=0;i=s.start(i)&&t<=s.end(i))return!0}}catch{}return!1}static bufferInfo(e,t,s){try{if(e){const i=J.getBuffered(e),r=[];let n;for(n=0;nu&&(i[h-1].end=e[c].end):i.push(e[c])}else i.push(e[c])}else i=e;let r=0,n,o=t,l=t;for(let c=0;c=h&&tt.startCC||a&&a.cc{if(this.loader&&this.loader.destroy(),e.gap)if(e.tagList.some(g=>g[0]==="GAP")){l(pi(e));return}else e.gap=!1;const c=this.loader=e.loader=r?new r(i):new n(i),h=mi(e),u=hi(i.fragLoadPolicy.default),d={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:e.sn==="initSegment"?1/0:gi};e.stats=c.stats,c.load(h,d,{onSuccess:(g,f,m,T)=>{this.resetLoader(e,c);let E=g.data;m.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(E.slice(0,16)),E=E.slice(16)),o({frag:e,part:null,payload:E,networkDetails:T})},onError:(g,f,m,T)=>{this.resetLoader(e,c),l(new Ce({type:$.NETWORK_ERROR,details:L.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:oe({url:s,data:void 0},g),error:new Error(`HTTP Error ${g.code} ${g.text}`),networkDetails:m,stats:T}))},onAbort:(g,f,m)=>{this.resetLoader(e,c),l(new Ce({type:$.NETWORK_ERROR,details:L.INTERNAL_ABORTED,fatal:!1,frag:e,error:new Error("Aborted"),networkDetails:m,stats:g}))},onTimeout:(g,f,m)=>{this.resetLoader(e,c),l(new Ce({type:$.NETWORK_ERROR,details:L.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error(`Timeout after ${d.timeout}ms`),networkDetails:m,stats:g}))},onProgress:(g,f,m,T)=>{t&&t({frag:e,part:null,payload:m,networkDetails:T})}})})}loadPart(e,t,s){this.abort();const i=this.config,r=i.fLoader,n=i.loader;return new Promise((o,l)=>{if(this.loader&&this.loader.destroy(),e.gap||t.gap){l(pi(e,t));return}const c=this.loader=e.loader=r?new r(i):new n(i),h=mi(e,t),u=hi(i.fragLoadPolicy.default),d={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:gi};t.stats=c.stats,c.load(h,d,{onSuccess:(g,f,m,T)=>{this.resetLoader(e,c),this.updateStatsFromPart(e,t);const E={frag:e,part:t,payload:g.data,networkDetails:T};s(E),o(E)},onError:(g,f,m,T)=>{this.resetLoader(e,c),l(new Ce({type:$.NETWORK_ERROR,details:L.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:oe({url:h.url,data:void 0},g),error:new Error(`HTTP Error ${g.code} ${g.text}`),networkDetails:m,stats:T}))},onAbort:(g,f,m)=>{e.stats.aborted=t.stats.aborted,this.resetLoader(e,c),l(new Ce({type:$.NETWORK_ERROR,details:L.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,error:new Error("Aborted"),networkDetails:m,stats:g}))},onTimeout:(g,f,m)=>{this.resetLoader(e,c),l(new Ce({type:$.NETWORK_ERROR,details:L.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,error:new Error(`Timeout after ${d.timeout}ms`),networkDetails:m,stats:g}))}})})}updateStatsFromPart(e,t){const s=e.stats,i=t.stats,r=i.total;if(s.loaded+=i.loaded,r){const l=Math.round(e.duration/t.duration),c=Math.min(Math.round(s.loaded/r),l),u=(l-c)*Math.round(s.loaded/c);s.total=s.loaded+u}else s.total=Math.max(s.loaded,s.total);const n=s.loading,o=i.loading;n.start?n.first+=o.first-o.start:(n.start=o.start,n.first=o.first),n.end=o.end}resetLoader(e,t){e.loader=null,this.loader===t&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),t.destroy()}}function mi(a,e=null){const t=e||a,s={frag:a,part:e,responseType:"arraybuffer",url:t.url,headers:{},rangeStart:0,rangeEnd:0},i=t.byteRangeStartOffset,r=t.byteRangeEndOffset;if(O(i)&&O(r)){var n;let o=i,l=r;if(a.sn==="initSegment"&&((n=a.decryptdata)==null?void 0:n.method)==="AES-128"){const c=r-i;c%16&&(l=r+(16-c%16)),i!==0&&(s.resetIV=!0,o=i-16)}s.rangeStart=o,s.rangeEnd=l}return s}function pi(a,e){const t=new Error(`GAP ${a.gap?"tag":"attribute"} found`),s={type:$.MEDIA_ERROR,details:L.FRAG_GAP,fatal:!1,frag:a,error:t,networkDetails:null};return e&&(s.part=e),(e||a).stats.aborted=!0,new Ce(s)}class Ce extends Error{constructor(e){super(e.error.message),this.data=void 0,this.data=e}}class qa{constructor(e,t){this.subtle=void 0,this.aesIV=void 0,this.subtle=e,this.aesIV=t}decrypt(e,t){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e)}}class ja{constructor(e,t){this.subtle=void 0,this.key=void 0,this.subtle=e,this.key=t}expandKey(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])}}function za(a){const e=a.byteLength,t=e&&new DataView(a.buffer).getUint8(e-1);return t?Ne(a,0,e-t):a}class Xa{constructor(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}uint8ArrayToUint32Array_(e){const t=new DataView(e),s=new Uint32Array(4);for(let i=0;i<4;i++)s[i]=t.getUint32(i*4);return s}initTable(){const e=this.sBox,t=this.invSBox,s=this.subMix,i=s[0],r=s[1],n=s[2],o=s[3],l=this.invSubMix,c=l[0],h=l[1],u=l[2],d=l[3],g=new Uint32Array(256);let f=0,m=0,T=0;for(T=0;T<256;T++)T<128?g[T]=T<<1:g[T]=T<<1^283;for(T=0;T<256;T++){let E=m^m<<1^m<<2^m<<3^m<<4;E=E>>>8^E&255^99,e[f]=E,t[E]=f;const x=g[f],y=g[x],I=g[y];let S=g[E]*257^E*16843008;i[f]=S<<24|S>>>8,r[f]=S<<16|S>>>16,n[f]=S<<8|S>>>24,o[f]=S,S=I*16843009^y*65537^x*257^f*16843008,c[E]=S<<24|S>>>8,h[E]=S<<16|S>>>16,u[E]=S<<8|S>>>24,d[E]=S,f?(f=x^g[g[g[I^x]]],m^=g[g[m]]):f=m=1}}expandKey(e){const t=this.uint8ArrayToUint32Array_(e);let s=!0,i=0;for(;ithis.subtle?(this.logOnce("WebCrypto AES decrypt"),new qa(this.subtle,new Uint8Array(s)).decrypt(e.buffer,i)):Promise.reject(new Error("web crypto not initialized"))).catch(i=>(v.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${i.name}: ${i.message}`),this.onWebCryptoError(e,t,s)))}onWebCryptoError(e,t,s){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(e,t,s);const i=this.flush();if(i)return i.buffer;throw new Error("WebCrypto and softwareDecrypt: failed to decrypt data")}getValidChunk(e){let t=e;const s=e.length-e.length%Qa;return s!==e.length&&(t=Ne(e,0,s),this.remainderData=Ne(e,s)),t}logOnce(e){this.logEnabled&&(v.log(`[decrypter]: ${e}`),this.logEnabled=!1)}}const Ja={toString:function(a){let e="";const t=a.length;for(let s=0;so.end){const u=n>h;(n{if(this.fragContextChanged(e)){this.warn(`Fragment ${e.sn}${r.part?" p: "+r.part.index:""} of level ${e.level} was dropped during download.`),this.fragmentTracker.removeFragment(e);return}e.stats.chunkCount++,this._handleFragmentLoadProgress(r)};this._doFragLoad(e,t,s,i).then(r=>{if(!r)return;const n=this.state;if(this.fragContextChanged(e)){(n===C.FRAG_LOADING||!this.fragCurrent&&n===C.PARSING)&&(this.fragmentTracker.removeFragment(e),this.state=C.IDLE);return}"payload"in r&&(this.log(`Loaded fragment ${e.sn} of level ${e.level}`),this.hls.trigger(p.FRAG_LOADED,r)),this._handleFragmentLoadComplete(r)}).catch(r=>{this.state===C.STOPPED||this.state===C.ERROR||(this.warn(`Frag error: ${(r==null?void 0:r.message)||r}`),this.resetFragmentLoading(e))})}clearTrackerIfNeeded(e){var t;const{fragmentTracker:s}=this;if(s.getState(e)===ae.APPENDING){const r=e.type,n=this.getFwdBufferInfo(this.mediaBuffer,r),o=Math.max(e.duration,n?n.len:this.config.maxBufferLength),l=this.backtrackFragment;((l?e.sn-l.sn:0)===1||this.reduceMaxBufferLength(o,e.duration))&&s.removeFragment(e)}else((t=this.mediaBuffer)==null?void 0:t.buffered.length)===0?s.removeAllFragments():s.hasParts(e.type)&&(s.detectPartialFragments({frag:e,part:null,stats:e.stats,id:e.type}),s.getState(e)===ae.PARTIAL&&s.removeFragment(e))}checkLiveUpdate(e){if(e.updated&&!e.live){const t=e.fragments[e.fragments.length-1];this.fragmentTracker.detectPartialFragments({frag:t,part:null,stats:t.stats,id:t.type})}e.fragments[0]||(e.deltaUpdateFailed=!0)}flushMainBuffer(e,t,s=null){if(!(e-t))return;const i={startOffset:e,endOffset:t,type:s};this.hls.trigger(p.BUFFER_FLUSHING,i)}_loadInitSegment(e,t){this._doFragLoad(e,t).then(s=>{if(!s||this.fragContextChanged(e)||!this.levels)throw new Error("init load aborted");return s}).then(s=>{const{hls:i}=this,{payload:r}=s,n=e.decryptdata;if(r&&r.byteLength>0&&n!=null&&n.key&&n.iv&&n.method==="AES-128"){const o=self.performance.now();return this.decrypter.decrypt(new Uint8Array(r),n.key.buffer,n.iv.buffer).catch(l=>{throw i.trigger(p.ERROR,{type:$.MEDIA_ERROR,details:L.FRAG_DECRYPT_ERROR,fatal:!1,error:l,reason:l.message,frag:e}),l}).then(l=>{const c=self.performance.now();return i.trigger(p.FRAG_DECRYPTED,{frag:e,payload:l,stats:{tstart:o,tdecrypt:c}}),s.payload=l,this.completeInitSegmentLoad(s)})}return this.completeInitSegmentLoad(s)}).catch(s=>{this.state===C.STOPPED||this.state===C.ERROR||(this.warn(s),this.resetFragmentLoading(e))})}completeInitSegmentLoad(e){const{levels:t}=this;if(!t)throw new Error("init load aborted, missing levels");const s=e.frag.stats;this.state=C.IDLE,e.frag.data=new Uint8Array(e.payload),s.parsing.start=s.buffering.start=self.performance.now(),s.parsing.end=s.buffering.end=self.performance.now(),this.tick()}fragContextChanged(e){const{fragCurrent:t}=this;return!e||!t||e.sn!==t.sn||e.level!==t.level}fragBufferedComplete(e,t){var s,i,r,n;const o=this.mediaBuffer?this.mediaBuffer:this.media;if(this.log(`Buffered ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.playlistType===U.MAIN?"level":"track"} ${e.level} (frag:[${((s=e.startPTS)!=null?s:NaN).toFixed(3)}-${((i=e.endPTS)!=null?i:NaN).toFixed(3)}] > buffer:${o?Ja.toString(J.getBuffered(o)):"(detached)"})`),e.sn!=="initSegment"){var l;if(e.type!==U.SUBTITLE){const h=e.elementaryStreams;if(!Object.keys(h).some(u=>!!h[u])){this.state=C.IDLE;return}}const c=(l=this.levels)==null?void 0:l[e.level];c!=null&&c.fragmentError&&(this.log(`Resetting level fragment error count of ${c.fragmentError} on frag buffered`),c.fragmentError=0)}this.state=C.IDLE,o&&(!this.loadedmetadata&&e.type==U.MAIN&&o.buffered.length&&((r=this.fragCurrent)==null?void 0:r.sn)===((n=this.fragPrevious)==null?void 0:n.sn)&&(this.loadedmetadata=!0,this.seekToStartPos()),this.tick())}seekToStartPos(){}_handleFragmentLoadComplete(e){const{transmuxer:t}=this;if(!t)return;const{frag:s,part:i,partsLoaded:r}=e,n=!r||r.length===0||r.some(l=>!l),o=new Is(s.level,s.sn,s.stats.chunkCount+1,0,i?i.index:-1,!n);t.flush(o)}_handleFragmentLoadProgress(e){}_doFragLoad(e,t,s=null,i){var r;const n=t==null?void 0:t.details;if(!this.levels||!n)throw new Error(`frag load aborted, missing level${n?"":" detail"}s`);let o=null;if(e.encrypted&&!((r=e.decryptdata)!=null&&r.key)?(this.log(`Loading key for ${e.sn} of [${n.startSN}-${n.endSN}], ${this.logPrefix==="[stream-controller]"?"level":"track"} ${e.level}`),this.state=C.KEY_LOADING,this.fragCurrent=e,o=this.keyLoader.load(e).then(h=>{if(!this.fragContextChanged(h.frag))return this.hls.trigger(p.KEY_LOADED,h),this.state===C.KEY_LOADING&&(this.state=C.IDLE),h}),this.hls.trigger(p.KEY_LOADING,{frag:e}),this.fragCurrent===null&&(o=Promise.reject(new Error("frag load aborted, context changed in KEY_LOADING")))):!e.encrypted&&n.encryptedFragments.length&&this.keyLoader.loadClear(e,n.encryptedFragments),s=Math.max(e.start,s||0),this.config.lowLatencyMode&&e.sn!=="initSegment"){const h=n.partList;if(h&&i){s>e.end&&n.fragmentHint&&(e=n.fragmentHint);const u=this.getNextPart(h,e,s);if(u>-1){const d=h[u];this.log(`Loading part sn: ${e.sn} p: ${d.index} cc: ${e.cc} of playlist [${n.startSN}-${n.endSN}] parts [0-${u}-${h.length-1}] ${this.logPrefix==="[stream-controller]"?"level":"track"}: ${e.level}, target: ${parseFloat(s.toFixed(3))}`),this.nextLoadPosition=d.start+d.duration,this.state=C.FRAG_LOADING;let g;return o?g=o.then(f=>!f||this.fragContextChanged(f.frag)?null:this.doFragPartsLoad(e,d,t,i)).catch(f=>this.handleFragLoadError(f)):g=this.doFragPartsLoad(e,d,t,i).catch(f=>this.handleFragLoadError(f)),this.hls.trigger(p.FRAG_LOADING,{frag:e,part:d,targetBufferTime:s}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):g}else if(!e.url||this.loadedEndOfParts(h,s))return Promise.resolve(null)}}this.log(`Loading fragment ${e.sn} cc: ${e.cc} ${n?"of ["+n.startSN+"-"+n.endSN+"] ":""}${this.logPrefix==="[stream-controller]"?"level":"track"}: ${e.level}, target: ${parseFloat(s.toFixed(3))}`),O(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=C.FRAG_LOADING;const l=this.config.progressive;let c;return l&&o?c=o.then(h=>!h||this.fragContextChanged(h==null?void 0:h.frag)?null:this.fragmentLoader.load(e,i)).catch(h=>this.handleFragLoadError(h)):c=Promise.all([this.fragmentLoader.load(e,l?i:void 0),o]).then(([h])=>(!l&&h&&i&&i(h),h)).catch(h=>this.handleFragLoadError(h)),this.hls.trigger(p.FRAG_LOADING,{frag:e,targetBufferTime:s}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):c}doFragPartsLoad(e,t,s,i){return new Promise((r,n)=>{var o;const l=[],c=(o=s.details)==null?void 0:o.partList,h=u=>{this.fragmentLoader.loadPart(e,u,i).then(d=>{l[u.index]=d;const g=d.part;this.hls.trigger(p.FRAG_LOADED,d);const f=li(s,e.sn,u.index+1)||or(c,e.sn,u.index+1);if(f)h(f);else return r({frag:e,part:g,partsLoaded:l})}).catch(n)};h(t)})}handleFragLoadError(e){if("data"in e){const t=e.data;e.data&&t.details===L.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):this.hls.trigger(p.ERROR,t)}else this.hls.trigger(p.ERROR,{type:$.OTHER_ERROR,details:L.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0});return null}_handleTransmuxerFlush(e){const t=this.getCurrentContext(e);if(!t||this.state!==C.PARSING){!this.fragCurrent&&this.state!==C.STOPPED&&this.state!==C.ERROR&&(this.state=C.IDLE);return}const{frag:s,part:i,level:r}=t,n=self.performance.now();s.stats.parsing.end=n,i&&(i.stats.parsing.end=n),this.updateLevelTiming(s,i,r,e.partial)}getCurrentContext(e){const{levels:t,fragCurrent:s}=this,{level:i,sn:r,part:n}=e;if(!(t!=null&&t[i]))return this.warn(`Levels object was unset while buffering fragment ${r} of level ${i}. The current chunk will not be buffered.`),null;const o=t[i],l=n>-1?li(o,r,n):null,c=l?l.fragment:xa(o,r,s);return c?(s&&s!==c&&(c.stats=s.stats),{frag:c,part:l,level:o}):null}bufferFragmentData(e,t,s,i,r){var n;if(!e||this.state!==C.PARSING)return;const{data1:o,data2:l}=e;let c=o;if(o&&l&&(c=pe(o,l)),!((n=c)!=null&&n.length))return;const h={type:e.type,frag:t,part:s,chunkMeta:i,parent:t.type,data:c};if(this.hls.trigger(p.BUFFER_APPENDING,h),e.dropped&&e.independent&&!s){if(r)return;this.flushBufferGap(t)}}flushBufferGap(e){const t=this.media;if(!t)return;if(!J.isBuffered(t,t.currentTime)){this.flushMainBuffer(0,e.start);return}const s=t.currentTime,i=J.bufferInfo(t,s,0),r=e.duration,n=Math.min(this.config.maxFragLookUpTolerance*2,r*.25),o=Math.max(Math.min(e.start-n,i.end-n),s+n);e.start-o>n&&this.flushMainBuffer(o,e.start)}getFwdBufferInfo(e,t){const s=this.getLoadPosition();return O(s)?this.getFwdBufferInfoAtPos(e,s,t):null}getFwdBufferInfoAtPos(e,t,s){const{config:{maxBufferHole:i}}=this,r=J.bufferInfo(e,t,i);if(r.len===0&&r.nextStart!==void 0){const n=this.fragmentTracker.getBufferedFrag(t,s);if(n&&r.nextStart=i?(s.maxMaxBufferLength=r,this.warn(`Reduce max buffer length to ${r}s`),!0):!1}getAppendedFrag(e,t=U.MAIN){const s=this.fragmentTracker.getAppendedFrag(e,U.MAIN);return s&&"fragment"in s?s.fragment:s}getNextFragment(e,t){const s=t.fragments,i=s.length;if(!i)return null;const{config:r}=this,n=s[0].start;let o;if(t.live){const l=r.initialLiveManifestSize;if(it}getNextFragmentLoopLoading(e,t,s,i,r){const n=e.gap,o=this.getNextFragment(this.nextLoadPosition,t);if(o===null)return o;if(e=o,n&&e&&!e.gap&&s.nextStart){const l=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,s.nextStart,i);if(l!==null&&s.len+l.len>=r)return this.log(`buffer full after gaps in "${i}" playlist starting at sn: ${e.sn}`),null}return e}mapToInitFragWhenRequired(e){return e!=null&&e.initSegment&&!(e!=null&&e.initSegment.data)&&!this.bitrateTest?e.initSegment:e}getNextPart(e,t,s){let i=-1,r=!1,n=!0;for(let o=0,l=e.length;o-1&&ss.start&&s.loaded}getInitialLiveFragment(e,t){const s=this.fragPrevious;let i=null;if(s){if(e.hasProgramDateTime&&(this.log(`Live playlist, switching playlist, load frag with same PDT: ${s.programDateTime}`),i=va(t,s.endProgramDateTime,this.config.maxFragLookUpTolerance)),!i){const r=s.sn+1;if(r>=e.startSN&&r<=e.endSN){const n=t[r-e.startSN];s.cc===n.cc&&(i=n,this.log(`Live playlist, switching playlist, load frag with next SN: ${i.sn}`))}i||(i=Ra(t,s.cc),i&&this.log(`Live playlist, switching playlist, load frag with same CC: ${i.sn}`))}}else{const r=this.hls.liveSyncPosition;r!==null&&(i=this.getFragmentAtPosition(r,this.bitrateTest?e.fragmentEnd:e.edge,e))}return i}getFragmentAtPosition(e,t,s){const{config:i}=this;let{fragPrevious:r}=this,{fragments:n,endSN:o}=s;const{fragmentHint:l}=s,{maxFragLookUpTolerance:c}=i,h=s.partList,u=!!(i.lowLatencyMode&&h!=null&&h.length&&l);u&&l&&!this.bitrateTest&&(n=n.concat(l),o=l.sn);let d;if(et-c?0:c;d=Ct(r,n,e,g)}else d=n[n.length-1];if(d){const g=d.sn-s.startSN,f=this.fragmentTracker.getState(d);if((f===ae.OK||f===ae.PARTIAL&&d.gap)&&(r=d),r&&d.sn===r.sn&&(!u||h[0].fragment.sn>d.sn)&&r&&d.level===r.level){const T=n[g+1];d.sn=n-t.maxFragLookUpTolerance&&r<=o;if(i!==null&&s.duration>i&&(r${e.startSN} prev-sn: ${l?l.sn:"na"} fragments: ${i}`),c}return r}waitForCdnTuneIn(e){return e.live&&e.canBlockReload&&e.partTarget&&e.tuneInGoal>Math.max(e.partHoldBack,e.partTarget*3)}setStartPosition(e,t){let s=this.startPosition;if(s ${(i=this.fragCurrent)==null?void 0:i.url}`);return}const r=t.details===L.FRAG_GAP;r&&this.fragmentTracker.fragBuffered(s,!0);const n=t.errorAction,{action:o,retryCount:l=0,retryConfig:c}=n||{};if(n&&o===ce.RetryRequest&&c){this.resetStartWhenNotLoaded(this.levelLastLoaded);const h=Ls(c,l);this.warn(`Fragment ${s.sn} of ${e} ${s.level} errored with ${t.details}, retrying loading ${l+1}/${c.maxNumRetry} in ${h}ms`),n.resolved=!0,this.retryDate=self.performance.now()+h,this.state=C.FRAG_LOADING_WAITING_RETRY}else if(c&&n)if(this.resetFragmentErrors(e),l.5;r&&this.reduceMaxBufferLength(i.len,(t==null?void 0:t.duration)||10);const n=!r;return n&&this.warn(`Buffer full error while media.currentTime is not buffered, flush ${s} buffer`),t&&(this.fragmentTracker.removeFragment(t),this.nextLoadPosition=t.start),this.resetLoadingState(),n}return!1}resetFragmentErrors(e){e===U.AUDIO&&(this.fragCurrent=null),this.loadedmetadata||(this.startFragRequested=!1),this.state!==C.STOPPED&&(this.state=C.IDLE)}afterBufferFlushed(e,t,s){if(!e)return;const i=J.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,i,s),this.state===C.ENDED&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state=C.IDLE}resetStartWhenNotLoaded(e){if(!this.loadedmetadata){this.startFragRequested=!1;const t=e?e.details:null;t!=null&&t.live?(this.startPosition=-1,this.setStartPosition(t,0),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}}resetWhenMissingContext(e){this.warn(`The loading context changed while buffering fragment ${e.sn} of level ${e.level}. This chunk will not be buffered.`),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded(this.levelLastLoaded),this.resetLoadingState()}removeUnbufferedFrags(e=0){this.fragmentTracker.removeFragmentsInRange(e,1/0,this.playlistType,!1,!0)}updateLevelTiming(e,t,s,i){var r;const n=s.details;if(!n){this.warn("level.details undefined");return}if(!Object.keys(e.elementaryStreams).reduce((l,c)=>{const h=e.elementaryStreams[c];if(h){const u=h.endPTS-h.startPTS;if(u<=0)return this.warn(`Could not parse fragment ${e.sn} ${c} duration reliably (${u})`),l||!1;const d=i?0:nr(n,e,h.startPTS,h.endPTS,h.startDTS,h.endDTS);return this.hls.trigger(p.LEVEL_PTS_UPDATED,{details:n,level:s,drift:d,type:c,frag:e,start:h.startPTS,end:h.endPTS}),!0}return l},!1)&&((r=this.transmuxer)==null?void 0:r.error)===null){const l=new Error(`Found no media in fragment ${e.sn} of level ${e.level} resetting transmuxer to fallback to playlist timing`);if(s.fragmentError===0&&(s.fragmentError++,e.gap=!0,this.fragmentTracker.removeFragment(e),this.fragmentTracker.fragBuffered(e,!0)),this.warn(l.message),this.hls.trigger(p.ERROR,{type:$.MEDIA_ERROR,details:L.FRAG_PARSING_ERROR,fatal:!1,error:l,frag:e,reason:`Found no media in msn ${e.sn} of level "${s.url}"`}),!this.hls)return;this.resetTransmuxer()}this.state=C.PARSED,this.hls.trigger(p.FRAG_PARSED,{frag:e,part:t})}resetTransmuxer(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)}recoverWorkerError(e){e.event==="demuxerWorker"&&(this.fragmentTracker.removeAllFragments(),this.resetTransmuxer(),this.resetStartWhenNotLoaded(this.levelLastLoaded),this.resetLoadingState())}set state(e){const t=this._state;t!==e&&(this._state=e,this.log(`${t}->${e}`))}get state(){return this._state}}class dr{constructor(){this.chunks=[],this.dataLength=0}push(e){this.chunks.push(e),this.dataLength+=e.length}flush(){const{chunks:e,dataLength:t}=this;let s;if(e.length)e.length===1?s=e[0]:s=Za(e,t);else return new Uint8Array(0);return this.reset(),s}reset(){this.chunks.length=0,this.dataLength=0}}function Za(a,e){const t=new Uint8Array(e);let s=0;for(let i=0;i0&&o.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:s,type:ye.audioId3,duration:Number.POSITIVE_INFINITY});i{if(O(a))return a*90;const s=t?t.baseTime*9e4/t.timescale:0;return e*9e4+s};function ro(a,e,t,s){let i,r,n,o;const l=navigator.userAgent.toLowerCase(),c=s,h=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];i=((e[t+2]&192)>>>6)+1;const u=(e[t+2]&60)>>>2;if(u>h.length-1){const d=new Error(`invalid ADTS sampling index:${u}`);a.emit(p.ERROR,p.ERROR,{type:$.MEDIA_ERROR,details:L.FRAG_PARSING_ERROR,fatal:!0,error:d,reason:d.message});return}return n=(e[t+2]&1)<<2,n|=(e[t+3]&192)>>>6,v.log(`manifest codec:${s}, ADTS type:${i}, samplingIndex:${u}`),/firefox/i.test(l)?u>=6?(i=5,o=new Array(4),r=u-3):(i=2,o=new Array(2),r=u):l.indexOf("android")!==-1?(i=2,o=new Array(2),r=u):(i=5,o=new Array(4),s&&(s.indexOf("mp4a.40.29")!==-1||s.indexOf("mp4a.40.5")!==-1)||!s&&u>=6?r=u-3:((s&&s.indexOf("mp4a.40.2")!==-1&&(u>=6&&n===1||/vivaldi/i.test(l))||!s&&n===1)&&(i=2,o=new Array(2)),r=u)),o[0]=i<<3,o[0]|=(u&14)>>1,o[1]|=(u&1)<<7,o[1]|=n<<3,i===5&&(o[1]|=(r&14)>>1,o[2]=(r&1)<<7,o[2]|=8,o[3]=0),{config:o,samplerate:h[u],channelCount:n,codec:"mp4a.40."+i,manifestCodec:c}}function fr(a,e){return a[e]===255&&(a[e+1]&246)===240}function gr(a,e){return a[e+1]&1?7:9}function _s(a,e){return(a[e+3]&3)<<11|a[e+4]<<3|(a[e+5]&224)>>>5}function no(a,e){return e+5=a.length)return!1;const s=_s(a,e);if(s<=t)return!1;const i=e+s;return i===a.length||wt(a,i)}return!1}function mr(a,e,t,s,i){if(!a.samplerate){const r=ro(e,t,s,i);if(!r)return;a.config=r.config,a.samplerate=r.samplerate,a.channelCount=r.channelCount,a.codec=r.codec,a.manifestCodec=r.manifestCodec,v.log(`parsed codec:${a.codec}, rate:${r.samplerate}, channels:${r.channelCount}`)}}function pr(a){return 1024*9e4/a}function lo(a,e){const t=gr(a,e);if(e+t<=a.length){const s=_s(a,e)-t;if(s>0)return{headerLength:t,frameLength:s}}}function Tr(a,e,t,s,i){const r=pr(a.samplerate),n=s+i*r,o=lo(e,t);let l;if(o){const{frameLength:u,headerLength:d}=o,g=d+u,f=Math.max(0,t+g-e.length);f?(l=new Uint8Array(g-d),l.set(e.subarray(t+d,e.length),0)):l=e.subarray(t+d,t+g);const m={unit:l,pts:n};return f||a.samples.push(m),{sample:m,length:g,missing:f}}const c=e.length-t;return l=new Uint8Array(c),l.set(e.subarray(t,e.length),0),{sample:{unit:l,pts:n},length:c,missing:-1}}let lt=null;const co=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],ho=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],uo=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],fo=[0,1,1,4];function Er(a,e,t,s,i){if(t+24>e.length)return;const r=yr(e,t);if(r&&t+r.frameLength<=e.length){const n=r.samplesPerFrame*9e4/r.sampleRate,o=s+i*n,l={unit:e.subarray(t,t+r.frameLength),pts:o,dts:o};return a.config=[],a.channelCount=r.channelCount,a.samplerate=r.sampleRate,a.samples.push(l),{sample:l,length:r.frameLength,missing:0}}}function yr(a,e){const t=a[e+1]>>3&3,s=a[e+1]>>1&3,i=a[e+2]>>4&15,r=a[e+2]>>2&3;if(t!==1&&i!==0&&i!==15&&r!==3){const n=a[e+2]>>1&1,o=a[e+3]>>6,l=t===3?3-s:s===3?3:4,c=co[l*14+i-1]*1e3,u=ho[(t===3?0:t===2?1:2)*3+r],d=o===3?1:2,g=uo[t][s],f=fo[s],m=g*8*f,T=Math.floor(g*c/u+n)*f;if(lt===null){const y=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);lt=y?parseInt(y[1]):0}return!!lt&<<=87&&s===2&&c>=224e3&&o===0&&(a[e+3]=a[e+3]|128),{sampleRate:u,channelCount:d,frameLength:T,samplesPerFrame:m}}}function ws(a,e){return a[e]===255&&(a[e+1]&224)===224&&(a[e+1]&6)!==0}function xr(a,e){return e+1{const n=Wn(r);if(po.test(n.schemeIdUri)){const o=O(n.presentationTime)?n.presentationTime/n.timeScale:t+n.presentationTimeDelta/n.timeScale;let l=n.eventDuration===4294967295?Number.POSITIVE_INFINITY:n.eventDuration/n.timeScale;l<=.001&&(l=Number.POSITIVE_INFINITY);const c=n.payload;s.samples.push({data:c,len:c.byteLength,dts:o,pts:o,type:ye.emsg,duration:l})}})}return s}demuxSampleAes(e,t,s){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))}destroy(){}}const vr=(a,e)=>{let t=0,s=5;e+=s;const i=new Uint32Array(1),r=new Uint32Array(1),n=new Uint8Array(1);for(;s>0;){n[0]=a[e];const o=Math.min(s,8),l=8-o;r[0]=4278190080>>>24+l<>l,t=t?t<e.length||e[t]!==11||e[t+1]!==119)return-1;const r=e[t+4]>>6;if(r>=3)return-1;const o=[48e3,44100,32e3][r],l=e[t+4]&63,h=[64,69,96,64,70,96,80,87,120,80,88,120,96,104,144,96,105,144,112,121,168,112,122,168,128,139,192,128,140,192,160,174,240,160,175,240,192,208,288,192,209,288,224,243,336,224,244,336,256,278,384,256,279,384,320,348,480,320,349,480,384,417,576,384,418,576,448,487,672,448,488,672,512,557,768,512,558,768,640,696,960,640,697,960,768,835,1152,768,836,1152,896,975,1344,896,976,1344,1024,1114,1536,1024,1115,1536,1152,1253,1728,1152,1254,1728,1280,1393,1920,1280,1394,1920][l*3+r]*2;if(t+h>e.length)return-1;const u=e[t+6]>>5;let d=0;u===2?d+=2:(u&1&&u!==1&&(d+=2),u&4&&(d+=2));const g=(e[t+6]<<8|e[t+7])>>12-d&1,m=[2,1,2,3,3,4,4,5][u]+g,T=e[t+5]>>3,E=e[t+5]&7,x=new Uint8Array([r<<6|T<<1|E>>2,(E&3)<<6|u<<3|g<<2|l>>4,l<<4&224]),y=1536/o*9e4,I=s+i*y,S=e.subarray(t,t+h);return a.config=x,a.channelCount=m,a.samplerate=o,a.samples.push({unit:S,pts:I}),h}class yo{constructor(){this.VideoSample=null}createVideoSample(e,t,s,i){return{key:e,frame:!1,pts:t,dts:s,units:[],debug:i,length:0}}getLastNalUnit(e){var t;let s=this.VideoSample,i;if((!s||s.units.length===0)&&(s=e[e.length-1]),(t=s)!=null&&t.units){const r=s.units;i=r[r.length-1]}return i}pushAccessUnit(e,t){if(e.units.length&&e.frame){if(e.pts===void 0){const s=t.samples,i=s.length;if(i){const r=s[i-1];e.pts=r.pts,e.dts=r.dts}else{t.dropped++;return}}t.samples.push(e)}e.debug.length&&v.log(e.pts+"/"+e.dts+":"+e.debug)}}class Ti{constructor(e){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=e,this.bytesAvailable=e.byteLength,this.word=0,this.bitsAvailable=0}loadWord(){const e=this.data,t=this.bytesAvailable,s=e.byteLength-t,i=new Uint8Array(4),r=Math.min(4,t);if(r===0)throw new Error("no bytes available");i.set(e.subarray(s,s+r)),this.word=new DataView(i.buffer).getUint32(0),this.bitsAvailable=r*8,this.bytesAvailable-=r}skipBits(e){let t;e=Math.min(e,this.bytesAvailable*8+this.bitsAvailable),this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,t=e>>3,e-=t<<3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)}readBits(e){let t=Math.min(this.bitsAvailable,e);const s=this.word>>>32-t;if(e>32&&v.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0)this.word<<=t;else if(this.bytesAvailable>0)this.loadWord();else throw new Error("no bits available");return t=e-t,t>0&&this.bitsAvailable?s<>>e)return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()}skipUEG(){this.skipBits(1+this.skipLZ())}skipEG(){this.skipBits(1+this.skipLZ())}readUEG(){const e=this.skipLZ();return this.readBits(e+1)-1}readEG(){const e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)}readBoolean(){return this.readBits(1)===1}readUByte(){return this.readBits(8)}readUShort(){return this.readBits(16)}readUInt(){return this.readBits(32)}skipScalingList(e){let t=8,s=8,i;for(let r=0;r{var u;switch(h.type){case 1:{let m=!1;l=!0;const T=h.data;if(c&&T.length>4){const E=new Ti(T).readSliceType();(E===2||E===4||E===7||E===9)&&(m=!0)}if(m){var d;(d=o)!=null&&d.frame&&!o.key&&(this.pushAccessUnit(o,e),o=this.VideoSample=null)}o||(o=this.VideoSample=this.createVideoSample(!0,s.pts,s.dts,"")),o.frame=!0,o.key=m;break}case 5:l=!0,(u=o)!=null&&u.frame&&!o.key&&(this.pushAccessUnit(o,e),o=this.VideoSample=null),o||(o=this.VideoSample=this.createVideoSample(!0,s.pts,s.dts,"")),o.key=!0,o.frame=!0;break;case 6:{l=!0,Zi(h.data,1,s.pts,t.samples);break}case 7:{var g,f;l=!0,c=!0;const m=h.data,E=new Ti(m).readSPS();if(!e.sps||e.width!==E.width||e.height!==E.height||((g=e.pixelRatio)==null?void 0:g[0])!==E.pixelRatio[0]||((f=e.pixelRatio)==null?void 0:f[1])!==E.pixelRatio[1]){e.width=E.width,e.height=E.height,e.pixelRatio=E.pixelRatio,e.sps=[m],e.duration=r;const x=m.subarray(1,4);let y="avc1.";for(let I=0;I<3;I++){let S=x[I].toString(16);S.length<2&&(S="0"+S),y+=S}e.codec=y}break}case 8:l=!0,e.pps=[h.data];break;case 9:l=!0,e.audFound=!0,o&&this.pushAccessUnit(o,e),o=this.VideoSample=this.createVideoSample(!1,s.pts,s.dts,"");break;case 12:l=!0;break;default:l=!1,o&&(o.debug+="unknown NAL "+h.type+" ");break}o&&l&&o.units.push(h)}),i&&o&&(this.pushAccessUnit(o,e),this.VideoSample=null)}parseAVCNALu(e,t){const s=t.byteLength;let i=e.naluState||0;const r=i,n=[];let o=0,l,c,h,u=-1,d=0;for(i===-1&&(u=0,d=t[0]&31,i=0,o=1);o=0){const g={data:t.subarray(u,c),type:d};n.push(g)}else{const g=this.getLastNalUnit(e.samples);g&&(r&&o<=4-r&&g.state&&(g.data=g.data.subarray(0,g.data.byteLength-r)),c>0&&(g.data=pe(g.data,t.subarray(0,c)),g.state=0))}o=0&&i>=0){const g={data:t.subarray(u,s),type:d,state:i};n.push(g)}if(n.length===0){const g=this.getLastNalUnit(e.samples);g&&(g.data=pe(g.data,t))}return e.naluState=i,n}}class So{constructor(e,t,s){this.keyData=void 0,this.decrypter=void 0,this.keyData=s,this.decrypter=new bs(t,{removePKCS7Padding:!1})}decryptBuffer(e){return this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer)}decryptAacSample(e,t,s){const i=e[t].unit;if(i.length<=16)return;const r=i.subarray(16,i.length-i.length%16),n=r.buffer.slice(r.byteOffset,r.byteOffset+r.length);this.decryptBuffer(n).then(o=>{const l=new Uint8Array(o);i.set(l,16),this.decrypter.isSync()||this.decryptAacSamples(e,t+1,s)})}decryptAacSamples(e,t,s){for(;;t++){if(t>=e.length){s();return}if(!(e[t].unit.length<32)&&(this.decryptAacSample(e,t,s),!this.decrypter.isSync()))return}}getAvcEncryptedData(e){const t=Math.floor((e.length-48)/160)*16+16,s=new Int8Array(t);let i=0;for(let r=32;r{r.data=this.getAvcDecryptedUnit(n,l),this.decrypter.isSync()||this.decryptAvcSamples(e,t,s+1,i)})}decryptAvcSamples(e,t,s,i){if(e instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;t++,s=0){if(t>=e.length){i();return}const r=e[t].units;for(;!(s>=r.length);s++){const n=r[s];if(!(n.data.length<=48||n.type!==1&&n.type!==5)&&(this.decryptAvcSample(e,t,s,i,n),!this.decrypter.isSync()))return}}}}const ne=188;class Pe{constructor(e,t,s){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this._pmtId=-1,this._videoTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.remainderData=null,this.videoParser=void 0,this.observer=e,this.config=t,this.typeSupported=s,this.videoParser=new xo}static probe(e){const t=Pe.syncOffset(e);return t>0&&v.warn(`MPEG2-TS detected but first sync word found @ offset ${t}`),t!==-1}static syncOffset(e){const t=e.length;let s=Math.min(ne*5,t-ne)+1,i=0;for(;i1&&(n===0&&o>2||l+ne>s))return n}else{if(o)return-1;break}i++}return-1}static createTrack(e,t){return{container:e==="video"||e==="audio"?"video/mp2t":void 0,type:e,id:ji[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:e==="audio"?t:void 0}}resetInitSegment(e,t,s,i){this.pmtParsed=!1,this._pmtId=-1,this._videoTrack=Pe.createTrack("video"),this._audioTrack=Pe.createTrack("audio",i),this._id3Track=Pe.createTrack("id3"),this._txtTrack=Pe.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.remainderData=null,this.audioCodec=t,this.videoCodec=s,this._duration=i}resetTimeStamp(){}resetContiguity(){const{_audioTrack:e,_videoTrack:t,_id3Track:s}=this;e&&(e.pesData=null),t&&(t.pesData=null),s&&(s.pesData=null),this.aacOverFlow=null,this.remainderData=null}demux(e,t,s=!1,i=!1){s||(this.sampleAes=null);let r;const n=this._videoTrack,o=this._audioTrack,l=this._id3Track,c=this._txtTrack;let h=n.pid,u=n.pesData,d=o.pid,g=l.pid,f=o.pesData,m=l.pesData,T=null,E=this.pmtParsed,x=this._pmtId,y=e.length;if(this.remainderData&&(e=pe(this.remainderData,e),y=e.length,this.remainderData=null),y>4;let w;if(b>1){if(w=R+5+e[R+4],w===R+ne)continue}else w=R+4;switch(k){case h:_&&(u&&(r=Ke(u))&&this.videoParser.parseAVCPES(n,c,r,!1,this._duration),u={data:[],size:0}),u&&(u.data.push(e.subarray(w,R+ne)),u.size+=R+ne-w);break;case d:if(_){if(f&&(r=Ke(f)))switch(o.segmentCodec){case"aac":this.parseAACPES(o,r);break;case"mp3":this.parseMPEGPES(o,r);break;case"ac3":this.parseAC3PES(o,r);break}f={data:[],size:0}}f&&(f.data.push(e.subarray(w,R+ne)),f.size+=R+ne-w);break;case g:_&&(m&&(r=Ke(m))&&this.parseID3PES(l,r),m={data:[],size:0}),m&&(m.data.push(e.subarray(w,R+ne)),m.size+=R+ne-w);break;case 0:_&&(w+=e[w]+1),x=this._pmtId=vo(e,w);break;case x:{_&&(w+=e[w]+1);const V=Ao(e,w,this.typeSupported,s,this.observer);h=V.videoPid,h>0&&(n.pid=h,n.segmentCodec=V.segmentVideoCodec),d=V.audioPid,d>0&&(o.pid=d,o.segmentCodec=V.segmentAudioCodec),g=V.id3Pid,g>0&&(l.pid=g),T!==null&&!E&&(v.warn(`MPEG-TS PMT found at ${R} after unknown PID '${T}'. Backtracking to sync byte @${I} to parse all TS packets.`),T=null,R=I-188),E=this.pmtParsed=!0;break}case 17:case 8191:break;default:T=k;break}}else S++;S>0&&kt(this.observer,new Error(`Found ${S} TS packet/s that do not start with 0x47`)),n.pesData=u,o.pesData=f,l.pesData=m;const D={audioTrack:o,videoTrack:n,id3Track:l,textTrack:c};return i&&this.extractRemainingSamples(D),D}flush(){const{remainderData:e}=this;this.remainderData=null;let t;return e?t=this.demux(e,-1,!1,!0):t={videoTrack:this._videoTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(t),this.sampleAes?this.decrypt(t,this.sampleAes):t}extractRemainingSamples(e){const{audioTrack:t,videoTrack:s,id3Track:i,textTrack:r}=e,n=s.pesData,o=t.pesData,l=i.pesData;let c;if(n&&(c=Ke(n))?(this.videoParser.parseAVCPES(s,r,c,!0,this._duration),s.pesData=null):s.pesData=n,o&&(c=Ke(o))){switch(t.segmentCodec){case"aac":this.parseAACPES(t,c);break;case"mp3":this.parseMPEGPES(t,c);break;case"ac3":this.parseAC3PES(t,c);break}t.pesData=null}else o!=null&&o.size&&v.log("last AAC PES packet truncated,might overlap between fragments"),t.pesData=o;l&&(c=Ke(l))?(this.parseID3PES(i,c),i.pesData=null):i.pesData=l}demuxSampleAes(e,t,s){const i=this.demux(e,s,!0,!this.config.progressive),r=this.sampleAes=new So(this.observer,this.config,t);return this.decrypt(i,r)}decrypt(e,t){return new Promise(s=>{const{audioTrack:i,videoTrack:r}=e;i.samples&&i.segmentCodec==="aac"?t.decryptAacSamples(i.samples,0,()=>{r.samples?t.decryptAvcSamples(r.samples,0,0,()=>{s(e)}):s(e)}):r.samples&&t.decryptAvcSamples(r.samples,0,0,()=>{s(e)})})}destroy(){this._duration=0}parseAACPES(e,t){let s=0;const i=this.aacOverFlow;let r=t.data;if(i){this.aacOverFlow=null;const u=i.missing,d=i.sample.unit.byteLength;if(u===-1)r=pe(i.sample.unit,r);else{const g=d-u;i.sample.unit.set(r.subarray(0,u),g),e.samples.push(i.sample),s=i.missing}}let n,o;for(n=s,o=r.length;n0;)o+=l}}parseID3PES(e,t){if(t.pts===void 0){v.warn("[tsdemuxer]: ID3 PES unknown PTS");return}const s=se({},t,{type:this._videoTrack?ye.emsg:ye.audioId3,duration:Number.POSITIVE_INFINITY});e.samples.push(s)}}function fs(a,e){return((a[e+1]&31)<<8)+a[e+2]}function vo(a,e){return(a[e+10]&31)<<8|a[e+11]}function Ao(a,e,t,s,i){const r={audioPid:-1,videoPid:-1,id3Pid:-1,segmentVideoCodec:"avc",segmentAudioCodec:"aac"},n=(a[e+1]&15)<<8|a[e+2],o=e+3+n-4,l=(a[e+10]&15)<<8|a[e+11];for(e+=12+l;e0){let u=e+5,d=h;for(;d>2;){switch(a[u]){case 106:t.ac3!==!0?v.log("AC-3 audio found, not supported in this browser for now"):(r.audioPid=c,r.segmentAudioCodec="ac3");break}const f=a[u+1]+2;u+=f,d-=f}}break;case 194:case 135:return kt(i,new Error("Unsupported EC-3 in M2TS found")),r;case 36:return kt(i,new Error("Unsupported HEVC in M2TS found")),r}e+=h+5}return r}function kt(a,e,t){v.warn(`parsing error: ${e.message}`),a.emit(p.ERROR,p.ERROR,{type:$.MEDIA_ERROR,details:L.FRAG_PARSING_ERROR,fatal:!1,levelRetry:t,error:e,reason:e.message})}function jt(a){v.log(`${a} with AES-128-CBC encryption found in unencrypted stream`)}function Ke(a){let e=0,t,s,i,r,n;const o=a.data;if(!a||a.size===0)return null;for(;o[0].length<19&&o.length>1;)o[0]=pe(o[0],o[1]),o.splice(1,1);if(t=o[0],(t[0]<<16)+(t[1]<<8)+t[2]===1){if(s=(t[4]<<8)+t[5],s&&s>a.size-6)return null;const c=t[7];c&192&&(r=(t[9]&14)*536870912+(t[10]&255)*4194304+(t[11]&254)*16384+(t[12]&255)*128+(t[13]&254)/2,c&64?(n=(t[14]&14)*536870912+(t[15]&255)*4194304+(t[16]&254)*16384+(t[17]&255)*128+(t[18]&254)/2,r-n>60*9e4&&(v.warn(`${Math.round((r-n)/9e4)}s delta between PTS and DTS, align them`),r=n)):n=r),i=t[8];let h=i+9;if(a.size<=h)return null;a.size-=h;const u=new Uint8Array(a.size);for(let d=0,g=o.length;df){h-=f;continue}else t=t.subarray(h),f-=h,h=0;u.set(t,e),e+=f}return s&&(s-=i+3),{data:u,pts:r,dts:n,len:s}}return null}class Lo extends Cs{resetInitSegment(e,t,s,i){super.resetInitSegment(e,t,s,i),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:t,duration:i,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;const t=et(e,0);let s=(t==null?void 0:t.length)||0;if(t&&e[s]===11&&e[s+1]===119&&As(t)!==void 0&&vr(e,s)<=16)return!1;for(let i=e.length;s>24&255,n[1]=s>>16&255,n[2]=s>>8&255,n[3]=s&255,n.set(e,4),i=0,s=8;i>24&255,e>>16&255,e>>8&255,e&255,s>>24,s>>16&255,s>>8&255,s&255,i>>24,i>>16&255,i>>8&255,i&255,85,196,0,0]))}static mdia(e){return A.box(A.types.mdia,A.mdhd(e.timescale,e.duration),A.hdlr(e.type),A.minf(e))}static mfhd(e){return A.box(A.types.mfhd,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,e&255]))}static minf(e){return e.type==="audio"?A.box(A.types.minf,A.box(A.types.smhd,A.SMHD),A.DINF,A.stbl(e)):A.box(A.types.minf,A.box(A.types.vmhd,A.VMHD),A.DINF,A.stbl(e))}static moof(e,t,s){return A.box(A.types.moof,A.mfhd(e),A.traf(s,t))}static moov(e){let t=e.length;const s=[];for(;t--;)s[t]=A.trak(e[t]);return A.box.apply(null,[A.types.moov,A.mvhd(e[0].timescale,e[0].duration)].concat(s).concat(A.mvex(e)))}static mvex(e){let t=e.length;const s=[];for(;t--;)s[t]=A.trex(e[t]);return A.box.apply(null,[A.types.mvex,...s])}static mvhd(e,t){t*=e;const s=Math.floor(t/(ke+1)),i=Math.floor(t%(ke+1)),r=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,e&255,s>>24,s>>16&255,s>>8&255,s&255,i>>24,i>>16&255,i>>8&255,i&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return A.box(A.types.mvhd,r)}static sdtp(e){const t=e.samples||[],s=new Uint8Array(4+t.length);let i,r;for(i=0;i>>8&255),t.push(n&255),t=t.concat(Array.prototype.slice.call(r));for(i=0;i>>8&255),s.push(n&255),s=s.concat(Array.prototype.slice.call(r));const o=A.box(A.types.avcC,new Uint8Array([1,t[3],t[4],t[5],255,224|e.sps.length].concat(t).concat([e.pps.length]).concat(s))),l=e.width,c=e.height,h=e.pixelRatio[0],u=e.pixelRatio[1];return A.box(A.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,l>>8&255,l&255,c>>8&255,c&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),o,A.box(A.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),A.box(A.types.pasp,new Uint8Array([h>>24,h>>16&255,h>>8&255,h&255,u>>24,u>>16&255,u>>8&255,u&255])))}static esds(e){const t=e.config.length;return new Uint8Array([0,0,0,0,3,23+t,0,1,0,4,15+t,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([t]).concat(e.config).concat([6,1,2]))}static audioStsd(e){const t=e.samplerate;return new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,t>>8&255,t&255,0,0])}static mp4a(e){return A.box(A.types.mp4a,A.audioStsd(e),A.box(A.types.esds,A.esds(e)))}static mp3(e){return A.box(A.types[".mp3"],A.audioStsd(e))}static ac3(e){return A.box(A.types["ac-3"],A.audioStsd(e),A.box(A.types.dac3,e.config))}static stsd(e){return e.type==="audio"?e.segmentCodec==="mp3"&&e.codec==="mp3"?A.box(A.types.stsd,A.STSD,A.mp3(e)):e.segmentCodec==="ac3"?A.box(A.types.stsd,A.STSD,A.ac3(e)):A.box(A.types.stsd,A.STSD,A.mp4a(e)):A.box(A.types.stsd,A.STSD,A.avc1(e))}static tkhd(e){const t=e.id,s=e.duration*e.timescale,i=e.width,r=e.height,n=Math.floor(s/(ke+1)),o=Math.floor(s%(ke+1));return A.box(A.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,t&255,0,0,0,0,n>>24,n>>16&255,n>>8&255,n&255,o>>24,o>>16&255,o>>8&255,o&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,i>>8&255,i&255,0,0,r>>8&255,r&255,0,0]))}static traf(e,t){const s=A.sdtp(e),i=e.id,r=Math.floor(t/(ke+1)),n=Math.floor(t%(ke+1));return A.box(A.types.traf,A.box(A.types.tfhd,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,i&255])),A.box(A.types.tfdt,new Uint8Array([1,0,0,0,r>>24,r>>16&255,r>>8&255,r&255,n>>24,n>>16&255,n>>8&255,n&255])),A.trun(e,s.length+16+20+8+16+8+8),s)}static trak(e){return e.duration=e.duration||4294967295,A.box(A.types.trak,A.tkhd(e),A.mdia(e))}static trex(e){const t=e.id;return A.box(A.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,t&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}static trun(e,t){const s=e.samples||[],i=s.length,r=12+16*i,n=new Uint8Array(r);let o,l,c,h,u,d;for(t+=8+r,n.set([e.type==="video"?1:0,0,15,1,i>>>24&255,i>>>16&255,i>>>8&255,i&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255],0),o=0;o>>24&255,c>>>16&255,c>>>8&255,c&255,h>>>24&255,h>>>16&255,h>>>8&255,h&255,u.isLeading<<2|u.dependsOn,u.isDependedOn<<6|u.hasRedundancy<<4|u.paddingValue<<1|u.isNonSync,u.degradPrio&61440,u.degradPrio&15,d>>>24&255,d>>>16&255,d>>>8&255,d&255],12+16*o);return A.box(A.types.trun,n)}static initSegment(e){A.types||A.init();const t=A.moov(e);return pe(A.FTYP,t)}}A.types=void 0;A.HDLR_TYPES=void 0;A.STTS=void 0;A.STSC=void 0;A.STCO=void 0;A.STSZ=void 0;A.VMHD=void 0;A.SMHD=void 0;A.STSD=void 0;A.FTYP=void 0;A.DINF=void 0;const Lr=9e4;function ks(a,e,t=1,s=!1){const i=a*e*t;return s?Math.round(i):i}function Ro(a,e,t=1,s=!1){return ks(a,e,1/t,s)}function Je(a,e=!1){return ks(a,1e3,1/Lr,e)}function Io(a,e=1){return ks(a,Lr,1/e)}const bo=10*1e3,yi=1024,Do=1152,Co=1536;let Ve=null,zt=null;class Tt{constructor(e,t,s,i=""){if(this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextAvcDts=null,this.nextAudioPts=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.videoTrackConfig=void 0,this.observer=e,this.config=t,this.typeSupported=s,this.ISGenerated=!1,Ve===null){const n=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Ve=n?parseInt(n[1]):0}if(zt===null){const r=navigator.userAgent.match(/Safari\/(\d+)/i);zt=r?parseInt(r[1]):0}}destroy(){this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null}resetTimeStamp(e){v.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=e}resetNextTimestamp(){v.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){v.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1,this.videoTrackConfig=void 0}getVideoStartPts(e){let t=!1;const s=e.reduce((i,r)=>{const n=r.pts-i;return n<-4294967296?(t=!0,me(i,r.pts)):n>0?i:r.pts},e[0].pts);return t&&v.debug("PTS rollover detected"),s}remux(e,t,s,i,r,n,o,l){let c,h,u,d,g,f,m=r,T=r;const E=e.pid>-1,x=t.pid>-1,y=t.samples.length,I=e.samples.length>0,S=o&&y>0||y>1;if((!E||I)&&(!x||S)||this.ISGenerated||o){if(this.ISGenerated){var R,_,k,b;const K=this.videoTrackConfig;K&&(t.width!==K.width||t.height!==K.height||((R=t.pixelRatio)==null?void 0:R[0])!==((_=K.pixelRatio)==null?void 0:_[0])||((k=t.pixelRatio)==null?void 0:k[1])!==((b=K.pixelRatio)==null?void 0:b[1]))&&this.resetInitSegment()}else u=this.generateIS(e,t,r,n);const w=this.isVideoContiguous;let V=-1,P;if(S&&(V=_o(t.samples),!w&&this.config.forceKeyFrameOnDiscontinuity))if(f=!0,V>0){v.warn(`[mp4-remuxer]: Dropped ${V} out of ${y} video samples due to a missing keyframe`);const K=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(V),t.dropped+=V,T+=(t.samples[0].pts-K)/t.inputTimeScale,P=T}else V===-1&&(v.warn(`[mp4-remuxer]: No keyframe found out of ${y} video samples`),f=!1);if(this.ISGenerated){if(I&&S){const K=this.getVideoStartPts(t.samples),B=(me(e.samples[0].pts,K)-K)/t.inputTimeScale;m+=Math.max(0,B),T+=Math.max(0,-B)}if(I){if(e.samplerate||(v.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),u=this.generateIS(e,t,r,n)),h=this.remuxAudio(e,m,this.isAudioContiguous,n,x||S||l===U.AUDIO?T:void 0),S){const K=h?h.endPTS-h.startPTS:0;t.inputTimeScale||(v.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),u=this.generateIS(e,t,r,n)),c=this.remuxVideo(t,T,w,K)}}else S&&(c=this.remuxVideo(t,T,w,0));c&&(c.firstKeyFrame=V,c.independent=V!==-1,c.firstKeyFramePTS=P)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(s.samples.length&&(g=Rr(s,r,this._initPTS,this._initDTS)),i.samples.length&&(d=Ir(i,r,this._initPTS))),{audio:h,video:c,initSegment:u,independent:f,text:d,id3:g}}generateIS(e,t,s,i){const r=e.samples,n=t.samples,o=this.typeSupported,l={},c=this._initPTS;let h=!c||i,u="audio/mp4",d,g,f;if(h&&(d=g=1/0),e.config&&r.length){switch(e.timescale=e.samplerate,e.segmentCodec){case"mp3":o.mpeg?(u="audio/mpeg",e.codec=""):o.mp3&&(e.codec="mp3");break;case"ac3":e.codec="ac-3";break}l.audio={id:"audio",container:u,codec:e.codec,initSegment:e.segmentCodec==="mp3"&&o.mpeg?new Uint8Array(0):A.initSegment([e]),metadata:{channelCount:e.channelCount}},h&&(f=e.inputTimeScale,!c||f!==c.timescale?d=g=r[0].pts-Math.round(f*s):h=!1)}if(t.sps&&t.pps&&n.length){if(t.timescale=t.inputTimeScale,l.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:A.initSegment([t]),metadata:{width:t.width,height:t.height}},h)if(f=t.inputTimeScale,!c||f!==c.timescale){const m=this.getVideoStartPts(n),T=Math.round(f*s);g=Math.min(g,me(n[0].dts,m)-T),d=Math.min(d,m-T)}else h=!1;this.videoTrackConfig={width:t.width,height:t.height,pixelRatio:t.pixelRatio}}if(Object.keys(l).length)return this.ISGenerated=!0,h?(this._initPTS={baseTime:d,timescale:f},this._initDTS={baseTime:g,timescale:f}):d=f=void 0,{tracks:l,initPTS:d,timescale:f}}remuxVideo(e,t,s,i){const r=e.inputTimeScale,n=e.samples,o=[],l=n.length,c=this._initPTS;let h=this.nextAvcDts,u=8,d=this.videoSampleDuration,g,f,m=Number.POSITIVE_INFINITY,T=Number.NEGATIVE_INFINITY,E=!1;if(!s||h===null){const M=t*r,F=n[0].pts-me(n[0].dts,n[0].pts);Ve&&h!==null&&Math.abs(M-F-h)<15e3?s=!0:h=M-F}const x=c.baseTime*r/c.timescale;for(let M=0;M0?M-1:M].dts&&(E=!0)}E&&n.sort(function(M,F){const j=M.dts-F.dts,W=M.pts-F.pts;return j||W}),g=n[0].dts,f=n[n.length-1].dts;const y=f-g,I=y?Math.round(y/(l-1)):d||e.inputTimeScale/30;if(s){const M=g-h,F=M>I,j=M<-1;if((F||j)&&(F?v.warn(`AVC: ${Je(M,!0)} ms (${M}dts) hole between fragments detected at ${t.toFixed(3)}`):v.warn(`AVC: ${Je(-M,!0)} ms (${M}dts) overlapping between fragments detected at ${t.toFixed(3)}`),!j||h>=n[0].pts||Ve)){g=h;const W=n[0].pts-M;if(F)n[0].dts=g,n[0].pts=W;else for(let z=0;zW);z++)n[z].dts-=M,n[z].pts-=M;v.log(`Video: Initial PTS/DTS adjusted: ${Je(W,!0)}/${Je(g,!0)}, delta: ${Je(M,!0)} ms`)}}g=Math.max(0,g);let S=0,D=0,R=g;for(let M=0;M0?F.dts-n[M-1].dts:I;if(z=M>0?F.pts-n[M-1].pts:I,re.stretchShortVideoTrack&&this.nextAudioPts!==null){const fe=Math.floor(re.maxBufferHole*r),Qe=(i?m+i*r:this.nextAudioPts)-F.pts;Qe>fe?(d=Qe-le,d<0?d=le:w=!0,v.log(`[mp4-remuxer]: It is approximately ${Qe/90} ms to the next segment; using duration ${d/90} ms for the last video frame.`)):d=le}else d=le}const te=Math.round(F.pts-F.dts);V=Math.min(V,d),K=Math.max(K,d),P=Math.min(P,z),G=Math.max(G,z),o.push(new xi(F.key,d,W,te))}if(o.length){if(Ve){if(Ve<70){const M=o[0].flags;M.dependsOn=2,M.isNonSync=0}}else if(zt&&G-P0&&(i&&Math.abs(x-E)<9e3||Math.abs(me(m[0].pts-y,x)-E)<20*h),m.forEach(function(B){B.pts=me(B.pts-y,x)}),!s||E<0){if(m=m.filter(B=>B.pts>=0),!m.length)return;r===0?E=0:i&&!f?E=Math.max(0,x):E=m[0].pts}if(e.segmentCodec==="aac"){const B=this.config.maxAudioFramesDrift;for(let q=0,Q=E;q=B*h&&W0){R+=T;try{D=new Uint8Array(R)}catch(W){this.observer.emit(p.ERROR,p.ERROR,{type:$.MUX_ERROR,details:L.REMUX_ALLOC_ERROR,fatal:!1,error:W,bytes:R,reason:`fail allocating audio mdat ${R}`});return}d||(new DataView(D.buffer).setUint32(0,R),D.set(A.types.mdat,4))}else return;D.set(M,T);const j=M.byteLength;T+=j,g.push(new xi(!0,c,j,0)),S=F}const k=g.length;if(!k)return;const b=g[g.length-1];this.nextAudioPts=E=S+l*b.duration;const w=d?new Uint8Array(0):A.moof(e.sequenceNumber++,I/l,se({},e,{samples:g}));e.samples=[];const V=I/n,P=E/n,G={data1:w,data2:D,startPTS:V,endPTS:P,startDTS:V,endDTS:P,type:"audio",hasAudio:!0,hasVideo:!1,nb:k};return this.isAudioContiguous=!0,G}remuxEmptyAudio(e,t,s,i){const r=e.inputTimeScale,n=e.samplerate?e.samplerate:r,o=r/n,l=this.nextAudioPts,c=this._initDTS,h=c.baseTime*9e4/c.timescale,u=(l!==null?l:i.startDTS*r)+h,d=i.endDTS*r+h,g=o*yi,f=Math.ceil((d-u)/g),m=Ei.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);if(v.warn("[mp4-remuxer]: remux empty Audio"),!m){v.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}const T=[];for(let E=0;E4294967296;)a+=t;return a}function _o(a){for(let e=0;en.pts-o.pts);const r=a.samples;return a.samples=[],{samples:r}}class xi{constructor(e,t,s,i){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=t,this.size=s,this.cts=i,this.flags={isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:e?2:1,isNonSync:e?0:1}}}class wo{constructor(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=null,this.initTracks=void 0,this.lastEndTime=null}destroy(){}resetTimeStamp(e){this.initPTS=e,this.lastEndTime=null}resetNextTimestamp(){this.lastEndTime=null}resetInitSegment(e,t,s,i){this.audioCodec=t,this.videoCodec=s,this.generateInitSegment(Nn(e,i)),this.emitInitSegment=!0}generateInitSegment(e){let{audioCodec:t,videoCodec:s}=this;if(!(e!=null&&e.byteLength)){this.initTracks=void 0,this.initData=void 0;return}const i=this.initData=Qi(e);i.audio&&(t=Si(i.audio,X.AUDIO)),i.video&&(s=Si(i.video,X.VIDEO));const r={};i.audio&&i.video?r.audiovideo={container:"video/mp4",codec:t+","+s,initSegment:e,id:"main"}:i.audio?r.audio={container:"audio/mp4",codec:t,initSegment:e,id:"audio"}:i.video?r.video={container:"video/mp4",codec:s,initSegment:e,id:"main"}:v.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=r}remux(e,t,s,i,r,n){var o,l;let{initPTS:c,lastEndTime:h}=this;const u={audio:void 0,video:void 0,text:i,id3:s,initSegment:void 0};O(h)||(h=this.lastEndTime=r||0);const d=t.samples;if(!(d!=null&&d.length))return u;const g={initPTS:void 0,timescale:1};let f=this.initData;if((o=f)!=null&&o.length||(this.generateInitSegment(d),f=this.initData),!((l=f)!=null&&l.length))return v.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),u;this.emitInitSegment&&(g.tracks=this.initTracks,this.emitInitSegment=!1);const m=Bn(d,f),T=Un(f,d),E=T===null?r:T;(ko(c,E,r,m)||g.timescale!==c.timescale&&n)&&(g.initPTS=E-r,c&&c.timescale===1&&v.warn(`Adjusting initPTS by ${g.initPTS-c.baseTime}`),this.initPTS=c={baseTime:g.initPTS,timescale:1});const x=e?E-c.baseTime/c.timescale:h,y=x+m;Gn(f,d,c.baseTime/c.timescale),m>0?this.lastEndTime=y:(v.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const I=!!f.audio,S=!!f.video;let D="";I&&(D+="audio"),S&&(D+="video");const R={data1:d,startPTS:x,startDTS:x,endPTS:y,endDTS:y,type:D,hasAudio:I,hasVideo:S,nb:1,dropped:0};return u.audio=R.type==="audio"?R:void 0,u.video=R.type!=="audio"?R:void 0,u.initSegment=g,u.id3=Rr(s,r,c,c),i.samples.length&&(u.text=Ir(i,r,c)),u}}function ko(a,e,t,s){if(a===null)return!0;const i=Math.max(s,1),r=e-a.baseTime/a.timescale;return Math.abs(r-t)>i}function Si(a,e){const t=a==null?void 0:a.codec;if(t&&t.length>4)return t;if(e===X.AUDIO){if(t==="ec-3"||t==="ac-3"||t==="alac")return t;if(t==="fLaC"||t==="Opus")return Rt(t,!1);const s="mp4a.40.5";return v.info(`Parsed audio codec "${t}" or audio object type not handled. Using "${s}"`),s}return v.warn(`Unhandled video codec "${t}"`),t==="hvc1"||t==="hev1"?"hvc1.1.6.L120.90":t==="av01"?"av01.0.04M.08":"avc1.42e01e"}let _e;try{_e=self.performance.now.bind(self.performance)}catch{v.debug("Unable to use Performance API on this environment"),_e=qe==null?void 0:qe.Date.now}const Et=[{demux:To,remux:wo},{demux:Pe,remux:Tt},{demux:mo,remux:Tt},{demux:Lo,remux:Tt}];Et.splice(2,0,{demux:Eo,remux:Tt});class vi{constructor(e,t,s,i,r){this.async=!1,this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.observer=e,this.typeSupported=t,this.config=s,this.vendor=i,this.id=r}configure(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()}push(e,t,s,i){const r=s.transmuxing;r.executeStart=_e();let n=new Uint8Array(e);const{currentTransmuxState:o,transmuxConfig:l}=this;i&&(this.currentTransmuxState=i);const{contiguous:c,discontinuity:h,trackSwitch:u,accurateTimeOffset:d,timeOffset:g,initSegmentChange:f}=i||o,{audioCodec:m,videoCodec:T,defaultInitPts:E,duration:x,initSegmentData:y}=l,I=Po(n,t);if(I&&I.method==="AES-128"){const _=this.getDecrypter();if(_.isSync()){let k=_.softwareDecrypt(n,I.key.buffer,I.iv.buffer);if(s.part>-1&&(k=_.flush()),!k)return r.executeEnd=_e(),Xt(s);n=new Uint8Array(k)}else return this.decryptionPromise=_.webCryptoDecrypt(n,I.key.buffer,I.iv.buffer).then(k=>{const b=this.push(k,null,s);return this.decryptionPromise=null,b}),this.decryptionPromise}const S=this.needsProbing(h,u);if(S){const _=this.configureTransmuxer(n);if(_)return v.warn(`[transmuxer] ${_.message}`),this.observer.emit(p.ERROR,p.ERROR,{type:$.MEDIA_ERROR,details:L.FRAG_PARSING_ERROR,fatal:!1,error:_,reason:_.message}),r.executeEnd=_e(),Xt(s)}(h||u||f||S)&&this.resetInitSegment(y,m,T,x,t),(h||f||S)&&this.resetInitialTimestamp(E),c||this.resetContiguity();const D=this.transmux(n,I,g,d,s),R=this.currentTransmuxState;return R.contiguous=!0,R.discontinuity=!1,R.trackSwitch=!1,r.executeEnd=_e(),D}flush(e){const t=e.transmuxing;t.executeStart=_e();const{decrypter:s,currentTransmuxState:i,decryptionPromise:r}=this;if(r)return r.then(()=>this.flush(e));const n=[],{timeOffset:o}=i;if(s){const u=s.flush();u&&n.push(this.push(u,null,e))}const{demuxer:l,remuxer:c}=this;if(!l||!c)return t.executeEnd=_e(),[Xt(e)];const h=l.flush(o);return yt(h)?h.then(u=>(this.flushRemux(n,u,e),n)):(this.flushRemux(n,h,e),n)}flushRemux(e,t,s){const{audioTrack:i,videoTrack:r,id3Track:n,textTrack:o}=t,{accurateTimeOffset:l,timeOffset:c}=this.currentTransmuxState;v.log(`[transmuxer.ts]: Flushed fragment ${s.sn}${s.part>-1?" p: "+s.part:""} of level ${s.level}`);const h=this.remuxer.remux(i,r,n,o,c,l,!0,this.id);e.push({remuxResult:h,chunkMeta:s}),s.transmuxing.executeEnd=_e()}resetInitialTimestamp(e){const{demuxer:t,remuxer:s}=this;!t||!s||(t.resetTimeStamp(e),s.resetTimeStamp(e))}resetContiguity(){const{demuxer:e,remuxer:t}=this;!e||!t||(e.resetContiguity(),t.resetNextTimestamp())}resetInitSegment(e,t,s,i,r){const{demuxer:n,remuxer:o}=this;!n||!o||(n.resetInitSegment(e,t,s,i),o.resetInitSegment(e,t,s,r))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(e,t,s,i,r){let n;return t&&t.method==="SAMPLE-AES"?n=this.transmuxSampleAes(e,t,s,i,r):n=this.transmuxUnencrypted(e,s,i,r),n}transmuxUnencrypted(e,t,s,i){const{audioTrack:r,videoTrack:n,id3Track:o,textTrack:l}=this.demuxer.demux(e,t,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(r,n,o,l,t,s,!1,this.id),chunkMeta:i}}transmuxSampleAes(e,t,s,i,r){return this.demuxer.demuxSampleAes(e,t,s).then(n=>({remuxResult:this.remuxer.remux(n.audioTrack,n.videoTrack,n.id3Track,n.textTrack,s,i,!1,this.id),chunkMeta:r}))}configureTransmuxer(e){const{config:t,observer:s,typeSupported:i,vendor:r}=this;let n;for(let d=0,g=Et.length;d0&&(e==null?void 0:e.key)!=null&&e.iv!==null&&e.method!=null&&(t=e),t}const Xt=a=>({remuxResult:{},chunkMeta:a});function yt(a){return"then"in a&&a.then instanceof Function}class Fo{constructor(e,t,s,i,r){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=e,this.videoCodec=t,this.initSegmentData=s,this.duration=i,this.defaultInitPts=r||null}}class Oo{constructor(e,t,s,i,r,n){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.initSegmentChange=void 0,this.discontinuity=e,this.contiguous=t,this.accurateTimeOffset=s,this.trackSwitch=i,this.timeOffset=r,this.initSegmentChange=n}}var br={exports:{}};(function(a){var e=Object.prototype.hasOwnProperty,t="~";function s(){}Object.create&&(s.prototype=Object.create(null),new s().__proto__||(t=!1));function i(l,c,h){this.fn=l,this.context=c,this.once=h||!1}function r(l,c,h,u,d){if(typeof h!="function")throw new TypeError("The listener must be a function");var g=new i(h,u||l,d),f=t?t+c:c;return l._events[f]?l._events[f].fn?l._events[f]=[l._events[f],g]:l._events[f].push(g):(l._events[f]=g,l._eventsCount++),l}function n(l,c){--l._eventsCount===0?l._events=new s:delete l._events[c]}function o(){this._events=new s,this._eventsCount=0}o.prototype.eventNames=function(){var c=[],h,u;if(this._eventsCount===0)return c;for(u in h=this._events)e.call(h,u)&&c.push(t?u.slice(1):u);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(h)):c},o.prototype.listeners=function(c){var h=t?t+c:c,u=this._events[h];if(!u)return[];if(u.fn)return[u.fn];for(var d=0,g=u.length,f=new Array(g);d{h=h||{},h.frag=this.frag,h.id=this.id,c===p.ERROR&&(this.error=h.error),this.hls.trigger(c,h)};this.observer=new Ps,this.observer.on(p.FRAG_DECRYPTED,n),this.observer.on(p.ERROR,n);const o=Ue(r.preferManagedMediaSource)||{isTypeSupported:()=>!1},l={mpeg:o.isTypeSupported("audio/mpeg"),mp3:o.isTypeSupported('audio/mp4; codecs="mp3"'),ac3:o.isTypeSupported('audio/mp4; codecs="ac-3"')};if(this.useWorker&&typeof Worker<"u"&&(r.workerPath||eo())){try{r.workerPath?(v.log(`loading Web Worker ${r.workerPath} for "${t}"`),this.workerContext=so(r.workerPath)):(v.log(`injecting Web Worker for "${t}"`),this.workerContext=to()),this.onwmsg=u=>this.onWorkerMessage(u);const{worker:h}=this.workerContext;h.addEventListener("message",this.onwmsg),h.onerror=u=>{const d=new Error(`${u.message} (${u.filename}:${u.lineno})`);r.enableWorker=!1,v.warn(`Error in "${t}" Web Worker, fallback to inline`),this.hls.trigger(p.ERROR,{type:$.OTHER_ERROR,details:L.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:d})},h.postMessage({cmd:"init",typeSupported:l,vendor:"",id:t,config:JSON.stringify(r)})}catch(h){v.warn(`Error setting up "${t}" Web Worker, fallback to inline`,h),this.resetWorker(),this.error=null,this.transmuxer=new vi(this.observer,l,r,"",t)}return}this.transmuxer=new vi(this.observer,l,r,"",t)}resetWorker(){if(this.workerContext){const{worker:e,objectURL:t}=this.workerContext;t&&self.URL.revokeObjectURL(t),e.removeEventListener("message",this.onwmsg),e.onerror=null,e.terminate(),this.workerContext=null}}destroy(){if(this.workerContext)this.resetWorker(),this.onwmsg=void 0;else{const t=this.transmuxer;t&&(t.destroy(),this.transmuxer=null)}const e=this.observer;e&&e.removeAllListeners(),this.frag=null,this.observer=null,this.hls=null}push(e,t,s,i,r,n,o,l,c,h){var u,d;c.transmuxing.start=self.performance.now();const{transmuxer:g}=this,f=n?n.start:r.start,m=r.decryptdata,T=this.frag,E=!(T&&r.cc===T.cc),x=!(T&&c.level===T.level),y=T?c.sn-T.sn:-1,I=this.part?c.part-this.part.index:-1,S=y===0&&c.id>1&&c.id===(T==null?void 0:T.stats.chunkCount),D=!x&&(y===1||y===0&&(I===1||S&&I<=0)),R=self.performance.now();(x||y||r.stats.parsing.start===0)&&(r.stats.parsing.start=R),n&&(I||!D)&&(n.stats.parsing.start=R);const _=!(T&&((u=r.initSegment)==null?void 0:u.url)===((d=T.initSegment)==null?void 0:d.url)),k=new Oo(E,D,l,x,f,_);if(!D||E||_){v.log(`[transmuxer-interface, ${r.type}]: Starting new transmux session for sn: ${c.sn} p: ${c.part} level: ${c.level} id: ${c.id} + discontinuity: ${E} + trackSwitch: ${x} + contiguous: ${D} + accurateTimeOffset: ${l} + timeOffset: ${f} + initSegmentChange: ${_}`);const b=new Fo(s,i,t,o,h);this.configureTransmuxer(b)}if(this.frag=r,this.part=n,this.workerContext)this.workerContext.worker.postMessage({cmd:"demux",data:e,decryptdata:m,chunkMeta:c,state:k},e instanceof ArrayBuffer?[e]:[]);else if(g){const b=g.push(e,m,c,k);yt(b)?(g.async=!0,b.then(w=>{this.handleTransmuxComplete(w)}).catch(w=>{this.transmuxerError(w,c,"transmuxer-interface push error")})):(g.async=!1,this.handleTransmuxComplete(b))}}flush(e){e.transmuxing.start=self.performance.now();const{transmuxer:t}=this;if(this.workerContext)this.workerContext.worker.postMessage({cmd:"flush",chunkMeta:e});else if(t){let s=t.flush(e);yt(s)||t.async?(yt(s)||(s=Promise.resolve(s)),s.then(r=>{this.handleFlushResult(r,e)}).catch(r=>{this.transmuxerError(r,e,"transmuxer-interface flush error")})):this.handleFlushResult(s,e)}}transmuxerError(e,t,s){this.hls&&(this.error=e,this.hls.trigger(p.ERROR,{type:$.MEDIA_ERROR,details:L.FRAG_PARSING_ERROR,chunkMeta:t,frag:this.frag||void 0,fatal:!1,error:e,err:e,reason:s}))}handleFlushResult(e,t){e.forEach(s=>{this.handleTransmuxComplete(s)}),this.onFlush(t)}onWorkerMessage(e){const t=e.data;if(!(t!=null&&t.event)){v.warn(`worker message received with no ${t?"event name":"data"}`);return}const s=this.hls;if(this.hls)switch(t.event){case"init":{var i;const r=(i=this.workerContext)==null?void 0:i.objectURL;r&&self.URL.revokeObjectURL(r);break}case"transmuxComplete":{this.handleTransmuxComplete(t.data);break}case"flush":{this.onFlush(t.data);break}case"workerLog":v[t.data.logType]&&v[t.data.logType](t.data.message);break;default:{t.data=t.data||{},t.data.frag=this.frag,t.data.id=this.id,s.trigger(t.event,t.data);break}}}configureTransmuxer(e){const{transmuxer:t}=this;this.workerContext?this.workerContext.worker.postMessage({cmd:"configure",config:e}):t&&t.configure(e)}handleTransmuxComplete(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)}}function Cr(a,e){if(a.length!==e.length)return!1;for(let t=0;ta[i]!==e[i])}function gs(a,e){return e.label.toLowerCase()===a.name.toLowerCase()&&(!e.language||e.language.toLowerCase()===(a.lang||"").toLowerCase())}const Ai=100;class No extends Ds{constructor(e,t,s){super(e,t,s,"[audio-stream-controller]",U.AUDIO),this.videoBuffer=null,this.videoTrackCC=-1,this.waitingVideoCC=-1,this.bufferedTrack=null,this.switchingTrack=null,this.trackId=-1,this.waitingData=null,this.mainDetails=null,this.flushing=!1,this.bufferFlushed=!1,this.cachedTrackLoadedData=null,this._registerListeners()}onHandlerDestroying(){this._unregisterListeners(),super.onHandlerDestroying(),this.mainDetails=null,this.bufferedTrack=null,this.switchingTrack=null}_registerListeners(){const{hls:e}=this;e.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.LEVEL_LOADED,this.onLevelLoaded,this),e.on(p.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.on(p.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(p.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(p.ERROR,this.onError,this),e.on(p.BUFFER_RESET,this.onBufferReset,this),e.on(p.BUFFER_CREATED,this.onBufferCreated,this),e.on(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(p.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(p.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(p.FRAG_BUFFERED,this.onFragBuffered,this)}_unregisterListeners(){const{hls:e}=this;e.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.LEVEL_LOADED,this.onLevelLoaded,this),e.off(p.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.off(p.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(p.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(p.ERROR,this.onError,this),e.off(p.BUFFER_RESET,this.onBufferReset,this),e.off(p.BUFFER_CREATED,this.onBufferCreated,this),e.off(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(p.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(p.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(p.FRAG_BUFFERED,this.onFragBuffered,this)}onInitPtsFound(e,{frag:t,id:s,initPTS:i,timescale:r}){if(s==="main"){const n=t.cc;this.initPTS[t.cc]={baseTime:i,timescale:r},this.log(`InitPTS for cc: ${n} found from main: ${i}`),this.videoTrackCC=n,this.state===C.WAITING_INIT_PTS&&this.tick()}}startLoad(e){if(!this.levels){this.startPosition=e,this.state=C.STOPPED;return}const t=this.lastCurrentTime;this.stopLoad(),this.setInterval(Ai),t>0&&e===-1?(this.log(`Override startPosition with lastCurrentTime @${t.toFixed(3)}`),e=t,this.state=C.IDLE):(this.loadedmetadata=!1,this.state=C.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}doTick(){switch(this.state){case C.IDLE:this.doTickIdle();break;case C.WAITING_TRACK:{var e;const{levels:s,trackId:i}=this,r=s==null||(e=s[i])==null?void 0:e.details;if(r){if(this.waitForCdnTuneIn(r))break;this.state=C.WAITING_INIT_PTS}break}case C.FRAG_LOADING_WAITING_RETRY:{var t;const s=performance.now(),i=this.retryDate;if(!i||s>=i||(t=this.media)!=null&&t.seeking){const{levels:r,trackId:n}=this;this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded((r==null?void 0:r[n])||null),this.state=C.IDLE}break}case C.WAITING_INIT_PTS:{const s=this.waitingData;if(s){const{frag:i,part:r,cache:n,complete:o}=s;if(this.initPTS[i.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=C.FRAG_LOADING;const l=n.flush(),c={frag:i,part:r,payload:l,networkDetails:null};this._handleFragmentLoadProgress(c),o&&super._handleFragmentLoadComplete(c)}else if(this.videoTrackCC!==this.waitingVideoCC)this.log(`Waiting fragment cc (${i.cc}) cancelled because video is at cc ${this.videoTrackCC}`),this.clearWaitingFragment();else{const l=this.getLoadPosition(),c=J.bufferInfo(this.mediaBuffer,l,this.config.maxBufferHole);ds(c.end,this.config.maxFragLookUpTolerance,i)<0&&(this.log(`Waiting fragment cc (${i.cc}) @ ${i.start} cancelled because another fragment at ${c.end} is needed`),this.clearWaitingFragment())}}else this.state=C.IDLE}}this.onTickEnd()}clearWaitingFragment(){const e=this.waitingData;e&&(this.fragmentTracker.removeFragment(e.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=C.IDLE)}resetLoadingState(){this.clearWaitingFragment(),super.resetLoadingState()}onTickEnd(){const{media:e}=this;e!=null&&e.readyState&&(this.lastCurrentTime=e.currentTime)}doTickIdle(){const{hls:e,levels:t,media:s,trackId:i}=this,r=e.config;if(!s&&(this.startFragRequested||!r.startFragPrefetch)||!(t!=null&&t[i]))return;const n=t[i],o=n.details;if(!o||o.live&&this.levelLastLoaded!==n||this.waitForCdnTuneIn(o)){this.state=C.WAITING_TRACK;return}const l=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&l&&(this.bufferFlushed=!1,this.afterBufferFlushed(l,X.AUDIO,U.AUDIO));const c=this.getFwdBufferInfo(l,U.AUDIO);if(c===null)return;const{bufferedTrack:h,switchingTrack:u}=this;if(!u&&this._streamEnded(c,o)){e.trigger(p.BUFFER_EOS,{type:"audio"}),this.state=C.ENDED;return}const d=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,U.MAIN),g=c.len,f=this.getMaxBufferLength(d==null?void 0:d.len),m=o.fragments,T=m[0].start;let E=this.flushing?this.getLoadPosition():c.end;if(u&&s){const S=this.getLoadPosition();h&&!ze(u.attrs,h.attrs)&&(E=S),o.PTSKnown&&ST||c.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),s.currentTime=T+.05)}if(g>=f&&!u&&Ed.end+o.targetduration;if(I||!(d!=null&&d.len)&&c.len){const S=this.getAppendedFrag(x.start,U.MAIN);if(S===null||(y||(y=!!S.gap||!!I&&d.len===0),I&&!y||y&&c.nextStart&&c.nextStartnew je(s))}onAudioTrackSwitching(e,t){const s=!!t.url;this.trackId=t.id;const{fragCurrent:i}=this;i&&(i.abortRequests(),this.removeUnbufferedFrags(i.start)),this.resetLoadingState(),s?this.setInterval(Ai):this.resetTransmuxer(),s?(this.switchingTrack=t,this.state=C.IDLE,this.flushAudioIfNeeded(t)):(this.switchingTrack=null,this.bufferedTrack=t,this.state=C.STOPPED),this.tick()}onManifestLoading(){this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=this.flushing=!1,this.levels=this.mainDetails=this.waitingData=this.bufferedTrack=this.cachedTrackLoadedData=this.switchingTrack=null,this.startFragRequested=!1,this.trackId=this.videoTrackCC=this.waitingVideoCC=-1}onLevelLoaded(e,t){this.mainDetails=t.details,this.cachedTrackLoadedData!==null&&(this.hls.trigger(p.AUDIO_TRACK_LOADED,this.cachedTrackLoadedData),this.cachedTrackLoadedData=null)}onAudioTrackLoaded(e,t){var s;if(this.mainDetails==null){this.cachedTrackLoadedData=t;return}const{levels:i}=this,{details:r,id:n}=t;if(!i){this.warn(`Audio tracks were reset while loading level ${n}`);return}this.log(`Audio track ${n} loaded [${r.startSN},${r.endSN}]${r.lastPartSn?`[part-${r.lastPartSn}-${r.lastPartIndex}]`:""},duration:${r.totalduration}`);const o=i[n];let l=0;if(r.live||(s=o.details)!=null&&s.live){this.checkLiveUpdate(r);const h=this.mainDetails;if(r.deltaUpdateFailed||!h)return;if(!o.details&&r.hasProgramDateTime&&h.hasProgramDateTime)_t(r,h),l=r.fragments[0].start;else{var c;l=this.alignPlaylists(r,o.details,(c=this.levelLastLoaded)==null?void 0:c.details)}}o.details=r,this.levelLastLoaded=o,!this.startFragRequested&&(this.mainDetails||!r.live)&&this.setStartPosition(this.mainDetails||r,l),this.state===C.WAITING_TRACK&&!this.waitForCdnTuneIn(r)&&(this.state=C.IDLE),this.tick()}_handleFragmentLoadProgress(e){var t;const{frag:s,part:i,payload:r}=e,{config:n,trackId:o,levels:l}=this;if(!l){this.warn(`Audio tracks were reset while fragment load was in progress. Fragment ${s.sn} of level ${s.level} will not be buffered`);return}const c=l[o];if(!c){this.warn("Audio track is undefined on fragment load progress");return}const h=c.details;if(!h){this.warn("Audio track details undefined on fragment load progress"),this.removeUnbufferedFrags(s.start);return}const u=n.defaultAudioCodec||c.audioCodec||"mp4a.40.2";let d=this.transmuxer;d||(d=this.transmuxer=new Dr(this.hls,U.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const g=this.initPTS[s.cc],f=(t=s.initSegment)==null?void 0:t.data;if(g!==void 0){const T=i?i.index:-1,E=T!==-1,x=new Is(s.level,s.sn,s.stats.chunkCount,r.byteLength,T,E);d.push(r,f,u,"",s,i,h.totalduration,!1,x,g)}else{this.log(`Unknown video PTS for cc ${s.cc}, waiting for video PTS before demuxing audio frag ${s.sn} of [${h.startSN} ,${h.endSN}],track ${o}`);const{cache:m}=this.waitingData=this.waitingData||{frag:s,part:i,cache:new dr,complete:!1};m.push(new Uint8Array(r)),this.waitingVideoCC=this.videoTrackCC,this.state=C.WAITING_INIT_PTS}}_handleFragmentLoadComplete(e){if(this.waitingData){this.waitingData.complete=!0;return}super._handleFragmentLoadComplete(e)}onBufferReset(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1}onBufferCreated(e,t){const s=t.tracks.audio;s&&(this.mediaBuffer=s.buffer||null),t.tracks.video&&(this.videoBuffer=t.tracks.video.buffer||null)}onFragBuffered(e,t){const{frag:s,part:i}=t;if(s.type!==U.AUDIO){if(!this.loadedmetadata&&s.type===U.MAIN){const r=this.videoBuffer||this.media;r&&J.getBuffered(r).length&&(this.loadedmetadata=!0)}return}if(this.fragContextChanged(s)){this.warn(`Fragment ${s.sn}${i?" p: "+i.index:""} of level ${s.level} finished buffering, but was aborted. state: ${this.state}, audioSwitch: ${this.switchingTrack?this.switchingTrack.name:"false"}`);return}if(s.sn!=="initSegment"){this.fragPrevious=s;const r=this.switchingTrack;r&&(this.bufferedTrack=r,this.switchingTrack=null,this.hls.trigger(p.AUDIO_TRACK_SWITCHED,oe({},r)))}this.fragBufferedComplete(s,i)}onError(e,t){var s;if(t.fatal){this.state=C.ERROR;return}switch(t.details){case L.FRAG_GAP:case L.FRAG_PARSING_ERROR:case L.FRAG_DECRYPT_ERROR:case L.FRAG_LOAD_ERROR:case L.FRAG_LOAD_TIMEOUT:case L.KEY_LOAD_ERROR:case L.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(U.AUDIO,t);break;case L.AUDIO_TRACK_LOAD_ERROR:case L.AUDIO_TRACK_LOAD_TIMEOUT:case L.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===C.WAITING_TRACK&&((s=t.context)==null?void 0:s.type)===Y.AUDIO_TRACK&&(this.state=C.IDLE);break;case L.BUFFER_APPEND_ERROR:case L.BUFFER_FULL_ERROR:if(!t.parent||t.parent!=="audio")return;if(t.details===L.BUFFER_APPEND_ERROR){this.resetLoadingState();return}this.reduceLengthAndFlushBuffer(t)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case L.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onBufferFlushing(e,{type:t}){t!==X.VIDEO&&(this.flushing=!0)}onBufferFlushed(e,{type:t}){if(t!==X.VIDEO){this.flushing=!1,this.bufferFlushed=!0,this.state===C.ENDED&&(this.state=C.IDLE);const s=this.mediaBuffer||this.media;s&&(this.afterBufferFlushed(s,t,U.AUDIO),this.tick())}}_handleTransmuxComplete(e){var t;const s="audio",{hls:i}=this,{remuxResult:r,chunkMeta:n}=e,o=this.getCurrentContext(n);if(!o){this.resetWhenMissingContext(n);return}const{frag:l,part:c,level:h}=o,{details:u}=h,{audio:d,text:g,id3:f,initSegment:m}=r;if(this.fragContextChanged(l)||!u){this.fragmentTracker.removeFragment(l);return}if(this.state=C.PARSING,this.switchingTrack&&d&&this.completeAudioSwitch(this.switchingTrack),m!=null&&m.tracks){const T=l.initSegment||l;this._bufferInitSegment(h,m.tracks,T,n),i.trigger(p.FRAG_PARSING_INIT_SEGMENT,{frag:T,id:s,tracks:m.tracks})}if(d){const{startPTS:T,endPTS:E,startDTS:x,endDTS:y}=d;c&&(c.elementaryStreams[X.AUDIO]={startPTS:T,endPTS:E,startDTS:x,endDTS:y}),l.setElementaryStreamInfo(X.AUDIO,T,E,x,y),this.bufferFragmentData(d,l,c,n)}if(f!=null&&(t=f.samples)!=null&&t.length){const T=se({id:s,frag:l,details:u},f);i.trigger(p.FRAG_PARSING_METADATA,T)}if(g){const T=se({id:s,frag:l,details:u},g);i.trigger(p.FRAG_PARSING_USERDATA,T)}}_bufferInitSegment(e,t,s,i){if(this.state!==C.PARSING)return;t.video&&delete t.video;const r=t.audio;if(!r)return;r.id="audio";const n=e.audioCodec;this.log(`Init audio buffer, container:${r.container}, codecs[level/parsed]=[${n}/${r.codec}]`),n&&n.split(",").length===1&&(r.levelCodec=n),this.hls.trigger(p.BUFFER_CODECS,t);const o=r.initSegment;if(o!=null&&o.byteLength){const l={type:"audio",frag:s,part:null,chunkMeta:i,parent:s.type,data:o};this.hls.trigger(p.BUFFER_APPENDING,l)}this.tickImmediate()}loadFragment(e,t,s){const i=this.fragmentTracker.getState(e);if(this.fragCurrent=e,this.switchingTrack||i===ae.NOT_LOADED||i===ae.PARTIAL){var r;if(e.sn==="initSegment")this._loadInitSegment(e,t);else if((r=t.details)!=null&&r.live&&!this.initPTS[e.cc]){this.log(`Waiting for video PTS in continuity counter ${e.cc} of live stream before loading audio fragment ${e.sn} of level ${this.trackId}`),this.state=C.WAITING_INIT_PTS;const n=this.mainDetails;n&&n.fragments[0].start!==t.details.fragments[0].start&&_t(t.details,n)}else this.startFragRequested=!0,super.loadFragment(e,t,s)}else this.clearTrackerIfNeeded(e)}flushAudioIfNeeded(e){const{media:t,bufferedTrack:s}=this,i=s==null?void 0:s.attrs,r=e.attrs;t&&i&&(i.CHANNELS!==r.CHANNELS||s.name!==e.name||s.lang!==e.lang)&&(this.log("Switching audio track : flushing all audio"),super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"),this.bufferedTrack=null)}completeAudioSwitch(e){const{hls:t}=this;this.flushAudioIfNeeded(e),this.bufferedTrack=e,this.switchingTrack=null,t.trigger(p.AUDIO_TRACK_SWITCHED,oe({},e))}}class Uo extends Rs{constructor(e){super(e,"[audio-track-controller]"),this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.registerListeners()}registerListeners(){const{hls:e}=this;e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_PARSED,this.onManifestParsed,this),e.on(p.LEVEL_LOADING,this.onLevelLoading,this),e.on(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(p.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(p.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_PARSED,this.onManifestParsed,this),e.off(p.LEVEL_LOADING,this.onLevelLoading,this),e.off(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(p.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(p.ERROR,this.onError,this)}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,super.destroy()}onManifestLoading(){this.tracks=[],this.tracksInGroup=[],this.groupIds=null,this.currentTrack=null,this.trackId=-1,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.audioTracks||[]}onAudioTrackLoaded(e,t){const{id:s,groupId:i,details:r}=t,n=this.tracksInGroup[s];if(!n||n.groupId!==i){this.warn(`Audio track with id:${s} and group:${i} not found in active group ${n==null?void 0:n.groupId}`);return}const o=n.details;n.details=t.details,this.log(`Audio track ${s} "${n.name}" lang:${n.lang} group:${i} loaded [${r.startSN}-${r.endSN}]`),s===this.trackId&&this.playlistLoaded(s,t,o)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const s=t.audioGroups||null,i=this.groupIds;let r=this.currentTrack;if(!s||(i==null?void 0:i.length)!==(s==null?void 0:s.length)||s!=null&&s.some(o=>(i==null?void 0:i.indexOf(o))===-1)){this.groupIds=s,this.trackId=-1,this.currentTrack=null;const o=this.tracks.filter(d=>!s||s.indexOf(d.groupId)!==-1);if(o.length)this.selectDefaultTrack&&!o.some(d=>d.default)&&(this.selectDefaultTrack=!1),o.forEach((d,g)=>{d.id=g});else if(!r&&!this.tracksInGroup.length)return;this.tracksInGroup=o;const l=this.hls.config.audioPreference;if(!r&&l){const d=Le(l,o,$e);if(d>-1)r=o[d];else{const g=Le(l,this.tracks);r=this.tracks[g]}}let c=this.findTrackId(r);c===-1&&r&&(c=this.findTrackId(null));const h={audioTracks:o};this.log(`Updating audio tracks, ${o.length} track(s) found in group(s): ${s==null?void 0:s.join(",")}`),this.hls.trigger(p.AUDIO_TRACKS_UPDATED,h);const u=this.trackId;if(c!==-1&&u===-1)this.setAudioTrack(c);else if(o.length&&u===-1){var n;const d=new Error(`No audio track selected for current audio group-ID(s): ${(n=this.groupIds)==null?void 0:n.join(",")} track count: ${o.length}`);this.warn(d.message),this.hls.trigger(p.ERROR,{type:$.MEDIA_ERROR,details:L.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:d})}}else this.shouldReloadPlaylist(r)&&this.setAudioTrack(this.trackId)}onError(e,t){t.fatal||!t.context||t.context.type===Y.AUDIO_TRACK&&t.context.id===this.trackId&&(!this.groupIds||this.groupIds.indexOf(t.context.groupId)!==-1)&&(this.requestScheduled=-1,this.checkRetry(t))}get allAudioTracks(){return this.tracks}get audioTracks(){return this.tracksInGroup}get audioTrack(){return this.trackId}set audioTrack(e){this.selectDefaultTrack=!1,this.setAudioTrack(e)}setAudioOption(e){const t=this.hls;if(t.config.audioPreference=e,e){const s=this.allAudioTracks;if(this.selectDefaultTrack=!1,s.length){const i=this.currentTrack;if(i&&We(e,i,$e))return i;const r=Le(e,this.tracksInGroup,$e);if(r>-1){const n=this.tracksInGroup[r];return this.setAudioTrack(r),n}else if(i){let n=t.loadLevel;n===-1&&(n=t.firstAutoLevel);const o=Na(e,t.levels,s,n,$e);if(o===-1)return null;t.nextLoadLevel=o}if(e.channels||e.audioCodec){const n=Le(e,s);if(n>-1)return s[n]}}}return null}setAudioTrack(e){const t=this.tracksInGroup;if(e<0||e>=t.length){this.warn(`Invalid audio track id: ${e}`);return}this.clearTimer(),this.selectDefaultTrack=!1;const s=this.currentTrack,i=t[e],r=i.details&&!i.details.live;if(e===this.trackId&&i===s&&r||(this.log(`Switching to audio-track ${e} "${i.name}" lang:${i.lang} group:${i.groupId} channels:${i.channels}`),this.trackId=e,this.currentTrack=i,this.hls.trigger(p.AUDIO_TRACK_SWITCHING,oe({},i)),r))return;const n=this.switchParams(i.url,s==null?void 0:s.details,i.details);this.loadPlaylist(n)}findTrackId(e){const t=this.tracksInGroup;for(let s=0;s=r[c].start&&o<=r[c].end){n=r[c];break}const l=s.start+s.duration;n?n.end=l:(n={start:o,end:l},r.push(n)),this.fragmentTracker.fragBuffered(s),this.fragBufferedComplete(s,null)}onBufferFlushing(e,t){const{startOffset:s,endOffset:i}=t;if(s===0&&i!==Number.POSITIVE_INFINITY){const r=i-1;if(r<=0)return;t.endOffsetSubtitles=Math.max(0,r),this.tracksBuffered.forEach(n=>{for(let o=0;onew je(s));return}this.tracksBuffered=[],this.levels=t.map(s=>{const i=new je(s);return this.tracksBuffered[i.id]=[],i}),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,U.SUBTITLE),this.fragPrevious=null,this.mediaBuffer=null}onSubtitleTrackSwitch(e,t){var s;if(this.currentTrackId=t.id,!((s=this.levels)!=null&&s.length)||this.currentTrackId===-1){this.clearInterval();return}const i=this.levels[this.currentTrackId];i!=null&&i.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,i&&this.setInterval(Li)}onSubtitleTrackLoaded(e,t){var s;const{currentTrackId:i,levels:r}=this,{details:n,id:o}=t;if(!r){this.warn(`Subtitle tracks were reset while loading level ${o}`);return}const l=r[o];if(o>=r.length||!l)return;this.log(`Subtitle track ${o} loaded [${n.startSN},${n.endSN}]${n.lastPartSn?`[part-${n.lastPartSn}-${n.lastPartIndex}]`:""},duration:${n.totalduration}`),this.mediaBuffer=this.mediaBufferTimeRanges;let c=0;if(n.live||(s=l.details)!=null&&s.live){const u=this.mainDetails;if(n.deltaUpdateFailed||!u)return;const d=u.fragments[0];if(!l.details)n.hasProgramDateTime&&u.hasProgramDateTime?(_t(n,u),c=n.fragments[0].start):d&&(c=d.start,us(n,c));else{var h;c=this.alignPlaylists(n,l.details,(h=this.levelLastLoaded)==null?void 0:h.details),c===0&&d&&(c=d.start,us(n,c))}}l.details=n,this.levelLastLoaded=l,o===i&&(!this.startFragRequested&&(this.mainDetails||!n.live)&&this.setStartPosition(this.mainDetails||n,c),this.tick(),n.live&&!this.fragCurrent&&this.media&&this.state===C.IDLE&&(Ct(null,n.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),l.details=void 0)))}_handleFragmentLoadComplete(e){const{frag:t,payload:s}=e,i=t.decryptdata,r=this.hls;if(!this.fragContextChanged(t)&&s&&s.byteLength>0&&i!=null&&i.key&&i.iv&&i.method==="AES-128"){const n=performance.now();this.decrypter.decrypt(new Uint8Array(s),i.key.buffer,i.iv.buffer).catch(o=>{throw r.trigger(p.ERROR,{type:$.MEDIA_ERROR,details:L.FRAG_DECRYPT_ERROR,fatal:!1,error:o,reason:o.message,frag:t}),o}).then(o=>{const l=performance.now();r.trigger(p.FRAG_DECRYPTED,{frag:t,payload:o,stats:{tstart:n,tdecrypt:l}})}).catch(o=>{this.warn(`${o.name}: ${o.message}`),this.state=C.IDLE})}}doTick(){if(!this.media){this.state=C.IDLE;return}if(this.state===C.IDLE){const{currentTrackId:e,levels:t}=this,s=t==null?void 0:t[e];if(!s||!t.length||!s.details)return;const{config:i}=this,r=this.getLoadPosition(),n=J.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],r,i.maxBufferHole),{end:o,len:l}=n,c=this.getFwdBufferInfo(this.media,U.MAIN),h=s.details,u=this.getMaxBufferLength(c==null?void 0:c.len)+h.levelTargetDuration;if(l>u)return;const d=h.fragments,g=d.length,f=h.edge;let m=null;const T=this.fragPrevious;if(of-E?0:E;m=Ct(T,d,Math.max(d[0].start,o),x),!m&&T&&T.start{if(i=i>>>0,i>r-1)throw new DOMException(`Failed to execute '${s}' on 'TimeRanges': The index provided (${i}) is greater than the maximum bound (${r})`);return e[i][s]};this.buffered={get length(){return e.length},end(s){return t("end",s,e.length)},start(s){return t("start",s,e.length)}}}}class Go extends Rs{constructor(e){super(e,"[subtitle-track-controller]"),this.media=null,this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.queuedDefaultTrack=-1,this.asyncPollTrackChange=()=>this.pollTrackChange(0),this.useTextTrackPolling=!1,this.subtitlePollingInterval=-1,this._subtitleDisplay=!0,this.onTextTracksChanged=()=>{if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;let t=null;const s=gt(this.media.textTracks);for(let r=0;r-1&&this.toggleTrackModes()}registerListeners(){const{hls:e}=this;e.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_PARSED,this.onManifestParsed,this),e.on(p.LEVEL_LOADING,this.onLevelLoading,this),e.on(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(p.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(p.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_PARSED,this.onManifestParsed,this),e.off(p.LEVEL_LOADING,this.onLevelLoading,this),e.off(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(p.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(p.ERROR,this.onError,this)}onMediaAttached(e,t){this.media=t.media,this.media&&(this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange))}pollTrackChange(e){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.onTextTracksChanged,e)}onMediaDetaching(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),gt(this.media.textTracks).forEach(t=>{He(t)}),this.subtitleTrack=-1,this.media=null}onManifestLoading(){this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.subtitleTracks}onSubtitleTrackLoaded(e,t){const{id:s,groupId:i,details:r}=t,n=this.tracksInGroup[s];if(!n||n.groupId!==i){this.warn(`Subtitle track with id:${s} and group:${i} not found in active group ${n==null?void 0:n.groupId}`);return}const o=n.details;n.details=t.details,this.log(`Subtitle track ${s} "${n.name}" lang:${n.lang} group:${i} loaded [${r.startSN}-${r.endSN}]`),s===this.trackId&&this.playlistLoaded(s,t,o)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const s=t.subtitleGroups||null,i=this.groupIds;let r=this.currentTrack;if(!s||(i==null?void 0:i.length)!==(s==null?void 0:s.length)||s!=null&&s.some(n=>(i==null?void 0:i.indexOf(n))===-1)){this.groupIds=s,this.trackId=-1,this.currentTrack=null;const n=this.tracks.filter(h=>!s||s.indexOf(h.groupId)!==-1);if(n.length)this.selectDefaultTrack&&!n.some(h=>h.default)&&(this.selectDefaultTrack=!1),n.forEach((h,u)=>{h.id=u});else if(!r&&!this.tracksInGroup.length)return;this.tracksInGroup=n;const o=this.hls.config.subtitlePreference;if(!r&&o){this.selectDefaultTrack=!1;const h=Le(o,n);if(h>-1)r=n[h];else{const u=Le(o,this.tracks);r=this.tracks[u]}}let l=this.findTrackId(r);l===-1&&r&&(l=this.findTrackId(null));const c={subtitleTracks:n};this.log(`Updating subtitle tracks, ${n.length} track(s) found in "${s==null?void 0:s.join(",")}" group-id`),this.hls.trigger(p.SUBTITLE_TRACKS_UPDATED,c),l!==-1&&this.trackId===-1&&this.setSubtitleTrack(l)}else this.shouldReloadPlaylist(r)&&this.setSubtitleTrack(this.trackId)}findTrackId(e){const t=this.tracksInGroup,s=this.selectDefaultTrack;for(let i=0;i-1){const r=this.tracksInGroup[i];return this.setSubtitleTrack(i),r}else{if(s)return null;{const r=Le(e,t);if(r>-1)return t[r]}}}}return null}loadPlaylist(e){super.loadPlaylist();const t=this.currentTrack;if(this.shouldLoadPlaylist(t)&&t){const s=t.id,i=t.groupId;let r=t.url;if(e)try{r=e.addDirectives(r)}catch(n){this.warn(`Could not construct new URL with HLS Delivery Directives: ${n}`)}this.log(`Loading subtitle playlist for id ${s}`),this.hls.trigger(p.SUBTITLE_TRACK_LOADING,{url:r,id:s,groupId:i,deliveryDirectives:e||null})}}toggleTrackModes(){const{media:e}=this;if(!e)return;const t=gt(e.textTracks),s=this.currentTrack;let i;if(s&&(i=t.filter(r=>gs(s,r))[0],i||this.warn(`Unable to find subtitle TextTrack with name "${s.name}" and language "${s.lang}"`)),[].slice.call(t).forEach(r=>{r.mode!=="disabled"&&r!==i&&(r.mode="disabled")}),i){const r=this.subtitleDisplay?"showing":"hidden";i.mode!==r&&(i.mode=r)}}setSubtitleTrack(e){const t=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=e;return}if(e<-1||e>=t.length||!O(e)){this.warn(`Invalid subtitle track id: ${e}`);return}this.clearTimer(),this.selectDefaultTrack=!1;const s=this.currentTrack,i=t[e]||null;if(this.trackId=e,this.currentTrack=i,this.toggleTrackModes(),!i){this.hls.trigger(p.SUBTITLE_TRACK_SWITCH,{id:e});return}const r=!!i.details&&!i.details.live;if(e===this.trackId&&i===s&&r)return;this.log(`Switching to subtitle-track ${e}`+(i?` "${i.name}" lang:${i.lang} group:${i.groupId}`:""));const{id:n,groupId:o="",name:l,type:c,url:h}=i;this.hls.trigger(p.SUBTITLE_TRACK_SWITCH,{id:n,groupId:o,name:l,type:c,url:h});const u=this.switchParams(i.url,s==null?void 0:s.details,i.details);this.loadPlaylist(u)}}class Ko{constructor(e){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=e}append(e,t,s){const i=this.queues[t];i.push(e),i.length===1&&!s&&this.executeNext(t)}insertAbort(e,t){this.queues[t].unshift(e),this.executeNext(t)}appendBlocker(e){let t;const s=new Promise(r=>{t=r}),i={execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};return this.append(i,e),s}executeNext(e){const t=this.queues[e];if(t.length){const s=t[0];try{s.execute()}catch(i){v.warn(`[buffer-operation-queue]: Exception executing "${e}" SourceBuffer operation: ${i}`),s.onError(i);const r=this.buffers[e];r!=null&&r.updating||this.shiftAndExecuteNext(e)}}}shiftAndExecuteNext(e){this.queues[e].shift(),this.executeNext(e)}current(e){return this.queues[e][0]}}const Ri=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/;class Vo{constructor(e){this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.lastMpegAudioChunk=null,this.appendSource=void 0,this.appendErrors={audio:0,video:0,audiovideo:0},this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this.log=void 0,this.warn=void 0,this.error=void 0,this._onEndStreaming=s=>{this.hls&&this.hls.pauseBuffering()},this._onStartStreaming=s=>{this.hls&&this.hls.resumeBuffering()},this._onMediaSourceOpen=()=>{const{media:s,mediaSource:i}=this;this.log("Media source opened"),s&&(s.removeEventListener("emptied",this._onMediaEmptied),this.updateMediaElementDuration(),this.hls.trigger(p.MEDIA_ATTACHED,{media:s,mediaSource:i})),i&&i.removeEventListener("sourceopen",this._onMediaSourceOpen),this.checkPendingTracks()},this._onMediaSourceClose=()=>{this.log("Media source closed")},this._onMediaSourceEnded=()=>{this.log("Media source ended")},this._onMediaEmptied=()=>{const{mediaSrc:s,_objectUrl:i}=this;s!==i&&v.error(`Media element src was set while attaching MediaSource (${i} > ${s})`)},this.hls=e;const t="[buffer-controller]";this.appendSource=Qn(Ue(e.config.preferManagedMediaSource)),this.log=v.log.bind(v,t),this.warn=v.warn.bind(v,t),this.error=v.error.bind(v,t),this._initSourceBuffer(),this.registerListeners()}hasSourceTypes(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0}destroy(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=null,this.hls=null}registerListeners(){const{hls:e}=this;e.on(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_PARSED,this.onManifestParsed,this),e.on(p.BUFFER_RESET,this.onBufferReset,this),e.on(p.BUFFER_APPENDING,this.onBufferAppending,this),e.on(p.BUFFER_CODECS,this.onBufferCodecs,this),e.on(p.BUFFER_EOS,this.onBufferEos,this),e.on(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(p.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(p.FRAG_PARSED,this.onFragParsed,this),e.on(p.FRAG_CHANGED,this.onFragChanged,this)}unregisterListeners(){const{hls:e}=this;e.off(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_PARSED,this.onManifestParsed,this),e.off(p.BUFFER_RESET,this.onBufferReset,this),e.off(p.BUFFER_APPENDING,this.onBufferAppending,this),e.off(p.BUFFER_CODECS,this.onBufferCodecs,this),e.off(p.BUFFER_EOS,this.onBufferEos,this),e.off(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(p.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(p.FRAG_PARSED,this.onFragParsed,this),e.off(p.FRAG_CHANGED,this.onFragChanged,this)}_initSourceBuffer(){this.sourceBuffer={},this.operationQueue=new Ko(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]},this.appendErrors={audio:0,video:0,audiovideo:0},this.lastMpegAudioChunk=null}onManifestLoading(){this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=0,this.details=null}onManifestParsed(e,t){let s=2;(t.audio&&!t.video||!t.altAudio)&&(s=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=s,this.log(`${this.bufferCodecEventsExpected} bufferCodec event(s) expected`)}onMediaAttaching(e,t){const s=this.media=t.media,i=Ue(this.appendSource);if(s&&i){var r;const n=this.mediaSource=new i;this.log(`created media source: ${(r=n.constructor)==null?void 0:r.name}`),n.addEventListener("sourceopen",this._onMediaSourceOpen),n.addEventListener("sourceended",this._onMediaSourceEnded),n.addEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(n.addEventListener("startstreaming",this._onStartStreaming),n.addEventListener("endstreaming",this._onEndStreaming));const o=this._objectUrl=self.URL.createObjectURL(n);if(this.appendSource)try{s.removeAttribute("src");const l=self.ManagedMediaSource;s.disableRemotePlayback=s.disableRemotePlayback||l&&n instanceof l,Ii(s),Ho(s,o),s.load()}catch{s.src=o}else s.src=o;s.addEventListener("emptied",this._onMediaEmptied)}}onMediaDetaching(){const{media:e,mediaSource:t,_objectUrl:s}=this;if(t){if(this.log("media source detaching"),t.readyState==="open")try{t.endOfStream()}catch(i){this.warn(`onMediaDetaching: ${i.message} while calling endOfStream`)}this.onBufferReset(),t.removeEventListener("sourceopen",this._onMediaSourceOpen),t.removeEventListener("sourceended",this._onMediaSourceEnded),t.removeEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(t.removeEventListener("startstreaming",this._onStartStreaming),t.removeEventListener("endstreaming",this._onEndStreaming)),e&&(e.removeEventListener("emptied",this._onMediaEmptied),s&&self.URL.revokeObjectURL(s),this.mediaSrc===s?(e.removeAttribute("src"),this.appendSource&&Ii(e),e.load()):this.warn("media|source.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(p.MEDIA_DETACHED,void 0)}onBufferReset(){this.getSourceBufferTypes().forEach(e=>{this.resetBuffer(e)}),this._initSourceBuffer()}resetBuffer(e){const t=this.sourceBuffer[e];try{if(t){var s;this.removeBufferListeners(e),this.sourceBuffer[e]=void 0,(s=this.mediaSource)!=null&&s.sourceBuffers.length&&this.mediaSource.removeSourceBuffer(t)}}catch(i){this.warn(`onBufferReset ${e}`,i)}}onBufferCodecs(e,t){const s=this.getSourceBufferTypes().length,i=Object.keys(t);if(i.forEach(n=>{if(s){const l=this.tracks[n];if(l&&typeof l.buffer.changeType=="function"){var o;const{id:c,codec:h,levelCodec:u,container:d,metadata:g}=t[n],f=qs(l.codec,l.levelCodec),m=f==null?void 0:f.replace(Ri,"$1");let T=qs(h,u);const E=(o=T)==null?void 0:o.replace(Ri,"$1");if(T&&m!==E){n.slice(0,5)==="audio"&&(T=Rt(T,this.appendSource));const x=`${d};codecs=${T}`;this.appendChangeType(n,x),this.log(`switching codec ${f} to ${T}`),this.tracks[n]={buffer:l.buffer,codec:h,container:d,levelCodec:u,metadata:g,id:c}}}}else this.pendingTracks[n]=t[n]}),s)return;const r=Math.max(this.bufferCodecEventsExpected-1,0);this.bufferCodecEventsExpected!==r&&(this.log(`${r} bufferCodec event(s) expected ${i.join(",")}`),this.bufferCodecEventsExpected=r),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()}appendChangeType(e,t){const{operationQueue:s}=this,i={execute:()=>{const r=this.sourceBuffer[e];r&&(this.log(`changing ${e} sourceBuffer type to ${t}`),r.changeType(t)),s.shiftAndExecuteNext(e)},onStart:()=>{},onComplete:()=>{},onError:r=>{this.warn(`Failed to change ${e} SourceBuffer type`,r)}};s.append(i,e,!!this.pendingTracks[e])}onBufferAppending(e,t){const{hls:s,operationQueue:i,tracks:r}=this,{data:n,type:o,frag:l,part:c,chunkMeta:h}=t,u=h.buffering[o],d=self.performance.now();u.start=d;const g=l.stats.buffering,f=c?c.stats.buffering:null;g.start===0&&(g.start=d),f&&f.start===0&&(f.start=d);const m=r.audio;let T=!1;o==="audio"&&(m==null?void 0:m.container)==="audio/mpeg"&&(T=!this.lastMpegAudioChunk||h.id===1||this.lastMpegAudioChunk.sn!==h.sn,this.lastMpegAudioChunk=h);const E=l.start,x={execute:()=>{if(u.executeStart=self.performance.now(),T){const y=this.sourceBuffer[o];if(y){const I=E-y.timestampOffset;Math.abs(I)>=.1&&(this.log(`Updating audio SourceBuffer timestampOffset to ${E} (delta: ${I}) sn: ${l.sn})`),y.timestampOffset=E)}}this.appendExecutor(n,o)},onStart:()=>{},onComplete:()=>{const y=self.performance.now();u.executeEnd=u.end=y,g.first===0&&(g.first=y),f&&f.first===0&&(f.first=y);const{sourceBuffer:I}=this,S={};for(const D in I)S[D]=J.getBuffered(I[D]);this.appendErrors[o]=0,o==="audio"||o==="video"?this.appendErrors.audiovideo=0:(this.appendErrors.audio=0,this.appendErrors.video=0),this.hls.trigger(p.BUFFER_APPENDED,{type:o,frag:l,part:c,chunkMeta:h,parent:l.type,timeRanges:S})},onError:y=>{const I={type:$.MEDIA_ERROR,parent:l.type,details:L.BUFFER_APPEND_ERROR,sourceBufferName:o,frag:l,part:c,chunkMeta:h,error:y,err:y,fatal:!1};if(y.code===DOMException.QUOTA_EXCEEDED_ERR)I.details=L.BUFFER_FULL_ERROR;else{const S=++this.appendErrors[o];I.details=L.BUFFER_APPEND_ERROR,this.warn(`Failed ${S}/${s.config.appendErrorMaxRetry} times to append segment in "${o}" sourceBuffer`),S>=s.config.appendErrorMaxRetry&&(I.fatal=!0)}s.trigger(p.ERROR,I)}};i.append(x,o,!!this.pendingTracks[o])}onBufferFlushing(e,t){const{operationQueue:s}=this,i=r=>({execute:this.removeExecutor.bind(this,r,t.startOffset,t.endOffset),onStart:()=>{},onComplete:()=>{this.hls.trigger(p.BUFFER_FLUSHED,{type:r})},onError:n=>{this.warn(`Failed to remove from ${r} SourceBuffer`,n)}});t.type?s.append(i(t.type),t.type):this.getSourceBufferTypes().forEach(r=>{s.append(i(r),r)})}onFragParsed(e,t){const{frag:s,part:i}=t,r=[],n=i?i.elementaryStreams:s.elementaryStreams;n[X.AUDIOVIDEO]?r.push("audiovideo"):(n[X.AUDIO]&&r.push("audio"),n[X.VIDEO]&&r.push("video"));const o=()=>{const l=self.performance.now();s.stats.buffering.end=l,i&&(i.stats.buffering.end=l);const c=i?i.stats:s.stats;this.hls.trigger(p.FRAG_BUFFERED,{frag:s,part:i,stats:c,id:s.type})};r.length===0&&this.warn(`Fragments must have at least one ElementaryStreamType set. type: ${s.type} level: ${s.level} sn: ${s.sn}`),this.blockBuffers(o,r)}onFragChanged(e,t){this.trimBuffers()}onBufferEos(e,t){this.getSourceBufferTypes().reduce((i,r)=>{const n=this.sourceBuffer[r];return n&&(!t.type||t.type===r)&&(n.ending=!0,n.ended||(n.ended=!0,this.log(`${r} sourceBuffer now EOS`))),i&&!!(!n||n.ended)},!0)&&(this.log("Queueing mediaSource.endOfStream()"),this.blockBuffers(()=>{this.getSourceBufferTypes().forEach(r=>{const n=this.sourceBuffer[r];n&&(n.ending=!1)});const{mediaSource:i}=this;if(!i||i.readyState!=="open"){i&&this.log(`Could not call mediaSource.endOfStream(). mediaSource.readyState: ${i.readyState}`);return}this.log("Calling mediaSource.endOfStream()"),i.endOfStream()}))}onLevelUpdated(e,{details:t}){t.fragments.length&&(this.details=t,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration())}trimBuffers(){const{hls:e,details:t,media:s}=this;if(!s||t===null||!this.getSourceBufferTypes().length)return;const r=e.config,n=s.currentTime,o=t.levelTargetDuration,l=t.live&&r.liveBackBufferLength!==null?r.liveBackBufferLength:r.backBufferLength;if(O(l)&&l>0){const c=Math.max(l,o),h=Math.floor(n/o)*o-c;this.flushBackBuffer(n,o,h)}if(O(r.frontBufferFlushThreshold)&&r.frontBufferFlushThreshold>0){const c=Math.max(r.maxBufferLength,r.frontBufferFlushThreshold),h=Math.max(c,o),u=Math.floor(n/o)*o+h;this.flushFrontBuffer(n,o,u)}}flushBackBuffer(e,t,s){const{details:i,sourceBuffer:r}=this;this.getSourceBufferTypes().forEach(o=>{const l=r[o];if(l){const c=J.getBuffered(l);if(c.length>0&&s>c.start(0)){if(this.hls.trigger(p.BACK_BUFFER_REACHED,{bufferEnd:s}),i!=null&&i.live)this.hls.trigger(p.LIVE_BACK_BUFFER_REACHED,{bufferEnd:s});else if(l.ended&&c.end(c.length-1)-e{const o=i[n];if(o){const l=J.getBuffered(o),c=l.length;if(c<2)return;const h=l.start(c-1),u=l.end(c-1);if(s>h||e>=h&&e<=u)return;if(o.ended&&e-u<2*t){this.log(`Cannot flush ${n} front buffer while SourceBuffer is in ended state`);return}this.hls.trigger(p.BUFFER_FLUSHING,{startOffset:h,endOffset:1/0,type:n})}})}updateMediaElementDuration(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;const{details:e,hls:t,media:s,mediaSource:i}=this,r=e.fragments[0].start+e.totalduration,n=s.duration,o=O(i.duration)?i.duration:0;e.live&&t.config.liveDurationInfinity?(i.duration=1/0,this.updateSeekableRange(e)):(r>o&&r>n||!O(n))&&(this.log(`Updating Media Source duration to ${r.toFixed(3)}`),i.duration=r)}updateSeekableRange(e){const t=this.mediaSource,s=e.fragments;if(s.length&&e.live&&t!=null&&t.setLiveSeekableRange){const r=Math.max(0,s[0].start),n=Math.max(r,r+e.totalduration);this.log(`Media Source duration is set to ${t.duration}. Setting seekable range to ${r}-${n}.`),t.setLiveSeekableRange(r,n)}}checkPendingTracks(){const{bufferCodecEventsExpected:e,operationQueue:t,pendingTracks:s}=this,i=Object.keys(s).length;if(i&&(!e||i===2||"audiovideo"in s)){this.createSourceBuffers(s),this.pendingTracks={};const r=this.getSourceBufferTypes();if(r.length)this.hls.trigger(p.BUFFER_CREATED,{tracks:this.tracks}),r.forEach(n=>{t.executeNext(n)});else{const n=new Error("could not create source buffer for media codec(s)");this.hls.trigger(p.ERROR,{type:$.MEDIA_ERROR,details:L.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:n,reason:n.message})}}}createSourceBuffers(e){const{sourceBuffer:t,mediaSource:s}=this;if(!s)throw Error("createSourceBuffers called when mediaSource was null");for(const r in e)if(!t[r]){var i;const n=e[r];if(!n)throw Error(`source buffer exists for track ${r}, however track does not`);let o=((i=n.levelCodec)==null?void 0:i.indexOf(","))===-1?n.levelCodec:n.codec;o&&r.slice(0,5)==="audio"&&(o=Rt(o,this.appendSource));const l=`${n.container};codecs=${o}`;this.log(`creating sourceBuffer(${l})`);try{const c=t[r]=s.addSourceBuffer(l),h=r;this.addBufferListener(h,"updatestart",this._onSBUpdateStart),this.addBufferListener(h,"updateend",this._onSBUpdateEnd),this.addBufferListener(h,"error",this._onSBUpdateError),this.appendSource&&this.addBufferListener(h,"bufferedchange",(u,d)=>{const g=d.removedRanges;g!=null&&g.length&&this.hls.trigger(p.BUFFER_FLUSHED,{type:r})}),this.tracks[r]={buffer:c,codec:o,container:n.container,levelCodec:n.levelCodec,metadata:n.metadata,id:n.id}}catch(c){this.error(`error while trying to add sourceBuffer: ${c.message}`),this.hls.trigger(p.ERROR,{type:$.MEDIA_ERROR,details:L.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:c,sourceBufferName:r,mimeType:l})}}}get mediaSrc(){var e,t;const s=((e=this.media)==null||(t=e.querySelector)==null?void 0:t.call(e,"source"))||this.media;return s==null?void 0:s.src}_onSBUpdateStart(e){const{operationQueue:t}=this;t.current(e).onStart()}_onSBUpdateEnd(e){var t;if(((t=this.mediaSource)==null?void 0:t.readyState)==="closed"){this.resetBuffer(e);return}const{operationQueue:s}=this;s.current(e).onComplete(),s.shiftAndExecuteNext(e)}_onSBUpdateError(e,t){var s;const i=new Error(`${e} SourceBuffer error. MediaSource readyState: ${(s=this.mediaSource)==null?void 0:s.readyState}`);this.error(`${i}`,t),this.hls.trigger(p.ERROR,{type:$.MEDIA_ERROR,details:L.BUFFER_APPENDING_ERROR,sourceBufferName:e,error:i,fatal:!1});const r=this.operationQueue.current(e);r&&r.onError(i)}removeExecutor(e,t,s){const{media:i,mediaSource:r,operationQueue:n,sourceBuffer:o}=this,l=o[e];if(!i||!r||!l){this.warn(`Attempting to remove from the ${e} SourceBuffer, but it does not exist`),n.shiftAndExecuteNext(e);return}const c=O(i.duration)?i.duration:1/0,h=O(r.duration)?r.duration:1/0,u=Math.max(0,t),d=Math.min(s,c,h);d>u&&(!l.ending||l.ended)?(l.ended=!1,this.log(`Removing [${u},${d}] from the ${e} SourceBuffer`),l.remove(u,d)):n.shiftAndExecuteNext(e)}appendExecutor(e,t){const s=this.sourceBuffer[t];if(!s){if(!this.pendingTracks[t])throw new Error(`Attempting to append to the ${t} SourceBuffer, but it does not exist`);return}s.ended=!1,s.appendBuffer(e)}blockBuffers(e,t=this.getSourceBufferTypes()){if(!t.length){this.log("Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(e);return}const{operationQueue:s}=this,i=t.map(r=>s.appendBlocker(r));Promise.all(i).then(()=>{e(),t.forEach(r=>{const n=this.sourceBuffer[r];n!=null&&n.updating||s.shiftAndExecuteNext(r)})})}getSourceBufferTypes(){return Object.keys(this.sourceBuffer)}addBufferListener(e,t,s){const i=this.sourceBuffer[e];if(!i)return;const r=s.bind(this,e);this.listeners[e].push({event:t,listener:r}),i.addEventListener(t,r)}removeBufferListeners(e){const t=this.sourceBuffer[e];t&&this.listeners[e].forEach(s=>{t.removeEventListener(s.event,s.listener)})}}function Ii(a){const e=a.querySelectorAll("source");[].slice.call(e).forEach(t=>{a.removeChild(t)})}function Ho(a,e){const t=self.document.createElement("source");t.type="video/mp4",t.src=e,a.appendChild(t)}const Wo={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},_r=a=>String.fromCharCode(Wo[a]||a),Ee=15,De=100,Yo={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},qo={17:2,18:4,21:6,22:8,23:10,19:13,20:15},jo={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},zo={25:2,26:4,29:6,30:8,31:10,27:13,28:15},Xo=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class Qo{constructor(){this.time=null,this.verboseLevel=0}log(e,t){if(this.verboseLevel>=e){const s=typeof t=="function"?t():t;v.log(`${this.time} [${e}] ${s}`)}}}const Fe=function(e){const t=[];for(let s=0;sDe&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=De)}moveCursor(e){const t=this.pos+e;if(e>1)for(let s=this.pos+1;s=144&&this.backSpace();const t=_r(e);if(this.pos>=De){this.logger.log(0,()=>"Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1)}clearFromPos(e){let t;for(t=e;t"pacData = "+JSON.stringify(e));let t=e.row-1;if(this.nrRollUpRows&&t"bkgData = "+JSON.stringify(e)),this.backSpace(),this.setPen(e),this.insertChar(32)}setRollUpRows(e){this.nrRollUpRows=e}rollUp(){if(this.nrRollUpRows===null){this.logger.log(3,"roll_up but nrRollUpRows not set yet");return}this.logger.log(1,()=>this.getDisplayText());const e=this.currRow+1-this.nrRollUpRows,t=this.rows.splice(e,1)[0];t.clear(),this.rows.splice(this.currRow,0,t),this.logger.log(2,"Rolling up")}getDisplayText(e){e=e||!1;const t=[];let s="",i=-1;for(let r=0;r0&&(e?s="["+t.join(" | ")+"]":s=t.join(` +`)),s}getTextAndFormat(){return this.rows}}class bi{constructor(e,t,s){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=e,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new Qt(s),this.nonDisplayedMemory=new Qt(s),this.lastOutputScreen=new Qt(s),this.currRollUpRow=this.displayedMemory.rows[Ee-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=s}reset(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[Ee-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}getHandler(){return this.outputFilter}setHandler(e){this.outputFilter=e}setPAC(e){this.writeScreen.setPAC(e)}setBkgData(e){this.writeScreen.setBkgData(e)}setMode(e){e!==this.mode&&(this.mode=e,this.logger.log(2,()=>"MODE="+e),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)}insertChars(e){for(let s=0;st+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(1,()=>"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())}ccRCL(){this.logger.log(2,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")}ccBS(){this.logger.log(2,"BS - BackSpace"),this.mode!=="MODE_TEXT"&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())}ccAOF(){}ccAON(){}ccDER(){this.logger.log(2,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()}ccRU(e){this.logger.log(2,"RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)}ccFON(){this.logger.log(2,"FON - Flash On"),this.writeScreen.setPen({flash:!0})}ccRDC(){this.logger.log(2,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")}ccTR(){this.logger.log(2,"TR"),this.setMode("MODE_TEXT")}ccRTD(){this.logger.log(2,"RTD"),this.setMode("MODE_TEXT")}ccEDM(){this.logger.log(2,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)}ccCR(){this.logger.log(2,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)}ccENM(){this.logger.log(2,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()}ccEOC(){if(this.logger.log(2,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){const e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,this.logger.log(1,()=>"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)}ccTO(e){this.logger.log(2,"TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)}ccMIDROW(e){const t={flash:!1};if(t.underline=e%2===1,t.italics=e>=46,t.italics)t.foreground="white";else{const s=Math.floor(e/2)-16,i=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=i[s]}this.logger.log(2,"MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)}outputDataUpdate(e=!1){const t=this.logger.time;t!==null&&this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=t:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,t,this.lastOutputScreen),e&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:t),this.lastOutputScreen.copy(this.displayedMemory))}cueSplitAtTime(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}}class Di{constructor(e,t,s){this.channels=void 0,this.currentChannel=0,this.cmdHistory=tl(),this.logger=void 0;const i=this.logger=new Qo;this.channels=[null,new bi(e,t,i),new bi(e+1,s,i)]}getHandler(e){return this.channels[e].getHandler()}setHandler(e,t){this.channels[e].setHandler(t)}addData(e,t){this.logger.time=e;for(let s=0;s"["+Fe([t[s],t[s+1]])+"] -> ("+Fe([i,r])+")");const l=this.cmdHistory;if(i>=16&&i<=31){if(el(i,r,l)){ct(null,null,l),this.logger.log(3,()=>"Repeated command ("+Fe([i,r])+") is dropped");continue}ct(i,r,this.cmdHistory),n=this.parseCmd(i,r),n||(n=this.parseMidrow(i,r)),n||(n=this.parsePAC(i,r)),n||(n=this.parseBackgroundAttributes(i,r))}else ct(null,null,l);if(!n&&(o=this.parseChars(i,r),o)){const h=this.currentChannel;h&&h>0?this.channels[h].insertChars(o):this.logger.log(2,"No channel found yet. TEXT-MODE?")}!n&&!o&&this.logger.log(2,()=>"Couldn't parse cleaned data "+Fe([i,r])+" orig: "+Fe([t[s],t[s+1]]))}}parseCmd(e,t){const s=(e===20||e===28||e===21||e===29)&&t>=32&&t<=47,i=(e===23||e===31)&&t>=33&&t<=35;if(!(s||i))return!1;const r=e===20||e===21||e===23?1:2,n=this.channels[r];return e===20||e===21||e===28||e===29?t===32?n.ccRCL():t===33?n.ccBS():t===34?n.ccAOF():t===35?n.ccAON():t===36?n.ccDER():t===37?n.ccRU(2):t===38?n.ccRU(3):t===39?n.ccRU(4):t===40?n.ccFON():t===41?n.ccRDC():t===42?n.ccTR():t===43?n.ccRTD():t===44?n.ccEDM():t===45?n.ccCR():t===46?n.ccENM():t===47&&n.ccEOC():n.ccTO(t-32),this.currentChannel=r,!0}parseMidrow(e,t){let s=0;if((e===17||e===25)&&t>=32&&t<=47){if(e===17?s=1:s=2,s!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;const i=this.channels[s];return i?(i.ccMIDROW(t),this.logger.log(3,()=>"MIDROW ("+Fe([e,t])+")"),!0):!1}return!1}parsePAC(e,t){let s;const i=(e>=17&&e<=23||e>=25&&e<=31)&&t>=64&&t<=127,r=(e===16||e===24)&&t>=64&&t<=95;if(!(i||r))return!1;const n=e<=23?1:2;t>=64&&t<=95?s=n===1?Yo[e]:jo[e]:s=n===1?qo[e]:zo[e];const o=this.channels[n];return o?(o.setPAC(this.interpretPAC(s,t)),this.currentChannel=n,!0):!1}interpretPAC(e,t){let s;const i={color:null,italics:!1,indent:null,underline:!1,row:e};return t>95?s=t-96:s=t-64,i.underline=(s&1)===1,s<=13?i.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(s/2)]:s<=15?(i.italics=!0,i.color="white"):i.indent=Math.floor((s-16)/2)*4,i}parseChars(e,t){let s,i=null,r=null;if(e>=25?(s=2,r=e-8):(s=1,r=e),r>=17&&r<=19){let n;r===17?n=t+80:r===18?n=t+112:n=t+144,this.logger.log(2,()=>"Special char '"+_r(n)+"' in channel "+s),i=[n]}else e>=32&&e<=127&&(i=t===0?[e]:[e,t]);return i&&this.logger.log(3,()=>"Char codes = "+Fe(i).join(",")),i}parseBackgroundAttributes(e,t){const s=(e===16||e===24)&&t>=32&&t<=47,i=(e===23||e===31)&&t>=45&&t<=47;if(!(s||i))return!1;let r;const n={};e===16||e===24?(r=Math.floor((t-32)/2),n.background=Xo[r],t%2===1&&(n.background=n.background+"_semi")):t===45?n.background="transparent":(n.foreground="black",t===47&&(n.underline=!0));const o=e<=23?1:2;return this.channels[o].setBkgData(n),!0}reset(){for(let e=0;ee)&&(this.startTime=e),this.endTime=t,this.screen=s,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}}var Fs=function(){if(qe!=null&&qe.VTTCue)return self.VTTCue;const a=["","lr","rl"],e=["start","middle","end","left","right"];function t(o,l){if(typeof l!="string"||!Array.isArray(o))return!1;const c=l.toLowerCase();return~o.indexOf(c)?c:!1}function s(o){return t(a,o)}function i(o){return t(e,o)}function r(o,...l){let c=1;for(;c100)throw new Error("Position must be between 0 and 100.");D=b,this.hasBeenReset=!0}})),Object.defineProperty(h,"positionAlign",r({},u,{get:function(){return R},set:function(b){const w=i(b);if(!w)throw new SyntaxError("An invalid or illegal string was specified.");R=w,this.hasBeenReset=!0}})),Object.defineProperty(h,"size",r({},u,{get:function(){return _},set:function(b){if(b<0||b>100)throw new Error("Size must be between 0 and 100.");_=b,this.hasBeenReset=!0}})),Object.defineProperty(h,"align",r({},u,{get:function(){return k},set:function(b){const w=i(b);if(!w)throw new SyntaxError("An invalid or illegal string was specified.");k=w,this.hasBeenReset=!0}})),h.displayState=void 0}return n.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},n}();class sl{decode(e,t){if(!e)return"";if(typeof e!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}function kr(a){function e(s,i,r,n){return(s|0)*3600+(i|0)*60+(r|0)+parseFloat(n||0)}const t=a.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return t?parseFloat(t[2])>59?e(t[2],t[3],0,t[4]):e(t[1],t[2],t[3],t[4]):null}class il{constructor(){this.values=Object.create(null)}set(e,t){!this.get(e)&&t!==""&&(this.values[e]=t)}get(e,t,s){return s?this.has(e)?this.values[e]:t[s]:this.has(e)?this.values[e]:t}has(e){return e in this.values}alt(e,t,s){for(let i=0;i=0&&s<=100)return this.set(e,s),!0}return!1}}function Pr(a,e,t,s){const i=s?a.split(s):[a];for(const r in i){if(typeof i[r]!="string")continue;const n=i[r].split(t);if(n.length!==2)continue;const o=n[0],l=n[1];e(o,l)}}const ms=new Fs(0,0,""),ut=ms.align==="middle"?"middle":"center";function rl(a,e,t){const s=a;function i(){const o=kr(a);if(o===null)throw new Error("Malformed timestamp: "+s);return a=a.replace(/^[^\sa-zA-Z-]+/,""),o}function r(o,l){const c=new il;Pr(o,function(d,g){let f;switch(d){case"region":for(let m=t.length-1;m>=0;m--)if(t[m].id===g){c.set(d,t[m].region);break}break;case"vertical":c.alt(d,g,["rl","lr"]);break;case"line":f=g.split(","),c.integer(d,f[0]),c.percent(d,f[0])&&c.set("snapToLines",!1),c.alt(d,f[0],["auto"]),f.length===2&&c.alt("lineAlign",f[1],["start",ut,"end"]);break;case"position":f=g.split(","),c.percent(d,f[0]),f.length===2&&c.alt("positionAlign",f[1],["start",ut,"end","line-left","line-right","auto"]);break;case"size":c.percent(d,g);break;case"align":c.alt(d,g,["start",ut,"end","left","right"]);break}},/:/,/\s/),l.region=c.get("region",null),l.vertical=c.get("vertical","");let h=c.get("line","auto");h==="auto"&&ms.line===-1&&(h=-1),l.line=h,l.lineAlign=c.get("lineAlign","start"),l.snapToLines=c.get("snapToLines",!0),l.size=c.get("size",100),l.align=c.get("align",ut);let u=c.get("position","auto");u==="auto"&&ms.position===50&&(u=l.align==="start"||l.align==="left"?0:l.align==="end"||l.align==="right"?100:50),l.position=u}function n(){a=a.replace(/^\s+/,"")}if(n(),e.startTime=i(),n(),a.slice(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+s);a=a.slice(3),n(),e.endTime=i(),n(),r(a,e)}function Fr(a){return a.replace(//gi,` +`)}class nl{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new sl,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}parse(e){const t=this;e&&(t.buffer+=t.decoder.decode(e,{stream:!0}));function s(){let r=t.buffer,n=0;for(r=Fr(r);n")===-1){t.cue.id=r;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{rl(r,t.cue,t.regionList)}catch{t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":{const o=r.indexOf("-->")!==-1;if(!r||o&&(n=!0)){t.oncue&&t.cue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}if(t.cue===null)continue;t.cue.text&&(t.cue.text+=` +`),t.cue.text+=r}continue;case"BADCUE":r||(t.state="ID")}}}catch{t.state==="CUETEXT"&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state=t.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this}flush(){const e=this;try{if((e.cue||e.state==="HEADER")&&(e.buffer+=` + +`,e.parse()),e.state==="INITIAL"||e.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(t){e.onparsingerror&&e.onparsingerror(t)}return e.onflush&&e.onflush(),this}}const al=/\r\n|\n\r|\n|\r/g,Jt=function(e,t,s=0){return e.slice(s,s+t.length)===t},ol=function(e){let t=parseInt(e.slice(-3));const s=parseInt(e.slice(-6,-4)),i=parseInt(e.slice(-9,-7)),r=e.length>9?parseInt(e.substring(0,e.indexOf(":"))):0;if(!O(t)||!O(s)||!O(i)||!O(r))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${e}`);return t+=1e3*s,t+=60*1e3*i,t+=60*60*1e3*r,t},Zt=function(e){let t=5381,s=e.length;for(;s;)t=t*33^e.charCodeAt(--s);return(t>>>0).toString()};function Os(a,e,t){return Zt(a.toString())+Zt(e.toString())+Zt(t)}const ll=function(e,t,s){let i=e[t],r=e[i.prevCC];if(!r||!r.new&&i.new){e.ccOffset=e.presentationOffset=i.start,i.new=!1;return}for(;(n=r)!=null&&n.new;){var n;e.ccOffset+=i.start-r.start,i.new=!1,i=r,r=e[i.prevCC]}e.presentationOffset=s};function cl(a,e,t,s,i,r,n){const o=new nl,l=Re(new Uint8Array(a)).trim().replace(al,` +`).split(` +`),c=[],h=e?Io(e.baseTime,e.timescale):0;let u="00:00.000",d=0,g=0,f,m=!0;o.oncue=function(T){const E=t[s];let x=t.ccOffset;const y=(d-h)/9e4;if(E!=null&&E.new&&(g!==void 0?x=t.ccOffset=E.start:ll(t,s,y)),y){if(!e){f=new Error("Missing initPTS for VTT MPEGTS");return}x=y-t.presentationOffset}const I=T.endTime-T.startTime,S=me((T.startTime+x-g)*9e4,i*9e4)/9e4;T.startTime=Math.max(S,0),T.endTime=Math.max(S+I,0);const D=T.text.trim();T.text=decodeURIComponent(encodeURIComponent(D)),T.id||(T.id=Os(T.startTime,T.endTime,D)),T.endTime>0&&c.push(T)},o.onparsingerror=function(T){f=T},o.onflush=function(){if(f){n(f);return}r(c)},l.forEach(T=>{if(m)if(Jt(T,"X-TIMESTAMP-MAP=")){m=!1,T.slice(16).split(",").forEach(E=>{Jt(E,"LOCAL:")?u=E.slice(6):Jt(E,"MPEGTS:")&&(d=parseInt(E.slice(7)))});try{g=ol(u)/1e3}catch(E){f=E}return}else T===""&&(m=!1);o.parse(T+` +`)}),o.flush()}const es="stpp.ttml.im1t",Or=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,Mr=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,hl={left:"start",center:"center",right:"end",start:"start",end:"end"};function Ci(a,e,t,s){const i=H(new Uint8Array(a),["mdat"]);if(i.length===0){s(new Error("Could not parse IMSC1 mdat"));return}const r=i.map(o=>Re(o)),n=Ro(e.baseTime,1,e.timescale);try{r.forEach(o=>t(ul(o,n)))}catch(o){s(o)}}function ul(a,e){const i=new DOMParser().parseFromString(a,"text/xml").getElementsByTagName("tt")[0];if(!i)throw new Error("Invalid ttml");const r={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},n=Object.keys(r).reduce((u,d)=>(u[d]=i.getAttribute(`ttp:${d}`)||r[d],u),{}),o=i.getAttribute("xml:space")!=="preserve",l=_i(ts(i,"styling","style")),c=_i(ts(i,"layout","region")),h=ts(i,"body","[begin]");return[].map.call(h,u=>{const d=Nr(u,o);if(!d||!u.hasAttribute("begin"))return null;const g=is(u.getAttribute("begin"),n),f=is(u.getAttribute("dur"),n);let m=is(u.getAttribute("end"),n);if(g===null)throw wi(u);if(m===null){if(f===null)throw wi(u);m=g+f}const T=new Fs(g-e,m-e,d);T.id=Os(T.startTime,T.endTime,T.text);const E=c[u.getAttribute("region")],x=l[u.getAttribute("style")],y=dl(E,x,l),{textAlign:I}=y;if(I){const S=hl[I];S&&(T.lineAlign=S),T.align=I}return se(T,y),T}).filter(u=>u!==null)}function ts(a,e,t){const s=a.getElementsByTagName(e)[0];return s?[].slice.call(s.querySelectorAll(t)):[]}function _i(a){return a.reduce((e,t)=>{const s=t.getAttribute("xml:id");return s&&(e[s]=t),e},{})}function Nr(a,e){return[].slice.call(a.childNodes).reduce((t,s,i)=>{var r;return s.nodeName==="br"&&i?t+` +`:(r=s.childNodes)!=null&&r.length?Nr(s,e):e?t+s.textContent.trim().replace(/\s+/g," "):t+s.textContent},"")}function dl(a,e,t){const s="http://www.w3.org/ns/ttml#styling";let i=null;const r=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],n=a!=null&&a.hasAttribute("style")?a.getAttribute("style"):null;return n&&t.hasOwnProperty(n)&&(i=t[n]),r.reduce((o,l)=>{const c=ss(e,s,l)||ss(a,s,l)||ss(i,s,l);return c&&(o[l]=c),o},{})}function ss(a,e,t){return a&&a.hasAttributeNS(e,t)?a.getAttributeNS(e,t):null}function wi(a){return new Error(`Could not parse ttml timestamp ${a}`)}function is(a,e){if(!a)return null;let t=kr(a);return t===null&&(Or.test(a)?t=fl(a,e):Mr.test(a)&&(t=gl(a,e))),t}function fl(a,e){const t=Or.exec(a),s=(t[4]|0)+(t[5]|0)/e.subFrameRate;return(t[1]|0)*3600+(t[2]|0)*60+(t[3]|0)+s/e.frameRate}function gl(a,e){const t=Mr.exec(a),s=Number(t[1]);switch(t[2]){case"h":return s*3600;case"m":return s*60;case"ms":return s*1e3;case"f":return s/e.frameRate;case"t":return s/e.tickRate}return s}class ml{constructor(e){this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=Pi(),this.captionsProperties=void 0,this.hls=e,this.config=e.config,this.Cues=e.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},e.on(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(p.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(p.FRAG_LOADING,this.onFragLoading,this),e.on(p.FRAG_LOADED,this.onFragLoaded,this),e.on(p.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(p.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(p.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(p.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(p.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:e}=this;e.off(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(p.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(p.FRAG_LOADING,this.onFragLoading,this),e.off(p.FRAG_LOADED,this.onFragLoaded,this),e.off(p.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(p.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(p.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(p.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(p.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=null,this.cea608Parser1=this.cea608Parser2=void 0}initCea608Parsers(){if(this.config.enableCEA708Captions&&(!this.cea608Parser1||!this.cea608Parser2)){const e=new ht(this,"textTrack1"),t=new ht(this,"textTrack2"),s=new ht(this,"textTrack3"),i=new ht(this,"textTrack4");this.cea608Parser1=new Di(1,e,t),this.cea608Parser2=new Di(3,s,i)}}addCues(e,t,s,i,r){let n=!1;for(let o=r.length;o--;){const l=r[o],c=pl(l[0],l[1],t,s);if(c>=0&&(l[0]=Math.min(l[0],t),l[1]=Math.max(l[1],s),n=!0,c/(s-t)>.5))return}if(n||r.push([t,s]),this.config.renderTextTracksNatively){const o=this.captionsTracks[e];this.Cues.newCue(o,t,s,i)}else{const o=this.Cues.newCue(null,t,s,i);this.hls.trigger(p.CUES_PARSED,{type:"captions",cues:o,track:e})}}onInitPtsFound(e,{frag:t,id:s,initPTS:i,timescale:r}){const{unparsedVttFrags:n}=this;s==="main"&&(this.initPTS[t.cc]={baseTime:i,timescale:r}),n.length&&(this.unparsedVttFrags=[],n.forEach(o=>{this.onFragLoaded(p.FRAG_LOADED,o)}))}getExistingTrack(e,t){const{media:s}=this;if(s)for(let i=0;i{He(e[t]),delete e[t]}),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=Pi(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=[],this.initPTS=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())}_cleanTracks(){const{media:e}=this;if(!e)return;const t=e.textTracks;if(t)for(let s=0;sr.textCodec===es);if(this.config.enableWebVTT||i&&this.config.enableIMSC1){if(Cr(this.tracks,s)){this.tracks=s;return}if(this.textTracks=[],this.tracks=s,this.config.renderTextTracksNatively){const n=this.media,o=n?gt(n.textTracks):null;if(this.tracks.forEach((l,c)=>{let h;if(o){let u=null;for(let d=0;dc!==null).map(c=>c.label);l.length&&v.warn(`Media element contains unused subtitle tracks: ${l.join(", ")}. Replace media element for each source to clear TextTracks and captions menu.`)}}else if(this.tracks.length){const n=this.tracks.map(o=>({label:o.name,kind:o.type.toLowerCase(),default:o.default,subtitleTrack:o}));this.hls.trigger(p.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:n})}}}onManifestLoaded(e,t){this.config.enableCEA708Captions&&t.captions&&t.captions.forEach(s=>{const i=/(?:CC|SERVICE)([1-4])/.exec(s.instreamId);if(!i)return;const r=`textTrack${i[1]}`,n=this.captionsProperties[r];n&&(n.label=s.name,s.lang&&(n.languageCode=s.lang),n.media=s)})}closedCaptionsForLevel(e){const t=this.hls.levels[e.level];return t==null?void 0:t.attrs["CLOSED-CAPTIONS"]}onFragLoading(e,t){if(this.enabled&&t.frag.type===U.MAIN){var s,i;const{cea608Parser1:r,cea608Parser2:n,lastSn:o}=this,{cc:l,sn:c}=t.frag,h=(s=(i=t.part)==null?void 0:i.index)!=null?s:-1;r&&n&&(c!==o+1||c===o&&h!==this.lastPartIndex+1||l!==this.lastCc)&&(r.reset(),n.reset()),this.lastCc=l,this.lastSn=c,this.lastPartIndex=h}}onFragLoaded(e,t){const{frag:s,payload:i}=t;if(s.type===U.SUBTITLE)if(i.byteLength){const r=s.decryptdata,n="stats"in t;if(r==null||!r.encrypted||n){const o=this.tracks[s.level],l=this.vttCCs;l[s.cc]||(l[s.cc]={start:s.start,prevCC:this.prevCC,new:!0},this.prevCC=s.cc),o&&o.textCodec===es?this._parseIMSC1(s,i):this._parseVTTs(t)}}else this.hls.trigger(p.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:s,error:new Error("Empty subtitle payload")})}_parseIMSC1(e,t){const s=this.hls;Ci(t,this.initPTS[e.cc],i=>{this._appendCues(i,e.level),s.trigger(p.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})},i=>{v.log(`Failed to parse IMSC1: ${i}`),s.trigger(p.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:i})})}_parseVTTs(e){var t;const{frag:s,payload:i}=e,{initPTS:r,unparsedVttFrags:n}=this,o=r.length-1;if(!r[s.cc]&&o===-1){n.push(e);return}const l=this.hls,c=(t=s.initSegment)!=null&&t.data?pe(s.initSegment.data,new Uint8Array(i)):i;cl(c,this.initPTS[s.cc],this.vttCCs,s.cc,s.start,h=>{this._appendCues(h,s.level),l.trigger(p.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:s})},h=>{const u=h.message==="Missing initPTS for VTT MPEGTS";u?n.push(e):this._fallbackToIMSC1(s,i),v.log(`Failed to parse VTT cue: ${h}`),!(u&&o>s.cc)&&l.trigger(p.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:s,error:h})})}_fallbackToIMSC1(e,t){const s=this.tracks[e.level];s.textCodec||Ci(t,this.initPTS[e.cc],()=>{s.textCodec=es,this._parseIMSC1(e,t)},()=>{s.textCodec="wvtt"})}_appendCues(e,t){const s=this.hls;if(this.config.renderTextTracksNatively){const i=this.textTracks[t];if(!i||i.mode==="disabled")return;e.forEach(r=>rr(i,r))}else{const i=this.tracks[t];if(!i)return;const r=i.default?"default":"subtitles"+t;s.trigger(p.CUES_PARSED,{type:"subtitles",cues:e,track:r})}}onFragDecrypted(e,t){const{frag:s}=t;s.type===U.SUBTITLE&&this.onFragLoaded(p.FRAG_LOADED,t)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(e,t){this.initCea608Parsers();const{cea608Parser1:s,cea608Parser2:i}=this;if(!this.enabled||!s||!i)return;const{frag:r,samples:n}=t;if(!(r.type===U.MAIN&&this.closedCaptionsForLevel(r)==="NONE"))for(let o=0;ols(o[l],t,s))}if(this.config.renderTextTracksNatively&&t===0&&i!==void 0){const{textTracks:o}=this;Object.keys(o).forEach(l=>ls(o[l],t,i))}}}extractCea608Data(e){const t=[[],[]],s=e[0]&31;let i=2;for(let r=0;rthis.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}}getMaxLevel(e){const t=this.hls.levels;if(!t.length)return-1;const s=t.filter((i,r)=>this.isLevelAllowed(i)&&r<=e);return this.clientRect=null,Ms.getMaxLevelByMediaSize(s,this.mediaWidth,this.mediaHeight)}startCapping(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())}stopCapping(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)}getDimensions(){if(this.clientRect)return this.clientRect;const e=this.media,t={width:0,height:0};if(e){const s=e.getBoundingClientRect();t.width=s.width,t.height=s.height,!t.width&&!t.height&&(t.width=s.right-s.left||e.width||0,t.height=s.bottom-s.top||e.height||0)}return this.clientRect=t,t}get mediaWidth(){return this.getDimensions().width*this.contentScaleFactor}get mediaHeight(){return this.getDimensions().height*this.contentScaleFactor}get contentScaleFactor(){let e=1;if(!this.hls.config.ignoreDevicePixelRatio)try{e=self.devicePixelRatio}catch{}return e}isLevelAllowed(e){return!this.restrictedLevels.some(s=>e.bitrate===s.bitrate&&e.width===s.width&&e.height===s.height)}static getMaxLevelByMediaSize(e,t,s){if(!(e!=null&&e.length))return-1;const i=(o,l)=>l?o.width!==l.width||o.height!==l.height:!0;let r=e.length-1;const n=Math.max(t,s);for(let o=0;o=n||l.height>=n)&&i(l,e[o+1])){r=o;break}}return r}}class Tl{constructor(e){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=e,this.registerListeners()}setStreamController(e){this.streamController=e}registerListeners(){this.hls.on(p.MEDIA_ATTACHING,this.onMediaAttaching,this)}unregisterListeners(){this.hls.off(p.MEDIA_ATTACHING,this.onMediaAttaching,this)}destroy(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}onMediaAttaching(e,t){const s=this.hls.config;if(s.capLevelOnFPSDrop){const i=t.media instanceof self.HTMLVideoElement?t.media:null;this.media=i,i&&typeof i.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),s.fpsDroppedMonitoringPeriod)}}checkFPS(e,t,s){const i=performance.now();if(t){if(this.lastTime){const r=i-this.lastTime,n=s-this.lastDroppedFrames,o=t-this.lastDecodedFrames,l=1e3*n/r,c=this.hls;if(c.trigger(p.FPS_DROP,{currentDropped:n,currentDecoded:o,totalDroppedFrames:s}),l>0&&n>c.config.fpsDroppedMonitoringThreshold*o){let h=c.currentLevel;v.warn("drop FPS ratio greater than max allowed value for currentLevel: "+h),h>0&&(c.autoLevelCapping===-1||c.autoLevelCapping>=h)&&(h=h-1,c.trigger(p.FPS_DROP_LEVEL_CAPPING,{level:h,droppedLevel:c.currentLevel}),c.autoLevelCapping=h,this.streamController.nextLevelSwitch())}}this.lastTime=i,this.lastDroppedFrames=s,this.lastDecodedFrames=t}}checkFPSInterval(){const e=this.media;if(e)if(this.isVideoPlaybackQualityAvailable){const t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)}}const dt="[eme]";class Ye{constructor(e){this.hls=void 0,this.config=void 0,this.media=null,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.setMediaKeysQueue=Ye.CDMCleanupPromise?[Ye.CDMCleanupPromise]:[],this.onMediaEncrypted=this._onMediaEncrypted.bind(this),this.onWaitingForKey=this._onWaitingForKey.bind(this),this.debug=v.debug.bind(v,dt),this.log=v.log.bind(v,dt),this.warn=v.warn.bind(v,dt),this.error=v.error.bind(v,dt),this.hls=e,this.config=e.config,this.registerListeners()}destroy(){this.unregisterListeners(),this.onMediaDetached();const e=this.config;e.requestMediaKeySystemAccessFunc=null,e.licenseXhrSetup=e.licenseResponseCallback=void 0,e.drmSystems=e.drmSystemOptions={},this.hls=this.onMediaEncrypted=this.onWaitingForKey=this.keyIdToKeySessionPromise=null,this.config=null}registerListeners(){this.hls.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(p.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(p.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(p.MANIFEST_LOADED,this.onManifestLoaded,this)}unregisterListeners(){this.hls.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(p.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(p.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(p.MANIFEST_LOADED,this.onManifestLoaded,this)}getLicenseServerUrl(e){const{drmSystems:t,widevineLicenseUrl:s}=this.config,i=t[e];if(i)return i.licenseUrl;if(e===Z.WIDEVINE&&s)return s;throw new Error(`no license server URL configured for key-system "${e}"`)}getServerCertificateUrl(e){const{drmSystems:t}=this.config,s=t[e];if(s)return s.serverCertificateUrl;this.log(`No Server Certificate in config.drmSystems["${e}"]`)}attemptKeySystemAccess(e){const t=this.hls.levels,s=(n,o,l)=>!!n&&l.indexOf(n)===o,i=t.map(n=>n.audioCodec).filter(s),r=t.map(n=>n.videoCodec).filter(s);return i.length+r.length===0&&r.push("avc1.42e01e"),new Promise((n,o)=>{const l=c=>{const h=c.shift();this.getMediaKeysPromise(h,i,r).then(u=>n({keySystem:h,mediaKeys:u})).catch(u=>{c.length?l(c):u instanceof ge?o(u):o(new ge({type:$.KEY_SYSTEM_ERROR,details:L.KEY_SYSTEM_NO_ACCESS,error:u,fatal:!0},u.message))})};l(e)})}requestMediaKeySystemAccess(e,t){const{requestMediaKeySystemAccessFunc:s}=this.config;if(typeof s!="function"){let i=`Configured requestMediaKeySystemAccess is not a function ${s}`;return Hi===null&&self.location.protocol==="http:"&&(i=`navigator.requestMediaKeySystemAccess is not available over insecure protocol ${location.protocol}`),Promise.reject(new Error(i))}return s(e,t)}getMediaKeysPromise(e,t,s){const i=An(e,t,s,this.config.drmSystemOptions),r=this.keySystemAccessPromises[e];let n=r==null?void 0:r.keySystemAccess;if(!n){this.log(`Requesting encrypted media "${e}" key-system access with config: ${JSON.stringify(i)}`),n=this.requestMediaKeySystemAccess(e,i);const o=this.keySystemAccessPromises[e]={keySystemAccess:n};return n.catch(l=>{this.log(`Failed to obtain access to key-system "${e}": ${l}`)}),n.then(l=>{this.log(`Access for key-system "${l.keySystem}" obtained`);const c=this.fetchServerCertificate(e);return this.log(`Create media-keys for "${e}"`),o.mediaKeys=l.createMediaKeys().then(h=>(this.log(`Media-keys created for "${e}"`),c.then(u=>u?this.setMediaKeysServerCertificate(h,e,u):h))),o.mediaKeys.catch(h=>{this.error(`Failed to create media-keys for "${e}"}: ${h}`)}),o.mediaKeys})}return n.then(()=>r.mediaKeys)}createMediaKeySessionContext({decryptdata:e,keySystem:t,mediaKeys:s}){this.log(`Creating key-system session "${t}" keyId: ${Se.hexDump(e.keyId||[])}`);const i=s.createSession(),r={decryptdata:e,keySystem:t,mediaKeys:s,mediaKeysSession:i,keyStatus:"status-pending"};return this.mediaKeySessions.push(r),r}renewKeySession(e){const t=e.decryptdata;if(t.pssh){const s=this.createMediaKeySessionContext(e),i=this.getKeyIdString(t),r="cenc";this.keyIdToKeySessionPromise[i]=this.generateRequestWithPreferredKeySession(s,r,t.pssh,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(e)}getKeyIdString(e){if(!e)throw new Error("Could not read keyId of undefined decryptdata");if(e.keyId===null)throw new Error("keyId is null");return Se.hexDump(e.keyId)}updateKeySession(e,t){var s;const i=e.mediaKeysSession;return this.log(`Updating key-session "${i.sessionId}" for keyID ${Se.hexDump(((s=e.decryptdata)==null?void 0:s.keyId)||[])} + } (data length: ${t&&t.byteLength})`),i.update(t)}selectKeySystemFormat(e){const t=Object.keys(e.levelkeys||{});return this.keyFormatPromise||(this.log(`Selecting key-system from fragment (sn: ${e.sn} ${e.type}: ${e.level}) key formats ${t.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(t)),this.keyFormatPromise}getKeyFormatPromise(e){return new Promise((t,s)=>{const i=Bt(this.config),r=e.map($s).filter(n=>!!n&&i.indexOf(n)!==-1);return this.getKeySystemSelectionPromise(r).then(({keySystem:n})=>{const o=Gs(n);o?t(o):s(new Error(`Unable to find format for key-system "${n}"`))}).catch(s)})}loadKey(e){const t=e.keyInfo.decryptdata,s=this.getKeyIdString(t),i=`(keyId: ${s} format: "${t.keyFormat}" method: ${t.method} uri: ${t.uri})`;this.log(`Starting session for key ${i}`);let r=this.keyIdToKeySessionPromise[s];return r||(r=this.keyIdToKeySessionPromise[s]=this.getKeySystemForKeyPromise(t).then(({keySystem:n,mediaKeys:o})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${e.frag.sn} ${e.frag.type}: ${e.frag.level} using key ${i}`),this.attemptSetMediaKeys(n,o).then(()=>{this.throwIfDestroyed();const l=this.createMediaKeySessionContext({keySystem:n,mediaKeys:o,decryptdata:t});return this.generateRequestWithPreferredKeySession(l,"cenc",t.pssh,"playlist-key")}))),r.catch(n=>this.handleError(n))),r}throwIfDestroyed(e="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(e){this.hls&&(this.error(e.message),e instanceof ge?this.hls.trigger(p.ERROR,e.data):this.hls.trigger(p.ERROR,{type:$.KEY_SYSTEM_ERROR,details:L.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0}))}getKeySystemForKeyPromise(e){const t=this.getKeyIdString(e),s=this.keyIdToKeySessionPromise[t];if(!s){const i=$s(e.keyFormat),r=i?[i]:Bt(this.config);return this.attemptKeySystemAccess(r)}return s}getKeySystemSelectionPromise(e){if(e.length||(e=Bt(this.config)),e.length===0)throw new ge({type:$.KEY_SYSTEM_ERROR,details:L.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${JSON.stringify({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(e)}_onMediaEncrypted(e){const{initDataType:t,initData:s}=e;if(this.debug(`"${e.type}" event: init data type: "${t}"`),s===null)return;let i,r;if(t==="sinf"&&this.config.drmSystems[Z.FAIRPLAY]){const h=ie(new Uint8Array(s));try{const u=Ss(JSON.parse(h).sinf),d=Ji(new Uint8Array(u));if(!d)return;i=d.subarray(8,24),r=Z.FAIRPLAY}catch{this.warn('Failed to parse sinf "encrypted" event message initData');return}}else{const h=jn(s);if(h===null)return;h.version===0&&h.systemId===Vi.WIDEVINE&&h.data&&(i=h.data.subarray(8,24)),r=vn(h.systemId)}if(!r||!i)return;const n=Se.hexDump(i),{keyIdToKeySessionPromise:o,mediaKeySessions:l}=this;let c=o[n];for(let h=0;hthis.generateRequestWithPreferredKeySession(u,t,s,"encrypted-event-key-match"));break}}c||(c=o[n]=this.getKeySystemSelectionPromise([r]).then(({keySystem:h,mediaKeys:u})=>{var d;this.throwIfDestroyed();const g=new tt("ISO-23001-7",n,(d=Gs(h))!=null?d:"");return g.pssh=new Uint8Array(s),g.keyId=i,this.attemptSetMediaKeys(h,u).then(()=>{this.throwIfDestroyed();const f=this.createMediaKeySessionContext({decryptdata:g,keySystem:h,mediaKeys:u});return this.generateRequestWithPreferredKeySession(f,t,s,"encrypted-event-no-match")})})),c.catch(h=>this.handleError(h))}_onWaitingForKey(e){this.log(`"${e.type}" event`)}attemptSetMediaKeys(e,t){const s=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${e}"`);const i=Promise.all(s).then(()=>{if(!this.media)throw new Error("Attempted to set mediaKeys without media element attached");return this.media.setMediaKeys(t)});return this.setMediaKeysQueue.push(i),i.then(()=>{this.log(`Media-keys set for "${e}"`),s.push(i),this.setMediaKeysQueue=this.setMediaKeysQueue.filter(r=>s.indexOf(r)===-1)})}generateRequestWithPreferredKeySession(e,t,s,i){var r,n;const o=(r=this.config.drmSystems)==null||(n=r[e.keySystem])==null?void 0:n.generateRequest;if(o)try{const f=o.call(this.hls,t,s,e);if(!f)throw new Error("Invalid response from configured generateRequest filter");t=f.initDataType,s=e.decryptdata.pssh=f.initData?new Uint8Array(f.initData):null}catch(f){var l;if(this.warn(f.message),(l=this.hls)!=null&&l.config.debug)throw f}if(s===null)return this.log(`Skipping key-session request for "${i}" (no initData)`),Promise.resolve(e);const c=this.getKeyIdString(e.decryptdata);this.log(`Generating key-session request for "${i}": ${c} (init data type: ${t} length: ${s?s.byteLength:null})`);const h=new Ps,u=e._onmessage=f=>{const m=e.mediaKeysSession;if(!m){h.emit("error",new Error("invalid state"));return}const{messageType:T,message:E}=f;this.log(`"${T}" message event for session "${m.sessionId}" message size: ${E.byteLength}`),T==="license-request"||T==="license-renewal"?this.renewLicense(e,E).catch(x=>{this.handleError(x),h.emit("error",x)}):T==="license-release"?e.keySystem===Z.FAIRPLAY&&(this.updateKeySession(e,as("acknowledged")),this.removeSession(e)):this.warn(`unhandled media key message type "${T}"`)},d=e._onkeystatuseschange=f=>{if(!e.mediaKeysSession){h.emit("error",new Error("invalid state"));return}this.onKeyStatusChange(e);const T=e.keyStatus;h.emit("keyStatus",T),T==="expired"&&(this.warn(`${e.keySystem} expired for key ${c}`),this.renewKeySession(e))};e.mediaKeysSession.addEventListener("message",u),e.mediaKeysSession.addEventListener("keystatuseschange",d);const g=new Promise((f,m)=>{h.on("error",m),h.on("keyStatus",T=>{T.startsWith("usable")?f():T==="output-restricted"?m(new ge({type:$.KEY_SYSTEM_ERROR,details:L.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):T==="internal-error"?m(new ge({type:$.KEY_SYSTEM_ERROR,details:L.KEY_SYSTEM_STATUS_INTERNAL_ERROR,fatal:!0},`key status changed to "${T}"`)):T==="expired"?m(new Error("key expired while generating request")):this.warn(`unhandled key status change "${T}"`)})});return e.mediaKeysSession.generateRequest(t,s).then(()=>{var f;this.log(`Request generated for key-session "${(f=e.mediaKeysSession)==null?void 0:f.sessionId}" keyId: ${c}`)}).catch(f=>{throw new ge({type:$.KEY_SYSTEM_ERROR,details:L.KEY_SYSTEM_NO_SESSION,error:f,fatal:!1},`Error generating key-session request: ${f}`)}).then(()=>g).catch(f=>{throw h.removeAllListeners(),this.removeSession(e),f}).then(()=>(h.removeAllListeners(),e))}onKeyStatusChange(e){e.mediaKeysSession.keyStatuses.forEach((t,s)=>{this.log(`key status change "${t}" for keyStatuses keyId: ${Se.hexDump("buffer"in s?new Uint8Array(s.buffer,s.byteOffset,s.byteLength):new Uint8Array(s))} session keyId: ${Se.hexDump(new Uint8Array(e.decryptdata.keyId||[]))} uri: ${e.decryptdata.uri}`),e.keyStatus=t})}fetchServerCertificate(e){const t=this.config,s=t.loader,i=new s(t),r=this.getServerCertificateUrl(e);return r?(this.log(`Fetching server certificate for "${e}"`),new Promise((n,o)=>{const l={responseType:"arraybuffer",url:r},c=t.certLoadPolicy.default,h={loadPolicy:c,timeout:c.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},u={onSuccess:(d,g,f,m)=>{n(d.data)},onError:(d,g,f,m)=>{o(new ge({type:$.KEY_SYSTEM_ERROR,details:L.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:f,response:oe({url:l.url,data:void 0},d)},`"${e}" certificate request failed (${r}). Status: ${d.code} (${d.text})`))},onTimeout:(d,g,f)=>{o(new ge({type:$.KEY_SYSTEM_ERROR,details:L.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:f,response:{url:l.url,data:void 0}},`"${e}" certificate request timed out (${r})`))},onAbort:(d,g,f)=>{o(new Error("aborted"))}};i.load(l,h,u)})):Promise.resolve()}setMediaKeysServerCertificate(e,t,s){return new Promise((i,r)=>{e.setServerCertificate(s).then(n=>{this.log(`setServerCertificate ${n?"success":"not supported by CDM"} (${s==null?void 0:s.byteLength}) on "${t}"`),i(e)}).catch(n=>{r(new ge({type:$.KEY_SYSTEM_ERROR,details:L.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:n,fatal:!0},n.message))})})}renewLicense(e,t){return this.requestLicense(e,new Uint8Array(t)).then(s=>this.updateKeySession(e,new Uint8Array(s)).catch(i=>{throw new ge({type:$.KEY_SYSTEM_ERROR,details:L.KEY_SYSTEM_SESSION_UPDATE_FAILED,error:i,fatal:!0},i.message)}))}unpackPlayReadyKeyMessage(e,t){const s=String.fromCharCode.apply(null,new Uint16Array(t.buffer));if(!s.includes("PlayReadyKeyMessage"))return e.setRequestHeader("Content-Type","text/xml; charset=utf-8"),t;const i=new DOMParser().parseFromString(s,"application/xml"),r=i.querySelectorAll("HttpHeader");if(r.length>0){let h;for(let u=0,d=r.length;u in key message");return as(atob(c))}setupLicenseXHR(e,t,s,i){const r=this.config.licenseXhrSetup;return r?Promise.resolve().then(()=>{if(!s.decryptdata)throw new Error("Key removed");return r.call(this.hls,e,t,s,i)}).catch(n=>{if(!s.decryptdata)throw n;return e.open("POST",t,!0),r.call(this.hls,e,t,s,i)}).then(n=>(e.readyState||e.open("POST",t,!0),{xhr:e,licenseChallenge:n||i})):(e.open("POST",t,!0),Promise.resolve({xhr:e,licenseChallenge:i}))}requestLicense(e,t){const s=this.config.keyLoadPolicy.default;return new Promise((i,r)=>{const n=this.getLicenseServerUrl(e.keySystem);this.log(`Sending license request to URL: ${n}`);const o=new XMLHttpRequest;o.responseType="arraybuffer",o.onreadystatechange=()=>{if(!this.hls||!e.mediaKeysSession)return r(new Error("invalid state"));if(o.readyState===4)if(o.status===200){this._requestLicenseFailureCount=0;let l=o.response;this.log(`License received ${l instanceof ArrayBuffer?l.byteLength:l}`);const c=this.config.licenseResponseCallback;if(c)try{l=c.call(this.hls,o,n,e)}catch(h){this.error(h)}i(l)}else{const l=s.errorRetry,c=l?l.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>c||o.status>=400&&o.status<500)r(new ge({type:$.KEY_SYSTEM_ERROR,details:L.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0,networkDetails:o,response:{url:n,data:void 0,code:o.status,text:o.statusText}},`License Request XHR failed (${n}). Status: ${o.status} (${o.statusText})`));else{const h=c-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${h} attempts left`),this.requestLicense(e,t).then(i,r)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=o,this.setupLicenseXHR(o,n,e,t).then(({xhr:l,licenseChallenge:c})=>{e.keySystem==Z.PLAYREADY&&(c=this.unpackPlayReadyKeyMessage(l,c)),l.send(c)})})}onMediaAttached(e,t){if(!this.config.emeEnabled)return;const s=t.media;this.media=s,s.addEventListener("encrypted",this.onMediaEncrypted),s.addEventListener("waitingforkey",this.onWaitingForKey)}onMediaDetached(){const e=this.media,t=this.mediaKeySessions;e&&(e.removeEventListener("encrypted",this.onMediaEncrypted),e.removeEventListener("waitingforkey",this.onWaitingForKey),this.media=null),this._requestLicenseFailureCount=0,this.setMediaKeysQueue=[],this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},tt.clearKeyUriToKeyIdMap();const s=t.length;Ye.CDMCleanupPromise=Promise.all(t.map(i=>this.removeSession(i)).concat(e==null?void 0:e.setMediaKeys(null).catch(i=>{this.log(`Could not clear media keys: ${i}`)}))).then(()=>{s&&(this.log("finished closing key sessions and clearing media keys"),t.length=0)}).catch(i=>{this.log(`Could not close sessions and clear media keys: ${i}`)})}onManifestLoading(){this.keyFormatPromise=null}onManifestLoaded(e,{sessionKeys:t}){if(!(!t||!this.config.emeEnabled)&&!this.keyFormatPromise){const s=t.reduce((i,r)=>(i.indexOf(r.keyFormat)===-1&&i.push(r.keyFormat),i),[]);this.log(`Selecting key-system from session-keys ${s.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(s)}}removeSession(e){const{mediaKeysSession:t,licenseXhr:s}=e;if(t){this.log(`Remove licenses and keys and close session ${t.sessionId}`),e._onmessage&&(t.removeEventListener("message",e._onmessage),e._onmessage=void 0),e._onkeystatuseschange&&(t.removeEventListener("keystatuseschange",e._onkeystatuseschange),e._onkeystatuseschange=void 0),s&&s.readyState!==XMLHttpRequest.DONE&&s.abort(),e.mediaKeysSession=e.decryptdata=e.licenseXhr=void 0;const i=this.mediaKeySessions.indexOf(e);return i>-1&&this.mediaKeySessions.splice(i,1),t.remove().catch(r=>{this.log(`Could not remove session: ${r}`)}).then(()=>t.close()).catch(r=>{this.log(`Could not close session: ${r}`)})}}}Ye.CDMCleanupPromise=void 0;class ge extends Error{constructor(e,t){super(t),this.data=void 0,e.error||(e.error=new Error(t)),this.data=e,e.err=e.error}}var he;(function(a){a.MANIFEST="m",a.AUDIO="a",a.VIDEO="v",a.MUXED="av",a.INIT="i",a.CAPTION="c",a.TIMED_TEXT="tt",a.KEY="k",a.OTHER="o"})(he||(he={}));var ps;(function(a){a.DASH="d",a.HLS="h",a.SMOOTH="s",a.OTHER="o"})(ps||(ps={}));var Me;(function(a){a.OBJECT="CMCD-Object",a.REQUEST="CMCD-Request",a.SESSION="CMCD-Session",a.STATUS="CMCD-Status"})(Me||(Me={}));const El={[Me.OBJECT]:["br","d","ot","tb"],[Me.REQUEST]:["bl","dl","mtp","nor","nrr","su"],[Me.SESSION]:["cid","pr","sf","sid","st","v"],[Me.STATUS]:["bs","rtp"]};class Xe{constructor(e,t){this.value=void 0,this.params=void 0,Array.isArray(e)&&(e=e.map(s=>s instanceof Xe?s:new Xe(s))),this.value=e,this.params=t}}class Br{constructor(e){this.description=void 0,this.description=e}}const yl="Dict";function xl(a){return Array.isArray(a)?JSON.stringify(a):a instanceof Map?"Map{}":a instanceof Set?"Set{}":typeof a=="object"?JSON.stringify(a):String(a)}function Sl(a,e,t,s){return new Error(`failed to ${a} "${xl(e)}" as ${t}`,{cause:s})}const Fi="Bare Item",vl="Boolean",Al="Byte Sequence",Ll="Decimal",Rl="Integer";function Il(a){return a<-999999999999999||99999999999999912)throw Ie(a,Ll);const t=e.toString();return t.includes(".")?t:`${t}.0`}const Ol="String";function Ml(a){if(bl.test(a))throw Ie(a,Ol);return`"${a.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function Nl(a){return a.description||a.toString().slice(7,-1)}function Oi(a){const e=Nl(a);if(/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(e)===!1)throw Ie(e,Dl);return e}function Ts(a){switch(typeof a){case"number":if(!O(a))throw Ie(a,Fi);return Number.isInteger(a)?$r(a):Fl(a);case"string":return Ml(a);case"symbol":return Oi(a);case"boolean":return _l(a);case"object":if(a instanceof Date)return Pl(a);if(a instanceof Uint8Array)return kl(a);if(a instanceof Br)return Oi(a);default:throw Ie(a,Fi)}}function Es(a){if(/^[a-z*][a-z0-9\-_.*]*$/.test(a)===!1)throw Ie(a,Cl);return a}function Ns(a){return a==null?"":Object.entries(a).map(([e,t])=>t===!0?`;${Es(e)}`:`;${Es(e)}=${Ts(t)}`).join("")}function Kr(a){return a instanceof Xe?`${Ts(a.value)}${Ns(a.params)}`:Ts(a)}function Ul(a){return`(${a.value.map(Kr).join(" ")})${Ns(a.params)}`}function Bl(a,e={whitespace:!0}){if(typeof a!="object")throw Ie(a,yl);const t=a instanceof Map?a.entries():Object.entries(a),s=e!=null&&e.whitespace?" ":"";return Array.from(t).map(([i,r])=>{r instanceof Xe||(r=new Xe(r));let n=Es(i);return r.value===!0?n+=Ns(r.params):(n+="=",Array.isArray(r.value)?n+=Ul(r):n+=Kr(r)),n}).join(`,${s}`)}function $l(a,e){return Bl(a,e)}const Gl=a=>a==="ot"||a==="sf"||a==="st",Kl=a=>typeof a=="number"?O(a):a!=null&&a!==""&&a!==!1;function Vl(a,e){const t=new URL(a),s=new URL(e);if(t.origin!==s.origin)return a;const i=t.pathname.split("/").slice(1),r=s.pathname.split("/").slice(1,-1);for(;i[0]===r[0];)i.shift(),r.shift();for(;r.length;)r.shift(),i.unshift("..");return i.join("/")}function Hl(){try{return crypto.randomUUID()}catch{try{const e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.slice(t.lastIndexOf("/")+1)}catch{let t=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,i=>{const r=(t+Math.random()*16)%16|0;return t=Math.floor(t/16),(i=="x"?r:r&3|8).toString(16)})}}}const xt=a=>Math.round(a),Wl=(a,e)=>(e!=null&&e.baseUrl&&(a=Vl(a,e.baseUrl)),encodeURIComponent(a)),ft=a=>xt(a/100)*100,Yl={br:xt,d:xt,bl:ft,dl:ft,mtp:ft,nor:Wl,rtp:ft,tb:xt};function ql(a,e){const t={};if(a==null||typeof a!="object")return t;const s=Object.keys(a).sort(),i=se({},Yl,e==null?void 0:e.formatters),r=e==null?void 0:e.filter;return s.forEach(n=>{if(r!=null&&r(n))return;let o=a[n];const l=i[n];l&&(o=l(o,e)),!(n==="v"&&o===1)&&(n=="pr"&&o===1||Kl(o)&&(Gl(n)&&typeof o=="string"&&(o=new Br(o)),t[n]=o))}),t}function Vr(a,e={}){return a?$l(ql(a,e),se({whitespace:!1},e)):""}function jl(a,e={}){if(!a)return{};const t=Object.entries(a),s=Object.entries(El).concat(Object.entries((e==null?void 0:e.customHeaderMap)||{})),i=t.reduce((r,n)=>{var o,l;const[c,h]=n,u=((o=s.find(d=>d[1].includes(c)))==null?void 0:o[0])||Me.REQUEST;return(l=r[u])!=null||(r[u]={}),r[u][c]=h,r},{});return Object.entries(i).reduce((r,[n,o])=>(r[n]=Vr(o,e),r),{})}function zl(a,e,t){return se(a,jl(e,t))}const Xl="CMCD";function Ql(a,e={}){if(!a)return"";const t=Vr(a,e);return`${Xl}=${encodeURIComponent(t)}`}const Mi=/CMCD=[^&#]+/;function Jl(a,e,t){const s=Ql(e,t);if(!s)return a;if(Mi.test(a))return a.replace(Mi,s);const i=a.includes("?")?"&":"?";return`${a}${i}${s}`}class Zl{constructor(e){this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.includeKeys=void 0,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=()=>{this.initialized&&(this.starved=!0),this.buffering=!0},this.onPlaying=()=>{this.initialized||(this.initialized=!0),this.buffering=!1},this.applyPlaylistData=i=>{try{this.apply(i,{ot:he.MANIFEST,su:!this.initialized})}catch(r){v.warn("Could not generate manifest CMCD data.",r)}},this.applyFragmentData=i=>{try{const r=i.frag,n=this.hls.levels[r.level],o=this.getObjectType(r),l={d:r.duration*1e3,ot:o};(o===he.VIDEO||o===he.AUDIO||o==he.MUXED)&&(l.br=n.bitrate/1e3,l.tb=this.getTopBandwidth(o)/1e3,l.bl=this.getBufferLength(o)),this.apply(i,l)}catch(r){v.warn("Could not generate segment CMCD data.",r)}},this.hls=e;const t=this.config=e.config,{cmcd:s}=t;s!=null&&(t.pLoader=this.createPlaylistLoader(),t.fLoader=this.createFragmentLoader(),this.sid=s.sessionId||Hl(),this.cid=s.contentId,this.useHeaders=s.useHeaders===!0,this.includeKeys=s.includeKeys,this.registerListeners())}registerListeners(){const e=this.hls;e.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(p.MEDIA_DETACHED,this.onMediaDetached,this),e.on(p.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const e=this.hls;e.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(p.MEDIA_DETACHED,this.onMediaDetached,this),e.off(p.BUFFER_CREATED,this.onBufferCreated,this)}destroy(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null,this.onWaiting=this.onPlaying=null}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)}onMediaDetached(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)}onBufferCreated(e,t){var s,i;this.audioBuffer=(s=t.tracks.audio)==null?void 0:s.buffer,this.videoBuffer=(i=t.tracks.video)==null?void 0:i.buffer}createData(){var e;return{v:1,sf:ps.HLS,sid:this.sid,cid:this.cid,pr:(e=this.media)==null?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(e,t={}){se(t,this.createData());const s=t.ot===he.INIT||t.ot===he.VIDEO||t.ot===he.MUXED;this.starved&&s&&(t.bs=!0,t.su=!0,this.starved=!1),t.su==null&&(t.su=this.buffering);const{includeKeys:i}=this;i&&(t=Object.keys(t).reduce((r,n)=>(i.includes(n)&&(r[n]=t[n]),r),{})),this.useHeaders?(e.headers||(e.headers={}),zl(e.headers,t)):e.url=Jl(e.url,t)}getObjectType(e){const{type:t}=e;if(t==="subtitle")return he.TIMED_TEXT;if(e.sn==="initSegment")return he.INIT;if(t==="audio")return he.AUDIO;if(t==="main")return this.hls.audioTracks.length?he.VIDEO:he.MUXED}getTopBandwidth(e){let t=0,s;const i=this.hls;if(e===he.AUDIO)s=i.audioTracks;else{const r=i.maxAutoLevel,n=r>-1?r+1:i.levels.length;s=i.levels.slice(0,n)}for(const r of s)r.bitrate>t&&(t=r.bitrate);return t>0?t:NaN}getBufferLength(e){const t=this.hls.media,s=e===he.AUDIO?this.audioBuffer:this.videoBuffer;return!s||!t?NaN:J.bufferInfo(s,t.currentTime,this.config.maxBufferHole).len*1e3}createPlaylistLoader(){const{pLoader:e}=this.config,t=this.applyPlaylistData,s=e||this.config.loader;return class{constructor(r){this.loader=void 0,this.loader=new s(r)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(r,n,o){t(r),this.loader.load(r,n,o)}}}createFragmentLoader(){const{fLoader:e}=this.config,t=this.applyFragmentData,s=e||this.config.loader;return class{constructor(r){this.loader=void 0,this.loader=new s(r)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(r,n,o){t(r),this.loader.load(r,n,o)}}}}const ec=3e5;class tc{constructor(e){this.hls=void 0,this.log=void 0,this.loader=null,this.uri=null,this.pathwayId=".",this.pathwayPriority=null,this.timeToLoad=300,this.reloadTimer=-1,this.updated=0,this.started=!1,this.enabled=!0,this.levels=null,this.audioTracks=null,this.subtitleTracks=null,this.penalizedPathways={},this.hls=e,this.log=v.log.bind(v,"[content-steering]:"),this.registerListeners()}registerListeners(){const e=this.hls;e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(p.MANIFEST_PARSED,this.onManifestParsed,this),e.on(p.ERROR,this.onError,this)}unregisterListeners(){const e=this.hls;e&&(e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(p.MANIFEST_PARSED,this.onManifestParsed,this),e.off(p.ERROR,this.onError,this))}startLoad(){if(this.started=!0,this.clearTimeout(),this.enabled&&this.uri){if(this.updated){const e=this.timeToLoad*1e3-(performance.now()-this.updated);if(e>0){this.scheduleRefresh(this.uri,e);return}}this.loadSteeringManifest(this.uri)}}stopLoad(){this.started=!1,this.loader&&(this.loader.destroy(),this.loader=null),this.clearTimeout()}clearTimeout(){this.reloadTimer!==-1&&(self.clearTimeout(this.reloadTimer),this.reloadTimer=-1)}destroy(){this.unregisterListeners(),this.stopLoad(),this.hls=null,this.levels=this.audioTracks=this.subtitleTracks=null}removeLevel(e){const t=this.levels;t&&(this.levels=t.filter(s=>s!==e))}onManifestLoading(){this.stopLoad(),this.enabled=!0,this.timeToLoad=300,this.updated=0,this.uri=null,this.pathwayId=".",this.levels=this.audioTracks=this.subtitleTracks=null}onManifestLoaded(e,t){const{contentSteering:s}=t;s!==null&&(this.pathwayId=s.pathwayId,this.uri=s.uri,this.started&&this.startLoad())}onManifestParsed(e,t){this.audioTracks=t.audioTracks,this.subtitleTracks=t.subtitleTracks}onError(e,t){const{errorAction:s}=t;if((s==null?void 0:s.action)===ce.SendAlternateToPenaltyBox&&s.flags===Te.MoveAllAlternatesMatchingHost){const i=this.levels;let r=this.pathwayPriority,n=this.pathwayId;if(t.context){const{groupId:o,pathwayId:l,type:c}=t.context;o&&i?n=this.getPathwayForGroupId(o,c,n):l&&(n=l)}n in this.penalizedPathways||(this.penalizedPathways[n]=performance.now()),!r&&i&&(r=i.reduce((o,l)=>(o.indexOf(l.pathwayId)===-1&&o.push(l.pathwayId),o),[])),r&&r.length>1&&(this.updatePathwayPriority(r),s.resolved=this.pathwayId!==n),s.resolved||v.warn(`Could not resolve ${t.details} ("${t.error.message}") with content-steering for Pathway: ${n} levels: ${i&&i.length} priorities: ${JSON.stringify(r)} penalized: ${JSON.stringify(this.penalizedPathways)}`)}}filterParsedLevels(e){this.levels=e;let t=this.getLevelsForPathway(this.pathwayId);if(t.length===0){const s=e[0].pathwayId;this.log(`No levels found in Pathway ${this.pathwayId}. Setting initial Pathway to "${s}"`),t=this.getLevelsForPathway(s),this.pathwayId=s}return t.length!==e.length?(this.log(`Found ${t.length}/${e.length} levels in Pathway "${this.pathwayId}"`),t):e}getLevelsForPathway(e){return this.levels===null?[]:this.levels.filter(t=>e===t.pathwayId)}updatePathwayPriority(e){this.pathwayPriority=e;let t;const s=this.penalizedPathways,i=performance.now();Object.keys(s).forEach(r=>{i-s[r]>ec&&delete s[r]});for(let r=0;r0){this.log(`Setting Pathway to "${n}"`),this.pathwayId=n,lr(t),this.hls.trigger(p.LEVELS_UPDATED,{levels:t});const c=this.hls.levels[o];l&&c&&this.levels&&(c.attrs["STABLE-VARIANT-ID"]!==l.attrs["STABLE-VARIANT-ID"]&&c.bitrate!==l.bitrate&&this.log(`Unstable Pathways change from bitrate ${l.bitrate} to ${c.bitrate}`),this.hls.nextLoadLevel=o);break}}}getPathwayForGroupId(e,t,s){const i=this.getLevelsForPathway(s).concat(this.levels||[]);for(let r=0;r{const{ID:n,"BASE-ID":o,"URI-REPLACEMENT":l}=r;if(t.some(h=>h.pathwayId===n))return;const c=this.getLevelsForPathway(o).map(h=>{const u=new ee(h.attrs);u["PATHWAY-ID"]=n;const d=u.AUDIO&&`${u.AUDIO}_clone_${n}`,g=u.SUBTITLES&&`${u.SUBTITLES}_clone_${n}`;d&&(s[u.AUDIO]=d,u.AUDIO=d),g&&(i[u.SUBTITLES]=g,u.SUBTITLES=g);const f=Hr(h.uri,u["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",l),m=new je({attrs:u,audioCodec:h.audioCodec,bitrate:h.bitrate,height:h.height,name:h.name,url:f,videoCodec:h.videoCodec,width:h.width});if(h.audioGroups)for(let T=1;T{this.log(`Loaded steering manifest: "${i}"`);const f=h.data;if(f.VERSION!==1){this.log(`Steering VERSION ${f.VERSION} not supported!`);return}this.updated=performance.now(),this.timeToLoad=f.TTL;const{"RELOAD-URI":m,"PATHWAY-CLONES":T,"PATHWAY-PRIORITY":E}=f;if(m)try{this.uri=new self.URL(m,i).href}catch{this.enabled=!1,this.log(`Failed to parse Steering Manifest RELOAD-URI: ${m}`);return}this.scheduleRefresh(this.uri||d.url),T&&this.clonePathways(T);const x={steeringManifest:f,url:i.toString()};this.hls.trigger(p.STEERING_MANIFEST_LOADED,x),E&&this.updatePathwayPriority(E)},onError:(h,u,d,g)=>{if(this.log(`Error loading steering manifest: ${h.code} ${h.text} (${u.url})`),this.stopLoad(),h.code===410){this.enabled=!1,this.log(`Steering manifest ${u.url} no longer available`);return}let f=this.timeToLoad*1e3;if(h.code===429){const m=this.loader;if(typeof(m==null?void 0:m.getResponseHeader)=="function"){const T=m.getResponseHeader("Retry-After");T&&(f=parseFloat(T)*1e3)}this.log(`Steering manifest ${u.url} rate limited`);return}this.scheduleRefresh(this.uri||u.url,f)},onTimeout:(h,u,d)=>{this.log(`Timeout loading steering manifest (${u.url})`),this.scheduleRefresh(this.uri||u.url)}};this.log(`Requesting steering manifest: ${i}`),this.loader.load(r,l,c)}scheduleRefresh(e,t=this.timeToLoad*1e3){this.clearTimeout(),this.reloadTimer=self.setTimeout(()=>{var s;const i=(s=this.hls)==null?void 0:s.media;if(i&&!i.ended){this.loadSteeringManifest(e);return}this.scheduleRefresh(e,this.timeToLoad*1e3)},t)}}function Ni(a,e,t,s){a&&Object.keys(e).forEach(i=>{const r=a.filter(n=>n.groupId===i).map(n=>{const o=se({},n);return o.details=void 0,o.attrs=new ee(o.attrs),o.url=o.attrs.URI=Hr(n.url,n.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",t),o.groupId=o.attrs["GROUP-ID"]=e[i],o.attrs["PATHWAY-ID"]=s,o});a.push(...r)})}function Hr(a,e,t,s){const{HOST:i,PARAMS:r,[t]:n}=s;let o;e&&(o=n==null?void 0:n[e],o&&(a=o));const l=new self.URL(a);return i&&!o&&(l.host=i),r&&Object.keys(r).sort().forEach(c=>{c&&l.searchParams.set(c,r[c])}),l.href}const sc=/^age:\s*[\d.]+\s*$/im;class Wr{constructor(e){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=null,this.loader=null,this.stats=void 0,this.xhrSetup=e&&e.xhrSetup||null,this.stats=new Ft,this.retryDelay=0}destroy(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null,this.context=null,this.xhrSetup=null}abortInternal(){const e=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),e&&(e.onreadystatechange=null,e.onprogress=null,e.readyState!==4&&(this.stats.aborted=!0,e.abort()))}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}load(e,t,s){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=e,this.config=t,this.callbacks=s,this.loadInternal()}loadInternal(){const{config:e,context:t}=this;if(!e||!t)return;const s=this.loader=new self.XMLHttpRequest,i=this.stats;i.loading.first=0,i.loaded=0,i.aborted=!1;const r=this.xhrSetup;r?Promise.resolve().then(()=>{if(!(this.loader!==s||this.stats.aborted))return r(s,t.url)}).catch(n=>{if(!(this.loader!==s||this.stats.aborted))return s.open("GET",t.url,!0),r(s,t.url)}).then(()=>{this.loader!==s||this.stats.aborted||this.openAndSendXhr(s,t,e)}).catch(n=>{this.callbacks.onError({code:s.status,text:n.message},t,s,i)}):this.openAndSendXhr(s,t,e)}openAndSendXhr(e,t,s){e.readyState||e.open("GET",t.url,!0);const i=t.headers,{maxTimeToFirstByteMs:r,maxLoadTimeMs:n}=s.loadPolicy;if(i)for(const o in i)e.setRequestHeader(o,i[o]);t.rangeEnd&&e.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,self.clearTimeout(this.requestTimeout),s.timeout=r&&O(r)?r:n,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),s.timeout),e.send()}readystatechange(){const{context:e,loader:t,stats:s}=this;if(!e||!t)return;const i=t.readyState,r=this.config;if(!s.aborted&&i>=2&&(s.loading.first===0&&(s.loading.first=Math.max(self.performance.now(),s.loading.start),r.timeout!==r.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),r.timeout=r.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),r.loadPolicy.maxLoadTimeMs-(s.loading.first-s.loading.start)))),i===4)){self.clearTimeout(this.requestTimeout),t.onreadystatechange=null,t.onprogress=null;const n=t.status,o=t.responseType!=="text";if(n>=200&&n<300&&(o&&t.response||t.responseText!==null)){s.loading.end=Math.max(self.performance.now(),s.loading.first);const l=o?t.response:t.responseText,c=t.responseType==="arraybuffer"?l.byteLength:l.length;if(s.loaded=s.total=c,s.bwEstimate=s.total*8e3/(s.loading.end-s.loading.first),!this.callbacks)return;const h=this.callbacks.onProgress;if(h&&h(s,e,l,t),!this.callbacks)return;const u={url:t.responseURL,data:l,code:n};this.callbacks.onSuccess(u,s,e,t)}else{const l=r.loadPolicy.errorRetry,c=s.retry,h={url:e.url,data:void 0,code:n};Dt(l,c,!1,h)?this.retry(l):(v.error(`${n} while loading ${e.url}`),this.callbacks.onError({code:n,text:t.statusText},e,t,s))}}}loadtimeout(){if(!this.config)return;const e=this.config.loadPolicy.timeoutRetry,t=this.stats.retry;if(Dt(e,t,!0))this.retry(e);else{var s;v.warn(`timeout while loading ${(s=this.context)==null?void 0:s.url}`);const i=this.callbacks;i&&(this.abortInternal(),i.onTimeout(this.stats,this.context,this.loader))}}retry(e){const{context:t,stats:s}=this;this.retryDelay=Ls(e,s.retry),s.retry++,v.warn(`${status?"HTTP Status "+status:"Timeout"} while loading ${t==null?void 0:t.url}, retrying ${s.retry}/${e.maxNumRetry} in ${this.retryDelay}ms`),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay)}loadprogress(e){const t=this.stats;t.loaded=e.loaded,e.lengthComputable&&(t.total=e.total)}getCacheAge(){let e=null;if(this.loader&&sc.test(this.loader.getAllResponseHeaders())){const t=this.loader.getResponseHeader("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.loader&&new RegExp(`^${e}:\\s*[\\d.]+\\s*$`,"im").test(this.loader.getAllResponseHeaders())?this.loader.getResponseHeader(e):null}}function ic(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch{}return!1}const rc=/(\d+)-(\d+)\/(\d+)/;class Ui{constructor(e){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=null,this.response=null,this.controller=void 0,this.context=null,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=e.fetchSetup||lc,this.controller=new self.AbortController,this.stats=new Ft}destroy(){this.loader=this.callbacks=this.context=this.config=this.request=null,this.abortInternal(),this.response=null,this.fetchSetup=this.controller=this.stats=null}abortInternal(){this.controller&&!this.stats.loading.end&&(this.stats.aborted=!0,this.controller.abort())}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)}load(e,t,s){const i=this.stats;if(i.loading.start)throw new Error("Loader can only be used once.");i.loading.start=self.performance.now();const r=nc(e,this.controller.signal),n=s.onProgress,o=e.responseType==="arraybuffer",l=o?"byteLength":"length",{maxTimeToFirstByteMs:c,maxLoadTimeMs:h}=t.loadPolicy;this.context=e,this.config=t,this.callbacks=s,this.request=this.fetchSetup(e,r),self.clearTimeout(this.requestTimeout),t.timeout=c&&O(c)?c:h,this.requestTimeout=self.setTimeout(()=>{this.abortInternal(),s.onTimeout(i,e,this.response)},t.timeout),self.fetch(this.request).then(u=>{this.response=this.loader=u;const d=Math.max(self.performance.now(),i.loading.start);if(self.clearTimeout(this.requestTimeout),t.timeout=h,this.requestTimeout=self.setTimeout(()=>{this.abortInternal(),s.onTimeout(i,e,this.response)},h-(d-i.loading.start)),!u.ok){const{status:g,statusText:f}=u;throw new cc(f||"fetch, bad network response",g,u)}return i.loading.first=d,i.total=oc(u.headers)||i.total,n&&O(t.highWaterMark)?this.loadProgressively(u,i,e,t.highWaterMark,n):o?u.arrayBuffer():e.responseType==="json"?u.json():u.text()}).then(u=>{const d=this.response;if(!d)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),i.loading.end=Math.max(self.performance.now(),i.loading.first);const g=u[l];g&&(i.loaded=i.total=g);const f={url:d.url,data:u,code:d.status};n&&!O(t.highWaterMark)&&n(i,e,u,d),s.onSuccess(f,i,e,d)}).catch(u=>{if(self.clearTimeout(this.requestTimeout),i.aborted)return;const d=u&&u.code||0,g=u?u.message:null;s.onError({code:d,text:g},e,u?u.details:null,i)})}getCacheAge(){let e=null;if(this.response){const t=this.response.headers.get("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.response?this.response.headers.get(e):null}loadProgressively(e,t,s,i=0,r){const n=new dr,o=e.body.getReader(),l=()=>o.read().then(c=>{if(c.done)return n.dataLength&&r(t,s,n.flush(),e),Promise.resolve(new ArrayBuffer(0));const h=c.value,u=h.length;return t.loaded+=u,u=i&&r(t,s,n.flush(),e)):r(t,s,h,e),l()}).catch(()=>Promise.reject());return l()}}function nc(a,e){const t={method:"GET",mode:"cors",credentials:"same-origin",signal:e,headers:new self.Headers(se({},a.headers))};return a.rangeEnd&&t.headers.set("Range","bytes="+a.rangeStart+"-"+String(a.rangeEnd-1)),t}function ac(a){const e=rc.exec(a);if(e)return parseInt(e[2])-parseInt(e[1])+1}function oc(a){const e=a.get("Content-Range");if(e){const s=ac(e);if(O(s))return s}const t=a.get("Content-Length");if(t)return parseInt(t)}function lc(a,e){return new self.Request(a.url,e)}class cc extends Error{constructor(e,t,s){super(e),this.code=void 0,this.details=void 0,this.code=t,this.details=s}}const hc=/\s/,uc={newCue(a,e,t,s){const i=[];let r,n,o,l,c;const h=self.VTTCue||self.TextTrackCue;for(let d=0;d=16?l--:l++;const g=Fr(c.trim()),f=Os(e,t,g);a!=null&&(u=a.cues)!=null&&u.getCueById(f)||(n=new h(e,t,g),n.id=f,n.line=d+1,n.align="left",n.position=10+Math.min(80,Math.floor(l*8/32)*10),i.push(n))}return a&&i.length&&(i.sort((d,g)=>d.line==="auto"||g.line==="auto"?0:d.line>8&&g.line>8?g.line-d.line:d.line-g.line),i.forEach(d=>rr(a,d))),i}},dc={maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null},Yr=oe(oe({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,preferManagedMediaSource:!0,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,frontBufferFlushThreshold:1/0,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,workerPath:null,enableSoftwareAES:!0,startLevel:void 0,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:Wr,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:Ua,bufferController:Vo,capLevelController:Ms,errorController:Ia,fpsController:Tl,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrEwmaDefaultEstimateMax:5e6,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystems:{},drmSystemOptions:{},requestMediaKeySystemAccessFunc:Hi,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableID3MetadataCues:!0,useMediaCapabilities:!0,certLoadPolicy:{default:dc},keyLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"},errorRetry:{maxNumRetry:8,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"}}},manifestLoadPolicy:{default:{maxTimeToFirstByteMs:1/0,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:2,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},fragLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:12e4,timeoutRetry:{maxNumRetry:4,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:6,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},steeringManifestLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3},fc()),{},{subtitleStreamController:Bo,subtitleTrackController:Go,timelineController:ml,audioStreamController:No,audioTrackController:Uo,emeController:Ye,cmcdController:Zl,contentSteeringController:tc});function fc(){return{cueHandler:uc,enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function gc(a,e){if((e.liveSyncDurationCount||e.liveMaxLatencyDurationCount)&&(e.liveSyncDuration||e.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(e.liveMaxLatencyDurationCount!==void 0&&(e.liveSyncDurationCount===void 0||e.liveMaxLatencyDurationCount<=e.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(e.liveMaxLatencyDuration!==void 0&&(e.liveSyncDuration===void 0||e.liveMaxLatencyDuration<=e.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');const t=ys(a),s=["manifest","level","frag"],i=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return s.forEach(r=>{const n=`${r==="level"?"playlist":r}LoadPolicy`,o=e[n]===void 0,l=[];i.forEach(c=>{const h=`${r}Loading${c}`,u=e[h];if(u!==void 0&&o){l.push(h);const d=t[n].default;switch(e[n]={default:d},c){case"TimeOut":d.maxLoadTimeMs=u,d.maxTimeToFirstByteMs=u;break;case"MaxRetry":d.errorRetry.maxNumRetry=u,d.timeoutRetry.maxNumRetry=u;break;case"RetryDelay":d.errorRetry.retryDelayMs=u,d.timeoutRetry.retryDelayMs=u;break;case"MaxRetryTimeout":d.errorRetry.maxRetryDelayMs=u,d.timeoutRetry.maxRetryDelayMs=u;break}}}),l.length&&v.warn(`hls.js config: "${l.join('", "')}" setting(s) are deprecated, use "${n}": ${JSON.stringify(e[n])}`)}),oe(oe({},t),e)}function ys(a){return a&&typeof a=="object"?Array.isArray(a)?a.map(ys):Object.keys(a).reduce((e,t)=>(e[t]=ys(a[t]),e),{}):a}function mc(a){const e=a.loader;e!==Ui&&e!==Wr?(v.log("[config]: Custom loader detected, cannot enable progressive streaming"),a.progressive=!1):ic()&&(a.loader=Ui,a.progressive=!0,a.enableSoftwareAES=!0,v.log("[config]: Progressive streaming enabled, using FetchLoader"))}let rs;class pc extends Rs{constructor(e,t){super(e,"[level-controller]"),this._levels=[],this._firstLevel=-1,this._maxAutoLevel=-1,this._startLevel=void 0,this.currentLevel=null,this.currentLevelIndex=-1,this.manualLevelIndex=-1,this.steering=void 0,this.onParsedComplete=void 0,this.steering=t,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(p.LEVEL_LOADED,this.onLevelLoaded,this),e.on(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(p.FRAG_BUFFERED,this.onFragBuffered,this),e.on(p.ERROR,this.onError,this)}_unregisterListeners(){const{hls:e}=this;e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(p.LEVEL_LOADED,this.onLevelLoaded,this),e.off(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(p.FRAG_BUFFERED,this.onFragBuffered,this),e.off(p.ERROR,this.onError,this)}destroy(){this._unregisterListeners(),this.steering=null,this.resetLevels(),super.destroy()}stopLoad(){this._levels.forEach(t=>{t.loadError=0,t.fragmentError=0}),super.stopLoad()}resetLevels(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[],this._maxAutoLevel=-1}onManifestLoading(e,t){this.resetLevels()}onManifestLoaded(e,t){const s=this.hls.config.preferManagedMediaSource,i=[],r={},n={};let o=!1,l=!1,c=!1;t.levels.forEach(h=>{var u,d;const g=h.attrs;let{audioCodec:f,videoCodec:m}=h;((u=f)==null?void 0:u.indexOf("mp4a.40.34"))!==-1&&(rs||(rs=/chrome|firefox/i.test(navigator.userAgent)),rs&&(h.audioCodec=f=void 0)),f&&(h.audioCodec=f=Rt(f,s)),((d=m)==null?void 0:d.indexOf("avc1"))===0&&(m=h.videoCodec=ta(m));const{width:T,height:E,unknownCodecs:x}=h;if(o||(o=!!(T&&E)),l||(l=!!m),c||(c=!!f),x!=null&&x.length||f&&!Vt(f,"audio",s)||m&&!Vt(m,"video",s))return;const{CODECS:y,"FRAME-RATE":I,"HDCP-LEVEL":S,"PATHWAY-ID":D,RESOLUTION:R,"VIDEO-RANGE":_}=g,b=`${`${D||"."}-`}${h.bitrate}-${R}-${I}-${y}-${_}-${S}`;if(r[b])if(r[b].uri!==h.url&&!h.attrs["PATHWAY-ID"]){const w=n[b]+=1;h.attrs["PATHWAY-ID"]=new Array(w+1).join(".");const V=new je(h);r[b]=V,i.push(V)}else r[b].addGroupId("audio",g.AUDIO),r[b].addGroupId("text",g.SUBTITLES);else{const w=new je(h);r[b]=w,n[b]=1,i.push(w)}}),this.filterAndSortMediaOptions(i,t,o,l,c)}filterAndSortMediaOptions(e,t,s,i,r){let n=[],o=[],l=e;if((s||i)&&r&&(l=l.filter(({videoCodec:f,videoRange:m,width:T,height:E})=>(!!f||!!(T&&E))&&ga(m))),l.length===0){Promise.resolve().then(()=>{if(this.hls){t.levels.length&&this.warn(`One or more CODECS in variant not supported: ${JSON.stringify(t.levels[0].attrs)}`);const f=new Error("no level with compatible codecs found in manifest");this.hls.trigger(p.ERROR,{type:$.MEDIA_ERROR,details:L.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:f,reason:f.message})}});return}if(t.audioTracks){const{preferManagedMediaSource:f}=this.hls.config;n=t.audioTracks.filter(m=>!m.audioCodec||Vt(m.audioCodec,"audio",f)),Bi(n)}t.subtitles&&(o=t.subtitles,Bi(o));const c=l.slice(0);l.sort((f,m)=>{if(f.attrs["HDCP-LEVEL"]!==m.attrs["HDCP-LEVEL"])return(f.attrs["HDCP-LEVEL"]||"")>(m.attrs["HDCP-LEVEL"]||"")?1:-1;if(s&&f.height!==m.height)return f.height-m.height;if(f.frameRate!==m.frameRate)return f.frameRate-m.frameRate;if(f.videoRange!==m.videoRange)return It.indexOf(f.videoRange)-It.indexOf(m.videoRange);if(f.videoCodec!==m.videoCodec){const T=Ys(f.videoCodec),E=Ys(m.videoCodec);if(T!==E)return E-T}if(f.uri===m.uri&&f.codecSet!==m.codecSet){const T=Lt(f.codecSet),E=Lt(m.codecSet);if(T!==E)return E-T}return f.averageBitrate!==m.averageBitrate?f.averageBitrate-m.averageBitrate:0});let h=c[0];if(this.steering&&(l=this.steering.filterParsedLevels(l),l.length!==c.length)){for(let f=0;fT&&T===Yr.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=E)}break}const d=r&&!i,g={levels:l,audioTracks:n,subtitleTracks:o,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:r,video:i,altAudio:!d&&n.some(f=>!!f.url)};this.hls.trigger(p.MANIFEST_PARSED,g),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}get levels(){return this._levels.length===0?null:this._levels}get level(){return this.currentLevelIndex}set level(e){const t=this._levels;if(t.length===0)return;if(e<0||e>=t.length){const h=new Error("invalid level idx"),u=e<0;if(this.hls.trigger(p.ERROR,{type:$.OTHER_ERROR,details:L.LEVEL_SWITCH_ERROR,level:e,fatal:u,error:h,reason:h.message}),u)return;e=Math.min(e,t.length-1)}const s=this.currentLevelIndex,i=this.currentLevel,r=i?i.attrs["PATHWAY-ID"]:void 0,n=t[e],o=n.attrs["PATHWAY-ID"];if(this.currentLevelIndex=e,this.currentLevel=n,s===e&&n.details&&i&&r===o)return;this.log(`Switching to level ${e} (${n.height?n.height+"p ":""}${n.videoRange?n.videoRange+" ":""}${n.codecSet?n.codecSet+" ":""}@${n.bitrate})${o?" with Pathway "+o:""} from level ${s}${r?" with Pathway "+r:""}`);const l={level:e,attrs:n.attrs,details:n.details,bitrate:n.bitrate,averageBitrate:n.averageBitrate,maxBitrate:n.maxBitrate,realBitrate:n.realBitrate,width:n.width,height:n.height,codecSet:n.codecSet,audioCodec:n.audioCodec,videoCodec:n.videoCodec,audioGroups:n.audioGroups,subtitleGroups:n.subtitleGroups,loaded:n.loaded,loadError:n.loadError,fragmentError:n.fragmentError,name:n.name,id:n.id,uri:n.uri,url:n.url,urlId:0,audioGroupIds:n.audioGroupIds,textGroupIds:n.textGroupIds};this.hls.trigger(p.LEVEL_SWITCHING,l);const c=n.details;if(!c||c.live){const h=this.switchParams(n.uri,i==null?void 0:i.details,c);this.loadPlaylist(h)}}get manualLevel(){return this.manualLevelIndex}set manualLevel(e){this.manualLevelIndex=e,this._startLevel===void 0&&(this._startLevel=e),e!==-1&&(this.level=e)}get firstLevel(){return this._firstLevel}set firstLevel(e){this._firstLevel=e}get startLevel(){if(this._startLevel===void 0){const e=this.hls.config.startLevel;return e!==void 0?e:this.hls.firstAutoLevel}return this._startLevel}set startLevel(e){this._startLevel=e}onError(e,t){t.fatal||!t.context||t.context.type===Y.LEVEL&&t.context.level===this.level&&this.checkRetry(t)}onFragBuffered(e,{frag:t}){if(t!==void 0&&t.type===U.MAIN){const s=t.elementaryStreams;if(!Object.keys(s).some(r=>!!s[r]))return;const i=this._levels[t.level];i!=null&&i.loadError&&(this.log(`Resetting level error count of ${i.loadError} on frag buffered`),i.loadError=0)}}onLevelLoaded(e,t){var s;const{level:i,details:r}=t,n=this._levels[i];if(!n){var o;this.warn(`Invalid level index ${i}`),(o=t.deliveryDirectives)!=null&&o.skip&&(r.deltaUpdateFailed=!0);return}i===this.currentLevelIndex?(n.fragmentError===0&&(n.loadError=0),this.playlistLoaded(i,t,n.details)):(s=t.deliveryDirectives)!=null&&s.skip&&(r.deltaUpdateFailed=!0)}loadPlaylist(e){super.loadPlaylist();const t=this.currentLevelIndex,s=this.currentLevel;if(s&&this.shouldLoadPlaylist(s)){let i=s.uri;if(e)try{i=e.addDirectives(i)}catch(n){this.warn(`Could not construct new URL with HLS Delivery Directives: ${n}`)}const r=s.attrs["PATHWAY-ID"];this.log(`Loading level index ${t}${(e==null?void 0:e.msn)!==void 0?" at sn "+e.msn+" part "+e.part:""} with${r?" Pathway "+r:""} ${i}`),this.clearTimer(),this.hls.trigger(p.LEVEL_LOADING,{url:i,level:t,pathwayId:s.attrs["PATHWAY-ID"],id:0,deliveryDirectives:e||null})}}get nextLoadLevel(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel}set nextLoadLevel(e){this.level=e,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=e)}removeLevel(e){var t;const s=this._levels.filter((i,r)=>r!==e?!0:(this.steering&&this.steering.removeLevel(i),i===this.currentLevel&&(this.currentLevel=null,this.currentLevelIndex=-1,i.details&&i.details.fragments.forEach(n=>n.level=-1)),!1));lr(s),this._levels=s,this.currentLevelIndex>-1&&(t=this.currentLevel)!=null&&t.details&&(this.currentLevelIndex=this.currentLevel.details.fragments[0].level),this.hls.trigger(p.LEVELS_UPDATED,{levels:s})}onLevelsUpdated(e,{levels:t}){this._levels=t}checkMaxAutoUpdated(){const{autoLevelCapping:e,maxAutoLevel:t,maxHdcpLevel:s}=this.hls;this._maxAutoLevel!==t&&(this._maxAutoLevel=t,this.hls.trigger(p.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:e,levels:this.levels,maxAutoLevel:t,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:s}))}}function Bi(a){const e={};a.forEach(t=>{const s=t.groupId||"";t.id=e[s]=e[s]||0,e[s]++})}class Tc{constructor(e){this.config=void 0,this.keyUriToKeyInfo={},this.emeController=null,this.config=e}abort(e){for(const s in this.keyUriToKeyInfo){const i=this.keyUriToKeyInfo[s].loader;if(i){var t;if(e&&e!==((t=i.context)==null?void 0:t.frag.type))return;i.abort()}}}detach(){for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e];(t.mediaKeySessionContext||t.decryptdata.isCommonEncryption)&&delete this.keyUriToKeyInfo[e]}}destroy(){this.detach();for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e].loader;t&&t.destroy()}this.keyUriToKeyInfo={}}createKeyLoadError(e,t=L.KEY_LOAD_ERROR,s,i,r){return new Ce({type:$.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:r,error:s,networkDetails:i})}loadClear(e,t){if(this.emeController&&this.config.emeEnabled){const{sn:s,cc:i}=e;for(let r=0;r{n.setKeyFormat(o)});break}}}}load(e){return!e.decryptdata&&e.encrypted&&this.emeController?this.emeController.selectKeySystemFormat(e).then(t=>this.loadInternal(e,t)):this.loadInternal(e)}loadInternal(e,t){var s,i;t&&e.setKeyFormat(t);const r=e.decryptdata;if(!r){const c=new Error(t?`Expected frag.decryptdata to be defined after setting format ${t}`:"Missing decryption data on fragment in onKeyLoading");return Promise.reject(this.createKeyLoadError(e,L.KEY_LOAD_ERROR,c))}const n=r.uri;if(!n)return Promise.reject(this.createKeyLoadError(e,L.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${n}"`)));let o=this.keyUriToKeyInfo[n];if((s=o)!=null&&s.decryptdata.key)return r.key=o.decryptdata.key,Promise.resolve({frag:e,keyInfo:o});if((i=o)!=null&&i.keyLoadPromise){var l;switch((l=o.mediaKeySessionContext)==null?void 0:l.keyStatus){case void 0:case"status-pending":case"usable":case"usable-in-future":return o.keyLoadPromise.then(c=>(r.key=c.keyInfo.decryptdata.key,{frag:e,keyInfo:o}))}}switch(o=this.keyUriToKeyInfo[n]={decryptdata:r,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},r.method){case"ISO-23001-7":case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return r.keyFormat==="identity"?this.loadKeyHTTP(o,e):this.loadKeyEME(o,e);case"AES-128":return this.loadKeyHTTP(o,e);default:return Promise.reject(this.createKeyLoadError(e,L.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${r.method}"`)))}}loadKeyEME(e,t){const s={frag:t,keyInfo:e};if(this.emeController&&this.config.emeEnabled){const i=this.emeController.loadKey(s);if(i)return(e.keyLoadPromise=i.then(r=>(e.mediaKeySessionContext=r,s))).catch(r=>{throw e.keyLoadPromise=null,r})}return Promise.resolve(s)}loadKeyHTTP(e,t){const s=this.config,i=s.loader,r=new i(s);return t.keyLoader=e.loader=r,e.keyLoadPromise=new Promise((n,o)=>{const l={keyInfo:e,frag:t,responseType:"arraybuffer",url:e.decryptdata.uri},c=s.keyLoadPolicy.default,h={loadPolicy:c,timeout:c.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},u={onSuccess:(d,g,f,m)=>{const{frag:T,keyInfo:E,url:x}=f;if(!T.decryptdata||E!==this.keyUriToKeyInfo[x])return o(this.createKeyLoadError(T,L.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),m));E.decryptdata.key=T.decryptdata.key=new Uint8Array(d.data),T.keyLoader=null,E.loader=null,n({frag:T,keyInfo:E})},onError:(d,g,f,m)=>{this.resetLoader(g),o(this.createKeyLoadError(t,L.KEY_LOAD_ERROR,new Error(`HTTP Error ${d.code} loading key ${d.text}`),f,oe({url:l.url,data:void 0},d)))},onTimeout:(d,g,f)=>{this.resetLoader(g),o(this.createKeyLoadError(t,L.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),f))},onAbort:(d,g,f)=>{this.resetLoader(g),o(this.createKeyLoadError(t,L.INTERNAL_ABORTED,new Error("key loading aborted"),f))}};r.load(l,h,u)})}resetLoader(e){const{frag:t,keyInfo:s,url:i}=e,r=s.loader;t.keyLoader===r&&(t.keyLoader=null,s.loader=null),delete this.keyUriToKeyInfo[i],r&&r.destroy()}}function qr(){return self.SourceBuffer||self.WebKitSourceBuffer}function jr(){if(!Ue())return!1;const e=qr();return!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function"}function Ec(){if(!jr())return!1;const a=Ue();return typeof(a==null?void 0:a.isTypeSupported)=="function"&&(["avc1.42E01E,mp4a.40.2","av01.0.01M.08","vp09.00.50.08"].some(e=>a.isTypeSupported(st(e,"video")))||["mp4a.40.2","fLaC"].some(e=>a.isTypeSupported(st(e,"audio"))))}function yc(){var a;const e=qr();return typeof(e==null||(a=e.prototype)==null?void 0:a.changeType)=="function"}const xc=250,St=2,Sc=.1,vc=.05;class Ac{constructor(e,t,s,i){this.config=void 0,this.media=null,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=e,this.media=t,this.fragmentTracker=s,this.hls=i}destroy(){this.media=null,this.hls=this.fragmentTracker=null}poll(e,t){const{config:s,media:i,stalled:r}=this;if(i===null)return;const{currentTime:n,seeking:o}=i,l=this.seeking&&!o,c=!this.seeking&&o;if(this.seeking=o,n!==e){if(this.moved=!0,o||(this.nudgeRetry=0),r!==null){if(this.stallReported){const T=self.performance.now()-r;v.warn(`playback not stuck anymore @${n}, after ${Math.round(T)}ms`),this.stallReported=!1}this.stalled=null}return}if(c||l){this.stalled=null;return}if(i.paused&&!o||i.ended||i.playbackRate===0||!J.getBuffered(i).length){this.nudgeRetry=0;return}const h=J.bufferInfo(i,n,0),u=h.nextStart||0;if(o){const T=h.len>St,E=!u||t&&t.start<=n||u-n>St&&!this.fragmentTracker.getPartialFragment(n);if(T||E)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var d;if(!(h.len>0)&&!u)return;const E=Math.max(u,h.start||0)-n,x=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,I=(x==null||(d=x.details)==null?void 0:d.live)?x.details.targetduration*2:St,S=this.fragmentTracker.getPartialFragment(n);if(E>0&&(E<=I||S)){i.paused||this._trySkipBufferHole(S);return}}const g=self.performance.now();if(r===null){this.stalled=g;return}const f=g-r;if(!o&&f>=xc&&(this._reportStall(h),!this.media))return;const m=J.bufferInfo(i,n,s.maxBufferHole);this._tryFixBufferStall(m,f)}_tryFixBufferStall(e,t){const{config:s,fragmentTracker:i,media:r}=this;if(r===null)return;const n=r.currentTime,o=i.getPartialFragment(n);o&&(this._trySkipBufferHole(o)||!this.media)||(e.len>s.maxBufferHole||e.nextStart&&e.nextStart-ns.highBufferWatchdogPeriod*1e3&&(v.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())}_reportStall(e){const{hls:t,media:s,stallReported:i}=this;if(!i&&s){this.stallReported=!0;const r=new Error(`Playback stalling at @${s.currentTime} due to low buffer (${JSON.stringify(e)})`);v.warn(r.message),t.trigger(p.ERROR,{type:$.MEDIA_ERROR,details:L.BUFFER_STALLED_ERROR,fatal:!1,error:r,buffer:e.len})}}_trySkipBufferHole(e){const{config:t,hls:s,media:i}=this;if(i===null)return 0;const r=i.currentTime,n=J.bufferInfo(i,r,0),o=r0&&n.len<1&&i.readyState<3,h=o-r;if(h>0&&(l||c)){if(h>t.maxBufferHole){const{fragmentTracker:d}=this;let g=!1;if(r===0){const f=d.getAppendedFrag(0,U.MAIN);f&&o1?(i=0,this.bitrateTest=!0):i=s.firstAutoLevel),s.nextLoadLevel=i,this.level=s.loadLevel,this.loadedmetadata=!1}t>0&&e===-1&&(this.log(`Override startPosition with lastCurrentTime @${t.toFixed(3)}`),e=t),this.state=C.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}else this._forceStartLoad=!0,this.state=C.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case C.WAITING_LEVEL:{const{levels:t,level:s}=this,i=t==null?void 0:t[s],r=i==null?void 0:i.details;if(r&&(!r.live||this.levelLastLoaded===i)){if(this.waitForCdnTuneIn(r))break;this.state=C.IDLE;break}else if(this.hls.nextLoadLevel!==this.level){this.state=C.IDLE;break}break}case C.FRAG_LOADING_WAITING_RETRY:{var e;const t=self.performance.now(),s=this.retryDate;if(!s||t>=s||(e=this.media)!=null&&e.seeking){const{levels:i,level:r}=this,n=i==null?void 0:i[r];this.resetStartWhenNotLoaded(n||null),this.state=C.IDLE}}break}this.state===C.IDLE&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){super.onTickEnd(),this.checkBuffer(),this.checkFragmentChanged()}doTickIdle(){const{hls:e,levelLastLoaded:t,levels:s,media:i}=this;if(t===null||!i&&(this.startFragRequested||!e.config.startFragPrefetch)||this.altAudio&&this.audioOnly)return;const r=e.nextLoadLevel;if(!(s!=null&&s[r]))return;const n=s[r],o=this.getMainFwdBufferInfo();if(o===null)return;const l=this.getLevelDetails();if(l&&this._streamEnded(o,l)){const m={};this.altAudio&&(m.type="video"),this.hls.trigger(p.BUFFER_EOS,m),this.state=C.ENDED;return}e.loadLevel!==r&&e.manualLevel===-1&&this.log(`Adapting to level ${r} from level ${this.level}`),this.level=e.nextLoadLevel=r;const c=n.details;if(!c||this.state===C.WAITING_LEVEL||c.live&&this.levelLastLoaded!==n){this.level=r,this.state=C.WAITING_LEVEL;return}const h=o.len,u=this.getMaxBufferLength(n.maxBitrate);if(h>=u)return;this.backtrackFragment&&this.backtrackFragment.start>o.end&&(this.backtrackFragment=null);const d=this.backtrackFragment?this.backtrackFragment.start:o.end;let g=this.getNextFragment(d,c);if(this.couldBacktrack&&!this.fragPrevious&&g&&g.sn!=="initSegment"&&this.fragmentTracker.getState(g)!==ae.OK){var f;const T=((f=this.backtrackFragment)!=null?f:g).sn-c.startSN,E=c.fragments[T-1];E&&g.cc===E.cc&&(g=E,this.fragmentTracker.removeFragment(E))}else this.backtrackFragment&&o.len&&(this.backtrackFragment=null);if(g&&this.isLoopLoading(g,d)){if(!g.gap){const T=this.audioOnly&&!this.altAudio?X.AUDIO:X.VIDEO,E=(T===X.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;E&&this.afterBufferFlushed(E,T,U.MAIN)}g=this.getNextFragmentLoopLoading(g,c,o,U.MAIN,u)}g&&(g.initSegment&&!g.initSegment.data&&!this.bitrateTest&&(g=g.initSegment),this.loadFragment(g,n,d))}loadFragment(e,t,s){const i=this.fragmentTracker.getState(e);this.fragCurrent=e,i===ae.NOT_LOADED||i===ae.PARTIAL?e.sn==="initSegment"?this._loadInitSegment(e,t):this.bitrateTest?(this.log(`Fragment ${e.sn} of level ${e.level} is being downloaded to test bitrate and will not be buffered`),this._loadBitrateTestFrag(e,t)):(this.startFragRequested=!0,super.loadFragment(e,t,s)):this.clearTrackerIfNeeded(e)}getBufferedFrag(e){return this.fragmentTracker.getBufferedFrag(e,U.MAIN)}followingBufferedFrag(e){return e?this.getBufferedFrag(e.end+.5):null}immediateLevelSwitch(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}nextLevelSwitch(){const{levels:e,media:t}=this;if(t!=null&&t.readyState){let s;const i=this.getAppendedFrag(t.currentTime);i&&i.start>1&&this.flushMainBuffer(0,i.start-1);const r=this.getLevelDetails();if(r!=null&&r.live){const o=this.getMainFwdBufferInfo();if(!o||o.len{const n=r.audioCodec;n&&(s=s||n.indexOf("mp4a.40.2")!==-1,i=i||n.indexOf("mp4a.40.5")!==-1)}),this.audioCodecSwitch=s&&i&&!yc(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=t.levels,this.startFragRequested=!1}onLevelLoading(e,t){const{levels:s}=this;if(!s||this.state!==C.IDLE)return;const i=s[t.level];(!i.details||i.details.live&&this.levelLastLoaded!==i||this.waitForCdnTuneIn(i.details))&&(this.state=C.WAITING_LEVEL)}onLevelLoaded(e,t){var s;const{levels:i}=this,r=t.level,n=t.details,o=n.totalduration;if(!i){this.warn(`Levels were reset while loading level ${r}`);return}this.log(`Level ${r} loaded [${n.startSN},${n.endSN}]${n.lastPartSn?`[part-${n.lastPartSn}-${n.lastPartIndex}]`:""}, cc [${n.startCC}, ${n.endCC}] duration:${o}`);const l=i[r],c=this.fragCurrent;c&&(this.state===C.FRAG_LOADING||this.state===C.FRAG_LOADING_WAITING_RETRY)&&c.level!==t.level&&c.loader&&this.abortCurrentFrag();let h=0;if(n.live||(s=l.details)!=null&&s.live){var u;if(this.checkLiveUpdate(n),n.deltaUpdateFailed)return;h=this.alignPlaylists(n,l.details,(u=this.levelLastLoaded)==null?void 0:u.details)}if(l.details=n,this.levelLastLoaded=l,this.hls.trigger(p.LEVEL_UPDATED,{details:n,level:r}),this.state===C.WAITING_LEVEL){if(this.waitForCdnTuneIn(n))return;this.state=C.IDLE}this.startFragRequested?n.live&&this.synchronizeToLiveEdge(n):this.setStartPosition(n,h),this.tick()}_handleFragmentLoadProgress(e){var t;const{frag:s,part:i,payload:r}=e,{levels:n}=this;if(!n){this.warn(`Levels were reset while fragment load was in progress. Fragment ${s.sn} of level ${s.level} will not be buffered`);return}const o=n[s.level],l=o.details;if(!l){this.warn(`Dropping fragment ${s.sn} of level ${s.level} after level details were reset`),this.fragmentTracker.removeFragment(s);return}const c=o.videoCodec,h=l.PTSKnown||!l.live,u=(t=s.initSegment)==null?void 0:t.data,d=this._getAudioCodec(o),g=this.transmuxer=this.transmuxer||new Dr(this.hls,U.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),f=i?i.index:-1,m=f!==-1,T=new Is(s.level,s.sn,s.stats.chunkCount,r.byteLength,f,m),E=this.initPTS[s.cc];g.push(r,u,d,c,s,i,l.totalduration,h,T,E)}onAudioTrackSwitching(e,t){const s=this.altAudio;if(!!!t.url){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;const n=this.fragCurrent;n&&(this.log("Switching to main audio track, cancel main fragment load"),n.abortRequests(),this.fragmentTracker.removeFragment(n)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();const r=this.hls;s&&(r.trigger(p.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null}),this.fragmentTracker.removeAllFragments()),r.trigger(p.AUDIO_TRACK_SWITCHED,t)}}onAudioTrackSwitched(e,t){const s=t.id,i=!!this.hls.audioTracks[s].url;if(i){const r=this.videoBuffer;r&&this.mediaBuffer!==r&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=r)}this.altAudio=i,this.tick()}onBufferCreated(e,t){const s=t.tracks;let i,r,n=!1;for(const o in s){const l=s[o];if(l.id==="main"){if(r=o,i=l,o==="video"){const c=s[o];c&&(this.videoBuffer=c.buffer)}}else n=!0}n&&i?(this.log(`Alternate track found, use ${r}.buffered to schedule main fragment loading`),this.mediaBuffer=i.buffer):this.mediaBuffer=this.media}onFragBuffered(e,t){const{frag:s,part:i}=t;if(s&&s.type!==U.MAIN)return;if(this.fragContextChanged(s)){this.warn(`Fragment ${s.sn}${i?" p: "+i.index:""} of level ${s.level} finished buffering, but was aborted. state: ${this.state}`),this.state===C.PARSED&&(this.state=C.IDLE);return}const r=i?i.stats:s.stats;this.fragLastKbps=Math.round(8*r.total/(r.buffering.end-r.loading.first)),s.sn!=="initSegment"&&(this.fragPrevious=s),this.fragBufferedComplete(s,i)}onError(e,t){var s;if(t.fatal){this.state=C.ERROR;return}switch(t.details){case L.FRAG_GAP:case L.FRAG_PARSING_ERROR:case L.FRAG_DECRYPT_ERROR:case L.FRAG_LOAD_ERROR:case L.FRAG_LOAD_TIMEOUT:case L.KEY_LOAD_ERROR:case L.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(U.MAIN,t);break;case L.LEVEL_LOAD_ERROR:case L.LEVEL_LOAD_TIMEOUT:case L.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===C.WAITING_LEVEL&&((s=t.context)==null?void 0:s.type)===Y.LEVEL&&(this.state=C.IDLE);break;case L.BUFFER_APPEND_ERROR:case L.BUFFER_FULL_ERROR:if(!t.parent||t.parent!=="main")return;if(t.details===L.BUFFER_APPEND_ERROR){this.resetLoadingState();return}this.reduceLengthAndFlushBuffer(t)&&this.flushMainBuffer(0,Number.POSITIVE_INFINITY);break;case L.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}checkBuffer(){const{media:e,gapController:t}=this;if(!(!e||!t||!e.readyState)){if(this.loadedmetadata||!J.getBuffered(e).length){const s=this.state!==C.IDLE?this.fragCurrent:null;t.poll(this.lastCurrentTime,s)}this.lastCurrentTime=e.currentTime}}onFragLoadEmergencyAborted(){this.state=C.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()}onBufferFlushed(e,{type:t}){if(t!==X.AUDIO||this.audioOnly&&!this.altAudio){const s=(t===X.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(s,t,U.MAIN),this.tick()}}onLevelsUpdated(e,t){this.level>-1&&this.fragCurrent&&(this.level=this.fragCurrent.level),this.levels=t.levels}swapAudioCodec(){this.audioCodecSwap=!this.audioCodecSwap}seekToStartPos(){const{media:e}=this;if(!e)return;const t=e.currentTime;let s=this.startPosition;if(s>=0&&t0&&(n{const{hls:i}=this;if(!s||this.fragContextChanged(e))return;t.fragmentError=0,this.state=C.IDLE,this.startFragRequested=!1,this.bitrateTest=!1;const r=e.stats;r.parsing.start=r.parsing.end=r.buffering.start=r.buffering.end=self.performance.now(),i.trigger(p.FRAG_LOADED,s),e.bitrateTest=!1})}_handleTransmuxComplete(e){var t;const s="main",{hls:i}=this,{remuxResult:r,chunkMeta:n}=e,o=this.getCurrentContext(n);if(!o){this.resetWhenMissingContext(n);return}const{frag:l,part:c,level:h}=o,{video:u,text:d,id3:g,initSegment:f}=r,{details:m}=h,T=this.altAudio?void 0:r.audio;if(this.fragContextChanged(l)){this.fragmentTracker.removeFragment(l);return}if(this.state=C.PARSING,f){if(f!=null&&f.tracks){const y=l.initSegment||l;this._bufferInitSegment(h,f.tracks,y,n),i.trigger(p.FRAG_PARSING_INIT_SEGMENT,{frag:y,id:s,tracks:f.tracks})}const E=f.initPTS,x=f.timescale;O(E)&&(this.initPTS[l.cc]={baseTime:E,timescale:x},i.trigger(p.INIT_PTS_FOUND,{frag:l,id:s,initPTS:E,timescale:x}))}if(u&&m&&l.sn!=="initSegment"){const E=m.fragments[l.sn-1-m.startSN],x=l.sn===m.startSN,y=!E||l.cc>E.cc;if(r.independent!==!1){const{startPTS:I,endPTS:S,startDTS:D,endDTS:R}=u;if(c)c.elementaryStreams[u.type]={startPTS:I,endPTS:S,startDTS:D,endDTS:R};else if(u.firstKeyFrame&&u.independent&&n.id===1&&!y&&(this.couldBacktrack=!0),u.dropped&&u.independent){const _=this.getMainFwdBufferInfo(),k=(_?_.end:this.getLoadPosition())+this.config.maxBufferHole,b=u.firstKeyFramePTS?u.firstKeyFramePTS:I;if(!x&&kSt&&(l.gap=!0);l.setElementaryStreamInfo(u.type,I,S,D,R),this.backtrackFragment&&(this.backtrackFragment=l),this.bufferFragmentData(u,l,c,n,x||y)}else if(x||y)l.gap=!0;else{this.backtrack(l);return}}if(T){const{startPTS:E,endPTS:x,startDTS:y,endDTS:I}=T;c&&(c.elementaryStreams[X.AUDIO]={startPTS:E,endPTS:x,startDTS:y,endDTS:I}),l.setElementaryStreamInfo(X.AUDIO,E,x,y,I),this.bufferFragmentData(T,l,c,n)}if(m&&g!=null&&(t=g.samples)!=null&&t.length){const E={id:s,frag:l,details:m,samples:g.samples};i.trigger(p.FRAG_PARSING_METADATA,E)}if(m&&d){const E={id:s,frag:l,details:m,samples:d.samples};i.trigger(p.FRAG_PARSING_USERDATA,E)}}_bufferInitSegment(e,t,s,i){if(this.state!==C.PARSING)return;this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&delete t.audio;const{audio:r,video:n,audiovideo:o}=t;if(r){let l=e.audioCodec;const c=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){l&&(l.indexOf("mp4a.40.5")!==-1?l="mp4a.40.2":l="mp4a.40.5");const h=r.metadata;h&&"channelCount"in h&&(h.channelCount||1)!==1&&c.indexOf("firefox")===-1&&(l="mp4a.40.5")}l&&l.indexOf("mp4a.40.5")!==-1&&c.indexOf("android")!==-1&&r.container!=="audio/mpeg"&&(l="mp4a.40.2",this.log(`Android: force audio codec to ${l}`)),e.audioCodec&&e.audioCodec!==l&&this.log(`Swapping manifest audio codec "${e.audioCodec}" for "${l}"`),r.levelCodec=l,r.id="main",this.log(`Init audio buffer, container:${r.container}, codecs[selected/level/parsed]=[${l||""}/${e.audioCodec||""}/${r.codec}]`)}n&&(n.levelCodec=e.videoCodec,n.id="main",this.log(`Init video buffer, container:${n.container}, codecs[level/parsed]=[${e.videoCodec||""}/${n.codec}]`)),o&&this.log(`Init audiovideo buffer, container:${o.container}, codecs[level/parsed]=[${e.codecs}/${o.codec}]`),this.hls.trigger(p.BUFFER_CODECS,t),Object.keys(t).forEach(l=>{const h=t[l].initSegment;h!=null&&h.byteLength&&this.hls.trigger(p.BUFFER_APPENDING,{type:l,data:h,frag:s,part:null,chunkMeta:i,parent:s.type})}),this.tickImmediate()}getMainFwdBufferInfo(){return this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,U.MAIN)}backtrack(e){this.couldBacktrack=!0,this.backtrackFragment=e,this.resetTransmuxer(),this.flushBufferGap(e),this.fragmentTracker.removeFragment(e),this.fragPrevious=null,this.nextLoadPosition=e.start,this.state=C.IDLE}checkFragmentChanged(){const e=this.media;let t=null;if(e&&e.readyState>1&&e.seeking===!1){const s=e.currentTime;if(J.isBuffered(e,s)?t=this.getAppendedFrag(s):J.isBuffered(e,s+.1)&&(t=this.getAppendedFrag(s+.1)),t){this.backtrackFragment=null;const i=this.fragPlaying,r=t.level;(!i||t.sn!==i.sn||i.level!==r)&&(this.fragPlaying=t,this.hls.trigger(p.FRAG_CHANGED,{frag:t}),(!i||i.level!==r)&&this.hls.trigger(p.LEVEL_SWITCHED,{level:r}))}}}get nextLevel(){const e=this.nextBufferedFrag;return e?e.level:-1}get currentFrag(){const e=this.media;return e?this.fragPlaying||this.getAppendedFrag(e.currentTime):null}get currentProgramDateTime(){const e=this.media;if(e){const t=e.currentTime,s=this.currentFrag;if(s&&O(t)&&O(s.programDateTime)){const i=s.programDateTime+(t-s.start)*1e3;return new Date(i)}}return null}get currentLevel(){const e=this.currentFrag;return e?e.level:-1}get nextBufferedFrag(){const e=this.currentFrag;return e?this.followingBufferedFrag(e):null}get forceStartLoad(){return this._forceStartLoad}}class we{static get version(){return"1.5.14"}static isMSESupported(){return jr()}static isSupported(){return Ec()}static getMediaSource(){return Ue()}static get Events(){return p}static get ErrorTypes(){return $}static get ErrorDetails(){return L}static get DefaultConfig(){return we.defaultConfig?we.defaultConfig:Yr}static set DefaultConfig(e){we.defaultConfig=e}constructor(e={}){this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this.started=!1,this._emitter=new Ps,this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null,this.triggeringException=void 0,dn(e.debug||!1,"Hls instance");const t=this.config=gc(we.DefaultConfig,e);this.userConfig=e,t.progressive&&mc(t);const{abrController:s,bufferController:i,capLevelController:r,errorController:n,fpsController:o}=t,l=new n(this),c=this.abrController=new s(this),h=this.bufferController=new i(this),u=this.capLevelController=new r(this),d=new o(this),g=new aa(this),f=new ua(this),m=t.contentSteeringController,T=m?new m(this):null,E=this.levelController=new pc(this,T),x=new $a(this),y=new Tc(this.config),I=this.streamController=new Rc(this,x,y);u.setStreamController(I),d.setStreamController(I);const S=[g,E,I];T&&S.splice(1,0,T),this.networkControllers=S;const D=[c,h,u,d,f,x];this.audioTrackController=this.createController(t.audioTrackController,S);const R=t.audioStreamController;R&&S.push(new R(this,x,y)),this.subtitleTrackController=this.createController(t.subtitleTrackController,S);const _=t.subtitleStreamController;_&&S.push(new _(this,x,y)),this.createController(t.timelineController,D),y.emeController=this.emeController=this.createController(t.emeController,D),this.cmcdController=this.createController(t.cmcdController,D),this.latencyController=this.createController(da,D),this.coreComponents=D,S.push(l);const k=l.onErrorOut;typeof k=="function"&&this.on(p.ERROR,k,l)}createController(e,t){if(e){const s=new e(this);return t&&t.push(s),s}return null}on(e,t,s=this){this._emitter.on(e,t,s)}once(e,t,s=this){this._emitter.once(e,t,s)}removeAllListeners(e){this._emitter.removeAllListeners(e)}off(e,t,s=this,i){this._emitter.off(e,t,s,i)}listeners(e){return this._emitter.listeners(e)}emit(e,t,s){return this._emitter.emit(e,t,s)}trigger(e,t){if(this.config.debug)return this.emit(e,e,t);try{return this.emit(e,e,t)}catch(s){if(v.error("An internal error happened while handling event "+e+'. Error message: "'+s.message+'". Here is a stacktrace:',s),!this.triggeringException){this.triggeringException=!0;const i=e===p.ERROR;this.trigger(p.ERROR,{type:$.OTHER_ERROR,details:L.INTERNAL_EXCEPTION,fatal:i,event:e,error:s}),this.triggeringException=!1}}return!1}listenerCount(e){return this._emitter.listenerCount(e)}destroy(){v.log("destroy"),this.trigger(p.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(t=>t.destroy()),this.networkControllers.length=0,this.coreComponents.forEach(t=>t.destroy()),this.coreComponents.length=0;const e=this.config;e.xhrSetup=e.fetchSetup=void 0,this.userConfig=null}attachMedia(e){v.log("attachMedia"),this._media=e,this.trigger(p.MEDIA_ATTACHING,{media:e})}detachMedia(){v.log("detachMedia"),this.trigger(p.MEDIA_DETACHING,void 0),this._media=null}loadSource(e){this.stopLoad();const t=this.media,s=this.url,i=this.url=xs.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,v.log(`loadSource:${i}`),t&&s&&(s!==i||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(t)),this.trigger(p.MANIFEST_LOADING,{url:e})}startLoad(e=-1){v.log(`startLoad(${e})`),this.started=!0,this.networkControllers.forEach(t=>{t.startLoad(e)})}stopLoad(){v.log("stopLoad"),this.started=!1,this.networkControllers.forEach(e=>{e.stopLoad()})}resumeBuffering(){this.started&&this.networkControllers.forEach(e=>{"fragmentLoader"in e&&e.startLoad(-1)})}pauseBuffering(){this.networkControllers.forEach(e=>{"fragmentLoader"in e&&e.stopLoad()})}swapAudioCodec(){v.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){v.log("recoverMediaError");const e=this._media;this.detachMedia(),e&&this.attachMedia(e)}removeLevel(e){this.levelController.removeLevel(e)}get levels(){const e=this.levelController.levels;return e||[]}get currentLevel(){return this.streamController.currentLevel}set currentLevel(e){v.log(`set currentLevel:${e}`),this.levelController.manualLevel=e,this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(e){v.log(`set nextLevel:${e}`),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(e){v.log(`set loadLevel:${e}`),this.levelController.manualLevel=e}get nextLoadLevel(){return this.levelController.nextLoadLevel}set nextLoadLevel(e){this.levelController.nextLoadLevel=e}get firstLevel(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)}set firstLevel(e){v.log(`set firstLevel:${e}`),this.levelController.firstLevel=e}get startLevel(){const e=this.levelController.startLevel;return e===-1&&this.abrController.forcedAutoLevel>-1?this.abrController.forcedAutoLevel:e}set startLevel(e){v.log(`set startLevel:${e}`),e!==-1&&(e=Math.max(e,this.minAutoLevel)),this.levelController.startLevel=e}get capLevelToPlayerSize(){return this.config.capLevelToPlayerSize}set capLevelToPlayerSize(e){const t=!!e;t!==this.config.capLevelToPlayerSize&&(t?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=t)}get autoLevelCapping(){return this._autoLevelCapping}get bandwidthEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimate():NaN}set bandwidthEstimate(e){this.abrController.resetEstimator(e)}get ttfbEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimateTTFB():NaN}set autoLevelCapping(e){this._autoLevelCapping!==e&&(v.log(`set autoLevelCapping:${e}`),this._autoLevelCapping=e,this.levelController.checkMaxAutoUpdated())}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(e){fa(e)&&this._maxHdcpLevel!==e&&(this._maxHdcpLevel=e,this.levelController.checkMaxAutoUpdated())}get autoLevelEnabled(){return this.levelController.manualLevel===-1}get manualLevel(){return this.levelController.manualLevel}get minAutoLevel(){const{levels:e,config:{minAutoBitrate:t}}=this;if(!e)return 0;const s=e.length;for(let i=0;i=t)return i;return 0}get maxAutoLevel(){const{levels:e,autoLevelCapping:t,maxHdcpLevel:s}=this;let i;if(t===-1&&e!=null&&e.length?i=e.length-1:i=t,s)for(let r=i;r--;){const n=e[r].attrs["HDCP-LEVEL"];if(n&&n<=s)return r}return i}get firstAutoLevel(){return this.abrController.firstAutoLevel}get nextAutoLevel(){return this.abrController.nextAutoLevel}set nextAutoLevel(e){this.abrController.nextAutoLevel=e}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}setAudioOption(e){var t;return(t=this.audioTrackController)==null?void 0:t.setAudioOption(e)}setSubtitleOption(e){var t;return(t=this.subtitleTrackController)==null||t.setSubtitleOption(e),null}get allAudioTracks(){const e=this.audioTrackController;return e?e.allAudioTracks:[]}get audioTracks(){const e=this.audioTrackController;return e?e.audioTracks:[]}get audioTrack(){const e=this.audioTrackController;return e?e.audioTrack:-1}set audioTrack(e){const t=this.audioTrackController;t&&(t.audioTrack=e)}get allSubtitleTracks(){const e=this.subtitleTrackController;return e?e.allSubtitleTracks:[]}get subtitleTracks(){const e=this.subtitleTrackController;return e?e.subtitleTracks:[]}get subtitleTrack(){const e=this.subtitleTrackController;return e?e.subtitleTrack:-1}get media(){return this._media}set subtitleTrack(e){const t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}get subtitleDisplay(){const e=this.subtitleTrackController;return e?e.subtitleDisplay:!1}set subtitleDisplay(e){const t=this.subtitleTrackController;t&&(t.subtitleDisplay=e)}get lowLatencyMode(){return this.config.lowLatencyMode}set lowLatencyMode(e){this.config.lowLatencyMode=e}get liveSyncPosition(){return this.latencyController.liveSyncPosition}get latency(){return this.latencyController.latency}get maxLatency(){return this.latencyController.maxLatency}get targetLatency(){return this.latencyController.targetLatency}get drift(){return this.latencyController.drift}get forceStartLoad(){return this.streamController.forceStartLoad}}we.defaultConfig=void 0;var Ic=Object.defineProperty,bc=Object.getOwnPropertyDescriptor,zr=(a,e,t,s)=>{for(var i=s>1?void 0:s?bc(e,t):e,r=a.length-1,n;r>=0;r--)(n=a[r])&&(i=(s?n(e,t,i):n(i))||i);return s&&i&&Ic(e,t,i),i};let Pt=class extends Jr(Zr){constructor(){super(...arguments);Nt(this,"cameraVideo");Nt(this,"hls",null)}startPlayback(){var s;const t=this.buildAbsoluteUrl(this.camera.stream_url||"").toString();we.isSupported()?((s=this.hls)==null||s.destroy(),this.hls=new we({enableWorker:!0,lowLatencyMode:!0,maxLiveSyncPlaybackRate:2,liveSyncDuration:.5,liveMaxLatencyDuration:2,backBufferLength:5}),this.hls.loadSource(t),this.hls.attachMedia(this.cameraVideo),this.hls.on(we.Events.MEDIA_ATTACHED,()=>{this.cameraVideo.play()})):this.cameraVideo.canPlayType("application/vnd.apple.mpegurl")&&(this.cameraVideo.src=t)}stopPlayback(){var t;(t=this.hls)==null||t.destroy(),this.hls=null,this.cameraVideo.src=""}};zr([tn("streamingElement")],Pt.prototype,"cameraVideo",2);Pt=zr([en({})],Pt);var Dc=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("video",{ref:"streamingElement",style:e.cameraStyle,attrs:{autoplay:"",muted:"",crossorigin:e.crossorigin},domProps:{muted:!0}})},Cc=[],_c=sn(Pt,Dc,Cc,!1,null,null);const Mc=_c.exports;export{Mc as default}; diff --git a/fluidd/assets/HlsstreamCamera-fxhA0z-p.js b/fluidd/assets/HlsstreamCamera-fxhA0z-p.js new file mode 100644 index 0000000..304fb93 --- /dev/null +++ b/fluidd/assets/HlsstreamCamera-fxhA0z-p.js @@ -0,0 +1,26 @@ +var Xr=Object.defineProperty;var Qr=(a,e,t)=>e in a?Xr(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var Nt=(a,e,t)=>Qr(a,typeof e!="symbol"?e+"":e,t);import{m as Jr,C as Zr,f as en,R as tn,j as sn}from"./index-CuYiwiAV.js";function rn(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var $i={exports:{}};(function(a,e){(function(t){var s=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,i=/^(?=([^\/?#]*))\1([^]*)$/,r=/(?:\/|^)\.(?=\/)/g,n=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,o={buildAbsoluteURL:function(l,c,h){if(h=h||{},l=l.trim(),c=c.trim(),!c){if(!h.alwaysNormalize)return l;var u=o.parseURL(l);if(!u)throw new Error("Error trying to parse base URL.");return u.path=o.normalizePath(u.path),o.buildURLFromParts(u)}var d=o.parseURL(c);if(!d)throw new Error("Error trying to parse relative URL.");if(d.scheme)return h.alwaysNormalize?(d.path=o.normalizePath(d.path),o.buildURLFromParts(d)):c;var g=o.parseURL(l);if(!g)throw new Error("Error trying to parse base URL.");if(!g.netLoc&&g.path&&g.path[0]!=="/"){var f=i.exec(g.path);g.netLoc=f[1],g.path=f[2]}g.netLoc&&!g.path&&(g.path="/");var m={scheme:g.scheme,netLoc:d.netLoc,path:null,params:d.params,query:d.query,fragment:d.fragment};if(!d.netLoc&&(m.netLoc=g.netLoc,d.path[0]!=="/"))if(!d.path)m.path=g.path,d.params||(m.params=g.params,d.query||(m.query=g.query));else{var T=g.path,E=T.substring(0,T.lastIndexOf("/")+1)+d.path;m.path=o.normalizePath(E)}return m.path===null&&(m.path=h.alwaysNormalize?o.normalizePath(d.path):d.path),o.buildURLFromParts(m)},parseURL:function(l){var c=s.exec(l);return c?{scheme:c[1]||"",netLoc:c[2]||"",path:c[3]||"",params:c[4]||"",query:c[5]||"",fragment:c[6]||""}:null},normalizePath:function(l){for(l=l.split("").reverse().join("").replace(r,"");l.length!==(l=l.replace(n,"")).length;);return l.split("").reverse().join("")},buildURLFromParts:function(l){return l.scheme+l.netLoc+l.path+l.params+l.query+l.fragment}};a.exports=o})()})($i);var xs=$i.exports;function Us(a,e){var t=Object.keys(a);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(a);e&&(s=s.filter(function(i){return Object.getOwnPropertyDescriptor(a,i).enumerable})),t.push.apply(t,s)}return t}function oe(a){for(var e=1;e`):Oe}function un(a,...e){e.forEach(function(t){Ze[t]=a[t]?a[t].bind(a):hn(t)})}function dn(a,e){if(typeof console=="object"&&a===!0||typeof a=="object"){un(a,"debug","log","info","warn","error");try{Ze.log(`Debug logs enabled for "${e}" in hls.js version 1.5.14`)}catch{Ze=ns}}else Ze=ns}const v=Ze,fn=/^(\d+)x(\d+)$/,Bs=/(.+?)=(".*?"|.*?)(?:,|$)/g;class ee{constructor(e){typeof e=="string"&&(e=ee.parseAttrList(e)),se(this,e)}get clientAttrs(){return Object.keys(this).filter(e=>e.substring(0,2)==="X-")}decimalInteger(e){const t=parseInt(this[e],10);return t>Number.MAX_SAFE_INTEGER?1/0:t}hexadecimalInteger(e){if(this[e]){let t=(this[e]||"0x").slice(2);t=(t.length&1?"0":"")+t;const s=new Uint8Array(t.length/2);for(let i=0;iNumber.MAX_SAFE_INTEGER?1/0:t}decimalFloatingPoint(e){return parseFloat(this[e])}optionalFloat(e,t){const s=this[e];return s?parseFloat(s):t}enumeratedString(e){return this[e]}bool(e){return this[e]==="YES"}decimalResolution(e){const t=fn.exec(this[e]);if(t!==null)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}static parseAttrList(e){let t;const s={},i='"';for(Bs.lastIndex=0;(t=Bs.exec(e))!==null;){let r=t[2];r.indexOf(i)===0&&r.lastIndexOf(i)===r.length-1&&(r=r.slice(1,-1));const n=t[1].trim();s[n]=r}return s}}function gn(a){return a!=="ID"&&a!=="CLASS"&&a!=="START-DATE"&&a!=="DURATION"&&a!=="END-DATE"&&a!=="END-ON-NEXT"}function mn(a){return a==="SCTE35-OUT"||a==="SCTE35-IN"}class Gi{constructor(e,t){if(this.attr=void 0,this._startDate=void 0,this._endDate=void 0,this._badValueForSameId=void 0,t){const s=t.attr;for(const i in s)if(Object.prototype.hasOwnProperty.call(e,i)&&e[i]!==s[i]){v.warn(`DATERANGE tag attribute: "${i}" does not match for tags with ID: "${e.ID}"`),this._badValueForSameId=i;break}e=se(new ee({}),s,e)}if(this.attr=e,this._startDate=new Date(e["START-DATE"]),"END-DATE"in this.attr){const s=new Date(this.attr["END-DATE"]);O(s.getTime())&&(this._endDate=s)}}get id(){return this.attr.ID}get class(){return this.attr.CLASS}get startDate(){return this._startDate}get endDate(){if(this._endDate)return this._endDate;const e=this.duration;return e!==null?new Date(this._startDate.getTime()+e*1e3):null}get duration(){if("DURATION"in this.attr){const e=this.attr.decimalFloatingPoint("DURATION");if(O(e))return e}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}get plannedDuration(){return"PLANNED-DURATION"in this.attr?this.attr.decimalFloatingPoint("PLANNED-DURATION"):null}get endOnNext(){return this.attr.bool("END-ON-NEXT")}get isValid(){return!!this.id&&!this._badValueForSameId&&O(this.startDate.getTime())&&(this.duration===null||this.duration>=0)&&(!this.endOnNext||!!this.class)}}class Ft{constructor(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}}var X={AUDIO:"audio",VIDEO:"video",AUDIOVIDEO:"audiovideo"};class Ki{constructor(e){this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams={[X.AUDIO]:null,[X.VIDEO]:null,[X.AUDIOVIDEO]:null},this.baseurl=e}setByteRange(e,t){const s=e.split("@",2);let i;s.length===1?i=(t==null?void 0:t.byteRangeEndOffset)||0:i=parseInt(s[1]),this._byteRange=[i,parseInt(s[0])+i]}get byteRange(){return this._byteRange?this._byteRange:[]}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=xs.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(e){this._url=e}}class Ut extends Ki{constructor(e,t){super(t),this._decryptdata=null,this.rawProgramDateTime=null,this.programDateTime=null,this.tagList=[],this.duration=0,this.sn=0,this.levelkeys=void 0,this.type=void 0,this.loader=null,this.keyLoader=null,this.level=-1,this.cc=0,this.startPTS=void 0,this.endPTS=void 0,this.startDTS=void 0,this.endDTS=void 0,this.start=0,this.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,this.stats=new Ft,this.data=void 0,this.bitrateTest=!1,this.title=null,this.initSegment=null,this.endList=void 0,this.gap=void 0,this.urlId=0,this.type=e}get decryptdata(){const{levelkeys:e}=this;if(!e&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkeys&&!this.levelkeys.NONE){const t=this.levelkeys.identity;if(t)this._decryptdata=t.getDecryptData(this.sn);else{const s=Object.keys(this.levelkeys);if(s.length===1)return this._decryptdata=this.levelkeys[s[0]].getDecryptData(this.sn)}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(this.programDateTime===null||!O(this.programDateTime))return null;const e=O(this.duration)?this.duration:0;return this.programDateTime+e*1e3}get encrypted(){var e;if((e=this._decryptdata)!=null&&e.encrypted)return!0;if(this.levelkeys){const t=Object.keys(this.levelkeys),s=t.length;if(s>1||s===1&&this.levelkeys[t[0]].encrypted)return!0}return!1}setKeyFormat(e){if(this.levelkeys){const t=this.levelkeys[e];t&&!this._decryptdata&&(this._decryptdata=t.getDecryptData(this.sn))}}abortRequests(){var e,t;(e=this.loader)==null||e.abort(),(t=this.keyLoader)==null||t.abort()}setElementaryStreamInfo(e,t,s,i,r,n=!1){const{elementaryStreams:o}=this,l=o[e];if(!l){o[e]={startPTS:t,endPTS:s,startDTS:i,endDTS:r,partial:n};return}l.startPTS=Math.min(l.startPTS,t),l.endPTS=Math.max(l.endPTS,s),l.startDTS=Math.min(l.startDTS,i),l.endDTS=Math.max(l.endDTS,r)}clearElementaryStreamInfo(){const{elementaryStreams:e}=this;e[X.AUDIO]=null,e[X.VIDEO]=null,e[X.AUDIOVIDEO]=null}}class pn extends Ki{constructor(e,t,s,i,r){super(s),this.fragOffset=0,this.duration=0,this.gap=!1,this.independent=!1,this.relurl=void 0,this.fragment=void 0,this.index=void 0,this.stats=new Ft,this.duration=e.decimalFloatingPoint("DURATION"),this.gap=e.bool("GAP"),this.independent=e.bool("INDEPENDENT"),this.relurl=e.enumeratedString("URI"),this.fragment=t,this.index=i;const n=e.enumeratedString("BYTERANGE");n&&this.setByteRange(n,r),r&&(this.fragOffset=r.fragOffset+r.duration)}get start(){return this.fragment.start+this.fragOffset}get end(){return this.start+this.duration}get loaded(){const{elementaryStreams:e}=this;return!!(e.audio||e.video||e.audiovideo)}}const Tn=10;class En{constructor(e){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.dateRanges=void 0,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.encryptedFragments=void 0,this.playlistParsingError=null,this.variableList=null,this.hasVariableRefs=!1,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=e}reloaded(e){if(!e){this.advanced=!0,this.updated=!0;return}const t=this.lastPartSn-e.lastPartSn,s=this.lastPartIndex-e.lastPartIndex;this.updated=this.endSN!==e.endSN||!!s||!!t||!this.live,this.advanced=this.endSN>e.endSN||t>0||t===0&&s>0,this.updated||this.advanced?this.misses=Math.floor(e.misses*.6):this.misses=e.misses+1,this.availabilityDelay=e.availabilityDelay}get hasProgramDateTime(){return this.fragments.length?O(this.fragments[this.fragments.length-1].programDateTime):!1}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||Tn}get drift(){const e=this.driftEndTime-this.driftStartTime;return e>0?(this.driftEnd-this.driftStart)*1e3/e:1}get edge(){return this.partEnd||this.fragmentEnd}get partEnd(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].end:this.fragmentEnd}get fragmentEnd(){var e;return(e=this.fragments)!=null&&e.length?this.fragments[this.fragments.length-1].end:0}get age(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}get lastPartIndex(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].index:-1}get lastPartSn(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}function Ss(a){return Uint8Array.from(atob(a),e=>e.charCodeAt(0))}function yn(a){const e=as(a).subarray(0,16),t=new Uint8Array(16);return t.set(e,16-e.length),t}function xn(a){const e=function(s,i,r){const n=s[i];s[i]=s[r],s[r]=n};e(a,0,3),e(a,1,2),e(a,4,5),e(a,6,7)}function Sn(a){const e=a.split(":");let t=null;if(e[0]==="data"&&e.length===2){const s=e[1].split(";"),i=s[s.length-1].split(",");if(i.length===2){const r=i[0]==="base64",n=i[1];r?(s.splice(-1,1),t=Ss(n)):t=yn(n)}}return t}function as(a){return Uint8Array.from(unescape(encodeURIComponent(a)),e=>e.charCodeAt(0))}const qe=typeof self<"u"?self:void 0;var Z={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},de={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.streamingkeydelivery",PLAYREADY:"com.microsoft.playready",WIDEVINE:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"};function $s(a){switch(a){case de.FAIRPLAY:return Z.FAIRPLAY;case de.PLAYREADY:return Z.PLAYREADY;case de.WIDEVINE:return Z.WIDEVINE;case de.CLEARKEY:return Z.CLEARKEY}}var Vi={WIDEVINE:"edef8ba979d64acea3c827dcd51d21ed"};function vn(a){if(a===Vi.WIDEVINE)return Z.WIDEVINE}function Gs(a){switch(a){case Z.FAIRPLAY:return de.FAIRPLAY;case Z.PLAYREADY:return de.PLAYREADY;case Z.WIDEVINE:return de.WIDEVINE;case Z.CLEARKEY:return de.CLEARKEY}}function Bt(a){const{drmSystems:e,widevineLicenseUrl:t}=a,s=e?[Z.FAIRPLAY,Z.WIDEVINE,Z.PLAYREADY,Z.CLEARKEY].filter(i=>!!e[i]):[];return!s[Z.WIDEVINE]&&t&&s.push(Z.WIDEVINE),s}const Hi=function(a){return qe!=null&&(a=qe.navigator)!=null&&a.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}();function An(a,e,t,s){let i;switch(a){case Z.FAIRPLAY:i=["cenc","sinf"];break;case Z.WIDEVINE:case Z.PLAYREADY:i=["cenc"];break;case Z.CLEARKEY:i=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${a}`)}return Ln(i,e,t,s)}function Ln(a,e,t,s){return[{initDataTypes:a,persistentState:s.persistentState||"optional",distinctiveIdentifier:s.distinctiveIdentifier||"optional",sessionTypes:s.sessionTypes||[s.sessionType||"temporary"],audioCapabilities:e.map(r=>({contentType:`audio/mp4; codecs="${r}"`,robustness:s.audioRobustness||"",encryptionScheme:s.audioEncryptionScheme||null})),videoCapabilities:t.map(r=>({contentType:`video/mp4; codecs="${r}"`,robustness:s.videoRobustness||"",encryptionScheme:s.videoEncryptionScheme||null}))}]}function Ne(a,e,t){return Uint8Array.prototype.slice?a.slice(e,t):new Uint8Array(Array.prototype.slice.call(a,e,t))}const vs=(a,e)=>e+10<=a.length&&a[e]===73&&a[e+1]===68&&a[e+2]===51&&a[e+3]<255&&a[e+4]<255&&a[e+6]<128&&a[e+7]<128&&a[e+8]<128&&a[e+9]<128,Wi=(a,e)=>e+10<=a.length&&a[e]===51&&a[e+1]===68&&a[e+2]===73&&a[e+3]<255&&a[e+4]<255&&a[e+6]<128&&a[e+7]<128&&a[e+8]<128&&a[e+9]<128,et=(a,e)=>{const t=e;let s=0;for(;vs(a,e);){s+=10;const i=Ot(a,e+6);s+=i,Wi(a,e+10)&&(s+=10),e+=s}if(s>0)return a.subarray(t,t+s)},Ot=(a,e)=>{let t=0;return t=(a[e]&127)<<21,t|=(a[e+1]&127)<<14,t|=(a[e+2]&127)<<7,t|=a[e+3]&127,t},Rn=(a,e)=>vs(a,e)&&Ot(a,e+6)+10<=a.length-e,As=a=>{const e=qi(a);for(let t=0;ta&&a.key==="PRIV"&&a.info==="com.apple.streaming.transportStreamTimestamp",In=a=>{const e=String.fromCharCode(a[0],a[1],a[2],a[3]),t=Ot(a,4),s=10;return{type:e,size:t,data:a.subarray(s,s+t)}},qi=a=>{let e=0;const t=[];for(;vs(a,e);){const s=Ot(a,e+6);e+=10;const i=e+s;for(;e+8a.type==="PRIV"?Dn(a):a.type[0]==="W"?_n(a):Cn(a),Dn=a=>{if(a.size<2)return;const e=Re(a.data,!0),t=new Uint8Array(a.data.subarray(e.length+1));return{key:a.type,info:e,data:t.buffer}},Cn=a=>{if(a.size<2)return;if(a.type==="TXXX"){let t=1;const s=Re(a.data.subarray(t),!0);t+=s.length+1;const i=Re(a.data.subarray(t));return{key:a.type,info:s,data:i}}const e=Re(a.data.subarray(1));return{key:a.type,data:e}},_n=a=>{if(a.type==="WXXX"){if(a.size<2)return;let t=1;const s=Re(a.data.subarray(t),!0);t+=s.length+1;const i=Re(a.data.subarray(t));return{key:a.type,info:s,data:i}}const e=Re(a.data);return{key:a.type,data:e}},wn=a=>{if(a.data.byteLength===8){const e=new Uint8Array(a.data),t=e[3]&1;let s=(e[4]<<23)+(e[5]<<15)+(e[6]<<7)+e[7];return s/=45,t&&(s+=4772185884e-2),Math.round(s)}},Re=(a,e=!1)=>{const t=kn();if(t){const c=t.decode(a);if(e){const h=c.indexOf("\0");return h!==-1?c.substring(0,h):c}return c.replace(/\0/g,"")}const s=a.length;let i,r,n,o="",l=0;for(;l>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:o+=String.fromCharCode(i);break;case 12:case 13:r=a[l++],o+=String.fromCharCode((i&31)<<6|r&63);break;case 14:r=a[l++],n=a[l++],o+=String.fromCharCode((i&15)<<12|(r&63)<<6|(n&63)<<0);break}}return o};let $t;function kn(){if(!navigator.userAgent.includes("PlayStation 4"))return!$t&&typeof self.TextDecoder<"u"&&($t=new self.TextDecoder("utf-8")),$t}const Se={hexDump:function(a){let e="";for(let t=0;t>24,a[e+1]=t>>16&255,a[e+2]=t>>8&255,a[e+3]=t&255}function Fn(a){const e=a.byteLength;for(let t=0;t8&&a[t+4]===109&&a[t+5]===111&&a[t+6]===111&&a[t+7]===102)return!0;t=s>1?t+s:e}return!1}function H(a,e){const t=[];if(!e.length)return t;const s=a.byteLength;for(let i=0;i1?i+r:s;if(n===e[0])if(e.length===1)t.push(a.subarray(i+8,o));else{const l=H(a.subarray(i+8,o),e.slice(1));l.length&&Pn.apply(t,l)}i=o}return t}function On(a){const e=[],t=a[0];let s=8;const i=N(a,s);s+=4;let r=0,n=0;t===0?(r=N(a,s),n=N(a,s+4),s+=8):(r=Ks(a,s),n=Ks(a,s+8),s+=16),s+=2;let o=a.length+n;const l=zi(a,s);s+=2;for(let c=0;c>>31===1)return v.warn("SIDX has hierarchical references (not supported)"),null;const f=N(a,h);h+=4,e.push({referenceSize:d,subsegmentDuration:f,info:{duration:f/i,start:o,end:o+d-1}}),o+=d,h+=4,s=h}return{earliestPresentationTime:r,timescale:i,version:t,referencesCount:l,references:e}}function Qi(a){const e=[],t=H(a,["moov","trak"]);for(let i=0;i{const r=N(i,4),n=e[r];n&&(n.default={duration:N(i,12),flags:N(i,20)})}),e}function Mn(a){const e=a.subarray(8),t=e.subarray(86),s=ie(e.subarray(4,8));let i=s;const r=s==="enca"||s==="encv";if(r){const o=H(e,[s])[0].subarray(s==="enca"?28:78);H(o,["sinf"]).forEach(c=>{const h=H(c,["schm"])[0];if(h){const u=ie(h.subarray(4,8));if(u==="cbcs"||u==="cenc"){const d=H(c,["frma"])[0];d&&(i=ie(d))}}})}switch(i){case"avc1":case"avc2":case"avc3":case"avc4":{const n=H(t,["avcC"])[0];i+="."+it(n[1])+it(n[2])+it(n[3]);break}case"mp4a":{const n=H(e,[s])[0],o=H(n.subarray(28),["esds"])[0];if(o&&o.length>12){let l=4;if(o[l++]!==3)break;l=Kt(o,l),l+=2;const c=o[l++];if(c&128&&(l+=2),c&64&&(l+=o[l++]),o[l++]!==4)break;l=Kt(o,l);const h=o[l++];if(h===64)i+="."+it(h);else break;if(l+=12,o[l++]!==5)break;l=Kt(o,l);const u=o[l++];let d=(u&248)>>3;d===31&&(d+=1+((u&7)<<3)+((o[l]&224)>>5)),i+="."+d}break}case"hvc1":case"hev1":{const n=H(t,["hvcC"])[0],o=n[1],l=["","A","B","C"][o>>6],c=o&31,h=N(n,2),u=(o&32)>>5?"H":"L",d=n[12],g=n.subarray(6,12);i+="."+l+c,i+="."+h.toString(16).toUpperCase(),i+="."+u+d;let f="";for(let m=g.length;m--;){const T=g[m];(T||f)&&(f="."+T.toString(16).toUpperCase()+f)}i+=f;break}case"dvh1":case"dvhe":{const n=H(t,["dvcC"])[0],o=n[2]>>1&127,l=n[2]<<5&32|n[3]>>3&31;i+="."+xe(o)+"."+xe(l);break}case"vp09":{const n=H(t,["vpcC"])[0],o=n[4],l=n[5],c=n[6]>>4&15;i+="."+xe(o)+"."+xe(l)+"."+xe(c);break}case"av01":{const n=H(t,["av1C"])[0],o=n[1]>>>5,l=n[1]&31,c=n[2]>>>7?"H":"M",h=(n[2]&64)>>6,u=(n[2]&32)>>5,d=o===2&&h?u?12:10:h?10:8,g=(n[2]&16)>>4,f=(n[2]&8)>>3,m=(n[2]&4)>>2,T=n[2]&3;i+="."+o+"."+xe(l)+c+"."+xe(d)+"."+g+"."+f+m+T+"."+xe(1)+"."+xe(1)+"."+xe(1)+"."+0;break}}return{codec:i,encrypted:r}}function Kt(a,e){const t=e+5;for(;a[e++]&128&&e{const n=H(i,["mdia","minf","stbl","stsd"])[0].subarray(8);let o=H(n,["enca"]);const l=o.length>0;l||(o=H(n,["encv"])),o.forEach(c=>{const h=l?c.subarray(28):c.subarray(78);H(h,["sinf"]).forEach(d=>{const g=Ji(d);if(g){const f=g.subarray(8,24);f.some(m=>m!==0)||(v.log(`[eme] Patching keyId in 'enc${l?"a":"v"}>sinf>>tenc' box: ${Se.hexDump(f)} -> ${Se.hexDump(t)}`),g.set(t,8))}})})}),a}function Ji(a){const e=H(a,["schm"])[0];if(e){const t=ie(e.subarray(4,8));if(t==="cbcs"||t==="cenc")return H(a,["schi","tenc"])[0]}return v.error("[eme] missing 'schm' box"),null}function Un(a,e){return H(e,["moof","traf"]).reduce((t,s)=>{const i=H(s,["tfdt"])[0],r=i[0],n=H(s,["tfhd"]).reduce((o,l)=>{const c=N(l,4),h=a[c];if(h){let u=N(i,4);if(r===1){if(u===vt)return v.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"),o;u*=vt+1,u+=N(i,8)}const d=h.timescale||9e4,g=u/d;if(O(g)&&(o===null||gg+f.info.duration||0,0);o=Math.max(o,d+u.earliestPresentationTime/u.timescale),l=o-n}}if(l&&O(l))return l}return s||i}function $n(a){const e=N(a,0);let t=8;e&1&&(t+=4),e&4&&(t+=4);let s=0;const i=N(a,4);for(let r=0;r{H(s,["tfhd"]).forEach(i=>{const r=N(i,4),n=a[r];if(!n)return;const o=n.timescale||9e4;H(s,["tfdt"]).forEach(l=>{const c=l[0],h=t*o;if(h){let u=N(l,4);if(c===0)u-=h,u=Math.max(u,0),Gt(l,4,u);else{u*=Math.pow(2,32),u+=N(l,8),u-=h,u=Math.max(u,0);const d=Math.floor(u/(vt+1)),g=Math.floor(u%(vt+1));Gt(l,4,d),Gt(l,8,g)}}})})})}function Kn(a){const e={valid:null,remainder:null},t=H(a,["moof"]);if(t.length<2)return e.remainder=a,e;const s=t[t.length-1];return e.valid=Ne(a,0,s.byteOffset-8),e.remainder=Ne(a,s.byteOffset-8),e}function pe(a,e){const t=new Uint8Array(a.length+e.length);return t.set(a),t.set(e,a.length),t}function Vs(a,e){const t=[],s=e.samples,i=e.timescale,r=e.id;let n=!1;return H(s,["moof"]).map(l=>{const c=l.byteOffset-8;H(l,["traf"]).map(u=>{const d=H(u,["tfdt"]).map(g=>{const f=g[0];let m=N(g,4);return f===1&&(m*=Math.pow(2,32),m+=N(g,8)),m/i})[0];return d!==void 0&&(a=d),H(u,["tfhd"]).map(g=>{const f=N(g,4),m=N(g,0)&16777215,T=(m&1)!==0,E=(m&2)!==0,x=(m&8)!==0;let y=0;const I=(m&16)!==0;let S=0;const D=(m&32)!==0;let R=8;f===r&&(T&&(R+=8),E&&(R+=4),x&&(y=N(g,R),R+=4),I&&(S=N(g,R),R+=4),D&&(R+=4),e.type==="video"&&(n=Vn(e.codec)),H(u,["trun"]).map(_=>{const k=_[0],b=N(_,0)&16777215,w=(b&1)!==0;let V=0;const P=(b&4)!==0,K=(b&256)!==0;let G=0;const B=(b&512)!==0;let q=0;const Q=(b&1024)!==0,M=(b&2048)!==0;let F=0;const j=N(_,4);let W=8;w&&(V=N(_,W),W+=4),P&&(W+=4);let z=V+c;for(let te=0;te>1&63;return t===39||t===40}else return(e&31)===6}function Zi(a,e,t,s){const i=er(a);let r=0;r+=e;let n=0,o=0,l=0;for(;r=i.length)break;l=i[r++],n+=l}while(l===255);o=0;do{if(r>=i.length)break;l=i[r++],o+=l}while(l===255);const c=i.length-r;let h=r;if(oc){v.error(`Malformed SEI payload. ${o} is too small, only ${c} bytes left to parse.`);break}if(n===4){if(i[h++]===181){const d=zi(i,h);if(h+=2,d===49){const g=N(i,h);if(h+=4,g===1195456820){const f=i[h++];if(f===3){const m=i[h++],T=31&m,E=64&m,x=E?2+T*3:0,y=new Uint8Array(x);if(E){y[0]=m;for(let I=1;I16){const u=[];for(let f=0;f<16;f++){const m=i[h++].toString(16);u.push(m.length==1?"0"+m:m),(f===3||f===5||f===7||f===9)&&u.push("-")}const d=o-16,g=new Uint8Array(d);for(let f=0;f>24&255,r[1]=s>>16&255,r[2]=s>>8&255,r[3]=s&255,r.set(a,4),i=0,s=8;i0?(r=new Uint8Array(4),e.length>0&&new DataView(r.buffer).setUint32(0,e.length,!1)):r=new Uint8Array;const n=new Uint8Array(4);return t&&t.byteLength>0&&new DataView(n.buffer).setUint32(0,t.byteLength,!1),Yn([112,115,115,104],new Uint8Array([s,0,0,0]),a,r,i,n,t||new Uint8Array)}function jn(a){if(!(a instanceof ArrayBuffer)||a.byteLength<32)return null;const e={version:0,systemId:"",kids:null,data:null},t=new DataView(a),s=t.getUint32(0);if(a.byteLength!==s&&s>44||t.getUint32(4)!==1886614376||(e.version=t.getUint32(8)>>>24,e.version>1))return null;e.systemId=Se.hexDump(new Uint8Array(a,12,16));const r=t.getUint32(28);if(e.version===0){if(s-32=22&&(this.keyId=t.subarray(t.length-22,t.length-6));break;case de.PLAYREADY:{const s=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=qn(s,null,t);const i=new Uint16Array(t.buffer,t.byteOffset,t.byteLength/2),r=String.fromCharCode.apply(null,Array.from(i)),n=r.substring(r.indexOf("<"),r.length),c=new DOMParser().parseFromString(n,"text/xml").getElementsByTagName("KID")[0];if(c){const h=c.childNodes[0]?c.childNodes[0].nodeValue:c.getAttribute("VALUE");if(h){const u=Ss(h).subarray(0,16);xn(u),this.keyId=u}}break}default:{let s=t.subarray(0,16);if(s.length!==16){const i=new Uint8Array(16);i.set(s,16-s.length),s=i}this.keyId=s;break}}if(!this.keyId||this.keyId.byteLength!==16){let s=rt[this.uri];if(!s){const i=Object.keys(rt).length%Number.MAX_SAFE_INTEGER;s=new Uint8Array(16),new DataView(s.buffer,12,4).setUint32(0,i),rt[this.uri]=s}this.keyId=s}return this}}function zn(a){const e=new Uint8Array(16);for(let t=12;t<16;t++)e[t]=a>>8*(15-t)&255;return e}const tr=/\{\$([a-zA-Z0-9-_]+)\}/g;function Hs(a){return tr.test(a)}function ue(a,e,t){if(a.variableList!==null||a.hasVariableRefs)for(let s=t.length;s--;){const i=t[s],r=e[i];r&&(e[i]=os(a,r))}}function os(a,e){if(a.variableList!==null||a.hasVariableRefs){const t=a.variableList;return e.replace(tr,s=>{const i=s.substring(2,s.length-1),r=t==null?void 0:t[i];return r===void 0?(a.playlistParsingError||(a.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${i}"`)),s):r})}return e}function Ws(a,e,t){let s=a.variableList;s||(a.variableList=s={});let i,r;if("QUERYPARAM"in e){i=e.QUERYPARAM;try{const n=new self.URL(t).searchParams;if(n.has(i))r=n.get(i);else throw new Error(`"${i}" does not match any query parameter in URI: "${t}"`)}catch(n){a.playlistParsingError||(a.playlistParsingError=new Error(`EXT-X-DEFINE QUERYPARAM: ${n.message}`))}}else i=e.NAME,r=e.VALUE;i in s?a.playlistParsingError||(a.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${i}"`)):s[i]=r||""}function Xn(a,e,t){const s=e.IMPORT;if(t&&s in t){let i=a.variableList;i||(a.variableList=i={}),i[s]=t[s]}else a.playlistParsingError||(a.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${s}"`))}function Ue(a=!0){return typeof self>"u"?void 0:(a||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function Qn(a){return typeof self<"u"&&a===self.ManagedMediaSource}const At={audio:{a3ds:1,"ac-3":.95,"ac-4":1,alac:.9,alaw:1,dra1:1,"dts+":1,"dts-":1,dtsc:1,dtse:1,dtsh:1,"ec-3":.9,enca:1,fLaC:.9,flac:.9,FLAC:.9,g719:1,g726:1,m4ae:1,mha1:1,mha2:1,mhm1:1,mhm2:1,mlpa:1,mp4a:1,"raw ":1,Opus:1,opus:1,samr:1,sawb:1,sawp:1,sevc:1,sqcp:1,ssmv:1,twos:1,ulaw:1},video:{avc1:1,avc2:1,avc3:1,avc4:1,avcp:1,av01:.8,drac:1,dva1:1,dvav:1,dvh1:.7,dvhe:.7,encv:1,hev1:.75,hvc1:.75,mjp2:1,mp4v:1,mvc1:1,mvc2:1,mvc3:1,mvc4:1,resv:1,rv60:1,s263:1,svc1:1,svc2:1,"vc-1":1,vp08:1,vp09:.9},text:{stpp:1,wvtt:1}};function Jn(a,e){const t=At[e];return!!t&&!!t[a.slice(0,4)]}function Vt(a,e,t=!0){return!a.split(",").some(s=>!sr(s,e,t))}function sr(a,e,t=!0){var s;const i=Ue(t);return(s=i==null?void 0:i.isTypeSupported(st(a,e)))!=null?s:!1}function st(a,e){return`${e}/mp4;codecs="${a}"`}function Ys(a){if(a){const e=a.substring(0,4);return At.video[e]}return 2}function Lt(a){return a.split(",").reduce((e,t)=>{const s=At.video[t];return s?(s*2+e)/(e?3:2):(At.audio[t]+e)/(e?2:1)},0)}const Ht={};function Zn(a,e=!0){if(Ht[a])return Ht[a];const t={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"]}[a];for(let s=0;sZn(t.toLowerCase(),e))}function qs(a,e){return a&&a!=="mp4a"?a:e&&e.split(",")[0]}function ta(a){const e=a.split(",");for(let t=0;t2){let i=s.shift()+".";i+=parseInt(s.shift()).toString(16),i+=("000"+parseInt(s.shift()).toString(16)).slice(-4),e[t]=i}}return e.join(",")}const js=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-(SESSION-DATA|SESSION-KEY|DEFINE|CONTENT-STEERING|START):([^\r\n]*)[\r\n]+/g,zs=/#EXT-X-MEDIA:(.*)/g,sa=/^#EXT(?:INF|-X-TARGETDURATION):/m,Xs=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[^\r\n]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),ia=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(DATERANGE|DEFINE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)/.source,/#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|VERSION): *(\d+)/.source,/#EXT-X-(DISCONTINUITY|ENDLIST|GAP|INDEPENDENT-SEGMENTS)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|"));class Ae{static findGroup(e,t){for(let s=0;s0&&r.length({id:c.attrs.AUDIO,audioCodec:c.audioCodec})),SUBTITLES:n.map(c=>({id:c.attrs.SUBTITLES,textCodec:c.textCodec})),"CLOSED-CAPTIONS":[]};let l=0;for(zs.lastIndex=0;(i=zs.exec(e))!==null;){const c=new ee(i[1]),h=c.TYPE;if(h){const u=o[h],d=r[h]||[];r[h]=d,ue(s,c,["URI","GROUP-ID","LANGUAGE","ASSOC-LANGUAGE","STABLE-RENDITION-ID","NAME","INSTREAM-ID","CHARACTERISTICS","CHANNELS"]);const g=c.LANGUAGE,f=c["ASSOC-LANGUAGE"],m=c.CHANNELS,T=c.CHARACTERISTICS,E=c["INSTREAM-ID"],x={attrs:c,bitrate:0,id:l++,groupId:c["GROUP-ID"]||"",name:c.NAME||g||"",type:h,default:c.bool("DEFAULT"),autoselect:c.bool("AUTOSELECT"),forced:c.bool("FORCED"),lang:g,url:c.URI?Ae.resolve(c.URI,t):""};if(f&&(x.assocLang=f),m&&(x.channels=m),T&&(x.characteristics=T),E&&(x.instreamId=E),u!=null&&u.length){const y=Ae.findGroup(u,x.groupId)||u[0];Zs(x,y,"audioCodec"),Zs(x,y,"textCodec")}d.push(x)}}return r}static parseLevelPlaylist(e,t,s,i,r,n){const o=new En(t),l=o.fragments;let c=null,h=0,u=0,d=0,g=0,f=null,m=new Ut(i,t),T,E,x,y=-1,I=!1,S=null;for(Xs.lastIndex=0,o.m3u8=e,o.hasVariableRefs=Hs(e);(T=Xs.exec(e))!==null;){I&&(I=!1,m=new Ut(i,t),m.start=d,m.sn=h,m.cc=g,m.level=s,c&&(m.initSegment=c,m.rawProgramDateTime=c.rawProgramDateTime,c.rawProgramDateTime=null,S&&(m.setByteRange(S),S=null)));const k=T[1];if(k){m.duration=parseFloat(k);const b=(" "+T[2]).slice(1);m.title=b||null,m.tagList.push(b?["INF",k,b]:["INF",k])}else if(T[3]){if(O(m.duration)){m.start=d,x&&si(m,x,o),m.sn=h,m.level=s,m.cc=g,l.push(m);const b=(" "+T[3]).slice(1);m.relurl=os(o,b),ei(m,f),f=m,d+=m.duration,h++,u=0,I=!0}}else if(T[4]){const b=(" "+T[4]).slice(1);f?m.setByteRange(b,f):m.setByteRange(b)}else if(T[5])m.rawProgramDateTime=(" "+T[5]).slice(1),m.tagList.push(["PROGRAM-DATE-TIME",m.rawProgramDateTime]),y===-1&&(y=l.length);else{if(T=T[0].match(ia),!T){v.warn("No matches on slow regex match for level playlist!");continue}for(E=1;E0&&P.bool("CAN-SKIP-DATERANGES"),o.partHoldBack=P.optionalFloat("PART-HOLD-BACK",0),o.holdBack=P.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{const P=new ee(w);o.partTarget=P.decimalFloatingPoint("PART-TARGET");break}case"PART":{let P=o.partList;P||(P=o.partList=[]);const K=u>0?P[P.length-1]:void 0,G=u++,B=new ee(w);ue(o,B,["BYTERANGE","URI"]);const q=new pn(B,m,t,G,K);P.push(q),m.duration+=q.duration;break}case"PRELOAD-HINT":{const P=new ee(w);ue(o,P,["URI"]),o.preloadHint=P;break}case"RENDITION-REPORT":{const P=new ee(w);ue(o,P,["URI"]),o.renditionReports=o.renditionReports||[],o.renditionReports.push(P);break}default:v.warn(`line parsed but not handled: ${T}`);break}}}f&&!f.relurl?(l.pop(),d-=f.duration,o.partList&&(o.fragmentHint=f)):o.partList&&(ei(m,f),m.cc=g,o.fragmentHint=m,x&&si(m,x,o));const D=l.length,R=l[0],_=l[D-1];if(d+=o.skippedSegments*o.targetduration,d>0&&D&&_){o.averagetargetduration=d/D;const k=_.sn;o.endSN=k!=="initSegment"?k:0,o.live||(_.endList=!0),R&&(o.startCC=R.cc)}else o.endSN=0,o.startCC=0;return o.fragmentHint&&(d+=o.fragmentHint.duration),o.totalduration=d,o.endCC=g,y>0&&na(l,y),o}}function Qs(a,e,t){var s,i;const r=new ee(a);ue(t,r,["KEYFORMAT","KEYFORMATVERSIONS","URI","IV","URI"]);const n=(s=r.METHOD)!=null?s:"",o=r.URI,l=r.hexadecimalInteger("IV"),c=r.KEYFORMATVERSIONS,h=(i=r.KEYFORMAT)!=null?i:"identity";o&&r.IV&&!l&&v.error(`Invalid IV: ${r.IV}`);const u=o?Ae.resolve(o,e):"",d=(c||"1").split("/").map(Number).filter(Number.isFinite);return new tt(n,u,h,d,l)}function Js(a){const t=new ee(a).decimalFloatingPoint("TIME-OFFSET");return O(t)?t:null}function ra(a,e){let t=(a||"").split(/[ ,]+/).filter(s=>s);["video","audio","text"].forEach(s=>{const i=t.filter(r=>Jn(r,s));i.length&&(e[`${s}Codec`]=i.join(","),t=t.filter(r=>i.indexOf(r)===-1))}),e.unknownCodecs=t}function Zs(a,e,t){const s=e[t];s&&(a[t]=s)}function na(a,e){let t=a[e];for(let s=e;s--;){const i=a[s];if(!i)return;i.programDateTime=t.programDateTime-i.duration*1e3,t=i}}function ei(a,e){a.rawProgramDateTime?a.programDateTime=Date.parse(a.rawProgramDateTime):e!=null&&e.programDateTime&&(a.programDateTime=e.endProgramDateTime),O(a.programDateTime)||(a.programDateTime=null,a.rawProgramDateTime=null)}function ti(a,e,t,s){a.relurl=e.URI,e.BYTERANGE&&a.setByteRange(e.BYTERANGE),a.level=t,a.sn="initSegment",s&&(a.levelkeys=s),a.initSegment=null}function si(a,e,t){a.levelkeys=e;const{encryptedFragments:s}=t;(!s.length||s[s.length-1].levelkeys!==e)&&Object.keys(e).some(i=>e[i].isCommonEncryption)&&s.push(a)}var Y={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},U={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};function ii(a){const{type:e}=a;switch(e){case Y.AUDIO_TRACK:return U.AUDIO;case Y.SUBTITLE_TRACK:return U.SUBTITLE;default:return U.MAIN}}function Wt(a,e){let t=a.url;return(t===void 0||t.indexOf("data:")===0)&&(t=e.url),t}class aa{constructor(e){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.hls=e,this.registerListeners()}startLoad(e){}stopLoad(){this.destroyInternalLoaders()}registerListeners(){const{hls:e}=this;e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.LEVEL_LOADING,this.onLevelLoading,this),e.on(p.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(p.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}unregisterListeners(){const{hls:e}=this;e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.LEVEL_LOADING,this.onLevelLoading,this),e.off(p.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(p.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}createInternalLoader(e){const t=this.hls.config,s=t.pLoader,i=t.loader,r=s||i,n=new r(t);return this.loaders[e.type]=n,n}getInternalLoader(e){return this.loaders[e.type]}resetInternalLoader(e){this.loaders[e]&&delete this.loaders[e]}destroyInternalLoaders(){for(const e in this.loaders){const t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}}destroy(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}onManifestLoading(e,t){const{url:s}=t;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:Y.MANIFEST,url:s,deliveryDirectives:null})}onLevelLoading(e,t){const{id:s,level:i,pathwayId:r,url:n,deliveryDirectives:o}=t;this.load({id:s,level:i,pathwayId:r,responseType:"text",type:Y.LEVEL,url:n,deliveryDirectives:o})}onAudioTrackLoading(e,t){const{id:s,groupId:i,url:r,deliveryDirectives:n}=t;this.load({id:s,groupId:i,level:null,responseType:"text",type:Y.AUDIO_TRACK,url:r,deliveryDirectives:n})}onSubtitleTrackLoading(e,t){const{id:s,groupId:i,url:r,deliveryDirectives:n}=t;this.load({id:s,groupId:i,level:null,responseType:"text",type:Y.SUBTITLE_TRACK,url:r,deliveryDirectives:n})}load(e){var t;const s=this.hls.config;let i=this.getInternalLoader(e);if(i){const c=i.context;if(c&&c.url===e.url&&c.level===e.level){v.trace("[playlist-loader]: playlist request ongoing");return}v.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`),i.abort()}let r;if(e.type===Y.MANIFEST?r=s.manifestLoadPolicy.default:r=se({},s.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),i=this.createInternalLoader(e),O((t=e.deliveryDirectives)==null?void 0:t.part)){let c;if(e.type===Y.LEVEL&&e.level!==null?c=this.hls.levels[e.level].details:e.type===Y.AUDIO_TRACK&&e.id!==null?c=this.hls.audioTracks[e.id].details:e.type===Y.SUBTITLE_TRACK&&e.id!==null&&(c=this.hls.subtitleTracks[e.id].details),c){const h=c.partTarget,u=c.targetduration;if(h&&u){const d=Math.max(h*3,u*.8)*1e3;r=se({},r,{maxTimeToFirstByteMs:Math.min(d,r.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(d,r.maxTimeToFirstByteMs)})}}}const n=r.errorRetry||r.timeoutRetry||{},o={loadPolicy:r,timeout:r.maxLoadTimeMs,maxRetry:n.maxNumRetry||0,retryDelay:n.retryDelayMs||0,maxRetryDelay:n.maxRetryDelayMs||0},l={onSuccess:(c,h,u,d)=>{const g=this.getInternalLoader(u);this.resetInternalLoader(u.type);const f=c.data;if(f.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(c,u,new Error("no EXTM3U delimiter"),d||null,h);return}h.parsing.start=performance.now(),Ae.isMediaPlaylist(f)?this.handleTrackOrLevelPlaylist(c,h,u,d||null,g):this.handleMasterPlaylist(c,h,u,d)},onError:(c,h,u,d)=>{this.handleNetworkError(h,u,!1,c,d)},onTimeout:(c,h,u)=>{this.handleNetworkError(h,u,!0,void 0,c)}};i.load(e,o,l)}handleMasterPlaylist(e,t,s,i){const r=this.hls,n=e.data,o=Wt(e,s),l=Ae.parseMasterPlaylist(n,o);if(l.playlistParsingError){this.handleManifestParsingError(e,s,l.playlistParsingError,i,t);return}const{contentSteering:c,levels:h,sessionData:u,sessionKeys:d,startTimeOffset:g,variableList:f}=l;this.variableList=f;const{AUDIO:m=[],SUBTITLES:T,"CLOSED-CAPTIONS":E}=Ae.parseMasterPlaylistMedia(n,o,l);m.length&&!m.some(y=>!y.url)&&h[0].audioCodec&&!h[0].attrs.AUDIO&&(v.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),m.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new ee({}),bitrate:0,url:""})),r.trigger(p.MANIFEST_LOADED,{levels:h,audioTracks:m,subtitles:T,captions:E,contentSteering:c,url:o,stats:t,networkDetails:i,sessionData:u,sessionKeys:d,startTimeOffset:g,variableList:f})}handleTrackOrLevelPlaylist(e,t,s,i,r){const n=this.hls,{id:o,level:l,type:c}=s,h=Wt(e,s),u=0,d=O(l)?l:O(o)?o:0,g=ii(s),f=Ae.parseLevelPlaylist(e.data,h,d,g,u,this.variableList);if(c===Y.MANIFEST){const m={attrs:new ee({}),bitrate:0,details:f,name:"",url:h};n.trigger(p.MANIFEST_LOADED,{levels:[m],audioTracks:[],url:h,stats:t,networkDetails:i,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),s.levelDetails=f,this.handlePlaylistLoaded(f,e,t,s,i,r)}handleManifestParsingError(e,t,s,i,r){this.hls.trigger(p.ERROR,{type:$.NETWORK_ERROR,details:L.MANIFEST_PARSING_ERROR,fatal:t.type===Y.MANIFEST,url:e.url,err:s,error:s,reason:s.message,response:e,context:t,networkDetails:i,stats:r})}handleNetworkError(e,t,s=!1,i,r){let n=`A network ${s?"timeout":"error"+(i?" (status "+i.code+")":"")} occurred while loading ${e.type}`;e.type===Y.LEVEL?n+=`: ${e.level} id: ${e.id}`:(e.type===Y.AUDIO_TRACK||e.type===Y.SUBTITLE_TRACK)&&(n+=` id: ${e.id} group-id: "${e.groupId}"`);const o=new Error(n);v.warn(`[playlist-loader]: ${n}`);let l=L.UNKNOWN,c=!1;const h=this.getInternalLoader(e);switch(e.type){case Y.MANIFEST:l=s?L.MANIFEST_LOAD_TIMEOUT:L.MANIFEST_LOAD_ERROR,c=!0;break;case Y.LEVEL:l=s?L.LEVEL_LOAD_TIMEOUT:L.LEVEL_LOAD_ERROR,c=!1;break;case Y.AUDIO_TRACK:l=s?L.AUDIO_TRACK_LOAD_TIMEOUT:L.AUDIO_TRACK_LOAD_ERROR,c=!1;break;case Y.SUBTITLE_TRACK:l=s?L.SUBTITLE_TRACK_LOAD_TIMEOUT:L.SUBTITLE_LOAD_ERROR,c=!1;break}h&&this.resetInternalLoader(e.type);const u={type:$.NETWORK_ERROR,details:l,fatal:c,url:e.url,loader:h,context:e,error:o,networkDetails:t,stats:r};if(i){const d=(t==null?void 0:t.url)||e.url;u.response=oe({url:d,data:void 0},i)}this.hls.trigger(p.ERROR,u)}handlePlaylistLoaded(e,t,s,i,r,n){const o=this.hls,{type:l,level:c,id:h,groupId:u,deliveryDirectives:d}=i,g=Wt(t,i),f=ii(i),m=typeof i.level=="number"&&f===U.MAIN?c:void 0;if(!e.fragments.length){const E=new Error("No Segments found in Playlist");o.trigger(p.ERROR,{type:$.NETWORK_ERROR,details:L.LEVEL_EMPTY_ERROR,fatal:!1,url:g,error:E,reason:E.message,response:t,context:i,level:m,parent:f,networkDetails:r,stats:s});return}e.targetduration||(e.playlistParsingError=new Error("Missing Target Duration"));const T=e.playlistParsingError;if(T){o.trigger(p.ERROR,{type:$.NETWORK_ERROR,details:L.LEVEL_PARSING_ERROR,fatal:!1,url:g,error:T,reason:T.message,response:t,context:i,level:m,parent:f,networkDetails:r,stats:s});return}switch(e.live&&n&&(n.getCacheAge&&(e.ageHeader=n.getCacheAge()||0),(!n.getCacheAge||isNaN(e.ageHeader))&&(e.ageHeader=0)),l){case Y.MANIFEST:case Y.LEVEL:o.trigger(p.LEVEL_LOADED,{details:e,level:m||0,id:h||0,stats:s,networkDetails:r,deliveryDirectives:d});break;case Y.AUDIO_TRACK:o.trigger(p.AUDIO_TRACK_LOADED,{details:e,id:h||0,groupId:u||"",stats:s,networkDetails:r,deliveryDirectives:d});break;case Y.SUBTITLE_TRACK:o.trigger(p.SUBTITLE_TRACK_LOADED,{details:e,id:h||0,groupId:u||"",stats:s,networkDetails:r,deliveryDirectives:d});break}}}function ir(a,e){let t;try{t=new Event("addtrack")}catch{t=document.createEvent("Event"),t.initEvent("addtrack",!1,!1)}t.track=a,e.dispatchEvent(t)}function rr(a,e){const t=a.mode;if(t==="disabled"&&(a.mode="hidden"),a.cues&&!a.cues.getCueById(e.id))try{if(a.addCue(e),!a.cues.getCueById(e.id))throw new Error(`addCue is failed for: ${e}`)}catch(s){v.debug(`[texttrack-utils]: ${s}`);try{const i=new self.TextTrackCue(e.startTime,e.endTime,e.text);i.id=e.id,a.addCue(i)}catch(i){v.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${i}`)}}t==="disabled"&&(a.mode=t)}function He(a){const e=a.mode;if(e==="disabled"&&(a.mode="hidden"),a.cues)for(let t=a.cues.length;t--;)a.removeCue(a.cues[t]);e==="disabled"&&(a.mode=e)}function ls(a,e,t,s){const i=a.mode;if(i==="disabled"&&(a.mode="hidden"),a.cues&&a.cues.length>0){const r=la(a.cues,e,t);for(let n=0;na[t].endTime)return-1;let s=0,i=t;for(;s<=i;){const r=Math.floor((i+s)/2);if(ea[r].startTime&&s-1)for(let r=i,n=a.length;r=e&&o.endTime<=t)s.push(o);else if(o.startTime>t)return s}return s}function gt(a){const e=[];for(let t=0;t"u"))return self.VTTCue||self.TextTrackCue}function ri(a,e,t,s,i){let r=new a(e,t,"");try{r.value=s,i&&(r.type=i)}catch{r=new a(e,t,JSON.stringify(i?oe({type:i},s):s))}return r}const nt=(()=>{const a=cs();try{a&&new a(0,Number.POSITIVE_INFINITY,"")}catch{return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();function Yt(a,e){return a.getTime()/1e3-e}function ha(a){return Uint8Array.from(a.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}class ua{constructor(e){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=e,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=null}_registerListeners(){const{hls:e}=this;e.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(p.LEVEL_UPDATED,this.onLevelUpdated,this)}_unregisterListeners(){const{hls:e}=this;e.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(p.LEVEL_UPDATED,this.onLevelUpdated,this)}onMediaAttached(e,t){this.media=t.media}onMediaDetaching(){this.id3Track&&(He(this.id3Track),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={})}onManifestLoading(){this.dateRangeCuesAppended={}}createTrack(e){const t=this.getID3Track(e.textTracks);return t.mode="hidden",t}getID3Track(e){if(this.media){for(let t=0;tnt&&(u=nt),u-h<=0&&(u=h+ca);for(let g=0;gh.type===ye.audioId3&&l:i==="video"?c=h=>h.type===ye.emsg&&o:c=h=>h.type===ye.audioId3&&l||h.type===ye.emsg&&o,ls(r,t,s,c)}}onLevelUpdated(e,{details:t}){if(!this.media||!t.hasProgramDateTime||!this.hls.config.enableDateRangeMetadataCues)return;const{dateRangeCuesAppended:s,id3Track:i}=this,{dateRanges:r}=t,n=Object.keys(r);if(i){const h=Object.keys(s).filter(u=>!n.includes(u));for(let u=h.length;u--;){const d=h[u];Object.keys(s[d].cues).forEach(g=>{i.removeCue(s[d].cues[g])}),delete s[d]}}const o=t.fragments[t.fragments.length-1];if(n.length===0||!O(o==null?void 0:o.programDateTime))return;this.id3Track||(this.id3Track=this.createTrack(this.media));const l=o.programDateTime/1e3-o.start,c=cs();for(let h=0;h{if(D!==d.id){const R=r[D];if(R.class===d.class&&R.startDate>d.startDate&&(!S||d.startDatethis.timeupdate(),this.hls=e,this.config=e.config,this.registerListeners()}get latency(){return this._latency||0}get maxLatency(){const{config:e,levelDetails:t}=this;return e.liveMaxLatencyDuration!==void 0?e.liveMaxLatencyDuration:t?e.liveMaxLatencyDurationCount*t.targetduration:0}get targetLatency(){const{levelDetails:e}=this;if(e===null)return null;const{holdBack:t,partHoldBack:s,targetduration:i}=e,{liveSyncDuration:r,liveSyncDurationCount:n,lowLatencyMode:o}=this.config,l=this.hls.userConfig;let c=o&&s||t;(l.liveSyncDuration||l.liveSyncDurationCount||c===0)&&(c=r!==void 0?r:n*i);const h=i;return c+Math.min(this.stallCount*1,h)}get liveSyncPosition(){const e=this.estimateLiveEdge(),t=this.targetLatency,s=this.levelDetails;if(e===null||t===null||s===null)return null;const i=s.edge,r=e-t-this.edgeStalled,n=i-s.totalduration,o=i-(this.config.lowLatencyMode&&s.partTarget||s.targetduration);return Math.min(Math.max(n,r),o)}get drift(){const{levelDetails:e}=this;return e===null?1:e.drift}get edgeStalled(){const{levelDetails:e}=this;if(e===null)return 0;const t=(this.config.lowLatencyMode&&e.partTarget||e.targetduration)*3;return Math.max(e.age-t,0)}get forwardBufferLength(){const{media:e,levelDetails:t}=this;if(!e||!t)return 0;const s=e.buffered.length;return(s?e.buffered.end(s-1):t.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null}registerListeners(){this.hls.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(p.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(p.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(p.ERROR,this.onError,this)}unregisterListeners(){this.hls.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.off(p.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(p.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.off(p.ERROR,this.onError,this)}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)}onMediaDetaching(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)}onManifestLoading(){this.levelDetails=null,this._latency=null,this.stallCount=0}onLevelUpdated(e,{details:t}){this.levelDetails=t,t.advanced&&this.timeupdate(),!t.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)}onError(e,t){var s;t.details===L.BUFFER_STALLED_ERROR&&(this.stallCount++,(s=this.levelDetails)!=null&&s.live&&v.warn("[playback-rate-controller]: Stall detected, adjusting target latency"))}timeupdate(){const{media:e,levelDetails:t}=this;if(!e||!t)return;this.currentTime=e.currentTime;const s=this.computeLatency();if(s===null)return;this._latency=s;const{lowLatencyMode:i,maxLiveSyncPlaybackRate:r}=this.config;if(!i||r===1||!t.live)return;const n=this.targetLatency;if(n===null)return;const o=s-n,l=Math.min(this.maxLatency,n+t.targetduration);if(o.05&&this.forwardBufferLength>1){const h=Math.min(2,Math.max(1,r)),u=Math.round(2/(1+Math.exp(-.75*o-this.edgeStalled))*20)/20;e.playbackRate=Math.min(h,Math.max(1,u))}else e.playbackRate!==1&&e.playbackRate!==0&&(e.playbackRate=1)}estimateLiveEdge(){const{levelDetails:e}=this;return e===null?null:e.edge+e.age}computeLatency(){const e=this.estimateLiveEdge();return e===null?null:e-this.currentTime}}const hs=["NONE","TYPE-0","TYPE-1",null];function fa(a){return hs.indexOf(a)>-1}const It=["SDR","PQ","HLG"];function ga(a){return!!a&&It.indexOf(a)>-1}var mt={No:"",Yes:"YES",v2:"v2"};function ni(a){const{canSkipUntil:e,canSkipDateRanges:t,age:s}=a,i=s!!t).map(t=>t.substring(0,4)).join(","),this.addGroupId("audio",e.attrs.AUDIO),this.addGroupId("text",e.attrs.SUBTITLES)}get maxBitrate(){return Math.max(this.realBitrate,this.bitrate)}get averageBitrate(){return this._avgBitrate||this.realBitrate||this.bitrate}get attrs(){return this._attrs[0]}get codecs(){return this.attrs.CODECS||""}get pathwayId(){return this.attrs["PATHWAY-ID"]||"."}get videoRange(){return this.attrs["VIDEO-RANGE"]||"SDR"}get score(){return this.attrs.optionalFloat("SCORE",0)}get uri(){return this.url[0]||""}hasAudioGroup(e){return oi(this._audioGroups,e)}hasSubtitleGroup(e){return oi(this._subtitleGroups,e)}get audioGroups(){return this._audioGroups}get subtitleGroups(){return this._subtitleGroups}addGroupId(e,t){if(t){if(e==="audio"){let s=this._audioGroups;s||(s=this._audioGroups=[]),s.indexOf(t)===-1&&s.push(t)}else if(e==="text"){let s=this._subtitleGroups;s||(s=this._subtitleGroups=[]),s.indexOf(t)===-1&&s.push(t)}}}get urlId(){return 0}set urlId(e){}get audioGroupIds(){return this.audioGroups?[this.audioGroupId]:void 0}get textGroupIds(){return this.subtitleGroups?[this.textGroupId]:void 0}get audioGroupId(){var e;return(e=this.audioGroups)==null?void 0:e[0]}get textGroupId(){var e;return(e=this.subtitleGroups)==null?void 0:e[0]}addFallback(){}}function oi(a,e){return!e||!a?!1:a.indexOf(e)!==-1}function qt(a,e){const t=e.startPTS;if(O(t)){let s=0,i;e.sn>a.sn?(s=t-a.start,i=a):(s=a.start-t,i=e),i.duration!==s&&(i.duration=s)}else e.sn>a.sn?a.cc===e.cc&&a.minEndPTS?e.start=a.start+(a.minEndPTS-a.start):e.start=a.start+a.duration:e.start=Math.max(a.start-e.duration,0)}function nr(a,e,t,s,i,r){s-t<=0&&(v.warn("Fragment should have a positive duration",e),s=t+e.duration,r=i+e.duration);let o=t,l=s;const c=e.startPTS,h=e.endPTS;if(O(c)){const T=Math.abs(c-t);O(e.deltaPTS)?e.deltaPTS=Math.max(T,e.deltaPTS):e.deltaPTS=T,o=Math.max(t,c),t=Math.min(t,c),i=Math.min(i,e.startDTS),l=Math.min(s,h),s=Math.max(s,h),r=Math.max(r,e.endDTS)}const u=t-e.start;e.start!==0&&(e.start=t),e.duration=s-e.start,e.startPTS=t,e.maxStartPTS=o,e.startDTS=i,e.endPTS=s,e.minEndPTS=l,e.endDTS=r;const d=e.sn;if(!a||da.endSN)return 0;let g;const f=d-a.startSN,m=a.fragments;for(m[f]=e,g=f;g>0;g--)qt(m[g],m[g-1]);for(g=f;g=0;l--){const c=s[l].initSegment;if(c){t=c;break}}a.fragmentHint&&delete a.fragmentHint.endPTS;let i=0,r;if(Ea(a,e,(l,c)=>{l.relurl&&(i=l.cc-c.cc),O(l.startPTS)&&O(l.endPTS)&&(c.start=c.startPTS=l.startPTS,c.startDTS=l.startDTS,c.maxStartPTS=l.maxStartPTS,c.endPTS=l.endPTS,c.endDTS=l.endDTS,c.minEndPTS=l.minEndPTS,c.duration=l.endPTS-l.startPTS,c.duration&&(r=c),e.PTSKnown=e.alignedSliding=!0),c.elementaryStreams=l.elementaryStreams,c.loader=l.loader,c.stats=l.stats,l.initSegment&&(c.initSegment=l.initSegment,t=l.initSegment)}),t&&(e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments).forEach(c=>{var h;c&&(!c.initSegment||c.initSegment.relurl===((h=t)==null?void 0:h.relurl))&&(c.initSegment=t)}),e.skippedSegments)if(e.deltaUpdateFailed=e.fragments.some(l=>!l),e.deltaUpdateFailed){v.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let l=e.skippedSegments;l--;)e.fragments.shift();e.startSN=e.fragments[0].sn,e.startCC=e.fragments[0].cc}else e.canSkipDateRanges&&(e.dateRanges=pa(a.dateRanges,e.dateRanges,e.recentlyRemovedDateranges));const n=e.fragments;if(i){v.warn("discontinuity sliding from playlist, take drift into account");for(let l=0;l{c.elementaryStreams=l.elementaryStreams,c.stats=l.stats}),r?nr(e,r,r.startPTS,r.endPTS,r.startDTS,r.endDTS):ar(a,e),n.length&&(e.totalduration=e.edge-n[0].start),e.driftStartTime=a.driftStartTime,e.driftStart=a.driftStart;const o=e.advancedDateTime;if(e.advanced&&o){const l=e.edge;e.driftStart||(e.driftStartTime=o,e.driftStart=l),e.driftEndTime=o,e.driftEnd=l}else e.driftEndTime=a.driftEndTime,e.driftEnd=a.driftEnd,e.advancedDateTime=a.advancedDateTime}function pa(a,e,t){const s=se({},a);return t&&t.forEach(i=>{delete s[i]}),Object.keys(e).forEach(i=>{const r=new Gi(e[i].attr,s[i]);r.isValid?s[i]=r:v.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${JSON.stringify(e[i].attr)}"`)}),s}function Ta(a,e,t){if(a&&e){let s=0;for(let i=0,r=a.length;i<=r;i++){const n=a[i],o=e[i+s];n&&o&&n.index===o.index&&n.fragment.sn===o.fragment.sn?t(n,o):s--}}}function Ea(a,e,t){const s=e.skippedSegments,i=Math.max(a.startSN,e.startSN)-e.startSN,r=(a.fragmentHint?1:0)+(s?e.endSN:Math.min(a.endSN,e.endSN))-e.startSN,n=e.startSN-a.startSN,o=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,l=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments;for(let c=i;c<=r;c++){const h=l[n+c];let u=o[c];s&&!u&&c=s.length||us(e,s[t].start)}function us(a,e){if(e){const t=a.fragments;for(let s=a.skippedSegments;se){const r=s[s.length-1].duration*1e3;r{const{details:s}=e;s!=null&&s.fragments&&s.fragments.forEach(i=>{i.level=t})})}function bt(a){switch(a.details){case L.FRAG_LOAD_TIMEOUT:case L.KEY_LOAD_TIMEOUT:case L.LEVEL_LOAD_TIMEOUT:case L.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function ci(a,e){const t=bt(e);return a.default[`${t?"timeout":"error"}Retry`]}function Ls(a,e){const t=a.backoff==="linear"?1:Math.pow(2,e);return Math.min(t*a.retryDelayMs,a.maxRetryDelayMs)}function hi(a){return oe(oe({},a),{errorRetry:null,timeoutRetry:null})}function Dt(a,e,t,s){if(!a)return!1;const i=s==null?void 0:s.code,r=e499)}const cr={search:function(a,e){let t=0,s=a.length-1,i=null,r=null;for(;t<=s;){i=(t+s)/2|0,r=a[i];const n=e(r);if(n>0)t=i+1;else if(n<0)s=i-1;else return r}return null}};function va(a,e,t){if(e===null||!Array.isArray(a)||!a.length||!O(e))return null;const s=a[0].programDateTime;if(e<(s||0))return null;const i=a[a.length-1].endProgramDateTime;if(e>=(i||0))return null;t=t||0;for(let r=0;r0&&o<15e-7&&(t+=15e-7)}else t===0&&e[0].start===0&&(r=e[0]);if(r&&((!a||a.level===r.level)&&ds(t,s,r)===0||Aa(r,a,Math.min(i,s))))return r;const n=cr.search(e,ds.bind(null,t,s));return n&&(n!==a||!r)?n:r}function Aa(a,e,t){if(e&&e.start===0&&e.level0){const s=e.tagList.reduce((i,r)=>(r[0]==="INF"&&(i+=parseFloat(r[1])),i),t);return a.start<=s}return!1}function ds(a=0,e=0,t){if(t.start<=a&&t.start+t.duration>a)return 0;const s=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0));return t.start+t.duration-s<=a?1:t.start-s>a&&t.start?-1:0}function La(a,e,t){const s=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0))*1e3;return(t.endProgramDateTime||0)-s>a}function Ra(a,e){return cr.search(a,t=>t.cce?-1:0)}var ce={DoNothing:0,SendEndCallback:1,SendAlternateToPenaltyBox:2,RemoveAlternatePermanently:3,InsertDiscontinuity:4,RetryRequest:5},Te={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2,SwitchToSDR:4};class Ia{constructor(e){this.hls=void 0,this.playlistError=0,this.penalizedRenditions={},this.log=void 0,this.warn=void 0,this.error=void 0,this.hls=e,this.log=v.log.bind(v,"[info]:"),this.warn=v.warn.bind(v,"[warning]:"),this.error=v.error.bind(v,"[error]:"),this.registerListeners()}registerListeners(){const e=this.hls;e.on(p.ERROR,this.onError,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const e=this.hls;e&&(e.off(p.ERROR,this.onError,this),e.off(p.ERROR,this.onErrorOut,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.LEVEL_UPDATED,this.onLevelUpdated,this))}destroy(){this.unregisterListeners(),this.hls=null,this.penalizedRenditions={}}startLoad(e){}stopLoad(){this.playlistError=0}getVariantLevelIndex(e){return(e==null?void 0:e.type)===U.MAIN?e.level:this.hls.loadLevel}onManifestLoading(){this.playlistError=0,this.penalizedRenditions={}}onLevelUpdated(){this.playlistError=0}onError(e,t){var s,i;if(t.fatal)return;const r=this.hls,n=t.context;switch(t.details){case L.FRAG_LOAD_ERROR:case L.FRAG_LOAD_TIMEOUT:case L.KEY_LOAD_ERROR:case L.KEY_LOAD_TIMEOUT:t.errorAction=this.getFragRetryOrSwitchAction(t);return;case L.FRAG_PARSING_ERROR:if((s=t.frag)!=null&&s.gap){t.errorAction={action:ce.DoNothing,flags:Te.None};return}case L.FRAG_GAP:case L.FRAG_DECRYPT_ERROR:{t.errorAction=this.getFragRetryOrSwitchAction(t),t.errorAction.action=ce.SendAlternateToPenaltyBox;return}case L.LEVEL_EMPTY_ERROR:case L.LEVEL_PARSING_ERROR:{var o,l;const c=t.parent===U.MAIN?t.level:r.loadLevel;t.details===L.LEVEL_EMPTY_ERROR&&((o=t.context)!=null&&(l=o.levelDetails)!=null&&l.live)?t.errorAction=this.getPlaylistRetryOrSwitchAction(t,c):(t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,c))}return;case L.LEVEL_LOAD_ERROR:case L.LEVEL_LOAD_TIMEOUT:typeof(n==null?void 0:n.level)=="number"&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,n.level));return;case L.AUDIO_TRACK_LOAD_ERROR:case L.AUDIO_TRACK_LOAD_TIMEOUT:case L.SUBTITLE_LOAD_ERROR:case L.SUBTITLE_TRACK_LOAD_TIMEOUT:if(n){const c=r.levels[r.loadLevel];if(c&&(n.type===Y.AUDIO_TRACK&&c.hasAudioGroup(n.groupId)||n.type===Y.SUBTITLE_TRACK&&c.hasSubtitleGroup(n.groupId))){t.errorAction=this.getPlaylistRetryOrSwitchAction(t,r.loadLevel),t.errorAction.action=ce.SendAlternateToPenaltyBox,t.errorAction.flags=Te.MoveAllAlternatesMatchingHost;return}}return;case L.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:{const c=r.levels[r.loadLevel],h=c==null?void 0:c.attrs["HDCP-LEVEL"];h?t.errorAction={action:ce.SendAlternateToPenaltyBox,flags:Te.MoveAllAlternatesMatchingHDCP,hdcpLevel:h}:this.keySystemError(t)}return;case L.BUFFER_ADD_CODEC_ERROR:case L.REMUX_ALLOC_ERROR:case L.BUFFER_APPEND_ERROR:t.errorAction=this.getLevelSwitchAction(t,(i=t.level)!=null?i:r.loadLevel);return;case L.INTERNAL_EXCEPTION:case L.BUFFER_APPENDING_ERROR:case L.BUFFER_FULL_ERROR:case L.LEVEL_SWITCH_ERROR:case L.BUFFER_STALLED_ERROR:case L.BUFFER_SEEK_OVER_HOLE:case L.BUFFER_NUDGE_ON_STALL:t.errorAction={action:ce.DoNothing,flags:Te.None};return}t.type===$.KEY_SYSTEM_ERROR&&this.keySystemError(t)}keySystemError(e){const t=this.getVariantLevelIndex(e.frag);e.levelRetry=!1,e.errorAction=this.getLevelSwitchAction(e,t)}getPlaylistRetryOrSwitchAction(e,t){const s=this.hls,i=ci(s.config.playlistLoadPolicy,e),r=this.playlistError++;if(Dt(i,r,bt(e),e.response))return{action:ce.RetryRequest,flags:Te.None,retryConfig:i,retryCount:r};const o=this.getLevelSwitchAction(e,t);return i&&(o.retryConfig=i,o.retryCount=r),o}getFragRetryOrSwitchAction(e){const t=this.hls,s=this.getVariantLevelIndex(e.frag),i=t.levels[s],{fragLoadPolicy:r,keyLoadPolicy:n}=t.config,o=ci(e.details.startsWith("key")?n:r,e),l=t.levels.reduce((h,u)=>h+u.fragmentError,0);if(i&&(e.details!==L.FRAG_GAP&&i.fragmentError++,Dt(o,l,bt(e),e.response)))return{action:ce.RetryRequest,flags:Te.None,retryConfig:o,retryCount:l};const c=this.getLevelSwitchAction(e,s);return o&&(c.retryConfig=o,c.retryCount=l),c}getLevelSwitchAction(e,t){const s=this.hls;t==null&&(t=s.loadLevel);const i=this.hls.levels[t];if(i){var r,n;const c=e.details;i.loadError++,c===L.BUFFER_APPEND_ERROR&&i.fragmentError++;let h=-1;const{levels:u,loadLevel:d,minAutoLevel:g,maxAutoLevel:f}=s;s.autoLevelEnabled||(s.loadLevel=-1);const m=(r=e.frag)==null?void 0:r.type,E=(m===U.AUDIO&&c===L.FRAG_PARSING_ERROR||e.sourceBufferName==="audio"&&(c===L.BUFFER_ADD_CODEC_ERROR||c===L.BUFFER_APPEND_ERROR))&&u.some(({audioCodec:D})=>i.audioCodec!==D),y=e.sourceBufferName==="video"&&(c===L.BUFFER_ADD_CODEC_ERROR||c===L.BUFFER_APPEND_ERROR)&&u.some(({codecSet:D,audioCodec:R})=>i.codecSet!==D&&i.audioCodec===R),{type:I,groupId:S}=(n=e.context)!=null?n:{};for(let D=u.length;D--;){const R=(D+d)%u.length;if(R!==d&&R>=g&&R<=f&&u[R].loadError===0){var o,l;const _=u[R];if(c===L.FRAG_GAP&&m===U.MAIN&&e.frag){const k=u[R].details;if(k){const b=Ct(e.frag,k.fragments,e.frag.start);if(b!=null&&b.gap)continue}}else{if(I===Y.AUDIO_TRACK&&_.hasAudioGroup(S)||I===Y.SUBTITLE_TRACK&&_.hasSubtitleGroup(S))continue;if(m===U.AUDIO&&(o=i.audioGroups)!=null&&o.some(k=>_.hasAudioGroup(k))||m===U.SUBTITLE&&(l=i.subtitleGroups)!=null&&l.some(k=>_.hasSubtitleGroup(k))||E&&i.audioCodec===_.audioCodec||!E&&i.audioCodec!==_.audioCodec||y&&i.codecSet===_.codecSet)continue}h=R;break}}if(h>-1&&s.loadLevel!==h)return e.levelRetry=!0,this.playlistError=0,{action:ce.SendAlternateToPenaltyBox,flags:Te.None,nextAutoLevel:h}}return{action:ce.SendAlternateToPenaltyBox,flags:Te.MoveAllAlternatesMatchingHost}}onErrorOut(e,t){var s;switch((s=t.errorAction)==null?void 0:s.action){case ce.DoNothing:break;case ce.SendAlternateToPenaltyBox:this.sendAlternateToPenaltyBox(t),!t.errorAction.resolved&&t.details!==L.FRAG_GAP?t.fatal=!0:/MediaSource readyState: ended/.test(t.error.message)&&(this.warn(`MediaSource ended after "${t.sourceBufferName}" sourceBuffer append error. Attempting to recover from media error.`),this.hls.recoverMediaError());break}if(t.fatal){this.hls.stopLoad();return}}sendAlternateToPenaltyBox(e){const t=this.hls,s=e.errorAction;if(!s)return;const{flags:i,hdcpLevel:r,nextAutoLevel:n}=s;switch(i){case Te.None:this.switchLevel(e,n);break;case Te.MoveAllAlternatesMatchingHDCP:r&&(t.maxHdcpLevel=hs[hs.indexOf(r)-1],s.resolved=!0),this.warn(`Restricting playback to HDCP-LEVEL of "${t.maxHdcpLevel}" or lower`);break}s.resolved||this.switchLevel(e,n)}switchLevel(e,t){t!==void 0&&e.errorAction&&(this.warn(`switching to level ${t} after ${e.details}`),this.hls.nextAutoLevel=t,e.errorAction.resolved=!0,this.hls.nextLoadLevel=this.hls.nextAutoLevel)}}class Rs{constructor(e,t){this.hls=void 0,this.timer=-1,this.requestScheduled=-1,this.canLoad=!1,this.log=void 0,this.warn=void 0,this.log=v.log.bind(v,`${t}:`),this.warn=v.warn.bind(v,`${t}:`),this.hls=e}destroy(){this.clearTimer(),this.hls=this.log=this.warn=null}clearTimer(){this.timer!==-1&&(self.clearTimeout(this.timer),this.timer=-1)}startLoad(){this.canLoad=!0,this.requestScheduled=-1,this.loadPlaylist()}stopLoad(){this.canLoad=!1,this.clearTimer()}switchParams(e,t,s){const i=t==null?void 0:t.renditionReports;if(i){let r=-1;for(let n=0;n=0&&h>t.partTarget&&(l+=1)}const c=s&&ni(s);return new ai(o,l>=0?l:void 0,c)}}}loadPlaylist(e){this.requestScheduled===-1&&(this.requestScheduled=self.performance.now())}shouldLoadPlaylist(e){return this.canLoad&&!!e&&!!e.url&&(!e.details||e.details.live)}shouldReloadPlaylist(e){return this.timer===-1&&this.requestScheduled===-1&&this.shouldLoadPlaylist(e)}playlistLoaded(e,t,s){const{details:i,stats:r}=t,n=self.performance.now(),o=r.loading.first?Math.max(0,n-r.loading.first):0;if(i.advancedDateTime=Date.now()-o,i.live||s!=null&&s.live){if(i.reloaded(s),s&&this.log(`live playlist ${e} ${i.advanced?"REFRESHED "+i.lastPartSn+"-"+i.lastPartIndex:i.updated?"UPDATED":"MISSED"}`),s&&i.fragments.length>0&&ma(s,i),!this.canLoad||!i.live)return;let l,c,h;if(i.canBlockReload&&i.endSN&&i.advanced){const T=this.hls.config.lowLatencyMode,E=i.lastPartSn,x=i.endSN,y=i.lastPartIndex,I=y!==-1,S=E===x,D=T?0:y;I?(c=S?x+1:E,h=S?D:y+1):c=x+1;const R=i.age,_=R+i.ageHeader;let k=Math.min(_-i.partTarget,i.targetduration*1.5);if(k>0){if(s&&k>s.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${s.tuneInGoal} to: ${k} with playlist age: ${i.age}`),k=0;else{const b=Math.floor(k/i.targetduration);if(c+=b,h!==void 0){const w=Math.round(k%i.targetduration/i.partTarget);h+=w}this.log(`CDN Tune-in age: ${i.ageHeader}s last advanced ${R.toFixed(2)}s goal: ${k} skip sn ${b} to part ${h}`)}i.tuneInGoal=k}if(l=this.getDeliveryDirectives(i,t.deliveryDirectives,c,h),T||!S){this.loadPlaylist(l);return}}else(i.canBlockReload||i.canSkipUntil)&&(l=this.getDeliveryDirectives(i,t.deliveryDirectives,c,h));const u=this.hls.mainForwardBufferInfo,d=u?u.end-u.len:0,g=(i.edge-d)*1e3,f=ya(i,g);i.updated&&n>this.requestScheduled+f&&(this.requestScheduled=r.loading.start),c!==void 0&&i.canBlockReload?this.requestScheduled=r.loading.first+f-(i.partTarget*1e3||1e3):this.requestScheduled===-1||this.requestScheduled+fthis.loadPlaylist(l),m)}else this.clearTimer()}getDeliveryDirectives(e,t,s,i){let r=ni(e);return t!=null&&t.skip&&e.deltaUpdateFailed&&(s=t.msn,i=t.part,r=mt.No),new ai(s,i,r)}checkRetry(e){const t=e.details,s=bt(e),i=e.errorAction,{action:r,retryCount:n=0,retryConfig:o}=i||{},l=!!i&&!!o&&(r===ce.RetryRequest||!i.resolved&&r===ce.SendAlternateToPenaltyBox);if(l){var c;if(this.requestScheduled=-1,n>=o.maxNumRetry)return!1;if(s&&(c=e.context)!=null&&c.deliveryDirectives)this.warn(`Retrying playlist loading ${n+1}/${o.maxNumRetry} after "${t}" without delivery-directives`),this.loadPlaylist();else{const h=Ls(o,n);this.timer=self.setTimeout(()=>this.loadPlaylist(),h),this.warn(`Retrying playlist loading ${n+1}/${o.maxNumRetry} after "${t}" in ${h}ms`)}e.levelRetry=!0,i.resolved=!0}return l}}class Be{constructor(e,t=0,s=0){this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=e,this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=t,this.totalWeight_=s}sample(e,t){const s=Math.pow(this.alpha_,e);this.estimate_=t*(1-s)+s*this.estimate_,this.totalWeight_+=e}getTotalWeight(){return this.totalWeight_}getEstimate(){if(this.alpha_){const e=1-Math.pow(this.alpha_,this.totalWeight_);if(e)return this.estimate_/e}return this.estimate_}}class ba{constructor(e,t,s,i=100){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=s,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new Be(e),this.fast_=new Be(t),this.defaultTTFB_=i,this.ttfb_=new Be(e)}update(e,t){const{slow_:s,fast_:i,ttfb_:r}=this;s.halfLife!==e&&(this.slow_=new Be(e,s.getEstimate(),s.getTotalWeight())),i.halfLife!==t&&(this.fast_=new Be(t,i.getEstimate(),i.getTotalWeight())),r.halfLife!==e&&(this.ttfb_=new Be(e,r.getEstimate(),r.getTotalWeight()))}sample(e,t){e=Math.max(e,this.minDelayMs_);const s=8*t,i=e/1e3,r=s/i;this.fast_.sample(i,r),this.slow_.sample(i,r)}sampleTTFB(e){const t=e/1e3,s=Math.sqrt(2)*Math.exp(-Math.pow(t,2)/2);this.ttfb_.sample(s,Math.max(e,5))}canEstimate(){return this.fast_.getTotalWeight()>=this.minWeight_}getEstimate(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}getEstimateTTFB(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_}destroy(){}}const hr={supported:!0,configurations:[],decodingInfoResults:[{supported:!0,powerEfficient:!0,smooth:!0}]},ui={};function Da(a,e,t,s,i,r){const n=a.audioCodec?a.audioGroups:null,o=r==null?void 0:r.audioCodec,l=r==null?void 0:r.channels,c=l?parseInt(l):o?1/0:2;let h=null;if(n!=null&&n.length)try{n.length===1&&n[0]?h=e.groups[n[0]].channels:h=n.reduce((u,d)=>{if(d){const g=e.groups[d];if(!g)throw new Error(`Audio track group ${d} not found`);Object.keys(g.channels).forEach(f=>{u[f]=(u[f]||0)+g.channels[f]})}return u},{2:0})}catch{return!0}return a.videoCodec!==void 0&&(a.width>1920&&a.height>1088||a.height>1920&&a.width>1088||a.frameRate>Math.max(s,30)||a.videoRange!=="SDR"&&a.videoRange!==t||a.bitrate>Math.max(i,8e6))||!!h&&O(c)&&Object.keys(h).some(u=>parseInt(u)>c)}function Ca(a,e,t){const s=a.videoCodec,i=a.audioCodec;if(!s||!i||!t)return Promise.resolve(hr);const r={width:a.width,height:a.height,bitrate:Math.ceil(Math.max(a.bitrate*.9,a.averageBitrate)),framerate:a.frameRate||30},n=a.videoRange;n!=="SDR"&&(r.transferFunction=n.toLowerCase());const o=s.split(",").map(l=>({type:"media-source",video:oe(oe({},r),{},{contentType:st(l,"video")})}));return i&&a.audioGroups&&a.audioGroups.forEach(l=>{var c;l&&((c=e.groups[l])==null||c.tracks.forEach(h=>{if(h.groupId===l){const u=h.channels||"",d=parseFloat(u);O(d)&&d>2&&o.push.apply(o,i.split(",").map(g=>({type:"media-source",audio:{contentType:st(g,"audio"),channels:""+d}})))}}))}),Promise.all(o.map(l=>{const c=_a(l);return ui[c]||(ui[c]=t.decodingInfo(l))})).then(l=>({supported:!l.some(c=>!c.supported),configurations:o,decodingInfoResults:l})).catch(l=>({supported:!1,configurations:o,decodingInfoResults:[],error:l}))}function _a(a){const{audio:e,video:t}=a,s=t||e;if(s){const i=s.contentType.split('"')[1];if(t)return`r${t.height}x${t.width}f${Math.ceil(t.framerate)}${t.transferFunction||"sd"}_${i}_${Math.ceil(t.bitrate/1e5)}`;if(e)return`c${e.channels}${e.spatialRendering?"s":"n"}_${i}`}return""}function wa(){if(typeof matchMedia=="function"){const a=matchMedia("(dynamic-range: high)"),e=matchMedia("bad query");if(a.media!==e.media)return a.matches===!0}return!1}function ka(a,e){let t=!1,s=[];return a&&(t=a!=="SDR",s=[a]),e&&(s=e.allowedVideoRanges||It.slice(0),t=e.preferHDR!==void 0?e.preferHDR:wa(),t?s=s.filter(i=>i!=="SDR"):s=["SDR"]),{preferHDR:t,allowedVideoRanges:s}}function Pa(a,e,t,s,i){const r=Object.keys(a),n=s==null?void 0:s.channels,o=s==null?void 0:s.audioCodec,l=n&&parseInt(n)===2;let c=!0,h=!1,u=1/0,d=1/0,g=1/0,f=0,m=[];const{preferHDR:T,allowedVideoRanges:E}=ka(e,i);for(let S=r.length;S--;){const D=a[r[S]];c=D.channels[2]>0,u=Math.min(u,D.minHeight),d=Math.min(d,D.minFramerate),g=Math.min(g,D.minBitrate);const R=E.filter(_=>D.videoRanges[_]>0);R.length>0&&(h=!0,m=R)}u=O(u)?u:0,d=O(d)?d:0;const x=Math.max(1080,u),y=Math.max(30,d);return g=O(g)?g:t,t=Math.max(g,t),h||(e=void 0,m=[]),{codecSet:r.reduce((S,D)=>{const R=a[D];if(D===S)return S;if(R.minBitrate>t)return be(D,`min bitrate of ${R.minBitrate} > current estimate of ${t}`),S;if(!R.hasDefaultAudio)return be(D,"no renditions with default or auto-select sound found"),S;if(o&&D.indexOf(o.substring(0,4))%5!==0)return be(D,`audio codec preference "${o}" not found`),S;if(n&&!l){if(!R.channels[n])return be(D,`no renditions with ${n} channel sound found (channels options: ${Object.keys(R.channels)})`),S}else if((!o||l)&&c&&R.channels[2]===0)return be(D,"no renditions with stereo sound found"),S;return R.minHeight>x?(be(D,`min resolution of ${R.minHeight} > maximum of ${x}`),S):R.minFramerate>y?(be(D,`min framerate of ${R.minFramerate} > maximum of ${y}`),S):m.some(_=>R.videoRanges[_]>0)?R.maxScore=Lt(S)||R.fragmentError>a[S].fragmentError)?S:(f=R.maxScore,D):(be(D,`no variants with VIDEO-RANGE of ${JSON.stringify(m)} found`),S)},void 0),videoRanges:m,preferHDR:T,minFramerate:d,minBitrate:g}}function be(a,e){v.log(`[abr] start candidates with "${a}" ignored because ${e}`)}function Fa(a){return a.reduce((e,t)=>{let s=e.groups[t.groupId];s||(s=e.groups[t.groupId]={tracks:[],channels:{2:0},hasDefault:!1,hasAutoSelect:!1}),s.tracks.push(t);const i=t.channels||"2";return s.channels[i]=(s.channels[i]||0)+1,s.hasDefault=s.hasDefault||t.default,s.hasAutoSelect=s.hasAutoSelect||t.autoselect,s.hasDefault&&(e.hasDefaultAudio=!0),s.hasAutoSelect&&(e.hasAutoSelectAudio=!0),e},{hasDefaultAudio:!1,hasAutoSelectAudio:!1,groups:{}})}function Oa(a,e,t,s){return a.slice(t,s+1).reduce((i,r)=>{if(!r.codecSet)return i;const n=r.audioGroups;let o=i[r.codecSet];o||(i[r.codecSet]=o={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!n,fragmentError:0}),o.minBitrate=Math.min(o.minBitrate,r.bitrate);const l=Math.min(r.height,r.width);return o.minHeight=Math.min(o.minHeight,l),o.minFramerate=Math.min(o.minFramerate,r.frameRate),o.maxScore=Math.max(o.maxScore,r.score),o.fragmentError+=r.fragmentError,o.videoRanges[r.videoRange]=(o.videoRanges[r.videoRange]||0)+1,n&&n.forEach(c=>{if(!c)return;const h=e.groups[c];h&&(o.hasDefaultAudio=o.hasDefaultAudio||e.hasDefaultAudio?h.hasDefault:h.hasAutoSelect||!e.hasDefaultAudio&&!e.hasAutoSelectAudio,Object.keys(h.channels).forEach(u=>{o.channels[u]=(o.channels[u]||0)+h.channels[u]}))}),i},{})}function Le(a,e,t){if("attrs"in a){const s=e.indexOf(a);if(s!==-1)return s}for(let s=0;ss.indexOf(i)===-1)}function $e(a,e){const{audioCodec:t,channels:s}=a;return(t===void 0||(e.audioCodec||"").substring(0,4)===t.substring(0,4))&&(s===void 0||s===(e.channels||"2"))}function Na(a,e,t,s,i){const r=e[s],o=e.reduce((d,g,f)=>{const m=g.uri;return(d[m]||(d[m]=[])).push(f),d},{})[r.uri];o.length>1&&(s=Math.max.apply(Math,o));const l=r.videoRange,c=r.frameRate,h=r.codecSet.substring(0,4),u=di(e,s,d=>{if(d.videoRange!==l||d.frameRate!==c||d.codecSet.substring(0,4)!==h)return!1;const g=d.audioGroups,f=t.filter(m=>!g||g.indexOf(m.groupId)!==-1);return Le(a,f,i)>-1});return u>-1?u:di(e,s,d=>{const g=d.audioGroups,f=t.filter(m=>!g||g.indexOf(m.groupId)!==-1);return Le(a,f,i)>-1})}function di(a,e,t){for(let s=e;s;s--)if(t(a[s]))return s;for(let s=e+1;s{const{fragCurrent:t,partCurrent:s,hls:i}=this,{autoLevelEnabled:r,media:n}=i;if(!t||!n)return;const o=performance.now(),l=s?s.stats:t.stats,c=s?s.duration:t.duration,h=o-l.loading.start,u=i.minAutoLevel;if(l.aborted||l.loaded&&l.loaded===l.total||t.level<=u){this.clearTimer(),this._nextAutoLevel=-1;return}if(!r||n.paused||!n.playbackRate||!n.readyState)return;const d=i.mainForwardBufferInfo;if(d===null)return;const g=this.bwEstimator.getEstimateTTFB(),f=Math.abs(n.playbackRate);if(h<=Math.max(g,1e3*(c/(f*2))))return;const m=d.len/f,T=l.loading.first?l.loading.first-l.loading.start:-1,E=l.loaded&&T>-1,x=this.getBwEstimate(),y=i.levels,I=y[t.level],S=l.total||Math.max(l.loaded,Math.round(c*I.averageBitrate/8));let D=E?h-T:h;D<1&&E&&(D=Math.min(h,l.loaded*8/x));const R=E?l.loaded*1e3/D:0,_=R?(S-l.loaded)/R:S*8/x+g/1e3;if(_<=m)return;const k=R?R*8:x;let b=Number.POSITIVE_INFINITY,w;for(w=t.level-1;w>u;w--){const P=y[w].maxBitrate;if(b=this.getTimeToLoadFrag(g/1e3,k,c*P,!y[w].details),b=_||b>c*10)return;i.nextLoadLevel=i.nextAutoLevel=w,E?this.bwEstimator.sample(h-Math.min(g,T),l.loaded):this.bwEstimator.sampleTTFB(h);const V=y[w].maxBitrate;this.getBwEstimate()*this.hls.config.abrBandWidthUpFactor>V&&this.resetEstimator(V),this.clearTimer(),v.warn(`[abr] Fragment ${t.sn}${s?" part "+s.index:""} of level ${t.level} is loading too slowly; + Time to underbuffer: ${m.toFixed(3)} s + Estimated load time for current fragment: ${_.toFixed(3)} s + Estimated load time for down switch fragment: ${b.toFixed(3)} s + TTFB estimate: ${T|0} ms + Current BW estimate: ${O(x)?x|0:"Unknown"} bps + New BW estimate: ${this.getBwEstimate()|0} bps + Switching to level ${w} @ ${V|0} bps`),i.trigger(p.FRAG_LOAD_EMERGENCY_ABORTED,{frag:t,part:s,stats:l})},this.hls=e,this.bwEstimator=this.initEstimator(),this.registerListeners()}resetEstimator(e){e&&(v.log(`setting initial bwe to ${e}`),this.hls.config.abrEwmaDefaultEstimate=e),this.firstSelection=-1,this.bwEstimator=this.initEstimator()}initEstimator(){const e=this.hls.config;return new ba(e.abrEwmaSlowVoD,e.abrEwmaFastVoD,e.abrEwmaDefaultEstimate)}registerListeners(){const{hls:e}=this;e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.FRAG_LOADING,this.onFragLoading,this),e.on(p.FRAG_LOADED,this.onFragLoaded,this),e.on(p.FRAG_BUFFERED,this.onFragBuffered,this),e.on(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(p.LEVEL_LOADED,this.onLevelLoaded,this),e.on(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(p.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.on(p.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e&&(e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.FRAG_LOADING,this.onFragLoading,this),e.off(p.FRAG_LOADED,this.onFragLoaded,this),e.off(p.FRAG_BUFFERED,this.onFragBuffered,this),e.off(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(p.LEVEL_LOADED,this.onLevelLoaded,this),e.off(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(p.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.off(p.ERROR,this.onError,this))}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this._abandonRulesCheck=null,this.fragCurrent=this.partCurrent=null}onManifestLoading(e,t){this.lastLoadedFragLevel=-1,this.firstSelection=-1,this.lastLevelLoadSec=0,this.fragCurrent=this.partCurrent=null,this.onLevelsUpdated(),this.clearTimer()}onLevelsUpdated(){this.lastLoadedFragLevel>-1&&this.fragCurrent&&(this.lastLoadedFragLevel=this.fragCurrent.level),this._nextAutoLevel=-1,this.onMaxAutoLevelUpdated(),this.codecTiers=null,this.audioTracksByGroup=null}onMaxAutoLevelUpdated(){this.firstSelection=-1,this.nextAutoLevelKey=""}onFragLoading(e,t){const s=t.frag;if(!this.ignoreFragment(s)){if(!s.bitrateTest){var i;this.fragCurrent=s,this.partCurrent=(i=t.part)!=null?i:null}this.clearTimer(),this.timer=self.setInterval(this._abandonRulesCheck,100)}}onLevelSwitching(e,t){this.clearTimer()}onError(e,t){if(!t.fatal)switch(t.details){case L.BUFFER_ADD_CODEC_ERROR:case L.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1;break;case L.FRAG_LOAD_TIMEOUT:{const s=t.frag,{fragCurrent:i,partCurrent:r}=this;if(s&&i&&s.sn===i.sn&&s.level===i.level){const n=performance.now(),o=r?r.stats:s.stats,l=n-o.loading.start,c=o.loading.first?o.loading.first-o.loading.start:-1;if(o.loaded&&c>-1){const u=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(l-Math.min(u,c),o.loaded)}else this.bwEstimator.sampleTTFB(l)}break}}}getTimeToLoadFrag(e,t,s,i){const r=e+s/t,n=i?this.lastLevelLoadSec:0;return r+n}onLevelLoaded(e,t){const s=this.hls.config,{loading:i}=t.stats,r=i.end-i.start;O(r)&&(this.lastLevelLoadSec=r/1e3),t.details.live?this.bwEstimator.update(s.abrEwmaSlowLive,s.abrEwmaFastLive):this.bwEstimator.update(s.abrEwmaSlowVoD,s.abrEwmaFastVoD)}onFragLoaded(e,{frag:t,part:s}){const i=s?s.stats:t.stats;if(t.type===U.MAIN&&this.bwEstimator.sampleTTFB(i.loading.first-i.loading.start),!this.ignoreFragment(t)){if(this.clearTimer(),t.level===this._nextAutoLevel&&(this._nextAutoLevel=-1),this.firstSelection=-1,this.hls.config.abrMaxWithRealBitrate){const r=s?s.duration:t.duration,n=this.hls.levels[t.level],o=(n.loaded?n.loaded.bytes:0)+i.loaded,l=(n.loaded?n.loaded.duration:0)+r;n.loaded={bytes:o,duration:l},n.realBitrate=Math.round(8*o/l)}if(t.bitrateTest){const r={stats:i,frag:t,part:s,id:t.type};this.onFragBuffered(p.FRAG_BUFFERED,r),t.bitrateTest=!1}else this.lastLoadedFragLevel=t.level}}onFragBuffered(e,t){const{frag:s,part:i}=t,r=i!=null&&i.stats.loaded?i.stats:s.stats;if(r.aborted||this.ignoreFragment(s))return;const n=r.parsing.end-r.loading.start-Math.min(r.loading.first-r.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(n,r.loaded),r.bwEstimate=this.getBwEstimate(),s.bitrateTest?this.bitrateTestDelay=n/1e3:this.bitrateTestDelay=0}ignoreFragment(e){return e.type!==U.MAIN||e.sn==="initSegment"}clearTimer(){this.timer>-1&&(self.clearInterval(this.timer),this.timer=-1)}get firstAutoLevel(){const{maxAutoLevel:e,minAutoLevel:t}=this.hls,s=this.getBwEstimate(),i=this.hls.config.maxStarvationDelay,r=this.findBestLevel(s,t,e,0,i,1,1);if(r>-1)return r;const n=this.hls.firstLevel,o=Math.min(Math.max(n,t),e);return v.warn(`[abr] Could not find best starting auto level. Defaulting to first in playlist ${n} clamped to ${o}`),o}get forcedAutoLevel(){return this.nextAutoLevelKey?-1:this._nextAutoLevel}get nextAutoLevel(){const e=this.forcedAutoLevel,s=this.bwEstimator.canEstimate(),i=this.lastLoadedFragLevel>-1;if(e!==-1&&(!s||!i||this.nextAutoLevelKey===this.getAutoLevelKey()))return e;const r=s&&i?this.getNextABRAutoLevel():this.firstAutoLevel;if(e!==-1){const n=this.hls.levels;if(n.length>Math.max(e,r)&&n[e].loadError<=n[r].loadError)return e}return this._nextAutoLevel=r,this.nextAutoLevelKey=this.getAutoLevelKey(),r}getAutoLevelKey(){return`${this.getBwEstimate()}_${this.getStarvationDelay().toFixed(2)}`}getNextABRAutoLevel(){const{fragCurrent:e,partCurrent:t,hls:s}=this,{maxAutoLevel:i,config:r,minAutoLevel:n}=s,o=t?t.duration:e?e.duration:0,l=this.getBwEstimate(),c=this.getStarvationDelay();let h=r.abrBandWidthFactor,u=r.abrBandWidthUpFactor;if(c){const T=this.findBestLevel(l,n,i,c,0,h,u);if(T>=0)return T}let d=o?Math.min(o,r.maxStarvationDelay):r.maxStarvationDelay;if(!c){const T=this.bitrateTestDelay;T&&(d=(o?Math.min(o,r.maxLoadingDelay):r.maxLoadingDelay)-T,v.info(`[abr] bitrate test took ${Math.round(1e3*T)}ms, set first fragment max fetchDuration to ${Math.round(1e3*d)} ms`),h=u=1)}const g=this.findBestLevel(l,n,i,c,d,h,u);if(v.info(`[abr] ${c?"rebuffering expected":"buffer is empty"}, optimal quality level ${g}`),g>-1)return g;const f=s.levels[n],m=s.levels[s.loadLevel];return(f==null?void 0:f.bitrate)<(m==null?void 0:m.bitrate)?n:s.loadLevel}getStarvationDelay(){const e=this.hls,t=e.media;if(!t)return 1/0;const s=t&&t.playbackRate!==0?Math.abs(t.playbackRate):1,i=e.mainForwardBufferInfo;return(i?i.len:0)/s}getBwEstimate(){return this.bwEstimator.canEstimate()?this.bwEstimator.getEstimate():this.hls.config.abrEwmaDefaultEstimate}findBestLevel(e,t,s,i,r,n,o){var l;const c=i+r,h=this.lastLoadedFragLevel,u=h===-1?this.hls.firstLevel:h,{fragCurrent:d,partCurrent:g}=this,{levels:f,allAudioTracks:m,loadLevel:T,config:E}=this.hls;if(f.length===1)return 0;const x=f[u],y=!!(x!=null&&(l=x.details)!=null&&l.live),I=T===-1||h===-1;let S,D="SDR",R=(x==null?void 0:x.frameRate)||0;const{audioPreference:_,videoPreference:k}=E,b=this.audioTracksByGroup||(this.audioTracksByGroup=Fa(m));if(I){if(this.firstSelection!==-1)return this.firstSelection;const G=this.codecTiers||(this.codecTiers=Oa(f,b,t,s)),B=Pa(G,D,e,_,k),{codecSet:q,videoRanges:Q,minFramerate:M,minBitrate:F,preferHDR:j}=B;S=q,D=j?Q[Q.length-1]:Q[0],R=M,e=Math.max(e,F),v.log(`[abr] picked start tier ${JSON.stringify(B)}`)}else S=x==null?void 0:x.codecSet,D=x==null?void 0:x.videoRange;const w=g?g.duration:d?d.duration:0,V=this.bwEstimator.getEstimateTTFB()/1e3,P=[];for(let G=s;G>=t;G--){var K;const B=f[G],q=G>u;if(!B)continue;if(E.useMediaCapabilities&&!B.supportedResult&&!B.supportedPromise){const te=navigator.mediaCapabilities;typeof(te==null?void 0:te.decodingInfo)=="function"&&Da(B,b,D,R,e,_)?(B.supportedPromise=Ca(B,b,te),B.supportedPromise.then(re=>{if(!this.hls)return;B.supportedResult=re;const le=this.hls.levels,fe=le.indexOf(B);re.error?v.warn(`[abr] MediaCapabilities decodingInfo error: "${re.error}" for level ${fe} ${JSON.stringify(re)}`):re.supported||(v.warn(`[abr] Unsupported MediaCapabilities decodingInfo result for level ${fe} ${JSON.stringify(re)}`),fe>-1&&le.length>1&&(v.log(`[abr] Removing unsupported level ${fe}`),this.hls.removeLevel(fe)))})):B.supportedResult=hr}if(S&&B.codecSet!==S||D&&B.videoRange!==D||q&&R>B.frameRate||!q&&R>0&&R=w*2&&r===0?f[G].averageBitrate:f[G].maxBitrate,W=this.getTimeToLoadFrag(V,F,j*M,Q===void 0);if(F>=j&&(G===h||B.loadError===0&&B.fragmentError===0)&&(W<=V||!O(W)||y&&!this.bitrateTestDelay||W${G} adjustedbw(${Math.round(F)})-bitrate=${Math.round(F-j)} ttfb:${V.toFixed(1)} avgDuration:${M.toFixed(1)} maxFetchDuration:${c.toFixed(1)} fetchDuration:${W.toFixed(1)} firstSelection:${I} codecSet:${S} videoRange:${D} hls.loadLevel:${T}`)),I&&(this.firstSelection=G),G}}return-1}set nextAutoLevel(e){const{maxAutoLevel:t,minAutoLevel:s}=this.hls,i=Math.min(Math.max(e,s),t);this._nextAutoLevel!==i&&(this.nextAutoLevelKey="",this._nextAutoLevel=i)}}class Ba{constructor(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}destroy(){this.onHandlerDestroying(),this.onHandlerDestroyed()}onHandlerDestroying(){this.clearNextTick(),this.clearInterval()}onHandlerDestroyed(){}hasInterval(){return!!this._tickInterval}hasNextTick(){return!!this._tickTimer}setInterval(e){return this._tickInterval?!1:(this._tickCallCount=0,this._tickInterval=self.setInterval(this._boundTick,e),!0)}clearInterval(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1}clearNextTick(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1}tick(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)}tickImmediate(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)}doTick(){}}var ae={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};class $a{constructor(e){this.activePartLists=Object.create(null),this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hasGaps=!1,this.hls=e,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(p.BUFFER_APPENDED,this.onBufferAppended,this),e.on(p.FRAG_BUFFERED,this.onFragBuffered,this),e.on(p.FRAG_LOADED,this.onFragLoaded,this)}_unregisterListeners(){const{hls:e}=this;e.off(p.BUFFER_APPENDED,this.onBufferAppended,this),e.off(p.FRAG_BUFFERED,this.onFragBuffered,this),e.off(p.FRAG_LOADED,this.onFragLoaded,this)}destroy(){this._unregisterListeners(),this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null}getAppendedFrag(e,t){const s=this.activePartLists[t];if(s)for(let i=s.length;i--;){const r=s[i];if(!r)break;const n=r.end;if(r.start<=e&&n!==null&&e<=n)return r}return this.getBufferedFrag(e,t)}getBufferedFrag(e,t){const{fragments:s}=this,i=Object.keys(s);for(let r=i.length;r--;){const n=s[i[r]];if((n==null?void 0:n.body.type)===t&&n.buffered){const o=n.body;if(o.start<=e&&e<=o.end)return o}}return null}detectEvictedFragments(e,t,s,i){this.timeRanges&&(this.timeRanges[e]=t);const r=(i==null?void 0:i.fragment.sn)||-1;Object.keys(this.fragments).forEach(n=>{const o=this.fragments[n];if(!o||r>=o.body.sn)return;if(!o.buffered&&!o.loaded){o.body.type===s&&this.removeFragment(o.body);return}const l=o.range[e];l&&l.time.some(c=>{const h=!this.isTimeBuffered(c.startPTS,c.endPTS,t);return h&&this.removeFragment(o.body),h})})}detectPartialFragments(e){const t=this.timeRanges,{frag:s,part:i}=e;if(!t||s.sn==="initSegment")return;const r=Ge(s),n=this.fragments[r];if(!n||n.buffered&&s.gap)return;const o=!s.relurl;Object.keys(t).forEach(l=>{const c=s.elementaryStreams[l];if(!c)return;const h=t[l],u=o||c.partial===!0;n.range[l]=this.getBufferedTimes(s,i,u,h)}),n.loaded=null,Object.keys(n.range).length?(n.buffered=!0,(n.body.endList=s.endList||n.body.endList)&&(this.endListFragments[n.body.type]=n),at(n)||this.removeParts(s.sn-1,s.type)):this.removeFragment(n.body)}removeParts(e,t){const s=this.activePartLists[t];s&&(this.activePartLists[t]=s.filter(i=>i.fragment.sn>=e))}fragBuffered(e,t){const s=Ge(e);let i=this.fragments[s];!i&&t&&(i=this.fragments[s]={body:e,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},e.gap&&(this.hasGaps=!0)),i&&(i.loaded=null,i.buffered=!0)}getBufferedTimes(e,t,s,i){const r={time:[],partial:s},n=e.start,o=e.end,l=e.minEndPTS||o,c=e.maxStartPTS||n;for(let h=0;h=u&&l<=d){r.time.push({startPTS:Math.max(n,i.start(h)),endPTS:Math.min(o,i.end(h))});break}else if(nu){const g=Math.max(n,i.start(h)),f=Math.min(o,i.end(h));f>g&&(r.partial=!0,r.time.push({startPTS:g,endPTS:f}))}else if(o<=u)break}return r}getPartialFragment(e){let t=null,s,i,r,n=0;const{bufferPadding:o,fragments:l}=this;return Object.keys(l).forEach(c=>{const h=l[c];h&&at(h)&&(i=h.body.start-o,r=h.body.end+o,e>=i&&e<=r&&(s=Math.min(e-i,r-e),n<=s&&(t=h.body,n=s)))}),t}isEndListAppended(e){const t=this.endListFragments[e];return t!==void 0&&(t.buffered||at(t))}getState(e){const t=Ge(e),s=this.fragments[t];return s?s.buffered?at(s)?ae.PARTIAL:ae.OK:ae.APPENDING:ae.NOT_LOADED}isTimeBuffered(e,t,s){let i,r;for(let n=0;n=i&&t<=r)return!0;if(t<=i)return!1}return!1}onFragLoaded(e,t){const{frag:s,part:i}=t;if(s.sn==="initSegment"||s.bitrateTest)return;const r=i?null:t,n=Ge(s);this.fragments[n]={body:s,appendedPTS:null,loaded:r,buffered:!1,range:Object.create(null)}}onBufferAppended(e,t){const{frag:s,part:i,timeRanges:r}=t;if(s.sn==="initSegment")return;const n=s.type;if(i){let o=this.activePartLists[n];o||(this.activePartLists[n]=o=[]),o.push(i)}this.timeRanges=r,Object.keys(r).forEach(o=>{const l=r[o];this.detectEvictedFragments(o,l,n,i)})}onFragBuffered(e,t){this.detectPartialFragments(t)}hasFragment(e){const t=Ge(e);return!!this.fragments[t]}hasParts(e){var t;return!!((t=this.activePartLists[e])!=null&&t.length)}removeFragmentsInRange(e,t,s,i,r){i&&!this.hasGaps||Object.keys(this.fragments).forEach(n=>{const o=this.fragments[n];if(!o)return;const l=o.body;l.type!==s||i&&!l.gap||l.starte&&(o.buffered||r)&&this.removeFragment(l)})}removeFragment(e){const t=Ge(e);e.stats.loaded=0,e.clearElementaryStreamInfo();const s=this.activePartLists[e.type];if(s){const i=e.sn;this.activePartLists[e.type]=s.filter(r=>r.fragment.sn!==i)}delete this.fragments[t],e.endList&&delete this.endListFragments[e.type]}removeAllFragments(){this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1}}function at(a){var e,t,s;return a.buffered&&(a.body.gap||((e=a.range.video)==null?void 0:e.partial)||((t=a.range.audio)==null?void 0:t.partial)||((s=a.range.audiovideo)==null?void 0:s.partial))}function Ge(a){return`${a.type}_${a.level}_${a.sn}`}const Ga={length:0,start:()=>0,end:()=>0};class J{static isBuffered(e,t){try{if(e){const s=J.getBuffered(e);for(let i=0;i=s.start(i)&&t<=s.end(i))return!0}}catch{}return!1}static bufferInfo(e,t,s){try{if(e){const i=J.getBuffered(e),r=[];let n;for(n=0;nu&&(i[h-1].end=e[c].end):i.push(e[c])}else i.push(e[c])}else i=e;let r=0,n,o=t,l=t;for(let c=0;c=h&&tt.startCC||a&&a.cc{if(this.loader&&this.loader.destroy(),e.gap)if(e.tagList.some(g=>g[0]==="GAP")){l(pi(e));return}else e.gap=!1;const c=this.loader=e.loader=r?new r(i):new n(i),h=mi(e),u=hi(i.fragLoadPolicy.default),d={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:e.sn==="initSegment"?1/0:gi};e.stats=c.stats,c.load(h,d,{onSuccess:(g,f,m,T)=>{this.resetLoader(e,c);let E=g.data;m.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(E.slice(0,16)),E=E.slice(16)),o({frag:e,part:null,payload:E,networkDetails:T})},onError:(g,f,m,T)=>{this.resetLoader(e,c),l(new Ce({type:$.NETWORK_ERROR,details:L.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:oe({url:s,data:void 0},g),error:new Error(`HTTP Error ${g.code} ${g.text}`),networkDetails:m,stats:T}))},onAbort:(g,f,m)=>{this.resetLoader(e,c),l(new Ce({type:$.NETWORK_ERROR,details:L.INTERNAL_ABORTED,fatal:!1,frag:e,error:new Error("Aborted"),networkDetails:m,stats:g}))},onTimeout:(g,f,m)=>{this.resetLoader(e,c),l(new Ce({type:$.NETWORK_ERROR,details:L.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error(`Timeout after ${d.timeout}ms`),networkDetails:m,stats:g}))},onProgress:(g,f,m,T)=>{t&&t({frag:e,part:null,payload:m,networkDetails:T})}})})}loadPart(e,t,s){this.abort();const i=this.config,r=i.fLoader,n=i.loader;return new Promise((o,l)=>{if(this.loader&&this.loader.destroy(),e.gap||t.gap){l(pi(e,t));return}const c=this.loader=e.loader=r?new r(i):new n(i),h=mi(e,t),u=hi(i.fragLoadPolicy.default),d={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:gi};t.stats=c.stats,c.load(h,d,{onSuccess:(g,f,m,T)=>{this.resetLoader(e,c),this.updateStatsFromPart(e,t);const E={frag:e,part:t,payload:g.data,networkDetails:T};s(E),o(E)},onError:(g,f,m,T)=>{this.resetLoader(e,c),l(new Ce({type:$.NETWORK_ERROR,details:L.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:oe({url:h.url,data:void 0},g),error:new Error(`HTTP Error ${g.code} ${g.text}`),networkDetails:m,stats:T}))},onAbort:(g,f,m)=>{e.stats.aborted=t.stats.aborted,this.resetLoader(e,c),l(new Ce({type:$.NETWORK_ERROR,details:L.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,error:new Error("Aborted"),networkDetails:m,stats:g}))},onTimeout:(g,f,m)=>{this.resetLoader(e,c),l(new Ce({type:$.NETWORK_ERROR,details:L.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,error:new Error(`Timeout after ${d.timeout}ms`),networkDetails:m,stats:g}))}})})}updateStatsFromPart(e,t){const s=e.stats,i=t.stats,r=i.total;if(s.loaded+=i.loaded,r){const l=Math.round(e.duration/t.duration),c=Math.min(Math.round(s.loaded/r),l),u=(l-c)*Math.round(s.loaded/c);s.total=s.loaded+u}else s.total=Math.max(s.loaded,s.total);const n=s.loading,o=i.loading;n.start?n.first+=o.first-o.start:(n.start=o.start,n.first=o.first),n.end=o.end}resetLoader(e,t){e.loader=null,this.loader===t&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),t.destroy()}}function mi(a,e=null){const t=e||a,s={frag:a,part:e,responseType:"arraybuffer",url:t.url,headers:{},rangeStart:0,rangeEnd:0},i=t.byteRangeStartOffset,r=t.byteRangeEndOffset;if(O(i)&&O(r)){var n;let o=i,l=r;if(a.sn==="initSegment"&&((n=a.decryptdata)==null?void 0:n.method)==="AES-128"){const c=r-i;c%16&&(l=r+(16-c%16)),i!==0&&(s.resetIV=!0,o=i-16)}s.rangeStart=o,s.rangeEnd=l}return s}function pi(a,e){const t=new Error(`GAP ${a.gap?"tag":"attribute"} found`),s={type:$.MEDIA_ERROR,details:L.FRAG_GAP,fatal:!1,frag:a,error:t,networkDetails:null};return e&&(s.part=e),(e||a).stats.aborted=!0,new Ce(s)}class Ce extends Error{constructor(e){super(e.error.message),this.data=void 0,this.data=e}}class qa{constructor(e,t){this.subtle=void 0,this.aesIV=void 0,this.subtle=e,this.aesIV=t}decrypt(e,t){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e)}}class ja{constructor(e,t){this.subtle=void 0,this.key=void 0,this.subtle=e,this.key=t}expandKey(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])}}function za(a){const e=a.byteLength,t=e&&new DataView(a.buffer).getUint8(e-1);return t?Ne(a,0,e-t):a}class Xa{constructor(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}uint8ArrayToUint32Array_(e){const t=new DataView(e),s=new Uint32Array(4);for(let i=0;i<4;i++)s[i]=t.getUint32(i*4);return s}initTable(){const e=this.sBox,t=this.invSBox,s=this.subMix,i=s[0],r=s[1],n=s[2],o=s[3],l=this.invSubMix,c=l[0],h=l[1],u=l[2],d=l[3],g=new Uint32Array(256);let f=0,m=0,T=0;for(T=0;T<256;T++)T<128?g[T]=T<<1:g[T]=T<<1^283;for(T=0;T<256;T++){let E=m^m<<1^m<<2^m<<3^m<<4;E=E>>>8^E&255^99,e[f]=E,t[E]=f;const x=g[f],y=g[x],I=g[y];let S=g[E]*257^E*16843008;i[f]=S<<24|S>>>8,r[f]=S<<16|S>>>16,n[f]=S<<8|S>>>24,o[f]=S,S=I*16843009^y*65537^x*257^f*16843008,c[E]=S<<24|S>>>8,h[E]=S<<16|S>>>16,u[E]=S<<8|S>>>24,d[E]=S,f?(f=x^g[g[g[I^x]]],m^=g[g[m]]):f=m=1}}expandKey(e){const t=this.uint8ArrayToUint32Array_(e);let s=!0,i=0;for(;ithis.subtle?(this.logOnce("WebCrypto AES decrypt"),new qa(this.subtle,new Uint8Array(s)).decrypt(e.buffer,i)):Promise.reject(new Error("web crypto not initialized"))).catch(i=>(v.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${i.name}: ${i.message}`),this.onWebCryptoError(e,t,s)))}onWebCryptoError(e,t,s){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(e,t,s);const i=this.flush();if(i)return i.buffer;throw new Error("WebCrypto and softwareDecrypt: failed to decrypt data")}getValidChunk(e){let t=e;const s=e.length-e.length%Qa;return s!==e.length&&(t=Ne(e,0,s),this.remainderData=Ne(e,s)),t}logOnce(e){this.logEnabled&&(v.log(`[decrypter]: ${e}`),this.logEnabled=!1)}}const Ja={toString:function(a){let e="";const t=a.length;for(let s=0;so.end){const u=n>h;(n{if(this.fragContextChanged(e)){this.warn(`Fragment ${e.sn}${r.part?" p: "+r.part.index:""} of level ${e.level} was dropped during download.`),this.fragmentTracker.removeFragment(e);return}e.stats.chunkCount++,this._handleFragmentLoadProgress(r)};this._doFragLoad(e,t,s,i).then(r=>{if(!r)return;const n=this.state;if(this.fragContextChanged(e)){(n===C.FRAG_LOADING||!this.fragCurrent&&n===C.PARSING)&&(this.fragmentTracker.removeFragment(e),this.state=C.IDLE);return}"payload"in r&&(this.log(`Loaded fragment ${e.sn} of level ${e.level}`),this.hls.trigger(p.FRAG_LOADED,r)),this._handleFragmentLoadComplete(r)}).catch(r=>{this.state===C.STOPPED||this.state===C.ERROR||(this.warn(`Frag error: ${(r==null?void 0:r.message)||r}`),this.resetFragmentLoading(e))})}clearTrackerIfNeeded(e){var t;const{fragmentTracker:s}=this;if(s.getState(e)===ae.APPENDING){const r=e.type,n=this.getFwdBufferInfo(this.mediaBuffer,r),o=Math.max(e.duration,n?n.len:this.config.maxBufferLength),l=this.backtrackFragment;((l?e.sn-l.sn:0)===1||this.reduceMaxBufferLength(o,e.duration))&&s.removeFragment(e)}else((t=this.mediaBuffer)==null?void 0:t.buffered.length)===0?s.removeAllFragments():s.hasParts(e.type)&&(s.detectPartialFragments({frag:e,part:null,stats:e.stats,id:e.type}),s.getState(e)===ae.PARTIAL&&s.removeFragment(e))}checkLiveUpdate(e){if(e.updated&&!e.live){const t=e.fragments[e.fragments.length-1];this.fragmentTracker.detectPartialFragments({frag:t,part:null,stats:t.stats,id:t.type})}e.fragments[0]||(e.deltaUpdateFailed=!0)}flushMainBuffer(e,t,s=null){if(!(e-t))return;const i={startOffset:e,endOffset:t,type:s};this.hls.trigger(p.BUFFER_FLUSHING,i)}_loadInitSegment(e,t){this._doFragLoad(e,t).then(s=>{if(!s||this.fragContextChanged(e)||!this.levels)throw new Error("init load aborted");return s}).then(s=>{const{hls:i}=this,{payload:r}=s,n=e.decryptdata;if(r&&r.byteLength>0&&n!=null&&n.key&&n.iv&&n.method==="AES-128"){const o=self.performance.now();return this.decrypter.decrypt(new Uint8Array(r),n.key.buffer,n.iv.buffer).catch(l=>{throw i.trigger(p.ERROR,{type:$.MEDIA_ERROR,details:L.FRAG_DECRYPT_ERROR,fatal:!1,error:l,reason:l.message,frag:e}),l}).then(l=>{const c=self.performance.now();return i.trigger(p.FRAG_DECRYPTED,{frag:e,payload:l,stats:{tstart:o,tdecrypt:c}}),s.payload=l,this.completeInitSegmentLoad(s)})}return this.completeInitSegmentLoad(s)}).catch(s=>{this.state===C.STOPPED||this.state===C.ERROR||(this.warn(s),this.resetFragmentLoading(e))})}completeInitSegmentLoad(e){const{levels:t}=this;if(!t)throw new Error("init load aborted, missing levels");const s=e.frag.stats;this.state=C.IDLE,e.frag.data=new Uint8Array(e.payload),s.parsing.start=s.buffering.start=self.performance.now(),s.parsing.end=s.buffering.end=self.performance.now(),this.tick()}fragContextChanged(e){const{fragCurrent:t}=this;return!e||!t||e.sn!==t.sn||e.level!==t.level}fragBufferedComplete(e,t){var s,i,r,n;const o=this.mediaBuffer?this.mediaBuffer:this.media;if(this.log(`Buffered ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.playlistType===U.MAIN?"level":"track"} ${e.level} (frag:[${((s=e.startPTS)!=null?s:NaN).toFixed(3)}-${((i=e.endPTS)!=null?i:NaN).toFixed(3)}] > buffer:${o?Ja.toString(J.getBuffered(o)):"(detached)"})`),e.sn!=="initSegment"){var l;if(e.type!==U.SUBTITLE){const h=e.elementaryStreams;if(!Object.keys(h).some(u=>!!h[u])){this.state=C.IDLE;return}}const c=(l=this.levels)==null?void 0:l[e.level];c!=null&&c.fragmentError&&(this.log(`Resetting level fragment error count of ${c.fragmentError} on frag buffered`),c.fragmentError=0)}this.state=C.IDLE,o&&(!this.loadedmetadata&&e.type==U.MAIN&&o.buffered.length&&((r=this.fragCurrent)==null?void 0:r.sn)===((n=this.fragPrevious)==null?void 0:n.sn)&&(this.loadedmetadata=!0,this.seekToStartPos()),this.tick())}seekToStartPos(){}_handleFragmentLoadComplete(e){const{transmuxer:t}=this;if(!t)return;const{frag:s,part:i,partsLoaded:r}=e,n=!r||r.length===0||r.some(l=>!l),o=new Is(s.level,s.sn,s.stats.chunkCount+1,0,i?i.index:-1,!n);t.flush(o)}_handleFragmentLoadProgress(e){}_doFragLoad(e,t,s=null,i){var r;const n=t==null?void 0:t.details;if(!this.levels||!n)throw new Error(`frag load aborted, missing level${n?"":" detail"}s`);let o=null;if(e.encrypted&&!((r=e.decryptdata)!=null&&r.key)?(this.log(`Loading key for ${e.sn} of [${n.startSN}-${n.endSN}], ${this.logPrefix==="[stream-controller]"?"level":"track"} ${e.level}`),this.state=C.KEY_LOADING,this.fragCurrent=e,o=this.keyLoader.load(e).then(h=>{if(!this.fragContextChanged(h.frag))return this.hls.trigger(p.KEY_LOADED,h),this.state===C.KEY_LOADING&&(this.state=C.IDLE),h}),this.hls.trigger(p.KEY_LOADING,{frag:e}),this.fragCurrent===null&&(o=Promise.reject(new Error("frag load aborted, context changed in KEY_LOADING")))):!e.encrypted&&n.encryptedFragments.length&&this.keyLoader.loadClear(e,n.encryptedFragments),s=Math.max(e.start,s||0),this.config.lowLatencyMode&&e.sn!=="initSegment"){const h=n.partList;if(h&&i){s>e.end&&n.fragmentHint&&(e=n.fragmentHint);const u=this.getNextPart(h,e,s);if(u>-1){const d=h[u];this.log(`Loading part sn: ${e.sn} p: ${d.index} cc: ${e.cc} of playlist [${n.startSN}-${n.endSN}] parts [0-${u}-${h.length-1}] ${this.logPrefix==="[stream-controller]"?"level":"track"}: ${e.level}, target: ${parseFloat(s.toFixed(3))}`),this.nextLoadPosition=d.start+d.duration,this.state=C.FRAG_LOADING;let g;return o?g=o.then(f=>!f||this.fragContextChanged(f.frag)?null:this.doFragPartsLoad(e,d,t,i)).catch(f=>this.handleFragLoadError(f)):g=this.doFragPartsLoad(e,d,t,i).catch(f=>this.handleFragLoadError(f)),this.hls.trigger(p.FRAG_LOADING,{frag:e,part:d,targetBufferTime:s}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):g}else if(!e.url||this.loadedEndOfParts(h,s))return Promise.resolve(null)}}this.log(`Loading fragment ${e.sn} cc: ${e.cc} ${n?"of ["+n.startSN+"-"+n.endSN+"] ":""}${this.logPrefix==="[stream-controller]"?"level":"track"}: ${e.level}, target: ${parseFloat(s.toFixed(3))}`),O(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=C.FRAG_LOADING;const l=this.config.progressive;let c;return l&&o?c=o.then(h=>!h||this.fragContextChanged(h==null?void 0:h.frag)?null:this.fragmentLoader.load(e,i)).catch(h=>this.handleFragLoadError(h)):c=Promise.all([this.fragmentLoader.load(e,l?i:void 0),o]).then(([h])=>(!l&&h&&i&&i(h),h)).catch(h=>this.handleFragLoadError(h)),this.hls.trigger(p.FRAG_LOADING,{frag:e,targetBufferTime:s}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):c}doFragPartsLoad(e,t,s,i){return new Promise((r,n)=>{var o;const l=[],c=(o=s.details)==null?void 0:o.partList,h=u=>{this.fragmentLoader.loadPart(e,u,i).then(d=>{l[u.index]=d;const g=d.part;this.hls.trigger(p.FRAG_LOADED,d);const f=li(s,e.sn,u.index+1)||or(c,e.sn,u.index+1);if(f)h(f);else return r({frag:e,part:g,partsLoaded:l})}).catch(n)};h(t)})}handleFragLoadError(e){if("data"in e){const t=e.data;e.data&&t.details===L.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):this.hls.trigger(p.ERROR,t)}else this.hls.trigger(p.ERROR,{type:$.OTHER_ERROR,details:L.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0});return null}_handleTransmuxerFlush(e){const t=this.getCurrentContext(e);if(!t||this.state!==C.PARSING){!this.fragCurrent&&this.state!==C.STOPPED&&this.state!==C.ERROR&&(this.state=C.IDLE);return}const{frag:s,part:i,level:r}=t,n=self.performance.now();s.stats.parsing.end=n,i&&(i.stats.parsing.end=n),this.updateLevelTiming(s,i,r,e.partial)}getCurrentContext(e){const{levels:t,fragCurrent:s}=this,{level:i,sn:r,part:n}=e;if(!(t!=null&&t[i]))return this.warn(`Levels object was unset while buffering fragment ${r} of level ${i}. The current chunk will not be buffered.`),null;const o=t[i],l=n>-1?li(o,r,n):null,c=l?l.fragment:xa(o,r,s);return c?(s&&s!==c&&(c.stats=s.stats),{frag:c,part:l,level:o}):null}bufferFragmentData(e,t,s,i,r){var n;if(!e||this.state!==C.PARSING)return;const{data1:o,data2:l}=e;let c=o;if(o&&l&&(c=pe(o,l)),!((n=c)!=null&&n.length))return;const h={type:e.type,frag:t,part:s,chunkMeta:i,parent:t.type,data:c};if(this.hls.trigger(p.BUFFER_APPENDING,h),e.dropped&&e.independent&&!s){if(r)return;this.flushBufferGap(t)}}flushBufferGap(e){const t=this.media;if(!t)return;if(!J.isBuffered(t,t.currentTime)){this.flushMainBuffer(0,e.start);return}const s=t.currentTime,i=J.bufferInfo(t,s,0),r=e.duration,n=Math.min(this.config.maxFragLookUpTolerance*2,r*.25),o=Math.max(Math.min(e.start-n,i.end-n),s+n);e.start-o>n&&this.flushMainBuffer(o,e.start)}getFwdBufferInfo(e,t){const s=this.getLoadPosition();return O(s)?this.getFwdBufferInfoAtPos(e,s,t):null}getFwdBufferInfoAtPos(e,t,s){const{config:{maxBufferHole:i}}=this,r=J.bufferInfo(e,t,i);if(r.len===0&&r.nextStart!==void 0){const n=this.fragmentTracker.getBufferedFrag(t,s);if(n&&r.nextStart=i?(s.maxMaxBufferLength=r,this.warn(`Reduce max buffer length to ${r}s`),!0):!1}getAppendedFrag(e,t=U.MAIN){const s=this.fragmentTracker.getAppendedFrag(e,U.MAIN);return s&&"fragment"in s?s.fragment:s}getNextFragment(e,t){const s=t.fragments,i=s.length;if(!i)return null;const{config:r}=this,n=s[0].start;let o;if(t.live){const l=r.initialLiveManifestSize;if(it}getNextFragmentLoopLoading(e,t,s,i,r){const n=e.gap,o=this.getNextFragment(this.nextLoadPosition,t);if(o===null)return o;if(e=o,n&&e&&!e.gap&&s.nextStart){const l=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,s.nextStart,i);if(l!==null&&s.len+l.len>=r)return this.log(`buffer full after gaps in "${i}" playlist starting at sn: ${e.sn}`),null}return e}mapToInitFragWhenRequired(e){return e!=null&&e.initSegment&&!(e!=null&&e.initSegment.data)&&!this.bitrateTest?e.initSegment:e}getNextPart(e,t,s){let i=-1,r=!1,n=!0;for(let o=0,l=e.length;o-1&&ss.start&&s.loaded}getInitialLiveFragment(e,t){const s=this.fragPrevious;let i=null;if(s){if(e.hasProgramDateTime&&(this.log(`Live playlist, switching playlist, load frag with same PDT: ${s.programDateTime}`),i=va(t,s.endProgramDateTime,this.config.maxFragLookUpTolerance)),!i){const r=s.sn+1;if(r>=e.startSN&&r<=e.endSN){const n=t[r-e.startSN];s.cc===n.cc&&(i=n,this.log(`Live playlist, switching playlist, load frag with next SN: ${i.sn}`))}i||(i=Ra(t,s.cc),i&&this.log(`Live playlist, switching playlist, load frag with same CC: ${i.sn}`))}}else{const r=this.hls.liveSyncPosition;r!==null&&(i=this.getFragmentAtPosition(r,this.bitrateTest?e.fragmentEnd:e.edge,e))}return i}getFragmentAtPosition(e,t,s){const{config:i}=this;let{fragPrevious:r}=this,{fragments:n,endSN:o}=s;const{fragmentHint:l}=s,{maxFragLookUpTolerance:c}=i,h=s.partList,u=!!(i.lowLatencyMode&&h!=null&&h.length&&l);u&&l&&!this.bitrateTest&&(n=n.concat(l),o=l.sn);let d;if(et-c?0:c;d=Ct(r,n,e,g)}else d=n[n.length-1];if(d){const g=d.sn-s.startSN,f=this.fragmentTracker.getState(d);if((f===ae.OK||f===ae.PARTIAL&&d.gap)&&(r=d),r&&d.sn===r.sn&&(!u||h[0].fragment.sn>d.sn)&&r&&d.level===r.level){const T=n[g+1];d.sn=n-t.maxFragLookUpTolerance&&r<=o;if(i!==null&&s.duration>i&&(r${e.startSN} prev-sn: ${l?l.sn:"na"} fragments: ${i}`),c}return r}waitForCdnTuneIn(e){return e.live&&e.canBlockReload&&e.partTarget&&e.tuneInGoal>Math.max(e.partHoldBack,e.partTarget*3)}setStartPosition(e,t){let s=this.startPosition;if(s ${(i=this.fragCurrent)==null?void 0:i.url}`);return}const r=t.details===L.FRAG_GAP;r&&this.fragmentTracker.fragBuffered(s,!0);const n=t.errorAction,{action:o,retryCount:l=0,retryConfig:c}=n||{};if(n&&o===ce.RetryRequest&&c){this.resetStartWhenNotLoaded(this.levelLastLoaded);const h=Ls(c,l);this.warn(`Fragment ${s.sn} of ${e} ${s.level} errored with ${t.details}, retrying loading ${l+1}/${c.maxNumRetry} in ${h}ms`),n.resolved=!0,this.retryDate=self.performance.now()+h,this.state=C.FRAG_LOADING_WAITING_RETRY}else if(c&&n)if(this.resetFragmentErrors(e),l.5;r&&this.reduceMaxBufferLength(i.len,(t==null?void 0:t.duration)||10);const n=!r;return n&&this.warn(`Buffer full error while media.currentTime is not buffered, flush ${s} buffer`),t&&(this.fragmentTracker.removeFragment(t),this.nextLoadPosition=t.start),this.resetLoadingState(),n}return!1}resetFragmentErrors(e){e===U.AUDIO&&(this.fragCurrent=null),this.loadedmetadata||(this.startFragRequested=!1),this.state!==C.STOPPED&&(this.state=C.IDLE)}afterBufferFlushed(e,t,s){if(!e)return;const i=J.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,i,s),this.state===C.ENDED&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state=C.IDLE}resetStartWhenNotLoaded(e){if(!this.loadedmetadata){this.startFragRequested=!1;const t=e?e.details:null;t!=null&&t.live?(this.startPosition=-1,this.setStartPosition(t,0),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}}resetWhenMissingContext(e){this.warn(`The loading context changed while buffering fragment ${e.sn} of level ${e.level}. This chunk will not be buffered.`),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded(this.levelLastLoaded),this.resetLoadingState()}removeUnbufferedFrags(e=0){this.fragmentTracker.removeFragmentsInRange(e,1/0,this.playlistType,!1,!0)}updateLevelTiming(e,t,s,i){var r;const n=s.details;if(!n){this.warn("level.details undefined");return}if(!Object.keys(e.elementaryStreams).reduce((l,c)=>{const h=e.elementaryStreams[c];if(h){const u=h.endPTS-h.startPTS;if(u<=0)return this.warn(`Could not parse fragment ${e.sn} ${c} duration reliably (${u})`),l||!1;const d=i?0:nr(n,e,h.startPTS,h.endPTS,h.startDTS,h.endDTS);return this.hls.trigger(p.LEVEL_PTS_UPDATED,{details:n,level:s,drift:d,type:c,frag:e,start:h.startPTS,end:h.endPTS}),!0}return l},!1)&&((r=this.transmuxer)==null?void 0:r.error)===null){const l=new Error(`Found no media in fragment ${e.sn} of level ${e.level} resetting transmuxer to fallback to playlist timing`);if(s.fragmentError===0&&(s.fragmentError++,e.gap=!0,this.fragmentTracker.removeFragment(e),this.fragmentTracker.fragBuffered(e,!0)),this.warn(l.message),this.hls.trigger(p.ERROR,{type:$.MEDIA_ERROR,details:L.FRAG_PARSING_ERROR,fatal:!1,error:l,frag:e,reason:`Found no media in msn ${e.sn} of level "${s.url}"`}),!this.hls)return;this.resetTransmuxer()}this.state=C.PARSED,this.hls.trigger(p.FRAG_PARSED,{frag:e,part:t})}resetTransmuxer(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)}recoverWorkerError(e){e.event==="demuxerWorker"&&(this.fragmentTracker.removeAllFragments(),this.resetTransmuxer(),this.resetStartWhenNotLoaded(this.levelLastLoaded),this.resetLoadingState())}set state(e){const t=this._state;t!==e&&(this._state=e,this.log(`${t}->${e}`))}get state(){return this._state}}class dr{constructor(){this.chunks=[],this.dataLength=0}push(e){this.chunks.push(e),this.dataLength+=e.length}flush(){const{chunks:e,dataLength:t}=this;let s;if(e.length)e.length===1?s=e[0]:s=Za(e,t);else return new Uint8Array(0);return this.reset(),s}reset(){this.chunks.length=0,this.dataLength=0}}function Za(a,e){const t=new Uint8Array(e);let s=0;for(let i=0;i0&&o.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:s,type:ye.audioId3,duration:Number.POSITIVE_INFINITY});i{if(O(a))return a*90;const s=t?t.baseTime*9e4/t.timescale:0;return e*9e4+s};function ro(a,e,t,s){let i,r,n,o;const l=navigator.userAgent.toLowerCase(),c=s,h=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];i=((e[t+2]&192)>>>6)+1;const u=(e[t+2]&60)>>>2;if(u>h.length-1){const d=new Error(`invalid ADTS sampling index:${u}`);a.emit(p.ERROR,p.ERROR,{type:$.MEDIA_ERROR,details:L.FRAG_PARSING_ERROR,fatal:!0,error:d,reason:d.message});return}return n=(e[t+2]&1)<<2,n|=(e[t+3]&192)>>>6,v.log(`manifest codec:${s}, ADTS type:${i}, samplingIndex:${u}`),/firefox/i.test(l)?u>=6?(i=5,o=new Array(4),r=u-3):(i=2,o=new Array(2),r=u):l.indexOf("android")!==-1?(i=2,o=new Array(2),r=u):(i=5,o=new Array(4),s&&(s.indexOf("mp4a.40.29")!==-1||s.indexOf("mp4a.40.5")!==-1)||!s&&u>=6?r=u-3:((s&&s.indexOf("mp4a.40.2")!==-1&&(u>=6&&n===1||/vivaldi/i.test(l))||!s&&n===1)&&(i=2,o=new Array(2)),r=u)),o[0]=i<<3,o[0]|=(u&14)>>1,o[1]|=(u&1)<<7,o[1]|=n<<3,i===5&&(o[1]|=(r&14)>>1,o[2]=(r&1)<<7,o[2]|=8,o[3]=0),{config:o,samplerate:h[u],channelCount:n,codec:"mp4a.40."+i,manifestCodec:c}}function fr(a,e){return a[e]===255&&(a[e+1]&246)===240}function gr(a,e){return a[e+1]&1?7:9}function _s(a,e){return(a[e+3]&3)<<11|a[e+4]<<3|(a[e+5]&224)>>>5}function no(a,e){return e+5=a.length)return!1;const s=_s(a,e);if(s<=t)return!1;const i=e+s;return i===a.length||wt(a,i)}return!1}function mr(a,e,t,s,i){if(!a.samplerate){const r=ro(e,t,s,i);if(!r)return;a.config=r.config,a.samplerate=r.samplerate,a.channelCount=r.channelCount,a.codec=r.codec,a.manifestCodec=r.manifestCodec,v.log(`parsed codec:${a.codec}, rate:${r.samplerate}, channels:${r.channelCount}`)}}function pr(a){return 1024*9e4/a}function lo(a,e){const t=gr(a,e);if(e+t<=a.length){const s=_s(a,e)-t;if(s>0)return{headerLength:t,frameLength:s}}}function Tr(a,e,t,s,i){const r=pr(a.samplerate),n=s+i*r,o=lo(e,t);let l;if(o){const{frameLength:u,headerLength:d}=o,g=d+u,f=Math.max(0,t+g-e.length);f?(l=new Uint8Array(g-d),l.set(e.subarray(t+d,e.length),0)):l=e.subarray(t+d,t+g);const m={unit:l,pts:n};return f||a.samples.push(m),{sample:m,length:g,missing:f}}const c=e.length-t;return l=new Uint8Array(c),l.set(e.subarray(t,e.length),0),{sample:{unit:l,pts:n},length:c,missing:-1}}let lt=null;const co=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],ho=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],uo=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],fo=[0,1,1,4];function Er(a,e,t,s,i){if(t+24>e.length)return;const r=yr(e,t);if(r&&t+r.frameLength<=e.length){const n=r.samplesPerFrame*9e4/r.sampleRate,o=s+i*n,l={unit:e.subarray(t,t+r.frameLength),pts:o,dts:o};return a.config=[],a.channelCount=r.channelCount,a.samplerate=r.sampleRate,a.samples.push(l),{sample:l,length:r.frameLength,missing:0}}}function yr(a,e){const t=a[e+1]>>3&3,s=a[e+1]>>1&3,i=a[e+2]>>4&15,r=a[e+2]>>2&3;if(t!==1&&i!==0&&i!==15&&r!==3){const n=a[e+2]>>1&1,o=a[e+3]>>6,l=t===3?3-s:s===3?3:4,c=co[l*14+i-1]*1e3,u=ho[(t===3?0:t===2?1:2)*3+r],d=o===3?1:2,g=uo[t][s],f=fo[s],m=g*8*f,T=Math.floor(g*c/u+n)*f;if(lt===null){const y=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);lt=y?parseInt(y[1]):0}return!!lt&<<=87&&s===2&&c>=224e3&&o===0&&(a[e+3]=a[e+3]|128),{sampleRate:u,channelCount:d,frameLength:T,samplesPerFrame:m}}}function ws(a,e){return a[e]===255&&(a[e+1]&224)===224&&(a[e+1]&6)!==0}function xr(a,e){return e+1{const n=Wn(r);if(po.test(n.schemeIdUri)){const o=O(n.presentationTime)?n.presentationTime/n.timeScale:t+n.presentationTimeDelta/n.timeScale;let l=n.eventDuration===4294967295?Number.POSITIVE_INFINITY:n.eventDuration/n.timeScale;l<=.001&&(l=Number.POSITIVE_INFINITY);const c=n.payload;s.samples.push({data:c,len:c.byteLength,dts:o,pts:o,type:ye.emsg,duration:l})}})}return s}demuxSampleAes(e,t,s){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))}destroy(){}}const vr=(a,e)=>{let t=0,s=5;e+=s;const i=new Uint32Array(1),r=new Uint32Array(1),n=new Uint8Array(1);for(;s>0;){n[0]=a[e];const o=Math.min(s,8),l=8-o;r[0]=4278190080>>>24+l<>l,t=t?t<e.length||e[t]!==11||e[t+1]!==119)return-1;const r=e[t+4]>>6;if(r>=3)return-1;const o=[48e3,44100,32e3][r],l=e[t+4]&63,h=[64,69,96,64,70,96,80,87,120,80,88,120,96,104,144,96,105,144,112,121,168,112,122,168,128,139,192,128,140,192,160,174,240,160,175,240,192,208,288,192,209,288,224,243,336,224,244,336,256,278,384,256,279,384,320,348,480,320,349,480,384,417,576,384,418,576,448,487,672,448,488,672,512,557,768,512,558,768,640,696,960,640,697,960,768,835,1152,768,836,1152,896,975,1344,896,976,1344,1024,1114,1536,1024,1115,1536,1152,1253,1728,1152,1254,1728,1280,1393,1920,1280,1394,1920][l*3+r]*2;if(t+h>e.length)return-1;const u=e[t+6]>>5;let d=0;u===2?d+=2:(u&1&&u!==1&&(d+=2),u&4&&(d+=2));const g=(e[t+6]<<8|e[t+7])>>12-d&1,m=[2,1,2,3,3,4,4,5][u]+g,T=e[t+5]>>3,E=e[t+5]&7,x=new Uint8Array([r<<6|T<<1|E>>2,(E&3)<<6|u<<3|g<<2|l>>4,l<<4&224]),y=1536/o*9e4,I=s+i*y,S=e.subarray(t,t+h);return a.config=x,a.channelCount=m,a.samplerate=o,a.samples.push({unit:S,pts:I}),h}class yo{constructor(){this.VideoSample=null}createVideoSample(e,t,s,i){return{key:e,frame:!1,pts:t,dts:s,units:[],debug:i,length:0}}getLastNalUnit(e){var t;let s=this.VideoSample,i;if((!s||s.units.length===0)&&(s=e[e.length-1]),(t=s)!=null&&t.units){const r=s.units;i=r[r.length-1]}return i}pushAccessUnit(e,t){if(e.units.length&&e.frame){if(e.pts===void 0){const s=t.samples,i=s.length;if(i){const r=s[i-1];e.pts=r.pts,e.dts=r.dts}else{t.dropped++;return}}t.samples.push(e)}e.debug.length&&v.log(e.pts+"/"+e.dts+":"+e.debug)}}class Ti{constructor(e){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=e,this.bytesAvailable=e.byteLength,this.word=0,this.bitsAvailable=0}loadWord(){const e=this.data,t=this.bytesAvailable,s=e.byteLength-t,i=new Uint8Array(4),r=Math.min(4,t);if(r===0)throw new Error("no bytes available");i.set(e.subarray(s,s+r)),this.word=new DataView(i.buffer).getUint32(0),this.bitsAvailable=r*8,this.bytesAvailable-=r}skipBits(e){let t;e=Math.min(e,this.bytesAvailable*8+this.bitsAvailable),this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,t=e>>3,e-=t<<3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)}readBits(e){let t=Math.min(this.bitsAvailable,e);const s=this.word>>>32-t;if(e>32&&v.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0)this.word<<=t;else if(this.bytesAvailable>0)this.loadWord();else throw new Error("no bits available");return t=e-t,t>0&&this.bitsAvailable?s<>>e)return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()}skipUEG(){this.skipBits(1+this.skipLZ())}skipEG(){this.skipBits(1+this.skipLZ())}readUEG(){const e=this.skipLZ();return this.readBits(e+1)-1}readEG(){const e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)}readBoolean(){return this.readBits(1)===1}readUByte(){return this.readBits(8)}readUShort(){return this.readBits(16)}readUInt(){return this.readBits(32)}skipScalingList(e){let t=8,s=8,i;for(let r=0;r{var u;switch(h.type){case 1:{let m=!1;l=!0;const T=h.data;if(c&&T.length>4){const E=new Ti(T).readSliceType();(E===2||E===4||E===7||E===9)&&(m=!0)}if(m){var d;(d=o)!=null&&d.frame&&!o.key&&(this.pushAccessUnit(o,e),o=this.VideoSample=null)}o||(o=this.VideoSample=this.createVideoSample(!0,s.pts,s.dts,"")),o.frame=!0,o.key=m;break}case 5:l=!0,(u=o)!=null&&u.frame&&!o.key&&(this.pushAccessUnit(o,e),o=this.VideoSample=null),o||(o=this.VideoSample=this.createVideoSample(!0,s.pts,s.dts,"")),o.key=!0,o.frame=!0;break;case 6:{l=!0,Zi(h.data,1,s.pts,t.samples);break}case 7:{var g,f;l=!0,c=!0;const m=h.data,E=new Ti(m).readSPS();if(!e.sps||e.width!==E.width||e.height!==E.height||((g=e.pixelRatio)==null?void 0:g[0])!==E.pixelRatio[0]||((f=e.pixelRatio)==null?void 0:f[1])!==E.pixelRatio[1]){e.width=E.width,e.height=E.height,e.pixelRatio=E.pixelRatio,e.sps=[m],e.duration=r;const x=m.subarray(1,4);let y="avc1.";for(let I=0;I<3;I++){let S=x[I].toString(16);S.length<2&&(S="0"+S),y+=S}e.codec=y}break}case 8:l=!0,e.pps=[h.data];break;case 9:l=!0,e.audFound=!0,o&&this.pushAccessUnit(o,e),o=this.VideoSample=this.createVideoSample(!1,s.pts,s.dts,"");break;case 12:l=!0;break;default:l=!1,o&&(o.debug+="unknown NAL "+h.type+" ");break}o&&l&&o.units.push(h)}),i&&o&&(this.pushAccessUnit(o,e),this.VideoSample=null)}parseAVCNALu(e,t){const s=t.byteLength;let i=e.naluState||0;const r=i,n=[];let o=0,l,c,h,u=-1,d=0;for(i===-1&&(u=0,d=t[0]&31,i=0,o=1);o=0){const g={data:t.subarray(u,c),type:d};n.push(g)}else{const g=this.getLastNalUnit(e.samples);g&&(r&&o<=4-r&&g.state&&(g.data=g.data.subarray(0,g.data.byteLength-r)),c>0&&(g.data=pe(g.data,t.subarray(0,c)),g.state=0))}o=0&&i>=0){const g={data:t.subarray(u,s),type:d,state:i};n.push(g)}if(n.length===0){const g=this.getLastNalUnit(e.samples);g&&(g.data=pe(g.data,t))}return e.naluState=i,n}}class So{constructor(e,t,s){this.keyData=void 0,this.decrypter=void 0,this.keyData=s,this.decrypter=new bs(t,{removePKCS7Padding:!1})}decryptBuffer(e){return this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer)}decryptAacSample(e,t,s){const i=e[t].unit;if(i.length<=16)return;const r=i.subarray(16,i.length-i.length%16),n=r.buffer.slice(r.byteOffset,r.byteOffset+r.length);this.decryptBuffer(n).then(o=>{const l=new Uint8Array(o);i.set(l,16),this.decrypter.isSync()||this.decryptAacSamples(e,t+1,s)})}decryptAacSamples(e,t,s){for(;;t++){if(t>=e.length){s();return}if(!(e[t].unit.length<32)&&(this.decryptAacSample(e,t,s),!this.decrypter.isSync()))return}}getAvcEncryptedData(e){const t=Math.floor((e.length-48)/160)*16+16,s=new Int8Array(t);let i=0;for(let r=32;r{r.data=this.getAvcDecryptedUnit(n,l),this.decrypter.isSync()||this.decryptAvcSamples(e,t,s+1,i)})}decryptAvcSamples(e,t,s,i){if(e instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;t++,s=0){if(t>=e.length){i();return}const r=e[t].units;for(;!(s>=r.length);s++){const n=r[s];if(!(n.data.length<=48||n.type!==1&&n.type!==5)&&(this.decryptAvcSample(e,t,s,i,n),!this.decrypter.isSync()))return}}}}const ne=188;class Pe{constructor(e,t,s){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this._pmtId=-1,this._videoTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.remainderData=null,this.videoParser=void 0,this.observer=e,this.config=t,this.typeSupported=s,this.videoParser=new xo}static probe(e){const t=Pe.syncOffset(e);return t>0&&v.warn(`MPEG2-TS detected but first sync word found @ offset ${t}`),t!==-1}static syncOffset(e){const t=e.length;let s=Math.min(ne*5,t-ne)+1,i=0;for(;i1&&(n===0&&o>2||l+ne>s))return n}else{if(o)return-1;break}i++}return-1}static createTrack(e,t){return{container:e==="video"||e==="audio"?"video/mp2t":void 0,type:e,id:ji[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:e==="audio"?t:void 0}}resetInitSegment(e,t,s,i){this.pmtParsed=!1,this._pmtId=-1,this._videoTrack=Pe.createTrack("video"),this._audioTrack=Pe.createTrack("audio",i),this._id3Track=Pe.createTrack("id3"),this._txtTrack=Pe.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.remainderData=null,this.audioCodec=t,this.videoCodec=s,this._duration=i}resetTimeStamp(){}resetContiguity(){const{_audioTrack:e,_videoTrack:t,_id3Track:s}=this;e&&(e.pesData=null),t&&(t.pesData=null),s&&(s.pesData=null),this.aacOverFlow=null,this.remainderData=null}demux(e,t,s=!1,i=!1){s||(this.sampleAes=null);let r;const n=this._videoTrack,o=this._audioTrack,l=this._id3Track,c=this._txtTrack;let h=n.pid,u=n.pesData,d=o.pid,g=l.pid,f=o.pesData,m=l.pesData,T=null,E=this.pmtParsed,x=this._pmtId,y=e.length;if(this.remainderData&&(e=pe(this.remainderData,e),y=e.length,this.remainderData=null),y>4;let w;if(b>1){if(w=R+5+e[R+4],w===R+ne)continue}else w=R+4;switch(k){case h:_&&(u&&(r=Ke(u))&&this.videoParser.parseAVCPES(n,c,r,!1,this._duration),u={data:[],size:0}),u&&(u.data.push(e.subarray(w,R+ne)),u.size+=R+ne-w);break;case d:if(_){if(f&&(r=Ke(f)))switch(o.segmentCodec){case"aac":this.parseAACPES(o,r);break;case"mp3":this.parseMPEGPES(o,r);break;case"ac3":this.parseAC3PES(o,r);break}f={data:[],size:0}}f&&(f.data.push(e.subarray(w,R+ne)),f.size+=R+ne-w);break;case g:_&&(m&&(r=Ke(m))&&this.parseID3PES(l,r),m={data:[],size:0}),m&&(m.data.push(e.subarray(w,R+ne)),m.size+=R+ne-w);break;case 0:_&&(w+=e[w]+1),x=this._pmtId=vo(e,w);break;case x:{_&&(w+=e[w]+1);const V=Ao(e,w,this.typeSupported,s,this.observer);h=V.videoPid,h>0&&(n.pid=h,n.segmentCodec=V.segmentVideoCodec),d=V.audioPid,d>0&&(o.pid=d,o.segmentCodec=V.segmentAudioCodec),g=V.id3Pid,g>0&&(l.pid=g),T!==null&&!E&&(v.warn(`MPEG-TS PMT found at ${R} after unknown PID '${T}'. Backtracking to sync byte @${I} to parse all TS packets.`),T=null,R=I-188),E=this.pmtParsed=!0;break}case 17:case 8191:break;default:T=k;break}}else S++;S>0&&kt(this.observer,new Error(`Found ${S} TS packet/s that do not start with 0x47`)),n.pesData=u,o.pesData=f,l.pesData=m;const D={audioTrack:o,videoTrack:n,id3Track:l,textTrack:c};return i&&this.extractRemainingSamples(D),D}flush(){const{remainderData:e}=this;this.remainderData=null;let t;return e?t=this.demux(e,-1,!1,!0):t={videoTrack:this._videoTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(t),this.sampleAes?this.decrypt(t,this.sampleAes):t}extractRemainingSamples(e){const{audioTrack:t,videoTrack:s,id3Track:i,textTrack:r}=e,n=s.pesData,o=t.pesData,l=i.pesData;let c;if(n&&(c=Ke(n))?(this.videoParser.parseAVCPES(s,r,c,!0,this._duration),s.pesData=null):s.pesData=n,o&&(c=Ke(o))){switch(t.segmentCodec){case"aac":this.parseAACPES(t,c);break;case"mp3":this.parseMPEGPES(t,c);break;case"ac3":this.parseAC3PES(t,c);break}t.pesData=null}else o!=null&&o.size&&v.log("last AAC PES packet truncated,might overlap between fragments"),t.pesData=o;l&&(c=Ke(l))?(this.parseID3PES(i,c),i.pesData=null):i.pesData=l}demuxSampleAes(e,t,s){const i=this.demux(e,s,!0,!this.config.progressive),r=this.sampleAes=new So(this.observer,this.config,t);return this.decrypt(i,r)}decrypt(e,t){return new Promise(s=>{const{audioTrack:i,videoTrack:r}=e;i.samples&&i.segmentCodec==="aac"?t.decryptAacSamples(i.samples,0,()=>{r.samples?t.decryptAvcSamples(r.samples,0,0,()=>{s(e)}):s(e)}):r.samples&&t.decryptAvcSamples(r.samples,0,0,()=>{s(e)})})}destroy(){this._duration=0}parseAACPES(e,t){let s=0;const i=this.aacOverFlow;let r=t.data;if(i){this.aacOverFlow=null;const u=i.missing,d=i.sample.unit.byteLength;if(u===-1)r=pe(i.sample.unit,r);else{const g=d-u;i.sample.unit.set(r.subarray(0,u),g),e.samples.push(i.sample),s=i.missing}}let n,o;for(n=s,o=r.length;n0;)o+=l}}parseID3PES(e,t){if(t.pts===void 0){v.warn("[tsdemuxer]: ID3 PES unknown PTS");return}const s=se({},t,{type:this._videoTrack?ye.emsg:ye.audioId3,duration:Number.POSITIVE_INFINITY});e.samples.push(s)}}function fs(a,e){return((a[e+1]&31)<<8)+a[e+2]}function vo(a,e){return(a[e+10]&31)<<8|a[e+11]}function Ao(a,e,t,s,i){const r={audioPid:-1,videoPid:-1,id3Pid:-1,segmentVideoCodec:"avc",segmentAudioCodec:"aac"},n=(a[e+1]&15)<<8|a[e+2],o=e+3+n-4,l=(a[e+10]&15)<<8|a[e+11];for(e+=12+l;e0){let u=e+5,d=h;for(;d>2;){switch(a[u]){case 106:t.ac3!==!0?v.log("AC-3 audio found, not supported in this browser for now"):(r.audioPid=c,r.segmentAudioCodec="ac3");break}const f=a[u+1]+2;u+=f,d-=f}}break;case 194:case 135:return kt(i,new Error("Unsupported EC-3 in M2TS found")),r;case 36:return kt(i,new Error("Unsupported HEVC in M2TS found")),r}e+=h+5}return r}function kt(a,e,t){v.warn(`parsing error: ${e.message}`),a.emit(p.ERROR,p.ERROR,{type:$.MEDIA_ERROR,details:L.FRAG_PARSING_ERROR,fatal:!1,levelRetry:t,error:e,reason:e.message})}function jt(a){v.log(`${a} with AES-128-CBC encryption found in unencrypted stream`)}function Ke(a){let e=0,t,s,i,r,n;const o=a.data;if(!a||a.size===0)return null;for(;o[0].length<19&&o.length>1;)o[0]=pe(o[0],o[1]),o.splice(1,1);if(t=o[0],(t[0]<<16)+(t[1]<<8)+t[2]===1){if(s=(t[4]<<8)+t[5],s&&s>a.size-6)return null;const c=t[7];c&192&&(r=(t[9]&14)*536870912+(t[10]&255)*4194304+(t[11]&254)*16384+(t[12]&255)*128+(t[13]&254)/2,c&64?(n=(t[14]&14)*536870912+(t[15]&255)*4194304+(t[16]&254)*16384+(t[17]&255)*128+(t[18]&254)/2,r-n>60*9e4&&(v.warn(`${Math.round((r-n)/9e4)}s delta between PTS and DTS, align them`),r=n)):n=r),i=t[8];let h=i+9;if(a.size<=h)return null;a.size-=h;const u=new Uint8Array(a.size);for(let d=0,g=o.length;df){h-=f;continue}else t=t.subarray(h),f-=h,h=0;u.set(t,e),e+=f}return s&&(s-=i+3),{data:u,pts:r,dts:n,len:s}}return null}class Lo extends Cs{resetInitSegment(e,t,s,i){super.resetInitSegment(e,t,s,i),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:t,duration:i,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;const t=et(e,0);let s=(t==null?void 0:t.length)||0;if(t&&e[s]===11&&e[s+1]===119&&As(t)!==void 0&&vr(e,s)<=16)return!1;for(let i=e.length;s>24&255,n[1]=s>>16&255,n[2]=s>>8&255,n[3]=s&255,n.set(e,4),i=0,s=8;i>24&255,e>>16&255,e>>8&255,e&255,s>>24,s>>16&255,s>>8&255,s&255,i>>24,i>>16&255,i>>8&255,i&255,85,196,0,0]))}static mdia(e){return A.box(A.types.mdia,A.mdhd(e.timescale,e.duration),A.hdlr(e.type),A.minf(e))}static mfhd(e){return A.box(A.types.mfhd,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,e&255]))}static minf(e){return e.type==="audio"?A.box(A.types.minf,A.box(A.types.smhd,A.SMHD),A.DINF,A.stbl(e)):A.box(A.types.minf,A.box(A.types.vmhd,A.VMHD),A.DINF,A.stbl(e))}static moof(e,t,s){return A.box(A.types.moof,A.mfhd(e),A.traf(s,t))}static moov(e){let t=e.length;const s=[];for(;t--;)s[t]=A.trak(e[t]);return A.box.apply(null,[A.types.moov,A.mvhd(e[0].timescale,e[0].duration)].concat(s).concat(A.mvex(e)))}static mvex(e){let t=e.length;const s=[];for(;t--;)s[t]=A.trex(e[t]);return A.box.apply(null,[A.types.mvex,...s])}static mvhd(e,t){t*=e;const s=Math.floor(t/(ke+1)),i=Math.floor(t%(ke+1)),r=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,e&255,s>>24,s>>16&255,s>>8&255,s&255,i>>24,i>>16&255,i>>8&255,i&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return A.box(A.types.mvhd,r)}static sdtp(e){const t=e.samples||[],s=new Uint8Array(4+t.length);let i,r;for(i=0;i>>8&255),t.push(n&255),t=t.concat(Array.prototype.slice.call(r));for(i=0;i>>8&255),s.push(n&255),s=s.concat(Array.prototype.slice.call(r));const o=A.box(A.types.avcC,new Uint8Array([1,t[3],t[4],t[5],255,224|e.sps.length].concat(t).concat([e.pps.length]).concat(s))),l=e.width,c=e.height,h=e.pixelRatio[0],u=e.pixelRatio[1];return A.box(A.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,l>>8&255,l&255,c>>8&255,c&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),o,A.box(A.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),A.box(A.types.pasp,new Uint8Array([h>>24,h>>16&255,h>>8&255,h&255,u>>24,u>>16&255,u>>8&255,u&255])))}static esds(e){const t=e.config.length;return new Uint8Array([0,0,0,0,3,23+t,0,1,0,4,15+t,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([t]).concat(e.config).concat([6,1,2]))}static audioStsd(e){const t=e.samplerate;return new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,t>>8&255,t&255,0,0])}static mp4a(e){return A.box(A.types.mp4a,A.audioStsd(e),A.box(A.types.esds,A.esds(e)))}static mp3(e){return A.box(A.types[".mp3"],A.audioStsd(e))}static ac3(e){return A.box(A.types["ac-3"],A.audioStsd(e),A.box(A.types.dac3,e.config))}static stsd(e){return e.type==="audio"?e.segmentCodec==="mp3"&&e.codec==="mp3"?A.box(A.types.stsd,A.STSD,A.mp3(e)):e.segmentCodec==="ac3"?A.box(A.types.stsd,A.STSD,A.ac3(e)):A.box(A.types.stsd,A.STSD,A.mp4a(e)):A.box(A.types.stsd,A.STSD,A.avc1(e))}static tkhd(e){const t=e.id,s=e.duration*e.timescale,i=e.width,r=e.height,n=Math.floor(s/(ke+1)),o=Math.floor(s%(ke+1));return A.box(A.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,t&255,0,0,0,0,n>>24,n>>16&255,n>>8&255,n&255,o>>24,o>>16&255,o>>8&255,o&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,i>>8&255,i&255,0,0,r>>8&255,r&255,0,0]))}static traf(e,t){const s=A.sdtp(e),i=e.id,r=Math.floor(t/(ke+1)),n=Math.floor(t%(ke+1));return A.box(A.types.traf,A.box(A.types.tfhd,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,i&255])),A.box(A.types.tfdt,new Uint8Array([1,0,0,0,r>>24,r>>16&255,r>>8&255,r&255,n>>24,n>>16&255,n>>8&255,n&255])),A.trun(e,s.length+16+20+8+16+8+8),s)}static trak(e){return e.duration=e.duration||4294967295,A.box(A.types.trak,A.tkhd(e),A.mdia(e))}static trex(e){const t=e.id;return A.box(A.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,t&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}static trun(e,t){const s=e.samples||[],i=s.length,r=12+16*i,n=new Uint8Array(r);let o,l,c,h,u,d;for(t+=8+r,n.set([e.type==="video"?1:0,0,15,1,i>>>24&255,i>>>16&255,i>>>8&255,i&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255],0),o=0;o>>24&255,c>>>16&255,c>>>8&255,c&255,h>>>24&255,h>>>16&255,h>>>8&255,h&255,u.isLeading<<2|u.dependsOn,u.isDependedOn<<6|u.hasRedundancy<<4|u.paddingValue<<1|u.isNonSync,u.degradPrio&61440,u.degradPrio&15,d>>>24&255,d>>>16&255,d>>>8&255,d&255],12+16*o);return A.box(A.types.trun,n)}static initSegment(e){A.types||A.init();const t=A.moov(e);return pe(A.FTYP,t)}}A.types=void 0;A.HDLR_TYPES=void 0;A.STTS=void 0;A.STSC=void 0;A.STCO=void 0;A.STSZ=void 0;A.VMHD=void 0;A.SMHD=void 0;A.STSD=void 0;A.FTYP=void 0;A.DINF=void 0;const Lr=9e4;function ks(a,e,t=1,s=!1){const i=a*e*t;return s?Math.round(i):i}function Ro(a,e,t=1,s=!1){return ks(a,e,1/t,s)}function Je(a,e=!1){return ks(a,1e3,1/Lr,e)}function Io(a,e=1){return ks(a,Lr,1/e)}const bo=10*1e3,yi=1024,Do=1152,Co=1536;let Ve=null,zt=null;class Tt{constructor(e,t,s,i=""){if(this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextAvcDts=null,this.nextAudioPts=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.videoTrackConfig=void 0,this.observer=e,this.config=t,this.typeSupported=s,this.ISGenerated=!1,Ve===null){const n=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Ve=n?parseInt(n[1]):0}if(zt===null){const r=navigator.userAgent.match(/Safari\/(\d+)/i);zt=r?parseInt(r[1]):0}}destroy(){this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null}resetTimeStamp(e){v.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=e}resetNextTimestamp(){v.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){v.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1,this.videoTrackConfig=void 0}getVideoStartPts(e){let t=!1;const s=e.reduce((i,r)=>{const n=r.pts-i;return n<-4294967296?(t=!0,me(i,r.pts)):n>0?i:r.pts},e[0].pts);return t&&v.debug("PTS rollover detected"),s}remux(e,t,s,i,r,n,o,l){let c,h,u,d,g,f,m=r,T=r;const E=e.pid>-1,x=t.pid>-1,y=t.samples.length,I=e.samples.length>0,S=o&&y>0||y>1;if((!E||I)&&(!x||S)||this.ISGenerated||o){if(this.ISGenerated){var R,_,k,b;const K=this.videoTrackConfig;K&&(t.width!==K.width||t.height!==K.height||((R=t.pixelRatio)==null?void 0:R[0])!==((_=K.pixelRatio)==null?void 0:_[0])||((k=t.pixelRatio)==null?void 0:k[1])!==((b=K.pixelRatio)==null?void 0:b[1]))&&this.resetInitSegment()}else u=this.generateIS(e,t,r,n);const w=this.isVideoContiguous;let V=-1,P;if(S&&(V=_o(t.samples),!w&&this.config.forceKeyFrameOnDiscontinuity))if(f=!0,V>0){v.warn(`[mp4-remuxer]: Dropped ${V} out of ${y} video samples due to a missing keyframe`);const K=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(V),t.dropped+=V,T+=(t.samples[0].pts-K)/t.inputTimeScale,P=T}else V===-1&&(v.warn(`[mp4-remuxer]: No keyframe found out of ${y} video samples`),f=!1);if(this.ISGenerated){if(I&&S){const K=this.getVideoStartPts(t.samples),B=(me(e.samples[0].pts,K)-K)/t.inputTimeScale;m+=Math.max(0,B),T+=Math.max(0,-B)}if(I){if(e.samplerate||(v.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),u=this.generateIS(e,t,r,n)),h=this.remuxAudio(e,m,this.isAudioContiguous,n,x||S||l===U.AUDIO?T:void 0),S){const K=h?h.endPTS-h.startPTS:0;t.inputTimeScale||(v.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),u=this.generateIS(e,t,r,n)),c=this.remuxVideo(t,T,w,K)}}else S&&(c=this.remuxVideo(t,T,w,0));c&&(c.firstKeyFrame=V,c.independent=V!==-1,c.firstKeyFramePTS=P)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(s.samples.length&&(g=Rr(s,r,this._initPTS,this._initDTS)),i.samples.length&&(d=Ir(i,r,this._initPTS))),{audio:h,video:c,initSegment:u,independent:f,text:d,id3:g}}generateIS(e,t,s,i){const r=e.samples,n=t.samples,o=this.typeSupported,l={},c=this._initPTS;let h=!c||i,u="audio/mp4",d,g,f;if(h&&(d=g=1/0),e.config&&r.length){switch(e.timescale=e.samplerate,e.segmentCodec){case"mp3":o.mpeg?(u="audio/mpeg",e.codec=""):o.mp3&&(e.codec="mp3");break;case"ac3":e.codec="ac-3";break}l.audio={id:"audio",container:u,codec:e.codec,initSegment:e.segmentCodec==="mp3"&&o.mpeg?new Uint8Array(0):A.initSegment([e]),metadata:{channelCount:e.channelCount}},h&&(f=e.inputTimeScale,!c||f!==c.timescale?d=g=r[0].pts-Math.round(f*s):h=!1)}if(t.sps&&t.pps&&n.length){if(t.timescale=t.inputTimeScale,l.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:A.initSegment([t]),metadata:{width:t.width,height:t.height}},h)if(f=t.inputTimeScale,!c||f!==c.timescale){const m=this.getVideoStartPts(n),T=Math.round(f*s);g=Math.min(g,me(n[0].dts,m)-T),d=Math.min(d,m-T)}else h=!1;this.videoTrackConfig={width:t.width,height:t.height,pixelRatio:t.pixelRatio}}if(Object.keys(l).length)return this.ISGenerated=!0,h?(this._initPTS={baseTime:d,timescale:f},this._initDTS={baseTime:g,timescale:f}):d=f=void 0,{tracks:l,initPTS:d,timescale:f}}remuxVideo(e,t,s,i){const r=e.inputTimeScale,n=e.samples,o=[],l=n.length,c=this._initPTS;let h=this.nextAvcDts,u=8,d=this.videoSampleDuration,g,f,m=Number.POSITIVE_INFINITY,T=Number.NEGATIVE_INFINITY,E=!1;if(!s||h===null){const M=t*r,F=n[0].pts-me(n[0].dts,n[0].pts);Ve&&h!==null&&Math.abs(M-F-h)<15e3?s=!0:h=M-F}const x=c.baseTime*r/c.timescale;for(let M=0;M0?M-1:M].dts&&(E=!0)}E&&n.sort(function(M,F){const j=M.dts-F.dts,W=M.pts-F.pts;return j||W}),g=n[0].dts,f=n[n.length-1].dts;const y=f-g,I=y?Math.round(y/(l-1)):d||e.inputTimeScale/30;if(s){const M=g-h,F=M>I,j=M<-1;if((F||j)&&(F?v.warn(`AVC: ${Je(M,!0)} ms (${M}dts) hole between fragments detected at ${t.toFixed(3)}`):v.warn(`AVC: ${Je(-M,!0)} ms (${M}dts) overlapping between fragments detected at ${t.toFixed(3)}`),!j||h>=n[0].pts||Ve)){g=h;const W=n[0].pts-M;if(F)n[0].dts=g,n[0].pts=W;else for(let z=0;zW);z++)n[z].dts-=M,n[z].pts-=M;v.log(`Video: Initial PTS/DTS adjusted: ${Je(W,!0)}/${Je(g,!0)}, delta: ${Je(M,!0)} ms`)}}g=Math.max(0,g);let S=0,D=0,R=g;for(let M=0;M0?F.dts-n[M-1].dts:I;if(z=M>0?F.pts-n[M-1].pts:I,re.stretchShortVideoTrack&&this.nextAudioPts!==null){const fe=Math.floor(re.maxBufferHole*r),Qe=(i?m+i*r:this.nextAudioPts)-F.pts;Qe>fe?(d=Qe-le,d<0?d=le:w=!0,v.log(`[mp4-remuxer]: It is approximately ${Qe/90} ms to the next segment; using duration ${d/90} ms for the last video frame.`)):d=le}else d=le}const te=Math.round(F.pts-F.dts);V=Math.min(V,d),K=Math.max(K,d),P=Math.min(P,z),G=Math.max(G,z),o.push(new xi(F.key,d,W,te))}if(o.length){if(Ve){if(Ve<70){const M=o[0].flags;M.dependsOn=2,M.isNonSync=0}}else if(zt&&G-P0&&(i&&Math.abs(x-E)<9e3||Math.abs(me(m[0].pts-y,x)-E)<20*h),m.forEach(function(B){B.pts=me(B.pts-y,x)}),!s||E<0){if(m=m.filter(B=>B.pts>=0),!m.length)return;r===0?E=0:i&&!f?E=Math.max(0,x):E=m[0].pts}if(e.segmentCodec==="aac"){const B=this.config.maxAudioFramesDrift;for(let q=0,Q=E;q=B*h&&W0){R+=T;try{D=new Uint8Array(R)}catch(W){this.observer.emit(p.ERROR,p.ERROR,{type:$.MUX_ERROR,details:L.REMUX_ALLOC_ERROR,fatal:!1,error:W,bytes:R,reason:`fail allocating audio mdat ${R}`});return}d||(new DataView(D.buffer).setUint32(0,R),D.set(A.types.mdat,4))}else return;D.set(M,T);const j=M.byteLength;T+=j,g.push(new xi(!0,c,j,0)),S=F}const k=g.length;if(!k)return;const b=g[g.length-1];this.nextAudioPts=E=S+l*b.duration;const w=d?new Uint8Array(0):A.moof(e.sequenceNumber++,I/l,se({},e,{samples:g}));e.samples=[];const V=I/n,P=E/n,G={data1:w,data2:D,startPTS:V,endPTS:P,startDTS:V,endDTS:P,type:"audio",hasAudio:!0,hasVideo:!1,nb:k};return this.isAudioContiguous=!0,G}remuxEmptyAudio(e,t,s,i){const r=e.inputTimeScale,n=e.samplerate?e.samplerate:r,o=r/n,l=this.nextAudioPts,c=this._initDTS,h=c.baseTime*9e4/c.timescale,u=(l!==null?l:i.startDTS*r)+h,d=i.endDTS*r+h,g=o*yi,f=Math.ceil((d-u)/g),m=Ei.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);if(v.warn("[mp4-remuxer]: remux empty Audio"),!m){v.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}const T=[];for(let E=0;E4294967296;)a+=t;return a}function _o(a){for(let e=0;en.pts-o.pts);const r=a.samples;return a.samples=[],{samples:r}}class xi{constructor(e,t,s,i){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=t,this.size=s,this.cts=i,this.flags={isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:e?2:1,isNonSync:e?0:1}}}class wo{constructor(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=null,this.initTracks=void 0,this.lastEndTime=null}destroy(){}resetTimeStamp(e){this.initPTS=e,this.lastEndTime=null}resetNextTimestamp(){this.lastEndTime=null}resetInitSegment(e,t,s,i){this.audioCodec=t,this.videoCodec=s,this.generateInitSegment(Nn(e,i)),this.emitInitSegment=!0}generateInitSegment(e){let{audioCodec:t,videoCodec:s}=this;if(!(e!=null&&e.byteLength)){this.initTracks=void 0,this.initData=void 0;return}const i=this.initData=Qi(e);i.audio&&(t=Si(i.audio,X.AUDIO)),i.video&&(s=Si(i.video,X.VIDEO));const r={};i.audio&&i.video?r.audiovideo={container:"video/mp4",codec:t+","+s,initSegment:e,id:"main"}:i.audio?r.audio={container:"audio/mp4",codec:t,initSegment:e,id:"audio"}:i.video?r.video={container:"video/mp4",codec:s,initSegment:e,id:"main"}:v.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=r}remux(e,t,s,i,r,n){var o,l;let{initPTS:c,lastEndTime:h}=this;const u={audio:void 0,video:void 0,text:i,id3:s,initSegment:void 0};O(h)||(h=this.lastEndTime=r||0);const d=t.samples;if(!(d!=null&&d.length))return u;const g={initPTS:void 0,timescale:1};let f=this.initData;if((o=f)!=null&&o.length||(this.generateInitSegment(d),f=this.initData),!((l=f)!=null&&l.length))return v.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),u;this.emitInitSegment&&(g.tracks=this.initTracks,this.emitInitSegment=!1);const m=Bn(d,f),T=Un(f,d),E=T===null?r:T;(ko(c,E,r,m)||g.timescale!==c.timescale&&n)&&(g.initPTS=E-r,c&&c.timescale===1&&v.warn(`Adjusting initPTS by ${g.initPTS-c.baseTime}`),this.initPTS=c={baseTime:g.initPTS,timescale:1});const x=e?E-c.baseTime/c.timescale:h,y=x+m;Gn(f,d,c.baseTime/c.timescale),m>0?this.lastEndTime=y:(v.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const I=!!f.audio,S=!!f.video;let D="";I&&(D+="audio"),S&&(D+="video");const R={data1:d,startPTS:x,startDTS:x,endPTS:y,endDTS:y,type:D,hasAudio:I,hasVideo:S,nb:1,dropped:0};return u.audio=R.type==="audio"?R:void 0,u.video=R.type!=="audio"?R:void 0,u.initSegment=g,u.id3=Rr(s,r,c,c),i.samples.length&&(u.text=Ir(i,r,c)),u}}function ko(a,e,t,s){if(a===null)return!0;const i=Math.max(s,1),r=e-a.baseTime/a.timescale;return Math.abs(r-t)>i}function Si(a,e){const t=a==null?void 0:a.codec;if(t&&t.length>4)return t;if(e===X.AUDIO){if(t==="ec-3"||t==="ac-3"||t==="alac")return t;if(t==="fLaC"||t==="Opus")return Rt(t,!1);const s="mp4a.40.5";return v.info(`Parsed audio codec "${t}" or audio object type not handled. Using "${s}"`),s}return v.warn(`Unhandled video codec "${t}"`),t==="hvc1"||t==="hev1"?"hvc1.1.6.L120.90":t==="av01"?"av01.0.04M.08":"avc1.42e01e"}let _e;try{_e=self.performance.now.bind(self.performance)}catch{v.debug("Unable to use Performance API on this environment"),_e=qe==null?void 0:qe.Date.now}const Et=[{demux:To,remux:wo},{demux:Pe,remux:Tt},{demux:mo,remux:Tt},{demux:Lo,remux:Tt}];Et.splice(2,0,{demux:Eo,remux:Tt});class vi{constructor(e,t,s,i,r){this.async=!1,this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.observer=e,this.typeSupported=t,this.config=s,this.vendor=i,this.id=r}configure(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()}push(e,t,s,i){const r=s.transmuxing;r.executeStart=_e();let n=new Uint8Array(e);const{currentTransmuxState:o,transmuxConfig:l}=this;i&&(this.currentTransmuxState=i);const{contiguous:c,discontinuity:h,trackSwitch:u,accurateTimeOffset:d,timeOffset:g,initSegmentChange:f}=i||o,{audioCodec:m,videoCodec:T,defaultInitPts:E,duration:x,initSegmentData:y}=l,I=Po(n,t);if(I&&I.method==="AES-128"){const _=this.getDecrypter();if(_.isSync()){let k=_.softwareDecrypt(n,I.key.buffer,I.iv.buffer);if(s.part>-1&&(k=_.flush()),!k)return r.executeEnd=_e(),Xt(s);n=new Uint8Array(k)}else return this.decryptionPromise=_.webCryptoDecrypt(n,I.key.buffer,I.iv.buffer).then(k=>{const b=this.push(k,null,s);return this.decryptionPromise=null,b}),this.decryptionPromise}const S=this.needsProbing(h,u);if(S){const _=this.configureTransmuxer(n);if(_)return v.warn(`[transmuxer] ${_.message}`),this.observer.emit(p.ERROR,p.ERROR,{type:$.MEDIA_ERROR,details:L.FRAG_PARSING_ERROR,fatal:!1,error:_,reason:_.message}),r.executeEnd=_e(),Xt(s)}(h||u||f||S)&&this.resetInitSegment(y,m,T,x,t),(h||f||S)&&this.resetInitialTimestamp(E),c||this.resetContiguity();const D=this.transmux(n,I,g,d,s),R=this.currentTransmuxState;return R.contiguous=!0,R.discontinuity=!1,R.trackSwitch=!1,r.executeEnd=_e(),D}flush(e){const t=e.transmuxing;t.executeStart=_e();const{decrypter:s,currentTransmuxState:i,decryptionPromise:r}=this;if(r)return r.then(()=>this.flush(e));const n=[],{timeOffset:o}=i;if(s){const u=s.flush();u&&n.push(this.push(u,null,e))}const{demuxer:l,remuxer:c}=this;if(!l||!c)return t.executeEnd=_e(),[Xt(e)];const h=l.flush(o);return yt(h)?h.then(u=>(this.flushRemux(n,u,e),n)):(this.flushRemux(n,h,e),n)}flushRemux(e,t,s){const{audioTrack:i,videoTrack:r,id3Track:n,textTrack:o}=t,{accurateTimeOffset:l,timeOffset:c}=this.currentTransmuxState;v.log(`[transmuxer.ts]: Flushed fragment ${s.sn}${s.part>-1?" p: "+s.part:""} of level ${s.level}`);const h=this.remuxer.remux(i,r,n,o,c,l,!0,this.id);e.push({remuxResult:h,chunkMeta:s}),s.transmuxing.executeEnd=_e()}resetInitialTimestamp(e){const{demuxer:t,remuxer:s}=this;!t||!s||(t.resetTimeStamp(e),s.resetTimeStamp(e))}resetContiguity(){const{demuxer:e,remuxer:t}=this;!e||!t||(e.resetContiguity(),t.resetNextTimestamp())}resetInitSegment(e,t,s,i,r){const{demuxer:n,remuxer:o}=this;!n||!o||(n.resetInitSegment(e,t,s,i),o.resetInitSegment(e,t,s,r))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(e,t,s,i,r){let n;return t&&t.method==="SAMPLE-AES"?n=this.transmuxSampleAes(e,t,s,i,r):n=this.transmuxUnencrypted(e,s,i,r),n}transmuxUnencrypted(e,t,s,i){const{audioTrack:r,videoTrack:n,id3Track:o,textTrack:l}=this.demuxer.demux(e,t,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(r,n,o,l,t,s,!1,this.id),chunkMeta:i}}transmuxSampleAes(e,t,s,i,r){return this.demuxer.demuxSampleAes(e,t,s).then(n=>({remuxResult:this.remuxer.remux(n.audioTrack,n.videoTrack,n.id3Track,n.textTrack,s,i,!1,this.id),chunkMeta:r}))}configureTransmuxer(e){const{config:t,observer:s,typeSupported:i,vendor:r}=this;let n;for(let d=0,g=Et.length;d0&&(e==null?void 0:e.key)!=null&&e.iv!==null&&e.method!=null&&(t=e),t}const Xt=a=>({remuxResult:{},chunkMeta:a});function yt(a){return"then"in a&&a.then instanceof Function}class Fo{constructor(e,t,s,i,r){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=e,this.videoCodec=t,this.initSegmentData=s,this.duration=i,this.defaultInitPts=r||null}}class Oo{constructor(e,t,s,i,r,n){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.initSegmentChange=void 0,this.discontinuity=e,this.contiguous=t,this.accurateTimeOffset=s,this.trackSwitch=i,this.timeOffset=r,this.initSegmentChange=n}}var br={exports:{}};(function(a){var e=Object.prototype.hasOwnProperty,t="~";function s(){}Object.create&&(s.prototype=Object.create(null),new s().__proto__||(t=!1));function i(l,c,h){this.fn=l,this.context=c,this.once=h||!1}function r(l,c,h,u,d){if(typeof h!="function")throw new TypeError("The listener must be a function");var g=new i(h,u||l,d),f=t?t+c:c;return l._events[f]?l._events[f].fn?l._events[f]=[l._events[f],g]:l._events[f].push(g):(l._events[f]=g,l._eventsCount++),l}function n(l,c){--l._eventsCount===0?l._events=new s:delete l._events[c]}function o(){this._events=new s,this._eventsCount=0}o.prototype.eventNames=function(){var c=[],h,u;if(this._eventsCount===0)return c;for(u in h=this._events)e.call(h,u)&&c.push(t?u.slice(1):u);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(h)):c},o.prototype.listeners=function(c){var h=t?t+c:c,u=this._events[h];if(!u)return[];if(u.fn)return[u.fn];for(var d=0,g=u.length,f=new Array(g);d{h=h||{},h.frag=this.frag,h.id=this.id,c===p.ERROR&&(this.error=h.error),this.hls.trigger(c,h)};this.observer=new Ps,this.observer.on(p.FRAG_DECRYPTED,n),this.observer.on(p.ERROR,n);const o=Ue(r.preferManagedMediaSource)||{isTypeSupported:()=>!1},l={mpeg:o.isTypeSupported("audio/mpeg"),mp3:o.isTypeSupported('audio/mp4; codecs="mp3"'),ac3:o.isTypeSupported('audio/mp4; codecs="ac-3"')};if(this.useWorker&&typeof Worker<"u"&&(r.workerPath||eo())){try{r.workerPath?(v.log(`loading Web Worker ${r.workerPath} for "${t}"`),this.workerContext=so(r.workerPath)):(v.log(`injecting Web Worker for "${t}"`),this.workerContext=to()),this.onwmsg=u=>this.onWorkerMessage(u);const{worker:h}=this.workerContext;h.addEventListener("message",this.onwmsg),h.onerror=u=>{const d=new Error(`${u.message} (${u.filename}:${u.lineno})`);r.enableWorker=!1,v.warn(`Error in "${t}" Web Worker, fallback to inline`),this.hls.trigger(p.ERROR,{type:$.OTHER_ERROR,details:L.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:d})},h.postMessage({cmd:"init",typeSupported:l,vendor:"",id:t,config:JSON.stringify(r)})}catch(h){v.warn(`Error setting up "${t}" Web Worker, fallback to inline`,h),this.resetWorker(),this.error=null,this.transmuxer=new vi(this.observer,l,r,"",t)}return}this.transmuxer=new vi(this.observer,l,r,"",t)}resetWorker(){if(this.workerContext){const{worker:e,objectURL:t}=this.workerContext;t&&self.URL.revokeObjectURL(t),e.removeEventListener("message",this.onwmsg),e.onerror=null,e.terminate(),this.workerContext=null}}destroy(){if(this.workerContext)this.resetWorker(),this.onwmsg=void 0;else{const t=this.transmuxer;t&&(t.destroy(),this.transmuxer=null)}const e=this.observer;e&&e.removeAllListeners(),this.frag=null,this.observer=null,this.hls=null}push(e,t,s,i,r,n,o,l,c,h){var u,d;c.transmuxing.start=self.performance.now();const{transmuxer:g}=this,f=n?n.start:r.start,m=r.decryptdata,T=this.frag,E=!(T&&r.cc===T.cc),x=!(T&&c.level===T.level),y=T?c.sn-T.sn:-1,I=this.part?c.part-this.part.index:-1,S=y===0&&c.id>1&&c.id===(T==null?void 0:T.stats.chunkCount),D=!x&&(y===1||y===0&&(I===1||S&&I<=0)),R=self.performance.now();(x||y||r.stats.parsing.start===0)&&(r.stats.parsing.start=R),n&&(I||!D)&&(n.stats.parsing.start=R);const _=!(T&&((u=r.initSegment)==null?void 0:u.url)===((d=T.initSegment)==null?void 0:d.url)),k=new Oo(E,D,l,x,f,_);if(!D||E||_){v.log(`[transmuxer-interface, ${r.type}]: Starting new transmux session for sn: ${c.sn} p: ${c.part} level: ${c.level} id: ${c.id} + discontinuity: ${E} + trackSwitch: ${x} + contiguous: ${D} + accurateTimeOffset: ${l} + timeOffset: ${f} + initSegmentChange: ${_}`);const b=new Fo(s,i,t,o,h);this.configureTransmuxer(b)}if(this.frag=r,this.part=n,this.workerContext)this.workerContext.worker.postMessage({cmd:"demux",data:e,decryptdata:m,chunkMeta:c,state:k},e instanceof ArrayBuffer?[e]:[]);else if(g){const b=g.push(e,m,c,k);yt(b)?(g.async=!0,b.then(w=>{this.handleTransmuxComplete(w)}).catch(w=>{this.transmuxerError(w,c,"transmuxer-interface push error")})):(g.async=!1,this.handleTransmuxComplete(b))}}flush(e){e.transmuxing.start=self.performance.now();const{transmuxer:t}=this;if(this.workerContext)this.workerContext.worker.postMessage({cmd:"flush",chunkMeta:e});else if(t){let s=t.flush(e);yt(s)||t.async?(yt(s)||(s=Promise.resolve(s)),s.then(r=>{this.handleFlushResult(r,e)}).catch(r=>{this.transmuxerError(r,e,"transmuxer-interface flush error")})):this.handleFlushResult(s,e)}}transmuxerError(e,t,s){this.hls&&(this.error=e,this.hls.trigger(p.ERROR,{type:$.MEDIA_ERROR,details:L.FRAG_PARSING_ERROR,chunkMeta:t,frag:this.frag||void 0,fatal:!1,error:e,err:e,reason:s}))}handleFlushResult(e,t){e.forEach(s=>{this.handleTransmuxComplete(s)}),this.onFlush(t)}onWorkerMessage(e){const t=e.data;if(!(t!=null&&t.event)){v.warn(`worker message received with no ${t?"event name":"data"}`);return}const s=this.hls;if(this.hls)switch(t.event){case"init":{var i;const r=(i=this.workerContext)==null?void 0:i.objectURL;r&&self.URL.revokeObjectURL(r);break}case"transmuxComplete":{this.handleTransmuxComplete(t.data);break}case"flush":{this.onFlush(t.data);break}case"workerLog":v[t.data.logType]&&v[t.data.logType](t.data.message);break;default:{t.data=t.data||{},t.data.frag=this.frag,t.data.id=this.id,s.trigger(t.event,t.data);break}}}configureTransmuxer(e){const{transmuxer:t}=this;this.workerContext?this.workerContext.worker.postMessage({cmd:"configure",config:e}):t&&t.configure(e)}handleTransmuxComplete(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)}}function Cr(a,e){if(a.length!==e.length)return!1;for(let t=0;ta[i]!==e[i])}function gs(a,e){return e.label.toLowerCase()===a.name.toLowerCase()&&(!e.language||e.language.toLowerCase()===(a.lang||"").toLowerCase())}const Ai=100;class No extends Ds{constructor(e,t,s){super(e,t,s,"[audio-stream-controller]",U.AUDIO),this.videoBuffer=null,this.videoTrackCC=-1,this.waitingVideoCC=-1,this.bufferedTrack=null,this.switchingTrack=null,this.trackId=-1,this.waitingData=null,this.mainDetails=null,this.flushing=!1,this.bufferFlushed=!1,this.cachedTrackLoadedData=null,this._registerListeners()}onHandlerDestroying(){this._unregisterListeners(),super.onHandlerDestroying(),this.mainDetails=null,this.bufferedTrack=null,this.switchingTrack=null}_registerListeners(){const{hls:e}=this;e.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.LEVEL_LOADED,this.onLevelLoaded,this),e.on(p.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.on(p.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(p.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(p.ERROR,this.onError,this),e.on(p.BUFFER_RESET,this.onBufferReset,this),e.on(p.BUFFER_CREATED,this.onBufferCreated,this),e.on(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(p.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(p.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(p.FRAG_BUFFERED,this.onFragBuffered,this)}_unregisterListeners(){const{hls:e}=this;e.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.LEVEL_LOADED,this.onLevelLoaded,this),e.off(p.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.off(p.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(p.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(p.ERROR,this.onError,this),e.off(p.BUFFER_RESET,this.onBufferReset,this),e.off(p.BUFFER_CREATED,this.onBufferCreated,this),e.off(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(p.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(p.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(p.FRAG_BUFFERED,this.onFragBuffered,this)}onInitPtsFound(e,{frag:t,id:s,initPTS:i,timescale:r}){if(s==="main"){const n=t.cc;this.initPTS[t.cc]={baseTime:i,timescale:r},this.log(`InitPTS for cc: ${n} found from main: ${i}`),this.videoTrackCC=n,this.state===C.WAITING_INIT_PTS&&this.tick()}}startLoad(e){if(!this.levels){this.startPosition=e,this.state=C.STOPPED;return}const t=this.lastCurrentTime;this.stopLoad(),this.setInterval(Ai),t>0&&e===-1?(this.log(`Override startPosition with lastCurrentTime @${t.toFixed(3)}`),e=t,this.state=C.IDLE):(this.loadedmetadata=!1,this.state=C.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}doTick(){switch(this.state){case C.IDLE:this.doTickIdle();break;case C.WAITING_TRACK:{var e;const{levels:s,trackId:i}=this,r=s==null||(e=s[i])==null?void 0:e.details;if(r){if(this.waitForCdnTuneIn(r))break;this.state=C.WAITING_INIT_PTS}break}case C.FRAG_LOADING_WAITING_RETRY:{var t;const s=performance.now(),i=this.retryDate;if(!i||s>=i||(t=this.media)!=null&&t.seeking){const{levels:r,trackId:n}=this;this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded((r==null?void 0:r[n])||null),this.state=C.IDLE}break}case C.WAITING_INIT_PTS:{const s=this.waitingData;if(s){const{frag:i,part:r,cache:n,complete:o}=s;if(this.initPTS[i.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=C.FRAG_LOADING;const l=n.flush(),c={frag:i,part:r,payload:l,networkDetails:null};this._handleFragmentLoadProgress(c),o&&super._handleFragmentLoadComplete(c)}else if(this.videoTrackCC!==this.waitingVideoCC)this.log(`Waiting fragment cc (${i.cc}) cancelled because video is at cc ${this.videoTrackCC}`),this.clearWaitingFragment();else{const l=this.getLoadPosition(),c=J.bufferInfo(this.mediaBuffer,l,this.config.maxBufferHole);ds(c.end,this.config.maxFragLookUpTolerance,i)<0&&(this.log(`Waiting fragment cc (${i.cc}) @ ${i.start} cancelled because another fragment at ${c.end} is needed`),this.clearWaitingFragment())}}else this.state=C.IDLE}}this.onTickEnd()}clearWaitingFragment(){const e=this.waitingData;e&&(this.fragmentTracker.removeFragment(e.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=C.IDLE)}resetLoadingState(){this.clearWaitingFragment(),super.resetLoadingState()}onTickEnd(){const{media:e}=this;e!=null&&e.readyState&&(this.lastCurrentTime=e.currentTime)}doTickIdle(){const{hls:e,levels:t,media:s,trackId:i}=this,r=e.config;if(!s&&(this.startFragRequested||!r.startFragPrefetch)||!(t!=null&&t[i]))return;const n=t[i],o=n.details;if(!o||o.live&&this.levelLastLoaded!==n||this.waitForCdnTuneIn(o)){this.state=C.WAITING_TRACK;return}const l=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&l&&(this.bufferFlushed=!1,this.afterBufferFlushed(l,X.AUDIO,U.AUDIO));const c=this.getFwdBufferInfo(l,U.AUDIO);if(c===null)return;const{bufferedTrack:h,switchingTrack:u}=this;if(!u&&this._streamEnded(c,o)){e.trigger(p.BUFFER_EOS,{type:"audio"}),this.state=C.ENDED;return}const d=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,U.MAIN),g=c.len,f=this.getMaxBufferLength(d==null?void 0:d.len),m=o.fragments,T=m[0].start;let E=this.flushing?this.getLoadPosition():c.end;if(u&&s){const S=this.getLoadPosition();h&&!ze(u.attrs,h.attrs)&&(E=S),o.PTSKnown&&ST||c.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),s.currentTime=T+.05)}if(g>=f&&!u&&Ed.end+o.targetduration;if(I||!(d!=null&&d.len)&&c.len){const S=this.getAppendedFrag(x.start,U.MAIN);if(S===null||(y||(y=!!S.gap||!!I&&d.len===0),I&&!y||y&&c.nextStart&&c.nextStartnew je(s))}onAudioTrackSwitching(e,t){const s=!!t.url;this.trackId=t.id;const{fragCurrent:i}=this;i&&(i.abortRequests(),this.removeUnbufferedFrags(i.start)),this.resetLoadingState(),s?this.setInterval(Ai):this.resetTransmuxer(),s?(this.switchingTrack=t,this.state=C.IDLE,this.flushAudioIfNeeded(t)):(this.switchingTrack=null,this.bufferedTrack=t,this.state=C.STOPPED),this.tick()}onManifestLoading(){this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=this.flushing=!1,this.levels=this.mainDetails=this.waitingData=this.bufferedTrack=this.cachedTrackLoadedData=this.switchingTrack=null,this.startFragRequested=!1,this.trackId=this.videoTrackCC=this.waitingVideoCC=-1}onLevelLoaded(e,t){this.mainDetails=t.details,this.cachedTrackLoadedData!==null&&(this.hls.trigger(p.AUDIO_TRACK_LOADED,this.cachedTrackLoadedData),this.cachedTrackLoadedData=null)}onAudioTrackLoaded(e,t){var s;if(this.mainDetails==null){this.cachedTrackLoadedData=t;return}const{levels:i}=this,{details:r,id:n}=t;if(!i){this.warn(`Audio tracks were reset while loading level ${n}`);return}this.log(`Audio track ${n} loaded [${r.startSN},${r.endSN}]${r.lastPartSn?`[part-${r.lastPartSn}-${r.lastPartIndex}]`:""},duration:${r.totalduration}`);const o=i[n];let l=0;if(r.live||(s=o.details)!=null&&s.live){this.checkLiveUpdate(r);const h=this.mainDetails;if(r.deltaUpdateFailed||!h)return;if(!o.details&&r.hasProgramDateTime&&h.hasProgramDateTime)_t(r,h),l=r.fragments[0].start;else{var c;l=this.alignPlaylists(r,o.details,(c=this.levelLastLoaded)==null?void 0:c.details)}}o.details=r,this.levelLastLoaded=o,!this.startFragRequested&&(this.mainDetails||!r.live)&&this.setStartPosition(this.mainDetails||r,l),this.state===C.WAITING_TRACK&&!this.waitForCdnTuneIn(r)&&(this.state=C.IDLE),this.tick()}_handleFragmentLoadProgress(e){var t;const{frag:s,part:i,payload:r}=e,{config:n,trackId:o,levels:l}=this;if(!l){this.warn(`Audio tracks were reset while fragment load was in progress. Fragment ${s.sn} of level ${s.level} will not be buffered`);return}const c=l[o];if(!c){this.warn("Audio track is undefined on fragment load progress");return}const h=c.details;if(!h){this.warn("Audio track details undefined on fragment load progress"),this.removeUnbufferedFrags(s.start);return}const u=n.defaultAudioCodec||c.audioCodec||"mp4a.40.2";let d=this.transmuxer;d||(d=this.transmuxer=new Dr(this.hls,U.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const g=this.initPTS[s.cc],f=(t=s.initSegment)==null?void 0:t.data;if(g!==void 0){const T=i?i.index:-1,E=T!==-1,x=new Is(s.level,s.sn,s.stats.chunkCount,r.byteLength,T,E);d.push(r,f,u,"",s,i,h.totalduration,!1,x,g)}else{this.log(`Unknown video PTS for cc ${s.cc}, waiting for video PTS before demuxing audio frag ${s.sn} of [${h.startSN} ,${h.endSN}],track ${o}`);const{cache:m}=this.waitingData=this.waitingData||{frag:s,part:i,cache:new dr,complete:!1};m.push(new Uint8Array(r)),this.waitingVideoCC=this.videoTrackCC,this.state=C.WAITING_INIT_PTS}}_handleFragmentLoadComplete(e){if(this.waitingData){this.waitingData.complete=!0;return}super._handleFragmentLoadComplete(e)}onBufferReset(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1}onBufferCreated(e,t){const s=t.tracks.audio;s&&(this.mediaBuffer=s.buffer||null),t.tracks.video&&(this.videoBuffer=t.tracks.video.buffer||null)}onFragBuffered(e,t){const{frag:s,part:i}=t;if(s.type!==U.AUDIO){if(!this.loadedmetadata&&s.type===U.MAIN){const r=this.videoBuffer||this.media;r&&J.getBuffered(r).length&&(this.loadedmetadata=!0)}return}if(this.fragContextChanged(s)){this.warn(`Fragment ${s.sn}${i?" p: "+i.index:""} of level ${s.level} finished buffering, but was aborted. state: ${this.state}, audioSwitch: ${this.switchingTrack?this.switchingTrack.name:"false"}`);return}if(s.sn!=="initSegment"){this.fragPrevious=s;const r=this.switchingTrack;r&&(this.bufferedTrack=r,this.switchingTrack=null,this.hls.trigger(p.AUDIO_TRACK_SWITCHED,oe({},r)))}this.fragBufferedComplete(s,i)}onError(e,t){var s;if(t.fatal){this.state=C.ERROR;return}switch(t.details){case L.FRAG_GAP:case L.FRAG_PARSING_ERROR:case L.FRAG_DECRYPT_ERROR:case L.FRAG_LOAD_ERROR:case L.FRAG_LOAD_TIMEOUT:case L.KEY_LOAD_ERROR:case L.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(U.AUDIO,t);break;case L.AUDIO_TRACK_LOAD_ERROR:case L.AUDIO_TRACK_LOAD_TIMEOUT:case L.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===C.WAITING_TRACK&&((s=t.context)==null?void 0:s.type)===Y.AUDIO_TRACK&&(this.state=C.IDLE);break;case L.BUFFER_APPEND_ERROR:case L.BUFFER_FULL_ERROR:if(!t.parent||t.parent!=="audio")return;if(t.details===L.BUFFER_APPEND_ERROR){this.resetLoadingState();return}this.reduceLengthAndFlushBuffer(t)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case L.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onBufferFlushing(e,{type:t}){t!==X.VIDEO&&(this.flushing=!0)}onBufferFlushed(e,{type:t}){if(t!==X.VIDEO){this.flushing=!1,this.bufferFlushed=!0,this.state===C.ENDED&&(this.state=C.IDLE);const s=this.mediaBuffer||this.media;s&&(this.afterBufferFlushed(s,t,U.AUDIO),this.tick())}}_handleTransmuxComplete(e){var t;const s="audio",{hls:i}=this,{remuxResult:r,chunkMeta:n}=e,o=this.getCurrentContext(n);if(!o){this.resetWhenMissingContext(n);return}const{frag:l,part:c,level:h}=o,{details:u}=h,{audio:d,text:g,id3:f,initSegment:m}=r;if(this.fragContextChanged(l)||!u){this.fragmentTracker.removeFragment(l);return}if(this.state=C.PARSING,this.switchingTrack&&d&&this.completeAudioSwitch(this.switchingTrack),m!=null&&m.tracks){const T=l.initSegment||l;this._bufferInitSegment(h,m.tracks,T,n),i.trigger(p.FRAG_PARSING_INIT_SEGMENT,{frag:T,id:s,tracks:m.tracks})}if(d){const{startPTS:T,endPTS:E,startDTS:x,endDTS:y}=d;c&&(c.elementaryStreams[X.AUDIO]={startPTS:T,endPTS:E,startDTS:x,endDTS:y}),l.setElementaryStreamInfo(X.AUDIO,T,E,x,y),this.bufferFragmentData(d,l,c,n)}if(f!=null&&(t=f.samples)!=null&&t.length){const T=se({id:s,frag:l,details:u},f);i.trigger(p.FRAG_PARSING_METADATA,T)}if(g){const T=se({id:s,frag:l,details:u},g);i.trigger(p.FRAG_PARSING_USERDATA,T)}}_bufferInitSegment(e,t,s,i){if(this.state!==C.PARSING)return;t.video&&delete t.video;const r=t.audio;if(!r)return;r.id="audio";const n=e.audioCodec;this.log(`Init audio buffer, container:${r.container}, codecs[level/parsed]=[${n}/${r.codec}]`),n&&n.split(",").length===1&&(r.levelCodec=n),this.hls.trigger(p.BUFFER_CODECS,t);const o=r.initSegment;if(o!=null&&o.byteLength){const l={type:"audio",frag:s,part:null,chunkMeta:i,parent:s.type,data:o};this.hls.trigger(p.BUFFER_APPENDING,l)}this.tickImmediate()}loadFragment(e,t,s){const i=this.fragmentTracker.getState(e);if(this.fragCurrent=e,this.switchingTrack||i===ae.NOT_LOADED||i===ae.PARTIAL){var r;if(e.sn==="initSegment")this._loadInitSegment(e,t);else if((r=t.details)!=null&&r.live&&!this.initPTS[e.cc]){this.log(`Waiting for video PTS in continuity counter ${e.cc} of live stream before loading audio fragment ${e.sn} of level ${this.trackId}`),this.state=C.WAITING_INIT_PTS;const n=this.mainDetails;n&&n.fragments[0].start!==t.details.fragments[0].start&&_t(t.details,n)}else this.startFragRequested=!0,super.loadFragment(e,t,s)}else this.clearTrackerIfNeeded(e)}flushAudioIfNeeded(e){const{media:t,bufferedTrack:s}=this,i=s==null?void 0:s.attrs,r=e.attrs;t&&i&&(i.CHANNELS!==r.CHANNELS||s.name!==e.name||s.lang!==e.lang)&&(this.log("Switching audio track : flushing all audio"),super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"),this.bufferedTrack=null)}completeAudioSwitch(e){const{hls:t}=this;this.flushAudioIfNeeded(e),this.bufferedTrack=e,this.switchingTrack=null,t.trigger(p.AUDIO_TRACK_SWITCHED,oe({},e))}}class Uo extends Rs{constructor(e){super(e,"[audio-track-controller]"),this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.registerListeners()}registerListeners(){const{hls:e}=this;e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_PARSED,this.onManifestParsed,this),e.on(p.LEVEL_LOADING,this.onLevelLoading,this),e.on(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(p.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(p.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_PARSED,this.onManifestParsed,this),e.off(p.LEVEL_LOADING,this.onLevelLoading,this),e.off(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(p.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(p.ERROR,this.onError,this)}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,super.destroy()}onManifestLoading(){this.tracks=[],this.tracksInGroup=[],this.groupIds=null,this.currentTrack=null,this.trackId=-1,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.audioTracks||[]}onAudioTrackLoaded(e,t){const{id:s,groupId:i,details:r}=t,n=this.tracksInGroup[s];if(!n||n.groupId!==i){this.warn(`Audio track with id:${s} and group:${i} not found in active group ${n==null?void 0:n.groupId}`);return}const o=n.details;n.details=t.details,this.log(`Audio track ${s} "${n.name}" lang:${n.lang} group:${i} loaded [${r.startSN}-${r.endSN}]`),s===this.trackId&&this.playlistLoaded(s,t,o)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const s=t.audioGroups||null,i=this.groupIds;let r=this.currentTrack;if(!s||(i==null?void 0:i.length)!==(s==null?void 0:s.length)||s!=null&&s.some(o=>(i==null?void 0:i.indexOf(o))===-1)){this.groupIds=s,this.trackId=-1,this.currentTrack=null;const o=this.tracks.filter(d=>!s||s.indexOf(d.groupId)!==-1);if(o.length)this.selectDefaultTrack&&!o.some(d=>d.default)&&(this.selectDefaultTrack=!1),o.forEach((d,g)=>{d.id=g});else if(!r&&!this.tracksInGroup.length)return;this.tracksInGroup=o;const l=this.hls.config.audioPreference;if(!r&&l){const d=Le(l,o,$e);if(d>-1)r=o[d];else{const g=Le(l,this.tracks);r=this.tracks[g]}}let c=this.findTrackId(r);c===-1&&r&&(c=this.findTrackId(null));const h={audioTracks:o};this.log(`Updating audio tracks, ${o.length} track(s) found in group(s): ${s==null?void 0:s.join(",")}`),this.hls.trigger(p.AUDIO_TRACKS_UPDATED,h);const u=this.trackId;if(c!==-1&&u===-1)this.setAudioTrack(c);else if(o.length&&u===-1){var n;const d=new Error(`No audio track selected for current audio group-ID(s): ${(n=this.groupIds)==null?void 0:n.join(",")} track count: ${o.length}`);this.warn(d.message),this.hls.trigger(p.ERROR,{type:$.MEDIA_ERROR,details:L.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:d})}}else this.shouldReloadPlaylist(r)&&this.setAudioTrack(this.trackId)}onError(e,t){t.fatal||!t.context||t.context.type===Y.AUDIO_TRACK&&t.context.id===this.trackId&&(!this.groupIds||this.groupIds.indexOf(t.context.groupId)!==-1)&&(this.requestScheduled=-1,this.checkRetry(t))}get allAudioTracks(){return this.tracks}get audioTracks(){return this.tracksInGroup}get audioTrack(){return this.trackId}set audioTrack(e){this.selectDefaultTrack=!1,this.setAudioTrack(e)}setAudioOption(e){const t=this.hls;if(t.config.audioPreference=e,e){const s=this.allAudioTracks;if(this.selectDefaultTrack=!1,s.length){const i=this.currentTrack;if(i&&We(e,i,$e))return i;const r=Le(e,this.tracksInGroup,$e);if(r>-1){const n=this.tracksInGroup[r];return this.setAudioTrack(r),n}else if(i){let n=t.loadLevel;n===-1&&(n=t.firstAutoLevel);const o=Na(e,t.levels,s,n,$e);if(o===-1)return null;t.nextLoadLevel=o}if(e.channels||e.audioCodec){const n=Le(e,s);if(n>-1)return s[n]}}}return null}setAudioTrack(e){const t=this.tracksInGroup;if(e<0||e>=t.length){this.warn(`Invalid audio track id: ${e}`);return}this.clearTimer(),this.selectDefaultTrack=!1;const s=this.currentTrack,i=t[e],r=i.details&&!i.details.live;if(e===this.trackId&&i===s&&r||(this.log(`Switching to audio-track ${e} "${i.name}" lang:${i.lang} group:${i.groupId} channels:${i.channels}`),this.trackId=e,this.currentTrack=i,this.hls.trigger(p.AUDIO_TRACK_SWITCHING,oe({},i)),r))return;const n=this.switchParams(i.url,s==null?void 0:s.details,i.details);this.loadPlaylist(n)}findTrackId(e){const t=this.tracksInGroup;for(let s=0;s=r[c].start&&o<=r[c].end){n=r[c];break}const l=s.start+s.duration;n?n.end=l:(n={start:o,end:l},r.push(n)),this.fragmentTracker.fragBuffered(s),this.fragBufferedComplete(s,null)}onBufferFlushing(e,t){const{startOffset:s,endOffset:i}=t;if(s===0&&i!==Number.POSITIVE_INFINITY){const r=i-1;if(r<=0)return;t.endOffsetSubtitles=Math.max(0,r),this.tracksBuffered.forEach(n=>{for(let o=0;onew je(s));return}this.tracksBuffered=[],this.levels=t.map(s=>{const i=new je(s);return this.tracksBuffered[i.id]=[],i}),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,U.SUBTITLE),this.fragPrevious=null,this.mediaBuffer=null}onSubtitleTrackSwitch(e,t){var s;if(this.currentTrackId=t.id,!((s=this.levels)!=null&&s.length)||this.currentTrackId===-1){this.clearInterval();return}const i=this.levels[this.currentTrackId];i!=null&&i.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,i&&this.setInterval(Li)}onSubtitleTrackLoaded(e,t){var s;const{currentTrackId:i,levels:r}=this,{details:n,id:o}=t;if(!r){this.warn(`Subtitle tracks were reset while loading level ${o}`);return}const l=r[o];if(o>=r.length||!l)return;this.log(`Subtitle track ${o} loaded [${n.startSN},${n.endSN}]${n.lastPartSn?`[part-${n.lastPartSn}-${n.lastPartIndex}]`:""},duration:${n.totalduration}`),this.mediaBuffer=this.mediaBufferTimeRanges;let c=0;if(n.live||(s=l.details)!=null&&s.live){const u=this.mainDetails;if(n.deltaUpdateFailed||!u)return;const d=u.fragments[0];if(!l.details)n.hasProgramDateTime&&u.hasProgramDateTime?(_t(n,u),c=n.fragments[0].start):d&&(c=d.start,us(n,c));else{var h;c=this.alignPlaylists(n,l.details,(h=this.levelLastLoaded)==null?void 0:h.details),c===0&&d&&(c=d.start,us(n,c))}}l.details=n,this.levelLastLoaded=l,o===i&&(!this.startFragRequested&&(this.mainDetails||!n.live)&&this.setStartPosition(this.mainDetails||n,c),this.tick(),n.live&&!this.fragCurrent&&this.media&&this.state===C.IDLE&&(Ct(null,n.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),l.details=void 0)))}_handleFragmentLoadComplete(e){const{frag:t,payload:s}=e,i=t.decryptdata,r=this.hls;if(!this.fragContextChanged(t)&&s&&s.byteLength>0&&i!=null&&i.key&&i.iv&&i.method==="AES-128"){const n=performance.now();this.decrypter.decrypt(new Uint8Array(s),i.key.buffer,i.iv.buffer).catch(o=>{throw r.trigger(p.ERROR,{type:$.MEDIA_ERROR,details:L.FRAG_DECRYPT_ERROR,fatal:!1,error:o,reason:o.message,frag:t}),o}).then(o=>{const l=performance.now();r.trigger(p.FRAG_DECRYPTED,{frag:t,payload:o,stats:{tstart:n,tdecrypt:l}})}).catch(o=>{this.warn(`${o.name}: ${o.message}`),this.state=C.IDLE})}}doTick(){if(!this.media){this.state=C.IDLE;return}if(this.state===C.IDLE){const{currentTrackId:e,levels:t}=this,s=t==null?void 0:t[e];if(!s||!t.length||!s.details)return;const{config:i}=this,r=this.getLoadPosition(),n=J.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],r,i.maxBufferHole),{end:o,len:l}=n,c=this.getFwdBufferInfo(this.media,U.MAIN),h=s.details,u=this.getMaxBufferLength(c==null?void 0:c.len)+h.levelTargetDuration;if(l>u)return;const d=h.fragments,g=d.length,f=h.edge;let m=null;const T=this.fragPrevious;if(of-E?0:E;m=Ct(T,d,Math.max(d[0].start,o),x),!m&&T&&T.start{if(i=i>>>0,i>r-1)throw new DOMException(`Failed to execute '${s}' on 'TimeRanges': The index provided (${i}) is greater than the maximum bound (${r})`);return e[i][s]};this.buffered={get length(){return e.length},end(s){return t("end",s,e.length)},start(s){return t("start",s,e.length)}}}}class Go extends Rs{constructor(e){super(e,"[subtitle-track-controller]"),this.media=null,this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.queuedDefaultTrack=-1,this.asyncPollTrackChange=()=>this.pollTrackChange(0),this.useTextTrackPolling=!1,this.subtitlePollingInterval=-1,this._subtitleDisplay=!0,this.onTextTracksChanged=()=>{if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;let t=null;const s=gt(this.media.textTracks);for(let r=0;r-1&&this.toggleTrackModes()}registerListeners(){const{hls:e}=this;e.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_PARSED,this.onManifestParsed,this),e.on(p.LEVEL_LOADING,this.onLevelLoading,this),e.on(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(p.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(p.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_PARSED,this.onManifestParsed,this),e.off(p.LEVEL_LOADING,this.onLevelLoading,this),e.off(p.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(p.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(p.ERROR,this.onError,this)}onMediaAttached(e,t){this.media=t.media,this.media&&(this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange))}pollTrackChange(e){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.onTextTracksChanged,e)}onMediaDetaching(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),gt(this.media.textTracks).forEach(t=>{He(t)}),this.subtitleTrack=-1,this.media=null}onManifestLoading(){this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.subtitleTracks}onSubtitleTrackLoaded(e,t){const{id:s,groupId:i,details:r}=t,n=this.tracksInGroup[s];if(!n||n.groupId!==i){this.warn(`Subtitle track with id:${s} and group:${i} not found in active group ${n==null?void 0:n.groupId}`);return}const o=n.details;n.details=t.details,this.log(`Subtitle track ${s} "${n.name}" lang:${n.lang} group:${i} loaded [${r.startSN}-${r.endSN}]`),s===this.trackId&&this.playlistLoaded(s,t,o)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const s=t.subtitleGroups||null,i=this.groupIds;let r=this.currentTrack;if(!s||(i==null?void 0:i.length)!==(s==null?void 0:s.length)||s!=null&&s.some(n=>(i==null?void 0:i.indexOf(n))===-1)){this.groupIds=s,this.trackId=-1,this.currentTrack=null;const n=this.tracks.filter(h=>!s||s.indexOf(h.groupId)!==-1);if(n.length)this.selectDefaultTrack&&!n.some(h=>h.default)&&(this.selectDefaultTrack=!1),n.forEach((h,u)=>{h.id=u});else if(!r&&!this.tracksInGroup.length)return;this.tracksInGroup=n;const o=this.hls.config.subtitlePreference;if(!r&&o){this.selectDefaultTrack=!1;const h=Le(o,n);if(h>-1)r=n[h];else{const u=Le(o,this.tracks);r=this.tracks[u]}}let l=this.findTrackId(r);l===-1&&r&&(l=this.findTrackId(null));const c={subtitleTracks:n};this.log(`Updating subtitle tracks, ${n.length} track(s) found in "${s==null?void 0:s.join(",")}" group-id`),this.hls.trigger(p.SUBTITLE_TRACKS_UPDATED,c),l!==-1&&this.trackId===-1&&this.setSubtitleTrack(l)}else this.shouldReloadPlaylist(r)&&this.setSubtitleTrack(this.trackId)}findTrackId(e){const t=this.tracksInGroup,s=this.selectDefaultTrack;for(let i=0;i-1){const r=this.tracksInGroup[i];return this.setSubtitleTrack(i),r}else{if(s)return null;{const r=Le(e,t);if(r>-1)return t[r]}}}}return null}loadPlaylist(e){super.loadPlaylist();const t=this.currentTrack;if(this.shouldLoadPlaylist(t)&&t){const s=t.id,i=t.groupId;let r=t.url;if(e)try{r=e.addDirectives(r)}catch(n){this.warn(`Could not construct new URL with HLS Delivery Directives: ${n}`)}this.log(`Loading subtitle playlist for id ${s}`),this.hls.trigger(p.SUBTITLE_TRACK_LOADING,{url:r,id:s,groupId:i,deliveryDirectives:e||null})}}toggleTrackModes(){const{media:e}=this;if(!e)return;const t=gt(e.textTracks),s=this.currentTrack;let i;if(s&&(i=t.filter(r=>gs(s,r))[0],i||this.warn(`Unable to find subtitle TextTrack with name "${s.name}" and language "${s.lang}"`)),[].slice.call(t).forEach(r=>{r.mode!=="disabled"&&r!==i&&(r.mode="disabled")}),i){const r=this.subtitleDisplay?"showing":"hidden";i.mode!==r&&(i.mode=r)}}setSubtitleTrack(e){const t=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=e;return}if(e<-1||e>=t.length||!O(e)){this.warn(`Invalid subtitle track id: ${e}`);return}this.clearTimer(),this.selectDefaultTrack=!1;const s=this.currentTrack,i=t[e]||null;if(this.trackId=e,this.currentTrack=i,this.toggleTrackModes(),!i){this.hls.trigger(p.SUBTITLE_TRACK_SWITCH,{id:e});return}const r=!!i.details&&!i.details.live;if(e===this.trackId&&i===s&&r)return;this.log(`Switching to subtitle-track ${e}`+(i?` "${i.name}" lang:${i.lang} group:${i.groupId}`:""));const{id:n,groupId:o="",name:l,type:c,url:h}=i;this.hls.trigger(p.SUBTITLE_TRACK_SWITCH,{id:n,groupId:o,name:l,type:c,url:h});const u=this.switchParams(i.url,s==null?void 0:s.details,i.details);this.loadPlaylist(u)}}class Ko{constructor(e){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=e}append(e,t,s){const i=this.queues[t];i.push(e),i.length===1&&!s&&this.executeNext(t)}insertAbort(e,t){this.queues[t].unshift(e),this.executeNext(t)}appendBlocker(e){let t;const s=new Promise(r=>{t=r}),i={execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};return this.append(i,e),s}executeNext(e){const t=this.queues[e];if(t.length){const s=t[0];try{s.execute()}catch(i){v.warn(`[buffer-operation-queue]: Exception executing "${e}" SourceBuffer operation: ${i}`),s.onError(i);const r=this.buffers[e];r!=null&&r.updating||this.shiftAndExecuteNext(e)}}}shiftAndExecuteNext(e){this.queues[e].shift(),this.executeNext(e)}current(e){return this.queues[e][0]}}const Ri=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/;class Vo{constructor(e){this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.lastMpegAudioChunk=null,this.appendSource=void 0,this.appendErrors={audio:0,video:0,audiovideo:0},this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this.log=void 0,this.warn=void 0,this.error=void 0,this._onEndStreaming=s=>{this.hls&&this.hls.pauseBuffering()},this._onStartStreaming=s=>{this.hls&&this.hls.resumeBuffering()},this._onMediaSourceOpen=()=>{const{media:s,mediaSource:i}=this;this.log("Media source opened"),s&&(s.removeEventListener("emptied",this._onMediaEmptied),this.updateMediaElementDuration(),this.hls.trigger(p.MEDIA_ATTACHED,{media:s,mediaSource:i})),i&&i.removeEventListener("sourceopen",this._onMediaSourceOpen),this.checkPendingTracks()},this._onMediaSourceClose=()=>{this.log("Media source closed")},this._onMediaSourceEnded=()=>{this.log("Media source ended")},this._onMediaEmptied=()=>{const{mediaSrc:s,_objectUrl:i}=this;s!==i&&v.error(`Media element src was set while attaching MediaSource (${i} > ${s})`)},this.hls=e;const t="[buffer-controller]";this.appendSource=Qn(Ue(e.config.preferManagedMediaSource)),this.log=v.log.bind(v,t),this.warn=v.warn.bind(v,t),this.error=v.error.bind(v,t),this._initSourceBuffer(),this.registerListeners()}hasSourceTypes(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0}destroy(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=null,this.hls=null}registerListeners(){const{hls:e}=this;e.on(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_PARSED,this.onManifestParsed,this),e.on(p.BUFFER_RESET,this.onBufferReset,this),e.on(p.BUFFER_APPENDING,this.onBufferAppending,this),e.on(p.BUFFER_CODECS,this.onBufferCodecs,this),e.on(p.BUFFER_EOS,this.onBufferEos,this),e.on(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(p.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(p.FRAG_PARSED,this.onFragParsed,this),e.on(p.FRAG_CHANGED,this.onFragChanged,this)}unregisterListeners(){const{hls:e}=this;e.off(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_PARSED,this.onManifestParsed,this),e.off(p.BUFFER_RESET,this.onBufferReset,this),e.off(p.BUFFER_APPENDING,this.onBufferAppending,this),e.off(p.BUFFER_CODECS,this.onBufferCodecs,this),e.off(p.BUFFER_EOS,this.onBufferEos,this),e.off(p.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(p.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(p.FRAG_PARSED,this.onFragParsed,this),e.off(p.FRAG_CHANGED,this.onFragChanged,this)}_initSourceBuffer(){this.sourceBuffer={},this.operationQueue=new Ko(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]},this.appendErrors={audio:0,video:0,audiovideo:0},this.lastMpegAudioChunk=null}onManifestLoading(){this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=0,this.details=null}onManifestParsed(e,t){let s=2;(t.audio&&!t.video||!t.altAudio)&&(s=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=s,this.log(`${this.bufferCodecEventsExpected} bufferCodec event(s) expected`)}onMediaAttaching(e,t){const s=this.media=t.media,i=Ue(this.appendSource);if(s&&i){var r;const n=this.mediaSource=new i;this.log(`created media source: ${(r=n.constructor)==null?void 0:r.name}`),n.addEventListener("sourceopen",this._onMediaSourceOpen),n.addEventListener("sourceended",this._onMediaSourceEnded),n.addEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(n.addEventListener("startstreaming",this._onStartStreaming),n.addEventListener("endstreaming",this._onEndStreaming));const o=this._objectUrl=self.URL.createObjectURL(n);if(this.appendSource)try{s.removeAttribute("src");const l=self.ManagedMediaSource;s.disableRemotePlayback=s.disableRemotePlayback||l&&n instanceof l,Ii(s),Ho(s,o),s.load()}catch{s.src=o}else s.src=o;s.addEventListener("emptied",this._onMediaEmptied)}}onMediaDetaching(){const{media:e,mediaSource:t,_objectUrl:s}=this;if(t){if(this.log("media source detaching"),t.readyState==="open")try{t.endOfStream()}catch(i){this.warn(`onMediaDetaching: ${i.message} while calling endOfStream`)}this.onBufferReset(),t.removeEventListener("sourceopen",this._onMediaSourceOpen),t.removeEventListener("sourceended",this._onMediaSourceEnded),t.removeEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(t.removeEventListener("startstreaming",this._onStartStreaming),t.removeEventListener("endstreaming",this._onEndStreaming)),e&&(e.removeEventListener("emptied",this._onMediaEmptied),s&&self.URL.revokeObjectURL(s),this.mediaSrc===s?(e.removeAttribute("src"),this.appendSource&&Ii(e),e.load()):this.warn("media|source.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(p.MEDIA_DETACHED,void 0)}onBufferReset(){this.getSourceBufferTypes().forEach(e=>{this.resetBuffer(e)}),this._initSourceBuffer()}resetBuffer(e){const t=this.sourceBuffer[e];try{if(t){var s;this.removeBufferListeners(e),this.sourceBuffer[e]=void 0,(s=this.mediaSource)!=null&&s.sourceBuffers.length&&this.mediaSource.removeSourceBuffer(t)}}catch(i){this.warn(`onBufferReset ${e}`,i)}}onBufferCodecs(e,t){const s=this.getSourceBufferTypes().length,i=Object.keys(t);if(i.forEach(n=>{if(s){const l=this.tracks[n];if(l&&typeof l.buffer.changeType=="function"){var o;const{id:c,codec:h,levelCodec:u,container:d,metadata:g}=t[n],f=qs(l.codec,l.levelCodec),m=f==null?void 0:f.replace(Ri,"$1");let T=qs(h,u);const E=(o=T)==null?void 0:o.replace(Ri,"$1");if(T&&m!==E){n.slice(0,5)==="audio"&&(T=Rt(T,this.appendSource));const x=`${d};codecs=${T}`;this.appendChangeType(n,x),this.log(`switching codec ${f} to ${T}`),this.tracks[n]={buffer:l.buffer,codec:h,container:d,levelCodec:u,metadata:g,id:c}}}}else this.pendingTracks[n]=t[n]}),s)return;const r=Math.max(this.bufferCodecEventsExpected-1,0);this.bufferCodecEventsExpected!==r&&(this.log(`${r} bufferCodec event(s) expected ${i.join(",")}`),this.bufferCodecEventsExpected=r),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()}appendChangeType(e,t){const{operationQueue:s}=this,i={execute:()=>{const r=this.sourceBuffer[e];r&&(this.log(`changing ${e} sourceBuffer type to ${t}`),r.changeType(t)),s.shiftAndExecuteNext(e)},onStart:()=>{},onComplete:()=>{},onError:r=>{this.warn(`Failed to change ${e} SourceBuffer type`,r)}};s.append(i,e,!!this.pendingTracks[e])}onBufferAppending(e,t){const{hls:s,operationQueue:i,tracks:r}=this,{data:n,type:o,frag:l,part:c,chunkMeta:h}=t,u=h.buffering[o],d=self.performance.now();u.start=d;const g=l.stats.buffering,f=c?c.stats.buffering:null;g.start===0&&(g.start=d),f&&f.start===0&&(f.start=d);const m=r.audio;let T=!1;o==="audio"&&(m==null?void 0:m.container)==="audio/mpeg"&&(T=!this.lastMpegAudioChunk||h.id===1||this.lastMpegAudioChunk.sn!==h.sn,this.lastMpegAudioChunk=h);const E=l.start,x={execute:()=>{if(u.executeStart=self.performance.now(),T){const y=this.sourceBuffer[o];if(y){const I=E-y.timestampOffset;Math.abs(I)>=.1&&(this.log(`Updating audio SourceBuffer timestampOffset to ${E} (delta: ${I}) sn: ${l.sn})`),y.timestampOffset=E)}}this.appendExecutor(n,o)},onStart:()=>{},onComplete:()=>{const y=self.performance.now();u.executeEnd=u.end=y,g.first===0&&(g.first=y),f&&f.first===0&&(f.first=y);const{sourceBuffer:I}=this,S={};for(const D in I)S[D]=J.getBuffered(I[D]);this.appendErrors[o]=0,o==="audio"||o==="video"?this.appendErrors.audiovideo=0:(this.appendErrors.audio=0,this.appendErrors.video=0),this.hls.trigger(p.BUFFER_APPENDED,{type:o,frag:l,part:c,chunkMeta:h,parent:l.type,timeRanges:S})},onError:y=>{const I={type:$.MEDIA_ERROR,parent:l.type,details:L.BUFFER_APPEND_ERROR,sourceBufferName:o,frag:l,part:c,chunkMeta:h,error:y,err:y,fatal:!1};if(y.code===DOMException.QUOTA_EXCEEDED_ERR)I.details=L.BUFFER_FULL_ERROR;else{const S=++this.appendErrors[o];I.details=L.BUFFER_APPEND_ERROR,this.warn(`Failed ${S}/${s.config.appendErrorMaxRetry} times to append segment in "${o}" sourceBuffer`),S>=s.config.appendErrorMaxRetry&&(I.fatal=!0)}s.trigger(p.ERROR,I)}};i.append(x,o,!!this.pendingTracks[o])}onBufferFlushing(e,t){const{operationQueue:s}=this,i=r=>({execute:this.removeExecutor.bind(this,r,t.startOffset,t.endOffset),onStart:()=>{},onComplete:()=>{this.hls.trigger(p.BUFFER_FLUSHED,{type:r})},onError:n=>{this.warn(`Failed to remove from ${r} SourceBuffer`,n)}});t.type?s.append(i(t.type),t.type):this.getSourceBufferTypes().forEach(r=>{s.append(i(r),r)})}onFragParsed(e,t){const{frag:s,part:i}=t,r=[],n=i?i.elementaryStreams:s.elementaryStreams;n[X.AUDIOVIDEO]?r.push("audiovideo"):(n[X.AUDIO]&&r.push("audio"),n[X.VIDEO]&&r.push("video"));const o=()=>{const l=self.performance.now();s.stats.buffering.end=l,i&&(i.stats.buffering.end=l);const c=i?i.stats:s.stats;this.hls.trigger(p.FRAG_BUFFERED,{frag:s,part:i,stats:c,id:s.type})};r.length===0&&this.warn(`Fragments must have at least one ElementaryStreamType set. type: ${s.type} level: ${s.level} sn: ${s.sn}`),this.blockBuffers(o,r)}onFragChanged(e,t){this.trimBuffers()}onBufferEos(e,t){this.getSourceBufferTypes().reduce((i,r)=>{const n=this.sourceBuffer[r];return n&&(!t.type||t.type===r)&&(n.ending=!0,n.ended||(n.ended=!0,this.log(`${r} sourceBuffer now EOS`))),i&&!!(!n||n.ended)},!0)&&(this.log("Queueing mediaSource.endOfStream()"),this.blockBuffers(()=>{this.getSourceBufferTypes().forEach(r=>{const n=this.sourceBuffer[r];n&&(n.ending=!1)});const{mediaSource:i}=this;if(!i||i.readyState!=="open"){i&&this.log(`Could not call mediaSource.endOfStream(). mediaSource.readyState: ${i.readyState}`);return}this.log("Calling mediaSource.endOfStream()"),i.endOfStream()}))}onLevelUpdated(e,{details:t}){t.fragments.length&&(this.details=t,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration())}trimBuffers(){const{hls:e,details:t,media:s}=this;if(!s||t===null||!this.getSourceBufferTypes().length)return;const r=e.config,n=s.currentTime,o=t.levelTargetDuration,l=t.live&&r.liveBackBufferLength!==null?r.liveBackBufferLength:r.backBufferLength;if(O(l)&&l>0){const c=Math.max(l,o),h=Math.floor(n/o)*o-c;this.flushBackBuffer(n,o,h)}if(O(r.frontBufferFlushThreshold)&&r.frontBufferFlushThreshold>0){const c=Math.max(r.maxBufferLength,r.frontBufferFlushThreshold),h=Math.max(c,o),u=Math.floor(n/o)*o+h;this.flushFrontBuffer(n,o,u)}}flushBackBuffer(e,t,s){const{details:i,sourceBuffer:r}=this;this.getSourceBufferTypes().forEach(o=>{const l=r[o];if(l){const c=J.getBuffered(l);if(c.length>0&&s>c.start(0)){if(this.hls.trigger(p.BACK_BUFFER_REACHED,{bufferEnd:s}),i!=null&&i.live)this.hls.trigger(p.LIVE_BACK_BUFFER_REACHED,{bufferEnd:s});else if(l.ended&&c.end(c.length-1)-e{const o=i[n];if(o){const l=J.getBuffered(o),c=l.length;if(c<2)return;const h=l.start(c-1),u=l.end(c-1);if(s>h||e>=h&&e<=u)return;if(o.ended&&e-u<2*t){this.log(`Cannot flush ${n} front buffer while SourceBuffer is in ended state`);return}this.hls.trigger(p.BUFFER_FLUSHING,{startOffset:h,endOffset:1/0,type:n})}})}updateMediaElementDuration(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;const{details:e,hls:t,media:s,mediaSource:i}=this,r=e.fragments[0].start+e.totalduration,n=s.duration,o=O(i.duration)?i.duration:0;e.live&&t.config.liveDurationInfinity?(i.duration=1/0,this.updateSeekableRange(e)):(r>o&&r>n||!O(n))&&(this.log(`Updating Media Source duration to ${r.toFixed(3)}`),i.duration=r)}updateSeekableRange(e){const t=this.mediaSource,s=e.fragments;if(s.length&&e.live&&t!=null&&t.setLiveSeekableRange){const r=Math.max(0,s[0].start),n=Math.max(r,r+e.totalduration);this.log(`Media Source duration is set to ${t.duration}. Setting seekable range to ${r}-${n}.`),t.setLiveSeekableRange(r,n)}}checkPendingTracks(){const{bufferCodecEventsExpected:e,operationQueue:t,pendingTracks:s}=this,i=Object.keys(s).length;if(i&&(!e||i===2||"audiovideo"in s)){this.createSourceBuffers(s),this.pendingTracks={};const r=this.getSourceBufferTypes();if(r.length)this.hls.trigger(p.BUFFER_CREATED,{tracks:this.tracks}),r.forEach(n=>{t.executeNext(n)});else{const n=new Error("could not create source buffer for media codec(s)");this.hls.trigger(p.ERROR,{type:$.MEDIA_ERROR,details:L.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:n,reason:n.message})}}}createSourceBuffers(e){const{sourceBuffer:t,mediaSource:s}=this;if(!s)throw Error("createSourceBuffers called when mediaSource was null");for(const r in e)if(!t[r]){var i;const n=e[r];if(!n)throw Error(`source buffer exists for track ${r}, however track does not`);let o=((i=n.levelCodec)==null?void 0:i.indexOf(","))===-1?n.levelCodec:n.codec;o&&r.slice(0,5)==="audio"&&(o=Rt(o,this.appendSource));const l=`${n.container};codecs=${o}`;this.log(`creating sourceBuffer(${l})`);try{const c=t[r]=s.addSourceBuffer(l),h=r;this.addBufferListener(h,"updatestart",this._onSBUpdateStart),this.addBufferListener(h,"updateend",this._onSBUpdateEnd),this.addBufferListener(h,"error",this._onSBUpdateError),this.appendSource&&this.addBufferListener(h,"bufferedchange",(u,d)=>{const g=d.removedRanges;g!=null&&g.length&&this.hls.trigger(p.BUFFER_FLUSHED,{type:r})}),this.tracks[r]={buffer:c,codec:o,container:n.container,levelCodec:n.levelCodec,metadata:n.metadata,id:n.id}}catch(c){this.error(`error while trying to add sourceBuffer: ${c.message}`),this.hls.trigger(p.ERROR,{type:$.MEDIA_ERROR,details:L.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:c,sourceBufferName:r,mimeType:l})}}}get mediaSrc(){var e,t;const s=((e=this.media)==null||(t=e.querySelector)==null?void 0:t.call(e,"source"))||this.media;return s==null?void 0:s.src}_onSBUpdateStart(e){const{operationQueue:t}=this;t.current(e).onStart()}_onSBUpdateEnd(e){var t;if(((t=this.mediaSource)==null?void 0:t.readyState)==="closed"){this.resetBuffer(e);return}const{operationQueue:s}=this;s.current(e).onComplete(),s.shiftAndExecuteNext(e)}_onSBUpdateError(e,t){var s;const i=new Error(`${e} SourceBuffer error. MediaSource readyState: ${(s=this.mediaSource)==null?void 0:s.readyState}`);this.error(`${i}`,t),this.hls.trigger(p.ERROR,{type:$.MEDIA_ERROR,details:L.BUFFER_APPENDING_ERROR,sourceBufferName:e,error:i,fatal:!1});const r=this.operationQueue.current(e);r&&r.onError(i)}removeExecutor(e,t,s){const{media:i,mediaSource:r,operationQueue:n,sourceBuffer:o}=this,l=o[e];if(!i||!r||!l){this.warn(`Attempting to remove from the ${e} SourceBuffer, but it does not exist`),n.shiftAndExecuteNext(e);return}const c=O(i.duration)?i.duration:1/0,h=O(r.duration)?r.duration:1/0,u=Math.max(0,t),d=Math.min(s,c,h);d>u&&(!l.ending||l.ended)?(l.ended=!1,this.log(`Removing [${u},${d}] from the ${e} SourceBuffer`),l.remove(u,d)):n.shiftAndExecuteNext(e)}appendExecutor(e,t){const s=this.sourceBuffer[t];if(!s){if(!this.pendingTracks[t])throw new Error(`Attempting to append to the ${t} SourceBuffer, but it does not exist`);return}s.ended=!1,s.appendBuffer(e)}blockBuffers(e,t=this.getSourceBufferTypes()){if(!t.length){this.log("Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(e);return}const{operationQueue:s}=this,i=t.map(r=>s.appendBlocker(r));Promise.all(i).then(()=>{e(),t.forEach(r=>{const n=this.sourceBuffer[r];n!=null&&n.updating||s.shiftAndExecuteNext(r)})})}getSourceBufferTypes(){return Object.keys(this.sourceBuffer)}addBufferListener(e,t,s){const i=this.sourceBuffer[e];if(!i)return;const r=s.bind(this,e);this.listeners[e].push({event:t,listener:r}),i.addEventListener(t,r)}removeBufferListeners(e){const t=this.sourceBuffer[e];t&&this.listeners[e].forEach(s=>{t.removeEventListener(s.event,s.listener)})}}function Ii(a){const e=a.querySelectorAll("source");[].slice.call(e).forEach(t=>{a.removeChild(t)})}function Ho(a,e){const t=self.document.createElement("source");t.type="video/mp4",t.src=e,a.appendChild(t)}const Wo={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},_r=a=>String.fromCharCode(Wo[a]||a),Ee=15,De=100,Yo={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},qo={17:2,18:4,21:6,22:8,23:10,19:13,20:15},jo={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},zo={25:2,26:4,29:6,30:8,31:10,27:13,28:15},Xo=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class Qo{constructor(){this.time=null,this.verboseLevel=0}log(e,t){if(this.verboseLevel>=e){const s=typeof t=="function"?t():t;v.log(`${this.time} [${e}] ${s}`)}}}const Fe=function(e){const t=[];for(let s=0;sDe&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=De)}moveCursor(e){const t=this.pos+e;if(e>1)for(let s=this.pos+1;s=144&&this.backSpace();const t=_r(e);if(this.pos>=De){this.logger.log(0,()=>"Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1)}clearFromPos(e){let t;for(t=e;t"pacData = "+JSON.stringify(e));let t=e.row-1;if(this.nrRollUpRows&&t"bkgData = "+JSON.stringify(e)),this.backSpace(),this.setPen(e),this.insertChar(32)}setRollUpRows(e){this.nrRollUpRows=e}rollUp(){if(this.nrRollUpRows===null){this.logger.log(3,"roll_up but nrRollUpRows not set yet");return}this.logger.log(1,()=>this.getDisplayText());const e=this.currRow+1-this.nrRollUpRows,t=this.rows.splice(e,1)[0];t.clear(),this.rows.splice(this.currRow,0,t),this.logger.log(2,"Rolling up")}getDisplayText(e){e=e||!1;const t=[];let s="",i=-1;for(let r=0;r0&&(e?s="["+t.join(" | ")+"]":s=t.join(` +`)),s}getTextAndFormat(){return this.rows}}class bi{constructor(e,t,s){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=e,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new Qt(s),this.nonDisplayedMemory=new Qt(s),this.lastOutputScreen=new Qt(s),this.currRollUpRow=this.displayedMemory.rows[Ee-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=s}reset(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[Ee-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}getHandler(){return this.outputFilter}setHandler(e){this.outputFilter=e}setPAC(e){this.writeScreen.setPAC(e)}setBkgData(e){this.writeScreen.setBkgData(e)}setMode(e){e!==this.mode&&(this.mode=e,this.logger.log(2,()=>"MODE="+e),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)}insertChars(e){for(let s=0;st+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(1,()=>"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())}ccRCL(){this.logger.log(2,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")}ccBS(){this.logger.log(2,"BS - BackSpace"),this.mode!=="MODE_TEXT"&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())}ccAOF(){}ccAON(){}ccDER(){this.logger.log(2,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()}ccRU(e){this.logger.log(2,"RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)}ccFON(){this.logger.log(2,"FON - Flash On"),this.writeScreen.setPen({flash:!0})}ccRDC(){this.logger.log(2,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")}ccTR(){this.logger.log(2,"TR"),this.setMode("MODE_TEXT")}ccRTD(){this.logger.log(2,"RTD"),this.setMode("MODE_TEXT")}ccEDM(){this.logger.log(2,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)}ccCR(){this.logger.log(2,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)}ccENM(){this.logger.log(2,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()}ccEOC(){if(this.logger.log(2,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){const e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,this.logger.log(1,()=>"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)}ccTO(e){this.logger.log(2,"TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)}ccMIDROW(e){const t={flash:!1};if(t.underline=e%2===1,t.italics=e>=46,t.italics)t.foreground="white";else{const s=Math.floor(e/2)-16,i=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=i[s]}this.logger.log(2,"MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)}outputDataUpdate(e=!1){const t=this.logger.time;t!==null&&this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=t:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,t,this.lastOutputScreen),e&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:t),this.lastOutputScreen.copy(this.displayedMemory))}cueSplitAtTime(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}}class Di{constructor(e,t,s){this.channels=void 0,this.currentChannel=0,this.cmdHistory=tl(),this.logger=void 0;const i=this.logger=new Qo;this.channels=[null,new bi(e,t,i),new bi(e+1,s,i)]}getHandler(e){return this.channels[e].getHandler()}setHandler(e,t){this.channels[e].setHandler(t)}addData(e,t){this.logger.time=e;for(let s=0;s"["+Fe([t[s],t[s+1]])+"] -> ("+Fe([i,r])+")");const l=this.cmdHistory;if(i>=16&&i<=31){if(el(i,r,l)){ct(null,null,l),this.logger.log(3,()=>"Repeated command ("+Fe([i,r])+") is dropped");continue}ct(i,r,this.cmdHistory),n=this.parseCmd(i,r),n||(n=this.parseMidrow(i,r)),n||(n=this.parsePAC(i,r)),n||(n=this.parseBackgroundAttributes(i,r))}else ct(null,null,l);if(!n&&(o=this.parseChars(i,r),o)){const h=this.currentChannel;h&&h>0?this.channels[h].insertChars(o):this.logger.log(2,"No channel found yet. TEXT-MODE?")}!n&&!o&&this.logger.log(2,()=>"Couldn't parse cleaned data "+Fe([i,r])+" orig: "+Fe([t[s],t[s+1]]))}}parseCmd(e,t){const s=(e===20||e===28||e===21||e===29)&&t>=32&&t<=47,i=(e===23||e===31)&&t>=33&&t<=35;if(!(s||i))return!1;const r=e===20||e===21||e===23?1:2,n=this.channels[r];return e===20||e===21||e===28||e===29?t===32?n.ccRCL():t===33?n.ccBS():t===34?n.ccAOF():t===35?n.ccAON():t===36?n.ccDER():t===37?n.ccRU(2):t===38?n.ccRU(3):t===39?n.ccRU(4):t===40?n.ccFON():t===41?n.ccRDC():t===42?n.ccTR():t===43?n.ccRTD():t===44?n.ccEDM():t===45?n.ccCR():t===46?n.ccENM():t===47&&n.ccEOC():n.ccTO(t-32),this.currentChannel=r,!0}parseMidrow(e,t){let s=0;if((e===17||e===25)&&t>=32&&t<=47){if(e===17?s=1:s=2,s!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;const i=this.channels[s];return i?(i.ccMIDROW(t),this.logger.log(3,()=>"MIDROW ("+Fe([e,t])+")"),!0):!1}return!1}parsePAC(e,t){let s;const i=(e>=17&&e<=23||e>=25&&e<=31)&&t>=64&&t<=127,r=(e===16||e===24)&&t>=64&&t<=95;if(!(i||r))return!1;const n=e<=23?1:2;t>=64&&t<=95?s=n===1?Yo[e]:jo[e]:s=n===1?qo[e]:zo[e];const o=this.channels[n];return o?(o.setPAC(this.interpretPAC(s,t)),this.currentChannel=n,!0):!1}interpretPAC(e,t){let s;const i={color:null,italics:!1,indent:null,underline:!1,row:e};return t>95?s=t-96:s=t-64,i.underline=(s&1)===1,s<=13?i.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(s/2)]:s<=15?(i.italics=!0,i.color="white"):i.indent=Math.floor((s-16)/2)*4,i}parseChars(e,t){let s,i=null,r=null;if(e>=25?(s=2,r=e-8):(s=1,r=e),r>=17&&r<=19){let n;r===17?n=t+80:r===18?n=t+112:n=t+144,this.logger.log(2,()=>"Special char '"+_r(n)+"' in channel "+s),i=[n]}else e>=32&&e<=127&&(i=t===0?[e]:[e,t]);return i&&this.logger.log(3,()=>"Char codes = "+Fe(i).join(",")),i}parseBackgroundAttributes(e,t){const s=(e===16||e===24)&&t>=32&&t<=47,i=(e===23||e===31)&&t>=45&&t<=47;if(!(s||i))return!1;let r;const n={};e===16||e===24?(r=Math.floor((t-32)/2),n.background=Xo[r],t%2===1&&(n.background=n.background+"_semi")):t===45?n.background="transparent":(n.foreground="black",t===47&&(n.underline=!0));const o=e<=23?1:2;return this.channels[o].setBkgData(n),!0}reset(){for(let e=0;ee)&&(this.startTime=e),this.endTime=t,this.screen=s,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}}var Fs=function(){if(qe!=null&&qe.VTTCue)return self.VTTCue;const a=["","lr","rl"],e=["start","middle","end","left","right"];function t(o,l){if(typeof l!="string"||!Array.isArray(o))return!1;const c=l.toLowerCase();return~o.indexOf(c)?c:!1}function s(o){return t(a,o)}function i(o){return t(e,o)}function r(o,...l){let c=1;for(;c100)throw new Error("Position must be between 0 and 100.");D=b,this.hasBeenReset=!0}})),Object.defineProperty(h,"positionAlign",r({},u,{get:function(){return R},set:function(b){const w=i(b);if(!w)throw new SyntaxError("An invalid or illegal string was specified.");R=w,this.hasBeenReset=!0}})),Object.defineProperty(h,"size",r({},u,{get:function(){return _},set:function(b){if(b<0||b>100)throw new Error("Size must be between 0 and 100.");_=b,this.hasBeenReset=!0}})),Object.defineProperty(h,"align",r({},u,{get:function(){return k},set:function(b){const w=i(b);if(!w)throw new SyntaxError("An invalid or illegal string was specified.");k=w,this.hasBeenReset=!0}})),h.displayState=void 0}return n.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},n}();class sl{decode(e,t){if(!e)return"";if(typeof e!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}function kr(a){function e(s,i,r,n){return(s|0)*3600+(i|0)*60+(r|0)+parseFloat(n||0)}const t=a.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return t?parseFloat(t[2])>59?e(t[2],t[3],0,t[4]):e(t[1],t[2],t[3],t[4]):null}class il{constructor(){this.values=Object.create(null)}set(e,t){!this.get(e)&&t!==""&&(this.values[e]=t)}get(e,t,s){return s?this.has(e)?this.values[e]:t[s]:this.has(e)?this.values[e]:t}has(e){return e in this.values}alt(e,t,s){for(let i=0;i=0&&s<=100)return this.set(e,s),!0}return!1}}function Pr(a,e,t,s){const i=s?a.split(s):[a];for(const r in i){if(typeof i[r]!="string")continue;const n=i[r].split(t);if(n.length!==2)continue;const o=n[0],l=n[1];e(o,l)}}const ms=new Fs(0,0,""),ut=ms.align==="middle"?"middle":"center";function rl(a,e,t){const s=a;function i(){const o=kr(a);if(o===null)throw new Error("Malformed timestamp: "+s);return a=a.replace(/^[^\sa-zA-Z-]+/,""),o}function r(o,l){const c=new il;Pr(o,function(d,g){let f;switch(d){case"region":for(let m=t.length-1;m>=0;m--)if(t[m].id===g){c.set(d,t[m].region);break}break;case"vertical":c.alt(d,g,["rl","lr"]);break;case"line":f=g.split(","),c.integer(d,f[0]),c.percent(d,f[0])&&c.set("snapToLines",!1),c.alt(d,f[0],["auto"]),f.length===2&&c.alt("lineAlign",f[1],["start",ut,"end"]);break;case"position":f=g.split(","),c.percent(d,f[0]),f.length===2&&c.alt("positionAlign",f[1],["start",ut,"end","line-left","line-right","auto"]);break;case"size":c.percent(d,g);break;case"align":c.alt(d,g,["start",ut,"end","left","right"]);break}},/:/,/\s/),l.region=c.get("region",null),l.vertical=c.get("vertical","");let h=c.get("line","auto");h==="auto"&&ms.line===-1&&(h=-1),l.line=h,l.lineAlign=c.get("lineAlign","start"),l.snapToLines=c.get("snapToLines",!0),l.size=c.get("size",100),l.align=c.get("align",ut);let u=c.get("position","auto");u==="auto"&&ms.position===50&&(u=l.align==="start"||l.align==="left"?0:l.align==="end"||l.align==="right"?100:50),l.position=u}function n(){a=a.replace(/^\s+/,"")}if(n(),e.startTime=i(),n(),a.slice(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+s);a=a.slice(3),n(),e.endTime=i(),n(),r(a,e)}function Fr(a){return a.replace(//gi,` +`)}class nl{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new sl,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}parse(e){const t=this;e&&(t.buffer+=t.decoder.decode(e,{stream:!0}));function s(){let r=t.buffer,n=0;for(r=Fr(r);n")===-1){t.cue.id=r;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{rl(r,t.cue,t.regionList)}catch{t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":{const o=r.indexOf("-->")!==-1;if(!r||o&&(n=!0)){t.oncue&&t.cue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}if(t.cue===null)continue;t.cue.text&&(t.cue.text+=` +`),t.cue.text+=r}continue;case"BADCUE":r||(t.state="ID")}}}catch{t.state==="CUETEXT"&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state=t.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this}flush(){const e=this;try{if((e.cue||e.state==="HEADER")&&(e.buffer+=` + +`,e.parse()),e.state==="INITIAL"||e.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(t){e.onparsingerror&&e.onparsingerror(t)}return e.onflush&&e.onflush(),this}}const al=/\r\n|\n\r|\n|\r/g,Jt=function(e,t,s=0){return e.slice(s,s+t.length)===t},ol=function(e){let t=parseInt(e.slice(-3));const s=parseInt(e.slice(-6,-4)),i=parseInt(e.slice(-9,-7)),r=e.length>9?parseInt(e.substring(0,e.indexOf(":"))):0;if(!O(t)||!O(s)||!O(i)||!O(r))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${e}`);return t+=1e3*s,t+=60*1e3*i,t+=60*60*1e3*r,t},Zt=function(e){let t=5381,s=e.length;for(;s;)t=t*33^e.charCodeAt(--s);return(t>>>0).toString()};function Os(a,e,t){return Zt(a.toString())+Zt(e.toString())+Zt(t)}const ll=function(e,t,s){let i=e[t],r=e[i.prevCC];if(!r||!r.new&&i.new){e.ccOffset=e.presentationOffset=i.start,i.new=!1;return}for(;(n=r)!=null&&n.new;){var n;e.ccOffset+=i.start-r.start,i.new=!1,i=r,r=e[i.prevCC]}e.presentationOffset=s};function cl(a,e,t,s,i,r,n){const o=new nl,l=Re(new Uint8Array(a)).trim().replace(al,` +`).split(` +`),c=[],h=e?Io(e.baseTime,e.timescale):0;let u="00:00.000",d=0,g=0,f,m=!0;o.oncue=function(T){const E=t[s];let x=t.ccOffset;const y=(d-h)/9e4;if(E!=null&&E.new&&(g!==void 0?x=t.ccOffset=E.start:ll(t,s,y)),y){if(!e){f=new Error("Missing initPTS for VTT MPEGTS");return}x=y-t.presentationOffset}const I=T.endTime-T.startTime,S=me((T.startTime+x-g)*9e4,i*9e4)/9e4;T.startTime=Math.max(S,0),T.endTime=Math.max(S+I,0);const D=T.text.trim();T.text=decodeURIComponent(encodeURIComponent(D)),T.id||(T.id=Os(T.startTime,T.endTime,D)),T.endTime>0&&c.push(T)},o.onparsingerror=function(T){f=T},o.onflush=function(){if(f){n(f);return}r(c)},l.forEach(T=>{if(m)if(Jt(T,"X-TIMESTAMP-MAP=")){m=!1,T.slice(16).split(",").forEach(E=>{Jt(E,"LOCAL:")?u=E.slice(6):Jt(E,"MPEGTS:")&&(d=parseInt(E.slice(7)))});try{g=ol(u)/1e3}catch(E){f=E}return}else T===""&&(m=!1);o.parse(T+` +`)}),o.flush()}const es="stpp.ttml.im1t",Or=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,Mr=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,hl={left:"start",center:"center",right:"end",start:"start",end:"end"};function Ci(a,e,t,s){const i=H(new Uint8Array(a),["mdat"]);if(i.length===0){s(new Error("Could not parse IMSC1 mdat"));return}const r=i.map(o=>Re(o)),n=Ro(e.baseTime,1,e.timescale);try{r.forEach(o=>t(ul(o,n)))}catch(o){s(o)}}function ul(a,e){const i=new DOMParser().parseFromString(a,"text/xml").getElementsByTagName("tt")[0];if(!i)throw new Error("Invalid ttml");const r={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},n=Object.keys(r).reduce((u,d)=>(u[d]=i.getAttribute(`ttp:${d}`)||r[d],u),{}),o=i.getAttribute("xml:space")!=="preserve",l=_i(ts(i,"styling","style")),c=_i(ts(i,"layout","region")),h=ts(i,"body","[begin]");return[].map.call(h,u=>{const d=Nr(u,o);if(!d||!u.hasAttribute("begin"))return null;const g=is(u.getAttribute("begin"),n),f=is(u.getAttribute("dur"),n);let m=is(u.getAttribute("end"),n);if(g===null)throw wi(u);if(m===null){if(f===null)throw wi(u);m=g+f}const T=new Fs(g-e,m-e,d);T.id=Os(T.startTime,T.endTime,T.text);const E=c[u.getAttribute("region")],x=l[u.getAttribute("style")],y=dl(E,x,l),{textAlign:I}=y;if(I){const S=hl[I];S&&(T.lineAlign=S),T.align=I}return se(T,y),T}).filter(u=>u!==null)}function ts(a,e,t){const s=a.getElementsByTagName(e)[0];return s?[].slice.call(s.querySelectorAll(t)):[]}function _i(a){return a.reduce((e,t)=>{const s=t.getAttribute("xml:id");return s&&(e[s]=t),e},{})}function Nr(a,e){return[].slice.call(a.childNodes).reduce((t,s,i)=>{var r;return s.nodeName==="br"&&i?t+` +`:(r=s.childNodes)!=null&&r.length?Nr(s,e):e?t+s.textContent.trim().replace(/\s+/g," "):t+s.textContent},"")}function dl(a,e,t){const s="http://www.w3.org/ns/ttml#styling";let i=null;const r=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],n=a!=null&&a.hasAttribute("style")?a.getAttribute("style"):null;return n&&t.hasOwnProperty(n)&&(i=t[n]),r.reduce((o,l)=>{const c=ss(e,s,l)||ss(a,s,l)||ss(i,s,l);return c&&(o[l]=c),o},{})}function ss(a,e,t){return a&&a.hasAttributeNS(e,t)?a.getAttributeNS(e,t):null}function wi(a){return new Error(`Could not parse ttml timestamp ${a}`)}function is(a,e){if(!a)return null;let t=kr(a);return t===null&&(Or.test(a)?t=fl(a,e):Mr.test(a)&&(t=gl(a,e))),t}function fl(a,e){const t=Or.exec(a),s=(t[4]|0)+(t[5]|0)/e.subFrameRate;return(t[1]|0)*3600+(t[2]|0)*60+(t[3]|0)+s/e.frameRate}function gl(a,e){const t=Mr.exec(a),s=Number(t[1]);switch(t[2]){case"h":return s*3600;case"m":return s*60;case"ms":return s*1e3;case"f":return s/e.frameRate;case"t":return s/e.tickRate}return s}class ml{constructor(e){this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=Pi(),this.captionsProperties=void 0,this.hls=e,this.config=e.config,this.Cues=e.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},e.on(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(p.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(p.FRAG_LOADING,this.onFragLoading,this),e.on(p.FRAG_LOADED,this.onFragLoaded,this),e.on(p.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(p.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(p.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(p.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(p.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:e}=this;e.off(p.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(p.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(p.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(p.FRAG_LOADING,this.onFragLoading,this),e.off(p.FRAG_LOADED,this.onFragLoaded,this),e.off(p.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(p.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(p.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(p.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(p.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=null,this.cea608Parser1=this.cea608Parser2=void 0}initCea608Parsers(){if(this.config.enableCEA708Captions&&(!this.cea608Parser1||!this.cea608Parser2)){const e=new ht(this,"textTrack1"),t=new ht(this,"textTrack2"),s=new ht(this,"textTrack3"),i=new ht(this,"textTrack4");this.cea608Parser1=new Di(1,e,t),this.cea608Parser2=new Di(3,s,i)}}addCues(e,t,s,i,r){let n=!1;for(let o=r.length;o--;){const l=r[o],c=pl(l[0],l[1],t,s);if(c>=0&&(l[0]=Math.min(l[0],t),l[1]=Math.max(l[1],s),n=!0,c/(s-t)>.5))return}if(n||r.push([t,s]),this.config.renderTextTracksNatively){const o=this.captionsTracks[e];this.Cues.newCue(o,t,s,i)}else{const o=this.Cues.newCue(null,t,s,i);this.hls.trigger(p.CUES_PARSED,{type:"captions",cues:o,track:e})}}onInitPtsFound(e,{frag:t,id:s,initPTS:i,timescale:r}){const{unparsedVttFrags:n}=this;s==="main"&&(this.initPTS[t.cc]={baseTime:i,timescale:r}),n.length&&(this.unparsedVttFrags=[],n.forEach(o=>{this.onFragLoaded(p.FRAG_LOADED,o)}))}getExistingTrack(e,t){const{media:s}=this;if(s)for(let i=0;i{He(e[t]),delete e[t]}),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=Pi(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=[],this.initPTS=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())}_cleanTracks(){const{media:e}=this;if(!e)return;const t=e.textTracks;if(t)for(let s=0;sr.textCodec===es);if(this.config.enableWebVTT||i&&this.config.enableIMSC1){if(Cr(this.tracks,s)){this.tracks=s;return}if(this.textTracks=[],this.tracks=s,this.config.renderTextTracksNatively){const n=this.media,o=n?gt(n.textTracks):null;if(this.tracks.forEach((l,c)=>{let h;if(o){let u=null;for(let d=0;dc!==null).map(c=>c.label);l.length&&v.warn(`Media element contains unused subtitle tracks: ${l.join(", ")}. Replace media element for each source to clear TextTracks and captions menu.`)}}else if(this.tracks.length){const n=this.tracks.map(o=>({label:o.name,kind:o.type.toLowerCase(),default:o.default,subtitleTrack:o}));this.hls.trigger(p.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:n})}}}onManifestLoaded(e,t){this.config.enableCEA708Captions&&t.captions&&t.captions.forEach(s=>{const i=/(?:CC|SERVICE)([1-4])/.exec(s.instreamId);if(!i)return;const r=`textTrack${i[1]}`,n=this.captionsProperties[r];n&&(n.label=s.name,s.lang&&(n.languageCode=s.lang),n.media=s)})}closedCaptionsForLevel(e){const t=this.hls.levels[e.level];return t==null?void 0:t.attrs["CLOSED-CAPTIONS"]}onFragLoading(e,t){if(this.enabled&&t.frag.type===U.MAIN){var s,i;const{cea608Parser1:r,cea608Parser2:n,lastSn:o}=this,{cc:l,sn:c}=t.frag,h=(s=(i=t.part)==null?void 0:i.index)!=null?s:-1;r&&n&&(c!==o+1||c===o&&h!==this.lastPartIndex+1||l!==this.lastCc)&&(r.reset(),n.reset()),this.lastCc=l,this.lastSn=c,this.lastPartIndex=h}}onFragLoaded(e,t){const{frag:s,payload:i}=t;if(s.type===U.SUBTITLE)if(i.byteLength){const r=s.decryptdata,n="stats"in t;if(r==null||!r.encrypted||n){const o=this.tracks[s.level],l=this.vttCCs;l[s.cc]||(l[s.cc]={start:s.start,prevCC:this.prevCC,new:!0},this.prevCC=s.cc),o&&o.textCodec===es?this._parseIMSC1(s,i):this._parseVTTs(t)}}else this.hls.trigger(p.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:s,error:new Error("Empty subtitle payload")})}_parseIMSC1(e,t){const s=this.hls;Ci(t,this.initPTS[e.cc],i=>{this._appendCues(i,e.level),s.trigger(p.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})},i=>{v.log(`Failed to parse IMSC1: ${i}`),s.trigger(p.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:i})})}_parseVTTs(e){var t;const{frag:s,payload:i}=e,{initPTS:r,unparsedVttFrags:n}=this,o=r.length-1;if(!r[s.cc]&&o===-1){n.push(e);return}const l=this.hls,c=(t=s.initSegment)!=null&&t.data?pe(s.initSegment.data,new Uint8Array(i)):i;cl(c,this.initPTS[s.cc],this.vttCCs,s.cc,s.start,h=>{this._appendCues(h,s.level),l.trigger(p.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:s})},h=>{const u=h.message==="Missing initPTS for VTT MPEGTS";u?n.push(e):this._fallbackToIMSC1(s,i),v.log(`Failed to parse VTT cue: ${h}`),!(u&&o>s.cc)&&l.trigger(p.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:s,error:h})})}_fallbackToIMSC1(e,t){const s=this.tracks[e.level];s.textCodec||Ci(t,this.initPTS[e.cc],()=>{s.textCodec=es,this._parseIMSC1(e,t)},()=>{s.textCodec="wvtt"})}_appendCues(e,t){const s=this.hls;if(this.config.renderTextTracksNatively){const i=this.textTracks[t];if(!i||i.mode==="disabled")return;e.forEach(r=>rr(i,r))}else{const i=this.tracks[t];if(!i)return;const r=i.default?"default":"subtitles"+t;s.trigger(p.CUES_PARSED,{type:"subtitles",cues:e,track:r})}}onFragDecrypted(e,t){const{frag:s}=t;s.type===U.SUBTITLE&&this.onFragLoaded(p.FRAG_LOADED,t)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(e,t){this.initCea608Parsers();const{cea608Parser1:s,cea608Parser2:i}=this;if(!this.enabled||!s||!i)return;const{frag:r,samples:n}=t;if(!(r.type===U.MAIN&&this.closedCaptionsForLevel(r)==="NONE"))for(let o=0;ols(o[l],t,s))}if(this.config.renderTextTracksNatively&&t===0&&i!==void 0){const{textTracks:o}=this;Object.keys(o).forEach(l=>ls(o[l],t,i))}}}extractCea608Data(e){const t=[[],[]],s=e[0]&31;let i=2;for(let r=0;rthis.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}}getMaxLevel(e){const t=this.hls.levels;if(!t.length)return-1;const s=t.filter((i,r)=>this.isLevelAllowed(i)&&r<=e);return this.clientRect=null,Ms.getMaxLevelByMediaSize(s,this.mediaWidth,this.mediaHeight)}startCapping(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())}stopCapping(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)}getDimensions(){if(this.clientRect)return this.clientRect;const e=this.media,t={width:0,height:0};if(e){const s=e.getBoundingClientRect();t.width=s.width,t.height=s.height,!t.width&&!t.height&&(t.width=s.right-s.left||e.width||0,t.height=s.bottom-s.top||e.height||0)}return this.clientRect=t,t}get mediaWidth(){return this.getDimensions().width*this.contentScaleFactor}get mediaHeight(){return this.getDimensions().height*this.contentScaleFactor}get contentScaleFactor(){let e=1;if(!this.hls.config.ignoreDevicePixelRatio)try{e=self.devicePixelRatio}catch{}return e}isLevelAllowed(e){return!this.restrictedLevels.some(s=>e.bitrate===s.bitrate&&e.width===s.width&&e.height===s.height)}static getMaxLevelByMediaSize(e,t,s){if(!(e!=null&&e.length))return-1;const i=(o,l)=>l?o.width!==l.width||o.height!==l.height:!0;let r=e.length-1;const n=Math.max(t,s);for(let o=0;o=n||l.height>=n)&&i(l,e[o+1])){r=o;break}}return r}}class Tl{constructor(e){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=e,this.registerListeners()}setStreamController(e){this.streamController=e}registerListeners(){this.hls.on(p.MEDIA_ATTACHING,this.onMediaAttaching,this)}unregisterListeners(){this.hls.off(p.MEDIA_ATTACHING,this.onMediaAttaching,this)}destroy(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}onMediaAttaching(e,t){const s=this.hls.config;if(s.capLevelOnFPSDrop){const i=t.media instanceof self.HTMLVideoElement?t.media:null;this.media=i,i&&typeof i.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),s.fpsDroppedMonitoringPeriod)}}checkFPS(e,t,s){const i=performance.now();if(t){if(this.lastTime){const r=i-this.lastTime,n=s-this.lastDroppedFrames,o=t-this.lastDecodedFrames,l=1e3*n/r,c=this.hls;if(c.trigger(p.FPS_DROP,{currentDropped:n,currentDecoded:o,totalDroppedFrames:s}),l>0&&n>c.config.fpsDroppedMonitoringThreshold*o){let h=c.currentLevel;v.warn("drop FPS ratio greater than max allowed value for currentLevel: "+h),h>0&&(c.autoLevelCapping===-1||c.autoLevelCapping>=h)&&(h=h-1,c.trigger(p.FPS_DROP_LEVEL_CAPPING,{level:h,droppedLevel:c.currentLevel}),c.autoLevelCapping=h,this.streamController.nextLevelSwitch())}}this.lastTime=i,this.lastDroppedFrames=s,this.lastDecodedFrames=t}}checkFPSInterval(){const e=this.media;if(e)if(this.isVideoPlaybackQualityAvailable){const t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)}}const dt="[eme]";class Ye{constructor(e){this.hls=void 0,this.config=void 0,this.media=null,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.setMediaKeysQueue=Ye.CDMCleanupPromise?[Ye.CDMCleanupPromise]:[],this.onMediaEncrypted=this._onMediaEncrypted.bind(this),this.onWaitingForKey=this._onWaitingForKey.bind(this),this.debug=v.debug.bind(v,dt),this.log=v.log.bind(v,dt),this.warn=v.warn.bind(v,dt),this.error=v.error.bind(v,dt),this.hls=e,this.config=e.config,this.registerListeners()}destroy(){this.unregisterListeners(),this.onMediaDetached();const e=this.config;e.requestMediaKeySystemAccessFunc=null,e.licenseXhrSetup=e.licenseResponseCallback=void 0,e.drmSystems=e.drmSystemOptions={},this.hls=this.onMediaEncrypted=this.onWaitingForKey=this.keyIdToKeySessionPromise=null,this.config=null}registerListeners(){this.hls.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(p.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(p.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(p.MANIFEST_LOADED,this.onManifestLoaded,this)}unregisterListeners(){this.hls.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(p.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(p.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(p.MANIFEST_LOADED,this.onManifestLoaded,this)}getLicenseServerUrl(e){const{drmSystems:t,widevineLicenseUrl:s}=this.config,i=t[e];if(i)return i.licenseUrl;if(e===Z.WIDEVINE&&s)return s;throw new Error(`no license server URL configured for key-system "${e}"`)}getServerCertificateUrl(e){const{drmSystems:t}=this.config,s=t[e];if(s)return s.serverCertificateUrl;this.log(`No Server Certificate in config.drmSystems["${e}"]`)}attemptKeySystemAccess(e){const t=this.hls.levels,s=(n,o,l)=>!!n&&l.indexOf(n)===o,i=t.map(n=>n.audioCodec).filter(s),r=t.map(n=>n.videoCodec).filter(s);return i.length+r.length===0&&r.push("avc1.42e01e"),new Promise((n,o)=>{const l=c=>{const h=c.shift();this.getMediaKeysPromise(h,i,r).then(u=>n({keySystem:h,mediaKeys:u})).catch(u=>{c.length?l(c):u instanceof ge?o(u):o(new ge({type:$.KEY_SYSTEM_ERROR,details:L.KEY_SYSTEM_NO_ACCESS,error:u,fatal:!0},u.message))})};l(e)})}requestMediaKeySystemAccess(e,t){const{requestMediaKeySystemAccessFunc:s}=this.config;if(typeof s!="function"){let i=`Configured requestMediaKeySystemAccess is not a function ${s}`;return Hi===null&&self.location.protocol==="http:"&&(i=`navigator.requestMediaKeySystemAccess is not available over insecure protocol ${location.protocol}`),Promise.reject(new Error(i))}return s(e,t)}getMediaKeysPromise(e,t,s){const i=An(e,t,s,this.config.drmSystemOptions),r=this.keySystemAccessPromises[e];let n=r==null?void 0:r.keySystemAccess;if(!n){this.log(`Requesting encrypted media "${e}" key-system access with config: ${JSON.stringify(i)}`),n=this.requestMediaKeySystemAccess(e,i);const o=this.keySystemAccessPromises[e]={keySystemAccess:n};return n.catch(l=>{this.log(`Failed to obtain access to key-system "${e}": ${l}`)}),n.then(l=>{this.log(`Access for key-system "${l.keySystem}" obtained`);const c=this.fetchServerCertificate(e);return this.log(`Create media-keys for "${e}"`),o.mediaKeys=l.createMediaKeys().then(h=>(this.log(`Media-keys created for "${e}"`),c.then(u=>u?this.setMediaKeysServerCertificate(h,e,u):h))),o.mediaKeys.catch(h=>{this.error(`Failed to create media-keys for "${e}"}: ${h}`)}),o.mediaKeys})}return n.then(()=>r.mediaKeys)}createMediaKeySessionContext({decryptdata:e,keySystem:t,mediaKeys:s}){this.log(`Creating key-system session "${t}" keyId: ${Se.hexDump(e.keyId||[])}`);const i=s.createSession(),r={decryptdata:e,keySystem:t,mediaKeys:s,mediaKeysSession:i,keyStatus:"status-pending"};return this.mediaKeySessions.push(r),r}renewKeySession(e){const t=e.decryptdata;if(t.pssh){const s=this.createMediaKeySessionContext(e),i=this.getKeyIdString(t),r="cenc";this.keyIdToKeySessionPromise[i]=this.generateRequestWithPreferredKeySession(s,r,t.pssh,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(e)}getKeyIdString(e){if(!e)throw new Error("Could not read keyId of undefined decryptdata");if(e.keyId===null)throw new Error("keyId is null");return Se.hexDump(e.keyId)}updateKeySession(e,t){var s;const i=e.mediaKeysSession;return this.log(`Updating key-session "${i.sessionId}" for keyID ${Se.hexDump(((s=e.decryptdata)==null?void 0:s.keyId)||[])} + } (data length: ${t&&t.byteLength})`),i.update(t)}selectKeySystemFormat(e){const t=Object.keys(e.levelkeys||{});return this.keyFormatPromise||(this.log(`Selecting key-system from fragment (sn: ${e.sn} ${e.type}: ${e.level}) key formats ${t.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(t)),this.keyFormatPromise}getKeyFormatPromise(e){return new Promise((t,s)=>{const i=Bt(this.config),r=e.map($s).filter(n=>!!n&&i.indexOf(n)!==-1);return this.getKeySystemSelectionPromise(r).then(({keySystem:n})=>{const o=Gs(n);o?t(o):s(new Error(`Unable to find format for key-system "${n}"`))}).catch(s)})}loadKey(e){const t=e.keyInfo.decryptdata,s=this.getKeyIdString(t),i=`(keyId: ${s} format: "${t.keyFormat}" method: ${t.method} uri: ${t.uri})`;this.log(`Starting session for key ${i}`);let r=this.keyIdToKeySessionPromise[s];return r||(r=this.keyIdToKeySessionPromise[s]=this.getKeySystemForKeyPromise(t).then(({keySystem:n,mediaKeys:o})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${e.frag.sn} ${e.frag.type}: ${e.frag.level} using key ${i}`),this.attemptSetMediaKeys(n,o).then(()=>{this.throwIfDestroyed();const l=this.createMediaKeySessionContext({keySystem:n,mediaKeys:o,decryptdata:t});return this.generateRequestWithPreferredKeySession(l,"cenc",t.pssh,"playlist-key")}))),r.catch(n=>this.handleError(n))),r}throwIfDestroyed(e="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(e){this.hls&&(this.error(e.message),e instanceof ge?this.hls.trigger(p.ERROR,e.data):this.hls.trigger(p.ERROR,{type:$.KEY_SYSTEM_ERROR,details:L.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0}))}getKeySystemForKeyPromise(e){const t=this.getKeyIdString(e),s=this.keyIdToKeySessionPromise[t];if(!s){const i=$s(e.keyFormat),r=i?[i]:Bt(this.config);return this.attemptKeySystemAccess(r)}return s}getKeySystemSelectionPromise(e){if(e.length||(e=Bt(this.config)),e.length===0)throw new ge({type:$.KEY_SYSTEM_ERROR,details:L.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${JSON.stringify({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(e)}_onMediaEncrypted(e){const{initDataType:t,initData:s}=e;if(this.debug(`"${e.type}" event: init data type: "${t}"`),s===null)return;let i,r;if(t==="sinf"&&this.config.drmSystems[Z.FAIRPLAY]){const h=ie(new Uint8Array(s));try{const u=Ss(JSON.parse(h).sinf),d=Ji(new Uint8Array(u));if(!d)return;i=d.subarray(8,24),r=Z.FAIRPLAY}catch{this.warn('Failed to parse sinf "encrypted" event message initData');return}}else{const h=jn(s);if(h===null)return;h.version===0&&h.systemId===Vi.WIDEVINE&&h.data&&(i=h.data.subarray(8,24)),r=vn(h.systemId)}if(!r||!i)return;const n=Se.hexDump(i),{keyIdToKeySessionPromise:o,mediaKeySessions:l}=this;let c=o[n];for(let h=0;hthis.generateRequestWithPreferredKeySession(u,t,s,"encrypted-event-key-match"));break}}c||(c=o[n]=this.getKeySystemSelectionPromise([r]).then(({keySystem:h,mediaKeys:u})=>{var d;this.throwIfDestroyed();const g=new tt("ISO-23001-7",n,(d=Gs(h))!=null?d:"");return g.pssh=new Uint8Array(s),g.keyId=i,this.attemptSetMediaKeys(h,u).then(()=>{this.throwIfDestroyed();const f=this.createMediaKeySessionContext({decryptdata:g,keySystem:h,mediaKeys:u});return this.generateRequestWithPreferredKeySession(f,t,s,"encrypted-event-no-match")})})),c.catch(h=>this.handleError(h))}_onWaitingForKey(e){this.log(`"${e.type}" event`)}attemptSetMediaKeys(e,t){const s=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${e}"`);const i=Promise.all(s).then(()=>{if(!this.media)throw new Error("Attempted to set mediaKeys without media element attached");return this.media.setMediaKeys(t)});return this.setMediaKeysQueue.push(i),i.then(()=>{this.log(`Media-keys set for "${e}"`),s.push(i),this.setMediaKeysQueue=this.setMediaKeysQueue.filter(r=>s.indexOf(r)===-1)})}generateRequestWithPreferredKeySession(e,t,s,i){var r,n;const o=(r=this.config.drmSystems)==null||(n=r[e.keySystem])==null?void 0:n.generateRequest;if(o)try{const f=o.call(this.hls,t,s,e);if(!f)throw new Error("Invalid response from configured generateRequest filter");t=f.initDataType,s=e.decryptdata.pssh=f.initData?new Uint8Array(f.initData):null}catch(f){var l;if(this.warn(f.message),(l=this.hls)!=null&&l.config.debug)throw f}if(s===null)return this.log(`Skipping key-session request for "${i}" (no initData)`),Promise.resolve(e);const c=this.getKeyIdString(e.decryptdata);this.log(`Generating key-session request for "${i}": ${c} (init data type: ${t} length: ${s?s.byteLength:null})`);const h=new Ps,u=e._onmessage=f=>{const m=e.mediaKeysSession;if(!m){h.emit("error",new Error("invalid state"));return}const{messageType:T,message:E}=f;this.log(`"${T}" message event for session "${m.sessionId}" message size: ${E.byteLength}`),T==="license-request"||T==="license-renewal"?this.renewLicense(e,E).catch(x=>{this.handleError(x),h.emit("error",x)}):T==="license-release"?e.keySystem===Z.FAIRPLAY&&(this.updateKeySession(e,as("acknowledged")),this.removeSession(e)):this.warn(`unhandled media key message type "${T}"`)},d=e._onkeystatuseschange=f=>{if(!e.mediaKeysSession){h.emit("error",new Error("invalid state"));return}this.onKeyStatusChange(e);const T=e.keyStatus;h.emit("keyStatus",T),T==="expired"&&(this.warn(`${e.keySystem} expired for key ${c}`),this.renewKeySession(e))};e.mediaKeysSession.addEventListener("message",u),e.mediaKeysSession.addEventListener("keystatuseschange",d);const g=new Promise((f,m)=>{h.on("error",m),h.on("keyStatus",T=>{T.startsWith("usable")?f():T==="output-restricted"?m(new ge({type:$.KEY_SYSTEM_ERROR,details:L.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):T==="internal-error"?m(new ge({type:$.KEY_SYSTEM_ERROR,details:L.KEY_SYSTEM_STATUS_INTERNAL_ERROR,fatal:!0},`key status changed to "${T}"`)):T==="expired"?m(new Error("key expired while generating request")):this.warn(`unhandled key status change "${T}"`)})});return e.mediaKeysSession.generateRequest(t,s).then(()=>{var f;this.log(`Request generated for key-session "${(f=e.mediaKeysSession)==null?void 0:f.sessionId}" keyId: ${c}`)}).catch(f=>{throw new ge({type:$.KEY_SYSTEM_ERROR,details:L.KEY_SYSTEM_NO_SESSION,error:f,fatal:!1},`Error generating key-session request: ${f}`)}).then(()=>g).catch(f=>{throw h.removeAllListeners(),this.removeSession(e),f}).then(()=>(h.removeAllListeners(),e))}onKeyStatusChange(e){e.mediaKeysSession.keyStatuses.forEach((t,s)=>{this.log(`key status change "${t}" for keyStatuses keyId: ${Se.hexDump("buffer"in s?new Uint8Array(s.buffer,s.byteOffset,s.byteLength):new Uint8Array(s))} session keyId: ${Se.hexDump(new Uint8Array(e.decryptdata.keyId||[]))} uri: ${e.decryptdata.uri}`),e.keyStatus=t})}fetchServerCertificate(e){const t=this.config,s=t.loader,i=new s(t),r=this.getServerCertificateUrl(e);return r?(this.log(`Fetching server certificate for "${e}"`),new Promise((n,o)=>{const l={responseType:"arraybuffer",url:r},c=t.certLoadPolicy.default,h={loadPolicy:c,timeout:c.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},u={onSuccess:(d,g,f,m)=>{n(d.data)},onError:(d,g,f,m)=>{o(new ge({type:$.KEY_SYSTEM_ERROR,details:L.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:f,response:oe({url:l.url,data:void 0},d)},`"${e}" certificate request failed (${r}). Status: ${d.code} (${d.text})`))},onTimeout:(d,g,f)=>{o(new ge({type:$.KEY_SYSTEM_ERROR,details:L.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:f,response:{url:l.url,data:void 0}},`"${e}" certificate request timed out (${r})`))},onAbort:(d,g,f)=>{o(new Error("aborted"))}};i.load(l,h,u)})):Promise.resolve()}setMediaKeysServerCertificate(e,t,s){return new Promise((i,r)=>{e.setServerCertificate(s).then(n=>{this.log(`setServerCertificate ${n?"success":"not supported by CDM"} (${s==null?void 0:s.byteLength}) on "${t}"`),i(e)}).catch(n=>{r(new ge({type:$.KEY_SYSTEM_ERROR,details:L.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:n,fatal:!0},n.message))})})}renewLicense(e,t){return this.requestLicense(e,new Uint8Array(t)).then(s=>this.updateKeySession(e,new Uint8Array(s)).catch(i=>{throw new ge({type:$.KEY_SYSTEM_ERROR,details:L.KEY_SYSTEM_SESSION_UPDATE_FAILED,error:i,fatal:!0},i.message)}))}unpackPlayReadyKeyMessage(e,t){const s=String.fromCharCode.apply(null,new Uint16Array(t.buffer));if(!s.includes("PlayReadyKeyMessage"))return e.setRequestHeader("Content-Type","text/xml; charset=utf-8"),t;const i=new DOMParser().parseFromString(s,"application/xml"),r=i.querySelectorAll("HttpHeader");if(r.length>0){let h;for(let u=0,d=r.length;u in key message");return as(atob(c))}setupLicenseXHR(e,t,s,i){const r=this.config.licenseXhrSetup;return r?Promise.resolve().then(()=>{if(!s.decryptdata)throw new Error("Key removed");return r.call(this.hls,e,t,s,i)}).catch(n=>{if(!s.decryptdata)throw n;return e.open("POST",t,!0),r.call(this.hls,e,t,s,i)}).then(n=>(e.readyState||e.open("POST",t,!0),{xhr:e,licenseChallenge:n||i})):(e.open("POST",t,!0),Promise.resolve({xhr:e,licenseChallenge:i}))}requestLicense(e,t){const s=this.config.keyLoadPolicy.default;return new Promise((i,r)=>{const n=this.getLicenseServerUrl(e.keySystem);this.log(`Sending license request to URL: ${n}`);const o=new XMLHttpRequest;o.responseType="arraybuffer",o.onreadystatechange=()=>{if(!this.hls||!e.mediaKeysSession)return r(new Error("invalid state"));if(o.readyState===4)if(o.status===200){this._requestLicenseFailureCount=0;let l=o.response;this.log(`License received ${l instanceof ArrayBuffer?l.byteLength:l}`);const c=this.config.licenseResponseCallback;if(c)try{l=c.call(this.hls,o,n,e)}catch(h){this.error(h)}i(l)}else{const l=s.errorRetry,c=l?l.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>c||o.status>=400&&o.status<500)r(new ge({type:$.KEY_SYSTEM_ERROR,details:L.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0,networkDetails:o,response:{url:n,data:void 0,code:o.status,text:o.statusText}},`License Request XHR failed (${n}). Status: ${o.status} (${o.statusText})`));else{const h=c-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${h} attempts left`),this.requestLicense(e,t).then(i,r)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=o,this.setupLicenseXHR(o,n,e,t).then(({xhr:l,licenseChallenge:c})=>{e.keySystem==Z.PLAYREADY&&(c=this.unpackPlayReadyKeyMessage(l,c)),l.send(c)})})}onMediaAttached(e,t){if(!this.config.emeEnabled)return;const s=t.media;this.media=s,s.addEventListener("encrypted",this.onMediaEncrypted),s.addEventListener("waitingforkey",this.onWaitingForKey)}onMediaDetached(){const e=this.media,t=this.mediaKeySessions;e&&(e.removeEventListener("encrypted",this.onMediaEncrypted),e.removeEventListener("waitingforkey",this.onWaitingForKey),this.media=null),this._requestLicenseFailureCount=0,this.setMediaKeysQueue=[],this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},tt.clearKeyUriToKeyIdMap();const s=t.length;Ye.CDMCleanupPromise=Promise.all(t.map(i=>this.removeSession(i)).concat(e==null?void 0:e.setMediaKeys(null).catch(i=>{this.log(`Could not clear media keys: ${i}`)}))).then(()=>{s&&(this.log("finished closing key sessions and clearing media keys"),t.length=0)}).catch(i=>{this.log(`Could not close sessions and clear media keys: ${i}`)})}onManifestLoading(){this.keyFormatPromise=null}onManifestLoaded(e,{sessionKeys:t}){if(!(!t||!this.config.emeEnabled)&&!this.keyFormatPromise){const s=t.reduce((i,r)=>(i.indexOf(r.keyFormat)===-1&&i.push(r.keyFormat),i),[]);this.log(`Selecting key-system from session-keys ${s.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(s)}}removeSession(e){const{mediaKeysSession:t,licenseXhr:s}=e;if(t){this.log(`Remove licenses and keys and close session ${t.sessionId}`),e._onmessage&&(t.removeEventListener("message",e._onmessage),e._onmessage=void 0),e._onkeystatuseschange&&(t.removeEventListener("keystatuseschange",e._onkeystatuseschange),e._onkeystatuseschange=void 0),s&&s.readyState!==XMLHttpRequest.DONE&&s.abort(),e.mediaKeysSession=e.decryptdata=e.licenseXhr=void 0;const i=this.mediaKeySessions.indexOf(e);return i>-1&&this.mediaKeySessions.splice(i,1),t.remove().catch(r=>{this.log(`Could not remove session: ${r}`)}).then(()=>t.close()).catch(r=>{this.log(`Could not close session: ${r}`)})}}}Ye.CDMCleanupPromise=void 0;class ge extends Error{constructor(e,t){super(t),this.data=void 0,e.error||(e.error=new Error(t)),this.data=e,e.err=e.error}}var he;(function(a){a.MANIFEST="m",a.AUDIO="a",a.VIDEO="v",a.MUXED="av",a.INIT="i",a.CAPTION="c",a.TIMED_TEXT="tt",a.KEY="k",a.OTHER="o"})(he||(he={}));var ps;(function(a){a.DASH="d",a.HLS="h",a.SMOOTH="s",a.OTHER="o"})(ps||(ps={}));var Me;(function(a){a.OBJECT="CMCD-Object",a.REQUEST="CMCD-Request",a.SESSION="CMCD-Session",a.STATUS="CMCD-Status"})(Me||(Me={}));const El={[Me.OBJECT]:["br","d","ot","tb"],[Me.REQUEST]:["bl","dl","mtp","nor","nrr","su"],[Me.SESSION]:["cid","pr","sf","sid","st","v"],[Me.STATUS]:["bs","rtp"]};class Xe{constructor(e,t){this.value=void 0,this.params=void 0,Array.isArray(e)&&(e=e.map(s=>s instanceof Xe?s:new Xe(s))),this.value=e,this.params=t}}class Br{constructor(e){this.description=void 0,this.description=e}}const yl="Dict";function xl(a){return Array.isArray(a)?JSON.stringify(a):a instanceof Map?"Map{}":a instanceof Set?"Set{}":typeof a=="object"?JSON.stringify(a):String(a)}function Sl(a,e,t,s){return new Error(`failed to ${a} "${xl(e)}" as ${t}`,{cause:s})}const Fi="Bare Item",vl="Boolean",Al="Byte Sequence",Ll="Decimal",Rl="Integer";function Il(a){return a<-999999999999999||99999999999999912)throw Ie(a,Ll);const t=e.toString();return t.includes(".")?t:`${t}.0`}const Ol="String";function Ml(a){if(bl.test(a))throw Ie(a,Ol);return`"${a.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function Nl(a){return a.description||a.toString().slice(7,-1)}function Oi(a){const e=Nl(a);if(/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(e)===!1)throw Ie(e,Dl);return e}function Ts(a){switch(typeof a){case"number":if(!O(a))throw Ie(a,Fi);return Number.isInteger(a)?$r(a):Fl(a);case"string":return Ml(a);case"symbol":return Oi(a);case"boolean":return _l(a);case"object":if(a instanceof Date)return Pl(a);if(a instanceof Uint8Array)return kl(a);if(a instanceof Br)return Oi(a);default:throw Ie(a,Fi)}}function Es(a){if(/^[a-z*][a-z0-9\-_.*]*$/.test(a)===!1)throw Ie(a,Cl);return a}function Ns(a){return a==null?"":Object.entries(a).map(([e,t])=>t===!0?`;${Es(e)}`:`;${Es(e)}=${Ts(t)}`).join("")}function Kr(a){return a instanceof Xe?`${Ts(a.value)}${Ns(a.params)}`:Ts(a)}function Ul(a){return`(${a.value.map(Kr).join(" ")})${Ns(a.params)}`}function Bl(a,e={whitespace:!0}){if(typeof a!="object")throw Ie(a,yl);const t=a instanceof Map?a.entries():Object.entries(a),s=e!=null&&e.whitespace?" ":"";return Array.from(t).map(([i,r])=>{r instanceof Xe||(r=new Xe(r));let n=Es(i);return r.value===!0?n+=Ns(r.params):(n+="=",Array.isArray(r.value)?n+=Ul(r):n+=Kr(r)),n}).join(`,${s}`)}function $l(a,e){return Bl(a,e)}const Gl=a=>a==="ot"||a==="sf"||a==="st",Kl=a=>typeof a=="number"?O(a):a!=null&&a!==""&&a!==!1;function Vl(a,e){const t=new URL(a),s=new URL(e);if(t.origin!==s.origin)return a;const i=t.pathname.split("/").slice(1),r=s.pathname.split("/").slice(1,-1);for(;i[0]===r[0];)i.shift(),r.shift();for(;r.length;)r.shift(),i.unshift("..");return i.join("/")}function Hl(){try{return crypto.randomUUID()}catch{try{const e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.slice(t.lastIndexOf("/")+1)}catch{let t=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,i=>{const r=(t+Math.random()*16)%16|0;return t=Math.floor(t/16),(i=="x"?r:r&3|8).toString(16)})}}}const xt=a=>Math.round(a),Wl=(a,e)=>(e!=null&&e.baseUrl&&(a=Vl(a,e.baseUrl)),encodeURIComponent(a)),ft=a=>xt(a/100)*100,Yl={br:xt,d:xt,bl:ft,dl:ft,mtp:ft,nor:Wl,rtp:ft,tb:xt};function ql(a,e){const t={};if(a==null||typeof a!="object")return t;const s=Object.keys(a).sort(),i=se({},Yl,e==null?void 0:e.formatters),r=e==null?void 0:e.filter;return s.forEach(n=>{if(r!=null&&r(n))return;let o=a[n];const l=i[n];l&&(o=l(o,e)),!(n==="v"&&o===1)&&(n=="pr"&&o===1||Kl(o)&&(Gl(n)&&typeof o=="string"&&(o=new Br(o)),t[n]=o))}),t}function Vr(a,e={}){return a?$l(ql(a,e),se({whitespace:!1},e)):""}function jl(a,e={}){if(!a)return{};const t=Object.entries(a),s=Object.entries(El).concat(Object.entries((e==null?void 0:e.customHeaderMap)||{})),i=t.reduce((r,n)=>{var o,l;const[c,h]=n,u=((o=s.find(d=>d[1].includes(c)))==null?void 0:o[0])||Me.REQUEST;return(l=r[u])!=null||(r[u]={}),r[u][c]=h,r},{});return Object.entries(i).reduce((r,[n,o])=>(r[n]=Vr(o,e),r),{})}function zl(a,e,t){return se(a,jl(e,t))}const Xl="CMCD";function Ql(a,e={}){if(!a)return"";const t=Vr(a,e);return`${Xl}=${encodeURIComponent(t)}`}const Mi=/CMCD=[^&#]+/;function Jl(a,e,t){const s=Ql(e,t);if(!s)return a;if(Mi.test(a))return a.replace(Mi,s);const i=a.includes("?")?"&":"?";return`${a}${i}${s}`}class Zl{constructor(e){this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.includeKeys=void 0,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=()=>{this.initialized&&(this.starved=!0),this.buffering=!0},this.onPlaying=()=>{this.initialized||(this.initialized=!0),this.buffering=!1},this.applyPlaylistData=i=>{try{this.apply(i,{ot:he.MANIFEST,su:!this.initialized})}catch(r){v.warn("Could not generate manifest CMCD data.",r)}},this.applyFragmentData=i=>{try{const r=i.frag,n=this.hls.levels[r.level],o=this.getObjectType(r),l={d:r.duration*1e3,ot:o};(o===he.VIDEO||o===he.AUDIO||o==he.MUXED)&&(l.br=n.bitrate/1e3,l.tb=this.getTopBandwidth(o)/1e3,l.bl=this.getBufferLength(o)),this.apply(i,l)}catch(r){v.warn("Could not generate segment CMCD data.",r)}},this.hls=e;const t=this.config=e.config,{cmcd:s}=t;s!=null&&(t.pLoader=this.createPlaylistLoader(),t.fLoader=this.createFragmentLoader(),this.sid=s.sessionId||Hl(),this.cid=s.contentId,this.useHeaders=s.useHeaders===!0,this.includeKeys=s.includeKeys,this.registerListeners())}registerListeners(){const e=this.hls;e.on(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(p.MEDIA_DETACHED,this.onMediaDetached,this),e.on(p.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const e=this.hls;e.off(p.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(p.MEDIA_DETACHED,this.onMediaDetached,this),e.off(p.BUFFER_CREATED,this.onBufferCreated,this)}destroy(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null,this.onWaiting=this.onPlaying=null}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)}onMediaDetached(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)}onBufferCreated(e,t){var s,i;this.audioBuffer=(s=t.tracks.audio)==null?void 0:s.buffer,this.videoBuffer=(i=t.tracks.video)==null?void 0:i.buffer}createData(){var e;return{v:1,sf:ps.HLS,sid:this.sid,cid:this.cid,pr:(e=this.media)==null?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(e,t={}){se(t,this.createData());const s=t.ot===he.INIT||t.ot===he.VIDEO||t.ot===he.MUXED;this.starved&&s&&(t.bs=!0,t.su=!0,this.starved=!1),t.su==null&&(t.su=this.buffering);const{includeKeys:i}=this;i&&(t=Object.keys(t).reduce((r,n)=>(i.includes(n)&&(r[n]=t[n]),r),{})),this.useHeaders?(e.headers||(e.headers={}),zl(e.headers,t)):e.url=Jl(e.url,t)}getObjectType(e){const{type:t}=e;if(t==="subtitle")return he.TIMED_TEXT;if(e.sn==="initSegment")return he.INIT;if(t==="audio")return he.AUDIO;if(t==="main")return this.hls.audioTracks.length?he.VIDEO:he.MUXED}getTopBandwidth(e){let t=0,s;const i=this.hls;if(e===he.AUDIO)s=i.audioTracks;else{const r=i.maxAutoLevel,n=r>-1?r+1:i.levels.length;s=i.levels.slice(0,n)}for(const r of s)r.bitrate>t&&(t=r.bitrate);return t>0?t:NaN}getBufferLength(e){const t=this.hls.media,s=e===he.AUDIO?this.audioBuffer:this.videoBuffer;return!s||!t?NaN:J.bufferInfo(s,t.currentTime,this.config.maxBufferHole).len*1e3}createPlaylistLoader(){const{pLoader:e}=this.config,t=this.applyPlaylistData,s=e||this.config.loader;return class{constructor(r){this.loader=void 0,this.loader=new s(r)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(r,n,o){t(r),this.loader.load(r,n,o)}}}createFragmentLoader(){const{fLoader:e}=this.config,t=this.applyFragmentData,s=e||this.config.loader;return class{constructor(r){this.loader=void 0,this.loader=new s(r)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(r,n,o){t(r),this.loader.load(r,n,o)}}}}const ec=3e5;class tc{constructor(e){this.hls=void 0,this.log=void 0,this.loader=null,this.uri=null,this.pathwayId=".",this.pathwayPriority=null,this.timeToLoad=300,this.reloadTimer=-1,this.updated=0,this.started=!1,this.enabled=!0,this.levels=null,this.audioTracks=null,this.subtitleTracks=null,this.penalizedPathways={},this.hls=e,this.log=v.log.bind(v,"[content-steering]:"),this.registerListeners()}registerListeners(){const e=this.hls;e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(p.MANIFEST_PARSED,this.onManifestParsed,this),e.on(p.ERROR,this.onError,this)}unregisterListeners(){const e=this.hls;e&&(e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(p.MANIFEST_PARSED,this.onManifestParsed,this),e.off(p.ERROR,this.onError,this))}startLoad(){if(this.started=!0,this.clearTimeout(),this.enabled&&this.uri){if(this.updated){const e=this.timeToLoad*1e3-(performance.now()-this.updated);if(e>0){this.scheduleRefresh(this.uri,e);return}}this.loadSteeringManifest(this.uri)}}stopLoad(){this.started=!1,this.loader&&(this.loader.destroy(),this.loader=null),this.clearTimeout()}clearTimeout(){this.reloadTimer!==-1&&(self.clearTimeout(this.reloadTimer),this.reloadTimer=-1)}destroy(){this.unregisterListeners(),this.stopLoad(),this.hls=null,this.levels=this.audioTracks=this.subtitleTracks=null}removeLevel(e){const t=this.levels;t&&(this.levels=t.filter(s=>s!==e))}onManifestLoading(){this.stopLoad(),this.enabled=!0,this.timeToLoad=300,this.updated=0,this.uri=null,this.pathwayId=".",this.levels=this.audioTracks=this.subtitleTracks=null}onManifestLoaded(e,t){const{contentSteering:s}=t;s!==null&&(this.pathwayId=s.pathwayId,this.uri=s.uri,this.started&&this.startLoad())}onManifestParsed(e,t){this.audioTracks=t.audioTracks,this.subtitleTracks=t.subtitleTracks}onError(e,t){const{errorAction:s}=t;if((s==null?void 0:s.action)===ce.SendAlternateToPenaltyBox&&s.flags===Te.MoveAllAlternatesMatchingHost){const i=this.levels;let r=this.pathwayPriority,n=this.pathwayId;if(t.context){const{groupId:o,pathwayId:l,type:c}=t.context;o&&i?n=this.getPathwayForGroupId(o,c,n):l&&(n=l)}n in this.penalizedPathways||(this.penalizedPathways[n]=performance.now()),!r&&i&&(r=i.reduce((o,l)=>(o.indexOf(l.pathwayId)===-1&&o.push(l.pathwayId),o),[])),r&&r.length>1&&(this.updatePathwayPriority(r),s.resolved=this.pathwayId!==n),s.resolved||v.warn(`Could not resolve ${t.details} ("${t.error.message}") with content-steering for Pathway: ${n} levels: ${i&&i.length} priorities: ${JSON.stringify(r)} penalized: ${JSON.stringify(this.penalizedPathways)}`)}}filterParsedLevels(e){this.levels=e;let t=this.getLevelsForPathway(this.pathwayId);if(t.length===0){const s=e[0].pathwayId;this.log(`No levels found in Pathway ${this.pathwayId}. Setting initial Pathway to "${s}"`),t=this.getLevelsForPathway(s),this.pathwayId=s}return t.length!==e.length?(this.log(`Found ${t.length}/${e.length} levels in Pathway "${this.pathwayId}"`),t):e}getLevelsForPathway(e){return this.levels===null?[]:this.levels.filter(t=>e===t.pathwayId)}updatePathwayPriority(e){this.pathwayPriority=e;let t;const s=this.penalizedPathways,i=performance.now();Object.keys(s).forEach(r=>{i-s[r]>ec&&delete s[r]});for(let r=0;r0){this.log(`Setting Pathway to "${n}"`),this.pathwayId=n,lr(t),this.hls.trigger(p.LEVELS_UPDATED,{levels:t});const c=this.hls.levels[o];l&&c&&this.levels&&(c.attrs["STABLE-VARIANT-ID"]!==l.attrs["STABLE-VARIANT-ID"]&&c.bitrate!==l.bitrate&&this.log(`Unstable Pathways change from bitrate ${l.bitrate} to ${c.bitrate}`),this.hls.nextLoadLevel=o);break}}}getPathwayForGroupId(e,t,s){const i=this.getLevelsForPathway(s).concat(this.levels||[]);for(let r=0;r{const{ID:n,"BASE-ID":o,"URI-REPLACEMENT":l}=r;if(t.some(h=>h.pathwayId===n))return;const c=this.getLevelsForPathway(o).map(h=>{const u=new ee(h.attrs);u["PATHWAY-ID"]=n;const d=u.AUDIO&&`${u.AUDIO}_clone_${n}`,g=u.SUBTITLES&&`${u.SUBTITLES}_clone_${n}`;d&&(s[u.AUDIO]=d,u.AUDIO=d),g&&(i[u.SUBTITLES]=g,u.SUBTITLES=g);const f=Hr(h.uri,u["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",l),m=new je({attrs:u,audioCodec:h.audioCodec,bitrate:h.bitrate,height:h.height,name:h.name,url:f,videoCodec:h.videoCodec,width:h.width});if(h.audioGroups)for(let T=1;T{this.log(`Loaded steering manifest: "${i}"`);const f=h.data;if(f.VERSION!==1){this.log(`Steering VERSION ${f.VERSION} not supported!`);return}this.updated=performance.now(),this.timeToLoad=f.TTL;const{"RELOAD-URI":m,"PATHWAY-CLONES":T,"PATHWAY-PRIORITY":E}=f;if(m)try{this.uri=new self.URL(m,i).href}catch{this.enabled=!1,this.log(`Failed to parse Steering Manifest RELOAD-URI: ${m}`);return}this.scheduleRefresh(this.uri||d.url),T&&this.clonePathways(T);const x={steeringManifest:f,url:i.toString()};this.hls.trigger(p.STEERING_MANIFEST_LOADED,x),E&&this.updatePathwayPriority(E)},onError:(h,u,d,g)=>{if(this.log(`Error loading steering manifest: ${h.code} ${h.text} (${u.url})`),this.stopLoad(),h.code===410){this.enabled=!1,this.log(`Steering manifest ${u.url} no longer available`);return}let f=this.timeToLoad*1e3;if(h.code===429){const m=this.loader;if(typeof(m==null?void 0:m.getResponseHeader)=="function"){const T=m.getResponseHeader("Retry-After");T&&(f=parseFloat(T)*1e3)}this.log(`Steering manifest ${u.url} rate limited`);return}this.scheduleRefresh(this.uri||u.url,f)},onTimeout:(h,u,d)=>{this.log(`Timeout loading steering manifest (${u.url})`),this.scheduleRefresh(this.uri||u.url)}};this.log(`Requesting steering manifest: ${i}`),this.loader.load(r,l,c)}scheduleRefresh(e,t=this.timeToLoad*1e3){this.clearTimeout(),this.reloadTimer=self.setTimeout(()=>{var s;const i=(s=this.hls)==null?void 0:s.media;if(i&&!i.ended){this.loadSteeringManifest(e);return}this.scheduleRefresh(e,this.timeToLoad*1e3)},t)}}function Ni(a,e,t,s){a&&Object.keys(e).forEach(i=>{const r=a.filter(n=>n.groupId===i).map(n=>{const o=se({},n);return o.details=void 0,o.attrs=new ee(o.attrs),o.url=o.attrs.URI=Hr(n.url,n.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",t),o.groupId=o.attrs["GROUP-ID"]=e[i],o.attrs["PATHWAY-ID"]=s,o});a.push(...r)})}function Hr(a,e,t,s){const{HOST:i,PARAMS:r,[t]:n}=s;let o;e&&(o=n==null?void 0:n[e],o&&(a=o));const l=new self.URL(a);return i&&!o&&(l.host=i),r&&Object.keys(r).sort().forEach(c=>{c&&l.searchParams.set(c,r[c])}),l.href}const sc=/^age:\s*[\d.]+\s*$/im;class Wr{constructor(e){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=null,this.loader=null,this.stats=void 0,this.xhrSetup=e&&e.xhrSetup||null,this.stats=new Ft,this.retryDelay=0}destroy(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null,this.context=null,this.xhrSetup=null}abortInternal(){const e=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),e&&(e.onreadystatechange=null,e.onprogress=null,e.readyState!==4&&(this.stats.aborted=!0,e.abort()))}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}load(e,t,s){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=e,this.config=t,this.callbacks=s,this.loadInternal()}loadInternal(){const{config:e,context:t}=this;if(!e||!t)return;const s=this.loader=new self.XMLHttpRequest,i=this.stats;i.loading.first=0,i.loaded=0,i.aborted=!1;const r=this.xhrSetup;r?Promise.resolve().then(()=>{if(!(this.loader!==s||this.stats.aborted))return r(s,t.url)}).catch(n=>{if(!(this.loader!==s||this.stats.aborted))return s.open("GET",t.url,!0),r(s,t.url)}).then(()=>{this.loader!==s||this.stats.aborted||this.openAndSendXhr(s,t,e)}).catch(n=>{this.callbacks.onError({code:s.status,text:n.message},t,s,i)}):this.openAndSendXhr(s,t,e)}openAndSendXhr(e,t,s){e.readyState||e.open("GET",t.url,!0);const i=t.headers,{maxTimeToFirstByteMs:r,maxLoadTimeMs:n}=s.loadPolicy;if(i)for(const o in i)e.setRequestHeader(o,i[o]);t.rangeEnd&&e.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,self.clearTimeout(this.requestTimeout),s.timeout=r&&O(r)?r:n,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),s.timeout),e.send()}readystatechange(){const{context:e,loader:t,stats:s}=this;if(!e||!t)return;const i=t.readyState,r=this.config;if(!s.aborted&&i>=2&&(s.loading.first===0&&(s.loading.first=Math.max(self.performance.now(),s.loading.start),r.timeout!==r.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),r.timeout=r.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),r.loadPolicy.maxLoadTimeMs-(s.loading.first-s.loading.start)))),i===4)){self.clearTimeout(this.requestTimeout),t.onreadystatechange=null,t.onprogress=null;const n=t.status,o=t.responseType!=="text";if(n>=200&&n<300&&(o&&t.response||t.responseText!==null)){s.loading.end=Math.max(self.performance.now(),s.loading.first);const l=o?t.response:t.responseText,c=t.responseType==="arraybuffer"?l.byteLength:l.length;if(s.loaded=s.total=c,s.bwEstimate=s.total*8e3/(s.loading.end-s.loading.first),!this.callbacks)return;const h=this.callbacks.onProgress;if(h&&h(s,e,l,t),!this.callbacks)return;const u={url:t.responseURL,data:l,code:n};this.callbacks.onSuccess(u,s,e,t)}else{const l=r.loadPolicy.errorRetry,c=s.retry,h={url:e.url,data:void 0,code:n};Dt(l,c,!1,h)?this.retry(l):(v.error(`${n} while loading ${e.url}`),this.callbacks.onError({code:n,text:t.statusText},e,t,s))}}}loadtimeout(){if(!this.config)return;const e=this.config.loadPolicy.timeoutRetry,t=this.stats.retry;if(Dt(e,t,!0))this.retry(e);else{var s;v.warn(`timeout while loading ${(s=this.context)==null?void 0:s.url}`);const i=this.callbacks;i&&(this.abortInternal(),i.onTimeout(this.stats,this.context,this.loader))}}retry(e){const{context:t,stats:s}=this;this.retryDelay=Ls(e,s.retry),s.retry++,v.warn(`${status?"HTTP Status "+status:"Timeout"} while loading ${t==null?void 0:t.url}, retrying ${s.retry}/${e.maxNumRetry} in ${this.retryDelay}ms`),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay)}loadprogress(e){const t=this.stats;t.loaded=e.loaded,e.lengthComputable&&(t.total=e.total)}getCacheAge(){let e=null;if(this.loader&&sc.test(this.loader.getAllResponseHeaders())){const t=this.loader.getResponseHeader("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.loader&&new RegExp(`^${e}:\\s*[\\d.]+\\s*$`,"im").test(this.loader.getAllResponseHeaders())?this.loader.getResponseHeader(e):null}}function ic(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch{}return!1}const rc=/(\d+)-(\d+)\/(\d+)/;class Ui{constructor(e){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=null,this.response=null,this.controller=void 0,this.context=null,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=e.fetchSetup||lc,this.controller=new self.AbortController,this.stats=new Ft}destroy(){this.loader=this.callbacks=this.context=this.config=this.request=null,this.abortInternal(),this.response=null,this.fetchSetup=this.controller=this.stats=null}abortInternal(){this.controller&&!this.stats.loading.end&&(this.stats.aborted=!0,this.controller.abort())}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)}load(e,t,s){const i=this.stats;if(i.loading.start)throw new Error("Loader can only be used once.");i.loading.start=self.performance.now();const r=nc(e,this.controller.signal),n=s.onProgress,o=e.responseType==="arraybuffer",l=o?"byteLength":"length",{maxTimeToFirstByteMs:c,maxLoadTimeMs:h}=t.loadPolicy;this.context=e,this.config=t,this.callbacks=s,this.request=this.fetchSetup(e,r),self.clearTimeout(this.requestTimeout),t.timeout=c&&O(c)?c:h,this.requestTimeout=self.setTimeout(()=>{this.abortInternal(),s.onTimeout(i,e,this.response)},t.timeout),self.fetch(this.request).then(u=>{this.response=this.loader=u;const d=Math.max(self.performance.now(),i.loading.start);if(self.clearTimeout(this.requestTimeout),t.timeout=h,this.requestTimeout=self.setTimeout(()=>{this.abortInternal(),s.onTimeout(i,e,this.response)},h-(d-i.loading.start)),!u.ok){const{status:g,statusText:f}=u;throw new cc(f||"fetch, bad network response",g,u)}return i.loading.first=d,i.total=oc(u.headers)||i.total,n&&O(t.highWaterMark)?this.loadProgressively(u,i,e,t.highWaterMark,n):o?u.arrayBuffer():e.responseType==="json"?u.json():u.text()}).then(u=>{const d=this.response;if(!d)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),i.loading.end=Math.max(self.performance.now(),i.loading.first);const g=u[l];g&&(i.loaded=i.total=g);const f={url:d.url,data:u,code:d.status};n&&!O(t.highWaterMark)&&n(i,e,u,d),s.onSuccess(f,i,e,d)}).catch(u=>{if(self.clearTimeout(this.requestTimeout),i.aborted)return;const d=u&&u.code||0,g=u?u.message:null;s.onError({code:d,text:g},e,u?u.details:null,i)})}getCacheAge(){let e=null;if(this.response){const t=this.response.headers.get("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.response?this.response.headers.get(e):null}loadProgressively(e,t,s,i=0,r){const n=new dr,o=e.body.getReader(),l=()=>o.read().then(c=>{if(c.done)return n.dataLength&&r(t,s,n.flush(),e),Promise.resolve(new ArrayBuffer(0));const h=c.value,u=h.length;return t.loaded+=u,u=i&&r(t,s,n.flush(),e)):r(t,s,h,e),l()}).catch(()=>Promise.reject());return l()}}function nc(a,e){const t={method:"GET",mode:"cors",credentials:"same-origin",signal:e,headers:new self.Headers(se({},a.headers))};return a.rangeEnd&&t.headers.set("Range","bytes="+a.rangeStart+"-"+String(a.rangeEnd-1)),t}function ac(a){const e=rc.exec(a);if(e)return parseInt(e[2])-parseInt(e[1])+1}function oc(a){const e=a.get("Content-Range");if(e){const s=ac(e);if(O(s))return s}const t=a.get("Content-Length");if(t)return parseInt(t)}function lc(a,e){return new self.Request(a.url,e)}class cc extends Error{constructor(e,t,s){super(e),this.code=void 0,this.details=void 0,this.code=t,this.details=s}}const hc=/\s/,uc={newCue(a,e,t,s){const i=[];let r,n,o,l,c;const h=self.VTTCue||self.TextTrackCue;for(let d=0;d=16?l--:l++;const g=Fr(c.trim()),f=Os(e,t,g);a!=null&&(u=a.cues)!=null&&u.getCueById(f)||(n=new h(e,t,g),n.id=f,n.line=d+1,n.align="left",n.position=10+Math.min(80,Math.floor(l*8/32)*10),i.push(n))}return a&&i.length&&(i.sort((d,g)=>d.line==="auto"||g.line==="auto"?0:d.line>8&&g.line>8?g.line-d.line:d.line-g.line),i.forEach(d=>rr(a,d))),i}},dc={maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null},Yr=oe(oe({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,preferManagedMediaSource:!0,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,frontBufferFlushThreshold:1/0,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,workerPath:null,enableSoftwareAES:!0,startLevel:void 0,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:Wr,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:Ua,bufferController:Vo,capLevelController:Ms,errorController:Ia,fpsController:Tl,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrEwmaDefaultEstimateMax:5e6,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystems:{},drmSystemOptions:{},requestMediaKeySystemAccessFunc:Hi,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableID3MetadataCues:!0,useMediaCapabilities:!0,certLoadPolicy:{default:dc},keyLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"},errorRetry:{maxNumRetry:8,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"}}},manifestLoadPolicy:{default:{maxTimeToFirstByteMs:1/0,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:2,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},fragLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:12e4,timeoutRetry:{maxNumRetry:4,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:6,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},steeringManifestLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3},fc()),{},{subtitleStreamController:Bo,subtitleTrackController:Go,timelineController:ml,audioStreamController:No,audioTrackController:Uo,emeController:Ye,cmcdController:Zl,contentSteeringController:tc});function fc(){return{cueHandler:uc,enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function gc(a,e){if((e.liveSyncDurationCount||e.liveMaxLatencyDurationCount)&&(e.liveSyncDuration||e.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(e.liveMaxLatencyDurationCount!==void 0&&(e.liveSyncDurationCount===void 0||e.liveMaxLatencyDurationCount<=e.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(e.liveMaxLatencyDuration!==void 0&&(e.liveSyncDuration===void 0||e.liveMaxLatencyDuration<=e.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');const t=ys(a),s=["manifest","level","frag"],i=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return s.forEach(r=>{const n=`${r==="level"?"playlist":r}LoadPolicy`,o=e[n]===void 0,l=[];i.forEach(c=>{const h=`${r}Loading${c}`,u=e[h];if(u!==void 0&&o){l.push(h);const d=t[n].default;switch(e[n]={default:d},c){case"TimeOut":d.maxLoadTimeMs=u,d.maxTimeToFirstByteMs=u;break;case"MaxRetry":d.errorRetry.maxNumRetry=u,d.timeoutRetry.maxNumRetry=u;break;case"RetryDelay":d.errorRetry.retryDelayMs=u,d.timeoutRetry.retryDelayMs=u;break;case"MaxRetryTimeout":d.errorRetry.maxRetryDelayMs=u,d.timeoutRetry.maxRetryDelayMs=u;break}}}),l.length&&v.warn(`hls.js config: "${l.join('", "')}" setting(s) are deprecated, use "${n}": ${JSON.stringify(e[n])}`)}),oe(oe({},t),e)}function ys(a){return a&&typeof a=="object"?Array.isArray(a)?a.map(ys):Object.keys(a).reduce((e,t)=>(e[t]=ys(a[t]),e),{}):a}function mc(a){const e=a.loader;e!==Ui&&e!==Wr?(v.log("[config]: Custom loader detected, cannot enable progressive streaming"),a.progressive=!1):ic()&&(a.loader=Ui,a.progressive=!0,a.enableSoftwareAES=!0,v.log("[config]: Progressive streaming enabled, using FetchLoader"))}let rs;class pc extends Rs{constructor(e,t){super(e,"[level-controller]"),this._levels=[],this._firstLevel=-1,this._maxAutoLevel=-1,this._startLevel=void 0,this.currentLevel=null,this.currentLevelIndex=-1,this.manualLevelIndex=-1,this.steering=void 0,this.onParsedComplete=void 0,this.steering=t,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(p.MANIFEST_LOADING,this.onManifestLoading,this),e.on(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(p.LEVEL_LOADED,this.onLevelLoaded,this),e.on(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(p.FRAG_BUFFERED,this.onFragBuffered,this),e.on(p.ERROR,this.onError,this)}_unregisterListeners(){const{hls:e}=this;e.off(p.MANIFEST_LOADING,this.onManifestLoading,this),e.off(p.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(p.LEVEL_LOADED,this.onLevelLoaded,this),e.off(p.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(p.FRAG_BUFFERED,this.onFragBuffered,this),e.off(p.ERROR,this.onError,this)}destroy(){this._unregisterListeners(),this.steering=null,this.resetLevels(),super.destroy()}stopLoad(){this._levels.forEach(t=>{t.loadError=0,t.fragmentError=0}),super.stopLoad()}resetLevels(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[],this._maxAutoLevel=-1}onManifestLoading(e,t){this.resetLevels()}onManifestLoaded(e,t){const s=this.hls.config.preferManagedMediaSource,i=[],r={},n={};let o=!1,l=!1,c=!1;t.levels.forEach(h=>{var u,d;const g=h.attrs;let{audioCodec:f,videoCodec:m}=h;((u=f)==null?void 0:u.indexOf("mp4a.40.34"))!==-1&&(rs||(rs=/chrome|firefox/i.test(navigator.userAgent)),rs&&(h.audioCodec=f=void 0)),f&&(h.audioCodec=f=Rt(f,s)),((d=m)==null?void 0:d.indexOf("avc1"))===0&&(m=h.videoCodec=ta(m));const{width:T,height:E,unknownCodecs:x}=h;if(o||(o=!!(T&&E)),l||(l=!!m),c||(c=!!f),x!=null&&x.length||f&&!Vt(f,"audio",s)||m&&!Vt(m,"video",s))return;const{CODECS:y,"FRAME-RATE":I,"HDCP-LEVEL":S,"PATHWAY-ID":D,RESOLUTION:R,"VIDEO-RANGE":_}=g,b=`${`${D||"."}-`}${h.bitrate}-${R}-${I}-${y}-${_}-${S}`;if(r[b])if(r[b].uri!==h.url&&!h.attrs["PATHWAY-ID"]){const w=n[b]+=1;h.attrs["PATHWAY-ID"]=new Array(w+1).join(".");const V=new je(h);r[b]=V,i.push(V)}else r[b].addGroupId("audio",g.AUDIO),r[b].addGroupId("text",g.SUBTITLES);else{const w=new je(h);r[b]=w,n[b]=1,i.push(w)}}),this.filterAndSortMediaOptions(i,t,o,l,c)}filterAndSortMediaOptions(e,t,s,i,r){let n=[],o=[],l=e;if((s||i)&&r&&(l=l.filter(({videoCodec:f,videoRange:m,width:T,height:E})=>(!!f||!!(T&&E))&&ga(m))),l.length===0){Promise.resolve().then(()=>{if(this.hls){t.levels.length&&this.warn(`One or more CODECS in variant not supported: ${JSON.stringify(t.levels[0].attrs)}`);const f=new Error("no level with compatible codecs found in manifest");this.hls.trigger(p.ERROR,{type:$.MEDIA_ERROR,details:L.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:f,reason:f.message})}});return}if(t.audioTracks){const{preferManagedMediaSource:f}=this.hls.config;n=t.audioTracks.filter(m=>!m.audioCodec||Vt(m.audioCodec,"audio",f)),Bi(n)}t.subtitles&&(o=t.subtitles,Bi(o));const c=l.slice(0);l.sort((f,m)=>{if(f.attrs["HDCP-LEVEL"]!==m.attrs["HDCP-LEVEL"])return(f.attrs["HDCP-LEVEL"]||"")>(m.attrs["HDCP-LEVEL"]||"")?1:-1;if(s&&f.height!==m.height)return f.height-m.height;if(f.frameRate!==m.frameRate)return f.frameRate-m.frameRate;if(f.videoRange!==m.videoRange)return It.indexOf(f.videoRange)-It.indexOf(m.videoRange);if(f.videoCodec!==m.videoCodec){const T=Ys(f.videoCodec),E=Ys(m.videoCodec);if(T!==E)return E-T}if(f.uri===m.uri&&f.codecSet!==m.codecSet){const T=Lt(f.codecSet),E=Lt(m.codecSet);if(T!==E)return E-T}return f.averageBitrate!==m.averageBitrate?f.averageBitrate-m.averageBitrate:0});let h=c[0];if(this.steering&&(l=this.steering.filterParsedLevels(l),l.length!==c.length)){for(let f=0;fT&&T===Yr.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=E)}break}const d=r&&!i,g={levels:l,audioTracks:n,subtitleTracks:o,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:r,video:i,altAudio:!d&&n.some(f=>!!f.url)};this.hls.trigger(p.MANIFEST_PARSED,g),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}get levels(){return this._levels.length===0?null:this._levels}get level(){return this.currentLevelIndex}set level(e){const t=this._levels;if(t.length===0)return;if(e<0||e>=t.length){const h=new Error("invalid level idx"),u=e<0;if(this.hls.trigger(p.ERROR,{type:$.OTHER_ERROR,details:L.LEVEL_SWITCH_ERROR,level:e,fatal:u,error:h,reason:h.message}),u)return;e=Math.min(e,t.length-1)}const s=this.currentLevelIndex,i=this.currentLevel,r=i?i.attrs["PATHWAY-ID"]:void 0,n=t[e],o=n.attrs["PATHWAY-ID"];if(this.currentLevelIndex=e,this.currentLevel=n,s===e&&n.details&&i&&r===o)return;this.log(`Switching to level ${e} (${n.height?n.height+"p ":""}${n.videoRange?n.videoRange+" ":""}${n.codecSet?n.codecSet+" ":""}@${n.bitrate})${o?" with Pathway "+o:""} from level ${s}${r?" with Pathway "+r:""}`);const l={level:e,attrs:n.attrs,details:n.details,bitrate:n.bitrate,averageBitrate:n.averageBitrate,maxBitrate:n.maxBitrate,realBitrate:n.realBitrate,width:n.width,height:n.height,codecSet:n.codecSet,audioCodec:n.audioCodec,videoCodec:n.videoCodec,audioGroups:n.audioGroups,subtitleGroups:n.subtitleGroups,loaded:n.loaded,loadError:n.loadError,fragmentError:n.fragmentError,name:n.name,id:n.id,uri:n.uri,url:n.url,urlId:0,audioGroupIds:n.audioGroupIds,textGroupIds:n.textGroupIds};this.hls.trigger(p.LEVEL_SWITCHING,l);const c=n.details;if(!c||c.live){const h=this.switchParams(n.uri,i==null?void 0:i.details,c);this.loadPlaylist(h)}}get manualLevel(){return this.manualLevelIndex}set manualLevel(e){this.manualLevelIndex=e,this._startLevel===void 0&&(this._startLevel=e),e!==-1&&(this.level=e)}get firstLevel(){return this._firstLevel}set firstLevel(e){this._firstLevel=e}get startLevel(){if(this._startLevel===void 0){const e=this.hls.config.startLevel;return e!==void 0?e:this.hls.firstAutoLevel}return this._startLevel}set startLevel(e){this._startLevel=e}onError(e,t){t.fatal||!t.context||t.context.type===Y.LEVEL&&t.context.level===this.level&&this.checkRetry(t)}onFragBuffered(e,{frag:t}){if(t!==void 0&&t.type===U.MAIN){const s=t.elementaryStreams;if(!Object.keys(s).some(r=>!!s[r]))return;const i=this._levels[t.level];i!=null&&i.loadError&&(this.log(`Resetting level error count of ${i.loadError} on frag buffered`),i.loadError=0)}}onLevelLoaded(e,t){var s;const{level:i,details:r}=t,n=this._levels[i];if(!n){var o;this.warn(`Invalid level index ${i}`),(o=t.deliveryDirectives)!=null&&o.skip&&(r.deltaUpdateFailed=!0);return}i===this.currentLevelIndex?(n.fragmentError===0&&(n.loadError=0),this.playlistLoaded(i,t,n.details)):(s=t.deliveryDirectives)!=null&&s.skip&&(r.deltaUpdateFailed=!0)}loadPlaylist(e){super.loadPlaylist();const t=this.currentLevelIndex,s=this.currentLevel;if(s&&this.shouldLoadPlaylist(s)){let i=s.uri;if(e)try{i=e.addDirectives(i)}catch(n){this.warn(`Could not construct new URL with HLS Delivery Directives: ${n}`)}const r=s.attrs["PATHWAY-ID"];this.log(`Loading level index ${t}${(e==null?void 0:e.msn)!==void 0?" at sn "+e.msn+" part "+e.part:""} with${r?" Pathway "+r:""} ${i}`),this.clearTimer(),this.hls.trigger(p.LEVEL_LOADING,{url:i,level:t,pathwayId:s.attrs["PATHWAY-ID"],id:0,deliveryDirectives:e||null})}}get nextLoadLevel(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel}set nextLoadLevel(e){this.level=e,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=e)}removeLevel(e){var t;const s=this._levels.filter((i,r)=>r!==e?!0:(this.steering&&this.steering.removeLevel(i),i===this.currentLevel&&(this.currentLevel=null,this.currentLevelIndex=-1,i.details&&i.details.fragments.forEach(n=>n.level=-1)),!1));lr(s),this._levels=s,this.currentLevelIndex>-1&&(t=this.currentLevel)!=null&&t.details&&(this.currentLevelIndex=this.currentLevel.details.fragments[0].level),this.hls.trigger(p.LEVELS_UPDATED,{levels:s})}onLevelsUpdated(e,{levels:t}){this._levels=t}checkMaxAutoUpdated(){const{autoLevelCapping:e,maxAutoLevel:t,maxHdcpLevel:s}=this.hls;this._maxAutoLevel!==t&&(this._maxAutoLevel=t,this.hls.trigger(p.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:e,levels:this.levels,maxAutoLevel:t,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:s}))}}function Bi(a){const e={};a.forEach(t=>{const s=t.groupId||"";t.id=e[s]=e[s]||0,e[s]++})}class Tc{constructor(e){this.config=void 0,this.keyUriToKeyInfo={},this.emeController=null,this.config=e}abort(e){for(const s in this.keyUriToKeyInfo){const i=this.keyUriToKeyInfo[s].loader;if(i){var t;if(e&&e!==((t=i.context)==null?void 0:t.frag.type))return;i.abort()}}}detach(){for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e];(t.mediaKeySessionContext||t.decryptdata.isCommonEncryption)&&delete this.keyUriToKeyInfo[e]}}destroy(){this.detach();for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e].loader;t&&t.destroy()}this.keyUriToKeyInfo={}}createKeyLoadError(e,t=L.KEY_LOAD_ERROR,s,i,r){return new Ce({type:$.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:r,error:s,networkDetails:i})}loadClear(e,t){if(this.emeController&&this.config.emeEnabled){const{sn:s,cc:i}=e;for(let r=0;r{n.setKeyFormat(o)});break}}}}load(e){return!e.decryptdata&&e.encrypted&&this.emeController?this.emeController.selectKeySystemFormat(e).then(t=>this.loadInternal(e,t)):this.loadInternal(e)}loadInternal(e,t){var s,i;t&&e.setKeyFormat(t);const r=e.decryptdata;if(!r){const c=new Error(t?`Expected frag.decryptdata to be defined after setting format ${t}`:"Missing decryption data on fragment in onKeyLoading");return Promise.reject(this.createKeyLoadError(e,L.KEY_LOAD_ERROR,c))}const n=r.uri;if(!n)return Promise.reject(this.createKeyLoadError(e,L.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${n}"`)));let o=this.keyUriToKeyInfo[n];if((s=o)!=null&&s.decryptdata.key)return r.key=o.decryptdata.key,Promise.resolve({frag:e,keyInfo:o});if((i=o)!=null&&i.keyLoadPromise){var l;switch((l=o.mediaKeySessionContext)==null?void 0:l.keyStatus){case void 0:case"status-pending":case"usable":case"usable-in-future":return o.keyLoadPromise.then(c=>(r.key=c.keyInfo.decryptdata.key,{frag:e,keyInfo:o}))}}switch(o=this.keyUriToKeyInfo[n]={decryptdata:r,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},r.method){case"ISO-23001-7":case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return r.keyFormat==="identity"?this.loadKeyHTTP(o,e):this.loadKeyEME(o,e);case"AES-128":return this.loadKeyHTTP(o,e);default:return Promise.reject(this.createKeyLoadError(e,L.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${r.method}"`)))}}loadKeyEME(e,t){const s={frag:t,keyInfo:e};if(this.emeController&&this.config.emeEnabled){const i=this.emeController.loadKey(s);if(i)return(e.keyLoadPromise=i.then(r=>(e.mediaKeySessionContext=r,s))).catch(r=>{throw e.keyLoadPromise=null,r})}return Promise.resolve(s)}loadKeyHTTP(e,t){const s=this.config,i=s.loader,r=new i(s);return t.keyLoader=e.loader=r,e.keyLoadPromise=new Promise((n,o)=>{const l={keyInfo:e,frag:t,responseType:"arraybuffer",url:e.decryptdata.uri},c=s.keyLoadPolicy.default,h={loadPolicy:c,timeout:c.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},u={onSuccess:(d,g,f,m)=>{const{frag:T,keyInfo:E,url:x}=f;if(!T.decryptdata||E!==this.keyUriToKeyInfo[x])return o(this.createKeyLoadError(T,L.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),m));E.decryptdata.key=T.decryptdata.key=new Uint8Array(d.data),T.keyLoader=null,E.loader=null,n({frag:T,keyInfo:E})},onError:(d,g,f,m)=>{this.resetLoader(g),o(this.createKeyLoadError(t,L.KEY_LOAD_ERROR,new Error(`HTTP Error ${d.code} loading key ${d.text}`),f,oe({url:l.url,data:void 0},d)))},onTimeout:(d,g,f)=>{this.resetLoader(g),o(this.createKeyLoadError(t,L.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),f))},onAbort:(d,g,f)=>{this.resetLoader(g),o(this.createKeyLoadError(t,L.INTERNAL_ABORTED,new Error("key loading aborted"),f))}};r.load(l,h,u)})}resetLoader(e){const{frag:t,keyInfo:s,url:i}=e,r=s.loader;t.keyLoader===r&&(t.keyLoader=null,s.loader=null),delete this.keyUriToKeyInfo[i],r&&r.destroy()}}function qr(){return self.SourceBuffer||self.WebKitSourceBuffer}function jr(){if(!Ue())return!1;const e=qr();return!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function"}function Ec(){if(!jr())return!1;const a=Ue();return typeof(a==null?void 0:a.isTypeSupported)=="function"&&(["avc1.42E01E,mp4a.40.2","av01.0.01M.08","vp09.00.50.08"].some(e=>a.isTypeSupported(st(e,"video")))||["mp4a.40.2","fLaC"].some(e=>a.isTypeSupported(st(e,"audio"))))}function yc(){var a;const e=qr();return typeof(e==null||(a=e.prototype)==null?void 0:a.changeType)=="function"}const xc=250,St=2,Sc=.1,vc=.05;class Ac{constructor(e,t,s,i){this.config=void 0,this.media=null,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=e,this.media=t,this.fragmentTracker=s,this.hls=i}destroy(){this.media=null,this.hls=this.fragmentTracker=null}poll(e,t){const{config:s,media:i,stalled:r}=this;if(i===null)return;const{currentTime:n,seeking:o}=i,l=this.seeking&&!o,c=!this.seeking&&o;if(this.seeking=o,n!==e){if(this.moved=!0,o||(this.nudgeRetry=0),r!==null){if(this.stallReported){const T=self.performance.now()-r;v.warn(`playback not stuck anymore @${n}, after ${Math.round(T)}ms`),this.stallReported=!1}this.stalled=null}return}if(c||l){this.stalled=null;return}if(i.paused&&!o||i.ended||i.playbackRate===0||!J.getBuffered(i).length){this.nudgeRetry=0;return}const h=J.bufferInfo(i,n,0),u=h.nextStart||0;if(o){const T=h.len>St,E=!u||t&&t.start<=n||u-n>St&&!this.fragmentTracker.getPartialFragment(n);if(T||E)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var d;if(!(h.len>0)&&!u)return;const E=Math.max(u,h.start||0)-n,x=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,I=(x==null||(d=x.details)==null?void 0:d.live)?x.details.targetduration*2:St,S=this.fragmentTracker.getPartialFragment(n);if(E>0&&(E<=I||S)){i.paused||this._trySkipBufferHole(S);return}}const g=self.performance.now();if(r===null){this.stalled=g;return}const f=g-r;if(!o&&f>=xc&&(this._reportStall(h),!this.media))return;const m=J.bufferInfo(i,n,s.maxBufferHole);this._tryFixBufferStall(m,f)}_tryFixBufferStall(e,t){const{config:s,fragmentTracker:i,media:r}=this;if(r===null)return;const n=r.currentTime,o=i.getPartialFragment(n);o&&(this._trySkipBufferHole(o)||!this.media)||(e.len>s.maxBufferHole||e.nextStart&&e.nextStart-ns.highBufferWatchdogPeriod*1e3&&(v.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())}_reportStall(e){const{hls:t,media:s,stallReported:i}=this;if(!i&&s){this.stallReported=!0;const r=new Error(`Playback stalling at @${s.currentTime} due to low buffer (${JSON.stringify(e)})`);v.warn(r.message),t.trigger(p.ERROR,{type:$.MEDIA_ERROR,details:L.BUFFER_STALLED_ERROR,fatal:!1,error:r,buffer:e.len})}}_trySkipBufferHole(e){const{config:t,hls:s,media:i}=this;if(i===null)return 0;const r=i.currentTime,n=J.bufferInfo(i,r,0),o=r0&&n.len<1&&i.readyState<3,h=o-r;if(h>0&&(l||c)){if(h>t.maxBufferHole){const{fragmentTracker:d}=this;let g=!1;if(r===0){const f=d.getAppendedFrag(0,U.MAIN);f&&o1?(i=0,this.bitrateTest=!0):i=s.firstAutoLevel),s.nextLoadLevel=i,this.level=s.loadLevel,this.loadedmetadata=!1}t>0&&e===-1&&(this.log(`Override startPosition with lastCurrentTime @${t.toFixed(3)}`),e=t),this.state=C.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}else this._forceStartLoad=!0,this.state=C.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case C.WAITING_LEVEL:{const{levels:t,level:s}=this,i=t==null?void 0:t[s],r=i==null?void 0:i.details;if(r&&(!r.live||this.levelLastLoaded===i)){if(this.waitForCdnTuneIn(r))break;this.state=C.IDLE;break}else if(this.hls.nextLoadLevel!==this.level){this.state=C.IDLE;break}break}case C.FRAG_LOADING_WAITING_RETRY:{var e;const t=self.performance.now(),s=this.retryDate;if(!s||t>=s||(e=this.media)!=null&&e.seeking){const{levels:i,level:r}=this,n=i==null?void 0:i[r];this.resetStartWhenNotLoaded(n||null),this.state=C.IDLE}}break}this.state===C.IDLE&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){super.onTickEnd(),this.checkBuffer(),this.checkFragmentChanged()}doTickIdle(){const{hls:e,levelLastLoaded:t,levels:s,media:i}=this;if(t===null||!i&&(this.startFragRequested||!e.config.startFragPrefetch)||this.altAudio&&this.audioOnly)return;const r=e.nextLoadLevel;if(!(s!=null&&s[r]))return;const n=s[r],o=this.getMainFwdBufferInfo();if(o===null)return;const l=this.getLevelDetails();if(l&&this._streamEnded(o,l)){const m={};this.altAudio&&(m.type="video"),this.hls.trigger(p.BUFFER_EOS,m),this.state=C.ENDED;return}e.loadLevel!==r&&e.manualLevel===-1&&this.log(`Adapting to level ${r} from level ${this.level}`),this.level=e.nextLoadLevel=r;const c=n.details;if(!c||this.state===C.WAITING_LEVEL||c.live&&this.levelLastLoaded!==n){this.level=r,this.state=C.WAITING_LEVEL;return}const h=o.len,u=this.getMaxBufferLength(n.maxBitrate);if(h>=u)return;this.backtrackFragment&&this.backtrackFragment.start>o.end&&(this.backtrackFragment=null);const d=this.backtrackFragment?this.backtrackFragment.start:o.end;let g=this.getNextFragment(d,c);if(this.couldBacktrack&&!this.fragPrevious&&g&&g.sn!=="initSegment"&&this.fragmentTracker.getState(g)!==ae.OK){var f;const T=((f=this.backtrackFragment)!=null?f:g).sn-c.startSN,E=c.fragments[T-1];E&&g.cc===E.cc&&(g=E,this.fragmentTracker.removeFragment(E))}else this.backtrackFragment&&o.len&&(this.backtrackFragment=null);if(g&&this.isLoopLoading(g,d)){if(!g.gap){const T=this.audioOnly&&!this.altAudio?X.AUDIO:X.VIDEO,E=(T===X.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;E&&this.afterBufferFlushed(E,T,U.MAIN)}g=this.getNextFragmentLoopLoading(g,c,o,U.MAIN,u)}g&&(g.initSegment&&!g.initSegment.data&&!this.bitrateTest&&(g=g.initSegment),this.loadFragment(g,n,d))}loadFragment(e,t,s){const i=this.fragmentTracker.getState(e);this.fragCurrent=e,i===ae.NOT_LOADED||i===ae.PARTIAL?e.sn==="initSegment"?this._loadInitSegment(e,t):this.bitrateTest?(this.log(`Fragment ${e.sn} of level ${e.level} is being downloaded to test bitrate and will not be buffered`),this._loadBitrateTestFrag(e,t)):(this.startFragRequested=!0,super.loadFragment(e,t,s)):this.clearTrackerIfNeeded(e)}getBufferedFrag(e){return this.fragmentTracker.getBufferedFrag(e,U.MAIN)}followingBufferedFrag(e){return e?this.getBufferedFrag(e.end+.5):null}immediateLevelSwitch(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}nextLevelSwitch(){const{levels:e,media:t}=this;if(t!=null&&t.readyState){let s;const i=this.getAppendedFrag(t.currentTime);i&&i.start>1&&this.flushMainBuffer(0,i.start-1);const r=this.getLevelDetails();if(r!=null&&r.live){const o=this.getMainFwdBufferInfo();if(!o||o.len{const n=r.audioCodec;n&&(s=s||n.indexOf("mp4a.40.2")!==-1,i=i||n.indexOf("mp4a.40.5")!==-1)}),this.audioCodecSwitch=s&&i&&!yc(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=t.levels,this.startFragRequested=!1}onLevelLoading(e,t){const{levels:s}=this;if(!s||this.state!==C.IDLE)return;const i=s[t.level];(!i.details||i.details.live&&this.levelLastLoaded!==i||this.waitForCdnTuneIn(i.details))&&(this.state=C.WAITING_LEVEL)}onLevelLoaded(e,t){var s;const{levels:i}=this,r=t.level,n=t.details,o=n.totalduration;if(!i){this.warn(`Levels were reset while loading level ${r}`);return}this.log(`Level ${r} loaded [${n.startSN},${n.endSN}]${n.lastPartSn?`[part-${n.lastPartSn}-${n.lastPartIndex}]`:""}, cc [${n.startCC}, ${n.endCC}] duration:${o}`);const l=i[r],c=this.fragCurrent;c&&(this.state===C.FRAG_LOADING||this.state===C.FRAG_LOADING_WAITING_RETRY)&&c.level!==t.level&&c.loader&&this.abortCurrentFrag();let h=0;if(n.live||(s=l.details)!=null&&s.live){var u;if(this.checkLiveUpdate(n),n.deltaUpdateFailed)return;h=this.alignPlaylists(n,l.details,(u=this.levelLastLoaded)==null?void 0:u.details)}if(l.details=n,this.levelLastLoaded=l,this.hls.trigger(p.LEVEL_UPDATED,{details:n,level:r}),this.state===C.WAITING_LEVEL){if(this.waitForCdnTuneIn(n))return;this.state=C.IDLE}this.startFragRequested?n.live&&this.synchronizeToLiveEdge(n):this.setStartPosition(n,h),this.tick()}_handleFragmentLoadProgress(e){var t;const{frag:s,part:i,payload:r}=e,{levels:n}=this;if(!n){this.warn(`Levels were reset while fragment load was in progress. Fragment ${s.sn} of level ${s.level} will not be buffered`);return}const o=n[s.level],l=o.details;if(!l){this.warn(`Dropping fragment ${s.sn} of level ${s.level} after level details were reset`),this.fragmentTracker.removeFragment(s);return}const c=o.videoCodec,h=l.PTSKnown||!l.live,u=(t=s.initSegment)==null?void 0:t.data,d=this._getAudioCodec(o),g=this.transmuxer=this.transmuxer||new Dr(this.hls,U.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),f=i?i.index:-1,m=f!==-1,T=new Is(s.level,s.sn,s.stats.chunkCount,r.byteLength,f,m),E=this.initPTS[s.cc];g.push(r,u,d,c,s,i,l.totalduration,h,T,E)}onAudioTrackSwitching(e,t){const s=this.altAudio;if(!!!t.url){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;const n=this.fragCurrent;n&&(this.log("Switching to main audio track, cancel main fragment load"),n.abortRequests(),this.fragmentTracker.removeFragment(n)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();const r=this.hls;s&&(r.trigger(p.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null}),this.fragmentTracker.removeAllFragments()),r.trigger(p.AUDIO_TRACK_SWITCHED,t)}}onAudioTrackSwitched(e,t){const s=t.id,i=!!this.hls.audioTracks[s].url;if(i){const r=this.videoBuffer;r&&this.mediaBuffer!==r&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=r)}this.altAudio=i,this.tick()}onBufferCreated(e,t){const s=t.tracks;let i,r,n=!1;for(const o in s){const l=s[o];if(l.id==="main"){if(r=o,i=l,o==="video"){const c=s[o];c&&(this.videoBuffer=c.buffer)}}else n=!0}n&&i?(this.log(`Alternate track found, use ${r}.buffered to schedule main fragment loading`),this.mediaBuffer=i.buffer):this.mediaBuffer=this.media}onFragBuffered(e,t){const{frag:s,part:i}=t;if(s&&s.type!==U.MAIN)return;if(this.fragContextChanged(s)){this.warn(`Fragment ${s.sn}${i?" p: "+i.index:""} of level ${s.level} finished buffering, but was aborted. state: ${this.state}`),this.state===C.PARSED&&(this.state=C.IDLE);return}const r=i?i.stats:s.stats;this.fragLastKbps=Math.round(8*r.total/(r.buffering.end-r.loading.first)),s.sn!=="initSegment"&&(this.fragPrevious=s),this.fragBufferedComplete(s,i)}onError(e,t){var s;if(t.fatal){this.state=C.ERROR;return}switch(t.details){case L.FRAG_GAP:case L.FRAG_PARSING_ERROR:case L.FRAG_DECRYPT_ERROR:case L.FRAG_LOAD_ERROR:case L.FRAG_LOAD_TIMEOUT:case L.KEY_LOAD_ERROR:case L.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(U.MAIN,t);break;case L.LEVEL_LOAD_ERROR:case L.LEVEL_LOAD_TIMEOUT:case L.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===C.WAITING_LEVEL&&((s=t.context)==null?void 0:s.type)===Y.LEVEL&&(this.state=C.IDLE);break;case L.BUFFER_APPEND_ERROR:case L.BUFFER_FULL_ERROR:if(!t.parent||t.parent!=="main")return;if(t.details===L.BUFFER_APPEND_ERROR){this.resetLoadingState();return}this.reduceLengthAndFlushBuffer(t)&&this.flushMainBuffer(0,Number.POSITIVE_INFINITY);break;case L.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}checkBuffer(){const{media:e,gapController:t}=this;if(!(!e||!t||!e.readyState)){if(this.loadedmetadata||!J.getBuffered(e).length){const s=this.state!==C.IDLE?this.fragCurrent:null;t.poll(this.lastCurrentTime,s)}this.lastCurrentTime=e.currentTime}}onFragLoadEmergencyAborted(){this.state=C.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()}onBufferFlushed(e,{type:t}){if(t!==X.AUDIO||this.audioOnly&&!this.altAudio){const s=(t===X.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(s,t,U.MAIN),this.tick()}}onLevelsUpdated(e,t){this.level>-1&&this.fragCurrent&&(this.level=this.fragCurrent.level),this.levels=t.levels}swapAudioCodec(){this.audioCodecSwap=!this.audioCodecSwap}seekToStartPos(){const{media:e}=this;if(!e)return;const t=e.currentTime;let s=this.startPosition;if(s>=0&&t0&&(n{const{hls:i}=this;if(!s||this.fragContextChanged(e))return;t.fragmentError=0,this.state=C.IDLE,this.startFragRequested=!1,this.bitrateTest=!1;const r=e.stats;r.parsing.start=r.parsing.end=r.buffering.start=r.buffering.end=self.performance.now(),i.trigger(p.FRAG_LOADED,s),e.bitrateTest=!1})}_handleTransmuxComplete(e){var t;const s="main",{hls:i}=this,{remuxResult:r,chunkMeta:n}=e,o=this.getCurrentContext(n);if(!o){this.resetWhenMissingContext(n);return}const{frag:l,part:c,level:h}=o,{video:u,text:d,id3:g,initSegment:f}=r,{details:m}=h,T=this.altAudio?void 0:r.audio;if(this.fragContextChanged(l)){this.fragmentTracker.removeFragment(l);return}if(this.state=C.PARSING,f){if(f!=null&&f.tracks){const y=l.initSegment||l;this._bufferInitSegment(h,f.tracks,y,n),i.trigger(p.FRAG_PARSING_INIT_SEGMENT,{frag:y,id:s,tracks:f.tracks})}const E=f.initPTS,x=f.timescale;O(E)&&(this.initPTS[l.cc]={baseTime:E,timescale:x},i.trigger(p.INIT_PTS_FOUND,{frag:l,id:s,initPTS:E,timescale:x}))}if(u&&m&&l.sn!=="initSegment"){const E=m.fragments[l.sn-1-m.startSN],x=l.sn===m.startSN,y=!E||l.cc>E.cc;if(r.independent!==!1){const{startPTS:I,endPTS:S,startDTS:D,endDTS:R}=u;if(c)c.elementaryStreams[u.type]={startPTS:I,endPTS:S,startDTS:D,endDTS:R};else if(u.firstKeyFrame&&u.independent&&n.id===1&&!y&&(this.couldBacktrack=!0),u.dropped&&u.independent){const _=this.getMainFwdBufferInfo(),k=(_?_.end:this.getLoadPosition())+this.config.maxBufferHole,b=u.firstKeyFramePTS?u.firstKeyFramePTS:I;if(!x&&kSt&&(l.gap=!0);l.setElementaryStreamInfo(u.type,I,S,D,R),this.backtrackFragment&&(this.backtrackFragment=l),this.bufferFragmentData(u,l,c,n,x||y)}else if(x||y)l.gap=!0;else{this.backtrack(l);return}}if(T){const{startPTS:E,endPTS:x,startDTS:y,endDTS:I}=T;c&&(c.elementaryStreams[X.AUDIO]={startPTS:E,endPTS:x,startDTS:y,endDTS:I}),l.setElementaryStreamInfo(X.AUDIO,E,x,y,I),this.bufferFragmentData(T,l,c,n)}if(m&&g!=null&&(t=g.samples)!=null&&t.length){const E={id:s,frag:l,details:m,samples:g.samples};i.trigger(p.FRAG_PARSING_METADATA,E)}if(m&&d){const E={id:s,frag:l,details:m,samples:d.samples};i.trigger(p.FRAG_PARSING_USERDATA,E)}}_bufferInitSegment(e,t,s,i){if(this.state!==C.PARSING)return;this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&delete t.audio;const{audio:r,video:n,audiovideo:o}=t;if(r){let l=e.audioCodec;const c=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){l&&(l.indexOf("mp4a.40.5")!==-1?l="mp4a.40.2":l="mp4a.40.5");const h=r.metadata;h&&"channelCount"in h&&(h.channelCount||1)!==1&&c.indexOf("firefox")===-1&&(l="mp4a.40.5")}l&&l.indexOf("mp4a.40.5")!==-1&&c.indexOf("android")!==-1&&r.container!=="audio/mpeg"&&(l="mp4a.40.2",this.log(`Android: force audio codec to ${l}`)),e.audioCodec&&e.audioCodec!==l&&this.log(`Swapping manifest audio codec "${e.audioCodec}" for "${l}"`),r.levelCodec=l,r.id="main",this.log(`Init audio buffer, container:${r.container}, codecs[selected/level/parsed]=[${l||""}/${e.audioCodec||""}/${r.codec}]`)}n&&(n.levelCodec=e.videoCodec,n.id="main",this.log(`Init video buffer, container:${n.container}, codecs[level/parsed]=[${e.videoCodec||""}/${n.codec}]`)),o&&this.log(`Init audiovideo buffer, container:${o.container}, codecs[level/parsed]=[${e.codecs}/${o.codec}]`),this.hls.trigger(p.BUFFER_CODECS,t),Object.keys(t).forEach(l=>{const h=t[l].initSegment;h!=null&&h.byteLength&&this.hls.trigger(p.BUFFER_APPENDING,{type:l,data:h,frag:s,part:null,chunkMeta:i,parent:s.type})}),this.tickImmediate()}getMainFwdBufferInfo(){return this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,U.MAIN)}backtrack(e){this.couldBacktrack=!0,this.backtrackFragment=e,this.resetTransmuxer(),this.flushBufferGap(e),this.fragmentTracker.removeFragment(e),this.fragPrevious=null,this.nextLoadPosition=e.start,this.state=C.IDLE}checkFragmentChanged(){const e=this.media;let t=null;if(e&&e.readyState>1&&e.seeking===!1){const s=e.currentTime;if(J.isBuffered(e,s)?t=this.getAppendedFrag(s):J.isBuffered(e,s+.1)&&(t=this.getAppendedFrag(s+.1)),t){this.backtrackFragment=null;const i=this.fragPlaying,r=t.level;(!i||t.sn!==i.sn||i.level!==r)&&(this.fragPlaying=t,this.hls.trigger(p.FRAG_CHANGED,{frag:t}),(!i||i.level!==r)&&this.hls.trigger(p.LEVEL_SWITCHED,{level:r}))}}}get nextLevel(){const e=this.nextBufferedFrag;return e?e.level:-1}get currentFrag(){const e=this.media;return e?this.fragPlaying||this.getAppendedFrag(e.currentTime):null}get currentProgramDateTime(){const e=this.media;if(e){const t=e.currentTime,s=this.currentFrag;if(s&&O(t)&&O(s.programDateTime)){const i=s.programDateTime+(t-s.start)*1e3;return new Date(i)}}return null}get currentLevel(){const e=this.currentFrag;return e?e.level:-1}get nextBufferedFrag(){const e=this.currentFrag;return e?this.followingBufferedFrag(e):null}get forceStartLoad(){return this._forceStartLoad}}class we{static get version(){return"1.5.14"}static isMSESupported(){return jr()}static isSupported(){return Ec()}static getMediaSource(){return Ue()}static get Events(){return p}static get ErrorTypes(){return $}static get ErrorDetails(){return L}static get DefaultConfig(){return we.defaultConfig?we.defaultConfig:Yr}static set DefaultConfig(e){we.defaultConfig=e}constructor(e={}){this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this.started=!1,this._emitter=new Ps,this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null,this.triggeringException=void 0,dn(e.debug||!1,"Hls instance");const t=this.config=gc(we.DefaultConfig,e);this.userConfig=e,t.progressive&&mc(t);const{abrController:s,bufferController:i,capLevelController:r,errorController:n,fpsController:o}=t,l=new n(this),c=this.abrController=new s(this),h=this.bufferController=new i(this),u=this.capLevelController=new r(this),d=new o(this),g=new aa(this),f=new ua(this),m=t.contentSteeringController,T=m?new m(this):null,E=this.levelController=new pc(this,T),x=new $a(this),y=new Tc(this.config),I=this.streamController=new Rc(this,x,y);u.setStreamController(I),d.setStreamController(I);const S=[g,E,I];T&&S.splice(1,0,T),this.networkControllers=S;const D=[c,h,u,d,f,x];this.audioTrackController=this.createController(t.audioTrackController,S);const R=t.audioStreamController;R&&S.push(new R(this,x,y)),this.subtitleTrackController=this.createController(t.subtitleTrackController,S);const _=t.subtitleStreamController;_&&S.push(new _(this,x,y)),this.createController(t.timelineController,D),y.emeController=this.emeController=this.createController(t.emeController,D),this.cmcdController=this.createController(t.cmcdController,D),this.latencyController=this.createController(da,D),this.coreComponents=D,S.push(l);const k=l.onErrorOut;typeof k=="function"&&this.on(p.ERROR,k,l)}createController(e,t){if(e){const s=new e(this);return t&&t.push(s),s}return null}on(e,t,s=this){this._emitter.on(e,t,s)}once(e,t,s=this){this._emitter.once(e,t,s)}removeAllListeners(e){this._emitter.removeAllListeners(e)}off(e,t,s=this,i){this._emitter.off(e,t,s,i)}listeners(e){return this._emitter.listeners(e)}emit(e,t,s){return this._emitter.emit(e,t,s)}trigger(e,t){if(this.config.debug)return this.emit(e,e,t);try{return this.emit(e,e,t)}catch(s){if(v.error("An internal error happened while handling event "+e+'. Error message: "'+s.message+'". Here is a stacktrace:',s),!this.triggeringException){this.triggeringException=!0;const i=e===p.ERROR;this.trigger(p.ERROR,{type:$.OTHER_ERROR,details:L.INTERNAL_EXCEPTION,fatal:i,event:e,error:s}),this.triggeringException=!1}}return!1}listenerCount(e){return this._emitter.listenerCount(e)}destroy(){v.log("destroy"),this.trigger(p.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(t=>t.destroy()),this.networkControllers.length=0,this.coreComponents.forEach(t=>t.destroy()),this.coreComponents.length=0;const e=this.config;e.xhrSetup=e.fetchSetup=void 0,this.userConfig=null}attachMedia(e){v.log("attachMedia"),this._media=e,this.trigger(p.MEDIA_ATTACHING,{media:e})}detachMedia(){v.log("detachMedia"),this.trigger(p.MEDIA_DETACHING,void 0),this._media=null}loadSource(e){this.stopLoad();const t=this.media,s=this.url,i=this.url=xs.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,v.log(`loadSource:${i}`),t&&s&&(s!==i||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(t)),this.trigger(p.MANIFEST_LOADING,{url:e})}startLoad(e=-1){v.log(`startLoad(${e})`),this.started=!0,this.networkControllers.forEach(t=>{t.startLoad(e)})}stopLoad(){v.log("stopLoad"),this.started=!1,this.networkControllers.forEach(e=>{e.stopLoad()})}resumeBuffering(){this.started&&this.networkControllers.forEach(e=>{"fragmentLoader"in e&&e.startLoad(-1)})}pauseBuffering(){this.networkControllers.forEach(e=>{"fragmentLoader"in e&&e.stopLoad()})}swapAudioCodec(){v.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){v.log("recoverMediaError");const e=this._media;this.detachMedia(),e&&this.attachMedia(e)}removeLevel(e){this.levelController.removeLevel(e)}get levels(){const e=this.levelController.levels;return e||[]}get currentLevel(){return this.streamController.currentLevel}set currentLevel(e){v.log(`set currentLevel:${e}`),this.levelController.manualLevel=e,this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(e){v.log(`set nextLevel:${e}`),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(e){v.log(`set loadLevel:${e}`),this.levelController.manualLevel=e}get nextLoadLevel(){return this.levelController.nextLoadLevel}set nextLoadLevel(e){this.levelController.nextLoadLevel=e}get firstLevel(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)}set firstLevel(e){v.log(`set firstLevel:${e}`),this.levelController.firstLevel=e}get startLevel(){const e=this.levelController.startLevel;return e===-1&&this.abrController.forcedAutoLevel>-1?this.abrController.forcedAutoLevel:e}set startLevel(e){v.log(`set startLevel:${e}`),e!==-1&&(e=Math.max(e,this.minAutoLevel)),this.levelController.startLevel=e}get capLevelToPlayerSize(){return this.config.capLevelToPlayerSize}set capLevelToPlayerSize(e){const t=!!e;t!==this.config.capLevelToPlayerSize&&(t?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=t)}get autoLevelCapping(){return this._autoLevelCapping}get bandwidthEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimate():NaN}set bandwidthEstimate(e){this.abrController.resetEstimator(e)}get ttfbEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimateTTFB():NaN}set autoLevelCapping(e){this._autoLevelCapping!==e&&(v.log(`set autoLevelCapping:${e}`),this._autoLevelCapping=e,this.levelController.checkMaxAutoUpdated())}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(e){fa(e)&&this._maxHdcpLevel!==e&&(this._maxHdcpLevel=e,this.levelController.checkMaxAutoUpdated())}get autoLevelEnabled(){return this.levelController.manualLevel===-1}get manualLevel(){return this.levelController.manualLevel}get minAutoLevel(){const{levels:e,config:{minAutoBitrate:t}}=this;if(!e)return 0;const s=e.length;for(let i=0;i=t)return i;return 0}get maxAutoLevel(){const{levels:e,autoLevelCapping:t,maxHdcpLevel:s}=this;let i;if(t===-1&&e!=null&&e.length?i=e.length-1:i=t,s)for(let r=i;r--;){const n=e[r].attrs["HDCP-LEVEL"];if(n&&n<=s)return r}return i}get firstAutoLevel(){return this.abrController.firstAutoLevel}get nextAutoLevel(){return this.abrController.nextAutoLevel}set nextAutoLevel(e){this.abrController.nextAutoLevel=e}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}setAudioOption(e){var t;return(t=this.audioTrackController)==null?void 0:t.setAudioOption(e)}setSubtitleOption(e){var t;return(t=this.subtitleTrackController)==null||t.setSubtitleOption(e),null}get allAudioTracks(){const e=this.audioTrackController;return e?e.allAudioTracks:[]}get audioTracks(){const e=this.audioTrackController;return e?e.audioTracks:[]}get audioTrack(){const e=this.audioTrackController;return e?e.audioTrack:-1}set audioTrack(e){const t=this.audioTrackController;t&&(t.audioTrack=e)}get allSubtitleTracks(){const e=this.subtitleTrackController;return e?e.allSubtitleTracks:[]}get subtitleTracks(){const e=this.subtitleTrackController;return e?e.subtitleTracks:[]}get subtitleTrack(){const e=this.subtitleTrackController;return e?e.subtitleTrack:-1}get media(){return this._media}set subtitleTrack(e){const t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}get subtitleDisplay(){const e=this.subtitleTrackController;return e?e.subtitleDisplay:!1}set subtitleDisplay(e){const t=this.subtitleTrackController;t&&(t.subtitleDisplay=e)}get lowLatencyMode(){return this.config.lowLatencyMode}set lowLatencyMode(e){this.config.lowLatencyMode=e}get liveSyncPosition(){return this.latencyController.liveSyncPosition}get latency(){return this.latencyController.latency}get maxLatency(){return this.latencyController.maxLatency}get targetLatency(){return this.latencyController.targetLatency}get drift(){return this.latencyController.drift}get forceStartLoad(){return this.streamController.forceStartLoad}}we.defaultConfig=void 0;var Ic=Object.defineProperty,bc=Object.getOwnPropertyDescriptor,zr=(a,e,t,s)=>{for(var i=s>1?void 0:s?bc(e,t):e,r=a.length-1,n;r>=0;r--)(n=a[r])&&(i=(s?n(e,t,i):n(i))||i);return s&&i&&Ic(e,t,i),i};let Pt=class extends Jr(Zr){constructor(){super(...arguments);Nt(this,"cameraVideo");Nt(this,"hls",null)}startPlayback(){var s;const t=this.buildAbsoluteUrl(this.camera.stream_url||"").toString();we.isSupported()?((s=this.hls)==null||s.destroy(),this.hls=new we({enableWorker:!0,lowLatencyMode:!0,maxLiveSyncPlaybackRate:2,liveSyncDuration:.5,liveMaxLatencyDuration:2,backBufferLength:5}),this.hls.loadSource(t),this.hls.attachMedia(this.cameraVideo),this.hls.on(we.Events.MEDIA_ATTACHED,()=>{this.cameraVideo.play()})):this.cameraVideo.canPlayType("application/vnd.apple.mpegurl")&&(this.cameraVideo.src=t)}stopPlayback(){var t;(t=this.hls)==null||t.destroy(),this.hls=null,this.cameraVideo.src=""}};zr([tn("streamingElement")],Pt.prototype,"cameraVideo",2);Pt=zr([en({})],Pt);var Dc=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("video",{ref:"streamingElement",style:e.cameraStyle,attrs:{autoplay:"",muted:"",crossorigin:e.crossorigin},domProps:{muted:!0}})},Cc=[],_c=sn(Pt,Dc,Cc,!1,null,null);const Mc=_c.exports;export{Mc as default}; diff --git a/fluidd/assets/IframeCamera-DGUbOvGq.js b/fluidd/assets/IframeCamera-DGUbOvGq.js new file mode 100644 index 0000000..466d244 --- /dev/null +++ b/fluidd/assets/IframeCamera-DGUbOvGq.js @@ -0,0 +1 @@ +var i=Object.defineProperty;var f=(a,e,r)=>e in a?i(a,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[e]=r;var o=(a,e,r)=>f(a,typeof e!="symbol"?e+"":e,r);import{m as _,C as p,f as u,R as v,j as I}from"./index-4UonB8GV.js";var h=Object.defineProperty,C=Object.getOwnPropertyDescriptor,l=(a,e,r,s)=>{for(var t=s>1?void 0:s?C(e,r):e,c=a.length-1,n;c>=0;c--)(n=a[c])&&(t=(s?n(e,r,t):n(t))||t);return s&&t&&h(e,r,t),t};let m=class extends _(p){constructor(){super(...arguments);o(this,"cameraIframe");o(this,"cameraIFrameSource","")}startPlayback(){const r=this.buildAbsoluteUrl(this.camera.stream_url||"").toString();this.cameraIFrameSource=r,this.$emit("raw-camera-url",r)}stopPlayback(){this.cameraIFrameSource="",this.cameraIframe.src=""}};l([v("streamingElement")],m.prototype,"cameraIframe",2);m=l([u({})],m);var b=function(){var e=this,r=e._self._c;return e._self._setupProxy,r("iframe",{ref:"streamingElement",staticStyle:{border:"none",width:"100%"},style:{"aspect-ratio":(e.camera.aspect_ratio||"16:9").replace(":","/"),...e.cameraStyle},attrs:{src:e.cameraIFrameSource}})},y=[],P=I(m,b,y,!1,null,null);const F=P.exports;export{F as default}; diff --git a/fluidd/assets/IframeCamera-Easd3hY3.js b/fluidd/assets/IframeCamera-Easd3hY3.js new file mode 100644 index 0000000..95a80e6 --- /dev/null +++ b/fluidd/assets/IframeCamera-Easd3hY3.js @@ -0,0 +1 @@ +var i=Object.defineProperty;var f=(a,e,r)=>e in a?i(a,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[e]=r;var o=(a,e,r)=>f(a,typeof e!="symbol"?e+"":e,r);import{m as _,C as p,f as u,R as v,j as I}from"./index-DNWTsqTH.js";var h=Object.defineProperty,C=Object.getOwnPropertyDescriptor,l=(a,e,r,s)=>{for(var t=s>1?void 0:s?C(e,r):e,c=a.length-1,n;c>=0;c--)(n=a[c])&&(t=(s?n(e,r,t):n(t))||t);return s&&t&&h(e,r,t),t};let m=class extends _(p){constructor(){super(...arguments);o(this,"cameraIframe");o(this,"cameraIFrameSource","")}startPlayback(){const r=this.buildAbsoluteUrl(this.camera.stream_url||"").toString();this.cameraIFrameSource=r,this.$emit("raw-camera-url",r)}stopPlayback(){this.cameraIFrameSource="",this.cameraIframe.src=""}};l([v("streamingElement")],m.prototype,"cameraIframe",2);m=l([u({})],m);var b=function(){var e=this,r=e._self._c;return e._self._setupProxy,r("iframe",{ref:"streamingElement",staticStyle:{border:"none",width:"100%"},style:{"aspect-ratio":(e.camera.aspect_ratio||"16:9").replace(":","/"),...e.cameraStyle},attrs:{src:e.cameraIFrameSource}})},y=[],P=I(m,b,y,!1,null,null);const F=P.exports;export{F as default}; diff --git a/fluidd/assets/IframeCamera-k2vVaNGH.js b/fluidd/assets/IframeCamera-k2vVaNGH.js new file mode 100644 index 0000000..c397845 --- /dev/null +++ b/fluidd/assets/IframeCamera-k2vVaNGH.js @@ -0,0 +1 @@ +var i=Object.defineProperty;var f=(a,e,r)=>e in a?i(a,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[e]=r;var o=(a,e,r)=>f(a,typeof e!="symbol"?e+"":e,r);import{m as _,C as p,f as u,R as v,j as I}from"./index-CuYiwiAV.js";var h=Object.defineProperty,C=Object.getOwnPropertyDescriptor,l=(a,e,r,s)=>{for(var t=s>1?void 0:s?C(e,r):e,c=a.length-1,n;c>=0;c--)(n=a[c])&&(t=(s?n(e,r,t):n(t))||t);return s&&t&&h(e,r,t),t};let m=class extends _(p){constructor(){super(...arguments);o(this,"cameraIframe");o(this,"cameraIFrameSource","")}startPlayback(){const r=this.buildAbsoluteUrl(this.camera.stream_url||"").toString();this.cameraIFrameSource=r,this.$emit("raw-camera-url",r)}stopPlayback(){this.cameraIFrameSource="",this.cameraIframe.src=""}};l([v("streamingElement")],m.prototype,"cameraIframe",2);m=l([u({})],m);var b=function(){var e=this,r=e._self._c;return e._self._setupProxy,r("iframe",{ref:"streamingElement",staticStyle:{border:"none",width:"100%"},style:{"aspect-ratio":(e.camera.aspect_ratio||"16:9").replace(":","/"),...e.cameraStyle},attrs:{src:e.cameraIFrameSource}})},y=[],P=I(m,b,y,!1,null,null);const F=P.exports;export{F as default}; diff --git a/fluidd/assets/IpstreamCamera-1Dkbxa2u.js b/fluidd/assets/IpstreamCamera-1Dkbxa2u.js new file mode 100644 index 0000000..45e8f61 --- /dev/null +++ b/fluidd/assets/IpstreamCamera-1Dkbxa2u.js @@ -0,0 +1 @@ +var l=Object.defineProperty;var u=(a,e,r)=>e in a?l(a,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[e]=r;var i=(a,e,r)=>u(a,typeof e!="symbol"?e+"":e,r);import{m as _,C as p,f,R as d,j as v}from"./index-CuYiwiAV.js";var h=Object.defineProperty,C=Object.getOwnPropertyDescriptor,n=(a,e,r,t)=>{for(var s=t>1?void 0:t?C(e,r):e,m=a.length-1,c;m>=0;m--)(c=a[m])&&(s=(t?c(e,r,s):c(s))||s);return t&&s&&h(e,r,s),s};let o=class extends _(p){constructor(){super(...arguments);i(this,"cameraVideo");i(this,"cameraVideoSource","")}startPlayback(){const r=this.buildAbsoluteUrl(this.camera.stream_url||"").toString();this.cameraVideoSource=r,this.$emit("raw-camera-url",r)}stopPlayback(){this.cameraVideoSource="",this.cameraVideo.src=""}};n([d("streamingElement")],o.prototype,"cameraVideo",2);o=n([f({})],o);var P=function(){var e=this,r=e._self._c;return e._self._setupProxy,r("video",{ref:"streamingElement",style:e.cameraStyle,attrs:{src:e.cameraVideoSource,autoplay:"",muted:"",crossorigin:e.crossorigin},domProps:{muted:!0}})},y=[],V=v(o,P,y,!1,null,null);const g=V.exports;export{g as default}; diff --git a/fluidd/assets/IpstreamCamera-C1K9O4EA.js b/fluidd/assets/IpstreamCamera-C1K9O4EA.js new file mode 100644 index 0000000..c6be1f3 --- /dev/null +++ b/fluidd/assets/IpstreamCamera-C1K9O4EA.js @@ -0,0 +1 @@ +var l=Object.defineProperty;var u=(a,e,r)=>e in a?l(a,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[e]=r;var i=(a,e,r)=>u(a,typeof e!="symbol"?e+"":e,r);import{m as _,C as p,f,R as d,j as v}from"./index-4UonB8GV.js";var h=Object.defineProperty,C=Object.getOwnPropertyDescriptor,n=(a,e,r,t)=>{for(var s=t>1?void 0:t?C(e,r):e,m=a.length-1,c;m>=0;m--)(c=a[m])&&(s=(t?c(e,r,s):c(s))||s);return t&&s&&h(e,r,s),s};let o=class extends _(p){constructor(){super(...arguments);i(this,"cameraVideo");i(this,"cameraVideoSource","")}startPlayback(){const r=this.buildAbsoluteUrl(this.camera.stream_url||"").toString();this.cameraVideoSource=r,this.$emit("raw-camera-url",r)}stopPlayback(){this.cameraVideoSource="",this.cameraVideo.src=""}};n([d("streamingElement")],o.prototype,"cameraVideo",2);o=n([f({})],o);var P=function(){var e=this,r=e._self._c;return e._self._setupProxy,r("video",{ref:"streamingElement",style:e.cameraStyle,attrs:{src:e.cameraVideoSource,autoplay:"",muted:"",crossorigin:e.crossorigin},domProps:{muted:!0}})},y=[],V=v(o,P,y,!1,null,null);const g=V.exports;export{g as default}; diff --git a/fluidd/assets/IpstreamCamera-XsU8XYYC.js b/fluidd/assets/IpstreamCamera-XsU8XYYC.js new file mode 100644 index 0000000..04f2410 --- /dev/null +++ b/fluidd/assets/IpstreamCamera-XsU8XYYC.js @@ -0,0 +1 @@ +var l=Object.defineProperty;var u=(a,e,r)=>e in a?l(a,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[e]=r;var i=(a,e,r)=>u(a,typeof e!="symbol"?e+"":e,r);import{m as _,C as p,f,R as d,j as v}from"./index-DNWTsqTH.js";var h=Object.defineProperty,C=Object.getOwnPropertyDescriptor,n=(a,e,r,t)=>{for(var s=t>1?void 0:t?C(e,r):e,m=a.length-1,c;m>=0;m--)(c=a[m])&&(s=(t?c(e,r,s):c(s))||s);return t&&s&&h(e,r,s),s};let o=class extends _(p){constructor(){super(...arguments);i(this,"cameraVideo");i(this,"cameraVideoSource","")}startPlayback(){const r=this.buildAbsoluteUrl(this.camera.stream_url||"").toString();this.cameraVideoSource=r,this.$emit("raw-camera-url",r)}stopPlayback(){this.cameraVideoSource="",this.cameraVideo.src=""}};n([d("streamingElement")],o.prototype,"cameraVideo",2);o=n([f({})],o);var P=function(){var e=this,r=e._self._c;return e._self._setupProxy,r("video",{ref:"streamingElement",style:e.cameraStyle,attrs:{src:e.cameraVideoSource,autoplay:"",muted:"",crossorigin:e.crossorigin},domProps:{muted:!0}})},y=[],V=v(o,P,y,!1,null,null);const g=V.exports;export{g as default}; diff --git a/fluidd/assets/MjpegstreamerAdaptiveCamera-BGaQ0MMZ.js b/fluidd/assets/MjpegstreamerAdaptiveCamera-BGaQ0MMZ.js new file mode 100644 index 0000000..94ad559 --- /dev/null +++ b/fluidd/assets/MjpegstreamerAdaptiveCamera-BGaQ0MMZ.js @@ -0,0 +1 @@ +var u=Object.defineProperty;var l=(r,t,e)=>t in r?u(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var a=(r,t,e)=>l(r,typeof t!="symbol"?t+"":t,e);import{m as g,C as p,f,R as d,j as S}from"./index-DNWTsqTH.js";var _=Object.defineProperty,T=Object.getOwnPropertyDescriptor,c=(r,t,e,m)=>{for(var s=m>1?void 0:m?T(t,e):t,i=r.length-1,o;i>=0;i--)(o=r[i])&&(s=(m?o(t,e,s):o(s))||s);return m&&s&&_(t,e,s),s};let n=class extends g(p){constructor(){super(...arguments);a(this,"cameraImage");a(this,"cameraImageSource","");a(this,"cameraImageSourceUrl",null);a(this,"requestStartTime",performance.now());a(this,"startTime",performance.now());a(this,"time",0);a(this,"requestTime",0);a(this,"timeSmoothing",.6);a(this,"requestTimeSmoothing",.1)}handleImageLoad(){const e=!document.hasFocus()&&this.camera.target_fps_idle||this.camera.target_fps||10,m=performance.now(),s=m-this.startTime;this.time=this.time*this.timeSmoothing+s*(1-this.timeSmoothing),this.startTime=m;const i=1e3/e,o=performance.now()-this.requestStartTime;this.requestTime=this.requestTime*this.requestTimeSmoothing+o*(1-this.requestTimeSmoothing);const h=Math.max(0,i-this.requestTime);this.$nextTick(()=>{setTimeout(this.handleRefresh,h)})}handleRefresh(){if(document.hidden)this.stopPlayback();else{const e=Math.round(1e3/this.time).toString().padStart(2,"0");this.$emit("frames-per-second",e),this.$nextTick(()=>this.updateCameraImageSource())}}updateCameraImageSource(){const e=this.cameraImageSourceUrl;e&&(e.searchParams.set("cacheBust",Date.now().toString()),this.requestStartTime=performance.now(),this.cameraImageSource=e.toString())}startPlayback(){this.cameraImageSourceUrl=this.buildAbsoluteUrl(this.camera.snapshot_url||""),this.updateCameraImageSource();const e=this.buildAbsoluteUrl(this.camera.stream_url||"");e.searchParams.set("cacheBust",Date.now().toString()),this.$emit("raw-camera-url",e.toString())}stopPlayback(){this.cameraImageSourceUrl=null,this.cameraImageSource="",this.cameraImage.src=""}};c([d("streamingElement")],n.prototype,"cameraImage",2);n=c([f({})],n);var I=function(){var t=this,e=t._self._c;return t._self._setupProxy,e("img",{ref:"streamingElement",style:t.cameraStyle,attrs:{src:t.cameraImageSource,crossorigin:t.crossorigin},on:{load:t.handleImageLoad}})},v=[],q=S(n,I,v,!1,null,null);const b=q.exports;export{b as default}; diff --git a/fluidd/assets/MjpegstreamerAdaptiveCamera-BecFJ9T1.js b/fluidd/assets/MjpegstreamerAdaptiveCamera-BecFJ9T1.js new file mode 100644 index 0000000..2d8c5b4 --- /dev/null +++ b/fluidd/assets/MjpegstreamerAdaptiveCamera-BecFJ9T1.js @@ -0,0 +1 @@ +var u=Object.defineProperty;var l=(r,t,e)=>t in r?u(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var a=(r,t,e)=>l(r,typeof t!="symbol"?t+"":t,e);import{m as g,C as p,f,R as d,j as S}from"./index-CuYiwiAV.js";var _=Object.defineProperty,T=Object.getOwnPropertyDescriptor,c=(r,t,e,m)=>{for(var s=m>1?void 0:m?T(t,e):t,i=r.length-1,o;i>=0;i--)(o=r[i])&&(s=(m?o(t,e,s):o(s))||s);return m&&s&&_(t,e,s),s};let n=class extends g(p){constructor(){super(...arguments);a(this,"cameraImage");a(this,"cameraImageSource","");a(this,"cameraImageSourceUrl",null);a(this,"requestStartTime",performance.now());a(this,"startTime",performance.now());a(this,"time",0);a(this,"requestTime",0);a(this,"timeSmoothing",.6);a(this,"requestTimeSmoothing",.1)}handleImageLoad(){const e=!document.hasFocus()&&this.camera.target_fps_idle||this.camera.target_fps||10,m=performance.now(),s=m-this.startTime;this.time=this.time*this.timeSmoothing+s*(1-this.timeSmoothing),this.startTime=m;const i=1e3/e,o=performance.now()-this.requestStartTime;this.requestTime=this.requestTime*this.requestTimeSmoothing+o*(1-this.requestTimeSmoothing);const h=Math.max(0,i-this.requestTime);this.$nextTick(()=>{setTimeout(this.handleRefresh,h)})}handleRefresh(){if(document.hidden)this.stopPlayback();else{const e=Math.round(1e3/this.time).toString().padStart(2,"0");this.$emit("frames-per-second",e),this.$nextTick(()=>this.updateCameraImageSource())}}updateCameraImageSource(){const e=this.cameraImageSourceUrl;e&&(e.searchParams.set("cacheBust",Date.now().toString()),this.requestStartTime=performance.now(),this.cameraImageSource=e.toString())}startPlayback(){this.cameraImageSourceUrl=this.buildAbsoluteUrl(this.camera.snapshot_url||""),this.updateCameraImageSource();const e=this.buildAbsoluteUrl(this.camera.stream_url||"");e.searchParams.set("cacheBust",Date.now().toString()),this.$emit("raw-camera-url",e.toString())}stopPlayback(){this.cameraImageSourceUrl=null,this.cameraImageSource="",this.cameraImage.src=""}};c([d("streamingElement")],n.prototype,"cameraImage",2);n=c([f({})],n);var I=function(){var t=this,e=t._self._c;return t._self._setupProxy,e("img",{ref:"streamingElement",style:t.cameraStyle,attrs:{src:t.cameraImageSource,crossorigin:t.crossorigin},on:{load:t.handleImageLoad}})},v=[],q=S(n,I,v,!1,null,null);const b=q.exports;export{b as default}; diff --git a/fluidd/assets/MjpegstreamerAdaptiveCamera-oOaK14jH.js b/fluidd/assets/MjpegstreamerAdaptiveCamera-oOaK14jH.js new file mode 100644 index 0000000..56cc381 --- /dev/null +++ b/fluidd/assets/MjpegstreamerAdaptiveCamera-oOaK14jH.js @@ -0,0 +1 @@ +var u=Object.defineProperty;var l=(r,t,e)=>t in r?u(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var a=(r,t,e)=>l(r,typeof t!="symbol"?t+"":t,e);import{m as g,C as p,f,R as d,j as S}from"./index-4UonB8GV.js";var _=Object.defineProperty,T=Object.getOwnPropertyDescriptor,c=(r,t,e,m)=>{for(var s=m>1?void 0:m?T(t,e):t,i=r.length-1,o;i>=0;i--)(o=r[i])&&(s=(m?o(t,e,s):o(s))||s);return m&&s&&_(t,e,s),s};let n=class extends g(p){constructor(){super(...arguments);a(this,"cameraImage");a(this,"cameraImageSource","");a(this,"cameraImageSourceUrl",null);a(this,"requestStartTime",performance.now());a(this,"startTime",performance.now());a(this,"time",0);a(this,"requestTime",0);a(this,"timeSmoothing",.6);a(this,"requestTimeSmoothing",.1)}handleImageLoad(){const e=!document.hasFocus()&&this.camera.target_fps_idle||this.camera.target_fps||10,m=performance.now(),s=m-this.startTime;this.time=this.time*this.timeSmoothing+s*(1-this.timeSmoothing),this.startTime=m;const i=1e3/e,o=performance.now()-this.requestStartTime;this.requestTime=this.requestTime*this.requestTimeSmoothing+o*(1-this.requestTimeSmoothing);const h=Math.max(0,i-this.requestTime);this.$nextTick(()=>{setTimeout(this.handleRefresh,h)})}handleRefresh(){if(document.hidden)this.stopPlayback();else{const e=Math.round(1e3/this.time).toString().padStart(2,"0");this.$emit("frames-per-second",e),this.$nextTick(()=>this.updateCameraImageSource())}}updateCameraImageSource(){const e=this.cameraImageSourceUrl;e&&(e.searchParams.set("cacheBust",Date.now().toString()),this.requestStartTime=performance.now(),this.cameraImageSource=e.toString())}startPlayback(){this.cameraImageSourceUrl=this.buildAbsoluteUrl(this.camera.snapshot_url||""),this.updateCameraImageSource();const e=this.buildAbsoluteUrl(this.camera.stream_url||"");e.searchParams.set("cacheBust",Date.now().toString()),this.$emit("raw-camera-url",e.toString())}stopPlayback(){this.cameraImageSourceUrl=null,this.cameraImageSource="",this.cameraImage.src=""}};c([d("streamingElement")],n.prototype,"cameraImage",2);n=c([f({})],n);var I=function(){var t=this,e=t._self._c;return t._self._setupProxy,e("img",{ref:"streamingElement",style:t.cameraStyle,attrs:{src:t.cameraImageSource,crossorigin:t.crossorigin},on:{load:t.handleImageLoad}})},v=[],q=S(n,I,v,!1,null,null);const b=q.exports;export{b as default}; diff --git a/fluidd/assets/MjpegstreamerCamera-COczQu_e.js b/fluidd/assets/MjpegstreamerCamera-COczQu_e.js new file mode 100644 index 0000000..3caab49 --- /dev/null +++ b/fluidd/assets/MjpegstreamerCamera-COczQu_e.js @@ -0,0 +1 @@ +var l=Object.defineProperty;var _=(a,e,r)=>e in a?l(a,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[e]=r;var n=(a,e,r)=>_(a,typeof e!="symbol"?e+"":e,r);import{m as u,C as g,f as p,R as f,j as h}from"./index-CuYiwiAV.js";var v=Object.defineProperty,C=Object.getOwnPropertyDescriptor,i=(a,e,r,t)=>{for(var s=t>1?void 0:t?C(e,r):e,c=a.length-1,o;c>=0;c--)(o=a[c])&&(s=(t?o(e,r,s):o(s))||s);return t&&s&&v(e,r,s),s};let m=class extends u(g){constructor(){super(...arguments);n(this,"cameraImage");n(this,"cameraImageSource","")}startPlayback(){const r=this.buildAbsoluteUrl(this.camera.stream_url||"");r.searchParams.set("cacheBust",Date.now().toString()),this.cameraImageSource=r.toString(),this.$emit("raw-camera-url",this.cameraImageSource)}stopPlayback(){this.cameraImageSource="",this.cameraImage.src=""}};i([f("streamingElement")],m.prototype,"cameraImage",2);m=i([p({})],m);var I=function(){var e=this,r=e._self._c;return e._self._setupProxy,r("img",{ref:"streamingElement",style:e.cameraStyle,attrs:{src:e.cameraImageSource,crossorigin:e.crossorigin}})},P=[],S=h(m,I,P,!1,null,null);const y=S.exports;export{y as default}; diff --git a/fluidd/assets/MjpegstreamerCamera-CXlqsO_0.js b/fluidd/assets/MjpegstreamerCamera-CXlqsO_0.js new file mode 100644 index 0000000..7a16446 --- /dev/null +++ b/fluidd/assets/MjpegstreamerCamera-CXlqsO_0.js @@ -0,0 +1 @@ +var l=Object.defineProperty;var _=(a,e,r)=>e in a?l(a,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[e]=r;var n=(a,e,r)=>_(a,typeof e!="symbol"?e+"":e,r);import{m as u,C as g,f as p,R as f,j as h}from"./index-4UonB8GV.js";var v=Object.defineProperty,C=Object.getOwnPropertyDescriptor,i=(a,e,r,t)=>{for(var s=t>1?void 0:t?C(e,r):e,c=a.length-1,o;c>=0;c--)(o=a[c])&&(s=(t?o(e,r,s):o(s))||s);return t&&s&&v(e,r,s),s};let m=class extends u(g){constructor(){super(...arguments);n(this,"cameraImage");n(this,"cameraImageSource","")}startPlayback(){const r=this.buildAbsoluteUrl(this.camera.stream_url||"");r.searchParams.set("cacheBust",Date.now().toString()),this.cameraImageSource=r.toString(),this.$emit("raw-camera-url",this.cameraImageSource)}stopPlayback(){this.cameraImageSource="",this.cameraImage.src=""}};i([f("streamingElement")],m.prototype,"cameraImage",2);m=i([p({})],m);var I=function(){var e=this,r=e._self._c;return e._self._setupProxy,r("img",{ref:"streamingElement",style:e.cameraStyle,attrs:{src:e.cameraImageSource,crossorigin:e.crossorigin}})},P=[],S=h(m,I,P,!1,null,null);const y=S.exports;export{y as default}; diff --git a/fluidd/assets/MjpegstreamerCamera-D8yWRRXC.js b/fluidd/assets/MjpegstreamerCamera-D8yWRRXC.js new file mode 100644 index 0000000..41b172d --- /dev/null +++ b/fluidd/assets/MjpegstreamerCamera-D8yWRRXC.js @@ -0,0 +1 @@ +var l=Object.defineProperty;var _=(a,e,r)=>e in a?l(a,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[e]=r;var n=(a,e,r)=>_(a,typeof e!="symbol"?e+"":e,r);import{m as u,C as g,f as p,R as f,j as h}from"./index-DNWTsqTH.js";var v=Object.defineProperty,C=Object.getOwnPropertyDescriptor,i=(a,e,r,t)=>{for(var s=t>1?void 0:t?C(e,r):e,c=a.length-1,o;c>=0;c--)(o=a[c])&&(s=(t?o(e,r,s):o(s))||s);return t&&s&&v(e,r,s),s};let m=class extends u(g){constructor(){super(...arguments);n(this,"cameraImage");n(this,"cameraImageSource","")}startPlayback(){const r=this.buildAbsoluteUrl(this.camera.stream_url||"");r.searchParams.set("cacheBust",Date.now().toString()),this.cameraImageSource=r.toString(),this.$emit("raw-camera-url",this.cameraImageSource)}stopPlayback(){this.cameraImageSource="",this.cameraImage.src=""}};i([f("streamingElement")],m.prototype,"cameraImage",2);m=i([p({})],m);var I=function(){var e=this,r=e._self._c;return e._self._setupProxy,r("img",{ref:"streamingElement",style:e.cameraStyle,attrs:{src:e.cameraImageSource,crossorigin:e.crossorigin}})},P=[],S=h(m,I,P,!1,null,null);const y=S.exports;export{y as default}; diff --git a/fluidd/assets/WebrtcCamerastreamerCamera-COt5QBCW.js b/fluidd/assets/WebrtcCamerastreamerCamera-COt5QBCW.js new file mode 100644 index 0000000..4df9ab0 --- /dev/null +++ b/fluidd/assets/WebrtcCamerastreamerCamera-COt5QBCW.js @@ -0,0 +1 @@ +var h=Object.defineProperty;var u=(s,t,r)=>t in s?h(s,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):s[t]=r;var o=(s,t,r)=>u(s,typeof t!="symbol"?t+"":t,r);import{m as y,C as f,k as p,f as _,R as C,j as v}from"./index-4UonB8GV.js";var b=Object.defineProperty,P=Object.getOwnPropertyDescriptor,m=(s,t,r,i)=>{for(var e=i>1?void 0:i?P(t,r):t,a=s.length-1,n;a>=0;a--)(n=s[a])&&(e=(i?n(t,r,e):n(e))||e);return i&&e&&b(t,r,e),e};let d=class extends y(f){constructor(){super(...arguments);o(this,"cameraVideo");o(this,"pc",null);o(this,"remoteId",null)}startPlayback(){var i;const r=this.buildAbsoluteUrl(this.camera.stream_url||"");(i=this.pc)==null||i.close(),fetch(r,{body:JSON.stringify({type:"request"}),headers:{"Content-Type":"application/json"},method:"POST"}).then(e=>e.json()).then(e=>{var n;this.remoteId="id"in e&&typeof e.id=="string"?e.id:null;const a={sdpSemantics:"unified-plan"};return"iceServers"in e&&Array.isArray(e.iceServers)&&(a.iceServers=e.iceServers),this.pc=new RTCPeerConnection(a),this.pc.addTransceiver("video",{direction:"recvonly"}),this.pc.ontrack=c=>{c.track.kind==="video"&&(this.cameraVideo.srcObject=c.streams[0])},this.pc.onicecandidate=c=>{if(c.candidate)return fetch(r,{body:JSON.stringify({type:"remote_candidate",id:this.remoteId,candidates:[c.candidate]}),headers:{"Content-Type":"application/json"},method:"POST"}).catch(l=>p.error("[WebrtcCamerastreamerCamera] onicecandidate",l))},(n=this.pc)==null?void 0:n.setRemoteDescription(e)}).then(()=>{var e;return(e=this.pc)==null?void 0:e.createAnswer()}).then(e=>{var a;return(a=this.pc)==null?void 0:a.setLocalDescription(e)}).then(()=>{var a;const e=(a=this.pc)==null?void 0:a.localDescription;return fetch(r,{body:JSON.stringify({type:e==null?void 0:e.type,id:this.remoteId,sdp:e==null?void 0:e.sdp}),headers:{"Content-Type":"application/json"},method:"POST"})}).then(e=>e.json()).catch(e=>p.error("[WebrtcCamerastreamerCamera] setUrl",e))}stopPlayback(){var r;(r=this.pc)==null||r.close(),this.pc=null,this.cameraVideo.src=""}};m([C("streamingElement")],d.prototype,"cameraVideo",2);d=m([_({})],d);var S=function(){var t=this,r=t._self._c;return t._self._setupProxy,r("video",{ref:"streamingElement",style:t.cameraStyle,attrs:{autoplay:"",playsinline:"",muted:"",crossorigin:t.crossorigin},domProps:{muted:!0}})},O=[],g=v(d,S,O,!1,null,null);const D=g.exports;export{D as default}; diff --git a/fluidd/assets/WebrtcCamerastreamerCamera-CplbrIkX.js b/fluidd/assets/WebrtcCamerastreamerCamera-CplbrIkX.js new file mode 100644 index 0000000..cbe4897 --- /dev/null +++ b/fluidd/assets/WebrtcCamerastreamerCamera-CplbrIkX.js @@ -0,0 +1 @@ +var h=Object.defineProperty;var u=(s,t,r)=>t in s?h(s,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):s[t]=r;var o=(s,t,r)=>u(s,typeof t!="symbol"?t+"":t,r);import{m as y,C as f,k as p,f as _,R as C,j as v}from"./index-CuYiwiAV.js";var b=Object.defineProperty,P=Object.getOwnPropertyDescriptor,m=(s,t,r,i)=>{for(var e=i>1?void 0:i?P(t,r):t,a=s.length-1,n;a>=0;a--)(n=s[a])&&(e=(i?n(t,r,e):n(e))||e);return i&&e&&b(t,r,e),e};let d=class extends y(f){constructor(){super(...arguments);o(this,"cameraVideo");o(this,"pc",null);o(this,"remoteId",null)}startPlayback(){var i;const r=this.buildAbsoluteUrl(this.camera.stream_url||"");(i=this.pc)==null||i.close(),fetch(r,{body:JSON.stringify({type:"request"}),headers:{"Content-Type":"application/json"},method:"POST"}).then(e=>e.json()).then(e=>{var n;this.remoteId="id"in e&&typeof e.id=="string"?e.id:null;const a={sdpSemantics:"unified-plan"};return"iceServers"in e&&Array.isArray(e.iceServers)&&(a.iceServers=e.iceServers),this.pc=new RTCPeerConnection(a),this.pc.addTransceiver("video",{direction:"recvonly"}),this.pc.ontrack=c=>{c.track.kind==="video"&&(this.cameraVideo.srcObject=c.streams[0])},this.pc.onicecandidate=c=>{if(c.candidate)return fetch(r,{body:JSON.stringify({type:"remote_candidate",id:this.remoteId,candidates:[c.candidate]}),headers:{"Content-Type":"application/json"},method:"POST"}).catch(l=>p.error("[WebrtcCamerastreamerCamera] onicecandidate",l))},(n=this.pc)==null?void 0:n.setRemoteDescription(e)}).then(()=>{var e;return(e=this.pc)==null?void 0:e.createAnswer()}).then(e=>{var a;return(a=this.pc)==null?void 0:a.setLocalDescription(e)}).then(()=>{var a;const e=(a=this.pc)==null?void 0:a.localDescription;return fetch(r,{body:JSON.stringify({type:e==null?void 0:e.type,id:this.remoteId,sdp:e==null?void 0:e.sdp}),headers:{"Content-Type":"application/json"},method:"POST"})}).then(e=>e.json()).catch(e=>p.error("[WebrtcCamerastreamerCamera] setUrl",e))}stopPlayback(){var r;(r=this.pc)==null||r.close(),this.pc=null,this.cameraVideo.src=""}};m([C("streamingElement")],d.prototype,"cameraVideo",2);d=m([_({})],d);var S=function(){var t=this,r=t._self._c;return t._self._setupProxy,r("video",{ref:"streamingElement",style:t.cameraStyle,attrs:{autoplay:"",playsinline:"",muted:"",crossorigin:t.crossorigin},domProps:{muted:!0}})},O=[],g=v(d,S,O,!1,null,null);const D=g.exports;export{D as default}; diff --git a/fluidd/assets/WebrtcCamerastreamerCamera-KVbDcVrm.js b/fluidd/assets/WebrtcCamerastreamerCamera-KVbDcVrm.js new file mode 100644 index 0000000..442f2d3 --- /dev/null +++ b/fluidd/assets/WebrtcCamerastreamerCamera-KVbDcVrm.js @@ -0,0 +1 @@ +var h=Object.defineProperty;var u=(s,t,r)=>t in s?h(s,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):s[t]=r;var o=(s,t,r)=>u(s,typeof t!="symbol"?t+"":t,r);import{m as y,C as f,k as p,f as _,R as C,j as v}from"./index-DNWTsqTH.js";var b=Object.defineProperty,P=Object.getOwnPropertyDescriptor,m=(s,t,r,i)=>{for(var e=i>1?void 0:i?P(t,r):t,a=s.length-1,n;a>=0;a--)(n=s[a])&&(e=(i?n(t,r,e):n(e))||e);return i&&e&&b(t,r,e),e};let d=class extends y(f){constructor(){super(...arguments);o(this,"cameraVideo");o(this,"pc",null);o(this,"remoteId",null)}startPlayback(){var i;const r=this.buildAbsoluteUrl(this.camera.stream_url||"");(i=this.pc)==null||i.close(),fetch(r,{body:JSON.stringify({type:"request"}),headers:{"Content-Type":"application/json"},method:"POST"}).then(e=>e.json()).then(e=>{var n;this.remoteId="id"in e&&typeof e.id=="string"?e.id:null;const a={sdpSemantics:"unified-plan"};return"iceServers"in e&&Array.isArray(e.iceServers)&&(a.iceServers=e.iceServers),this.pc=new RTCPeerConnection(a),this.pc.addTransceiver("video",{direction:"recvonly"}),this.pc.ontrack=c=>{c.track.kind==="video"&&(this.cameraVideo.srcObject=c.streams[0])},this.pc.onicecandidate=c=>{if(c.candidate)return fetch(r,{body:JSON.stringify({type:"remote_candidate",id:this.remoteId,candidates:[c.candidate]}),headers:{"Content-Type":"application/json"},method:"POST"}).catch(l=>p.error("[WebrtcCamerastreamerCamera] onicecandidate",l))},(n=this.pc)==null?void 0:n.setRemoteDescription(e)}).then(()=>{var e;return(e=this.pc)==null?void 0:e.createAnswer()}).then(e=>{var a;return(a=this.pc)==null?void 0:a.setLocalDescription(e)}).then(()=>{var a;const e=(a=this.pc)==null?void 0:a.localDescription;return fetch(r,{body:JSON.stringify({type:e==null?void 0:e.type,id:this.remoteId,sdp:e==null?void 0:e.sdp}),headers:{"Content-Type":"application/json"},method:"POST"})}).then(e=>e.json()).catch(e=>p.error("[WebrtcCamerastreamerCamera] setUrl",e))}stopPlayback(){var r;(r=this.pc)==null||r.close(),this.pc=null,this.cameraVideo.src=""}};m([C("streamingElement")],d.prototype,"cameraVideo",2);d=m([_({})],d);var S=function(){var t=this,r=t._self._c;return t._self._setupProxy,r("video",{ref:"streamingElement",style:t.cameraStyle,attrs:{autoplay:"",playsinline:"",muted:"",crossorigin:t.crossorigin},domProps:{muted:!0}})},O=[],g=v(d,S,O,!1,null,null);const D=g.exports;export{D as default}; diff --git a/fluidd/assets/WebrtcGo2RtcCamera-C4ESzxvA.js b/fluidd/assets/WebrtcGo2RtcCamera-C4ESzxvA.js new file mode 100644 index 0000000..7aadde9 --- /dev/null +++ b/fluidd/assets/WebrtcGo2RtcCamera-C4ESzxvA.js @@ -0,0 +1 @@ +var m=Object.defineProperty;var b=(o,s,e)=>s in o?m(o,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[s]=e;var i=(o,s,e)=>b(o,typeof s!="symbol"?s+"":s,e);import{m as w,C as u,k as l,l as f,f as C,R as y,j as _}from"./index-DNWTsqTH.js";var g=Object.defineProperty,v=Object.getOwnPropertyDescriptor,h=(o,s,e,t)=>{for(var r=t>1?void 0:t?v(s,e):s,a=o.length-1,c;a>=0;a--)(c=o[a])&&(r=(t?c(s,e,r):c(r))||r);return t&&r&&g(s,e,r),r};let d=class extends w(u){constructor(){super(...arguments);i(this,"cameraVideo");i(this,"pc",null);i(this,"ws",null);i(this,"abortController",null)}startPlayback(){var r,a,c;(r=this.abortController)==null||r.abort(),(a=this.pc)==null||a.close(),(c=this.ws)==null||c.close(),this.abortController=new AbortController;const e=this.buildAbsoluteUrl(this.camera.stream_url||""),t=new URL("api/ws"+e.search,e);t.protocol=t.protocol==="https:"?"wss:":"ws:",this.ws=new WebSocket(t),this.ws.binaryType="arraybuffer",this.ws.onopen=this.onWebSocketOpen,this.ws.onmessage=this.onWebSocketMessage,this.ws.onclose=this.onWebSocketClose,this.$emit("raw-camera-url",e)}async onWebSocketOpen(){var a;l.debug("[WebrtcGo2RtcCamera] socket opened");const e={iceServers:[{urls:"stun:stun.l.google.com:19302"}],sdpSemantics:"unified-plan"};this.pc=new RTCPeerConnection(e),this.pc.onicecandidate=c=>{var p;if(!c.candidate)return;const n={type:"webrtc/candidate",value:c.candidate.toJSON().candidate};(p=this.ws)==null||p.send(JSON.stringify(n))},this.pc.onconnectionstatechange=()=>{var c;switch((c=this.pc)==null?void 0:c.connectionState){case"connected":{const n=this.pc.getReceivers().map(p=>p.track);this.cameraVideo.srcObject=new MediaStream(n);break}case"failed":case"disconnected":this.startPlayback()}},this.pc.addTransceiver("video",{direction:"recvonly"});const t=await this.pc.createOffer();await this.pc.setLocalDescription(t);const r={type:"webrtc/offer",value:t.sdp};(a=this.ws)==null||a.send(JSON.stringify(r))}async onWebSocketMessage(e){var r,a,c;const t=JSON.parse(e.data);switch(t.type){case"webrtc/candidate":try{await((r=this.pc)==null?void 0:r.addIceCandidate({candidate:t.value,sdpMid:"0"}))}catch(n){l.warn("[WebrtcGo2RtcCamera] RTCPeerConnection.addIceCandidate() error",n)}break;case"webrtc/answer":try{(a=this.pc)==null||a.setRemoteDescription({type:"answer",sdp:t.value})}catch(n){l.warn("[WebrtcGo2RtcCamera] RTCPeerConnection.setRemoteDescription() error",n)}break;case"error":l.error(`[WebrtcGo2RtcCamera] ${t.value}`),(c=this.pc)==null||c.close()}}async onWebSocketClose(e){var t;if(!e.wasClean){l.error("[WebrtcGo2RtcCamera] socket close was not clean",e);try{await f(2e3,(t=this.abortController)==null?void 0:t.signal),this.startPlayback()}catch{}}}stopPlayback(){var e,t;(e=this.abortController)==null||e.abort(),this.abortController=null,this.pc&&(this.pc.getSenders().forEach(r=>{var a;(a=r.track)==null||a.stop()}),this.pc.close(),this.pc=null),(t=this.ws)==null||t.close(),this.ws=null,this.cameraVideo.src="",this.cameraVideo.srcObject=null}};h([y("streamingElement")],d.prototype,"cameraVideo",2);d=h([C({})],d);var R=function(){var s=this,e=s._self._c;return s._self._setupProxy,e("video",{ref:"streamingElement",style:s.cameraStyle,attrs:{autoplay:"",playsinline:"",muted:"",crossorigin:s.crossorigin},domProps:{muted:!0}})},S=[],k=_(d,R,S,!1,null,null);const G=k.exports;export{G as default}; diff --git a/fluidd/assets/WebrtcGo2RtcCamera-DtI6qUm8.js b/fluidd/assets/WebrtcGo2RtcCamera-DtI6qUm8.js new file mode 100644 index 0000000..760157e --- /dev/null +++ b/fluidd/assets/WebrtcGo2RtcCamera-DtI6qUm8.js @@ -0,0 +1 @@ +var m=Object.defineProperty;var b=(o,s,e)=>s in o?m(o,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[s]=e;var i=(o,s,e)=>b(o,typeof s!="symbol"?s+"":s,e);import{m as w,C as u,k as l,l as f,f as C,R as y,j as _}from"./index-4UonB8GV.js";var g=Object.defineProperty,v=Object.getOwnPropertyDescriptor,h=(o,s,e,t)=>{for(var r=t>1?void 0:t?v(s,e):s,a=o.length-1,c;a>=0;a--)(c=o[a])&&(r=(t?c(s,e,r):c(r))||r);return t&&r&&g(s,e,r),r};let d=class extends w(u){constructor(){super(...arguments);i(this,"cameraVideo");i(this,"pc",null);i(this,"ws",null);i(this,"abortController",null)}startPlayback(){var r,a,c;(r=this.abortController)==null||r.abort(),(a=this.pc)==null||a.close(),(c=this.ws)==null||c.close(),this.abortController=new AbortController;const e=this.buildAbsoluteUrl(this.camera.stream_url||""),t=new URL("api/ws"+e.search,e);t.protocol=t.protocol==="https:"?"wss:":"ws:",this.ws=new WebSocket(t),this.ws.binaryType="arraybuffer",this.ws.onopen=this.onWebSocketOpen,this.ws.onmessage=this.onWebSocketMessage,this.ws.onclose=this.onWebSocketClose,this.$emit("raw-camera-url",e)}async onWebSocketOpen(){var a;l.debug("[WebrtcGo2RtcCamera] socket opened");const e={iceServers:[{urls:"stun:stun.l.google.com:19302"}],sdpSemantics:"unified-plan"};this.pc=new RTCPeerConnection(e),this.pc.onicecandidate=c=>{var p;if(!c.candidate)return;const n={type:"webrtc/candidate",value:c.candidate.toJSON().candidate};(p=this.ws)==null||p.send(JSON.stringify(n))},this.pc.onconnectionstatechange=()=>{var c;switch((c=this.pc)==null?void 0:c.connectionState){case"connected":{const n=this.pc.getReceivers().map(p=>p.track);this.cameraVideo.srcObject=new MediaStream(n);break}case"failed":case"disconnected":this.startPlayback()}},this.pc.addTransceiver("video",{direction:"recvonly"});const t=await this.pc.createOffer();await this.pc.setLocalDescription(t);const r={type:"webrtc/offer",value:t.sdp};(a=this.ws)==null||a.send(JSON.stringify(r))}async onWebSocketMessage(e){var r,a,c;const t=JSON.parse(e.data);switch(t.type){case"webrtc/candidate":try{await((r=this.pc)==null?void 0:r.addIceCandidate({candidate:t.value,sdpMid:"0"}))}catch(n){l.warn("[WebrtcGo2RtcCamera] RTCPeerConnection.addIceCandidate() error",n)}break;case"webrtc/answer":try{(a=this.pc)==null||a.setRemoteDescription({type:"answer",sdp:t.value})}catch(n){l.warn("[WebrtcGo2RtcCamera] RTCPeerConnection.setRemoteDescription() error",n)}break;case"error":l.error(`[WebrtcGo2RtcCamera] ${t.value}`),(c=this.pc)==null||c.close()}}async onWebSocketClose(e){var t;if(!e.wasClean){l.error("[WebrtcGo2RtcCamera] socket close was not clean",e);try{await f(2e3,(t=this.abortController)==null?void 0:t.signal),this.startPlayback()}catch{}}}stopPlayback(){var e,t;(e=this.abortController)==null||e.abort(),this.abortController=null,this.pc&&(this.pc.getSenders().forEach(r=>{var a;(a=r.track)==null||a.stop()}),this.pc.close(),this.pc=null),(t=this.ws)==null||t.close(),this.ws=null,this.cameraVideo.src="",this.cameraVideo.srcObject=null}};h([y("streamingElement")],d.prototype,"cameraVideo",2);d=h([C({})],d);var R=function(){var s=this,e=s._self._c;return s._self._setupProxy,e("video",{ref:"streamingElement",style:s.cameraStyle,attrs:{autoplay:"",playsinline:"",muted:"",crossorigin:s.crossorigin},domProps:{muted:!0}})},S=[],k=_(d,R,S,!1,null,null);const G=k.exports;export{G as default}; diff --git a/fluidd/assets/WebrtcGo2RtcCamera-dXsDqblf.js b/fluidd/assets/WebrtcGo2RtcCamera-dXsDqblf.js new file mode 100644 index 0000000..2d22024 --- /dev/null +++ b/fluidd/assets/WebrtcGo2RtcCamera-dXsDqblf.js @@ -0,0 +1 @@ +var m=Object.defineProperty;var b=(o,s,e)=>s in o?m(o,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[s]=e;var i=(o,s,e)=>b(o,typeof s!="symbol"?s+"":s,e);import{m as w,C as u,k as l,l as f,f as C,R as y,j as _}from"./index-CuYiwiAV.js";var g=Object.defineProperty,v=Object.getOwnPropertyDescriptor,h=(o,s,e,t)=>{for(var r=t>1?void 0:t?v(s,e):s,a=o.length-1,c;a>=0;a--)(c=o[a])&&(r=(t?c(s,e,r):c(r))||r);return t&&r&&g(s,e,r),r};let d=class extends w(u){constructor(){super(...arguments);i(this,"cameraVideo");i(this,"pc",null);i(this,"ws",null);i(this,"abortController",null)}startPlayback(){var r,a,c;(r=this.abortController)==null||r.abort(),(a=this.pc)==null||a.close(),(c=this.ws)==null||c.close(),this.abortController=new AbortController;const e=this.buildAbsoluteUrl(this.camera.stream_url||""),t=new URL("api/ws"+e.search,e);t.protocol=t.protocol==="https:"?"wss:":"ws:",this.ws=new WebSocket(t),this.ws.binaryType="arraybuffer",this.ws.onopen=this.onWebSocketOpen,this.ws.onmessage=this.onWebSocketMessage,this.ws.onclose=this.onWebSocketClose,this.$emit("raw-camera-url",e)}async onWebSocketOpen(){var a;l.debug("[WebrtcGo2RtcCamera] socket opened");const e={iceServers:[{urls:"stun:stun.l.google.com:19302"}],sdpSemantics:"unified-plan"};this.pc=new RTCPeerConnection(e),this.pc.onicecandidate=c=>{var p;if(!c.candidate)return;const n={type:"webrtc/candidate",value:c.candidate.toJSON().candidate};(p=this.ws)==null||p.send(JSON.stringify(n))},this.pc.onconnectionstatechange=()=>{var c;switch((c=this.pc)==null?void 0:c.connectionState){case"connected":{const n=this.pc.getReceivers().map(p=>p.track);this.cameraVideo.srcObject=new MediaStream(n);break}case"failed":case"disconnected":this.startPlayback()}},this.pc.addTransceiver("video",{direction:"recvonly"});const t=await this.pc.createOffer();await this.pc.setLocalDescription(t);const r={type:"webrtc/offer",value:t.sdp};(a=this.ws)==null||a.send(JSON.stringify(r))}async onWebSocketMessage(e){var r,a,c;const t=JSON.parse(e.data);switch(t.type){case"webrtc/candidate":try{await((r=this.pc)==null?void 0:r.addIceCandidate({candidate:t.value,sdpMid:"0"}))}catch(n){l.warn("[WebrtcGo2RtcCamera] RTCPeerConnection.addIceCandidate() error",n)}break;case"webrtc/answer":try{(a=this.pc)==null||a.setRemoteDescription({type:"answer",sdp:t.value})}catch(n){l.warn("[WebrtcGo2RtcCamera] RTCPeerConnection.setRemoteDescription() error",n)}break;case"error":l.error(`[WebrtcGo2RtcCamera] ${t.value}`),(c=this.pc)==null||c.close()}}async onWebSocketClose(e){var t;if(!e.wasClean){l.error("[WebrtcGo2RtcCamera] socket close was not clean",e);try{await f(2e3,(t=this.abortController)==null?void 0:t.signal),this.startPlayback()}catch{}}}stopPlayback(){var e,t;(e=this.abortController)==null||e.abort(),this.abortController=null,this.pc&&(this.pc.getSenders().forEach(r=>{var a;(a=r.track)==null||a.stop()}),this.pc.close(),this.pc=null),(t=this.ws)==null||t.close(),this.ws=null,this.cameraVideo.src="",this.cameraVideo.srcObject=null}};h([y("streamingElement")],d.prototype,"cameraVideo",2);d=h([C({})],d);var R=function(){var s=this,e=s._self._c;return s._self._setupProxy,e("video",{ref:"streamingElement",style:s.cameraStyle,attrs:{autoplay:"",playsinline:"",muted:"",crossorigin:s.crossorigin},domProps:{muted:!0}})},S=[],k=_(d,R,S,!1,null,null);const G=k.exports;export{G as default}; diff --git a/fluidd/assets/WebrtcMediamtxCamera-3i7SI2In.js b/fluidd/assets/WebrtcMediamtxCamera-3i7SI2In.js new file mode 100644 index 0000000..eeffc9e --- /dev/null +++ b/fluidd/assets/WebrtcMediamtxCamera-3i7SI2In.js @@ -0,0 +1,7 @@ +var m=Object.defineProperty;var f=(i,a,e)=>a in i?m(i,a,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[a]=e;var o=(i,a,e)=>f(i,typeof a!="symbol"?a+"":a,e);import{m as p,C as w,k as l,f as C,R as g,j as b}from"./index-CuYiwiAV.js";var T=Object.defineProperty,y=Object.getOwnPropertyDescriptor,u=(i,a,e,t)=>{for(var r=t>1?void 0:t?y(a,e):a,s=i.length-1,n;s>=0;s--)(n=i[s])&&(r=(t?n(a,e,r):n(r))||r);return t&&r&&T(a,e,r),r};let h=class extends p(w){constructor(){super(...arguments);o(this,"cameraVideo");o(this,"whepUrl","");o(this,"sessionUrl","");o(this,"pc",null);o(this,"restartTimeout",null);o(this,"offerData",null);o(this,"queuedCandidates",[])}unquoteCredential(e){return JSON.parse(`"${e}"`)}linkToIceServers(e){return e!==null?e.split(", ").map(t=>{const r=t.match(/^<(.+?)>; rel="ice-server"(; username="(.*?)"; credential="(.*?)"; credential-type="password")?/i),s={urls:[r[1]]};return r[3]!==void 0&&(s.username=this.unquoteCredential(r[3]),s.credential=this.unquoteCredential(r[4]),s.credentialType="password"),s}):[]}parseOffer(e){const t={iceUfrag:"",icePwd:"",medias:[]};for(const r of e.split(`\r +`))r.startsWith("m=")?t.medias.push(r.slice(2)):t.iceUfrag===""&&r.startsWith("a=ice-ufrag:")?t.iceUfrag=r.slice(12):t.icePwd===""&&r.startsWith("a=ice-pwd:")&&(t.icePwd=r.slice(10));return t}generateSdpFragment(e,t){const r={};for(const d of t){const c=d.sdpMLineIndex;r[c]===void 0&&(r[c]=[]),r[c].push(d)}let s="a=ice-ufrag:"+e.iceUfrag+`\r +a=ice-pwd:`+e.icePwd+`\r +`,n=0;for(const d of e.medias){if(r[n]!==void 0){s+="m="+d+`\r +a=mid:`+n+`\r +`;for(const c of r[n])s+="a="+c.candidate+`\r +`}n++}return s}async loadStream(){try{const e=await fetch(this.whepUrl,{method:"OPTIONS"}),t={iceServers:this.linkToIceServers(e.headers.get("Link")),sdpSemantics:"unified-plan"};this.pc=new RTCPeerConnection(t),this.pc.addTransceiver("video",{direction:"recvonly"}),this.pc.onicecandidate=s=>{this.restartTimeout===null&&s.candidate!==null&&(this.sessionUrl===""?this.queuedCandidates.push(s.candidate):this.sendLocalCandidates([s.candidate]))},this.pc.oniceconnectionstatechange=()=>{var s;this.restartTimeout===null&&((s=this.pc)==null?void 0:s.iceConnectionState)==="disconnected"&&(l.warn("[WebrtcMediamtxCamera] peer connection disconnected"),this.onError())},this.pc.ontrack=s=>{this.cameraVideo.srcObject=s.streams[0]};const r=await this.pc.createOffer();this.offerData=this.parseOffer(r.sdp??""),this.pc.setLocalDescription(r),this.sendOffer(r)}catch(e){l.error("[WebrtcMediamtxCamera] error on loadStream",e),this.onError()}}onError(){this.restartTimeout===null&&(this.pc!==null&&(this.pc.close(),this.pc=null),this.restartTimeout=window.setTimeout(()=>{this.restartTimeout=null,this.loadStream()},2e3),this.sessionUrl&&(fetch(this.sessionUrl,{method:"DELETE"}),this.sessionUrl=""),this.queuedCandidates=[])}async sendLocalCandidates(e){try{const t=await fetch(this.sessionUrl,{method:"PATCH",headers:{"Content-Type":"application/trickle-ice-sdpfrag","If-Match":"*"},body:this.generateSdpFragment(this.offerData,e)});switch(t.status){case 204:break;case 404:throw new Error("stream not found");default:throw new Error(`bad status code ${t.status}`)}}catch(t){l.error("[WebrtcMediamtxCamera] error on sendLocalCandidates",t),this.onError()}}onRemoteAnswer(e){var t;this.restartTimeout===null&&((t=this.pc)==null||t.setRemoteDescription(new RTCSessionDescription({type:"answer",sdp:e})),this.queuedCandidates.length!==0&&(this.sendLocalCandidates(this.queuedCandidates),this.queuedCandidates=[]))}async sendOffer(e){try{const t=await fetch(this.whepUrl,{method:"POST",headers:{"Content-Type":"application/sdp"},body:e.sdp});switch(t.status){case 201:break;case 404:throw new Error("stream not found");default:throw new Error(`bad status code ${t.status}`)}this.sessionUrl=new URL(t.headers.get("location")??"",this.baseUrl).toString();const r=await t.text();this.onRemoteAnswer(r)}catch(t){l.error("[WebrtcMediamtxCamera] error on sendOffer",t),this.onError()}}get baseUrl(){const e=this.buildAbsoluteUrl(this.camera.stream_url||"");return e.pathname.endsWith("/")||(e.pathname+="/"),e}startPlayback(){this.whepUrl=new URL("whep",this.baseUrl).toString(),this.loadStream()}stopPlayback(){this.sessionUrl="",this.queuedCandidates=[],this.restartTimeout&&(clearTimeout(this.restartTimeout),this.restartTimeout=null),this.pc&&(this.pc.close(),this.pc=null),this.cameraVideo.src="",this.cameraVideo.srcObject=null}};u([g("streamingElement")],h.prototype,"cameraVideo",2);h=u([C({})],h);var U=function(){var a=this,e=a._self._c;return a._self._setupProxy,e("video",{ref:"streamingElement",style:a.cameraStyle,attrs:{autoplay:"",playsinline:"",muted:"",crossorigin:a.crossorigin},domProps:{muted:!0}})},_=[],v=b(h,U,_,!1,null,null);const x=v.exports;export{x as default}; diff --git a/fluidd/assets/WebrtcMediamtxCamera-DZbYE0k7.js b/fluidd/assets/WebrtcMediamtxCamera-DZbYE0k7.js new file mode 100644 index 0000000..46a8d79 --- /dev/null +++ b/fluidd/assets/WebrtcMediamtxCamera-DZbYE0k7.js @@ -0,0 +1,7 @@ +var m=Object.defineProperty;var f=(i,a,e)=>a in i?m(i,a,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[a]=e;var o=(i,a,e)=>f(i,typeof a!="symbol"?a+"":a,e);import{m as p,C as w,k as l,f as C,R as g,j as b}from"./index-DNWTsqTH.js";var T=Object.defineProperty,y=Object.getOwnPropertyDescriptor,u=(i,a,e,t)=>{for(var r=t>1?void 0:t?y(a,e):a,s=i.length-1,n;s>=0;s--)(n=i[s])&&(r=(t?n(a,e,r):n(r))||r);return t&&r&&T(a,e,r),r};let h=class extends p(w){constructor(){super(...arguments);o(this,"cameraVideo");o(this,"whepUrl","");o(this,"sessionUrl","");o(this,"pc",null);o(this,"restartTimeout",null);o(this,"offerData",null);o(this,"queuedCandidates",[])}unquoteCredential(e){return JSON.parse(`"${e}"`)}linkToIceServers(e){return e!==null?e.split(", ").map(t=>{const r=t.match(/^<(.+?)>; rel="ice-server"(; username="(.*?)"; credential="(.*?)"; credential-type="password")?/i),s={urls:[r[1]]};return r[3]!==void 0&&(s.username=this.unquoteCredential(r[3]),s.credential=this.unquoteCredential(r[4]),s.credentialType="password"),s}):[]}parseOffer(e){const t={iceUfrag:"",icePwd:"",medias:[]};for(const r of e.split(`\r +`))r.startsWith("m=")?t.medias.push(r.slice(2)):t.iceUfrag===""&&r.startsWith("a=ice-ufrag:")?t.iceUfrag=r.slice(12):t.icePwd===""&&r.startsWith("a=ice-pwd:")&&(t.icePwd=r.slice(10));return t}generateSdpFragment(e,t){const r={};for(const d of t){const c=d.sdpMLineIndex;r[c]===void 0&&(r[c]=[]),r[c].push(d)}let s="a=ice-ufrag:"+e.iceUfrag+`\r +a=ice-pwd:`+e.icePwd+`\r +`,n=0;for(const d of e.medias){if(r[n]!==void 0){s+="m="+d+`\r +a=mid:`+n+`\r +`;for(const c of r[n])s+="a="+c.candidate+`\r +`}n++}return s}async loadStream(){try{const e=await fetch(this.whepUrl,{method:"OPTIONS"}),t={iceServers:this.linkToIceServers(e.headers.get("Link")),sdpSemantics:"unified-plan"};this.pc=new RTCPeerConnection(t),this.pc.addTransceiver("video",{direction:"recvonly"}),this.pc.onicecandidate=s=>{this.restartTimeout===null&&s.candidate!==null&&(this.sessionUrl===""?this.queuedCandidates.push(s.candidate):this.sendLocalCandidates([s.candidate]))},this.pc.oniceconnectionstatechange=()=>{var s;this.restartTimeout===null&&((s=this.pc)==null?void 0:s.iceConnectionState)==="disconnected"&&(l.warn("[WebrtcMediamtxCamera] peer connection disconnected"),this.onError())},this.pc.ontrack=s=>{this.cameraVideo.srcObject=s.streams[0]};const r=await this.pc.createOffer();this.offerData=this.parseOffer(r.sdp??""),this.pc.setLocalDescription(r),this.sendOffer(r)}catch(e){l.error("[WebrtcMediamtxCamera] error on loadStream",e),this.onError()}}onError(){this.restartTimeout===null&&(this.pc!==null&&(this.pc.close(),this.pc=null),this.restartTimeout=window.setTimeout(()=>{this.restartTimeout=null,this.loadStream()},2e3),this.sessionUrl&&(fetch(this.sessionUrl,{method:"DELETE"}),this.sessionUrl=""),this.queuedCandidates=[])}async sendLocalCandidates(e){try{const t=await fetch(this.sessionUrl,{method:"PATCH",headers:{"Content-Type":"application/trickle-ice-sdpfrag","If-Match":"*"},body:this.generateSdpFragment(this.offerData,e)});switch(t.status){case 204:break;case 404:throw new Error("stream not found");default:throw new Error(`bad status code ${t.status}`)}}catch(t){l.error("[WebrtcMediamtxCamera] error on sendLocalCandidates",t),this.onError()}}onRemoteAnswer(e){var t;this.restartTimeout===null&&((t=this.pc)==null||t.setRemoteDescription(new RTCSessionDescription({type:"answer",sdp:e})),this.queuedCandidates.length!==0&&(this.sendLocalCandidates(this.queuedCandidates),this.queuedCandidates=[]))}async sendOffer(e){try{const t=await fetch(this.whepUrl,{method:"POST",headers:{"Content-Type":"application/sdp"},body:e.sdp});switch(t.status){case 201:break;case 404:throw new Error("stream not found");default:throw new Error(`bad status code ${t.status}`)}this.sessionUrl=new URL(t.headers.get("location")??"",this.baseUrl).toString();const r=await t.text();this.onRemoteAnswer(r)}catch(t){l.error("[WebrtcMediamtxCamera] error on sendOffer",t),this.onError()}}get baseUrl(){const e=this.buildAbsoluteUrl(this.camera.stream_url||"");return e.pathname.endsWith("/")||(e.pathname+="/"),e}startPlayback(){this.whepUrl=new URL("whep",this.baseUrl).toString(),this.loadStream()}stopPlayback(){this.sessionUrl="",this.queuedCandidates=[],this.restartTimeout&&(clearTimeout(this.restartTimeout),this.restartTimeout=null),this.pc&&(this.pc.close(),this.pc=null),this.cameraVideo.src="",this.cameraVideo.srcObject=null}};u([g("streamingElement")],h.prototype,"cameraVideo",2);h=u([C({})],h);var U=function(){var a=this,e=a._self._c;return a._self._setupProxy,e("video",{ref:"streamingElement",style:a.cameraStyle,attrs:{autoplay:"",playsinline:"",muted:"",crossorigin:a.crossorigin},domProps:{muted:!0}})},_=[],v=b(h,U,_,!1,null,null);const x=v.exports;export{x as default}; diff --git a/fluidd/assets/WebrtcMediamtxCamera-G0N7e5mu.js b/fluidd/assets/WebrtcMediamtxCamera-G0N7e5mu.js new file mode 100644 index 0000000..d3b5b62 --- /dev/null +++ b/fluidd/assets/WebrtcMediamtxCamera-G0N7e5mu.js @@ -0,0 +1,7 @@ +var m=Object.defineProperty;var f=(i,a,e)=>a in i?m(i,a,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[a]=e;var o=(i,a,e)=>f(i,typeof a!="symbol"?a+"":a,e);import{m as p,C as w,k as l,f as C,R as g,j as b}from"./index-4UonB8GV.js";var T=Object.defineProperty,y=Object.getOwnPropertyDescriptor,u=(i,a,e,t)=>{for(var r=t>1?void 0:t?y(a,e):a,s=i.length-1,n;s>=0;s--)(n=i[s])&&(r=(t?n(a,e,r):n(r))||r);return t&&r&&T(a,e,r),r};let h=class extends p(w){constructor(){super(...arguments);o(this,"cameraVideo");o(this,"whepUrl","");o(this,"sessionUrl","");o(this,"pc",null);o(this,"restartTimeout",null);o(this,"offerData",null);o(this,"queuedCandidates",[])}unquoteCredential(e){return JSON.parse(`"${e}"`)}linkToIceServers(e){return e!==null?e.split(", ").map(t=>{const r=t.match(/^<(.+?)>; rel="ice-server"(; username="(.*?)"; credential="(.*?)"; credential-type="password")?/i),s={urls:[r[1]]};return r[3]!==void 0&&(s.username=this.unquoteCredential(r[3]),s.credential=this.unquoteCredential(r[4]),s.credentialType="password"),s}):[]}parseOffer(e){const t={iceUfrag:"",icePwd:"",medias:[]};for(const r of e.split(`\r +`))r.startsWith("m=")?t.medias.push(r.slice(2)):t.iceUfrag===""&&r.startsWith("a=ice-ufrag:")?t.iceUfrag=r.slice(12):t.icePwd===""&&r.startsWith("a=ice-pwd:")&&(t.icePwd=r.slice(10));return t}generateSdpFragment(e,t){const r={};for(const d of t){const c=d.sdpMLineIndex;r[c]===void 0&&(r[c]=[]),r[c].push(d)}let s="a=ice-ufrag:"+e.iceUfrag+`\r +a=ice-pwd:`+e.icePwd+`\r +`,n=0;for(const d of e.medias){if(r[n]!==void 0){s+="m="+d+`\r +a=mid:`+n+`\r +`;for(const c of r[n])s+="a="+c.candidate+`\r +`}n++}return s}async loadStream(){try{const e=await fetch(this.whepUrl,{method:"OPTIONS"}),t={iceServers:this.linkToIceServers(e.headers.get("Link")),sdpSemantics:"unified-plan"};this.pc=new RTCPeerConnection(t),this.pc.addTransceiver("video",{direction:"recvonly"}),this.pc.onicecandidate=s=>{this.restartTimeout===null&&s.candidate!==null&&(this.sessionUrl===""?this.queuedCandidates.push(s.candidate):this.sendLocalCandidates([s.candidate]))},this.pc.oniceconnectionstatechange=()=>{var s;this.restartTimeout===null&&((s=this.pc)==null?void 0:s.iceConnectionState)==="disconnected"&&(l.warn("[WebrtcMediamtxCamera] peer connection disconnected"),this.onError())},this.pc.ontrack=s=>{this.cameraVideo.srcObject=s.streams[0]};const r=await this.pc.createOffer();this.offerData=this.parseOffer(r.sdp??""),this.pc.setLocalDescription(r),this.sendOffer(r)}catch(e){l.error("[WebrtcMediamtxCamera] error on loadStream",e),this.onError()}}onError(){this.restartTimeout===null&&(this.pc!==null&&(this.pc.close(),this.pc=null),this.restartTimeout=window.setTimeout(()=>{this.restartTimeout=null,this.loadStream()},2e3),this.sessionUrl&&(fetch(this.sessionUrl,{method:"DELETE"}),this.sessionUrl=""),this.queuedCandidates=[])}async sendLocalCandidates(e){try{const t=await fetch(this.sessionUrl,{method:"PATCH",headers:{"Content-Type":"application/trickle-ice-sdpfrag","If-Match":"*"},body:this.generateSdpFragment(this.offerData,e)});switch(t.status){case 204:break;case 404:throw new Error("stream not found");default:throw new Error(`bad status code ${t.status}`)}}catch(t){l.error("[WebrtcMediamtxCamera] error on sendLocalCandidates",t),this.onError()}}onRemoteAnswer(e){var t;this.restartTimeout===null&&((t=this.pc)==null||t.setRemoteDescription(new RTCSessionDescription({type:"answer",sdp:e})),this.queuedCandidates.length!==0&&(this.sendLocalCandidates(this.queuedCandidates),this.queuedCandidates=[]))}async sendOffer(e){try{const t=await fetch(this.whepUrl,{method:"POST",headers:{"Content-Type":"application/sdp"},body:e.sdp});switch(t.status){case 201:break;case 404:throw new Error("stream not found");default:throw new Error(`bad status code ${t.status}`)}this.sessionUrl=new URL(t.headers.get("location")??"",this.baseUrl).toString();const r=await t.text();this.onRemoteAnswer(r)}catch(t){l.error("[WebrtcMediamtxCamera] error on sendOffer",t),this.onError()}}get baseUrl(){const e=this.buildAbsoluteUrl(this.camera.stream_url||"");return e.pathname.endsWith("/")||(e.pathname+="/"),e}startPlayback(){this.whepUrl=new URL("whep",this.baseUrl).toString(),this.loadStream()}stopPlayback(){this.sessionUrl="",this.queuedCandidates=[],this.restartTimeout&&(clearTimeout(this.restartTimeout),this.restartTimeout=null),this.pc&&(this.pc.close(),this.pc=null),this.cameraVideo.src="",this.cameraVideo.srcObject=null}};u([g("streamingElement")],h.prototype,"cameraVideo",2);h=u([C({})],h);var U=function(){var a=this,e=a._self._c;return a._self._setupProxy,e("video",{ref:"streamingElement",style:a.cameraStyle,attrs:{autoplay:"",playsinline:"",muted:"",crossorigin:a.crossorigin},domProps:{muted:!0}})},_=[],v=b(h,U,_,!1,null,null);const x=v.exports;export{x as default}; diff --git a/fluidd/assets/af-mps6ICIQ.js b/fluidd/assets/af-mps6ICIQ.js new file mode 100644 index 0000000..2fc8140 --- /dev/null +++ b/fluidd/assets/af-mps6ICIQ.js @@ -0,0 +1 @@ +var e={app:{bedmesh:{label:{active:"aktief",box_scale:"Skaal",flat_surface:"Wys platvlak",mesh_matrix:"Maasmatriks",probed_matrix:"Gemete matriks",profile_name:"Profielnaam",remove_profile:"Vee %{name} profiel uit",scale:"Kleurskaal",wireframe:"Draadraam"},msg:{hint:"As jy hierdie onder 'n ander naam as %{name} stoor, kan jy kies om die %{name} profiel ook uit te vee",not_found:"Geen bestaande bedmaas is gevind nie.",not_loaded:"Geen maas is gelaai nie"},tooltip:{calibrate:"Begin nuwe kalibrasie, stoor as 'default' profiel",delete:"Vee Profiel Uit",load:"Laai Profiel",save:"Stoor gekalibreerde profiel na printer.cfg"}},chart:{label:{current:"Tans",item:"Naam",power:"Drywing",target:"Teiken",rate_of_change:"Verandering"},tooltip:{help:"Hou shift in om te zoem.
Klik op 'n item om dit aan en af te skakel op die grafiek.
Klik 'n drywing om dit aan en af te skakel op die grafiek."}},console:{label:{auto_scroll:"Rol outomaties aan",flip_layout:"Keer uitleg om",hide_temp_waits:"Versteek temp. wagtye"},placeholder:{command:"'tab' vir outo-voltooi, 'help' vir opdragte 'pyltjies' vir geskiedenis"}},endpoint:{error:{cant_connect:"Iets is verkeerd, fluidd kan nie die bestemming bereik nie. Is jy seker die adres is korrek?",cors_error:"geblok deur die CORS beleid",cors_note:'Dit mag wees dat die moonraker-konfigurasie opdateer moet word. Sien die dokumentasie vir multi-drukker opstellings here'},hint:{add_printer:"Bv., http://fluiddpi.local"},msg:{trouble:'Sukkel jy? Sien hier vir meer inligting.'},tooltip:{endpoint_examples:"Voer jou API URL in.
Hier is voorbeelde;
fluidd.local, https://192.168.1.150
"}},endstop:{label:{open:"OOP",triggered:"GESNELLER"},msg:{subtitle:"Gebruik die vervrisknop om die endstop status op te dateer."}},file_system:{filters:{label:{print_start_time:"Filter druktyd.",hidden_files_folders:"Filter versteekte lêers and vouers.",klipper_backup_files:"Filter Klipper rugsteunlêers.",rolled_log_files:"Filter log-lêers wat oorgeslaan het."}},label:{dir_name:"Vouernaam",disk_usage:"Skyfverbruik",diskinfo:"Skyfinligting",downloaded:"Afgelaai",file_name:"Lêernaam",transfer_rate:"Spoed",uploaded:"Opgelaai",view_section_documentation:"Sien '%{section}' dokumentasie",hour:"uur",minute:"minuut",second:"sekond"},msg:{not_found:"Geen lêers gevind nie",processing:"Verwerk tans"},overlay:{drag_files_folders_upload:"Sleep lêers en vouers hier om op te laai",drag_files_enqueue:"Sleep lêers hier om dit op die waglys te plaas"},title:{add_dir:"Voeg Vouer By",add_file:"Voeg Lêer By",command_palette:"Opdraglys",download_file:"Lêer word afgelaai",duplicate_dir:"Dupliseer Vouer",duplicate_file:"Dupliseer Lêer",go_to_file:"Gaan na lêer",rename_dir:"Herbenoem Vouer",rename_file:"Herbenoem Lêer",upload_file:"Lêer word opgelaai | Lêers word opgelaai",check_filament:"Kontroleer Draadstof"},tooltip:{low_on_space:"Stoorspasie is min",root_disabled:"{root} root is nie beskikbaar nie. Sien die logs.",warning_text:"Voeg asseblief die tipes materiaal in die materiaalbak toe, of verminder die tipes materiaal wat die model gebruik.",tip:"Kies die te gebruik materiaal. Bovenaan is die materiaal wat die model gebruik, en onderaan is die ooreenstemmende materiaal in die materiaalbak."},url:{klipper_config:"%{klipperDomain}/Config_Reference.html#%{hash}",moonraker_config:"https://moonraker.readthedocs.io/en/latest/configuration/#%{hash}",moonraker_telegram_bot_config:"https://github.com/nlef/moonraker-telegram-bot/wiki/Sample-config#%{hash}",crowsnest_config:"https://crowsnest.mainsail.xyz/configuration/%{hash}-section"}},gcode:{btn:{load_current_file:"Laai Huidige Lêer"},label:{current_layer_height:"Huidige laaghoogte",exclude_object:"Sluit voorwerp uit",follow_progress:"Volg vordering",layer:"Laag",layers:"Lae",parsed:"Ontleed",show_current_layer:"Wys die huidige laag",show_extrusions:"Wys ekstrusies",show_moves:"Wys bewegings",show_next_layer:"Wys volgende laag",show_parts:"Wys parte",show_previous_layer:"Wys vorige laag",show_retractions:"Wys terugtrekkings",parsing_file:"Ontleed tans lêer"},msg:{confirm:'Die lêer "%{filename}" is %{size}, dit mag hulpbronintensief wees vir jou stelsel. Is jy seker?'}},general:{btn:{abort:"Staak",accept:"Aanvaar",add:"Voeg By",add_dir:"Voeg Vouer By",add_file:"Voeg Lêer By",add_printer:"Voeg Drukker By",add_to_queue:"Plaas op die druklys",adjust_layout:"Verander paneelskerm uitleg",adjusted:"Aangepas",all:"Alles",auth_unsure:"Onseker waarom jy hierdie sien?",calibrate:"Kalibreer",cancel:"Kanselleer",clear_profile:"Maak Profiel Skoon",close:"Maak toe",config_reference:"Konfigurasieverwysings",create_zip_archive:"Skep ZIP-Argief",delete:"Vee Uit",download:"Laai Af",duplicate:"Dupliseer",edit:"Verander",exit_layout:"Maak uileg toe",extrude:"Druk Uit",filter:"Filter",forgot_password:"Wagwoord vergeet?",go_to_file:"Gaan na lêer",heaters_off:"Verwarmers af",job_queue:"Druklys",load_all:"Laai alles",login:"Teken in",logout:"Teken uit",more_information:"Meer inligting",pause:"Pouse",preheat:"Voorverhit",presets:"Voorafinstellings",preview_gcode:"Gcode-Voorskou",print:"Druk",quad_gantry_level:"QGL",reboot:"Herbegin",recover:"Herwin",refresh:"Vervris",refresh_metadata:"Vervris Metadata",reload:"Herlaai",remove:"Verwyder",remove_all:"Verwyder Alles",rename:"Herbenoem",reprint:"Druk weer",reset_file:"Maak Lêer Skoon",reset_layout:"Stel terug na verstekuitleg",reset_default_layout:"Herstel Verstekuitleg",restart_firmware:"Herlaai Fermware",restart_service:"Herlaai %{service}",restart_service_klipper:"Herbegin Klipper",restart_service_moonraker:"Herbegin Moonraker",resume:"Hervat",retract:"Trek terug",return_dashboard:"Gaan terug na paneelskerm",save:"Stoor",save_as:"Stoor As",save_restart:"Stoor en herbegin",save_config_and_restart:"Stoor konfigurasie & herlaai",select_columns:"Kies kolomme",send:"Stuur",set_color:"Stel Kleur",set_default_layout:"Stel as Verstekuitleg",shutdown:"Skakel af",snooze:"Slaap",socket_reconnect:"Herkonnekteer",socket_refresh:"Vervris",thumbnail_size:"Duimnaelgrootte",upload:"Laai op",upload_files:"Laai lêers Op",upload_folder:"Laai Vouers Op",upload_print:"Laai Op en Druk",view:"Bekyk",reset_stats:"Herstel Statistieke"},error:{app_setup_link:'Fluidd opstellingsvereistes kan hier gevind word.',app_warnings_found:"%{appName} waarskuwings gevind.",components_config:'Moonraker-toevoegingkonfigurasie kan hier gevind word.',failed_components:"Moonraker het toevoegings wat gefaal het, gaan asb. die logs na, dateer die konfigurasie op en herlaai moonraker."},label:{accel_to_decel:"Versnel. tot Vertraag.",acceleration:"Versnelling",accepted_screws:"Aanvaarde skroewe",actual_time:"Tans",add_camera:"Voeg Kamera by",add_filter:"Voeg Filter by",add_preset:"Voer Voorafinstellings by",add_user:"Voeg gebruiker by",all:"Alles",api_key:"API Sleutel",api_url:"API URL",auth_source:"Verifikasiebron",category:"Kategorie",change_password:"Verander wagwoord",clear_all:"Maak alles skoon",color:"Kleur",command:"Opdrag",confirm:"Bevestig",current_password:"Huidige wagwoord",current_user:"Huidige gebruiker",default:"Verstek",disabled_while_printing:"Gedeaktiveer tydens drukwerk",edit_camera:"Verander Kamera",edit_filter:"Verander Filter",edit_preset:"Verander Voorafinstelling",edit_user:"Verander Gebruiker",extrude_length:"Ekstrusielengte",extrude_speed:"Ekstrusiespoed",filament:"Filament",file:"Lêer",finish_time:"Klaar",flow:"Vloei",free:"vry",heaters_busy:"Die drukker is tans besig. Die druktaak mag faal as die verwarmers nou afgeskakel word.",high:"Hoog",host:"Host",layer:"Laag",layout:"Uitleg",ldap:"LDAP",longest_job:"Langste druktaak",low:"Low",manage_accounts:"Bestuur Rekeninge",user_managed_source:"Gebruiker word bestuur deur %{source} verifikasie",m117:"M117",moonraker:"Moonraker",name:"Naam",new_password:"Nuwe wagwoord",no_notifications:"Geen kennisgewings",on:"Aan",off:"Af",numeric_prefix_sort:"Volgens numeriese voorvoegsel",password:"Wagwoord",partial_of_total:"%{partial} van %{total}",pause_at_layer:"Pouseer by laag",pause_at_next_layer:"Pouseer by volgende laag",pause_at_layer_number:"Pouseer by laagnommer",power:"Krag",pressure_advance:"Druk-vooruitgang",printers:"Drukkers",progress:"Vordering",requested_speed:"Spoed",retract_length:"Terugtreklengte",retract_speed:"Terugtrekspoed",save_as:"Stoor As",screw_index:"Skroefindeks",screw_name:"Skroefnaam",screw_number:"Skroef %{index}",services:"Dienste",slicer:"Slicer",smooth_time:"Uitgladtyd",speed:"Spoed",sqv:"Reghoeksnelheid",stepper_enabled:"Stapper Aangeskakel",synced_extruder:"Gesinchroniseerde Ekstruder",thumbnail_size:"Duimnaelgrootte",total:"Totaal",total_filament:"Totale filament gebruik",total_filament_avg:"Gem. per druktaak",total_jobs:"Totale druktake",total_print_time:"Totale druktyd",total_print_time_avg:"Gem. per druktaak",total_time:"Totale tyd",total_time_avg:"Gem. per druktaak",turn_device_on:"Skakel %{device} aan",turn_device_off:"Skakel %{device} af",uncategorized:"Ongekategoriseerd",unretract_extra_length:"na-terugtrek ekstra lengte",unretract_speed:"na-terugtrek-spoed",upload_and_print:"Laai Op en Druk",used:"gebruik",username:"Gebruikersnaam",velocity:"Snelheid",version_sort:"Volgens weergawe",visible:"Sigbaar",z_offset:"Z-Afset",unsaved_changes:"Ongestoorde Veranderinge",alias:"Alias",apply_z_offset:"Pas toe en Stoor Z_Offset",edit_category:"Verander kategorie",add_category:"Voeg kategorie by",file_time:"Lêer"},msg:{password_changed:"Wagwoord is verander",wrong_password:"Gits, iets het verkeerd gegaan. Is die wagwoord korrek?",bed_screws_adjust:"Klik Aangepas as 'n noemenswaardige verstelling van die huidige skroef nodig is; anders, klink Aanvaar om te begin.",welcome_back:"Welkom terug.
Teken hier onder in om in verbinding te bly met jou drukker.",offline_ready:"Fluidd is nou gereed om vanlyn te werk.",needs_refresh:"Nuwe inhoud beskikbaar, druk die Herlaai knoppie om op te dateer.",pending_configuration_sections_deleted:"Die volgende afdelings is gemerk om uitgevee te word",rolledover_logs:"Die volgende toepassing-logs het oorgeslaan: %{applications}"},simple_form:{error:{arrayofnums:"Slegs nommers",credentials:"Ongeldige intekenbesonderhede",exists:"Bestaan reeds",invalid_number:"Ongeldige nommer",invalid_url:"Ongeldige URL",invalid_expression:"Ongeldige uitdrukking",max:"Maks %{max}",min:"Min %{min}",min_or_0:"Min %{min} of 0",password_username:"Gebruikersnaam nie gevind",required:"Vereis",invalid_aspect:"Ongeldige verhouding"},msg:{confirm:"Is jy seker?",confirm_delete:"Is jy seker? Die geselekteerde item gaan uitgevee word. | Is jy seker? Die {count} geselekteerde items gaan uitgevee word.",confirm_exclude_object:"Is jy seker jy wil hierdie item uitlaat om te druk?",confirm_forcemove_toggle:"Is jy seker? Dit kan die drukker beskadig.",confirm_reboot_host:"Is jy seker? Hierdie gaan die stelsel herbegin.",confirm_shutdown_host:"Is jy seker? Hierdie gaan die bedryfstelsel afskakel.",confirm_service_start:"Is jy seker jy wil die %{name} diens begin loop?",confirm_service_restart:"Is jy seker jy wil die diens %{name} herlaai?",confirm_service_stop:"Is jy seker jy wil die diens %{name} stop?",confirm_power_device_toggle:"Is jy seker? Hierdie gaan die krag afsit.",unsaved_changes:"Daar is ongestoorde veranderinge. Is jy seker jy wil die lêer toe maak?",no_file_preview:"%{name} het tans geen voorskou beskikbaar nie."}},table:{header:{actions:"Aksies",chamber_temp:"Kamertemp.",end_time:"Geëindig",estimated_time:"Geraamde tyd",filament:"Filament",filament_name:"Filamentnaam",filament_type:"Filamenttipe",filament_used:"Filament gebruik",filament_weight_total:"Filamentgewig",first_layer_bed_temp:"Eerstelaag bedtemp.",first_layer_extr_temp:"Eerstelaag ekstrudertemp.",first_layer_height:"Eerstelaaghoogte",height:"Hoogte",last_printed:"Laas gedruk",layer_height:"Laaghoogte",modified:"Verander",name:"Naam",nozzle_diameter:"Mondstukdeursnee",print_duration:"Druktydsduur",time_added:"Tyd bygevoeg",time_in_queue:"Tyd op werklys",size:"Grootte",slicer:"Slicer",slicer_version:"Slicer weergawe",start_time:"Begin",status:"Status",total_duration:"Totale tydsduur"}},title:{add_chart:"Voeg Grafiek By",add_printer:"Voeg Drukker By",bedmesh:"Bedmaas",bedmesh_controls:"Bedmaaskontrole",camera:"Kamera | Kameras",config_files:"Konfigurasielêers",configure:"Konfigurasie",console:"Konsole",diagnostics:"Diagnostiek",edit_chart:"Verander Grafiek",endstops:"Endstoppe",fans_outputs:"Waaiers & Uitrees",gcode_preview:"Gcode-Voorskou",history:"Geskiedenis",home:"Tuis",jobs:"Druktake",job_queue:"Werkslys",limits:"Drukkerlimiete",macros:"Makro's",metrics_explorer:"Metriekverkenner",not_found:"404 Nie gevind nie",other_files:"Ander lêers",pending_configuration_changes:"Hangende Konfigurasieveranderinge",retract:"Fermware-Terugtrekking",rollover_logs:"Laat logs oorslaan",runout_sensors:"Uitloopsensors",settings:"Instellings",stats:"Drukkerstatistiek",system:"Stelsel",system_overview:"Stelselinligting",temperature:"Temperature",timelapse:"Timelapse",tool:"Druktuig",tune:"Stel in"},tooltip:{browse_metrics:"Deursoek beskikbare maatstawwe",estop:"Noodstop",managed_by_moonraker:"Bestuur deur jou moonraker-konfigurasie",notifications:"Kennisgewings",reload_klipper:"Herlaai klipper-konfigurasie.",reload_restart_klipper:"Herlaai klipper-konfigurasie en herbegin MCU's.",restart_klipper:"Herbegin die klipper-stelseldiens.",run_collector:"Laat versamelaar loop",rollover_logs:"Laat logs oorslaan"}},history:{msg:{confirm:"Is jy seker? Hierdie sal alle geskiedenis en drukkerstatistieke uitvee",confirm_jobs:"Is jy seker? Hierdie sal alle druktake uitvee.",confirm_stats:"Is jy seker? Hierdie sal alle statistieke uitvee."}},job_queue:{msg:{confirm:"Is jy seker? Hierdie sal die hele drukker se werkslys uitvee."}},printer:{state:{busy:"Besig",cancelled:"Gekanselleer",complete:"Klaar",idle:"Onaktief",loading:"Laai tans",paused:"Gepouseer",printing:"Druk tans",ready:"Gereed",standby:"Op bystand"}},setting:{btn:{add_camera:"Voeg Kamera By",add_category:"Voeg Kategorie By",add_filter:"Voeg Filter By",add_metric:"Voeg Maatstaf By",add_thermal_preset:"Voeg Voorafinstelling By",add_user:"Voeg Gebruiker By",reset:"Herstel",select_theme:"Kies Tema"},camera_type_options:{mjpegadaptive:"MJPEG Aanpassend",mjpegstream:"MJPEG Stroom",hlsstream:"HLS Stroom",webrtc_camera_streamer:"WebRTC (kamera-stroom)",video:"IP Kamera",iframe:"HTTP blad"},camera_rotate_options:{90:"90°",180:"180°",270:"270°",none:"Geen"},label:{all_off:"Alles af",all_on:"Alles aan",aspect_ratio:"Beeldverhouding",aspect_ratio_format:"[wydte : hoogte]",auto_edit_extensions:"Lêer-tipes om outomaties oop te maak",auto_follow_on_file_load:"Volg vordering outmaties wanneer lêer gelaai word",auto_load_on_print_start:"Laai lêer outomaties wanneer druktaak begin",auto_load_mobile_on_print_start:"Laai lêer outomaties op mobiele toestelle",axes:"Asse",camera_flip_x:"Keer horisontaal om",camera_flip_y:"Keer vertikaal om",camera_fullscreen_action:{title:"Volskermaksie",embed:"Bed in",rawstream:"Rou stroom"},camera_rotate_by:"Draai met",camera_stream_type:"Stroomtipe",card:"Kaart",collector:"Versamelaar",confirm_on_estop:"Bevestig 'n Noodstop",confirm_on_power_device_change:"Bevestig toestelkragveranderinge",confirm_on_save_config_and_restart:"Hersien hangende konfigurasieveranderinge voor Stoor-en-Herlaai.",confirm_dirty_editor_close:"Bevestig voordat redigeerder toegemaak word met ongestoorde veranderinge",contains:"Bevat",dark_mode:"Donkermodus",dashed:"Gestippel",default_extrude_length:"Verstek ekstrusielength",default_extrude_speed:"Verstek ekstrusiespoed",default_min_layer_height:"Verstel minimum laaghoogte",default_toolhead_move_length:"Verstek druktuigbeweeglengte",default_toolhead_xy_speed:"Verstek druktuig-XY-spoed",default_toolhead_z_speed:"Verstek druktuig-Z-spoed",dotted:"Gestippel",draw_background:"Teken Agtergrond",enable:"Skakel aan",enable_diagnostics:"Skakel diagnostiek aan",enable_notifications:"Skakel kennisgewings aan",expression:"Uitdrukking",extrusion_line_width:"Ekstrusielynwydte",flip_horizontal:"Keer Horisontaal Om",flip_vertical:"Keer Vertikaal Om",fill_color:"Vulkleur",fill_opacity:"Vuldeursigtigheid",filter:"Filter | Filters",fps_target:"FPS Teiken",fps_idle_target:"FPS Teiken wanneer uit fokus",height:"Hoogte",gcode_coords:"Gebruik GCode-koordinate",icon:"Ikoon",invert_x_control:"Keer X-beheer om",invert_y_control:"Keer Y-beheer om",invert_z_control:"Keer Z-beheer om",language:"Vertoontaal",last_result:"Laaste resultaat",left_y:"Linker Y-As",line_color:"Lynkleur",line_style:"Lynstyl",min:"Minimum",max:"Maximum",metrics:"Maatstawwe",move_line_width:"Beweeg-lynwydte",name:"Naam",never:"Nooit",none:"Geen",optional:"Opsioneel",power_toggle_in_top_nav:"Kragskakelaar in boonste navigasiebalk",primary_color:"Primêre Kleur",printer_name:"Drukkernaam",reset:"Herstel Instellings",retraction_icon_size:"Terugtrekking-Ikoongrootte",right_y:"Linker Y-As",save_and_restore_view_state:"Stoor en keer terug",show_animations:"Wys animasies",show_barometric_pressure:"Wys barometriese druk",show_code_lens:"Wys CodeLens",show_gas_resistance:"Wys gasweerstand",show_legend:"Wys verduideliking",show_rate_of_change:"Wys temperatuur tempo-van-verandering",show_relative_humidity:"Wys relatiewe humiditeit",show_save_config_and_restart:"Toon Stoor-Konfigurasie-en-Herlaai knop in boonste navigasiebalk",show_upload_and_print:"Toon Laai-Op-en-Druk knop in boonste navigasiebalk",solid:"Solied",starts_with:"Begin met",theme_preset:"Gemeenskapsinstelling",thermal_preset_gcode:"GCode",thermal_preset_name:"Voorafinstellingnaam",title:"Titel",to_browser_local_storage:"Na webblaaier se plaaslike stoorspasie",to_browser_session_storage:"Na webblaaier se sessie-stoorspasie",toolhead_move_distances:"Druktuig afstandwaardes",type:"Tipe",unit:"Eenheid",z_adjust_values:"Z-Verstelwaardes",date_format:"Datumformaat",time_format:"Tydformaat",text_sort_order:"Tekssorteervolgorde",force_move_toggle_warning:"Bevestig voordat FORCE_MOVE aangeskakel word",show_manual_probe_dialog_automatically:"Wys Handmatige-probe-dialoog outomaties",show_bed_screws_adjust_dialog_automatically:"Wys bedskroefverstelling-dialoog outomaties"},timer_options:{duration:"Slegs Tydsduur",filament:"Filamentskatting",file:"Lêerskatting",slicer:"Slicer"},title:{authentication:"Magtiging",console:"Konsole",camera:"Kamera | Kameras",file_editor:"Lêerredigeerder",gcode_preview:"Gcode-Voorskou",general:"Algemeen",macros:"Makro's",theme:"Tema",thermal_presets:"Temperatuur-Voorafinstellings",tool:"Druktuig"},tooltip:{diagnostics_performance:"[BETA] Die loghou van diagnostieke inligting mag die prestasie beïnvloed.",gcode_coords:"Gebruik GCode posisie i.p.v. druktuigposisie op paneelblad",show_manual_probe_dialog_automatically:"Wys hulpdialoog outomaties wanneer 'n probe met die hand uitgevoer word",show_bed_screws_adjust_dialog_automatically:"Wys hulpdialoog outomaties wanneer BED_SCREWS_ADJUST geloop word"}},socket:{msg:{connecting:"Konnekteer tans aan moonraker...",no_connection:"Geen moonraker-konneksie nie. Gaan moonraker-status na en / of vervris."}},system_info:{label:{capacity:"Kapasiteit",cpu_desc:"CPU Beskrywing",distribution_codename:"Kodenaam",distribution_like:"Distribusie soos",distribution_name:"Distribusie",frequency:"Frekwensie",hardware_desc:"Hardewarebeskrywing",hostname:"Hostname",klipper_load:"Klipper-Lading",manufactured:"Vervaardig",manufacturer:"Vervaardiger",mcu_awake:"{mcu} Wakkertyd",mcu_bandwidth:"{mcu} Bandwydte",mcu_information:"{mcu} Inligting",mcu_load:"{mcu}-Lading",micro_controller:"Mikrobeheerder",model:"CPU Model",moonraker_load:"Moonraker-Lading",network:"Netwerk",processor_desc:"Verwerker",product_name:"Produknaam",serial_number:"Serienommer",system_load:"Stelsel-lading",system_memory:"Stelselgeheue",system_utilization:"Stelselbenutting",total_memory:"Totale Geheue",operating_system:"Bedryfstelsel",version:"Weergawe",virtualization:"Virtualisasie"}},tool:{btn:{home_x:"X",home_y:"Y",home_all:"Almal"},title:{bed_screws_adjust:"Bedskroefverstelling",manual_probe:"Handmatige Probe"},tooltip:{absolute_positioning:"Absolute Posisionering",extruder_disabled:"ekstruder gedeaktiveer, onder min_extrude_temp (%{min}°C)",home_xy:"Bring XY tuis",home_z:"Bring Z tuis",manual_probe:"Handmatige Probe",motors_off:"Motors Af",relative_positioning:"Relatiewe Posisionering",tools:"Gereedskap"},label:{stats_active_extruder:'Die huidige ekstruderkonfigurasie is gestel vir %{filamentDiameter} mm diameter filament en %{nozzleDiameter} mm mondstuk',stats_volumetric_flow:`Extruder voer teen %{extrudeSpeed} mm/s, Die ekstruder behoort 'n geskatte volumetriese vloei van %{estimatedVolumetricFlow} mm³/s te handhaaf`,stats_extruded_length:`Die invoer van %{extrudeLength} mm filament teen %{extrudeFactor} % vloei, lewer 'n geskatte uitgedrukte lengte van %{estimatedExtrudedLength} mm`,stats_max_speed:`Vir 'n %{layerHeight} mm laaghoogte, is die maksimum drukspoed %{estimatedMaxSpeed} mm/s`}},version:{btn:{check_for_updates:"Kyk vir opdaterings",finish:"Klaar",update:"Dateer op",update_all:"Dateer alles op",view_versions:"Sien weergawes"},label:{commit_history:"Commit-Geskiedenis",commits_on:"commits op",committed:"Committed",dirty:"DIRTY",invalid:"FOUTIEF",os_packages:"OS Pakette",package_list:"Paketlys",up_to_date:"OP DATUM",updates_available:"Opdaterings is Beskikbaar"},status:{finished:"Opdatering is klaar",updating:"Dateer tans op..."},title:"Sagtewareopdaterings",tooltip:{commit_history:"Commit-geskiedenis",dirty:"indicates a detached head, not on master or an invalid origin",invalid:"dui op plaaslike veranderinge aan die repo",packages:"Pakette",release_notes:"Vrystellingsnotas"}},timelapse:{btn:{render:"Vertoon",save_frames:"Stoor Rame"},error:{newframe:"Fout met neem van timelapse raam"},label:{frames:"%{frames} raam | %{frames} rame",length:"Geskatte lengte: %{length}",frame:"Raam | Rame"},title:{timelapse_settings:"Timelapse instellings",timelapse_status:"Timelapse status",render_settings:"Vertoningsinstellings"},setting:{enable:"Aangeskakel",auto_render:"Outovertoon",crf:"Konstantetempofaktor",duplicatelastframe:"Dupliseer laaste rame",fw_retract:"Gebruik Fermware-terugtrekking",gcode_verbose:"Verbose Gcode",mode:"Modus",mode_layermacro:"Laagmakro",mode_hyperlapse:"Hiperlapse",hyperlapse_cycle:"Hiperlapse Siklus",output_framerate:"Uittreeraamtempo",park_retract_distance:"Parkeer-terugtrekafstand",park_retract_speed:"Parkeer-terugtrekspoed",park_extrude_distance:"Parkeer-ekstrusieafstand",park_extrude_speed:"Parkeer-ekstrusiespoed",parkhead:"Parkeer druktuig",park_time:"Parkeertyd",park_travel_speed:"Parkeerbewegingspoed",park_custom_pos_x:"Parkeerposisie X",park_custom_pos_y:"Parkeerposisie Y",park_custom_pos_dz:"Parkeerposisie Z-Hop",parkpos:{label:"Parkeerposisie",custom:"Pasgemaak",front_left:"Voor-Links",front_right:"Voor-Regs",center:"Middel",back_left:"Agter-Links",back_right:"Agter-Regs",x_only:"Beweeg slegs X",y_only:"Beweeg slegs Y"},previewimage:"Skep Duimnael",saveframes:"Stoor Rame",stream_delay_compensation:"Vertragingkompensasie",targetlength:"Teikenlengte",variable_fps:"Veranderlike FPS",variable_fps_min:"Minimum Raamtempo",variable_fps_max:"Maksimum Raamtempo"}},box:{btn:{uninstall:"Deïnstalleer",load:"Laai in",unload:"Laai uit"},label:{vendor:"Leverancier",filament:"Materiaal",color:"Kleur",title:"Materialenbeheer"},tooltip:{control_filament:"Kontroleer die invoer en uitvoer van materiaal in 'n enkele slot, asook lees data soos kleur en materiaalsoort."}}}};export{e as default}; diff --git a/fluidd/assets/ar-DLWXELLU.js b/fluidd/assets/ar-DLWXELLU.js new file mode 100644 index 0000000..aafbcbd --- /dev/null +++ b/fluidd/assets/ar-DLWXELLU.js @@ -0,0 +1 @@ +var e={app:{bedmesh:{label:{box_scale:"مقياس الصندوق",flat_surface:"عرض سطح مستوي",mesh_matrix:"مصفوفة شبكة",probed_matrix:"مصفوفة Probed",profile_name:"اسم الملف",remove_profile:"حذف %{name}",scale:"مقياس اللون",wireframe:"الاطار"},msg:{hint:"If saving as something other than %{name}, you can choose to also remove the %{name} profile",not_found:"لا يوجد اي شبكة",not_loaded:"لم يتم تحميل شبكة"},tooltip:{calibrate:"Begins a new calibration, saving as profile 'default'",delete:"Delete Profile",load:"Load Profile",save:"Commits calibrated profile to printer.cfg"}},chart:{label:{current:"درجة الحرارة",item:"الاسم",power:"الطاقة",target:"الهدف"},tooltip:{help:"Hold shift to zoom.
Click an item to toggle in the graph.
Click a power to toggle in the graph."}},console:{label:{auto_scroll:"التفاف تلقائي",hide_temp_waits:"Hide temp waits"},placeholder:{command:"'tab' للاكمال التلقائي، 'help' للاوامر 'الاسهم' للاوامر السابقة"}},endpoint:{error:{cant_connect:"Something went wrong, and fluidd can't reach the destination. Are you sure this is the correct address?",cors_error:"blocked by CORS policy",cors_note:'This may mean you need to modify your moonraker configuration. Please see the documentation on multi printer setups here'},hint:{add_printer:"مثلا http://fluiddpi.local"},msg:{trouble:'لديك مشكلة؟ انظر هنا لمزيد من المعلومات'},tooltip:{endpoint_examples:"Enter your API URL.
Some examples might be;
http://fluidd.local, http://192.168.1.150
"}},endstop:{label:{open:"مفتوح",triggered:"مفعل"},msg:{subtitle:"استخدم زر التحديث لتحديث حالة نقطة التوقف."}},file_system:{filters:{label:{print_start_time:"Filter printed"}},label:{dir_name:"اسم المجلد",disk_usage:"استخدام قرص التخزين",diskinfo:"معلومات قرص التخزين",downloaded:"محمل",file_name:"اسم الملف",transfer_rate:"معدل النقل",uploaded:"مرفوع",hour:"ساعة",minute:"دقيقة",second:"ثانية"},msg:{not_found:"لا يوجد ملفات",processing:"جاري المعالجة"},title:{add_dir:"اضافة مجلد",add_file:"اضافة ملف",download_file:"جاري جلب الملف",rename_dir:"اعادة تسمية مجلد",rename_file:"اعادة تسمية ملف",upload_file:"جاري رفع الملف | جاري رفع الملفات",check_filament:"تحقق من المواد"},tooltip:{low_on_space:"مساحة القرص منخفضة",root_disabled:"{root} الجذر غير متوفر الرجاء مراجعة السجل",warning_text:"يرجى إضافة أنواع المواد في صندوق المواد أو تقليل أنواع المواد المستخدمة في النموذج.",tip:"اختر المواد المستخدمة، الأعلى هي المواد المستخدمة في النموذج، والأسفل هي المواد المقابلة في صندوق المواد."}},gcode:{btn:{load_current_file:"تحميل الملف الحالي"},label:{current_layer_height:"ارتفاع الطبقة الحالية",follow_progress:"متابعة التقدم",layer:"طبقة",layers:"طبقات",parsed:"Parsed",show_extrusions:"عرض التدفقات",show_moves:"عرض التنقلات",show_next_layer:"عرض الطبقة التالية",show_previous_layer:"عرض الطبقة السابقة",show_retractions:"عرض التراجعات"},msg:{confirm:'The file "%{filename}" is %{size}, this might be resource intensive for your system. Are you sure?'}},general:{btn:{add:"اضاقة",add_dir:"اضافة مجلد",add_file:"اضافة ملف",add_printer:"اضافة طابعة",adjust_layout:"تعديل تخطيط لوحة المعلومات",all:"الكل",calibrate:"معايرة",cancel:"الغاء الامر",clear_profile:"Clear Profile",close:"اغلاق",config_reference:"مرجع التكوين",download:"تحميل",edit:"تحرير",exit_layout:"الخروج من وضع التخطيط",extrude:"اخراج",heaters_off:"اغلاق المسخنات",load_all:"تحميل الكل",more_information:"المزيد من المعلومات",pause:"ايقاف مؤقت",preheat:"تسخين",presets:"الإعدادات المسبقة",preview_gcode:"Gcode معاينة",quad_gantry_level:"QGL",reboot:"اعادة التشغيل",refresh:"تحديث",remove:"ازالة",remove_all:"ازالة الكل",rename:"اعادة تسمية",reprint:"اعادة الطباعة",reset_file:"اعادة تعيين الملف",reset_layout:"اعادة تعيين التخطيط",restart_firmware:"اعادة تشغيل برنامج الطابعة",restart_service:"%{service} اعادة تشغيل",restart_service_klipper:"Klipper اعادة تشغيل",restart_service_moonraker:"Moonraker اعادة تشغيل",resume:"متابعة",retract:"تراجع",save:"حفظ",save_as:"حفظ باسم",save_restart:"حفظ واعادة تشغيل",send:"ارسال",set_color:"تعيين اللون",shutdown:"ايقاف التشغيل",socket_refresh:"تحديث اجباري",upload:"رفع",upload_print:"رفع وطباعة",view:"عرض"},error:{app_setup_link:'Fluidd setup requirements can be found here.',app_warnings_found:"%{appName} warnings found.",components_config:'Moonraker plugin configuration can be found here.',failed_components:"Moonraker has failed plugins, please check your logs, update your configuration and restart moonraker."},label:{accel_to_decel:"التسارع الى التباطؤ",acceleration:"التسارع",add_camera:"اضافة كاميرا",add_preset:"اضافة اعداد مسبق",add_user:"اضافة مستخدم",api_key:"مفتاح API",api_url:"رابط API",category:"تصنيف",change_password:"تغيير كلمة المرور",clear_all:"مسح الكل",color:"اللون",confirm:"تاكيد",current_password:"كلمة المرور الحالية",disabled_while_printing:"معطل اثناء الطباعة",edit_camera:"تحرير الكاميرا",edit_preset:"تحرير اعداد مسبق",edit_user:"تحرير مستخدم",extrude_length:"طول الاخراج",extrude_speed:"سرعة الاخراج",flow:"التدفق",free:"متاح",high:"High",host:"المضيف",layout:"التخطيط",longest_job:"اطول مهمة",low:"Low",name:"الاسم",new_password:"كلمة مرور جديدة",no_notifications:"لا يوجد تنبيهات",off:"Off",password:"كلمة المرور",power:"الطاقة",printers:"الطابعات",requested_speed:"السرعة المطلوبة",retract_length:"طول التراجع",retract_speed:"سرعة التراجع",save_as:"حفظ باسم",services:"الخدمات",speed:"السرعة",sqv:"سرعة الزاوية المربعة",total_filament:"اجمالي الخيط المستخدم",total_filament_avg:"معدل الطبعة",total_jobs:"اجمالي المهام المطبوعة",total_print_time:"اجمالي وقت الطباعة",total_print_time_avg:"معدل الطبعة",total_time:"اجمالي الوقت",total_time_avg:"معدل الطبعة",uncategorized:"غير مصنف",unretract_speed:"سرعة الكسر",used:"مستخدم",velocity:"السرعة",visible:"ظاهر",z_offset:"موازنة Z"},msg:{password_changed:"تم تغيير كلمة المرور",wrong_password:"حدث خطأ هل انت متأكد من كلمة المرور؟"},simple_form:{error:{arrayofnums:"ارقام فقط",exists:"موجود مسبقا",invalid_url:"الرابط غير صحيح",max:"%{max} اعلى",min:"%{min} اقل",min_or_0:"Min %{min} or 0",password_username:"Cannot match username",required:"مطلوب"},msg:{confirm:"هل انت متأكد؟",confirm_reboot_host:"هل انت متأكد؟ سيتم اعادة تشغيل النظام.",confirm_shutdown_host:"هل انت متأكد؟ سيتم ايقاف تشغيل النظام."}},table:{header:{actions:"اجراءات",end_time:"انتهى",estimated_time:"الوقت المتوقع",filament:"الخيط",filament_used:"الخيط المستخدم",filament_weight_total:"وزن الخيط",first_layer_bed_temp:"درجة حرارة السطح للطبقة الاولى",first_layer_extr_temp:"درجة حرارة الفوهة للطبقة الاولى",first_layer_height:"ارتفاع الطبقة الاولى",height:"الارتفاع",last_printed:"اخر طباعة",layer_height:"ارتفاع الطبقة",modified:"اخر تعديل",name:"الاسم",print_duration:"مدة الطباعة",size:"الحجم",slicer:"التطبيق",slicer_version:"نسخة التطبيق",start_time:"بدء",status:"الحالة",total_duration:"اجمالي المدة"}},title:{add_printer:"اضافة طابعة",bedmesh:"شبكة السطح",bedmesh_controls:"ادوات شبكة السطح",camera:"الكاميرا | الكاميرات",config_files:"ملفات التكوين",configure:"الاعدادات",console:"الطرفية",endstops:"نقاط التوقف",fans_outputs:"المراوح والمخرجات",gcode_preview:"معاينة Gcode",history:"التاريخ",home:"الرئيسية",jobs:"المهام",limits:"قيود الطابعة",macros:"اوامر صغيرة",retract:"Firmware Retraction",runout_sensors:"حساسات انقطاع الخيط",settings:"الاعدادات",stats:"حالة الطابعة",system:"النظام",system_overview:"معلومات النظام",temperature:"مؤشرات حرارية",tool:"الفوهة",tune:"ضبط"},tooltip:{estop:"ايقاف طوارئ",reload_klipper:"اعادة تحميل تكوين klipper.",reload_restart_klipper:"اعادة تحميل تكوين klipper واعادة تشغيل الطابعة.",restart_klipper:"اعادة تشغيل خدمة klipper الخاصة بالنظام"}},printer:{state:{busy:"مشغولة",complete:"مكتملة",idle:"خاملة",loading:"جاري التحميل",paused:"موقفة مؤفتا",printing:"جاري الطباعة",ready:"جاهزة",standby:"وضع الانتظار"}},setting:{btn:{add_camera:"اضافة كاميرا",add_thermal_preset:"اضافة اعداد مسبق",add_user:"اضافة مستخدم",reset:"اعادة تعيين",select_theme:"اختيار"},camera_type_options:{mjpegadaptive:"MJPEG Adaptive",mjpegstream:"بث MJPEG",video:"IP الكامير"},label:{all_off:"ايقاف الكل",all_on:"تشغيل الكل",camera_flip_x:"عكس افقي",camera_flip_y:"عكس عمودي",camera_stream_type:"نوع البث",confirm_on_estop:"ايقاف الطوارئ يحتاج تأكيد",dark_mode:"الوضع الداكن",default_extrude_length:"Default extrude length",default_extrude_speed:"Default extrude speed",default_toolhead_move_length:"Default toolhead move length",default_toolhead_xy_speed:"Default toolhead XY speed",default_toolhead_z_speed:"Default toolhead Z speed",draw_background:"رسم خلفية",enable:"تفعيل",enable_notifications:"تفعيل التنبيهات",extrusion_line_width:"Extrusion Line Width",flip_horizontal:"عكس افقي",flip_vertical:"عكس عمودي",fps_target:"عدد الاطارات المستهدف",gcode_coords:"استخدام احداثيات GCode",invert_x_control:"عكس تحكم محور X",invert_y_control:"عكس تحكم محور Y",invert_z_control:"عكس تحكم محور Z",language:"لغة العرض",move_line_width:"Move Line Width",primary_color:"اللون الاساسي",printer_name:"اسم الطابعة",reset:"اعادة تعيين الاعدادات",retraction_icon_size:"Retraction Icon Size",show_animations:"عرض الحركات",theme_preset:"Community preset",thermal_preset_gcode:"GCode",thermal_preset_name:"اسم الاعداد المسبق",z_adjust_values:"Z Adjust values"},timer_options:{duration:"المدة فقط",filament:"تقدير الخيط",file:"File Estimation",slicer:"Slicer"},title:{authentication:"المصادقة",camera:"الكاميرا | الكاميرات",gcode_preview:"Gcode معاينة",general:"عام",macros:"اوامر صغيرة",theme:"التصميم",thermal_presets:"الإعدادات الحرارية المسبقة",tool:"الفوهة"},tooltip:{gcode_coords:"Use GCode position instead of toolhead position on dashboard"}},socket:{msg:{connecting:"Connecting to moonraker...",no_connection:"No moonraker connection. Please check moonraker status and / or refresh."}},system_info:{label:{capacity:"السعة",cpu_desc:"وصف المعالج",distribution_codename:"Codename",distribution_like:"Distribution Like",distribution_name:"Distribution",hardware_desc:"Hardware Description",hostname:"Hostname",klipper_load:"Klipper Load",manufactured:"Manufactured",manufacturer:"المصنع",mcu_awake:"{mcu} Awake Time",mcu_bandwidth:"{mcu} عرض نطاق",mcu_load:"{mcu} Load",model:"طراز المعالج",moonraker_load:"Moonraker Load",processor_desc:"المعالج",product_name:"اسم المنتج",serial_number:"الرقم التسلسلي",system_load:"تحميل النظام",system_memory:"ذاكرة النظام",system_utilization:"System Utilization",total_memory:"اجمالي الذاكرة"}},tool:{btn:{home_x:"X",home_y:"Y"},tooltip:{extruder_disabled:"extruder disabled, below min_extrude_temp (%{min}°C)",home_xy:"Home XY",home_z:"Home Z"}},version:{btn:{check_for_updates:"التحقق من التحديثات",finish:"انتهى",update:"تحديث",view_versions:"عرض النسخ"},label:{commit_history:"Commit History",commits_on:"commits on",committed:"Committed",dirty:"DIRTY",invalid:"INVALID",os_packages:"حزم نظام التشغيل",package_list:"قائمة الحزم",up_to_date:"محدث",updates_available:"التحديثات متوفرة"},status:{finished:"اكتمل التحديث",updating:"جاري التحديث"},title:"تحديث البرمجيات",tooltip:{commit_history:"Commit history",dirty:"indicates a detached head, not on master or an invalid origin",invalid:"indicates local changes to the repo",packages:"الحزم",release_notes:"ملاحظات الاصدارة"}},box:{btn:{uninstall:"إلغاء التثبيت",load:"تحميل",unload:"إزالة"},label:{vendor:"المورد",filament:"موصل",color:"اللون",title:"تحكم المواد"},tooltip:{control_filament:"تحكم تحميل وإزالة موصل واحد، وكذلك قراءة بيانات مثل لون المواد ومكوناتها."}}}};export{e as default}; diff --git a/fluidd/assets/cs-DX6v0VI2.js b/fluidd/assets/cs-DX6v0VI2.js new file mode 100644 index 0000000..f2755d0 --- /dev/null +++ b/fluidd/assets/cs-DX6v0VI2.js @@ -0,0 +1 @@ +var e={app:{bedmesh:{label:{box_scale:"Měřítko boxu",flat_surface:"Zobrazit plochou rovinu",mesh_matrix:"Síťová matice",probed_matrix:"Změřená matice",profile_name:"Název profilu",remove_profile:"Odstranit %{name} profil",scale:"Barevná škála",wireframe:"Drátěný model"},msg:{hint:"Pokud uložíte pod jiným názvem než %{name}, můžete původní profil %{name} odstranit.",not_found:"Síť bodů nenalezena.",not_loaded:"Síť bodů nenačtena."},tooltip:{calibrate:"Zahájí novou kalibraci, uloží se jako profil 'default'",delete:"Smazat profil",load:"Načíst profil",save:"Vloží profil do printer.cfg"}},chart:{label:{current:"Teplota",item:"Název",power:"Zatížení",target:"Cílová"},tooltip:{help:"Pro přiblížení podržte Shift.
Pro přepnutí grafu klikněte na položku.
Klikněte na výkon pro jeho zobrazení v grafu."}},console:{label:{auto_scroll:"Automatický posun",hide_temp_waits:"Skrýt čekání na teplotu"},placeholder:{command:"'tab' pro autodoplňování, 'help' pro příkazy 'šipky' pro historii"}},endpoint:{error:{cant_connect:"Něco se pokazilo a fluidd se nemůže připojit na cílovou adresu. Jste si jistí že je adresa správně zadaná?",cors_error:"Zablokováno CORS politikou",cors_note:'To znamená, že bude třeba upravit konfiguraci moonrakeru. Prosím pročtěte si dokumentaci ohledně multi printer nastavení zde'},hint:{add_printer:"Např. http://fluiddpi.local"},msg:{trouble:'Nefunguje Vám něco? Klikněte zde pro více informací.'},tooltip:{endpoint_examples:"Vložte URL Vašeho API.
Příklad URL;
fluidd.local, https://192.168.1.150
"}},endstop:{label:{open:"OTEVŘEN",triggered:"SEPNUT"},msg:{subtitle:"Použijte tlačítko pro obnovení stavu koncových spínačů."}},file_system:{filters:{label:{print_start_time:"Filtrovat vytisknuté"}},label:{dir_name:"Název adresáře",disk_usage:"Využití disku",diskinfo:"Informace o disku",downloaded:"Staženo",file_name:"Název souboru",transfer_rate:"Přenosová rychlost",uploaded:"Nahráno",hour:"hodina",minute:"minuta",second:"sekunda"},msg:{not_found:"Žádný soubor nenalezen",processing:"Zpracovávám"},title:{add_dir:"Přidat adresář",add_file:"Přidat soubor",download_file:"Přijímám soubor",rename_dir:"Přejmenovat adresář",rename_file:"Přejmenovat soubor",upload_file:"Nahrávám soubor | Nahrávám soubory",check_filament:"Zkontroluj materiál"},tooltip:{low_on_space:"Málo místa na disku",root_disabled:"{root} kořenový adresář není dostupný. Prosím zkontrolujte logy.",warning_text:"Přidejte typy materiálů v nádrži pro materiál nebo snižte typy materiálů používaných modelem.",tip:"Vyberte použitý materiál. Nahoru patří materiály používané modelem, dole jsou odpovídající materiály v nádrži pro materiál."}},gcode:{btn:{load_current_file:"Načíst aktuální soubor"},label:{current_layer_height:"Současná výška vrstvy",follow_progress:"Sledovat průběh tisku",layer:"Vrstva",layers:"Vrstvy",parsed:"Analyzována(y)",show_extrusions:"Zobrazit extruzi",show_moves:"Zobrazit pohyby",show_next_layer:"Následující vrstva",show_previous_layer:"Předchozí vrstva",show_retractions:"Zobrazit retrakce"},msg:{confirm:'Soubor "%{filename}" má %{size}, může být dost náročný na prostředky Vašeho systému. Jste si jistí?'}},general:{btn:{add:"Přidat",add_dir:"Přidat adresář",add_file:"Přidat soubor",add_printer:"Přidat tiskárnu",adjust_layout:"Upravit rozložení dashboardu",all:"Vše",calibrate:"Kalibrovat",cancel:"Zrušit",clear_profile:"Vymazat profil",close:"Zavřít",config_reference:"Konfigurační reference",download:"Stáhnout",edit:"Upravit",exit_layout:"Uložit rozložení",extrude:"Extruze",heaters_off:"Vypnout vyhřívání",load_all:"Načíst vše",more_information:"Více informací",pause:"Pauza",preheat:"Předehřát",presets:"Předvolby",preview_gcode:"Zobrazit Gcode",quad_gantry_level:"QGL",reboot:"Reboot",refresh:"Obnovit",remove:"Odstranit",remove_all:"Odstranit vše",rename:"Přejmenovat",reprint:"Vytisknout znovu",reset_file:"Vyčistit soubor",reset_layout:"Resetovat rozložení",restart_firmware:"Restartovat firmware",restart_service:"Restartovat %{service}",restart_service_klipper:"Restartovat Klipper",restart_service_moonraker:"Restartovat Moonraker",resume:"Pokračovat",retract:"Retrakce",save:"Uložit",save_as:"Uložit jako",save_restart:"Uložit a restartovat",send:"Odeslat",set_color:"Nastavit barvu",shutdown:"Vypnout",socket_reconnect:"Připojit se znovu",socket_refresh:"Vynutit obnovení",upload:"Nahrát",upload_print:"Nahrát a tisknout",view:"Zobrazení"},error:{app_setup_link:'Požadavky pro nastavení Fluidd naleznete zde.',app_warnings_found:"%{appName} varování nalezena.",components_config:'Nastavení pluginu Moonraker naleznete here.',failed_components:"Pluginy Moonrakeru zhavarovaly, prosím zkontrolujte logy, aktualizujte konfiuraci a restartujte moonraker."},label:{accel_to_decel:"Accel to Decel",acceleration:"Akcelerace",actual_time:"Aktuální",add_camera:"Přidat kameru",add_preset:"Přidat přednastavení",add_user:"Přidat uživatele",api_key:"Klíč API",api_url:"API URL",category:"Kategorie",change_password:"Změnit heslo",clear_all:"Vyčistit vše",color:"Barva",confirm:"Potvrdit",current_password:"Současné heslo",disabled_while_printing:"Zakázáno během tisku",edit_camera:"Upravit kameru",edit_preset:"Upravit přednastavení",edit_user:"Upravit uživatele",extrude_length:"Délka extruze",extrude_speed:"Rychlost extruze",filament:"Filament",file:"Soubor",finish_time:"Konec",flow:"Průtok",free:"volné",high:"Vysoké",host:"Host",layer:"Vrstva",layout:"Rozložení",longest_job:"Nejdelší tisk",low:"Nízko",m117:"M117",name:"Jméno",new_password:"Nové heslo",no_notifications:"Žádné notifikace",off:"Vypnuto",password:"Heslo",power:"Výkon",printers:"Tiskárny",progress:"Průběh",requested_speed:"Rychlost",retract_length:"Délka retrakce",retract_speed:"Rychlost retrakce",save_as:"Uložit jako",services:"Služby",slicer:"Slicer",speed:"Rychlost",sqv:"Rychlost na pravoúhlém rohu",total:"Celkem",total_filament:"Celkem použito filamentu",total_filament_avg:"Průměr na tisk",total_jobs:"Celkem tisků",total_print_time:"Celkový tiskový čas",total_print_time_avg:"Průměr na tisk",total_time:"Celkový čas",total_time_avg:"Průměr na tisk",uncategorized:"Bez kategorie",unretract_extra_length:"Extra délka detrakce",unretract_speed:"Rychlost detrakce",used:"použito",velocity:"Rychlost",visible:"Viditelné",z_offset:"Odchylka Z"},msg:{password_changed:"Heslo změněno",wrong_password:"Sakriš, něco se pokazilo. Zadáváte správné heslo?"},simple_form:{error:{arrayofnums:"Pouze čísla",exists:"Již existuje",invalid_url:"Neplatná URL",max:"Max %{max}",min:"Min %{min}",min_or_0:"Min %{min} nebo 0",password_username:"Nemůžu najít uživatele",required:"Vyžadováno"},msg:{confirm:"Jste si jistí?",confirm_reboot_host:"Jste si jistí? Toto restartuje váš system.",confirm_shutdown_host:"Jste si jistí? Toto vypne váš system."}},table:{header:{actions:"Akce",end_time:"Ukončeno",estimated_time:"Odhadovaný čas",filament:"Filament",filament_used:"Použito filamentu",filament_weight_total:"Váha filamentu",first_layer_bed_temp:"Teplota podložky první vrstvy",first_layer_extr_temp:"Teplota extruderu první vrstvy",first_layer_height:"Výška první vrstvy",height:"Výška",last_printed:"Naposledy tisknuto",layer_height:"Výška vrstvy",modified:"Upraveno",name:"Název",print_duration:"Doba tisku",size:"Velikost",slicer:"Slicer",slicer_version:"Verze sliceru",start_time:"Zahájeno",status:"Stav",total_duration:"Celková doba trvání"}},title:{add_printer:"Přidat tiskárnu",bedmesh:"Mesh podložky",bedmesh_controls:"Nastavení meshe podložky",camera:"Kamera | Kamery",config_files:"Konfigurační soubory",configure:"Konfigurace",console:"Konzole",endstops:"Koncové spínače",fans_outputs:"Větráky a výstupy",gcode_preview:"Zobrazení Gcode",history:"Historie",home:"Domů",jobs:"Soubory",limits:"Limity tiskárny",macros:"Makra",retract:"Retrakce firmware",runout_sensors:"Runout senzory",settings:"Nastavení",stats:"Statistiky tiskárny",system:"Systém",system_overview:"Informace o systému",temperature:"Teploty",tool:"Nástroj",tune:"Ladění"},tooltip:{estop:"Nouzové zastavení",reload_klipper:"Obnoví konfiguraci klipperu.",reload_restart_klipper:"Obnoví konfiguraci klipperu a restartuje MCU.",restart_klipper:"Restartuje systémovou službu klipper."}},printer:{state:{busy:"Zaneprázdněn",complete:"Kompletní",idle:"Nečinný",loading:"Nahrávání",paused:"Pauza",printing:"Tiskne",ready:"Připraven",standby:"Pohotovostní"}},setting:{btn:{add_camera:"Přidat kameru",add_thermal_preset:"Přidat přednastavení",add_user:"Přidat uživatele",reset:"Resetovat",select_theme:"Vybrat motiv"},camera_type_options:{mjpegadaptive:"MJPEG Adaptive",mjpegstream:"MJPEG Stream",video:"IP Camera"},label:{all_off:"Vše vypnout",all_on:"Vše zapnout",camera_flip_x:"Překlopit horizontálně",camera_flip_y:"Překlopit vertikálně",camera_stream_type:"Typ streamu",confirm_on_estop:"Požadovat potvrzení při nouzovém zastavení",dark_mode:"Tmavý režim",default_extrude_length:"Výchozí délka extruze",default_extrude_speed:"Výchozí rychlost extruze",default_toolhead_move_length:"Výchozí délka pohybu nástroje",default_toolhead_xy_speed:"Výchozí XY rychlost nástroje",default_toolhead_z_speed:"Výchozí Z rychlost nástroje",draw_background:"Vykreslovat pozadí",enable:"Povolit",enable_notifications:"Zapnout notifikace",extrusion_line_width:"Šířka linky extruze",flip_horizontal:"Překlopit horizontálně",flip_vertical:"Překlopit vertikálně",fps_target:"Cílové FPS",gcode_coords:"Použít souřadnice GCode",invert_x_control:"Převrátit ovládání X",invert_y_control:"Převrátit ovládání Y",invert_z_control:"Převrátit ovládání Z",language:"Jazyk rozhraní",move_line_width:"Šírka linky pohybu",primary_color:"Primární barva",printer_name:"Název tiskárny",reset:"Resetovat nastavení",retraction_icon_size:"Velikost ikony retrakce",show_animations:"Zobrazovat animace",theme_preset:"Komunitní přednastavení",thermal_preset_gcode:"GCode",thermal_preset_name:"Název přednastavení",z_adjust_values:"Úpravy Z hodnot"},timer_options:{duration:"Pouze doba trvání",filament:"Odhady filamentu",file:"Odhady ze souboru",slicer:"Slicer"},title:{authentication:"Authentikace",camera:"Kamera | Kamery",gcode_preview:"Zobrazení Gcode",general:"Základní",macros:"Makra",theme:"Téma",thermal_presets:"Nastavení teplot",tool:"Nástroj"},tooltip:{gcode_coords:"Použij pozici z GCode místo pozice nástroje na dashboardu"}},socket:{msg:{connecting:"Připojuji se na moonraker...",no_connection:"Žádné připojení k moonrakeru. Zkontrolujte stav moonrakeru nebo jej obnovte."}},system_info:{label:{capacity:"Kapacita",cpu_desc:"Popis CPU",distribution_codename:"Kódový název",distribution_like:"Druh distribuce",distribution_name:"Distribuce",hardware_desc:"Popis hardware",hostname:"Hostname",klipper_load:"Zátěž klipperu",manufactured:"Vyrobeno",manufacturer:"Výrobce",mcu_awake:"{mcu} Čas probuzení",mcu_bandwidth:"{mcu} Šířka pásma",mcu_load:"{mcu} Zatížení",model:"Model CPU",moonraker_load:"Zátěž moonrakeru",processor_desc:"Processor",product_name:"Název produktu",serial_number:"Seriové číslo",system_load:"Zátěž systému",system_memory:"Paměť",system_utilization:"Využití systému",total_memory:"Paměti celkem"}},tool:{btn:{home_x:"X",home_y:"Y"},tooltip:{extruder_disabled:"Extruze zakázána pod min_extrude_temp (%{min}°C)",home_xy:"Výchozí pozice XY",home_z:"Výchozí pozice Z"}},version:{btn:{check_for_updates:"Zkontrolovat aktualizace",finish:"Hotovo",update:"Aktualizovat",view_versions:"Zobrazit verze"},label:{commit_history:"Historie commitů",commits_on:"Commity zapnout",committed:"Commitnuto",dirty:"DIRTY",invalid:"INVALID",os_packages:"Balíčky systému",package_list:"Seznam balíčků",up_to_date:"AKTUÁLNÍ",updates_available:"Dostupné aktualizace"},status:{finished:"Aktualizace hotova",updating:"Aktualizuji..."},title:"Aktualizace programů",tooltip:{commit_history:"Historie commitů",dirty:"naznačuje odpojený (git) head, není v (git) masteru nebo neplatný (git) origin",invalid:"naznačuje lokální změny v repositáři",packages:"Balíčky",release_notes:"Poznámky k vydání"}},box:{btn:{uninstall:"Odinstalovat",load:"Načíst",unload:"Vyložit"},label:{vendor:"Dodavatel",filament:"Materiál",color:"Barva",title:"Ovládání materiálů"},tooltip:{control_filament:"Ovládejte načítání a vykládání materiálu v jednom slotu a také čtěte data jako barvu a materiál."}}}};export{e as default}; diff --git a/fluidd/assets/cssMode-BCN7etFc.js b/fluidd/assets/cssMode-BCN7etFc.js new file mode 100644 index 0000000..2104c28 --- /dev/null +++ b/fluidd/assets/cssMode-BCN7etFc.js @@ -0,0 +1,9 @@ +import{hl as et}from"./setupMonaco-CF2GrFdn.js";import"./index-4UonB8GV.js";/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Version: 0.50.0(c321d0fbecb50ab8a5365fa1965476b0ae63fc87) + * Released under the MIT license + * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt + *-----------------------------------------------------------------------------*/var tt=Object.defineProperty,rt=Object.getOwnPropertyDescriptor,nt=Object.getOwnPropertyNames,it=Object.prototype.hasOwnProperty,ot=(e,n,i,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let t of nt(n))!it.call(e,t)&&t!==i&&tt(e,t,{get:()=>n[t],enumerable:!(r=rt(n,t))||r.enumerable});return e},at=(e,n,i)=>(ot(e,n,"default"),i),d={};at(d,et);var st=2*60*1e3,ut=class{constructor(e){this._defaults=e,this._worker=null,this._client=null,this._idleCheckInterval=window.setInterval(()=>this._checkIfIdle(),30*1e3),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker())}_stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null}dispose(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()}_checkIfIdle(){if(!this._worker)return;Date.now()-this._lastUsedTime>st&&this._stopWorker()}_getClient(){return this._lastUsedTime=Date.now(),this._client||(this._worker=d.editor.createWebWorker({moduleId:"vs/language/css/cssWorker",label:this._defaults.languageId,createData:{options:this._defaults.options,languageId:this._defaults.languageId}}),this._client=this._worker.getProxy()),this._client}getLanguageServiceWorker(...e){let n;return this._getClient().then(i=>{n=i}).then(i=>{if(this._worker)return this._worker.withSyncedResources(e)}).then(i=>n)}},T;(function(e){function n(i){return typeof i=="string"}e.is=n})(T||(T={}));var O;(function(e){function n(i){return typeof i=="string"}e.is=n})(O||(O={}));var Y;(function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647;function n(i){return typeof i=="number"&&e.MIN_VALUE<=i&&i<=e.MAX_VALUE}e.is=n})(Y||(Y={}));var M;(function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647;function n(i){return typeof i=="number"&&e.MIN_VALUE<=i&&i<=e.MAX_VALUE}e.is=n})(M||(M={}));var w;(function(e){function n(r,t){return r===Number.MAX_VALUE&&(r=M.MAX_VALUE),t===Number.MAX_VALUE&&(t=M.MAX_VALUE),{line:r,character:t}}e.create=n;function i(r){let t=r;return a.objectLiteral(t)&&a.uinteger(t.line)&&a.uinteger(t.character)}e.is=i})(w||(w={}));var h;(function(e){function n(r,t,o,s){if(a.uinteger(r)&&a.uinteger(t)&&a.uinteger(o)&&a.uinteger(s))return{start:w.create(r,t),end:w.create(o,s)};if(w.is(r)&&w.is(t))return{start:r,end:t};throw new Error(`Range#create called with invalid arguments[${r}, ${t}, ${o}, ${s}]`)}e.create=n;function i(r){let t=r;return a.objectLiteral(t)&&w.is(t.start)&&w.is(t.end)}e.is=i})(h||(h={}));var C;(function(e){function n(r,t){return{uri:r,range:t}}e.create=n;function i(r){let t=r;return a.objectLiteral(t)&&h.is(t.range)&&(a.string(t.uri)||a.undefined(t.uri))}e.is=i})(C||(C={}));var Z;(function(e){function n(r,t,o,s){return{targetUri:r,targetRange:t,targetSelectionRange:o,originSelectionRange:s}}e.create=n;function i(r){let t=r;return a.objectLiteral(t)&&h.is(t.targetRange)&&a.string(t.targetUri)&&h.is(t.targetSelectionRange)&&(h.is(t.originSelectionRange)||a.undefined(t.originSelectionRange))}e.is=i})(Z||(Z={}));var S;(function(e){function n(r,t,o,s){return{red:r,green:t,blue:o,alpha:s}}e.create=n;function i(r){const t=r;return a.objectLiteral(t)&&a.numberRange(t.red,0,1)&&a.numberRange(t.green,0,1)&&a.numberRange(t.blue,0,1)&&a.numberRange(t.alpha,0,1)}e.is=i})(S||(S={}));var K;(function(e){function n(r,t){return{range:r,color:t}}e.create=n;function i(r){const t=r;return a.objectLiteral(t)&&h.is(t.range)&&S.is(t.color)}e.is=i})(K||(K={}));var ee;(function(e){function n(r,t,o){return{label:r,textEdit:t,additionalTextEdits:o}}e.create=n;function i(r){const t=r;return a.objectLiteral(t)&&a.string(t.label)&&(a.undefined(t.textEdit)||E.is(t))&&(a.undefined(t.additionalTextEdits)||a.typedArray(t.additionalTextEdits,E.is))}e.is=i})(ee||(ee={}));var A;(function(e){e.Comment="comment",e.Imports="imports",e.Region="region"})(A||(A={}));var te;(function(e){function n(r,t,o,s,u,f){const c={startLine:r,endLine:t};return a.defined(o)&&(c.startCharacter=o),a.defined(s)&&(c.endCharacter=s),a.defined(u)&&(c.kind=u),a.defined(f)&&(c.collapsedText=f),c}e.create=n;function i(r){const t=r;return a.objectLiteral(t)&&a.uinteger(t.startLine)&&a.uinteger(t.startLine)&&(a.undefined(t.startCharacter)||a.uinteger(t.startCharacter))&&(a.undefined(t.endCharacter)||a.uinteger(t.endCharacter))&&(a.undefined(t.kind)||a.string(t.kind))}e.is=i})(te||(te={}));var U;(function(e){function n(r,t){return{location:r,message:t}}e.create=n;function i(r){let t=r;return a.defined(t)&&C.is(t.location)&&a.string(t.message)}e.is=i})(U||(U={}));var x;(function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4})(x||(x={}));var re;(function(e){e.Unnecessary=1,e.Deprecated=2})(re||(re={}));var ne;(function(e){function n(i){const r=i;return a.objectLiteral(r)&&a.string(r.href)}e.is=n})(ne||(ne={}));var y;(function(e){function n(r,t,o,s,u,f){let c={range:r,message:t};return a.defined(o)&&(c.severity=o),a.defined(s)&&(c.code=s),a.defined(u)&&(c.source=u),a.defined(f)&&(c.relatedInformation=f),c}e.create=n;function i(r){var t;let o=r;return a.defined(o)&&h.is(o.range)&&a.string(o.message)&&(a.number(o.severity)||a.undefined(o.severity))&&(a.integer(o.code)||a.string(o.code)||a.undefined(o.code))&&(a.undefined(o.codeDescription)||a.string((t=o.codeDescription)===null||t===void 0?void 0:t.href))&&(a.string(o.source)||a.undefined(o.source))&&(a.undefined(o.relatedInformation)||a.typedArray(o.relatedInformation,U.is))}e.is=i})(y||(y={}));var I;(function(e){function n(r,t,...o){let s={title:r,command:t};return a.defined(o)&&o.length>0&&(s.arguments=o),s}e.create=n;function i(r){let t=r;return a.defined(t)&&a.string(t.title)&&a.string(t.command)}e.is=i})(I||(I={}));var E;(function(e){function n(o,s){return{range:o,newText:s}}e.replace=n;function i(o,s){return{range:{start:o,end:o},newText:s}}e.insert=i;function r(o){return{range:o,newText:""}}e.del=r;function t(o){const s=o;return a.objectLiteral(s)&&a.string(s.newText)&&h.is(s.range)}e.is=t})(E||(E={}));var V;(function(e){function n(r,t,o){const s={label:r};return t!==void 0&&(s.needsConfirmation=t),o!==void 0&&(s.description=o),s}e.create=n;function i(r){const t=r;return a.objectLiteral(t)&&a.string(t.label)&&(a.boolean(t.needsConfirmation)||t.needsConfirmation===void 0)&&(a.string(t.description)||t.description===void 0)}e.is=i})(V||(V={}));var L;(function(e){function n(i){const r=i;return a.string(r)}e.is=n})(L||(L={}));var ie;(function(e){function n(o,s,u){return{range:o,newText:s,annotationId:u}}e.replace=n;function i(o,s,u){return{range:{start:o,end:o},newText:s,annotationId:u}}e.insert=i;function r(o,s){return{range:o,newText:"",annotationId:s}}e.del=r;function t(o){const s=o;return E.is(s)&&(V.is(s.annotationId)||L.is(s.annotationId))}e.is=t})(ie||(ie={}));var W;(function(e){function n(r,t){return{textDocument:r,edits:t}}e.create=n;function i(r){let t=r;return a.defined(t)&&B.is(t.textDocument)&&Array.isArray(t.edits)}e.is=i})(W||(W={}));var H;(function(e){function n(r,t,o){let s={kind:"create",uri:r};return t!==void 0&&(t.overwrite!==void 0||t.ignoreIfExists!==void 0)&&(s.options=t),o!==void 0&&(s.annotationId=o),s}e.create=n;function i(r){let t=r;return t&&t.kind==="create"&&a.string(t.uri)&&(t.options===void 0||(t.options.overwrite===void 0||a.boolean(t.options.overwrite))&&(t.options.ignoreIfExists===void 0||a.boolean(t.options.ignoreIfExists)))&&(t.annotationId===void 0||L.is(t.annotationId))}e.is=i})(H||(H={}));var X;(function(e){function n(r,t,o,s){let u={kind:"rename",oldUri:r,newUri:t};return o!==void 0&&(o.overwrite!==void 0||o.ignoreIfExists!==void 0)&&(u.options=o),s!==void 0&&(u.annotationId=s),u}e.create=n;function i(r){let t=r;return t&&t.kind==="rename"&&a.string(t.oldUri)&&a.string(t.newUri)&&(t.options===void 0||(t.options.overwrite===void 0||a.boolean(t.options.overwrite))&&(t.options.ignoreIfExists===void 0||a.boolean(t.options.ignoreIfExists)))&&(t.annotationId===void 0||L.is(t.annotationId))}e.is=i})(X||(X={}));var $;(function(e){function n(r,t,o){let s={kind:"delete",uri:r};return t!==void 0&&(t.recursive!==void 0||t.ignoreIfNotExists!==void 0)&&(s.options=t),o!==void 0&&(s.annotationId=o),s}e.create=n;function i(r){let t=r;return t&&t.kind==="delete"&&a.string(t.uri)&&(t.options===void 0||(t.options.recursive===void 0||a.boolean(t.options.recursive))&&(t.options.ignoreIfNotExists===void 0||a.boolean(t.options.ignoreIfNotExists)))&&(t.annotationId===void 0||L.is(t.annotationId))}e.is=i})($||($={}));var z;(function(e){function n(i){let r=i;return r&&(r.changes!==void 0||r.documentChanges!==void 0)&&(r.documentChanges===void 0||r.documentChanges.every(t=>a.string(t.kind)?H.is(t)||X.is(t)||$.is(t):W.is(t)))}e.is=n})(z||(z={}));var oe;(function(e){function n(r){return{uri:r}}e.create=n;function i(r){let t=r;return a.defined(t)&&a.string(t.uri)}e.is=i})(oe||(oe={}));var ae;(function(e){function n(r,t){return{uri:r,version:t}}e.create=n;function i(r){let t=r;return a.defined(t)&&a.string(t.uri)&&a.integer(t.version)}e.is=i})(ae||(ae={}));var B;(function(e){function n(r,t){return{uri:r,version:t}}e.create=n;function i(r){let t=r;return a.defined(t)&&a.string(t.uri)&&(t.version===null||a.integer(t.version))}e.is=i})(B||(B={}));var se;(function(e){function n(r,t,o,s){return{uri:r,languageId:t,version:o,text:s}}e.create=n;function i(r){let t=r;return a.defined(t)&&a.string(t.uri)&&a.string(t.languageId)&&a.integer(t.version)&&a.string(t.text)}e.is=i})(se||(se={}));var q;(function(e){e.PlainText="plaintext",e.Markdown="markdown";function n(i){const r=i;return r===e.PlainText||r===e.Markdown}e.is=n})(q||(q={}));var P;(function(e){function n(i){const r=i;return a.objectLiteral(i)&&q.is(r.kind)&&a.string(r.value)}e.is=n})(P||(P={}));var v;(function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25})(v||(v={}));var Q;(function(e){e.PlainText=1,e.Snippet=2})(Q||(Q={}));var ue;(function(e){e.Deprecated=1})(ue||(ue={}));var ce;(function(e){function n(r,t,o){return{newText:r,insert:t,replace:o}}e.create=n;function i(r){const t=r;return t&&a.string(t.newText)&&h.is(t.insert)&&h.is(t.replace)}e.is=i})(ce||(ce={}));var de;(function(e){e.asIs=1,e.adjustIndentation=2})(de||(de={}));var le;(function(e){function n(i){const r=i;return r&&(a.string(r.detail)||r.detail===void 0)&&(a.string(r.description)||r.description===void 0)}e.is=n})(le||(le={}));var fe;(function(e){function n(i){return{label:i}}e.create=n})(fe||(fe={}));var ge;(function(e){function n(i,r){return{items:i||[],isIncomplete:!!r}}e.create=n})(ge||(ge={}));var F;(function(e){function n(r){return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}e.fromPlainText=n;function i(r){const t=r;return a.string(t)||a.objectLiteral(t)&&a.string(t.language)&&a.string(t.value)}e.is=i})(F||(F={}));var he;(function(e){function n(i){let r=i;return!!r&&a.objectLiteral(r)&&(P.is(r.contents)||F.is(r.contents)||a.typedArray(r.contents,F.is))&&(i.range===void 0||h.is(i.range))}e.is=n})(he||(he={}));var ve;(function(e){function n(i,r){return r?{label:i,documentation:r}:{label:i}}e.create=n})(ve||(ve={}));var pe;(function(e){function n(i,r,...t){let o={label:i};return a.defined(r)&&(o.documentation=r),a.defined(t)?o.parameters=t:o.parameters=[],o}e.create=n})(pe||(pe={}));var R;(function(e){e.Text=1,e.Read=2,e.Write=3})(R||(R={}));var me;(function(e){function n(i,r){let t={range:i};return a.number(r)&&(t.kind=r),t}e.create=n})(me||(me={}));var p;(function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26})(p||(p={}));var _e;(function(e){e.Deprecated=1})(_e||(_e={}));var be;(function(e){function n(i,r,t,o,s){let u={name:i,kind:r,location:{uri:o,range:t}};return s&&(u.containerName=s),u}e.create=n})(be||(be={}));var we;(function(e){function n(i,r,t,o){return o!==void 0?{name:i,kind:r,location:{uri:t,range:o}}:{name:i,kind:r,location:{uri:t}}}e.create=n})(we||(we={}));var ke;(function(e){function n(r,t,o,s,u,f){let c={name:r,detail:t,kind:o,range:s,selectionRange:u};return f!==void 0&&(c.children=f),c}e.create=n;function i(r){let t=r;return t&&a.string(t.name)&&a.number(t.kind)&&h.is(t.range)&&h.is(t.selectionRange)&&(t.detail===void 0||a.string(t.detail))&&(t.deprecated===void 0||a.boolean(t.deprecated))&&(t.children===void 0||Array.isArray(t.children))&&(t.tags===void 0||Array.isArray(t.tags))}e.is=i})(ke||(ke={}));var xe;(function(e){e.Empty="",e.QuickFix="quickfix",e.Refactor="refactor",e.RefactorExtract="refactor.extract",e.RefactorInline="refactor.inline",e.RefactorRewrite="refactor.rewrite",e.Source="source",e.SourceOrganizeImports="source.organizeImports",e.SourceFixAll="source.fixAll"})(xe||(xe={}));var j;(function(e){e.Invoked=1,e.Automatic=2})(j||(j={}));var Ie;(function(e){function n(r,t,o){let s={diagnostics:r};return t!=null&&(s.only=t),o!=null&&(s.triggerKind=o),s}e.create=n;function i(r){let t=r;return a.defined(t)&&a.typedArray(t.diagnostics,y.is)&&(t.only===void 0||a.typedArray(t.only,a.string))&&(t.triggerKind===void 0||t.triggerKind===j.Invoked||t.triggerKind===j.Automatic)}e.is=i})(Ie||(Ie={}));var Ee;(function(e){function n(r,t,o){let s={title:r},u=!0;return typeof t=="string"?(u=!1,s.kind=t):I.is(t)?s.command=t:s.edit=t,u&&o!==void 0&&(s.kind=o),s}e.create=n;function i(r){let t=r;return t&&a.string(t.title)&&(t.diagnostics===void 0||a.typedArray(t.diagnostics,y.is))&&(t.kind===void 0||a.string(t.kind))&&(t.edit!==void 0||t.command!==void 0)&&(t.command===void 0||I.is(t.command))&&(t.isPreferred===void 0||a.boolean(t.isPreferred))&&(t.edit===void 0||z.is(t.edit))}e.is=i})(Ee||(Ee={}));var Le;(function(e){function n(r,t){let o={range:r};return a.defined(t)&&(o.data=t),o}e.create=n;function i(r){let t=r;return a.defined(t)&&h.is(t.range)&&(a.undefined(t.command)||I.is(t.command))}e.is=i})(Le||(Le={}));var Ae;(function(e){function n(r,t){return{tabSize:r,insertSpaces:t}}e.create=n;function i(r){let t=r;return a.defined(t)&&a.uinteger(t.tabSize)&&a.boolean(t.insertSpaces)}e.is=i})(Ae||(Ae={}));var Re;(function(e){function n(r,t,o){return{range:r,target:t,data:o}}e.create=n;function i(r){let t=r;return a.defined(t)&&h.is(t.range)&&(a.undefined(t.target)||a.string(t.target))}e.is=i})(Re||(Re={}));var Pe;(function(e){function n(r,t){return{range:r,parent:t}}e.create=n;function i(r){let t=r;return a.objectLiteral(t)&&h.is(t.range)&&(t.parent===void 0||e.is(t.parent))}e.is=i})(Pe||(Pe={}));var De;(function(e){e.namespace="namespace",e.type="type",e.class="class",e.enum="enum",e.interface="interface",e.struct="struct",e.typeParameter="typeParameter",e.parameter="parameter",e.variable="variable",e.property="property",e.enumMember="enumMember",e.event="event",e.function="function",e.method="method",e.macro="macro",e.keyword="keyword",e.modifier="modifier",e.comment="comment",e.string="string",e.number="number",e.regexp="regexp",e.operator="operator",e.decorator="decorator"})(De||(De={}));var Me;(function(e){e.declaration="declaration",e.definition="definition",e.readonly="readonly",e.static="static",e.deprecated="deprecated",e.abstract="abstract",e.async="async",e.modification="modification",e.documentation="documentation",e.defaultLibrary="defaultLibrary"})(Me||(Me={}));var Ce;(function(e){function n(i){const r=i;return a.objectLiteral(r)&&(r.resultId===void 0||typeof r.resultId=="string")&&Array.isArray(r.data)&&(r.data.length===0||typeof r.data[0]=="number")}e.is=n})(Ce||(Ce={}));var ye;(function(e){function n(r,t){return{range:r,text:t}}e.create=n;function i(r){const t=r;return t!=null&&h.is(t.range)&&a.string(t.text)}e.is=i})(ye||(ye={}));var Fe;(function(e){function n(r,t,o){return{range:r,variableName:t,caseSensitiveLookup:o}}e.create=n;function i(r){const t=r;return t!=null&&h.is(t.range)&&a.boolean(t.caseSensitiveLookup)&&(a.string(t.variableName)||t.variableName===void 0)}e.is=i})(Fe||(Fe={}));var je;(function(e){function n(r,t){return{range:r,expression:t}}e.create=n;function i(r){const t=r;return t!=null&&h.is(t.range)&&(a.string(t.expression)||t.expression===void 0)}e.is=i})(je||(je={}));var Ne;(function(e){function n(r,t){return{frameId:r,stoppedLocation:t}}e.create=n;function i(r){const t=r;return a.defined(t)&&h.is(r.stoppedLocation)}e.is=i})(Ne||(Ne={}));var G;(function(e){e.Type=1,e.Parameter=2;function n(i){return i===1||i===2}e.is=n})(G||(G={}));var J;(function(e){function n(r){return{value:r}}e.create=n;function i(r){const t=r;return a.objectLiteral(t)&&(t.tooltip===void 0||a.string(t.tooltip)||P.is(t.tooltip))&&(t.location===void 0||C.is(t.location))&&(t.command===void 0||I.is(t.command))}e.is=i})(J||(J={}));var Oe;(function(e){function n(r,t,o){const s={position:r,label:t};return o!==void 0&&(s.kind=o),s}e.create=n;function i(r){const t=r;return a.objectLiteral(t)&&w.is(t.position)&&(a.string(t.label)||a.typedArray(t.label,J.is))&&(t.kind===void 0||G.is(t.kind))&&t.textEdits===void 0||a.typedArray(t.textEdits,E.is)&&(t.tooltip===void 0||a.string(t.tooltip)||P.is(t.tooltip))&&(t.paddingLeft===void 0||a.boolean(t.paddingLeft))&&(t.paddingRight===void 0||a.boolean(t.paddingRight))}e.is=i})(Oe||(Oe={}));var Se;(function(e){function n(i){return{kind:"snippet",value:i}}e.createSnippet=n})(Se||(Se={}));var Ue;(function(e){function n(i,r,t,o){return{insertText:i,filterText:r,range:t,command:o}}e.create=n})(Ue||(Ue={}));var Ve;(function(e){function n(i){return{items:i}}e.create=n})(Ve||(Ve={}));var We;(function(e){e.Invoked=0,e.Automatic=1})(We||(We={}));var He;(function(e){function n(i,r){return{range:i,text:r}}e.create=n})(He||(He={}));var Xe;(function(e){function n(i,r){return{triggerKind:i,selectedCompletionInfo:r}}e.create=n})(Xe||(Xe={}));var $e;(function(e){function n(i){const r=i;return a.objectLiteral(r)&&O.is(r.uri)&&a.string(r.name)}e.is=n})($e||($e={}));var ze;(function(e){function n(o,s,u,f){return new ct(o,s,u,f)}e.create=n;function i(o){let s=o;return!!(a.defined(s)&&a.string(s.uri)&&(a.undefined(s.languageId)||a.string(s.languageId))&&a.uinteger(s.lineCount)&&a.func(s.getText)&&a.func(s.positionAt)&&a.func(s.offsetAt))}e.is=i;function r(o,s){let u=o.getText(),f=t(s,(g,_)=>{let b=g.range.start.line-_.range.start.line;return b===0?g.range.start.character-_.range.start.character:b}),c=u.length;for(let g=f.length-1;g>=0;g--){let _=f[g],b=o.offsetAt(_.range.start),l=o.offsetAt(_.range.end);if(l<=c)u=u.substring(0,b)+_.newText+u.substring(l,u.length);else throw new Error("Overlapping edit");c=b}return u}e.applyEdits=r;function t(o,s){if(o.length<=1)return o;const u=o.length/2|0,f=o.slice(0,u),c=o.slice(u);t(f,s),t(c,s);let g=0,_=0,b=0;for(;g0&&e.push(n.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let n=this.getLineOffsets(),i=0,r=n.length;if(r===0)return w.create(0,e);for(;ie?r=o:i=o+1}let t=i-1;return w.create(t,e-n[t])}offsetAt(e){let n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;let i=n[e.line],r=e.line+1"u"}e.undefined=r;function t(l){return l===!0||l===!1}e.boolean=t;function o(l){return n.call(l)==="[object String]"}e.string=o;function s(l){return n.call(l)==="[object Number]"}e.number=s;function u(l,N,Ke){return n.call(l)==="[object Number]"&&N<=l&&l<=Ke}e.numberRange=u;function f(l){return n.call(l)==="[object Number]"&&-2147483648<=l&&l<=2147483647}e.integer=f;function c(l){return n.call(l)==="[object Number]"&&0<=l&&l<=2147483647}e.uinteger=c;function g(l){return n.call(l)==="[object Function]"}e.func=g;function _(l){return l!==null&&typeof l=="object"}e.objectLiteral=_;function b(l,N){return Array.isArray(l)&&l.every(N)}e.typedArray=b})(a||(a={}));var dt=class{constructor(e,n,i){this._languageId=e,this._worker=n,this._disposables=[],this._listener=Object.create(null);const r=o=>{let s=o.getLanguageId();if(s!==this._languageId)return;let u;this._listener[o.uri.toString()]=o.onDidChangeContent(()=>{window.clearTimeout(u),u=window.setTimeout(()=>this._doValidate(o.uri,s),500)}),this._doValidate(o.uri,s)},t=o=>{d.editor.setModelMarkers(o,this._languageId,[]);let s=o.uri.toString(),u=this._listener[s];u&&(u.dispose(),delete this._listener[s])};this._disposables.push(d.editor.onDidCreateModel(r)),this._disposables.push(d.editor.onWillDisposeModel(t)),this._disposables.push(d.editor.onDidChangeModelLanguage(o=>{t(o.model),r(o.model)})),this._disposables.push(i(o=>{d.editor.getModels().forEach(s=>{s.getLanguageId()===this._languageId&&(t(s),r(s))})})),this._disposables.push({dispose:()=>{d.editor.getModels().forEach(t);for(let o in this._listener)this._listener[o].dispose()}}),d.editor.getModels().forEach(r)}dispose(){this._disposables.forEach(e=>e&&e.dispose()),this._disposables.length=0}_doValidate(e,n){this._worker(e).then(i=>i.doValidation(e.toString())).then(i=>{const r=i.map(o=>ft(e,o));let t=d.editor.getModel(e);t&&t.getLanguageId()===n&&d.editor.setModelMarkers(t,n,r)}).then(void 0,i=>{console.error(i)})}};function lt(e){switch(e){case x.Error:return d.MarkerSeverity.Error;case x.Warning:return d.MarkerSeverity.Warning;case x.Information:return d.MarkerSeverity.Info;case x.Hint:return d.MarkerSeverity.Hint;default:return d.MarkerSeverity.Info}}function ft(e,n){let i=typeof n.code=="number"?String(n.code):n.code;return{severity:lt(n.severity),startLineNumber:n.range.start.line+1,startColumn:n.range.start.character+1,endLineNumber:n.range.end.line+1,endColumn:n.range.end.character+1,message:n.message,code:i,source:n.source}}var gt=class{constructor(e,n){this._worker=e,this._triggerCharacters=n}get triggerCharacters(){return this._triggerCharacters}provideCompletionItems(e,n,i,r){const t=e.uri;return this._worker(t).then(o=>o.doComplete(t.toString(),k(n))).then(o=>{if(!o)return;const s=e.getWordUntilPosition(n),u=new d.Range(n.lineNumber,s.startColumn,n.lineNumber,s.endColumn),f=o.items.map(c=>{const g={label:c.label,insertText:c.insertText||c.label,sortText:c.sortText,filterText:c.filterText,documentation:c.documentation,detail:c.detail,command:pt(c.command),range:u,kind:vt(c.kind)};return c.textEdit&&(ht(c.textEdit)?g.range={insert:m(c.textEdit.insert),replace:m(c.textEdit.replace)}:g.range=m(c.textEdit.range),g.insertText=c.textEdit.newText),c.additionalTextEdits&&(g.additionalTextEdits=c.additionalTextEdits.map(D)),c.insertTextFormat===Q.Snippet&&(g.insertTextRules=d.languages.CompletionItemInsertTextRule.InsertAsSnippet),g});return{isIncomplete:o.isIncomplete,suggestions:f}})}};function k(e){if(e)return{character:e.column-1,line:e.lineNumber-1}}function Qe(e){if(e)return{start:{line:e.startLineNumber-1,character:e.startColumn-1},end:{line:e.endLineNumber-1,character:e.endColumn-1}}}function m(e){if(e)return new d.Range(e.start.line+1,e.start.character+1,e.end.line+1,e.end.character+1)}function ht(e){return typeof e.insert<"u"&&typeof e.replace<"u"}function vt(e){const n=d.languages.CompletionItemKind;switch(e){case v.Text:return n.Text;case v.Method:return n.Method;case v.Function:return n.Function;case v.Constructor:return n.Constructor;case v.Field:return n.Field;case v.Variable:return n.Variable;case v.Class:return n.Class;case v.Interface:return n.Interface;case v.Module:return n.Module;case v.Property:return n.Property;case v.Unit:return n.Unit;case v.Value:return n.Value;case v.Enum:return n.Enum;case v.Keyword:return n.Keyword;case v.Snippet:return n.Snippet;case v.Color:return n.Color;case v.File:return n.File;case v.Reference:return n.Reference}return n.Property}function D(e){if(e)return{range:m(e.range),text:e.newText}}function pt(e){return e&&e.command==="editor.action.triggerSuggest"?{id:e.command,title:e.title,arguments:e.arguments}:void 0}var mt=class{constructor(e){this._worker=e}provideHover(e,n,i){let r=e.uri;return this._worker(r).then(t=>t.doHover(r.toString(),k(n))).then(t=>{if(t)return{range:m(t.range),contents:bt(t.contents)}})}};function _t(e){return e&&typeof e=="object"&&typeof e.kind=="string"}function Be(e){return typeof e=="string"?{value:e}:_t(e)?e.kind==="plaintext"?{value:e.value.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}:{value:e.value}:{value:"```"+e.language+` +`+e.value+"\n```\n"}}function bt(e){if(e)return Array.isArray(e)?e.map(Be):[Be(e)]}var wt=class{constructor(e){this._worker=e}provideDocumentHighlights(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.findDocumentHighlights(r.toString(),k(n))).then(t=>{if(t)return t.map(o=>({range:m(o.range),kind:kt(o.kind)}))})}};function kt(e){switch(e){case R.Read:return d.languages.DocumentHighlightKind.Read;case R.Write:return d.languages.DocumentHighlightKind.Write;case R.Text:return d.languages.DocumentHighlightKind.Text}return d.languages.DocumentHighlightKind.Text}var xt=class{constructor(e){this._worker=e}provideDefinition(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.findDefinition(r.toString(),k(n))).then(t=>{if(t)return[Ge(t)]})}};function Ge(e){return{uri:d.Uri.parse(e.uri),range:m(e.range)}}var It=class{constructor(e){this._worker=e}provideReferences(e,n,i,r){const t=e.uri;return this._worker(t).then(o=>o.findReferences(t.toString(),k(n))).then(o=>{if(o)return o.map(Ge)})}},Et=class{constructor(e){this._worker=e}provideRenameEdits(e,n,i,r){const t=e.uri;return this._worker(t).then(o=>o.doRename(t.toString(),k(n),i)).then(o=>Lt(o))}};function Lt(e){if(!e||!e.changes)return;let n=[];for(let i in e.changes){const r=d.Uri.parse(i);for(let t of e.changes[i])n.push({resource:r,versionId:void 0,textEdit:{range:m(t.range),text:t.newText}})}return{edits:n}}var At=class{constructor(e){this._worker=e}provideDocumentSymbols(e,n){const i=e.uri;return this._worker(i).then(r=>r.findDocumentSymbols(i.toString())).then(r=>{if(r)return r.map(t=>Rt(t)?Je(t):{name:t.name,detail:"",containerName:t.containerName,kind:Te(t.kind),range:m(t.location.range),selectionRange:m(t.location.range),tags:[]})})}};function Rt(e){return"children"in e}function Je(e){return{name:e.name,detail:e.detail??"",kind:Te(e.kind),range:m(e.range),selectionRange:m(e.selectionRange),tags:e.tags??[],children:(e.children??[]).map(n=>Je(n))}}function Te(e){let n=d.languages.SymbolKind;switch(e){case p.File:return n.File;case p.Module:return n.Module;case p.Namespace:return n.Namespace;case p.Package:return n.Package;case p.Class:return n.Class;case p.Method:return n.Method;case p.Property:return n.Property;case p.Field:return n.Field;case p.Constructor:return n.Constructor;case p.Enum:return n.Enum;case p.Interface:return n.Interface;case p.Function:return n.Function;case p.Variable:return n.Variable;case p.Constant:return n.Constant;case p.String:return n.String;case p.Number:return n.Number;case p.Boolean:return n.Boolean;case p.Array:return n.Array}return n.Function}var Ot=class{constructor(e){this._worker=e}provideLinks(e,n){const i=e.uri;return this._worker(i).then(r=>r.findDocumentLinks(i.toString())).then(r=>{if(r)return{links:r.map(t=>({range:m(t.range),url:t.target}))}})}},Pt=class{constructor(e){this._worker=e}provideDocumentFormattingEdits(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.format(r.toString(),null,Ye(n)).then(o=>{if(!(!o||o.length===0))return o.map(D)}))}},Dt=class{constructor(e){this._worker=e,this.canFormatMultipleRanges=!1}provideDocumentRangeFormattingEdits(e,n,i,r){const t=e.uri;return this._worker(t).then(o=>o.format(t.toString(),Qe(n),Ye(i)).then(s=>{if(!(!s||s.length===0))return s.map(D)}))}};function Ye(e){return{tabSize:e.tabSize,insertSpaces:e.insertSpaces}}var Mt=class{constructor(e){this._worker=e}provideDocumentColors(e,n){const i=e.uri;return this._worker(i).then(r=>r.findDocumentColors(i.toString())).then(r=>{if(r)return r.map(t=>({color:t.color,range:m(t.range)}))})}provideColorPresentations(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.getColorPresentations(r.toString(),n.color,Qe(n.range))).then(t=>{if(t)return t.map(o=>{let s={label:o.label};return o.textEdit&&(s.textEdit=D(o.textEdit)),o.additionalTextEdits&&(s.additionalTextEdits=o.additionalTextEdits.map(D)),s})})}},Ct=class{constructor(e){this._worker=e}provideFoldingRanges(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.getFoldingRanges(r.toString(),n)).then(t=>{if(t)return t.map(o=>{const s={start:o.startLine+1,end:o.endLine+1};return typeof o.kind<"u"&&(s.kind=yt(o.kind)),s})})}};function yt(e){switch(e){case A.Comment:return d.languages.FoldingRangeKind.Comment;case A.Imports:return d.languages.FoldingRangeKind.Imports;case A.Region:return d.languages.FoldingRangeKind.Region}}var Ft=class{constructor(e){this._worker=e}provideSelectionRanges(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.getSelectionRanges(r.toString(),n.map(k))).then(t=>{if(t)return t.map(o=>{const s=[];for(;o;)s.push({range:m(o.range)}),o=o.parent;return s})})}};function St(e){const n=[],i=[],r=new ut(e);n.push(r);const t=(...s)=>r.getLanguageServiceWorker(...s);function o(){const{languageId:s,modeConfiguration:u}=e;Ze(i),u.completionItems&&i.push(d.languages.registerCompletionItemProvider(s,new gt(t,["/","-",":"]))),u.hovers&&i.push(d.languages.registerHoverProvider(s,new mt(t))),u.documentHighlights&&i.push(d.languages.registerDocumentHighlightProvider(s,new wt(t))),u.definitions&&i.push(d.languages.registerDefinitionProvider(s,new xt(t))),u.references&&i.push(d.languages.registerReferenceProvider(s,new It(t))),u.documentSymbols&&i.push(d.languages.registerDocumentSymbolProvider(s,new At(t))),u.rename&&i.push(d.languages.registerRenameProvider(s,new Et(t))),u.colors&&i.push(d.languages.registerColorProvider(s,new Mt(t))),u.foldingRanges&&i.push(d.languages.registerFoldingRangeProvider(s,new Ct(t))),u.diagnostics&&i.push(new dt(s,t,e.onDidChange)),u.selectionRanges&&i.push(d.languages.registerSelectionRangeProvider(s,new Ft(t))),u.documentFormattingEdits&&i.push(d.languages.registerDocumentFormattingEditProvider(s,new Pt(t))),u.documentRangeFormattingEdits&&i.push(d.languages.registerDocumentRangeFormattingEditProvider(s,new Dt(t)))}return o(),n.push(qe(i)),qe(n)}function qe(e){return{dispose:()=>Ze(e)}}function Ze(e){for(;e.length;)e.pop().dispose()}export{gt as CompletionAdapter,xt as DefinitionAdapter,dt as DiagnosticsAdapter,Mt as DocumentColorAdapter,Pt as DocumentFormattingEditProvider,wt as DocumentHighlightAdapter,Ot as DocumentLinkAdapter,Dt as DocumentRangeFormattingEditProvider,At as DocumentSymbolAdapter,Ct as FoldingRangeAdapter,mt as HoverAdapter,It as ReferenceAdapter,Et as RenameAdapter,Ft as SelectionRangeAdapter,ut as WorkerManager,k as fromPosition,Qe as fromRange,St as setupMode,m as toRange,D as toTextEdit}; diff --git a/fluidd/assets/cssMode-Blm1wgae.js b/fluidd/assets/cssMode-Blm1wgae.js new file mode 100644 index 0000000..2d1f413 --- /dev/null +++ b/fluidd/assets/cssMode-Blm1wgae.js @@ -0,0 +1,9 @@ +import{hl as et}from"./setupMonaco-w_dYaS1J.js";import"./index-DNWTsqTH.js";/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Version: 0.50.0(c321d0fbecb50ab8a5365fa1965476b0ae63fc87) + * Released under the MIT license + * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt + *-----------------------------------------------------------------------------*/var tt=Object.defineProperty,rt=Object.getOwnPropertyDescriptor,nt=Object.getOwnPropertyNames,it=Object.prototype.hasOwnProperty,ot=(e,n,i,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let t of nt(n))!it.call(e,t)&&t!==i&&tt(e,t,{get:()=>n[t],enumerable:!(r=rt(n,t))||r.enumerable});return e},at=(e,n,i)=>(ot(e,n,"default"),i),d={};at(d,et);var st=2*60*1e3,ut=class{constructor(e){this._defaults=e,this._worker=null,this._client=null,this._idleCheckInterval=window.setInterval(()=>this._checkIfIdle(),30*1e3),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker())}_stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null}dispose(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()}_checkIfIdle(){if(!this._worker)return;Date.now()-this._lastUsedTime>st&&this._stopWorker()}_getClient(){return this._lastUsedTime=Date.now(),this._client||(this._worker=d.editor.createWebWorker({moduleId:"vs/language/css/cssWorker",label:this._defaults.languageId,createData:{options:this._defaults.options,languageId:this._defaults.languageId}}),this._client=this._worker.getProxy()),this._client}getLanguageServiceWorker(...e){let n;return this._getClient().then(i=>{n=i}).then(i=>{if(this._worker)return this._worker.withSyncedResources(e)}).then(i=>n)}},T;(function(e){function n(i){return typeof i=="string"}e.is=n})(T||(T={}));var O;(function(e){function n(i){return typeof i=="string"}e.is=n})(O||(O={}));var Y;(function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647;function n(i){return typeof i=="number"&&e.MIN_VALUE<=i&&i<=e.MAX_VALUE}e.is=n})(Y||(Y={}));var M;(function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647;function n(i){return typeof i=="number"&&e.MIN_VALUE<=i&&i<=e.MAX_VALUE}e.is=n})(M||(M={}));var w;(function(e){function n(r,t){return r===Number.MAX_VALUE&&(r=M.MAX_VALUE),t===Number.MAX_VALUE&&(t=M.MAX_VALUE),{line:r,character:t}}e.create=n;function i(r){let t=r;return a.objectLiteral(t)&&a.uinteger(t.line)&&a.uinteger(t.character)}e.is=i})(w||(w={}));var h;(function(e){function n(r,t,o,s){if(a.uinteger(r)&&a.uinteger(t)&&a.uinteger(o)&&a.uinteger(s))return{start:w.create(r,t),end:w.create(o,s)};if(w.is(r)&&w.is(t))return{start:r,end:t};throw new Error(`Range#create called with invalid arguments[${r}, ${t}, ${o}, ${s}]`)}e.create=n;function i(r){let t=r;return a.objectLiteral(t)&&w.is(t.start)&&w.is(t.end)}e.is=i})(h||(h={}));var C;(function(e){function n(r,t){return{uri:r,range:t}}e.create=n;function i(r){let t=r;return a.objectLiteral(t)&&h.is(t.range)&&(a.string(t.uri)||a.undefined(t.uri))}e.is=i})(C||(C={}));var Z;(function(e){function n(r,t,o,s){return{targetUri:r,targetRange:t,targetSelectionRange:o,originSelectionRange:s}}e.create=n;function i(r){let t=r;return a.objectLiteral(t)&&h.is(t.targetRange)&&a.string(t.targetUri)&&h.is(t.targetSelectionRange)&&(h.is(t.originSelectionRange)||a.undefined(t.originSelectionRange))}e.is=i})(Z||(Z={}));var S;(function(e){function n(r,t,o,s){return{red:r,green:t,blue:o,alpha:s}}e.create=n;function i(r){const t=r;return a.objectLiteral(t)&&a.numberRange(t.red,0,1)&&a.numberRange(t.green,0,1)&&a.numberRange(t.blue,0,1)&&a.numberRange(t.alpha,0,1)}e.is=i})(S||(S={}));var K;(function(e){function n(r,t){return{range:r,color:t}}e.create=n;function i(r){const t=r;return a.objectLiteral(t)&&h.is(t.range)&&S.is(t.color)}e.is=i})(K||(K={}));var ee;(function(e){function n(r,t,o){return{label:r,textEdit:t,additionalTextEdits:o}}e.create=n;function i(r){const t=r;return a.objectLiteral(t)&&a.string(t.label)&&(a.undefined(t.textEdit)||E.is(t))&&(a.undefined(t.additionalTextEdits)||a.typedArray(t.additionalTextEdits,E.is))}e.is=i})(ee||(ee={}));var A;(function(e){e.Comment="comment",e.Imports="imports",e.Region="region"})(A||(A={}));var te;(function(e){function n(r,t,o,s,u,f){const c={startLine:r,endLine:t};return a.defined(o)&&(c.startCharacter=o),a.defined(s)&&(c.endCharacter=s),a.defined(u)&&(c.kind=u),a.defined(f)&&(c.collapsedText=f),c}e.create=n;function i(r){const t=r;return a.objectLiteral(t)&&a.uinteger(t.startLine)&&a.uinteger(t.startLine)&&(a.undefined(t.startCharacter)||a.uinteger(t.startCharacter))&&(a.undefined(t.endCharacter)||a.uinteger(t.endCharacter))&&(a.undefined(t.kind)||a.string(t.kind))}e.is=i})(te||(te={}));var U;(function(e){function n(r,t){return{location:r,message:t}}e.create=n;function i(r){let t=r;return a.defined(t)&&C.is(t.location)&&a.string(t.message)}e.is=i})(U||(U={}));var x;(function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4})(x||(x={}));var re;(function(e){e.Unnecessary=1,e.Deprecated=2})(re||(re={}));var ne;(function(e){function n(i){const r=i;return a.objectLiteral(r)&&a.string(r.href)}e.is=n})(ne||(ne={}));var y;(function(e){function n(r,t,o,s,u,f){let c={range:r,message:t};return a.defined(o)&&(c.severity=o),a.defined(s)&&(c.code=s),a.defined(u)&&(c.source=u),a.defined(f)&&(c.relatedInformation=f),c}e.create=n;function i(r){var t;let o=r;return a.defined(o)&&h.is(o.range)&&a.string(o.message)&&(a.number(o.severity)||a.undefined(o.severity))&&(a.integer(o.code)||a.string(o.code)||a.undefined(o.code))&&(a.undefined(o.codeDescription)||a.string((t=o.codeDescription)===null||t===void 0?void 0:t.href))&&(a.string(o.source)||a.undefined(o.source))&&(a.undefined(o.relatedInformation)||a.typedArray(o.relatedInformation,U.is))}e.is=i})(y||(y={}));var I;(function(e){function n(r,t,...o){let s={title:r,command:t};return a.defined(o)&&o.length>0&&(s.arguments=o),s}e.create=n;function i(r){let t=r;return a.defined(t)&&a.string(t.title)&&a.string(t.command)}e.is=i})(I||(I={}));var E;(function(e){function n(o,s){return{range:o,newText:s}}e.replace=n;function i(o,s){return{range:{start:o,end:o},newText:s}}e.insert=i;function r(o){return{range:o,newText:""}}e.del=r;function t(o){const s=o;return a.objectLiteral(s)&&a.string(s.newText)&&h.is(s.range)}e.is=t})(E||(E={}));var V;(function(e){function n(r,t,o){const s={label:r};return t!==void 0&&(s.needsConfirmation=t),o!==void 0&&(s.description=o),s}e.create=n;function i(r){const t=r;return a.objectLiteral(t)&&a.string(t.label)&&(a.boolean(t.needsConfirmation)||t.needsConfirmation===void 0)&&(a.string(t.description)||t.description===void 0)}e.is=i})(V||(V={}));var L;(function(e){function n(i){const r=i;return a.string(r)}e.is=n})(L||(L={}));var ie;(function(e){function n(o,s,u){return{range:o,newText:s,annotationId:u}}e.replace=n;function i(o,s,u){return{range:{start:o,end:o},newText:s,annotationId:u}}e.insert=i;function r(o,s){return{range:o,newText:"",annotationId:s}}e.del=r;function t(o){const s=o;return E.is(s)&&(V.is(s.annotationId)||L.is(s.annotationId))}e.is=t})(ie||(ie={}));var W;(function(e){function n(r,t){return{textDocument:r,edits:t}}e.create=n;function i(r){let t=r;return a.defined(t)&&B.is(t.textDocument)&&Array.isArray(t.edits)}e.is=i})(W||(W={}));var H;(function(e){function n(r,t,o){let s={kind:"create",uri:r};return t!==void 0&&(t.overwrite!==void 0||t.ignoreIfExists!==void 0)&&(s.options=t),o!==void 0&&(s.annotationId=o),s}e.create=n;function i(r){let t=r;return t&&t.kind==="create"&&a.string(t.uri)&&(t.options===void 0||(t.options.overwrite===void 0||a.boolean(t.options.overwrite))&&(t.options.ignoreIfExists===void 0||a.boolean(t.options.ignoreIfExists)))&&(t.annotationId===void 0||L.is(t.annotationId))}e.is=i})(H||(H={}));var X;(function(e){function n(r,t,o,s){let u={kind:"rename",oldUri:r,newUri:t};return o!==void 0&&(o.overwrite!==void 0||o.ignoreIfExists!==void 0)&&(u.options=o),s!==void 0&&(u.annotationId=s),u}e.create=n;function i(r){let t=r;return t&&t.kind==="rename"&&a.string(t.oldUri)&&a.string(t.newUri)&&(t.options===void 0||(t.options.overwrite===void 0||a.boolean(t.options.overwrite))&&(t.options.ignoreIfExists===void 0||a.boolean(t.options.ignoreIfExists)))&&(t.annotationId===void 0||L.is(t.annotationId))}e.is=i})(X||(X={}));var $;(function(e){function n(r,t,o){let s={kind:"delete",uri:r};return t!==void 0&&(t.recursive!==void 0||t.ignoreIfNotExists!==void 0)&&(s.options=t),o!==void 0&&(s.annotationId=o),s}e.create=n;function i(r){let t=r;return t&&t.kind==="delete"&&a.string(t.uri)&&(t.options===void 0||(t.options.recursive===void 0||a.boolean(t.options.recursive))&&(t.options.ignoreIfNotExists===void 0||a.boolean(t.options.ignoreIfNotExists)))&&(t.annotationId===void 0||L.is(t.annotationId))}e.is=i})($||($={}));var z;(function(e){function n(i){let r=i;return r&&(r.changes!==void 0||r.documentChanges!==void 0)&&(r.documentChanges===void 0||r.documentChanges.every(t=>a.string(t.kind)?H.is(t)||X.is(t)||$.is(t):W.is(t)))}e.is=n})(z||(z={}));var oe;(function(e){function n(r){return{uri:r}}e.create=n;function i(r){let t=r;return a.defined(t)&&a.string(t.uri)}e.is=i})(oe||(oe={}));var ae;(function(e){function n(r,t){return{uri:r,version:t}}e.create=n;function i(r){let t=r;return a.defined(t)&&a.string(t.uri)&&a.integer(t.version)}e.is=i})(ae||(ae={}));var B;(function(e){function n(r,t){return{uri:r,version:t}}e.create=n;function i(r){let t=r;return a.defined(t)&&a.string(t.uri)&&(t.version===null||a.integer(t.version))}e.is=i})(B||(B={}));var se;(function(e){function n(r,t,o,s){return{uri:r,languageId:t,version:o,text:s}}e.create=n;function i(r){let t=r;return a.defined(t)&&a.string(t.uri)&&a.string(t.languageId)&&a.integer(t.version)&&a.string(t.text)}e.is=i})(se||(se={}));var q;(function(e){e.PlainText="plaintext",e.Markdown="markdown";function n(i){const r=i;return r===e.PlainText||r===e.Markdown}e.is=n})(q||(q={}));var P;(function(e){function n(i){const r=i;return a.objectLiteral(i)&&q.is(r.kind)&&a.string(r.value)}e.is=n})(P||(P={}));var v;(function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25})(v||(v={}));var Q;(function(e){e.PlainText=1,e.Snippet=2})(Q||(Q={}));var ue;(function(e){e.Deprecated=1})(ue||(ue={}));var ce;(function(e){function n(r,t,o){return{newText:r,insert:t,replace:o}}e.create=n;function i(r){const t=r;return t&&a.string(t.newText)&&h.is(t.insert)&&h.is(t.replace)}e.is=i})(ce||(ce={}));var de;(function(e){e.asIs=1,e.adjustIndentation=2})(de||(de={}));var le;(function(e){function n(i){const r=i;return r&&(a.string(r.detail)||r.detail===void 0)&&(a.string(r.description)||r.description===void 0)}e.is=n})(le||(le={}));var fe;(function(e){function n(i){return{label:i}}e.create=n})(fe||(fe={}));var ge;(function(e){function n(i,r){return{items:i||[],isIncomplete:!!r}}e.create=n})(ge||(ge={}));var F;(function(e){function n(r){return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}e.fromPlainText=n;function i(r){const t=r;return a.string(t)||a.objectLiteral(t)&&a.string(t.language)&&a.string(t.value)}e.is=i})(F||(F={}));var he;(function(e){function n(i){let r=i;return!!r&&a.objectLiteral(r)&&(P.is(r.contents)||F.is(r.contents)||a.typedArray(r.contents,F.is))&&(i.range===void 0||h.is(i.range))}e.is=n})(he||(he={}));var ve;(function(e){function n(i,r){return r?{label:i,documentation:r}:{label:i}}e.create=n})(ve||(ve={}));var pe;(function(e){function n(i,r,...t){let o={label:i};return a.defined(r)&&(o.documentation=r),a.defined(t)?o.parameters=t:o.parameters=[],o}e.create=n})(pe||(pe={}));var R;(function(e){e.Text=1,e.Read=2,e.Write=3})(R||(R={}));var me;(function(e){function n(i,r){let t={range:i};return a.number(r)&&(t.kind=r),t}e.create=n})(me||(me={}));var p;(function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26})(p||(p={}));var _e;(function(e){e.Deprecated=1})(_e||(_e={}));var be;(function(e){function n(i,r,t,o,s){let u={name:i,kind:r,location:{uri:o,range:t}};return s&&(u.containerName=s),u}e.create=n})(be||(be={}));var we;(function(e){function n(i,r,t,o){return o!==void 0?{name:i,kind:r,location:{uri:t,range:o}}:{name:i,kind:r,location:{uri:t}}}e.create=n})(we||(we={}));var ke;(function(e){function n(r,t,o,s,u,f){let c={name:r,detail:t,kind:o,range:s,selectionRange:u};return f!==void 0&&(c.children=f),c}e.create=n;function i(r){let t=r;return t&&a.string(t.name)&&a.number(t.kind)&&h.is(t.range)&&h.is(t.selectionRange)&&(t.detail===void 0||a.string(t.detail))&&(t.deprecated===void 0||a.boolean(t.deprecated))&&(t.children===void 0||Array.isArray(t.children))&&(t.tags===void 0||Array.isArray(t.tags))}e.is=i})(ke||(ke={}));var xe;(function(e){e.Empty="",e.QuickFix="quickfix",e.Refactor="refactor",e.RefactorExtract="refactor.extract",e.RefactorInline="refactor.inline",e.RefactorRewrite="refactor.rewrite",e.Source="source",e.SourceOrganizeImports="source.organizeImports",e.SourceFixAll="source.fixAll"})(xe||(xe={}));var j;(function(e){e.Invoked=1,e.Automatic=2})(j||(j={}));var Ie;(function(e){function n(r,t,o){let s={diagnostics:r};return t!=null&&(s.only=t),o!=null&&(s.triggerKind=o),s}e.create=n;function i(r){let t=r;return a.defined(t)&&a.typedArray(t.diagnostics,y.is)&&(t.only===void 0||a.typedArray(t.only,a.string))&&(t.triggerKind===void 0||t.triggerKind===j.Invoked||t.triggerKind===j.Automatic)}e.is=i})(Ie||(Ie={}));var Ee;(function(e){function n(r,t,o){let s={title:r},u=!0;return typeof t=="string"?(u=!1,s.kind=t):I.is(t)?s.command=t:s.edit=t,u&&o!==void 0&&(s.kind=o),s}e.create=n;function i(r){let t=r;return t&&a.string(t.title)&&(t.diagnostics===void 0||a.typedArray(t.diagnostics,y.is))&&(t.kind===void 0||a.string(t.kind))&&(t.edit!==void 0||t.command!==void 0)&&(t.command===void 0||I.is(t.command))&&(t.isPreferred===void 0||a.boolean(t.isPreferred))&&(t.edit===void 0||z.is(t.edit))}e.is=i})(Ee||(Ee={}));var Le;(function(e){function n(r,t){let o={range:r};return a.defined(t)&&(o.data=t),o}e.create=n;function i(r){let t=r;return a.defined(t)&&h.is(t.range)&&(a.undefined(t.command)||I.is(t.command))}e.is=i})(Le||(Le={}));var Ae;(function(e){function n(r,t){return{tabSize:r,insertSpaces:t}}e.create=n;function i(r){let t=r;return a.defined(t)&&a.uinteger(t.tabSize)&&a.boolean(t.insertSpaces)}e.is=i})(Ae||(Ae={}));var Re;(function(e){function n(r,t,o){return{range:r,target:t,data:o}}e.create=n;function i(r){let t=r;return a.defined(t)&&h.is(t.range)&&(a.undefined(t.target)||a.string(t.target))}e.is=i})(Re||(Re={}));var Pe;(function(e){function n(r,t){return{range:r,parent:t}}e.create=n;function i(r){let t=r;return a.objectLiteral(t)&&h.is(t.range)&&(t.parent===void 0||e.is(t.parent))}e.is=i})(Pe||(Pe={}));var De;(function(e){e.namespace="namespace",e.type="type",e.class="class",e.enum="enum",e.interface="interface",e.struct="struct",e.typeParameter="typeParameter",e.parameter="parameter",e.variable="variable",e.property="property",e.enumMember="enumMember",e.event="event",e.function="function",e.method="method",e.macro="macro",e.keyword="keyword",e.modifier="modifier",e.comment="comment",e.string="string",e.number="number",e.regexp="regexp",e.operator="operator",e.decorator="decorator"})(De||(De={}));var Me;(function(e){e.declaration="declaration",e.definition="definition",e.readonly="readonly",e.static="static",e.deprecated="deprecated",e.abstract="abstract",e.async="async",e.modification="modification",e.documentation="documentation",e.defaultLibrary="defaultLibrary"})(Me||(Me={}));var Ce;(function(e){function n(i){const r=i;return a.objectLiteral(r)&&(r.resultId===void 0||typeof r.resultId=="string")&&Array.isArray(r.data)&&(r.data.length===0||typeof r.data[0]=="number")}e.is=n})(Ce||(Ce={}));var ye;(function(e){function n(r,t){return{range:r,text:t}}e.create=n;function i(r){const t=r;return t!=null&&h.is(t.range)&&a.string(t.text)}e.is=i})(ye||(ye={}));var Fe;(function(e){function n(r,t,o){return{range:r,variableName:t,caseSensitiveLookup:o}}e.create=n;function i(r){const t=r;return t!=null&&h.is(t.range)&&a.boolean(t.caseSensitiveLookup)&&(a.string(t.variableName)||t.variableName===void 0)}e.is=i})(Fe||(Fe={}));var je;(function(e){function n(r,t){return{range:r,expression:t}}e.create=n;function i(r){const t=r;return t!=null&&h.is(t.range)&&(a.string(t.expression)||t.expression===void 0)}e.is=i})(je||(je={}));var Ne;(function(e){function n(r,t){return{frameId:r,stoppedLocation:t}}e.create=n;function i(r){const t=r;return a.defined(t)&&h.is(r.stoppedLocation)}e.is=i})(Ne||(Ne={}));var G;(function(e){e.Type=1,e.Parameter=2;function n(i){return i===1||i===2}e.is=n})(G||(G={}));var J;(function(e){function n(r){return{value:r}}e.create=n;function i(r){const t=r;return a.objectLiteral(t)&&(t.tooltip===void 0||a.string(t.tooltip)||P.is(t.tooltip))&&(t.location===void 0||C.is(t.location))&&(t.command===void 0||I.is(t.command))}e.is=i})(J||(J={}));var Oe;(function(e){function n(r,t,o){const s={position:r,label:t};return o!==void 0&&(s.kind=o),s}e.create=n;function i(r){const t=r;return a.objectLiteral(t)&&w.is(t.position)&&(a.string(t.label)||a.typedArray(t.label,J.is))&&(t.kind===void 0||G.is(t.kind))&&t.textEdits===void 0||a.typedArray(t.textEdits,E.is)&&(t.tooltip===void 0||a.string(t.tooltip)||P.is(t.tooltip))&&(t.paddingLeft===void 0||a.boolean(t.paddingLeft))&&(t.paddingRight===void 0||a.boolean(t.paddingRight))}e.is=i})(Oe||(Oe={}));var Se;(function(e){function n(i){return{kind:"snippet",value:i}}e.createSnippet=n})(Se||(Se={}));var Ue;(function(e){function n(i,r,t,o){return{insertText:i,filterText:r,range:t,command:o}}e.create=n})(Ue||(Ue={}));var Ve;(function(e){function n(i){return{items:i}}e.create=n})(Ve||(Ve={}));var We;(function(e){e.Invoked=0,e.Automatic=1})(We||(We={}));var He;(function(e){function n(i,r){return{range:i,text:r}}e.create=n})(He||(He={}));var Xe;(function(e){function n(i,r){return{triggerKind:i,selectedCompletionInfo:r}}e.create=n})(Xe||(Xe={}));var $e;(function(e){function n(i){const r=i;return a.objectLiteral(r)&&O.is(r.uri)&&a.string(r.name)}e.is=n})($e||($e={}));var ze;(function(e){function n(o,s,u,f){return new ct(o,s,u,f)}e.create=n;function i(o){let s=o;return!!(a.defined(s)&&a.string(s.uri)&&(a.undefined(s.languageId)||a.string(s.languageId))&&a.uinteger(s.lineCount)&&a.func(s.getText)&&a.func(s.positionAt)&&a.func(s.offsetAt))}e.is=i;function r(o,s){let u=o.getText(),f=t(s,(g,_)=>{let b=g.range.start.line-_.range.start.line;return b===0?g.range.start.character-_.range.start.character:b}),c=u.length;for(let g=f.length-1;g>=0;g--){let _=f[g],b=o.offsetAt(_.range.start),l=o.offsetAt(_.range.end);if(l<=c)u=u.substring(0,b)+_.newText+u.substring(l,u.length);else throw new Error("Overlapping edit");c=b}return u}e.applyEdits=r;function t(o,s){if(o.length<=1)return o;const u=o.length/2|0,f=o.slice(0,u),c=o.slice(u);t(f,s),t(c,s);let g=0,_=0,b=0;for(;g0&&e.push(n.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let n=this.getLineOffsets(),i=0,r=n.length;if(r===0)return w.create(0,e);for(;ie?r=o:i=o+1}let t=i-1;return w.create(t,e-n[t])}offsetAt(e){let n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;let i=n[e.line],r=e.line+1"u"}e.undefined=r;function t(l){return l===!0||l===!1}e.boolean=t;function o(l){return n.call(l)==="[object String]"}e.string=o;function s(l){return n.call(l)==="[object Number]"}e.number=s;function u(l,N,Ke){return n.call(l)==="[object Number]"&&N<=l&&l<=Ke}e.numberRange=u;function f(l){return n.call(l)==="[object Number]"&&-2147483648<=l&&l<=2147483647}e.integer=f;function c(l){return n.call(l)==="[object Number]"&&0<=l&&l<=2147483647}e.uinteger=c;function g(l){return n.call(l)==="[object Function]"}e.func=g;function _(l){return l!==null&&typeof l=="object"}e.objectLiteral=_;function b(l,N){return Array.isArray(l)&&l.every(N)}e.typedArray=b})(a||(a={}));var dt=class{constructor(e,n,i){this._languageId=e,this._worker=n,this._disposables=[],this._listener=Object.create(null);const r=o=>{let s=o.getLanguageId();if(s!==this._languageId)return;let u;this._listener[o.uri.toString()]=o.onDidChangeContent(()=>{window.clearTimeout(u),u=window.setTimeout(()=>this._doValidate(o.uri,s),500)}),this._doValidate(o.uri,s)},t=o=>{d.editor.setModelMarkers(o,this._languageId,[]);let s=o.uri.toString(),u=this._listener[s];u&&(u.dispose(),delete this._listener[s])};this._disposables.push(d.editor.onDidCreateModel(r)),this._disposables.push(d.editor.onWillDisposeModel(t)),this._disposables.push(d.editor.onDidChangeModelLanguage(o=>{t(o.model),r(o.model)})),this._disposables.push(i(o=>{d.editor.getModels().forEach(s=>{s.getLanguageId()===this._languageId&&(t(s),r(s))})})),this._disposables.push({dispose:()=>{d.editor.getModels().forEach(t);for(let o in this._listener)this._listener[o].dispose()}}),d.editor.getModels().forEach(r)}dispose(){this._disposables.forEach(e=>e&&e.dispose()),this._disposables.length=0}_doValidate(e,n){this._worker(e).then(i=>i.doValidation(e.toString())).then(i=>{const r=i.map(o=>ft(e,o));let t=d.editor.getModel(e);t&&t.getLanguageId()===n&&d.editor.setModelMarkers(t,n,r)}).then(void 0,i=>{console.error(i)})}};function lt(e){switch(e){case x.Error:return d.MarkerSeverity.Error;case x.Warning:return d.MarkerSeverity.Warning;case x.Information:return d.MarkerSeverity.Info;case x.Hint:return d.MarkerSeverity.Hint;default:return d.MarkerSeverity.Info}}function ft(e,n){let i=typeof n.code=="number"?String(n.code):n.code;return{severity:lt(n.severity),startLineNumber:n.range.start.line+1,startColumn:n.range.start.character+1,endLineNumber:n.range.end.line+1,endColumn:n.range.end.character+1,message:n.message,code:i,source:n.source}}var gt=class{constructor(e,n){this._worker=e,this._triggerCharacters=n}get triggerCharacters(){return this._triggerCharacters}provideCompletionItems(e,n,i,r){const t=e.uri;return this._worker(t).then(o=>o.doComplete(t.toString(),k(n))).then(o=>{if(!o)return;const s=e.getWordUntilPosition(n),u=new d.Range(n.lineNumber,s.startColumn,n.lineNumber,s.endColumn),f=o.items.map(c=>{const g={label:c.label,insertText:c.insertText||c.label,sortText:c.sortText,filterText:c.filterText,documentation:c.documentation,detail:c.detail,command:pt(c.command),range:u,kind:vt(c.kind)};return c.textEdit&&(ht(c.textEdit)?g.range={insert:m(c.textEdit.insert),replace:m(c.textEdit.replace)}:g.range=m(c.textEdit.range),g.insertText=c.textEdit.newText),c.additionalTextEdits&&(g.additionalTextEdits=c.additionalTextEdits.map(D)),c.insertTextFormat===Q.Snippet&&(g.insertTextRules=d.languages.CompletionItemInsertTextRule.InsertAsSnippet),g});return{isIncomplete:o.isIncomplete,suggestions:f}})}};function k(e){if(e)return{character:e.column-1,line:e.lineNumber-1}}function Qe(e){if(e)return{start:{line:e.startLineNumber-1,character:e.startColumn-1},end:{line:e.endLineNumber-1,character:e.endColumn-1}}}function m(e){if(e)return new d.Range(e.start.line+1,e.start.character+1,e.end.line+1,e.end.character+1)}function ht(e){return typeof e.insert<"u"&&typeof e.replace<"u"}function vt(e){const n=d.languages.CompletionItemKind;switch(e){case v.Text:return n.Text;case v.Method:return n.Method;case v.Function:return n.Function;case v.Constructor:return n.Constructor;case v.Field:return n.Field;case v.Variable:return n.Variable;case v.Class:return n.Class;case v.Interface:return n.Interface;case v.Module:return n.Module;case v.Property:return n.Property;case v.Unit:return n.Unit;case v.Value:return n.Value;case v.Enum:return n.Enum;case v.Keyword:return n.Keyword;case v.Snippet:return n.Snippet;case v.Color:return n.Color;case v.File:return n.File;case v.Reference:return n.Reference}return n.Property}function D(e){if(e)return{range:m(e.range),text:e.newText}}function pt(e){return e&&e.command==="editor.action.triggerSuggest"?{id:e.command,title:e.title,arguments:e.arguments}:void 0}var mt=class{constructor(e){this._worker=e}provideHover(e,n,i){let r=e.uri;return this._worker(r).then(t=>t.doHover(r.toString(),k(n))).then(t=>{if(t)return{range:m(t.range),contents:bt(t.contents)}})}};function _t(e){return e&&typeof e=="object"&&typeof e.kind=="string"}function Be(e){return typeof e=="string"?{value:e}:_t(e)?e.kind==="plaintext"?{value:e.value.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}:{value:e.value}:{value:"```"+e.language+` +`+e.value+"\n```\n"}}function bt(e){if(e)return Array.isArray(e)?e.map(Be):[Be(e)]}var wt=class{constructor(e){this._worker=e}provideDocumentHighlights(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.findDocumentHighlights(r.toString(),k(n))).then(t=>{if(t)return t.map(o=>({range:m(o.range),kind:kt(o.kind)}))})}};function kt(e){switch(e){case R.Read:return d.languages.DocumentHighlightKind.Read;case R.Write:return d.languages.DocumentHighlightKind.Write;case R.Text:return d.languages.DocumentHighlightKind.Text}return d.languages.DocumentHighlightKind.Text}var xt=class{constructor(e){this._worker=e}provideDefinition(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.findDefinition(r.toString(),k(n))).then(t=>{if(t)return[Ge(t)]})}};function Ge(e){return{uri:d.Uri.parse(e.uri),range:m(e.range)}}var It=class{constructor(e){this._worker=e}provideReferences(e,n,i,r){const t=e.uri;return this._worker(t).then(o=>o.findReferences(t.toString(),k(n))).then(o=>{if(o)return o.map(Ge)})}},Et=class{constructor(e){this._worker=e}provideRenameEdits(e,n,i,r){const t=e.uri;return this._worker(t).then(o=>o.doRename(t.toString(),k(n),i)).then(o=>Lt(o))}};function Lt(e){if(!e||!e.changes)return;let n=[];for(let i in e.changes){const r=d.Uri.parse(i);for(let t of e.changes[i])n.push({resource:r,versionId:void 0,textEdit:{range:m(t.range),text:t.newText}})}return{edits:n}}var At=class{constructor(e){this._worker=e}provideDocumentSymbols(e,n){const i=e.uri;return this._worker(i).then(r=>r.findDocumentSymbols(i.toString())).then(r=>{if(r)return r.map(t=>Rt(t)?Je(t):{name:t.name,detail:"",containerName:t.containerName,kind:Te(t.kind),range:m(t.location.range),selectionRange:m(t.location.range),tags:[]})})}};function Rt(e){return"children"in e}function Je(e){return{name:e.name,detail:e.detail??"",kind:Te(e.kind),range:m(e.range),selectionRange:m(e.selectionRange),tags:e.tags??[],children:(e.children??[]).map(n=>Je(n))}}function Te(e){let n=d.languages.SymbolKind;switch(e){case p.File:return n.File;case p.Module:return n.Module;case p.Namespace:return n.Namespace;case p.Package:return n.Package;case p.Class:return n.Class;case p.Method:return n.Method;case p.Property:return n.Property;case p.Field:return n.Field;case p.Constructor:return n.Constructor;case p.Enum:return n.Enum;case p.Interface:return n.Interface;case p.Function:return n.Function;case p.Variable:return n.Variable;case p.Constant:return n.Constant;case p.String:return n.String;case p.Number:return n.Number;case p.Boolean:return n.Boolean;case p.Array:return n.Array}return n.Function}var Ot=class{constructor(e){this._worker=e}provideLinks(e,n){const i=e.uri;return this._worker(i).then(r=>r.findDocumentLinks(i.toString())).then(r=>{if(r)return{links:r.map(t=>({range:m(t.range),url:t.target}))}})}},Pt=class{constructor(e){this._worker=e}provideDocumentFormattingEdits(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.format(r.toString(),null,Ye(n)).then(o=>{if(!(!o||o.length===0))return o.map(D)}))}},Dt=class{constructor(e){this._worker=e,this.canFormatMultipleRanges=!1}provideDocumentRangeFormattingEdits(e,n,i,r){const t=e.uri;return this._worker(t).then(o=>o.format(t.toString(),Qe(n),Ye(i)).then(s=>{if(!(!s||s.length===0))return s.map(D)}))}};function Ye(e){return{tabSize:e.tabSize,insertSpaces:e.insertSpaces}}var Mt=class{constructor(e){this._worker=e}provideDocumentColors(e,n){const i=e.uri;return this._worker(i).then(r=>r.findDocumentColors(i.toString())).then(r=>{if(r)return r.map(t=>({color:t.color,range:m(t.range)}))})}provideColorPresentations(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.getColorPresentations(r.toString(),n.color,Qe(n.range))).then(t=>{if(t)return t.map(o=>{let s={label:o.label};return o.textEdit&&(s.textEdit=D(o.textEdit)),o.additionalTextEdits&&(s.additionalTextEdits=o.additionalTextEdits.map(D)),s})})}},Ct=class{constructor(e){this._worker=e}provideFoldingRanges(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.getFoldingRanges(r.toString(),n)).then(t=>{if(t)return t.map(o=>{const s={start:o.startLine+1,end:o.endLine+1};return typeof o.kind<"u"&&(s.kind=yt(o.kind)),s})})}};function yt(e){switch(e){case A.Comment:return d.languages.FoldingRangeKind.Comment;case A.Imports:return d.languages.FoldingRangeKind.Imports;case A.Region:return d.languages.FoldingRangeKind.Region}}var Ft=class{constructor(e){this._worker=e}provideSelectionRanges(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.getSelectionRanges(r.toString(),n.map(k))).then(t=>{if(t)return t.map(o=>{const s=[];for(;o;)s.push({range:m(o.range)}),o=o.parent;return s})})}};function St(e){const n=[],i=[],r=new ut(e);n.push(r);const t=(...s)=>r.getLanguageServiceWorker(...s);function o(){const{languageId:s,modeConfiguration:u}=e;Ze(i),u.completionItems&&i.push(d.languages.registerCompletionItemProvider(s,new gt(t,["/","-",":"]))),u.hovers&&i.push(d.languages.registerHoverProvider(s,new mt(t))),u.documentHighlights&&i.push(d.languages.registerDocumentHighlightProvider(s,new wt(t))),u.definitions&&i.push(d.languages.registerDefinitionProvider(s,new xt(t))),u.references&&i.push(d.languages.registerReferenceProvider(s,new It(t))),u.documentSymbols&&i.push(d.languages.registerDocumentSymbolProvider(s,new At(t))),u.rename&&i.push(d.languages.registerRenameProvider(s,new Et(t))),u.colors&&i.push(d.languages.registerColorProvider(s,new Mt(t))),u.foldingRanges&&i.push(d.languages.registerFoldingRangeProvider(s,new Ct(t))),u.diagnostics&&i.push(new dt(s,t,e.onDidChange)),u.selectionRanges&&i.push(d.languages.registerSelectionRangeProvider(s,new Ft(t))),u.documentFormattingEdits&&i.push(d.languages.registerDocumentFormattingEditProvider(s,new Pt(t))),u.documentRangeFormattingEdits&&i.push(d.languages.registerDocumentRangeFormattingEditProvider(s,new Dt(t)))}return o(),n.push(qe(i)),qe(n)}function qe(e){return{dispose:()=>Ze(e)}}function Ze(e){for(;e.length;)e.pop().dispose()}export{gt as CompletionAdapter,xt as DefinitionAdapter,dt as DiagnosticsAdapter,Mt as DocumentColorAdapter,Pt as DocumentFormattingEditProvider,wt as DocumentHighlightAdapter,Ot as DocumentLinkAdapter,Dt as DocumentRangeFormattingEditProvider,At as DocumentSymbolAdapter,Ct as FoldingRangeAdapter,mt as HoverAdapter,It as ReferenceAdapter,Et as RenameAdapter,Ft as SelectionRangeAdapter,ut as WorkerManager,k as fromPosition,Qe as fromRange,St as setupMode,m as toRange,D as toTextEdit}; diff --git a/fluidd/assets/cssMode-CHF1Y-ak.js b/fluidd/assets/cssMode-CHF1Y-ak.js new file mode 100644 index 0000000..ac44dc0 --- /dev/null +++ b/fluidd/assets/cssMode-CHF1Y-ak.js @@ -0,0 +1,9 @@ +import{hl as et}from"./setupMonaco-DQfVw6JO.js";import"./index-CuYiwiAV.js";/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Version: 0.50.0(c321d0fbecb50ab8a5365fa1965476b0ae63fc87) + * Released under the MIT license + * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt + *-----------------------------------------------------------------------------*/var tt=Object.defineProperty,rt=Object.getOwnPropertyDescriptor,nt=Object.getOwnPropertyNames,it=Object.prototype.hasOwnProperty,ot=(e,n,i,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let t of nt(n))!it.call(e,t)&&t!==i&&tt(e,t,{get:()=>n[t],enumerable:!(r=rt(n,t))||r.enumerable});return e},at=(e,n,i)=>(ot(e,n,"default"),i),d={};at(d,et);var st=2*60*1e3,ut=class{constructor(e){this._defaults=e,this._worker=null,this._client=null,this._idleCheckInterval=window.setInterval(()=>this._checkIfIdle(),30*1e3),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker())}_stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null}dispose(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()}_checkIfIdle(){if(!this._worker)return;Date.now()-this._lastUsedTime>st&&this._stopWorker()}_getClient(){return this._lastUsedTime=Date.now(),this._client||(this._worker=d.editor.createWebWorker({moduleId:"vs/language/css/cssWorker",label:this._defaults.languageId,createData:{options:this._defaults.options,languageId:this._defaults.languageId}}),this._client=this._worker.getProxy()),this._client}getLanguageServiceWorker(...e){let n;return this._getClient().then(i=>{n=i}).then(i=>{if(this._worker)return this._worker.withSyncedResources(e)}).then(i=>n)}},T;(function(e){function n(i){return typeof i=="string"}e.is=n})(T||(T={}));var O;(function(e){function n(i){return typeof i=="string"}e.is=n})(O||(O={}));var Y;(function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647;function n(i){return typeof i=="number"&&e.MIN_VALUE<=i&&i<=e.MAX_VALUE}e.is=n})(Y||(Y={}));var M;(function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647;function n(i){return typeof i=="number"&&e.MIN_VALUE<=i&&i<=e.MAX_VALUE}e.is=n})(M||(M={}));var w;(function(e){function n(r,t){return r===Number.MAX_VALUE&&(r=M.MAX_VALUE),t===Number.MAX_VALUE&&(t=M.MAX_VALUE),{line:r,character:t}}e.create=n;function i(r){let t=r;return a.objectLiteral(t)&&a.uinteger(t.line)&&a.uinteger(t.character)}e.is=i})(w||(w={}));var h;(function(e){function n(r,t,o,s){if(a.uinteger(r)&&a.uinteger(t)&&a.uinteger(o)&&a.uinteger(s))return{start:w.create(r,t),end:w.create(o,s)};if(w.is(r)&&w.is(t))return{start:r,end:t};throw new Error(`Range#create called with invalid arguments[${r}, ${t}, ${o}, ${s}]`)}e.create=n;function i(r){let t=r;return a.objectLiteral(t)&&w.is(t.start)&&w.is(t.end)}e.is=i})(h||(h={}));var C;(function(e){function n(r,t){return{uri:r,range:t}}e.create=n;function i(r){let t=r;return a.objectLiteral(t)&&h.is(t.range)&&(a.string(t.uri)||a.undefined(t.uri))}e.is=i})(C||(C={}));var Z;(function(e){function n(r,t,o,s){return{targetUri:r,targetRange:t,targetSelectionRange:o,originSelectionRange:s}}e.create=n;function i(r){let t=r;return a.objectLiteral(t)&&h.is(t.targetRange)&&a.string(t.targetUri)&&h.is(t.targetSelectionRange)&&(h.is(t.originSelectionRange)||a.undefined(t.originSelectionRange))}e.is=i})(Z||(Z={}));var S;(function(e){function n(r,t,o,s){return{red:r,green:t,blue:o,alpha:s}}e.create=n;function i(r){const t=r;return a.objectLiteral(t)&&a.numberRange(t.red,0,1)&&a.numberRange(t.green,0,1)&&a.numberRange(t.blue,0,1)&&a.numberRange(t.alpha,0,1)}e.is=i})(S||(S={}));var K;(function(e){function n(r,t){return{range:r,color:t}}e.create=n;function i(r){const t=r;return a.objectLiteral(t)&&h.is(t.range)&&S.is(t.color)}e.is=i})(K||(K={}));var ee;(function(e){function n(r,t,o){return{label:r,textEdit:t,additionalTextEdits:o}}e.create=n;function i(r){const t=r;return a.objectLiteral(t)&&a.string(t.label)&&(a.undefined(t.textEdit)||E.is(t))&&(a.undefined(t.additionalTextEdits)||a.typedArray(t.additionalTextEdits,E.is))}e.is=i})(ee||(ee={}));var A;(function(e){e.Comment="comment",e.Imports="imports",e.Region="region"})(A||(A={}));var te;(function(e){function n(r,t,o,s,u,f){const c={startLine:r,endLine:t};return a.defined(o)&&(c.startCharacter=o),a.defined(s)&&(c.endCharacter=s),a.defined(u)&&(c.kind=u),a.defined(f)&&(c.collapsedText=f),c}e.create=n;function i(r){const t=r;return a.objectLiteral(t)&&a.uinteger(t.startLine)&&a.uinteger(t.startLine)&&(a.undefined(t.startCharacter)||a.uinteger(t.startCharacter))&&(a.undefined(t.endCharacter)||a.uinteger(t.endCharacter))&&(a.undefined(t.kind)||a.string(t.kind))}e.is=i})(te||(te={}));var U;(function(e){function n(r,t){return{location:r,message:t}}e.create=n;function i(r){let t=r;return a.defined(t)&&C.is(t.location)&&a.string(t.message)}e.is=i})(U||(U={}));var x;(function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4})(x||(x={}));var re;(function(e){e.Unnecessary=1,e.Deprecated=2})(re||(re={}));var ne;(function(e){function n(i){const r=i;return a.objectLiteral(r)&&a.string(r.href)}e.is=n})(ne||(ne={}));var y;(function(e){function n(r,t,o,s,u,f){let c={range:r,message:t};return a.defined(o)&&(c.severity=o),a.defined(s)&&(c.code=s),a.defined(u)&&(c.source=u),a.defined(f)&&(c.relatedInformation=f),c}e.create=n;function i(r){var t;let o=r;return a.defined(o)&&h.is(o.range)&&a.string(o.message)&&(a.number(o.severity)||a.undefined(o.severity))&&(a.integer(o.code)||a.string(o.code)||a.undefined(o.code))&&(a.undefined(o.codeDescription)||a.string((t=o.codeDescription)===null||t===void 0?void 0:t.href))&&(a.string(o.source)||a.undefined(o.source))&&(a.undefined(o.relatedInformation)||a.typedArray(o.relatedInformation,U.is))}e.is=i})(y||(y={}));var I;(function(e){function n(r,t,...o){let s={title:r,command:t};return a.defined(o)&&o.length>0&&(s.arguments=o),s}e.create=n;function i(r){let t=r;return a.defined(t)&&a.string(t.title)&&a.string(t.command)}e.is=i})(I||(I={}));var E;(function(e){function n(o,s){return{range:o,newText:s}}e.replace=n;function i(o,s){return{range:{start:o,end:o},newText:s}}e.insert=i;function r(o){return{range:o,newText:""}}e.del=r;function t(o){const s=o;return a.objectLiteral(s)&&a.string(s.newText)&&h.is(s.range)}e.is=t})(E||(E={}));var V;(function(e){function n(r,t,o){const s={label:r};return t!==void 0&&(s.needsConfirmation=t),o!==void 0&&(s.description=o),s}e.create=n;function i(r){const t=r;return a.objectLiteral(t)&&a.string(t.label)&&(a.boolean(t.needsConfirmation)||t.needsConfirmation===void 0)&&(a.string(t.description)||t.description===void 0)}e.is=i})(V||(V={}));var L;(function(e){function n(i){const r=i;return a.string(r)}e.is=n})(L||(L={}));var ie;(function(e){function n(o,s,u){return{range:o,newText:s,annotationId:u}}e.replace=n;function i(o,s,u){return{range:{start:o,end:o},newText:s,annotationId:u}}e.insert=i;function r(o,s){return{range:o,newText:"",annotationId:s}}e.del=r;function t(o){const s=o;return E.is(s)&&(V.is(s.annotationId)||L.is(s.annotationId))}e.is=t})(ie||(ie={}));var W;(function(e){function n(r,t){return{textDocument:r,edits:t}}e.create=n;function i(r){let t=r;return a.defined(t)&&B.is(t.textDocument)&&Array.isArray(t.edits)}e.is=i})(W||(W={}));var H;(function(e){function n(r,t,o){let s={kind:"create",uri:r};return t!==void 0&&(t.overwrite!==void 0||t.ignoreIfExists!==void 0)&&(s.options=t),o!==void 0&&(s.annotationId=o),s}e.create=n;function i(r){let t=r;return t&&t.kind==="create"&&a.string(t.uri)&&(t.options===void 0||(t.options.overwrite===void 0||a.boolean(t.options.overwrite))&&(t.options.ignoreIfExists===void 0||a.boolean(t.options.ignoreIfExists)))&&(t.annotationId===void 0||L.is(t.annotationId))}e.is=i})(H||(H={}));var X;(function(e){function n(r,t,o,s){let u={kind:"rename",oldUri:r,newUri:t};return o!==void 0&&(o.overwrite!==void 0||o.ignoreIfExists!==void 0)&&(u.options=o),s!==void 0&&(u.annotationId=s),u}e.create=n;function i(r){let t=r;return t&&t.kind==="rename"&&a.string(t.oldUri)&&a.string(t.newUri)&&(t.options===void 0||(t.options.overwrite===void 0||a.boolean(t.options.overwrite))&&(t.options.ignoreIfExists===void 0||a.boolean(t.options.ignoreIfExists)))&&(t.annotationId===void 0||L.is(t.annotationId))}e.is=i})(X||(X={}));var $;(function(e){function n(r,t,o){let s={kind:"delete",uri:r};return t!==void 0&&(t.recursive!==void 0||t.ignoreIfNotExists!==void 0)&&(s.options=t),o!==void 0&&(s.annotationId=o),s}e.create=n;function i(r){let t=r;return t&&t.kind==="delete"&&a.string(t.uri)&&(t.options===void 0||(t.options.recursive===void 0||a.boolean(t.options.recursive))&&(t.options.ignoreIfNotExists===void 0||a.boolean(t.options.ignoreIfNotExists)))&&(t.annotationId===void 0||L.is(t.annotationId))}e.is=i})($||($={}));var z;(function(e){function n(i){let r=i;return r&&(r.changes!==void 0||r.documentChanges!==void 0)&&(r.documentChanges===void 0||r.documentChanges.every(t=>a.string(t.kind)?H.is(t)||X.is(t)||$.is(t):W.is(t)))}e.is=n})(z||(z={}));var oe;(function(e){function n(r){return{uri:r}}e.create=n;function i(r){let t=r;return a.defined(t)&&a.string(t.uri)}e.is=i})(oe||(oe={}));var ae;(function(e){function n(r,t){return{uri:r,version:t}}e.create=n;function i(r){let t=r;return a.defined(t)&&a.string(t.uri)&&a.integer(t.version)}e.is=i})(ae||(ae={}));var B;(function(e){function n(r,t){return{uri:r,version:t}}e.create=n;function i(r){let t=r;return a.defined(t)&&a.string(t.uri)&&(t.version===null||a.integer(t.version))}e.is=i})(B||(B={}));var se;(function(e){function n(r,t,o,s){return{uri:r,languageId:t,version:o,text:s}}e.create=n;function i(r){let t=r;return a.defined(t)&&a.string(t.uri)&&a.string(t.languageId)&&a.integer(t.version)&&a.string(t.text)}e.is=i})(se||(se={}));var q;(function(e){e.PlainText="plaintext",e.Markdown="markdown";function n(i){const r=i;return r===e.PlainText||r===e.Markdown}e.is=n})(q||(q={}));var P;(function(e){function n(i){const r=i;return a.objectLiteral(i)&&q.is(r.kind)&&a.string(r.value)}e.is=n})(P||(P={}));var v;(function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25})(v||(v={}));var Q;(function(e){e.PlainText=1,e.Snippet=2})(Q||(Q={}));var ue;(function(e){e.Deprecated=1})(ue||(ue={}));var ce;(function(e){function n(r,t,o){return{newText:r,insert:t,replace:o}}e.create=n;function i(r){const t=r;return t&&a.string(t.newText)&&h.is(t.insert)&&h.is(t.replace)}e.is=i})(ce||(ce={}));var de;(function(e){e.asIs=1,e.adjustIndentation=2})(de||(de={}));var le;(function(e){function n(i){const r=i;return r&&(a.string(r.detail)||r.detail===void 0)&&(a.string(r.description)||r.description===void 0)}e.is=n})(le||(le={}));var fe;(function(e){function n(i){return{label:i}}e.create=n})(fe||(fe={}));var ge;(function(e){function n(i,r){return{items:i||[],isIncomplete:!!r}}e.create=n})(ge||(ge={}));var F;(function(e){function n(r){return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}e.fromPlainText=n;function i(r){const t=r;return a.string(t)||a.objectLiteral(t)&&a.string(t.language)&&a.string(t.value)}e.is=i})(F||(F={}));var he;(function(e){function n(i){let r=i;return!!r&&a.objectLiteral(r)&&(P.is(r.contents)||F.is(r.contents)||a.typedArray(r.contents,F.is))&&(i.range===void 0||h.is(i.range))}e.is=n})(he||(he={}));var ve;(function(e){function n(i,r){return r?{label:i,documentation:r}:{label:i}}e.create=n})(ve||(ve={}));var pe;(function(e){function n(i,r,...t){let o={label:i};return a.defined(r)&&(o.documentation=r),a.defined(t)?o.parameters=t:o.parameters=[],o}e.create=n})(pe||(pe={}));var R;(function(e){e.Text=1,e.Read=2,e.Write=3})(R||(R={}));var me;(function(e){function n(i,r){let t={range:i};return a.number(r)&&(t.kind=r),t}e.create=n})(me||(me={}));var p;(function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26})(p||(p={}));var _e;(function(e){e.Deprecated=1})(_e||(_e={}));var be;(function(e){function n(i,r,t,o,s){let u={name:i,kind:r,location:{uri:o,range:t}};return s&&(u.containerName=s),u}e.create=n})(be||(be={}));var we;(function(e){function n(i,r,t,o){return o!==void 0?{name:i,kind:r,location:{uri:t,range:o}}:{name:i,kind:r,location:{uri:t}}}e.create=n})(we||(we={}));var ke;(function(e){function n(r,t,o,s,u,f){let c={name:r,detail:t,kind:o,range:s,selectionRange:u};return f!==void 0&&(c.children=f),c}e.create=n;function i(r){let t=r;return t&&a.string(t.name)&&a.number(t.kind)&&h.is(t.range)&&h.is(t.selectionRange)&&(t.detail===void 0||a.string(t.detail))&&(t.deprecated===void 0||a.boolean(t.deprecated))&&(t.children===void 0||Array.isArray(t.children))&&(t.tags===void 0||Array.isArray(t.tags))}e.is=i})(ke||(ke={}));var xe;(function(e){e.Empty="",e.QuickFix="quickfix",e.Refactor="refactor",e.RefactorExtract="refactor.extract",e.RefactorInline="refactor.inline",e.RefactorRewrite="refactor.rewrite",e.Source="source",e.SourceOrganizeImports="source.organizeImports",e.SourceFixAll="source.fixAll"})(xe||(xe={}));var j;(function(e){e.Invoked=1,e.Automatic=2})(j||(j={}));var Ie;(function(e){function n(r,t,o){let s={diagnostics:r};return t!=null&&(s.only=t),o!=null&&(s.triggerKind=o),s}e.create=n;function i(r){let t=r;return a.defined(t)&&a.typedArray(t.diagnostics,y.is)&&(t.only===void 0||a.typedArray(t.only,a.string))&&(t.triggerKind===void 0||t.triggerKind===j.Invoked||t.triggerKind===j.Automatic)}e.is=i})(Ie||(Ie={}));var Ee;(function(e){function n(r,t,o){let s={title:r},u=!0;return typeof t=="string"?(u=!1,s.kind=t):I.is(t)?s.command=t:s.edit=t,u&&o!==void 0&&(s.kind=o),s}e.create=n;function i(r){let t=r;return t&&a.string(t.title)&&(t.diagnostics===void 0||a.typedArray(t.diagnostics,y.is))&&(t.kind===void 0||a.string(t.kind))&&(t.edit!==void 0||t.command!==void 0)&&(t.command===void 0||I.is(t.command))&&(t.isPreferred===void 0||a.boolean(t.isPreferred))&&(t.edit===void 0||z.is(t.edit))}e.is=i})(Ee||(Ee={}));var Le;(function(e){function n(r,t){let o={range:r};return a.defined(t)&&(o.data=t),o}e.create=n;function i(r){let t=r;return a.defined(t)&&h.is(t.range)&&(a.undefined(t.command)||I.is(t.command))}e.is=i})(Le||(Le={}));var Ae;(function(e){function n(r,t){return{tabSize:r,insertSpaces:t}}e.create=n;function i(r){let t=r;return a.defined(t)&&a.uinteger(t.tabSize)&&a.boolean(t.insertSpaces)}e.is=i})(Ae||(Ae={}));var Re;(function(e){function n(r,t,o){return{range:r,target:t,data:o}}e.create=n;function i(r){let t=r;return a.defined(t)&&h.is(t.range)&&(a.undefined(t.target)||a.string(t.target))}e.is=i})(Re||(Re={}));var Pe;(function(e){function n(r,t){return{range:r,parent:t}}e.create=n;function i(r){let t=r;return a.objectLiteral(t)&&h.is(t.range)&&(t.parent===void 0||e.is(t.parent))}e.is=i})(Pe||(Pe={}));var De;(function(e){e.namespace="namespace",e.type="type",e.class="class",e.enum="enum",e.interface="interface",e.struct="struct",e.typeParameter="typeParameter",e.parameter="parameter",e.variable="variable",e.property="property",e.enumMember="enumMember",e.event="event",e.function="function",e.method="method",e.macro="macro",e.keyword="keyword",e.modifier="modifier",e.comment="comment",e.string="string",e.number="number",e.regexp="regexp",e.operator="operator",e.decorator="decorator"})(De||(De={}));var Me;(function(e){e.declaration="declaration",e.definition="definition",e.readonly="readonly",e.static="static",e.deprecated="deprecated",e.abstract="abstract",e.async="async",e.modification="modification",e.documentation="documentation",e.defaultLibrary="defaultLibrary"})(Me||(Me={}));var Ce;(function(e){function n(i){const r=i;return a.objectLiteral(r)&&(r.resultId===void 0||typeof r.resultId=="string")&&Array.isArray(r.data)&&(r.data.length===0||typeof r.data[0]=="number")}e.is=n})(Ce||(Ce={}));var ye;(function(e){function n(r,t){return{range:r,text:t}}e.create=n;function i(r){const t=r;return t!=null&&h.is(t.range)&&a.string(t.text)}e.is=i})(ye||(ye={}));var Fe;(function(e){function n(r,t,o){return{range:r,variableName:t,caseSensitiveLookup:o}}e.create=n;function i(r){const t=r;return t!=null&&h.is(t.range)&&a.boolean(t.caseSensitiveLookup)&&(a.string(t.variableName)||t.variableName===void 0)}e.is=i})(Fe||(Fe={}));var je;(function(e){function n(r,t){return{range:r,expression:t}}e.create=n;function i(r){const t=r;return t!=null&&h.is(t.range)&&(a.string(t.expression)||t.expression===void 0)}e.is=i})(je||(je={}));var Ne;(function(e){function n(r,t){return{frameId:r,stoppedLocation:t}}e.create=n;function i(r){const t=r;return a.defined(t)&&h.is(r.stoppedLocation)}e.is=i})(Ne||(Ne={}));var G;(function(e){e.Type=1,e.Parameter=2;function n(i){return i===1||i===2}e.is=n})(G||(G={}));var J;(function(e){function n(r){return{value:r}}e.create=n;function i(r){const t=r;return a.objectLiteral(t)&&(t.tooltip===void 0||a.string(t.tooltip)||P.is(t.tooltip))&&(t.location===void 0||C.is(t.location))&&(t.command===void 0||I.is(t.command))}e.is=i})(J||(J={}));var Oe;(function(e){function n(r,t,o){const s={position:r,label:t};return o!==void 0&&(s.kind=o),s}e.create=n;function i(r){const t=r;return a.objectLiteral(t)&&w.is(t.position)&&(a.string(t.label)||a.typedArray(t.label,J.is))&&(t.kind===void 0||G.is(t.kind))&&t.textEdits===void 0||a.typedArray(t.textEdits,E.is)&&(t.tooltip===void 0||a.string(t.tooltip)||P.is(t.tooltip))&&(t.paddingLeft===void 0||a.boolean(t.paddingLeft))&&(t.paddingRight===void 0||a.boolean(t.paddingRight))}e.is=i})(Oe||(Oe={}));var Se;(function(e){function n(i){return{kind:"snippet",value:i}}e.createSnippet=n})(Se||(Se={}));var Ue;(function(e){function n(i,r,t,o){return{insertText:i,filterText:r,range:t,command:o}}e.create=n})(Ue||(Ue={}));var Ve;(function(e){function n(i){return{items:i}}e.create=n})(Ve||(Ve={}));var We;(function(e){e.Invoked=0,e.Automatic=1})(We||(We={}));var He;(function(e){function n(i,r){return{range:i,text:r}}e.create=n})(He||(He={}));var Xe;(function(e){function n(i,r){return{triggerKind:i,selectedCompletionInfo:r}}e.create=n})(Xe||(Xe={}));var $e;(function(e){function n(i){const r=i;return a.objectLiteral(r)&&O.is(r.uri)&&a.string(r.name)}e.is=n})($e||($e={}));var ze;(function(e){function n(o,s,u,f){return new ct(o,s,u,f)}e.create=n;function i(o){let s=o;return!!(a.defined(s)&&a.string(s.uri)&&(a.undefined(s.languageId)||a.string(s.languageId))&&a.uinteger(s.lineCount)&&a.func(s.getText)&&a.func(s.positionAt)&&a.func(s.offsetAt))}e.is=i;function r(o,s){let u=o.getText(),f=t(s,(g,_)=>{let b=g.range.start.line-_.range.start.line;return b===0?g.range.start.character-_.range.start.character:b}),c=u.length;for(let g=f.length-1;g>=0;g--){let _=f[g],b=o.offsetAt(_.range.start),l=o.offsetAt(_.range.end);if(l<=c)u=u.substring(0,b)+_.newText+u.substring(l,u.length);else throw new Error("Overlapping edit");c=b}return u}e.applyEdits=r;function t(o,s){if(o.length<=1)return o;const u=o.length/2|0,f=o.slice(0,u),c=o.slice(u);t(f,s),t(c,s);let g=0,_=0,b=0;for(;g0&&e.push(n.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let n=this.getLineOffsets(),i=0,r=n.length;if(r===0)return w.create(0,e);for(;ie?r=o:i=o+1}let t=i-1;return w.create(t,e-n[t])}offsetAt(e){let n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;let i=n[e.line],r=e.line+1"u"}e.undefined=r;function t(l){return l===!0||l===!1}e.boolean=t;function o(l){return n.call(l)==="[object String]"}e.string=o;function s(l){return n.call(l)==="[object Number]"}e.number=s;function u(l,N,Ke){return n.call(l)==="[object Number]"&&N<=l&&l<=Ke}e.numberRange=u;function f(l){return n.call(l)==="[object Number]"&&-2147483648<=l&&l<=2147483647}e.integer=f;function c(l){return n.call(l)==="[object Number]"&&0<=l&&l<=2147483647}e.uinteger=c;function g(l){return n.call(l)==="[object Function]"}e.func=g;function _(l){return l!==null&&typeof l=="object"}e.objectLiteral=_;function b(l,N){return Array.isArray(l)&&l.every(N)}e.typedArray=b})(a||(a={}));var dt=class{constructor(e,n,i){this._languageId=e,this._worker=n,this._disposables=[],this._listener=Object.create(null);const r=o=>{let s=o.getLanguageId();if(s!==this._languageId)return;let u;this._listener[o.uri.toString()]=o.onDidChangeContent(()=>{window.clearTimeout(u),u=window.setTimeout(()=>this._doValidate(o.uri,s),500)}),this._doValidate(o.uri,s)},t=o=>{d.editor.setModelMarkers(o,this._languageId,[]);let s=o.uri.toString(),u=this._listener[s];u&&(u.dispose(),delete this._listener[s])};this._disposables.push(d.editor.onDidCreateModel(r)),this._disposables.push(d.editor.onWillDisposeModel(t)),this._disposables.push(d.editor.onDidChangeModelLanguage(o=>{t(o.model),r(o.model)})),this._disposables.push(i(o=>{d.editor.getModels().forEach(s=>{s.getLanguageId()===this._languageId&&(t(s),r(s))})})),this._disposables.push({dispose:()=>{d.editor.getModels().forEach(t);for(let o in this._listener)this._listener[o].dispose()}}),d.editor.getModels().forEach(r)}dispose(){this._disposables.forEach(e=>e&&e.dispose()),this._disposables.length=0}_doValidate(e,n){this._worker(e).then(i=>i.doValidation(e.toString())).then(i=>{const r=i.map(o=>ft(e,o));let t=d.editor.getModel(e);t&&t.getLanguageId()===n&&d.editor.setModelMarkers(t,n,r)}).then(void 0,i=>{console.error(i)})}};function lt(e){switch(e){case x.Error:return d.MarkerSeverity.Error;case x.Warning:return d.MarkerSeverity.Warning;case x.Information:return d.MarkerSeverity.Info;case x.Hint:return d.MarkerSeverity.Hint;default:return d.MarkerSeverity.Info}}function ft(e,n){let i=typeof n.code=="number"?String(n.code):n.code;return{severity:lt(n.severity),startLineNumber:n.range.start.line+1,startColumn:n.range.start.character+1,endLineNumber:n.range.end.line+1,endColumn:n.range.end.character+1,message:n.message,code:i,source:n.source}}var gt=class{constructor(e,n){this._worker=e,this._triggerCharacters=n}get triggerCharacters(){return this._triggerCharacters}provideCompletionItems(e,n,i,r){const t=e.uri;return this._worker(t).then(o=>o.doComplete(t.toString(),k(n))).then(o=>{if(!o)return;const s=e.getWordUntilPosition(n),u=new d.Range(n.lineNumber,s.startColumn,n.lineNumber,s.endColumn),f=o.items.map(c=>{const g={label:c.label,insertText:c.insertText||c.label,sortText:c.sortText,filterText:c.filterText,documentation:c.documentation,detail:c.detail,command:pt(c.command),range:u,kind:vt(c.kind)};return c.textEdit&&(ht(c.textEdit)?g.range={insert:m(c.textEdit.insert),replace:m(c.textEdit.replace)}:g.range=m(c.textEdit.range),g.insertText=c.textEdit.newText),c.additionalTextEdits&&(g.additionalTextEdits=c.additionalTextEdits.map(D)),c.insertTextFormat===Q.Snippet&&(g.insertTextRules=d.languages.CompletionItemInsertTextRule.InsertAsSnippet),g});return{isIncomplete:o.isIncomplete,suggestions:f}})}};function k(e){if(e)return{character:e.column-1,line:e.lineNumber-1}}function Qe(e){if(e)return{start:{line:e.startLineNumber-1,character:e.startColumn-1},end:{line:e.endLineNumber-1,character:e.endColumn-1}}}function m(e){if(e)return new d.Range(e.start.line+1,e.start.character+1,e.end.line+1,e.end.character+1)}function ht(e){return typeof e.insert<"u"&&typeof e.replace<"u"}function vt(e){const n=d.languages.CompletionItemKind;switch(e){case v.Text:return n.Text;case v.Method:return n.Method;case v.Function:return n.Function;case v.Constructor:return n.Constructor;case v.Field:return n.Field;case v.Variable:return n.Variable;case v.Class:return n.Class;case v.Interface:return n.Interface;case v.Module:return n.Module;case v.Property:return n.Property;case v.Unit:return n.Unit;case v.Value:return n.Value;case v.Enum:return n.Enum;case v.Keyword:return n.Keyword;case v.Snippet:return n.Snippet;case v.Color:return n.Color;case v.File:return n.File;case v.Reference:return n.Reference}return n.Property}function D(e){if(e)return{range:m(e.range),text:e.newText}}function pt(e){return e&&e.command==="editor.action.triggerSuggest"?{id:e.command,title:e.title,arguments:e.arguments}:void 0}var mt=class{constructor(e){this._worker=e}provideHover(e,n,i){let r=e.uri;return this._worker(r).then(t=>t.doHover(r.toString(),k(n))).then(t=>{if(t)return{range:m(t.range),contents:bt(t.contents)}})}};function _t(e){return e&&typeof e=="object"&&typeof e.kind=="string"}function Be(e){return typeof e=="string"?{value:e}:_t(e)?e.kind==="plaintext"?{value:e.value.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}:{value:e.value}:{value:"```"+e.language+` +`+e.value+"\n```\n"}}function bt(e){if(e)return Array.isArray(e)?e.map(Be):[Be(e)]}var wt=class{constructor(e){this._worker=e}provideDocumentHighlights(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.findDocumentHighlights(r.toString(),k(n))).then(t=>{if(t)return t.map(o=>({range:m(o.range),kind:kt(o.kind)}))})}};function kt(e){switch(e){case R.Read:return d.languages.DocumentHighlightKind.Read;case R.Write:return d.languages.DocumentHighlightKind.Write;case R.Text:return d.languages.DocumentHighlightKind.Text}return d.languages.DocumentHighlightKind.Text}var xt=class{constructor(e){this._worker=e}provideDefinition(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.findDefinition(r.toString(),k(n))).then(t=>{if(t)return[Ge(t)]})}};function Ge(e){return{uri:d.Uri.parse(e.uri),range:m(e.range)}}var It=class{constructor(e){this._worker=e}provideReferences(e,n,i,r){const t=e.uri;return this._worker(t).then(o=>o.findReferences(t.toString(),k(n))).then(o=>{if(o)return o.map(Ge)})}},Et=class{constructor(e){this._worker=e}provideRenameEdits(e,n,i,r){const t=e.uri;return this._worker(t).then(o=>o.doRename(t.toString(),k(n),i)).then(o=>Lt(o))}};function Lt(e){if(!e||!e.changes)return;let n=[];for(let i in e.changes){const r=d.Uri.parse(i);for(let t of e.changes[i])n.push({resource:r,versionId:void 0,textEdit:{range:m(t.range),text:t.newText}})}return{edits:n}}var At=class{constructor(e){this._worker=e}provideDocumentSymbols(e,n){const i=e.uri;return this._worker(i).then(r=>r.findDocumentSymbols(i.toString())).then(r=>{if(r)return r.map(t=>Rt(t)?Je(t):{name:t.name,detail:"",containerName:t.containerName,kind:Te(t.kind),range:m(t.location.range),selectionRange:m(t.location.range),tags:[]})})}};function Rt(e){return"children"in e}function Je(e){return{name:e.name,detail:e.detail??"",kind:Te(e.kind),range:m(e.range),selectionRange:m(e.selectionRange),tags:e.tags??[],children:(e.children??[]).map(n=>Je(n))}}function Te(e){let n=d.languages.SymbolKind;switch(e){case p.File:return n.File;case p.Module:return n.Module;case p.Namespace:return n.Namespace;case p.Package:return n.Package;case p.Class:return n.Class;case p.Method:return n.Method;case p.Property:return n.Property;case p.Field:return n.Field;case p.Constructor:return n.Constructor;case p.Enum:return n.Enum;case p.Interface:return n.Interface;case p.Function:return n.Function;case p.Variable:return n.Variable;case p.Constant:return n.Constant;case p.String:return n.String;case p.Number:return n.Number;case p.Boolean:return n.Boolean;case p.Array:return n.Array}return n.Function}var Ot=class{constructor(e){this._worker=e}provideLinks(e,n){const i=e.uri;return this._worker(i).then(r=>r.findDocumentLinks(i.toString())).then(r=>{if(r)return{links:r.map(t=>({range:m(t.range),url:t.target}))}})}},Pt=class{constructor(e){this._worker=e}provideDocumentFormattingEdits(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.format(r.toString(),null,Ye(n)).then(o=>{if(!(!o||o.length===0))return o.map(D)}))}},Dt=class{constructor(e){this._worker=e,this.canFormatMultipleRanges=!1}provideDocumentRangeFormattingEdits(e,n,i,r){const t=e.uri;return this._worker(t).then(o=>o.format(t.toString(),Qe(n),Ye(i)).then(s=>{if(!(!s||s.length===0))return s.map(D)}))}};function Ye(e){return{tabSize:e.tabSize,insertSpaces:e.insertSpaces}}var Mt=class{constructor(e){this._worker=e}provideDocumentColors(e,n){const i=e.uri;return this._worker(i).then(r=>r.findDocumentColors(i.toString())).then(r=>{if(r)return r.map(t=>({color:t.color,range:m(t.range)}))})}provideColorPresentations(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.getColorPresentations(r.toString(),n.color,Qe(n.range))).then(t=>{if(t)return t.map(o=>{let s={label:o.label};return o.textEdit&&(s.textEdit=D(o.textEdit)),o.additionalTextEdits&&(s.additionalTextEdits=o.additionalTextEdits.map(D)),s})})}},Ct=class{constructor(e){this._worker=e}provideFoldingRanges(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.getFoldingRanges(r.toString(),n)).then(t=>{if(t)return t.map(o=>{const s={start:o.startLine+1,end:o.endLine+1};return typeof o.kind<"u"&&(s.kind=yt(o.kind)),s})})}};function yt(e){switch(e){case A.Comment:return d.languages.FoldingRangeKind.Comment;case A.Imports:return d.languages.FoldingRangeKind.Imports;case A.Region:return d.languages.FoldingRangeKind.Region}}var Ft=class{constructor(e){this._worker=e}provideSelectionRanges(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.getSelectionRanges(r.toString(),n.map(k))).then(t=>{if(t)return t.map(o=>{const s=[];for(;o;)s.push({range:m(o.range)}),o=o.parent;return s})})}};function St(e){const n=[],i=[],r=new ut(e);n.push(r);const t=(...s)=>r.getLanguageServiceWorker(...s);function o(){const{languageId:s,modeConfiguration:u}=e;Ze(i),u.completionItems&&i.push(d.languages.registerCompletionItemProvider(s,new gt(t,["/","-",":"]))),u.hovers&&i.push(d.languages.registerHoverProvider(s,new mt(t))),u.documentHighlights&&i.push(d.languages.registerDocumentHighlightProvider(s,new wt(t))),u.definitions&&i.push(d.languages.registerDefinitionProvider(s,new xt(t))),u.references&&i.push(d.languages.registerReferenceProvider(s,new It(t))),u.documentSymbols&&i.push(d.languages.registerDocumentSymbolProvider(s,new At(t))),u.rename&&i.push(d.languages.registerRenameProvider(s,new Et(t))),u.colors&&i.push(d.languages.registerColorProvider(s,new Mt(t))),u.foldingRanges&&i.push(d.languages.registerFoldingRangeProvider(s,new Ct(t))),u.diagnostics&&i.push(new dt(s,t,e.onDidChange)),u.selectionRanges&&i.push(d.languages.registerSelectionRangeProvider(s,new Ft(t))),u.documentFormattingEdits&&i.push(d.languages.registerDocumentFormattingEditProvider(s,new Pt(t))),u.documentRangeFormattingEdits&&i.push(d.languages.registerDocumentRangeFormattingEditProvider(s,new Dt(t)))}return o(),n.push(qe(i)),qe(n)}function qe(e){return{dispose:()=>Ze(e)}}function Ze(e){for(;e.length;)e.pop().dispose()}export{gt as CompletionAdapter,xt as DefinitionAdapter,dt as DiagnosticsAdapter,Mt as DocumentColorAdapter,Pt as DocumentFormattingEditProvider,wt as DocumentHighlightAdapter,Ot as DocumentLinkAdapter,Dt as DocumentRangeFormattingEditProvider,At as DocumentSymbolAdapter,Ct as FoldingRangeAdapter,mt as HoverAdapter,It as ReferenceAdapter,Et as RenameAdapter,Ft as SelectionRangeAdapter,ut as WorkerManager,k as fromPosition,Qe as fromRange,St as setupMode,m as toRange,D as toTextEdit}; diff --git a/fluidd/assets/de-wxpHuzeZ.js b/fluidd/assets/de-wxpHuzeZ.js new file mode 100644 index 0000000..d1ef654 --- /dev/null +++ b/fluidd/assets/de-wxpHuzeZ.js @@ -0,0 +1 @@ +var e={app:{bedmesh:{label:{active:"aktiv",box_scale:"Skalierung",flat_surface:"Ebene anzeigen",mesh_matrix:"Mesh-Matrix",probed_matrix:"Testpunktmatrix",profile_name:"Profilname",remove_profile:"Profil %{name} löschen",scale:"Farbskala",wireframe:"Drahtmodell",base:"Basis"},msg:{hint:"Wird das Profil mit einem anderen Namen als %{name} gespeichert, kann ausgewählt werden das Profil %{name} zu löschen",not_found:"Keine Bett-Meshes gefunden.",not_loaded:"Kein Mesh geladen"},tooltip:{calibrate:"Neue Kalibrierung beginnen und Profil als 'default' speichern",delete:"Profil löschen",load:"Profil laden",save:"Fügt das Mesh Profil der printer.cfg hinzu",copy_image:"Bett-Mesh-Abbildung kopieren"}},chart:{label:{current:"Aktuell",item:"Element",power:"Leistung",target:"Ziel",rate_of_change:"Änderung"},tooltip:{help:"Halten Sie Umschalt gedrückt, um zu zoomen.
Klicken Sie auf ein Element, um es im Diagramm ein-/auszublenden.
Klicken Sie auf eine Leistung, um sie im Diagramm ein-/auszublenden."}},console:{label:{auto_scroll:"Automatisches Scrollen",flip_layout:"Layout umkehren",hide_temp_waits:"Temperaturbenachrichtigungen ausblenden"},placeholder:{command:"Tab für Autovervollständigung, 'help' für Befehle, Pfeiltasten für Verlauf"},tooltip:{help:'Geben Sie "help" für eine Befehlsliste ein
Benutzen Sie Tab für Autovervollständigung
Benutzen Sie und für den Verlauf'}},endpoint:{error:{cant_connect:"Etwas ist schiefgelaufen und Fluidd kann die Adresse nicht erreichen. Sind Sie sicher, dass dies die richtige Adresse ist?",cors_error:"durch CORS-Richtlinie blockiert",cors_note:'Dies kann bedeuten, dass Sie Ihre Moonraker-Konfiguration ändern müssen. Bitte lesen Sie dazu die Dokumentation zur Einrichtung mehrerer Drucker hier'},hint:{add_printer:"z.B. http://fluiddpi.local"},msg:{trouble:'Haben Sie Schwierigkeiten? Siehe hier für weitere Informationen.'},tooltip:{endpoint_examples:"Geben Sie Ihre API-URL ein.
Zum Beispiel:
http://fluidd.local, http://192.168.1.150
"}},endstop:{label:{open:"Offen",triggered:"Ausgelöst"},msg:{subtitle:'Verwenden Sie die Schaltfläche "Aktualisieren", um den Endschalter-Status zu aktualisieren.'}},file_system:{filters:{label:{print_start_time:"Nur ungedruckte",klipper_backup_files:"Klipper-Backupdateien ausblenden",rolled_log_files:"Alte Logdateien ausblenden",hidden_files_folders:"Versteckte Dateien und Ordner ausblenden",moonraker_backup_files:"Moonraker Backup-Dateien ausblenden",crowsnest_backup_files:"Crowsnest-Backupdateien ausblenden"}},label:{dir_name:"Ordnername",disk_usage:"Belegter Speicher",diskinfo:"Speicherinformationen",downloaded:"Heruntergeladen",file_name:"Dateiname",transfer_rate:"Transferrate",uploaded:"Hochgeladen",view_section_documentation:"Dokumentation für '%{section}' anzeigen",hour:"Stunde",minute:"Minute",second:"Sekunde"},msg:{not_found:"Keine Dateien gefunden",processing:"Verarbeiten"},overlay:{drag_files_folders_upload:"Ziehen Sie Dateien und Ordner zum Hochladen hierher",drag_files_enqueue:"Ziehen Sie Dateien hierher, um sie in die Warteschlange zu stellen"},title:{add_dir:"Ordner hinzufügen",add_file:"Datei hinzufügen",command_palette:"Befehlspalette",download_file:"Empfange Datei",rename_dir:"Ordner umbennen",rename_file:"Datei umbennen",upload_file:"Datei hochladen | Dateien hochladen",duplicate_dir:"Doppelter Ordner",duplicate_file:"Doppelte Datei",go_to_file:"Zur Datei gehen",devices:"Geräte",check_filament:"Fadenprüfung"},tooltip:{low_on_space:"Wenig Speicherplatz auf der Festplatte",root_disabled:"{root} ist nicht verfügbar. Bitte überprüfen Sie Ihre Logdateien.",items_count:"{count} Element | {count} Elemente",warning_text:"Bitte fügen Sie die Arten von Materialien im Materialbehälter hinzu oder reduzieren Sie die Arten von Materialien, die das Modell verwendet.",tip:"Wählen Sie die zu verwendenden Materialien aus. Oben sind die vom Modell verwendeten Materialien und unten die entsprechenden Materialien im Materialbehälter."},url:{klipper_config:"%{klipperDomain}/Config_Reference.html#%{hash}",moonraker_config:"https://moonraker.readthedocs.io/en/latest/configuration/#%{hash}",moonraker_telegram_bot_config:"https://github.com/nlef/moonraker-telegram-bot/wiki/Sample-config#%{hash}",crowsnest_config:"https://crowsnest.mainsail.xyz/configuration/%{hash}-section"}},gcode:{btn:{load_current_file:"Aktuelle Datei laden"},label:{current_layer_height:"Aktuelle Schichthöhe",exclude_object:"Objekt ausschließen",follow_progress:"Fortschritt folgen",layer:"Schicht",layers:"Schichten",parsed:"Verarbeitet",show_extrusions:"Extrusionen zeigen",show_moves:"Bewegungen zeigen",show_next_layer:"Nächste Schicht zeigen",show_previous_layer:"Vorherige Schicht zeigen",show_retractions:"Retracten zeigen",parsing_file:"Verarbeite Datei",show_current_layer:"Aktuelle Schicht anzeigen",show_parts:"Teile anzeigen"},msg:{confirm:'Die Datei "%{filename}" ist %{size} groß, dies kann sehr Ressourcenintensiv für Ihr System sein. Sind Sie sicher?'},overlay:{drag_file_load:"Ziehe eine Gcode-Datei hierher, um sie zu laden"}},general:{btn:{add:"Hinzufügen",add_dir:"Ordner hinzufügen",add_file:"Datei hinzufügen",add_printer:"Drucker hinzufügen",adjust_layout:"Dashboard-Layout anpassen",all:"Alle",calibrate:"Kalibrieren",cancel:"Abbrechen",clear_profile:"Profil zurücksetzen",close:"Schließen",config_reference:"Config Referenz",delete:"Löschen",download:"Herunterladen",edit:"Bearbeiten",exit_layout:"Layout-Modus verlassen",extrude:"Extrudieren",heaters_off:"Heizelemente aus",load_all:"Alle laden",more_information:"Mehr Informationen",pause:"Pause",preheat:"Vorheizen",presets:"Voreinstellungen",preview_gcode:"Gcode-Vorschau",print:"Drucken",quad_gantry_level:"QGL",reboot:"Neustarten",recover:"Retten",refresh:"Aktualisieren",remove:"Entfernen",remove_all:"Alle Entfernen",rename:"Umbenennen",reprint:"Druck wiederholen",reset_file:"Datei zurücksetzen",reset_layout:"Auf Standardlayout zurücksetzen",reset_default_layout:"Standardlayout zurücksetzen",restart_firmware:"Firmware Neustarten",restart_service:"%{service} neustarten",restart_service_klipper:"Klipper neustarten",restart_service_moonraker:"Moonraker neustarten",resume:"Fortfahren",retract:"Retracten",return_dashboard:"Zurück zum Dashboard",save:"Speichern",save_as:"Speichern als",save_restart:"Speichern & Neu starten",send:"Senden",set_color:"Farbe setzen",set_default_layout:"Als Standardlayout setzen",shutdown:"Herunterfahren",socket_reconnect:"Neu verbinden",socket_refresh:"Aktualisieren erzwingen",upload:"Hochladen",upload_print:"Hochladen & Drucken",view:"Ansicht",reset_stats:"Statistik zurücksetzen",snooze:"Schlummern",abort:"Abbrechen",accept:"Akzeptieren",adjusted:"Angepasst",auth_unsure:"Sie wissen nicht, warum dies angezeigt wird?",forgot_password:"Passwort vergessen?",login:"Einloggen",logout:"Ausloggen",save_config_and_restart:"Konfiguration speichern und neu starten",add_to_queue:"Zur Warteschlange hinzufügen",filter:"Filtern",go_to_file:"Zur Datei gehen",job_queue:"Job-Warteschlange",refresh_metadata:"Metadaten aktualisieren",reload:"Aktualisieren",thumbnail_size:"Vorschaugröße",upload_files:"Dateien hochladen",upload_folder:"Ordner hochladen",create_zip_archive:"ZIP-Archiv erstellen",duplicate:"Duplizieren",select_columns:"Spalten auswählen",retry:"Wiederholen",multiply:"Vermehren",copied:"Kopiert",copy:"Kopieren"},error:{app_setup_link:'Die Anforderungen für die Einrichtung von Fluidd finden Sie hier.',app_warnings_found:"%{appName}-Warnungen gefunden.",components_config:'Die Konfiguration des Moonraker-Plugins finden Sie hier.',failed_components:"Moonraker hat fehlerhafte Plugins, bitte überprüfen Sie Ihre Logs, aktualisieren Sie Ihre Konfiguration und starten Sie Moonraker neu."},label:{accel_to_decel:"Beschleunigen zu Bremsen",acceleration:"Beschleunigung",actual_time:"Wirklich",add_camera:"Kamera hinzufügen",add_filter:"Filter hinzufügen",add_preset:"Voreinstellingen hinzufügen",add_user:"Benutzer hinzufügen",alias:"Alias",api_key:"API-Schlüssel",api_url:"API-URL",apply_z_offset:"Z-Offset übernehmen und speichern",category:"Kategorie",change_password:"Passwort ändern",clear_all:"Alle schließen",color:"Farbe",confirm:"Bestätigen",current_password:"Aktuelles Passwort",disabled_while_printing:"Während Druck deaktiviert",edit_camera:"Kamera bearbeiten",edit_filter:"Filter bearbeiten",edit_preset:"Voreinstellungen bearbeiten",edit_user:"Benutzer bearbeiten",extrude_length:"Extrusionslänge",extrude_speed:"Extrusionsgeschwindigkeit",filament:"Filament",file:"Datei",finish_time:"Fertig um",flow:"Fluss",free:"frei",heaters_busy:"Der Drucker ist momentan beschäftigt. Das Ausschalten der Heizelemente könnte zu einem fehlgeschlagenen Druck führen.",high:"Höchste",host:"Host",layer:"Schicht",layout:"Layout",longest_job:"Längster Auftrag",low:"Niedrigste",manage_accounts:"Benutzer verwalten",m117:"M117",name:"Name",new_password:"Neues Passwort",no_notifications:"Keine Benachrichtigungen",off:"Aus",on:"An",password:"Passwort",power:"Leistung",printers:"Drucker",progress:"Fortschritt",requested_speed:"Geschw.",retract_length:"Retract-Länge",retract_speed:"Retract-Geschwindigkeit",save_as:"Speichern als",services:"Dienste",slicer:"Slicer",speed:"Geschwindigkeit",sqv:"Geschwindigkeit bei rechtwinkligen Ecken",total:"Gesamt",total_filament:"Insgesamt verbrauchtes Filament",total_filament_avg:"Durchschnitt pro Druck",total_jobs:"Druckaufträge insgesamt",total_print_time:"Druckzeit insgesamt",total_print_time_avg:"Durchschnitt pro Druck",total_time:"Gesamtzeit",total_time_avg:"Durchschnitt pro Druck",turn_device_on:"%{device} einschalten",turn_device_off:"%{device} ausschalten",uncategorized:"Unkategorisiert",unretract_extra_length:"Unretract-Extralänge",unretract_speed:"Unretract-Geschwindigkeit",unsaved_changes:"Ungespeicherte Änderungen",used:"gebraucht",velocity:"Geschwindigkeit",visible:"Sichtbar",z_offset:"Z-Offset",add_category:"Kategorie hinzufügen",edit_category:"Kategorie bearbeiten",file_time:"Datei",pressure_advance:"Pressure Advance",smooth_time:"Glättungszeit",current_user:"Aktueller Benutzer",moonraker:"Moonraker",username:"Benutzername",ldap:"LDAP",accepted_screws:"Akzeptierte Schrauben",auth_source:"Authentifizierungsquelle",partial_of_total:"%{partial} von %{total}",screw_index:"Schraubenindex",screw_name:"Schraubenname",screw_number:"Schraube %{index}",user_managed_source:"Benutzer durch %{source}-Authentifizierung verwaltet",numeric_prefix_sort:"Sortierung nach numerischem Präfix",pause_at_layer:"Pausieren bei Schicht",stepper_enabled:"Motor aktiv",command:"Befehl",default:"Standard",pause_at_next_layer:"Pausieren bei nächster Schicht",thumbnail_size:"Vorschaugröße",upload_and_print:"Hochladen und drucken",version_sort:"Versions-Sortierung",all:"Alle",pause_at_layer_number:"Pausieren bei Schicht-Nummer",synced_extruder:"Synchronisierte Extruder",cross:"Kreuz",bars:"Balken",range:"Distanz",circle:"Kreis",minimum_cruise_ratio:"Minimales Konstantfahrtverhältnis",compact:"Kompakt",unknown:"Unbekannt",stepper_driver:"%{name} Treiber"},msg:{password_changed:"Passwort geändert",wrong_password:"Ups, etwas ist schiefgelaufen. Ist Ihr Passwort korrekt?",bed_screws_adjust:"Klicken Sie auf Angepasst, wenn eine signifikante Anpassung an der aktuellen Schraube erforderlich ist. Klicken Sie andernfalls auf Akzeptieren, um fortzufahren.",welcome_back:"Willkommen zurück.
Melden Sie sich unten an, um mit Ihrem Drucker in Kontakt zu bleiben.",needs_refresh:"Neue Inhalte verfügbar, bitte klicken Sie den Aktualisieren-Button um zu aktualisieren.",offline_ready:"Fluidd ist jetzt bereit, offline zu arbeiten.",pending_configuration_sections_deleted:"Die folgenden Sektionen sind zur Löschung markiert",rolledover_logs:"Die folgenden Applikations-Protokolle wurden erneuert: %{applications}",fluidd_settings_backup_failed:"Konnte kein Backup der Fluidd-Einstellungen erstellen!",not_valid_fluidd_backup_file:"Keine gültige Fluidd-Backupdatei!",fluidd_settings_restore_failed:"Konnte das Backup der Fluidd-Einstellungen nicht wiederherstellen!"},simple_form:{error:{arrayofnums:"Nur Zahlen",exists:"Existiert bereits",invalid_expression:"Ungültiger Ausdruck",invalid_url:"Ungültige URL",max:"Max %{max}",min:"Min %{min}",min_or_0:"Min %{min} oder 0",password_username:"Kann nicht dem Nutzernamen entsprechen",required:"Erforderlich",invalid_aspect:"Ungültiges Verhältnis",invalid_number:"Ungültige Zahl",credentials:"Ungültige Anmeldeinformationen"},msg:{no_file_preview:"%{name} kann momentan nicht angezeigt werden.",confirm:"Sind Sie sicher?",confirm_delete:"Sind Sie sicher? Hierdurch wird das ausgewählte Element gelöscht. | Sind Sie sicher? Hierdurch werden die {count} ausgewählten Elemente gelöscht.",confirm_exclude_object:"Sind Sie sicher, dass Sie dieses Objekt vom Druck ausschließen wollen?",confirm_power_device_toggle:"Sind Sie sicher? Dies wird das Gerät ein- bzw. ausschalten.",confirm_reboot_host:"Sind Sie sicher? Das Host-System wird neu gestartet.",confirm_service_restart:"Möchten Sie den Dienst %{name} wirklich neu starten?",confirm_service_stop:"Möchten Sie den Dienst %{name} wirklich beenden?",confirm_shutdown_host:"Sind Sie sicher? Das Host-System wird heruntergefahren.",unsaved_changes:"Sie haben ungespeicherte Änderungen. Sind Sie sicher, dass Sie den Editor schließen möchten?",confirm_forcemove_toggle:"Sind Sie sicher? Dies kann Schäden am Drucker verursachen.",confirm_service_start:"Sind Sie sicher, dass Sie den %{name}-Dienst starten wollen?",confirm_cancel_print:"Sind Sie sicher, dass sie den Druck abbrechen wollen?",confirm_clear_mesh:"Der Drucker ist gerade beschäftigt. Sind Sie sicher, dass sie das Bett-Mesh leeren wollen?",confirm_load_bedmesh_profile:"Der Drucker ist gerade beschäftigt. Sind Sie sicher, dass Sie das Profil %{name} laden wollen?",confirm_emergency_stop:"Sind Sie sicher, dass sie den Drucker notausschalten wollen?",confirm_remove_user:"Sind Sie sicher, dass Sie den Benutzer %{username} entfernen wollen?"}},table:{header:{actions:"Aktionen",end_time:"Beendet",estimated_time:"Geschätzte Zeit",filament:"Filament",filament_used:"Filament verbraucht",filament_weight_total:"Filamentgewicht",first_layer_bed_temp:"Erste Schicht Bett-Temperatur",first_layer_extr_temp:"Erste Schicht Extruder-Temperatur",first_layer_height:"Erste Schichtöhe",height:"Höhe",last_printed:"Zuletzt gedruckt",layer_height:"Schichthöhe",modified:"Geändert",name:"Name",print_duration:"Druckdauer",size:"Größe",slicer:"Slicer",slicer_version:"Slicer-Version",start_time:"Gestartet",status:"Status",total_duration:"Gesamtdauer",chamber_temp:"Kammertemperatur",time_in_queue:"Zeit in Warteschlange",filament_name:"Filament-Name",filament_type:"Filament-Typ",nozzle_diameter:"Düsendurchmesser",time_added:"Hinzugefügt"}},title:{add_printer:"Drucker hinzufügen",bedmesh:"Bettnivellierung",bedmesh_controls:"Bettnivellierungs-Einstellungen",camera:"Kamera | Kameras",config_files:"Konfigurationsdateien",configure:"Konfiguration",console:"Konsole",diagnostics:"Diagnostik",endstops:"Endschalter",fans_outputs:"Lüfter & Ausgänge",gcode_preview:"Gcode-Vorschau",history:"Auftragsverlauf",home:"Dashboard",jobs:"Aufträge",limits:"Drucker-Limits",macros:"Makros",other_files:"Andere Dateien",retract:"Firmware-Retraction",runout_sensors:"Runout-Sensoren",settings:"Einstellungen",stats:"Statistik",system:"System",system_overview:"Systeminformationen",temperature:"Temperaturen",timelapse:"Zeitraffer",tool:"Druckkopf",tune:"Tune",pending_configuration_changes:"Ausstehende Konfigurationsänderungen",metrics_explorer:"Metrik-Explorer",not_found:"404 Nicht Gefunden",edit_chart:"Diagramm bearbeiten",add_chart:"Diagramm hinzufügen",job_queue:"Job-Warteschlange",rollover_logs:"Protokolle erneuern"},tooltip:{browse_metrics:"Verfügbare Metriken durchsuchen",estop:"NOT-AUS",managed_by_moonraker:"Verwaltet durch Ihre moonraker-Konfiguration",notifications:"Benachrichtigungen",reload_klipper:"Lädt die Klipper-Konfiguration neu.",reload_restart_klipper:"Lädt die Klipper-Konfiguration neu und startet die MCUs neu.",restart_klipper:"Starten den Klipper-Systemdienst neu.",run_collector:"Kollektor ausführen",rollover_logs:"Protokolle erneuern",file_browser_help:'Ziehen Sie Dateien und Ordner von außerhalb des Browsers hierhin, um sie hochzuladen
Verschieben Sie Dateien und Ordner, indem Sie sie in Unterordner oder ".." ziehen',file_browser_configuration_help:"Kopieren Sie Dateien und Ordner in die Konfigurationsdateien, indem Sie diese von hier nach dort ziehen"}},history:{msg:{confirm_jobs:"Sind Sie sicher? Dadurch werden alle Aufträge gelöscht.",confirm_stats:"Sind Sie sicher? Dadurch wird die Statistik gelöscht.",confirm:"Sind Sie sicher? Hierdurch werden alle Historien und Druckerstatistiken geleert"}},printer:{state:{busy:"Beschäftigt",cancelled:"Abgebrochen",complete:"Fertig",idle:"Untätig",loading:"Laden",paused:"Pausiert",printing:"Druckt",ready:"Bereit",standby:"Standby"},title:{printer_status:"Druckerstatus",stepper_driver_overheating:"Schrittmotor-Treiber '%{name}' überhitzt"},msg:{possible_print_failure:"Dies kann zu einem fehlgeschlagenen Druck führen"},url:{stepper_driver_overheating:"%{klipperDomain}/TMC_Drivers.html#tmc-reports-error-ot1overtemperror"}},setting:{btn:{add_camera:"Kamera hinzufügen",add_category:"Kategorie hinzufügen",add_filter:"Filter hinzufügen",add_thermal_preset:"Voreinstellungen hinzufügen",add_user:"Benutzer hinzufügen",reset:"Zurücksetzen",select_theme:"Farbschema auswählen",add_metric:"Metrik hinzufügen",backup:"Backup",restore:"Wiederherstellen"},camera_type_options:{iframe:"HTTP-Seite",mjpegadaptive:"Adaptives MJPEG",mjpegstream:"MJPEG Stream",video:"IP Camera",webrtc_camera_streamer:"WebRTC (camera-streamer)",hlsstream:"HLS-Stream",webrtc_go2rtc:"WebRTC (go2rtc)",webrtc_mediamtx:"WebRTC (MediaMTX)"},camera_rotate_options:{90:"90°",180:"180°",270:"270°",none:"Keine Drehung"},label:{all_off:"Alle aus",all_on:"Alle an",aspect_ratio:"Seitenverhältnis",aspect_ratio_format:"[Breite : Höhe]",auto_edit_extensions:"Erweiterungen, die automatisch im Bearbeitungsmodus geöffnet werden",auto_follow_on_file_load:"Fortschritt beim Laden einer Datei automatisch folgen",auto_load_on_print_start:"Datei bei Druckstart automatisch laden",auto_load_mobile_on_print_start:"Datei bei Druckstart auch auf mobilen Geräten laden",camera_flip_x:"Horizontal spiegeln",camera_flip_y:"Vertikal spiegeln",camera_rotate_by:"Rotieren um",camera_stream_type:"Art des Kamerastreams",confirm_dirty_editor_close:"Schließen des Editors mit ungespeicherten Änderungen bestätigen",confirm_on_estop:"Bestätigung bei Notaus anfordern",confirm_on_power_device_change:"Bestätigung bei Änderung eines Gerätestatus anfordern",contains:"Enthält",dark_mode:"Nachtmodus",force_move_toggle_warning:"Bestätigung bei Aktivierung von FORCE_MOVE anfordern",show_manual_probe_dialog_automatically:"Dialog für manuelles Probing automatisch anzeigen",default_extrude_length:"Standard Extrudierlänge",default_extrude_speed:"Standard Extrudiergeschwindigkeit",default_toolhead_move_length:"Standard Bewegungsdistanz des Druckkopfes",default_toolhead_xy_speed:"Standard Druckkopfgeschwindigkeit für XY",default_toolhead_z_speed:"Standard Druckkopfgeschwindigkeit für Z",draw_background:"Hintergrund anzeigen",enable:"Aktivieren",enable_diagnostics:"Diagnostik-Aufzeichnung aktivieren",enable_notifications:"Aktiviere Benachrichtigung",expression:"Ausdruck",extrusion_line_width:"Extrusionslinien-Dicke",filter:"Filter",flip_horizontal:"Horizontal spiegeln",flip_vertical:"Vertikal spiegeln",fps_target:"FPS Ziel",fps_idle_target:"FPS Ziel im Ruhezustand",gcode_coords:"GCode-Koordinaten verwenden",height:"Höhe",hide_single_part_bounding_box:"Bauteilrahmen bei Druck eines einzelnen Teils verstecken",invert_x_control:"X-Steuerung invertieren",invert_y_control:"Y-Steuerung invertieren",invert_z_control:"Z-Steuerung invertieren",language:"Anzeigesprache",move_line_width:"Bewegungslinien-Dicke",none:"Keines | Keine",power_toggle_in_top_nav:"Power-Schalter in Kopfleiste",primary_color:"Primärfarbe",printer_name:"Druckername",reset:"Einstellungen zurücksetzen",retraction_icon_size:"Retraction-Symbolgröße",show_animations:"Animationen anzeigen",show_barometric_pressure:"Luftdruck anzeigen",show_rate_of_change:"Temperatur-Änderungsrate anzeigen",show_relative_humidity:"Relative Luftfeuchtigkeit anzeigen",starts_with:"Beginnt mit",theme_preset:"Community-Voreinstellung",thermal_preset_gcode:"GCode",thermal_preset_name:"Name des Voreinstellungsprofils",toolhead_move_distances:"Bewegungsdistanzen des Druckkopfes",type:"Art",z_adjust_values:"Z-Werte anpassen",show_code_lens:"CodeLens anzeigen",show_save_config_and_restart:"Speichern & Neu starten Schaltfläche in der Navigationsleiste",icon:"Symbol",solid:"Durchgängig",title:"Titel",unit:"Einheit",camera_fullscreen_action:{title:"Vollbildaktion",rawstream:"Direkter Stream",embed:"Eingebettet"},last_result:"Letztes Ergebnis",show_bed_screws_adjust_dialog_automatically:"Dialog zum Anpassen der Bettschrauben automatisch anzeigen",show_legend:"Legende zeigen",max:"Maximum",metrics:"Metriken",min:"Minimum",name:"Name",optional:"Optional",right_y:"Rechte Y-Achse",save_and_restore_view_state:"Ansicht speichern und wiederherstellen",confirm_on_save_config_and_restart:"Vor dem Speichern und Neustart die ausstehenden Konfigurationsänderungen überprüfen",dashed:"Gestrichelt",fill_color:"Füllfarbe",fill_opacity:"Fülldeckkraft",left_y:"Linke Y-Achse",line_color:"Linienfarbe",line_style:"Linienstil",card:"Karte",collector:"Kollektor",dotted:"Gepunktet",axes:"Achsen",camera_url_snapshot:"Kamera-Snapshot-URL",camera_url_stream:"Kamera-Stream-URL",default_min_layer_height:"Standard minimum Schichthöhe",date_format:"Datumsformat",never:"Nie",show_upload_and_print:"Hochladen und Drucken-Button in der Kopfzeile anzeigen",show_gas_resistance:"Gas-Widerstand anzeigen",time_format:"Zeitformat",text_sort_order:"Reihenfolge der Textsortierung",to_browser_local_storage:"zum Browser-Lokalspeicher",to_browser_session_storage:"zum Browser-Sitzungsspeicher",toolhead_control_style:"Druckkopf-Steuerstil",toolhead_xy_move_distances:"Druckkopf-Bewegungsdistanzen für XY",toolhead_z_move_distances:"Druckkopf-Bewegungsdistanzen für Z",show_chart:"Diagramm anzeigen",sections_to_ignore_pending_configuration_changes:"Zu ignorierende Sektionen mit ausstehenden Konfigurationsänderungen",show_screws_tilt_adjust_dialog_automatically:"Dialog zum Anpassen der Bettneigung automatisch anzeigen",draw_origin:"Ursprung anzeigen",enable_xy_homing:"XY-Homing aktivieren",show_logo_on_background:"Logo auf dem Hintergrund anzeigen",print_in_progress_layout:"Druckfortschritt-Layout",print_eta_calculation:"Druckendzeit-Berechnung",print_progress_calculation:"Druckfortschritt-Berechnung",keyboard_shortcuts:"Tastenkürzel",fluidd_settings_in_moonraker_db:"Fluidd-Einstellungen in Moonraker-Datenbank"},timer_options:{duration:"Nur Dauer",filament:"Filament",file:"Datei",slicer:"Slicer",slicer_m73:"Slicer (M73)",absolute_file_position:"Absolute Dateiposition",relative_file_position:"Relative Dateiposition"},title:{authentication:"Authentifizierung",camera:"Kamera | Kameras",console:"Konsole",gcode_preview:"Gcode-Vorschau",general:"Allgemein",file_editor:"Datei-Editor",macros:"Makros",theme:"Farbschema",thermal_presets:"Temperatur-Voreinstellungen",tool:"Druckkopf",file_browser:"Dateibrowser"},tooltip:{gcode_coords:"GCode-Position anstelle der Toolhead-Position auf dem Dashboard anzeigen",show_manual_probe_dialog_automatically:"Öffnet automatisch einen Hilfsdialog, wenn ein manuelles Probe-Tool ausgeführt wird",show_bed_screws_adjust_dialog_automatically:"Öffnet automatisch einen Hilfsdialog, wenn das BED_SCREWS_ADJUST-Werkzeug ausgeführt wird",diagnostics_performance:"[BETA] Das Protokollieren von Diagnoseinformationen kann die Leistung beeinträchtigen",show_screws_tilt_adjust_dialog_automatically:"Öffnet automatisch einen Hilfsdialog, wenn das SCREWS_TILT_CALCULATE-Werkzeug ausgeführt wird",theme_disclaimer:"Diese Farbschemata enthalten Markennamen und Logos, die geistiges Eigentum ihrer jeweiligen Eigentümer sind.
Die Nutzung dieser Namen und Logos erfolgt mit Genehmigung dieser Marken.
Bitte beachten SIe jedoch, dass die Farbschemata nicht offiziell von diesen Marken gepflegt werden.
Alle Probleme oder Anfragen bezüglich dieser Schemata sollten an das Fluidd-Team gerichtet werden.
Die Verwendung der Markennamen und Logos dient ausschließlich zu dekorativen und ästhetischen Zwecken und stellt keine offizielle Verbindung zu den Firmen oder eine Billigung dieser dar.",average_calculation:"Wenn mehr als eine Option gewählt ist, wird ein Durchschnittswert berechnet",keyboard_shortcuts:"[BETA] Aktivieren Sie Kürzel und drücken Sie '?', um eine Liste aller Kürzel anzuzeigen"}},socket:{msg:{connecting:"Verbinde mit Moonraker...",no_connection:"Keine Moonraker-Verbindung. Bitte überprüfen Sie den Moonraker-Status und / oder aktualisieren Sie Moonraker."}},system_info:{label:{capacity:"Gesamtgröße",cpu_desc:"CPU-Beschreibung",distribution_codename:"Codename",distribution_like:"Distribution basiert auf",distribution_name:"Distribution",frequency:"Frequenz",hardware_desc:"Hardwarebeschreibung",hostname:"Hostname",klipper_load:"Klipper-Last",manufactured:"Hergestellt",manufacturer:"Hersteller",mcu_awake:"{mcu} Zeit im Wachzustand",mcu_bandwidth:"{mcu}-Bandbreite",mcu_information:"{mcu}-Informationen",mcu_load:"{mcu}-Last",micro_controller:"Mikrocontroller",model:"CPU-Modell",moonraker_load:"Moonraker-Last",processor_desc:"Prozessor",product_name:"Produktname",serial_number:"Seriennummer",system_load:"Systemlast",system_memory:"Systemspeicher",system_utilization:"Auslastung",total_memory:"Gesamtspeicherplatz",operating_system:"Betriebssystem",version:"Version",network:"Netzwerk",virtualization:"Virtualisierung",load:"Last",awake_time:"Wachzeit",memory_used:"Genutzter Speicher",constants:"Konstanten",last_stats:"Letzte Statistiken",devices:"Geräte"},msg:{no_devices_found:"Keine Geräte gefunden",no_devices_searched:"Nutzen Sie den Aktualisieren-Knopf, um nach Geräten zu suchen",canbus_warning:'Nur unzugewiesene CAN-Bus-Knoten werden erkannt.
Es ist empfohlen, nur ein unzugewiesenes Gerät an den CAN-Bus anzuschließen, um Kommunikationsprobleme zu vermeiden.
Mehr Informationen finden Sie hier.'}},tool:{btn:{home_x:"X",home_y:"Y",home_all:"Alle"},tooltip:{absolute_positioning:"Absolute Positionierung",extruder_disabled:"Extruder deaktiviert, da unter der min_extrude_temp (%{min}°C)",home_xy:"Home XY",home_z:"Home Z",manual_probe:"Manuelles Probing",motors_off:"Motoren Aus",relative_positioning:"Relative Positionierung",tools:"Werkzeuge",select_tool:"Werkzeug %{tool} auswählen"},title:{bed_screws_adjust:"Bettschrauben einstellen",manual_probe:"Manuelles Probing",screws_tilt_adjust:"Bettneigung einstellen"},label:{stats_volumetric_flow:'Bei einer Extrusion mit %{extrudeSpeed} mm/s sollte der Druckkopf einen ungefähren volumetrischen Fluss von %{estimatedVolumetricFlow} mm³/s erreichen können',stats_extruded_length:'Bei der Extrusion von %{extrudeLength} mm Filament bei %{extrudeFactor} % Fluss wird eine ungefähre Austrittslänge von %{estimatedExtrudedLength} mm extrudiert',stats_active_extruder:'Die aktive Extruderkonfiguration ist auf ein %{filamentDiameter} mm Durchmesser Filamentund eine %{nozzleDiameter} mm Düse eingestellt',stats_max_speed:'Unter der Annahme einer %{layerHeight} mm Schichthöhe liegt die ungefähre Maximaldruckgeschwindigkeit bei %{estimatedMaxSpeed} mm/s'}},version:{btn:{check_for_updates:"Nach Aktualisierungen suchen",finish:"Beenden",update:"Aktualisieren",update_all:"Alles aktualisieren",view_versions:"Versionen anzeigen"},label:{commit_history:"Commit-Verlauf",commits_on:"Commits am",committed:"Committed",dirty:"VERUNREINIGT",invalid:"UNZULÄSSIG",os_packages:"Betriebssystem-Pakete",package_list:"Paketliste",up_to_date:"AKTUELL",updates_available:"Updates sind verfügbar",old_component_version:"Sie verwenden eine veraltete Version von %{name}, welche nicht alle Features von Fluidd unterstützt.Aktualisieren Sie %{name} auf mindestens %{version}."},status:{finished:"Aktualisierung abgeschlossen",updating:"Aktualisieren..."},title:"Softwareaktualisierungen",tooltip:{commit_history:"Commit-Verlauf",dirty:"Deutet auf einen Fehler in Bezug auf das Git-Repository hin (z.B. detached head, not on master, invalid origin)",invalid:"Deutet auf lokale Änderungen im Git-Repository hin",packages:"Pakete",release_notes:"Veröffentlichungsnotizen"}},timelapse:{btn:{render:"Rendern",save_frames:"Bilder speichern"},error:{newframe:"Fehler beim Aufnehmen eines Zeitraffer-Bildes"},label:{frames:"%{frames} Bild | %{frames} Bilder",length:"Geschätzte Länge: %{length}",frame:"Bild | Bilder"},title:{timelapse_settings:"Zeitraffer-Einstellungen",timelapse_status:"Zeitraffer-Status",render_settings:"Render-Einstellungen"},setting:{enable:"Aktiviert",auto_render:"Automatisches Rendern",crf:"Constant Rate- Faktor",duplicatelastframe:"Letzte Bilder wiederholen",fw_retract:"Firmware-Retraction verwenden",gcode_verbose:"Verboser Gcode",mode:"Modus",mode_layermacro:"Schicht-Makro",mode_hyperlapse:"Hyperlapse",hyperlapse_cycle:"Hyperlapse-Intervall",output_framerate:"Ausgabe-Bildrate",park_retract_distance:"Retraction-Länge beim Parken",park_retract_speed:"Retraction-Geschw. beim Parken",park_extrude_distance:"Extrusionslänge beim Parken",park_extrude_speed:"Extrusionsgeschw. beim Parken",parkhead:"Druckkopf parken",park_time:"Parkdauer",park_travel_speed:"Park-Bewegungsgeschw.",park_custom_pos_x:"Parkposition X",park_custom_pos_y:"Parkposition Y",park_custom_pos_dz:"Parkposition Z-Hop",parkpos:{label:"Parkposition",custom:"Benutzerdefiniert",front_left:"Vorne links",front_right:"Vorne rechts",center:"Mitte",back_left:"Hinten links",back_right:"Hinten rechts",x_only:"Nur X bewegen",y_only:"Nur Y bewegen"},previewimage:"Vorschaubild erzeugen",saveframes:"Einzelbilder speichern",stream_delay_compensation:"Verzögerungs-Kompensation",targetlength:"Ziellänge",variable_fps:"Variable Bildrate",variable_fps_min:"Minimum Bildrate",variable_fps_max:"Maximum Bildrate"}},spoolman:{btn:{manage_spools:"Spulen verwalten",scan_code:"Code scannen",select:"Auswählen | Für {macro} auswählen"},title:{spool_selection:"Spulenauswahl | Spulenauswahl für {macro}",scan_spool:"Spule scannen",spoolman:"Spoolman"},label:{active_spool:"Aktive Spule",change_spool:"Spule wechseln",comment:"Kommentar",device_camera:"Gerät",filament_name:"Filament",first_used:"Zuerst genutzt",last_used:"Zuletzt genutzt",location:"Ort",lot_nr:"Charge",material:"Material",remaining_weight:"Verbleibend",vendor:"Hersteller",id:"ID",weight:"Gewicht",length:"Länge"},msg:{no_spool:"Sie haben keine Spule ausgewählt. Sind Sie sicher, dass Sie ohne Filament-Tracking drucken wollen?",no_filament:"Die Spule, die Sie ausgewählt haben, hat eventuell nicht genug verbleibendes Filament, um den Druckauftrag erfolgreich abzuschließen. Sind Sie sicher, dass Sie fortfahren wollen?",no_required_length:"Die benötigte Filamentmenge für die von Ihnen ausgewählte Datei ist unbekannt. Wollen Sie fortfahren?",mismatched_filament:"Das Material des ausgewählten Filaments stimmt nicht mit dem im Slicer ausgewählten Material überein. Sind Sie sicher, dass Sie fortfahren wollen?",tracking_inactive:"Filament-Tracking ist inaktiv. Bitte wählen Sie eine Spule aus um fortzufahren.",not_connected:"Spoolman-Server nicht verfügbar.",info:{howto:"Halten Sie den QR-Code der Spule in die Kamera. Dieses Fenster wird geschlossen, sobald eine Spule erkannt wurde."},warning:{code_not_recognized:"Dieser Code sieht nicht nach einem kompatiblen QR-Code aus.",invalid_spool_id:"Die Spulen-ID in diesem QR-Code ist ungültig."},error:{cors:"Es ist ein Fehler beim Abrufen des Kamerabilds aufgetreten. Bitte stellen Sie sicher, dass Ihr Kameraserver CORS-Zugriff erlaubt.",spool_not_existant:"Die von Ihnen gescannte Spule existiert nicht in der Datenbank.",no_image_data:"Es ist ein Fehler beim Abrufen des Kamerabilds aufgetreten. Bitte überprüfen Sie Ihre Kameraeinstellungen oder versuchen Sie, eine andere Kameraquelle zu verwenden."}},setting:{auto_open_qr_camera:"Kamera automatisch zur QR-Code- Erkennung öffnen",auto_select_spool_on_match:"Spulenauswahl bei QR-Code- Übereinstimmung automatisch übernehmen",prefer_device_camera:"Gerätekamera wenn verfügbar zur QR-Code- Erkennung verwenden",show_spool_selection_dialog_on_print_start:"Spulenauswahl-Dialog automatisch bei Druckstart anzeigen",warn_on_not_enough_filament:"Warnung anzeigen, wenn die Spule nicht genug Filament verbleibend hat, um den Druck abzuschließen",warn_on_filament_type_mismatch:"Warnung anzeigen, wenn der Filamenttyp der Spule nicht mit dem im Slicer ausgewählten übereinstimmt",remaining_filament_unit:"Verbleibendes Filament anzeigen als"}},job_queue:{msg:{confirm:"Sind Sie sicher? Hierdurch wird die gesamte Druckwarteschlange geleert"},title:{multiply_job:"Auftrag vermehren | Aufträge vermehren"},label:{number_of_copies:"Anzahl der Kopien"},tooltip:{help:"Fügen Sie Jobs der Warteschlange hinzu, indem Sie diese hierhin ziehen
Passen Sie die Reihenfolge der Warteschlange an, indem Sie die Jobs nach oben oder unten verschieben"}},sensors:{title:{sensors:"Sensoren"}},keyboard_shortcuts:{title:{keyboard_shortcuts:"Tastenkürzel"},label:{actions:"Aktionen",cancel:"Abbrechen",emergency_stop:"Not-Aus",home_all:"Alle homen",navigation:"Navigation",open_keyboard_shortcut_help:"Tastenkürzel-Hilfe öffnen",pause:"Pausieren",printing:"Drucken",tool:"Werkzeug"}},box:{btn:{uninstall:"Deinstallieren",load:"Laden",unload:"Entladen"},label:{vendor:"Lieferant",filament:"Material",color:"Farbe",title:"Materialsteuerung"},tooltip:{control_filament:"Steuern Sie das Laden und Entladen eines Materialslots sowie das Lesen von Daten wie Farbe und Materialart."}}}};export{e as default}; diff --git a/fluidd/assets/es-SJydnxzH.js b/fluidd/assets/es-SJydnxzH.js new file mode 100644 index 0000000..acfe5b7 --- /dev/null +++ b/fluidd/assets/es-SJydnxzH.js @@ -0,0 +1 @@ +var e={app:{bedmesh:{label:{box_scale:"Escala de la caja",flat_surface:"Mostrar plano",mesh_matrix:"Matriz de la malla",probed_matrix:"Matriz sondeada",profile_name:"Nombre del Perfil",remove_profile:"Borrar el perfil %{name}",scale:"Escala de color",wireframe:"Wireframe",base:"base",active:"activo"},msg:{hint:"Si guarda el perfil con un nombre que no sea %{name}, también puede elegir eliminar el perfil %{name}.",not_found:"No se ha encontrado ninguna malla de la cama.",not_loaded:"No está cargada ninguna malla."},tooltip:{calibrate:"Comienza una nueva calibración, se guardará con el nombre 'default'",delete:"Elimina el perfil",load:"Cargar el perfil",save:"Guarda el perfil de calibracion en el archivo printer.cfg",copy_image:"Copiar imagen de la malla de cama"}},chart:{label:{current:"Tª",item:"Nombre",power:"Potencia",rate_of_change:"Cambio",target:"Objetivo"},tooltip:{help:"Mantenga presionada la tecla Mayús para hacer zoom.
Haga clic en un elemento para mostrarlo.
Haga clic en una potencia para mostrarla."}},console:{label:{auto_scroll:"Scroll automático",flip_layout:"Invertir diseño",hide_temp_waits:"Esconder los mensajes de temperatura"},placeholder:{command:"''tabulador'' para autocompletar, ''help'' para comandos, ''flechas'' para historia"},tooltip:{help:'Introduce "help" para los comandos
Utiliza Tab para autocompletar
Utiliza y para el historial'}},endpoint:{error:{cant_connect:"Se ha producido un error y Fluidd no puede comunicarse con el destino. ¿Está seguro de que la dirección es correcta?",cors_error:"bloqueado por la configuración de CORS",cors_note:'Esto puede indicar que necesita modificar su configuración de Moonraker. Consulte la documentación sobre las configuraciones con varias impresoras aquí.'},hint:{add_printer:"Ex., http://fluiddpi.local"},msg:{trouble:'¿Tienes problemas? Haga clic aquí para más información.'},tooltip:{endpoint_examples:"Ingrese la URL de la API.
Por ejemplo:
fluidd.local, https://192.168.1.150
"}},endstop:{label:{open:"ABIERTO",triggered:"ACTIVADO"},msg:{subtitle:"Presione el botón 'Actualizar' para actualizar el estado."}},file_system:{filters:{label:{print_start_time:"Filtrar ya impresos",hidden_files_folders:"Filtrar archivos y carpetas ocultos",klipper_backup_files:"Filtar archivos de backup de Klipper",rolled_log_files:"Filtrar archivos de log rotados",moonraker_backup_files:"Filtrar archivos de backup de Moonraker",crowsnest_backup_files:"Filtrar archivos de backup de Crowsnest"}},label:{dir_name:"Nombre de la carpeta",disk_usage:"Uso del disco",diskinfo:"Información del disco",downloaded:"Descargado",file_name:"Nombre del archivo",transfer_rate:"Tasa de transferencia",uploaded:"Subido",view_section_documentation:"Ver documentación sobre '%{section}'",hour:"hora",minute:"minuto",second:"segundo"},msg:{not_found:"No se encontraron archivos",processing:"Procesando..."},title:{add_dir:"Agregar una carpeta",add_file:"Agregar un archivo",download_file:"Recuperando el archivo",rename_dir:"Cambiar el nombre de la carpeta",rename_file:"Cambiar el nombre del archivo",upload_file:"Subiendo archivo | Subiendo archivos",devices:"Dispositivos",command_palette:"Paleta de comandos",duplicate_dir:"Directorio duplicado",go_to_file:"Ir al archivo",duplicate_file:"Archivo duplicado",check_filament:"Verificar Material"},tooltip:{low_on_space:"Espacio en disco limitado",root_disabled:"{root} root no esta disponible. Por favor chequear los registros.",warning_text:"Por favor, agregue los tipos de materiales en el contenedor de materiales o reduzca los tipos de materiales utilizados por el modelo.",tip:"Seleccione los materiales a usar. La parte superior muestra los materiales utilizados por el modelo, y la parte inferior muestra los materiales correspondientes en el contenedor de materiales."},url:{klipper_config:"%{klipperDomain}/Config_Reference.html#%{hash}",crowsnest_config:"https://crowsnest.mainsail.xyz/configuration/%{hash}-section",moonraker_config:"https://moonraker.readthedocs.io/en/latest/configuration/#%{hash}",moonraker_telegram_bot_config:"https://github.com/nlef/moonraker-telegram-bot/wiki/Sample-config#%{hash}"},overlay:{drag_files_enqueue:"Arrastrar archivos aqui para encolar",drag_files_folders_upload:"Arrastrar archivos y carpetas aqui para subir"}},gcode:{btn:{load_current_file:"Cargar archivo actual"},label:{current_layer_height:"Altura de capa actual",exclude_object:"Excluir objeto",follow_progress:"Seguir el progreso",layer:"Capa",layers:"Capas",parsed:"Analizado",parsing_file:"Procesando archivo",show_current_layer:"Mostrar capa actual",show_extrusions:"Mostrar extrusiones",show_moves:"Mostrar movimientos",show_next_layer:"Mostrar capa siguiente",show_previous_layer:"Mostrar capa anterior",show_retractions:"Mostrar retracciones",show_parts:"Mostrar partes"},msg:{confirm:'El archivo "%{filename}" pesa %{size}. Esto podría usar muchos recursos de su sistema. ¿Está seguro?'},overlay:{drag_file_load:"Arrastra un archivo gcode aqui para cargar"}},general:{btn:{abort:"Abortar",accept:"Aceptar",add:"Añadir",add_dir:"Añadir una carpeta",add_file:"Añadir un archivo",add_printer:"Añadir una impresora",adjust_layout:"Ajustar la disposición del tablero",adjusted:"Ajustado",all:"Todo",auth_unsure:"No está seguro de porqué vé esto?",calibrate:"Calibrar",cancel:"Cancelar",clear_profile:"Limpar Perfil",close:"Cerrar",config_reference:"Referencia de configuración",download:"Descargar",edit:"Editar",extrude:"Extrudir",forgot_password:"Olvido su contraseña?",heaters_off:"Apagar calentadores",load_all:"Cargar todos",login:"Ingresar",more_information:"Más información",pause:"Pausa",preheat:"Precalentar",presets:"Preajustes",preview_gcode:"Previsualizar Gcode",quad_gantry_level:"QGL",reboot:"Reiniciar",refresh:"Actualizar",remove:"Borrar",remove_all:"Borrar todos",rename:"Renombrar",reprint:"Reimprimir",reset_file:"Despejar archivo",reset_layout:"Restablecer la disposición",reset_stats:"Restablecer Estadísticas",restart_firmware:"Reiniciar firmware",restart_service:"Reinciar %{service}",restart_service_klipper:"Reiniciar Klipper",restart_service_moonraker:"Reiniciar Moonraker",resume:"Retomar",retract:"Retraer",save:"Guardar",save_as:"Guardar como",save_config_and_restart:"Guardar configuración & reiniciar",save_restart:"Guardar y reiniciar",send:"Enviar",set_color:"Elegir color",shutdown:"Apagar",snooze:"Posponer",socket_reconnect:"Reconectar",socket_refresh:"Forzar actualización",upload:"Subir",upload_print:"Subir e imprimir",view:"Ver",add_to_queue:"Agregar a la cola",delete:"Eliminar",create_zip_archive:"Crear archivo ZIP",duplicate:"Duplicado",go_to_file:"Ir al archivo",multiply:"Multiplicar",reload:"Recargar",copied:"Copiado",copy:"Copiar",exit_layout:"Salir del modo diseño",job_queue:"Cola de trabajo",logout:"Cerrar sesión",print:"Imprimir",retry:"Reintentar",filter:"Filtro",recover:"Recuperar",reset_default_layout:"Restaurar diseño predeterminado"},error:{app_setup_link:'Las instrucciones de instalación de Fluidd están disponibles aquí.',app_warnings_found:"%{appName} advertencias encontradas.",components_config:'La configuración de complementos de Moonraker está disponible aquí.',failed_components:"Moonraker ha fallado en los complementos. Verifique los registros, actualice su configuración y reinicie Moonraker."},label:{accel_to_decel:"Aceleración a deceleración",acceleration:"Aceleración",accepted_screws:"Tornillos aceptados",actual_time:"Real",add_camera:"Añadir cámara",add_category:"Agregar categoría",add_filter:"Agregar Filtro",add_preset:"Añadir preajuste",add_user:"Añadir usuario",alias:"Alias",api_key:"Clave de la API",api_url:"URL de la API",apply_z_offset:"Aplicar y guardar Z_Offset",category:"Categoría",change_password:"Cambiar contraseña",clear_all:"Despejar todos",color:"Color",confirm:"Confirmar",current_password:"Contraseña actual",current_user:"Usuario actual",disabled_while_printing:"Desactivado durante la impresión",edit_camera:"Editar cámara",edit_category:"Editar Cateogria",edit_filter:"Editar Filtro",edit_preset:"Editar preajustes",edit_user:"Editar usuario",extrude_length:"Longitud de extrusión",extrude_speed:"Velocidad de extrusión",filament:"Filamento",file:"Archivo",finish_time:"Final",flow:"Flujo",free:"libre",heaters_busy:"La impresora está ocupada. Apagar los calentadores puede resultar en una impresión fallida.",high:"Alto",host:"Anfitrión",layer:"Capa",layout:"Disposición",longest_job:"Tarea más larga",low:"Bajo",m117:"M117",name:"Nombre",new_password:"Nueva contraseña",no_notifications:"Ninguna notificación",off:"Apagado",on:"Encendido",partial_of_total:"%{partial} de %{total}",password:"Contraseña",power:"Energía",printers:"Impresoras",progress:"Progreso",requested_speed:"Velocidad",retract_length:"Longitud de retracción",retract_speed:"Velocidad de retracción",save_as:"Guardar como",screw_index:"Indice de tornillo",screw_name:"Nombre del Tornillo",screw_number:"Tornillo %{index}",services:"Servicios",slicer:"Slicer",speed:"Velocidad",sqv:"Square Corner Velocity",total:"Total",total_filament:"Filamento total usado",total_filament_avg:"Promedio por impresión",total_jobs:"Impresiones totales",total_print_time:"Tiempo total de impresión",total_print_time_avg:"Promedio por impresion",total_time:"Tiempo total",total_time_avg:"Promedio por impresión",turn_device_off:"Apagar %{device}",turn_device_on:"Encender %{device}",uncategorized:"Sin categorizar",unretract_extra_length:"Longitud extra al des-retraer",unretract_speed:"Velocidad de des-retracción",unsaved_changes:"Cambios sin guardar",used:"Usado",username:"Usuario",velocity:"Velocidad",visible:"Visible",z_offset:"Z Offset",range:"Rango",synced_extruder:"Extrusor sincronizado",upload_and_print:"Subir e imprimir",stepper_enabled:"Stepper habilitado",unknown:"Desconocido",thumbnail_size:"Tamaño de la miniatura",file_time:"Archivo"},msg:{bed_screws_adjust:"Haga click en Ajustado si fue necesario un ajuste significativo en el tornillo actual, de lo contrario haga click en Aceptar para continuar.",password_changed:"Contraseña cambiada",wrong_password:"Se ha producido un error. ¿Es su contraseña correcta?"},simple_form:{error:{arrayofnums:"Solo números",credentials:"Credenciales inválidas",exists:"Ya existe",invalid_number:"Número inválido",invalid_url:"URL no válida",max:"Máx. %{max}",min:"Mín. %{min}",min_or_0:"Mín. %{min} o 0",password_username:"No se puede emparejar con el nombre de usuario",required:"Obligatorio"},msg:{confirm:"¿Está seguro?",confirm_power_device_toggle:"¿Está seguro? Esto alternará la alimentación del dispositivo.",confirm_reboot_host:"¿Está seguro? Esto reiniciará el sistema anfitrión.",confirm_shutdown_host:"¿Está seguro? Esto apagará el sistema anfitrión."}},table:{header:{actions:"Acciones",end_time:"Finalizado",estimated_time:"Tiempo estimado",filament:"Filamento",filament_used:"Filamento usado",filament_weight_total:"Peso del filamento",first_layer_bed_temp:"Temperatura de la cama de la primera capa",first_layer_extr_temp:"Temperatura de extrusión de la primera capa",first_layer_height:"Altura de capa de la primera capa",height:"Altura",last_printed:"Última impresión",layer_height:"Altura de capa",modified:"Modificado",name:"Nombre",print_duration:"Duración de la impresión",size:"Tamaño",slicer:"Slicer",slicer_version:"Versión del slicer",start_time:"Iniciado",status:"Estado",total_duration:"Duración total"}},title:{add_chart:"Agregar gráfico",add_printer:"Añadir impresora",bedmesh:"Malla de la cama",bedmesh_controls:"Controles de la malla de la cama",camera:"Cámara | Cámaras",config_files:"Archivos de configuración",configure:"Configuración",console:"Consola",endstops:"Endstops",fans_outputs:"Ventiladores y salidas",gcode_preview:"Previsualización de Gcode",history:"Historial",home:"Inicio",jobs:"Tareas",limits:"Límites de la impresora",macros:"Macros",other_files:"Otros Archivos",retract:"Retracción por firmware",runout_sensors:"Sensores de filamento",settings:"Opciones",stats:"Estatísticas de la impresora",system:"Sistema",system_overview:"Información del sistema",temperature:"Térmicas",tool:"Herramienta",tune:"Calibrar"},tooltip:{estop:"Parada de Emergencia",notifications:"Notificaciones",reload_klipper:"Recarga la configuración de Klipper.",reload_restart_klipper:"Recarga la configuración de Klipper y reinicia los MCUs.",restart_klipper:"Reinicia el servicio de sistema de Klipper."}},printer:{state:{busy:"Ocupada",cancelled:"Cancelado",complete:"Completado",idle:"Inactiva",loading:"Cargando",paused:"Pausada",printing:"Imprimiendo",ready:"Lista",standby:"Stand-by"}},setting:{btn:{add_camera:"Añadir cámara",add_thermal_preset:"Añadir preajuste",add_user:"Añadir usuario",reset:"Resetear",select_theme:"Seleccionar tema"},camera_type_options:{mjpegadaptive:"MJPEG Adaptative",mjpegstream:"MJPEG Stream",video:"Cámara IP"},label:{all_off:"Apagar todo",all_on:"Encender todo",axes:"Ejes",camera_flip_x:"Voltear horizontalmente",camera_flip_y:"Voltear verticalmente",camera_stream_type:"Tipo de stream",confirm_on_estop:"Requerir confirmación para la Parada de Emergencia",confirm_on_power_device_change:"Requiere confirmar cambios de alimentación",dark_mode:"Modo oscuro",default_extrude_length:"Longitud de extrusión por defecto",default_extrude_speed:"Velocidad de extrusión por defecto",default_toolhead_move_length:"Longitud de movimiento por defecto del cabezal",default_toolhead_xy_speed:"Velocidad XY por defecto del cabezal",default_toolhead_z_speed:"Velocidad Z por defecto del cabezal",draw_background:"Dibujar fondo",enable:"Activar",enable_notifications:"Activar notificaciones",extrusion_line_width:"Ancho de línea de la extrusión",flip_horizontal:"Volteo horizontal",flip_vertical:"Volteo vertical",fps_target:"Objetivo de FPS",gcode_coords:"Usar Coordenadas GCode",invert_x_control:"Invertir control X",invert_y_control:"Invertir control Y",invert_z_control:"Invertir control Z",language:"Idioma",max:"Máximo",metrics:"Métricas",min:"Mínimo",move_line_width:"Ancho de línea del movimiento",name:"Nombre",none:"Ninguno",optional:"Opcional",primary_color:"Color principal",printer_name:"Nombre de la impresora",reset:"Restablecer opciones",retraction_icon_size:"Tamaño del icono de retracción",show_animations:"Mostrar animaciones",show_bed_screws_adjust_dialog_automatically:"Mostrar diálogo de ajuste de tornillos de cama automáticamente",show_rate_of_change:"Mostrar tasa de cambio de temperatura",solid:"Sólido",starts_with:"Comienza con",theme_preset:"Preajustes de la comunidad",thermal_preset_gcode:"GCode",thermal_preset_name:"Nombre del preajuste",title:"Título",toolhead_move_distances:"Valores de distancia de la herramienta",type:"Tipo",unit:"Unidad",z_adjust_values:"Valores de ajuste de Z",show_logo_on_background:"Mostrar logotipo en el fondo"},timer_options:{duration:"Solo duración",filament:"Estimación por filamento",file:"Estimación por archivo",slicer:"Slicer"},title:{authentication:"Autentificación",camera:"Cámara | Cámaras",console:"Consola",file_editor:"Editor de Archivos",gcode_preview:"Previsualización de Gcode",general:"General",macros:"Macros",theme:"Tema",thermal_presets:"Preajustes térmicos",tool:"Herramienta"},tooltip:{gcode_coords:"Usar la posición del GCode en lugar de la posición del cabezal en el tablero"}},socket:{msg:{connecting:"Conectando con Moonraker...",no_connection:"No hay conexión con Moonraker. Compruebe el estado de Moonraker y/o actualice la página."}},system_info:{label:{capacity:"Capacidad",cpu_desc:"Descripción de la CPU",distribution_codename:"Nombre clave",distribution_like:"Distribución basada en",distribution_name:"Distribución",frequency:"Frecuencia",hardware_desc:"Descripción de hardware",hostname:"Nombre del anfitrión",klipper_load:"Carga de Klipper",manufactured:"Fabricado",manufacturer:"Fabricante",mcu_awake:"Tiempo despierto del {mcu}",mcu_bandwidth:"Ancho de banda del {mcu}",mcu_load:"Carga del {mcu}",model:"Modelo de CPU",moonraker_load:"Carga de Moonraker",processor_desc:"Procesador",product_name:"Nombre de producto",serial_number:"Número de serie",system_load:"Carga del sistema",system_memory:"Memoria del sistema",system_utilization:"Utilización del sistema",total_memory:"Memoria total"}},tool:{btn:{home_all:"Todos",home_x:"X",home_y:"Y"},title:{bed_screws_adjust:"Ajustar tornillos de la cama"},tooltip:{absolute_positioning:"Posicionamiento Absoluto",extruder_disabled:"Extrusor deshabilidado, por debajo de min_extrude_temp (%{min}°C)",home_xy:"Origen XY",home_z:"Origen Z",motors_off:"Apagar Motores",relative_positioning:"Posicionamiento Relativo"}},version:{btn:{check_for_updates:"Buscar actualizaciones",finish:"Terminar",update:"Actualizar",update_all:"Actualizar todo",view_versions:"Ver versiones"},label:{commit_history:"Historial de commits",dirty:"SUCIO",invalid:"NO VÁLIDO",os_packages:"Paquetes del SO",package_list:"Lista de paquetes",up_to_date:"ACTUALIZADO",updates_available:"Hay actualizaciones disponibles"},status:{finished:"Atualizaciones terminadas",updating:"Actualizando..."},title:"Actualizaciones de software",tooltip:{commit_history:"Historial de commits",dirty:"avisa del estado 'detached head', no sobre 'master' o con origen no válido",invalid:"indica cambios locales a la repo",packages:"Paquetes",release_notes:"Notas de lanzamiento"}},box:{btn:{uninstall:"Desinstalar",load:"Cargar",unload:"Descargar"},label:{vendor:"Proveedor",filament:"Material",color:"Color",title:"Control de Materiales"},tooltip:{control_filament:"Controlar la carga y descarga de un solo slot de material, así como leer datos como el color y tipo de material."}}}};export{e as default}; diff --git a/fluidd/assets/fr-DoiaUWIQ.js b/fluidd/assets/fr-DoiaUWIQ.js new file mode 100644 index 0000000..28b4c74 --- /dev/null +++ b/fluidd/assets/fr-DoiaUWIQ.js @@ -0,0 +1 @@ +var e={app:{bedmesh:{label:{box_scale:"Amplifier la visualisation",flat_surface:"Montrer un plan plat",mesh_matrix:"Matrice interpolée",probed_matrix:"Matrice réelle",profile_name:"Nom du profil",remove_profile:"Supprimer le profile %{name}",scale:"Échelle au min / max",wireframe:"Armature",active:"actif",base:"base"},msg:{hint:"Si vous enregistrez sous un nom autre que %{name}, vous pouvez choisir de supprimer également le profil %{name}",not_found:"Aucune maille de lit existante n'a été trouvée.",not_loaded:"Pas de bed mesh chargé"},tooltip:{calibrate:"Démarrer une nouvelle calibration, le profil sera sauvegardé sous le nom 'default'",delete:"Supprime le profil",load:"Charger le profil",save:"Enregistrer le profil calibré dans 'printer.cfg'",copy_image:"Copier l'image du bed mesh"}},chart:{label:{current:"Courant",item:"Élément",power:"Puissance",target:"Cible",rate_of_change:"Changement"},tooltip:{help:"Maintenez Shift pour zoomer.
Cliquez sur un élément pour l'afficher .
Cliquez sur une puissance pour l'afficher ."}},console:{label:{auto_scroll:"Scroll auto",hide_temp_waits:"Cacher les messages de température",flip_layout:"Inverser disposition"},placeholder:{command:"'tab' pour l'autocomplete, 'help' pour les commandes, les flêches pour l'historique"},tooltip:{help:`Saisir "help" pour les commandes
Utiliser Tab pour l'autocomplétion
Utiliser et pour l'historique`}},endpoint:{error:{cant_connect:"Une erreur s'est produite et fluidd ne peut pas communiquer . Êtes-vous sûr(e) qu'il s'agisse de la bonne adresse ?",cors_error:"blocké par la configuration CORS",cors_note:'Cela peut signifier que vous devez modifier la configuration de votre moonraker. Veuillez consulter la documentation sur les configurations multi-imprimantes ici'},hint:{add_printer:"Ex : http://fluiddpi.local"},msg:{trouble:`Un souci ? Cliquez ici pour plus d'informations.`},tooltip:{endpoint_examples:"Saissizez l'URL de l'API .
Par exemple;
http://fluidd.local, http://192.168.1.150
"}},endstop:{label:{open:"OUVERT",triggered:"ACTIF"},msg:{subtitle:"Utilisez le bouton d'actualisation pour mettre à jour l'état de l'arrêt final."}},file_system:{filters:{label:{print_start_time:"Filtrer les impressions passées",moonraker_backup_files:"Filtrer les fichiers de sauvegarde Moonraker",klipper_backup_files:"Filtrer les fichiers de sauvegardes Klipper",rolled_log_files:"Filtrer les fichiers log rotatifs",crowsnest_backup_files:"Filtrer les fichiers de sauvegarde de Crowsnest",hidden_files_folders:"Filtrer les fichiers et dossiers cachés"}},label:{dir_name:"Nom du dossier",disk_usage:"Utilisation du disque",diskinfo:"Informations sur le disque",downloaded:"Téléchargé",file_name:"Nom du fichier",transfer_rate:"Vitesse de transfert",uploaded:"Téléchargé",view_section_documentation:"Voir la documentation : '%{section}'",hour:"heure",minute:"minute",second:"seconde"},msg:{not_found:"Aucun fichier trouvé",processing:"Traitement en cours"},title:{add_dir:"Ajouter un dossier",add_file:"Créer un fichier",download_file:"Téléchargement en cours",rename_dir:"Renommer le dossier",rename_file:"Renommer le fichier",upload_file:"Upload en cours",devices:"Périphériques",duplicate_dir:"Répertoire des doublons",duplicate_file:"Fichier Dupliqués",go_to_file:"Aller au fichier",command_palette:"Palette de commandes",check_filament:"Vérifier le filament"},tooltip:{low_on_space:"Espace disque limité",root_disabled:"La racine {root} n'est pas disponible. Veuillez vérifier vos logs.",items_count:"élément {count} | éléments {count}",warning_text:"Veuillez ajouter les types de matériaux dans le bac à matériaux ou réduire les types de matériaux utilisés par le modèle.",tip:"Sélectionnez les matériaux à utiliser. Le haut montre les matériaux utilisés par le modèle, et le bas montre les matériaux correspondants dans le bac à matériaux."},url:{moonraker_telegram_bot_config:"https://github.com/nlef/moonraker-telegram-bot/wiki/Sample-config#%{hash}",klipper_config:"%{klipperDomain}/Config_Reference.html#%{hash}",moonraker_config:"https://moonraker.readthedocs.io/en/latest/configuration/#%{hash}",crowsnest_config:"https://crowsnest.mainsail.xyz/configuration/%{hash}-section"},overlay:{drag_files_enqueue:"Glisser les fichiers ici pour les mettre en file d'attente",drag_files_folders_upload:"Glisser les fichiers et les dossiers ici pour les télécharger"}},gcode:{btn:{load_current_file:"Charger le fichier actuel"},label:{current_layer_height:"Hauteur de couche actuelle",follow_progress:"Suivre la progression",layer:"Couche",layers:"Couches",parsed:"Analysé",show_extrusions:"Afficher les extrusions",show_moves:"Afficher les déplacements",show_next_layer:"Afficher la couche suivante",show_previous_layer:"Afficher la couche précédente",show_retractions:"Aficher les rétractations",exclude_object:"Exclure un objet",parsing_file:"Analyse du fichier",show_current_layer:"Afficher la couche actuelle",show_parts:"Afficher les pièces"},msg:{confirm:'Le fichier "%{filename}" est de %{size}, ce qui peut être coûteux en ressources pour votre système. En êtes-vous certain ?'},overlay:{drag_file_load:"Glisser un fichier gcode ici pour le charger"}},general:{btn:{add:"Ajouter",add_dir:"Ajouter un dossier",add_file:"Créer un fichier",add_printer:"Ajouter une imprimante",adjust_layout:"Ajuster la disposition du tableau de bord",all:"Tout",calibrate:"Calibrer",cancel:"Annuler",clear_profile:"Effacer le profile",close:"Fermer",config_reference:"Référence de configuration",download:"Télécharger",edit:"Editer",exit_layout:"Quitter le mode de mise en page",extrude:"Extruder",heaters_off:"Tout éteindre",load_all:"Tout charger",more_information:"Plus d'informations",pause:"Pause",preheat:"Préchauffe",presets:"Préréglage",preview_gcode:"Prévisualiser le Gcode",quad_gantry_level:"QGL",reboot:"Redémarrer",refresh:"Rafraîchir",remove:"Supprimer",remove_all:"Tout supprimer",rename:"Renommer",reprint:"Imprimer à nouveau",reset_file:"Réinitialiser le fichier",reset_layout:"Remettre la disposition à zéro",restart_firmware:"Redémarrer le firmware",restart_service:"Redémarrer %{service}",restart_service_klipper:"Redémarrer Klipper",restart_service_moonraker:"Redémarrer Moonraker",resume:"Reprendre",retract:"Rétracter",save:"Enregistrer",save_as:"Sauvegarder sous",save_restart:"Enregister et redémarrer",send:"Envoyer",set_color:"Définir la couleur",shutdown:"Éteindre",socket_refresh:"Forcer le rafraichissement",upload:"Uploaded",upload_print:"Uploaded & imprimer",view:"Voir",socket_reconnect:"Se reconnecter",add_to_queue:"Ajouter à la file d'attente",login:"Connexion",reload:"Recharger",retry:"Réessayer",save_config_and_restart:"Sauvegarder la configuration et redémarrer",select_columns:"Sélectionner les colonnes",auth_unsure:"Vous ne savez pas pourquoi vous voyez cela ?",reset_stats:"Réinitialiser les statistiques",copied:"Copié",copy:"Copie",create_zip_archive:"Créer une archive ZIP",delete:"Supprimer",filter:"Filtre",print:"Imprimer",adjusted:"Ajusté",forgot_password:"Vous avez oublié votre mot de passe ?",job_queue:"File d'attente",logout:"Déconnexion",snooze:"Snooze",thumbnail_size:"Taille des vignettes",upload_files:"Téléversement de fichiers",duplicate:"Duplicata",set_default_layout:"Définir en mise en page par défaut",multiply:"Multiplier",abort:"Abandonner",accept:"Accepter",go_to_file:"Aller au fichier",recover:"Récupérer",refresh_metadata:"Actualiser les métadonnées",reset_default_layout:"Réinitialisation de la présentation par défaut",return_dashboard:"Retour au tableau de bord",upload_folder:"Téléversement du dossier"},error:{app_setup_link:`Les instructions d'installation de Fluidd sont disponibles ici`,app_warnings_found:"%{appName} avertissements .",components_config:'La configuration du plugin moonraker est disponible ici.',failed_components:"Moonraker a des plugins en échec, veuillez vérifier les logs, mettre à jour la configuration et redémarrer moonraker ."},label:{accel_to_decel:"Accel. à Décel",acceleration:"Accélération",add_camera:"Ajouter une caméra",add_preset:"Ajouter un pré-réglage",add_user:"Ajouter un utilisateur",api_key:"Clé API",api_url:"URL de l'API",category:"Catégorie",change_password:"Changer le mot de passe",clear_all:"Effacer tout",color:"Couleur",confirm:"Confirmation",current_password:"Mot de passe actuel",disabled_while_printing:"Désactiver durant l'impression",edit_camera:"Éditer une caméra",edit_preset:"Editer le pré-réglage",edit_user:"Modifier l'utilisateur",extrude_length:"Longueur d'extrusion",extrude_speed:"Vitesse d'extrusion",flow:"Débit",free:"libres",high:"Max",host:"Hôte",layout:"Disposition",longest_job:"Impression la plus longue",low:"Min",name:"Nom",new_password:"Nouveau mot de passe",no_notifications:"Aucune notification",off:"Arrêt",password:"Mot de passe",power:"Puissance",printers:"Imprimantes",progress:"Progression",requested_speed:"Vitesse demandée",retract_length:"Longueur de retractation",retract_speed:"Vitesse de rétractation",save_as:"Sauvegarder sous",services:"Services",speed:"Vitesse",sqv:"Vitesse angle droit",total_filament:"Total filament",total_filament_avg:"Moy. par impression",total_jobs:"Nombre total d'impression",total_print_time:"Temps total d'impression",total_print_time_avg:"Moy. par impression",total_time:"Temps total",total_time_avg:"Temps moyen",uncategorized:"Non catégorisé",unretract_speed:"Vitesse de dérétractation",used:"occupé",velocity:"Velocité",visible:"Visible",z_offset:"Z Offset",finish_time:"Fin",unretract_extra_length:"Longueur de rétractation supplémentaire",layer:"Couche",actual_time:"Actuel",file:"Fichier",filament:"Filament",m117:"M117",slicer:"Slicer",total:"Total",screw_name:"Nom de la vis",command:"Commande",numeric_prefix_sort:"Préfixe numérique tri",current_user:"Utilisateur actuel",default:"Défaut",heaters_busy:"L'imprimante est actuellement occupée. Le fait d'éteindre les appareils de chauffage peut entraîner un échec de l'impression.",moonraker:"Moonraker",pause_at_layer:"Pause à la couche",pause_at_next_layer:"Pause à la couche suivante",pause_at_layer_number:"Pause à la couche numéro",smooth_time:"Smooth Time",stepper_enabled:"Stepper activé",synced_extruder:"Extrudeur synchronisé",accepted_screws:"Vis acceptées",on:"On",range:"Portée",screw_index:"Index de vis",turn_device_off:"Éteindre %{device}",unknown:"Inconnu",alias:"Alias",apply_z_offset:"Appliquer et sauvegarder le Z_Offset",edit_filter:"Modifier le filtre",all:"Tout",ldap:"LDAP",screw_number:"Vis %{index}",turn_device_on:"Allumer %{device}",upload_and_print:"Téléverser et imprimer",version_sort:"Tri des versions",unsaved_changes:"Modifications non sauvegardées",add_category:"Ajouter une catégorie",minimum_cruise_ratio:"Ratio de déplacement minimum",compact:"Compact",manage_accounts:"Gérer les comptes",user_managed_source:"Utilisateur géré par %{source} authentification",pressure_advance:"Avance de pression",thumbnail_size:"Taille de la vignette",file_time:"Fichier",bars:"Barres",cross:"Croiser",add_filter:"Ajouter un filtre",auth_source:"Source d'authentification",circle:"Cercle",partial_of_total:"%{partial} de %{total}",username:"Nom d'utilisateur",edit_category:"Modifier la catégorie",stepper_driver:"%{name} Driver"},msg:{password_changed:"Mot de passe modifié",wrong_password:"Oops, il y a eu un problème. Le mot de passe est il correct ?",pending_configuration_sections_deleted:"Les sections suivantes sont marquées pour suppression",bed_screws_adjust:"Cliquez sur Ajusté si un ajustement significatif est nécessaire sur la vis actuelle ; sinon, cliquez sur Accepter pour continuer.",needs_refresh:"Nouveau contenu disponible, veuillez cliquer sur le bouton Recharger pour mettre à jour.",rolledover_logs:"Les journaux d'application suivants ont été transférés : %{applications}",welcome_back:"Bienvenue.
Connectez-vous ci-dessous pour rester en communication avec votre imprimante.",offline_ready:"Fluidd est maintenant prêt à travailler hors ligne.",fluidd_settings_restore_failed:"Échec de la restauration des paramètres Fluidd !",not_valid_fluidd_backup_file:"Fichier de sauvegarde Fluidd non valide !",fluidd_settings_backup_failed:"Échec de la sauvegarde des paramètres Fluidd !"},simple_form:{error:{arrayofnums:"Nombres uniquement",exists:"Existe déja",invalid_url:"URL invalide",max:"Max %{max}",min:"Min %{min}",min_or_0:"Min %{min} ou 0",password_username:"Le nom d'utilisateur ne correspond pas",required:"Requis",invalid_number:"Numéro invalide",credentials:"Identifiants incorrects",invalid_expression:"Expression invalide",invalid_aspect:"Ratio d'aspect invalide"},msg:{confirm:"Êtes-vous sûr(e) ?",confirm_reboot_host:"Êtes-vous sûr(e) ? Ceci va redémarrer le système hôte .",confirm_shutdown_host:"Êtes-vous sûr(e) ? Ceci va éteindre le système hôte .",confirm_forcemove_toggle:"En êtes-vous sûr ? Cela peut endommager l'imprimante.",confirm_power_device_toggle:"Êtes-vous sûr ? Cela va basculer l'état de cet appareil.",unsaved_changes:"Vous avez des modifications non enregistrées. Êtes-vous sûr de vouloir fermer ce fichier ?",confirm_service_restart:"Êtes-vous sûr de vouloir redémarrer le service %{name} ?",confirm_cancel_print:"Êtes-vous sûr de vouloir annuler l'impression en cours ?",confirm_delete:"Êtes-vous sûr ? Cette opération supprime l'élément sélectionné. | Êtes-vous sûr ? Cela supprimera les {count} éléments sélectionnés.",confirm_emergency_stop:"Êtes-vous sûr de vouloir arrêter d'urgence l'imprimante ?",confirm_exclude_object:"Êtes-vous sûr de vouloir exclure cet objet de l'impression ?",confirm_load_bedmesh_profile:"L'imprimante est actuellement occupée. Êtes-vous sûr de vouloir charger le profil %{name} ?",confirm_clear_mesh:"L'imprimante est actuellement occupée. Êtes-vous sûr de vouloir effacer le maillage du lit ?",confirm_service_start:"Êtes-vous sûr de vouloir démarrer le service %{name} ?",confirm_remove_user:"Êtes-vous sûr de vouloir supprimer l'utilisateur %{username} ?",confirm_service_stop:"Êtes-vous sûr de vouloir arrêter le service %{name} ?",no_file_preview:"%{name} ne peut pas être prévisualisé actuellement."}},table:{header:{actions:"Actions",end_time:"Terminé",estimated_time:"Temps estimé",filament:"Filament",filament_used:"Filament utilisé",filament_weight_total:"Poids total",first_layer_bed_temp:"Temp. initiale du lit",first_layer_extr_temp:"Temp. initiale de l'extrudeur",first_layer_height:"Hauteur première couche",height:"Hauteur",last_printed:"Dernière impression",layer_height:"Hauteur de couche",modified:"Modifié",name:"Nom",print_duration:"Durée d'impression",size:"Taille",slicer:"Slicer",slicer_version:"Version du slicer",start_time:"Démarré",status:"Statut",total_duration:"Durée totale",filament_type:"Type de filament",chamber_temp:"Température de la chambre",filament_name:"Nom du filament",time_in_queue:"Temps d'attente",nozzle_diameter:"Diamètre de la buse",time_added:"Temps ajouté"}},title:{add_printer:"Ajouter une imprimante",bedmesh:"Maille du lit",bedmesh_controls:"Options du Bed Mesh",camera:"Webcam",config_files:"Fichiers de configuration",configure:"Configuration",console:"Console",endstops:"Fin de course",fans_outputs:"Ventilateur & sorties",gcode_preview:"Prévisualisation du Gcode",history:"Historique des impressions",home:"Tableau de bord",jobs:"Fichiers",limits:"Limites de l'imprimante",macros:"Macros",retract:"Rétractation Firmware",runout_sensors:"Capteurs de filament",settings:"Paramètres",stats:"Statistiques de l'imprimante",system:"Système",system_overview:"Information système",temperature:"Température",tool:"Outil",tune:"Réglages",add_chart:"Ajouter un graphique",rollover_logs:"Rotation des logs",not_found:"404 Non trouvé",diagnostics:"Diagnostics",edit_chart:"Editer le graphique",job_queue:"File d'attente",timelapse:"Timelapse",metrics_explorer:"Explorateur de métriques",other_files:"Autres fichiers",pending_configuration_changes:"Attente de changements de configuration en cours"},tooltip:{estop:"Arrêt d'urgence",reload_klipper:"Recharge la configuration Klipper.",reload_restart_klipper:"Recharge la configuration Klipper et redémarre les cartes de contrôle.",restart_klipper:"Redémarre le service système klipper.",browse_metrics:"Consulter les indicateurs disponibles",rollover_logs:"Rotation des logs",managed_by_moonraker:"Géré par la configuration de votre Moonraker",notifications:"Notifications",run_collector:"Exécuter le collecteur",file_browser_configuration_help:"Copiez les fichiers et les dossiers dans les fichiers de configuration en les faisant glisser d'ici et en les déposant là",file_browser_help:`Glisser-déposer des fichiers ou des dossiers depuis l'extérieur du navigateur pour les téléverser ici
Déplacer des fichiers et des dossiers en les glissant-déposant dans des sous-dossiers ou ".."`}},printer:{state:{busy:"Occupée",complete:"Terminé",idle:"Inactif",loading:"Chargement",paused:"En pause",printing:"Impression en cours",ready:"Prêt",standby:"Stand-by",cancelled:"Annulé"},title:{printer_status:"État de l'imprimante"}},setting:{btn:{add_camera:"Ajouter une caméra",add_thermal_preset:"Ajouter un pré-réglage",add_user:"Ajouter un utilisateur",reset:"RAZ",select_theme:"Sélectionner le thème",add_category:"Ajouter une catégorie",add_filter:"Ajouter un filtre",add_metric:"Ajouter un indicateur",backup:"Sauvegarde",restore:"Restaurer"},camera_type_options:{mjpegadaptive:"MJPEG Adaptive",mjpegstream:"Flux MJPEG",video:"caméra ip",webrtc_camera_streamer:"WebRTC (camera-streamer)",iframe:"Page HTTP",webrtc_go2rtc:"WebRTC (go2rtc)",hlsstream:"Flux HLS",webrtc_mediamtx:"WebRTC (MediaMTX)"},label:{all_off:"Tout éteindre",all_on:"Tout allumer",camera_flip_x:"Retourner horizontalement",camera_flip_y:"Retourner verticalement",camera_stream_type:"Type de flux",confirm_on_estop:"Demander une confirmation en cas d'arrêt d'urgence",dark_mode:"Mode sombre",default_extrude_length:"Longueur d'extrusion par défaut",default_extrude_speed:"Vitesse d'extrusion par défaut",default_toolhead_move_length:"Longueur de déplacement par défaut de la tête d'outil",default_toolhead_xy_speed:"Vitesse XY de la tête d'outil par défaut",default_toolhead_z_speed:"Vitesse Z de la tête d'outil par défaut",draw_background:"Afficher le fond d'écran",enable:"Activer",enable_notifications:"Activer les notifications",extrusion_line_width:"Largeur de ligne d'extrusion",flip_horizontal:"Retourner horizontalement",flip_vertical:"Retourner verticalement",fps_target:"Nombre d'images par seconde",gcode_coords:"Utiliser les coordonnées GCode",invert_x_control:"Inverser les contrôles en X",invert_y_control:"Inverser les contrôles en Y",invert_z_control:"Inverser les contrôles en Z",language:"Langue d'affichage",move_line_width:"Largeur de ligne de déplacement",primary_color:"Couleur primaire",printer_name:"Nom de l'imprimante",reset:"Remettre à zéro",retraction_icon_size:"Taille de l'icone de rétractation",show_animations:"Afficher les animations",theme_preset:"Préréglage communautaire",thermal_preset_name:"Nom du pré-réglage",z_adjust_values:"Valeurs de Z Adjust",thermal_preset_gcode:"GCode",print_eta_calculation:"Imprimer le calcul de l'ETA",print_in_progress_layout:"Afficher la progression",print_progress_calculation:"Afficher le calcul de la progression",show_manual_probe_dialog_automatically:"Afficher automatiquement la boîte de dialogue pour la Sonde manuelle",show_barometric_pressure:"Afficher la pression barométrique",camera_fullscreen_action:{title:"Action plein écran",embed:"Embarquer",rawstream:"Flux brut"},collector:"Collecteur",contains:"Contient",dashed:"En pointillés",metrics:"Indicateurs",name:"Nom",show_save_config_and_restart:'Bouton "Sauvegarder la configuration et redémarrer" dans la barre de navigation supérieure',auto_load_mobile_on_print_start:"Chargement automatique des fichiers sur les appareils mobiles",confirm_on_power_device_change:"Demander une confirmation pour le changement d'état de l'alimentation de l'appareil",confirm_on_save_config_and_restart:"Examiner les modifications de configuration en cours avant l'enregistrement et le redémarrage",enable_diagnostics:"Activer les diagnostics",filter:"Filtre | Filtres",height:"Hauteur",icon:"Icône",keyboard_shortcuts:"Raccourcis clavier",show_chart:"Afficher le graphique",show_code_lens:"Montrer CodeLens",show_legend:"Afficher la légende",show_upload_and_print:"Afficher le bouton de téléversement et d'impression dans la barre de navigation supérieure",toolhead_move_distances:"Valeurs de distance de la tête d'outil",show_gas_resistance:"Montrer la résistance au gaz",sections_to_ignore_pending_configuration_changes:"Sections ignorant les changements de configuration en attente",show_rate_of_change:"Afficher le taux de variation de la température",show_relative_humidity:"Afficher l'humidité relative",solid:"Solide",toolhead_control_style:"Style de contrôle de la tête d'outil",starts_with:"Commence par",toolhead_z_move_distances:"Valeurs de la distance Z de la tête d'outil",date_format:"Format de la date",time_format:"Format de l'heure",default_min_layer_height:"Hauteur minimale de la couche par défaut",dotted:"Pointillés",title:"Titre",text_sort_order:"Ordre de tri du texte",type:"Type",unit:"Unité",show_bed_screws_adjust_dialog_automatically:"Afficher la boîte de dialogue Ajustement automatique des vis de lit",show_logo_on_background:"Afficher le logo sur l'arrière-plan",to_browser_local_storage:"Pour le stockage local du navigateur",to_browser_session_storage:"Stockage de la session du navigateur",optional:"En option",last_result:"Dernier résultat",line_color:"Couleur de la ligne",min:"Minimum",max:"Maximum",axes:"Axes",enable_xy_homing:"Activer le Homing XY",aspect_ratio:"Ratio d'aspect",aspect_ratio_format:"[width : height]",auto_edit_extensions:"Extensions à ouvrir automatiquement en mode édition",auto_follow_on_file_load:"Suivi automatique de la progression du chargement des fichiers",auto_load_on_print_start:"Chargement automatique du fichier au démarrage de l'impression",camera_rotate_by:"Rotation par",camera_url_stream:"URL du flux de la caméra",draw_origin:"Dessiner l'origine",confirm_dirty_editor_close:"Demander confirmation avant fermeture de l'éditeur avec changements non sauvegardés",expression:"Expression",fill_opacity:"Opacité du remplissage",hide_single_part_bounding_box:"Masquer la boîte englobante de la pièce lors de l'impression d'une seule pièce",fill_color:"Couleur de remplissage",fps_idle_target:"FPS Cible sans mise au point",left_y:"Axe Y gauche",line_style:"Style de ligne",never:"Jamais",none:"Aucun",power_toggle_in_top_nav:"Bouton d'allumage dans la navigation supérieure",right_y:"Axe Y droit",save_and_restore_view_state:"Sauvegarder et restaurer l'état de la vue",show_screws_tilt_adjust_dialog_automatically:"Afficher automatiquement la boîte de dialogue des Vis pour le Réglage de l'inclinaison",toolhead_xy_move_distances:"Valeurs de la distance XY de la tête d'outil",force_move_toggle_warning:"Confirmation obligatoire lors de l'activation de FORCE_MOVE",camera_url_snapshot:"URL de l'instatané de la caméra",card:"Carte",fluidd_settings_in_moonraker_db:"Paramètres Fluidd dans la base de données Moonraker"},timer_options:{duration:"Durée uniquement",filament:"Filament",file:"Fichier",slicer:"Slicer",slicer_m73:"Slicer (M73)",absolute_file_position:"Position absolue du fichier",relative_file_position:"Position relative du fichier"},title:{authentication:"Authentification",camera:"Webcam",gcode_preview:"Prévisualiser le Gcode",general:"Général",macros:"Macros",theme:"Thème",thermal_presets:"Pré-réglages de température",tool:"Outil",file_editor:"Éditeur de fichiers",console:"Console",file_browser:"Navigateur de fichiers"},tooltip:{gcode_coords:"Utiliser la posistion GCode au lieu de la position de l'outil sur le tableau de bord",average_calculation:"Si plusieurs options sont sélectionnées, une moyenne sera calculée",show_manual_probe_dialog_automatically:"Affiche automatiquement la boîte de dialogue d'aide si l'on exécute une sonde manuelle",show_screws_tilt_adjust_dialog_automatically:"Affiche automatiquement un dialogue d'aide si l'outil SCREWS_TILT_CALCULATE est exécuté",theme_disclaimer:"Ces thèmes comportent des noms de marques et des logos qui sont la propriété intellectuelle de leurs propriétaires respectifs.
L'inclusion de ces noms et logos est faite avec la permission des marques.
Cependant, veuillez noter que ces thèmes ne sont pas officiellement maintenus par les marques respectives.
Tous les problèmes ou demandes liés aux thèmes doivent être adressés à l'équipe Fluidd.
L'utilisation des noms de marques et des logos est uniquement à des fins décoratives et esthétiques, et aucune association officielle avec ou l'approbation par les marques n'est implicite.",keyboard_shortcuts:"[BETA] Activer et appuyer sur '?' pour afficher la liste des raccourcis clavier disponibles",diagnostics_performance:"[BETA] L'enregistrement des informations de diagnostic peut avoir un impact sur les performances",show_bed_screws_adjust_dialog_automatically:"Affiche automatiquement une boîte de dialogue d'aide si l'outil BED_SCREWS_ADJUST est en cours d'exécution"},camera_rotate_options:{90:"90°",180:"180°",270:"270°",none:"Aucun"}},socket:{msg:{connecting:"Connexion à Moonraker ...",no_connection:"Pas de connection à Moonraker . Vérifiez l'état de Moonraker et / ou rafraichissez ."}},system_info:{label:{capacity:"Capacité",cpu_desc:"Description du processeur",distribution_codename:"Nom de code",distribution_like:"Distribution comme",distribution_name:"Distribution",hardware_desc:"Description du matériel",hostname:"Nom d'hôte",klipper_load:"Charge de Klipper",manufactured:"Fabriqué",manufacturer:"Fabricant",mcu_awake:"{mcu} Temps de fonctionnement",mcu_bandwidth:"{mcu} Bande passante",mcu_load:"{mcu} Charge",model:"Modèle de processeur",moonraker_load:"Charge de Moonraker",processor_desc:"Processeur",product_name:"Nom du produit",serial_number:"Numéro de série",system_load:"Charge du système",system_memory:"Mémoire système",system_utilization:"Utilisation du système",total_memory:"Mémoire totale",network:"Réseau",micro_controller:"Micro-contrôleur",devices:"Dispositifs",frequency:"Fréquence",memory_used:"mémoire utilisée",mcu_information:"Informations sur le {mcu}",operating_system:"Système d'exploitation",awake_time:"temps d'éveil",constants:"Constantes",last_stats:"Dernières statistiques",version:"Version",virtualization:"Virtualisation",load:"charge"},msg:{no_devices_found:"Aucun dispositif trouvé",no_devices_searched:"Utilisez le bouton d'actualisation pour rechercher des appareils",canbus_warning:`Seuls les nœuds de bus CAN non assignés peuvent être détectés.
Il est recommandé de n'avoir qu'un seul dispositif non assigné connecté au bus CAN pour éviter les problèmes de communication.
De plus amples informations peuvent être trouvées ici.`}},tool:{btn:{home_x:"X",home_y:"Y",home_all:"Tous"},tooltip:{extruder_disabled:"extrudeur désactivé, en dessous de min_extrude_temp( %{min} °C)",home_xy:"Home XY",home_z:"Home Z",absolute_positioning:"Positionnement absolu",tools:"Outils",manual_probe:"Sonde manuelle",motors_off:"Moteurs éteints",relative_positioning:"Positionnement relatif",select_tool:"Sélectionner l'outil %{tool}"},title:{bed_screws_adjust:"Ajuste les vis du lit",manual_probe:"Sonde manuelle",screws_tilt_adjust:"Vis Réglage de l'inclinaison"},label:{stats_volumetric_flow:`Extrudant à %{extrudeSpeed} mm/s, l'extrudeur doit pouvoir fournir un débit volumétrique estimé de %{estimatedVolumetricFlow} mm³/s`,stats_active_extruder:`La configuration active de l'extrudeuse est définie pour %{filamentDiameter} mm de diamètre de filament et %{nozzleDiameter} mm de buse`,stats_extruded_length:`L'extrusion de %{extrudeLength} mm de filament à %{extrudeFactor} % de débit, donnera une longueur de sortie estimée à %{estimatedExtrudedLength} mm`,stats_max_speed:`En supposant une %{layerHeight} mm de hauteur de couche, la vitesse d'impression maximale estimée est %{estimatedMaxSpeed} mm/s`}},version:{btn:{check_for_updates:"Vérifier les mises à jour",finish:"Terminer",update:"Mettre à jour",view_versions:"Voir les versions",update_all:"Tout mettre à jour"},label:{commit_history:"Historique des commits",commits_on:"commité le",committed:"Commité",dirty:"SOUILLÉ",invalid:"INVALIDE",os_packages:"Paquets du système d'exploitation",package_list:"Liste des paquets",up_to_date:"A JOUR",updates_available:"Mises à jour disponibles",old_component_version:"Vous utilisez une ancienne version de %{name} qui ne prend pas en charge toutes les fonctionnalités de Fluidd.
Mettre à jour %{name} vers au moins %{version}."},status:{finished:"Mises à jour terminées",updating:"Mise à jour ..."},title:"Mises à jour",tooltip:{commit_history:"Historique des commits",dirty:"indique un état 'detached head', pas sur 'master' ou une 'origin' invalide",invalid:"indique des changements locaux dans le répo",packages:"Paquets",release_notes:"Notes de mise à jour"}},spoolman:{msg:{error:{spool_not_existant:"Le spool que vous avez analysé n'existe pas dans la base de données.",cors:"Une erreur s'est produite lors de l'accès au flux des caméras. Veuillez vous assurer que le serveur de votre webcam autorise l'accès CORS.",no_image_data:"Une erreur s'est produite lors de l'accès au flux de la caméra. Veuillez vérifier la configuration de votre caméra ou essayer une autre source de caméra."},warning:{code_not_recognized:"Ce code ne ressemble pas à un code QR compatible.",invalid_spool_id:"L'identifiant du spool contenu dans ce code QR n'est pas valide."},not_connected:"Le serveur Spoolman n'est pas disponible.",no_spool:"Vous n'avez pas sélectionné de bobine. Êtes-vous sûr de vouloir imprimer sans suivi de filament ?",mismatched_filament:"Le matériau du filament sélectionné ne correspond pas au matériau sélectionné dans le slicer. Êtes-vous sûr de vouloir continuer ?",no_filament:"Il se peut que la bobine que vous avez sélectionnée ne contienne pas suffisamment de filament pour terminer le travail d'impression. Êtes-vous sûr de vouloir continuer ?",no_required_length:"La quantité de filament nécessaire pour imprimer le fichier sélectionné est inconnue. Souhaitez-vous continuer ?",info:{howto:"Montrez le code QR de votre bobine à la caméra. Cette fenêtre se fermera dès qu'une bobine sera détectée."},tracking_inactive:"Le suivi du filament est inactif. Pour commencer, veuillez sélectionner une bobine."},label:{first_used:"Première utilisation",change_spool:"Changer de bobine",remaining_weight:"Restant",filament_name:"Filament",location:"Localisation",comment:"Commentaire",id:"ID",lot_nr:"Lot n°",material:"Matériel",active_spool:"Bobine active",last_used:"Dernière utilisation",device_camera:"Périphérique",vendor:"Vendeur"},btn:{scan_code:"Scanner le code",select:"Sélectionner | Sélectionner pour {macro}",manage_spools:"Gérer les bobines"},title:{spoolman:"Spoolman",spool_selection:"Sélection du spool | Sélection du spool pour la macro {macro}",scan_spool:"Scanner la bobine"},setting:{auto_select_spool_on_match:"Validation automatique de la sélection de la bobine en cas de correspondance avec le code QR",show_spool_selection_dialog_on_print_start:"Afficher la boîte de dialogue de sélection de la bobine au démarrage de l'impression",auto_open_qr_camera:"Ouverture automatique de l'appareil photo pour la détection des codes QR",prefer_device_camera:"Utiliser l'appareil photo de l'appareil pour la détection des codes QR, le cas échéant",warn_on_not_enough_filament:"Afficher un avertissement lorsque la bobine sélectionnée n'a plus assez de filament pour terminer l'impression",warn_on_filament_type_mismatch:"Afficher un avertissement lorsque le type de filament de la bobine et celui sélectionné dans le slicer ne correspondent pas"}},history:{msg:{confirm_jobs:"Êtes-vous sûr ? Cette opération effacera tous les jobs.",confirm:"Êtes-vous sûr ? Cela effacera tout l'historique et les statistiques de l'imprimante",confirm_stats:"Êtes-vous sûr ? Cela effacera toutes les statistiques."}},timelapse:{setting:{park_retract_distance:"Distance de rétractation du mode Park",park_time:"Temps du mode Park",parkhead:"Parquer la tête d'impression",parkpos:{center:"Centre",front_right:"Avant Droit",back_left:"Arrière Gauche",y_only:"Mouvement de Y seulement",x_only:"Mouvement de X seulement",label:"Position du mode Park",custom:"Personnalisé",front_left:"Avant Gauche",back_right:"Arrière Droit"},mode_hyperlapse:"Hyperlapse",park_travel_speed:"Vitesse pour ce mettre en mode Park",targetlength:"Longeur cible",variable_fps_min:"Fréquence de rafraichissement minimale",park_custom_pos_x:"Position du mode Park en X",park_custom_pos_dz:"Position du Z-Hop pour le mode Park",fw_retract:"Utiliser la rétractation du micrologiciel",previewimage:"Générer une miniature",saveframes:"Sauvegardes les images",enable:"Activé",crf:"Facteur de taux constant",duplicatelastframe:"Duplication des dernières images",gcode_verbose:"GCode détaillé",park_extrude_distance:"Distance d'extrusion du mode Park",park_extrude_speed:"Vitesse d'extrusion du mode Park",mode:"Mode",mode_layermacro:"Macro de couche",hyperlapse_cycle:"Cycle Hyperlapse",output_framerate:"Fréquence de sortie",auto_render:"Rendu automatique",park_retract_speed:"Vitesse de rétraction du mode Park",park_custom_pos_y:"Position du mode Park en Y",stream_delay_compensation:"Délai de la compensation",variable_fps:"FPS variable",variable_fps_max:"Fréquence de rafraichissement maximale"},title:{timelapse_status:"Statut du timelapse",timelapse_settings:"Réglages Timelapse",render_settings:"Paramètres de rendu"},label:{frame:"Image | Images",frames:"Image %{frames} | %{frames} images",length:"Longueur estimée : %{length}"},error:{newframe:"Erreur lors de la prise d'une image timelapse"},btn:{save_frames:"Sauvegarder les prise de vues",render:"Rendu"}},sensors:{title:{sensors:"Capteurs"}},keyboard_shortcuts:{label:{tool:"Outil",actions:"Actions",cancel:"Annuler",emergency_stop:"Arrêt d'urgence",home_all:"Origine tout axe",navigation:"Navigation",open_keyboard_shortcut_help:"Ouvrir l'aide sur les raccourcis clavier",pause:"Pause",printing:"Impression"},title:{keyboard_shortcuts:"Raccourcis clavier"}},job_queue:{msg:{confirm:"Êtes-vous sûr ? Cela effacera toute la file d'attente de l'imprimante"},label:{number_of_copies:"Nombre de copies"},title:{multiply_job:"Multiplier le job | Multiplier les jobs"},tooltip:{help:"Mettez les jobs en file d'attente en faisant glisser les fichiers depuis les jobs et en les déposant ici
Réglez l'ordre des jobs en file d'attente en les faisant glisser vers le haut ou vers le bas"}},box:{btn:{uninstall:"Désinstaller",load:"Charger",unload:"Décharger"},label:{vendor:"Fournisseur",filament:"Matériau",color:"Couleur",title:"Contrôle des Matériaux"},tooltip:{control_filament:"Contrôler le chargement et le déchargement d'un seul compartiment de matériau, ainsi que la lecture des données telles que la couleur et le type de matériau."}}}};export{e as default}; diff --git a/fluidd/assets/hu-DZHz7Kx7.js b/fluidd/assets/hu-DZHz7Kx7.js new file mode 100644 index 0000000..5783cfe --- /dev/null +++ b/fluidd/assets/hu-DZHz7Kx7.js @@ -0,0 +1 @@ +var e={app:{bedmesh:{label:{active:"aktív",base:"alap",box_scale:"Doboz skála",flat_surface:"Lapos sík megjelenítése",mesh_matrix:"Hálós mátrix",probed_matrix:"Vizsgált mátrix",profile_name:"Profilnév",remove_profile:"Profil %{name} eltávolítása",scale:"Színskála",wireframe:"Drótváz"},msg:{hint:"Ha nem %{name} fájlként mented, választhatod a %{name} profil eltávolítását is",not_found:"Nem található meglévő ágyháló.",not_loaded:"Nincs háló betöltve"},tooltip:{calibrate:'Új kalibrálás kezdése, mentés "alapértelmezett" profilként',delete:"Profil törlése",load:"Profil betöltése",save:"A kalibrált profil a printer.cfg fájlba íródik",copy_image:"Ágyhálós kép másolása"}},chart:{label:{current:"Aktuális",item:"Név",power:"Kapacitás",target:"Cél",rate_of_change:"Változás"},tooltip:{help:"A nagyításhoz tartsd lenyomva a Shift billentyűt.
Kattints egy elemre a grafikonon való váltáshoz.
Kattints egy teljesítményre a grafikonon való váltáshoz."}},console:{label:{auto_scroll:"Automatikus görgetés",flip_layout:"Fordított elrendezés",hide_temp_waits:"Hőmérsékletek elrejtése"},tooltip:{help:'Írd be a "help"-et a parancsokhoz
Használd Tab az automatikus kiegészítéshez
és az előzményekhez'}},endpoint:{error:{cant_connect:"Valami elromlott, és a Fluidd nem éri el a célállomást. Biztos, hogy ez a helyes cím?",cors_error:"blokkolja a CORS szabályzata",cors_note:'Ez azt jelentheti, hogy módosítanod kell a moonraker konfigurációt. Kérjük, tekintsd meg a több nyomtató beállításával kapcsolatos dokumentációt itt'},hint:{add_printer:"Pl.: Http://fluiddpi.local"},msg:{trouble:'Problémád akadt? További információt itt találsz .'},tooltip:{endpoint_examples:"Add meg az API URL-címét.
Pár példa látható;
fluidd.local, http://192.168.1.150
"}},endstop:{label:{open:"NYITVA",triggered:"AKTIVÁLVA"},msg:{subtitle:"A frissítés gombbal frissítheted a végállás állapotát."}},file_system:{filters:{label:{print_start_time:"Nyomtatottak szűrése",hidden_files_folders:"Rejtett fájlok és mappák szűrése",klipper_backup_files:"Klipper biztonsági fájlok szűrése",moonraker_backup_files:"Moonraker biztonsági fájlok szűrése",rolled_log_files:"A gördített naplófájlok szűrése",crowsnest_backup_files:"Crowsnest biztonsági mentési fájlok szűrése"}},label:{dir_name:"Könyvtár neve",disk_usage:"Lemezhasználat",diskinfo:"Lemezinformációk",downloaded:"Letöltve",file_name:"Fájlnév",transfer_rate:"Átviteli sebesség",uploaded:"Feltöltve",view_section_documentation:"Nézd '%{section}' dokumentáció",hour:"óra",minute:"perc",second:"másodperc"},msg:{not_found:"Nincsenek fájlok",processing:"Feldolgozás"},overlay:{drag_files_folders_upload:"Feltöltéshez húzd ide a fájlokat és mappákat",drag_files_enqueue:"Húzd sorba a fájlokat"},title:{add_dir:"Könyvtár hozzáadása",add_file:"Fájl hozzáadása",command_palette:"Parancs paletta",download_file:"Fájl lekérése",duplicate_dir:"Duplikált könyvtár",duplicate_file:"Duplikált fájl",go_to_file:"Menj a fájlhoz",rename_dir:"Könyvtár átnevezése",rename_file:"Fájl átnevezése",upload_file:"Fájl feltöltése",devices:"Eszközök",check_filament:"Anyagellenőrzés"},tooltip:{low_on_space:"Kevés a lemezterület",items_count:"{count} tétel | {count} tételeket",root_disabled:"{root} nem elérhető. Kérjük, ellenőrizd a naplókat.",warning_text:"Kérjük, adjon hozzá anyagokat az anyag tárolójához, vagy csökkentse a modell által használt anyagok típusait.",tip:"Válassza ki a használandó anyagokat. A felső rész a modell által használt anyagokat mutatja, az alsó rész pedig a tárolóban lévő megfelelő anyagokat."},url:{klipper_config:"%{klipperDomain}/Config_Reference.html#%{hash}",moonraker_config:"https://moonraker.readthedocs.io/en/latest/configuration/#%{hash}",moonraker_telegram_bot_config:"https://github.com/nlef/moonraker-telegram-bot/wiki/Sample-config#%{hash}",crowsnest_config:"https://crowsnest.mainsail.xyz/configuration/%{hash}-section"}},gcode:{btn:{load_current_file:"Aktuális fájl betöltése"},label:{current_layer_height:"Aktuális rétegmagasság",exclude_object:"Objektum kizárása",follow_progress:"Folyamat követése",layer:"Réteg",layers:"Rétegek",parsed:"Elemezve",show_current_layer:"Aktuális réteg megjelenítése",show_extrusions:"Extrudálások megjelenítése",show_moves:"Mozgások megjelenítése",show_next_layer:"Következő réteg megjelenítése",show_parts:"Részek mutatása",show_previous_layer:"Előző réteg megjelenítése",show_retractions:"Visszahúzások megjelenítése",parsing_file:"Fájl elemzése"},msg:{confirm:'A fájl "%{filename}" mérete %{size}, megterhelheti a rendszert. Biztos, hogy folytatod?'},overlay:{drag_file_load:"Húzz ide egy G-Kód fájlt a betöltéshez"}},general:{btn:{abort:"Elvet",accept:"Elfogad",add:"Hozzáad",add_dir:"Könyvtár hozzáadása",add_file:"Fájl hozzáadása",add_printer:"Nyomtató hozzáadása",add_to_queue:"Hozzáadás sorhoz",adjust_layout:"Műszerfal elrendezésének beállítása",adjusted:"Beállított",all:"Összes",auth_unsure:"Nem tudod, miért látod ezt?",calibrate:"Kalibrálás",cancel:"Mégsem",clear_profile:"Profil tisztítása",close:"Bezárás",config_reference:"Konfigurációs hivatkozás",create_zip_archive:"ZIP archívum létrehozása",delete:"Töröl",download:"Letöltés",duplicate:"Duplikált",edit:"Szerkesztés",exit_layout:"Elrendezési mód bezárása",extrude:"Extrudálás",filter:"Szűrő",forgot_password:"Elfelejtetted a jelszavad?",go_to_file:"Menj a fájlhoz",heaters_off:"Fűtőtestek Ki",job_queue:"Feladatsor",load_all:"Minden betöltése",login:"Belépés",logout:"Kijelentkezés",more_information:"Bővebb információ",multiply:"Többszöröz",pause:"Szünet",preheat:"Előfűtés",presets:"Előbeállítások",preview_gcode:"G-Kód előnézet",print:"Nyomtatás",quad_gantry_level:"QGL",reboot:"Újraindítás",recover:"Visszaállítás",refresh:"Frissítés",refresh_metadata:"Metaadat frissítése",reload:"Újratöltés",remove:"Eltávolítás",remove_all:"Összes eltávolítása",rename:"Átnevezés",reprint:"Újranyomtatás",reset_file:"Fájl törlése",reset_layout:"Elrendezés visszaállítása",reset_default_layout:"Alapértelmezett elrendezés visszaállítása",restart_firmware:"Firmware újraindítása",restart_service:"Újraindítás %{service}",restart_service_klipper:"Klipper újraindítása",restart_service_moonraker:"Moonraker újraindítása",resume:"Folytatás",retract:"Visszahúzás",retry:"Próbáld újra",return_dashboard:"Vissza a műszerfalra",save:"Mentés",save_as:"Mentés másként",save_restart:"Mentés & Újraindítás",save_config_and_restart:"Konfiguráció mentése és újraindítás",select_columns:"Oszlopok kijelölése",send:"Küldés",set_color:"Szín beállítása",set_default_layout:"Beállítás alapértelmezett elrendezésként",shutdown:"Leállítás",snooze:"Szundi",socket_reconnect:"Újracsatlakozás",socket_refresh:"Frissítés kényszerítése",thumbnail_size:"Miniatűr méret",upload:"Feltöltés",upload_files:"Fájlok feltöltése",upload_folder:"Mappa feltöltése",upload_print:"Feltöltés & Nyomtatás",view:"Nézet",reset_stats:"Statisztikák törlése",copied:"Másolva",copy:"Másolás"},error:{app_setup_link:'A Fluidd telepítési követelményeit itt találod.',app_warnings_found:"%{appName} figyelmeztetés található.",components_config:'A Moonraker plugin konfigurációja itt található.',failed_components:"A Moonraker moduljai hibásak. Kérlek, ellenőrizd a naplókat, frissítsd a konfigurációt és indítsd újra a Moonrakert."},label:{accel_to_decel:"Gyorsítás-Lassítás",acceleration:"Gyorsulás",accepted_screws:"Elfogadott csavarok",actual_time:"Aktuális",add_camera:"Kamera hozzáadása",add_filter:"Szűrő hozzáadása",add_preset:"Előbeállítás hozzáadása",add_user:"Felhasználó hozzáadása",all:"Mind",api_key:"Api kulcs",api_url:"API URL",auth_source:"Hitelesítési forrás",bars:"Bárok",category:"Kategória",change_password:"Jelszóváltás",clear_all:"Mindent kitöröl",color:"Szín",command:"Parancs",confirm:"Megerősít",cross:"Kereszt",circle:"Kör",current_password:"Aktuális jelszó",current_user:"Jelenlegi felhasználó",default:"Alapértelmezett",disabled_while_printing:"Nyomtatáskor letiltva",edit_camera:"Kamera szerkesztése",edit_filter:"Szűrő szerkesztése",edit_preset:"Előbeállítás szerkesztése",edit_user:"Felhasználó szerkesztése",extrude_length:"Extrudálás hossza",extrude_speed:"Extrudálás sebessége",filament:"Szál",file:"Fájl",finish_time:"Befejezés",flow:"Átfolyás",free:"szabad",heaters_busy:"A nyomtató jelenleg foglalt. A fűtőtestek kikapcsolása sikertelen nyomtatást eredményezhet.",high:"Magas",host:"Gazdagép",layer:"Réteg",layout:"Elrendezés",ldap:"LDAP",longest_job:"Leghosszabb munka",low:"Alacsony",manage_accounts:"Fiókok kezelése",minimum_cruise_ratio:"Minimális haladási arány",user_managed_source:"%{source} hitelesítéssel kezelt felhasználó",m117:"M117",moonraker:"Moonraker",name:"Név",new_password:"Új jelszó",no_notifications:"Nincs értesítés",on:"Be",off:"Ki",numeric_prefix_sort:"Numerikus előtag rendezése",password:"Jelszó",partial_of_total:"%{partial} - %{total}",pause_at_layer:"Szünet a rétegnél",pause_at_next_layer:"Szünet a következő rétegnél",pause_at_layer_number:"Szünet a rétegszámnál",power:"Áramellátás",pressure_advance:"Nyomás előtolás",printers:"Nyomtatók",progress:"Folyamat",range:"Hatótávolság",requested_speed:"Sebesség",retract_length:"Visszahúzási hossz",retract_speed:"Visszahúzási sebesség",save_as:"Mentés másként",screw_index:"Csavar index",screw_name:"Csavar neve",screw_number:"Csavar %{index}",services:"Szolgáltatások",slicer:"Szeletelő",smooth_time:"Simítási idő",speed:"Sebesség",sqv:"Négyzet saroksebesség",stepper_enabled:"Léptető engedélyezve",synced_extruder:"Szinkronizált extruder",thumbnail_size:"Miniatűr mérete",total:"Eltelt",total_filament:"Összes felhasznált szál",total_filament_avg:"Átl. nyomtatásonként",total_jobs:"Összes nyomtatási feladat",total_print_time:"Teljes nyomtatási idő",total_print_time_avg:"Átl. nyomtatásonként",total_time:"Teljes idő",total_time_avg:"Átl. nyomtatásonként",turn_device_on:"Kapcsolja be %{device}",turn_device_off:"Kapcsolja ki %{device}",uncategorized:"Nem kategorizált",unretract_extra_length:"Extra hossz visszahúzása",unretract_speed:"Visszahúzási sebesség",upload_and_print:"Feltöltés és nyomtatás",used:"használt",username:"Felhasználónév",velocity:"Sebesség",version_sort:"Verzió rendezés",visible:"Látható",z_offset:"Z Eltolás",unsaved_changes:"Nem mentett változások",alias:"Álnév",apply_z_offset:"Z-eltolás alkalmazása és mentése",edit_category:"Kategória szerkesztése",add_category:"Kategória hozzáadása",file_time:"Fájl",unknown:"Ismeretlen",compact:"Kompakt",stepper_driver:"%{name} Meghajtó"},msg:{password_changed:"A jelszó megváltozott",wrong_password:"Hoppá! Valami rosszul sült el. Ez a jelszavad?",bed_screws_adjust:"Kattints a Adjusted ha jelentős csavar módosításra van szükség ellenkező esetben kattints a Accept gombra a folytatáshoz.",welcome_back:"Üdv újra.
Jelentkezz be alább, hogy kapcsolatban maradj a nyomtatóddal.",offline_ready:"Fluidd készen áll az offline munkavégzésre.",needs_refresh:"Új tartalom érhető el, frissítéshez kattints az Újratöltés gombra.",pending_configuration_sections_deleted:"A következő szakaszok törlésre vannak jelölve",rolledover_logs:"A következő alkalmazási naplók átkerültek: %{applications}",fluidd_settings_backup_failed:"Nem sikerült a Fluidd beállítások mentése!",fluidd_settings_restore_failed:"Nem sikerült visszaállítani a Fluidd beállításokat!",not_valid_fluidd_backup_file:"Nem érvényes Fluidd visszaállító fájl!"},simple_form:{error:{arrayofnums:"Csak számok",credentials:"Érvénytelen hitelesítő adatok",exists:"Már létezik",invalid_number:"Érvénytelen szám",invalid_url:"Érvénytelen URL",invalid_expression:"Érvénytelen kifejezés",max:"Max %{max}",min:"Min %{min}",min_or_0:"Min %{min} vagy 0",password_username:"Nem egyezik a felhasználónév",required:"Ajánlott",invalid_aspect:"Érvénytelen képarány"},msg:{confirm:"Biztos vagy benne?",confirm_delete:"Biztos vagy benne? Törlöd a kiválasztott elemet. | Biztos vagy benne? Törölsz {count} elemet.",confirm_exclude_object:"Biztosan kizárod ezt az objektumot a nyomtatásból?",confirm_forcemove_toggle:"Biztos vagy benne? Ez károsíthatja a nyomtatót.",confirm_reboot_host:"Biztos vagy benne? Ez újraindítja a gazdagépet.",confirm_shutdown_host:"Biztos vagy benne? Ez leállítja a gazdagépet.",confirm_service_start:"Biztos elindítod a %{name} szolgáltatást?",confirm_service_restart:"Biztos, hogy újraindítod a %{name} szolgáltatást?",confirm_service_stop:"Biztos, hogy leállítod a %{name} szolgáltatást?",confirm_power_device_toggle:"Biztos vagy benne? Ez átkapcsolja az eszköz teljesítményét.",unsaved_changes:"Nem mentett módosításaid vannak. Biztosan bezárod ezt a fájlt?",no_file_preview:"%{name} jelenleg nem tekinthető meg.",confirm_remove_user:"Biztosan eltávolítod a felhasználót %{username}?",confirm_cancel_print:"Biztosan megszakítod az aktuális nyomtatást?",confirm_emergency_stop:"Biztos, hogy a vészhelyzeti kapcsolóval állítod le a nyomtatót?",confirm_clear_mesh:"A nyomtató jelenleg foglalt. Biztos, hogy tisztázni akarod az ágyhálót?",confirm_load_bedmesh_profile:"A nyomtató jelenleg foglalt. Biztosan betöltöd a %{name} profilt?"}},table:{header:{actions:"Tevékenységek",chamber_temp:"Kamra hőmérséklet",end_time:"Befejezve",estimated_time:"Becsült idő",filament:"Nyomtatószál",filament_name:"Nyomtatószál neve",filament_type:"Nyomtatószál típusa",filament_used:"Használt nyomtatószál",filament_weight_total:"Nyomtatószál súlya",first_layer_bed_temp:"Első réteg ágy hőmérséklet",first_layer_extr_temp:"Első réteg extruder hőmérséklet",first_layer_height:"Első réteg magassága",height:"Magasság",last_printed:"Utoljára nyomtatott",layer_height:"Rétegmagasság",modified:"Módosított",name:"Név",nozzle_diameter:"Fúvóka átmérő",print_duration:"Nyomtatás időtartama",time_added:"Hozzáadott idő",time_in_queue:"Idő a sorban",size:"Méret",slicer:"Szeletelő",slicer_version:"Szeletelő verziója",start_time:"Elindult",status:"Állapot",total_duration:"Teljes időtartam"}},title:{add_chart:"Ábra hozzáadása",add_printer:"Nyomtató hozzáadása",bedmesh:"Ágyháló",bedmesh_controls:"Ágyhálós vezérlők",camera:"Kamera",config_files:"Konfigurációs fájlok",configure:"Konfiguráció",console:"Konzol",diagnostics:"Diagnosztika",edit_chart:"Ábra szerkesztése",endstops:"Végállások",fans_outputs:"Ventilátorok & Kimenetek",gcode_preview:"G-Kód előnézet",history:"Történet",home:"Kezdőlap",jobs:"Feladatok",job_queue:"Feladatsor",limits:"Nyomtató határai",macros:"Makrók",metrics_explorer:"Felderítő mérés",not_found:"404 Nem található",other_files:"Egyéb fájlok",pending_configuration_changes:"Függőben lévő konfigurációs változások",retract:"Szoftveres visszahúzás",rollover_logs:"Forgó naplók",runout_sensors:"Kifutás érzékelők",settings:"Beállítások",stats:"Nyomtató statisztikák",system:"Rendszer",system_overview:"Rendszerinformáció",temperature:"Hőmérsékletek",timelapse:"Timelapse",tool:"Eszköz",tune:"Hangolás"},tooltip:{browse_metrics:"A böngészőben elérhető mutatók",estop:"VészSTOP",managed_by_moonraker:"A moonraker konfigurációja által kezelt",notifications:"Értesítések",reload_klipper:"Újratölti a klipper konfigurációját.",reload_restart_klipper:"Újratölti a klipper konfigurációját és újraindítja az MCU-kat.",restart_klipper:"Újraindítja a klipper rendszerszolgáltatást.",run_collector:"Gyűjtő futtatása",rollover_logs:"Forgó naplók",file_browser_help:'Húzd át a fájlokat vagy mappákat a böngészőn kívülről, hogy ide töltsd fel őket
Fájlok és mappák áthelyezése almappákba vagy almappákba húzással ".."',file_browser_configuration_help:"Másold át a fájlokat és mappákat a konfigurációs fájlokba úgy, hogy innen húzd át őket, majd dobd oda"}},history:{msg:{confirm:"Biztos vagy benne? Törlöd az összes előzményt és a nyomtatóstatisztikát",confirm_jobs:"Biztos vagy benne? Ez az összes munkát törli.",confirm_stats:"Biztos vagy benne? Ez az összes statisztikát törli."}},job_queue:{msg:{confirm:"Biztos vagy benne? Törlöd a teljes nyomtatósort"},label:{number_of_copies:"Másolatok száma"},title:{multiply_job:"Munka szorzása | Munkák szorzása"},tooltip:{help:"Feladatok sorba rendezése úgy, hogy áthúzod a fájlokat a Feladatok közül, és ide dobod
Módosítsd a sorban álló feladatok sorrendjét felfelé vagy lefelé húzással"}},printer:{state:{busy:"Elfoglalt",cancelled:"Törölt",complete:"Kész",idle:"Tétlen",loading:"Betöltés",paused:"Szüneteltetve",printing:"Nyomtatás",ready:"Kész",standby:"Készenlét"},title:{printer_status:"Nyomtató állapota",stepper_driver_overheating:"A '%{name}' léptetőmotor meghajtó túlmelegedett"},msg:{possible_print_failure:"Ez sikertelen nyomtatáshoz vezethet"},url:{stepper_driver_overheating:"%{klipperDomain}/TMC_Drivers.html#tmc-reports-error-ot1overtemperror"}},setting:{btn:{add_camera:"Kamera hozzáadása",add_category:"Kategória Hozzáadása",add_filter:"Szűrő hozzáadása",add_metric:"Metrika hozzáadása",add_thermal_preset:"Előbeállítás hozzáadása",add_user:"Felhasználó hozzáadása",reset:"Frissítés",select_theme:"Válassz témát",backup:"Biztonsági mentés",restore:"Visszaállítás"},camera_type_options:{mjpegadaptive:"MJPEG Adaptív",mjpegstream:"MJPEG Sugárzás",hlsstream:"HLS Sugárzás",webrtc_camera_streamer:"WebRTC (kamera-sugárzása)",video:"IP Kamera",iframe:"HTTP oldal",webrtc_go2rtc:"WebRTC (go2rtc)",webrtc_mediamtx:"WebRTC (MediaMTX)"},camera_rotate_options:{90:"90°",180:"180°",270:"270°",none:"Nincs"},label:{all_off:"Minden kikapcsolva",all_on:"Minden bekapcsolva",aspect_ratio:"Képarány",aspect_ratio_format:"[szélesség : magasság]",auto_edit_extensions:"Szerkesztési módban automatikusan megnyíló bővítmények",auto_follow_on_file_load:"Automatikusan követi a fájlbetöltés folyamatát",auto_load_on_print_start:"Fájl automatikus betöltése a nyomtatás indításakor",auto_load_mobile_on_print_start:"Fájlok automatikus betöltése mobileszközökön",axes:"Tengelyek",camera_flip_x:"Vízszintes forgatás",camera_flip_y:"Függőleges forgatás",camera_fullscreen_action:{title:"Teljes képernyős művelet",embed:"Beágyaz",rawstream:"Nyers adás"},camera_rotate_by:"Forgatás szerint",camera_stream_type:"Sugárzás típusa",camera_url_snapshot:"Kamera pillanatkép URL",camera_url_stream:"Kamera közvetítés URL",card:"Kártya",collector:"Kollektor",confirm_on_estop:"Megerősítés kérése vészleállításkor",confirm_on_power_device_change:"Megerősítés kérése kikapcsoláskor",confirm_on_save_config_and_restart:"Mentés és újraindítás előtt tekintsd át a függőben lévő konfigurációs módosításokat",confirm_dirty_editor_close:"Megerősítés kérése, ha módosítások mentése nélkül zárod be a szerkesztőt",contains:"Tartalom",dark_mode:"Sötét mód",dashed:"Szaggatott",default_extrude_length:"Alapértelmezett extrudálási hossz",default_extrude_speed:"Alapértelmezett extrudálási sebesség",default_min_layer_height:"Alapértelmezett minimális rétegmagasság",default_toolhead_move_length:"Alapértelmezett nyomtatófej mozgási hossza",default_toolhead_xy_speed:"Alapértelmezett (XY) nyomtatófej sebesség",default_toolhead_z_speed:"Alapértelmezett (Z) nyomtatófej sebesség",dotted:"Pöttyös",draw_background:"Háttér rajzolása",draw_origin:"Rajzolj eredetet",enable:"Engedélyez",enable_diagnostics:"Diagnosztika engedélyezése",enable_notifications:"Értesítések engedélyezése",enable_xy_homing:"Az (XY) kezdőpont engedélyezése",expression:"Kifejezés",extrusion_line_width:"Extrudálási vonal szélessége",flip_horizontal:"Vízszintes forgatás",flip_vertical:"Függőleges forgatás",fill_color:"Kitöltés színe",fill_opacity:"Kitöltés átlátszósága",filter:"Szűrő",fps_target:"FPS Cél",fps_idle_target:"FPS Cél, ha nincs fókuszban",height:"Magasság",hide_single_part_bounding_box:"Alkatrészhatároló doboz elrejtése egyetlen tárgy nyomtatásakor",gcode_coords:"G-Kód koordináták használata",icon:"Ikon",invert_x_control:"Fordított (X) vezérlés",invert_y_control:"Fordított (Y) vezérlés",invert_z_control:"Fordított (Z) vezérlés",language:"Megjelenítés nyelve",last_result:"Utolsó eredmény",left_y:"Bal Y-tengely",line_color:"Vonal színe",line_style:"Vonal stílusa",min:"Minimum",max:"Maximum",metrics:"Metrikus",move_line_width:"Vonalszélesség mozgatása",name:"Név",never:"Soha",none:"Egyik sem",optional:"Opcionális",power_toggle_in_top_nav:"Bekapcsológomb a felső navigációban",primary_color:"Elsődleges szín",printer_name:"Nyomtató neve",reset:"Beállítások visszaállítása",retraction_icon_size:"Visszahúzási ikon mérete",right_y:"Jobb Y-tengely",save_and_restore_view_state:"A nézet állapot mentése és visszaállítása",sections_to_ignore_pending_configuration_changes:"Szakasz a függőben lévő konfigurációs változások figyelmen kívül hagyásához",show_animations:"Animációk megjelenítése",show_barometric_pressure:"Barometrikus nyomás mutatása",show_chart:"Diagram megjelenítése",show_code_lens:"CodeLens megjelenítése",show_gas_resistance:"Gázellenállás mutatása",show_legend:"Legenda mutatása",show_logo_on_background:"Logó megjelenítése a háttérben",show_rate_of_change:"A hőmérséklet változásának mértéke",show_relative_humidity:"Relatív páratartalom mutatása",show_save_config_and_restart:"Konfiguráció mentése, újraindítás gomb a felső navigációban",show_upload_and_print:"A Feltöltés és Nyomtatás gomb megjelenítése a felső navigációban",solid:"Szilárd",starts_with:"Ezzel kezdődik",theme_preset:"Előre beállított téma",thermal_preset_gcode:"G-Kód",thermal_preset_name:"Előre beállított név",title:"Cím",to_browser_local_storage:"A böngésző helyi tárolója",to_browser_session_storage:"A böngésző munkamenet tárolása",toolhead_control_style:"Nyomtatófej vezérlési stílus",toolhead_move_distances:"Nyomtatófej távolsági értékek",toolhead_xy_move_distances:"Nyomtatófej XY távolságértékei",toolhead_z_move_distances:"Nyomtatófej Z távolságértékei",type:"Típus",unit:"Egység",z_adjust_values:"A (Z) értékek beállítása",date_format:"Dátum formátum",time_format:"Idő formátum",text_sort_order:"Szövegrendezési sorrend",force_move_toggle_warning:"A FORCE_MOVE aktiválásakor megerősítés szükséges",show_manual_probe_dialog_automatically:"Kézi szonda párbeszédpanel automatikus megjelenítése",show_bed_screws_adjust_dialog_automatically:"Ágycsavarok beállítása párbeszédpanel automatikus megjelenítése",show_screws_tilt_adjust_dialog_automatically:"Ágycsavarok dőlésszögének beállítása párbeszédpanel automatikus megjelenítése",print_progress_calculation:"Nyomtatási folyamat számítás",print_eta_calculation:"Nyomtatás ETA számítása",print_in_progress_layout:"Nyomtatási folyamat elrendezés",keyboard_shortcuts:"Billentyűparancsok",fluidd_settings_in_moonraker_db:"Fluidd beállítások a Moonraker adatbázisban"},timer_options:{duration:"Csak időtartam",filament:"Nyomtatószál",file:"Fájl",slicer:"Szeletelő",slicer_m73:"Szeletelő (M73)",absolute_file_position:"Abszolút fájlpozíció",relative_file_position:"Relatív fájlpozíció"},title:{authentication:"Hitelesítés",console:"Konzol",camera:"Kamera",file_browser:"Fájlböngésző",file_editor:"Fájlszerkesztő",gcode_preview:"G-Kód előnézet",general:"Általános",macros:"Makrók",theme:"Téma",thermal_presets:"Hőmérsékleti előbeállítások",tool:"Eszköz"},tooltip:{diagnostics_performance:"A diagnosztikai információk naplózása hatással lehet a teljesítményre",gcode_coords:"G-Kód pozíció használata a nyomtatófej pozíciója helyett a műszerfalon",show_manual_probe_dialog_automatically:"Automatikusan megjeleníti a segítő párbeszédpanelt, ha kézi szintezőeszközt futtatsz",show_bed_screws_adjust_dialog_automatically:"Automatikusan megjeleníti a segítő párbeszédpanelt, ha a BED_SCREWS_ADJUST eszközt futtatod",show_screws_tilt_adjust_dialog_automatically:"Automatikusan megjeleníti a segítő párbeszédpanelt, ha a SCREWS_TILT_CALCULATE eszközt futtatod",theme_disclaimer:"Ezek a témák márkaneveket és logókat tartalmaznak, amelyek a megfelelő tulajdonosok szellemi tulajdonát képezik.
Ezen nevek és logók feltüntetése a márkák engedélyével történik.
Felhívjuk azonban figyelmed, hogy ezeket a témákat hivatalosan nem a megfelelő márkák tartják karban.
A témákkal kapcsolatos bármilyen kérdéssel vagy kéréssel a Fluidd csapatához kell fordulni.
A márkanevek és logók használata kizárólag dekoratív és esztétikai célokat szolgál, és nem jelenti azt, hogy a márkák hivatalos kapcsolatban állnak vagy támogatmak minket.",average_calculation:"Ha egynél több lehetőség van kiválasztva, a rendszer átlagot számít ki",keyboard_shortcuts:"[BETA] Engedélyezd és nyomd meg a '?' gombot az elérhető billentyűparancsok listájának megtekintéséhez"}},socket:{msg:{connecting:"Csatlakozás a Moonraker-hez...",no_connection:"Nincs Moonraker kapcsolat. Kérjük, ellenőrizd a Moonraker állapotát és/vagy frissítsd."}},system_info:{label:{awake_time:"Ébrenléti idő",capacity:"Kapacitás",cpu_desc:"CPU leírása",distribution_codename:"Kódnév",distribution_like:"Alap disztribúció",distribution_name:"Disztribúció",frequency:"Frekvencia",hardware_desc:"Hardver leírás",hostname:"Gazdanév",klipper_load:"Klipper Terheltsége",load:"Töltés",manufactured:"Gyártva",manufacturer:"Gyártó",memory_used:"Memóriahasználat",mcu_awake:"{mcu} Ébredés ideje",mcu_bandwidth:"{mcu} Sávszélesség",mcu_information:"{mcu} Információ",mcu_load:"{mcu} Terheltsége",micro_controller:"Mikrovezérlő",model:"CPU Modell",moonraker_load:"Moonraker Terheltsége",network:"Hálózat",processor_desc:"Processzor",product_name:"Termék név",serial_number:"Sorozatszám",system_load:"Rendszer Terheltsége",system_memory:"Rendszermemória",system_utilization:"Rendszerhasználat",total_memory:"Teljes memória",operating_system:"Operációs rendszer",version:"Változat",virtualization:"Virtualizáció",constants:"Állandók",devices:"Eszközök",last_stats:"Utolsó statisztika"},msg:{no_devices_found:"Nem találhatóak eszközök",no_devices_searched:"Eszközök kereséséhez használd a frissítés gombot",canbus_warning:'Csak a hozzá nem rendelt CAN-busz-csomópontok észlelhetők.
Javasoljuk, hogy a kommunikációs problémák elkerülése érdekében csak egy hozzá nem rendelt eszközt csatlakoztass a CAN-buszhoz.
További információk: itt.'}},tool:{btn:{home_x:"X",home_y:"Y",home_all:"Mind"},title:{bed_screws_adjust:"Ágycsavarok beállítása",manual_probe:"Kézi szonda",screws_tilt_adjust:"Csavarok dőlésszög beállítása"},tooltip:{absolute_positioning:"Abszolút pozicionálás",extruder_disabled:"extruder letiltva, min_extrude_temp (%{min}°C) alatt van",home_xy:"XY kezdőpont",home_z:"Z kezdőpont",manual_probe:"Kézi szonda",motors_off:"Motorok Ki",relative_positioning:"Relatív pozicionálás",select_tool:"Eszköz kiválasztása %{tool}",tools:"Szerszámok"},label:{stats_active_extruder:'Az aktív extruder konfigurációja be van állítva %{filamentDiameter} mm átmérőjű filament és %{nozzleDiameter} mm fúvóka',stats_volumetric_flow:'Extrudálás: %{extrudeSpeed} mm/s, az extrudernek biztosítania kell at becsült térfogatáram %{estimatedVolumetricFlow} mm³/s',stats_extruded_length:'A filament extrudálása %{extrudeLength} mm-nél %{extrudeFactor} % folyamot, biztosít egy-t becsült kimeneti hosszon %{estimatedExtrudedLength} mm',stats_max_speed:'Feltéve, hogy a %{layerHeight} mm réteg magassága, a becsült maximális nyomtatási sebesség %{estimatedMaxSpeed} mm/s'}},version:{btn:{check_for_updates:"Frissítések keresése",finish:"Befejezve",update:"Frissítés",update_all:"Összes frissítése",view_versions:"Verziók megtekintése"},label:{commit_history:"Történet rögzítése",commits_on:"vállalja",committed:"Elkötelezett",dirty:"PISZKOS",invalid:"ÉRVÉNYTELEN",os_packages:"OS csomagok",package_list:"Csomaglista",up_to_date:"NAPRAKÉSZ",updates_available:"Frissítések állnak rendelkezésre",old_component_version:"A(z) %{name} régi verzióját használod, amely nem támogatja a Fluidd összes funkcióját.
Frissítsd a(z) %{name} terméket legalább %{version} értékre."},status:{finished:"A frissítések befejeződtek",updating:"Frissítés..."},title:"Szoftverfrissítések",tooltip:{commit_history:"Előzmények rögzítése",dirty:"leválasztott fejet jelez, nem elsődleges vagy érvénytelen eredetű",invalid:"a repo helyi változásait jelzi",packages:"Csomagok",release_notes:"Kiadási jegyzetek"}},timelapse:{btn:{render:"Renderelés",save_frames:"Képkockák mentése"},error:{newframe:"Hiba a timelapse képkocka felvételekor"},label:{frames:"%{frames} képkocka | %{frames} képkockák",length:"Becsült hossz: %{length}",frame:"Képkocka | Képkockák"},title:{timelapse_settings:"Timelapse beállítások",timelapse_status:"Timelapse állapot",render_settings:"Renderelési beállítások"},setting:{enable:"Engedélyezve",auto_render:"Automatikus renderelés",crf:"Állandó árfolyamtényező",duplicatelastframe:"Utolsó képkockák duplikálása",fw_retract:"Firmware visszahúzás használata",gcode_verbose:"Szöveges G-Kód",mode:"Mód",mode_layermacro:"Réteg makró",mode_hyperlapse:"Hyperlapse",hyperlapse_cycle:"Hyperlapse ciklus",output_framerate:"Kimeneti képkockaszám",park_retract_distance:"Parkolás visszahúzási távolság",park_retract_speed:"Parkolás visszahúzási sebesség",park_extrude_distance:"Parkolás extrudálási távolság",park_extrude_speed:"Parkolás extrudálás sebesség",parkhead:"Parkoló fej",park_time:"Parkolási idő",park_travel_speed:"Parkolás utazási sebesség",park_custom_pos_x:"Parkolási pozíció X",park_custom_pos_y:"Parkolási pozíció Y",park_custom_pos_dz:"Parkolási pozíció Z-ugrás",parkpos:{label:"Parkolási pozíció",custom:"Egyedi",front_left:"Elöl balra",front_right:"Elöl jobbra",center:"Központ",back_left:"Hátul balra",back_right:"Hátul jobbra",x_only:"X mozgatása",y_only:"Y mozgatása"},previewimage:"Miniatűr generálása",saveframes:"Képkockák mentése",stream_delay_compensation:"Késleltetés kompenzáció",targetlength:"Cél hossza",variable_fps:"Változó FPS",variable_fps_min:"Minimális képkockaszám",variable_fps_max:"Maximális képkockaszám"}},spoolman:{btn:{manage_spools:"Orsók kezelése",scan_code:"Kód beolvasása",select:"Válaszd | Válaszd ki: {macro}"},title:{spoolman:"Orsómester",spool_selection:"Tekercs kiválasztása | Tekercs kiválasztása a makróhoz {macro}",scan_spool:"Orsó beolvasása"},label:{change_spool:"Orsó cseréje",comment:"Megjegyzés",device_camera:"Eszköz",filament_name:"Nyomtatószál",first_used:"Először használt",id:"ID",last_used:"Utoljára használt",location:"Helyszín",lot_nr:"Lot Nr",material:"Anyag",remaining_weight:"Maradék",vendor:"Forgalmazó",active_spool:"Aktív tekercs",length:"Hossz",weight:"Súly"},msg:{no_spool:"Nem választottál ki orsót. Biztos, hogy szálkövetés nélkül szeretnél nyomtatni?",no_filament:"Lehet, hogy a kiválasztott orsón nem maradt elég szál ahhoz, hogy a nyomtatási feladat sikeresen befejeződjön. Biztos, hogy folytatni akarod?",no_required_length:"A kiválasztott fájl nyomtatásához szükséges szálmennyiség ismeretlen. Szeretnéd folytatni?",mismatched_filament:"A kiválasztott szál anyaga nem egyezik a szeletelőben kiválasztott anyaggal. Biztos, hogy folytatni akarod?",tracking_inactive:"A szálkövetés inaktív. A kezdéshez kérjük, válassz egy orsót.",not_connected:"Spoolman szerver nem elérhető.",info:{howto:"Mutasd meg az orsó QR-kódját a kamerának. Ez az ablak bezáródik, amint egy orsót észlel."},warning:{code_not_recognized:"Ez a kód nem tűnik kompatibilis QR-kódnak.",invalid_spool_id:"A QR-kódban szereplő orsóazonosító ID érvénytelen."},error:{cors:"Hiba történt a kamerákhoz való hozzáférésnél. Kérjük, győződj meg, hogy a webkamszerver engedélyezi a CORS-hozzáférést.",spool_not_existant:"A beolvasott orsó nem létezik az adatbázisban.",no_image_data:"Hiba történt a kamerákhoz való hozzáférésnél. Kérjük, ellenőrizd a kamera konfigurációját, vagy próbálkozz másik kameraforrással."}},setting:{auto_open_qr_camera:"Automatikusan megnyitja a kamerát a QR-kód beolvasásához",auto_select_spool_on_match:"Automatikusan rögzíti az orsókiválasztást QR-kód egyezés esetén",prefer_device_camera:"A készülék kamerájának használata a QR-kódok felismeréséhez, ha van ilyen",show_spool_selection_dialog_on_print_start:"Orsókiválasztó párbeszédpanel megjelenítése nyomtatás indításakor",warn_on_not_enough_filament:"Figyelmeztetés megjelenítése, ha a kiválasztott tekercsen nincs elég szál a nyomtatás befejezéséhez",warn_on_filament_type_mismatch:"Figyelmeztetés megjelenítése, ha a tekercsen lévő szál típusa és a szeletelőben kiválasztott szál típusa nem egyezik",remaining_filament_unit:"Mutasd a maradék nyomtatószálat"}},sensors:{title:{sensors:"Érzékelők"}},keyboard_shortcuts:{title:{keyboard_shortcuts:"Billentyűparancsok"},label:{actions:"Tevékenységek",cancel:"Mégsem",emergency_stop:"Vész STOP",home_all:"Kezdőpont X-Y-Z",navigation:"Navigáció",open_keyboard_shortcut_help:"Billentyűparancsok súgójának megnyitása",pause:"Szünet",printing:"Nyomtatás",tool:"Szerszám"}},box:{btn:{uninstall:"Eltávolítás",load:"Betöltés",unload:"Kivétel"},label:{vendor:"Szállító",filament:"Anyag",color:"Szín",title:"Anyagkezelés"},tooltip:{control_filament:"Egyetlen anyagcsatorna betöltésének és kivételének vezérlése, valamint az anyag színének és típusának olvasása."}}}};export{e as default}; diff --git a/fluidd/assets/index-4UonB8GV.js b/fluidd/assets/index-4UonB8GV.js new file mode 100644 index 0000000..a38cfaf --- /dev/null +++ b/fluidd/assets/index-4UonB8GV.js @@ -0,0 +1,274 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./setupMonaco-CF2GrFdn.js","./setupMonaco-qJs8Ougx.css"])))=>i.map(i=>d[i]); +var XP=Object.defineProperty;var QP=(r,e,t)=>e in r?XP(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var f=(r,e,t)=>QP(r,typeof e!="symbol"?e+"":e,t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))s(n);new MutationObserver(n=>{for(const i of n)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&s(a)}).observe(document,{childList:!0,subtree:!0});function t(n){const i={};return n.integrity&&(i.integrity=n.integrity),n.referrerPolicy&&(i.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?i.credentials="include":n.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(n){if(n.ep)return;n.ep=!0;const i=t(n);fetch(n.href,i)}})();const JP="modulepreload",eL=function(r,e){return new URL(r,e).href},q2={},Ye=function(e,t,s){let n=Promise.resolve();if(t&&t.length>0){const i=document.getElementsByTagName("link"),a=document.querySelector("meta[property=csp-nonce]"),o=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));n=Promise.all(t.map(l=>{if(l=eL(l,s),l in q2)return;q2[l]=!0;const c=l.endsWith(".css"),u=c?'[rel="stylesheet"]':"";if(!!s)for(let h=i.length-1;h>=0;h--){const m=i[h];if(m.href===l&&(!c||m.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${l}"]${u}`))return;const p=document.createElement("link");if(p.rel=c?"stylesheet":JP,c||(p.as="script",p.crossOrigin=""),p.href=l,o&&p.setAttribute("nonce",o),document.head.appendChild(p),c)return new Promise((h,m)=>{p.addEventListener("load",h),p.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${l}`)))})}))}return n.then(()=>e()).catch(i=>{const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=i,window.dispatchEvent(a),!a.defaultPrevented)throw i})};var tL={};/*! + * Vue.js v2.7.16 + * (c) 2014-2023 Evan You + * Released under the MIT License. + */var mr=Object.freeze({}),ze=Array.isArray;function Be(r){return r==null}function z(r){return r!=null}function Ct(r){return r===!0}function rL(r){return r===!1}function Qu(r){return typeof r=="string"||typeof r=="number"||typeof r=="symbol"||typeof r=="boolean"}function ot(r){return typeof r=="function"}function yr(r){return r!==null&&typeof r=="object"}var ay=Object.prototype.toString;function Lr(r){return ay.call(r)==="[object Object]"}function sL(r){return ay.call(r)==="[object RegExp]"}function Ix(r){var e=parseFloat(String(r));return e>=0&&Math.floor(e)===e&&isFinite(r)}function Wg(r){return z(r)&&typeof r.then=="function"&&typeof r.catch=="function"}function nL(r){return r==null?"":Array.isArray(r)||Lr(r)&&r.toString===ay?JSON.stringify(r,iL,2):String(r)}function iL(r,e){return e&&e.__v_isRef?e.value:e}function eu(r){var e=parseFloat(r);return isNaN(e)?r:e}function Qs(r,e){for(var t=Object.create(null),s=r.split(","),n=0;n-1)return r.splice(s,1)}}var oL=Object.prototype.hasOwnProperty;function Pr(r,e){return oL.call(r,e)}function Wa(r){var e=Object.create(null);return function(s){var n=e[s];return n||(e[s]=r(s))}}var lL=/-(\w)/g,Sa=Wa(function(r){return r.replace(lL,function(e,t){return t?t.toUpperCase():""})}),cL=Wa(function(r){return r.charAt(0).toUpperCase()+r.slice(1)}),uL=/\B([A-Z])/g,Ju=Wa(function(r){return r.replace(uL,"-$1").toLowerCase()});function dL(r,e){function t(s){var n=arguments.length;return n?n>1?r.apply(e,arguments):r.call(e,s):r.call(e)}return t._length=r.length,t}function pL(r,e){return r.bind(e)}var Fx=Function.prototype.bind?pL:dL;function Gg(r,e){e=e||0;for(var t=r.length-e,s=new Array(t);t--;)s[t]=r[t+e];return s}function gt(r,e){for(var t in e)r[t]=e[t];return r}function Hx(r){for(var e={},t=0;t0,zx=Ss&&Ss.indexOf("edge/")>0;Ss&&Ss.indexOf("android")>0;var vL=Ss&&/iphone|ipad|ipod|ios/.test(Ss),Y2=Ss&&Ss.match(/firefox\/(\d+)/),Zg={}.watch,Ux=!1;if(Gr)try{var K2={};Object.defineProperty(K2,"passive",{get:function(){Ux=!0}}),window.addEventListener("test-passive",null,K2)}catch{}var ep,Fi=function(){return ep===void 0&&(!Gr&&typeof global<"u"?ep=global.process&&tL.VUE_ENV==="server":ep=!1),ep},ch=Gr&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function Ho(r){return typeof r=="function"&&/native code/.test(r.toString())}var ed=typeof Symbol<"u"&&Ho(Symbol)&&typeof Reflect<"u"&&Ho(Reflect.ownKeys),tu;typeof Set<"u"&&Ho(Set)?tu=Set:tu=function(){function r(){this.set=Object.create(null)}return r.prototype.has=function(e){return this.set[e]===!0},r.prototype.add=function(e){this.set[e]=!0},r.prototype.clear=function(){this.set=Object.create(null)},r}();var kt=null;function _L(){return kt&&{proxy:kt}}function Ci(r){r===void 0&&(r=null),r||kt&&kt._scope.off(),kt=r,r&&r._scope.on()}var is=function(){function r(e,t,s,n,i,a,o,l){this.tag=e,this.data=t,this.children=s,this.text=n,this.elm=i,this.ns=void 0,this.context=a,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=t&&t.key,this.componentOptions=o,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnce=!1,this.asyncFactory=l,this.asyncMeta=void 0,this.isAsyncPlaceholder=!1}return Object.defineProperty(r.prototype,"child",{get:function(){return this.componentInstance},enumerable:!1,configurable:!0}),r}(),ma=function(r){r===void 0&&(r="");var e=new is;return e.text=r,e.isComment=!0,e};function Oo(r){return new is(void 0,void 0,void 0,String(r))}function Yg(r){var e=new is(r.tag,r.data,r.children&&r.children.slice(),r.text,r.elm,r.context,r.componentOptions,r.asyncFactory);return e.ns=r.ns,e.isStatic=r.isStatic,e.key=r.key,e.isComment=r.isComment,e.fnContext=r.fnContext,e.fnOptions=r.fnOptions,e.fnScopeId=r.fnScopeId,e.asyncMeta=r.asyncMeta,e.isCloned=!0,e}var yL=0,Rp=[],bL=function(){for(var r=0;r1)return t&&ot(e)?e.call(s):e}}var r$=Wa(function(r){var e=r.charAt(0)==="&";r=e?r.slice(1):r;var t=r.charAt(0)==="~";r=t?r.slice(1):r;var s=r.charAt(0)==="!";return r=s?r.slice(1):r,{name:r,once:t,capture:s,passive:e}});function Kg(r,e){function t(){var s=t.fns;if(ze(s))for(var n=s.slice(),i=0;i0&&(n=nC(n,"".concat(e||"","_").concat(s)),ac(n[0])&&ac(a)&&(t[i]=Oo(a.text+n[0].text),n.shift()),t.push.apply(t,n)):Qu(n)?ac(a)?t[i]=Oo(a.text+n):n!==""&&t.push(Oo(n)):ac(n)&&ac(a)?t[i]=Oo(a.text+n.text):(Ct(r._isVList)&&z(n.tag)&&Be(n.key)&&z(e)&&(n.key="__vlist".concat(e,"_").concat(s,"__")),t.push(n)));return t}function YL(r,e){var t=null,s,n,i,a;if(ze(r)||typeof r=="string")for(t=new Array(r.length),s=0,n=r.length;s0,a=e?!!e.$stable:!i,o=e&&e.$key;if(!e)n={};else{if(e._normalized)return e._normalized;if(a&&s&&s!==mr&&o===s.$key&&!i&&!s.$hasNormal)return s;n={};for(var l in e)e[l]&&l[0]!=="$"&&(n[l]=aA(r,t,l,e[l]))}for(var c in t)c in n||(n[c]=oA(t,c));return e&&Object.isExtensible(e)&&(e._normalized=n),It(n,"$stable",a),It(n,"$key",o),It(n,"$hasNormal",i),n}function aA(r,e,t,s){var n=function(){var i=kt;Ci(r);var a=arguments.length?s.apply(null,arguments):s({});a=a&&typeof a=="object"&&!ze(a)?[a]:dy(a);var o=a&&a[0];return Ci(i),a&&(!o||a.length===1&&o.isComment&&!ru(o))?void 0:a};return s.proxy&&Object.defineProperty(e,t,{get:n,enumerable:!0,configurable:!0}),n}function oA(r,e){return function(){return r[e]}}function lA(r){var e=r.$options,t=e.setup;if(t){var s=r._setupContext=lC(r);Ci(r),$l();var n=Bn(t,null,[r._props||cy({}),s],r,"setup");if(Sl(),Ci(),ot(n))e.render=n;else if(yr(n))if(r._setupState=n,n.__sfc){var a=r._setupProxy={};for(var i in n)i!=="__sfc"&&ph(a,n,i)}else for(var i in n)Nx(i)||ph(r,n,i)}}function lC(r){return{get attrs(){if(!r._attrsProxy){var e=r._attrsProxy={};It(e,"_v_attr_proxy",!0),hh(e,r.$attrs,mr,r,"$attrs")}return r._attrsProxy},get listeners(){if(!r._listenersProxy){var e=r._listenersProxy={};hh(e,r.$listeners,mr,r,"$listeners")}return r._listenersProxy},get slots(){return uA(r)},emit:Fx(r.$emit,r),expose:function(e){e&&Object.keys(e).forEach(function(t){return ph(r,e,t)})}}}function hh(r,e,t,s,n){var i=!1;for(var a in e)a in r?e[a]!==t[a]&&(i=!0):(i=!0,cA(r,a,s,n));for(var a in r)a in e||(i=!0,delete r[a]);return i}function cA(r,e,t,s){Object.defineProperty(r,e,{enumerable:!0,configurable:!0,get:function(){return t[s][e]}})}function uA(r){return r._slotsProxy||cC(r._slotsProxy={},r.$scopedSlots),r._slotsProxy}function cC(r,e){for(var t in e)r[t]=e[t];for(var t in r)t in e||delete r[t]}function dA(){return hy().slots}function pA(){return hy().attrs}function hA(){return hy().listeners}function hy(){var r=kt;return r._setupContext||(r._setupContext=lC(r))}function fA(r,e){var t=ze(r)?r.reduce(function(i,a){return i[a]={},i},{}):r;for(var s in e){var n=t[s];n?ze(n)||ot(n)?t[s]={type:n,default:e[s]}:n.default=e[s]:n===null&&(t[s]={default:e[s]})}return t}function mA(r){r._vnode=null,r._staticTrees=null;var e=r.$options,t=r.$vnode=e._parentVnode,s=t&&t.context;r.$slots=py(e._renderChildren,s),r.$scopedSlots=t?Rc(r.$parent,t.data.scopedSlots,r.$slots):mr,r._c=function(i,a,o,l){return su(r,i,a,o,l,!1)},r.$createElement=function(i,a,o,l){return su(r,i,a,o,l,!0)};var n=t&&t.data;Li(r,"$attrs",n&&n.attrs||mr,null,!0),Li(r,"$listeners",e._parentListeners||mr,null,!0)}var Fp=null;function gA(r){oC(r.prototype),r.prototype.$nextTick=function(e){return om(e,this)},r.prototype._render=function(){var e=this,t=e.$options,s=t.render,n=t._parentVnode;n&&e._isMounted&&(e.$scopedSlots=Rc(e.$parent,n.data.scopedSlots,e.$slots,e.$scopedSlots),e._slotsProxy&&cC(e._slotsProxy,e.$scopedSlots)),e.$vnode=n;var i=kt,a=Fp,o;try{Ci(e),Fp=e,o=s.call(e._renderProxy,e.$createElement)}catch(l){xa(l,e,"render"),o=e._vnode}finally{Fp=a,Ci(i)}return ze(o)&&o.length===1&&(o=o[0]),o instanceof is||(o=ma()),o.parent=n,o}}function R1(r,e){return(r.__esModule||ed&&r[Symbol.toStringTag]==="Module")&&(r=r.default),yr(r)?e.extend(r):r}function vA(r,e,t,s,n){var i=ma();return i.asyncFactory=r,i.asyncMeta={data:e,context:t,children:s,tag:n},i}function _A(r,e){if(Ct(r.error)&&z(r.errorComp))return r.errorComp;if(z(r.resolved))return r.resolved;var t=Fp;if(t&&z(r.owners)&&r.owners.indexOf(t)===-1&&r.owners.push(t),Ct(r.loading)&&z(r.loadingComp))return r.loadingComp;if(t&&!z(r.owners)){var s=r.owners=[t],n=!0,i=null,a=null;t.$on("hook:destroyed",function(){return Ii(s,t)});var o=function(d){for(var p=0,h=s.length;p1?Gg(n):n;for(var i=Gg(arguments,1),a='event handler for "'.concat(t,'"'),o=0,l=n.length;odocument.createEvent("Event").timeStamp&&(tv=function(){return I1.now()})}var eE=function(r,e){if(r.post){if(!e.post)return 1}else if(e.post)return-1;return r.id-e.id};function tE(){_C=tv(),gy=!0;var r,e;for(kn.sort(eE),To=0;ToTo&&kn[t].id>r.id;)t--;kn.splice(t+1,0,r)}ev||(ev=!0,om(tE))}}function iE(r){var e=r.$options.provide;if(e){var t=ot(e)?e.call(r):e;if(!yr(t))return;for(var s=rC(r),n=ed?Reflect.ownKeys(t):Object.keys(t),i=0;i-1){if(i&&!Pr(n,"default"))a=!1;else if(a===""||a===Ju(r)){var l=g$(String,n.type);(l<0||o-1)return this;var s=Gg(arguments,1);return s.unshift(this),ot(e.install)?e.install.apply(e,s):ot(e)&&e.apply(null,s),t.push(e),this}}function RE(r){r.mixin=function(e){return this.options=Ca(this.options,e),this}}function IE(r){r.cid=0;var e=1;r.extend=function(t){t=t||{};var s=this,n=s.cid,i=t._Ctor||(t._Ctor={});if(i[n])return i[n];var a=mh(t)||mh(s.options),o=function(c){this._init(c)};return o.prototype=Object.create(s.prototype),o.prototype.constructor=o,o.cid=e++,o.options=Ca(s.options,t),o.super=s,o.options.props&&FE(o),o.options.computed&&HE(o),o.extend=s.extend,o.mixin=s.mixin,o.use=s.use,sm.forEach(function(l){o[l]=s[l]}),a&&(o.options.components[a]=o),o.superOptions=s.options,o.extendOptions=t,o.sealedOptions=gt({},o.options),i[n]=o,o}}function FE(r){var e=r.options.props;for(var t in e)by(r.prototype,"_props",t)}function HE(r){var e=r.options.computed;for(var t in e)$C(r.prototype,t,e[t])}function BE(r){sm.forEach(function(e){r[e]=function(t,s){return s?(e==="component"&&Lr(s)&&(s.name=s.name||t,s=this.options._base.extend(s)),e==="directive"&&ot(s)&&(s={bind:s,update:s}),this.options[e+"s"][t]=s,s):this.options[e+"s"][t]}})}function y$(r){return r&&(mh(r.Ctor.options)||r.tag)}function sp(r,e){return ze(r)?r.indexOf(e)>-1:typeof r=="string"?r.split(",").indexOf(e)>-1:sL(r)?r.test(e):!1}function b$(r,e){var t=r.cache,s=r.keys,n=r._vnode,i=r.$vnode;for(var a in t){var o=t[a];if(o){var l=o.name;l&&!e(l)&&iv(t,a,s,n)}}i.componentOptions.children=void 0}function iv(r,e,t,s){var n=r[e];n&&(!s||n.tag!==s.tag)&&n.componentInstance.$destroy(),r[e]=null,Ii(t,e)}var $$=[String,RegExp,Array],jE={name:"keep-alive",abstract:!0,props:{include:$$,exclude:$$,max:[String,Number]},methods:{cacheVNode:function(){var r=this,e=r.cache,t=r.keys,s=r.vnodeToCache,n=r.keyToCache;if(s){var i=s.tag,a=s.componentInstance,o=s.componentOptions;e[n]={name:y$(o),tag:i,componentInstance:a},t.push(n),this.max&&t.length>parseInt(this.max)&&iv(e,t[0],t,this._vnode),this.vnodeToCache=null}}},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var r in this.cache)iv(this.cache,r,this.keys)},mounted:function(){var r=this;this.cacheVNode(),this.$watch("include",function(e){b$(r,function(t){return sp(e,t)})}),this.$watch("exclude",function(e){b$(r,function(t){return!sp(e,t)})})},updated:function(){this.cacheVNode()},render:function(){var r=this.$slots.default,e=uC(r),t=e&&e.componentOptions;if(t){var s=y$(t),n=this,i=n.include,a=n.exclude;if(i&&(!s||!sp(i,s))||a&&s&&sp(a,s))return e;var o=this,l=o.cache,c=o.keys,u=e.key==null?t.Ctor.cid+(t.tag?"::".concat(t.tag):""):e.key;l[u]?(e.componentInstance=l[u].componentInstance,Ii(c,u),c.push(u)):(this.vnodeToCache=e,this.keyToCache=u),e.data.keepAlive=!0}return e||r&&r[0]}},VE={KeepAlive:jE};function NE(r){var e={};e.get=function(){return bs},Object.defineProperty(r,"config",e),r.util={warn:pE,extend:gt,mergeOptions:Ca,defineReactive:Li},r.set=nm,r.delete=ly,r.nextTick=om,r.observable=function(t){return Hn(t),t},r.options=Object.create(null),sm.forEach(function(t){r.options[t+"s"]=Object.create(null)}),r.options._base=r,gt(r.options.components,VE),ME(r),RE(r),IE(r),BE(r)}NE(b);Object.defineProperty(b.prototype,"$isServer",{get:Fi});Object.defineProperty(b.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}});Object.defineProperty(b,"FunctionalRenderContext",{value:vy});b.version=hC;var zE=Qs("style,class"),UE=Qs("input,textarea,option,select,progress"),WE=function(r,e,t){return t==="value"&&UE(r)&&e!=="button"||t==="selected"&&r==="option"||t==="checked"&&r==="input"||t==="muted"&&r==="video"},SC=Qs("contenteditable,draggable,spellcheck"),GE=Qs("events,caret,typing,plaintext-only"),qE=function(r,e){return vh(e)||e==="false"?"false":r==="contenteditable"&&GE(e)?e:"true"},ZE=Qs("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,truespeed,typemustmatch,visible"),av="http://www.w3.org/1999/xlink",Sy=function(r){return r.charAt(5)===":"&&r.slice(0,5)==="xlink"},wC=function(r){return Sy(r)?r.slice(6,r.length):""},vh=function(r){return r==null||r===!1};function YE(r){for(var e=r.data,t=r,s=r;z(s.componentInstance);)s=s.componentInstance._vnode,s&&s.data&&(e=S$(s.data,e));for(;z(t=t.parent);)t&&t.data&&(e=S$(e,t.data));return KE(e.staticClass,e.class)}function S$(r,e){return{staticClass:wy(r.staticClass,e.staticClass),class:z(r.class)?[r.class,e.class]:e.class}}function KE(r,e){return z(r)||z(e)?wy(r,xy(e)):""}function wy(r,e){return r?e?r+" "+e:r:e||""}function xy(r){return Array.isArray(r)?XE(r):yr(r)?QE(r):typeof r=="string"?r:""}function XE(r){for(var e="",t,s=0,n=r.length;s-1?np[r]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:np[r]=/HTMLUnknownElement/.test(e.toString())}var ov=Qs("text,number,password,search,email,tel,url");function sO(r){if(typeof r=="string"){var e=document.querySelector(r);return e||document.createElement("div")}else return r}function nO(r,e){var t=document.createElement(r);return r!=="select"||e.data&&e.data.attrs&&e.data.attrs.multiple!==void 0&&t.setAttribute("multiple","multiple"),t}function iO(r,e){return document.createElementNS(JE[r],e)}function aO(r){return document.createTextNode(r)}function oO(r){return document.createComment(r)}function lO(r,e,t){r.insertBefore(e,t)}function cO(r,e){r.removeChild(e)}function uO(r,e){r.appendChild(e)}function dO(r){return r.parentNode}function pO(r){return r.nextSibling}function hO(r){return r.tagName}function fO(r,e){r.textContent=e}function mO(r,e){r.setAttribute(e,"")}var gO=Object.freeze({__proto__:null,createElement:nO,createElementNS:iO,createTextNode:aO,createComment:oO,insertBefore:lO,removeChild:cO,appendChild:uO,parentNode:dO,nextSibling:pO,tagName:hO,setTextContent:fO,setStyleScope:mO}),vO={create:function(r,e){ko(e)},update:function(r,e){r.data.ref!==e.data.ref&&(ko(r,!0),ko(e))},destroy:function(r){ko(r,!0)}};function ko(r,e){var t=r.data.ref;if(z(t)){var s=r.context,n=r.componentInstance||r.elm,i=e?null:n,a=e?void 0:n;if(ot(t)){Bn(t,s,[i],s,"template ref function");return}var o=r.data.refInFor,l=typeof t=="string"||typeof t=="number",c=or(t),u=s.$refs;if(l||c){if(o){var d=l?u[t]:t.value;e?ze(d)&&Ii(d,n):ze(d)?d.includes(n)||d.push(n):l?(u[t]=[n],w$(s,t,u[t])):t.value=[n]}else if(l){if(e&&u[t]!==n)return;u[t]=a,w$(s,t,i)}else if(c){if(e&&t.value!==n)return;t.value=i}}}}function w$(r,e,t){var s=r._setupState;s&&Pr(s,e)&&(or(s[e])?s[e].value=t:s[e]=t)}var mi=new is("",{},[]),oc=["create","activate","update","remove","destroy"];function Qi(r,e){return r.key===e.key&&r.asyncFactory===e.asyncFactory&&(r.tag===e.tag&&r.isComment===e.isComment&&z(r.data)===z(e.data)&&_O(r,e)||Ct(r.isAsyncPlaceholder)&&Be(e.asyncFactory.error))}function _O(r,e){if(r.tag!=="input")return!0;var t,s=z(t=r.data)&&z(t=t.attrs)&&t.type,n=z(t=e.data)&&z(t=t.attrs)&&t.type;return s===n||ov(s)&&ov(n)}function yO(r,e,t){var s,n,i={};for(s=e;s<=t;++s)n=r[s].key,z(n)&&(i[n]=s);return i}function bO(r){var e,t,s={},n=r.modules,i=r.nodeOps;for(e=0;eN?(wt=Be(P[q+1])?null:P[q+1].elm,C(k,wt,P,U,q,O)):U>q&&S(T,V,N)}function K(k,T,P,O){for(var j=P;j-1?L$(r,e,t):ZE(e)?vh(t)?r.removeAttribute(e):(t=e==="allowfullscreen"&&r.tagName==="EMBED"?"true":e,r.setAttribute(e,t)):SC(e)?r.setAttribute(e,qE(e,t)):Sy(e)?vh(t)?r.removeAttributeNS(av,wC(e)):r.setAttributeNS(av,e,t):L$(r,e,t)}function L$(r,e,t){if(vh(t))r.removeAttribute(e);else{if(yl&&!bl&&r.tagName==="TEXTAREA"&&e==="placeholder"&&t!==""&&!r.__ieph){var s=function(n){n.stopImmediatePropagation(),r.removeEventListener("input",s)};r.addEventListener("input",s),r.__ieph=!0}r.setAttribute(e,t)}}var PO={create:C$,update:C$};function A$(r,e){var t=e.elm,s=e.data,n=r.data;if(!(Be(s.staticClass)&&Be(s.class)&&(Be(n)||Be(n.staticClass)&&Be(n.class)))){var i=YE(e),a=t._transitionClasses;z(a)&&(i=wy(i,xy(a))),i!==t._prevClass&&(t.setAttribute("class",i),t._prevClass=i)}}var LO={create:A$,update:A$},H1="__r",B1="__c";function AO(r){if(z(r[H1])){var e=yl?"change":"input";r[e]=[].concat(r[H1],r[e]||[]),delete r[H1]}z(r[B1])&&(r.change=[].concat(r[B1],r.change||[]),delete r[B1])}var au;function EO(r,e,t){var s=au;return function n(){var i=e.apply(null,arguments);i!==null&&CC(r,n,t,s)}}var OO=Xg&&!(Y2&&Number(Y2[1])<=53);function TO(r,e,t,s){if(OO){var n=_C,i=e;e=i._wrapper=function(a){if(a.target===a.currentTarget||a.timeStamp>=n||a.timeStamp<=0||a.target.ownerDocument!==document)return i.apply(this,arguments)}}au.addEventListener(r,e,Ux?{capture:t,passive:s}:t)}function CC(r,e,t,s){(s||au).removeEventListener(r,e._wrapper||e,t)}function j1(r,e){if(!(Be(r.data.on)&&Be(e.data.on))){var t=e.data.on||{},s=r.data.on||{};au=e.elm||r.elm,AO(t),sC(t,s,TO,CC,EO,e.context),au=void 0}}var kO={create:j1,update:j1,destroy:function(r){return j1(r,mi)}},ip;function E$(r,e){if(!(Be(r.data.domProps)&&Be(e.data.domProps))){var t,s,n=e.elm,i=r.data.domProps||{},a=e.data.domProps||{};(z(a.__ob__)||Ct(a._v_attr_proxy))&&(a=e.data.domProps=gt({},a));for(t in i)t in a||(n[t]="");for(t in a){if(s=a[t],t==="textContent"||t==="innerHTML"){if(e.children&&(e.children.length=0),s===i[t])continue;n.childNodes.length===1&&n.removeChild(n.childNodes[0])}if(t==="value"&&n.tagName!=="PROGRESS"){n._value=s;var o=Be(s)?"":String(s);DO(n,o)&&(n.value=o)}else if(t==="innerHTML"&&Cy(n.tagName)&&Be(n.innerHTML)){ip=ip||document.createElement("div"),ip.innerHTML="".concat(s,"");for(var l=ip.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;l.firstChild;)n.appendChild(l.firstChild)}else if(s!==i[t])try{n[t]=s}catch{}}}}function DO(r,e){return!r.composing&&(r.tagName==="OPTION"||MO(r,e)||RO(r,e))}function MO(r,e){var t=!0;try{t=document.activeElement!==r}catch{}return t&&r.value!==e}function RO(r,e){var t=r.value,s=r._vModifiers;if(z(s)){if(s.number)return eu(t)!==eu(e);if(s.trim)return t.trim()!==e.trim()}return t!==e}var IO={create:E$,update:E$},FO=Wa(function(r){var e={},t=/;(?![^(]*\))/g,s=/:(.+)/;return r.split(t).forEach(function(n){if(n){var i=n.split(s);i.length>1&&(e[i[0].trim()]=i[1].trim())}}),e});function V1(r){var e=PC(r.style);return r.staticStyle?gt(r.staticStyle,e):e}function PC(r){return Array.isArray(r)?Hx(r):typeof r=="string"?FO(r):r}function HO(r,e){for(var t={},s,n=r;n.componentInstance;)n=n.componentInstance._vnode,n&&n.data&&(s=V1(n.data))&>(t,s);(s=V1(r.data))&>(t,s);for(var i=r;i=i.parent;)i.data&&(s=V1(i.data))&>(t,s);return t}var BO=/^--/,O$=/\s*!important$/,T$=function(r,e,t){if(BO.test(e))r.style.setProperty(e,t);else if(O$.test(t))r.style.setProperty(Ju(e),t.replace(O$,""),"important");else{var s=jO(e);if(Array.isArray(t))for(var n=0,i=t.length;n-1?e.split(LC).forEach(function(s){return r.classList.add(s)}):r.classList.add(e);else{var t=" ".concat(r.getAttribute("class")||""," ");t.indexOf(" "+e+" ")<0&&r.setAttribute("class",(t+e).trim())}}function EC(r,e){if(!(!e||!(e=e.trim())))if(r.classList)e.indexOf(" ")>-1?e.split(LC).forEach(function(n){return r.classList.remove(n)}):r.classList.remove(e),r.classList.length||r.removeAttribute("class");else{for(var t=" ".concat(r.getAttribute("class")||""," "),s=" "+e+" ";t.indexOf(s)>=0;)t=t.replace(s," ");t=t.trim(),t?r.setAttribute("class",t):r.removeAttribute("class")}}function OC(r){if(r){if(typeof r=="object"){var e={};return r.css!==!1&>(e,M$(r.name||"v")),gt(e,r),e}else if(typeof r=="string")return M$(r)}}var M$=Wa(function(r){return{enterClass:"".concat(r,"-enter"),enterToClass:"".concat(r,"-enter-to"),enterActiveClass:"".concat(r,"-enter-active"),leaveClass:"".concat(r,"-leave"),leaveToClass:"".concat(r,"-leave-to"),leaveActiveClass:"".concat(r,"-leave-active")}}),TC=Gr&&!bl,Lo="transition",N1="animation",Bp="transition",_h="transitionend",lv="animation",kC="animationend";TC&&(window.ontransitionend===void 0&&window.onwebkittransitionend!==void 0&&(Bp="WebkitTransition",_h="webkitTransitionEnd"),window.onanimationend===void 0&&window.onwebkitanimationend!==void 0&&(lv="WebkitAnimation",kC="webkitAnimationEnd"));var R$=Gr?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(r){return r()};function DC(r){R$(function(){R$(r)})}function _a(r,e){var t=r._transitionClasses||(r._transitionClasses=[]);t.indexOf(e)<0&&(t.push(e),AC(r,e))}function Dn(r,e){r._transitionClasses&&Ii(r._transitionClasses,e),EC(r,e)}function MC(r,e,t){var s=RC(r,e),n=s.type,i=s.timeout,a=s.propCount;if(!n)return t();var o=n===Lo?_h:kC,l=0,c=function(){r.removeEventListener(o,u),t()},u=function(d){d.target===r&&++l>=a&&c()};setTimeout(function(){l0&&(c=Lo,u=i,d=n.length):e===N1?l>0&&(c=N1,u=l,d=o.length):(u=Math.max(i,l),c=u>0?i>l?Lo:N1:null,d=c?c===Lo?n.length:o.length:0);var p=c===Lo&&NO.test(t[Bp+"Property"]);return{type:c,timeout:u,propCount:d,hasTransform:p}}function I$(r,e){for(;r.length1}function H$(r,e){e.data.show!==!0&&cv(e)}var zO=Gr?{create:H$,activate:H$,remove:function(r,e){r.data.show!==!0?IC(r,e):e()}}:{},UO=[PO,LO,kO,IO,VO,zO],WO=UO.concat(CO),GO=bO({nodeOps:gO,modules:WO});bl&&document.addEventListener("selectionchange",function(){var r=document.activeElement;r&&r.vmodel&&Ly(r,"input")});var HC={inserted:function(r,e,t,s){t.tag==="select"?(s.elm&&!s.elm._vOptions?fi(t,"postpatch",function(){HC.componentUpdated(r,e,t)}):B$(r,e,t.context),r._vOptions=[].map.call(r.options,yh)):(t.tag==="textarea"||ov(r.type))&&(r._vModifiers=e.modifiers,e.modifiers.lazy||(r.addEventListener("compositionstart",qO),r.addEventListener("compositionend",N$),r.addEventListener("change",N$),bl&&(r.vmodel=!0)))},componentUpdated:function(r,e,t){if(t.tag==="select"){B$(r,e,t.context);var s=r._vOptions,n=r._vOptions=[].map.call(r.options,yh);if(n.some(function(a,o){return!wa(a,s[o])})){var i=r.multiple?e.value.some(function(a){return V$(a,n)}):e.value!==e.oldValue&&V$(e.value,n);i&&Ly(r,"change")}}}};function B$(r,e,t){j$(r,e),(yl||zx)&&setTimeout(function(){j$(r,e)},0)}function j$(r,e,t){var s=e.value,n=r.multiple;if(!(n&&!Array.isArray(s))){for(var i,a,o=0,l=r.options.length;o-1,a.selected!==i&&(a.selected=i);else if(wa(yh(a),s)){r.selectedIndex!==o&&(r.selectedIndex=o);return}n||(r.selectedIndex=-1)}}function V$(r,e){return e.every(function(t){return!wa(t,r)})}function yh(r){return"_value"in r?r._value:r.value}function qO(r){r.target.composing=!0}function N$(r){r.target.composing&&(r.target.composing=!1,Ly(r.target,"input"))}function Ly(r,e){var t=document.createEvent("HTMLEvents");t.initEvent(e,!0,!0),r.dispatchEvent(t)}function uv(r){return r.componentInstance&&(!r.data||!r.data.transition)?uv(r.componentInstance._vnode):r}var ZO={bind:function(r,e,t){var s=e.value;t=uv(t);var n=t.data&&t.data.transition,i=r.__vOriginalDisplay=r.style.display==="none"?"":r.style.display;s&&n?(t.data.show=!0,cv(t,function(){r.style.display=i})):r.style.display=s?i:"none"},update:function(r,e,t){var s=e.value,n=e.oldValue;if(!s!=!n){t=uv(t);var i=t.data&&t.data.transition;i?(t.data.show=!0,s?cv(t,function(){r.style.display=r.__vOriginalDisplay}):IC(t,function(){r.style.display="none"})):r.style.display=s?r.__vOriginalDisplay:"none"}},unbind:function(r,e,t,s,n){n||(r.style.display=r.__vOriginalDisplay)}},YO={model:HC,show:ZO},BC={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function dv(r){var e=r&&r.componentOptions;return e&&e.Ctor.options.abstract?dv(uC(e.children)):r}function jC(r){var e={},t=r.$options;for(var s in t.propsData)e[s]=r[s];var n=t._parentListeners;for(var s in n)e[Sa(s)]=n[s];return e}function z$(r,e){if(/\d-keep-alive$/.test(e.tag))return r("keep-alive",{props:e.componentOptions.propsData})}function KO(r){for(;r=r.parent;)if(r.data.transition)return!0}function XO(r,e){return e.key===r.key&&e.tag===r.tag}var QO=function(r){return r.tag||ru(r)},JO=function(r){return r.name==="show"},eT={name:"transition",props:BC,abstract:!0,render:function(r){var e=this,t=this.$slots.default;if(t&&(t=t.filter(QO),!!t.length)){var s=this.mode,n=t[0];if(KO(this.$vnode))return n;var i=dv(n);if(!i)return n;if(this._leaving)return z$(r,n);var a="__transition-".concat(this._uid,"-");i.key=i.key==null?i.isComment?a+"comment":a+i.tag:Qu(i.key)?String(i.key).indexOf(a)===0?i.key:a+i.key:i.key;var o=(i.data||(i.data={})).transition=jC(this),l=this._vnode,c=dv(l);if(i.data.directives&&i.data.directives.some(JO)&&(i.data.show=!0),c&&c.data&&!XO(i,c)&&!ru(c)&&!(c.componentInstance&&c.componentInstance._vnode.isComment)){var u=c.data.transition=gt({},o);if(s==="out-in")return this._leaving=!0,fi(u,"afterLeave",function(){e._leaving=!1,e.$forceUpdate()}),z$(r,n);if(s==="in-out"){if(ru(i))return l;var d,p=function(){d()};fi(o,"afterEnter",p),fi(o,"enterCancelled",p),fi(u,"delayLeave",function(h){d=h})}}return n}}},VC=gt({tag:String,moveClass:String},BC);delete VC.mode;var tT={props:VC,beforeMount:function(){var r=this,e=this._update;this._update=function(t,s){var n=mC(r);r.__patch__(r._vnode,r.kept,!1,!0),r._vnode=r.kept,n(),e.call(r,t,s)}},render:function(r){for(var e=this.tag||this.$vnode.data.tag||"span",t=Object.create(null),s=this.prevChildren=this.children,n=this.$slots.default||[],i=this.children=[],a=jC(this),o=0;o1&&arguments[1]!==void 0?arguments[1]:{};e.name=e.name||r._componentTag||r.name;var t=r.prototype;Object.getOwnPropertyNames(t).forEach(function(o){if(o!=="constructor"){if(pv.indexOf(o)>-1){e[o]=t[o];return}var l=Object.getOwnPropertyDescriptor(t,o);l.value!==void 0?typeof l.value=="function"?(e.methods||(e.methods={}))[o]=l.value:(e.mixins||(e.mixins=[])).push({data:function(){return oT({},o,l.value)}}):(l.get||l.set)&&((e.computed||(e.computed={}))[o]={get:l.get,set:l.set})}}),(e.mixins||(e.mixins=[])).push({data:function(){return vT(this,r)}});var s=r.__decorators__;s&&(s.forEach(function(o){return o(e)}),delete r.__decorators__);var n=Object.getPrototypeOf(r.prototype),i=n instanceof b?n.constructor:b,a=i.extend(e);return yT(a,r,i),pT()&&hT(a,r),a}var _T={prototype:!0,arguments:!0,callee:!0,caller:!0};function yT(r,e,t){Object.getOwnPropertyNames(e).forEach(function(s){if(!_T[s]){var n=Object.getOwnPropertyDescriptor(r,s);if(!(n&&!n.configurable)){var i=Object.getOwnPropertyDescriptor(e,s);if(!mT){if(s==="cid")return;var a=Object.getOwnPropertyDescriptor(t,s);if(!gT(i.value)&&a&&a.value===i.value)return}Object.defineProperty(r,s,i)}}})}function L(r){return typeof r=="function"?U$(r):function(e){return U$(e,r)}}L.registerHooks=function(e){pv.push.apply(pv,lT(e))};L.registerHooks(["beforeRouteEnter","beforeRouteUpdate"]);const Fr={silent:Number.NEGATIVE_INFINITY,fatal:0,error:0,warn:1,log:2,info:3,success:3,fail:3,ready:3,start:3,box:3,debug:4,trace:5,verbose:Number.POSITIVE_INFINITY},W$={silent:{level:-1},fatal:{level:Fr.fatal},error:{level:Fr.error},warn:{level:Fr.warn},log:{level:Fr.log},info:{level:Fr.info},success:{level:Fr.success},fail:{level:Fr.fail},ready:{level:Fr.info},start:{level:Fr.info},box:{level:Fr.info},debug:{level:Fr.debug},trace:{level:Fr.trace},verbose:{level:Fr.verbose}};function U1(r){return r!==null&&typeof r=="object"}function hv(r,e,t=".",s){if(!U1(e))return hv(r,{},t);const n=Object.assign({},e);for(const i in r){if(i==="__proto__"||i==="constructor")continue;const a=r[i];a!=null&&(Array.isArray(a)&&Array.isArray(n[i])?n[i]=[...a,...n[i]]:U1(a)&&U1(n[i])?n[i]=hv(a,n[i],(t?`${t}.`:"")+i.toString()):n[i]=a)}return n}function bT(r){return(...e)=>e.reduce((t,s)=>hv(t,s,""),{})}const $T=bT();function ST(r){return Object.prototype.toString.call(r)==="[object Object]"}function wT(r){return!(!ST(r)||!r.message&&!r.args||r.stack)}let W1=!1;const G$=[];class ur{constructor(e={}){const t=e.types||W$;this.options=$T({...e,defaults:{...e.defaults},level:G1(e.level,t),reporters:[...e.reporters||[]]},{types:W$,throttle:1e3,throttleMin:5,formatOptions:{date:!0,colors:!1,compact:!0}});for(const s in t){const n={type:s,...this.options.defaults,...t[s]};this[s]=this._wrapLogFn(n),this[s].raw=this._wrapLogFn(n,!0)}this.options.mockFn&&this.mockTypes(),this._lastLog={}}get level(){return this.options.level}set level(e){this.options.level=G1(e,this.options.types,this.options.level)}prompt(e,t){if(!this.options.prompt)throw new Error("prompt is not supported!");return this.options.prompt(e,t)}create(e){const t=new ur({...this.options,...e});return this._mockFn&&t.mockTypes(this._mockFn),t}withDefaults(e){return this.create({...this.options,defaults:{...this.options.defaults,...e}})}withTag(e){return this.withDefaults({tag:this.options.defaults.tag?this.options.defaults.tag+":"+e:e})}addReporter(e){return this.options.reporters.push(e),this}removeReporter(e){if(e){const t=this.options.reporters.indexOf(e);if(t>=0)return this.options.reporters.splice(t,1)}else this.options.reporters.splice(0);return this}setReporters(e){return this.options.reporters=Array.isArray(e)?e:[e],this}wrapAll(){this.wrapConsole(),this.wrapStd()}restoreAll(){this.restoreConsole(),this.restoreStd()}wrapConsole(){for(const e in this.options.types)console["__"+e]||(console["__"+e]=console[e]),console[e]=this[e].raw}restoreConsole(){for(const e in this.options.types)console["__"+e]&&(console[e]=console["__"+e],delete console["__"+e])}wrapStd(){this._wrapStream(this.options.stdout,"log"),this._wrapStream(this.options.stderr,"log")}_wrapStream(e,t){e&&(e.__write||(e.__write=e.write),e.write=s=>{this[t].raw(String(s).trim())})}restoreStd(){this._restoreStream(this.options.stdout),this._restoreStream(this.options.stderr)}_restoreStream(e){e&&e.__write&&(e.write=e.__write,delete e.__write)}pauseLogs(){W1=!0}resumeLogs(){W1=!1;const e=G$.splice(0);for(const t of e)t[0]._logFn(t[1],t[2])}mockTypes(e){const t=e||this.options.mockFn;if(this._mockFn=t,typeof t=="function")for(const s in this.options.types)this[s]=t(s,this.options.types[s])||this[s],this[s].raw=this[s]}_wrapLogFn(e,t){return(...s)=>{if(W1){G$.push([this,e,s,t]);return}return this._logFn(e,s,t)}}_logFn(e,t,s){if((e.level||0)>this.level)return!1;const n={date:new Date,args:[],...e,level:G1(e.level,this.options.types)};!s&&t.length===1&&wT(t[0])?Object.assign(n,t[0]):n.args=[...t],n.message&&(n.args.unshift(n.message),delete n.message),n.additional&&(Array.isArray(n.additional)||(n.additional=n.additional.split(` +`)),n.args.push(` +`+n.additional.join(` +`)),delete n.additional),n.type=typeof n.type=="string"?n.type.toLowerCase():"log",n.tag=typeof n.tag=="string"?n.tag:"";const i=(o=!1)=>{const l=(this._lastLog.count||0)-this.options.throttleMin;if(this._lastLog.object&&l>0){const c=[...this._lastLog.object.args];l>1&&c.push(`(repeated ${l} times)`),this._log({...this._lastLog.object,args:c}),this._lastLog.count=1}o&&(this._lastLog.object=n,this._log(n))};clearTimeout(this._lastLog.timeout);const a=this._lastLog.time&&n.date?n.date.getTime()-this._lastLog.time.getTime():0;if(this._lastLog.time=n.date,athis.options.throttleMin)){this._lastLog.timeout=setTimeout(i,this.options.throttle);return}}catch{}i(!0)}_log(e){for(const t of this.options.reporters)t.log(e,{options:this.options})}}function G1(r,e={},t=3){return r===void 0?t:typeof r=="number"?r:e[r]&&e[r].level!==void 0?e[r].level:t}ur.prototype.add=ur.prototype.addReporter;ur.prototype.remove=ur.prototype.removeReporter;ur.prototype.clear=ur.prototype.removeReporter;ur.prototype.withScope=ur.prototype.withTag;ur.prototype.mock=ur.prototype.mockTypes;ur.prototype.pause=ur.prototype.pauseLogs;ur.prototype.resume=ur.prototype.resumeLogs;function xT(r={}){return new ur(r)}class CT{constructor(e){this.options={...e},this.defaultColor="#7f8c8d",this.levelColorMap={0:"#c0392b",1:"#f39c12",3:"#00BCD4"},this.typeColorMap={success:"#2ecc71"}}_getLogFn(e){return e<1?console.__error||console.error:e===1?console.__warn||console.warn:console.__log||console.log}log(e){const t=this._getLogFn(e.level),s=e.type==="log"?"":e.type,n=e.tag||"",a=` + background: ${this.typeColorMap[e.type]||this.levelColorMap[e.level]||this.defaultColor}; + border-radius: 0.5em; + color: white; + font-weight: bold; + padding: 2px 0.5em; + `,o=`%c${[n,s].filter(Boolean).join(":")}`;typeof e.args[0]=="string"?t(`${o}%c ${e.args[0]}`,a,"",...e.args.slice(1)):t(o,a,...e.args)}}function PT(r={}){return xT({reporters:r.reporters||[new CT({})],prompt(t,s={}){return s.type==="confirm"?Promise.resolve(confirm(t)):Promise.resolve(prompt(t))},...r})}const ye=PT();ye.wrapAll();ye.level=Fr.warn;var LT="M5 5H7V11H5V5M10 5H8V11H10V5M5 19H7V13H5V19M10 13H8V19H10V17H15V15H10V13M2 21H4V3H2V21M20 3V7H13V5H11V11H13V9H20V15H18V13H16V19H18V17H20V21H22V3H20Z",AT="M12,4A4,4 0 0,1 16,8A4,4 0 0,1 12,12A4,4 0 0,1 8,8A4,4 0 0,1 12,4M12,14C16.42,14 20,15.79 20,18V20H4V18C4,15.79 7.58,14 12,14Z",ET="M15,14C12.33,14 7,15.33 7,18V20H23V18C23,15.33 17.67,14 15,14M6,10V7H4V10H1V12H4V15H6V12H9V10M15,12A4,4 0 0,0 19,8A4,4 0 0,0 15,4A4,4 0 0,0 11,8A4,4 0 0,0 15,12Z",OT="M13 14H11V9H13M13 18H11V16H13M1 21H23L12 2L1 21Z",TT="M13,13H11V7H13M13,17H11V15H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z",kT="M16,20H20V16H16M16,14H20V10H16M10,8H14V4H10M16,8H20V4H16M10,14H14V10H10M4,14H8V10H4M4,20H8V16H4M10,20H14V16H10M4,8H8V4H4V8Z",DT="M3,3H21V7H3V3M4,8H20V21H4V8M9.5,11A0.5,0.5 0 0,0 9,11.5V13H15V11.5A0.5,0.5 0 0,0 14.5,11H9.5Z",MT="M21 7H3V3H21V7M9.5 11H14.5C14.78 11 15 11.22 15 11.5V12.06C15.87 10.83 17.35 10 19 10C19.34 10 19.68 10.04 20 10.11V8H4V21H13.03C13 20.9 13 20.8 13 20.7V17.2C13 16.24 13.5 15.34 14.2 14.74V14.5C14.2 14 14.32 13.47 14.5 13H9V11.5C9 11.22 9.22 11 9.5 11M23 17.3V20.8C23 21.4 22.4 22 21.7 22H16.2C15.6 22 15 21.4 15 20.7V17.2C15 16.6 15.6 16 16.2 16V14.5C16.2 13.1 17.6 12 19 12S21.8 13.1 21.8 14.5V16C22.4 16 23 16.6 23 17.3M20.5 14.5C20.5 13.7 19.8 13.2 19 13.2S17.5 13.7 17.5 14.5V16H20.5V14.5Z",RT="M21 7H3V3H21V7M13 19C13 19.7 13.13 20.37 13.35 21H4V8H20V13.09C19.67 13.04 19.34 13 19 13C15.69 13 13 15.69 13 19M15 13V11.5C15 11.22 14.78 11 14.5 11H9.5C9.22 11 9 11.22 9 11.5V13H15M20 18V15H18V18H15V20H18V23H20V20H23V18H20Z",IT="M19.92,12.08L12,20L4.08,12.08L5.5,10.67L11,16.17V2H13V16.17L18.5,10.66L19.92,12.08M12,20H2V22H22V20H12Z",FT="M11,4H13V16L18.5,10.5L19.92,11.92L12,19.84L4.08,11.92L5.5,10.5L11,16V4Z",HT="M9,11H15V8L19,12L15,16V13H9V16L5,12L9,8V11M2,20V4H4V20H2M20,20V4H22V20H20Z",BT="M2,20V22H22V20H13V5.83L18.5,11.33L19.92,9.92L12,2L4.08,9.92L5.5,11.33L11,5.83V20H2Z",jT="M13,9V15H16L12,19L8,15H11V9H8L12,5L16,9H13M4,2H20V4H4V2M4,20H20V22H4V20Z",VT="M14.8 7V5.5C14.8 4.1 13.4 3 12 3S9.2 4.1 9.2 5.5V7C8.6 7 8 7.6 8 8.2V11.7C8 12.4 8.6 13 9.2 13H14.7C15.4 13 16 12.4 16 11.8V8.3C16 7.6 15.4 7 14.8 7M13.5 7H10.5V5.5C10.5 4.7 11.2 4.2 12 4.2S13.5 4.7 13.5 5.5V7M6 17V20L2 16L6 12V15H18V12L22 16L18 20V17H6Z",NT="M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z",zT="M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z",UT="M13,20H11V8L5.5,13.5L4.08,12.08L12,4.16L19.92,12.08L18.5,13.5L13,8V20Z",WT="M12,2L16,6H13V13.85L19.53,17.61L21,15.03L22.5,20.5L17,21.96L18.53,19.35L12,15.58L5.47,19.35L7,21.96L1.5,20.5L3,15.03L4.47,17.61L11,13.85V6H8L12,2Z",GT="M10 21H14C14 22.1 13.1 23 12 23S10 22.1 10 21M21 19V20H3V19L5 17V11C5 7.9 7 5.2 10 4.3V4C10 2.9 10.9 2 12 2S14 2.9 14 4V4.3C17 5.2 19 7.9 19 11V17L21 19M17 11C17 8.2 14.8 6 12 6S7 8.2 7 11V18H17V11Z",qT="M10,21H14A2,2 0 0,1 12,23A2,2 0 0,1 10,21M21,19V20H3V19L5,17V11C5,7.9 7.03,5.17 10,4.29C10,4.19 10,4.1 10,4A2,2 0 0,1 12,2A2,2 0 0,1 14,4C14,4.1 14,4.19 14,4.29C16.97,5.17 19,7.9 19,11V17L21,19M15,9H9V11H12.24L9,13.7V16H15V14H11.76L15,11.3V9Z",ZT="M4,4H7L9,2H15L17,4H20A2,2 0 0,1 22,6V18A2,2 0 0,1 20,20H4A2,2 0 0,1 2,18V6A2,2 0 0,1 4,4M12,7A5,5 0 0,0 7,12A5,5 0 0,0 12,17A5,5 0 0,0 17,12A5,5 0 0,0 12,7M12,9A3,3 0 0,1 15,12A3,3 0 0,1 12,15A3,3 0 0,1 9,12A3,3 0 0,1 12,9Z",YT="M12 2C17.5 2 22 6.5 22 12S17.5 22 12 22 2 17.5 2 12 6.5 2 12 2M12 4C10.1 4 8.4 4.6 7.1 5.7L18.3 16.9C19.3 15.5 20 13.8 20 12C20 7.6 16.4 4 12 4M16.9 18.3L5.7 7.1C4.6 8.4 4 10.1 4 12C4 16.4 7.6 20 12 20C13.9 20 15.6 19.4 16.9 18.3Z",KT="M11,15H13V17H11V15M11,7H13V13H11V7M12,3A9,9 0 0,0 3,12A9,9 0 0,0 12,21A9,9 0 0,0 21,12A9,9 0 0,0 12,3M12,19C8.14,19 5,15.86 5,12C5,8.14 8.14,5 12,5C15.86,5 19,8.14 19,12C19,15.86 15.86,19 12,19M20.5,20.5C22.66,18.31 24,15.31 24,12C24,8.69 22.66,5.69 20.5,3.5L19.42,4.58C21.32,6.5 22.5,9.11 22.5,12C22.5,14.9 21.32,17.5 19.42,19.42L20.5,20.5M4.58,19.42C2.68,17.5 1.5,14.9 1.5,12C1.5,9.11 2.68,6.5 4.58,4.58L3.5,3.5C1.34,5.69 0,8.69 0,12C0,15.31 1.34,18.31 3.5,20.5L4.58,19.42Z",XT="M3,14L3.5,14.07L8.07,9.5C7.89,8.85 8.06,8.11 8.59,7.59C9.37,6.8 10.63,6.8 11.41,7.59C11.94,8.11 12.11,8.85 11.93,9.5L14.5,12.07L15,12C15.18,12 15.35,12 15.5,12.07L19.07,8.5C19,8.35 19,8.18 19,8A2,2 0 0,1 21,6A2,2 0 0,1 23,8A2,2 0 0,1 21,10C20.82,10 20.65,10 20.5,9.93L16.93,13.5C17,13.65 17,13.82 17,14A2,2 0 0,1 15,16A2,2 0 0,1 13,14L13.07,13.5L10.5,10.93C10.18,11 9.82,11 9.5,10.93L4.93,15.5L5,16A2,2 0 0,1 3,18A2,2 0 0,1 1,16A2,2 0 0,1 3,14Z",QT="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z",JT="M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M12 20C7.59 20 4 16.41 4 12S7.59 4 12 4 20 7.59 20 12 16.41 20 12 20M16.59 7.58L10 14.17L7.41 11.59L6 13L10 17L18 9L16.59 7.58Z",ek="M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z",tk="M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3M19,5V19H5V5H19Z",rk="M19,19H5V5H15V3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V11H19M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z",sk="M22,16A2,2 0 0,1 20,18H8C6.89,18 6,17.1 6,16V4C6,2.89 6.89,2 8,2H20A2,2 0 0,1 22,4V16M16,20V22H4A2,2 0 0,1 2,20V7H4V20H16Z",nk="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z",ik="M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z",ak="M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z",ok="M7.41,15.41L12,10.83L16.59,15.41L18,14L12,8L6,14L7.41,15.41Z",lk="M6,4H18V5H21V7H18V9H21V11H18V13H21V15H18V17H21V19H18V20H6V19H3V17H6V15H3V13H6V11H3V9H6V7H3V5H6V4M11,15V18H12V15H11M13,15V18H14V15H13M15,15V18H16V15H15Z",ck="M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z",uk="M12 2C17.5 2 22 6.5 22 12C22 17.5 17.5 22 12 22C6.5 22 2 17.5 2 12C2 6.5 6.5 2 12 2M12 4C7.58 4 4 7.58 4 12C4 16.42 7.58 20 12 20C16.42 20 20 16.42 20 12C20 7.58 16.42 4 12 4M12 5C15.87 5 19 8.13 19 12C19 13.93 18.22 15.68 16.95 16.95L12 12V5Z",dk="M12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22C6.47,22 2,17.5 2,12A10,10 0 0,1 12,2M12.5,7V12.25L17,14.92L16.25,16.15L11,13V7H12.5Z",pk="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",hk="M21.86 12.5C21.1 11.63 20.15 11.13 19 11C19 9.05 18.32 7.4 16.96 6.04C15.6 4.68 13.95 4 12 4C10.42 4 9 4.47 7.75 5.43S5.67 7.62 5.25 9.15C4 9.43 2.96 10.08 2.17 11.1S1 13.28 1 14.58C1 16.09 1.54 17.38 2.61 18.43C3.69 19.5 5 20 6.5 20H18.5C19.75 20 20.81 19.56 21.69 18.69C22.56 17.81 23 16.75 23 15.5C23 14.35 22.62 13.35 21.86 12.5M13 17H11V15H13V17M13 13H11V7H13V13Z",fk="M13 19C13 19.34 13.04 19.67 13.09 20H6.5C5 20 3.69 19.5 2.61 18.43C1.54 17.38 1 16.09 1 14.58C1 13.28 1.39 12.12 2.17 11.1S4 9.43 5.25 9.15C5.67 7.62 6.5 6.38 7.75 5.43S10.42 4 12 4C13.95 4 15.6 4.68 16.96 6.04C18.32 7.4 19 9.05 19 11C20.15 11.13 21.1 11.63 21.86 12.5C22.37 13.07 22.7 13.71 22.86 14.42C21.82 13.54 20.5 13 19 13C15.69 13 13 15.69 13 19M17.75 19.43L16.16 17.84L15 19L17.75 22L22.5 17.25L21.34 15.84L17.75 19.43Z",mk="M5,3H7V5H5V10A2,2 0 0,1 3,12A2,2 0 0,1 5,14V19H7V21H5C3.93,20.73 3,20.1 3,19V15A2,2 0 0,0 1,13H0V11H1A2,2 0 0,0 3,9V5A2,2 0 0,1 5,3M19,3A2,2 0 0,1 21,5V9A2,2 0 0,0 23,11H24V13H23A2,2 0 0,0 21,15V19A2,2 0 0,1 19,21H17V19H19V14A2,2 0 0,1 21,12A2,2 0 0,1 19,10V5H17V3H19M12,15A1,1 0 0,1 13,16A1,1 0 0,1 12,17A1,1 0 0,1 11,16A1,1 0 0,1 12,15M8,15A1,1 0 0,1 9,16A1,1 0 0,1 8,17A1,1 0 0,1 7,16A1,1 0 0,1 8,15M16,15A1,1 0 0,1 17,16A1,1 0 0,1 16,17A1,1 0 0,1 15,16A1,1 0 0,1 16,15Z",gk="M12,15.5A3.5,3.5 0 0,1 8.5,12A3.5,3.5 0 0,1 12,8.5A3.5,3.5 0 0,1 15.5,12A3.5,3.5 0 0,1 12,15.5M19.43,12.97C19.47,12.65 19.5,12.33 19.5,12C19.5,11.67 19.47,11.34 19.43,11L21.54,9.37C21.73,9.22 21.78,8.95 21.66,8.73L19.66,5.27C19.54,5.05 19.27,4.96 19.05,5.05L16.56,6.05C16.04,5.66 15.5,5.32 14.87,5.07L14.5,2.42C14.46,2.18 14.25,2 14,2H10C9.75,2 9.54,2.18 9.5,2.42L9.13,5.07C8.5,5.32 7.96,5.66 7.44,6.05L4.95,5.05C4.73,4.96 4.46,5.05 4.34,5.27L2.34,8.73C2.21,8.95 2.27,9.22 2.46,9.37L4.57,11C4.53,11.34 4.5,11.67 4.5,12C4.5,12.33 4.53,12.65 4.57,12.97L2.46,14.63C2.27,14.78 2.21,15.05 2.34,15.27L4.34,18.73C4.46,18.95 4.73,19.03 4.95,18.95L7.44,17.94C7.96,18.34 8.5,18.68 9.13,18.93L9.5,21.58C9.54,21.82 9.75,22 10,22H14C14.25,22 14.46,21.82 14.5,21.58L14.87,18.93C15.5,18.67 16.04,18.34 16.56,17.94L19.05,18.95C19.27,19.03 19.54,18.95 19.66,18.73L21.66,15.27C21.78,15.05 21.73,14.78 21.54,14.63L19.43,12.97Z",vk="M15.9,18.45C17.25,18.45 18.35,17.35 18.35,16C18.35,14.65 17.25,13.55 15.9,13.55C14.54,13.55 13.45,14.65 13.45,16C13.45,17.35 14.54,18.45 15.9,18.45M21.1,16.68L22.58,17.84C22.71,17.95 22.75,18.13 22.66,18.29L21.26,20.71C21.17,20.86 21,20.92 20.83,20.86L19.09,20.16C18.73,20.44 18.33,20.67 17.91,20.85L17.64,22.7C17.62,22.87 17.47,23 17.3,23H14.5C14.32,23 14.18,22.87 14.15,22.7L13.89,20.85C13.46,20.67 13.07,20.44 12.71,20.16L10.96,20.86C10.81,20.92 10.62,20.86 10.54,20.71L9.14,18.29C9.05,18.13 9.09,17.95 9.22,17.84L10.7,16.68L10.65,16L10.7,15.31L9.22,14.16C9.09,14.05 9.05,13.86 9.14,13.71L10.54,11.29C10.62,11.13 10.81,11.07 10.96,11.13L12.71,11.84C13.07,11.56 13.46,11.32 13.89,11.15L14.15,9.29C14.18,9.13 14.32,9 14.5,9H17.3C17.47,9 17.62,9.13 17.64,9.29L17.91,11.15C18.33,11.32 18.73,11.56 19.09,11.84L20.83,11.13C21,11.07 21.17,11.13 21.26,11.29L22.66,13.71C22.75,13.86 22.71,14.05 22.58,14.16L21.1,15.31L21.15,16L21.1,16.68M6.69,8.07C7.56,8.07 8.26,7.37 8.26,6.5C8.26,5.63 7.56,4.92 6.69,4.92A1.58,1.58 0 0,0 5.11,6.5C5.11,7.37 5.82,8.07 6.69,8.07M10.03,6.94L11,7.68C11.07,7.75 11.09,7.87 11.03,7.97L10.13,9.53C10.08,9.63 9.96,9.67 9.86,9.63L8.74,9.18L8,9.62L7.81,10.81C7.79,10.92 7.7,11 7.59,11H5.79C5.67,11 5.58,10.92 5.56,10.81L5.4,9.62L4.64,9.18L3.5,9.63C3.41,9.67 3.3,9.63 3.24,9.53L2.34,7.97C2.28,7.87 2.31,7.75 2.39,7.68L3.34,6.94L3.31,6.5L3.34,6.06L2.39,5.32C2.31,5.25 2.28,5.13 2.34,5.03L3.24,3.47C3.3,3.37 3.41,3.33 3.5,3.37L4.63,3.82L5.4,3.38L5.56,2.19C5.58,2.08 5.67,2 5.79,2H7.59C7.7,2 7.79,2.08 7.81,2.19L8,3.38L8.74,3.82L9.86,3.37C9.96,3.33 10.08,3.37 10.13,3.47L11.03,5.03C11.09,5.13 11.07,5.25 11,5.32L10.03,6.06L10.06,6.5L10.03,6.94Z",_k="M20,19V7H4V19H20M20,3A2,2 0 0,1 22,5V19A2,2 0 0,1 20,21H4A2,2 0 0,1 2,19V5C2,3.89 2.9,3 4,3H20M13,17V15H18V17H13M9.58,13L5.57,9H8.4L11.7,12.3C12.09,12.69 12.09,13.33 11.7,13.72L8.42,17H5.59L9.58,13Z",yk="M13,19V16H21V19H13M8.5,13L2.47,7H6.71L11.67,11.95C12.25,12.54 12.25,13.5 11.67,14.07L6.74,19H2.5L8.5,13Z",bk="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z",$k="M11,17H4A2,2 0 0,1 2,15V3A2,2 0 0,1 4,1H16V3H4V15H11V13L15,16L11,19V17M19,21V7H8V13H6V7A2,2 0 0,1 8,5H19A2,2 0 0,1 21,7V21A2,2 0 0,1 19,23H8A2,2 0 0,1 6,21V19H8V21H19Z",Sk="M17 3H5C3.89 3 3 3.9 3 5V19C3 20.1 3.89 21 5 21H19C20.1 21 21 20.1 21 19V7L17 3M19 19H5V5H16.17L19 7.83V19M12 12C10.34 12 9 13.34 9 15S10.34 18 12 18 15 16.66 15 15 13.66 12 12 12M6 6H15V10H6V6Z",wk="M17,22V20H20V17H22V20.5C22,20.89 21.84,21.24 21.54,21.54C21.24,21.84 20.89,22 20.5,22H17M7,22H3.5C3.11,22 2.76,21.84 2.46,21.54C2.16,21.24 2,20.89 2,20.5V17H4V20H7V22M17,2H20.5C20.89,2 21.24,2.16 21.54,2.46C21.84,2.76 22,3.11 22,3.5V7H20V4H17V2M7,2V4H4V7H2V3.5C2,3.11 2.16,2.76 2.46,2.46C2.76,2.16 3.11,2 3.5,2H7M13,17.25L17,14.95V10.36L13,12.66V17.25M12,10.92L16,8.63L12,6.28L8,8.63L12,10.92M7,14.95L11,17.25V12.66L7,10.36V14.95M18.23,7.59C18.73,7.91 19,8.34 19,8.91V15.23C19,15.8 18.73,16.23 18.23,16.55L12.75,19.73C12.25,20.05 11.75,20.05 11.25,19.73L5.77,16.55C5.27,16.23 5,15.8 5,15.23V8.91C5,8.34 5.27,7.91 5.77,7.59L11.25,4.41C11.5,4.28 11.75,4.22 12,4.22C12.25,4.22 12.5,4.28 12.75,4.41L18.23,7.59Z",xk="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",q$="M8,2H16A2,2 0 0,1 18,4V20A2,2 0 0,1 16,22H8A2,2 0 0,1 6,20V4A2,2 0 0,1 8,2M8,4V6H16V4H8M16,8H8V10H16V8M16,18H14V20H16V18Z",Ck="M12 16C13.1 16 14 16.9 14 18S13.1 20 12 20 10 19.1 10 18 10.9 16 12 16M12 10C13.1 10 14 10.9 14 12S13.1 14 12 14 10 13.1 10 12 10.9 10 12 10M12 4C13.1 4 14 4.9 14 6S13.1 8 12 8 10 7.1 10 6 10.9 4 12 4M6 16C7.1 16 8 16.9 8 18S7.1 20 6 20 4 19.1 4 18 4.9 16 6 16M6 10C7.1 10 8 10.9 8 12S7.1 14 6 14 4 13.1 4 12 4.9 10 6 10M6 4C7.1 4 8 4.9 8 6S7.1 8 6 8 4 7.1 4 6 4.9 4 6 4M18 16C19.1 16 20 16.9 20 18S19.1 20 18 20 16 19.1 16 18 16.9 16 18 16M18 10C19.1 10 20 10.9 20 12S19.1 14 18 14 16 13.1 16 12 16.9 10 18 10M18 4C19.1 4 20 4.9 20 6S19.1 8 18 8 16 7.1 16 6 16.9 4 18 4Z",Pk="M16,12A2,2 0 0,1 18,10A2,2 0 0,1 20,12A2,2 0 0,1 18,14A2,2 0 0,1 16,12M10,12A2,2 0 0,1 12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12M4,12A2,2 0 0,1 6,10A2,2 0 0,1 8,12A2,2 0 0,1 6,14A2,2 0 0,1 4,12Z",Lk="M12,16A2,2 0 0,1 14,18A2,2 0 0,1 12,20A2,2 0 0,1 10,18A2,2 0 0,1 12,16M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10M12,4A2,2 0 0,1 14,6A2,2 0 0,1 12,8A2,2 0 0,1 10,6A2,2 0 0,1 12,4Z",Ak="M5,20H19V18H5M19,9H15V3H9V9H5L12,16L19,9Z",Ek="M7,19V17H9V19H7M11,19V17H13V19H11M15,19V17H17V19H15M7,15V13H9V15H7M11,15V13H13V15H11M15,15V13H17V15H15M7,11V9H9V11H7M11,11V9H13V11H11M15,11V9H17V11H15M7,7V5H9V7H7M11,7V5H13V7H11M15,7V5H17V7H15Z",Ok="M12,11A1,1 0 0,0 11,12A1,1 0 0,0 12,13A1,1 0 0,0 13,12A1,1 0 0,0 12,11M12.5,2C17,2 17.11,5.57 14.75,6.75C13.76,7.24 13.32,8.29 13.13,9.22C13.61,9.42 14.03,9.73 14.35,10.13C18.05,8.13 22.03,8.92 22.03,12.5C22.03,17 18.46,17.1 17.28,14.73C16.78,13.74 15.72,13.3 14.79,13.11C14.59,13.59 14.28,14 13.88,14.34C15.87,18.03 15.08,22 11.5,22C7,22 6.91,18.42 9.27,17.24C10.25,16.75 10.69,15.71 10.89,14.79C10.4,14.59 9.97,14.27 9.65,13.87C5.96,15.85 2,15.07 2,11.5C2,7 5.56,6.89 6.74,9.26C7.24,10.25 8.29,10.68 9.22,10.87C9.41,10.39 9.73,9.97 10.14,9.65C8.15,5.96 8.94,2 12.5,2Z",Tk="M13,9V3.5L18.5,9M6,2C4.89,2 4,2.89 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2H6Z",kk="M13,9H18.5L13,3.5V9M6,2H14L20,8V20A2,2 0 0,1 18,22H6C4.89,22 4,21.1 4,20V4C4,2.89 4.89,2 6,2M10.5,11C8,11 6,13 6,15.5C6,18 8,20 10.5,20C13,20 15,18 15,15.5C15,13 13,11 10.5,11M10.5,12.5A3,3 0 0,1 13.5,15.5C13.5,16.06 13.35,16.58 13.08,17L9,12.92C9.42,12.65 9.94,12.5 10.5,12.5M7.5,15.5C7.5,14.94 7.65,14.42 7.92,14L12,18.08C11.58,18.35 11.06,18.5 10.5,18.5A3,3 0 0,1 7.5,15.5Z",Dk="M14 2H6C4.89 2 4 2.9 4 4V20C4 21.11 4.89 22 6 22H18C19.11 22 20 21.11 20 20V8L14 2M18 20H6V4H13V9H18V20M9.54 15.65L11.63 17.74L10.35 19L7 15.65L10.35 12.3L11.63 13.56L9.54 15.65M17 15.65L13.65 19L12.38 17.74L14.47 15.65L12.38 13.56L13.65 12.3L17 15.65Z",Mk="M13,9H18.5L13,3.5V9M6,2H14L20,8V20A2,2 0 0,1 18,22H6C4.89,22 4,21.1 4,20V4C4,2.89 4.89,2 6,2M6,20H15L18,20V12L14,16L12,14L6,20M8,9A2,2 0 0,0 6,11A2,2 0 0,0 8,13A2,2 0 0,0 10,11A2,2 0 0,0 8,9Z",Rk="M18 13C16.6 13 15.2 14.1 15.2 15.5V17C14.6 17 14 17.6 14 18.2V21.7C14 22.4 14.6 23 15.2 23H20.7C21.4 23 22 22.4 22 21.8V18.3C22 17.6 21.4 17 20.8 17V15.5C20.8 14.1 19.4 13 18 13M18 14.2C18.8 14.2 19.5 14.7 19.5 15.5V17H16.5V15.5C16.5 14.7 17.2 14.2 18 14.2M6 2C4.9 2 4 2.9 4 4V20C4 21.1 4.9 22 6 22H12V18.2C12 17.2 12.4 16.5 13 16C13.1 15.9 13.2 15.9 13.2 15.8V15.5C13.2 12.8 15.6 11 18 11C18.7 11 19.4 11.2 20 11.4V8L14 2H6M13 3.5L18.5 9H13V3.5Z",Ik="M14 2H6C4.89 2 4 2.89 4 4V20C4 21.11 4.89 22 6 22H13.81C13.28 21.09 13 20.05 13 19C13 15.69 15.69 13 19 13C19.34 13 19.67 13.03 20 13.08V8L14 2M13 9V3.5L18.5 9H13M23 20H20V23H18V20H15V18H18V15H20V18H23V20Z",Fk="M18 14.5C19.11 14.5 20.11 14.95 20.83 15.67L22 14.5V18.5H18L19.77 16.73C19.32 16.28 18.69 16 18 16C16.62 16 15.5 17.12 15.5 18.5C15.5 19.88 16.62 21 18 21C18.82 21 19.54 20.61 20 20H21.71C21.12 21.47 19.68 22.5 18 22.5C15.79 22.5 14 20.71 14 18.5C14 16.29 15.79 14.5 18 14.5M14 2L20 8V12.17C19.5 12.06 19 12 18.5 12L18 12V9H13V4H6V20H12.17C12.34 20.72 12.63 21.39 13 22H6C4.9 22 4 21.1 4 20V4C4 2.9 4.9 2 6 2H14Z",Hk="M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M18,20H6V4H13V9H18V20M10,13H7V11H10V13M14,13H11V11H14V13M10,16H7V14H10V16M14,16H11V14H14V16M10,19H7V17H10V19M14,19H11V17H14V19Z",Bk="M14,2L20,8V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V4A2,2 0 0,1 6,2H14M18,20V9H13V4H6V20H18M16,18L13.5,16.3V18H8V13H13.5V14.7L16,13V18Z",jk="M15,19.88C15.04,20.18 14.94,20.5 14.71,20.71C14.32,21.1 13.69,21.1 13.3,20.71L9.29,16.7C9.06,16.47 8.96,16.16 9,15.87V10.75L4.21,4.62C3.87,4.19 3.95,3.56 4.38,3.22C4.57,3.08 4.78,3 5,3V3H19V3C19.22,3 19.43,3.08 19.62,3.22C20.05,3.56 20.13,4.19 19.79,4.62L15,10.75V19.88M7.04,5L11,10.06V15.58L13,17.58V10.05L16.96,5H7.04Z",Vk="M17.66 11.2C17.43 10.9 17.15 10.64 16.89 10.38C16.22 9.78 15.46 9.35 14.82 8.72C13.33 7.26 13 4.85 13.95 3C13 3.23 12.17 3.75 11.46 4.32C8.87 6.4 7.85 10.07 9.07 13.22C9.11 13.32 9.15 13.42 9.15 13.55C9.15 13.77 9 13.97 8.8 14.05C8.57 14.15 8.33 14.09 8.14 13.93C8.08 13.88 8.04 13.83 8 13.76C6.87 12.33 6.69 10.28 7.45 8.64C5.78 10 4.87 12.3 5 14.47C5.06 14.97 5.12 15.47 5.29 15.97C5.43 16.57 5.7 17.17 6 17.7C7.08 19.43 8.95 20.67 10.96 20.92C13.1 21.19 15.39 20.8 17.03 19.32C18.86 17.66 19.5 15 18.56 12.72L18.43 12.46C18.22 12 17.66 11.2 17.66 11.2M14.5 17.5C14.22 17.74 13.76 18 13.4 18.1C12.28 18.5 11.16 17.94 10.5 17.28C11.69 17 12.4 16.12 12.61 15.23C12.78 14.43 12.46 13.77 12.33 13C12.21 12.26 12.23 11.63 12.5 10.94C12.69 11.32 12.89 11.7 13.13 12C13.9 13 15.11 13.44 15.37 14.8C15.41 14.94 15.43 15.08 15.43 15.23C15.46 16.05 15.1 16.95 14.5 17.5H14.5Z",Nk="M15.66 11.2C15.43 10.9 15.15 10.64 14.89 10.38C14.22 9.78 13.46 9.35 12.82 8.72C11.33 7.26 11 4.85 11.95 3C11 3.23 10.17 3.75 9.46 4.32C6.87 6.4 5.85 10.07 7.07 13.22C7.11 13.32 7.15 13.42 7.15 13.55C7.15 13.77 7 13.97 6.8 14.05C6.57 14.15 6.33 14.09 6.14 13.93C6.08 13.88 6.04 13.83 6 13.76C4.87 12.33 4.69 10.28 5.45 8.64C3.78 10 2.87 12.3 3 14.47C3.06 14.97 3.12 15.47 3.29 15.97C3.43 16.57 3.7 17.17 4 17.7C5.08 19.43 6.95 20.67 8.96 20.92C11.1 21.19 13.39 20.8 15.03 19.32C16.86 17.66 17.5 15 16.56 12.72L16.43 12.46C16.22 12 15.66 11.2 15.66 11.2M12.5 17.5C12.22 17.74 11.76 18 11.4 18.1C10.28 18.5 9.16 17.94 8.5 17.28C9.69 17 10.4 16.12 10.61 15.23C10.78 14.43 10.46 13.77 10.33 13C10.21 12.26 10.23 11.63 10.5 10.94C10.69 11.32 10.89 11.7 11.13 12C11.9 13 13.11 13.44 13.37 14.8C13.41 14.94 13.43 15.08 13.43 15.23C13.46 16.05 13.1 16.95 12.5 17.5H12.5M21 13H19V7H21V13M21 17H19V15H21V17Z",zk="M10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6H12L10,4Z",Uk="M22 8V13.81C21.12 13.3 20.1 13 19 13C15.69 13 13 15.69 13 19C13 19.34 13.04 19.67 13.09 20H4C2.9 20 2 19.11 2 18V6C2 4.89 2.89 4 4 4H10L12 6H20C21.1 6 22 6.89 22 8M16 18H18V22H20V18H22L19 15L16 18Z",Wk="M13 20H4C2.9 20 2 19.11 2 18V6C2 4.89 2.89 4 4 4H10L12 6H20C21.1 6 22 6.89 22 8V11.04C21.17 10.4 20.13 10 19 10C16.4 10 14.2 12.06 14.2 14.5V14.74C13.5 15.34 13 16.24 13 17.2V20M23 17.3V20.8C23 21.4 22.4 22 21.7 22H16.2C15.6 22 15 21.4 15 20.7V17.2C15 16.6 15.6 16 16.2 16V14.5C16.2 13.1 17.6 12 19 12S21.8 13.1 21.8 14.5V16C22.4 16 23 16.6 23 17.3M20.5 14.5C20.5 13.7 19.8 13.2 19 13.2S17.5 13.7 17.5 14.5V16H20.5V14.5Z",Gk="M14,18V15H10V11H14V8L19,13M20,6H12L10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6Z",qk="M19,20H4C2.89,20 2,19.1 2,18V6C2,4.89 2.89,4 4,4H10L12,6H19A2,2 0 0,1 21,8H21L4,8V18L6.14,10H23.21L20.93,18.5C20.7,19.37 19.92,20 19,20Z",Zk="M13 19C13 19.34 13.04 19.67 13.09 20H4C2.9 20 2 19.11 2 18V6C2 4.89 2.89 4 4 4H10L12 6H20C21.1 6 22 6.89 22 8V13.81C21.12 13.3 20.1 13 19 13C15.69 13 13 15.69 13 19M20 18V15H18V18H15V20H18V23H20V20H23V18H20Z",Yk="M20,6A2,2 0 0,1 22,8V18A2,2 0 0,1 20,20H4A2,2 0 0,1 2,18V6A2,2 0 0,1 4,4H10L12,6H20M10.75,13H14V17H16V13H19.25L15,8.75",Kk="M17,7H22V17H17V19A1,1 0 0,0 18,20H20V22H17.5C16.95,22 16,21.55 16,21C16,21.55 15.05,22 14.5,22H12V20H14A1,1 0 0,0 15,19V5A1,1 0 0,0 14,4H12V2H14.5C15.05,2 16,2.45 16,3C16,2.45 16.95,2 17.5,2H20V4H18A1,1 0 0,0 17,5V7M2,7H13V9H4V15H13V17H2V7M20,15V9H17V15H20Z",Xk="M10,13H22V11H10M10,19H22V17H10M10,7H22V5H10M6,7H8.5L5,3.5L1.5,7H4V17H1.5L5,20.5L8.5,17H6V7Z",Qk="M7,5H21V7H7V5M7,13V11H21V13H7M4,4.5A1.5,1.5 0 0,1 5.5,6A1.5,1.5 0 0,1 4,7.5A1.5,1.5 0 0,1 2.5,6A1.5,1.5 0 0,1 4,4.5M4,10.5A1.5,1.5 0 0,1 5.5,12A1.5,1.5 0 0,1 4,13.5A1.5,1.5 0 0,1 2.5,12A1.5,1.5 0 0,1 4,10.5M7,19V17H21V19H7M4,16.5A1.5,1.5 0 0,1 5.5,18A1.5,1.5 0 0,1 4,19.5A1.5,1.5 0 0,1 2.5,18A1.5,1.5 0 0,1 4,16.5Z",Jk="M5,5H10V7H7V10H5V5M14,5H19V10H17V7H14V5M17,14H19V19H14V17H17V14M10,17V19H5V14H7V17H10Z",eD="M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,4A8,8 0 0,1 20,12C20,14.4 19,16.5 17.3,18C15.9,16.7 14,16 12,16C10,16 8.2,16.7 6.7,18C5,16.5 4,14.4 4,12A8,8 0 0,1 12,4M14,5.89C13.62,5.9 13.26,6.15 13.1,6.54L11.81,9.77L11.71,10C11,10.13 10.41,10.6 10.14,11.26C9.73,12.29 10.23,13.45 11.26,13.86C12.29,14.27 13.45,13.77 13.86,12.74C14.12,12.08 14,11.32 13.57,10.76L13.67,10.5L14.96,7.29L14.97,7.26C15.17,6.75 14.92,6.17 14.41,5.96C14.28,5.91 14.15,5.89 14,5.89M10,6A1,1 0 0,0 9,7A1,1 0 0,0 10,8A1,1 0 0,0 11,7A1,1 0 0,0 10,6M7,9A1,1 0 0,0 6,10A1,1 0 0,0 7,11A1,1 0 0,0 8,10A1,1 0 0,0 7,9M17,9A1,1 0 0,0 16,10A1,1 0 0,0 17,11A1,1 0 0,0 18,10A1,1 0 0,0 17,9Z",tD="M1 22L2.5 17H9.5L11 22H1M13 22L14.5 17H21.5L23 22H13M6 15L7.5 10H14.5L16 15H6M23 6.05L19.14 7.14L18.05 11L16.96 7.14L13.1 6.05L16.96 4.96L18.05 1.1L19.14 4.96L23 6.05Z",rD="M13.78 15.3L19.78 21.3L21.89 19.14L15.89 13.14L13.78 15.3M17.5 10.1C17.11 10.1 16.69 10.05 16.36 9.91L4.97 21.25L2.86 19.14L10.27 11.74L8.5 9.96L7.78 10.66L6.33 9.25V12.11L5.63 12.81L2.11 9.25L2.81 8.55H5.62L4.22 7.14L7.78 3.58C8.95 2.41 10.83 2.41 12 3.58L9.89 5.74L11.3 7.14L10.59 7.85L12.38 9.63L14.2 7.75C14.06 7.42 14 7 14 6.63C14 4.66 15.56 3.11 17.5 3.11C18.09 3.11 18.61 3.25 19.08 3.53L16.41 6.2L17.91 7.7L20.58 5.03C20.86 5.5 21 6 21 6.63C21 8.55 19.45 10.1 17.5 10.1Z",sD="M13 24C9.74 24 6.81 22 5.6 19L2.57 11.37C2.26 10.58 3 9.79 3.81 10.05L4.6 10.31C5.16 10.5 5.62 10.92 5.84 11.47L7.25 15H8V3.25C8 2.56 8.56 2 9.25 2S10.5 2.56 10.5 3.25V12H11.5V1.25C11.5 .56 12.06 0 12.75 0S14 .56 14 1.25V12H15V2.75C15 2.06 15.56 1.5 16.25 1.5C16.94 1.5 17.5 2.06 17.5 2.75V12H18.5V5.75C18.5 5.06 19.06 4.5 19.75 4.5S21 5.06 21 5.75V16C21 20.42 17.42 24 13 24Z",nD="M6,2H18A2,2 0 0,1 20,4V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V4A2,2 0 0,1 6,2M12,4A6,6 0 0,0 6,10C6,13.31 8.69,16 12.1,16L11.22,13.77C10.95,13.29 11.11,12.68 11.59,12.4L12.45,11.9C12.93,11.63 13.54,11.79 13.82,12.27L15.74,14.69C17.12,13.59 18,11.9 18,10A6,6 0 0,0 12,4M12,9A1,1 0 0,1 13,10A1,1 0 0,1 12,11A1,1 0 0,1 11,10A1,1 0 0,1 12,9M7,18A1,1 0 0,0 6,19A1,1 0 0,0 7,20A1,1 0 0,0 8,19A1,1 0 0,0 7,18M12.09,13.27L14.58,19.58L17.17,18.08L12.95,12.77L12.09,13.27Z",iD="M15.07,11.25L14.17,12.17C13.45,12.89 13,13.5 13,15H11V14.5C11,13.39 11.45,12.39 12.17,11.67L13.41,10.41C13.78,10.05 14,9.55 14,9C14,7.89 13.1,7 12,7A2,2 0 0,0 10,9H8A4,4 0 0,1 12,5A4,4 0 0,1 16,9C16,9.88 15.64,10.67 15.07,11.25M13,19H11V17H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z",aD="M11,18H13V16H11V18M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,6A4,4 0 0,0 8,10H10A2,2 0 0,1 12,8A2,2 0 0,1 14,10C14,12 11,11.75 11,15H13C13,12.75 16,12.5 16,10A4,4 0 0,0 12,6Z",oD="M13.5,8H12V13L16.28,15.54L17,14.33L13.5,12.25V8M13,3A9,9 0 0,0 4,12H1L4.96,16.03L9,12H6A7,7 0 0,1 13,5A7,7 0 0,1 20,12A7,7 0 0,1 13,19C11.07,19 9.32,18.21 8.06,16.94L6.64,18.36C8.27,20 10.5,21 13,21A9,9 0 0,0 22,12A9,9 0 0,0 13,3",lD="M10,20V14H14V20H19V12H22L12,3L2,12H5V20H10Z",cD="M21,15H23V17H21V15M21,11H23V13H21V11M23,19H21V21C22,21 23,20 23,19M13,3H15V5H13V3M21,7H23V9H21V7M21,3V5H23C23,4 22,3 21,3M1,7H3V9H1V7M17,3H19V5H17V3M17,19H19V21H17V19M3,3C2,3 1,4 1,5H3V3M9,3H11V5H9V3M5,3H7V5H5V3M1,11V19A2,2 0 0,0 3,21H15V11H1M3,19L5.5,15.79L7.29,17.94L9.79,14.72L13,19H3Z",uD="M12,16L19.36,10.27L21,9L12,2L3,9L4.63,10.27M12,18.54L4.62,12.81L3,14.07L12,21.07L21,14.07L19.37,12.8L12,18.54Z",dD="M22,17V19H14V17H22M11,16L2,9L11,2L20,9L11,16M11,18.54L12,17.75V18C12,18.71 12.12,19.39 12.35,20L11,21.07L2,14.07L3.62,12.81L11,18.54Z",pD="M17,14H19V17H22V19H19V22H17V19H14V17H17V14M11,16L2,9L11,2L20,9L11,16M11,18.54L12,17.75V18C12,18.71 12.12,19.39 12.35,20L11,21.07L2,14.07L3.62,12.81L11,18.54Z",hD="M12 16.54L19.37 10.8L21 12.07L12 19.07L3 12.07L4.62 10.81L12 16.54M12 14L3 7L12 0L21 7L12 14M12 2.53L6.26 7L12 11.47L17.74 7L12 2.53M12 21.47L19.37 15.73L21 17L12 24L3 17L4.62 15.74L12 21.47",fD="M16.5 11L13 7.5L14.4 6.1L16.5 8.2L20.7 4L22.1 5.4L16.5 11M11 7H2V9H11V7M21 13.4L19.6 12L17 14.6L14.4 12L13 13.4L15.6 16L13 18.6L14.4 20L17 17.4L19.6 20L21 18.6L18.4 16L21 13.4M11 15H2V17H11V15Z",mD="M12,17A2,2 0 0,0 14,15C14,13.89 13.1,13 12,13A2,2 0 0,0 10,15A2,2 0 0,0 12,17M18,8A2,2 0 0,1 20,10V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V10C4,8.89 4.9,8 6,8H7V6A5,5 0 0,1 12,1A5,5 0 0,1 17,6V8H18M12,3A3,3 0 0,0 9,6V8H15V6A3,3 0 0,0 12,3Z",gD="M18 1C15.24 1 13 3.24 13 6V8H4C2.9 8 2 8.89 2 10V20C2 21.11 2.9 22 4 22H16C17.11 22 18 21.11 18 20V10C18 8.9 17.11 8 16 8H15V6C15 4.34 16.34 3 18 3C19.66 3 21 4.34 21 6V8H23V6C23 3.24 20.76 1 18 1M10 13C11.1 13 12 13.89 12 15C12 16.11 11.11 17 10 17C8.9 17 8 16.11 8 15C8 13.9 8.9 13 10 13Z",vD="M12.63,2C18.16,2 22.64,6.5 22.64,12C22.64,17.5 18.16,22 12.63,22C9.12,22 6.05,20.18 4.26,17.43L5.84,16.18C7.25,18.47 9.76,20 12.64,20A8,8 0 0,0 20.64,12A8,8 0 0,0 12.64,4C8.56,4 5.2,7.06 4.71,11H7.47L3.73,14.73L0,11H2.69C3.19,5.95 7.45,2 12.63,2M15.59,10.24C16.09,10.25 16.5,10.65 16.5,11.16V15.77C16.5,16.27 16.09,16.69 15.58,16.69H10.05C9.54,16.69 9.13,16.27 9.13,15.77V11.16C9.13,10.65 9.54,10.25 10.04,10.24V9.23C10.04,7.7 11.29,6.46 12.81,6.46C14.34,6.46 15.59,7.7 15.59,9.23V10.24M12.81,7.86C12.06,7.86 11.44,8.47 11.44,9.23V10.24H14.19V9.23C14.19,8.47 13.57,7.86 12.81,7.86Z",_D="M9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.44,13.73L14.71,14H15.5L20.5,19L19,20.5L14,15.5V14.71L13.73,14.44C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3M9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5Z",yD="M9,2A7,7 0 0,1 16,9C16,10.57 15.5,12 14.61,13.19L15.41,14H16L22,20L20,22L14,16V15.41L13.19,14.61C12,15.5 10.57,16 9,16A7,7 0 0,1 2,9A7,7 0 0,1 9,2M5,8V10H13V8H5Z",bD="M9,2A7,7 0 0,1 16,9C16,10.57 15.5,12 14.61,13.19L15.41,14H16L22,20L20,22L14,16V15.41L13.19,14.61C12,15.5 10.57,16 9,16A7,7 0 0,1 2,9A7,7 0 0,1 9,2M8,5V8H5V10H8V13H10V10H13V8H10V5H8Z",$D="M3,6H21V8H3V6M3,11H21V13H3V11M3,16H21V18H3V16Z",SD="M7,10L12,15L17,10H7Z",wD="M20,2A2,2 0 0,1 22,4V16A2,2 0 0,1 20,18H6L2,22V4C2,2.89 2.9,2 4,2H20M4,4V17.17L5.17,16H20V4H4M6,7H18V9H6V7M6,11H15V13H6V11Z",xD="M19,13H5V11H19V13Z",CD="M9,6H5V10H7V8H9M19,10H17V12H15V14H19M21,16H3V4H21M21,2H3C1.89,2 1,2.89 1,4V16A2,2 0 0,0 3,18H10V20H8V22H16V20H14V18H21A2,2 0 0,0 23,16V4C23,2.89 22.1,2 21,2",PD="M7 13H3C2.45 13 2 12.55 2 12S2.45 11 3 11H7C7.55 11 8 11.45 8 12S7.55 13 7 13M6 8C6 7.45 5.55 7 5 7H4C3.45 7 3 7.45 3 8S3.45 9 4 9H5C5.55 9 6 8.55 6 8M22 12C22 14.76 19.76 17 17 17H4C3.45 17 3 16.55 3 16S3.45 15 4 15H13C12.58 14.42 12.25 13.74 12.1 13H10C9.45 13 9 12.55 9 12S9.45 11 10 11H12.1C12.25 10.26 12.58 9.58 13 9H8C7.45 9 7 8.55 7 8S7.45 7 8 7H17C19.76 7 22 9.24 22 12M20 12C20 10.35 18.65 9 17 9S14 10.35 14 12C14 13.65 15.35 15 17 15S20 13.65 20 12Z",LD="M10,7V9H12V17H14V7H10Z",AD="M9,7V9H13V11H11A2,2 0 0,0 9,13V17H11L15,17V15H11V13H13A2,2 0 0,0 15,11V9A2,2 0 0,0 13,7H9Z",ED="M15,15V13.5A1.5,1.5 0 0,0 13.5,12A1.5,1.5 0 0,0 15,10.5V9C15,7.89 14.1,7 13,7H9V9H13V11H11V13H13V15H9V17H13A2,2 0 0,0 15,15",OD="M9,7V13H13V17H15V7H13V11H11V7H9Z",TD="M12,10L8,14H11V20H13V14H16M19,4H5C3.89,4 3,4.9 3,6V18A2,2 0 0,0 5,20H9V18H5V8H19V18H15V20H19A2,2 0 0,0 21,18V6A2,2 0 0,0 19,4Z",kD="M14,3V5H17.59L7.76,14.83L9.17,16.24L19,6.41V10H21V3M19,19H5V5H12V3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V12H19V19Z",DD="M14,19H18V5H14M6,19H10V5H6V19Z",MD="M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z",RD="M5.5,2A2.5,2.5 0 0,0 3,4.5V5A1,1 0 0,0 2,6V10A1,1 0 0,0 3,11H8A1,1 0 0,0 9,10V6A1,1 0 0,0 8,5V4.5A2.5,2.5 0 0,0 5.5,2M5.5,3A1.5,1.5 0 0,1 7,4.5V5H4V4.5A1.5,1.5 0 0,1 5.5,3M19.66,3C19.4,3 19.16,3.09 18.97,3.28L17.13,5.13L20.88,8.88L22.72,7.03C23.11,6.64 23.11,6 22.72,5.63L20.38,3.28C20.18,3.09 19.91,3 19.66,3M16.06,6.19L5,17.25V21H8.75L19.81,9.94L16.06,6.19Z",Z$="M8,5.14V19.14L19,12.14L8,5.14Z",ID="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",FD="M16.56,5.44L15.11,6.89C16.84,7.94 18,9.83 18,12A6,6 0 0,1 12,18A6,6 0 0,1 6,12C6,9.83 7.16,7.94 8.88,6.88L7.44,5.44C5.36,6.88 4,9.28 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12C20,9.28 18.64,6.88 16.56,5.44M13,3H11V13H13",HD="M12,3A9,9 0 0,0 3,12A9,9 0 0,0 12,21A9,9 0 0,0 21,12A9,9 0 0,0 12,3M12,19A7,7 0 0,1 5,12A7,7 0 0,1 12,5A7,7 0 0,1 19,12A7,7 0 0,1 12,19M13,17H11V7H13V17Z",Y$="M18,3H6V7H18M19,12A1,1 0 0,1 18,11A1,1 0 0,1 19,10A1,1 0 0,1 20,11A1,1 0 0,1 19,12M16,19H8V14H16M19,8H5A3,3 0 0,0 2,11V17H6V21H18V17H22V11A3,3 0 0,0 19,8Z",BD="M19,6A1,1 0 0,0 20,5A1,1 0 0,0 19,4A1,1 0 0,0 18,5A1,1 0 0,0 19,6M19,2A3,3 0 0,1 22,5V11H18V7H6V11H2V5A3,3 0 0,1 5,2H19M18,18.25C18,18.63 17.79,18.96 17.47,19.13L12.57,21.82C12.4,21.94 12.21,22 12,22C11.79,22 11.59,21.94 11.43,21.82L6.53,19.13C6.21,18.96 6,18.63 6,18.25V13C6,12.62 6.21,12.29 6.53,12.12L11.43,9.68C11.59,9.56 11.79,9.5 12,9.5C12.21,9.5 12.4,9.56 12.57,9.68L17.47,12.12C17.79,12.29 18,12.62 18,13V18.25M12,11.65L9.04,13L12,14.6L14.96,13L12,11.65M8,17.66L11,19.29V16.33L8,14.71V17.66M16,17.66V14.71L13,16.33V19.29L16,17.66Z",jD="M7,2H17V8H19V13H16.5L13,17H11L7.5,13H5V8H7V2M10,22H2V20H10A1,1 0 0,0 11,19V18H13V19A3,3 0 0,1 10,22Z",VD="M7 2H17V7H19V13H16.5L13 17H11L7.5 13H5V7H7V2M10 22H2V20H10C10.6 20 11 19.5 11 19V18H13V19C13 20.7 11.7 22 10 22M7 9V11H8.5L12 15L15.5 11H17V9H15V4H9V9H7M21 13V7H23V13H21M21 17V15H23V17H21Z",ND="M7,2H17V7H19V13H16.5L13,17H11L7.5,13H5V7H7V2M10,22H2V20H10A1,1 0 0,0 11,19V18H13V19A3,3 0 0,1 10,22M7,9V11H8.5L12,15L15.5,11H17V9H15V4H9V9H7Z",zD="M13 18H11V16H13V18M13 15H11C11 11.75 14 12 14 10C14 8.9 13.1 8 12 8C10.9 8 10 8.9 10 10H8C8 7.79 9.79 6 12 6C14.21 6 16 7.79 16 10C16 12.5 13 12.75 13 15M22 12C22 17.18 18.05 21.45 13 21.95V19.94C16.95 19.45 20 16.08 20 12C20 7.92 16.95 4.55 13 4.06V2.05C18.05 2.55 22 6.82 22 12M11 2.05V4.06C9.54 4.24 8.2 4.82 7.09 5.68L5.67 4.26C7.15 3.05 9 2.25 11 2.05M4.06 11H2.05C2.25 9 3.05 7.15 4.26 5.67L5.68 7.1C4.82 8.2 4.24 9.54 4.06 11M11 19.94V21.95C9 21.75 7.15 20.96 5.67 19.74L7.09 18.32C8.2 19.18 9.54 19.76 11 19.94M2.05 13H4.06C4.24 14.46 4.82 15.8 5.68 16.91L4.26 18.33C3.05 16.85 2.25 15 2.05 13Z",UD="M13,2.03C17.73,2.5 21.5,6.25 21.95,11C22.5,16.5 18.5,21.38 13,21.93V19.93C16.64,19.5 19.5,16.61 19.96,12.97C20.5,8.58 17.39,4.59 13,4.05V2.05L13,2.03M11,2.06V4.06C9.57,4.26 8.22,4.84 7.1,5.74L5.67,4.26C7.19,3 9.05,2.25 11,2.06M4.26,5.67L5.69,7.1C4.8,8.23 4.24,9.58 4.05,11H2.05C2.25,9.04 3,7.19 4.26,5.67M2.06,13H4.06C4.24,14.42 4.81,15.77 5.69,16.9L4.27,18.33C3.03,16.81 2.26,14.96 2.06,13M7.1,18.37C8.23,19.25 9.58,19.82 11,20V22C9.04,21.79 7.18,21 5.67,19.74L7.1,18.37M12,7.5L7.5,12H11V16H13V12H16.5L12,7.5Z",WD="M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,7A5,5 0 0,0 7,12A5,5 0 0,0 12,17A5,5 0 0,0 17,12A5,5 0 0,0 12,7Z",GD="M17.65,6.35C16.2,4.9 14.21,4 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20C15.73,20 18.84,17.45 19.73,14H17.65C16.83,16.33 14.61,18 12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6C13.66,6 15.14,6.69 16.22,7.78L13,11H20V4L17.65,6.35Z",qD="M12,4C14.1,4 16.1,4.8 17.6,6.3C20.7,9.4 20.7,14.5 17.6,17.6C15.8,19.5 13.3,20.2 10.9,19.9L11.4,17.9C13.1,18.1 14.9,17.5 16.2,16.2C18.5,13.9 18.5,10.1 16.2,7.7C15.1,6.6 13.5,6 12,6V10.6L7,5.6L12,0.6V4M6.3,17.6C3.7,15 3.3,11 5.1,7.9L6.6,9.4C5.5,11.6 5.9,14.4 7.8,16.2C8.3,16.7 8.9,17.1 9.6,17.4L9,19.4C8,19 7.1,18.4 6.3,17.6Z",ZD="M10 4.03V.633L5 5.63L10 10.63V6.03C11.5 6.03 13.11 6.63 14.21 7.73C16.5 10.13 16.5 13.93 14.21 16.23C12.91 17.53 11.11 18.13 9.4 17.93L8.9 19.93C11.31 20.23 13.81 19.53 15.61 17.63C18.7 14.53 18.7 9.43 15.61 6.33C14.11 4.83 12.11 4.03 10 4.03M4.31 17.63C5.11 18.43 6 19.03 7 19.43L7.61 17.43C6.91 17.13 6.31 16.73 5.81 16.23C3.91 14.43 3.5 11.63 4.61 9.43L3.11 7.93C1.31 11.03 1.71 15.03 4.31 17.63M20 13H22V7H20V13M20 17H22V15H20V17Z",YD="M13,3A9,9 0 0,0 4,12H1L4.89,15.89L4.96,16.03L9,12H6A7,7 0 0,1 13,5A7,7 0 0,1 20,12A7,7 0 0,1 13,19C11.07,19 9.32,18.21 8.06,16.94L6.64,18.36C8.27,20 10.5,21 13,21A9,9 0 0,0 22,12A9,9 0 0,0 13,3Z",KD="M13,4.07V1L8.45,5.55L13,10V6.09C15.84,6.57 18,9.03 18,12C18,14.97 15.84,17.43 13,17.91V19.93C16.95,19.44 20,16.08 20,12C20,7.92 16.95,4.56 13,4.07M7.1,18.32C8.26,19.22 9.61,19.76 11,19.93V17.9C10.13,17.75 9.29,17.41 8.54,16.87L7.1,18.32M6.09,13H4.07C4.24,14.39 4.79,15.73 5.69,16.89L7.1,15.47C6.58,14.72 6.23,13.88 6.09,13M7.11,8.53L5.7,7.11C4.8,8.27 4.24,9.61 4.07,11H6.09C6.23,10.13 6.58,9.28 7.11,8.53Z",XD="M16.89,15.5L18.31,16.89C19.21,15.73 19.76,14.39 19.93,13H17.91C17.77,13.87 17.43,14.72 16.89,15.5M13,17.9V19.92C14.39,19.75 15.74,19.21 16.9,18.31L15.46,16.87C14.71,17.41 13.87,17.76 13,17.9M19.93,11C19.76,9.61 19.21,8.27 18.31,7.11L16.89,8.53C17.43,9.28 17.77,10.13 17.91,11M15.55,5.55L11,1V4.07C7.06,4.56 4,7.92 4,12C4,16.08 7.05,19.44 11,19.93V17.91C8.16,17.43 6,14.97 6,12C6,9.03 8.16,6.57 11,6.09V10L15.55,5.55Z",QD="M2,21L23,12L2,3V10L17,12L2,14V21Z",JD="M11,13.5V21.5H3V13.5H11M12,2L17.5,11H6.5L12,2M17.5,13C20,13 22,15 22,17.5C22,20 20,22 17.5,22C15,22 13,20 13,17.5C13,15 15,13 17.5,13Z",eM="M12,1L3,5V11C3,16.55 6.84,21.74 12,23C17.16,21.74 21,16.55 21,11V5L12,1M12,5A3,3 0 0,1 15,8A3,3 0 0,1 12,11A3,3 0 0,1 9,8A3,3 0 0,1 12,5M17.13,17C15.92,18.85 14.11,20.24 12,20.92C9.89,20.24 8.08,18.85 6.87,17C6.53,16.5 6.24,16 6,15.47C6,13.82 8.71,12.47 12,12.47C15.29,12.47 18,13.79 18,15.47C17.76,16 17.47,16.5 17.13,17Z",tM="M16.46,9.41L13,7.38V5.12L14.71,3.41L13.29,2L12,3.29L10.71,2L9.29,3.41L11,5.12V7.38L8.5,8.82L6.5,7.69L5.92,5.36L4,5.88L4.47,7.65L2.7,8.12L3.22,10.05L5.55,9.43L7.55,10.56V13.45L5.55,14.58L3.22,13.96L2.7,15.89L4.47,16.36L4,18.12L5.93,18.64L6.55,16.31L8.55,15.18L11,16.62V18.88L9.29,20.59L10.71,22L12,20.71L13.29,22L14.7,20.59L13,18.88V16.62L16.46,14.61M9.5,10.56L12,9.11L14.5,10.56V13.44L12,14.89L9.5,13.44M19,13V7H21V13H19M19,17V15H21V17H19Z",rM="M17,12C17,14.42 15.28,16.44 13,16.9V21H11V16.9C8.72,16.44 7,14.42 7,12C7,9.58 8.72,7.56 11,7.1V3H13V7.1C15.28,7.56 17,9.58 17,12M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9Z",sM="M18,18H6V6H18V18Z",K$="M9,3L5,7H8V14H10V7H13M16,17V10H14V17H11L15,21L19,17H16Z",nM="M12,18A6,6 0 0,1 6,12C6,11 6.25,10.03 6.7,9.2L5.24,7.74C4.46,8.97 4,10.43 4,12A8,8 0 0,0 12,20V23L16,19L12,15M12,4V1L8,5L12,9V6A6,6 0 0,1 18,12C18,13 17.75,13.97 17.3,14.8L18.76,16.26C19.54,15.03 20,13.57 20,12A8,8 0 0,0 12,4Z",iM="M8,2H16A2,2 0 0,1 18,4V20A2,2 0 0,1 16,22H8A2,2 0 0,1 6,20V4A2,2 0 0,1 8,2M8,10V14H16V10H8M8,16V20H16V16H8M8,4V8H16V4H8Z",aM="M17 13V7H19V13H17M17 17V15H19V17H17M13 13V5C13 3.3 11.7 2 10 2S7 3.3 7 5V13C4.8 14.7 4.3 17.8 6 20S10.8 22.7 13 21 15.7 16.2 14 14C13.7 13.6 13.4 13.3 13 13M10 4C10.6 4 11 4.4 11 5V8H9V5C9 4.4 9.4 4 10 4Z",oM="M15 13V5A3 3 0 0 0 9 5V13A5 5 0 1 0 15 13M12 4A1 1 0 0 1 13 5V12H11V5A1 1 0 0 1 12 4Z",lM="M6,2H18V8H18V8L14,12L18,16V16H18V22H6V16H6V16L10,12L6,8V8H6V2M16,16.5L12,12.5L8,16.5V20H16V16.5M12,11.5L16,7.5V4H8V7.5L12,11.5M10,6H14V6.75L12,8.75L10,6.75V6Z",cM="M17,7H7A5,5 0 0,0 2,12A5,5 0 0,0 7,17H17A5,5 0 0,0 22,12A5,5 0 0,0 17,7M17,15A3,3 0 0,1 14,12A3,3 0 0,1 17,9A3,3 0 0,1 20,12A3,3 0 0,1 17,15Z",uM="M17 6H7c-3.31 0-6 2.69-6 6s2.69 6 6 6h10c3.31 0 6-2.69 6-6s-2.69-6-6-6zm0 10H7c-2.21 0-4-1.79-4-4s1.79-4 4-4h10c2.21 0 4 1.79 4 4s-1.79 4-4 4zM7 9c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z",dM="M12.91 6.43L15.03 8.55L16.09 7.5L15.03 6.43L17.86 3.6L18.92 4.66L20 3.6L17.86 1.5M3 20.57L4.43 22L14.5 11.9L16.63 11.19L21.4 6.43C22.18 5.65 22.18 4.38 21.4 3.6L15.55 9.44L13.43 10.15Z",pM="M18 5H6V7H18M6 9H18V11H6M2 12H4V17H20V12H22V17A2 2 0 0 1 20 19H4A2 2 0 0 1 2 17M18 13H6V15H18Z",hM="M2 12H4V17H20V12H22V17A2 2 0 0 1 20 19H4A2 2 0 0 1 2 17M11 5H13V8H16V10H13V13H11V10H8V8H11Z",fM="M3,17V19H9V17H3M3,5V7H13V5H3M13,21V19H21V17H13V15H11V21H13M7,9V11H3V13H7V15H9V9H7M21,13V11H11V13H21M15,9H17V7H21V5H17V3H15V9Z",mM="M21,10.12H14.22L16.96,7.3C14.23,4.6 9.81,4.5 7.08,7.2C4.35,9.91 4.35,14.28 7.08,17C9.81,19.7 14.23,19.7 16.96,17C18.32,15.65 19,14.08 19,12.1H21C21,14.08 20.12,16.65 18.36,18.39C14.85,21.87 9.15,21.87 5.64,18.39C2.14,14.92 2.11,9.28 5.62,5.81C9.13,2.34 14.76,2.34 18.27,5.81L21,3V10.12M12.5,8V12.25L16,14.33L15.28,15.54L11,13V8H12.5Z",gM="M9,16V10H5L12,3L19,10H15V16H9M5,20V18H19V20H5Z",vM="M15,7V11H16V13H13V5H15L12,1L9,5H11V13H8V10.93C8.7,10.56 9.2,9.85 9.2,9C9.2,7.78 8.21,6.8 7,6.8C5.78,6.8 4.8,7.78 4.8,9C4.8,9.85 5.3,10.56 6,10.93V13A2,2 0 0,0 8,15H11V18.05C10.29,18.41 9.8,19.15 9.8,20A2.2,2.2 0 0,0 12,22.2A2.2,2.2 0 0,0 14.2,20C14.2,19.15 13.71,18.41 13,18.05V15H16A2,2 0 0,0 18,13V11H19V7H15Z",X$="M15,3V7.59L7.59,15H3V21H9V16.42L16.42,9H21V3M17,5H19V7H17M5,17H7V19H5",_M="M19,5V7H15V5H19M9,5V11H5V5H9M19,13V19H15V13H19M9,17V19H5V17H9M21,3H13V9H21V3M11,3H3V13H11V3M21,11H13V21H21V11M11,15H3V21H11V15Z",yM="M3 11H11V3H3M5 5H9V9H5M13 21H21V13H13M15 15H19V19H15M3 21H11V13H3M5 15H9V19H5M13 3V11H21V3M19 9H15V5H19Z",bM="M4,5V7H21V5M4,11H21V9H4M4,19H21V17H4M4,15H21V13H4V15Z",$M="M13.46,12L19,17.54V19H17.54L12,13.46L6.46,19H5V17.54L10.54,12L5,6.46V5H6.46L12,10.54L17.54,5H19V6.46L13.46,12Z";const SM="M 12 2 C 11.811244 2.0027 11.62182 2.01009 11.433594 2.0234375 C 11.245368 2.0367892 11.058338 2.0560871 10.871094 2.0800781 C 10.528376 2.1223311 10.188076 2.1823072 9.8515625 2.2597656 C 9.4050859 2.3584685 8.9659029 2.4876777 8.5371094 2.6464844 C 8.2433457 2.7507726 7.9546177 2.8687402 7.671875 3 L 7.6699219 3 C 7.2200923 3.2179359 6.7872406 3.4692919 6.375 3.7519531 C 6.1149723 3.9281592 5.8633915 4.1165194 5.6210938 4.3164062 C 5.2734281 4.6063526 4.9458497 4.9195737 4.640625 5.2539062 C 4.4299712 5.4884886 4.2305306 5.7329027 4.0429688 5.9863281 C 4.0007188 6.0418801 3.9590487 6.0978726 3.9179688 6.1542969 C 3.7241339 6.4206091 3.543575 6.6963363 3.3769531 6.9804688 C 3.3651531 7.0019097 3.3534369 7.0233949 3.3417969 7.0449219 C 2.9828732 7.6642764 2.691488 8.3203821 2.4726562 9.0019531 C 2.3383154 9.4325109 2.233258 9.8716656 2.1582031 10.316406 C 2.1085032 10.625133 2.0733024 10.936022 2.0527344 11.248047 L 2.0527344 11.25 L 2.0527344 11.251953 L 2.0527344 11.253906 L 2.0527344 11.255859 C 2.0258944 11.502973 2.00832 11.751383 2 12 C 2.000879 12.252257 2.0113 12.504391 2.03125 12.755859 L 2.0332031 12.767578 C 2.0566631 13.076458 2.0944624 13.384082 2.1464844 13.689453 C 2.2214943 14.129536 2.3258985 14.564103 2.4589844 14.990234 C 2.5675343 15.334756 2.6946769 15.673142 2.8398438 16.003906 L 2.8457031 16.017578 L 2.8535156 16.03125 C 2.9986205 16.362102 3.1616911 16.684839 3.3417969 16.998047 L 3.34375 17 C 3.5265728 17.317394 3.7267926 17.624495 3.9433594 17.919922 C 4.1600882 18.215026 4.3928602 18.498004 4.640625 18.767578 C 4.9426097 19.096141 5.2662503 19.404121 5.609375 19.689453 C 5.8509948 19.889955 6.1019244 20.078968 6.3613281 20.255859 C 6.7778367 20.540458 7.2152833 20.793132 7.6699219 21.011719 L 7.671875 21.011719 C 7.9543247 21.147608 8.2431027 21.27014 8.5371094 21.378906 C 8.956542 21.533797 9.3858911 21.660384 9.8222656 21.757812 L 9.8242188 21.757812 C 10.165943 21.833832 10.511518 21.891861 10.859375 21.931641 C 10.885405 21.935041 10.91144 21.938206 10.9375 21.941406 C 11.290376 21.979776 11.645044 21.99934 12 22 C 12.188756 21.9973 12.37818 21.98991 12.566406 21.976562 C 12.754632 21.963215 12.941662 21.943912 13.128906 21.919922 C 13.471624 21.877672 13.811924 21.817693 14.148438 21.740234 C 14.594914 21.641534 15.034096 21.512323 15.462891 21.353516 C 15.756653 21.249229 16.045381 21.131261 16.328125 21 L 16.330078 21 C 16.779908 20.782064 17.21276 20.530708 17.625 20.248047 C 17.885029 20.07184 18.136608 19.883481 18.378906 19.683594 C 18.726573 19.393647 19.054149 19.080425 19.359375 18.746094 C 19.570029 18.511511 19.76947 18.267097 19.957031 18.013672 C 19.999281 17.958122 20.040951 17.902127 20.082031 17.845703 C 20.275866 17.57939 20.456425 17.303665 20.623047 17.019531 C 20.634847 16.998091 20.646563 16.976598 20.658203 16.955078 C 21.017127 16.335724 21.308511 15.679617 21.527344 14.998047 C 21.661685 14.567489 21.766742 14.128334 21.841797 13.683594 C 21.891497 13.374867 21.926698 13.063978 21.947266 12.751953 L 21.947266 12.75 L 21.947266 12.748047 L 21.947266 12.746094 L 21.947266 12.744141 C 21.974096 12.496824 21.99169 12.248617 22 12 C 21.999121 11.747743 21.9887 11.495609 21.96875 11.244141 L 21.966797 11.232422 C 21.943337 10.923542 21.905537 10.615918 21.853516 10.310547 C 21.778506 9.8704641 21.6741 9.4358974 21.541016 9.0097656 C 21.432464 8.6652447 21.305324 8.3268573 21.160156 7.9960938 L 21.154297 7.9824219 L 21.146484 7.96875 C 21.001384 7.6379017 20.838309 7.315161 20.658203 7.0019531 L 20.65625 7 C 20.47338 6.6826091 20.273207 6.375505 20.056641 6.0800781 C 19.839912 5.7849746 19.60714 5.5019958 19.359375 5.2324219 C 19.05739 4.903859 18.73375 4.5958783 18.390625 4.3105469 C 18.149005 4.1100449 17.898076 3.921033 17.638672 3.7441406 C 17.222163 3.459542 16.784717 3.2068671 16.330078 2.9882812 L 16.328125 2.9882812 C 16.045675 2.8523915 15.756897 2.72986 15.462891 2.6210938 C 15.043458 2.4662029 14.614109 2.3396166 14.177734 2.2421875 L 14.175781 2.2421875 C 13.834058 2.1661636 13.488482 2.1081404 13.140625 2.0683594 C 13.114595 2.0649994 13.08856 2.0617537 13.0625 2.0585938 C 12.709629 2.0202237 12.354956 2.0006604 12 2 z M 10.701172 4.25 L 10.957031 4.3984375 L 11.066406 4.4609375 L 11.132812 4.5 L 11.566406 4.75 L 11.566406 5.75 L 11.132812 6 L 10.875 6.1484375 C 10.874877 6.1490598 10.875123 6.1497684 10.875 6.1503906 L 10.701172 6.25 L 10.267578 6 L 9.8359375 5.75 L 9.8359375 4.75 L 10.103516 4.5957031 L 10.701172 4.25 z M 13.298828 4.25 L 14.164062 4.75 L 14.164062 5.75 L 13.298828 6.25 L 12.433594 5.75 L 12.433594 4.75 L 13.298828 4.25 z M 8.8398438 4.6757812 L 8.96875 4.75 L 8.96875 5.75 L 8.5371094 6 L 8.1035156 6.25 L 7.2382812 5.75 L 7.2382812 5.578125 C 7.7356888 5.2168041 8.2730923 4.9140239 8.8398438 4.6757812 z M 15.160156 4.6757812 C 15.726909 4.914025 16.264309 5.2168044 16.761719 5.578125 L 16.761719 5.75 L 16.103516 6.1308594 L 15.896484 6.25 L 15.03125 5.75 L 15.03125 4.75 L 15.160156 4.6757812 z M 6.8046875 6.5 L 7.6699219 7 L 7.6699219 8 L 6.8046875 8.5 L 6.7011719 8.4394531 L 5.9394531 8 L 5.9394531 7.75 L 5.9394531 7 L 6.8046875 6.5 z M 9.4023438 6.5 L 10.267578 7 L 10.267578 7.8398438 L 10.267578 8 L 10.140625 8.0742188 L 9.8339844 8.25 L 9.4023438 8.5 L 8.9707031 8.25 L 8.5371094 8 L 8.5371094 7 L 8.96875 6.75 L 9.4023438 6.5 z M 12 6.5 L 12.865234 7 L 12.865234 7.75 L 12.865234 8 L 12.744141 8.0703125 C 12.743508 8.0701923 12.74282 8.0704324 12.742188 8.0703125 C 12.497492 8.0239396 12.249054 8.0001594 12 8 C 11.754037 8.00282 11.508857 8.0283149 11.267578 8.0761719 L 11.134766 8 L 11.134766 7.25 L 11.134766 7 L 11.896484 6.5605469 L 12 6.5 z M 14.597656 6.5 L 15.029297 6.75 L 15.462891 7 L 15.462891 8 L 14.597656 8.5 L 14.166016 8.25 L 13.732422 8 L 13.732422 7 L 14.166016 6.75 L 14.597656 6.5 z M 17.195312 6.5 L 17.298828 6.5605469 L 18.060547 7 L 18.060547 7.25 L 18.060547 8 L 17.298828 8.4394531 L 17.195312 8.5 L 16.330078 8 L 16.330078 7 L 17.195312 6.5 z M 5.5058594 8.75 L 6.3710938 9.25 L 6.3710938 10.25 L 5.5058594 10.75 L 4.640625 10.25 L 4.640625 9.25 L 5.5058594 8.75 z M 8.1035156 8.75 L 8.96875 9.25 L 8.96875 9.390625 C 8.6470443 9.7691664 8.398667 10.204324 8.2363281 10.673828 L 8.1035156 10.75 L 7.5449219 10.427734 L 7.2382812 10.25 L 7.2382812 9.25 L 8.1035156 8.75 z M 15.896484 8.75 L 16.761719 9.25 L 16.761719 10.25 L 16.328125 10.5 L 15.896484 10.75 L 15.775391 10.679688 C 15.6258 10.253096 15.401287 9.8581752 15.119141 9.5058594 C 15.089259 9.4685462 15.062498 9.4288507 15.03125 9.3925781 L 15.03125 9.390625 L 15.03125 9.25 L 15.462891 9 L 15.896484 8.75 z M 18.494141 8.75 L 19.359375 9.25 L 19.359375 10.25 L 18.494141 10.75 L 18.287109 10.630859 L 17.628906 10.25 L 17.628906 9.25 L 18.494141 8.75 z M 12 10 C 13.104568 10 14 10.895432 14 12 C 14 13.035532 13.213589 13.887814 12.205078 13.990234 C 12.137844 13.997062 12.069035 14 12 14 C 11.792894 14 11.592174 13.968592 11.404297 13.910156 C 11.028542 13.793284 10.701584 13.567814 10.457031 13.271484 C 10.416272 13.222096 10.377738 13.172341 10.341797 13.119141 C 10.126148 12.799939 10 12.414213 10 12 C 10 11.930965 10.002938 11.862156 10.009766 11.794922 C 10.037078 11.525986 10.119032 11.273584 10.242188 11.046875 C 10.396132 10.763489 10.614858 10.521504 10.880859 10.341797 C 10.93406 10.305855 10.990198 10.272976 11.046875 10.242188 C 11.330261 10.088243 11.654823 10 12 10 z M 4.2070312 11 L 5.0722656 11.5 L 5.0722656 11.75 L 5.0722656 12.5 L 4.2070312 13 L 4.0722656 12.921875 C 4.0304257 12.616234 4.0063 12.308428 4 12 C 4.00315 11.845786 4.0113888 11.690819 4.0234375 11.537109 C 4.0354862 11.383399 4.0513406 11.230945 4.0722656 11.078125 L 4.2070312 11 z M 6.8046875 11 L 7.2363281 11.25 L 7.6699219 11.5 L 7.6699219 12.5 L 6.8046875 13 L 6.7011719 12.939453 L 5.9394531 12.5 L 5.9394531 11.5 L 6.7011719 11.060547 L 6.8046875 11 z M 17.195312 11 L 17.298828 11.060547 L 18.060547 11.5 L 18.060547 12.5 L 17.298828 12.939453 L 17.195312 13 L 16.763672 12.75 L 16.330078 12.5 L 16.330078 11.5 L 17.195312 11 z M 19.792969 11 L 19.927734 11.078125 C 19.969574 11.383766 19.9937 11.691572 20 12 C 19.9937 12.308428 19.969584 12.616234 19.927734 12.921875 L 19.792969 13 L 18.927734 12.5 L 18.927734 12.25 L 18.927734 11.5 L 19.792969 11 z M 5.5058594 13.25 L 5.7128906 13.369141 L 6.3710938 13.75 L 6.3710938 14.75 L 5.5058594 15.25 L 4.640625 14.75 L 4.640625 13.75 L 5.5058594 13.25 z M 8.1035156 13.25 L 8.2246094 13.320312 C 8.3742003 13.746904 8.5987134 14.141825 8.8808594 14.494141 C 8.9107409 14.531454 8.9375015 14.571149 8.96875 14.607422 C 8.9690848 14.607816 8.968415 14.608981 8.96875 14.609375 L 8.96875 14.75 L 8.5371094 15 L 8.1035156 15.25 L 7.2382812 14.75 L 7.2382812 13.75 L 7.671875 13.5 L 8.1035156 13.25 z M 15.896484 13.25 L 16.455078 13.572266 L 16.761719 13.75 L 16.761719 14.75 L 15.896484 15.25 L 15.03125 14.75 L 15.03125 14.609375 C 15.288819 14.306302 15.495308 13.965789 15.652344 13.601562 C 15.6928 13.511265 15.729958 13.419415 15.763672 13.326172 L 15.896484 13.25 z M 18.494141 13.25 L 19.359375 13.75 L 19.359375 14.75 L 18.494141 15.25 L 17.628906 14.75 L 17.628906 13.75 L 18.494141 13.25 z M 6.8046875 15.5 L 7.6699219 16 L 7.6699219 17 L 6.8046875 17.5 L 6.7011719 17.439453 L 5.9394531 17 L 5.9394531 16.75 L 5.9394531 16 L 6.7011719 15.560547 L 6.8046875 15.5 z M 9.4023438 15.5 L 9.8339844 15.75 L 10.267578 16 L 10.267578 17 L 9.8339844 17.25 L 9.4023438 17.5 L 8.9707031 17.25 L 8.5371094 17 L 8.5371094 16.25 L 8.5371094 16 L 8.96875 15.75 L 8.9707031 15.75 L 9.4023438 15.5 z M 14.597656 15.5 L 15.029297 15.75 L 15.462891 16 L 15.462891 17 L 15.03125 17.25 L 14.597656 17.5 L 13.732422 17 L 13.732422 16.160156 L 13.732422 16 L 13.859375 15.925781 L 14.166016 15.75 L 14.597656 15.5 z M 17.195312 15.5 L 17.298828 15.560547 L 18.060547 16 L 18.060547 16.25 L 18.060547 17 L 17.195312 17.5 L 16.330078 17 L 16.330078 16 L 17.195312 15.5 z M 12.732422 15.923828 L 12.865234 16 L 12.865234 16.75 L 12.865234 17 L 12.103516 17.439453 L 12 17.5 L 11.134766 17 L 11.134766 16 L 11.255859 15.929688 C 11.256492 15.929808 11.25718 15.929568 11.257812 15.929688 C 11.502508 15.976059 11.750946 15.99984 12 16 C 12.122981 15.9986 12.244987 15.991227 12.367188 15.978516 C 12.489388 15.965806 12.611782 15.947758 12.732422 15.923828 z M 8.1035156 17.75 L 8.96875 18.25 L 8.96875 19.25 L 8.8398438 19.324219 C 8.2730923 19.085975 7.7356888 18.783196 7.2382812 18.421875 L 7.2382812 18.25 L 7.8964844 17.869141 L 8.1035156 17.75 z M 10.701172 17.75 L 11.566406 18.25 L 11.566406 19.25 L 10.701172 19.75 L 9.8359375 19.25 L 9.8359375 18.25 L 10.701172 17.75 z M 13.298828 17.75 L 13.732422 18 L 14.164062 18.25 L 14.164062 19.25 L 13.896484 19.404297 L 13.298828 19.75 L 13.042969 19.601562 L 12.867188 19.5 L 12.433594 19.25 L 12.433594 18.25 L 12.867188 18 L 13.125 17.851562 C 13.125123 17.85094 13.124877 17.850232 13.125 17.849609 L 13.298828 17.75 z M 15.896484 17.75 L 16.761719 18.25 L 16.761719 18.421875 C 16.264309 18.783196 15.726909 19.085977 15.160156 19.324219 L 15.03125 19.25 L 15.03125 18.25 L 15.462891 18 L 15.896484 17.75 z",wM="M 12 2 A 10 10 0 0 0 10.871094 2.0800781 A 10 10 0 0 0 9.8515625 2.2597656 A 10 10 0 0 0 8.5371094 2.6464844 A 10 10 0 0 0 7.671875 3 A 10 10 0 0 0 7.6699219 3 A 10 10 0 0 0 6.375 3.7519531 A 10 10 0 0 0 5.6210938 4.3164062 A 10 10 0 0 0 4.640625 5.2539062 A 10 10 0 0 0 4.0429688 5.9863281 A 10 10 0 0 0 3.9179688 6.1542969 A 10 10 0 0 0 3.3769531 6.9804688 A 10 10 0 0 0 3.3417969 7.0449219 A 10 10 0 0 0 2.4726562 9.0019531 A 10 10 0 0 0 2.1582031 10.316406 A 10 10 0 0 0 2.0527344 11.248047 A 10 10 0 0 0 2.0527344 11.255859 A 10 10 0 0 0 2 12 A 10 10 0 0 0 2.0527344 12.742188 A 10 10 0 0 0 2.0527344 12.748047 A 10 10 0 0 0 2.1582031 13.683594 A 10 10 0 0 0 2.4726562 14.998047 A 10 10 0 0 0 3.3417969 16.955078 A 10 10 0 0 0 3.3769531 17.019531 A 10 10 0 0 0 3.9179688 17.845703 A 10 10 0 0 0 4.0429688 18.013672 A 10 10 0 0 0 4.640625 18.746094 A 10 10 0 0 0 5.6210938 19.683594 A 10 10 0 0 0 6.375 20.248047 A 10 10 0 0 0 7.6699219 21 A 10 10 0 0 0 7.671875 21 A 10 10 0 0 0 8.5371094 21.353516 A 10 10 0 0 0 9.8515625 21.740234 A 10 10 0 0 0 10.871094 21.919922 A 10 10 0 0 0 12 22 A 10 10 0 0 0 13.128906 21.919922 A 10 10 0 0 0 13.71875 21.816406 A 6 6 0 0 1 13.042969 19.601562 L 12.433594 19.25 L 12.433594 18.25 L 12.867188 18 L 13.125 17.851562 A 6 6 0 0 1 13.732422 16.160156 L 13.732422 16 L 13.859375 15.925781 A 6 6 0 0 1 15.201172 14.367188 A 4 4 0 0 0 15.763672 13.326172 L 15.896484 13.25 L 16.455078 13.572266 A 6 6 0 0 1 19 13 A 6 6 0 0 1 21.833984 13.712891 A 10 10 0 0 0 21.841797 13.683594 A 10 10 0 0 0 21.947266 12.751953 A 10 10 0 0 0 21.947266 12.75 A 10 10 0 0 0 21.947266 12.748047 A 10 10 0 0 0 21.947266 12.746094 A 10 10 0 0 0 21.947266 12.744141 A 10 10 0 0 0 22 12 A 10 10 0 0 0 21.96875 11.244141 A 10 10 0 0 0 21.966797 11.232422 A 10 10 0 0 0 21.853516 10.310547 A 10 10 0 0 0 21.541016 9.0097656 A 10 10 0 0 0 21.160156 7.9960938 A 10 10 0 0 0 21.154297 7.9824219 A 10 10 0 0 0 21.146484 7.96875 A 10 10 0 0 0 20.658203 7.0019531 A 10 10 0 0 0 20.65625 7 A 10 10 0 0 0 20.056641 6.0800781 A 10 10 0 0 0 19.359375 5.2324219 A 10 10 0 0 0 18.390625 4.3105469 A 10 10 0 0 0 17.638672 3.7441406 A 10 10 0 0 0 16.330078 2.9882812 A 10 10 0 0 0 16.328125 2.9882812 A 10 10 0 0 0 15.462891 2.6210938 A 10 10 0 0 0 14.177734 2.2421875 A 10 10 0 0 0 14.175781 2.2421875 A 10 10 0 0 0 13.140625 2.0683594 A 10 10 0 0 0 13.0625 2.0585938 A 10 10 0 0 0 12 2 z M 10.701172 4.25 L 11.132812 4.5 L 11.566406 4.75 L 11.566406 5.75 L 10.701172 6.25 L 10.267578 6 L 9.8359375 5.75 L 9.8359375 4.75 L 10.103516 4.5957031 L 10.701172 4.25 z M 13.298828 4.25 L 14.164062 4.75 L 14.164062 5.75 L 13.298828 6.25 L 12.433594 5.75 L 12.433594 4.75 L 13.298828 4.25 z M 15.181641 4.6640625 A 8 8 0 0 1 16.761719 5.5742188 L 16.761719 5.75 L 16.103516 6.1308594 L 15.896484 6.25 L 15.03125 5.75 L 15.03125 4.75 L 15.181641 4.6640625 z M 8.8398438 4.6757812 L 8.96875 4.75 L 8.96875 5.75 L 8.5371094 6 L 8.1035156 6.25 L 7.2382812 5.75 L 7.2382812 5.578125 A 8 8 0 0 1 8.8398438 4.6757812 z M 6.8046875 6.5 L 7.6699219 7 L 7.6699219 8 L 6.8046875 8.5 L 6.7011719 8.4394531 L 5.9394531 8 L 5.9394531 7.75 L 5.9394531 7 L 6.8046875 6.5 z M 9.4023438 6.5 L 10.267578 7 L 10.267578 8 L 9.8339844 8.25 L 9.4023438 8.5 L 8.9707031 8.25 L 8.5371094 8 L 8.5371094 7 L 8.96875 6.75 L 9.4023438 6.5 z M 12 6.5 L 12.865234 7 L 12.865234 7.75 L 12.865234 8 L 12.744141 8.0703125 A 4 4 0 0 0 12 8 A 4 4 0 0 0 11.267578 8.0761719 L 11.134766 8 L 11.134766 7 L 12 6.5 z M 14.597656 6.5 L 15.462891 7 L 15.462891 7.75 L 15.462891 8 L 14.597656 8.5 L 13.732422 8 L 13.732422 7.75 L 13.732422 7 L 14.597656 6.5 z M 17.195312 6.5 L 18.060547 7 L 18.060547 8 L 17.195312 8.5 L 16.330078 8 L 16.330078 7 L 17.195312 6.5 z M 5.5058594 8.75 L 6.3710938 9.25 L 6.3710938 10.25 L 5.5058594 10.75 L 4.640625 10.25 L 4.640625 9.25 L 5.5058594 8.75 z M 8.1035156 8.75 L 8.96875 9.25 L 8.96875 9.390625 A 4 4 0 0 0 8.2363281 10.673828 L 8.1035156 10.75 L 7.2382812 10.25 L 7.2382812 9.25 L 8.1035156 8.75 z M 15.896484 8.75 L 16.761719 9.25 L 16.761719 10.25 L 15.896484 10.75 L 15.775391 10.679688 A 4 4 0 0 0 15.03125 9.3925781 L 15.03125 9.25 L 15.896484 8.75 z M 18.494141 8.75 L 19.359375 9.25 L 19.359375 10.25 L 18.494141 10.75 L 18.287109 10.630859 L 17.628906 10.25 L 17.628906 9.25 L 18.494141 8.75 z M 12 10 A 2 2 0 0 1 14 12 A 2 2 0 0 1 12 14 A 2 2 0 0 1 10 12 A 2 2 0 0 1 12 10 z M 4.2070312 11 L 5.0722656 11.5 L 5.0722656 12.5 L 4.2070312 13 L 4.0722656 12.921875 A 8 8 0 0 1 4 12 A 8 8 0 0 1 4.0722656 11.078125 L 4.2070312 11 z M 6.8046875 11 L 7.6699219 11.5 L 7.6699219 12.5 L 6.8046875 13 L 6.7011719 12.939453 L 5.9394531 12.5 L 5.9394531 11.5 L 6.7011719 11.060547 L 6.8046875 11 z M 17.195312 11 L 18.060547 11.5 L 18.060547 12.5 L 17.195312 13 L 16.763672 12.75 L 16.330078 12.5 L 16.330078 11.5 L 17.195312 11 z M 19.792969 11 L 19.947266 11.089844 A 8 8 0 0 1 20 12 A 8 8 0 0 1 19.927734 12.921875 L 19.792969 13 L 18.927734 12.5 L 18.927734 12.25 L 18.927734 11.5 L 19.792969 11 z M 5.5058594 13.25 L 6.3710938 13.75 L 6.3710938 14.75 L 5.5058594 15.25 L 4.640625 14.75 L 4.640625 13.75 L 5.5058594 13.25 z M 8.1035156 13.25 L 8.2363281 13.326172 A 4 4 0 0 0 8.96875 14.609375 L 8.96875 14.75 L 8.5371094 15 L 8.1035156 15.25 L 7.2382812 14.75 L 7.2382812 13.75 L 7.671875 13.5 L 8.1035156 13.25 z M 6.8046875 15.5 L 7.6699219 16 L 7.6699219 17 L 6.8046875 17.5 L 6.7011719 17.439453 L 5.9394531 17 L 5.9394531 16.75 L 5.9394531 16 L 6.7011719 15.560547 L 6.8046875 15.5 z M 9.4023438 15.5 L 9.8339844 15.75 L 10.267578 16 L 10.267578 17 L 9.8339844 17.25 L 9.4023438 17.5 L 8.9707031 17.25 L 8.5371094 17 L 8.5371094 16 L 8.96875 15.75 L 8.9707031 15.75 L 9.4023438 15.5 z M 11.267578 15.923828 A 4 4 0 0 0 12 16 A 4 4 0 0 0 12.732422 15.923828 L 12.865234 16 L 12.865234 16.75 L 12.865234 17 L 12.103516 17.439453 L 12 17.5 L 11.134766 17 L 11.134766 16 L 11.267578 15.923828 z M 18 16 L 18 20 L 16 20 L 19 23 L 22 20 L 20 20 L 20 16 L 18 16 z M 8.1035156 17.75 L 8.96875 18.25 L 8.96875 19.25 L 8.8398438 19.324219 A 8 8 0 0 1 7.2382812 18.421875 L 7.2382812 18.25 L 8.1035156 17.75 z M 10.701172 17.75 L 11.566406 18.25 L 11.566406 19.25 L 10.701172 19.75 L 9.8359375 19.25 L 9.8359375 18.25 L 10.701172 17.75 z",xM="M 12 2 A 10 10 0 0 0 10.871094 2.0800781 A 10 10 0 0 0 9.8515625 2.2597656 A 10 10 0 0 0 8.5371094 2.6464844 A 10 10 0 0 0 7.671875 3 A 10 10 0 0 0 7.6699219 3 A 10 10 0 0 0 6.375 3.7519531 A 10 10 0 0 0 5.6210938 4.3164062 A 10 10 0 0 0 4.640625 5.2539062 A 10 10 0 0 0 4.0429688 5.9863281 A 10 10 0 0 0 3.9179688 6.1542969 A 10 10 0 0 0 3.3769531 6.9804688 A 10 10 0 0 0 3.3417969 7.0449219 A 10 10 0 0 0 2.4726562 9.0019531 A 10 10 0 0 0 2.1582031 10.316406 A 10 10 0 0 0 2.0527344 11.248047 A 10 10 0 0 0 2.0527344 11.255859 A 10 10 0 0 0 2 12 A 10 10 0 0 0 2.0527344 12.742188 A 10 10 0 0 0 2.0527344 12.748047 A 10 10 0 0 0 2.1582031 13.683594 A 10 10 0 0 0 2.4726562 14.998047 A 10 10 0 0 0 3.3417969 16.955078 A 10 10 0 0 0 3.3769531 17.019531 A 10 10 0 0 0 3.9179688 17.845703 A 10 10 0 0 0 4.0429688 18.013672 A 10 10 0 0 0 4.640625 18.746094 A 10 10 0 0 0 5.6210938 19.683594 A 10 10 0 0 0 6.375 20.248047 A 10 10 0 0 0 7.6699219 21 A 10 10 0 0 0 7.671875 21 A 10 10 0 0 0 8.5371094 21.353516 A 10 10 0 0 0 9.8515625 21.740234 A 10 10 0 0 0 10.871094 21.919922 A 10 10 0 0 0 12 22 A 10 10 0 0 0 13.128906 21.919922 A 10 10 0 0 0 13.71875 21.816406 A 6 6 0 0 1 13.042969 19.601562 L 12.433594 19.25 L 12.433594 18.25 L 12.867188 18 L 13.125 17.851562 A 6 6 0 0 1 13.732422 16.160156 L 13.732422 16 L 13.859375 15.925781 A 6 6 0 0 1 15.201172 14.367188 A 4 4 0 0 0 15.763672 13.326172 L 15.896484 13.25 L 16.455078 13.572266 A 6 6 0 0 1 19 13 A 6 6 0 0 1 21.833984 13.712891 A 10 10 0 0 0 21.841797 13.683594 A 10 10 0 0 0 21.947266 12.751953 A 10 10 0 0 0 21.947266 12.75 A 10 10 0 0 0 21.947266 12.748047 A 10 10 0 0 0 21.947266 12.746094 A 10 10 0 0 0 21.947266 12.744141 A 10 10 0 0 0 22 12 A 10 10 0 0 0 21.96875 11.244141 A 10 10 0 0 0 21.966797 11.232422 A 10 10 0 0 0 21.853516 10.310547 A 10 10 0 0 0 21.541016 9.0097656 A 10 10 0 0 0 21.160156 7.9960938 A 10 10 0 0 0 21.154297 7.9824219 A 10 10 0 0 0 21.146484 7.96875 A 10 10 0 0 0 20.658203 7.0019531 A 10 10 0 0 0 20.65625 7 A 10 10 0 0 0 20.056641 6.0800781 A 10 10 0 0 0 19.359375 5.2324219 A 10 10 0 0 0 18.390625 4.3105469 A 10 10 0 0 0 17.638672 3.7441406 A 10 10 0 0 0 16.330078 2.9882812 A 10 10 0 0 0 16.328125 2.9882812 A 10 10 0 0 0 15.462891 2.6210938 A 10 10 0 0 0 14.177734 2.2421875 A 10 10 0 0 0 14.175781 2.2421875 A 10 10 0 0 0 13.140625 2.0683594 A 10 10 0 0 0 13.0625 2.0585938 A 10 10 0 0 0 12 2 z M 10.701172 4.25 L 11.132812 4.5 L 11.566406 4.75 L 11.566406 5.75 L 10.701172 6.25 L 10.267578 6 L 9.8359375 5.75 L 9.8359375 4.75 L 10.103516 4.5957031 L 10.701172 4.25 z M 13.298828 4.25 L 14.164062 4.75 L 14.164062 5.75 L 13.298828 6.25 L 12.433594 5.75 L 12.433594 4.75 L 13.298828 4.25 z M 15.181641 4.6640625 A 8 8 0 0 1 16.761719 5.5742188 L 16.761719 5.75 L 16.103516 6.1308594 L 15.896484 6.25 L 15.03125 5.75 L 15.03125 4.75 L 15.181641 4.6640625 z M 8.8398438 4.6757812 L 8.96875 4.75 L 8.96875 5.75 L 8.5371094 6 L 8.1035156 6.25 L 7.2382812 5.75 L 7.2382812 5.578125 A 8 8 0 0 1 8.8398438 4.6757812 z M 6.8046875 6.5 L 7.6699219 7 L 7.6699219 8 L 6.8046875 8.5 L 6.7011719 8.4394531 L 5.9394531 8 L 5.9394531 7.75 L 5.9394531 7 L 6.8046875 6.5 z M 9.4023438 6.5 L 10.267578 7 L 10.267578 8 L 9.8339844 8.25 L 9.4023438 8.5 L 8.9707031 8.25 L 8.5371094 8 L 8.5371094 7 L 8.96875 6.75 L 9.4023438 6.5 z M 12 6.5 L 12.865234 7 L 12.865234 7.75 L 12.865234 8 L 12.744141 8.0703125 A 4 4 0 0 0 12 8 A 4 4 0 0 0 11.267578 8.0761719 L 11.134766 8 L 11.134766 7 L 12 6.5 z M 14.597656 6.5 L 15.462891 7 L 15.462891 7.75 L 15.462891 8 L 14.597656 8.5 L 13.732422 8 L 13.732422 7.75 L 13.732422 7 L 14.597656 6.5 z M 17.195312 6.5 L 18.060547 7 L 18.060547 8 L 17.195312 8.5 L 16.330078 8 L 16.330078 7 L 17.195312 6.5 z M 5.5058594 8.75 L 6.3710938 9.25 L 6.3710938 10.25 L 5.5058594 10.75 L 4.640625 10.25 L 4.640625 9.25 L 5.5058594 8.75 z M 8.1035156 8.75 L 8.96875 9.25 L 8.96875 9.390625 A 4 4 0 0 0 8.2363281 10.673828 L 8.1035156 10.75 L 7.2382812 10.25 L 7.2382812 9.25 L 8.1035156 8.75 z M 15.896484 8.75 L 16.761719 9.25 L 16.761719 10.25 L 15.896484 10.75 L 15.775391 10.679688 A 4 4 0 0 0 15.03125 9.3925781 L 15.03125 9.25 L 15.896484 8.75 z M 18.494141 8.75 L 19.359375 9.25 L 19.359375 10.25 L 18.494141 10.75 L 18.287109 10.630859 L 17.628906 10.25 L 17.628906 9.25 L 18.494141 8.75 z M 12 10 A 2 2 0 0 1 14 12 A 2 2 0 0 1 12 14 A 2 2 0 0 1 10 12 A 2 2 0 0 1 12 10 z M 4.2070312 11 L 5.0722656 11.5 L 5.0722656 12.5 L 4.2070312 13 L 4.0722656 12.921875 A 8 8 0 0 1 4 12 A 8 8 0 0 1 4.0722656 11.078125 L 4.2070312 11 z M 6.8046875 11 L 7.6699219 11.5 L 7.6699219 12.5 L 6.8046875 13 L 6.7011719 12.939453 L 5.9394531 12.5 L 5.9394531 11.5 L 6.7011719 11.060547 L 6.8046875 11 z M 17.195312 11 L 18.060547 11.5 L 18.060547 12.5 L 17.195312 13 L 16.763672 12.75 L 16.330078 12.5 L 16.330078 11.5 L 17.195312 11 z M 19.792969 11 L 19.947266 11.089844 A 8 8 0 0 1 20 12 A 8 8 0 0 1 19.927734 12.921875 L 19.792969 13 L 18.927734 12.5 L 18.927734 12.25 L 18.927734 11.5 L 19.792969 11 z M 5.5058594 13.25 L 6.3710938 13.75 L 6.3710938 14.75 L 5.5058594 15.25 L 4.640625 14.75 L 4.640625 13.75 L 5.5058594 13.25 z M 8.1035156 13.25 L 8.2363281 13.326172 A 4 4 0 0 0 8.96875 14.609375 L 8.96875 14.75 L 8.5371094 15 L 8.1035156 15.25 L 7.2382812 14.75 L 7.2382812 13.75 L 7.671875 13.5 L 8.1035156 13.25 z M 19 15 L 16 18 L 18 18 L 18 22 L 20 22 L 20 18 L 22 18 L 19 15 z M 6.8046875 15.5 L 7.6699219 16 L 7.6699219 17 L 6.8046875 17.5 L 6.7011719 17.439453 L 5.9394531 17 L 5.9394531 16.75 L 5.9394531 16 L 6.7011719 15.560547 L 6.8046875 15.5 z M 9.4023438 15.5 L 9.8339844 15.75 L 10.267578 16 L 10.267578 17 L 9.8339844 17.25 L 9.4023438 17.5 L 8.9707031 17.25 L 8.5371094 17 L 8.5371094 16 L 8.96875 15.75 L 8.9707031 15.75 L 9.4023438 15.5 z M 11.267578 15.923828 A 4 4 0 0 0 12 16 A 4 4 0 0 0 12.732422 15.923828 L 12.865234 16 L 12.865234 16.75 L 12.865234 17 L 12.103516 17.439453 L 12 17.5 L 11.134766 17 L 11.134766 16 L 11.267578 15.923828 z M 8.1035156 17.75 L 8.96875 18.25 L 8.96875 19.25 L 8.8398438 19.324219 A 8 8 0 0 1 7.2382812 18.421875 L 7.2382812 18.25 L 8.1035156 17.75 z M 10.701172 17.75 L 11.566406 18.25 L 11.566406 19.25 L 10.701172 19.75 L 9.8359375 19.25 L 9.8359375 18.25 L 10.701172 17.75 z",CM="m 23.5,18.5 -3,-3 v 2 h -4 v 2 h 4 v 2 z m -9,0 3,3 v -2 h 4 v -2 h -4 v -2 z M 12,2 C 11.622488,2.00536 11.245583,2.032096 10.871094,2.080078 10.528376,2.122331 10.188076,2.182307 9.8515625,2.2597655 9.4050853,2.3584681 8.9659036,2.4876776 8.5371094,2.6464844 8.2433456,2.7507727 7.9546188,2.8687401 7.671875,3 H 7.669925 C 7.2200951,3.2179361 6.7872412,3.4692916 6.375,3.7519531 6.1149725,3.9281594 5.8633915,4.1165192 5.6210938,4.3164062 5.2734271,4.6063528 4.9458507,4.9195733 4.640625,5.2539062 4.4299716,5.4884888 4.2305301,5.7329024 4.0429688,5.9863281 4.0007171,6.04188 3.9590482,6.0978726 3.9179688,6.1542969 3.7241339,6.4206094 3.5435752,6.6963361 3.3769531,6.9804688 3.3651555,7.0019101 3.3534367,7.0233946 3.3417969,7.0449219 2.9828723,7.664277 2.6914886,8.3203814 2.4726562,9.0019531 2.3383156,9.4325113 2.233258,9.871665 2.1582031,10.316406 2.1084999,10.625133 2.073305,10.936022 2.0527344,11.248047 v 0.0078 C 2.0259069,11.503164 2.0083166,11.751383 2,12 c 0.00836,0.247965 0.025955,0.495532 0.052734,0.742188 v 0.0059 c 0.020449,0.313332 0.055644,0.625527 0.1054687,0.935547 0.075055,0.444741 0.1801125,0.883895 0.3144531,1.314453 0.2188324,0.681572 0.5102161,1.337676 0.8691407,1.957031 0.01164,0.02153 0.023359,0.04301 0.035156,0.06445 0.1666221,0.284133 0.3471808,0.55986 0.5410157,0.826172 0.041079,0.05642 0.082748,0.112417 0.125,0.167969 0.1875613,0.253426 0.3870028,0.497839 0.5976562,0.732422 0.3052257,0.334333 0.6328021,0.647553 0.9804688,0.9375 C 5.8633915,19.883481 6.1149725,20.071841 6.375,20.248047 6.7872412,20.530708 7.2200951,20.782064 7.6699219,21 h 0.00195 c 0.2827438,0.13126 0.5714706,0.249228 0.8652344,0.353516 0.4287942,0.158807 0.8679759,0.288016 1.3144531,0.386718 0.3365136,0.07746 0.6768136,0.137435 1.0195316,0.179688 C 11.245583,21.967904 11.622488,21.99464 12,22 12.377512,21.9946 12.754417,21.9679 13.128906,21.91992 13.32651,21.89131 13.523213,21.85679 13.71875,21.816404 13.351809,21.12901 13.122274,20.37672 13.042969,19.601562 L 12.433594,19.25 v -1 L 12.867188,18 13.125,17.851562 c 0.11641,-0.5911 0.32118,-1.161297 0.607422,-1.691406 V 16 l 0.126953,-0.07422 c 0.354229,-0.592884 0.808162,-1.120159 1.341797,-1.558593 0.238072,-0.3172 0.427646,-0.668043 0.5625,-1.041016 L 15.896484,13.25 16.455078,13.572266 C 17.251154,13.197189 18.119991,13.001817 19,13 c 0.988977,4.37e-4 1.962512,0.24533 2.833984,0.712891 0.0026,-0.0098 0.0052,-0.01953 0.0078,-0.0293 0.0497,-0.308727 0.0849,-0.619616 0.105469,-0.931641 v -0.002 -0.002 -0.002 -0.002 C 21.974093,12.496836 21.991684,12.248617 22,12 21.999121,11.747743 21.9887,11.49561 21.96875,11.244141 l -0.002,-0.01172 C 21.94329,10.923541 21.90549,10.615917 21.853469,10.310546 21.778459,9.8704628 21.674054,9.4358968 21.540969,9.0097646 21.432417,8.6652433 21.305277,8.3268567 21.160109,7.9960928 l -0.0059,-0.013672 -0.0078,-0.013672 C 21.001308,7.6379002 20.838309,7.3151613 20.658203,7.0019531 L 20.65625,7 C 20.47338,6.6826088 20.273208,6.3755053 20.056641,6.0800781 19.839912,5.7849743 19.60714,5.5019961 19.359375,5.2324219 19.05739,4.9038587 18.73375,4.5958786 18.390625,4.3105469 18.149005,4.1100447 17.898076,3.9210332 17.638672,3.7441406 17.222163,3.4595417 16.784717,3.2068673 16.330078,2.9882812 h -0.002 C 16.045628,2.8523913 15.756898,2.7298602 15.462891,2.6210938 15.043458,2.4662028 14.614109,2.3396167 14.177734,2.2421875 h -0.002 C 13.83401,2.1661631 13.488482,2.1081405 13.140625,2.0683594 13.114596,2.0650017 13.088554,2.0617465 13.0625,2.0585938 12.709624,2.0202193 12.354956,2.0006604 12,2 Z m -1.298828,2.25 0.43164,0.25 0.433594,0.25 v 1 L 10.701172,6.25 10.267578,6 9.8359375,5.75 v -1 L 10.103516,4.5957031 Z m 2.597656,0 0.865234,0.5 v 1 l -0.865234,0.5 -0.865234,-0.5 v -1 z m 1.882813,0.4140625 c 0.55966,0.2421723 1.089796,0.5475408 1.580078,0.9101563 V 5.75 L 16.103516,6.1308594 15.896484,6.25 15.03125,5.75 v -1 z M 8.8398438,4.6757812 8.96875,4.75 v 1 L 8.5371094,6 8.1035156,6.25 7.2382812,5.75 V 5.578125 C 7.7356899,5.2168037 8.273091,4.9140241 8.8398438,4.6757812 Z M 6.8046875,6.5 7.6699219,7 V 8 L 6.8046875,8.5 6.7011719,8.4394531 5.9394531,8 V 7.75 7 Z M 9.4023438,6.5 10.267578,7 V 8 L 9.8339844,8.25 9.4023438,8.5 8.9707031,8.25 8.5371094,8 V 7 L 8.96875,6.75 Z M 12,6.5 12.865234,7 V 7.75 8 L 12.744141,8.070312 C 12.498832,8.0237001 12.249698,8.0001598 12,8 11.754037,8.00282 11.508857,8.028315 11.267578,8.076172 L 11.134766,8 V 7 Z m 2.597656,0 0.865235,0.5 V 7.75 8 L 14.597656,8.5 13.732422,8 V 7.75 7 Z m 2.597656,0 0.865235,0.5 V 8 L 17.195312,8.5 16.330078,8 V 7 Z M 5.5058594,8.75 6.3710938,9.25 v 1 l -0.8652344,0.5 -0.8652344,-0.5 v -1 z m 2.5976562,0 0.8652344,0.5 V 9.390625 C 8.6470442,9.7691668 8.3986671,10.204323 8.2363281,10.673828 L 8.1035156,10.75 7.2382812,10.25 v -1 z m 7.7929684,0 0.865235,0.5 v 1 l -0.865235,0.5 -0.121093,-0.07031 C 15.609957,10.207918 15.357551,9.7713421 15.03125,9.3925781 V 9.25 Z m 2.597657,0 0.865234,0.5 v 1 L 18.494141,10.75 18.287109,10.630859 17.628906,10.25 v -1 z M 12,10 c 1.104569,0 2,0.895431 2,2 0,1.104569 -0.895431,2 -2,2 -1.104569,0 -2,-0.895431 -2,-2 0,-1.104569 0.895431,-2 2,-2 z m -7.7929688,1 0.8652344,0.5 v 1 L 4.2070312,13 4.0722656,12.921875 C 4.0304228,12.616234 4.0062939,12.308428 4,12 4.00629,11.691572 4.030423,11.383766 4.072266,11.078125 Z m 2.5976563,0 0.8652344,0.5 v 1 L 6.8046875,13 6.7011719,12.939453 5.9394531,12.5 v -1 l 0.7617188,-0.439453 z m 10.3906245,0 0.865235,0.5 v 1 L 17.195312,13 16.763672,12.75 16.330078,12.5 v -1 z m 2.597657,0 0.154297,0.08984 C 19.982131,11.39198 19.999737,11.695859 20,12 c -0.0063,0.308428 -0.03042,0.616234 -0.07227,0.921875 L 19.792969,13 18.927734,12.5 V 12.25 11.5 Z m -14.2871096,2.25 0.8652344,0.5 v 1 l -0.8652344,0.5 -0.8652344,-0.5 v -1 z m 2.5976562,0 0.1328125,0.07617 c 0.162339,0.469505 0.4107161,0.904661 0.7324219,1.283203 V 14.75 L 8.5371094,15 8.1035156,15.25 7.2382812,14.75 v -1 L 7.671875,13.5 Z M 6.8046875,15.5 7.6699219,16 v 1 L 6.8046875,17.5 6.7011719,17.439453 5.9394531,17 V 16.75 16 l 0.7617188,-0.439453 z m 2.5976563,0 0.4316406,0.25 0.4335936,0.25 v 1 L 9.8339844,17.25 9.4023438,17.5 8.9707031,17.25 8.5371094,17 V 16 L 8.96875,15.75 H 8.9707 Z m 1.8652342,0.423828 C 11.508857,15.971685 11.754037,15.997183 12,16 c 0.245963,-0.0028 0.491143,-0.02831 0.732422,-0.07617 L 12.865234,16 V 16.75 17 L 12.103516,17.439453 12,17.5 11.134766,17 V 16 Z M 8.1035156,17.75 8.96875,18.25 v 1 L 8.8398438,19.32422 C 8.273091,19.085976 7.7356899,18.783196 7.2382812,18.421875 V 18.25 Z m 2.5976564,0 0.865234,0.5 v 1 l -0.865234,0.5 -0.8652345,-0.5 v -1 z",PM="M 6 2 C 4.8900033 2 4 2.8900033 4 4 L 4 20 C 4 21.099997 4.8900033 22 6 22 L 11.111328 22 L 12 22 L 12 20 L 6 20 L 12 14 L 13.210938 15.210938 C 13.375508 12.672702 15.686928 11 18 11 C 18.699997 11 19.400001 11.200391 20 11.400391 L 20 11 L 20 8 L 14 2 L 6 2 z M 13 3.5 L 18.5 9 L 13 9 L 13 3.5 z M 8 9 A 2 2 0 0 1 10 11 A 2 2 0 0 1 8 13 A 2 2 0 0 1 6 11 A 2 2 0 0 1 8 9 z M 18 13 C 16.600001 13 15.199219 14.100002 15.199219 15.5 L 15.199219 17 C 14.599219 17 14 17.599219 14 18.199219 L 14 21.699219 C 14 22.399217 14.599219 23 15.199219 23 L 20.699219 23 C 21.399218 23 22 22.400781 22 21.800781 L 22 18.300781 C 22 17.600783 21.400781 17 20.800781 17 L 20.800781 15.5 C 20.800781 14.100002 19.399998 13 18 13 z M 18 14.199219 C 18.799997 14.199219 19.5 14.700002 19.5 15.5 L 19.5 17 L 16.5 17 L 16.5 15.5 C 16.5 14.700002 17.200002 14.199219 18 14.199219 z",LM="M13,12.9h-2.1c-0.2,0-0.3,0.1-0.3,0.3v0.5c0,0.2,0.1,0.3,0.3,0.3H13c0.2,0,0.3-0.1,0.3-0.3v-0.5C13.3,13,13.2,12.9,13,12.9z M13.4,13.2C13.4,13.2,13.4,13.2,13.4,13.2l0,0.5c0,0.2-0.2,0.4-0.4,0.4h-2.1c-0.2,0-0.4-0.2-0.4-0.4v-0.5c0,0,0,0,0,0H1V19 h1.4v0.1h0.1v0.1h1.2v-0.1h0.1V19h16.5v0.1h0.1v0.1h1.2v-0.1h0.1V19H23v-5.7H13.4z M2,12.2L2,5.8L22,5.8L22,12.2L23,12.2L23,6.9L22.8,6.9L22.8,4.8L1.2,4.8L1.2,6.9L1,6.9L1,12.2 M3.6,8.2c-0.1,0-0.2,0.1-0.2,0.2v3.8h0.4V8.4C3.8,8.2,3.7,8.2,3.6,8.2z M4.1,8.2C4,8.2,3.9,8.2,3.9,8.4v3.8h0.4V8.4C4.3,8.2,4.2,8.2,4.1,8.2z M3,7C2.9,7,2.8,7.2,2.8,7.3v4.9h0.5V7.3C3.3,7.2,3.2,7,3,7z M4.5,8.2c-0.1,0-0.2,0.1-0.2,0.2v3.8h0.4V8.4C4.7,8.2,4.7,8.2,4.5,8.2z M6.5,7C6.4,7,6.3,7.2,6.3,7.3v4.9h0.5V7.3C6.8,7.2,6.7,7,6.5,7z M5.9,8.2c-0.1,0-0.2,0.1-0.2,0.2v3.8h0.4V8.4C6.2,8.2,6.1,8.2,5.9,8.2z M5,8.2c-0.1,0-0.2,0.1-0.2,0.2v3.8h0.4V8.4C5.2,8.2,5.1,8.2,5,8.2z M5.5,8.2c-0.1,0-0.2,0.1-0.2,0.2v3.8h0.4V8.4C5.7,8.2,5.6,8.2,5.5,8.2z M8.9,8.2c-0.1,0-0.2,0.1-0.2,0.2v3.8h0.4V8.4C9.1,8.2,9,8.2,8.9,8.2z M9.4,8.2c-0.1,0-0.2,0.1-0.2,0.2v3.8h0.4V8.4C9.6,8.2,9.5,8.2,9.4,8.2z M8.4,8.2c-0.1,0-0.2,0.1-0.2,0.2v3.8h0.4V8.4C8.6,8.2,8.5,8.2,8.4,8.2z M7.9,7C7.7,7,7.6,7.2,7.6,7.3v4.9h0.5V7.3C8.1,7.2,8,7,7.9,7z M10.3,8.2c-0.1,0-0.2,0.1-0.2,0.2v3.8h0.4V8.4C10.5,8.2,10.4,8.2,10.3,8.2z M9.8,8.2c-0.1,0-0.2,0.1-0.2,0.2v3.8H10V8.4C10,8.2,9.9,8.2,9.8,8.2z M11.3,7c-0.1,0-0.3,0.1-0.3,0.3v4.9h0.5V7.3C11.6,7.2,11.5,7,11.3,7z M10.8,8.2c-0.1,0-0.2,0.1-0.2,0.2v3.8H11V8.4C11,8.2,10.9,8.2,10.8,8.2z M14.2,8.2C14,8.2,14,8.2,14,8.4v3.8h0.4V8.4C14.4,8.2,14.3,8.2,14.2,8.2z M13.7,8.2c-0.1,0-0.2,0.1-0.2,0.2v3.8h0.4V8.4C13.9,8.2,13.8,8.2,13.7,8.2z M13.2,8.2c-0.1,0-0.2,0.1-0.2,0.2v3.8h0.4V8.4C13.4,8.2,13.3,8.2,13.2,8.2z M12.7,7c-0.1,0-0.3,0.1-0.3,0.3v4.9h0.5V7.3C12.9,7.2,12.8,7,12.7,7z M15.6,8.2c-0.1,0-0.2,0.1-0.2,0.2v3.8h0.4V8.4C15.8,8.2,15.7,8.2,15.6,8.2z M14.6,8.2c-0.1,0-0.2,0.1-0.2,0.2v3.8h0.4V8.4C14.8,8.2,14.7,8.2,14.6,8.2z M16.1,7c-0.1,0-0.3,0.1-0.3,0.3v4.9h0.5V7.3C16.4,7.2,16.3,7,16.1,7z M15.1,8.2c-0.1,0-0.2,0.1-0.2,0.2v3.8h0.4V8.4C15.3,8.2,15.2,8.2,15.1,8.2z M18,8.2c-0.1,0-0.2,0.1-0.2,0.2v3.8h0.4V8.4C18.2,8.2,18.1,8.2,18,8.2z M18.5,8.2c-0.1,0-0.2,0.1-0.2,0.2v3.8h0.4V8.4C18.7,8.2,18.6,8.2,18.5,8.2z M21,7c-0.1,0-0.3,0.1-0.3,0.3v4.9h0.5V7.3C21.2,7.2,21.1,7,21,7z M19,8.2c-0.1,0-0.2,0.1-0.2,0.2v3.8h0.4V8.4C19.2,8.2,19.1,8.2,19,8.2z M17.5,7c-0.1,0-0.3,0.1-0.3,0.3v4.9h0.5V7.3C17.7,7.2,17.6,7,17.5,7z M20.4,8.2c-0.1,0-0.2,0.1-0.2,0.2v3.8h0.4V8.4C20.6,8.2,20.5,8.2,20.4,8.2z M19.9,8.2c-0.1,0-0.2,0.1-0.2,0.2v3.8h0.4V8.4C20.1,8.2,20,8.2,19.9,8.2z M19.4,8.2c-0.1,0-0.2,0.1-0.2,0.2v3.8h0.4V8.4C19.6,8.2,19.5,8.2,19.4,8.2z",AM="M18.0610109375,18.0619875Q15.5505109375,20.5725875,12.0001409375,20.5725875Q8.4497409375,20.5725875,5.9392209375,18.0619875Q3.428711473942,15.5514875,3.4287109375,12.0011175Q3.428710401058,8.4507175,5.9392209375,5.9401975Q8.4497409375,3.429688036442,12.0001409375,3.4296875Q14.4468109375,3.429686963558,16.5155109375,4.7141475Q18.3706109375,5.8659775,19.4402109375,7.7412475L21.5423109375,7.2306875L20.1430109375,12.0011175L16.711310937500002,8.4040475L18.5695109375,7.9527175Q17.6260109375,6.4125875,16.063410937500002,5.4423475Q14.2023109375,4.2868295,12.0001409375,4.2868305Q8.8047809375,4.2868295,6.5453109375,6.5462875Q4.2858529375,8.8057575,4.2858539375,12.0011175Q4.2858529375,15.1964875,6.5453109375,17.4559875Q8.8047809375,19.7153875,12.0001409375,19.7153875Q15.1955109375,19.7153875,17.4550109375,17.4559875L18.0610109375,18.0619875Z",he=Object.freeze({APP_NAME:"fluidd",HEADER_HEIGHT:56,DEFAULTS:{CAMERA_URL_STREAM:"/webcam/?action=stream",CAMERA_URL_SNAPSHOT:"/webcam/?action=snapshot"},NETWORK_REQUEST_TIMEOUT:0,KLIPPY_RETRY_DELAY:1500,SOCKET_RETRY_DELAY:2e3,SOCKET_PING_INTERVAL:1e4,CONSOLE_HISTORY_RETENTION:1e3,CONSOLE_RECEIVE_PREFIX:"",CONSOLE_SEND_PREFIX:"$ ",CONSOLE_COMMAND_HISTORY:20,CHART_HISTORY_RETENTION:1200,JOB_HISTORY_LOAD:50,KLIPPY_DISCONNECTED_REDIRECT:"/configuration",LOCAL_CARDSTATE_STORAGE_KEY:"cardState",LOCAL_CARDLAYOUT_STORAGE_KEY:"cardLayout2",LOCAL_INSTANCES_STORAGE_KEY:"appInstances",KLIPPER_MIN_VERSION:"v0.11.0-257",MOONRAKER_MIN_VERSION:"v0.8.0-309",MOONRAKER_DB:{fluidd:{NAMESPACE:"fluidd",ROOTS:{uiSettings:{name:"uiSettings",dispatch:"config/initUiSettings"},macros:{name:"macros",dispatch:"macros/initMacros"},console:{name:"console",dispatch:"console/initConsole"},charts:{name:"charts",dispatch:"charts/initCharts"},cameras:{name:"cameras",dispatch:"webcams/initLegacyCameras",migrate_only:!0},webcams:{name:"webcams",dispatch:"webcams/initWebcams"},layout:{name:"layout",dispatch:"layout/initLayout"}}},webcams:{NAMESPACE:"webcams",ROOTS:[]}},MOONRAKER_COMPONENTS:{auth:{name:"authorization",dispatch:"auth/init"},power:{name:"power",dispatch:"power/init"},updateManager:{name:"update_manager",dispatch:"version/init"},history:{name:"history",dispatch:"history/init"},timelapse:{name:"timelapse",dispatch:"timelapse/init"},announcements:{name:"announcements",dispatch:"announcements/init"},webcams:{name:"webcam",dispatch:"webcams/init"},jobQueue:{name:"job_queue",dispatch:"jobQueue/init"},spoolman:{name:"spoolman",dispatch:"spoolman/init"},sensors:{name:"sensor",dispatch:"sensors/init"}},CONFIG_SERVICE_MAP:[{filename:"moonraker.conf",service:"moonraker",link:"https://moonraker.readthedocs.io/en/latest/configuration/"},{filename:"webcam.txt",service:"webcamd"},{filename:"crowsnest.conf",service:"crowsnest",link:"https://crowsnest.mainsail.xyz/configuration/sample-config"},{filename:"klipperscreen.conf",service:"KlipperScreen",link:"https://klipperscreen.readthedocs.io/en/latest/"},{filename:"sonar.conf",service:"sonar",link:"https://github.com/mainsail-crew/sonar"},{filename:"mooncord-webcam.json",service:"webcamd",link:"https://github.com/eliteSchwein/mooncord"},{prefix:"mooncord",service:"MoonCord",link:"https://github.com/eliteSchwein/mooncord"},{filename:"telegram.conf",service:"moonraker-telegram-bot",link:"https://github.com/nlef/moonraker-telegram-bot/wiki/Sample-config"},{suffix:".cfg",service:"klipper",link:"{klipperDomain}/Config_Reference.html"}],SUPPORTED_SERVICES:{klipper:{klipper:{domain:"https://www.klipper3d.org"},"danger-klipper":{domain:"https://dangerklipper.io"}}},FILE_DATA_TRANSFER_TYPES:{files:"x-fluidd-files",jobs:"x-fluidd-jobs"},FILTERED_FOLDER_NAMES:[".git"],FILTERED_FILES_PREFIX:[".thumbs","thumbs"],FILTERED_FILES_EXTENSION:[".ignoreme"],KEYBOARD_SHORTCUTS:{home:"h",console:"c",preview:"p",jobs:"j",history:"i",timelapse:"l",tune:"t",diagnostics:"g",configure:"x",system:"q",settings:"s"},DOCS_ROOT:"https://docs.fluidd.xyz",DOCS_REQUIRED_CONFIGURATION:"https://docs.fluidd.xyz/configuration/initial_setup",DOCS_MULTIPLE_INSTANCES:"https://docs.fluidd.xyz/configuration/multiple_printers",DOCS_MOONRAKER_COMPONENTS:"https://docs.fluidd.xyz/configuration/moonraker",DOCS_AUTH_LOST_PASSWORD:"https://docs.fluidd.xyz/authorization#lost-password",DOCS_AUTH:"https://docs.fluidd.xyz/authorization",GITHUB_REPO:"https://github.com/fluidd-core/fluidd"}),ou=Object.freeze({dash:_M,account:AT,addAccount:ET,help:iD,motion:PD,limits:VT,send:QD,open:TD,move:Gk,tabs:sk,menu:Lk,menuAlt:$D,dots:Pk,dotsGrid:Ck,drag:Ek,chart:XT,power:FD,powerCycle:HD,powerOn:cM,powerOff:uM,home:lD,close:pk,refresh:GD,restart:qD,restartAlert:ZD,update:mM,warning:OT,error:sD,thermometer:oM,bell:GT,fireAlert:Nk,snowflakeAlert:tM,circle:ck,blankCircle:ek,markedCircle:WD,checkedCircle:JT,checkboxBlank:tk,checkboxMarked:rk,alertCircle:TT,folderAdd:Zk,folderUp:Yk,folderUpload:Uk,folder:zk,folderLock:Wk,fileUpload:gM,fileAdd:Ik,inProgress:uk,progressUpload:UD,progressQuestion:zD,up:UT,down:FT,left:NT,right:zT,tune:fM,zUp:BT,zDown:IT,expandHorizontal:HT,expandVertical:jT,cog:gk,cogs:vk,save:Sk,estop:KT,fire:Vk,tools:rD,minus:xD,plus:ID,check:QT,console:_k,clock:dk,formatLineSpacing:Xk,layersTripleOutline:hD,chevronUp:ok,chevronDown:nk,chevronRight:ak,chevronLeft:ik,timer:lM,fileCode:Dk,fileRefresh:Fk,files:Hk,file:Tk,fileLock:Rk,fileCancel:kk,pause:DD,cancel:$M,cancelled:YT,play:Z$,resume:Z$,stop:sM,reprint:Y$,printer:Y$,download:Ak,rename:Kk,duplicate:$k,sync:nM,delete:xk,camera:ZT,fan:Ok,pencil:MD,pencilLock:RD,magnify:_D,magnifyPlus:bD,magnifyMinus:yD,printer3d:BD,printer3dNozzle:ND,printer3dNozzleAlert:VD,bedMesh:yM,host:q$,history:oD,filter:jk,commit:rM,cloudCheck:fk,cloudAlert:hk,cubeScan:wk,consoleLine:yk,lock:mD,lockOpen:gD,lockReset:vD,reset:YD,tempError:aM,contentCopy:bk,apps:kT,shieldAccount:eM,retract:K$,codeJson:mk,desktopTower:q$,harddisk:nD,message:wD,list:Qk,fullScreen:Jk,video:Bk,snooze:qT,chip:lk,viewHeadline:bM,absolutePositioning:WT,relativePositioning:X$,openInNew:kD,imageSizeSelectLarge:cD,listStatus:fD,previousLayer:dD,currentLayer:uD,nextLayer:pD,moves:X$,extrusions:jD,retractions:K$,tableColumn:iM,parts:JD,folderOpen:qk,fileImage:Mk,fileImageLock:PM,fileZip:DT,fileZipLock:MT,fileZipAdd:RT,filament:SM,loadFilament:wM,unloadFilament:xM,changeFilament:CM,cleanNozzle:dM,jobQueue:pM,enqueueJob:hM,sensors:eD,screenshot:CD,zRotateClockwise:XD,zRotateCounterclockwise:KD,devices:vM,abacus:LT,box:LM,num1:LD,num2:AD,num3:ED,num4:OD,helpCircleOutline:aD,gold:tD,downArrow:SD,reRfid:AM}),tt=Object.freeze({onServiceRestart:"onServiceRestart",onServiceStop:"onServiceStop",onServiceStart:"onServiceStart",onDevicePowerToggle:"onDevicePowerToggle",onHomeAll:"onHomeAll",onHomeXY:"onHomeXY",onHomeX:"onHomeX",onHomeY:"onHomeY",onHomeZ:"onHomeZ",onQGL:"onQGL",onZTilt:"onZTilt",onBedScrewsAdjust:"onBedScrewAdjust",onBedScrewsCalculate:"onBedScrewsCalculate",onBedTiltCalibrate:"onBedTiltCalibrate",onDeltaCalibrate:"onDeltaCalibrate",onPrintPause:"onPrintPause",onPrintCancel:"onPrintCancel",onPrintResume:"onPrintResume",onMacro:"onMacro",onSetSpeed:"onSetSpeed",onSetFlow:"onSetFlow",onSetPressureAdvance:"onSetPressureAdvance",onSetFanSpeed:"onSetFanSpeed",onSetOutputPin:"onSetOutputPin",onZAdjust:"onZAdjust",onZApply:"onZApply",onSaveConfig:"onSaveConfig",onRetract:"onRetract",onExtrude:"onExtrude",onMeshCalibrate:"onMeshCalibrate",onKlipperRestart:"klipperRestart",onKlipperFirmwareRestart:"klipperFirmwareRestart",onSetVelocity:"onSetVelocity",onSetAcceleration:"onSetAcceleration",onSetAccelToDecel:"onSetAccelToDecel",onSetMinimumCruiseRatio:"onSetMinimumCruiseRatio",onSetSquareCornerVelocity:"onSetSquareCornerVelocity",onSetRetractLength:"onSetRetractLength",onSetRetractSpeed:"onSetRetractSpeed",onSetUnretractSpeed:"onSetUnretractSpeed",onSetUnretractExtraLength:"onSetUnretractExtraLength",onExtruderChange:"onExtruderChange",onLoadLanguage:"onLoadLanguage",onFileSystem:"onFileSystem",onJobQueue:"onJobQueue",onTimelapseSaveFrame:"onTimelapseSaveFrame",onManualProbe:"onManualProbe",onProbeCalibrate:"onProbeCalibrate",onProbeAccuracy:"onProbeAccuracy",onZEndstopCalibrate:"onZEndstopCalibrate",onQueryEndstops:"onQueryEndstops",onQueryProbe:"onQueryProbe",onVersionRefresh:"onVersionRefresh",onSyncExtruder:"onSyncExtruder",onStepperEnable:"onStepperEnable",onMachinePeripheralsUsb:"onMachinePeripheralsUsb",onMachinePeripheralsSerial:"onMachinePeripheralsSerial",onMachinePeripheralsVideo:"onMachinePeripheralsVideo",onMachinePeripheralsCanbus:"onMachinePeripheralsCanbus"}),NC=Object.freeze([{name:"English",code:"en"},{name:"Afrikaans",code:"af"},{name:"Čeština",code:"cs"},{name:"简体中文",code:"zh-CN"},{name:"繁體中文",code:"zh-TW"},{name:"Deutsch",code:"de"},{name:"Español",code:"es"},{name:"Français",code:"fr"},{name:"Italiano",code:"it"},{name:"Magyar",code:"hu"},{name:"Nederlands",code:"nl"},{name:"Polski",code:"pl"},{name:"Português",code:"pt"},{name:"Русский",code:"ru"},{name:"Slovenščina",code:"sl"},{name:"Türkçe",code:"tr"},{name:"Українська",code:"uk"},{name:"한국어",code:"ko"},{name:"العربية",code:"ar"},{name:"日本語",code:"ja"}]),zC=Object.freeze([".bmp",".gif",".jfif",".jpeg",".jpg",".png",".svg",".tif",".tiff",".webp"]),EM=Object.freeze([".markdown",".md",".mdown"]),UC=Object.freeze([".mp4",".mpeg",".mpg"]),WC=Object.freeze({iso:{locales:"lt",options:{day:"2-digit",month:"2-digit",year:"numeric"},suffix:" (ISO 8601)"},digits2:{options:{day:"2-digit",month:"2-digit",year:"numeric"}},short:{options:{day:"2-digit",month:"short",year:"numeric"}}}),GC=Object.freeze({iso:{locales:"lt",options:{hour:"2-digit",minute:"2-digit",hour12:!1},suffix:" (ISO 8601)"},hours12:{options:{hour:"2-digit",minute:"2-digit",hour12:!0}},hours24:{options:{hour:"2-digit",minute:"2-digit",hour12:!1}}});/*! + * vue-i18n v8.28.2 + * (c) 2022 kazuya kawaguchi + * Released under the MIT License. + */var qC=["compactDisplay","currency","currencyDisplay","currencySign","localeMatcher","notation","numberingSystem","signDisplay","style","unit","unitDisplay","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits"],OM=["dateStyle","timeStyle","calendar","localeMatcher","hour12","hourCycle","timeZone","formatMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName"];function Uo(r,e){typeof console<"u"&&console.warn("[vue-i18n] "+r)}function TM(r,e){typeof console<"u"&&console.error("[vue-i18n] "+r)}var _n=Array.isArray;function ws(r){return r!==null&&typeof r=="object"}function kM(r){return typeof r=="boolean"}function Qt(r){return typeof r=="string"}var DM=Object.prototype.toString,MM="[object Object]";function mn(r){return DM.call(r)===MM}function Nr(r){return r==null}function fv(r){return typeof r=="function"}function lm(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];var t=null,s=null;return r.length===1?ws(r[0])||_n(r[0])?s=r[0]:typeof r[0]=="string"&&(t=r[0]):r.length===2&&(typeof r[0]=="string"&&(t=r[0]),(ws(r[1])||_n(r[1]))&&(s=r[1])),{locale:t,params:s}}function wl(r){return JSON.parse(JSON.stringify(r))}function RM(r,e){if(r.delete(e))return r}function IM(r){var e=[];return r.forEach(function(t){return e.push(t)}),e}function nd(r,e){return!!~r.indexOf(e)}var FM=Object.prototype.hasOwnProperty;function HM(r,e){return FM.call(r,e)}function ya(r){for(var e=arguments,t=Object(r),s=1;s/g,">").replace(/"/g,""").replace(/'/g,"'")}function jM(r){return r!=null&&Object.keys(r).forEach(function(e){typeof r[e]=="string"&&(r[e]=BM(r[e]))}),r}function VM(r){r.prototype.hasOwnProperty("$i18n")||Object.defineProperty(r.prototype,"$i18n",{get:function(){return this._i18n}}),r.prototype.$t=function(e){for(var t=[],s=arguments.length-1;s-- >0;)t[s]=arguments[s+1];var n=this.$i18n;return n._t.apply(n,[e,n.locale,n._getMessages(),this].concat(t))},r.prototype.$tc=function(e,t){for(var s=[],n=arguments.length-2;n-- >0;)s[n]=arguments[n+2];var i=this.$i18n;return i._tc.apply(i,[e,i.locale,i._getMessages(),this,t].concat(s))},r.prototype.$te=function(e,t){var s=this.$i18n;return s._te(e,s.locale,s._getMessages(),t)},r.prototype.$d=function(e){for(var t,s=[],n=arguments.length-1;n-- >0;)s[n]=arguments[n+1];return(t=this.$i18n).d.apply(t,[e].concat(s))},r.prototype.$n=function(e){for(var t,s=[],n=arguments.length-1;n-- >0;)s[n]=arguments[n+1];return(t=this.$i18n).n.apply(t,[e].concat(s))}}function NM(r){r===void 0&&(r=!1);function e(){this!==this.$root&&this.$options.__INTLIFY_META__&&this.$el&&this.$el.setAttribute("data-intlify",this.$options.__INTLIFY_META__)}return r?{mounted:e}:{beforeCreate:function(){var s=this.$options;if(s.i18n=s.i18n||(s.__i18nBridge||s.__i18n?{}:null),s.i18n){if(s.i18n instanceof ve){if(s.__i18nBridge||s.__i18n)try{var n=s.i18n&&s.i18n.messages?s.i18n.messages:{},i=s.__i18nBridge||s.__i18n;i.forEach(function(d){n=ya(n,JSON.parse(d))}),Object.keys(n).forEach(function(d){s.i18n.mergeLocaleMessage(d,n[d])})}catch{}this._i18n=s.i18n,this._i18nWatcher=this._i18n.watchI18nData()}else if(mn(s.i18n)){var a=this.$root&&this.$root.$i18n&&this.$root.$i18n instanceof ve?this.$root.$i18n:null;if(a&&(s.i18n.root=this.$root,s.i18n.formatter=a.formatter,s.i18n.fallbackLocale=a.fallbackLocale,s.i18n.formatFallbackMessages=a.formatFallbackMessages,s.i18n.silentTranslationWarn=a.silentTranslationWarn,s.i18n.silentFallbackWarn=a.silentFallbackWarn,s.i18n.pluralizationRules=a.pluralizationRules,s.i18n.preserveDirectiveContent=a.preserveDirectiveContent),s.__i18nBridge||s.__i18n)try{var o=s.i18n&&s.i18n.messages?s.i18n.messages:{},l=s.__i18nBridge||s.__i18n;l.forEach(function(d){o=ya(o,JSON.parse(d))}),s.i18n.messages=o}catch{}var c=s.i18n,u=c.sharedMessages;u&&mn(u)&&(s.i18n.messages=ya(s.i18n.messages,u)),this._i18n=new ve(s.i18n),this._i18nWatcher=this._i18n.watchI18nData(),(s.i18n.sync===void 0||s.i18n.sync)&&(this._localeWatcher=this.$i18n.watchLocale()),a&&a.onComponentInstanceCreated(this._i18n)}}else this.$root&&this.$root.$i18n&&this.$root.$i18n instanceof ve?this._i18n=this.$root.$i18n:s.parent&&s.parent.$i18n&&s.parent.$i18n instanceof ve&&(this._i18n=s.parent.$i18n)},beforeMount:function(){var s=this.$options;s.i18n=s.i18n||(s.__i18nBridge||s.__i18n?{}:null),s.i18n?s.i18n instanceof ve?(this._i18n.subscribeDataChanging(this),this._subscribing=!0):mn(s.i18n)&&(this._i18n.subscribeDataChanging(this),this._subscribing=!0):this.$root&&this.$root.$i18n&&this.$root.$i18n instanceof ve?(this._i18n.subscribeDataChanging(this),this._subscribing=!0):s.parent&&s.parent.$i18n&&s.parent.$i18n instanceof ve&&(this._i18n.subscribeDataChanging(this),this._subscribing=!0)},mounted:e,beforeDestroy:function(){if(this._i18n){var s=this;this.$nextTick(function(){s._subscribing&&(s._i18n.unsubscribeDataChanging(s),delete s._subscribing),s._i18nWatcher&&(s._i18nWatcher(),s._i18n.destroyVM(),delete s._i18nWatcher),s._localeWatcher&&(s._localeWatcher(),delete s._localeWatcher)})}}}}var Q$={name:"i18n",functional:!0,props:{tag:{type:[String,Boolean,Object],default:"span"},path:{type:String,required:!0},locale:{type:String},places:{type:[Array,Object]}},render:function(e,t){var s=t.data,n=t.parent,i=t.props,a=t.slots,o=n.$i18n;if(o){var l=i.path,c=i.locale,u=i.places,d=a(),p=o.i(l,c,zM(d)||u?UM(d.default,u):d),h=i.tag&&i.tag!==!0||i.tag===!1?i.tag:"span";return h?e(h,s,p):p}}};function zM(r){var e;for(e in r)if(e!=="default")return!1;return!!e}function UM(r,e){var t=e?WM(e):{};if(!r)return t;r=r.filter(function(n){return n.tag||n.text.trim()!==""});var s=r.every(qM);return r.reduce(s?GM:ZC,t)}function WM(r){return Array.isArray(r)?r.reduce(ZC,{}):Object.assign({},r)}function GM(r,e){return e.data&&e.data.attrs&&e.data.attrs.place&&(r[e.data.attrs.place]=e),r}function ZC(r,e,t){return r[t]=e,r}function qM(r){return!!(r.data&&r.data.attrs&&r.data.attrs.place)}var J$={name:"i18n-n",functional:!0,props:{tag:{type:[String,Boolean,Object],default:"span"},value:{type:Number,required:!0},format:{type:[String,Object]},locale:{type:String}},render:function(e,t){var s=t.props,n=t.parent,i=t.data,a=n.$i18n;if(!a)return null;var o=null,l=null;Qt(s.format)?o=s.format:ws(s.format)&&(s.format.key&&(o=s.format.key),l=Object.keys(s.format).reduce(function(h,m){var g;return nd(qC,m)?Object.assign({},h,(g={},g[m]=s.format[m],g)):h},null));var c=s.locale||a.locale,u=a._ntp(s.value,c,o,l),d=u.map(function(h,m){var g,v=i.scopedSlots&&i.scopedSlots[h.type];return v?v((g={},g[h.type]=h.value,g.index=m,g.parts=u,g)):h.value}),p=s.tag&&s.tag!==!0||s.tag===!1?s.tag:"span";return p?e(p,{attrs:i.attrs,class:i.class,staticClass:i.staticClass},d):d}};function ZM(r,e,t){YC(r,t)&&KC(r,e,t)}function YM(r,e,t,s){if(YC(r,t)){var n=t.context.$i18n;XM(r,t)&&bh(e.value,e.oldValue)&&bh(r._localeMessage,n.getLocaleMessage(n.locale))||KC(r,e,t)}}function KM(r,e,t,s){var n=t.context;if(!n){Uo("Vue instance does not exists in VNode context");return}var i=t.context.$i18n||{};!e.modifiers.preserve&&!i.preserveDirectiveContent&&(r.textContent=""),r._vt=void 0,delete r._vt,r._locale=void 0,delete r._locale,r._localeMessage=void 0,delete r._localeMessage}function YC(r,e){var t=e.context;return t?t.$i18n?!0:(Uo("VueI18n instance does not exists in Vue instance"),!1):(Uo("Vue instance does not exists in VNode context"),!1)}function XM(r,e){var t=e.context;return r._locale===t.$i18n.locale}function KC(r,e,t){var s,n,i=e.value,a=QM(i),o=a.path,l=a.locale,c=a.args,u=a.choice;if(!o&&!l&&!c){Uo("value type not supported");return}if(!o){Uo("`path` is required in v-t directive");return}var d=t.context;u!=null?r._vt=r.textContent=(s=d.$i18n).tc.apply(s,[o,u].concat(eS(l,c))):r._vt=r.textContent=(n=d.$i18n).t.apply(n,[o].concat(eS(l,c))),r._locale=d.$i18n.locale,r._localeMessage=d.$i18n.getLocaleMessage(d.$i18n.locale)}function QM(r){var e,t,s,n;return Qt(r)?e=r:mn(r)&&(e=r.path,t=r.locale,s=r.args,n=r.choice),{path:e,locale:t,args:s,choice:n}}function eS(r,e){var t=[];return r&&t.push(r),e&&(Array.isArray(e)||mn(e))&&t.push(e),t}var Sr;function Ay(r,e){e===void 0&&(e={bridge:!1}),Ay.installed=!0,Sr=r,Sr.version&&Number(Sr.version.split(".")[0]),VM(Sr),Sr.mixin(NM(e.bridge)),Sr.directive("t",{bind:ZM,update:YM,unbind:KM}),Sr.component(Q$.name,Q$),Sr.component(J$.name,J$);var t=Sr.config.optionMergeStrategies;t.i18n=function(s,n){return n===void 0?s:n}}var XC=function(){this._caches=Object.create(null)};XC.prototype.interpolate=function(e,t){if(!t)return[e];var s=this._caches[e];return s||(s=tR(e),this._caches[e]=s),rR(s,t)};var JM=/^(?:\d)+/,eR=/^(?:\w)+/;function tR(r){for(var e=[],t=0,s="";t0)n--,s=Mn,p[Xt]();else{if(n=0,a===void 0||(a=oR(a),a===!1))return!1;p[Do]()}};function h(){var m=r[t+1];if(s===wh&&m==="'"||s===xh&&m==='"')return t++,o="\\"+m,p[Xt](),!0}for(;s!==null;)if(t++,i=r[t],!(i==="\\"&&h())){if(l=aR(i),d=Hi[s],c=d[l]||d.else||lu,c===lu||(s=c[0],u=p[c[1]],u&&(o=c[2],o=o===void 0?i:o,u()===!1)))return;if(s===cm)return e}}var Ey=function(){this._cache=Object.create(null)};Ey.prototype.parsePath=function(e){var t=this._cache[e];return t||(t=lR(e),t&&(this._cache[e]=t)),t||[]};Ey.prototype.getPathValue=function(e,t){if(!ws(e))return null;var s=this.parsePath(t);if(s.length===0)return null;for(var n=s.length,i=e,a=0;a/,uR=/(?:@(?:\.[a-zA-Z]+)?:(?:[\w\-_|./]+|\([\w\-_:|./]+\)))/g,dR=/^@(?:\.([a-zA-Z]+))?:/,pR=/[()]/g,tS={upper:function(r){return r.toLocaleUpperCase()},lower:function(r){return r.toLocaleLowerCase()},capitalize:function(r){return""+r.charAt(0).toLocaleUpperCase()+r.substr(1)}},gv=new XC,ve=function(e){var t=this;e===void 0&&(e={}),!Sr&&typeof window<"u"&&window.Vue&&Ay(window.Vue);var s=e.locale||"en-US",n=e.fallbackLocale===!1?!1:e.fallbackLocale||"en-US",i=e.messages||{},a=e.dateTimeFormats||e.datetimeFormats||{},o=e.numberFormats||{};this._vm=null,this._formatter=e.formatter||gv,this._modifiers=e.modifiers||{},this._missing=e.missing||null,this._root=e.root||null,this._sync=e.sync===void 0?!0:!!e.sync,this._fallbackRoot=e.fallbackRoot===void 0?!0:!!e.fallbackRoot,this._fallbackRootWithEmptyString=e.fallbackRootWithEmptyString===void 0?!0:!!e.fallbackRootWithEmptyString,this._formatFallbackMessages=e.formatFallbackMessages===void 0?!1:!!e.formatFallbackMessages,this._silentTranslationWarn=e.silentTranslationWarn===void 0?!1:e.silentTranslationWarn,this._silentFallbackWarn=e.silentFallbackWarn===void 0?!1:!!e.silentFallbackWarn,this._dateTimeFormatters={},this._numberFormatters={},this._path=new Ey,this._dataListeners=new Set,this._componentInstanceCreatedListener=e.componentInstanceCreatedListener||null,this._preserveDirectiveContent=e.preserveDirectiveContent===void 0?!1:!!e.preserveDirectiveContent,this.pluralizationRules=e.pluralizationRules||{},this._warnHtmlInMessage=e.warnHtmlInMessage||"off",this._postTranslation=e.postTranslation||null,this._escapeParameterHtml=e.escapeParameterHtml||!1,"__VUE_I18N_BRIDGE__"in e&&(this.__VUE_I18N_BRIDGE__=e.__VUE_I18N_BRIDGE__),this.getChoiceIndex=function(l,c){var u=Object.getPrototypeOf(t);if(u&&u.getChoiceIndex){var d=u.getChoiceIndex;return d.call(t,l,c)}var p=function(h,m){return h=Math.abs(h),m===2?h?h>1?1:0:1:h?Math.min(h,2):0};return t.locale in t.pluralizationRules?t.pluralizationRules[t.locale].apply(t,[l,c]):p(l,c)},this._exist=function(l,c){return!l||!c?!1:!!(!Nr(t._path.getPathValue(l,c))||l[c])},(this._warnHtmlInMessage==="warn"||this._warnHtmlInMessage==="error")&&Object.keys(i).forEach(function(l){t._checkLocaleMessage(l,t._warnHtmlInMessage,i[l])}),this._initVM({locale:s,fallbackLocale:n,messages:i,dateTimeFormats:a,numberFormats:o})},ht={vm:{configurable:!0},messages:{configurable:!0},dateTimeFormats:{configurable:!0},numberFormats:{configurable:!0},availableLocales:{configurable:!0},locale:{configurable:!0},fallbackLocale:{configurable:!0},formatFallbackMessages:{configurable:!0},missing:{configurable:!0},formatter:{configurable:!0},silentTranslationWarn:{configurable:!0},silentFallbackWarn:{configurable:!0},preserveDirectiveContent:{configurable:!0},warnHtmlInMessage:{configurable:!0},postTranslation:{configurable:!0},sync:{configurable:!0}};ve.prototype._checkLocaleMessage=function(e,t,s){var n=[],i=function(a,o,l,c){if(mn(l))Object.keys(l).forEach(function(p){var h=l[p];mn(h)?(c.push(p),c.push("."),i(a,o,h,c),c.pop(),c.pop()):(c.push(p),i(a,o,h,c),c.pop())});else if(_n(l))l.forEach(function(p,h){mn(p)?(c.push("["+h+"]"),c.push("."),i(a,o,p,c),c.pop(),c.pop()):(c.push("["+h+"]"),i(a,o,p,c),c.pop())});else if(Qt(l)){var u=cR.test(l);if(u){var d="Detected HTML in message '"+l+"' of keypath '"+c.join("")+"' at '"+o+"'. Consider component interpolation with '' to avoid XSS. See https://bit.ly/2ZqJzkp";a==="warn"?Uo(d):a==="error"&&TM(d)}}};i(t,e,s,n)};ve.prototype._initVM=function(e){var t=Sr.config.silent;Sr.config.silent=!0,this._vm=new Sr({data:e,__VUE18N__INSTANCE__:!0}),Sr.config.silent=t};ve.prototype.destroyVM=function(){this._vm.$destroy()};ve.prototype.subscribeDataChanging=function(e){this._dataListeners.add(e)};ve.prototype.unsubscribeDataChanging=function(e){RM(this._dataListeners,e)};ve.prototype.watchI18nData=function(){var e=this;return this._vm.$watch("$data",function(){for(var t=IM(e._dataListeners),s=t.length;s--;)Sr.nextTick(function(){t[s]&&t[s].$forceUpdate()})},{deep:!0})};ve.prototype.watchLocale=function(e){if(e){if(!this.__VUE_I18N_BRIDGE__)return null;var s=this,n=this._vm;return this.vm.$watch("locale",function(i){n.$set(n,"locale",i),s.__VUE_I18N_BRIDGE__&&e&&(e.locale.value=i),n.$forceUpdate()},{immediate:!0})}else{if(!this._sync||!this._root)return null;var t=this._vm;return this._root.$i18n.vm.$watch("locale",function(i){t.$set(t,"locale",i),t.$forceUpdate()},{immediate:!0})}};ve.prototype.onComponentInstanceCreated=function(e){this._componentInstanceCreatedListener&&this._componentInstanceCreatedListener(e,this)};ht.vm.get=function(){return this._vm};ht.messages.get=function(){return wl(this._getMessages())};ht.dateTimeFormats.get=function(){return wl(this._getDateTimeFormats())};ht.numberFormats.get=function(){return wl(this._getNumberFormats())};ht.availableLocales.get=function(){return Object.keys(this.messages).sort()};ht.locale.get=function(){return this._vm.locale};ht.locale.set=function(r){this._vm.$set(this._vm,"locale",r)};ht.fallbackLocale.get=function(){return this._vm.fallbackLocale};ht.fallbackLocale.set=function(r){this._localeChainCache={},this._vm.$set(this._vm,"fallbackLocale",r)};ht.formatFallbackMessages.get=function(){return this._formatFallbackMessages};ht.formatFallbackMessages.set=function(r){this._formatFallbackMessages=r};ht.missing.get=function(){return this._missing};ht.missing.set=function(r){this._missing=r};ht.formatter.get=function(){return this._formatter};ht.formatter.set=function(r){this._formatter=r};ht.silentTranslationWarn.get=function(){return this._silentTranslationWarn};ht.silentTranslationWarn.set=function(r){this._silentTranslationWarn=r};ht.silentFallbackWarn.get=function(){return this._silentFallbackWarn};ht.silentFallbackWarn.set=function(r){this._silentFallbackWarn=r};ht.preserveDirectiveContent.get=function(){return this._preserveDirectiveContent};ht.preserveDirectiveContent.set=function(r){this._preserveDirectiveContent=r};ht.warnHtmlInMessage.get=function(){return this._warnHtmlInMessage};ht.warnHtmlInMessage.set=function(r){var e=this,t=this._warnHtmlInMessage;if(this._warnHtmlInMessage=r,t!==r&&(r==="warn"||r==="error")){var s=this._getMessages();Object.keys(s).forEach(function(n){e._checkLocaleMessage(n,e._warnHtmlInMessage,s[n])})}};ht.postTranslation.get=function(){return this._postTranslation};ht.postTranslation.set=function(r){this._postTranslation=r};ht.sync.get=function(){return this._sync};ht.sync.set=function(r){this._sync=r};ve.prototype._getMessages=function(){return this._vm.messages};ve.prototype._getDateTimeFormats=function(){return this._vm.dateTimeFormats};ve.prototype._getNumberFormats=function(){return this._vm.numberFormats};ve.prototype._warnDefault=function(e,t,s,n,i,a){if(!Nr(s))return s;if(this._missing){var o=this._missing.apply(null,[e,t,n,i]);if(Qt(o))return o}if(this._formatFallbackMessages){var l=lm.apply(void 0,i);return this._render(t,a,l.params,t)}else return t};ve.prototype._isFallbackRoot=function(e){return(this._fallbackRootWithEmptyString?!e:Nr(e))&&!Nr(this._root)&&this._fallbackRoot};ve.prototype._isSilentFallbackWarn=function(e){return this._silentFallbackWarn instanceof RegExp?this._silentFallbackWarn.test(e):this._silentFallbackWarn};ve.prototype._isSilentFallback=function(e,t){return this._isSilentFallbackWarn(t)&&(this._isFallbackRoot()||e!==this.fallbackLocale)};ve.prototype._isSilentTranslationWarn=function(e){return this._silentTranslationWarn instanceof RegExp?this._silentTranslationWarn.test(e):this._silentTranslationWarn};ve.prototype._interpolate=function(e,t,s,n,i,a,o){if(!t)return null;var l=this._path.getPathValue(t,s);if(_n(l)||mn(l))return l;var c;if(Nr(l))if(mn(t)){if(c=t[s],!(Qt(c)||fv(c)))return null}else return null;else if(Qt(l)||fv(l))c=l;else return null;return Qt(c)&&(c.indexOf("@:")>=0||c.indexOf("@.")>=0)&&(c=this._link(e,t,c,n,"raw",a,o)),this._render(c,i,a,s)};ve.prototype._link=function(e,t,s,n,i,a,o){var l=s,c=l.match(uR);for(var u in c)if(c.hasOwnProperty(u)){var d=c[u],p=d.match(dR),h=p[0],m=p[1],g=d.replace(h,"").replace(pR,"");if(nd(o,g))return l;o.push(g);var v=this._interpolate(e,t,g,n,i==="raw"?"string":i,i==="raw"?void 0:a,o);if(this._isFallbackRoot(v)){if(!this._root)throw Error("unexpected error");var y=this._root.$i18n;v=y._translate(y._getMessages(),y.locale,y.fallbackLocale,g,n,i,a)}v=this._warnDefault(e,g,v,n,_n(a)?a:[a],i),this._modifiers.hasOwnProperty(m)?v=this._modifiers[m](v):tS.hasOwnProperty(m)&&(v=tS[m](v)),o.pop(),l=v?l.replace(d,v):l}return l};ve.prototype._createMessageContext=function(e,t,s,n){var i=this,a=_n(e)?e:[],o=ws(e)?e:{},l=function(p){return a[p]},c=function(p){return o[p]},u=this._getMessages(),d=this.locale;return{list:l,named:c,values:e,formatter:t,path:s,messages:u,locale:d,linked:function(p){return i._interpolate(d,u[d]||{},p,null,n,void 0,[p])}}};ve.prototype._render=function(e,t,s,n){if(fv(e))return e(this._createMessageContext(s,this._formatter||gv,n,t));var i=this._formatter.interpolate(e,s,n);return i||(i=gv.interpolate(e,s,n)),t==="string"&&!Qt(i)?i.join(""):i};ve.prototype._appendItemToChain=function(e,t,s){var n=!1;return nd(e,t)||(n=!0,t&&(n=t[t.length-1]!=="!",t=t.replace(/!/g,""),e.push(t),s&&s[t]&&(n=s[t]))),n};ve.prototype._appendLocaleToChain=function(e,t,s){var n,i=t.split("-");do{var a=i.join("-");n=this._appendItemToChain(e,a,s),i.splice(-1,1)}while(i.length&&n===!0);return n};ve.prototype._appendBlockToChain=function(e,t,s){for(var n=!0,i=0;i0;)a[o]=arguments[o+4];if(!e)return"";var l=lm.apply(void 0,a);this._escapeParameterHtml&&(l.params=jM(l.params));var c=l.locale||t,u=this._translate(s,c,this.fallbackLocale,e,n,"string",l.params);if(this._isFallbackRoot(u)){if(!this._root)throw Error("unexpected error");return(i=this._root).$t.apply(i,[e].concat(a))}else return u=this._warnDefault(c,e,u,n,a,"string"),this._postTranslation&&u!==null&&u!==void 0&&(u=this._postTranslation(u,e)),u};ve.prototype.t=function(e){for(var t,s=[],n=arguments.length-1;n-- >0;)s[n]=arguments[n+1];return(t=this)._t.apply(t,[e,this.locale,this._getMessages(),null].concat(s))};ve.prototype._i=function(e,t,s,n,i){var a=this._translate(s,t,this.fallbackLocale,e,n,"raw",i);if(this._isFallbackRoot(a)){if(!this._root)throw Error("unexpected error");return this._root.$i18n.i(e,t,i)}else return this._warnDefault(t,e,a,n,[i],"raw")};ve.prototype.i=function(e,t,s){return e?(Qt(t)||(t=this.locale),this._i(e,t,this._getMessages(),null,s)):""};ve.prototype._tc=function(e,t,s,n,i){for(var a,o=[],l=arguments.length-5;l-- >0;)o[l]=arguments[l+5];if(!e)return"";i===void 0&&(i=1);var c={count:i,n:i},u=lm.apply(void 0,o);return u.params=Object.assign(c,u.params),o=u.locale===null?[u.params]:[u.locale,u.params],this.fetchChoice((a=this)._t.apply(a,[e,t,s,n].concat(o)),i)};ve.prototype.fetchChoice=function(e,t){if(!e||!Qt(e))return null;var s=e.split("|");return t=this.getChoiceIndex(t,s.length),s[t]?s[t].trim():e};ve.prototype.tc=function(e,t){for(var s,n=[],i=arguments.length-2;i-- >0;)n[i]=arguments[i+2];return(s=this)._tc.apply(s,[e,this.locale,this._getMessages(),null,t].concat(n))};ve.prototype._te=function(e,t,s){for(var n=[],i=arguments.length-3;i-- >0;)n[i]=arguments[i+3];var a=lm.apply(void 0,n).locale||t;return this._exist(s[a],e)};ve.prototype.te=function(e,t){return this._te(e,this.locale,this._getMessages(),t)};ve.prototype.getLocaleMessage=function(e){return wl(this._vm.messages[e]||{})};ve.prototype.setLocaleMessage=function(e,t){(this._warnHtmlInMessage==="warn"||this._warnHtmlInMessage==="error")&&this._checkLocaleMessage(e,this._warnHtmlInMessage,t),this._vm.$set(this._vm.messages,e,t)};ve.prototype.mergeLocaleMessage=function(e,t){(this._warnHtmlInMessage==="warn"||this._warnHtmlInMessage==="error")&&this._checkLocaleMessage(e,this._warnHtmlInMessage,t),this._vm.$set(this._vm.messages,e,ya(typeof this._vm.messages[e]<"u"&&Object.keys(this._vm.messages[e]).length?Object.assign({},this._vm.messages[e]):{},t))};ve.prototype.getDateTimeFormat=function(e){return wl(this._vm.dateTimeFormats[e]||{})};ve.prototype.setDateTimeFormat=function(e,t){this._vm.$set(this._vm.dateTimeFormats,e,t),this._clearDateTimeFormat(e,t)};ve.prototype.mergeDateTimeFormat=function(e,t){this._vm.$set(this._vm.dateTimeFormats,e,ya(this._vm.dateTimeFormats[e]||{},t)),this._clearDateTimeFormat(e,t)};ve.prototype._clearDateTimeFormat=function(e,t){for(var s in t){var n=e+"__"+s;this._dateTimeFormatters.hasOwnProperty(n)&&delete this._dateTimeFormatters[n]}};ve.prototype._localizeDateTime=function(e,t,s,n,i,a){for(var o=t,l=n[o],c=this._getLocaleChain(t,s),u=0;u0;)t[s]=arguments[s+1];var n=this.locale,i=null,a=null;return t.length===1?(Qt(t[0])?i=t[0]:ws(t[0])&&(t[0].locale&&(n=t[0].locale),t[0].key&&(i=t[0].key)),a=Object.keys(t[0]).reduce(function(o,l){var c;return nd(OM,l)?Object.assign({},o,(c={},c[l]=t[0][l],c)):o},null)):t.length===2&&(Qt(t[0])&&(i=t[0]),Qt(t[1])&&(n=t[1])),this._d(e,n,i,a)};ve.prototype.getNumberFormat=function(e){return wl(this._vm.numberFormats[e]||{})};ve.prototype.setNumberFormat=function(e,t){this._vm.$set(this._vm.numberFormats,e,t),this._clearNumberFormat(e,t)};ve.prototype.mergeNumberFormat=function(e,t){this._vm.$set(this._vm.numberFormats,e,ya(this._vm.numberFormats[e]||{},t)),this._clearNumberFormat(e,t)};ve.prototype._clearNumberFormat=function(e,t){for(var s in t){var n=e+"__"+s;this._numberFormatters.hasOwnProperty(n)&&delete this._numberFormatters[n]}};ve.prototype._getNumberFormatter=function(e,t,s,n,i,a){for(var o=t,l=n[o],c=this._getLocaleChain(t,s),u=0;u0;)t[s]=arguments[s+1];var n=this.locale,i=null,a=null;return t.length===1?Qt(t[0])?i=t[0]:ws(t[0])&&(t[0].locale&&(n=t[0].locale),t[0].key&&(i=t[0].key),a=Object.keys(t[0]).reduce(function(o,l){var c;return nd(qC,l)?Object.assign({},o,(c={},c[l]=t[0][l],c)):o},null)):t.length===2&&(Qt(t[0])&&(i=t[0]),Qt(t[1])&&(n=t[1])),this._n(e,n,i,a)};ve.prototype._ntp=function(e,t,s,n){if(!ve.availabilities.numberFormat)return[];if(!s){var i=n?new Intl.NumberFormat(t,n):new Intl.NumberFormat(t);return i.formatToParts(e)}var a=this._getNumberFormatter(e,t,this.fallbackLocale,this._getNumberFormats(),s,n),o=a&&a.formatToParts(e);if(this._isFallbackRoot(o)){if(!this._root)throw Error("unexpected error");return this._root.$i18n._ntp(e,t,s,n)}else return o||[]};Object.defineProperties(ve.prototype,ht);var q1;Object.defineProperty(ve,"availabilities",{get:function(){if(!q1){var e=typeof Intl<"u";q1={dateTimeFormat:e&&typeof Intl.DateTimeFormat<"u",numberFormat:e&&typeof Intl.NumberFormat<"u"}}return q1}});ve.install=Ay;ve.version="8.28.2";const hR=(r={})=>{const t={...{countryCodeOnly:!1},...r},s=navigator.languages!==void 0?navigator.languages[0]:navigator.language;return s?s=="zh-CN"||s=="zh-TW"?s:t.countryCodeOnly?s.trim().split(/-|_/)[0]:s.trim():void 0};var e3={app:{bedmesh:{label:{active:"active",base:"base",box_scale:"Box scale",flat_surface:"Show flat plane",mesh_matrix:"Mesh matrix",probed_matrix:"Probed matrix",profile_name:"Profile Name",remove_profile:"Remove %{name} profile",scale:"Color scale",wireframe:"Wireframe"},msg:{hint:"If saving as something other than %{name}, you can choose to also remove the %{name} profile",not_found:"No existing bed meshes found.",not_loaded:"No mesh loaded"},tooltip:{calibrate:"Begins a new calibration, saving as profile 'default'",delete:"Delete Profile",load:"Load Profile",save:"Commits calibrated profile to printer.cfg",copy_image:"Copy bed mesh image"}},chart:{label:{current:"Actual",item:"Name",power:"Power",target:"Target",rate_of_change:"Change"},tooltip:{help:"Hold Shift to zoom.
Click an item to toggle in the graph.
Click a power to toggle in the graph."}},console:{label:{auto_scroll:"Auto scroll",flip_layout:"Flip layout",hide_temp_waits:"Hide temp waits"},tooltip:{help:'Enter "help" for commands
Use Tab for autocomplete
Use and for history'}},endpoint:{error:{cant_connect:"Something went wrong, and fluidd can't reach the destination. Are you sure this is the correct address?",cors_error:"blocked by CORS policy",cors_note:'This may mean you need to modify your moonraker configuration. Please see the documentation on multi printer setups here'},hint:{add_printer:"E.g., http://fluiddpi.local"},msg:{trouble:'Having trouble? See here for more information.'},tooltip:{endpoint_examples:"Enter your API URL.
Some examples might be;
fluidd.local, https://192.168.1.150
"}},endstop:{label:{open:"OPEN",triggered:"TRIGGERED"},msg:{subtitle:"Use the refresh button to update endstop status."}},file_system:{filters:{label:{crowsnest_backup_files:"Filter Crowsnest backup files",print_start_time:"Filter printed",hidden_files_folders:"Filter hidden files and folders",klipper_backup_files:"Filter Klipper backup files",moonraker_backup_files:"Filter Moonraker backup files",rolled_log_files:"Filter rolled log files"}},label:{dir_name:"Directory name",disk_usage:"Disk Usage",diskinfo:"Disk Information",downloaded:"Downloaded",file_name:"Filename",transfer_rate:"Transfer rate",uploaded:"Uploaded",view_section_documentation:"View '%{section}' documentation",hour:"hour",minute:"minute",second:"second"},msg:{not_found:"No files found",processing:"Processing"},overlay:{drag_files_folders_upload:"Drag files and folders here to upload",drag_files_enqueue:"Drag files here to enqueue"},title:{add_dir:"Add Directory",add_file:"Add File",command_palette:"Command Palette",devices:"Devices",download_file:"Retrieving file",duplicate_dir:"Duplicate Directory",duplicate_file:"Duplicate File",go_to_file:"Go to file",rename_dir:"Rename Directory",rename_file:"Rename File",upload_file:"Uploading file | Uploading files",check_filament:"Check Filament"},tooltip:{low_on_space:"Low on disk space",items_count:"{count} item | {count} items",root_disabled:"{root} root is not available. Please check your logs.",warning_text:"Please add the types of materials in the material tray, or reduce the types of materials used by the model.",tip:"Select the materials to be used. The top section shows the materials used by the model, and the bottom section shows the corresponding materials in the material tray."},url:{klipper_config:"%{klipperDomain}/Config_Reference.html#%{hash}",moonraker_config:"https://moonraker.readthedocs.io/en/latest/configuration/#%{hash}",moonraker_telegram_bot_config:"https://github.com/nlef/moonraker-telegram-bot/wiki/Sample-config#%{hash}",crowsnest_config:"https://crowsnest.mainsail.xyz/configuration/%{hash}-section"}},gcode:{btn:{load_current_file:"Load Current File"},label:{current_layer_height:"Current Layer Height",exclude_object:"Exclude Object",follow_progress:"Follow progress",layer:"Layer",layers:"Layers",parsed:"Parsed",show_current_layer:"Show current layer",show_extrusions:"Show extrusions",show_moves:"Show moves",show_next_layer:"Show next layer",show_parts:"Show parts",show_previous_layer:"Show previous layer",show_retractions:"Show retractions",parsing_file:"Parsing file"},msg:{confirm:'The file "%{filename}" is %{size}, this might be resource intensive for your system. Are you sure?'},overlay:{drag_file_load:"Drag a gcode file here to load"}},general:{btn:{abort:"Abort",accept:"Accept",add:"Add",add_dir:"Add Directory",add_file:"Add File",add_printer:"Add printer",add_to_queue:"Add to Queue",adjust_layout:"Adjust dashboard layout",adjusted:"Adjusted",all:"All",auth_unsure:"Unsure why you're seeing this?",calibrate:"Calibrate",cancel:"Cancel",clear_profile:"Clear Profile",close:"Close",config_reference:"Config Reference",copied:"Copied",copy:"Copy",create_zip_archive:"Create ZIP Archive",delete:"Delete",download:"Download",duplicate:"Duplicate",edit:"Edit",exit_layout:"Exit layout mode",extrude:"Extrude",filter:"Filter",forgot_password:"Forgotten your password?",go_to_file:"Go to file",heaters_off:"Heaters off",job_queue:"Job Queue",load_all:"Load all",login:"Login",logout:"Logout",more_information:"More information",multiply:"Multiply",pause:"Pause",preheat:"Preheat",presets:"Presets",preview_gcode:"Preview Gcode",print:"Print",quad_gantry_level:"QGL",reboot:"Reboot",recover:"Recover",refresh:"Refresh",refresh_metadata:"Refresh Metadata",reload:"Reload",remove:"Remove",remove_all:"Remove all",rename:"Rename",reprint:"Re-Print",reset_file:"Clear File",reset_layout:"Reset to Default Layout",reset_default_layout:"Reset Default Layout",restart_firmware:"Firmware Restart",restart_service:"Restart %{service}",restart_service_klipper:"Restart Klipper",restart_service_moonraker:"Restart Moonraker",resume:"Resume",retract:"Retract",retry:"Retry",return_dashboard:"Return to the dashboard",save:"Save",save_as:"Save As",save_restart:"Save & Restart",save_config_and_restart:"Save config & restart",select_columns:"Select columns",send:"Send",set_color:"Set Color",set_default_layout:"Set as Default Layout",shutdown:"Shutdown",snooze:"Snooze",socket_reconnect:"Re-Connect",socket_refresh:"Force refresh",thumbnail_size:"Thumbnail size",upload:"Upload",upload_files:"Upload Files",upload_folder:"Upload Folder",upload_print:"Upload & Print",view:"View",reset_stats:"Reset Stats"},error:{app_setup_link:'Fluidd setup requirements can be found here.',app_warnings_found:"%{appName} warnings found.",components_config:'Moonraker plugin configuration can be found here.',failed_components:"Moonraker has failed plugins, please check your logs, update your configuration and restart moonraker."},label:{accel_to_decel:"Accel to Decel",acceleration:"Acceleration",accepted_screws:"Accepted screws",actual_time:"Actual",add_camera:"Add Camera",add_filter:"Add Filter",add_preset:"Add Preset",add_user:"Add user",all:"All",api_key:"Api Key",api_url:"API URL",auth_source:"Authentication Source",bars:"Bars",category:"Category",change_password:"Change password",clear_all:"Clear all",color:"Color",command:"Command",confirm:"Confirm",cross:"Cross",circle:"Circle",compact:"Compact",current_password:"Current password",current_user:"Current user",default:"Default",disabled_while_printing:"Disabled while printing",edit_camera:"Edit Camera",edit_filter:"Edit Filter",edit_preset:"Edit Preset",edit_user:"Edit user",extrude_length:"Extrude Length",extrude_speed:"Extrude Speed",filament:"Filament",file:"File",finish_time:"Finish",flow:"Flow",free:"free",heaters_busy:"The printer is currently busy. Turning off the heaters may result in a failed print.",high:"High",host:"Host",layer:"Layer",layout:"Layout",ldap:"LDAP",longest_job:"Longest job",low:"Low",manage_accounts:"Manage Accounts",minimum_cruise_ratio:"Minimum Cruise Ratio",user_managed_source:"User managed by %{source} authentication",m117:"M117",moonraker:"Moonraker",name:"Name",new_password:"New password",no_notifications:"No notifications",on:"On",off:"Off",numeric_prefix_sort:"Numeric Prefix sort",password:"Password",partial_of_total:"%{partial} of %{total}",pause_at_layer:"Pause at Layer",pause_at_next_layer:"Pause at next layer",pause_at_layer_number:"Pause at layer number",power:"Power",pressure_advance:"Pressure Advance",printers:"Printers",progress:"Progress",range:"Range",requested_speed:"Speed",retract_length:"Retract Length",retract_speed:"Retract Speed",save_as:"Save As",screw_index:"Screw index",screw_name:"Screw name",screw_number:"Screw %{index}",services:"Services",slicer:"Slicer",smooth_time:"Smooth Time",speed:"Speed",sqv:"Square Corner Velocity",stepper_enabled:"Stepper Enabled",synced_extruder:"Synced Extruder",thumbnail_size:"Thumbnail Size",total:"Total",total_filament:"Total filament used",total_filament_avg:"Avg per print",total_jobs:"Total print jobs",total_print_time:"Total print time",total_print_time_avg:"Avg per print",total_time:"Total time",total_time_avg:"Avg per print",turn_device_on:"Turn %{device} on",turn_device_off:"Turn %{device} off",uncategorized:"Uncategorized",unknown:"Unknown",unretract_extra_length:"Unretract Extra Length",unretract_speed:"Unretract Speed",upload_and_print:"Upload and Print",used:"used",username:"Username",velocity:"Velocity",version_sort:"Version sort",visible:"Visible",z_offset:"Z Offset",unsaved_changes:"Unsaved Changes",alias:"Alias",apply_z_offset:"Apply and Save Z_Offset",edit_category:"Edit category",add_category:"Add category",file_time:"File",stepper_driver:"%{name} Driver"},msg:{password_changed:"Password changed",wrong_password:"Oops, something went wrong. Is your password correct?",bed_screws_adjust:"Click Adjusted if a significant adjustment is necessary on the current screw; otherwise, click Accept to continue.",welcome_back:"Welcome back.
Sign in below to stay in touch with your printer.",offline_ready:"Fluidd is now ready to work offline.",needs_refresh:"New content available, please click the Reload button to update.",pending_configuration_sections_deleted:"The following sections are marked for deletion",rolledover_logs:"The following application logs have been rolled over: %{applications}",not_valid_fluidd_backup_file:"Not a valid Fluidd backup file!",fluidd_settings_backup_failed:"Failed to backup Fluidd settings!",fluidd_settings_restore_failed:"Failed to restore Fluidd settings!"},simple_form:{error:{arrayofnums:"Only numbers",credentials:"Invalid credentials",exists:"Already exists",invalid_number:"Invalid Number",invalid_url:"Invalid URL",invalid_expression:"Invalid Expression",max:"Max %{max}",min:"Min %{min}",min_or_0:"Min %{min} or 0",password_username:"Cannot match username",required:"Required",invalid_aspect:"Invalid Aspect Ratio"},msg:{confirm:"Are you sure?",confirm_cancel_print:"Are you sure you want to cancel the current print?",confirm_clear_mesh:"The printer is currently busy. Are you sure you want to clear the bed mesh?",confirm_delete:"Are you sure? This will delete the selected item. | Are you sure? This will delete the {count} selected items.",confirm_emergency_stop:"Are you sure you want to emergency stop the printer?",confirm_exclude_object:"Are you sure you want to exclude this object from printing?",confirm_forcemove_toggle:"Are you sure? This can damage the printer.",confirm_load_bedmesh_profile:"The printer is currently busy. Are you sure you want to load profile %{name}?",confirm_reboot_host:"Are you sure? This will reboot your host system.",confirm_remove_user:"Are you sure you want to remove user %{username}?",confirm_shutdown_host:"Are you sure? This will shutdown your host system.",confirm_service_start:"Are you sure you want to start the %{name} service?",confirm_service_restart:"Are you sure you want to restart the %{name} service?",confirm_service_stop:"Are you sure you want to stop the %{name} service?",confirm_power_device_toggle:"Are you sure? This will toggle the power of this device.",unsaved_changes:"You have unsaved changes. Are you sure you want to close this file?",no_file_preview:"%{name} cannot currently be previewed."}},table:{header:{actions:"Actions",chamber_temp:"Chamber temp",end_time:"Ended",estimated_time:"Estimated time",filament:"Filament",filament_name:"Filament name",filament_type:"Filament type",filament_used:"Used filament",filament_weight_total:"Filament weight",first_layer_bed_temp:"First layer bed temp",first_layer_extr_temp:"First layer extruder temp",first_layer_height:"First layer height",height:"Height",last_printed:"Last printed",layer_height:"Layer height",modified:"Modified",name:"Name",nozzle_diameter:"Nozzle diameter",print_duration:"Print duration",time_added:"Time Added",time_in_queue:"Time In Queue",size:"Size",slicer:"Slicer",slicer_version:"Slicer version",start_time:"Started",status:"Status",total_duration:"Total duration"}},title:{add_chart:"Add Chart",add_printer:"Add Printer",bedmesh:"Bed Mesh",bedmesh_controls:"Bed Mesh Controls",camera:"Camera | Cameras",config_files:"Configuration Files",configure:"Configuration",console:"Console",diagnostics:"Diagnostics",edit_chart:"Edit Chart",endstops:"Endstops",fans_outputs:"Fans & Outputs",gcode_preview:"Gcode Preview",history:"History",home:"Home",jobs:"Jobs",job_queue:"Job Queue",limits:"Printer Limits",macros:"Macros",metrics_explorer:"Metrics Explorer",not_found:"404 Not Found",other_files:"Other Files",pending_configuration_changes:"Pending Configuration Changes",retract:"Firmware Retraction",rollover_logs:"Rollover logs",runout_sensors:"Runout Sensors",settings:"Settings",stats:"Printer Stats",system:"System",system_overview:"System Information",temperature:"Thermals",timelapse:"Timelapse",tool:"Tool",tune:"Tune"},tooltip:{browse_metrics:"Browse available metrics",estop:"Emergency Stop",managed_by_moonraker:"Managed by your moonraker configuration",notifications:"Notifications",reload_klipper:"Reloads klipper configuration.",reload_restart_klipper:"Reloads klipper configuration and restarts MCU's.",restart_klipper:"Restarts the klipper system service.",run_collector:"Run collector",rollover_logs:"Rollover logs",file_browser_help:'Drag and drop files or folders from outside the browser to upload them here
Move files and folders by dragging and dropping them onto sub-folders or ".."',file_browser_configuration_help:"Copy files and folders to the Configuration Files by dragging them from here and dropping them there"}},history:{msg:{confirm:"Are you sure? This will clear all history, and printer statistics",confirm_jobs:"Are you sure? This will clear all jobs.",confirm_stats:"Are you sure? This will clear all stats."}},job_queue:{msg:{confirm:"Are you sure? This will clear the entire printer queue"},label:{number_of_copies:"Number of copies"},title:{multiply_job:"Multiply Job | Multiply Jobs"},tooltip:{help:"Queue jobs by dragging files from the Jobs and dropping them here
Adjust the order of queued jobs by dragging them up or down"}},printer:{state:{busy:"Busy",cancelled:"Cancelled",complete:"Complete",idle:"Idle",loading:"Loading",paused:"Paused",printing:"Printing",ready:"Ready",standby:"Standby"},title:{printer_status:"Printer Status",stepper_driver_overheating:"Stepper driver '%{name}' is over-heating"},msg:{possible_print_failure:"This may lead to a failed print"},url:{stepper_driver_overheating:"%{klipperDomain}/TMC_Drivers.html#tmc-reports-error-ot1overtemperror"}},setting:{btn:{add_camera:"Add Camera",add_category:"Add Category",add_filter:"Add Filter",add_metric:"Add Metric",add_thermal_preset:"Add Preset",add_user:"Add user",backup:"Backup",reset:"Reset",restore:"Restore",select_theme:"Select Theme"},camera_type_options:{mjpegadaptive:"MJPEG Adaptive",mjpegstream:"MJPEG Stream",hlsstream:"HLS Stream",webrtc_camera_streamer:"WebRTC (camera-streamer)",video:"IP Camera",iframe:"HTTP page",webrtc_go2rtc:"WebRTC (go2rtc)",webrtc_mediamtx:"WebRTC (MediaMTX)"},camera_rotate_options:{90:"90°",180:"180°",270:"270°",none:"None"},label:{all_off:"All off",all_on:"All on",aspect_ratio:"Aspect Ratio",aspect_ratio_format:"[width : height]",auto_edit_extensions:"Extensions to automatically open in edit mode",auto_follow_on_file_load:"Automatically follow progress on file load",auto_load_on_print_start:"Automatically load file on print start",auto_load_mobile_on_print_start:"Automatically load file on mobile devices",axes:"Axes",camera_flip_x:"Flip horizontally",camera_flip_y:"Flip vertically",camera_fullscreen_action:{title:"Fullscreen action",embed:"Embed",rawstream:"Raw stream"},camera_rotate_by:"Rotate by",camera_stream_type:"Stream type",camera_url_snapshot:"Camera Url Snapshot",camera_url_stream:"Camera Url Stream",card:"Card",collector:"Collector",confirm_on_estop:"Require confirm on Emergency Stop",confirm_on_power_device_change:"Require confirm on Device Power changes",confirm_on_save_config_and_restart:"Review Pending Configuration Changes before Save and Restart",confirm_dirty_editor_close:"Require confirm when closing the editor with unsaved changes",contains:"Contains",dark_mode:"Dark mode",dashed:"Dashed",default_extrude_length:"Default extrude length",default_extrude_speed:"Default extrude speed",default_min_layer_height:"Default minimum layer height",default_toolhead_move_length:"Default toolhead move length",default_toolhead_xy_speed:"Default toolhead XY speed",default_toolhead_z_speed:"Default toolhead Z speed",dotted:"Dotted",draw_background:"Draw Background",draw_origin:"Draw origin",enable:"Enable",enable_diagnostics:"Enable diagnostics",enable_notifications:"Enable notifications",enable_xy_homing:"Enable XY Homing",expression:"Expression",extrusion_line_width:"Extrusion Line Width",flip_horizontal:"Horizontal Flip",flip_vertical:"Vertical Flip",fill_color:"Fill color",fill_opacity:"Fill opacity",filter:"Filter | Filters",fluidd_settings_in_moonraker_db:"Fluidd settings in Moonraker database",fps_target:"FPS Target",fps_idle_target:"FPS Target when not in focus",height:"Height",hide_single_part_bounding_box:"Hide part bounding box when printing a single part",gcode_coords:"Use GCode Coordinates",icon:"Icon",invert_x_control:"Invert X control",invert_y_control:"Invert Y control",invert_z_control:"Invert Z control",keyboard_shortcuts:"Keyboard shortcuts",language:"Display Language",last_result:"Last result",left_y:"Left Y-Axis",line_color:"Line color",line_style:"Line style",min:"Minimum",max:"Maximum",metrics:"Metrics",move_line_width:"Move Line Width",name:"Name",never:"Never",none:"None",optional:"Optional",power_toggle_in_top_nav:"Power toggle in top navigation",primary_color:"Primary color",print_eta_calculation:"Print ETA calculation",print_in_progress_layout:"Print in Progress layout",print_progress_calculation:"Print Progress calculation",printer_name:"Printer Name",reset:"Reset settings",retraction_icon_size:"Retraction Icon Size",right_y:"Right Y-Axis",save_and_restore_view_state:"Save and restore view state",sections_to_ignore_pending_configuration_changes:"Sections to ignore Pending Configuration Changes",show_animations:"Show animations",show_barometric_pressure:"Show barometric pressure",show_chart:"Show chart",show_code_lens:"Show CodeLens",show_gas_resistance:"Show gas resistance",show_legend:"Show legend",show_logo_on_background:"Show logo on background",show_rate_of_change:"Show temperature rate of change",show_relative_humidity:"Show relative humidity",show_save_config_and_restart:"Save Config and Restart button in top navigation",show_upload_and_print:"Show Upload and Print button in top navigation",solid:"Solid",starts_with:"Starts with",theme_preset:"Community preset",thermal_preset_gcode:"GCode",thermal_preset_name:"Preset Name",title:"Title",to_browser_local_storage:"To browser local storage",to_browser_session_storage:"To browser session storage",toolhead_control_style:"Toolhead control style",toolhead_move_distances:"Toolhead distance values",toolhead_xy_move_distances:"Toolhead XY distance values",toolhead_z_move_distances:"Toolhead Z distance values",type:"Type",unit:"Unit",z_adjust_values:"Z Adjust values",date_format:"Date format",time_format:"Time format",text_sort_order:"Text sort order",force_move_toggle_warning:"Require confirm when activating FORCE_MOVE",show_manual_probe_dialog_automatically:"Show Manual Probe dialog automatically",show_bed_screws_adjust_dialog_automatically:"Show Bed Screws Adjust dialog automatically",show_screws_tilt_adjust_dialog_automatically:"Show Screws Tilt Adjust dialog automatically"},timer_options:{absolute_file_position:"Absolute file position",duration:"Duration only",filament:"Filament",file:"File",relative_file_position:"Relative file position",slicer:"Slicer",slicer_m73:"Slicer (M73)"},title:{authentication:"Authentication",console:"Console",camera:"Camera | Cameras",file_browser:"File Browser",file_editor:"File Editor",gcode_preview:"Gcode Preview",general:"General",macros:"Macros",theme:"Theme",thermal_presets:"Thermal Presets",tool:"Tool"},tooltip:{average_calculation:"If more than one option is select, an average will be calculated",diagnostics_performance:"[BETA] Logging diagnostics info may impact performance",gcode_coords:"Use GCode position instead of toolhead position on dashboard",keyboard_shortcuts:"[BETA] Enable and press '?' to view the list of available keyboard shortcuts",show_manual_probe_dialog_automatically:"Automatically shows helper dialog if running a Manual Probe tool",show_bed_screws_adjust_dialog_automatically:"Automatically shows helper dialog if running BED_SCREWS_ADJUST tool",show_screws_tilt_adjust_dialog_automatically:"Automatically shows helper dialog if running SCREWS_TILT_CALCULATE tool",theme_disclaimer:"These themes feature brand names and logos that are the intellectual property of their respective owners.
The inclusion of these names and logos is done with permission from the brands.
However, please note that these themes are not officially maintained by the respective brands.
Any issues or inquiries related to the themes should be directed to the Fluidd team.
The use of brand names and logos is for decorative and aesthetic purposes only, and no official association with or endorsement by the brands is implied."}},socket:{msg:{connecting:"Connecting to moonraker...",no_connection:"No moonraker connection. Please check moonraker status and / or refresh."}},system_info:{label:{awake_time:"awake time",capacity:"Capacity",constants:"Constants",cpu_desc:"CPU Description",devices:"Devices",distribution_codename:"Codename",distribution_like:"Distribution Like",distribution_name:"Distribution",frequency:"Frequency",hardware_desc:"Hardware Description",hostname:"Hostname",klipper_load:"Klipper Load",load:"load",manufactured:"Manufactured",manufacturer:"Manufacturer",memory_used:"memory used",mcu_awake:"{mcu} Awake Time",mcu_bandwidth:"{mcu} Bandwidth",mcu_information:"{mcu} Information",mcu_load:"{mcu} Load",micro_controller:"Micro-Controller",model:"CPU Model",moonraker_load:"Moonraker Load",last_stats:"Last Stats",network:"Network",processor_desc:"Processor",product_name:"Product Name",serial_number:"Serial Number",system_load:"System Load",system_memory:"System Memory",system_utilization:"System Utilization",total_memory:"Total Memory",operating_system:"Operating System",version:"Version",virtualization:"Virtualization"},msg:{canbus_warning:'Only unassigned CAN bus nodes can be detected.
It is recommended to have only one unassigned device connected to the CAN bus to avoid communication issues.
More information can be found here.',no_devices_found:"No devices found",no_devices_searched:"Use the refresh button to search for devices"}},tool:{btn:{home_x:"X",home_y:"Y",home_all:"All"},title:{bed_screws_adjust:"Bed Screws Adjust",manual_probe:"Manual Probe",screws_tilt_adjust:"Screws Tilt Adjust"},tooltip:{absolute_positioning:"Absolute Positioning",extruder_disabled:"extruder disabled, below min_extrude_temp (%{min}°C)",home_xy:"Home XY",home_z:"Home Z",manual_probe:"Manual Probe",motors_off:"Motors Off",relative_positioning:"Relative Positioning",select_tool:"Select tool %{tool}",tools:"Tools"},label:{stats_active_extruder:'The active extruder configuration is set for %{filamentDiameter} mm diameter filament and %{nozzleDiameter} mm nozzle',stats_volumetric_flow:'Extruding at %{extrudeSpeed} mm/s, the extruder should be able to provide an estimated volumetric flow of %{estimatedVolumetricFlow} mm³/s',stats_extruded_length:'Extruding %{extrudeLength} mm of filament at %{extrudeFactor} % flow, will provide an estimated output length of %{estimatedExtrudedLength} mm',stats_max_speed:'Assuming a %{layerHeight} mm layer height, the estimated maximum print speed is %{estimatedMaxSpeed} mm/s'}},version:{btn:{check_for_updates:"Check for updates",finish:"Finish",update:"Update",update_all:"Update all",view_versions:"View versions"},label:{commit_history:"Commit History",commits_on:"commits on",committed:"Committed",dirty:"DIRTY",invalid:"INVALID",os_packages:"OS Packages",package_list:"Package List",up_to_date:"UP TO DATE",updates_available:"Updates are available",old_component_version:"You are using an old version of %{name} that does not support all features of Fluidd.
Update %{name} to at least %{version}."},status:{finished:"Updates finished",updating:"Updating..."},title:"Software Updates",tooltip:{commit_history:"Commit history",dirty:"indicates a detached head, not on master or an invalid origin",invalid:"indicates local changes to the repo",packages:"Packages",release_notes:"Release notes"}},timelapse:{btn:{render:"Render",save_frames:"Save Frames"},error:{newframe:"Error taking timelapse frame"},label:{frames:"%{frames} frame | %{frames} frames",length:"Estimated length: %{length}",frame:"Frame | Frames"},title:{timelapse_settings:"Timelapse Settings",timelapse_status:"Timelapse Status",render_settings:"Render Settings"},setting:{enable:"Enabled",auto_render:"Auto Render",crf:"Constant Rate Factor",duplicatelastframe:"Duplicate last frames",fw_retract:"Use Firmware Retraction",gcode_verbose:"Verbose Gcode",mode:"Mode",mode_layermacro:"Layer Macro",mode_hyperlapse:"Hyperlapse",hyperlapse_cycle:"Hyperlapse Cycle",output_framerate:"Output Framerate",park_retract_distance:"Park Retraction Distance",park_retract_speed:"Park Retraction Speed",park_extrude_distance:"Park Extrude Distance",park_extrude_speed:"Park Extrude Speed",parkhead:"Park Head",park_time:"Park Time",park_travel_speed:"Park Travel Speed",park_custom_pos_x:"Park Position X",park_custom_pos_y:"Park Position Y",park_custom_pos_dz:"Park Position Z-Hop",parkpos:{label:"Park Position",custom:"Custom",front_left:"Front Left",front_right:"Front Right",center:"Center",back_left:"Back Left",back_right:"Back Right",x_only:"Move X only",y_only:"Move Y only"},previewimage:"Generate Thumbnail",saveframes:"Save Frames",stream_delay_compensation:"Delay Compensation",targetlength:"Target Length",variable_fps:"Variable FPS",variable_fps_min:"Minimum Framerate",variable_fps_max:"Maximum Framerate"}},spoolman:{btn:{manage_spools:"Manage Spools",scan_code:"Scan Code",select:"Select | Select for {macro}"},title:{spoolman:"Spoolman",spool_selection:"Spool Selection | Spool Selection for macro {macro}",scan_spool:"Scan Spool"},label:{active_spool:"Active Spool",change_spool:"Change Spool",comment:"Comment",device_camera:"Device",filament_name:"Filament",first_used:"First Used",id:"ID",last_used:"Last Used",location:"Location",lot_nr:"Lot Nr",material:"Material",remaining_weight:"Remaining",vendor:"Vendor",weight:"Weight",length:"Length"},msg:{no_spool:"You haven't selected a spool. Are you sure you want to print without filament tracking?",no_filament:"The spool you selected may not have enough filament left on it to successfully finish the print job. Are you sure you want to continue?",no_required_length:"The amount of filament required to print the selected file is unknown. Do you wish to continue?",mismatched_filament:"The material of the selected filament does not match the selected material in the slicer. Are you sure you want to continue?",tracking_inactive:"Filament tracking is inactive. To get started, please select a spool.",not_connected:"Spoolman server not available.",info:{howto:"Show your spool's QR code to the camera. This window will close as soon as a spool is detected."},warning:{code_not_recognized:"This code doesn't look like a compatible QR code.",invalid_spool_id:"The spool ID contained in this QR code is invalid."},error:{cors:"There was an error accessing the cameras feed. Please make sure your webcam server allows CORS access.",spool_not_existant:"The spool you scanned doesn't exist in the database.",no_image_data:"There was an error accessing the cameras feed. Please check your camera configuration or try another camera source."}},setting:{auto_open_qr_camera:"Automatically open camera for QR code detection",auto_select_spool_on_match:"Automatically commit spool selection on QR code match",prefer_device_camera:"Use device camera for QR code detection if available",show_spool_selection_dialog_on_print_start:"Show spool selection dialog on print start",warn_on_not_enough_filament:"Show a warning when the selected spool doesn't have enough filament left on it to finish the print",warn_on_filament_type_mismatch:"Show a warning when the spool's filament type and the one selected in the slicer don't match",remaining_filament_unit:"Show remaining filament as"}},sensors:{title:{sensors:"Sensors"}},keyboard_shortcuts:{title:{keyboard_shortcuts:"Keyboard Shortcuts"},label:{actions:"Actions",cancel:"Cancel",emergency_stop:"Emergency stop",home_all:"Home all",navigation:"Navigation",open_keyboard_shortcut_help:"Open keyboard shortcut help",pause:"Pause",printing:"Printing",tool:"Tool"}},box:{btn:{uninstall:"Uninstall",load:"Load",unload:"Unload"},label:{vendor:"Vendor",filament:"Filament",color:"Color",title:"Control Box",rack:"Rack"},tooltip:{control_filament:"Control feeding and unloading of a single material slot, as well as read data such as filament color and material type."}}}};const fR=Object.freeze(Object.defineProperty({__proto__:null,default:e3},Symbol.toStringTag,{value:"Module"}));var t3=typeof global=="object"&&global&&global.Object===Object&&global,mR=typeof self=="object"&&self&&self.Object===Object&&self,Js=t3||mR||Function("return this")(),yn=Js.Symbol,r3=Object.prototype,gR=r3.hasOwnProperty,vR=r3.toString,cc=yn?yn.toStringTag:void 0;function _R(r){var e=gR.call(r,cc),t=r[cc];try{r[cc]=void 0;var s=!0}catch{}var n=vR.call(r);return s&&(e?r[cc]=t:delete r[cc]),n}var yR=Object.prototype,bR=yR.toString;function $R(r){return bR.call(r)}var SR="[object Null]",wR="[object Undefined]",rS=yn?yn.toStringTag:void 0;function qa(r){return r==null?r===void 0?wR:SR:rS&&rS in Object(r)?_R(r):$R(r)}function bn(r){return r!=null&&typeof r=="object"}var xR="[object Symbol]";function Oy(r){return typeof r=="symbol"||bn(r)&&qa(r)==xR}function CR(r,e){for(var t=-1,s=r==null?0:r.length,n=Array(s);++t0){if(++e>=WR)return arguments[0]}else e=0;return r.apply(void 0,arguments)}}function YR(r){return function(){return r}}var Ch=function(){try{var r=Ya(Object,"defineProperty");return r({},"",{}),r}catch{}}(),KR=Ch?function(r,e){return Ch(r,"toString",{configurable:!0,enumerable:!1,value:YR(e),writable:!0})}:Ty,XR=ZR(KR);function QR(r,e){for(var t=-1,s=r==null?0:r.length;++t-1&&r%1==0&&r-1&&r%1==0&&r<=iI}function pm(r){return r!=null&&My(r.length)&&!ky(r)}function aI(r,e,t){if(!qs(t))return!1;var s=typeof e;return(s=="number"?pm(t)&&um(e,t.length):s=="string"&&e in t)?id(t[e],r):!1}function i3(r){return nI(function(e,t){var s=-1,n=t.length,i=n>1?t[n-1]:void 0,a=n>2?t[2]:void 0;for(i=r.length>3&&typeof i=="function"?(n--,i):void 0,a&&aI(t[0],t[1],a)&&(i=n<3?void 0:i,n=1),e=Object(e);++s-1}function gF(r,e){var t=this.__data__,s=hm(t,r);return s<0?(++this.size,t.push([r,e])):t[s][1]=e,this}function Yn(r){var e=-1,t=r==null?0:r.length;for(this.clear();++en?0:n+e),t=t>n?n:t,t<0&&(t+=n),n=e>t?0:t-e>>>0,e>>>=0;for(var i=Array(n);++s=s?r:_v(r,e,t)}var FF="\\ud800-\\udfff",HF="\\u0300-\\u036f",BF="\\ufe20-\\ufe2f",jF="\\u20d0-\\u20ff",VF=HF+BF+jF,NF="\\ufe0e\\ufe0f",zF="\\u200d",UF=RegExp("["+zF+FF+VF+NF+"]");function f3(r){return UF.test(r)}function WF(r){return r.split("")}var m3="\\ud800-\\udfff",GF="\\u0300-\\u036f",qF="\\ufe20-\\ufe2f",ZF="\\u20d0-\\u20ff",YF=GF+qF+ZF,KF="\\ufe0e\\ufe0f",XF="["+m3+"]",yv="["+YF+"]",bv="\\ud83c[\\udffb-\\udfff]",QF="(?:"+yv+"|"+bv+")",g3="[^"+m3+"]",v3="(?:\\ud83c[\\udde6-\\uddff]){2}",_3="[\\ud800-\\udbff][\\udc00-\\udfff]",JF="\\u200d",y3=QF+"?",b3="["+KF+"]?",eH="(?:"+JF+"(?:"+[g3,v3,_3].join("|")+")"+b3+y3+")*",tH=b3+y3+eH,rH="(?:"+[g3+yv+"?",yv,v3,_3,XF].join("|")+")",sH=RegExp(bv+"(?="+bv+")|"+rH+tH,"g");function nH(r){return r.match(sH)||[]}function iH(r){return f3(r)?nH(r):WF(r)}function aH(r){return function(e){e=cd(e);var t=f3(e)?iH(e):void 0,s=t?t[0]:e.charAt(0),n=t?IF(t,1).join(""):e.slice(1);return s[r]()+n}}var mm=aH("toUpperCase");function Ny(r){return mm(cd(r).toLowerCase())}function oH(r,e,t,s){for(var n=-1,i=r==null?0:r.length;++no))return!1;var c=i.get(r),u=i.get(e);if(c&&u)return c==e&&u==r;var d=-1,p=!0,h=t&Dj?new Ah:void 0;for(i.set(r,e),i.set(e,r);++dPV(r,(e,t)=>{var s;return(s=t.split("/").pop())==null?void 0:s.split(".")[0]}),G3e=Object.freeze(Gy(Object.assign({"/src/monaco/language/gcode.tmLanguage.json":()=>Ye(()=>import("./gcode.tmLanguage-CxxTzjZ-.js"),[],import.meta.url).then(r=>r.default),"/src/monaco/language/klipper-config.tmLanguage.json":()=>Ye(()=>import("./klipper-config.tmLanguage-DHe00u4k.js"),[],import.meta.url).then(r=>r.default),"/src/monaco/language/log.tmLanguage.json":()=>Ye(()=>import("./log.tmLanguage-DH-qwE--.js"),[],import.meta.url).then(r=>r.default)}))),EV=Object.freeze(Gy(Object.assign({"/src/locales/af.yaml":()=>Ye(()=>import("./af-mps6ICIQ.js"),[],import.meta.url).then(r=>r.default),"/src/locales/ar.yaml":()=>Ye(()=>import("./ar-DLWXELLU.js"),[],import.meta.url).then(r=>r.default),"/src/locales/cs.yaml":()=>Ye(()=>import("./cs-DX6v0VI2.js"),[],import.meta.url).then(r=>r.default),"/src/locales/de.yaml":()=>Ye(()=>import("./de-wxpHuzeZ.js"),[],import.meta.url).then(r=>r.default),"/src/locales/en.yaml":()=>Ye(()=>Promise.resolve().then(()=>fR),void 0,import.meta.url).then(r=>r.default),"/src/locales/es.yaml":()=>Ye(()=>import("./es-SJydnxzH.js"),[],import.meta.url).then(r=>r.default),"/src/locales/fr.yaml":()=>Ye(()=>import("./fr-DoiaUWIQ.js"),[],import.meta.url).then(r=>r.default),"/src/locales/hu.yaml":()=>Ye(()=>import("./hu-DZHz7Kx7.js"),[],import.meta.url).then(r=>r.default),"/src/locales/it.yaml":()=>Ye(()=>import("./it-C-3NCLqC.js"),[],import.meta.url).then(r=>r.default),"/src/locales/ja.yaml":()=>Ye(()=>import("./ja-DwKdLJlg.js"),[],import.meta.url).then(r=>r.default),"/src/locales/ko.yaml":()=>Ye(()=>import("./ko-CVGOyHIb.js"),[],import.meta.url).then(r=>r.default),"/src/locales/nl.yaml":()=>Ye(()=>import("./nl-CotZl5xy.js"),[],import.meta.url).then(r=>r.default),"/src/locales/pl.yaml":()=>Ye(()=>import("./pl-zmuLZD6n.js"),[],import.meta.url).then(r=>r.default),"/src/locales/pt.yaml":()=>Ye(()=>import("./pt-CSzrLhTW.js"),[],import.meta.url).then(r=>r.default),"/src/locales/ru.yaml":()=>Ye(()=>import("./ru-D20pk4zT.js"),[],import.meta.url).then(r=>r.default),"/src/locales/sl.yaml":()=>Ye(()=>import("./sl-BDj-z85b.js"),[],import.meta.url).then(r=>r.default),"/src/locales/tr.yaml":()=>Ye(()=>import("./tr-DD5nV5yB.js"),[],import.meta.url).then(r=>r.default),"/src/locales/uk.yaml":()=>Ye(()=>import("./uk-D7fsDPbb.js"),[],import.meta.url).then(r=>r.default),"/src/locales/zh-CN.yaml":()=>Ye(()=>import("./zh-CN-VQ91wzBt.js"),[],import.meta.url).then(r=>r.default),"/src/locales/zh-TW.yaml":()=>Ye(()=>import("./zh-TW-CQJMEs7b.js"),[],import.meta.url).then(r=>r.default)}))),DS=Object.freeze(Gy(Object.assign({"/src/components/widgets/camera/services/DeviceCamera.vue":()=>Ye(()=>import("./DeviceCamera-BD1S1a_T.js"),[],import.meta.url),"/src/components/widgets/camera/services/HlsstreamCamera.vue":()=>Ye(()=>import("./HlsstreamCamera-BwaV2una.js"),[],import.meta.url),"/src/components/widgets/camera/services/IframeCamera.vue":()=>Ye(()=>import("./IframeCamera-DGUbOvGq.js"),[],import.meta.url),"/src/components/widgets/camera/services/IpstreamCamera.vue":()=>Ye(()=>import("./IpstreamCamera-C1K9O4EA.js"),[],import.meta.url),"/src/components/widgets/camera/services/MjpegstreamerAdaptiveCamera.vue":()=>Ye(()=>import("./MjpegstreamerAdaptiveCamera-oOaK14jH.js"),[],import.meta.url),"/src/components/widgets/camera/services/MjpegstreamerCamera.vue":()=>Ye(()=>import("./MjpegstreamerCamera-CXlqsO_0.js"),[],import.meta.url),"/src/components/widgets/camera/services/WebrtcCamerastreamerCamera.vue":()=>Ye(()=>import("./WebrtcCamerastreamerCamera-COt5QBCW.js"),[],import.meta.url),"/src/components/widgets/camera/services/WebrtcGo2RtcCamera.vue":()=>Ye(()=>import("./WebrtcGo2RtcCamera-DtI6qUm8.js"),[],import.meta.url),"/src/components/widgets/camera/services/WebrtcMediamtxCamera.vue":()=>Ye(()=>import("./WebrtcMediamtxCamera-G0N7e5mu.js"),[],import.meta.url)})));b.use(ve);const J3=()=>{const r=hR({countryCodeOnly:!0});return r&&NC.findIndex(e=>e.code===r)>=0?r:"en"},e4=J3(),st=new ve({locale:e4,fallbackLocale:"en",messages:{}});st.setLocaleMessage("en",e3);const X1=[],Ev=async r=>{if(X1.length>0&&st.locale===r)return r;if(X1.includes(r))return st.locale=r,r;try{const e=await EV[r]();return st.setLocaleMessage(r,e),X1.push(r),st.locale=r,r}catch{return st.locale}};Ev(e4);/*! + * vue-router v3.6.5 + * (c) 2022 Evan You + * @license MIT + */function js(r,e){for(var t in e)r[t]=e[t];return r}var OV=/[!'()*]/g,TV=function(r){return"%"+r.charCodeAt(0).toString(16)},kV=/%2C/g,bo=function(r){return encodeURIComponent(r).replace(OV,TV).replace(kV,",")};function Ov(r){try{return decodeURIComponent(r)}catch{}return r}function DV(r,e,t){e===void 0&&(e={});var s=t||MV,n;try{n=s(r||"")}catch{n={}}for(var i in e){var a=e[i];n[i]=Array.isArray(a)?a.map(MS):MS(a)}return n}var MS=function(r){return r==null||typeof r=="object"?r:String(r)};function MV(r){var e={};return r=r.trim().replace(/^(\?|#|&)/,""),r&&r.split("&").forEach(function(t){var s=t.replace(/\+/g," ").split("="),n=Ov(s.shift()),i=s.length>0?Ov(s.join("=")):null;e[n]===void 0?e[n]=i:Array.isArray(e[n])?e[n].push(i):e[n]=[e[n],i]}),e}function RV(r){var e=r?Object.keys(r).map(function(t){var s=r[t];if(s===void 0)return"";if(s===null)return bo(t);if(Array.isArray(s)){var n=[];return s.forEach(function(i){i!==void 0&&(i===null?n.push(bo(t)):n.push(bo(t)+"="+bo(i)))}),n.join("&")}return bo(t)+"="+bo(s)}).filter(function(t){return t.length>0}).join("&"):null;return e?"?"+e:""}var Eh=/\/?$/;function Oh(r,e,t,s){var n=s&&s.options.stringifyQuery,i=e.query||{};try{i=Tv(i)}catch{}var a={name:e.name||r&&r.name,meta:r&&r.meta||{},path:e.path||"/",hash:e.hash||"",query:i,params:e.params||{},fullPath:RS(e,n),matched:r?IV(r):[]};return t&&(a.redirectedFrom=RS(t,n)),Object.freeze(a)}function Tv(r){if(Array.isArray(r))return r.map(Tv);if(r&&typeof r=="object"){var e={};for(var t in r)e[t]=Tv(r[t]);return e}else return r}var Bi=Oh(null,{path:"/"});function IV(r){for(var e=[];r;)e.unshift(r),r=r.parent;return e}function RS(r,e){var t=r.path,s=r.query;s===void 0&&(s={});var n=r.hash;n===void 0&&(n="");var i=e||RV;return(t||"/")+i(s)+n}function t4(r,e,t){return e===Bi?r===e:e?r.path&&e.path?r.path.replace(Eh,"")===e.path.replace(Eh,"")&&(t||r.hash===e.hash&&Vp(r.query,e.query)):r.name&&e.name?r.name===e.name&&(t||r.hash===e.hash&&Vp(r.query,e.query)&&Vp(r.params,e.params)):!1:!1}function Vp(r,e){if(r===void 0&&(r={}),e===void 0&&(e={}),!r||!e)return r===e;var t=Object.keys(r).sort(),s=Object.keys(e).sort();return t.length!==s.length?!1:t.every(function(n,i){var a=r[n],o=s[i];if(o!==n)return!1;var l=e[n];return a==null||l==null?a===l:typeof a=="object"&&typeof l=="object"?Vp(a,l):String(a)===String(l)})}function FV(r,e){return r.path.replace(Eh,"/").indexOf(e.path.replace(Eh,"/"))===0&&(!e.hash||r.hash===e.hash)&&HV(r.query,e.query)}function HV(r,e){for(var t in e)if(!(t in r))return!1;return!0}function r4(r){for(var e=0;e=0&&(e=r.slice(s),r=r.slice(0,s));var n=r.indexOf("?");return n>=0&&(t=r.slice(n+1),r=r.slice(0,n)),{path:r,query:t,hash:e}}function bi(r){return r.replace(/\/(?:\s*\/)+/g,"/")}var Th=Array.isArray||function(r){return Object.prototype.toString.call(r)=="[object Array]"},xl=a4,NV=qy,zV=qV,UV=n4,WV=i4,GV=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function qy(r,e){for(var t=[],s=0,n=0,i="",a=e&&e.delimiter||"/",o;(o=GV.exec(r))!=null;){var l=o[0],c=o[1],u=o.index;if(i+=r.slice(n,u),n=u+l.length,c){i+=c[1];continue}var d=r[n],p=o[2],h=o[3],m=o[4],g=o[5],v=o[6],y=o[7];i&&(t.push(i),i="");var C=p!=null&&d!=null&&d!==p,x=v==="+"||v==="*",S=v==="?"||v==="*",E=o[2]||a,G=m||g;t.push({name:h||s++,prefix:p||"",delimiter:E,optional:S,repeat:x,partial:C,asterisk:!!y,pattern:G?KV(G):y?".*":"[^"+Np(E)+"]+?"})}return n1||!E.length)return E.length===0?e():e("span",{},E)}if(this.tag==="a")S.on=x,S.attrs={href:l,"aria-current":y};else{var G=o4(this.$slots.default);if(G){G.isStatic=!1;var K=G.data=js({},G.data);K.on=K.on||{};for(var le in K.on){var ue=K.on[le];le in x&&(K.on[le]=Array.isArray(ue)?ue:[ue])}for(var ie in x)ie in K.on?K.on[ie].push(x[ie]):K.on[ie]=C;var fe=G.data.attrs=js({},G.data.attrs);fe.href=l,fe["aria-current"]=y}else S.on=x}return e(this.tag,S,this.$slots.default)}};function BS(r){if(!(r.metaKey||r.altKey||r.ctrlKey||r.shiftKey)&&!r.defaultPrevented&&!(r.button!==void 0&&r.button!==0)){if(r.currentTarget&&r.currentTarget.getAttribute){var e=r.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return r.preventDefault&&r.preventDefault(),!0}}function o4(r){if(r){for(var e,t=0;t-1&&(v.params[S]=m.params[S]);return v.path=zp(C.path,v.params),p(C,v,g)}else if(v.path){v.params={};for(var E=0;E-1}function ym(r,e){return Mh(r)&&r._isRouter&&(e==null||r.type===e)}function WS(r,e,t){var s=function(n){n>=r.length?t():r[n]?e(r[n],function(){s(n+1)}):s(n+1)};s(0)}function _N(r){return function(e,t,s){var n=!1,i=0,a=null;f4(r,function(o,l,c,u){if(typeof o=="function"&&o.cid===void 0){n=!0,i++;var d=GS(function(g){bN(g)&&(g=g.default),o.resolved=typeof g=="function"?g:kh.extend(g),c.components[u]=g,i--,i<=0&&s()}),p=GS(function(g){var v="Failed to resolve async component "+u+": "+g;a||(a=Mh(g)?g:new Error(v),s(a))}),h;try{h=o(d,p)}catch(g){p(g)}if(h)if(typeof h.then=="function")h.then(d,p);else{var m=h.component;m&&typeof m.then=="function"&&m.then(d,p)}}}),n||s()}}function f4(r,e){return m4(r.map(function(t){return Object.keys(t.components).map(function(s){return e(t.components[s],t.instances[s],t,s)})}))}function m4(r){return Array.prototype.concat.apply([],r)}var yN=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol";function bN(r){return r.__esModule||yN&&r[Symbol.toStringTag]==="Module"}function GS(r){var e=!1;return function(){for(var t=[],s=arguments.length;s--;)t[s]=arguments[s];if(!e)return e=!0,r.apply(this,t)}}var en=function(e,t){this.router=e,this.base=$N(t),this.current=Bi,this.pending=null,this.ready=!1,this.readyCbs=[],this.readyErrorCbs=[],this.errorCbs=[],this.listeners=[]};en.prototype.listen=function(e){this.cb=e};en.prototype.onReady=function(e,t){this.ready?e():(this.readyCbs.push(e),t&&this.readyErrorCbs.push(t))};en.prototype.onError=function(e){this.errorCbs.push(e)};en.prototype.transitionTo=function(e,t,s){var n=this,i;try{i=this.router.match(e,this.current)}catch(o){throw this.errorCbs.forEach(function(l){l(o)}),o}var a=this.current;this.confirmTransition(i,function(){n.updateRoute(i),t&&t(i),n.ensureURL(),n.router.afterHooks.forEach(function(o){o&&o(i,a)}),n.ready||(n.ready=!0,n.readyCbs.forEach(function(o){o(i)}))},function(o){s&&s(o),o&&!n.ready&&(!ym(o,Ka.redirected)||a!==Bi)&&(n.ready=!0,n.readyErrorCbs.forEach(function(l){l(o)}))})};en.prototype.confirmTransition=function(e,t,s){var n=this,i=this.current;this.pending=e;var a=function(g){!ym(g)&&Mh(g)&&(n.errorCbs.length?n.errorCbs.forEach(function(v){v(g)}):console.error(g)),s&&s(g)},o=e.matched.length-1,l=i.matched.length-1;if(t4(e,i)&&o===l&&e.matched[o]===i.matched[l])return this.ensureURL(),e.hash&&$i(this.router,i,e,!1),a(fN(i,e));var c=SN(this.current.matched,e.matched),u=c.updated,d=c.deactivated,p=c.activated,h=[].concat(xN(d),this.router.beforeHooks,CN(u),p.map(function(g){return g.beforeEnter}),_N(p)),m=function(g,v){if(n.pending!==e)return a(US(i,e));try{g(e,i,function(y){y===!1?(n.ensureURL(!0),a(mN(i,e))):Mh(y)?(n.ensureURL(!0),a(y)):typeof y=="string"||typeof y=="object"&&(typeof y.path=="string"||typeof y.name=="string")?(a(hN(i,e)),typeof y=="object"&&y.replace?n.replace(y):n.push(y)):v(y)})}catch(y){a(y)}};WS(h,m,function(){var g=PN(p),v=g.concat(n.router.resolveHooks);WS(v,m,function(){if(n.pending!==e)return a(US(i,e));n.pending=null,t(e),n.router.app&&n.router.app.$nextTick(function(){r4(e)})})})};en.prototype.updateRoute=function(e){this.current=e,this.cb&&this.cb(e)};en.prototype.setupListeners=function(){};en.prototype.teardown=function(){this.listeners.forEach(function(e){e()}),this.listeners=[],this.current=Bi,this.pending=null};function $N(r){if(!r)if(dd){var e=document.querySelector("base");r=e&&e.getAttribute("href")||"/",r=r.replace(/^https?:\/\/[^\/]+/,"")}else r="/";return r.charAt(0)!=="/"&&(r="/"+r),r.replace(/\/$/,"")}function SN(r,e){var t,s=Math.max(r.length,e.length);for(t=0;t0)){var n=this.router,i=n.options.scrollBehavior,a=Si&&i;a&&this.listeners.push(p4());var o=function(){var l=s.current,c=Pc(s.base);s.current===Bi&&c===s._startLocation||s.transitionTo(c,function(u){a&&$i(n,u,l,!0)})};window.addEventListener("popstate",o),this.listeners.push(function(){window.removeEventListener("popstate",o)})}},e.prototype.go=function(s){window.history.go(s)},e.prototype.push=function(s,n,i){var a=this,o=this,l=o.current;this.transitionTo(s,function(c){Dh(bi(a.base+c.fullPath)),$i(a.router,c,l,!1),n&&n(c)},i)},e.prototype.replace=function(s,n,i){var a=this,o=this,l=o.current;this.transitionTo(s,function(c){Mv(bi(a.base+c.fullPath)),$i(a.router,c,l,!1),n&&n(c)},i)},e.prototype.ensureURL=function(s){if(Pc(this.base)!==this.current.fullPath){var n=bi(this.base+this.current.fullPath);s?Dh(n):Mv(n)}},e.prototype.getCurrentLocation=function(){return Pc(this.base)},e}(en);function Pc(r){var e=window.location.pathname,t=e.toLowerCase(),s=r.toLowerCase();return r&&(t===s||t.indexOf(bi(s+"/"))===0)&&(e=e.slice(r.length)),(e||"/")+window.location.search+window.location.hash}var _4=function(r){function e(t,s,n){r.call(this,t,s),!(n&&AN(this.base))&&qS()}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.setupListeners=function(){var s=this;if(!(this.listeners.length>0)){var n=this.router,i=n.options.scrollBehavior,a=Si&&i;a&&this.listeners.push(p4());var o=function(){var c=s.current;qS()&&s.transitionTo(Up(),function(u){a&&$i(s.router,u,c,!0),Si||Wp(u.fullPath)})},l=Si?"popstate":"hashchange";window.addEventListener(l,o),this.listeners.push(function(){window.removeEventListener(l,o)})}},e.prototype.push=function(s,n,i){var a=this,o=this,l=o.current;this.transitionTo(s,function(c){ZS(c.fullPath),$i(a.router,c,l,!1),n&&n(c)},i)},e.prototype.replace=function(s,n,i){var a=this,o=this,l=o.current;this.transitionTo(s,function(c){Wp(c.fullPath),$i(a.router,c,l,!1),n&&n(c)},i)},e.prototype.go=function(s){window.history.go(s)},e.prototype.ensureURL=function(s){var n=this.current.fullPath;Up()!==n&&(s?ZS(n):Wp(n))},e.prototype.getCurrentLocation=function(){return Up()},e}(en);function AN(r){var e=Pc(r);if(!/^\/#/.test(e))return window.location.replace(bi(r+"/#"+e)),!0}function qS(){var r=Up();return r.charAt(0)==="/"?!0:(Wp("/"+r),!1)}function Up(){var r=window.location.href,e=r.indexOf("#");return e<0?"":(r=r.slice(e+1),r)}function Rv(r){var e=window.location.href,t=e.indexOf("#"),s=t>=0?e.slice(0,t):e;return s+"#"+r}function ZS(r){Si?Dh(Rv(r)):window.location.hash=r}function Wp(r){Si?Mv(Rv(r)):window.location.replace(Rv(r))}var EN=function(r){function e(t,s){r.call(this,t,s),this.stack=[],this.index=-1}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.push=function(s,n,i){var a=this;this.transitionTo(s,function(o){a.stack=a.stack.slice(0,a.index+1).concat(o),a.index++,n&&n(o)},i)},e.prototype.replace=function(s,n,i){var a=this;this.transitionTo(s,function(o){a.stack=a.stack.slice(0,a.index).concat(o),n&&n(o)},i)},e.prototype.go=function(s){var n=this,i=this.index+s;if(!(i<0||i>=this.stack.length)){var a=this.stack[i];this.confirmTransition(a,function(){var o=n.current;n.index=i,n.updateRoute(a),n.router.afterHooks.forEach(function(l){l&&l(a,o)})},function(o){ym(o,Ka.duplicated)&&(n.index=i)})}},e.prototype.getCurrentLocation=function(){var s=this.stack[this.stack.length-1];return s?s.fullPath:"/"},e.prototype.ensureURL=function(){},e}(en),yt=function(e){e===void 0&&(e={}),this.app=null,this.apps=[],this.options=e,this.beforeHooks=[],this.resolveHooks=[],this.afterHooks=[],this.matcher=iN(e.routes||[],this);var t=e.mode||"hash";switch(this.fallback=t==="history"&&!Si&&e.fallback!==!1,this.fallback&&(t="hash"),dd||(t="abstract"),this.mode=t,t){case"history":this.history=new v4(this,e.base);break;case"hash":this.history=new _4(this,e.base,this.fallback);break;case"abstract":this.history=new EN(this,e.base);break}},y4={currentRoute:{configurable:!0}};yt.prototype.match=function(e,t,s){return this.matcher.match(e,t,s)};y4.currentRoute.get=function(){return this.history&&this.history.current};yt.prototype.init=function(e){var t=this;if(this.apps.push(e),e.$once("hook:destroyed",function(){var a=t.apps.indexOf(e);a>-1&&t.apps.splice(a,1),t.app===e&&(t.app=t.apps[0]||null),t.app||t.history.teardown()}),!this.app){this.app=e;var s=this.history;if(s instanceof v4||s instanceof _4){var n=function(a){var o=s.current,l=t.options.scrollBehavior,c=Si&&l;c&&"fullPath"in a&&$i(t,a,o,!1)},i=function(a){s.setupListeners(),n(a)};s.transitionTo(s.getCurrentLocation(),i,i)}s.listen(function(a){t.apps.forEach(function(o){o._route=a})})}};yt.prototype.beforeEach=function(e){return Qy(this.beforeHooks,e)};yt.prototype.beforeResolve=function(e){return Qy(this.resolveHooks,e)};yt.prototype.afterEach=function(e){return Qy(this.afterHooks,e)};yt.prototype.onReady=function(e,t){this.history.onReady(e,t)};yt.prototype.onError=function(e){this.history.onError(e)};yt.prototype.push=function(e,t,s){var n=this;if(!t&&!s&&typeof Promise<"u")return new Promise(function(i,a){n.history.push(e,i,a)});this.history.push(e,t,s)};yt.prototype.replace=function(e,t,s){var n=this;if(!t&&!s&&typeof Promise<"u")return new Promise(function(i,a){n.history.replace(e,i,a)});this.history.replace(e,t,s)};yt.prototype.go=function(e){this.history.go(e)};yt.prototype.back=function(){this.go(-1)};yt.prototype.forward=function(){this.go(1)};yt.prototype.getMatchedComponents=function(e){var t=e?e.matched?e:this.resolve(e).route:this.currentRoute;return t?[].concat.apply([],t.matched.map(function(s){return Object.keys(s.components).map(function(n){return s.components[n]})})):[]};yt.prototype.resolve=function(e,t,s){t=t||this.history.current;var n=Ky(e,t,s,this),i=this.match(n,t),a=i.redirectedFrom||i.fullPath,o=this.history.base,l=ON(o,a,this.mode);return{location:n,route:i,href:l,normalizedTo:n,resolved:i}};yt.prototype.getRoutes=function(){return this.matcher.getRoutes()};yt.prototype.addRoute=function(e,t){this.matcher.addRoute(e,t),this.history.current!==Bi&&this.history.transitionTo(this.history.getCurrentLocation())};yt.prototype.addRoutes=function(e){this.matcher.addRoutes(e),this.history.current!==Bi&&this.history.transitionTo(this.history.getCurrentLocation())};Object.defineProperties(yt.prototype,y4);var b4=yt;function Qy(r,e){return r.push(e),function(){var t=r.indexOf(e);t>-1&&r.splice(t,1)}}function ON(r,e,t){var s=t==="hash"?"#"+e:e;return r?bi(r+"/"+s):s}yt.install=kv;yt.version="3.6.5";yt.isNavigationFailure=ym;yt.NavigationFailureType=Ka;yt.START_LOCATION=Bi;dd&&window.Vue&&window.Vue.use(yt);var TN=typeof Reflect<"u"&&typeof Reflect.getMetadata<"u";function $4(r,e,t){if(TN&&!Array.isArray(r)&&typeof r!="function"&&!r.hasOwnProperty("type")&&typeof r.type>"u"){var s=Reflect.getMetadata("design:type",e,t);s!==Object&&(r.type=s)}}function $(r){return r===void 0&&(r={}),function(e,t){$4(r,e,t),sd(function(s,n){(s.props||(s.props={}))[n]=r})(e,t)}}function ji(r,e){return e===void 0&&(e={}),function(t,s){$4(e,t,s),sd(function(n,i){(n.props||(n.props={}))[r]=e,(n.computed||(n.computed={}))[i]={get:function(){return this[r]},set:function(a){this.$emit("update:"+r,a)}}})(t,s)}}function ke(r){return sd(function(e,t){e.computed=e.computed||{},e.computed[t]={cache:!1,get:function(){return this.$refs[r||t]}}})}function He(r){r===void 0&&(r={});var e="value";return sd(function(t,s){(t.props||(t.props={}))[e]=r,(t.computed||(t.computed={}))[s]={get:function(){return this[e]},set:function(n){this.$emit("input",n)}}})}function Ae(r,e){e===void 0&&(e={});var t=e.deep,s=t===void 0?!1:t,n=e.immediate,i=n===void 0?!1:n;return sd(function(a,o){typeof a.watch!="object"&&(a.watch=Object.create(null));var l=a.watch;typeof l[r]=="object"&&!Array.isArray(l[r])?l[r]=[l[r]]:typeof l[r]>"u"&&(l[r]=[]),l[r].push({handler:o,deep:s,immediate:i})})}/**! + * Sortable 1.15.2 + * @author RubaXa + * @author owenm + * @license MIT + */function YS(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(r);e&&(s=s.filter(function(n){return Object.getOwnPropertyDescriptor(r,n).enumerable})),t.push.apply(t,s)}return t}function $n(r){for(var e=1;e=0)&&(t[n]=r[n]);return t}function MN(r,e){if(r==null)return{};var t=DN(r,e),s,n;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(r,s)&&(t[s]=r[s])}return t}var RN="1.15.2";function Rn(r){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(r)}var Xn=Rn(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),pd=Rn(/Edge/i),KS=Rn(/firefox/i),Bc=Rn(/safari/i)&&!Rn(/chrome/i)&&!Rn(/android/i),S4=Rn(/iP(ad|od|hone)/i),w4=Rn(/chrome/i)&&Rn(/android/i),x4={capture:!1,passive:!1};function nt(r,e,t){r.addEventListener(e,t,!Xn&&x4)}function Je(r,e,t){r.removeEventListener(e,t,!Xn&&x4)}function Rh(r,e){if(e){if(e[0]===">"&&(e=e.substring(1)),r)try{if(r.matches)return r.matches(e);if(r.msMatchesSelector)return r.msMatchesSelector(e);if(r.webkitMatchesSelector)return r.webkitMatchesSelector(e)}catch{return!1}return!1}}function IN(r){return r.host&&r!==document&&r.host.nodeType?r.host:r.parentNode}function Hs(r,e,t,s){if(r){t=t||document;do{if(e!=null&&(e[0]===">"?r.parentNode===t&&Rh(r,e):Rh(r,e))||s&&r===t)return r;if(r===t)break}while(r=IN(r))}return null}var XS=/\s+/g;function Kr(r,e,t){if(r&&e)if(r.classList)r.classList[t?"add":"remove"](e);else{var s=(" "+r.className+" ").replace(XS," ").replace(" "+e+" "," ");r.className=(s+(t?" "+e:"")).replace(XS," ")}}function De(r,e,t){var s=r&&r.style;if(s){if(t===void 0)return document.defaultView&&document.defaultView.getComputedStyle?t=document.defaultView.getComputedStyle(r,""):r.currentStyle&&(t=r.currentStyle),e===void 0?t:t[e];!(e in s)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),s[e]=t+(typeof t=="string"?"":"px")}}function jo(r,e){var t="";if(typeof r=="string")t=r;else do{var s=De(r,"transform");s&&s!=="none"&&(t=s+" "+t)}while(!e&&(r=r.parentNode));var n=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return n&&new n(t)}function C4(r,e,t){if(r){var s=r.getElementsByTagName(e),n=0,i=s.length;if(t)for(;n=i,!a)return s;if(s===gn())break;s=vi(s,!1)}return!1}function qo(r,e,t,s){for(var n=0,i=0,a=r.children;i2&&arguments[2]!==void 0?arguments[2]:{},n=s.evt,i=MN(s,UN);hd.pluginEvent.bind(Me)(e,t,$n({dragEl:ce,parentEl:Ot,ghostEl:je,rootEl:bt,nextEl:sa,lastDownEl:qp,cloneEl:xt,cloneHidden:hi,dragStarted:Lc,putSortable:sr,activeSortable:Me.active,originalEvent:n,oldIndex:Mo,oldDraggableIndex:Vc,newIndex:Jr,newDraggableIndex:di,hideGhostForTarget:D4,unhideGhostForTarget:M4,cloneNowHidden:function(){hi=!0},cloneNowShown:function(){hi=!1},dispatchSortableEvent:function(o){$r({sortable:t,name:o,originalEvent:n})}},i))};function $r(r){zN($n({putSortable:sr,cloneEl:xt,targetEl:ce,rootEl:bt,oldIndex:Mo,oldDraggableIndex:Vc,newIndex:Jr,newDraggableIndex:di},r))}var ce,Ot,je,bt,sa,qp,xt,hi,Mo,Jr,Vc,di,cp,sr,Eo=!1,Ih=!1,Fh=[],Ji,Ds,eg,tg,ew,tw,Lc,So,Nc,zc=!1,up=!1,Zp,hr,rg=[],Iv=!1,Hh=[],bm=typeof document<"u",dp=S4,rw=pd||Xn?"cssFloat":"float",WN=bm&&!w4&&!S4&&"draggable"in document.createElement("div"),O4=function(){if(bm){if(Xn)return!1;var r=document.createElement("x");return r.style.cssText="pointer-events:auto",r.style.pointerEvents==="auto"}}(),T4=function(e,t){var s=De(e),n=parseInt(s.width)-parseInt(s.paddingLeft)-parseInt(s.paddingRight)-parseInt(s.borderLeftWidth)-parseInt(s.borderRightWidth),i=qo(e,0,t),a=qo(e,1,t),o=i&&De(i),l=a&&De(a),c=o&&parseInt(o.marginLeft)+parseInt(o.marginRight)+Nt(i).width,u=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+Nt(a).width;if(s.display==="flex")return s.flexDirection==="column"||s.flexDirection==="column-reverse"?"vertical":"horizontal";if(s.display==="grid")return s.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&o.float&&o.float!=="none"){var d=o.float==="left"?"left":"right";return a&&(l.clear==="both"||l.clear===d)?"vertical":"horizontal"}return i&&(o.display==="block"||o.display==="flex"||o.display==="table"||o.display==="grid"||c>=n&&s[rw]==="none"||a&&s[rw]==="none"&&c+u>n)?"vertical":"horizontal"},GN=function(e,t,s){var n=s?e.left:e.top,i=s?e.right:e.bottom,a=s?e.width:e.height,o=s?t.left:t.top,l=s?t.right:t.bottom,c=s?t.width:t.height;return n===o||i===l||n+a/2===o+c/2},qN=function(e,t){var s;return Fh.some(function(n){var i=n[rs].options.emptyInsertThreshold;if(!(!i||Jy(n))){var a=Nt(n),o=e>=a.left-i&&e<=a.right+i,l=t>=a.top-i&&t<=a.bottom+i;if(o&&l)return s=n}}),s},k4=function(e){function t(i,a){return function(o,l,c,u){var d=o.options.group.name&&l.options.group.name&&o.options.group.name===l.options.group.name;if(i==null&&(a||d))return!0;if(i==null||i===!1)return!1;if(a&&i==="clone")return i;if(typeof i=="function")return t(i(o,l,c,u),a)(o,l,c,u);var p=(a?o:l).options.group.name;return i===!0||typeof i=="string"&&i===p||i.join&&i.indexOf(p)>-1}}var s={},n=e.group;(!n||Gp(n)!="object")&&(n={name:n}),s.name=n.name,s.checkPull=t(n.pull,!0),s.checkPut=t(n.put),s.revertClone=n.revertClone,e.group=s},D4=function(){!O4&&je&&De(je,"display","none")},M4=function(){!O4&&je&&De(je,"display","")};bm&&!w4&&document.addEventListener("click",function(r){if(Ih)return r.preventDefault(),r.stopPropagation&&r.stopPropagation(),r.stopImmediatePropagation&&r.stopImmediatePropagation(),Ih=!1,!1},!0);var ea=function(e){if(ce){e=e.touches?e.touches[0]:e;var t=qN(e.clientX,e.clientY);if(t){var s={};for(var n in e)e.hasOwnProperty(n)&&(s[n]=e[n]);s.target=s.rootEl=t,s.preventDefault=void 0,s.stopPropagation=void 0,t[rs]._onDragOver(s)}}},ZN=function(e){ce&&ce.parentNode[rs]._isOutsideThisEl(e.target)};function Me(r,e){if(!(r&&r.nodeType&&r.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(r));this.el=r,this.options=e=jn({},e),r[rs]=this;var t={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(r.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return T4(r,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(a,o){a.setData("Text",o.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:Me.supportPointer!==!1&&"PointerEvent"in window&&!Bc,emptyInsertThreshold:5};hd.initializePlugins(this,r,t);for(var s in t)!(s in e)&&(e[s]=t[s]);k4(e);for(var n in this)n.charAt(0)==="_"&&typeof this[n]=="function"&&(this[n]=this[n].bind(this));this.nativeDraggable=e.forceFallback?!1:WN,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?nt(r,"pointerdown",this._onTapStart):(nt(r,"mousedown",this._onTapStart),nt(r,"touchstart",this._onTapStart)),this.nativeDraggable&&(nt(r,"dragover",this),nt(r,"dragenter",this)),Fh.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),jn(this,jN())}Me.prototype={constructor:Me,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(So=null)},_getDirection:function(e,t){return typeof this.options.direction=="function"?this.options.direction.call(this,e,t,ce):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,s=this.el,n=this.options,i=n.preventOnFilter,a=e.type,o=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,l=(o||e).target,c=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||l,u=n.filter;if(rz(s),!ce&&!(/mousedown|pointerdown/.test(a)&&e.button!==0||n.disabled)&&!c.isContentEditable&&!(!this.nativeDraggable&&Bc&&l&&l.tagName.toUpperCase()==="SELECT")&&(l=Hs(l,n.draggable,s,!1),!(l&&l.animated)&&qp!==l)){if(Mo=_s(l),Vc=_s(l,n.draggable),typeof u=="function"){if(u.call(this,e,l,this)){$r({sortable:t,rootEl:c,name:"filter",targetEl:l,toEl:s,fromEl:s}),Tr("filter",t,{evt:e}),i&&e.cancelable&&e.preventDefault();return}}else if(u&&(u=u.split(",").some(function(d){if(d=Hs(c,d.trim(),s,!1),d)return $r({sortable:t,rootEl:d,name:"filter",targetEl:l,fromEl:s,toEl:s}),Tr("filter",t,{evt:e}),!0}),u)){i&&e.cancelable&&e.preventDefault();return}n.handle&&!Hs(c,n.handle,s,!1)||this._prepareDragStart(e,o,l)}}},_prepareDragStart:function(e,t,s){var n=this,i=n.el,a=n.options,o=i.ownerDocument,l;if(s&&!ce&&s.parentNode===i){var c=Nt(s);if(bt=i,ce=s,Ot=ce.parentNode,sa=ce.nextSibling,qp=s,cp=a.group,Me.dragged=ce,Ji={target:ce,clientX:(t||e).clientX,clientY:(t||e).clientY},ew=Ji.clientX-c.left,tw=Ji.clientY-c.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,ce.style["will-change"]="all",l=function(){if(Tr("delayEnded",n,{evt:e}),Me.eventCanceled){n._onDrop();return}n._disableDelayedDragEvents(),!KS&&n.nativeDraggable&&(ce.draggable=!0),n._triggerDragStart(e,t),$r({sortable:n,name:"choose",originalEvent:e}),Kr(ce,a.chosenClass,!0)},a.ignore.split(",").forEach(function(u){C4(ce,u.trim(),sg)}),nt(o,"dragover",ea),nt(o,"mousemove",ea),nt(o,"touchmove",ea),nt(o,"mouseup",n._onDrop),nt(o,"touchend",n._onDrop),nt(o,"touchcancel",n._onDrop),KS&&this.nativeDraggable&&(this.options.touchStartThreshold=4,ce.draggable=!0),Tr("delayStart",this,{evt:e}),a.delay&&(!a.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(pd||Xn))){if(Me.eventCanceled){this._onDrop();return}nt(o,"mouseup",n._disableDelayedDrag),nt(o,"touchend",n._disableDelayedDrag),nt(o,"touchcancel",n._disableDelayedDrag),nt(o,"mousemove",n._delayedDragTouchMoveHandler),nt(o,"touchmove",n._delayedDragTouchMoveHandler),a.supportPointer&&nt(o,"pointermove",n._delayedDragTouchMoveHandler),n._dragStartTimer=setTimeout(l,a.delay)}else l()}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){ce&&sg(ce),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;Je(e,"mouseup",this._disableDelayedDrag),Je(e,"touchend",this._disableDelayedDrag),Je(e,"touchcancel",this._disableDelayedDrag),Je(e,"mousemove",this._delayedDragTouchMoveHandler),Je(e,"touchmove",this._delayedDragTouchMoveHandler),Je(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||e.pointerType=="touch"&&e,!this.nativeDraggable||t?this.options.supportPointer?nt(document,"pointermove",this._onTouchMove):t?nt(document,"touchmove",this._onTouchMove):nt(document,"mousemove",this._onTouchMove):(nt(ce,"dragend",this),nt(bt,"dragstart",this._onDragStart));try{document.selection?Yp(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,t){if(Eo=!1,bt&&ce){Tr("dragStarted",this,{evt:t}),this.nativeDraggable&&nt(document,"dragover",ZN);var s=this.options;!e&&Kr(ce,s.dragClass,!1),Kr(ce,s.ghostClass,!0),Me.active=this,e&&this._appendGhost(),$r({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(Ds){this._lastX=Ds.clientX,this._lastY=Ds.clientY,D4();for(var e=document.elementFromPoint(Ds.clientX,Ds.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(Ds.clientX,Ds.clientY),e!==t);)t=e;if(ce.parentNode[rs]._isOutsideThisEl(e),t)do{if(t[rs]){var s=void 0;if(s=t[rs]._onDragOver({clientX:Ds.clientX,clientY:Ds.clientY,target:e,rootEl:t}),s&&!this.options.dragoverBubble)break}e=t}while(t=t.parentNode);M4()}},_onTouchMove:function(e){if(Ji){var t=this.options,s=t.fallbackTolerance,n=t.fallbackOffset,i=e.touches?e.touches[0]:e,a=je&&jo(je,!0),o=je&&a&&a.a,l=je&&a&&a.d,c=dp&&hr&&JS(hr),u=(i.clientX-Ji.clientX+n.x)/(o||1)+(c?c[0]-rg[0]:0)/(o||1),d=(i.clientY-Ji.clientY+n.y)/(l||1)+(c?c[1]-rg[1]:0)/(l||1);if(!Me.active&&!Eo){if(s&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))=0&&($r({rootEl:Ot,name:"add",toEl:Ot,fromEl:bt,originalEvent:e}),$r({sortable:this,name:"remove",toEl:Ot,originalEvent:e}),$r({rootEl:Ot,name:"sort",toEl:Ot,fromEl:bt,originalEvent:e}),$r({sortable:this,name:"sort",toEl:Ot,originalEvent:e})),sr&&sr.save()):Jr!==Mo&&Jr>=0&&($r({sortable:this,name:"update",toEl:Ot,originalEvent:e}),$r({sortable:this,name:"sort",toEl:Ot,originalEvent:e})),Me.active&&((Jr==null||Jr===-1)&&(Jr=Mo,di=Vc),$r({sortable:this,name:"end",toEl:Ot,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){Tr("nulling",this),bt=ce=Ot=je=sa=xt=qp=hi=Ji=Ds=Lc=Jr=di=Mo=Vc=So=Nc=sr=cp=Me.dragged=Me.ghost=Me.clone=Me.active=null,Hh.forEach(function(e){e.checked=!0}),Hh.length=eg=tg=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":ce&&(this._onDragOver(e),YN(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],t,s=this.el.children,n=0,i=s.length,a=this.options;nn.right+i||r.clientY>s.bottom&&r.clientX>s.left:r.clientY>n.bottom+i||r.clientX>s.right&&r.clientY>s.top}function JN(r,e,t,s,n,i,a,o){var l=s?r.clientY:r.clientX,c=s?t.height:t.width,u=s?t.top:t.left,d=s?t.bottom:t.right,p=!1;if(!a){if(o&&Zpu+c*i/2:ld-Zp)return-Nc}else if(l>u+c*(1-n)/2&&ld-c*i/2)?l>u+c/2?1:-1:0}function ez(r){return _s(ce)<_s(r)?1:-1}function tz(r){for(var e=r.tagName+r.className+r.src+r.href+r.textContent,t=e.length,s=0;t--;)s+=e.charCodeAt(t);return s.toString(36)}function rz(r){Hh.length=0;for(var e=r.getElementsByTagName("input"),t=e.length;t--;){var s=e[t];s.checked&&Hh.push(s)}}function Yp(r){return setTimeout(r,0)}function Fv(r){return clearTimeout(r)}bm&&nt(document,"touchmove",function(r){(Me.active||Eo)&&r.cancelable&&r.preventDefault()});Me.utils={on:nt,off:Je,css:De,find:C4,is:function(e,t){return!!Hs(e,t,e,!1)},extend:HN,throttle:P4,closest:Hs,toggleClass:Kr,clone:A4,index:_s,nextTick:Yp,cancelNextTick:Fv,detectDirection:T4,getChild:qo};Me.get=function(r){return r[rs]};Me.mount=function(){for(var r=arguments.length,e=new Array(r),t=0;t{for(var n=s>1?void 0:s?iz(e,t):e,i=r.length-1,a;i>=0;i--)(a=r[i])&&(n=(s?a(e,t,n):a(n))||n);return s&&n&&nz(e,t,n),n};const Oc=Symbol("instanceKey"),nw=r=>Oc in r;let Ai=class extends b{constructor(){super(...arguments);f(this,"items");f(this,"options");f(this,"target");f(this,"sortable",null)}onOptions(e){if(this.sortable)for(const t in e){const s=t;this.sortable.option(s,e[s])}}onTarget(){this.dettach(),this.attach()}handleStart(e){this.$emit("start",e)}handleAdd(e){const{oldIndex:t,newIndex:s,from:n}=e;if(t===void 0||s===void 0||!nw(n)||n[Oc]===null)return;const i=n[Oc],a=[...this.items];a.splice(s,0,i.items[t]),this.items=a,this.$emit("add",e)}handleRemove(e){const{oldIndex:t}=e;if(t===void 0)return;const s=[...this.items];s.splice(t,1),this.items=s,this.$emit("remove",e)}handleUpdate(e){const{oldIndex:t,newIndex:s}=e;if(t===void 0||s===void 0)return;const n=[...this.items],i=n.splice(t,1)[0];n.splice(s,0,i),this.items=n,this.$emit("update",e)}handleEnd(e){this.$emit("end",e)}attach(){const e=this.target&&this.$el.querySelector(this.target)||this.$el;e[Oc]=this;const t={...this.options,onStart:this.handleStart,onAdd:this.handleAdd,onRemove:this.handleRemove,onUpdate:this.handleUpdate,onEnd:this.handleEnd};this.sortable=Me.create(e,t)}dettach(){var t,s;const e=(t=this.sortable)==null?void 0:t.el;e&&nw(e)&&(e[Oc]=null),(s=this.sortable)==null||s.destroy(),this.sortable=null}mounted(){this.attach()}unmounted(){this.dettach()}};Cl([He({type:Array,default:()=>[]})],Ai.prototype,"items",2);Cl([$({type:Object})],Ai.prototype,"options",2);Cl([$({type:String})],Ai.prototype,"target",2);Cl([Ae("options")],Ai.prototype,"onOptions",1);Cl([Ae("target")],Ai.prototype,"onTarget",1);Ai=Cl([L({})],Ai);function A(r,e,t,s,n,i,a,o){var l=typeof r=="function"?r.options:r;return e&&(l.render=e,l.staticRenderFns=t,l._compiled=!0),i&&(l._scopeId="data-v-"+i),{exports:r,options:l}}var az=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",[e._t("default")],2)},oz=[],lz=A(Ai,az,oz,!1,null,null);const $m=lz.exports,Ke=b.extend().extend({name:"themeable",provide(){return{theme:this.themeableProvide}},inject:{theme:{default:{isDark:!1}}},props:{dark:{type:Boolean,default:null},light:{type:Boolean,default:null}},data(){return{themeableProvide:{isDark:!1}}},computed:{appIsDark(){return this.$vuetify.theme.dark||!1},isDark(){return this.dark===!0?!0:this.light===!0?!1:this.theme.isDark},themeClasses(){return{"theme--dark":this.isDark,"theme--light":!this.isDark}},rootIsDark(){return this.dark===!0?!0:this.light===!0?!1:this.appIsDark},rootThemeClasses(){return{"theme--dark":this.rootIsDark,"theme--light":!this.rootIsDark}}},watch:{isDark:{handler(r,e){r!==e&&(this.themeableProvide.isDark=this.isDark)},immediate:!0}}});function I4(r){const e={...r.props,...r.injections},t=Ke.options.computed.isDark.call(e);return Ke.options.computed.themeClasses.call({isDark:t})}function be(...r){return b.extend({mixins:r})}function qr(r,e="div",t){return b.extend({name:t||r.replace(/__/g,"-"),functional:!0,props:{tag:{type:String,default:e}},render(s,{data:n,props:i,children:a}){return n.staticClass=`${r} ${n.staticClass||""}`.trim(),s(i.tag,n,a)}})}function F4(r,e,t,s=!1){const n=i=>{t(i),r.removeEventListener(e,n,s)};r.addEventListener(e,n,s)}let Uc=!1;try{if(typeof window<"u"){const r=Object.defineProperty({},"passive",{get:()=>{Uc=!0}});window.addEventListener("testListener",r,r),window.removeEventListener("testListener",r,r)}}catch(r){console.warn(r)}function cz(r,e,t,s){r.addEventListener(e,t,Uc?s:!1)}function rb(r,e,t){const s=e.length-1;if(s<0)return r===void 0?t:r;for(let n=0;nGt(r[s],e[s]))}function at(r,e,t){return r==null||!e||typeof e!="string"?t:r[e]!==void 0?r[e]:(e=e.replace(/\[(\w+)\]/g,".$1"),e=e.replace(/^\./,""),rb(r,e.split("."),t))}function In(r,e,t){if(e==null)return r===void 0?t:r;if(r!==Object(r))return t===void 0?r:t;if(typeof e=="string")return at(r,e,t);if(Array.isArray(e))return rb(r,e,t);if(typeof e!="function")return t;const s=e(r,t);return typeof s>"u"?t:s}function uz(r){return Array.from({length:r},(e,t)=>t)}function Wc(r){if(!r||r.nodeType!==Node.ELEMENT_NODE)return 0;const e=+window.getComputedStyle(r).getPropertyValue("z-index");return e||Wc(r.parentNode)}function dz(r,e){const t={};for(let s=0;sr.replace(hz,(e,t)=>t?t.toUpperCase():"");function wm(r){return r.charAt(0).toUpperCase()+r.slice(1)}function fz(r,e,t){const s=e[0],n=[];let i;for(let a=0;a{for(let l=0;l(p||"").toString().toLocaleLowerCase()),u!==d)return!isNaN(u)&&!isNaN(d)?Number(u)-Number(d):i.compare(u,d)}}return 0})}function jh(r,e,t){return r!=null&&e!=null&&typeof r!="boolean"&&r.toString().toLocaleLowerCase().indexOf(e.toLocaleLowerCase())!==-1}function gz(r,e){return!e||(e=e.toString().toLowerCase(),e.trim()==="")?r:r.filter(t=>Object.keys(t).some(s=>jh(at(t,s),e)))}function B4(r,e,t){if(r.$slots.hasOwnProperty(e)&&r.$scopedSlots.hasOwnProperty(e)&&r.$scopedSlots[e].name)return"v-slot";if(r.$slots.hasOwnProperty(e))return"normal";if(r.$scopedSlots.hasOwnProperty(e))return"scoped"}function Xp(r,e){return Object.keys(e).filter(t=>t.startsWith(r)).reduce((t,s)=>(t[s.replace(r,"")]=e[s],t),{})}function me(r,e="default",t,s=!1){const n=jv(e);if(r.$scopedSlots.hasOwnProperty(e))return r.$scopedSlots[e](t instanceof Function?t():t);if(r.$scopedSlots.hasOwnProperty(n))return r.$scopedSlots[n](t instanceof Function?t():t);if(r.$slots.hasOwnProperty(e)&&(!t||s))return r.$slots[e];if(r.$slots.hasOwnProperty(n)&&(!t||s))return r.$slots[n]}function vz(r,e=0,t=1){return Math.max(e,Math.min(t,r))}function j4(r){return r?Object.keys(r).reduce((e,t)=>(e[H4(t)]=r[t],e),{}):{}}function Gc(r={},e={}){for(const t in e){const s=r[t],n=e[t];if(iw(s)&&iw(n)){r[t]=Gc(s,n);continue}r[t]=n}return r}function aw(r,e){return Array(r).fill(e)}function V4(r){if(r.composedPath)return r.composedPath();const e=[];let t=r.target;for(;t;){if(e.push(t),t.tagName==="HTML")return e.push(document),e.push(window),e;t=t.parentElement}return e}const ow=be(Ke).extend({name:"v-app",props:{dark:{type:Boolean,default:void 0},id:{type:String,default:"app"},light:{type:Boolean,default:void 0}},computed:{isDark(){return this.$vuetify.theme.dark}},beforeCreate(){if(!this.$vuetify||this.$vuetify===this.$root)throw new Error("Vuetify is not properly initialized, see https://v2.vuetifyjs.com/getting-started/quick-start#bootstrapping-the-vuetify-object")},render(r){const e=r("div",{staticClass:"v-application--wrap"},me(this));return r("div",{staticClass:"v-application",class:{"v-application--is-rtl":this.$vuetify.rtl,"v-application--is-ltr":!this.$vuetify.rtl,...this.themeClasses},attrs:{"data-app":!0},domProps:{id:this.id}},[e])}});function lw(r){return function(e,t){for(const s in t)Object.prototype.hasOwnProperty.call(e,s)||this.$delete(this.$data[r],s);for(const s in e)this.$set(this.$data[r],s,e[s])}}const Pl=b.extend({data:()=>({attrs$:{},listeners$:{}}),created(){this.$watch("$attrs",lw("attrs$"),{immediate:!0}),this.$watch("$listeners",lw("listeners$"),{immediate:!0})}});function Vv(r,e={}){if(Vv.installed)return;Vv.installed=!0,b!==r&&Ns(`Multiple instances of Vue detected +See https://github.com/vuetifyjs/vuetify/issues/4068 + +If you're seeing "$attrs is readonly", it's caused by this`);const t=e.components||{},s=e.directives||{};for(const n in s){const i=s[n];r.directive(n,i)}(function n(i){if(i){for(const a in i){const o=i[a];o&&!n(o.$_vuetify_subcomponents)&&r.component(a,o)}return!0}return!1})(t),!r.$_vuetify_installed&&(r.$_vuetify_installed=!0,r.mixin({beforeCreate(){const n=this.$options;n.vuetify?(n.vuetify.init(this,this.$ssrContext),this.$vuetify=r.observable(n.vuetify.framework)):this.$vuetify=n.parent&&n.parent.$vuetify||this},beforeMount(){this.$options.vuetify&&this.$el&&this.$el.hasAttribute("data-server-rendered")&&(this.$vuetify.isHydrating=!0,this.$vuetify.breakpoint.update(!0))},mounted(){this.$options.vuetify&&this.$vuetify.isHydrating&&(this.$vuetify.isHydrating=!1,this.$vuetify.breakpoint.update())}}))}class Xa{constructor(){this.framework={}}init(e,t){}}class N4 extends Xa{constructor(){super(...arguments),this.bar=0,this.top=0,this.left=0,this.insetFooter=0,this.right=0,this.bottom=0,this.footer=0,this.application={bar:{},top:{},left:{},insetFooter:{},right:{},bottom:{},footer:{}}}register(e,t,s){this.application[t][e]=s,this.update(t)}unregister(e,t){this.application[t][e]!=null&&(delete this.application[t][e],this.update(t))}update(e){this[e]=Object.values(this.application[e]).reduce((t,s)=>t+s,0)}}N4.property="application";class xm extends Xa{constructor(e){super(),this.xs=!1,this.sm=!1,this.md=!1,this.lg=!1,this.xl=!1,this.xsOnly=!1,this.smOnly=!1,this.smAndDown=!1,this.smAndUp=!1,this.mdOnly=!1,this.mdAndDown=!1,this.mdAndUp=!1,this.lgOnly=!1,this.lgAndDown=!1,this.lgAndUp=!1,this.xlOnly=!1,this.name="xs",this.height=0,this.width=0,this.mobile=!0,this.resizeTimeout=0;const{mobileBreakpoint:t,scrollBarWidth:s,thresholds:n}=e[xm.property];this.mobileBreakpoint=t,this.scrollBarWidth=s,this.thresholds=n}init(){this.update(),!(typeof window>"u")&&window.addEventListener("resize",this.onResize.bind(this),{passive:!0})}update(e=!1){const t=e?0:this.getClientHeight(),s=e?0:this.getClientWidth(),n=s=this.thresholds.lg-this.scrollBarWidth;switch(this.height=t,this.width=s,this.xs=n,this.sm=i,this.md=a,this.lg=o,this.xl=l,this.xsOnly=n,this.smOnly=i,this.smAndDown=(n||i)&&!(a||o||l),this.smAndUp=!n&&(i||a||o||l),this.mdOnly=a,this.mdAndDown=(n||i||a)&&!(o||l),this.mdAndUp=!(n||i)&&(a||o||l),this.lgOnly=o,this.lgAndDown=(n||i||a||o)&&!l,this.lgAndUp=!(n||i||a)&&(o||l),this.xlOnly=l,!0){case n:this.name="xs";break;case i:this.name="sm";break;case a:this.name="md";break;case o:this.name="lg";break;default:this.name="xl";break}if(typeof this.mobileBreakpoint=="number"){this.mobile=s"u"?0:Math.max(document.documentElement.clientWidth,window.innerWidth||0)}getClientHeight(){return typeof document>"u"?0:Math.max(document.documentElement.clientHeight,window.innerHeight||0)}}xm.property="breakpoint";const _z=r=>r,yz=r=>r**2,bz=r=>r*(2-r),$z=r=>r<.5?2*r**2:-1+(4-2*r)*r,Sz=r=>r**3,wz=r=>--r**3+1,xz=r=>r<.5?4*r**3:(r-1)*(2*r-2)*(2*r-2)+1,Cz=r=>r**4,Pz=r=>1- --r**4,Lz=r=>r<.5?8*r*r*r*r:1-8*--r*r*r*r,Az=r=>r**5,Ez=r=>1+--r**5,Oz=r=>r<.5?16*r**5:1+16*--r**5,Tz=Object.freeze(Object.defineProperty({__proto__:null,easeInCubic:Sz,easeInOutCubic:xz,easeInOutQuad:$z,easeInOutQuart:Lz,easeInOutQuint:Oz,easeInQuad:yz,easeInQuart:Cz,easeInQuint:Az,easeOutCubic:wz,easeOutQuad:bz,easeOutQuart:Pz,easeOutQuint:Ez,linear:_z},Symbol.toStringTag,{value:"Module"}));function og(r){if(typeof r=="number")return r;let e=U4(r);if(!e)throw typeof r=="string"?new Error(`Target element "${r}" not found.`):new TypeError(`Target must be a Number/Selector/HTMLElement/VueComponent, received ${z4(r)} instead.`);let t=0;for(;e;)t+=e.offsetTop,e=e.offsetParent;return t}function kz(r){const e=U4(r);if(e)return e;throw typeof r=="string"?new Error(`Container element "${r}" not found.`):new TypeError(`Container must be a Selector/HTMLElement/VueComponent, received ${z4(r)} instead.`)}function z4(r){return r==null?r:r.constructor.name}function U4(r){return typeof r=="string"?document.querySelector(r):r&&r._isVue?r.$el:r instanceof HTMLElement?r:null}function La(r,e={}){const t={container:document.scrollingElement||document.body||document.documentElement,duration:500,offset:0,easing:"easeInOutCubic",appOffset:!0,...e},s=kz(t.container);if(t.appOffset&&La.framework.application){const l=s.classList.contains("v-navigation-drawer"),c=s.classList.contains("v-navigation-drawer--clipped"),{bar:u,top:d}=La.framework.application;t.offset+=u,(!l||c)&&(t.offset+=d)}const n=performance.now();let i;typeof r=="number"?i=og(r)-t.offset:i=og(r)-og(s)-t.offset;const a=s.scrollTop;if(i===a)return Promise.resolve(i);const o=typeof t.easing=="function"?t.easing:Tz[t.easing];if(!o)throw new TypeError(`Easing function "${t.easing}" not found.`);return new Promise(l=>requestAnimationFrame(function c(u){const d=u-n,p=Math.abs(t.duration?Math.min(d/t.duration,1):1);s.scrollTop=Math.floor(a+(i-a)*o(p));const m=(s===document.body?document.documentElement.clientHeight:s.clientHeight)+s.scrollTop>=s.scrollHeight;if(p===1||i>s.scrollTop&&m)return l(i);requestAnimationFrame(c)}))}La.framework={};La.init=()=>{};class W4 extends Xa{constructor(){return super(),La}}W4.property="goTo";const Dz={complete:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z",cancel:"M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2,6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12,13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z",close:"M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",delete:"M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2,6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12,13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z",clear:"M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2,6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12,13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z",success:"M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M10 17L5 12L6.41 10.59L10 14.17L17.59 6.58L19 8L10 17Z",info:"M13,9H11V7H13M13,17H11V11H13M12,2C6.48,2 2,6.48 2,12C2,17.52 6.48,22 12,22C17.52,22 22,17.52 22,12C22,6.48 17.52,2 12,2ZM13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z",warning:"M13,13H11V7H13M13,17H11V15H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z",error:"M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2,6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12,13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z",prev:"M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z",next:"M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z",checkboxOn:"M10,17L5,12L6.41,10.58L10,14.17L17.59,6.58L19,8M19,3H5C3.89,3 3,3.89 3,5V19C3,20.1 3.9,21 5,21H19C20.1,21 21,20.1 21,19V5C21,3.89 20.1,3 19,3Z",checkboxOff:"M19,3H5C3.89,3 3,3.89 3,5V19C3,20.1 3.9,21 5,21H19C20.1,21 21,20.1 21,19V5C21,3.89 20.1,3 19,3M19,5V19H5V5H19Z",checkboxIndeterminate:"M17,13H7V11H17M19,3H5C3.89,3 3,3.89 3,5V19C3,20.1 3.9,21 5,21H19C20.1,21 21,20.1 21,19V5C21,3.89 20.1,3 19,3Z",delimiter:"M12,2C6.48,2 2,6.48 2,12C2,17.52 6.48,22 12,22C17.52,22 22,17.52 22,12C22,6.48 17.52,2 12,2Z",sort:"M13,20H11V8L5.5,13.5L4.08,12.08L12,4.16L19.92,12.08L18.5,13.5L13,8V20Z",expand:"M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z",menu:"M3,6H21V8H3V6M3,11H21V13H3V11M3,16H21V18H3V16Z",subgroup:"M7,10L12,15L17,10H7Z",dropdown:"M7,10L12,15L17,10H7Z",radioOn:"M12,20C7.58,20 4,16.42 4,12C4,7.58 7.58,4 12,4C16.42,4 20,7.58 20,12C20,16.42 16.42,20 12,20M12,2C6.48,2 2,6.48 2,12C2,17.52 6.48,22 12,22C17.52,22 22,17.52 22,12C22,6.48 17.52,2 12,2M12,7C9.24,7 7,9.24 7,12C7,14.76 9.24,17 12,17C14.76,17 17,14.76 17,12C17,9.24 14.76,7 12,7Z",radioOff:"M12,20C7.58,20 4,16.42 4,12C4,7.58 7.58,4 12,4C16.42,4 20,7.58 20,12C20,16.42 16.42,20 12,20M12,2C6.48,2 2,6.48 2,12C2,17.52 6.48,22 12,22C17.52,22 22,17.52 22,12C22,6.48 17.52,2 12,2Z",edit:"M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z",ratingEmpty:"M12,15.39L8.24,17.66L9.23,13.38L5.91,10.5L10.29,10.13L12,6.09L13.71,10.13L18.09,10.5L14.77,13.38L15.76,17.66M22,9.24L14.81,8.63L12,2L9.19,8.63L2,9.24L7.45,13.97L5.82,21L12,17.27L18.18,21L16.54,13.97L22,9.24Z",ratingFull:"M12,17.27L18.18,21L16.54,13.97L22,9.24L14.81,8.62L12,2L9.19,8.62L2,9.24L7.45,13.97L5.82,21L12,17.27Z",ratingHalf:"M12,15.4V6.1L13.71,10.13L18.09,10.5L14.77,13.39L15.76,17.67M22,9.24L14.81,8.63L12,2L9.19,8.63L2,9.24L7.45,13.97L5.82,21L12,17.27L18.18,21L16.54,13.97L22,9.24Z",loading:"M19,8L15,12H18C18,15.31 15.31,18 12,18C11,18 10.03,17.75 9.2,17.3L7.74,18.76C8.97,19.54 10.43,20 12,20C16.42,20 20,16.42 20,12H23M6,12C6,8.69 8.69,6 12,6C13,6 13.97,6.25 14.8,6.7L16.26,5.24C15.03,4.46 13.57,4 12,4C7.58,4 4,7.58 4,12H1L5,16L9,12",first:"M18.41,16.59L13.82,12L18.41,7.41L17,6L11,12L17,18L18.41,16.59M6,6H8V18H6V6Z",last:"M5.59,7.41L10.18,12L5.59,16.59L7,18L13,12L7,6L5.59,7.41M16,6H18V18H16V6Z",unfold:"M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z",file:"M16.5,6V17.5C16.5,19.71 14.71,21.5 12.5,21.5C10.29,21.5 8.5,19.71 8.5,17.5V5C8.5,3.62 9.62,2.5 11,2.5C12.38,2.5 13.5,3.62 13.5,5V15.5C13.5,16.05 13.05,16.5 12.5,16.5C11.95,16.5 11.5,16.05 11.5,15.5V6H10V15.5C10,16.88 11.12,18 12.5,18C13.88,18 15,16.88 15,15.5V5C15,2.79 13.21,1 11,1C8.79,1 7,2.79 7,5V17.5C7,20.54 9.46,23 12.5,23C15.54,23 18,20.54 18,17.5V6H16.5Z",plus:"M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",minus:"M19,13H5V11H19V13Z"},Mz={complete:"check",cancel:"cancel",close:"close",delete:"cancel",clear:"clear",success:"check_circle",info:"info",warning:"priority_high",error:"warning",prev:"chevron_left",next:"chevron_right",checkboxOn:"check_box",checkboxOff:"check_box_outline_blank",checkboxIndeterminate:"indeterminate_check_box",delimiter:"fiber_manual_record",sort:"arrow_upward",expand:"keyboard_arrow_down",menu:"menu",subgroup:"arrow_drop_down",dropdown:"arrow_drop_down",radioOn:"radio_button_checked",radioOff:"radio_button_unchecked",edit:"edit",ratingEmpty:"star_border",ratingFull:"star",ratingHalf:"star_half",loading:"cached",first:"first_page",last:"last_page",unfold:"unfold_more",file:"attach_file",plus:"add",minus:"remove"},Rz={complete:"mdi-check",cancel:"mdi-close-circle",close:"mdi-close",delete:"mdi-close-circle",clear:"mdi-close",success:"mdi-check-circle",info:"mdi-information",warning:"mdi-exclamation",error:"mdi-alert",prev:"mdi-chevron-left",next:"mdi-chevron-right",checkboxOn:"mdi-checkbox-marked",checkboxOff:"mdi-checkbox-blank-outline",checkboxIndeterminate:"mdi-minus-box",delimiter:"mdi-circle",sort:"mdi-arrow-up",expand:"mdi-chevron-down",menu:"mdi-menu",subgroup:"mdi-menu-down",dropdown:"mdi-menu-down",radioOn:"mdi-radiobox-marked",radioOff:"mdi-radiobox-blank",edit:"mdi-pencil",ratingEmpty:"mdi-star-outline",ratingFull:"mdi-star",ratingHalf:"mdi-star-half-full",loading:"mdi-cached",first:"mdi-page-first",last:"mdi-page-last",unfold:"mdi-unfold-more-horizontal",file:"mdi-paperclip",plus:"mdi-plus",minus:"mdi-minus"},G4={complete:"fas fa-check",cancel:"fas fa-times-circle",close:"fas fa-times",delete:"fas fa-times-circle",clear:"fas fa-times-circle",success:"fas fa-check-circle",info:"fas fa-info-circle",warning:"fas fa-exclamation-circle",error:"fas fa-exclamation-triangle",prev:"fas fa-chevron-left",next:"fas fa-chevron-right",checkboxOn:"fas fa-check-square",checkboxOff:"far fa-square",checkboxIndeterminate:"fas fa-minus-square",delimiter:"fas fa-circle",sort:"fas fa-sort-up",expand:"fas fa-chevron-down",menu:"fas fa-bars",subgroup:"fas fa-caret-down",dropdown:"fas fa-caret-down",radioOn:"far fa-dot-circle",radioOff:"far fa-circle",edit:"fas fa-edit",ratingEmpty:"far fa-star",ratingFull:"fas fa-star",ratingHalf:"fas fa-star-half",loading:"fas fa-sync",first:"fas fa-step-backward",last:"fas fa-step-forward",unfold:"fas fa-arrows-alt-v",file:"fas fa-paperclip",plus:"fas fa-plus",minus:"fas fa-minus"},Iz={complete:"fa fa-check",cancel:"fa fa-times-circle",close:"fa fa-times",delete:"fa fa-times-circle",clear:"fa fa-times-circle",success:"fa fa-check-circle",info:"fa fa-info-circle",warning:"fa fa-exclamation",error:"fa fa-exclamation-triangle",prev:"fa fa-chevron-left",next:"fa fa-chevron-right",checkboxOn:"fa fa-check-square",checkboxOff:"fa fa-square-o",checkboxIndeterminate:"fa fa-minus-square",delimiter:"fa fa-circle",sort:"fa fa-sort-up",expand:"fa fa-chevron-down",menu:"fa fa-bars",subgroup:"fa fa-caret-down",dropdown:"fa fa-caret-down",radioOn:"fa fa-dot-circle-o",radioOff:"fa fa-circle-o",edit:"fa fa-pencil",ratingEmpty:"fa fa-star-o",ratingFull:"fa fa-star",ratingHalf:"fa fa-star-half-o",loading:"fa fa-refresh",first:"fa fa-step-backward",last:"fa fa-step-forward",unfold:"fa fa-angle-double-down",file:"fa fa-paperclip",plus:"fa fa-plus",minus:"fa fa-minus"};function Fz(r,e){const t={};for(const s in e)t[s]={component:r,props:{icon:e[s].split(" fa-")}};return t}const Hz=Fz("font-awesome-icon",G4),Bz=Object.freeze({mdiSvg:Dz,md:Mz,mdi:Rz,fa:G4,fa4:Iz,faSvg:Hz});let q4=class Z4 extends Xa{constructor(e){super();const{iconfont:t,values:s,component:n}=e[Z4.property];this.component=n,this.iconfont=t,this.values=Gc(Bz[t],s)}};q4.property="icons";const Y4="$vuetify.",cw=Symbol("Lang fallback");function K4(r,e,t=!1,s){const n=e.replace(Y4,"");let i=at(r,n,cw);return i===cw&&(t?(Ns(`Translation key "${n}" not found in fallback`),i=e):(lr(`Translation key "${n}" not found, falling back to default`),i=K4(s,e,!0,s))),i}class Cm extends Xa{constructor(e){super(),this.defaultLocale="en";const{current:t,locales:s,t:n}=e[Cm.property];this.current=t,this.locales=s,this.translator=n||this.defaultTranslator}currentLocale(e){const t=this.locales[this.current],s=this.locales[this.defaultLocale];return K4(t,e,!1,s)}t(e,...t){return e.startsWith(Y4)?this.translator(e,...t):this.replace(e,t)}defaultTranslator(e,...t){return this.replace(this.currentLocale(e),t)}replace(e,t){return e.replace(/\{(\d+)\}/g,(s,n)=>String(t[+n]))}}Cm.property="lang";const jz={badge:"Badge",close:"Close",dataIterator:{noResultsText:"No matching records found",loadingText:"Loading items..."},dataTable:{itemsPerPageText:"Rows per page:",ariaLabel:{sortDescending:"Sorted descending.",sortAscending:"Sorted ascending.",sortNone:"Not sorted.",activateNone:"Activate to remove sorting.",activateDescending:"Activate to sort descending.",activateAscending:"Activate to sort ascending."},sortBy:"Sort by"},dataFooter:{itemsPerPageText:"Items per page:",itemsPerPageAll:"All",nextPage:"Next page",prevPage:"Previous page",firstPage:"First page",lastPage:"Last page",pageText:"{0}-{1} of {2}"},datePicker:{itemsSelected:"{0} selected",nextMonthAriaLabel:"Next month",nextYearAriaLabel:"Next year",prevMonthAriaLabel:"Previous month",prevYearAriaLabel:"Previous year"},noDataText:"No data available",carousel:{prev:"Previous visual",next:"Next visual",ariaLabel:{delimiter:"Carousel slide {0} of {1}"}},calendar:{moreEvents:"{0} more"},input:{clear:"Clear {0}",prependAction:"{0} prepended action",appendAction:"{0} appended action"},fileInput:{counter:"{0} files",counterSize:"{0} files ({1} in total)"},timePicker:{am:"AM",pm:"PM"},pagination:{ariaLabel:{wrapper:"Pagination Navigation",next:"Next page",previous:"Previous page",page:"Goto Page {0}",currentPage:"Current Page, Page {0}"}},rating:{ariaLabel:{icon:"Rating {0} of {1}"}},loading:"Loading..."},Vz={breakpoint:{mobileBreakpoint:1264,scrollBarWidth:16,thresholds:{xs:600,sm:960,md:1280,lg:1920}},icons:{iconfont:"mdi",values:{}},lang:{current:"en",locales:{en:jz},t:void 0},rtl:!1,theme:{dark:!1,default:"light",disable:!1,options:{cspNonce:void 0,customProperties:void 0,minifyTheme:void 0,themeCache:void 0,variations:!0},themes:{light:{primary:"#1976D2",secondary:"#424242",accent:"#82B1FF",error:"#FF5252",info:"#2196F3",success:"#4CAF50",warning:"#FB8C00"},dark:{primary:"#2196F3",secondary:"#424242",accent:"#FF4081",error:"#FF5252",info:"#2196F3",success:"#4CAF50",warning:"#FB8C00"}}}};class X4 extends Xa{constructor(e,t){super();const s=Gc({},Vz),{userPreset:n}=t,{preset:i={},...a}=n;i.preset!=null&&lr("Global presets do not support the **preset** option, it can be safely omitted"),t.preset=Gc(Gc(s,i),a)}}X4.property="presets";const Nz=[[3.2406,-1.5372,-.4986],[-.9689,1.8758,.0415],[.0557,-.204,1.057]],zz=r=>r<=.0031308?r*12.92:1.055*r**(1/2.4)-.055,Uz=[[.4124,.3576,.1805],[.2126,.7152,.0722],[.0193,.1192,.9505]],Wz=r=>r<=.04045?r/12.92:((r+.055)/1.055)**2.4;function Q4(r){const e=Array(3),t=zz,s=Nz;for(let n=0;n<3;++n)e[n]=Math.round(vz(t(s[n][0]*r[0]+s[n][1]*r[1]+s[n][2]*r[2]))*255);return(e[0]<<16)+(e[1]<<8)+(e[2]<<0)}function J4(r){const e=[0,0,0],t=Wz,s=Uz,n=t((r>>16&255)/255),i=t((r>>8&255)/255),a=t((r>>0&255)/255);for(let o=0;o<3;++o)e[o]=s[o][0]*n+s[o][1]*i+s[o][2]*a;return e}function uw(r){return!!r&&!!r.match(/^(#|var\(--|(rgb|hsl)a?\()/)}function Nv(r){let e;if(typeof r=="number")e=r;else if(typeof r=="string"){let t=r[0]==="#"?r.substring(1):r;t.length===3&&(t=t.split("").map(s=>s+s).join("")),t.length!==6&&lr(`'${r}' is not a valid rgb color`),e=parseInt(t,16)}else throw new TypeError(`Colors can only be numbers or strings, recieved ${r==null?r:r.constructor.name} instead`);return e<0?(lr(`Colors cannot be negative: '${r}'`),e=0):(e>16777215||isNaN(e))&&(lr(`'${r}' is not a valid rgb color`),e=16777215),e}function qc(r){let e=r.toString(16);return e.length<6&&(e="0".repeat(6-e.length)+e),"#"+e}function Gz(r){return qc(Nv(r))}const Vh=.20689655172413793,qz=r=>r>Vh**3?Math.cbrt(r):r/(3*Vh**2)+4/29,Zz=r=>r>Vh?r**3:3*Vh**2*(r-4/29);function e6(r){const e=qz,t=e(r[1]);return[116*t-16,500*(e(r[0]/.95047)-t),200*(t-e(r[2]/1.08883))]}function t6(r){const e=Zz,t=(r[0]+16)/116;return[e(t+r[1]/500)*.95047,e(t),e(t-r[2]/200)*1.08883]}function r6(r,e=!1,t=!0){const{anchor:s,...n}=r,i=Object.keys(n),a={};for(let o=0;o` +.v-application .${r} { + background-color: ${e} !important; + border-color: ${e} !important; +} +.v-application .${r}--text { + color: ${e} !important; + caret-color: ${e} !important; +}`,Kz=(r,e,t)=>{const[s,n]=e.split(/(\d)/,2);return` +.v-application .${r}.${s}-${n} { + background-color: ${t} !important; + border-color: ${t} !important; +} +.v-application .${r}--text.text--${s}-${n} { + color: ${t} !important; + caret-color: ${t} !important; +}`},Qp=(r,e="base")=>`--v-${r}-${e}`,lg=(r,e="base")=>`var(${Qp(r,e)})`;function Xz(r,e=!1){const{anchor:t,...s}=r,n=Object.keys(s);if(!n.length)return"";let i="",a="";const o=e?lg("anchor"):t;a+=`.v-application a { color: ${o}; }`,e&&(i+=` ${Qp("anchor")}: ${t}; +`);for(let l=0;l0;--s)t[`lighten${s}`]=qc(Jz(e,s));for(let s=1;s<=4;++s)t[`darken${s}`]=qc(eU(e,s));return t}function Jz(r,e){const t=e6(J4(r));return t[0]=t[0]+e*10,Q4(t6(t))}function eU(r,e){const t=e6(J4(r));return t[0]=t[0]-e*10,Q4(t6(t))}class Pm extends Xa{constructor(e){super(),this.disabled=!1,this.isDark=null,this.unwatch=null,this.vueMeta=null;const{dark:t,disable:s,options:n,themes:i}=e[Pm.property];if(this.dark=!!t,this.defaults=this.themes=i,this.options=n,s){this.disabled=!0;return}this.themes={dark:this.fillVariant(i.dark,!0),light:this.fillVariant(i.light,!1)}}set css(e){if(this.vueMeta){this.isVueMeta23&&this.applyVueMeta23();return}this.checkOrCreateStyleElement()&&(this.styleEl.innerHTML=e)}set dark(e){const t=this.isDark;this.isDark=e,t!=null&&this.applyTheme()}get dark(){return!!this.isDark}applyTheme(){if(this.disabled)return this.clearCss();this.css=this.generatedStyles}clearCss(){this.css=""}init(e,t){this.disabled||(e.$meta?this.initVueMeta(e):t&&this.initSSR(t),this.initTheme(e))}setTheme(e,t){this.themes[e]=Object.assign(this.themes[e],t),this.applyTheme()}resetThemes(){this.themes.light=Object.assign({},this.defaults.light),this.themes.dark=Object.assign({},this.defaults.dark),this.applyTheme()}checkOrCreateStyleElement(){return this.styleEl=document.getElementById("vuetify-theme-stylesheet"),this.styleEl?!0:(this.genStyleElement(),!!this.styleEl)}fillVariant(e={},t){const s=this.themes[t?"dark":"light"];return Object.assign({},s,e)}genStyleElement(){typeof document>"u"||(this.styleEl=document.createElement("style"),this.styleEl.type="text/css",this.styleEl.id="vuetify-theme-stylesheet",this.options.cspNonce&&this.styleEl.setAttribute("nonce",this.options.cspNonce),document.head.appendChild(this.styleEl))}initVueMeta(e){if(this.vueMeta=e.$meta(),this.isVueMeta23){e.$nextTick(()=>{this.applyVueMeta23()});return}const t=typeof this.vueMeta.getOptions=="function"?this.vueMeta.getOptions().keyName:"metaInfo",s=e.$options[t]||{};e.$options[t]=()=>{s.style=s.style||[];const n=s.style.find(i=>i.id==="vuetify-theme-stylesheet");return n?n.cssText=this.generatedStyles:s.style.push({cssText:this.generatedStyles,type:"text/css",id:"vuetify-theme-stylesheet",nonce:(this.options||{}).cspNonce}),s}}applyVueMeta23(){const{set:e}=this.vueMeta.addApp("vuetify");e({style:[{cssText:this.generatedStyles,type:"text/css",id:"vuetify-theme-stylesheet",nonce:this.options.cspNonce}]})}initSSR(e){const t=this.options.cspNonce?` nonce="${this.options.cspNonce}"`:"";e.head=e.head||"",e.head+=``}initTheme(e){typeof document>"u"||(this.unwatch&&(this.unwatch(),this.unwatch=null),e.$once("hook:created",()=>{const t=b.observable({themes:this.themes});this.unwatch=e.$watch(()=>t.themes,()=>this.applyTheme(),{deep:!0})}),this.applyTheme())}get currentTheme(){const e=this.dark?"dark":"light";return this.themes[e]}get generatedStyles(){const e=this.parsedTheme,t=this.options||{};let s;return t.themeCache!=null&&(s=t.themeCache.get(e),s!=null)||(s=Xz(e,t.customProperties),t.minifyTheme!=null&&(s=t.minifyTheme(s)),t.themeCache!=null&&t.themeCache.set(e,s)),s}get parsedTheme(){return r6(this.currentTheme||{},void 0,rb(this.options,["variations"],!0))}get isVueMeta23(){return typeof this.vueMeta.addApp=="function"}}Pm.property="theme";class Qa{constructor(e={}){this.framework={isHydrating:!1},this.installed=[],this.preset={},this.userPreset={},this.userPreset=e,this.use(X4),this.use(N4),this.use(xm),this.use(W4),this.use(q4),this.use(Cm),this.use(Pm)}init(e,t){this.installed.forEach(s=>{const n=this.framework[s];n.framework=this.framework,n.init(e,t)}),this.framework.rtl=!!this.preset.rtl}use(e){const t=e.property;this.installed.includes(t)||(this.framework[t]=new e(this.preset,this),this.installed.push(t))}}Qa.install=Vv;Qa.installed=!1;Qa.version="2.7.2";Qa.config={silent:!1};function s6(r,e,t){if(!Qa.config.silent){if(e){if(e.$_alreadyWarned=e.$_alreadyWarned||[],e.$_alreadyWarned.includes(r))return;e.$_alreadyWarned.push(r)}return`[Vuetify] ${r}`+(e?sU(e):"")}}function lr(r,e,t){const s=s6(r,e);s!=null&&console.warn(s)}function Ns(r,e,t){const s=s6(r,e);s!=null&&console.error(s)}function n6(r,e,t,s){lr(`[UPGRADE] '${r}' is deprecated, use '${e}' instead.`,t)}function Zs(r,e,t,s){Ns(`[BREAKING] '${r}' has been removed, use '${e}' instead. For more information, see the upgrade guide https://github.com/vuetifyjs/vuetify/releases/tag/v2.0.0#user-content-upgrade-guide`,t)}function Ll(r,e,t){lr(`[REMOVED] '${r}' has been removed. You can safely omit it.`,e)}const tU=/(?:^|[-_])(\w)/g,rU=r=>r.replace(tU,e=>e.toUpperCase()).replace(/[-_]/g,"");function cg(r,e){if(r.$root===r)return"";const t=typeof r=="function"&&r.cid!=null?r.options:r._isVue?r.$options||r.constructor.options:r||{};let s=t.name||t._componentTag;const n=t.__file;if(!s&&n){const i=n.match(/([^/\\]+)\.vue$/);s=i&&i[1]}return(s?`<${rU(s)}>`:"")+(n&&e!==!1?` at ${n}`:"")}function sU(r){if(r._isVue&&r.$parent){const e=[];let t=0;for(;r;){if(e.length>0){const s=e[e.length-1];if(s.constructor===r.constructor){t++,r=r.$parent;continue}else t>0&&(e[e.length-1]=[s,t],t=0)}e.push(r),r=r.$parent}return` + +found in + +`+e.map((s,n)=>`${n===0?"---> ":" ".repeat(5+n*2)}${Array.isArray(s)?`${cg(s[0])}... (${s[1]} recursive calls)`:cg(s)}`).join(` +`)}else return` + +(found in ${cg(r)})`}const dt=b.extend({name:"colorable",props:{color:String},methods:{setBackgroundColor(r,e={}){return typeof e.style=="string"?(Ns("style must be an object",this),e):typeof e.class=="string"?(Ns("class must be an object",this),e):(uw(r)?e.style={...e.style,"background-color":`${r}`,"border-color":`${r}`}:r&&(e.class={...e.class,[r]:!0}),e)},setTextColor(r,e={}){if(typeof e.style=="string")return Ns("style must be an object",this),e;if(typeof e.class=="string")return Ns("class must be an object",this),e;if(uw(r))e.style={...e.style,color:`${r}`,"caret-color":`${r}`};else if(r){const[t,s]=r.toString().trim().split(" ",2);e.class={...e.class,[t+"--text"]:!0},s&&(e.class["text--"+s]=!0)}return e}}}),i6=b.extend({name:"elevatable",props:{elevation:[Number,String]},computed:{computedElevation(){return this.elevation},elevationClasses(){const r=this.computedElevation;return r==null?{}:isNaN(parseInt(r))?{}:{[`elevation-${this.elevation}`]:!0}}}}),sb=b.extend({name:"measurable",props:{height:[Number,String],maxHeight:[Number,String],maxWidth:[Number,String],minHeight:[Number,String],minWidth:[Number,String],width:[Number,String]},computed:{measurableStyles(){const r={},e=ge(this.height),t=ge(this.minHeight),s=ge(this.minWidth),n=ge(this.maxHeight),i=ge(this.maxWidth),a=ge(this.width);return e&&(r.height=e),t&&(r.minHeight=t),s&&(r.minWidth=s),n&&(r.maxHeight=n),i&&(r.maxWidth=i),a&&(r.width=a),r}}}),a6=b.extend({name:"roundable",props:{rounded:[Boolean,String],tile:Boolean},computed:{roundedClasses(){const r=[],e=typeof this.rounded=="string"?String(this.rounded):this.rounded===!0;if(this.tile)r.push("rounded-0");else if(typeof e=="string"){const t=e.split(" ");for(const s of t)r.push(`rounded-${s}`)}else e&&r.push("rounded");return r.length>0?{[r.join(" ")]:!0}:{}}}}),ut=be(Pl,dt,i6,sb,a6,Ke).extend({name:"v-sheet",props:{outlined:Boolean,shaped:Boolean,tag:{type:String,default:"div"}},computed:{classes(){return{"v-sheet":!0,"v-sheet--outlined":this.outlined,"v-sheet--shaped":this.shaped,...this.themeClasses,...this.elevationClasses,...this.roundedClasses}},styles(){return this.measurableStyles}},render(r){const e={class:this.classes,style:this.styles,on:this.listeners$};return r(this.tag,this.setBackgroundColor(this.color,e),this.$slots.default)}});function nU(r,e,t){if(typeof window>"u"||!("IntersectionObserver"in window))return;const s=e.modifiers||{},n=e.value,{handler:i,options:a}=typeof n=="object"?n:{handler:n,options:{}},o=new IntersectionObserver((l=[],c)=>{var u;const d=(u=r._observe)===null||u===void 0?void 0:u[t.context._uid];if(!d)return;const p=l.some(h=>h.isIntersecting);i&&(!s.quiet||d.init)&&(!s.once||p||d.init)&&i(l,c,p),p&&s.once?o6(r,e,t):d.init=!0},a);r._observe=Object(r._observe),r._observe[t.context._uid]={init:!1,observer:o},o.observe(r)}function o6(r,e,t){var s;const n=(s=r._observe)===null||s===void 0?void 0:s[t.context._uid];n&&(n.observer.unobserve(r),delete r._observe[t.context._uid])}const pu={inserted:nU,unbind:o6},ug=be(sb).extend({name:"v-responsive",props:{aspectRatio:[String,Number],contentClass:String},computed:{computedAspectRatio(){return Number(this.aspectRatio)},aspectStyle(){return this.computedAspectRatio?{paddingBottom:1/this.computedAspectRatio*100+"%"}:void 0},__cachedSizer(){return this.aspectStyle?this.$createElement("div",{style:this.aspectStyle,staticClass:"v-responsive__sizer"}):[]}},methods:{genContent(){return this.$createElement("div",{staticClass:"v-responsive__content",class:this.contentClass},me(this))}},render(r){return r("div",{staticClass:"v-responsive",style:this.measurableStyles,on:this.$listeners},[this.__cachedSizer,this.genContent()])}}),dw={styleList:/;(?![^(]*\))/g,styleProp:/:(.*)/};function pw(r){const e={};for(const t of r.split(dw.styleList)){let[s,n]=t.split(dw.styleProp);s=s.trim(),s&&(typeof n=="string"&&(n=n.trim()),e[H4(s)]=n)}return e}function os(){const r={};let e=arguments.length,t;for(;e--;)for(t of Object.keys(arguments[e]))switch(t){case"class":case"directives":arguments[e][t]&&(r[t]=c6(r[t],arguments[e][t]));break;case"style":arguments[e][t]&&(r[t]=l6(r[t],arguments[e][t]));break;case"staticClass":if(!arguments[e][t])break;r[t]===void 0&&(r[t]=""),r[t]&&(r[t]+=" "),r[t]+=arguments[e][t].trim();break;case"on":case"nativeOn":arguments[e][t]&&(r[t]=u6(r[t],arguments[e][t]));break;case"attrs":case"props":case"domProps":case"scopedSlots":case"staticStyle":case"hook":case"transition":if(!arguments[e][t])break;r[t]||(r[t]={}),r[t]={...arguments[e][t],...r[t]};break;default:r[t]||(r[t]=arguments[e][t])}return r}function l6(r,e){return r?e?(r=xr(typeof r=="string"?pw(r):r),r.concat(typeof e=="string"?pw(e):e)):r:e}function c6(r,e){return e?r&&r?xr(r).concat(e):e:r}function u6(...r){if(!r[0])return r[1];if(!r[1])return r[0];const e={};for(let t=2;t--;){const s=r[t];for(const n in s)s[n]&&(e[n]?e[n]=[].concat(s[n],e[n]):e[n]=s[n])}return e}const hw=typeof window<"u"&&"IntersectionObserver"in window,nb=be(ug,Ke).extend({name:"v-img",directives:{intersect:pu},props:{alt:String,contain:Boolean,eager:Boolean,gradient:String,lazySrc:String,options:{type:Object,default:()=>({root:void 0,rootMargin:void 0,threshold:void 0})},position:{type:String,default:"center center"},sizes:String,src:{type:[String,Object],default:""},srcset:String,transition:{type:[Boolean,String],default:"fade-transition"}},data(){return{currentSrc:"",image:null,isLoading:!0,calculatedAspectRatio:void 0,naturalWidth:void 0,hasError:!1}},computed:{computedAspectRatio(){return Number(this.normalisedSrc.aspect||this.calculatedAspectRatio)},normalisedSrc(){return this.src&&typeof this.src=="object"?{src:this.src.src,srcset:this.srcset||this.src.srcset,lazySrc:this.lazySrc||this.src.lazySrc,aspect:Number(this.aspectRatio||this.src.aspect)}:{src:this.src,srcset:this.srcset,lazySrc:this.lazySrc,aspect:Number(this.aspectRatio||0)}},__cachedImage(){if(!(this.normalisedSrc.src||this.normalisedSrc.lazySrc||this.gradient))return[];const r=[],e=this.isLoading?this.normalisedSrc.lazySrc:this.currentSrc;this.gradient&&r.push(`linear-gradient(${this.gradient})`),e&&r.push(`url("${e}")`);const t=this.$createElement("div",{staticClass:"v-image__image",class:{"v-image__image--preload":this.isLoading,"v-image__image--contain":this.contain,"v-image__image--cover":!this.contain},style:{backgroundImage:r.join(", "),backgroundPosition:this.position},key:+this.isLoading});return this.transition?this.$createElement("transition",{attrs:{name:this.transition,mode:"in-out"}},[t]):t}},watch:{src(){this.isLoading?this.loadImage():this.init(void 0,void 0,!0)},"$vuetify.breakpoint.width":"getSrc"},mounted(){this.init()},methods:{init(r,e,t){if(!(hw&&!t&&!this.eager)){if(this.normalisedSrc.lazySrc){const s=new Image;s.src=this.normalisedSrc.lazySrc,this.pollForSize(s,null)}this.normalisedSrc.src&&this.loadImage()}},onLoad(){this.getSrc(),this.isLoading=!1,this.$emit("load",this.src),this.image&&(this.normalisedSrc.src.endsWith(".svg")||this.normalisedSrc.src.startsWith("data:image/svg+xml"))&&(this.image.naturalHeight&&this.image.naturalWidth?(this.naturalWidth=this.image.naturalWidth,this.calculatedAspectRatio=this.image.naturalWidth/this.image.naturalHeight):this.calculatedAspectRatio=1)},onError(){this.hasError=!0,this.$emit("error",this.src)},getSrc(){this.image&&(this.currentSrc=this.image.currentSrc||this.image.src)},loadImage(){const r=new Image;this.image=r,r.onload=()=>{r.decode?r.decode().catch(e=>{lr(`Failed to decode image, trying to render anyway + +src: ${this.normalisedSrc.src}`+(e.message?` +Original error: ${e.message}`:""),this)}).then(this.onLoad):this.onLoad()},r.onerror=this.onError,this.hasError=!1,this.sizes&&(r.sizes=this.sizes),this.normalisedSrc.srcset&&(r.srcset=this.normalisedSrc.srcset),r.src=this.normalisedSrc.src,this.$emit("loadstart",this.normalisedSrc.src),this.aspectRatio||this.pollForSize(r),this.getSrc()},pollForSize(r,e=100){const t=()=>{const{naturalHeight:s,naturalWidth:n}=r;s||n?(this.naturalWidth=n,this.calculatedAspectRatio=n/s):!r.complete&&this.isLoading&&!this.hasError&&e!=null&&setTimeout(t,e)};t()},genContent(){const r=ug.options.methods.genContent.call(this);return this.naturalWidth&&this._b(r.data,"div",{style:{width:`${this.naturalWidth}px`}}),r},__genPlaceholder(){const r=me(this,"placeholder");if(r){const e=this.isLoading?[this.$createElement("div",{staticClass:"v-image__placeholder"},r)]:[];return this.transition?this.$createElement("transition",{props:{appear:!0,name:this.transition}},e):e[0]}}},render(r){const e=ug.options.render.call(this,r),t=os(e.data,{staticClass:"v-image",attrs:{"aria-label":this.alt,role:this.alt?"img":void 0},class:this.themeClasses,directives:hw?[{name:"intersect",modifiers:{once:!0},value:{handler:this.init,options:this.options}}]:void 0});return e.children=[this.__cachedSizer,this.__cachedImage,this.__genPlaceholder(),this.genContent()],r(e.tag,t,e.children)}}),qt=ut.extend({name:"v-toolbar",props:{absolute:Boolean,bottom:Boolean,collapse:Boolean,dense:Boolean,extended:Boolean,extensionHeight:{default:48,type:[Number,String]},flat:Boolean,floating:Boolean,prominent:Boolean,short:Boolean,src:{type:[String,Object],default:""},tag:{type:String,default:"header"}},data:()=>({isExtended:!1}),computed:{computedHeight(){const r=this.computedContentHeight;if(!this.isExtended)return r;const e=parseInt(this.extensionHeight);return this.isCollapsed?r:r+(isNaN(e)?0:e)},computedContentHeight(){return this.height?parseInt(this.height):this.isProminent&&this.dense?96:this.isProminent&&this.short?112:this.isProminent?128:this.dense?48:this.short||this.$vuetify.breakpoint.smAndDown?56:64},classes(){return{...ut.options.computed.classes.call(this),"v-toolbar":!0,"v-toolbar--absolute":this.absolute,"v-toolbar--bottom":this.bottom,"v-toolbar--collapse":this.collapse,"v-toolbar--collapsed":this.isCollapsed,"v-toolbar--dense":this.dense,"v-toolbar--extended":this.isExtended,"v-toolbar--flat":this.flat,"v-toolbar--floating":this.floating,"v-toolbar--prominent":this.isProminent}},isCollapsed(){return this.collapse},isProminent(){return this.prominent},styles(){return{...this.measurableStyles,height:ge(this.computedHeight)}}},created(){[["app",""],["manual-scroll",''],["clipped-left",""],["clipped-right",""],["inverted-scroll",""],["scroll-off-screen",""],["scroll-target",""],["scroll-threshold",""],["card",""]].forEach(([e,t])=>{this.$attrs.hasOwnProperty(e)&&Zs(e,t,this)})},methods:{genBackground(){const r={height:ge(this.computedHeight),src:this.src},e=this.$scopedSlots.img?this.$scopedSlots.img({props:r}):this.$createElement(nb,{props:r});return this.$createElement("div",{staticClass:"v-toolbar__image"},[e])},genContent(){return this.$createElement("div",{staticClass:"v-toolbar__content",style:{height:ge(this.computedContentHeight)}},me(this))},genExtension(){return this.$createElement("div",{staticClass:"v-toolbar__extension",style:{height:ge(this.extensionHeight)}},me(this,"extension"))}},render(r){this.isExtended=this.extended||!!this.$scopedSlots.extension;const e=[this.genContent()],t=this.setBackgroundColor(this.color,{class:this.classes,style:this.styles,on:this.$listeners});return this.isExtended&&e.push(this.genExtension()),(this.src||this.$scopedSlots.img)&&e.unshift(this.genBackground()),r(this.tag,t,e)}});function iU(r,e,t){const{self:s=!1}=e.modifiers||{},n=e.value,i=typeof n=="object"&&n.options||{passive:!0},a=typeof n=="function"||"handleEvent"in n?n:n.handler,o=s?r:e.arg?document.querySelector(e.arg):window;o&&(o.addEventListener("scroll",a,i),r._onScroll=Object(r._onScroll),r._onScroll[t.context._uid]={handler:a,options:i,target:s?void 0:o})}function aU(r,e,t){var s;if(!(!((s=r._onScroll)===null||s===void 0)&&s[t.context._uid]))return;const{handler:n,options:i,target:a=r}=r._onScroll[t.context._uid];a.removeEventListener("scroll",n,i),delete r._onScroll[t.context._uid]}const ib={inserted:iU,unbind:aU},fw={absolute:Boolean,bottom:Boolean,fixed:Boolean,left:Boolean,right:Boolean,top:Boolean};function Al(r=[]){return b.extend({name:"positionable",props:r.length?dz(fw,r):fw})}const oU=Al();function ab(r,e=[]){return be(Al(["absolute","fixed"])).extend({name:"applicationable",props:{app:Boolean},computed:{applicationProperty(){return r}},watch:{app(t,s){s?this.removeApplication(!0):this.callUpdate()},applicationProperty(t,s){this.$vuetify.application.unregister(this._uid,s)}},activated(){this.callUpdate()},created(){for(let t=0,s=e.length;t0}})}function Nh(r){if(typeof r.getRootNode!="function"){for(;r.parentNode;)r=r.parentNode;return r!==document?null:document}const e=r.getRootNode();return e!==document&&e.getRootNode({composed:!0})!==document?null:e}function lU(){return!0}function d6(r,e,t){if(!r||p6(r,t)===!1)return!1;const s=Nh(e);if(typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&s.host===r.target)return!1;const n=(typeof t.value=="object"&&t.value.include||(()=>[]))();return n.push(e),!n.some(i=>i.contains(r.target))}function p6(r,e){return(typeof e.value=="object"&&e.value.closeConditional||lU)(r)}function cU(r,e,t){const s=typeof t.value=="function"?t.value:t.value.handler;e._clickOutside.lastMousedownWasOutside&&d6(r,e,t)&&setTimeout(()=>{p6(r,t)&&s&&s(r)},0)}function mw(r,e){const t=Nh(r);e(document),typeof ShadowRoot<"u"&&t instanceof ShadowRoot&&e(t)}const fd={inserted(r,e,t){const s=i=>cU(i,r,e),n=i=>{r._clickOutside.lastMousedownWasOutside=d6(i,r,e)};mw(r,i=>{i.addEventListener("click",s,!0),i.addEventListener("mousedown",n,!0)}),r._clickOutside||(r._clickOutside={lastMousedownWasOutside:!0}),r._clickOutside[t.context._uid]={onClick:s,onMousedown:n}},unbind(r,e,t){r._clickOutside&&(mw(r,s=>{var n;if(!s||!(!((n=r._clickOutside)===null||n===void 0)&&n[t.context._uid]))return;const{onClick:i,onMousedown:a}=r._clickOutside[t.context._uid];s.removeEventListener("click",i,!0),s.removeEventListener("mousedown",a,!0)}),delete r._clickOutside[t.context._uid])}};function uU(r,e,t){const s=e.value,n=e.options||{passive:!0};window.addEventListener("resize",s,n),r._onResize=Object(r._onResize),r._onResize[t.context._uid]={callback:s,options:n},(!e.modifiers||!e.modifiers.quiet)&&s()}function dU(r,e,t){var s;if(!(!((s=r._onResize)===null||s===void 0)&&s[t.context._uid]))return;const{callback:n,options:i}=r._onResize[t.context._uid];window.removeEventListener("resize",n,i),delete r._onResize[t.context._uid]}const md={inserted:uU,unbind:dU},pU=80;function gw(r,e){r.style.transform=e,r.style.webkitTransform=e}function zv(r){return r.constructor.name==="TouchEvent"}function h6(r){return r.constructor.name==="KeyboardEvent"}const hU=(r,e,t={})=>{let s=0,n=0;if(!h6(r)){const d=e.getBoundingClientRect(),p=zv(r)?r.touches[r.touches.length-1]:r;s=p.clientX-d.left,n=p.clientY-d.top}let i=0,a=.3;e._ripple&&e._ripple.circle?(a=.15,i=e.clientWidth/2,i=t.center?i:i+Math.sqrt((s-i)**2+(n-i)**2)/4):i=Math.sqrt(e.clientWidth**2+e.clientHeight**2)/2;const o=`${(e.clientWidth-i*2)/2}px`,l=`${(e.clientHeight-i*2)/2}px`,c=t.center?o:`${s-i}px`,u=t.center?l:`${n-i}px`;return{radius:i,scale:a,x:c,y:u,centerX:o,centerY:l}},zh={show(r,e,t={}){if(!e._ripple||!e._ripple.enabled)return;const s=document.createElement("span"),n=document.createElement("span");s.appendChild(n),s.className="v-ripple__container",t.class&&(s.className+=` ${t.class}`);const{radius:i,scale:a,x:o,y:l,centerX:c,centerY:u}=hU(r,e,t),d=`${i*2}px`;n.className="v-ripple__animation",n.style.width=d,n.style.height=d,e.appendChild(s);const p=window.getComputedStyle(e);p&&p.position==="static"&&(e.style.position="relative",e.dataset.previousPosition="static"),n.classList.add("v-ripple__animation--enter"),n.classList.add("v-ripple__animation--visible"),gw(n,`translate(${o}, ${l}) scale3d(${a},${a},${a})`),n.dataset.activated=String(performance.now()),setTimeout(()=>{n.classList.remove("v-ripple__animation--enter"),n.classList.add("v-ripple__animation--in"),gw(n,`translate(${c}, ${u}) scale3d(1,1,1)`)},0)},hide(r){if(!r||!r._ripple||!r._ripple.enabled)return;const e=r.getElementsByClassName("v-ripple__animation");if(e.length===0)return;const t=e[e.length-1];if(t.dataset.isHiding)return;t.dataset.isHiding="true";const s=performance.now()-Number(t.dataset.activated),n=Math.max(250-s,0);setTimeout(()=>{t.classList.remove("v-ripple__animation--in"),t.classList.add("v-ripple__animation--out"),setTimeout(()=>{var i;r.getElementsByClassName("v-ripple__animation").length===1&&r.dataset.previousPosition&&(r.style.position=r.dataset.previousPosition,delete r.dataset.previousPosition),((i=t.parentNode)===null||i===void 0?void 0:i.parentNode)===r&&r.removeChild(t.parentNode)},300)},n)}};function f6(r){return typeof r>"u"||!!r}function hu(r){const e={},t=r.currentTarget;if(!(!t||!t._ripple||t._ripple.touched||r.rippleStop)){if(r.rippleStop=!0,zv(r))t._ripple.touched=!0,t._ripple.isTouch=!0;else if(t._ripple.isTouch)return;if(e.center=t._ripple.centered||h6(r),t._ripple.class&&(e.class=t._ripple.class),zv(r)){if(t._ripple.showTimerCommit)return;t._ripple.showTimerCommit=()=>{zh.show(r,t,e)},t._ripple.showTimer=window.setTimeout(()=>{t&&t._ripple&&t._ripple.showTimerCommit&&(t._ripple.showTimerCommit(),t._ripple.showTimerCommit=null)},pU)}else zh.show(r,t,e)}}function ss(r){const e=r.currentTarget;if(!(!e||!e._ripple)){if(window.clearTimeout(e._ripple.showTimer),r.type==="touchend"&&e._ripple.showTimerCommit){e._ripple.showTimerCommit(),e._ripple.showTimerCommit=null,e._ripple.showTimer=setTimeout(()=>{ss(r)});return}window.setTimeout(()=>{e._ripple&&(e._ripple.touched=!1)}),zh.hide(e)}}function m6(r){const e=r.currentTarget;!e||!e._ripple||(e._ripple.showTimerCommit&&(e._ripple.showTimerCommit=null),window.clearTimeout(e._ripple.showTimer))}let fu=!1;function g6(r){!fu&&(r.keyCode===Le.enter||r.keyCode===Le.space)&&(fu=!0,hu(r))}function v6(r){fu=!1,ss(r)}function _6(r){fu===!0&&(fu=!1,ss(r))}function y6(r,e,t){const s=f6(e.value);s||zh.hide(r),r._ripple=r._ripple||{},r._ripple.enabled=s;const n=e.value||{};n.center&&(r._ripple.centered=!0),n.class&&(r._ripple.class=e.value.class),n.circle&&(r._ripple.circle=n.circle),s&&!t?(r.addEventListener("touchstart",hu,{passive:!0}),r.addEventListener("touchend",ss,{passive:!0}),r.addEventListener("touchmove",m6,{passive:!0}),r.addEventListener("touchcancel",ss),r.addEventListener("mousedown",hu),r.addEventListener("mouseup",ss),r.addEventListener("mouseleave",ss),r.addEventListener("keydown",g6),r.addEventListener("keyup",v6),r.addEventListener("blur",_6),r.addEventListener("dragstart",ss,{passive:!0})):!s&&t&&b6(r)}function b6(r){r.removeEventListener("mousedown",hu),r.removeEventListener("touchstart",hu),r.removeEventListener("touchend",ss),r.removeEventListener("touchmove",m6),r.removeEventListener("touchcancel",ss),r.removeEventListener("mouseup",ss),r.removeEventListener("mouseleave",ss),r.removeEventListener("keydown",g6),r.removeEventListener("keyup",v6),r.removeEventListener("dragstart",ss),r.removeEventListener("blur",_6)}function fU(r,e,t){y6(r,e,!1)}function mU(r){delete r._ripple,b6(r)}function gU(r,e){if(e.value===e.oldValue)return;const t=f6(e.oldValue);y6(r,e,t)}const ls={bind:fU,unbind:mU,update:gU},vU=r=>{const{touchstartX:e,touchendX:t,touchstartY:s,touchendY:n}=r,i=.5,a=16;r.offsetX=t-e,r.offsetY=n-s,Math.abs(r.offsetY)e+a&&r.right(r)),Math.abs(r.offsetX)s+a&&r.down(r))};function _U(r,e){const t=r.changedTouches[0];e.touchstartX=t.clientX,e.touchstartY=t.clientY,e.start&&e.start(Object.assign(r,e))}function yU(r,e){const t=r.changedTouches[0];e.touchendX=t.clientX,e.touchendY=t.clientY,e.end&&e.end(Object.assign(r,e)),vU(e)}function bU(r,e){const t=r.changedTouches[0];e.touchmoveX=t.clientX,e.touchmoveY=t.clientY,e.move&&e.move(Object.assign(r,e))}function $U(r){const e={touchstartX:0,touchstartY:0,touchendX:0,touchendY:0,touchmoveX:0,touchmoveY:0,offsetX:0,offsetY:0,left:r.left,right:r.right,up:r.up,down:r.down,start:r.start,move:r.move,end:r.end};return{touchstart:t=>_U(t,e),touchend:t=>yU(t,e),touchmove:t=>bU(t,e)}}function SU(r,e,t){const s=e.value,n=s.parent?r.parentElement:r,i=s.options||{passive:!0};if(!n)return;const a=$U(e.value);n._touchHandlers=Object(n._touchHandlers),n._touchHandlers[t.context._uid]=a,Sm(a).forEach(o=>{n.addEventListener(o,a[o],i)})}function wU(r,e,t){const s=e.value.parent?r.parentElement:r;if(!s||!s._touchHandlers)return;const n=s._touchHandlers[t.context._uid];Sm(n).forEach(i=>{s.removeEventListener(i,n[i])}),delete s._touchHandlers[t.context._uid]}const gd={inserted:SU,unbind:wU},$6=b.extend({name:"scrollable",directives:{Scroll:ib},props:{scrollTarget:String,scrollThreshold:[String,Number]},data:()=>({currentScroll:0,currentThreshold:0,isActive:!1,isScrollingUp:!1,previousScroll:0,savedScroll:0,target:null}),computed:{canScroll(){return typeof window<"u"},computedScrollThreshold(){return this.scrollThreshold?Number(this.scrollThreshold):300}},watch:{isScrollingUp(){this.savedScroll=this.savedScroll||this.currentScroll},isActive(){this.savedScroll=0}},mounted(){this.scrollTarget&&(this.target=document.querySelector(this.scrollTarget),this.target||lr(`Unable to locate element with identifier ${this.scrollTarget}`,this))},methods:{onScroll(){this.canScroll&&(this.previousScroll=this.currentScroll,this.currentScroll=this.target?this.target.scrollTop:window.pageYOffset,this.isScrollingUp=this.currentScroll{Math.abs(this.currentScroll-this.savedScroll)>this.computedScrollThreshold&&this.thresholdMet()}))},thresholdMet(){}}}),vd=b.extend({name:"ssr-bootable",data:()=>({isBooted:!1}),mounted(){window.requestAnimationFrame(()=>{this.$el.setAttribute("data-booted","true"),this.isBooted=!0})}});function Lm(r="value",e="input"){return b.extend({name:"toggleable",model:{prop:r,event:e},props:{[r]:{required:!1}},data(){return{isActive:!!this[r]}},watch:{[r](t){this.isActive=!!t},isActive(t){!!t!==this[r]&&this.$emit(e,t)}}})}const xU=Lm(),Vi=xU,CU=be(qt,$6,vd,Vi,ab("top",["clippedLeft","clippedRight","computedHeight","invertedScroll","isExtended","isProminent","value"])),PU=CU.extend({name:"v-app-bar",directives:{Scroll:ib},provide(){return{VAppBar:this}},props:{clippedLeft:Boolean,clippedRight:Boolean,collapseOnScroll:Boolean,elevateOnScroll:Boolean,fadeImgOnScroll:Boolean,hideOnScroll:Boolean,invertedScroll:Boolean,scrollOffScreen:Boolean,shrinkOnScroll:Boolean,value:{type:Boolean,default:!0}},data(){return{isActive:this.value}},computed:{applicationProperty(){return this.bottom?"bottom":"top"},canScroll(){return $6.options.computed.canScroll.call(this)&&(this.invertedScroll||this.elevateOnScroll||this.hideOnScroll||this.collapseOnScroll||this.isBooted||!this.value)},classes(){return{...qt.options.computed.classes.call(this),"v-toolbar--collapse":this.collapse||this.collapseOnScroll,"v-app-bar":!0,"v-app-bar--clipped":this.clippedLeft||this.clippedRight,"v-app-bar--fade-img-on-scroll":this.fadeImgOnScroll,"v-app-bar--elevate-on-scroll":this.elevateOnScroll,"v-app-bar--fixed":!this.absolute&&(this.app||this.fixed),"v-app-bar--hide-shadow":this.hideShadow,"v-app-bar--is-scrolled":this.currentScroll>0,"v-app-bar--shrink-on-scroll":this.shrinkOnScroll}},scrollRatio(){const r=this.computedScrollThreshold;return Math.max((r-this.currentScroll)/r,0)},computedContentHeight(){if(!this.shrinkOnScroll)return qt.options.computed.computedContentHeight.call(this);const r=this.dense?48:56,e=this.computedOriginalHeight;return r+(e-r)*this.scrollRatio},computedFontSize(){if(!this.isProminent)return;const r=1.25;return r+(1.5-r)*this.scrollRatio},computedLeft(){return!this.app||this.clippedLeft?0:this.$vuetify.application.left},computedMarginTop(){return this.app?this.$vuetify.application.bar:0},computedOpacity(){if(this.fadeImgOnScroll)return this.scrollRatio},computedOriginalHeight(){let r=qt.options.computed.computedContentHeight.call(this);return this.isExtended&&(r+=parseInt(this.extensionHeight)),r},computedRight(){return!this.app||this.clippedRight?0:this.$vuetify.application.right},computedScrollThreshold(){return this.scrollThreshold?Number(this.scrollThreshold):this.computedOriginalHeight-(this.dense?48:56)},computedTransform(){if(!this.canScroll||this.elevateOnScroll&&this.currentScroll===0&&this.isActive||this.isActive)return 0;const r=this.scrollOffScreen?this.computedHeight:this.computedContentHeight;return this.bottom?r:-r},hideShadow(){return this.elevateOnScroll&&this.isExtended?this.currentScroll0:qt.options.computed.isCollapsed.call(this)},isProminent(){return qt.options.computed.isProminent.call(this)||this.shrinkOnScroll},styles(){return{...qt.options.computed.styles.call(this),fontSize:ge(this.computedFontSize,"rem"),marginTop:ge(this.computedMarginTop),transform:`translateY(${ge(this.computedTransform)})`,left:ge(this.computedLeft),right:ge(this.computedRight)}}},watch:{canScroll:"onScroll",computedTransform(){!this.canScroll||!this.clippedLeft&&!this.clippedRight||this.callUpdate()},invertedScroll(r){this.isActive=!r||this.currentScroll!==0},hideOnScroll(r){this.isActive=!r||this.currentScrollthis.computedScrollThreshold;return}this.hideOnScroll&&(this.isActive=this.isScrollingUp||this.currentScrollr.includes(e))}function AU(r){return/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(r)&&/[\dz]$/i.test(r)&&r.length>4}const vw=be(Pl,dt,ob,Ke).extend({name:"v-icon",props:{dense:Boolean,disabled:Boolean,left:Boolean,right:Boolean,size:[Number,String],tag:{type:String,required:!1,default:"i"}},computed:{medium(){return!1},hasClickListener(){return!!(this.listeners$.click||this.listeners$["!click"])}},methods:{getIcon(){let r="";return this.$slots.default&&(r=this.$slots.default[0].text.trim()),pz(this,r)},getSize(){const r={xSmall:this.xSmall,small:this.small,medium:this.medium,large:this.large,xLarge:this.xLarge},e=Sm(r).find(t=>r[t]);return e&&Uv[e]||ge(this.size)},getDefaultData(){return{staticClass:"v-icon notranslate",class:{"v-icon--disabled":this.disabled,"v-icon--left":this.left,"v-icon--link":this.hasClickListener,"v-icon--right":this.right,"v-icon--dense":this.dense},attrs:{"aria-hidden":!this.hasClickListener,disabled:this.hasClickListener&&this.disabled,type:this.hasClickListener?"button":void 0,...this.attrs$},on:this.listeners$}},getSvgWrapperData(){const r=this.getSize(),e={...this.getDefaultData(),style:r?{fontSize:r,height:r,width:r}:void 0};return this.applyColors(e),e},applyColors(r){r.class={...r.class,...this.themeClasses},this.setTextColor(this.color,r)},renderFontIcon(r,e){const t=[],s=this.getDefaultData();let n="material-icons";const i=r.indexOf("-"),a=i<=-1;a?t.push(r):(n=r.slice(0,i),LU(n)&&(n="")),s.class[n]=!0,s.class[r]=!a;const o=this.getSize();return o&&(s.style={fontSize:o}),this.applyColors(s),e(this.hasClickListener?"button":this.tag,s,t)},renderSvgIcon(r,e){const t={class:"v-icon__svg",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",role:"img","aria-hidden":!0}},s=this.getSize();return s&&(t.style={fontSize:s,height:s,width:s}),e(this.hasClickListener?"button":"span",this.getSvgWrapperData(),[e("svg",t,[e("path",{attrs:{d:r}})])])},renderSvgIconComponent(r,e){const t={class:{"v-icon__component":!0}},s=this.getSize();s&&(t.style={fontSize:s,height:s,width:s}),this.applyColors(t);const n=r.component;return t.props=r.props,t.nativeOn=t.on,e(this.hasClickListener?"button":"span",this.getSvgWrapperData(),[e(n,t)])}},render(r){const e=this.getIcon();return typeof e=="string"?AU(e)?this.renderSvgIcon(e,r):this.renderFontIcon(e,r):this.renderSvgIconComponent(e,r)}}),w=b.extend({name:"v-icon",$_wrapperFor:vw,functional:!0,render(r,{data:e,children:t}){let s="";return e.domProps&&(s=e.domProps.textContent||e.domProps.innerHTML||s,delete e.domProps.textContent,delete e.domProps.innerHTML),r(vw,e,s?[s]:t)}}),Zo=dt.extend({name:"v-progress-circular",directives:{intersect:pu},props:{button:Boolean,indeterminate:Boolean,rotate:{type:[Number,String],default:0},size:{type:[Number,String],default:32},width:{type:[Number,String],default:4},value:{type:[Number,String],default:0}},data:()=>({radius:20,isVisible:!0}),computed:{calculatedSize(){return Number(this.size)+(this.button?8:0)},circumference(){return 2*Math.PI*this.radius},classes(){return{"v-progress-circular--visible":this.isVisible,"v-progress-circular--indeterminate":this.indeterminate,"v-progress-circular--button":this.button}},normalizedValue(){return this.value<0?0:this.value>100?100:parseFloat(this.value)},strokeDashArray(){return Math.round(this.circumference*1e3)/1e3},strokeDashOffset(){return(100-this.normalizedValue)/100*this.circumference+"px"},strokeWidth(){return Number(this.width)/+this.size*this.viewBoxSize*2},styles(){return{height:ge(this.calculatedSize),width:ge(this.calculatedSize)}},svgStyles(){return{transform:`rotate(${Number(this.rotate)}deg)`}},viewBoxSize(){return this.radius/(1-Number(this.width)/+this.size)}},methods:{genCircle(r,e){return this.$createElement("circle",{class:`v-progress-circular__${r}`,attrs:{fill:"transparent",cx:2*this.viewBoxSize,cy:2*this.viewBoxSize,r:this.radius,"stroke-width":this.strokeWidth,"stroke-dasharray":this.strokeDashArray,"stroke-dashoffset":e}})},genSvg(){const r=[this.indeterminate||this.genCircle("underlay",0),this.genCircle("overlay",this.strokeDashOffset)];return this.$createElement("svg",{style:this.svgStyles,attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:`${this.viewBoxSize} ${this.viewBoxSize} ${2*this.viewBoxSize} ${2*this.viewBoxSize}`}},r)},genInfo(){return this.$createElement("div",{staticClass:"v-progress-circular__info"},me(this))},onObserve(r,e,t){this.isVisible=t}},render(r){return r("div",this.setTextColor(this.color,{staticClass:"v-progress-circular",attrs:{role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":this.indeterminate?void 0:this.normalizedValue},class:this.classes,directives:[{name:"intersect",value:this.onObserve}],style:this.styles,on:this.$listeners}),[this.genSvg(),this.genInfo()])}});function _w(r,e){return()=>lr(`The ${r} component must be used inside a ${e}`)}function Ja(r,e,t){const s=e&&t?{register:_w(e,t),unregister:_w(e,t)}:null;return b.extend({name:"registrable-inject",inject:{[r]:{default:s}}})}function lb(r,e=!1){return b.extend({name:"registrable-provide",provide(){return{[r]:e?this:{register:this.register,unregister:this.unregister}}}})}function Ni(r,e,t){return Ja(r,e,t).extend({name:"groupable",props:{activeClass:{type:String,default(){if(this[r])return this[r].activeClass}},disabled:Boolean},data(){return{isActive:!1}},computed:{groupClasses(){return this.activeClass?{[this.activeClass]:this.isActive}:{}}},created(){this[r]&&this[r].register(this)},beforeDestroy(){this[r]&&this[r].unregister(this)},methods:{toggle(s){if(this.disabled&&s){s.preventDefault();return}this.$emit("change")}}})}Ni("itemGroup");const $s=b.extend({name:"routable",directives:{Ripple:ls},props:{activeClass:String,append:Boolean,disabled:Boolean,exact:{type:Boolean,default:void 0},exactPath:Boolean,exactActiveClass:String,link:Boolean,href:[String,Object],to:[String,Object],nuxt:Boolean,replace:Boolean,ripple:{type:[Boolean,Object],default:null},tag:String,target:String},data:()=>({isActive:!1,proxyClass:""}),computed:{classes(){const r={};return this.to||(this.activeClass&&(r[this.activeClass]=this.isActive),this.proxyClass&&(r[this.proxyClass]=this.isActive)),r},computedRipple(){var r;return(r=this.ripple)!==null&&r!==void 0?r:!this.disabled&&this.isClickable},isClickable(){return this.disabled?!1:!!(this.isLink||this.$listeners.click||this.$listeners["!click"]||this.$attrs.tabindex)},isLink(){return this.to||this.href||this.link},styles:()=>({})},watch:{$route:"onRouteChange"},mounted(){this.onRouteChange()},methods:{generateRouteLink(){let r=this.exact,e;const t={attrs:{tabindex:"tabindex"in this.$attrs?this.$attrs.tabindex:void 0},class:this.classes,style:this.styles,props:{},directives:[{name:"ripple",value:this.computedRipple}],[this.to?"nativeOn":"on"]:{...this.$listeners,..."click"in this?{click:this.click}:void 0},ref:"link"};if(typeof this.exact>"u"&&(r=this.to==="/"||this.to===Object(this.to)&&this.to.path==="/"),this.to){let s=this.activeClass,n=this.exactActiveClass||s;this.proxyClass&&(s=`${s} ${this.proxyClass}`.trim(),n=`${n} ${this.proxyClass}`.trim()),e=this.nuxt?"nuxt-link":"router-link",Object.assign(t.props,{to:this.to,exact:r,exactPath:this.exactPath,activeClass:s,exactActiveClass:n,append:this.append,replace:this.replace})}else e=this.href&&"a"||this.tag||"div",e==="a"&&this.href&&(t.attrs.href=this.href);return this.target&&(t.attrs.target=this.target),{tag:e,data:t}},onRouteChange(){if(!this.to||!this.$refs.link||!this.$route)return;const r=`${this.activeClass||""} ${this.proxyClass||""}`.trim(),e=`${this.exactActiveClass||""} ${this.proxyClass||""}`.trim()||r,t="_vnode.data.class."+(this.exact?e:r);this.$nextTick(()=>{!at(this.$refs.link,t)===this.isActive&&this.toggle()})},toggle(){this.isActive=!this.isActive}}}),EU=be(ut,$s,oU,ob,Ni("btnToggle"),Lm("inputValue")),Fe=EU.extend().extend({name:"v-btn",props:{activeClass:{type:String,default(){return this.btnToggle?this.btnToggle.activeClass:""}},block:Boolean,depressed:Boolean,fab:Boolean,icon:Boolean,loading:Boolean,outlined:Boolean,plain:Boolean,retainFocusOnClick:Boolean,rounded:Boolean,tag:{type:String,default:"button"},text:Boolean,tile:Boolean,type:{type:String,default:"button"},value:null},data:()=>({proxyClass:"v-btn--active"}),computed:{classes(){return{"v-btn":!0,...$s.options.computed.classes.call(this),"v-btn--absolute":this.absolute,"v-btn--block":this.block,"v-btn--bottom":this.bottom,"v-btn--disabled":this.disabled,"v-btn--is-elevated":this.isElevated,"v-btn--fab":this.fab,"v-btn--fixed":this.fixed,"v-btn--has-bg":this.hasBg,"v-btn--icon":this.icon,"v-btn--left":this.left,"v-btn--loading":this.loading,"v-btn--outlined":this.outlined,"v-btn--plain":this.plain,"v-btn--right":this.right,"v-btn--round":this.isRound,"v-btn--rounded":this.rounded,"v-btn--router":this.to,"v-btn--text":this.text,"v-btn--tile":this.tile,"v-btn--top":this.top,...this.themeClasses,...this.groupClasses,...this.elevationClasses,...this.sizeableClasses}},computedElevation(){if(!this.disabled)return i6.options.computed.computedElevation.call(this)},computedRipple(){var r;const e=this.icon||this.fab?{circle:!0}:!0;return this.disabled?!1:(r=this.ripple)!==null&&r!==void 0?r:e},hasBg(){return!this.text&&!this.plain&&!this.outlined&&!this.icon},isElevated(){return!this.icon&&!this.text&&!this.outlined&&!this.depressed&&!this.disabled&&!this.plain&&(this.elevation==null||Number(this.elevation)>0)},isRound(){return!!(this.icon||this.fab)},styles(){return{...this.measurableStyles}}},created(){[["flat","text"],["outline","outlined"],["round","rounded"]].forEach(([e,t])=>{this.$attrs.hasOwnProperty(e)&&Zs(e,t,this)})},methods:{click(r){!this.retainFocusOnClick&&!this.fab&&r.detail&&this.$el.blur(),this.$emit("click",r),this.btnToggle&&this.toggle()},genContent(){return this.$createElement("span",{staticClass:"v-btn__content"},me(this))},genLoader(){return this.$createElement("span",{class:"v-btn__loader"},me(this,"loader")||[this.$createElement(Zo,{props:{indeterminate:!0,size:23,width:2}})])}},render(r){const e=[this.genContent(),this.loading&&this.genLoader()],{tag:t,data:s}=this.generateRouteLink(),n=this.hasBg?this.setBackgroundColor:this.setTextColor;return t==="button"&&(s.attrs.type=this.type,s.attrs.disabled=this.disabled),s.attrs.value=["string","number"].includes(typeof this.value)?this.value:JSON.stringify(this.value),r(t,this.disabled?s:n(this.color,s),e)}}),S6=b.extend({name:"transitionable",props:{mode:String,origin:String,transition:String}}),Vn=be(ut,Vi,S6).extend({name:"v-alert",props:{border:{type:String,validator(r){return["top","right","bottom","left"].includes(r)}},closeLabel:{type:String,default:"$vuetify.close"},coloredBorder:Boolean,dense:Boolean,dismissible:Boolean,closeIcon:{type:String,default:"$cancel"},icon:{default:"",type:[Boolean,String],validator(r){return typeof r=="string"||r===!1}},outlined:Boolean,prominent:Boolean,text:Boolean,type:{type:String,validator(r){return["info","error","success","warning"].includes(r)}},value:{type:Boolean,default:!0}},computed:{__cachedBorder(){if(!this.border)return null;let r={staticClass:"v-alert__border",class:{[`v-alert__border--${this.border}`]:!0}};return this.coloredBorder&&(r=this.setBackgroundColor(this.computedColor,r),r.class["v-alert__border--has-color"]=!0),this.$createElement("div",r)},__cachedDismissible(){if(!this.dismissible)return null;const r=this.iconColor;return this.$createElement(Fe,{staticClass:"v-alert__dismissible",props:{color:r,icon:!0,small:!0},attrs:{"aria-label":this.$vuetify.lang.t(this.closeLabel)},on:{click:()=>this.isActive=!1}},[this.$createElement(w,{props:{color:r}},this.closeIcon)])},__cachedIcon(){return this.computedIcon?this.$createElement(w,{staticClass:"v-alert__icon",props:{color:this.iconColor}},this.computedIcon):null},classes(){const r={...ut.options.computed.classes.call(this),"v-alert--border":!!this.border,"v-alert--dense":this.dense,"v-alert--outlined":this.outlined,"v-alert--prominent":this.prominent,"v-alert--text":this.text};return this.border&&(r[`v-alert--border-${this.border}`]=!0),r},computedColor(){return this.color||this.type},computedIcon(){return this.icon===!1?!1:typeof this.icon=="string"&&this.icon?this.icon:["error","info","success","warning"].includes(this.type)?`$${this.type}`:!1},hasColoredIcon(){return this.hasText||!!this.border&&this.coloredBorder},hasText(){return this.text||this.outlined},iconColor(){return this.hasColoredIcon?this.computedColor:void 0},isDark(){return this.type&&!this.coloredBorder&&!this.outlined?!0:Ke.options.computed.isDark.call(this)}},created(){this.$attrs.hasOwnProperty("outline")&&Zs("outline","outlined",this)},methods:{genWrapper(){const r=[me(this,"prepend")||this.__cachedIcon,this.genContent(),this.__cachedBorder,me(this,"append"),this.$scopedSlots.close?this.$scopedSlots.close({toggle:this.toggle}):this.__cachedDismissible],e={staticClass:"v-alert__wrapper"};return this.$createElement("div",e,r)},genContent(){return this.$createElement("div",{staticClass:"v-alert__content"},me(this))},genAlert(){let r={staticClass:"v-alert",attrs:{role:"alert"},on:this.listeners$,class:this.classes,style:this.styles,directives:[{name:"show",value:this.isActive}]};return this.coloredBorder||(r=(this.hasText?this.setTextColor:this.setBackgroundColor)(this.computedColor,r)),this.$createElement("div",r,[this.genWrapper()])},toggle(){this.isActive=!this.isActive}},render(r){const e=this.genAlert();return this.transition?r("transition",{props:{name:this.transition,origin:this.origin,mode:this.mode}},[e]):e}});function dg(r=[],...e){return Array().concat(r,...e)}function El(r,e="top center 0",t){return{name:r,functional:!0,props:{group:{type:Boolean,default:!1},hideOnLeave:{type:Boolean,default:!1},leaveAbsolute:{type:Boolean,default:!1},mode:{type:String,default:t},origin:{type:String,default:e}},render(s,n){const i=`transition${n.props.group?"-group":""}`,a={props:{name:r,mode:n.props.mode},on:{beforeEnter(o){o.style.transformOrigin=n.props.origin,o.style.webkitTransformOrigin=n.props.origin}}};return n.props.leaveAbsolute&&(a.on.leave=dg(a.on.leave,o=>{const{offsetTop:l,offsetLeft:c,offsetWidth:u,offsetHeight:d}=o;o._transitionInitialStyles={position:o.style.position,top:o.style.top,left:o.style.left,width:o.style.width,height:o.style.height},o.style.position="absolute",o.style.top=l+"px",o.style.left=c+"px",o.style.width=u+"px",o.style.height=d+"px"}),a.on.afterLeave=dg(a.on.afterLeave,o=>{if(o&&o._transitionInitialStyles){const{position:l,top:c,left:u,width:d,height:p}=o._transitionInitialStyles;delete o._transitionInitialStyles,o.style.position=l||"",o.style.top=c||"",o.style.left=u||"",o.style.width=d||"",o.style.height=p||""}})),n.props.hideOnLeave&&(a.on.leave=dg(a.on.leave,o=>{o.style.setProperty("display","none","important")})),s(i,os(n.data,a),n.children)}}}function w6(r,e,t="in-out"){return{name:r,functional:!0,props:{mode:{type:String,default:t}},render(s,n){return s("transition",os(n.data,{props:{name:r},on:e}),n.children)}}}function x6(r="",e=!1){const t=e?"width":"height",s=`offset${wm(t)}`;return{beforeEnter(a){a._parent=a.parentNode,a._initialStyle={transition:a.style.transition,overflow:a.style.overflow,[t]:a.style[t]}},enter(a){const o=a._initialStyle;a.style.setProperty("transition","none","important"),a.style.overflow="hidden";const l=`${a[s]}px`;a.style[t]="0",a.offsetHeight,a.style.transition=o.transition,r&&a._parent&&a._parent.classList.add(r),requestAnimationFrame(()=>{a.style[t]=l})},afterEnter:i,enterCancelled:i,leave(a){a._initialStyle={transition:"",overflow:a.style.overflow,[t]:a.style[t]},a.style.overflow="hidden",a.style[t]=`${a[s]}px`,a.offsetHeight,requestAnimationFrame(()=>a.style[t]="0")},afterLeave:n,leaveCancelled:n};function n(a){r&&a._parent&&a._parent.classList.remove(r),i(a)}function i(a){const o=a._initialStyle[t];a.style.overflow=a._initialStyle.overflow,o!=null&&(a.style[t]=o),delete a._initialStyle}}const OU=El("tab-transition"),TU=El("tab-reverse-transition"),kU=El("fab-transition","center center","out-in"),Ol=El("fade-transition"),DU=El("scale-transition"),MU=El("slide-x-transition"),Zc=w6("expand-transition",x6()),RU=w6("expand-x-transition",x6("",!0)),gr=be(dt,ob,$s,Ke,Ni("chipGroup"),Lm("inputValue")).extend({name:"v-chip",props:{active:{type:Boolean,default:!0},activeClass:{type:String,default(){return this.chipGroup?this.chipGroup.activeClass:""}},close:Boolean,closeIcon:{type:String,default:"$delete"},closeLabel:{type:String,default:"$vuetify.close"},disabled:Boolean,draggable:Boolean,filter:Boolean,filterIcon:{type:String,default:"$complete"},label:Boolean,link:Boolean,outlined:Boolean,pill:Boolean,tag:{type:String,default:"span"},textColor:String,value:null},data:()=>({proxyClass:"v-chip--active"}),computed:{classes(){return{"v-chip":!0,...$s.options.computed.classes.call(this),"v-chip--clickable":this.isClickable,"v-chip--disabled":this.disabled,"v-chip--draggable":this.draggable,"v-chip--label":this.label,"v-chip--link":this.isLink,"v-chip--no-color":!this.color,"v-chip--outlined":this.outlined,"v-chip--pill":this.pill,"v-chip--removable":this.hasClose,...this.themeClasses,...this.sizeableClasses,...this.groupClasses}},hasClose(){return!!this.close},isClickable(){return!!($s.options.computed.isClickable.call(this)||this.chipGroup)}},created(){[["outline","outlined"],["selected","input-value"],["value","active"],["@input","@active.sync"]].forEach(([e,t])=>{this.$attrs.hasOwnProperty(e)&&Zs(e,t,this)})},methods:{click(r){this.$emit("click",r),this.chipGroup&&this.toggle()},genFilter(){const r=[];return this.isActive&&r.push(this.$createElement(w,{staticClass:"v-chip__filter",props:{left:!0}},this.filterIcon)),this.$createElement(RU,r)},genClose(){return this.$createElement(w,{staticClass:"v-chip__close",props:{right:!0,size:18},attrs:{"aria-label":this.$vuetify.lang.t(this.closeLabel)},on:{click:r=>{r.stopPropagation(),r.preventDefault(),this.$emit("click:close"),this.$emit("update:active",!1)}}},this.closeIcon)},genContent(){return this.$createElement("span",{staticClass:"v-chip__content"},[this.filter&&this.genFilter(),me(this),this.hasClose&&this.genClose()])}},render(r){const e=[this.genContent()];let{tag:t,data:s}=this.generateRouteLink();s.attrs={...s.attrs,draggable:this.draggable?"true":void 0,tabindex:this.chipGroup&&!this.disabled?0:s.attrs.tabindex},s.directives.push({name:"show",value:this.active}),s=this.setBackgroundColor(this.color,s);const n=this.textColor||this.outlined&&this.color;return r(t,this.setTextColor(n,s),e)}}),C6=Ke.extend({name:"v-theme-provider",props:{root:Boolean},computed:{isDark(){return this.root?this.rootIsDark:Ke.options.computed.isDark.call(this)}},render(){return this.$slots.default&&this.$slots.default.find(r=>!r.isComment&&r.text!==" ")}}),Am=b.extend().extend({name:"delayable",props:{openDelay:{type:[Number,String],default:0},closeDelay:{type:[Number,String],default:0}},data:()=>({openTimeout:void 0,closeTimeout:void 0}),methods:{clearDelay(){clearTimeout(this.openTimeout),clearTimeout(this.closeTimeout)},runDelay(r,e){this.clearDelay();const t=parseInt(this[`${r}Delay`],10);this[`${r}Timeout`]=setTimeout(e||(()=>{this.isActive={open:!0,close:!1}[r]}),t)}}}),IU=be(Am,Vi),_d=IU.extend({name:"activatable",props:{activator:{default:null,validator:r=>["string","object"].includes(typeof r)},disabled:Boolean,internalActivator:Boolean,openOnClick:{type:Boolean,default:!0},openOnHover:Boolean,openOnFocus:Boolean},data:()=>({activatorElement:null,activatorNode:[],events:["click","mouseenter","mouseleave","focus"],listeners:{}}),watch:{activator:"resetActivator",openOnFocus:"resetActivator",openOnHover:"resetActivator"},mounted(){const r=B4(this,"activator");r&&["v-slot","normal"].includes(r)&&Ns(`The activator slot must be bound, try '