@swipefindercom/finder-sdk 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- (function(){if(typeof document!=="undefined"){var s=document.createElement("style");s.textContent="._card_doqsx_2{position:absolute;width:100%;height:100%;left:0;top:0;background-color:#fff;box-shadow:0 2px 8px #0003;overflow:hidden;transition:transform .3s ease;cursor:default;transform-origin:50% 100%;will-change:transform;z-index:1}._cardContent_doqsx_18{position:absolute;z-index:2;bottom:0;left:0;width:100%;height:100%;color:#fff}._gradientBottom_doqsx_29{position:absolute;z-index:1;bottom:0;left:0;width:100%;height:120px;background:linear-gradient(transparent,#000);pointer-events:none}._gradientTop_doqsx_41{position:absolute;z-index:1;top:0;left:0;width:100%;height:120px;background:linear-gradient(rgba(0,0,0,1),transparent);pointer-events:none}._cardName_doqsx_52{position:absolute;left:0;bottom:10%;font-weight:700;font-size:22px;padding:0 20px;text-shadow:1px 1px 2px rgba(0,0,0,.8);width:100%;text-align:left;white-space:pre-wrap}._image_trs4h_2{width:100%;height:100%;object-fit:cover}._videoContainer_119iz_3{width:100%;height:100%;position:relative;overflow:hidden}._cardVideo_119iz_10{width:100%;height:100%;object-fit:cover;position:absolute;top:0;left:0;z-index:1}._swipeableCard_14c6z_1{position:relative;width:100%;height:100%;will-change:transform,opacity;backface-visibility:hidden;-webkit-backface-visibility:hidden;touch-action:none;user-select:none;-webkit-user-select:none;pointer-events:auto}._swipeableCard_14c6z_1>*{pointer-events:none}._swipeableCard_14c6z_1 video,._swipeableCard_14c6z_1 img{pointer-events:none}._swipeHeadline_14c6z_25{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);font-size:24px;font-weight:700;color:#fff;z-index:200000}._ctaTooltip_1mai4_2{position:absolute;z-index:110;font-size:12px;top:0;right:-2px;background-color:#fff;color:#333;padding:10px 14px;border-radius:8px;font-weight:800;text-align:center;width:max-content;transition:opacity .3s ease;pointer-events:none;animation:_ctaTooltipBounce_1mai4_1 2s infinite;box-shadow:0 0 16px 1px #000;white-space:pre-line}._ctaTooltipArrow_1mai4_22{position:absolute;bottom:-8px;width:16px;height:16px;transform:translate(50%) rotate(45deg);z-index:0}@keyframes _ctaTooltipBounce_1mai4_1{0%,20%,50%,80%,to{transform:translateY(calc(-100% - 16px))}40%{transform:translateY(calc(-100% - 24px))}60%{transform:translateY(calc(-100% - 20px))}}._verticalEmojisButtons_14t5d_2{position:absolute;display:flex;flex-direction:column;align-items:center;z-index:100}._buttonContainer_14t5d_11{display:flex;flex-direction:column;align-items:center;justify-content:center;margin:8px 0}._button_14t5d_11{width:40px;height:40px;border-radius:50%;display:flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:0 2px 5px #0003;background-color:#fff;position:relative;-webkit-user-select:none;user-select:none;transition:transform .2s ease,background-color .2s ease;outline:none;border:none;-webkit-tap-highlight-color:transparent}._button_14t5d_11:focus,._button_14t5d_11:active{outline:none;border:none}._emojiIcon_14t5d_45{width:35px;height:35px;display:block;outline:none;pointer-events:none;position:relative;z-index:2}._buttonLabel_14t5d_56{white-space:pre-wrap;margin-top:5px}._buttonAnimation_14t5d_62{transform:scale(1.3);z-index:101;position:relative}._buttonAnimation_14t5d_62:before{content:\"\";position:absolute;top:-5px;left:-5px;right:-5px;bottom:-5px;border-radius:50%;border:5px solid rgba(255,255,255,.5);z-index:1}._buttonLikeAnimation_14t5d_80{background-color:#4cd964!important;transform:scale(1.3)!important}._buttonDislikeAnimation_14t5d_85{background-color:#ff3b30!important;transform:scale(1.3)!important}._buttonMaybeAnimation_14t5d_90{background-color:#fc0!important;transform:scale(1.3)!important}._buttonSeenAnimation_14t5d_95{background-color:#007aff!important;transform:scale(1.3)!important}._contrastMode_14t5d_101 ._buttonContainer_14t5d_11{display:flex;flex-direction:column;align-items:center;justify-content:center;margin:8px 0}._contrastModeButton_14t5d_109{background-color:#fffc!important;border:2px solid black!important;box-shadow:0 0 8px #00000080!important}._contrastModeButton_14t5d_109:hover{background-color:#fff!important}._contrastModeLabel_14t5d_119{color:#fff!important;text-shadow:1px 1px 3px black,-1px -1px 3px black,1px -1px 3px black,-1px 1px 3px black!important;font-weight:700!important;font-size:12px!important;text-align:center!important;display:block!important;margin-top:5px!important;text-transform:uppercase}._contrastModeLike_14t5d_130,._contrastModeDislike_14t5d_135,._contrastModeMaybe_14t5d_140,._contrastModeSeen_14t5d_145{color:#fff!important;filter:brightness(1.5)!important}._sideButtonsContainer_jjr9u_2{position:absolute;width:100%;height:100%;left:0;top:0;display:flex;justify-content:center;align-items:center;z-index:100;pointer-events:none}._sideButtonsWrapper_jjr9u_16{position:relative;width:100%;height:100%;display:grid;grid-template-columns:1fr auto 1fr;grid-template-rows:auto 1fr auto;padding:15px;box-sizing:border-box}._sideButtonContainer_jjr9u_28{display:flex;align-items:center;flex-direction:column;gap:4px}._sideButtonLeft_jjr9u_36{grid-column:1;grid-row:2;margin-right:auto;justify-self:start;align-self:center}._sideButtonRight_jjr9u_45{grid-column:3;grid-row:2;margin-left:auto;justify-self:end;align-self:center}._sideButtonTop_jjr9u_54{grid-column:2;grid-row:1;justify-self:center;align-self:start}._sideButtonBottom_jjr9u_62{grid-column:2;grid-row:3;justify-self:center;align-self:end}._sideButton_jjr9u_2{border-radius:50%;display:flex;flex-direction:column;align-items:center;justify-content:center;border:2px solid rgba(255,255,255,.4);background-color:#ffffffb3;backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);box-shadow:0 4px 12px #0000004d;transition:all .3s ease;-webkit-tap-highlight-color:transparent;pointer-events:auto;padding:0;margin:0;gap:4px}._sideButton_jjr9u_2:hover{border-color:#fff;background-color:#ffffffe6}._buttonContent_jjr9u_95{position:relative;display:flex;align-items:center;justify-content:center}._arrowWrapper_jjr9u_103,._emojiWrapper_jjr9u_104{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center}._arrowWrapper_jjr9u_103 svg{color:#000}._arrowRight_jjr9u_120{transform:rotate(0)}._arrowLeft_jjr9u_124{transform:rotate(180deg)}._arrowUp_jjr9u_128{transform:rotate(-90deg)}._arrowDown_jjr9u_132{transform:rotate(90deg)}._emojiIcon_jjr9u_137{pointer-events:none;user-select:none;-webkit-user-select:none}._buttonLabel_jjr9u_144{white-space:pre-wrap;text-align:center;color:#000;font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:.1em;line-height:1.2;user-select:none;-webkit-user-select:none;margin-top:0}@keyframes _moveRight_jjr9u_1{0%{transform:rotate(0) translate(0);opacity:.7}10%{transform:rotate(0) translate(6px);opacity:1}15%{transform:rotate(0) translate(12px);opacity:1}20%{transform:rotate(0) translate(12px);opacity:1}25%{transform:rotate(0) translate(0);opacity:.7}25.01%,to{transform:rotate(0) translate(0);opacity:.7}}@keyframes _moveLeft_jjr9u_1{0%,24.99%{transform:rotate(180deg) translate(0);opacity:.7}25%{transform:rotate(180deg) translate(0);opacity:.7}35%{transform:rotate(180deg) translate(6px);opacity:1}40%{transform:rotate(180deg) translate(12px);opacity:1}45%{transform:rotate(180deg) translate(12px);opacity:1}50%{transform:rotate(180deg) translate(0);opacity:.7}50.01%,to{transform:rotate(180deg) translate(0);opacity:.7}}@keyframes _moveUp_jjr9u_1{0%,49.99%{transform:rotate(-90deg) translate(0);opacity:.7}50%{transform:rotate(-90deg) translate(0);opacity:.7}60%{transform:rotate(-90deg) translate(6px);opacity:1}65%{transform:rotate(-90deg) translate(12px);opacity:1}70%{transform:rotate(-90deg) translate(12px);opacity:1}75%{transform:rotate(-90deg) translate(0);opacity:.7}75.01%,to{transform:rotate(-90deg) translate(0);opacity:.7}}@keyframes _moveDown_jjr9u_1{0%,74.99%{transform:rotate(90deg) translate(0);opacity:.7}75%{transform:rotate(90deg) translate(0);opacity:.7}85%{transform:rotate(90deg) translate(6px);opacity:1}90%{transform:rotate(90deg) translate(12px);opacity:1}95%{transform:rotate(90deg) translate(12px);opacity:1}to{transform:rotate(90deg) translate(0);opacity:.7}}._sideButton_jjr9u_2.like-btn ._arrowWrapper_jjr9u_103 svg._arrowRight_jjr9u_120{animation:_moveRight_jjr9u_1 8s infinite}._sideButton_jjr9u_2.dislike-btn ._arrowWrapper_jjr9u_103 svg._arrowLeft_jjr9u_124{animation:_moveLeft_jjr9u_1 8s infinite}._sideButton_jjr9u_2.maybe-btn ._arrowWrapper_jjr9u_103 svg._arrowUp_jjr9u_128{animation:_moveUp_jjr9u_1 8s infinite}._sideButton_jjr9u_2.seen-btn ._arrowWrapper_jjr9u_103 svg._arrowDown_jjr9u_132{animation:_moveDown_jjr9u_1 8s infinite}._horizontalCtaTooltip_1slua_1{position:absolute;transform:translate(-50%) translateY(-25%);left:50%;padding:10px 15px;border-radius:6px;font-weight:500;text-align:center;z-index:100;transition:opacity .3s ease;box-shadow:0 2px 8px #0003;animation:_horizontalCtaTooltipPulse_1slua_1 2s infinite ease-in-out;white-space:pre-line;background-color:#fff;color:#333;font-size:12px}._contrastMode_1slua_19 ._horizontalCtaTooltip_1slua_1{background-color:#00000080;color:#fff;border:1px solid white;font-weight:600}@keyframes _horizontalCtaTooltipPulse_1slua_1{0%{transform:translate(-50%) translateY(-25%) scale(1)}50%{transform:translate(-50%) translateY(-25%) scale(1.1)}to{transform:translate(-50%) translateY(-25%) scale(1)}}._sideButtonsContainer_1kkly_2{position:absolute;width:100%;height:100%;left:0;top:0;display:flex;justify-content:center;align-items:center;z-index:100;pointer-events:none}._sideButtonsWrapper_1kkly_16{position:relative;width:100%;height:100%;display:grid;grid-template-columns:1fr auto 1fr;grid-template-rows:auto 1fr auto;padding:15px;box-sizing:border-box}._sideButtonContainer_1kkly_28{display:flex;align-items:center;flex-direction:column;gap:4px}._sideButtonLeft_1kkly_36{grid-column:1;grid-row:2;margin-right:auto;justify-self:start;align-self:center}._sideButtonRight_1kkly_45{grid-column:3;grid-row:2;margin-left:auto;justify-self:end;align-self:center}._sideButtonTop_1kkly_54{grid-column:2;grid-row:1;justify-self:center;align-self:start}._sideButtonBottom_1kkly_62{grid-column:2;grid-row:3;justify-self:center;align-self:end}._sideButton_1kkly_2{border-radius:50%;display:flex;flex-direction:column;align-items:center;justify-content:center;border:2px solid rgba(255,255,255,.4);background-color:#ffffffb3;backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);box-shadow:0 4px 12px #0000004d;transition:all .3s ease;-webkit-tap-highlight-color:transparent;pointer-events:auto;padding:0;margin:0;gap:4px;-webkit-touch-callout:none;-webkit-user-select:none;touch-action:manipulation;cursor:pointer}._sideButton_1kkly_2:hover{border-color:#fff;background-color:#ffffffe6}._buttonContent_1kkly_99{position:relative;display:flex;align-items:center;justify-content:center}._buttonContent_1kkly_99 svg{color:#000}._buttonLabel_1kkly_111{white-space:pre-wrap;text-align:center;color:#000;font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:.1em;line-height:1.2;user-select:none;-webkit-user-select:none;margin-top:0}._arrowRight_1kkly_126{transform:rotate(0)}._arrowLeft_1kkly_130{transform:rotate(180deg)}._arrowUp_1kkly_134{transform:rotate(-90deg)}._arrowDown_1kkly_138{transform:rotate(90deg)}@keyframes _moveRight_1kkly_1{0%{transform:rotate(0) translate(0);opacity:.7}10%{transform:rotate(0) translate(6px);opacity:1}15%{transform:rotate(0) translate(12px);opacity:1}20%{transform:rotate(0) translate(12px);opacity:1}25%{transform:rotate(0) translate(0);opacity:.7}25.01%,to{transform:rotate(0) translate(0);opacity:.7}}@keyframes _moveLeft_1kkly_1{0%,24.99%{transform:rotate(180deg) translate(0);opacity:.7}25%{transform:rotate(180deg) translate(0);opacity:.7}35%{transform:rotate(180deg) translate(6px);opacity:1}40%{transform:rotate(180deg) translate(12px);opacity:1}45%{transform:rotate(180deg) translate(12px);opacity:1}50%{transform:rotate(180deg) translate(0);opacity:.7}50.01%,to{transform:rotate(180deg) translate(0);opacity:.7}}@keyframes _moveUp_1kkly_1{0%,49.99%{transform:rotate(-90deg) translate(0);opacity:.7}50%{transform:rotate(-90deg) translate(0);opacity:.7}60%{transform:rotate(-90deg) translate(6px);opacity:1}65%{transform:rotate(-90deg) translate(12px);opacity:1}70%{transform:rotate(-90deg) translate(12px);opacity:1}75%{transform:rotate(-90deg) translate(0);opacity:.7}75.01%,to{transform:rotate(-90deg) translate(0);opacity:.7}}@keyframes _moveDown_1kkly_1{0%,74.99%{transform:rotate(90deg) translate(0);opacity:.7}75%{transform:rotate(90deg) translate(0);opacity:.7}85%{transform:rotate(90deg) translate(6px);opacity:1}90%{transform:rotate(90deg) translate(12px);opacity:1}95%{transform:rotate(90deg) translate(12px);opacity:1}to{transform:rotate(90deg) translate(0);opacity:.7}}._sideButton_1kkly_2.like-btn ._buttonContent_1kkly_99 svg._arrowRight_1kkly_126{animation:_moveRight_1kkly_1 8s infinite}._sideButton_1kkly_2.dislike-btn ._buttonContent_1kkly_99 svg._arrowLeft_1kkly_130{animation:_moveLeft_1kkly_1 8s infinite}._sideButton_1kkly_2.maybe-btn ._buttonContent_1kkly_99 svg._arrowUp_1kkly_134{animation:_moveUp_1kkly_1 8s infinite}._sideButton_1kkly_2.seen-btn ._buttonContent_1kkly_99 svg._arrowDown_1kkly_138{animation:_moveDown_1kkly_1 8s infinite}._tooltipWrapper_1kkly_277{grid-column:2;grid-row:2;display:flex;align-items:center;justify-content:center}._swipeTutorialOverlay_jbb64_2{position:absolute;width:100%;height:100%;left:0;top:0;display:flex;justify-content:center;align-items:center;z-index:100;pointer-events:none}._handContainer_jbb64_16{display:flex;align-items:center;justify-content:center;pointer-events:none}._handIcon_jbb64_24{filter:drop-shadow(0 4px 8px rgba(0,0,0,.3));opacity:.9}._swipeableFeed_jamse_1{position:relative;width:100%;height:100%;overflow:hidden}._swipeableFeedCards_jamse_8{position:relative;width:100%;height:100%}._swipeableFeedCards_jamse_8>*{position:absolute;top:0;left:0;width:100%;height:100%}._swipeableFeedEmpty_jamse_22{display:flex;align-items:center;justify-content:center;width:100%;height:100%;color:#666;font-size:16px;text-align:center}._swipeTutorialContainer_jamse_33{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;z-index:150}._volumeControl_r52gg_2{position:absolute;z-index:1100;display:flex;align-items:center;gap:8px;margin:0}._volumeControlTopLeft_r52gg_12{top:10px;left:10px}._volumeControlTopRight_r52gg_17{top:10px;right:10px;flex-direction:row-reverse}._volumeControlBottomLeft_r52gg_23{bottom:80px;left:15px}._volumeControlBottomRight_r52gg_28{bottom:80px;right:15px;flex-direction:row-reverse}._volumeControlButton_r52gg_34{width:auto;height:30px;cursor:pointer;background-color:#0006;border-radius:50%;transition:background-color .2s ease;display:flex;align-items:center;justify-content:center;padding:4px;box-sizing:border-box;flex-shrink:0}._volumeControlButton_r52gg_34:hover{background-color:#000000b3}._volumeControlButton_r52gg_34 img{width:100%;height:100%;object-fit:contain}._volumeSlider_r52gg_60{background-color:#0006;border-radius:20px;padding:8px 12px;display:flex;align-items:center;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);opacity:0;pointer-events:none;transition:opacity .2s ease}._volumeSlider_r52gg_60:hover{background-color:#000000b3}._volumeControl_r52gg_2:hover ._volumeSlider_r52gg_60{opacity:1;pointer-events:auto}._volumeSliderInput_r52gg_81{width:100px;height:4px;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:#ffffff4d;border-radius:2px;outline:none;cursor:pointer}._volumeSliderInput_r52gg_81::-webkit-slider-thumb{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:12px;height:12px;border-radius:50%;background:#fff;cursor:pointer;transition:transform .1s ease}._volumeSliderInput_r52gg_81::-webkit-slider-thumb:hover{transform:scale(1.2)}._volumeSliderInput_r52gg_81::-moz-range-thumb{width:12px;height:12px;border-radius:50%;background:#fff;cursor:pointer;border:none;transition:transform .1s ease}._volumeSliderInput_r52gg_81::-moz-range-thumb:hover{transform:scale(1.2)}._historyButton_1xf6c_1{border-radius:50%;border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;z-index:1000;box-shadow:16px 20px 8px #00000026,inset -4px -4px 10px #0003;background-image:linear-gradient(135deg,#fff3,#0003);outline:none;-webkit-tap-highlight-color:transparent;-webkit-appearance:none;-moz-appearance:none;appearance:none}._historyCardsContent_1xf6c_17{margin:12px 0}._historyButton_1xf6c_1:focus{outline:none}._historyButton_1xf6c_1:active{outline:none;-webkit-tap-highlight-color:transparent}._historyButton_1xf6c_1:focus-visible{outline:none}._historyButton_1xf6c_1 img{pointer-events:none}._tooltip_1xf6c_39{display:flex;z-index:110;line-height:1.2;padding:10px 14px;position:absolute;top:0;border-radius:8px;font-weight:800;text-align:center;width:max-content;transition:opacity .3s ease;box-shadow:0 0 16px 1px #000;left:50%;white-space:pre-line;transform:translate(-50%) translateY(calc(-100% - 16px));animation:_historyButtonTooltipBounce_1xf6c_1 2s infinite}._tooltipArrow_1xf6c_59{position:absolute;bottom:-8px;left:50%;width:16px;height:16px;transform:translate(-50%) rotate(45deg);z-index:0}@keyframes _historyButtonTooltipBounce_1xf6c_1{0%,20%,50%,80%,to{transform:translate(-50%) translateY(calc(-100% - 16px))}40%{transform:translate(-50%) translateY(calc(-100% - 24px))}60%{transform:translate(-50%) translateY(calc(-100% - 20px))}}._drawerOverlay_1eftt_2{position:fixed;top:0;left:0;right:0;bottom:0;background-color:#00000080;z-index:999;opacity:0;visibility:hidden;transition:opacity .5s ease,visibility .5s ease}._drawerOverlayScoped_1eftt_16{position:absolute;top:0;left:0;right:0;bottom:0}._drawerOverlayVisible_1eftt_24{opacity:1;visibility:visible}._drawer_1eftt_2{position:fixed;bottom:0;left:0;right:0;height:80%;background:#fff;border-radius:20px 20px 0 0;z-index:1000;transform:translateY(100%);transition:transform .6s cubic-bezier(.25,.46,.45,.94);box-shadow:0 -8px 32px #0003;display:flex;flex-direction:column;overflow:hidden}._drawerScoped_1eftt_48{position:absolute;bottom:0;left:0;right:0}._drawerOpen_1eftt_55{transform:translateY(0)}._drawerHandle_1eftt_60{width:40px;height:4px;background-color:#0003;border-radius:2px;margin:12px auto 8px;flex-shrink:0;transition:background-color .2s ease}._drawerHandle_1eftt_60:hover{background-color:#0000004d}._drawerEmojisContainer_1eftt_75{display:flex;justify-content:space-between;padding:16px 20px;border-bottom:1px solid rgba(0,0,0,.1);flex-shrink:0}._drawerEmojiItem_1eftt_84{display:flex;flex-direction:column;align-items:center;gap:8px}._drawerEmojiItemActive_1eftt_91 ._drawerEmojiLabel_1eftt_91{color:#000;font-weight:700}._drawerEmojiButton_1eftt_97{display:flex;align-items:center;justify-content:center;padding:0;border-radius:50%;background:#fffc;border:2px solid rgba(0,0,0,.2);cursor:pointer;transition:all .3s ease;width:50px;height:50px;box-shadow:0 2px 8px #00000026;-webkit-tap-highlight-color:transparent}._drawerEmojiButtonActive_1eftt_113{background:#fff;border:3px solid rgba(0,0,0,.6);box-shadow:0 4px 12px #00000040;transform:scale(1.1)}._drawerEmojiLikeActive_1eftt_125{border-color:#4caf50;background:#4caf5026;box-shadow:0 4px 12px #4caf504d}._drawerEmojiDislikeActive_1eftt_135{border-color:#f44336;background:#f4433626;box-shadow:0 4px 12px #f443364d}._drawerEmojiMaybeActive_1eftt_145{border-color:#ff9800;background:#ff980026;box-shadow:0 4px 12px #ff98004d}._drawerEmojiSeenActive_1eftt_155{border-color:#2196f3;background:#2196f326;box-shadow:0 4px 12px #2196f34d}._drawerEmojiIcon_1eftt_162{width:32px;height:32px;object-fit:contain}._drawerEmojiLabel_1eftt_91{font-size:11px;font-weight:600;color:#000c;text-align:center;line-height:1.2;text-transform:uppercase;letter-spacing:.5px;white-space:pre-wrap}._drawerEmojiLike_1eftt_121:hover{border-color:#4caf50;background:#4caf501a}._drawerEmojiDislike_1eftt_131:hover{border-color:#f44336;background:#f443361a}._drawerEmojiMaybe_1eftt_141:hover{border-color:#ff9800;background:#ff98001a}._drawerEmojiSeen_1eftt_151:hover{border-color:#2196f3;background:#2196f31a}._drawerContent_1eftt_202{flex:1;padding:20px;-webkit-overflow-scrolling:touch;overflow-y:auto}._drawerCloseButton_1eftt_210{background:linear-gradient(135deg,#ff6b6b,#ee5a52);color:#fff;border:none;padding:12px 24px;margin:20px;border-radius:25px;font-size:16px;font-weight:600;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:8px;transition:all .3s ease;box-shadow:0 4px 16px #ff6b6b4d;outline:none;-webkit-tap-highlight-color:transparent;-webkit-appearance:none;-moz-appearance:none;appearance:none;align-self:center;min-height:48px;white-space:pre-wrap}._drawerCloseButton_1eftt_210:hover{transform:translateY(-2px);box-shadow:0 6px 20px #ff6b6b66}._drawerCloseButton_1eftt_210:active{transform:translateY(0);box-shadow:0 2px 8px #ff6b6b4d}._drawerCloseButton_1eftt_210:focus{outline:none}._drawerCloseButton_1eftt_210:focus-visible{outline:2px solid rgba(255,107,107,.5);outline-offset:2px}._drawerCloseIcon_1eftt_255{width:16px;height:16px;filter:brightness(0) invert(1)}@media (max-width: 768px){._drawer_1eftt_2{height:80%;border-radius:30px 30px 0 0}._drawerContent_1eftt_202{padding:16px}._drawerCloseButton_1eftt_210{margin:16px;padding:10px 20px;font-size:14px}}@media (max-width: 480px){._drawer_1eftt_2{height:80%;border-radius:30px 30px 0 0}._drawerContent_1eftt_202{padding:12px}._drawerCloseButton_1eftt_210{margin:12px;font-size:14px}}._cardListContainer_zrmnf_2{padding:20px;overscroll-behavior-y:contain;touch-action:pan-y;overflow-y:auto;height:100%;box-sizing:border-box}._cardListContainerNoPadding_zrmnf_11{padding:0;box-sizing:border-box}._summaryGridContainer_zrmnf_17{display:grid;grid-template-columns:1fr 1fr;gap:12px;padding:20px;box-sizing:border-box}._summaryGridItem_zrmnf_26{aspect-ratio:1;border-radius:8px;overflow:hidden;background:#0000000d;cursor:default}._summaryGridItemClickable_zrmnf_34{cursor:pointer}._gridPlaceholder_zrmnf_39{width:100%;height:100%;background:#f2f2f2;display:flex;align-items:center;justify-content:center;font-size:12px;color:#181818}._gridItemImage_zrmnf_51{width:100%;height:100%;object-fit:cover}._summaryCardItem_zrmnf_58{display:flex;gap:8px;padding:12px;border-radius:8px;background:#f2f2f2;color:#181818;margin-bottom:8px;align-items:center;cursor:default}._summaryCardItemClickable_zrmnf_70{cursor:pointer}._cardItemImage_zrmnf_75{width:60px;height:60px;border-radius:6px;object-fit:cover;flex-shrink:0}._cardItemPlaceholder_zrmnf_84{width:60px;height:60px;border-radius:6px;background:#d9d9d9;display:flex;align-items:center;justify-content:center;font-size:12px;color:#00000080;flex-shrink:0}._cardItemContent_zrmnf_98{flex:1;min-width:0;display:flex;flex-direction:column;justify-content:center}._cardItemTitle_zrmnf_107{margin:0 0 2px;font-size:14px;font-weight:600;line-height:1.2;text-align:left}._cardItemPrice_zrmnf_116{margin:0;font-size:12px;color:#000000b3;line-height:1.2}._summaryContainer_1gtok_3{display:flex;flex-direction:column;height:100%;width:100%;background-color:#fff;overflow:hidden;position:relative}._summaryShareButtonFixed_1gtok_14{position:absolute;bottom:10px;right:10px;width:45px;height:45px;font-size:12px;text-transform:uppercase;border-radius:50%;background-color:#2196f3;color:#fff;border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;box-shadow:0 4px 12px #00000026;transition:all .3s ease;z-index:1000;-webkit-tap-highlight-color:transparent}._summaryShareButtonFixed_1gtok_14:hover{background-color:#1976d2;box-shadow:0 6px 16px #0003;transform:scale(1.05)}._summaryShareButtonFixed_1gtok_14:active{transform:scale(.95);box-shadow:0 2px 8px #00000026}._summaryShareButtonFixed_1gtok_14 ._shareIcon_1gtok_47{width:24px;height:24px;filter:brightness(0) invert(1)}._summaryExplaination_1gtok_54{gap:8px;padding:12px;border-radius:8px;align-items:center;margin:12px 20px 0;font-size:14px;font-weight:600;line-height:1.2;text-align:center;justify-content:center;white-space:pre-wrap;background:#f2f2f2;color:#181818}._summaryTabs_1gtok_71{display:flex;justify-content:center;padding:16px 20px;background-color:#f5f5f5;border-bottom:1px solid #e0e0e0}._summaryTab_1gtok_71{display:flex;flex-direction:column;align-items:center;cursor:pointer;transition:all .3s ease;text-align:center;padding:0 5px;-webkit-tap-highlight-color:transparent}._summaryEmojiItem_1gtok_96{display:flex;flex-direction:column;align-items:center;gap:8px}._summaryEmojiButton_1gtok_108{display:flex;align-items:center;justify-content:center;padding:0;border-radius:50%;background:#fffc;border:2px solid rgba(0,0,0,.2);cursor:pointer;transition:all .3s ease;width:40px;height:40px;box-shadow:0 2px 8px #00000026;-webkit-tap-highlight-color:transparent}._summaryEmojiButtonActive_1gtok_124{background:#fff;border:3px solid rgba(0,0,0,.6);box-shadow:0 4px 12px #00000040;transform:scale(1.1)}._summaryEmojiLikeActive_1gtok_136{border-color:#4caf50;background:#4caf5026;box-shadow:0 4px 12px #4caf504d}._summaryEmojiDislikeActive_1gtok_146{border-color:#f44336;background:#f4433626;box-shadow:0 4px 12px #f443364d}._summaryEmojiMaybeActive_1gtok_156{border-color:#ff9800;background:#ff980026;box-shadow:0 4px 12px #ff98004d}._summaryEmojiSeenActive_1gtok_166{border-color:#2196f3;background:#2196f326;box-shadow:0 4px 12px #2196f34d}._summaryEmojiLike_1gtok_132:hover{border-color:#4caf50;background:#4caf501a}._summaryEmojiDislike_1gtok_142:hover{border-color:#f44336;background:#f443361a}._summaryEmojiMaybe_1gtok_152:hover{border-color:#ff9800;background:#ff98001a}._summaryEmojiSeen_1gtok_162:hover{border-color:#2196f3;background:#2196f31a}._summaryEmojiIcon_1gtok_194{width:28px;height:28px;object-fit:contain}._summaryEmojiLabel_1gtok_201{font-size:11px;font-weight:600;color:#000c;text-align:center;line-height:1.2;text-transform:uppercase;letter-spacing:.5px}._summaryEmojiItemActive_1gtok_103 ._summaryEmojiLabel_1gtok_201{color:#000;font-weight:700}._summaryContent_1gtok_217{flex:1;overflow:hidden;position:relative;background-color:#fff;min-height:0}._summaryPanel_1gtok_226{display:none;position:absolute;top:0;left:0;right:0;bottom:0;height:100%;width:100%;overflow-y:auto;min-height:0;box-sizing:border-box;overscroll-behavior:contain}._summaryPanelActive_1gtok_241{display:block}._summaryEmptyState_1gtok_246{text-align:center;padding:40px 20px;color:#181818}._summaryEmptyStateText_1gtok_252{margin:0 0 16px;font-size:18px;font-weight:600}._historyDrawerContent_x0jj6_1,._historyDrawerContent_x0jj6_1 .summary-container{height:100%;display:flex;flex-direction:column;overflow:hidden}._historyDrawerEmpty_x0jj6_15{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;padding:40px 20px;text-align:center;color:#666}._historyDrawerEmpty_x0jj6_15 p{margin:8px 0;font-size:16px}._historyDrawerEmptyHint_x0jj6_31{font-size:14px;color:#999}._historyDrawerTitle_x0jj6_36{margin:0 0 16px;padding:20px 20px 0;font-size:20px;font-weight:700;color:#333}._historyDrawerList_x0jj6_44{height:100%;display:flex;flex-direction:column;overflow:hidden}._historyDrawerList_x0jj6_44 .card-list-container{flex:1;overflow-y:auto}._historyDrawerGrouped_x0jj6_56{height:100%;display:flex;flex-direction:column;overflow-y:auto}._historyDrawerGroup_x0jj6_56{margin-bottom:24px}._historyDrawerGroup_x0jj6_56:last-child{margin-bottom:0}._historyDrawerGroupTitle_x0jj6_71{margin:0 0 12px;padding:20px 20px 0;font-size:18px;font-weight:700;color:#333}._historyDrawerGroup_x0jj6_56:first-child ._historyDrawerGroupTitle_x0jj6_71{padding-top:20px}._historyDrawerGroup_x0jj6_56 .card-list-container{padding-top:0}._historyDrawer_x0jj6_1 .drawer-content{padding:20px 0}._historyDrawer_x0jj6_1 .drawer-content .summary-tabs,._historyDrawer_x0jj6_1 .drawer-content .summary-content{background-color:transparent!important}._filtersButton_qio2f_1{position:absolute;z-index:1000;min-width:80px;height:40px;padding:8px 16px;border:none;border-radius:20px;cursor:pointer;display:flex;align-items:center;justify-content:center;outline:none;-webkit-tap-highlight-color:transparent;-webkit-appearance:none;-moz-appearance:none;appearance:none;font-size:14px;font-weight:500;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;text-align:center;white-space:pre-wrap;background-image:linear-gradient(135deg,#ffffff1a,#0000001a);transition:all .3s ease;box-shadow:0 4px 8px #00000026}._filtersButton_qio2f_1:hover{box-shadow:0 6px 12px #0003;transform:translateY(-1px)}._filtersButton_qio2f_1:active{transform:translateY(1px);box-shadow:0 2px 4px #00000026}._filtersButton_qio2f_1:focus{outline:none}._filtersButton_qio2f_1:focus-visible{outline:none}._filtersLeft_qio2f_46{left:20px;right:auto}._filtersMiddle_qio2f_51{left:50%;right:auto;transform:translate(-50%)}._filtersRight_qio2f_57{left:auto;right:20px}._filtersIcon_qio2f_63{pointer-events:none;flex-shrink:0}._content_hci8k_2{padding:12px 20px}._title_hci8k_7{margin:0 0 12px;font-size:16px;font-weight:600;color:#333;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;white-space:pre-wrap}._categories_hci8k_17{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:0}._pill_hci8k_25{display:inline-flex;align-items:center;padding:6px 12px;border-radius:20px;cursor:pointer;font-size:13px;font-weight:500;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;transition:all .2s ease;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}._noCategories_hci8k_40{width:100%;color:#999;font-style:italic;text-align:center;padding:20px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}._cardsCounter_1h26d_1{width:100%;text-align:left;font-size:14px;font-weight:700;color:#fff;text-shadow:1px 1px 2px rgba(0,0,0,.8);padding:5px 5px 5px 21px;pointer-events:none;white-space:pre-wrap}._logo_1rzq2_1{display:block;height:auto;max-width:100%;-webkit-user-select:none;user-select:none;pointer-events:none}._container_18bki_1{position:absolute}._interactiveFeed_1wsuw_1,._swippingJourney_15509_1{position:relative;width:100%;height:100%;overflow:hidden}._mainBootstrap_1rzog_1{width:100%;height:100%;position:relative}:root{--media-object-fit: cover}*{margin:0;padding:0;box-sizing:border-box;font-family:Arial,sans-serif}body{touch-action:pan-y;-webkit-user-select:none;user-select:none}";document.head.appendChild(s);}})();"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),e=require("react"),n=e.createContext({});function i(t){const n=e.useRef(null);return null===n.current&&(n.current=t()),n.current}const s=e.createContext(null),o=e.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});const r="undefined"!=typeof window,a=r?e.useLayoutEffect:e.useEffect,l=t=>t;let c=l,u=l;"production"!==process.env.NODE_ENV&&(c=(t,e)=>{},u=(t,e)=>{if(!t)throw new Error(e)});const d=!1;const A=["read","resolveKeyframes","update","preRender","render","postRender"];function h(t,e){let n=!1,i=!0;const s={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,r=A.reduce((t,e)=>(t[e]=function(t){let e=new Set,n=new Set,i=!1,s=!1;const o=new WeakSet;let r={delta:0,timestamp:0,isProcessing:!1};function a(e){o.has(e)&&(l.schedule(e),t()),e(r)}const l={schedule:(t,s=!1,r=!1)=>{const a=r&&i?e:n;return s&&o.add(t),a.has(t)||a.add(t),t},cancel:t=>{n.delete(t),o.delete(t)},process:t=>{r=t,i?s=!0:(i=!0,[e,n]=[n,e],e.forEach(a),e.clear(),i=!1,s&&(s=!1,l.process(t)))}};return l}(o),t),{}),{read:a,resolveKeyframes:l,update:c,preRender:u,render:d,postRender:h}=r,m=()=>{const o=performance.now();n=!1,s.delta=i?1e3/60:Math.max(Math.min(o-s.timestamp,40),1),s.timestamp=o,s.isProcessing=!0,a.process(s),l.process(s),c.process(s),u.process(s),d.process(s),h.process(s),s.isProcessing=!1,n&&e&&(i=!1,t(m))};return{schedule:A.reduce((e,o)=>{const a=r[o];return e[o]=(e,o=!1,r=!1)=>(n||(n=!0,i=!0,s.isProcessing||t(m)),a.schedule(e,o,r)),e},{}),cancel:t=>{for(let e=0;e<A.length;e++)r[A[e]].cancel(t)},state:s,steps:r}}const{schedule:m,cancel:p,state:g,steps:f}=h("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:l,!0),v=e.createContext({strict:!1}),y={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},x={};for(const lu in y)x[lu]={isEnabled:t=>y[lu].some(e=>!!t[e])};const w=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function C(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||w.has(t)}let b=t=>!C(t);try{(B=require("@emotion/is-prop-valid").default)&&(b=t=>t.startsWith("on")?!C(t):B(t))}catch(au){}var B;const E=new Set;function D(t,e,n){t||E.has(e)||E.add(e)}function I(t){if("undefined"==typeof Proxy)return t;const e=new Map;return new Proxy((...e)=>("production"!==process.env.NODE_ENV&&D(!1,"motion() is deprecated. Use motion.create() instead."),t(...e)),{get:(n,i)=>"create"===i?t:(e.has(i)||e.set(i,t(i)),e.get(i))})}const S=e.createContext({});function O(t){return"string"==typeof t||Array.isArray(t)}function M(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}const j=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],k=["initial",...j];function Q(t){return M(t.animate)||k.some(e=>O(t[e]))}function T(t){return Boolean(Q(t)||t.variants)}function P(t){const{initial:n,animate:i}=function(t,e){if(Q(t)){const{initial:e,animate:n}=t;return{initial:!1===e||O(e)?e:void 0,animate:O(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,e.useContext(S));return e.useMemo(()=>({initial:n,animate:i}),[R(n),R(i)])}function R(t){return Array.isArray(t)?t.join(" "):t}const H=Symbol.for("motionComponentSymbol");function V(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function N(t,n,i){return e.useCallback(e=>{e&&t.onMount&&t.onMount(e),n&&(e?n.mount(e):n.unmount()),i&&("function"==typeof i?i(e):V(i)&&(i.current=e))},[n])}const U=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),F="data-"+U("framerAppearId"),{schedule:q}=h(queueMicrotask,!1),z=e.createContext({});function L(t,n,i,r,l){var c,u;const{visualElement:d}=e.useContext(S),A=e.useContext(v),h=e.useContext(s),m=e.useContext(o).reducedMotion,p=e.useRef(null);r=r||A.renderer,!p.current&&r&&(p.current=r(t,{visualState:n,parent:d,props:i,presenceContext:h,blockInitialAnimation:!!h&&!1===h.initial,reducedMotionConfig:m}));const g=p.current,f=e.useContext(z);!g||g.projection||!l||"html"!==g.type&&"svg"!==g.type||function(t,e,n,i){const{layoutId:s,layout:o,drag:r,dragConstraints:a,layoutScroll:l,layoutRoot:c}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:W(t.parent)),t.projection.setOptions({layoutId:s,layout:o,alwaysMeasureLayout:Boolean(r)||a&&V(a),visualElement:t,animationType:"string"==typeof o?o:"both",initialPromotionConfig:i,layoutScroll:l,layoutRoot:c})}(p.current,i,l,f);const y=e.useRef(!1);e.useInsertionEffect(()=>{g&&y.current&&g.update(i,h)});const x=i[F],w=e.useRef(Boolean(x)&&!(null===(c=window.MotionHandoffIsComplete)||void 0===c?void 0:c.call(window,x))&&(null===(u=window.MotionHasOptimisedAnimation)||void 0===u?void 0:u.call(window,x)));return a(()=>{g&&(y.current=!0,window.MotionIsMounted=!0,g.updateFeatures(),q.render(g.render),w.current&&g.animationState&&g.animationState.animateChanges())}),e.useEffect(()=>{g&&(!w.current&&g.animationState&&g.animationState.animateChanges(),w.current&&(queueMicrotask(()=>{var t;null===(t=window.MotionHandoffMarkAsComplete)||void 0===t||t.call(window,x)}),w.current=!1))}),g}function W(t){if(t)return!1!==t.options.allowProjection?t.projection:W(t.parent)}function Y({preloadedFeatures:n,createVisualElement:i,useRender:s,useVisualState:a,Component:l}){var d,A;function h(d,A){let h;const m={...e.useContext(o),...d,layoutId:G(d)},{isStatic:p}=m,g=P(d),f=a(d,p);if(!p&&r){!function(t,n){const i=e.useContext(v).strict;if("production"!==process.env.NODE_ENV&&n&&i){const e="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";t.ignoreStrict?c(!1,e):u(!1,e)}}(m,n);const t=function(t){const{drag:e,layout:n}=x;if(!e&&!n)return{};const i={...e,...n};return{MeasureLayout:(null==e?void 0:e.isEnabled(t))||(null==n?void 0:n.isEnabled(t))?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}(m);h=t.MeasureLayout,g.visualElement=L(l,f,m,i,t.ProjectionNode)}return t.jsxs(S.Provider,{value:g,children:[h&&g.visualElement?t.jsx(h,{visualElement:g.visualElement,...m}):null,s(l,d,N(f,g.visualElement,A),f,p,g.visualElement)]})}n&&function(t){for(const e in t)x[e]={...x[e],...t[e]}}(n),h.displayName=`motion.${"string"==typeof l?l:`create(${null!==(A=null!==(d=l.displayName)&&void 0!==d?d:l.name)&&void 0!==A?A:""})`}`;const m=e.forwardRef(h);return m[H]=l,m}function G({layoutId:t}){const i=e.useContext(n).id;return i&&void 0!==t?i+"-"+t:t}const K=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function X(t){return"string"==typeof t&&!t.includes("-")&&!!(K.indexOf(t)>-1||/[A-Z]/u.test(t))}function Z(t){const e=[{},{}];return null==t||t.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function J(t,e,n,i){if("function"==typeof e){const[s,o]=Z(i);e=e(void 0!==n?n:t.custom,s,o)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[s,o]=Z(i);e=e(void 0!==n?n:t.custom,s,o)}return e}const _=t=>Array.isArray(t),$=t=>_(t)?t[t.length-1]||0:t,tt=t=>Boolean(t&&t.getVelocity);function et(t){const e=tt(t)?t.get():t;return n=e,Boolean(n&&"object"==typeof n&&n.mix&&n.toValue)?e.toValue():e;var n}const nt=t=>(n,o)=>{const r=e.useContext(S),a=e.useContext(s),l=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e,onUpdate:n},i,s,o){const r={latestValues:it(i,s,o,t),renderState:e()};return n&&(r.onMount=t=>n({props:i,current:t,...r}),r.onUpdate=t=>n(t)),r}(t,n,r,a);return o?l():i(l)};function it(t,e,n,i){const s={},o=i(t,{});for(const A in o)s[A]=et(o[A]);let{initial:r,animate:a}=t;const l=Q(t),c=T(t);e&&c&&!l&&!1!==t.inherit&&(void 0===r&&(r=e.initial),void 0===a&&(a=e.animate));let u=!!n&&!1===n.initial;u=u||!1===r;const d=u?a:r;if(d&&"boolean"!=typeof d&&!M(d)){const e=Array.isArray(d)?d:[d];for(let n=0;n<e.length;n++){const i=J(t,e[n]);if(i){const{transitionEnd:t,transition:e,...n}=i;for(const i in n){let t=n[i];if(Array.isArray(t)){t=t[u?t.length-1:0]}null!==t&&(s[i]=t)}for(const i in t)s[i]=t[i]}}}return s}const st=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ot=new Set(st),rt=t=>e=>"string"==typeof e&&e.startsWith(t),at=rt("--"),lt=rt("var(--"),ct=t=>!!lt(t)&&ut.test(t.split("/*")[0].trim()),ut=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,dt=(t,e)=>e&&"number"==typeof t?e.transform(t):t,At=(t,e,n)=>n>e?e:n<t?t:n,ht={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},mt={...ht,transform:t=>At(0,1,t)},pt={...ht,default:1},gt=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),ft=gt("deg"),vt=gt("%"),yt=gt("px"),xt=gt("vh"),wt=gt("vw"),Ct={...vt,parse:t=>vt.parse(t)/100,transform:t=>vt.transform(100*t)},bt={borderWidth:yt,borderTopWidth:yt,borderRightWidth:yt,borderBottomWidth:yt,borderLeftWidth:yt,borderRadius:yt,radius:yt,borderTopLeftRadius:yt,borderTopRightRadius:yt,borderBottomRightRadius:yt,borderBottomLeftRadius:yt,width:yt,maxWidth:yt,height:yt,maxHeight:yt,top:yt,right:yt,bottom:yt,left:yt,padding:yt,paddingTop:yt,paddingRight:yt,paddingBottom:yt,paddingLeft:yt,margin:yt,marginTop:yt,marginRight:yt,marginBottom:yt,marginLeft:yt,backgroundPositionX:yt,backgroundPositionY:yt},Bt={rotate:ft,rotateX:ft,rotateY:ft,rotateZ:ft,scale:pt,scaleX:pt,scaleY:pt,scaleZ:pt,skew:ft,skewX:ft,skewY:ft,distance:yt,translateX:yt,translateY:yt,translateZ:yt,x:yt,y:yt,z:yt,perspective:yt,transformPerspective:yt,opacity:mt,originX:Ct,originY:Ct,originZ:yt},Et={...ht,transform:Math.round},Dt={...bt,...Bt,zIndex:Et,size:yt,fillOpacity:mt,strokeOpacity:mt,numOctaves:Et},It={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},St=st.length;function Ot(t,e,n){const{style:i,vars:s,transformOrigin:o}=t;let r=!1,a=!1;for(const l in e){const t=e[l];if(ot.has(l))r=!0;else if(at(l))s[l]=t;else{const e=dt(t,Dt[l]);l.startsWith("origin")?(a=!0,o[l]=e):i[l]=e}}if(e.transform||(r||n?i.transform=function(t,e,n){let i="",s=!0;for(let o=0;o<St;o++){const r=st[o],a=t[r];if(void 0===a)continue;let l=!0;if(l="number"==typeof a?a===(r.startsWith("scale")?1:0):0===parseFloat(a),!l||n){const t=dt(a,Dt[r]);l||(s=!1,i+=`${It[r]||r}(${t}) `),n&&(e[r]=t)}}return i=i.trim(),n?i=n(e,s?"":i):s&&(i="none"),i}(e,t.transform,n):i.transform&&(i.transform="none")),a){const{originX:t="50%",originY:e="50%",originZ:n=0}=o;i.transformOrigin=`${t} ${e} ${n}`}}const Mt={offset:"stroke-dashoffset",array:"stroke-dasharray"},jt={offset:"strokeDashoffset",array:"strokeDasharray"};function kt(t,e,n){return"string"==typeof t?t:yt.transform(e+n*t)}function Qt(t,{attrX:e,attrY:n,attrScale:i,originX:s,originY:o,pathLength:r,pathSpacing:a=1,pathOffset:l=0,...c},u,d){if(Ot(t,c,d),u)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:A,style:h,dimensions:m}=t;A.transform&&(m&&(h.transform=A.transform),delete A.transform),m&&(void 0!==s||void 0!==o||h.transform)&&(h.transformOrigin=function(t,e,n){return`${kt(e,t.x,t.width)} ${kt(n,t.y,t.height)}`}(m,void 0!==s?s:.5,void 0!==o?o:.5)),void 0!==e&&(A.x=e),void 0!==n&&(A.y=n),void 0!==i&&(A.scale=i),void 0!==r&&function(t,e,n=1,i=0,s=!0){t.pathLength=1;const o=s?Mt:jt;t[o.offset]=yt.transform(-i);const r=yt.transform(e),a=yt.transform(n);t[o.array]=`${r} ${a}`}(A,r,a,l,!1)}const Tt=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),Pt=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),Rt=t=>"string"==typeof t&&"svg"===t.toLowerCase();function Ht(t,{style:e,vars:n},i,s){Object.assign(t.style,e,s&&s.getProjectionStyles(i));for(const o in n)t.style.setProperty(o,n[o])}const Vt=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Nt(t,e,n,i){Ht(t,e,void 0,i);for(const s in e.attrs)t.setAttribute(Vt.has(s)?s:U(s),e.attrs[s])}const Ut={};function Ft(t,{layout:e,layoutId:n}){return ot.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!Ut[t]||"opacity"===t)}function qt(t,e,n){var i;const{style:s}=t,o={};for(const r in s)(tt(s[r])||e.style&&tt(e.style[r])||Ft(r,t)||void 0!==(null===(i=null==n?void 0:n.getValue(r))||void 0===i?void 0:i.liveStyle))&&(o[r]=s[r]);return o}function zt(t,e,n){const i=qt(t,e,n);for(const s in t)if(tt(t[s])||tt(e[s])){i[-1!==st.indexOf(s)?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s]=t[s]}return i}const Lt=["x","y","width","height","cx","cy","r"],Wt={useVisualState:nt({scrapeMotionValuesFromProps:zt,createRenderState:Pt,onUpdate:({props:t,prevProps:e,current:n,renderState:i,latestValues:s})=>{if(!n)return;let o=!!t.drag;if(!o)for(const a in s)if(ot.has(a)){o=!0;break}if(!o)return;let r=!e;if(e)for(let a=0;a<Lt.length;a++){const n=Lt[a];t[n]!==e[n]&&(r=!0)}r&&m.read(()=>{!function(t,e){try{e.dimensions="function"==typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}catch(n){e.dimensions={x:0,y:0,width:0,height:0}}}(n,i),m.render(()=>{Qt(i,s,Rt(n.tagName),t.transformTemplate),Nt(n,i)})})}})},Yt={useVisualState:nt({scrapeMotionValuesFromProps:qt,createRenderState:Tt})};function Gt(t,e,n){for(const i in e)tt(e[i])||Ft(i,n)||(t[i]=e[i])}function Kt(t,n){const i={};return Gt(i,t.style||{},t),Object.assign(i,function({transformTemplate:t},n){return e.useMemo(()=>{const e={style:{},transform:{},transformOrigin:{},vars:{}};return Ot(e,n,t),Object.assign({},e.vars,e.style)},[n])}(t,n)),i}function Xt(t,e){const n={},i=Kt(t,e);return t.drag&&!1!==t.dragListener&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=i,n}function Zt(t,n,i,s){const o=e.useMemo(()=>{const e={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return Qt(e,n,Rt(s),t.transformTemplate),{...e.attrs,style:{...e.style}}},[n]);if(t.style){const e={};Gt(e,t.style,t),o.style={...e,...o.style}}return o}function Jt(t=!1){return(n,i,s,{latestValues:o},r)=>{const a=(X(n)?Zt:Xt)(i,o,r,n),l=function(t,e,n){const i={};for(const s in t)"values"===s&&"object"==typeof t.values||(b(s)||!0===n&&C(s)||!e&&!C(s)||t.draggable&&s.startsWith("onDrag"))&&(i[s]=t[s]);return i}(i,"string"==typeof n,t),c=n!==e.Fragment?{...l,...a,ref:s}:{},{children:u}=i,d=e.useMemo(()=>tt(u)?u.get():u,[u]);return e.createElement(n,{...c,children:d})}}function _t(t,e){return function(n,{forwardMotionProps:i}={forwardMotionProps:!1}){return Y({...X(n)?Wt:Yt,preloadedFeatures:t,useRender:Jt(i),createVisualElement:e,Component:n})}}function $t(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let i=0;i<n;i++)if(e[i]!==t[i])return!1;return!0}function te(t,e,n){const i=t.getProps();return J(i,e,void 0!==n?n:i.custom,t)}function ee(t,e){return t?t[e]||t.default||t:void 0}const ne=new Set(["width","height","top","left","right","bottom",...st]);let ie;function se(){ie=void 0}const oe={now:()=>(void 0===ie&&oe.set(g.isProcessing||d?g.timestamp:performance.now()),ie),set:t=>{ie=t,queueMicrotask(se)}};function re(t,e){-1===t.indexOf(e)&&t.push(e)}function ae(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class le{constructor(){this.subscriptions=[]}add(t){return re(this.subscriptions,t),()=>ae(this.subscriptions,t)}notify(t,e,n){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,n);else for(let s=0;s<i;s++){const i=this.subscriptions[s];i&&i(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function ce(t,e){return e?t*(1e3/e):0}const ue={current:void 0};class de{constructor(t,e={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(t,e=!0)=>{const n=oe.now();this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),e&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=oe.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return"production"!==process.env.NODE_ENV&&D(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new le);const n=this.events[t].add(e);return"change"===t?()=>{n(),m.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return ue.current&&ue.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=oe.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return ce(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Ae(t,e){return new de(t,e)}function he(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Ae(n))}function me(t,e){const n=te(t,e);let{transitionEnd:i={},transition:s={},...o}=n||{};o={...o,...i};for(const r in o){he(t,r,$(o[r]))}}function pe(t,e){const n=t.getValue("willChange");if(i=n,Boolean(tt(i)&&i.add))return n.add(e);var i}function ge(t){return t.props[F]}function fe(t){let e;return()=>(void 0===e&&(e=t()),e)}const ve=fe(()=>void 0!==window.ScrollTimeline);class ye{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;n<this.animations.length;n++)this.animations[n][t]=e}attachTimeline(t,e){const n=this.animations.map(n=>ve()&&n.attachTimeline?n.attachTimeline(t):"function"==typeof e?e(n):void 0);return()=>{n.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let e=0;e<this.animations.length;e++)t=Math.max(t,this.animations[e].duration);return t}runAll(t){this.animations.forEach(e=>e[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class xe extends ye{then(t,e){return Promise.all(this.animations).then(t).catch(e)}}const we=t=>1e3*t,Ce=t=>t/1e3;function be(t){return"function"==typeof t}function Be(t,e){t.timeline=e,t.onfinish=null}const Ee=t=>Array.isArray(t)&&"number"==typeof t[0],De={linearEasing:void 0};function Ie(t,e){const n=fe(t);return()=>{var t;return null!==(t=De[e])&&void 0!==t?t:n()}}const Se=Ie(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),Oe=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i},Me=(t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let o=0;o<s;o++)i+=t(Oe(0,s-1,o))+", ";return`linear(${i.substring(0,i.length-2)})`};function je(t){return Boolean("function"==typeof t&&Se()||!t||"string"==typeof t&&(t in Qe||Se())||Ee(t)||Array.isArray(t)&&t.every(je))}const ke=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,Qe={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ke([0,.65,.55,1]),circOut:ke([.55,0,1,.45]),backIn:ke([.31,.01,.66,-.59]),backOut:ke([.33,1.53,.69,.99])};function Te(t,e){return t?"function"==typeof t&&Se()?Me(t,e):Ee(t)?ke(t):Array.isArray(t)?t.map(t=>Te(t,e)||Qe.easeOut):Qe[t]:void 0}const Pe=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function Re(t,e,n,i){if(t===e&&n===i)return l;const s=e=>function(t,e,n,i,s){let o,r,a=0;do{r=e+(n-e)/2,o=Pe(r,i,s)-t,o>0?n=r:e=r}while(Math.abs(o)>1e-7&&++a<12);return r}(e,0,1,t,n);return t=>0===t||1===t?t:Pe(s(t),e,i)}const He=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Ve=t=>e=>1-t(1-e),Ne=Re(.33,1.53,.69,.99),Ue=Ve(Ne),Fe=He(Ue),qe=t=>(t*=2)<1?.5*Ue(t):.5*(2-Math.pow(2,-10*(t-1))),ze=t=>1-Math.sin(Math.acos(t)),Le=Ve(ze),We=He(ze),Ye=t=>/^0[^.\s]+$/u.test(t);function Ge(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||Ye(t))}const Ke=t=>Math.round(1e5*t)/1e5,Xe=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const Ze=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Je=(t,e)=>n=>Boolean("string"==typeof n&&Ze.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),_e=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[s,o,r,a]=i.match(Xe);return{[t]:parseFloat(s),[e]:parseFloat(o),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},$e={...ht,transform:t=>Math.round((t=>At(0,255,t))(t))},tn={test:Je("rgb","red"),parse:_e("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+$e.transform(t)+", "+$e.transform(e)+", "+$e.transform(n)+", "+Ke(mt.transform(i))+")"};const en={test:Je("#"),parse:function(t){let e="",n="",i="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,i+=i,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}},transform:tn.transform},nn={test:Je("hsl","hue"),parse:_e("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+vt.transform(Ke(e))+", "+vt.transform(Ke(n))+", "+Ke(mt.transform(i))+")"},sn={test:t=>tn.test(t)||en.test(t)||nn.test(t),parse:t=>tn.test(t)?tn.parse(t):nn.test(t)?nn.parse(t):en.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?tn.transform(t):nn.transform(t)},on=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const rn="number",an="color",ln=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function cn(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let o=0;const r=e.replace(ln,t=>(sn.test(t)?(i.color.push(o),s.push(an),n.push(sn.parse(t))):t.startsWith("var(")?(i.var.push(o),s.push("var"),n.push(t)):(i.number.push(o),s.push(rn),n.push(parseFloat(t))),++o,"${}")).split("${}");return{values:n,split:r,indexes:i,types:s}}function un(t){return cn(t).values}function dn(t){const{split:e,types:n}=cn(t),i=e.length;return t=>{let s="";for(let o=0;o<i;o++)if(s+=e[o],void 0!==t[o]){const e=n[o];s+=e===rn?Ke(t[o]):e===an?sn.transform(t[o]):t[o]}return s}}const An=t=>"number"==typeof t?0:t;const hn={test:function(t){var e,n;return isNaN(t)&&"string"==typeof t&&((null===(e=t.match(Xe))||void 0===e?void 0:e.length)||0)+((null===(n=t.match(on))||void 0===n?void 0:n.length)||0)>0},parse:un,createTransformer:dn,getAnimatableNone:function(t){const e=un(t);return dn(t)(e.map(An))}},mn=new Set(["brightness","contrast","saturate","opacity"]);function pn(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(Xe)||[];if(!i)return t;const s=n.replace(i,"");let o=mn.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+s+")"}const gn=/\b([a-z-]*)\(.*?\)/gu,fn={...hn,getAnimatableNone:t=>{const e=t.match(gn);return e?e.map(pn).join(" "):t}},vn={...Dt,color:sn,backgroundColor:sn,outlineColor:sn,fill:sn,stroke:sn,borderColor:sn,borderTopColor:sn,borderRightColor:sn,borderBottomColor:sn,borderLeftColor:sn,filter:fn,WebkitFilter:fn},yn=t=>vn[t];function xn(t,e){let n=yn(t);return n!==fn&&(n=hn),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const wn=new Set(["auto","none","0"]);const Cn=t=>t===ht||t===yt,bn=(t,e)=>parseFloat(t.split(", ")[e]),Bn=(t,e)=>(n,{transform:i})=>{if("none"===i||!i)return 0;const s=i.match(/^matrix3d\((.+)\)$/u);if(s)return bn(s[1],e);{const e=i.match(/^matrix\((.+)\)$/u);return e?bn(e[1],t):0}},En=new Set(["x","y","z"]),Dn=st.filter(t=>!En.has(t));const In={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:Bn(4,13),y:Bn(5,14)};In.translateX=In.x,In.translateY=In.y;const Sn=new Set;let On=!1,Mn=!1;function jn(){if(Mn){const t=Array.from(Sn).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),n=new Map;e.forEach(t=>{const e=function(t){const e=[];return Dn.forEach(n=>{const i=t.getValue(n);void 0!==i&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e}(t);e.length&&(n.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=n.get(t);e&&e.forEach(([e,n])=>{var i;null===(i=t.getValue(e))||void 0===i||i.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}Mn=!1,On=!1,Sn.forEach(t=>t.complete()),Sn.clear()}function kn(){Sn.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Mn=!0)})}class Qn{constructor(t,e,n,i,s,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Sn.add(this),On||(On=!0,m.read(kn),m.resolveKeyframes(jn))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:i}=this;for(let s=0;s<t.length;s++)if(null===t[s])if(0===s){const s=null==i?void 0:i.get(),o=t[t.length-1];if(void 0!==s)t[0]=s;else if(n&&e){const i=n.readValue(e,o);null!=i&&(t[0]=i)}void 0===t[0]&&(t[0]=o),i&&void 0===s&&i.set(t[0])}else t[s]=t[s-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Sn.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Sn.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Tn=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),Pn=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Rn(t,e,n=1){u(n<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);const[i,s]=function(t){const e=Pn.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${null!=n?n:i}`,s]}(t);if(!i)return;const o=window.getComputedStyle(e).getPropertyValue(i);if(o){const t=o.trim();return Tn(t)?parseFloat(t):t}return ct(s)?Rn(s,e,n+1):s}const Hn=t=>e=>e.test(t),Vn=[ht,yt,vt,ft,wt,xt,{test:t=>"auto"===t,parse:t=>t}],Nn=t=>Vn.find(Hn(t));class Un extends Qn{constructor(t,e,n,i,s){super(t,e,n,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let a=0;a<t.length;a++){let n=t[a];if("string"==typeof n&&(n=n.trim(),ct(n))){const i=Rn(n,e.current);void 0!==i&&(t[a]=i),a===t.length-1&&(this.finalKeyframe=n)}}if(this.resolveNoneKeyframes(),!ne.has(n)||2!==t.length)return;const[i,s]=t,o=Nn(i),r=Nn(s);if(o!==r)if(Cn(o)&&Cn(r))for(let a=0;a<t.length;a++){const e=t[a];"string"==typeof e&&(t[a]=parseFloat(e))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let i=0;i<t.length;i++)Ge(t[i])&&n.push(i);n.length&&function(t,e,n){let i,s=0;for(;s<t.length&&!i;){const e=t[s];"string"==typeof e&&!wn.has(e)&&cn(e).values.length&&(i=t[s]),s++}if(i&&n)for(const o of e)t[o]=xn(n,i)}(t,n,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=In[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const i=e[e.length-1];void 0!==i&&t.getValue(n,i).jump(i,!1)}measureEndState(){var t;const{element:e,name:n,unresolvedKeyframes:i}=this;if(!e||!e.current)return;const s=e.getValue(n);s&&s.jump(this.measuredOrigin,!1);const o=i.length-1,r=i[o];i[o]=In[n](e.measureViewportBox(),window.getComputedStyle(e.current)),null!==r&&void 0===this.finalKeyframe&&(this.finalKeyframe=r),(null===(t=this.removedTransforms)||void 0===t?void 0:t.length)&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}}const Fn=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!hn.test(t)&&"0"!==t||t.startsWith("url(")));const qn=t=>null!==t;function zn(t,{repeat:e,repeatType:n="loop"},i){const s=t.filter(qn),o=e&&"loop"!==n&&e%2==1?0:s.length-1;return o&&void 0!==i?i:s[o]}class Ln{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:o="loop",...r}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=oe.now(),this.options={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:s,repeatType:o,...r},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return this._resolved||this.hasAttemptedResolve||(kn(),jn()),this._resolved}onKeyframesResolved(t,e){this.resolvedAt=oe.now(),this.hasAttemptedResolve=!0;const{name:n,type:i,velocity:s,delay:o,onComplete:r,onUpdate:a,isGenerator:l}=this.options;if(!l&&!function(t,e,n,i){const s=t[0];if(null===s)return!1;if("display"===e||"visibility"===e)return!0;const o=t[t.length-1],r=Fn(s,e),a=Fn(o,e);return c(r===a,`You are trying to animate ${e} from "${s}" to "${o}". ${s} is not an animatable value - to enable this animation set ${s} to a value animatable to ${o} via the \`style\` property.`),!(!r||!a)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}(t)||("spring"===n||be(n))&&i)}(t,n,i,s)){if(!o)return a&&a(zn(t,this.options,e)),r&&r(),void this.resolveFinishedPromise();this.options.duration=0}const u=this.initPlayback(t,e);!1!==u&&(this._resolved={keyframes:t,finalKeyframe:e,...u},this.onPostResolved())}onPostResolved(){}then(t,e){return this.currentFinishedPromise.then(t,e)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const Wn=2e4;function Yn(t){let e=0;let n=t.next(e);for(;!n.done&&e<Wn;)e+=50,n=t.next(e);return e>=Wn?1/0:e}const Gn=(t,e,n)=>t+(e-t)*n;function Kn(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Xn(t,e){return n=>n>0?e:t}const Zn=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},Jn=[en,tn,nn];function _n(t){const e=(n=t,Jn.find(t=>t.test(n)));var n;if(c(Boolean(e),`'${t}' is not an animatable color. Use the equivalent color code instead.`),!Boolean(e))return!1;let i=e.parse(t);return e===nn&&(i=function({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let s=0,o=0,r=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;s=Kn(a,i,t+1/3),o=Kn(a,i,t),r=Kn(a,i,t-1/3)}else s=o=r=n;return{red:Math.round(255*s),green:Math.round(255*o),blue:Math.round(255*r),alpha:i}}(i)),i}const $n=(t,e)=>{const n=_n(t),i=_n(e);if(!n||!i)return Xn(t,e);const s={...n};return t=>(s.red=Zn(n.red,i.red,t),s.green=Zn(n.green,i.green,t),s.blue=Zn(n.blue,i.blue,t),s.alpha=Gn(n.alpha,i.alpha,t),tn.transform(s))},ti=(t,e)=>n=>e(t(n)),ei=(...t)=>t.reduce(ti),ni=new Set(["none","hidden"]);function ii(t,e){return n=>Gn(t,e,n)}function si(t){return"number"==typeof t?ii:"string"==typeof t?ct(t)?Xn:sn.test(t)?$n:ai:Array.isArray(t)?oi:"object"==typeof t?sn.test(t)?$n:ri:Xn}function oi(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>si(t)(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=s[e](t);return n}}function ri(t,e){const n={...t,...e},i={};for(const s in n)void 0!==t[s]&&void 0!==e[s]&&(i[s]=si(t[s])(t[s],e[s]));return t=>{for(const e in i)n[e]=i[e](t);return n}}const ai=(t,e)=>{const n=hn.createTransformer(e),i=cn(t),s=cn(e);return i.indexes.var.length===s.indexes.var.length&&i.indexes.color.length===s.indexes.color.length&&i.indexes.number.length>=s.indexes.number.length?ni.has(t)&&!s.values.length||ni.has(e)&&!i.values.length?function(t,e){return ni.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):ei(oi(function(t,e){var n;const i=[],s={color:0,var:0,number:0};for(let o=0;o<e.values.length;o++){const r=e.types[o],a=t.indexes[r][s[r]],l=null!==(n=t.values[a])&&void 0!==n?n:0;i[o]=l,s[r]++}return i}(i,s),s.values),n):(c(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),Xn(t,e))};function li(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return Gn(t,e,n);return si(t)(t,e)}function ci(t,e,n){const i=Math.max(e-5,0);return ce(n-t(i),e-i)}const ui=100,di=10,Ai=1,hi=0,mi=800,pi=.3,gi=.3,fi={granular:.01,default:2},vi={granular:.005,default:.5},yi=.01,xi=10,wi=.05,Ci=1,bi=.001;function Bi({duration:t=mi,bounce:e=pi,velocity:n=hi,mass:i=Ai}){let s,o;c(t<=we(xi),"Spring duration must be 10 seconds or less");let r=1-e;r=At(wi,Ci,r),t=At(yi,xi,Ce(t)),r<1?(s=e=>{const i=e*r,s=i*t,o=i-n,a=Di(e,r),l=Math.exp(-s);return bi-o/a*l},o=e=>{const i=e*r*t,o=i*n+n,a=Math.pow(r,2)*Math.pow(e,2)*t,l=Math.exp(-i),c=Di(Math.pow(e,2),r);return(-s(e)+bi>0?-1:1)*((o-a)*l)/c}):(s=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,o=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let i=n;for(let s=1;s<Ei;s++)i-=t(i)/e(i);return i}(s,o,5/t);if(t=we(t),isNaN(a))return{stiffness:ui,damping:di,duration:t};{const e=Math.pow(a,2)*i;return{stiffness:e,damping:2*r*Math.sqrt(i*e),duration:t}}}const Ei=12;function Di(t,e){return t*Math.sqrt(1-e*e)}const Ii=["duration","bounce"],Si=["stiffness","damping","mass"];function Oi(t,e){return e.some(e=>void 0!==t[e])}function Mi(t=gi,e=pi){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:s}=n;const o=n.keyframes[0],r=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:l,damping:c,mass:u,duration:d,velocity:A,isResolvedFromDuration:h}=function(t){let e={velocity:hi,stiffness:ui,damping:di,mass:Ai,isResolvedFromDuration:!1,...t};if(!Oi(t,Si)&&Oi(t,Ii))if(t.visualDuration){const n=t.visualDuration,i=2*Math.PI/(1.2*n),s=i*i,o=2*At(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:Ai,stiffness:s,damping:o}}else{const n=Bi(t);e={...e,...n,mass:Ai},e.isResolvedFromDuration=!0}return e}({...n,velocity:-Ce(n.velocity||0)}),m=A||0,p=c/(2*Math.sqrt(l*u)),g=r-o,f=Ce(Math.sqrt(l/u)),v=Math.abs(g)<5;let y;if(i||(i=v?fi.granular:fi.default),s||(s=v?vi.granular:vi.default),p<1){const t=Di(f,p);y=e=>{const n=Math.exp(-p*f*e);return r-n*((m+p*f*g)/t*Math.sin(t*e)+g*Math.cos(t*e))}}else if(1===p)y=t=>r-Math.exp(-f*t)*(g+(m+f*g)*t);else{const t=f*Math.sqrt(p*p-1);y=e=>{const n=Math.exp(-p*f*e),i=Math.min(t*e,300);return r-n*((m+p*f*g)*Math.sinh(i)+t*g*Math.cosh(i))/t}}const x={calculatedDuration:h&&d||null,next:t=>{const e=y(t);if(h)a.done=t>=d;else{let n=0;p<1&&(n=0===t?we(m):ci(y,t,e));const o=Math.abs(n)<=i,l=Math.abs(r-e)<=s;a.done=o&&l}return a.value=a.done?r:e,a},toString:()=>{const t=Math.min(Yn(x),Wn),e=Me(e=>x.next(t*e).value,t,30);return t+"ms "+e}};return x}function ji({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:c=.5,restSpeed:u}){const d=t[0],A={done:!1,value:d},h=t=>void 0===a?l:void 0===l||Math.abs(a-t)<Math.abs(l-t)?a:l;let m=n*e;const p=d+m,g=void 0===r?p:r(p);g!==p&&(m=g-d);const f=t=>-m*Math.exp(-t/i),v=t=>g+f(t),y=t=>{const e=f(t),n=v(t);A.done=Math.abs(e)<=c,A.value=A.done?g:n};let x,w;const C=t=>{var e;(e=A.value,void 0!==a&&e<a||void 0!==l&&e>l)&&(x=t,w=Mi({keyframes:[A.value,h(A.value)],velocity:ci(v,t,A.value),damping:s,stiffness:o,restDelta:c,restSpeed:u}))};return C(0),{calculatedDuration:null,next:t=>{let e=!1;return w||void 0!==x||(e=!0,y(t),C(t)),void 0!==x&&t>=x?w.next(t-x):(!e&&y(t),A)}}}const ki=Re(.42,0,1,1),Qi=Re(0,0,.58,1),Ti=Re(.42,0,.58,1),Pi=t=>Array.isArray(t)&&"number"!=typeof t[0],Ri={linear:l,easeIn:ki,easeInOut:Ti,easeOut:Qi,circIn:ze,circInOut:We,circOut:Le,backIn:Ue,backInOut:Fe,backOut:Ne,anticipate:qe},Hi=t=>{if(Ee(t)){u(4===t.length,"Cubic bezier arrays must contain four numerical values.");const[e,n,i,s]=t;return Re(e,n,i,s)}return"string"==typeof t?(u(void 0!==Ri[t],`Invalid easing type '${t}'`),Ri[t]):t};function Vi(t,e,{clamp:n=!0,ease:i,mixer:s}={}){const o=t.length;if(u(o===e.length,"Both input and output ranges must be the same length"),1===o)return()=>e[0];if(2===o&&e[0]===e[1])return()=>e[1];const r=t[0]===t[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=function(t,e,n){const i=[],s=n||li,o=t.length-1;for(let r=0;r<o;r++){let n=s(t[r],t[r+1]);if(e){const t=Array.isArray(e)?e[r]||l:e;n=ei(t,n)}i.push(n)}return i}(e,i,s),c=a.length,d=n=>{if(r&&n<t[0])return e[0];let i=0;if(c>1)for(;i<t.length-2&&!(n<t[i+1]);i++);const s=Oe(t[i],t[i+1],n);return a[i](s)};return n?e=>d(At(t[0],t[o-1],e)):d}function Ni(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const s=Oe(0,e,i);t.push(Gn(n,1,s))}}function Ui(t){const e=[0];return Ni(e,t.length-1),e}function Fi({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const s=Pi(i)?i.map(Hi):Hi(i),o={done:!1,value:e[0]},r=function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:Ui(e),t),a=Vi(r,e,{ease:Array.isArray(s)?s:(l=e,c=s,l.map(()=>c||Ti).splice(0,l.length-1))});var l,c;return{calculatedDuration:t,next:e=>(o.value=a(e),o.done=e>=t,o)}}const qi=t=>{const e=({timestamp:e})=>t(e);return{start:()=>m.update(e,!0),stop:()=>p(e),now:()=>g.isProcessing?g.timestamp:oe.now()}},zi={decay:ji,inertia:ji,tween:Fi,keyframes:Fi,spring:Mi},Li=t=>t/100;class Wi extends Ln{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.teardown();const{onStop:t}=this.options;t&&t()};const{name:e,motionValue:n,element:i,keyframes:s}=this.options,o=(null==i?void 0:i.KeyframeResolver)||Qn;this.resolver=new o(s,(t,e)=>this.onKeyframesResolved(t,e),e,n,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:e="keyframes",repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=this.options,r=be(e)?e:zi[e]||Fi;let a,l;r!==Fi&&"number"!=typeof t[0]&&("production"!==process.env.NODE_ENV&&u(2===t.length,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${t}`),a=ei(Li,li(t[0],t[1])),t=[0,100]);const c=r({...this.options,keyframes:t});"mirror"===s&&(l=r({...this.options,keyframes:[...t].reverse(),velocity:-o})),null===c.calculatedDuration&&(c.calculatedDuration=Yn(c));const{calculatedDuration:d}=c,A=d+i;return{generator:c,mirroredGenerator:l,mapPercentToKeyframes:a,calculatedDuration:d,resolvedDuration:A,totalDuration:A*(n+1)-i}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&t?this.state=this.pendingPlayState:this.pause()}tick(t,e=!1){const{resolved:n}=this;if(!n){const{keyframes:t}=this.options;return{done:!0,value:t[t.length-1]}}const{finalKeyframe:i,generator:s,mirroredGenerator:o,mapPercentToKeyframes:r,keyframes:a,calculatedDuration:l,totalDuration:c,resolvedDuration:u}=n;if(null===this.startTime)return s.next(0);const{delay:d,repeat:A,repeatType:h,repeatDelay:m,onUpdate:p}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-c/this.speed,this.startTime)),e?this.currentTime=t:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const g=this.currentTime-d*(this.speed>=0?1:-1),f=this.speed>=0?g<0:g>c;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=c);let v=this.currentTime,y=s;if(A){const t=Math.min(this.currentTime,c)/u;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,A+1);Boolean(e%2)&&("reverse"===h?(n=1-n,m&&(n-=m/u)):"mirror"===h&&(y=o)),v=At(0,1,n)*u}const x=f?{done:!1,value:a[0]}:y.next(v);r&&(x.value=r(x.value));let{done:w}=x;f||null===l||(w=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const C=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return C&&void 0!==i&&(x.value=zn(a,this.options,i)),p&&p(x.value),C&&this.finish(),x}get duration(){const{resolved:t}=this;return t?Ce(t.calculatedDuration):0}get time(){return Ce(this.currentTime)}set time(t){t=we(t),this.currentTime=t,null!==this.holdTime||0===this.speed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=Ce(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:t=qi,onPlay:e,startTime:n}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),e&&e();const i=this.driver.now();null!==this.holdTime?this.startTime=i-this.holdTime:this.startTime?"finished"===this.state&&(this.startTime=i):this.startTime=null!=n?n:this.calcStartTime(),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;this._resolved?(this.state="paused",this.holdTime=null!==(t=this.currentTime)&&void 0!==t?t:0):this.pendingPlayState="paused"}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){null!==this.cancelTime&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const Yi=new Set(["opacity","clipPath","filter","transform"]);function Gi(t,e,n,{delay:i=0,duration:s=300,repeat:o=0,repeatType:r="loop",ease:a="easeInOut",times:l}={}){const c={[e]:n};l&&(c.offset=l);const u=Te(a,s);return Array.isArray(u)&&(c.easing=u),t.animate(c,{delay:i,duration:s,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:o+1,direction:"reverse"===r?"alternate":"normal"})}const Ki=fe(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));const Xi={anticipate:qe,backInOut:Fe,circInOut:We};class Zi extends Ln{constructor(t){super(t);const{name:e,motionValue:n,element:i,keyframes:s}=this.options;this.resolver=new Un(s,(t,e)=>this.onKeyframesResolved(t,e),e,n,i),this.resolver.scheduleResolve()}initPlayback(t,e){let{duration:n=300,times:i,ease:s,type:o,motionValue:r,name:a,startTime:l}=this.options;if(!r.owner||!r.owner.current)return!1;var c;if("string"==typeof s&&Se()&&s in Xi&&(s=Xi[s]),be((c=this.options).type)||"spring"===c.type||!je(c.ease)){const{onComplete:e,onUpdate:r,motionValue:a,element:l,...c}=this.options,u=function(t,e){const n=new Wi({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let i={done:!1,value:t[0]};const s=[];let o=0;for(;!i.done&&o<2e4;)i=n.sample(o),s.push(i.value),o+=10;return{times:void 0,keyframes:s,duration:o-10,ease:"linear"}}(t,c);1===(t=u.keyframes).length&&(t[1]=t[0]),n=u.duration,i=u.times,s=u.ease,o="keyframes"}const u=Gi(r.owner.current,a,t,{...this.options,duration:n,times:i,ease:s});return u.startTime=null!=l?l:this.calcStartTime(),this.pendingTimeline?(Be(u,this.pendingTimeline),this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:n}=this.options;r.set(zn(t,this.options,e)),n&&n(),this.cancel(),this.resolveFinishedPromise()},{animation:u,duration:n,times:i,type:o,ease:s,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:e}=t;return Ce(e)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:e}=t;return Ce(e.currentTime||0)}set time(t){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.currentTime=we(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:e}=t;return e.playbackRate}set speed(t){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:e}=t;return e.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:e}=t;return e.startTime}attachTimeline(t){if(this._resolved){const{resolved:e}=this;if(!e)return l;const{animation:n}=e;Be(n,t)}else this.pendingTimeline=t;return l}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:e}=t;"finished"===e.playState&&this.updateFinishedPromise(),e.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:e}=t;e.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:e,keyframes:n,duration:i,type:s,ease:o,times:r}=t;if("idle"===e.playState||"finished"===e.playState)return;if(this.time){const{motionValue:t,onUpdate:e,onComplete:a,element:l,...c}=this.options,u=new Wi({...c,keyframes:n,duration:i,type:s,ease:o,times:r,isGenerator:!0}),d=we(this.time);t.setWithVelocity(u.sample(d-10).value,u.sample(d).value,10)}const{onStop:a}=this.options;a&&a(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:o,type:r}=t;if(!(e&&e.owner&&e.owner.current instanceof HTMLElement))return!1;const{onUpdate:a,transformTemplate:l}=e.owner.getProps();return Ki()&&n&&Yi.has(n)&&!a&&!l&&!i&&"mirror"!==s&&0!==o&&"inertia"!==r}}const Ji={type:"spring",stiffness:500,damping:25,restSpeed:10},_i={type:"keyframes",duration:.8},$i={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ts=(t,{keyframes:e})=>e.length>2?_i:ot.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:Ji:$i;const es=(t,e,n,i={},s,o)=>r=>{const a=ee(i,t)||{},l=a.delay||i.delay||0;let{elapsed:c=0}=i;c-=we(l);let u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-c,onUpdate:t=>{e.set(t),a.onUpdate&&a.onUpdate(t)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:o?void 0:s};(function({when:t,delay:e,delayChildren:n,staggerChildren:i,staggerDirection:s,repeat:o,repeatType:r,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length})(a)||(u={...u,...ts(t,u)}),u.duration&&(u.duration=we(u.duration)),u.repeatDelay&&(u.repeatDelay=we(u.repeatDelay)),void 0!==u.from&&(u.keyframes[0]=u.from);let d=!1;if((!1===u.type||0===u.duration&&!u.repeatDelay)&&(u.duration=0,0===u.delay&&(d=!0)),d&&!o&&void 0!==e.get()){const t=zn(u.keyframes,a);if(void 0!==t)return m.update(()=>{u.onUpdate(t),u.onComplete()}),new xe([])}return!o&&Zi.supports(u)?new Zi(u):new Wi(u)};function ns({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}function is(t,e,{delay:n=0,transitionOverride:i,type:s}={}){var o;let{transition:r=t.getDefaultTransition(),transitionEnd:a,...l}=e;i&&(r=i);const c=[],u=s&&t.animationState&&t.animationState.getState()[s];for(const d in l){const e=t.getValue(d,null!==(o=t.latestValues[d])&&void 0!==o?o:null),i=l[d];if(void 0===i||u&&ns(u,d))continue;const s={delay:n,...ee(r||{},d)};let a=!1;if(window.MotionHandoffAnimation){const e=ge(t);if(e){const t=window.MotionHandoffAnimation(e,d,m);null!==t&&(s.startTime=t,a=!0)}}pe(t,d),e.start(es(d,e,i,t.shouldReduceMotion&&ne.has(d)?{type:!1}:s,t,a));const A=e.animation;A&&c.push(A)}return a&&Promise.all(c).then(()=>{m.update(()=>{a&&me(t,a)})}),c}function ss(t,e,n={}){var i;const s=te(t,e,"exit"===n.type?null===(i=t.presenceContext)||void 0===i?void 0:i.custom:void 0);let{transition:o=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(o=n.transitionOverride);const r=s?()=>Promise.all(is(t,s,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(i=0)=>{const{delayChildren:s=0,staggerChildren:r,staggerDirection:a}=o;return function(t,e,n=0,i=0,s=1,o){const r=[],a=(t.variantChildren.size-1)*i,l=1===s?(t=0)=>t*i:(t=0)=>a-t*i;return Array.from(t.variantChildren).sort(os).forEach((t,i)=>{t.notify("AnimationStart",e),r.push(ss(t,e,{...o,delay:n+l(i)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(r)}(t,e,s+i,r,a,n)}:()=>Promise.resolve(),{when:l}=o;if(l){const[t,e]="beforeChildren"===l?[r,a]:[a,r];return t().then(()=>e())}return Promise.all([r(),a(n.delay)])}function os(t,e){return t.sortNodePosition(e)}function rs(t,e,n={}){let i;if(t.notify("AnimationStart",e),Array.isArray(e)){const s=e.map(e=>ss(t,e,n));i=Promise.all(s)}else if("string"==typeof e)i=ss(t,e,n);else{const s="function"==typeof e?te(t,e,n.custom):e;i=Promise.all(is(t,s,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}const as=k.length;function ls(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&ls(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let n=0;n<as;n++){const i=k[n],s=t.props[i];(O(s)||!1===s)&&(e[i]=s)}return e}const cs=[...j].reverse(),us=j.length;function ds(t){let e=function(t){return e=>Promise.all(e.map(({animation:e,options:n})=>rs(t,e,n)))}(t),n=ms(),i=!0;const s=e=>(n,i)=>{var s;const o=te(t,i,"exit"===e?null===(s=t.presenceContext)||void 0===s?void 0:s.custom:void 0);if(o){const{transition:t,transitionEnd:e,...i}=o;n={...n,...i,...e}}return n};function o(o){const{props:r}=t,a=ls(t.parent)||{},l=[],c=new Set;let u={},d=1/0;for(let e=0;e<us;e++){const A=cs[e],h=n[A],m=void 0!==r[A]?r[A]:a[A],p=O(m),g=A===o?h.isActive:null;!1===g&&(d=e);let f=m===a[A]&&m!==r[A]&&p;if(f&&i&&t.manuallyAnimateOnMount&&(f=!1),h.protectedKeys={...u},!h.isActive&&null===g||!m&&!h.prevProp||M(m)||"boolean"==typeof m)continue;const v=As(h.prevProp,m);let y=v||A===o&&h.isActive&&!f&&p||e>d&&p,x=!1;const w=Array.isArray(m)?m:[m];let C=w.reduce(s(A),{});!1===g&&(C={});const{prevResolvedValues:b={}}=h,B={...b,...C},E=e=>{y=!0,c.has(e)&&(x=!0,c.delete(e)),h.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)};for(const t in B){const e=C[t],n=b[t];if(u.hasOwnProperty(t))continue;let i=!1;i=_(e)&&_(n)?!$t(e,n):e!==n,i?null!=e?E(t):c.add(t):void 0!==e&&c.has(t)?E(t):h.protectedKeys[t]=!0}h.prevProp=m,h.prevResolvedValues=C,h.isActive&&(u={...u,...C}),i&&t.blockInitialAnimation&&(y=!1);y&&(!(f&&v)||x)&&l.push(...w.map(t=>({animation:t,options:{type:A}})))}if(c.size){const e={};c.forEach(n=>{const i=t.getBaseTarget(n),s=t.getValue(n);s&&(s.liveStyle=!0),e[n]=null!=i?i:null}),l.push({animation:e})}let A=Boolean(l.length);return!i||!1!==r.initial&&r.initial!==r.animate||t.manuallyAnimateOnMount||(A=!1),i=!1,A?e(l):Promise.resolve()}return{animateChanges:o,setActive:function(e,i){var s;if(n[e].isActive===i)return Promise.resolve();null===(s=t.variantChildren)||void 0===s||s.forEach(t=>{var n;return null===(n=t.animationState)||void 0===n?void 0:n.setActive(e,i)}),n[e].isActive=i;const r=o(e);for(const t in n)n[t].protectedKeys={};return r},setAnimateFunction:function(n){e=n(t)},getState:()=>n,reset:()=>{n=ms(),i=!0}}}function As(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!$t(e,t)}function hs(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function ms(){return{animate:hs(!0),whileInView:hs(),whileHover:hs(),whileTap:hs(),whileDrag:hs(),whileFocus:hs(),exit:hs()}}class ps{constructor(t){this.isMounted=!1,this.node=t}update(){}}let gs=0;const fs={animation:{Feature:class extends ps{constructor(t){super(t),t.animationState||(t.animationState=ds(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();M(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),null===(t=this.unmountControls)||void 0===t||t.call(this)}}},exit:{Feature:class extends ps{constructor(){super(...arguments),this.id=gs++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;const i=this.node.animationState.setActive("exit",!t);e&&!t&&i.then(()=>e(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}}},vs={x:!1,y:!1};function ys(){return vs.x||vs.y}const xs=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary;function ws(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}function Cs(t){return{point:{x:t.pageX,y:t.pageY}}}function bs(t,e,n,i){return ws(t,e,(t=>e=>xs(e)&&t(e,Cs(e)))(n),i)}const Bs=(t,e)=>Math.abs(t-e);class Es{constructor(t,e,{transformPagePoint:n,contextWindow:i,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const t=Ss(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=function(t,e){const n=Bs(t.x,e.x),i=Bs(t.y,e.y);return Math.sqrt(n**2+i**2)}(t.offset,{x:0,y:0})>=3;if(!e&&!n)return;const{point:i}=t,{timestamp:s}=g;this.history.push({...i,timestamp:s});const{onStart:o,onMove:r}=this.handlers;e||(o&&o(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),r&&r(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=Ds(e,this.transformPagePoint),m.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:n,onSessionEnd:i,resumeAnimation:s}=this.handlers;if(this.dragSnapToOrigin&&s&&s(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const o=Ss("pointercancel"===t.type?this.lastMoveEventInfo:Ds(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,o),i&&i(t,o)},!xs(t))return;this.dragSnapToOrigin=s,this.handlers=e,this.transformPagePoint=n,this.contextWindow=i||window;const o=Ds(Cs(t),this.transformPagePoint),{point:r}=o,{timestamp:a}=g;this.history=[{...r,timestamp:a}];const{onSessionStart:l}=e;l&&l(t,Ss(o,this.history)),this.removeListeners=ei(bs(this.contextWindow,"pointermove",this.handlePointerMove),bs(this.contextWindow,"pointerup",this.handlePointerUp),bs(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),p(this.updatePoint)}}function Ds(t,e){return e?{point:e(t.point)}:t}function Is(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Ss({point:t},e){return{point:t,delta:Is(t,Ms(e)),offset:Is(t,Os(e)),velocity:js(e,.1)}}function Os(t){return t[0]}function Ms(t){return t[t.length-1]}function js(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const s=Ms(t);for(;n>=0&&(i=t[n],!(s.timestamp-i.timestamp>we(e)));)n--;if(!i)return{x:0,y:0};const o=Ce(s.timestamp-i.timestamp);if(0===o)return{x:0,y:0};const r={x:(s.x-i.x)/o,y:(s.y-i.y)/o};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function ks(t){return t.max-t.min}function Qs(t,e,n,i=.5){t.origin=i,t.originPoint=Gn(e.min,e.max,t.origin),t.scale=ks(n)/ks(e),t.translate=Gn(n.min,n.max,t.origin)-t.originPoint,(t.scale>=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function Ts(t,e,n,i){Qs(t.x,e.x,n.x,i?i.originX:void 0),Qs(t.y,e.y,n.y,i?i.originY:void 0)}function Ps(t,e,n){t.min=n.min+e.min,t.max=t.min+ks(e)}function Rs(t,e,n){t.min=e.min-n.min,t.max=t.min+ks(e)}function Hs(t,e,n){Rs(t.x,e.x,n.x),Rs(t.y,e.y,n.y)}function Vs(t,e,n){return{min:void 0!==e?t.min+e:void 0,max:void 0!==n?t.max+n-(t.max-t.min):void 0}}function Ns(t,e){let n=e.min-t.min,i=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,i]=[i,n]),{min:n,max:i}}const Us=.35;function Fs(t,e,n){return{min:qs(t,e),max:qs(t,n)}}function qs(t,e){return"number"==typeof t?t:t[e]||0}const zs=()=>({x:{min:0,max:0},y:{min:0,max:0}});function Ls(t){return[t("x"),t("y")]}function Ws({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function Ys(t){return void 0===t||1===t}function Gs({scale:t,scaleX:e,scaleY:n}){return!Ys(t)||!Ys(e)||!Ys(n)}function Ks(t){return Gs(t)||Xs(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Xs(t){return Zs(t.x)||Zs(t.y)}function Zs(t){return t&&"0%"!==t}function Js(t,e,n){return n+e*(t-n)}function _s(t,e,n,i,s){return void 0!==s&&(t=Js(t,s,i)),Js(t,n,i)+e}function $s(t,e=0,n=1,i,s){t.min=_s(t.min,e,n,i,s),t.max=_s(t.max,e,n,i,s)}function to(t,{x:e,y:n}){$s(t.x,e.translate,e.scale,e.originPoint),$s(t.y,n.translate,n.scale,n.originPoint)}const eo=.999999999999,no=1.0000000000001;function io(t,e){t.min=t.min+e,t.max=t.max+e}function so(t,e,n,i,s=.5){$s(t,e,n,Gn(t.min,t.max,s),i)}function oo(t,e){so(t.x,e.x,e.scaleX,e.scale,e.originX),so(t.y,e.y,e.scaleY,e.scale,e.originY)}function ro(t,e){return Ws(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}(t.getBoundingClientRect(),e))}const ao=({current:t})=>t?t.ownerDocument.defaultView:null,lo=new WeakMap;class co{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.visualElement=t}start(t,{snapToCursor:e=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&!1===n.isPresent)return;const{dragSnapToOrigin:i}=this.getProps();this.panSession=new Es(t,{onSessionStart:t=>{const{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),e&&this.snapToCursor(Cs(t).point)},onStart:(t,e)=>{const{drag:n,dragPropagation:i,onDragStart:s}=this.getProps();if(n&&!i&&(this.openDragLock&&this.openDragLock(),this.openDragLock="x"===(o=n)||"y"===o?vs[o]?null:(vs[o]=!0,()=>{vs[o]=!1}):vs.x||vs.y?null:(vs.x=vs.y=!0,()=>{vs.x=vs.y=!1}),!this.openDragLock))return;var o;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ls(t=>{let e=this.getAxisMotionValue(t).get()||0;if(vt.test(e)){const{projection:n}=this.visualElement;if(n&&n.layout){const i=n.layout.layoutBox[t];if(i){e=ks(i)*(parseFloat(e)/100)}}}this.originPoint[t]=e}),s&&m.postRender(()=>s(t,e)),pe(this.visualElement,"transform");const{animationState:r}=this.visualElement;r&&r.setActive("whileDrag",!0)},onMove:(t,e)=>{const{dragPropagation:n,dragDirectionLock:i,onDirectionLock:s,onDrag:o}=this.getProps();if(!n&&!this.openDragLock)return;const{offset:r}=e;if(i&&null===this.currentDirection)return this.currentDirection=function(t,e=10){let n=null;Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x");return n}(r),void(null!==this.currentDirection&&s&&s(this.currentDirection));this.updateAxis("x",e.point,r),this.updateAxis("y",e.point,r),this.visualElement.render(),o&&o(t,e)},onSessionEnd:(t,e)=>this.stop(t,e),resumeAnimation:()=>Ls(t=>{var e;return"paused"===this.getAnimationState(t)&&(null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.play())})},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:i,contextWindow:ao(this.visualElement)})}stop(t,e){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:i}=e;this.startAnimation(i);const{onDragEnd:s}=this.getProps();s&&m.postRender(()=>s(t,e))}cancel(){this.isDragging=!1;const{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),e&&e.setActive("whileDrag",!1)}updateAxis(t,e,n){const{drag:i}=this.getProps();if(!n||!uo(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(o=function(t,{min:e,max:n},i){return void 0!==e&&t<e?t=i?Gn(e,t,i.min):Math.max(t,e):void 0!==n&&t>n&&(t=i?Gn(n,t,i.max):Math.min(t,n)),t}(o,this.constraints[t],this.elastic[t])),s.set(o)}resolveConstraints(){var t;const{dragConstraints:e,dragElastic:n}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):null===(t=this.visualElement.projection)||void 0===t?void 0:t.layout,s=this.constraints;e&&V(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!e||!i)&&function(t,{top:e,left:n,bottom:i,right:s}){return{x:Vs(t.x,n,s),y:Vs(t.y,e,i)}}(i.layoutBox,e),this.elastic=function(t=Us){return!1===t?t=0:!0===t&&(t=Us),{x:Fs(t,"left","right"),y:Fs(t,"top","bottom")}}(n),s!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Ls(t=>{!1!==this.constraints&&this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const n={};return void 0!==e.min&&(n.min=e.min-t.min),void 0!==e.max&&(n.max=e.max-t.min),n}(i.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!V(t))return!1;const n=t.current;u(null!==n,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=function(t,e,n){const i=ro(t,n),{scroll:s}=e;return s&&(io(i.x,s.offset.x),io(i.y,s.offset.y)),i}(n,i.root,this.visualElement.getTransformPagePoint());let o=function(t,e){return{x:Ns(t.x,e.x),y:Ns(t.y,e.y)}}(i.layout.layoutBox,s);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(o));this.hasMutatedConstraints=!!t,t&&(o=Ws(t))}return o}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},l=Ls(r=>{if(!uo(r,e,this.currentDirection))return;let l=a&&a[r]||{};o&&(l={min:0,max:0});const c=i?200:1e6,u=i?40:1e7,d={type:"inertia",velocity:n?t[r]:0,bounceStiffness:c,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...s,...l};return this.startAxisValueAnimation(r,d)});return Promise.all(l).then(r)}startAxisValueAnimation(t,e){const n=this.getAxisMotionValue(t);return pe(this.visualElement,t),n.start(es(t,n,0,e,this.visualElement,!1))}stopAnimation(){Ls(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Ls(t=>{var e;return null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.pause()})}getAnimationState(t){var e;return null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.state}getAxisMotionValue(t){const e=`_drag${t.toUpperCase()}`,n=this.visualElement.getProps(),i=n[e];return i||this.visualElement.getValue(t,(n.initial?n.initial[t]:void 0)||0)}snapToCursor(t){Ls(e=>{const{drag:n}=this.getProps();if(!uo(e,n,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(e);if(i&&i.layout){const{min:n,max:o}=i.layout.layoutBox[e];s.set(t[e]-Gn(n,o,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:n}=this.visualElement;if(!V(e)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Ls(t=>{const e=this.getAxisMotionValue(t);if(e&&!1!==this.constraints){const n=e.get();i[t]=function(t,e){let n=.5;const i=ks(t),s=ks(e);return s>i?n=Oe(e.min,e.max-i,t.min):i>s&&(n=Oe(t.min,t.max-s,e.min)),At(0,1,n)}({min:n,max:n},this.constraints[t])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),Ls(e=>{if(!uo(e,t,null))return;const n=this.getAxisMotionValue(e),{min:s,max:o}=this.constraints[e];n.set(Gn(s,o,i[e]))})}addListeners(){if(!this.visualElement.current)return;lo.set(this.visualElement,this);const t=bs(this.visualElement.current,"pointerdown",t=>{const{drag:e,dragListener:n=!0}=this.getProps();e&&n&&this.start(t)}),e=()=>{const{dragConstraints:t}=this.getProps();V(t)&&t.current&&(this.constraints=this.resolveRefConstraints())},{projection:n}=this.visualElement,i=n.addEventListener("measure",e);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),m.read(e);const s=ws(window,"resize",()=>this.scalePositionWithinConstraints()),o=n.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(Ls(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.render())});return()=>{s(),t(),i(),o&&o()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=Us,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:r}}}function uo(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}const Ao=t=>(e,n)=>{t&&m.postRender(()=>t(e,n))};const ho={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function mo(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const po={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!yt.test(t))return t;t=parseFloat(t)}return`${mo(t,e.target.x)}% ${mo(t,e.target.y)}%`}},go={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=hn.parse(t);if(s.length>5)return i;const o=hn.createTransformer(t),r="number"!=typeof s[0]?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;s[0+r]/=a,s[1+r]/=l;const c=Gn(a,l,.5);return"number"==typeof s[2+r]&&(s[2+r]/=c),"number"==typeof s[3+r]&&(s[3+r]/=c),o(s)}};class fo extends e.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:i}=this.props,{projection:s}=t;var o;o=yo,Object.assign(Ut,o),s&&(e.group&&e.group.add(s),n&&n.register&&i&&n.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),ho.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:i,isPresent:s}=this.props,o=n.projection;return o?(o.isPresent=s,i||t.layoutDependency!==e||void 0===e?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||m.postRender(()=>{const t=o.getStack();t&&t.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),q.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),e&&e.group&&e.group.remove(i),n&&n.deregister&&n.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function vo(i){const[o,r]=function(t=!0){const n=e.useContext(s);if(null===n)return[!0,null];const{isPresent:i,onExitComplete:o,register:r}=n,a=e.useId();e.useEffect(()=>{t&&r(a)},[t]);const l=e.useCallback(()=>t&&o&&o(a),[a,o,t]);return!i&&o?[!1,l]:[!0]}(),a=e.useContext(n);return t.jsx(fo,{...i,layoutGroup:a,switchLayoutGroup:e.useContext(z),isPresent:o,safeToRemove:r})}const yo={borderRadius:{...po,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:po,borderTopRightRadius:po,borderBottomLeftRadius:po,borderBottomRightRadius:po,boxShadow:go};function xo(t,e,n){const i=tt(t)?t:Ae(t);return i.start(es("",i,e,n)),i.animation}function wo(t){return t instanceof SVGElement&&"svg"!==t.tagName}const Co=(t,e)=>t.depth-e.depth;class bo{constructor(){this.children=[],this.isDirty=!1}add(t){re(this.children,t),this.isDirty=!0}remove(t){ae(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Co),this.isDirty=!1,this.children.forEach(t)}}const Bo=["TopLeft","TopRight","BottomLeft","BottomRight"],Eo=Bo.length,Do=t=>"string"==typeof t?parseFloat(t):t,Io=t=>"number"==typeof t||yt.test(t);function So(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const Oo=jo(0,.5,Le),Mo=jo(.5,.95,l);function jo(t,e,n){return i=>i<t?0:i>e?1:n(Oe(t,e,i))}function ko(t,e){t.min=e.min,t.max=e.max}function Qo(t,e){ko(t.x,e.x),ko(t.y,e.y)}function To(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function Po(t,e,n,i,s){return t=Js(t-=e,1/n,i),void 0!==s&&(t=Js(t,1/s,i)),t}function Ro(t,e,[n,i,s],o,r){!function(t,e=0,n=1,i=.5,s,o=t,r=t){vt.test(e)&&(e=parseFloat(e),e=Gn(r.min,r.max,e/100)-r.min);if("number"!=typeof e)return;let a=Gn(o.min,o.max,i);t===o&&(a-=e),t.min=Po(t.min,e,n,a,s),t.max=Po(t.max,e,n,a,s)}(t,e[n],e[i],e[s],e.scale,o,r)}const Ho=["x","scaleX","originX"],Vo=["y","scaleY","originY"];function No(t,e,n,i){Ro(t.x,e,Ho,n?n.x:void 0,i?i.x:void 0),Ro(t.y,e,Vo,n?n.y:void 0,i?i.y:void 0)}function Uo(t){return 0===t.translate&&1===t.scale}function Fo(t){return Uo(t.x)&&Uo(t.y)}function qo(t,e){return t.min===e.min&&t.max===e.max}function zo(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Lo(t,e){return zo(t.x,e.x)&&zo(t.y,e.y)}function Wo(t){return ks(t.x)/ks(t.y)}function Yo(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class Go{constructor(){this.members=[]}add(t){re(this.members,t),t.scheduleRender()}remove(t){if(ae(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){const e=this.members.findIndex(e=>t===e);if(0===e)return!1;let n;for(let i=e;i>=0;i--){const t=this.members[i];if(!1!==t.isPresent){n=t;break}}return!!n&&(this.promote(n),!0)}promote(t,e){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.instance&&n.scheduleRender(),t.scheduleRender(),t.resumeFrom=n,e&&(t.resumeFrom.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;!1===i&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:e,resumingFrom:n}=t;e.onExitComplete&&e.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const Ko={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Xo="undefined"!=typeof window&&void 0!==window.MotionDebug,Zo=["","X","Y","Z"],Jo={visibility:"hidden"};let _o=0;function $o(t,e,n,i){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),i&&(i[t]=0))}function tr(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=ge(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:e,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",m,!(e||i))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&tr(i)}function er({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:s}){return class{constructor(t={},n=(null==e?void 0:e())){this.id=_o++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Xo&&(Ko.totalNodes=Ko.resolvedTargetDeltas=Ko.recalculatedProjection=0),this.nodes.forEach(sr),this.nodes.forEach(dr),this.nodes.forEach(Ar),this.nodes.forEach(or),Xo&&window.MotionDebug.record(Ko)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new bo)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new le),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){const n=this.eventHandlers.get(t);n&&n.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}mount(e,n=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=wo(e),this.instance=e;const{layoutId:i,layout:s,visualElement:o}=this.options;if(o&&!o.current&&o.mount(e),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),n&&(s||i)&&(this.isLayoutDirty=!0),t){let n;const i=()=>this.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,n&&n(),n=function(t,e){const n=oe.now(),i=({timestamp:s})=>{const o=s-n;o>=e&&(p(i),t(o-e))};return m.read(i,!0),()=>p(i)}(i,250),ho.hasAnimatedSinceResize&&(ho.hasAnimatedSinceResize=!1,this.nodes.forEach(ur))})}i&&this.root.registerSharedNode(i,this),!1!==this.options.animate&&o&&(i||s)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeTargetChanged:n,layout:i})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const s=this.options.transition||o.getDefaultTransition()||vr,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=o.getProps(),l=!this.targetLayout||!Lo(this.targetLayout,i)||n,c=!e&&n;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||c||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(t,c);const e={...ee(s,"layout"),onPlay:r,onComplete:a};(o.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||ur(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=i})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,p(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(hr),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&tr(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let s=0;s<this.path.length;s++){const t=this.path[s];t.shouldResetTransform=!0,t.updateScroll("snapshot"),t.options.layoutRoot&&t.willUpdate(!1)}const{layoutId:e,layout:n}=this.options;if(void 0===e&&!n)return;const i=this.getTransformTemplate();this.prevTransformTemplateValue=i?i(this.latestValues,""):void 0,this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}update(){this.updateScheduled=!1;if(this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(ar);this.isUpdating||this.nodes.forEach(lr),this.isUpdating=!1,this.nodes.forEach(cr),this.nodes.forEach(nr),this.nodes.forEach(ir),this.clearAllSnapshots();const t=oe.now();g.delta=At(0,1e3/60,t-g.timestamp),g.timestamp=t,g.isProcessing=!0,f.update.process(g),f.preRender.process(g),f.render.process(g),g.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,q.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(rr),this.sharedNodes.forEach(mr)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,m.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){m.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let n=0;n<this.path.length;n++){this.path[n].updateScroll()}const t=this.layout;this.layout=this.measure(!1),this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:e}=this.options;e&&e.notify("LayoutMeasure",this.layout.layoutBox,t?t.layoutBox:void 0)}updateScroll(t="measure"){let e=Boolean(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===t&&(e=!1),e){const e=i(this.instance);this.scroll={animationId:this.root.animationId,phase:t,isRoot:e,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:e}}}resetTransform(){if(!s)return;const t=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,e=this.projectionDelta&&!Fo(this.projectionDelta),n=this.getTransformTemplate(),i=n?n(this.latestValues,""):void 0,o=i!==this.prevTransformTemplateValue;t&&(e||Ks(this.latestValues)||o)&&(s(this.instance,i),this.shouldResetTransform=!1,this.scheduleRender())}measure(t=!0){const e=this.measurePageBox();let n=this.removeElementScroll(e);var i;return t&&(n=this.removeTransform(n)),wr((i=n).x),wr(i.y),{animationId:this.root.animationId,measuredBox:e,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){var t;const{visualElement:e}=this.options;if(!e)return{x:{min:0,max:0},y:{min:0,max:0}};const n=e.measureViewportBox();if(!((null===(t=this.scroll)||void 0===t?void 0:t.wasRoot)||this.path.some(br))){const{scroll:t}=this.root;t&&(io(n.x,t.offset.x),io(n.y,t.offset.y))}return n}removeElementScroll(t){var e;const n={x:{min:0,max:0},y:{min:0,max:0}};if(Qo(n,t),null===(e=this.scroll)||void 0===e?void 0:e.wasRoot)return n;for(let i=0;i<this.path.length;i++){const e=this.path[i],{scroll:s,options:o}=e;e!==this.root&&s&&o.layoutScroll&&(s.wasRoot&&Qo(n,t),io(n.x,s.offset.x),io(n.y,s.offset.y))}return n}applyTransform(t,e=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};Qo(n,t);for(let i=0;i<this.path.length;i++){const t=this.path[i];!e&&t.options.layoutScroll&&t.scroll&&t!==t.root&&oo(n,{x:-t.scroll.offset.x,y:-t.scroll.offset.y}),Ks(t.latestValues)&&oo(n,t.latestValues)}return Ks(this.latestValues)&&oo(n,this.latestValues),n}removeTransform(t){const e={x:{min:0,max:0},y:{min:0,max:0}};Qo(e,t);for(let n=0;n<this.path.length;n++){const t=this.path[n];if(!t.instance)continue;if(!Ks(t.latestValues))continue;Gs(t.latestValues)&&t.updateSnapshot();const i=zs();Qo(i,t.measurePageBox()),No(e,t.latestValues,t.snapshot?t.snapshot.layoutBox:void 0,i)}return Ks(this.latestValues)&&No(e,this.latestValues),e}setTargetDelta(t){this.targetDelta=t,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(t){this.options={...this.options,...t,crossfade:void 0===t.crossfade||t.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==g.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(t=!1){var e;const n=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=n.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=n.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=n.isSharedProjectionDirty);const i=Boolean(this.resumingFrom)||this!==n;if(!(t||i&&this.isSharedProjectionDirty||this.isProjectionDirty||(null===(e=this.parent)||void 0===e?void 0:e.isProjectionDirty)||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:s,layoutId:o}=this.options;if(this.layout&&(s||o)){if(this.resolvedRelativeTargetAt=g.timestamp,!this.targetDelta&&!this.relativeTarget){const t=this.getClosestProjectingParent();t&&t.layout&&1!==this.animationProgress?(this.relativeParent=t,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},Hs(this.relativeTargetOrigin,this.layout.layoutBox,t.layout.layoutBox),Qo(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(this.relativeTarget||this.targetDelta){var r,a,l;if(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),r=this.target,a=this.relativeTarget,l=this.relativeParent.target,Ps(r.x,a.x,l.x),Ps(r.y,a.y,l.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):Qo(this.target,this.layout.layoutBox),to(this.target,this.targetDelta)):Qo(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const t=this.getClosestProjectingParent();t&&Boolean(t.resumingFrom)===Boolean(this.resumingFrom)&&!t.options.layoutScroll&&t.target&&1!==this.animationProgress?(this.relativeParent=t,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},Hs(this.relativeTargetOrigin,this.target,t.target),Qo(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Xo&&Ko.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(this.parent&&!Gs(this.parent.latestValues)&&!Xs(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var t;const e=this.getLead(),n=Boolean(this.resumingFrom)||this!==e;let i=!0;if((this.isProjectionDirty||(null===(t=this.parent)||void 0===t?void 0:t.isProjectionDirty))&&(i=!1),n&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(i=!1),this.resolvedRelativeTargetAt===g.timestamp&&(i=!1),i)return;const{layout:s,layoutId:o}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!s&&!o)return;Qo(this.layoutCorrected,this.layout.layoutBox);const r=this.treeScale.x,a=this.treeScale.y;!function(t,e,n,i=!1){const s=n.length;if(!s)return;let o,r;e.x=e.y=1;for(let a=0;a<s;a++){o=n[a],r=o.projectionDelta;const{visualElement:s}=o.options;s&&s.props.style&&"contents"===s.props.style.display||(i&&o.options.layoutScroll&&o.scroll&&o!==o.root&&oo(t,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),r&&(e.x*=r.x.scale,e.y*=r.y.scale,to(t,r)),i&&Ks(o.latestValues)&&oo(t,o.latestValues))}e.x<no&&e.x>eo&&(e.x=1),e.y<no&&e.y>eo&&(e.y=1)}(this.layoutCorrected,this.treeScale,this.path,n),!e.layout||e.target||1===this.treeScale.x&&1===this.treeScale.y||(e.target=e.layout.layoutBox,e.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:l}=e;l?(this.projectionDelta&&this.prevProjectionDelta?(To(this.prevProjectionDelta.x,this.projectionDelta.x),To(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),Ts(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.treeScale.x===r&&this.treeScale.y===a&&Yo(this.projectionDelta.x,this.prevProjectionDelta.x)&&Yo(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l)),Xo&&Ko.recalculatedProjection++):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){var e;if(null===(e=this.options.visualElement)||void 0===e||e.scheduleRender(),t){const t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}}setAnimationOrigin(t,e=!1){const n=this.snapshot,i=n?n.latestValues:{},s={...this.latestValues},o={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;const r={x:{min:0,max:0},y:{min:0,max:0}},a=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),c=!l||l.members.length<=1,u=Boolean(a&&!c&&!0===this.options.crossfade&&!this.path.some(fr));let d;this.animationProgress=0,this.mixTargetDelta=e=>{const n=e/1e3;var l,A,h,m,p,g;pr(o.x,t.x,n),pr(o.y,t.y,n),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Hs(r,this.layout.layoutBox,this.relativeParent.layout.layoutBox),h=this.relativeTarget,m=this.relativeTargetOrigin,p=r,g=n,gr(h.x,m.x,p.x,g),gr(h.y,m.y,p.y,g),d&&(l=this.relativeTarget,A=d,qo(l.x,A.x)&&qo(l.y,A.y))&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),Qo(d,this.relativeTarget)),a&&(this.animationValues=s,function(t,e,n,i,s,o){s?(t.opacity=Gn(0,void 0!==n.opacity?n.opacity:1,Oo(i)),t.opacityExit=Gn(void 0!==e.opacity?e.opacity:1,0,Mo(i))):o&&(t.opacity=Gn(void 0!==e.opacity?e.opacity:1,void 0!==n.opacity?n.opacity:1,i));for(let r=0;r<Eo;r++){const s=`border${Bo[r]}Radius`;let o=So(e,s),a=So(n,s);void 0===o&&void 0===a||(o||(o=0),a||(a=0),0===o||0===a||Io(o)===Io(a)?(t[s]=Math.max(Gn(Do(o),Do(a),i),0),(vt.test(a)||vt.test(o))&&(t[s]+="%")):t[s]=a)}(e.rotate||n.rotate)&&(t.rotate=Gn(e.rotate||0,n.rotate||0,i))}(s,i,this.latestValues,n,u,c)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(p(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=m.update(()=>{ho.hasAnimatedSinceResize=!0,this.currentAnimation=xo(0,1e3,{...t,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onComplete:()=>{t.onComplete&&t.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:n,layout:i,latestValues:s}=t;if(e&&n&&i){if(this!==t&&this.layout&&i&&Cr(this.options.animationType,this.layout.layoutBox,i.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=ks(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const i=ks(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+i}Qo(e,n),oo(e,s),Ts(this.projectionDeltaWithTransform,this.layoutCorrected,e,s)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new Go);this.sharedNodes.get(t).add(e);const n=e.options.initialPromotionConfig;e.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){var t;const{layoutId:e}=this.options;return e&&(null===(t=this.getStack())||void 0===t?void 0:t.lead)||this}getPrevLead(){var t;const{layoutId:e}=this.options;return e?null===(t=this.getStack())||void 0===t?void 0:t.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const i=this.getStack();i&&i.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetSkewAndRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:n}=t;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(e=!0),!e)return;const i={};n.z&&$o("z",t,i,this.animationValues);for(let s=0;s<Zo.length;s++)$o(`rotate${Zo[s]}`,t,i,this.animationValues),$o(`skew${Zo[s]}`,t,i,this.animationValues);t.render();for(const s in i)t.setStaticValue(s,i[s]),this.animationValues&&(this.animationValues[s]=i[s]);t.scheduleRender()}getProjectionStyles(t){var e,n;if(!this.instance||this.isSVG)return;if(!this.isVisible)return Jo;const i={visibility:""},s=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,i.opacity="",i.pointerEvents=et(null==t?void 0:t.pointerEvents)||"",i.transform=s?s(this.latestValues,""):"none",i;const o=this.getLead();if(!this.projectionDelta||!this.layout||!o.target){const e={};return this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=et(null==t?void 0:t.pointerEvents)||""),this.hasProjected&&!Ks(this.latestValues)&&(e.transform=s?s({},""):"none",this.hasProjected=!1),e}const r=o.animationValues||o.latestValues;this.applyTransformsToTarget(),i.transform=function(t,e,n){let i="";const s=t.x.translate/e.x,o=t.y.translate/e.y,r=(null==n?void 0:n.z)||0;if((s||o||r)&&(i=`translate3d(${s}px, ${o}px, ${r}px) `),1===e.x&&1===e.y||(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:t,rotate:e,rotateX:s,rotateY:o,skewX:r,skewY:a}=n;t&&(i=`perspective(${t}px) ${i}`),e&&(i+=`rotate(${e}deg) `),s&&(i+=`rotateX(${s}deg) `),o&&(i+=`rotateY(${o}deg) `),r&&(i+=`skewX(${r}deg) `),a&&(i+=`skewY(${a}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return 1===a&&1===l||(i+=`scale(${a}, ${l})`),i||"none"}(this.projectionDeltaWithTransform,this.treeScale,r),s&&(i.transform=s(r,i.transform));const{x:a,y:l}=this.projectionDelta;i.transformOrigin=`${100*a.origin}% ${100*l.origin}% 0`,o.animationValues?i.opacity=o===this?null!==(n=null!==(e=r.opacity)&&void 0!==e?e:this.latestValues.opacity)&&void 0!==n?n:1:this.preserveOpacity?this.latestValues.opacity:r.opacityExit:i.opacity=o===this?void 0!==r.opacity?r.opacity:"":void 0!==r.opacityExit?r.opacityExit:0;for(const c in Ut){if(void 0===r[c])continue;const{correct:t,applyTo:e}=Ut[c],n="none"===i.transform?r[c]:t(r[c],o);if(e){const t=e.length;for(let s=0;s<t;s++)i[e[s]]=n}else i[c]=n}return this.options.layoutId&&(i.pointerEvents=o===this?et(null==t?void 0:t.pointerEvents)||"":"none"),i}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(t=>{var e;return null===(e=t.currentAnimation)||void 0===e?void 0:e.stop()}),this.root.nodes.forEach(ar),this.root.sharedNodes.clear()}}}function nr(t){t.updateLayout()}function ir(t){var e;const n=(null===(e=t.resumeFrom)||void 0===e?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&n&&t.hasListeners("didUpdate")){const{layoutBox:e,measuredBox:i}=t.layout,{animationType:s}=t.options,o=n.source!==t.layout.source;"size"===s?Ls(t=>{const i=o?n.measuredBox[t]:n.layoutBox[t],s=ks(i);i.min=e[t].min,i.max=i.min+s}):Cr(s,n.layoutBox,e)&&Ls(i=>{const s=o?n.measuredBox[i]:n.layoutBox[i],r=ks(e[i]);s.max=s.min+r,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[i].max=t.relativeTarget[i].min+r)});const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};Ts(r,e,n.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o?Ts(a,t.applyTransform(i,!0),n.measuredBox):Ts(a,e,n.layoutBox);const l=!Fo(r);let c=!1;if(!t.resumeFrom){const i=t.getClosestProjectingParent();if(i&&!i.resumeFrom){const{snapshot:s,layout:o}=i;if(s&&o){const r={x:{min:0,max:0},y:{min:0,max:0}};Hs(r,n.layoutBox,s.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};Hs(a,e,o.layoutBox),Lo(r,a)||(c=!0),i.options.layoutRoot&&(t.relativeTarget=a,t.relativeTargetOrigin=r,t.relativeParent=i)}}}t.notifyListeners("didUpdate",{layout:e,snapshot:n,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeTargetChanged:c})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function sr(t){Xo&&Ko.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=Boolean(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function or(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function rr(t){t.clearSnapshot()}function ar(t){t.clearMeasurements()}function lr(t){t.isLayoutDirty=!1}function cr(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function ur(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function dr(t){t.resolveTargetDelta()}function Ar(t){t.calcProjection()}function hr(t){t.resetSkewAndRotation()}function mr(t){t.removeLeadSnapshot()}function pr(t,e,n){t.translate=Gn(e.translate,0,n),t.scale=Gn(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function gr(t,e,n,i){t.min=Gn(e.min,n.min,i),t.max=Gn(e.max,n.max,i)}function fr(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const vr={duration:.45,ease:[.4,0,.1,1]},yr=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),xr=yr("applewebkit/")&&!yr("chrome/")?Math.round:l;function wr(t){t.min=xr(t.min),t.max=xr(t.max)}function Cr(t,e,n){return"position"===t||"preserve-aspect"===t&&(i=Wo(e),s=Wo(n),o=.2,!(Math.abs(i-s)<=o));var i,s,o}function br(t){var e;return t!==t.root&&(null===(e=t.scroll)||void 0===e?void 0:e.wasRoot)}const Br=er({attachResizeListener:(t,e)=>ws(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Er={current:void 0},Dr=er({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Er.current){const t=new Br({});t.mount(window),t.setOptions({layoutScroll:!0}),Er.current=t}return Er.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),Ir={pan:{Feature:class extends ps{constructor(){super(...arguments),this.removePointerDownListener=l}onPointerDown(t){this.session=new Es(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:ao(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:Ao(t),onStart:Ao(e),onMove:n,onEnd:(t,e)=>{delete this.session,i&&m.postRender(()=>i(t,e))}}}mount(){this.removePointerDownListener=bs(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends ps{constructor(t){super(t),this.removeGroupControls=l,this.removeListeners=l,this.controls=new co(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||l}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:Dr,MeasureLayout:vo}};function Sr(t,e,n){var i;if(t instanceof Element)return[t];if("string"==typeof t){let e=document;const s=null!==(i=null==n?void 0:n[t])&&void 0!==i?i:e.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t)}function Or(t,e){const n=Sr(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},()=>i.abort()]}function Mr(t){return e=>{"touch"===e.pointerType||ys()||t(e)}}function jr(t,e,n){const{props:i}=t;t.animationState&&i.whileHover&&t.animationState.setActive("whileHover","Start"===n);const s=i["onHover"+n];s&&m.postRender(()=>s(e,Cs(e)))}const kr=(t,e)=>!!e&&(t===e||kr(t,e.parentElement)),Qr=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const Tr=new WeakSet;function Pr(t){return e=>{"Enter"===e.key&&t(e)}}function Rr(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function Hr(t){return xs(t)&&!ys()}function Vr(t,e,n={}){const[i,s,o]=Or(t,n),r=t=>{const i=t.currentTarget;if(!Hr(t)||Tr.has(i))return;Tr.add(i);const o=e(t),r=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),Hr(t)&&Tr.has(i)&&(Tr.delete(i),"function"==typeof o&&o(t,{success:e}))},a=t=>{r(t,n.useGlobalTarget||kr(i,t.target))},l=t=>{r(t,!1)};window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",l,s)};return i.forEach(t=>{(function(t){return Qr.has(t.tagName)||-1!==t.tabIndex})(t)||null!==t.getAttribute("tabindex")||(t.tabIndex=0);(n.useGlobalTarget?window:t).addEventListener("pointerdown",r,s),t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const i=Pr(()=>{if(Tr.has(n))return;Rr(n,"down");const t=Pr(()=>{Rr(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>Rr(n,"cancel"),e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)})(t,s),s)}),o}function Nr(t,e,n){const{props:i}=t;t.animationState&&i.whileTap&&t.animationState.setActive("whileTap","Start"===n);const s=i["onTap"+("End"===n?"":n)];s&&m.postRender(()=>s(e,Cs(e)))}const Ur=new WeakMap,Fr=new WeakMap,qr=t=>{const e=Ur.get(t.target);e&&e(t)},zr=t=>{t.forEach(qr)};function Lr(t,e,n){const i=function({root:t,...e}){const n=t||document;Fr.has(n)||Fr.set(n,{});const i=Fr.get(n),s=JSON.stringify(e);return i[s]||(i[s]=new IntersectionObserver(zr,{root:t,...e})),i[s]}(e);return Ur.set(t,n),i.observe(t),()=>{Ur.delete(t),i.unobserve(t)}}const Wr={some:0,all:1};const Yr={inView:{Feature:class extends ps{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:i="some",once:s}=t,o={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof i?i:Wr[i]};return Lr(this.node.current,o,t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,s&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:n,onViewportLeave:i}=this.node.getProps(),o=e?n:i;o&&o(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends ps{mount(){const{current:t}=this.node;t&&(this.unmount=Vr(t,t=>(Nr(this.node,t,"Start"),(t,{success:e})=>Nr(this.node,t,e?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}},focus:{Feature:class extends ps{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=ei(ws(this.node.current,"focus",()=>this.onFocus()),ws(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends ps{mount(){const{current:t}=this.node;t&&(this.unmount=function(t,e,n={}){const[i,s,o]=Or(t,n),r=Mr(t=>{const{target:n}=t,i=e(t);if("function"!=typeof i||!n)return;const o=Mr(t=>{i(t),n.removeEventListener("pointerleave",o)});n.addEventListener("pointerleave",o,s)});return i.forEach(t=>{t.addEventListener("pointerenter",r,s)}),o}(t,t=>(jr(this.node,t,"Start"),t=>jr(this.node,t,"End"))))}unmount(){}}}},Gr={layout:{ProjectionNode:Dr,MeasureLayout:vo}},Kr={current:null},Xr={current:!1};const Zr=[...Vn,sn,hn],Jr=new WeakMap;const _r=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class $r{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:i,blockInitialAnimation:s,visualState:o},r={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Qn,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=oe.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,m.render(this.render,!1,!0))};const{latestValues:a,renderState:l,onUpdate:c}=o;this.onUpdate=c,this.latestValues=a,this.baseTarget={...a},this.initialValues=e.initial?{...a}:{},this.renderState=l,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=r,this.blockInitialAnimation=Boolean(s),this.isControllingVariants=Q(e),this.isVariantNode=T(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:u,...d}=this.scrapeMotionValuesFromProps(e,{},this);for(const A in d){const t=d[A];void 0!==a[A]&&tt(t)&&t.set(a[A],!1)}}mount(t){this.current=t,Jr.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),Xr.current||function(){if(Xr.current=!0,r)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Kr.current=t.matches;t.addListener(e),e()}else Kr.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||Kr.current),"production"!==process.env.NODE_ENV&&D(!0!==this.shouldReduceMotion,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Jr.delete(this.current),this.projection&&this.projection.unmount(),p(this.notifyUpdate),p(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}bindToMotionValue(t,e){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const n=ot.has(t),i=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&m.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)}),s=e.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{i(),s(),o&&o(),e.owner&&e.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in x){const e=x[t];if(!e)continue;const{isEnabled:n,Feature:i}=e;if(!this.features[t]&&i&&n(this.props)&&(this.features[t]=new i(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let n=0;n<_r.length;n++){const e=_r[n];this.propEventSubscriptions[e]&&(this.propEventSubscriptions[e](),delete this.propEventSubscriptions[e]);const i=t["on"+e];i&&(this.propEventSubscriptions[e]=this.on(e,i))}this.prevMotionValues=function(t,e,n){for(const i in e){const s=e[i],o=n[i];if(tt(s))t.addValue(i,s),"development"===process.env.NODE_ENV&&D("11.18.2"===s.version,`Attempting to mix Motion versions ${s.version} with 11.18.2 may not work as expected.`);else if(tt(o))t.addValue(i,Ae(s,{owner:t}));else if(o!==s)if(t.hasValue(i)){const e=t.getValue(i);!0===e.liveStyle?e.jump(s):e.hasAnimated||e.set(s)}else{const e=t.getStaticValue(i);t.addValue(i,Ae(void 0!==e?e:s,{owner:t}))}}for(const i in n)void 0===e[i]&&t.removeValue(i);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=Ae(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){var n;let i=void 0===this.latestValues[t]&&this.current?null!==(n=this.getBaseTargetFromProps(this.props,t))&&void 0!==n?n:this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var s;return null!=i&&("string"==typeof i&&(Tn(i)||Ye(i))?i=parseFloat(i):(s=i,!Zr.find(Hn(s))&&hn.test(e)&&(i=xn(t,e))),this.setBaseTarget(t,tt(i)?i.get():i)),tt(i)?i.get():i}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;const{initial:n}=this.props;let i;if("string"==typeof n||"object"==typeof n){const s=J(this.props,n,null===(e=this.presenceContext)||void 0===e?void 0:e.custom);s&&(i=s[t])}if(n&&void 0!==i)return i;const s=this.getBaseTargetFromProps(this.props,t);return void 0===s||tt(s)?void 0!==this.initialValues[t]&&void 0===i?void 0:this.baseTarget[t]:s}on(t,e){return this.events[t]||(this.events[t]=new le),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}class ta extends $r{constructor(){super(...arguments),this.KeyframeResolver=Un}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;tt(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}class ea extends ta{constructor(){super(...arguments),this.type="html",this.renderInstance=Ht}readValueFromInstance(t,e){if(ot.has(e)){const t=yn(e);return t&&t.default||0}{const i=(n=t,window.getComputedStyle(n)),s=(at(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return ro(t,e)}build(t,e,n){Ot(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return qt(t,e,n)}}class na extends ta{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=zs}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(ot.has(e)){const t=yn(e);return t&&t.default||0}return e=Vt.has(e)?e:U(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return zt(t,e,n)}build(t,e,n){Qt(t,e,this.isSVGTag,n.transformTemplate)}renderInstance(t,e,n,i){Nt(t,e,0,i)}mount(t){this.isSVGTag=Rt(t.tagName),super.mount(t)}}const ia=I(_t({...fs,...Yr,...Ir,...Gr},(t,n)=>X(t)?new na(n):new ea(n,{allowProjection:t!==e.Fragment})));function sa(t){const n=i(()=>Ae(t)),{isStatic:s}=e.useContext(o);if(s){const[,i]=e.useState(t);e.useEffect(()=>n.on("change",i),[])}return n}function oa(t,e){const n=sa(e()),i=()=>n.set(e());return i(),a(()=>{const e=()=>m.preRender(i,!1,!0),n=t.map(t=>t.on("change",e));return()=>{n.forEach(t=>t()),p(i)}}),n}function ra(t,e,n,i){if("function"==typeof t)return function(t){ue.current=[],t();const e=oa(ue.current,t);return ue.current=void 0,e}(t);const s="function"==typeof e?e:function(...t){const e=!Array.isArray(t[0]),n=e?0:-1,i=t[0+n],s=t[1+n],o=t[2+n],r=t[3+n],a=Vi(s,o,{mixer:(l=o[0],(t=>t&&"object"==typeof t&&t.mix)(l)?l.mix:void 0),...r});var l;return e?a(i):a}(e,n,i);return Array.isArray(t)?aa(t,s):aa([t],([t])=>s(t))}function aa(t,e){const n=i(()=>[]);return oa(t,()=>{n.length=0;const i=t.length;for(let e=0;e<i;e++)n[e]=t[e].get();return e(n)})}function la(t,e){[...e].reverse().forEach(n=>{const i=t.getVariant(n);i&&me(t,i),t.variantChildren&&t.variantChildren.forEach(t=>{la(t,e)})})}function ca(){let t=!1;const e=new Set,n={subscribe:t=>(e.add(t),()=>{e.delete(t)}),start(n,i){u(t,"controls.start() should only be called after a component has mounted. Consider calling within a useEffect hook.");const s=[];return e.forEach(t=>{s.push(rs(t,n,{transitionOverride:i}))}),Promise.all(s)},set:n=>(u(t,"controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook."),e.forEach(t=>{!function(t,e){Array.isArray(e)?la(t,e):"string"==typeof e?la(t,[e]):me(t,e)}(t,n)})),stop(){e.forEach(t=>{!function(t){t.values.forEach(t=>t.stop())}(t)})},mount:()=>(t=!0,()=>{t=!1,n.stop()})};return n}function ua(t,e=100,n){const i=n({...t,keyframes:[0,e]}),s=Math.min(Yn(i),Wn);return{type:"keyframes",ease:t=>i.next(s*t).value/e,duration:Ce(s)}}function da(t,e){return Pi(t)?t[((t,e,n)=>{const i=e-t;return((n-t)%i+i)%i+t})(0,t.length,e)]:t}function Aa(t){return"object"==typeof t&&!Array.isArray(t)}function ha(t,e,n,i){return"string"==typeof t&&Aa(e)?Sr(t,0,i):t instanceof NodeList?Array.from(t):Array.isArray(t)?t:[t]}function ma(t,e,n){return t*(e+1)}function pa(t,e,n,i){var s;return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:null!==(s=i.get(e))&&void 0!==s?s:t}function ga(t,e,n,i,s,o){!function(t,e,n){for(let i=0;i<t.length;i++){const s=t[i];s.at>e&&s.at<n&&(ae(t,s),i--)}}(t,s,o);for(let r=0;r<e.length;r++)t.push({value:e[r],at:Gn(s,o,i[r]),easing:da(n,r)})}function fa(t,e){for(let n=0;n<t.length;n++)t[n]=t[n]/(e+1)}function va(t,e){return t.at===e.at?null===t.value?1:null===e.value?-1:0:t.at-e.at}function ya(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function xa(t,e){return e[t]||(e[t]=[]),e[t]}function wa(t){return Array.isArray(t)?t:[t]}function Ca(t,e){return t&&t[e]?{...t,...t[e]}:{...t}}const ba=t=>"number"==typeof t,Ba=t=>t.every(ba);class Ea extends $r{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,e){if(function(t,e){return t in e}(e,t)){const n=t[e];if("string"==typeof n||"number"==typeof n)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(t,e){delete e.output[t]}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}build(t,e){Object.assign(t.output,e)}renderInstance(t,{output:e}){Object.assign(t,e)}sortInstanceNodePosition(){return 0}}function Da(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=wo(t)?new na(e):new ea(e);n.mount(t),Jr.set(t,n)}function Ia(t){const e=new Ea({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});e.mount(t),Jr.set(t,e)}function Sa(t,e,n,i){const s=[];if(function(t,e){return tt(t)||"number"==typeof t||"string"==typeof t&&!Aa(e)}(t,e))s.push(xo(t,Aa(e)&&e.default||e,n&&n.default||n));else{const i=ha(t,e),o=i.length;u(Boolean(o),"No valid elements provided.");for(let t=0;t<o;t++){const r=i[t],a=r instanceof Element?Da:Ia;Jr.has(r)||a(r);const l=Jr.get(r),c={...n};"delay"in c&&"function"==typeof c.delay&&(c.delay=c.delay(t,o)),s.push(...is(l,{...e,transition:c},{}))}}return s}function Oa(t,e,n){const i=[],s=function(t,{defaultTransition:e={},...n}={},i,s){const o=e.duration||.3,r=new Map,a=new Map,l={},c=new Map;let d=0,A=0,h=0;for(let m=0;m<t.length;m++){const n=t[m];if("string"==typeof n){c.set(n,A);continue}if(!Array.isArray(n)){c.set(n.name,pa(A,n.at,d,c));continue}let[i,r,p={}]=n;void 0!==p.at&&(A=pa(A,p.at,d,c));let g=0;const f=(t,n,i,r=0,a=0)=>{const l=wa(t),{delay:c=0,times:d=Ui(l),type:m="keyframes",repeat:p,repeatType:f,repeatDelay:v=0,...y}=n;let{ease:x=e.ease||"easeOut",duration:w}=n;const C="function"==typeof c?c(r,a):c,b=l.length,B=be(m)?m:null==s?void 0:s[m];if(b<=2&&B){let t=100;if(2===b&&Ba(l)){const e=l[1]-l[0];t=Math.abs(e)}const e={...y};void 0!==w&&(e.duration=we(w));const n=ua(e,t,B);x=n.ease,w=n.duration}null!=w||(w=o);const E=A+C;1===d.length&&0===d[0]&&(d[1]=1);const D=d.length-l.length;if(D>0&&Ni(d,D),1===l.length&&l.unshift(null),p){u(p<20,"Repeat count too high, must be less than 20"),w=ma(w,p);const t=[...l],e=[...d];x=Array.isArray(x)?[...x]:[x];const n=[...x];for(let i=0;i<p;i++){l.push(...t);for(let s=0;s<t.length;s++)d.push(e[s]+(i+1)),x.push(0===s?"linear":da(n,s-1))}fa(d,p)}const I=E+w;ga(i,l,x,d,E,I),g=Math.max(C+w,g),h=Math.max(I,h)};if(tt(i))f(r,p,xa("default",ya(i,a)));else{const t=ha(i,r,0,l),e=t.length;for(let n=0;n<e;n++){const i=ya(t[n],a);for(const t in r)f(r[t],Ca(p,t),xa(t,i),n,e)}}d=A,A+=g}return a.forEach((t,i)=>{for(const s in t){const o=t[s];o.sort(va);const a=[],l=[],c=[];for(let t=0;t<o.length;t++){const{at:e,value:n,easing:i}=o[t];a.push(n),l.push(Oe(0,h,e)),c.push(i||"easeOut")}0!==l[0]&&(l.unshift(0),a.unshift(a[0]),c.unshift("easeInOut")),1!==l[l.length-1]&&(l.push(1),a.push(null)),r.has(i)||r.set(i,{keyframes:{},transition:{}});const u=r.get(i);u.keyframes[s]=a,u.transition[s]={...e,duration:h,ease:c,times:l,...n}}}),r}(t,e,0,{spring:Mi});return s.forEach(({keyframes:t,transition:e},n)=>{i.push(...Sa(n,t,e))}),i}const Ma=function(t,e,n){let i=[];var s;return s=t,i=Array.isArray(s)&&s.some(Array.isArray)?Oa(t,e):Sa(t,e,n),new xe(i)};function ja(){const t=i(ca);return a(t.mount,[]),t}const ka="_card_doqsx_2",Qa="_cardContent_doqsx_18",Ta="_gradientBottom_doqsx_29",Pa="_gradientTop_doqsx_41",Ra="_cardName_doqsx_52",Ha=({card:e,cardUIConfig:n,className:i="",children:s})=>{const{gradient:o,title:r}=n,a=o.color||"rgba(0, 0, 0, 1)",l=(()=>{if(!o.type)return{showTop:!1,showBottom:!1};const t=o.type.toLowerCase();return{showTop:"top"===t||"top-and-bottom"===t,showBottom:"bottom"===t||"top-and-bottom"===t}})();return t.jsxs("div",{id:e.id||void 0,className:`${ka} ${i}`.trim(),children:[s,l.showBottom&&t.jsx("div",{className:Ta,style:{background:`linear-gradient(transparent, ${a})`}}),l.showTop&&t.jsx("div",{className:Pa,style:{background:`linear-gradient(${a}, transparent)`}}),r.enabled&&t.jsx("div",{className:Qa,children:t.jsx("div",{className:Ra,style:{fontSize:`${r.textSize}px`,bottom:`${r.positionBottom}%`},children:e.title||""})})]})},Va="_image_trs4h_2",Na=({card:n,onImageReady:i,ready:s=!0,lazyLoad:o=!1,className:r=""})=>{const a=e.useRef(null);return e.useEffect(()=>{if(a.current&&i&&s){const t=()=>{i(a.current)};if(!a.current.complete)return a.current.addEventListener("load",t),()=>{var e;null==(e=a.current)||e.removeEventListener("load",t)};i(a.current)}},[s]),t.jsx(t.Fragment,{children:n.imageUrl&&s&&t.jsx("img",{ref:a,src:n.imageUrl,alt:n.title||"",loading:o?"lazy":"eager",className:`${Va} ${r}`.trim()})})},Ua="_videoContainer_119iz_3",Fa="_cardVideo_119iz_10",qa=({card:n,cardIndex:i=0,isActive:s=!1,isMuted:o,volume:r=.5,onVideoReady:a,onPlayRequested:l,ready:c=!0,className:u=""})=>{const d=e.useRef(null);e.useEffect(()=>{d.current&&a&&c&&a(d.current)},[c]),e.useEffect(()=>{s&&d.current&&l&&c&&l(d.current)},[s,c]),e.useEffect(()=>{d.current&&c&&(d.current.muted=o,void 0!==d.current.volume&&(d.current.volume=r))},[o,r,c]),e.useEffect(()=>{if(!d.current||!n.videoUrl)return;const t=d.current;t.setAttribute("src",n.videoUrl),n.videoThumbnail&&(t.poster=n.videoThumbnail,t.setAttribute("poster",n.videoThumbnail)),t.autoplay=!1,t.muted=o},[n.videoUrl,n.videoThumbnail,o]);const A=0===i||1===i?"none":"auto";return t.jsx(t.Fragment,{children:n.videoUrl&&c&&t.jsx("div",{className:Ua,children:t.jsx("hls-video",{ref:d,id:`video-card-${n.id}`,class:Fa,src:n.videoUrl,muted:o,loop:!0,playsInline:!0,preload:A,...n.videoThumbnail?{poster:n.videoThumbnail}:{}})})})},za="_swipeableCard_14c6z_1",La="_swipeHeadline_14c6z_25",Wa=t=>"video"===t.type,Ya=100,Ga=1,Ka=.35,Xa=.25,Za=.35,Ja=600,_a=(t,e,n=!1)=>{const i=Math.abs(t)>Math.abs(e)?t>0?"right":"left":e>0?"down":"up";return n?i.charAt(0).toUpperCase()+i.slice(1):i},$a=e.forwardRef(({card:n,cardIndex:i=0,cardUIConfig:s,isActive:o=!1,swipeOptions:r,creation:a,isAnimating:l=!1,animateDirection:c,onSwipeLeft:u,onSwipeRight:d,onSwipeUp:A,onSwipeDown:h,isMuted:m=!0,volume:p=.5,onVideoReady:g,onPlayRequested:f,onImageReady:v,ready:y=!0,className:x="",zIndex:w,tutorialXOffset:C=0},b)=>{const B=e.useRef(null),E=sa(0),D=sa(0),I=sa(1),[S,O]=e.useState({text:"",opacity:0}),M=e.useRef(null),j=e.useRef(0),k=e.useRef(null),Q=ra(E,t=>t+C),T=e.useCallback(()=>r||((null==a?void 0:a.swipeOptions)?a.swipeOptions:{right:{enabled:!0,gesture:!0,label:"RIGHT"},left:{enabled:!0,gesture:!0,label:"LEFT"},up:{enabled:!0,gesture:!0,label:"UP"},down:{enabled:!0,gesture:!0,label:"DOWN"}}),[r,a]),P=e.useCallback(()=>{const t=T();return{right:t.right.label,left:t.left.label,up:t.up.label,down:t.down.label}},[T]),R=e.useCallback((t,e)=>{if(!o||l)return;const{offset:n}=e;k.current||(Math.abs(n.x)>5||Math.abs(n.y)>5)&&(k.current=Math.abs(n.x)>Math.abs(n.y)?"x":"y");const i=T(),s="x"===k.current?n.x:0,r="y"===k.current?n.y:0,a=s>0&&i.right.enabled&&i.right.gesture||s<0&&i.left.enabled&&i.left.gesture,c=r<0&&i.up.enabled&&i.up.gesture||r>0&&i.down.enabled&&i.down.gesture;if("x"===k.current&&!a)return;if("y"===k.current&&!c)return;E.set(s),D.set(r);const u=Math.sqrt(s**2+r**2);I.set((t=>1-Math.min(t/(4*Ya),1)*(1-Ka))(u));const d=_a(s,r,!0),A=Math.min(u/Ya*3,Ga);if(d!==M.current||Math.abs(A-j.current)>.05){M.current=d,j.current=A;const t=P(),e="Left"===d?t.left:"Right"===d?t.right:"Up"===d?t.up:"Down"===d?t.down:"";O({text:e,opacity:A})}},[o,l,T,P,E,D,I]),H=e.useCallback((t,e)=>{if(!o||l)return;const{offset:n}=e,i="x"===k.current?n.x:0,s="y"===k.current?n.y:0;k.current=null;const r=T(),a=i>0&&r.right.enabled&&r.right.gesture||i<0&&r.left.enabled&&r.left.gesture,c=s<0&&r.up.enabled&&r.up.gesture||s>0&&r.down.enabled&&r.down.gesture;if(Math.abs(i)>Ya&&a||Math.abs(s)>Ya&&c){const t=_a(i,s);Ma(I,Xa,{duration:Za,ease:"easeOut"}),requestAnimationFrame(()=>{"right"===t&&d?(d(),O({text:"",opacity:0})):"left"===t&&u?(u(),O({text:"",opacity:0})):"up"===t&&A?(A(),O({text:"",opacity:0})):"down"===t&&h&&(h(),O({text:"",opacity:0}))})}else Ma(E,0,{type:"spring",stiffness:400,damping:30,duration:.15}),Ma(D,0,{type:"spring",stiffness:400,damping:30,duration:.15}),Ma(I,1,{type:"spring",stiffness:400,damping:30,duration:.15});M.current=null,j.current=0},[o,l,T,u,d,A,h,E,D,I]),V=e.useRef(null);e.useEffect(()=>{if(c&&c!==V.current&&o&&B.current){V.current=c;const t=B.current.getBoundingClientRect(),e=t.width,n=t.height,i="up"===c?1.25*-n:"down"===c?1.25*n:0;Ma(E,"left"===c?1.25*-e:"right"===c?1.25*e:0,{duration:Ja/1e3,ease:"easeOut"}),Ma(D,i,{duration:Ja/1e3,ease:"easeOut"}),Ma(I,Xa,{duration:Za,ease:"easeOut"})}else!c&&V.current&&(V.current=null,E.set(0),D.set(0),I.set(1))},[c,o,I,E,D]),e.useEffect(()=>{o||(E.set(0),D.set(0),I.set(1),O({text:"",opacity:0}),k.current=null)},[o,E,D,I]),e.useImperativeHandle(b,()=>({fadeOut:()=>{Ma(I,Xa,{duration:Za,ease:"easeOut"})}}),[I]);const N=T(),U=N.left.enabled&&N.left.gesture||N.right.enabled&&N.right.gesture,F=N.up.enabled&&N.up.gesture||N.down.enabled&&N.down.gesture;return t.jsxs(ia.div,{ref:B,drag:o&&!l&&(U||F),dragConstraints:{left:0,right:0,top:0,bottom:0},dragElastic:1,dragPropagation:!1,onDrag:R,onDragEnd:H,className:`${za} ${x}`.trim(),style:{x:Q,y:D,opacity:I,zIndex:w,cursor:o&&!l&&(U||F)?"grab":"default"},whileDrag:{cursor:"grabbing"},children:[t.jsx(Ha,{card:n,cardUIConfig:s,children:Wa(n)?t.jsx(qa,{card:n,cardIndex:i,isActive:o,isMuted:m,volume:p,onVideoReady:t=>{g&&g(t,n.id)},onPlayRequested:t=>{f&&f(t,n.id)},ready:y}):t.jsx(Na,{card:n,onImageReady:t=>{v&&v(t,n.id)},ready:y})}),t.jsx("div",{className:La,style:{opacity:S.opacity},children:S.text})]})}),tl="_ctaTooltip_1mai4_2",el="_ctaTooltipArrow_1mai4_22",nl=({currentCardId:n,currentCardIndex:i=0,totalCards:s=10,tooltipText:o,tooltipTextColor:r,tooltipTextSize:a,tooltipBackgroundColor:l,tooltipKeep:c=!1,assetTooltips:u={},buttonContainerId:d="buttonsContainer",onFirstSwipe:A,className:h=""})=>{var m;const[p,g]=e.useState(n??null),[f,v]=e.useState(i),[y,x]=e.useState(s),[w,C]=e.useState(i>0),b=e.useRef(null),B=e.useRef(i),E=p&&(null==(m=u[p])?void 0:m.enabled)?u[p]:null,D=(null==E?void 0:E.text)??o??null,I=!(f>=y)&&""!==(D??"")&&(!w||c);e.useEffect(()=>{void 0!==n&&g(n)},[n]),e.useEffect(()=>{const t=B.current;B.current=i,v(i),i>0&&0===t&&!w?(C(!0),A&&A()):i>0&&!w&&C(!0)},[i,w,A]),e.useEffect(()=>{x(s)},[s]);const[S,O]=e.useState(100);e.useEffect(()=>{const t=document.getElementById(d);if(!t)return;const e=new ResizeObserver(t=>{for(const e of t)O(e.contentRect.width)});return e.observe(t),b.current=e,()=>{b.current&&(b.current.disconnect(),b.current=null)}},[d]);const M=(null==E?void 0:E.textColor)??r,j=(null==E?void 0:E.textSize)??a,k=(null==E?void 0:E.backgroundColor)??l;if(!D)return null;const Q=D.replace(/<br>/g,"\n"),T=k??"#FFFFFF",P=`calc((${S}px / 2) + 2px)`;return t.jsxs("div",{className:`${tl} ${h}`.trim(),style:{fontSize:j?`${j}px`:"12px",backgroundColor:T,color:M??"#333333",opacity:I?1:0},children:[Q,t.jsx("div",{className:el,style:{right:P,backgroundColor:T}})]})},il={verticalEmojisButtons:"_verticalEmojisButtons_14t5d_2",buttonContainer:"_buttonContainer_14t5d_11",button:"_button_14t5d_11",emojiIcon:"_emojiIcon_14t5d_45",buttonLabel:"_buttonLabel_14t5d_56",buttonAnimation:"_buttonAnimation_14t5d_62",buttonLikeAnimation:"_buttonLikeAnimation_14t5d_80",buttonDislikeAnimation:"_buttonDislikeAnimation_14t5d_85",buttonMaybeAnimation:"_buttonMaybeAnimation_14t5d_90",buttonSeenAnimation:"_buttonSeenAnimation_14t5d_95",contrastMode:"_contrastMode_14t5d_101",contrastModeButton:"_contrastModeButton_14t5d_109",contrastModeLabel:"_contrastModeLabel_14t5d_119",contrastModeLike:"_contrastModeLike_14t5d_130",contrastModeDislike:"_contrastModeDislike_14t5d_135",contrastModeMaybe:"_contrastModeMaybe_14t5d_140",contrastModeSeen:"_contrastModeSeen_14t5d_145"},sl=({buttons:n,tooltipText:i,tooltipTextColor:s,tooltipTextSize:o,tooltipBackgroundColor:r,tooltipKeep:a,verticalPosition:l,horizontalPosition:c,buttonClass:u,containerClass:d,labelClass:A,onButtonClick:h,isAnimating:m=!1,visible:p=!0,className:g="",id:f="buttonsContainer",currentCardIndex:v,totalCards:y,onFirstSwipe:x})=>{const[w,C]=e.useState(null),b=e.useRef(null),B=e.useRef(null);e.useEffect(()=>()=>{B.current&&clearTimeout(B.current)},[]);const E=i&&i.trim().length>0;return p?t.jsxs("div",{ref:b,id:f,className:`${il.verticalEmojisButtons} contrast-mode ${d||""} ${g}`.trim(),style:{...void 0!==l&&{top:`${l}px`},...void 0!==c&&{right:`${c}px`}},children:[E&&t.jsx(nl,{tooltipText:i,tooltipTextColor:s,tooltipTextSize:o,tooltipBackgroundColor:r,tooltipKeep:a,buttonContainerId:f,currentCardIndex:v,totalCards:y,onFirstSwipe:x}),n.map(e=>{const n=w===e.id;return t.jsxs("div",{className:il.buttonContainer,children:[t.jsx("div",{className:`${il.button} ${e.action}-btn ${u||""} ${il.contrastModeButton} ${il[`contrastMode${e.action.charAt(0).toUpperCase()+e.action.slice(1)}`]||""} ${n&&il[`button${e.action.charAt(0).toUpperCase()+e.action.slice(1)}Animation`]||""}`.trim(),onClick:()=>(t=>{m||(C(t.id),B.current&&clearTimeout(B.current),B.current=setTimeout(()=>{C(null)},300),h&&h(t.action,t.id))})(e),children:t.jsx("img",{src:e.icon,alt:e.altText,className:il.emojiIcon})}),t.jsx("span",{className:`${il.buttonLabel} ${il.contrastModeLabel} ${A||""}`.trim(),children:e.label})]},e.id)})]}):null},ol={sideButtonsContainer:"_sideButtonsContainer_jjr9u_2",sideButtonsWrapper:"_sideButtonsWrapper_jjr9u_16",sideButtonContainer:"_sideButtonContainer_jjr9u_28",sideButtonLeft:"_sideButtonLeft_jjr9u_36",sideButtonRight:"_sideButtonRight_jjr9u_45",sideButtonTop:"_sideButtonTop_jjr9u_54",sideButtonBottom:"_sideButtonBottom_jjr9u_62",sideButton:"_sideButton_jjr9u_2",buttonContent:"_buttonContent_jjr9u_95",arrowWrapper:"_arrowWrapper_jjr9u_103",emojiWrapper:"_emojiWrapper_jjr9u_104",arrowRight:"_arrowRight_jjr9u_120",arrowLeft:"_arrowLeft_jjr9u_124",arrowUp:"_arrowUp_jjr9u_128",arrowDown:"_arrowDown_jjr9u_132",emojiIcon:"_emojiIcon_jjr9u_137",buttonLabel:"_buttonLabel_jjr9u_144",moveRight:"_moveRight_jjr9u_1",moveLeft:"_moveLeft_jjr9u_1",moveUp:"_moveUp_jjr9u_1",moveDown:"_moveDown_jjr9u_1"},rl=({direction:e,size:n=32})=>t.jsx("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:(()=>{switch(e){case"right":default:return ol.arrowRight;case"left":return ol.arrowLeft;case"up":return ol.arrowUp;case"down":return ol.arrowDown}})(),children:t.jsx("path",{d:"M5 12h14M12 5l7 7-7 7"})}),al=({button:e,position:n,onButtonClick:i,isAnimating:s,buttonClass:o,labelClass:r,currentAnimation:a=0,showEmoji:l=!1,buttonSize:c=80})=>{const u=ja(),d=(()=>{switch(e.action){case"like":default:return"right";case"dislike":return"left";case"maybe":return"up";case"seen":return"down"}})(),A=["right","left","up","down"][a]===d,h=.4*c,m=ol[`sideButton${n.charAt(0).toUpperCase()+n.slice(1)}`]||"";return t.jsx("div",{className:`${ol.sideButtonContainer} ${m}`,children:t.jsxs(ia.button,{onClick:async()=>{s||(await u.start({scale:1.2,transition:{type:"spring",stiffness:400,damping:17,duration:.15}}),await u.start({scale:1,transition:{type:"spring",stiffness:400,damping:17,duration:.15}}),i&&i(e.action,e.id))},onContextMenu:t=>t.preventDefault(),className:`${ol.sideButton} ${e.action}-btn ${o||""}`.trim(),animate:u,whileHover:{scale:1.1,transition:{duration:.2}},style:{WebkitTouchCallout:"none",WebkitUserSelect:"none",touchAction:"manipulation",cursor:"pointer",pointerEvents:"auto",width:`${c}px`,height:`${c}px`},"aria-label":e.altText,children:[t.jsxs("div",{className:ol.buttonContent,style:{width:`${h}px`,height:`${h}px`},children:[t.jsx("div",{className:ol.arrowWrapper,style:{opacity:A&&l?0:1,transition:"opacity 0.15s ease"},children:t.jsx(rl,{direction:d,size:h})}),t.jsx("div",{className:ol.emojiWrapper,style:{opacity:A&&l?1:0,transition:"opacity 0.15s ease"},children:t.jsx("img",{src:e.icon,alt:e.altText,className:ol.emojiIcon,style:{width:`${h}px`,height:`${h}px`}})})]}),t.jsx("span",{className:`${ol.buttonLabel} ${r||""}`.trim(),children:e.label})]})})},ll=({buttons:n,buttonClass:i,containerClass:s,labelClass:o,buttonSize:r=80,onButtonClick:a,isAnimating:l=!1,visible:c=!0,className:u="",id:d="buttonsContainer"})=>{const[A,h]=e.useState(0),[m,p]=e.useState(!1),g=n.find(t=>"like"===t.action&&!1!==t.enabled),f=n.find(t=>"dislike"===t.action&&!1!==t.enabled),v=n.find(t=>"maybe"===t.action&&!1!==t.enabled),y=n.find(t=>"seen"===t.action&&!1!==t.enabled);return e.useEffect(()=>{p(!1);const t=setTimeout(()=>{p(!0)},300),e=setTimeout(()=>{p(!1)},1500);return()=>{clearTimeout(t),clearTimeout(e)}},[A]),e.useEffect(()=>{const t=setInterval(()=>{h(t=>(t+1)%4)},2e3);return()=>clearInterval(t)},[]),c?t.jsx("div",{id:d,className:`${ol.sideButtonsContainer} ${s||""} ${u}`.trim(),children:t.jsxs("div",{className:ol.sideButtonsWrapper,children:[v&&t.jsx(al,{button:v,position:"top",onButtonClick:a,isAnimating:l,buttonClass:i,labelClass:o,currentAnimation:A,showEmoji:m,buttonSize:r}),f&&t.jsx(al,{button:f,position:"left",onButtonClick:a,isAnimating:l,buttonClass:i,labelClass:o,currentAnimation:A,showEmoji:m,buttonSize:r}),g&&t.jsx(al,{button:g,position:"right",onButtonClick:a,isAnimating:l,buttonClass:i,labelClass:o,currentAnimation:A,showEmoji:m,buttonSize:r}),y&&t.jsx(al,{button:y,position:"bottom",onButtonClick:a,isAnimating:l,buttonClass:i,labelClass:o,currentAnimation:A,showEmoji:m,buttonSize:r})]})}):null},cl="_horizontalCtaTooltip_1slua_1",ul=({currentCardId:n,currentCardIndex:i=0,tooltipText:s,tooltipTextColor:o,tooltipTextSize:r,tooltipBackgroundColor:a,tooltipKeep:l=!1,tooltipBottomOffset:c,assetTooltips:u={},onFirstSwipe:d,className:A=""})=>{var h;const[m,p]=e.useState(n??null),[g,f]=e.useState(i),[v,y]=e.useState(i>0),x=e.useRef(i),w=m&&(null==(h=u[m])?void 0:h.enabled)?u[m]:null,C=(null==w?void 0:w.text)??s??null,b=(0===g||l||((null==w?void 0:w.enabled)??!1))&&""!==(C??"")&&(!v||l);e.useEffect(()=>{void 0!==n&&p(n)},[n]),e.useEffect(()=>{const t=x.current;x.current=i,f(i),i>0&&0===t&&!v?(y(!0),d&&d()):i>0&&!v&&y(!0)},[i,v,d]);const B=(null==w?void 0:w.textColor)??o,E=(null==w?void 0:w.textSize)??r,D=(null==w?void 0:w.backgroundColor)??a,I=(null==w?void 0:w.bottomOffset)??c;if(!C)return null;const S=C.replace(/<br>/g,"\n");return t.jsx("div",{className:`${cl} ${A}`.trim(),style:{bottom:void 0!==I?`calc(${I}px + 50%)`:"50%",backgroundColor:D??"#FFFFFF",color:B??"#333333",fontSize:E?`${E}px`:"12px",opacity:b?1:0,pointerEvents:b?"auto":"none"},children:S})},dl={sideButtonsContainer:"_sideButtonsContainer_1kkly_2",sideButtonsWrapper:"_sideButtonsWrapper_1kkly_16",sideButtonContainer:"_sideButtonContainer_1kkly_28",sideButtonLeft:"_sideButtonLeft_1kkly_36",sideButtonRight:"_sideButtonRight_1kkly_45",sideButtonTop:"_sideButtonTop_1kkly_54",sideButtonBottom:"_sideButtonBottom_1kkly_62",sideButton:"_sideButton_1kkly_2",buttonContent:"_buttonContent_1kkly_99",buttonLabel:"_buttonLabel_1kkly_111",arrowRight:"_arrowRight_1kkly_126",arrowLeft:"_arrowLeft_1kkly_130",arrowUp:"_arrowUp_1kkly_134",arrowDown:"_arrowDown_1kkly_138",moveRight:"_moveRight_1kkly_1",moveLeft:"_moveLeft_1kkly_1",moveUp:"_moveUp_1kkly_1",moveDown:"_moveDown_1kkly_1",tooltipWrapper:"_tooltipWrapper_1kkly_277"},Al=({direction:e,size:n=32})=>t.jsx("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:(()=>{switch(e){case"right":default:return dl.arrowRight;case"left":return dl.arrowLeft;case"up":return dl.arrowUp;case"down":return dl.arrowDown}})(),children:t.jsx("path",{d:"M5 12h14M12 5l7 7-7 7"})}),hl=({button:e,position:n,onButtonClick:i,isAnimating:s,buttonClass:o,labelClass:r,currentAnimation:a=0,buttonSize:l=80})=>{const c=ja(),u=(()=>{switch(e.action){case"like":default:return"right";case"dislike":return"left";case"maybe":return"up";case"seen":return"down"}})(),d=.4*l,A=dl[`sideButton${n.charAt(0).toUpperCase()+n.slice(1)}`]||"";return t.jsx("div",{className:`${dl.sideButtonContainer} ${A}`,children:t.jsxs(ia.button,{onClick:async()=>{s||(await c.start({scale:1.2,transition:{type:"spring",stiffness:400,damping:17,duration:.15}}),await c.start({scale:1,transition:{type:"spring",stiffness:400,damping:17,duration:.15}}),i&&i(e.action,e.id))},onContextMenu:t=>t.preventDefault(),className:`${dl.sideButton} ${e.action}-btn ${o||""}`.trim(),animate:c,whileHover:{scale:1.1,transition:{duration:.2}},style:{width:`${l}px`,height:`${l}px`},"aria-label":e.altText,children:[t.jsx("div",{className:dl.buttonContent,style:{width:`${d}px`,height:`${d}px`},children:t.jsx(Al,{direction:u,size:d})}),t.jsx("span",{className:`${dl.buttonLabel} ${r||""}`.trim(),children:e.label})]})})},ml=({buttons:n,ctaText:i,isDemoMode:s=!1,tooltipTextColor:o,tooltipTextSize:r,tooltipBackgroundColor:a,tooltipKeep:l,tooltipBottomOffset:c,currentCardIndex:u,onFirstSwipe:d,buttonClass:A,containerClass:h,labelClass:m,buttonSize:p=80,onButtonClick:g,isAnimating:f=!1,visible:v=!0,className:y="",id:x="buttonsContainer"})=>{const[w,C]=e.useState(0),b=n.find(t=>"like"===t.action&&t.enabled),B=n.find(t=>"dislike"===t.action&&t.enabled),E=n.find(t=>"maybe"===t.action&&t.enabled),D=n.find(t=>"seen"===t.action&&t.enabled);if(e.useEffect(()=>{const t=setInterval(()=>{C(t=>(t+1)%4)},2e3);return()=>clearInterval(t)},[]),!v)return null;const I=s&&i&&i.trim().length>0;return t.jsx("div",{id:x,className:`${dl.sideButtonsContainer} ${h||""} ${y}`.trim(),children:t.jsxs("div",{className:dl.sideButtonsWrapper,children:[E&&t.jsx(hl,{button:E,position:"top",onButtonClick:g,isAnimating:f,buttonClass:A,labelClass:m,currentAnimation:w,buttonSize:p}),B&&t.jsx(hl,{button:B,position:"left",onButtonClick:g,isAnimating:f,buttonClass:A,labelClass:m,currentAnimation:w,buttonSize:p}),I&&t.jsx("div",{className:dl.tooltipWrapper,children:t.jsx(ul,{tooltipText:i,tooltipTextColor:o,tooltipTextSize:r,tooltipBackgroundColor:a,tooltipKeep:l,tooltipBottomOffset:c,currentCardIndex:u??0,onFirstSwipe:d})}),b&&t.jsx(hl,{button:b,position:"right",onButtonClick:g,isAnimating:f,buttonClass:A,labelClass:m,currentAnimation:w,buttonSize:p}),D&&t.jsx(hl,{button:D,position:"bottom",onButtonClick:g,isAnimating:f,buttonClass:A,labelClass:m,currentAnimation:w,buttonSize:p})]})})},pl="_swipeTutorialOverlay_jbb64_2",gl="_handContainer_jbb64_16",fl="_handIcon_jbb64_24",vl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABBwAAAQ4AQAAAACC3fKIAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAnRSTlMAAHaTzTgAAAACYktHRAAB3YoTpAAAAAd0SU1FB+oCCwgOA99Ta6kAABV7SURBVHja7Z1PsqwqEsY1HDBk2jOWwtK0ozfmDnoLLsGhEW1o3z/nVKklmh9kJt53YfTOfVXUTyA/kgSTqiqllFJKKaWUUkoppZRSSinl7y71OrDX6RbwC806sUO0a4d9wa8rN0Ozoq3brij2bbEr2Lr1uq4995BY1xltOvaR+aOHsS4268o+Mn/0MNbFP/oPbLv7sqJd7Pghfg4zrIt/9t8iADGi/beyywQ4zn5+gVkofo51qItrKYgFbTpmCLuCXfyLmlkyLfpgVgDCoXX+/sIgADFgMiEDMYIyIQIxgTIhAjGDMiECsYAyIQKxgjIhA9FhMiED0YOfF4EYMAuVgRgxC5WBmDALlYGYMQsVmcDIQmEkIVYQohOB6CCZEPGsyO3rRCAMNtz9uq78Lv83xAhpFfPi59vmJkirJFZgZKHAPg1DLBLtBrprxKEGjiDQcSUanRWZOt5G1yMy0TNDOOThvBCERbq5FdGq91ib8snE2+pmdnsWEgopmYCEQkomIKGwYhCA2UnJBCQUXsSlAdtYSiYgoZCyUEQohLwJTCgaOQi6UMhZKCAUTsibgITCi8kE8ICtmEwAXb2KyQRdKGo5maBbnigEtXI5bwLoayMoE+RRbwVlgmz/TlAmyELhBWWCLBStoEyQhULSQqlCIehN0IVCViaIQiErE0Shk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aJDYu9xZxoSVLmSZaCNzFkYwmZ1aBC56oUhquwGShwUsziEeUBvUAZFJw5xrxSTPMP99DEoQNSZ5ZLUH5MKhM3fG7f20VX5+0OnIW76Q6khLpti1GK4kgq1hrhoil6PIdwUig0RbIpKtZiMYnndFr02w0lbLFUppZRSSimllFJKKaWUUkoppZQSKP8HUbkEDAG+x4EAAAAldEVYdGRhdGU6Y3JlYXRlADIwMjYtMDItMTFUMDg6MTQ6MDMrMDA6MDCAmdYbAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDI2LTAyLTExVDA4OjE0OjAzKzAwOjAw8cRupwAAAABJRU5ErkJggg==",yl=({size:e=80,src:n,alt:i})=>t.jsx("img",{src:n,alt:i,className:fl,style:{width:`${e}px`,height:`${e}px`}}),xl=({visible:n=!0,onCardMove:i,animationDuration:s=3e3,startDelay:o=500,className:r="",id:a="swipeTutorialOverlay"})=>{const l=ja(),c=e.useRef(null),u=e.useRef(!1),[d,A]=e.useState(vl);return e.useEffect(()=>{if(!n)return l.set({x:0}),A(vl),i&&i(0),c.current&&(cancelAnimationFrame(c.current),c.current=null),void(u.current=!1);if(u.current)return;u.current=!0;return(async()=>{for(await new Promise(t=>setTimeout(t,o));n&&u.current;)A(vl),await l.start({x:0,transition:{duration:.4,ease:"easeOut"}}),await new Promise(t=>setTimeout(t,1e3)),A("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABBwAAAQ4CAQAAAAArweuAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QA/4ePzL8AAHHkSURBVHja7d13nBbHYf/x79Db0etxvd/RqwoSSKh32XJRYjtuiR07sZPYaU7imuIk/sWOe48tN9mW1ZAEiCaJItGr6Bxw9C7g6OXm9wdIQqI9zz27O7O7n3deSWwJdnZntnyf2dkZCQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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b9CYIDgOSZZvuJiakRpO3arOPMCUlwAJBcs22hiqgGBBIa1uuo7uVZRHAAkHSzbLn6UQ3IKTTU6zCzNBAcAKTHAtuPCaLQLDu0SyN4AhEcAKTNBNtBpSqjIpCFDdqum3j6EBwApNkaW00l4Kq267DqeO4QHABAmmy7ayS3FFzGca3WQd3CCUJwAIALrbBF6kw14AKntEOlPGsIDgBwadNsS/VXJRUBSeu1VaKfgeAAAFe33Pbkc83UOq0tOsRXEwQHAMjOLNtedWpPRaTKRm3RCd3F04XgAADNs8x2Vr7aUBGJt0cbdUCWeSAJDgCQqxdtG/VVKRWRULvVoD06qod5phAcACA4c2wbdVORWlMVCXFU+9SoQTxJCA4AEJ7JtoPyVU5FxNpO1Wuf3sEzhOAAANFZb1uppzpREbFxXHt1XDU8OQgOAODKU7a9Oqmb+qkrleGx3dqugzqjO3hqEByoAgC+WGjbqLMK1YKq8MQxNapRxzWYZwUIDgB8NcHmqUAVVIRDr2mrduiUHuAZAYIDgDhZZVuog3qoA1URohPaoxOSWqiSZwIIDgDib7JtqQ7qpr7qRmUEao92aJ+O0bMAggOANKi3x3RKTbKS2qiz+jK99ds0arcO65Sa1FIt1Vqt1EqtVc6dHwQHAOn1a3tCx3RMVp3UU4UqTfniWo3arYNq1GEd1Gtq1Bm1UXt1VJ7exx0fAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJB0/x/Bt3TKC4gr+QAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyNi0wMi0xMVQwODoxMzo0NyswMDowMBJA54sAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjYtMDItMTFUMDg6MTM6NDcrMDA6MDBjHV83AAAAAElFTkSuQmCC"),await Promise.all([l.start({x:90,transition:{duration:s/1e3,ease:"easeOut"}}),i?new Promise(t=>{const e=Date.now(),n=()=>{const o=Date.now()-e,r=Math.min(o/s,1),a=1-Math.pow(1-r,3);i(150*a),r<1?c.current=requestAnimationFrame(n):t()};n()}):Promise.resolve()]),A(vl),await Promise.all([l.start({x:0,transition:{duration:.5,ease:"easeInOut"}}),i?new Promise(t=>{const e=Date.now(),n=()=>{const s=Date.now()-e,o=Math.min(s/500,1),r=1-Math.pow(1-o,3);i(150*(1-r)),o<1?c.current=requestAnimationFrame(n):(i(0),t())};n()}):Promise.resolve()]),await new Promise(t=>setTimeout(t,500)),A("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABBwAAAQ4CAQAAAAArweuAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QA/4ePzL8AAE5dSURBVHja7d13vG5VfSf+777tnMu9F5AL3AKCYAHEQhDUYDdxYhJ1HAvjaOxiTXOS0ZlkJslk0pNfzGSMLcWGGks0oCLWSEws9KaJqKBSbu/tnFvO+v3BBUFuec45+3n2Wmu/33m9fBnkPHvv7157rc9eu0UAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAtKZRgul4V1oQ949HxLEREbEhro3vxvYYi+PiBSoJgODAj3wyjceKOPM+//y2WB2bYyKeqZYACA5E/Hm6X5wUZ8SKQ/w7U3F1/Ftsj9erKACCQ399OG2IB8cTY8FA//YX4pZ4tZoCIDj007vSMfGTsXIaf3FD3BgvVFUABIf+eW96QDxx2n+1Kf41NseLVRYAwaE/PpQm4px42Az/+pL49/g1tQVAcOiH96XF8YT9D13OzCfjO6IDAIJDH3wwHRk/P+tf+XDsiFeqLwBVmaME9xnw0/IWYkPEz8SYYgIgONQeG46Pp7TyS0fHo+PDSUUBEBwqjg0nxpNb+7UHx6nxd6IDAIJDnS5Mx8d5rf7iOXG0sgIgONTo/emYFmcb7nJeXGrOAYBqzFOCO300zYunD+F3l8USxQVAcKjLx9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B7YkFxgQEB6CCM9+0UBGGOxQYCxAcgB6cIad5ijBtu2NMz88seKoCKNb8pmmaZqtCDGRnNE3TNI3YAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAxf5/YGXrivgArHYAAAAldEVYdGRhdGU6Y3JlYXRlADIwMjYtMDItMTFUMDg6MTM6MjArMDA6MDARiNCCAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDI2LTAyLTExVDA4OjEzOjIwKzAwOjAwYNVoPgAAAABJRU5ErkJggg=="),await Promise.all([l.start({x:-90,transition:{duration:s/1e3,ease:"easeOut"}}),i?new Promise(t=>{const e=Date.now(),n=()=>{const o=Date.now()-e,r=Math.min(o/s,1),a=1-Math.pow(1-r,3);i(-150*a),r<1?c.current=requestAnimationFrame(n):t()};n()}):Promise.resolve()]),A(vl),await Promise.all([l.start({x:0,transition:{duration:.5,ease:"easeInOut"}}),i?new Promise(t=>{const e=Date.now(),n=()=>{const s=Date.now()-e,o=Math.min(s/500,1),r=1-Math.pow(1-o,3);i(-150*(1-r)),o<1?c.current=requestAnimationFrame(n):(i(0),t())};n()}):Promise.resolve()]),await new Promise(t=>setTimeout(t,1e3))})(),()=>{u.current=!1,c.current&&(cancelAnimationFrame(c.current),c.current=null)}},[n,l,i,s,o]),n?t.jsx("div",{id:a,className:`${pl} ${r}`.trim(),children:t.jsx(ia.div,{className:gl,animate:l,initial:{x:0},children:t.jsx(yl,{size:80,src:d,alt:"Swipe tutorial hand"})})}):null},wl="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='144'%20height='144'%20fill='%23000'%20xmlns:v='https://vecta.io/nano'%3e%3cpath%20d='M71.998%20105c6.8%200%2012.975-1.925%2018.525-5.775S100.098%2090.3%20102.598%2084h-9.9c-2.2%203.7-5.125%206.625-8.775%208.775S76.298%2096%2071.998%2096s-8.275-1.075-11.925-3.225S53.498%2087.7%2051.298%2084h-9.9c2.5%206.3%206.525%2011.375%2012.075%2015.225S65.198%20105%2071.998%20105zM52.395%2051.002c-3.2%200-6.175.9-8.925%202.7a23.03%2023.03%200%200%200-6.825%206.9l7.5%204.95c1-1.5%202.2-2.775%203.6-3.825s2.95-1.575%204.65-1.575%203.25.525%204.65%201.575%202.6%202.275%203.6%203.675l7.5-4.95c-1.8-2.7-4.075-4.95-6.825-6.75s-5.725-2.7-8.925-2.7zm42%200c-3.2%200-6.175.9-8.925%202.7a23.03%2023.03%200%200%200-6.825%206.9l7.5%204.95c1-1.4%202.2-2.625%203.6-3.675s2.95-1.575%204.65-1.575%203.275.5%204.725%201.5%202.626%202.25%203.525%203.75l7.5-4.95a23.03%2023.03%200%200%200-6.825-6.9c-2.75-1.8-5.725-2.7-8.925-2.7z'/%3e%3c/svg%3e",Cl="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='144'%20height='144'%20fill='none'%20xmlns:v='https://vecta.io/nano'%3e%3cpath%20d='M37.498%2095.998h9v-1.5c0-7.1%202.475-13.125%207.425-18.075s10.975-7.425%2018.075-7.425%2013.125%202.475%2018.075%207.425%207.425%2010.975%207.425%2018.075v1.5h9v-1.5c0-9.6-3.35-17.75-10.05-24.45s-14.85-10.05-24.45-10.05-17.75%203.35-24.45%2010.05-10.05%2014.85-10.05%2024.45v1.5zm5.1-40.5c4.1-.6%208.425-2.2%2012.975-4.8s8.175-5.55%2010.875-8.85l-6.9-5.7c-2%202.4-4.775%204.6-8.325%206.6s-6.825%203.25-9.825%203.75l1.2%209zm58.8%200l1.2-9c-3-.5-6.275-1.75-9.825-3.75s-6.325-4.2-8.325-6.6l-6.9%205.7c2.7%203.3%206.325%206.25%2010.875%208.85s8.875%204.2%2012.975%204.8z'%20fill='%23000'/%3e%3c/svg%3e",bl="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='145'%20height='144'%20fill='%23000'%20xmlns:v='https://vecta.io/nano'%3e%3cdefs%3e%3cclipPath%20id='iconClip'%3e%3ccircle%20cx='50%25'%20cy='50%25'%20r='50%25'/%3e%3c/clipPath%3e%3c/defs%3e%3cg%20clip-path='url(%23iconClip)'%3e%3cpath%20d='M49.734%2084.513a2%202%200%200%200%201.284%202.52l30.434%209.889a2%202%200%200%200%202.52-1.284l1.545-4.755a2%202%200%200%200-1.284-2.52L53.8%2078.474a2%202%200%200%200-2.52%201.284l-1.545%204.755zm44.815-11.736c2.378.773%204.669.597%206.874-.526s3.694-2.874%204.467-5.252.597-4.669-.527-6.874-2.874-3.694-5.252-4.467-4.669-.597-6.874.527-3.694%202.874-4.466%205.252-.597%204.669.527%206.874%202.874%203.694%205.252%204.466zM54.605%2059.799c2.378.773%204.669.597%206.874-.526s3.694-2.874%204.467-5.252.597-4.669-.527-6.874-2.874-3.694-5.252-4.466-4.669-.597-6.874.526-3.694%202.874-4.466%205.252-.597%204.669.526%206.874%202.874%203.694%205.252%204.467z'/%3e%3c/g%3e%3c/svg%3e",Bl="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='144'%20height='144'%20fill='none'%20xmlns:v='https://vecta.io/nano'%3e%3cpath%20d='M63.601%2099.602l42.3-42.3-8.4-8.4-33.9%2033.9-17.1-17.1-8.4%208.4%2025.5%2025.5z'%20fill='%23000'/%3e%3c/svg%3e",El="_swipeableFeed_jamse_1",Dl="_swipeableFeedCards_jamse_8",Il="_swipeableFeedEmpty_jamse_22",Sl="_swipeTutorialContainer_jamse_33",Ol=({cards:n,finderUiConfig:i,buttonStyle:s="vertical-emojis",maxVisibleCards:o=2,isMuted:r=!0,volume:a=.5,currentCardIndex:l,setCurrentCardIndex:c,addSwipeToHistory:u,setIsAnimating:d,isAnimating:A,setNoMoreCards:h,sendSwipeEvent:m,sendImpressionEvent:p,startCardImpression:g,onAllCardsSwiped:f,onCardSwiped:v,swipeTutorialEnabled:y=!1,swipeTutorialDuration:x=3e3,swipeTutorialStartDelay:w=500,id:C="swipeableFeed"})=>{const[b,B]=e.useState(!1),[E,D]=e.useState(null),[I,S]=e.useState({}),[O,M]=e.useState(0),j=e.useRef(null),k=e.useCallback(async t=>{if(!t)return;if(!("HLS-VIDEO"===t.tagName||"VIDEO"===t.tagName||"play"in t))return;const e=t;try{(void 0===e.readyState||e.readyState<2)&&await new Promise(t=>{const n=()=>{e.removeEventListener("loadeddata",n),t()};e.addEventListener("loadeddata",n),setTimeout(()=>{e.removeEventListener("loadeddata",n),t()},3e3)}),void 0!==e.currentTime&&(e.currentTime=0);let t=0;const n=5,i=async()=>{try{e.play&&await e.play()}catch(s){t<n&&(t++,e.load&&e.load(),setTimeout(i,500*t))}};setTimeout(()=>{i()},200)}catch(n){}},[]),Q=e.useMemo(()=>n.slice(l,l+o),[n,l,o]),T=l<n.length,P=e.useCallback(t=>{if(A||!T)return;const e=n[l];e&&(d(!0),B(!0),M(0),e.id&&m(e.id,t),u(t,e),null==v||v(e,t),D(t),setTimeout(()=>{const t=l+1;if(D(null),t>=n.length)return d(!1),h(!0),void(null==f||f());const e=n[t];if(!(!e||(I[t]??!1))&&e){const e=(n=0)=>{if(n>20)return d(!1),void c(t);I[t]??!1?(d(!1),c(t)):setTimeout(()=>e(n+1),100)};e()}else d(!1),c(t);if(t<n.length){const e=n[t];(null==e?void 0:e.id)&&(g(e.id),p(e.id),"video"===e.type&&e.videoUrl&&setTimeout(()=>{var t;const n=null==(t=j.current)?void 0:t.querySelector(`[id="${e.id}"]`);if(n){const t=n.querySelector("hls-video, video");t&&k(t)}},100))}},600))},[A,T,n,l,d,c,h,m,p,g,u,v,f,k,I,h]),R=e.useCallback((t,e)=>{if(A||!T)return;const n={like:"right",dislike:"left",maybe:"up",seen:"down"}[t];n&&P(n)},[A,T,P]),H=e.useCallback(t=>{M(t)},[]),V=e.useCallback(t=>{const e=n.findIndex(e=>e.id===t);e>=0&&S(t=>({...t,[e]:!0}))},[n]),N=e.useCallback((t,e)=>{e&&V(e)},[V]),U=e.useCallback((t,e)=>{if(!t)return;const i=n[l];i&&e===i.id&&k(t)},[k,n,l]),F=e.useCallback((t,e)=>{e&&V(e)},[V]),q=e.useRef(new Set);e.useEffect(()=>{Q.forEach((t,e)=>{const n=l+e;"image"===t.type&&t.id&&!q.current.has(n)&&(q.current.add(n),S(t=>({...t,[n]:!0})))});const t=new Set(Q.map((t,e)=>l+e));q.current.forEach(e=>{t.has(e)||q.current.delete(e)})},[Q,l]),e.useEffect(()=>{if(n.length>0&&0===l){const t=n[0];(null==t?void 0:t.id)&&(g(t.id),p(t.id))}},[n,l,g,p]),e.useEffect(()=>{M(0)},[l]);const z=e.useMemo(()=>i.navigation.options||{right:{enabled:!0,gesture:!0,label:"RIGHT"},left:{enabled:!0,gesture:!0,label:"LEFT"},up:{enabled:!0,gesture:!1,label:"UP"},down:{enabled:!0,gesture:!1,label:"DOWN"}},[i.navigation.options]),L=e.useMemo(()=>{const t={tooltipText:i.navigationDemoTooltip.text,tooltipTextColor:i.navigationDemoTooltip.textColor,tooltipTextSize:i.navigationDemoTooltip.textSize,tooltipBackgroundColor:i.navigationDemoTooltip.backgroundColor,tooltipKeep:i.navigationDemoTooltip.keep,onButtonClick:R,isAnimating:A,visible:T,currentCardIndex:l,totalCards:n.length,onFirstSwipe:()=>B(!0)};switch(s){case"vertical-emojis":{const e=[{id:"likeBtn",action:"like",label:z.right.label,icon:wl,altText:"Yes"},{id:"dislikeBtn",action:"dislike",label:z.left.label,icon:Cl,altText:"No"},{id:"maybeBtn",action:"maybe",label:z.up.label,icon:bl,altText:"Maybe"},{id:"seenBtn",action:"seen",label:z.down.label,icon:Bl,altText:"Seen"}].filter(t=>{var e;const n={like:"right",dislike:"left",maybe:"up",seen:"down"}[t.action];return(null==(e=z[n])?void 0:e.enabled)??!0});return{component:sl,props:{...t,buttons:e,verticalPosition:i.navigation.positionTop,horizontalPosition:i.navigation.positionRight}}}case"side-emojis":{const e=[{id:"likeBtn",action:"like",label:z.right.label,icon:wl,altText:"Yes"},{id:"dislikeBtn",action:"dislike",label:z.left.label,icon:Cl,altText:"No"}].filter(t=>{var e;const n={like:"right",dislike:"left"}[t.action];return(null==(e=z[n])?void 0:e.enabled)??!0});return{component:ll,props:{...t,buttons:e}}}case"side-arrows":{const e=[{id:"likeBtn",action:"like",label:z.right.label,icon:wl,altText:"Yes",enabled:z.right.enabled},{id:"dislikeBtn",action:"dislike",label:z.left.label,icon:Cl,altText:"No",enabled:z.left.enabled},{id:"maybeBtn",action:"maybe",label:z.up.label,icon:bl,altText:"Maybe",enabled:z.up.enabled},{id:"seenBtn",action:"seen",label:z.down.label,icon:Bl,altText:"Seen",enabled:z.down.enabled}];return{component:ml,props:{...t,buttons:e,ctaText:i.navigationDemoTooltip.text,isDemoMode:Boolean(i.navigationDemoTooltip.text&&!b),tooltipBottomOffset:i.navigationDemoTooltip.bottomOffset}}}default:return null}},[s,i.navigation.options,z,R,A,T,l,n.length,b]),W=e.useCallback(()=>{z.left.enabled&&z.left.gesture&&P("left")},[z.left,P]),Y=e.useCallback(()=>{z.right.enabled&&z.right.gesture&&P("right")},[z.right,P]),G=e.useCallback(()=>{z.up.enabled&&z.up.gesture&&P("up")},[z.up,P]),K=e.useCallback(()=>{z.down.enabled&&z.down.gesture&&P("down")},[z.down,P]);return 0===n.length?t.jsx("div",{className:El,id:C,children:t.jsx("div",{className:Il,children:"No cards available"})}):t.jsxs("div",{ref:j,className:El,id:C,children:[t.jsx("div",{className:Dl,children:Q.map((e,n)=>{const s=l+n,c=0===n,u=c&&(I[s]??!0)&&!A,d=o-n;return t.jsx($a,{card:e,cardUIConfig:i.card,cardIndex:s,isActive:c,swipeOptions:z,isAnimating:A&&c,animateDirection:c?E:null,onSwipeLeft:u?W:void 0,onSwipeRight:u?Y:void 0,onSwipeUp:u?G:void 0,onSwipeDown:u?K:void 0,onVideoReady:N,onPlayRequested:U,onImageReady:F,isMuted:r,volume:a,ready:!0,zIndex:d,tutorialXOffset:c?O:0},e.id)})}),(()=>{if(!L||!T)return null;const{component:e,props:n}=L;return t.jsx(e,{...n})})(),y&&T&&!b&&Q.length>0&&t.jsx("div",{className:Sl,children:t.jsx(xl,{visible:!0,onCardMove:H,animationDuration:x,startDelay:w})})]})},Ml="_volumeControl_r52gg_2",jl="_volumeControlTopLeft_r52gg_12",kl="_volumeControlTopRight_r52gg_17",Ql="_volumeControlBottomLeft_r52gg_23",Tl="_volumeControlBottomRight_r52gg_28",Pl="_volumeControlButton_r52gg_34",Rl="_volumeSlider_r52gg_60",Hl="_volumeSliderInput_r52gg_81",Vl="_volumeSliderLeft_r52gg_122",Nl="_volumeSliderRight_r52gg_126",Ul=({volumeControlUIConfig:n,isMuted:i,volume:s,visible:o=!0,className:r="",onToggleMute:a,onVolumeChange:l})=>{const{position:c,size:u,volumeControl:d}=n,A="top-left"===c||"bottom-left"===c?"right":"left";if(!o)return null;const h=e.useMemo(()=>{switch(c){case"top-left":return jl;case"top-right":default:return kl;case"bottom-left":return Ql;case"bottom-right":return Tl}},[c]);return t.jsxs("div",{className:`${Ml} ${h} ${r}`.trim(),style:{height:`${u}px`},children:[t.jsx("div",{className:Pl,onClick:t=>{t.stopPropagation(),a()},style:{height:`${u}px`},children:t.jsx("img",{src:i?"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20fill='none'%20xmlns:v='https://vecta.io/nano'%3e%3cmask%20id='A'%20maskUnits='userSpaceOnUse'%20x='0'%20y='0'%20width='24'%20height='24'%20mask-type='alpha'%3e%3cpath%20fill='%23d9d9d9'%20d='M0%200h24v24H0z'/%3e%3c/mask%3e%3cg%20mask='url(%23A)'%3e%3cpath%20d='M19.801%2022.601l-3.025-3.025a8.31%208.31%200%200%201-1.325.688%209.48%209.48%200%200%201-1.45.462v-2.05l.688-.25c.225-.083.438-.183.637-.3l-3.325-3.325v5.2l-5-5h-4v-6h3.2l-4.8-4.8%201.4-1.4%2018.4%2018.4-1.4%201.4zm-.2-5.8l-1.45-1.45c.283-.517.496-1.058.638-1.625a7.19%207.19%200%200%200%20.212-1.75%206.86%206.86%200%200%200-1.375-4.2c-.917-1.233-2.125-2.067-3.625-2.5v-2.05c2.067.467%203.75%201.512%205.05%203.137s1.95%203.496%201.95%205.613c0%20.883-.121%201.733-.363%202.55s-.587%201.575-1.037%202.275zm-3.35-3.35l-2.25-2.25v-3.25a4.15%204.15%200%200%201%201.838%201.65c.442.733.662%201.533.662%202.4a4.34%204.34%200%200%201-.062.738%204.28%204.28%200%200%201-.187.712zm-4.25-4.25l-2.6-2.6%202.6-2.6v5.2zm-2%205.95v-2.35l-1.8-1.8h-3.2v2h2.85l2.15%202.15z'%20fill='%23fff'/%3e%3c/g%3e%3c/svg%3e":"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20fill='none'%20xmlns:v='https://vecta.io/nano'%3e%3cmask%20id='A'%20maskUnits='userSpaceOnUse'%20x='0'%20y='0'%20width='24'%20height='24'%20mask-type='alpha'%3e%3cpath%20fill='%23d9d9d9'%20d='M0%200h24v24H0z'/%3e%3c/mask%3e%3cg%20mask='url(%23A)'%3e%3cpath%20d='M14%2020.727v-2.05c1.5-.433%202.708-1.267%203.625-2.5S19%2013.543%2019%2011.977s-.458-2.967-1.375-4.2S15.5%205.71%2014%205.277v-2.05c2.067.467%203.75%201.513%205.05%203.138S21%209.86%2021%2011.977s-.65%203.988-1.95%205.612-2.983%202.671-5.05%203.138zM3%2015.002v-6h4l5-5v16l-5-5H3zm11%201v-8.05a4.15%204.15%200%200%201%201.838%201.65c.442.733.662%201.533.662%202.4%200%20.85-.221%201.637-.662%202.363S14.783%2015.635%2014%2016.002zm-4-7.15l-2.15%202.15H5v2h2.85l2.15%202.15v-6.3z'%20fill='%23fff'/%3e%3c/g%3e%3c/svg%3e",alt:"Volume control"})}),d&&t.jsx("div",{className:`${Rl} ${"left"===A?Vl:Nl}`,onClick:t=>t.stopPropagation(),style:{height:`${u}px`,borderRadius:`${u}px`},children:t.jsx("input",{type:"range",min:"0",max:"1",step:"0.01",value:s,onChange:t=>{const e=parseFloat(t.target.value)||1;i&&a(),l(e)},className:Hl,onClick:t=>t.stopPropagation()})})]})},Fl="_historyButton_1xf6c_1",ql="_tooltip_1xf6c_39",zl="_tooltipArrow_1xf6c_59",Ll=({historyUIConfig:n,show:i=!1,onOpenHistory:s,className:o=""})=>{const{enabled:r,buttonSize:a,buttonColor:l,tooltipText:c,tooltipTextSize:u,tooltipTextColor:d,tooltipBackgroundColor:A,tooltipTimeout:h}=n,[m,p]=e.useState(!1),g=e.useRef(null);e.useEffect(()=>{i&&r?(p(!0),g.current&&clearTimeout(g.current),g.current=window.setTimeout(()=>{p(!1),g.current=null},h)):(p(!1),g.current&&(clearTimeout(g.current),g.current=null))},[i,r,h]),e.useEffect(()=>()=>{g.current&&clearTimeout(g.current)},[]);if(!r||!i)return null;const f=.6*a;return t.jsxs("button",{className:`${Fl} ${o}`.trim(),onClick:()=>{s&&s()},"aria-label":"Open history",style:{width:`${a}px`,height:`${a}px`,backgroundColor:l},children:[t.jsx("img",{src:"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='33'%20height='32'%20fill='none'%20xmlns:v='https://vecta.io/nano'%3e%3cmask%20id='A'%20maskUnits='userSpaceOnUse'%20x='0'%20y='0'%20width='33'%20height='32'%20mask-type='alpha'%3e%3cpath%20fill='%23d9d9d9'%20d='M.5%200h32v32H.5z'/%3e%3c/mask%3e%3cg%20mask='url(%23A)'%3e%3cpath%20d='M16.5%2018.001l8-5.333-8-5.333v10.667zM8.1%2029.168a2.5%202.5%200%200%201-1.983-.517A2.56%202.56%200%200%201%205.1%2026.868L3.334%2012.301c-.089-.733.089-1.389.533-1.967s1.033-.911%201.767-1l1.533-.2v10.867c0%201.467.522%202.722%201.567%203.767s2.3%201.567%203.767%201.567h12.4c-.133.533-.4.995-.8%201.383s-.889.617-1.467.683L8.1%2029.168zm4.4-6.5c-.733%200-1.361-.261-1.883-.783s-.783-1.15-.783-1.883V5.335c0-.733.261-1.361.783-1.883s1.15-.783%201.883-.783h14.667c.733%200%201.361.261%201.883.783s.783%201.15.783%201.883v14.667c0%20.733-.261%201.361-.783%201.883s-1.15.783-1.883.783H12.5z'%20fill='%23fff'/%3e%3c/g%3e%3c/svg%3e",alt:"History",style:{width:`${f}px`,height:`${f}px`}}),m&&c&&t.jsxs("span",{className:ql,style:{fontSize:`${u}px`,backgroundColor:A,color:d},children:[(c??"").replace(/<br>/g,"\n"),t.jsx("span",{className:zl,style:{backgroundColor:A}})]})]})},Wl="_drawerOverlay_1eftt_2",Yl="_drawerOverlayScoped_1eftt_16",Gl="_drawerOverlayVisible_1eftt_24",Kl="_drawer_1eftt_2",Xl="_drawerScoped_1eftt_48",Zl="_drawerOpen_1eftt_55",Jl="_drawerHandle_1eftt_60",_l="_drawerContent_1eftt_202",$l="_drawerCloseButton_1eftt_210",tc="_drawerCloseIcon_1eftt_255",ec=({isOpen:n,onClose:i,height:s="50%",maxHeight:o,showHandle:r=!0,showCloseButton:a=!0,className:l="",closeButtonText:c="Close",handleEscKey:u=!0,lockBodyScroll:d=!0,scoped:A=!1,children:h})=>{const m=e.useRef(null),p=e.useRef(null),[g,f]=e.useState(!1);e.useEffect(()=>{n?requestAnimationFrame(()=>{f(!0)}):f(!1)},[n]);const v=t=>{if(!t||t===document.body)return null;const e=t.parentElement;if(!e)return null;const n=window.getComputedStyle(e);return"auto"===n.overflow||"scroll"===n.overflow||"auto"===n.overflowY||"scroll"===n.overflowY||e.scrollHeight>e.clientHeight?e:v(e)};e.useEffect(()=>{if(!d||A)return;const t=t=>{"Escape"===t.key&&n&&i()};if(n){document.addEventListener("keydown",t);const e=(m.current?v(m.current):null)||document.body,n=(()=>{var t;const e=document.createElement("div");e.style.visibility="hidden",e.style.overflow="scroll",e.style.msOverflowStyle="scrollbar",document.body.appendChild(e);const n=document.createElement("div");e.appendChild(n);const i=e.offsetWidth-n.offsetWidth;return null==(t=e.parentNode)||t.removeChild(e),i})(),i=window.getComputedStyle(e).paddingRight,s=parseInt(i,10)||0,o=e.style.overflow,r=e.style.paddingRight;return e.style.overflow="hidden",e===document.body&&(e.style.paddingRight=`${s+n}px`),()=>{document.removeEventListener("keydown",t),e.style.overflow=o,e.style.paddingRight=r}}return()=>{document.removeEventListener("keydown",t)}},[n,i,d]);const y={height:s,...o&&{maxHeight:o}},x=`${Kl} ${A?Xl:""} ${l} ${g?Zl:""}`.trim(),w=`${Wl} ${A?Yl:""} ${g?Gl:""}`.trim();return n?t.jsxs(t.Fragment,{children:[t.jsx("div",{ref:p,className:w,onClick:t=>{t.target===p.current&&i()},"aria-hidden":!1}),t.jsxs("div",{ref:m,className:x,style:y,"aria-hidden":!1,role:"dialog","aria-modal":"true",onKeyDown:t=>{u&&"Escape"===t.key&&i()},tabIndex:-1,children:[r&&t.jsx("div",{className:Jl}),t.jsx("div",{className:_l,children:h}),a&&t.jsxs("button",{className:$l,onClick:i,"aria-label":"Close drawer",children:[t.jsx("img",{src:"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20fill='none'%20xmlns:v='https://vecta.io/nano'%3e%3cmask%20id='A'%20maskUnits='userSpaceOnUse'%20x='0'%20y='0'%20width='24'%20height='24'%20mask-type='alpha'%3e%3cpath%20fill='%23d9d9d9'%20d='M0%200h24v24H0z'/%3e%3c/mask%3e%3cg%20mask='url(%23A)'%3e%3cpath%20d='M6.4%2019L5%2017.6L10.6%2012L5%206.4L6.4%205L12%2010.6L17.6%205L19%206.4L13.4%2012L19%2017.6L17.6%2019L12%2013.4L6.4%2019Z'%20fill='%23fff'/%3e%3c/g%3e%3c/svg%3e",alt:"Close",className:tc}),c]})]})]}):null},nc="_cardListContainer_zrmnf_2",ic="_summaryGridContainer_zrmnf_17",sc="_summaryGridItem_zrmnf_26",oc="_summaryGridItemClickable_zrmnf_34",rc="_gridPlaceholder_zrmnf_39",ac="_gridItemImage_zrmnf_51",lc="_summaryCardItem_zrmnf_58",cc="_summaryCardItemClickable_zrmnf_70",uc="_cardItemImage_zrmnf_75",dc="_cardItemPlaceholder_zrmnf_84",Ac="_cardItemContent_zrmnf_98",hc="_cardItemTitle_zrmnf_107",mc="_cardItemPrice_zrmnf_116",pc=({cards:e,clickable:n=!1,padding:i="20px",layout:s="list",onCardClick:o,cardItemBackgroundColor:r,cardItemTextColor:a})=>{const l=(t,e,n)=>{o&&o(t,e,n)},c=r||"#F2F2F2",u=a||"#181818";return"grid"===s?t.jsx("div",{className:ic,children:e.map((e,i)=>{const s="card"in e?e.card:e;if(!s)return null;const o="image"===s.type?s.imageUrl:s.summaryImage??s.videoThumbnail;return t.jsx("div",{className:`${sc} ${n?oc:""}`,"data-card-id":s.id||"","data-card-url":s.url||"","data-card-position":s.position||"",onClick:n?()=>l(s.id,s.url,s.position):void 0,children:o?t.jsx("img",{src:o,className:ac,alt:"Card image"}):t.jsx("div",{className:rc,style:{background:c,color:u},children:"No image"})},s.id||i)})}):t.jsx("div",{className:nc,style:{padding:"0"===i?"0":i},children:e.map((e,i)=>{const s="card"in e?e.card:e;if(!s)return null;const o="image"===s.type?s.imageUrl:s.summaryImage??s.videoThumbnail;return t.jsxs("div",{className:`${lc} ${n?cc:""}`,style:{background:c,color:u},"data-card-id":s.id||"","data-card-url":s.url||"","data-card-position":s.position||"",onClick:n?()=>l(s.id,s.url,s.position):void 0,children:[o?t.jsx("img",{src:o,className:uc,alt:"Card image"}):t.jsx("div",{className:dc,children:"No image"}),t.jsxs("div",{className:Ac,children:[t.jsx("h4",{className:hc,children:s.title||"Untitled"}),s.price&&t.jsxs("p",{className:mc,children:[s.price," ",s.currency||""]})]})]},s.id||i)})})},gc={summaryContainer:"_summaryContainer_1gtok_3",summaryShareButtonFixed:"_summaryShareButtonFixed_1gtok_14",shareIcon:"_shareIcon_1gtok_47",summaryExplaination:"_summaryExplaination_1gtok_54",summaryTabs:"_summaryTabs_1gtok_71",summaryTab:"_summaryTab_1gtok_71",summaryTabActive:"_summaryTabActive_1gtok_91",summaryEmojiItem:"_summaryEmojiItem_1gtok_96",summaryEmojiItemActive:"_summaryEmojiItemActive_1gtok_103",summaryEmojiButton:"_summaryEmojiButton_1gtok_108",summaryEmojiButtonActive:"_summaryEmojiButtonActive_1gtok_124",summaryEmojiLike:"_summaryEmojiLike_1gtok_132",summaryEmojiLikeActive:"_summaryEmojiLikeActive_1gtok_136",summaryEmojiDislike:"_summaryEmojiDislike_1gtok_142",summaryEmojiDislikeActive:"_summaryEmojiDislikeActive_1gtok_146",summaryEmojiMaybe:"_summaryEmojiMaybe_1gtok_152",summaryEmojiMaybeActive:"_summaryEmojiMaybeActive_1gtok_156",summaryEmojiSeen:"_summaryEmojiSeen_1gtok_162",summaryEmojiSeenActive:"_summaryEmojiSeenActive_1gtok_166",summaryEmojiIcon:"_summaryEmojiIcon_1gtok_194",summaryEmojiLabel:"_summaryEmojiLabel_1gtok_201",summaryContent:"_summaryContent_1gtok_217",summaryPanel:"_summaryPanel_1gtok_226",summaryPanelActive:"_summaryPanelActive_1gtok_241",summaryEmptyState:"_summaryEmptyState_1gtok_246",summaryEmptyStateText:"_summaryEmptyStateText_1gtok_252",summaryExplainationRight:"_summaryExplainationRight_1gtok_259",summaryExplainationLeft:"_summaryExplainationLeft_1gtok_263",summaryExplainationUp:"_summaryExplainationUp_1gtok_267",summaryExplainationDown:"_summaryExplainationDown_1gtok_271"},fc=({cardsByDirection:n,navigationUIConfig:i,summaryUIConfig:s,onCardClick:o,onShareClick:r,visible:a=!0,className:l=""})=>{const c=i.options,{endCardType:u="list",explanationTexts:d={},tabsBackgroundColor:A="#f5f5f5",tabsBorderColor:h="#e0e0e0",cardItemBackgroundColor:m="#F2F2F2",cardItemTextColor:p="#181818",contentBackgroundColor:g="#ffffff",explanationVisible:f=!1}=s,[v,y]=e.useState(null),x={right:wl,left:Cl,up:bl,down:Bl},w=(t,e)=>`${gc.summaryEmojiButton} ${gc[`summaryEmoji${t.charAt(0).toUpperCase()+t.slice(1)}`]||""} ${e?gc.summaryEmojiButtonActive:""} ${e&&gc[`summaryEmoji${t.charAt(0).toUpperCase()+t.slice(1)}Active`]||""}`.trim(),C=e.useMemo(()=>[{key:"right",config:c.right},{key:"up",config:c.up},{key:"down",config:c.down},{key:"left",config:c.left}].filter(t=>t.config.enabled),[c]);e.useEffect(()=>{C.length>0&&null===v&&y(C[0].key)},[C]);const b=(t,e,n)=>{o&&o(t,e,n)};if(!a||0===C.length)return null;const B=100/C.length;return t.jsxs("div",{className:`${gc.summaryContainer} ${l}`.trim(),children:[t.jsx("div",{className:gc.summaryTabs,style:{backgroundColor:A,borderBottom:`1px solid ${h}`},children:C.map(e=>{const n=v===e.key,i={right:"like",left:"dislike",up:"maybe",down:"seen"}[e.key];return t.jsx("div",{className:`${gc.summaryTab} ${n?gc.summaryTabActive:""}`,style:{width:`${B}%`,boxSizing:"border-box"},onClick:()=>y(e.key),children:t.jsxs("div",{className:`${gc.summaryEmojiItem} ${n?gc.summaryEmojiItemActive:""}`,children:[t.jsx("div",{className:w(i,n),children:t.jsx("img",{src:x[e.key],alt:e.config.label,className:gc.summaryEmojiIcon})}),t.jsx("span",{className:gc.summaryEmojiLabel,children:e.config.label})]})},e.key)})}),t.jsx("div",{className:gc.summaryContent,style:{backgroundColor:g},children:C.map(e=>{const i=v===e.key,s=(o=e.key,n[o]||[]);var o;const r=(t=>{var e;return(null==(e=d[t])?void 0:e.replace(/\\A/g,"\n"))||""})(e.key);return t.jsx("div",{className:`${gc.summaryPanel} ${i?gc.summaryPanelActive:""}`,"data-panel":e.key,children:0===s.length?t.jsx("div",{className:gc.summaryEmptyState,style:{color:p},children:t.jsx("h3",{className:gc.summaryEmptyStateText,children:"No cards"})}):t.jsxs(t.Fragment,{children:[r&&t.jsx("div",{className:`${gc.summaryExplaination} ${gc[`summaryExplaination${e.key.charAt(0).toUpperCase()+e.key.slice(1)}`]||""}`,style:{display:f?"flex":"none",background:m,color:p},children:r}),t.jsx(pc,{cards:s,clickable:!0,padding:"20px",layout:u,onCardClick:b,cardItemBackgroundColor:m,cardItemTextColor:p})]})},e.key)})}),r&&t.jsx("button",{className:gc.summaryShareButtonFixed,onClick:()=>{if(!r)return;const t=n.right.map(t=>t.id).filter(t=>null!=t&&""!==t),e=n.up.map(t=>t.id).filter(t=>null!=t&&""!==t);r(t,e)},"aria-label":"Share",children:"share"})]})},vc="_historyDrawerContent_x0jj6_1",yc="_historyDrawerEmpty_x0jj6_15",xc="_historyDrawerEmptyHint_x0jj6_31",wc="_historyDrawer_x0jj6_1",Cc=({isOpen:n,onClose:i,swipeHistory:s,getCardsByDirection:o,historyUIConfig:r,navigationUIConfig:a,summaryUIConfig:l,onCardClick:c,className:u="",scoped:d=!1})=>{const{drawerHeight:A,drawerMaxHeight:h,drawerCloseButtonText:m}=r,p=e.useMemo(()=>({right:o("right"),left:o("left"),up:o("up"),down:o("down")}),[o,s]),g=s.length>0;return t.jsx(ec,{isOpen:n,onClose:i,height:`${A}%`,maxHeight:`${h}%`,showHandle:!0,showCloseButton:!0,closeButtonText:m,scoped:d,className:`${wc} ${u}`.trim(),children:t.jsx("div",{className:vc,children:g?t.jsx(fc,{cardsByDirection:p,navigationUIConfig:a,summaryUIConfig:l,onCardClick:c,visible:!0}):t.jsxs("div",{className:yc,children:[t.jsx("p",{children:"No swipe history yet"}),t.jsx("p",{className:xc,children:"Swipe some cards to see them here"})]})})})},bc="_filtersButton_qio2f_1",Bc="_filtersIcon_qio2f_63",Ec=({filtersUIConfig:e,onClick:n,className:i=""})=>{const{enabled:s,buttonText:o,buttonColor:r,iconSize:a,textColor:l,showIcon:c}=e;if(!s)return null;const u={gap:c&&o?"8px":"0",background:r,color:l},d={width:`${a}px`,height:`${a}px`,color:l};return t.jsxs("button",{className:`${bc} ${i}`.trim(),style:u,onClick:()=>{n&&n()},onFocus:t=>t.currentTarget.blur(),"aria-label":"Open filters",children:[c&&t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:a,height:a,viewBox:"0 0 24 24",fill:"none",stroke:l,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:Bc,style:d,"aria-hidden":"true",children:t.jsx("polygon",{points:"22,3 2,3 10,12.46 10,19 14,21 14,12.46"})}),o&&t.jsx("span",{children:o})]})},Dc="_content_hci8k_2",Ic="_title_hci8k_7",Sc="_categories_hci8k_17",Oc="_pill_hci8k_25",Mc="_noCategories_hci8k_40",jc=({isOpen:n,onClose:i,filtersUIConfig:s,categories:o=[],selectedCategories:r=[],onFilterChange:a,scoped:l=!1,className:c=""})=>{const{drawerCategoriesTitle:u,drawerCloseButtonText:d}=s,A=new Set(r),[h,m]=e.useState(null),p=t=>{const e=new Set(r);"all"===t?e.clear():e.has(t)?e.delete(t):e.add(t),a&&a(Array.from(e))},g=(t,e)=>{const n=h===t,i="all"===t&&0===A.size;return{background:e||i?"#007bff":n?"#e9ecef":"#f5f5f5",color:e||i?"white":"#666",border:"2px solid "+(e||i?"#0056b3":"transparent"),transform:n?"translateY(-1px)":"none"}};return t.jsx(ec,{isOpen:n,onClose:i,height:"auto",maxHeight:"70%",className:c,showHandle:!0,showCloseButton:!0,closeButtonText:d,scoped:l,children:t.jsxs("div",{className:Dc,children:[t.jsx("h3",{className:Ic,children:u}),t.jsx("div",{className:Sc,children:0===o.length?t.jsx("div",{className:Mc,children:"No categories available"}):t.jsxs(t.Fragment,{children:[t.jsx("div",{className:Oc,style:g("all",0===A.size),onMouseEnter:()=>m("all"),onMouseLeave:()=>m(null),onClick:()=>p("all"),children:"All"}),o.map(e=>t.jsx("div",{className:Oc,style:g(e.id,A.has(e.id)),onMouseEnter:()=>m(e.id),onMouseLeave:()=>m(null),onClick:()=>p(e.id),children:e.name},e.id))]})})]})})},kc="_cardsCounter_1h26d_1",Qc=({cardsCounterUIConfig:e,currentCardIndex:n,totalCards:i,className:s=""})=>{const{enabled:o,text:r,textSize:a}=e;if(!o)return null;const l=Math.min(n+1,i);let c;return c=e.text.includes("{current}")||e.text.includes("{total}")?r.replace(/{current}/g,l.toString()).replace(/{total}/g,i.toString()):`${r} ${l} / ${i}`,t.jsx("div",{className:`${kc} ${s}`.trim(),style:{fontSize:a},children:c})},Tc="_logo_1rzq2_1",Pc=({logoUIConfig:e,visible:n,className:i=""})=>{const{enabled:s,url:o,size:r}=e;if(!s||!o||!n)return null;const a={...void 0!==r&&{width:`${r}px`}};return t.jsx("img",{src:o,alt:"Logo",className:`${Tc} ${i}`.trim(),style:a})},Rc="_container_18bki_1",Hc=({children:e,x:n,y:i,centered:s=!1,zIndex:o,className:r=""})=>{const a={...void 0!==n&&{left:"number"==typeof n?`${n}px`:n},...void 0!==i&&{top:"number"==typeof i?`${i}px`:i},...s&&{transform:"translate(-50%, -50%)"},...void 0!==o&&{zIndex:o}};return t.jsx("div",{className:`${Rc} ${r}`.trim(),style:a,children:e})},Vc=e.createContext(void 0),Nc=({children:n,dataService:i,finderId:s,backendUrl:o,data:r,initialCards:a=[],initialFinder:l=null,initialCategories:c=[]})=>{const u=e.useRef(!1),[d,A]=e.useState(()=>r?i.processApiResponse(r).cards:a),[h,m]=e.useState(()=>r?i.processApiResponse(r).finder:l),[p,g]=e.useState(()=>r?i.processApiResponse(r).categories:c),[f,v]=e.useState(!1),[y,x]=e.useState(null);e.useEffect(()=>{if(r){const t=i.processApiResponse(r);m(t.finder),A(t.cards),g(t.categories),v(!1),x(null),u.current=!0}},[r,i]);const w=e.useCallback(async()=>{if(s&&o){v(!0),x(null);try{const t=await i.loadFinderFromApi(s,o);m(t.finder),A(t.cards),g(t.categories)}catch(t){const e=t instanceof Error?t.message:"Failed to load finder";x(e)}finally{v(!1),u.current=!0}}else x("finderId and backendUrl are required to load finder")},[i,s,o]);e.useEffect(()=>{r||w()},[w,r]);const C={cards:d,finder:h,categories:p,loading:f,error:y,isInitiallyLoaded:u.current,setCards:A,setFinder:m,setCategories:g,loadFinder:w};return t.jsx(Vc.Provider,{value:C,children:n})},Uc=()=>{const t=e.useContext(Vc);if(void 0===t)throw new Error("useData must be used within a DataProvider");return t},Fc=e.createContext(void 0),qc=({children:n})=>{const{finder:i,isInitiallyLoaded:s}=Uc(),[o,r]=e.useState(0),[a,l]=e.useState([]),[c,u]=e.useState(!1),[d,A]=e.useState(!0),[h,m]=e.useState(!1),[p,g]=e.useState(!1),[f,v]=e.useState(!0),[y,x]=e.useState(.5),[w,C]=e.useState(!0),[b,B]=e.useState([]),[E,D]=e.useState([]),[I,S]=e.useState([]);e.useEffect(()=>{s&&i&&(v(0===i.initialVolume),x(i.initialVolume))},[s,i]);const O=e.useCallback((t,e)=>{l(n=>{const i=n.findIndex(t=>t.card.id&&e.id&&t.card.id===e.id);return[...-1!==i?n.filter((t,e)=>e!==i):n,{direction:t,card:e,timestamp:Date.now()}]})},[]),M=e.useCallback(()=>{l([])},[]),j=e.useCallback(t=>a.filter(e=>e.direction===t).map(t=>t.card),[a]),k=e.useCallback(()=>{v(t=>!t)},[]),Q=e.useCallback(t=>{x(t)},[]),T=e.useCallback(t=>{setTimeout(()=>{C(!0)},t)},[]),P=e.useCallback(t=>{B(t),D(t),S([])},[]);e.useEffect(()=>{let t;t=0===I.length?[...b]:b.filter(t=>t.categoryIds&&t.categoryIds.some(t=>I.includes(t))),D(t),b.length>0&&r(0)},[I,b]);const R={currentCardIndex:o,swipeHistory:a,isAnimating:c,demoActive:d,noMoreCards:h,userHasInteracted:p,isMuted:f,volume:y,logoVisible:w,allCards:b,filteredCards:E,selectedCategories:I,setCurrentCardIndex:r,addSwipeToHistory:O,clearSwipeHistory:M,setIsAnimating:u,setDemoActive:A,setNoMoreCards:m,setUserHasInteracted:g,getCardsByDirection:j,setIsMuted:v,setVolume:Q,toggleMute:k,showLogo:T,setCards:P,setSelectedCategories:S};return t.jsx(Fc.Provider,{value:R,children:n})},zc=()=>{const t=e.useContext(Fc);if(void 0===t)throw new Error("useAppState must be used within an AppStateProvider");return t},Lc=e.createContext(void 0),Wc=({children:n,monitorService:i,finderId:s})=>{const[o]=e.useState(()=>crypto.randomUUID()),r=e.useRef({}),[a,l]=e.useState(!1),c=e.useRef([]),u=e.useCallback(()=>{const t=[...c.current];c.current=[],t.forEach(t=>{i.sendEvent({sessionId:o,finderId:s,event:t.event,cardId:t.cardId,cardViewDuration:t.cardViewDuration,direction:t.direction})})},[i,o,s]),d=e.useCallback(()=>{!a&&c.current.length>0&&u(),l(!0)},[a,u]),A=e.useCallback(t=>{a?i.sendEvent({sessionId:o,finderId:s,event:t.event,cardId:t.cardId,cardViewDuration:t.cardViewDuration,direction:t.direction}):c.current.push({...t,finderId:s,timestamp:Date.now()})},[i,o,a]),h=e.useCallback(()=>{s&&A({event:"impression"})},[s,A]),m=e.useCallback(t=>{s&&(r.current[t]=Date.now(),A({event:"impression",cardId:t}))},[s,A]),p=e.useCallback(t=>{r.current[t]=Date.now()},[]),g=e.useCallback((t,e)=>{if(s){let n=0;r.current[t]&&(n=(Date.now()-r.current[t])/1e3,delete r.current[t]),A({event:"swipe",cardId:t,direction:e,cardViewDuration:Math.round(n)})}},[s,A]),f=e.useCallback(t=>{s&&A({event:"click",cardId:t})},[s,A]),v=e.useCallback(()=>{s&&A({event:"click"})},[s,A]),y=e.useMemo(()=>({sessionId:o,sendImpressionEvent:m,sendSwipeEvent:g,sendClickEvent:f,sendButtonClickEvent:v,sendCreativeImpressionEvent:h,startCardImpression:p,setConsentGranted:d}),[o,m,g,f,v,h,p,d]);return t.jsx(Lc.Provider,{value:y,children:n})},Yc="_interactiveFeed_1wsuw_1",Gc=({cards:n,categories:i=[],finderUiConfig:s,buttonStyle:o="vertical-emojis",maxVisibleCards:r=2,volumeControlUIConfig:a,historyUIConfig:l,onOpenHistory:c,onHistoryCardClick:u,filtersUIConfig:d,onFilterChange:A,onAllCardsSwiped:h,onCardSwiped:m,initialMuted:p=!0,cardsCounterUIConfig:g,navigationUIConfig:f,summaryUIConfig:v,logoUIConfig:y,className:x="",id:w})=>{const{currentCardIndex:C,setCurrentCardIndex:b,swipeHistory:B,getCardsByDirection:E,isMuted:D,volume:I,toggleMute:S,setVolume:O,showLogo:M,logoVisible:j,filteredCards:k,selectedCategories:Q,setCards:T,setSelectedCategories:P,addSwipeToHistory:R,setIsAnimating:H,isAnimating:V,setNoMoreCards:N}=zc(),{sendSwipeEvent:U,sendImpressionEvent:F,startCardImpression:q}=(()=>{const t=e.useContext(Lc);if(void 0===t)throw new Error("useMonitoring must be used within a MonitoringProvider");return t})();e.useEffect(()=>{(null==y?void 0:y.url)&&y.autoHideTimeout>0&&M(y.autoHideTimeout)},[y,M]),e.useEffect(()=>{T(n)},[n,T]);const[z,L]=e.useState(!1),[W,Y]=e.useState(!1),G=e.useCallback(t=>{P(t),A&&A(t)},[P,A]),K=e.useMemo(()=>C>0,[C]),X=e.useMemo(()=>i,[i]),Z=e.useCallback(()=>{L(!0),c&&c()},[c]),J=e.useCallback(()=>{L(!1)},[]),_=e.useCallback(()=>{Y(!0)},[]),$=e.useCallback(()=>{Y(!1)},[]);return t.jsxs("div",{className:Yc,children:[t.jsx(Ol,{cards:k,finderUiConfig:s,buttonStyle:o,maxVisibleCards:r,isMuted:D,volume:I,currentCardIndex:C,setCurrentCardIndex:b,addSwipeToHistory:R,setIsAnimating:H,isAnimating:V,setNoMoreCards:N,sendSwipeEvent:U,sendImpressionEvent:F,startCardImpression:q,onAllCardsSwiped:h,onCardSwiped:m,id:w}),a.enabled&&t.jsx(Ul,{volumeControlUIConfig:a,isMuted:D,volume:I,onToggleMute:S,onVolumeChange:O}),l.enabled&&t.jsx(Hc,{x:`${l.buttonLeftPosition}%`,y:100-l.buttonBottomPosition+"%",centered:!0,zIndex:1e3,children:t.jsx(Ll,{historyUIConfig:l,show:K,onOpenHistory:Z})}),d.enabled&&t.jsx(Hc,{x:`${d.buttonLeftPosition}%`,y:100-d.buttonBottomPosition+"%",centered:50===d.buttonLeftPosition,zIndex:1e3,children:t.jsx(Ec,{filtersUIConfig:d,onClick:_})}),d.enabled&&t.jsx(jc,{isOpen:W,onClose:$,filtersUIConfig:d,categories:X,selectedCategories:Q,onFilterChange:G,scoped:!0}),l.enabled&&t.jsx(Cc,{isOpen:z,onClose:J,swipeHistory:B,getCardsByDirection:E,historyUIConfig:l,navigationUIConfig:f,summaryUIConfig:v,onCardClick:u,scoped:!0}),g.enabled&&t.jsx(Hc,{x:`${g.positionLeft}%`,y:100-g.positionBottom+"%",zIndex:100,children:t.jsx(Qc,{cardsCounterUIConfig:g,currentCardIndex:C,totalCards:k.length})}),y.enabled&&t.jsx(Hc,{x:`${y.positionX}%`,y:`${y.positionY}%`,centered:!0,zIndex:100,children:t.jsx(Pc,{logoUIConfig:y,visible:j})})]})},Kc="_swippingJourney_15509_1",Xc=({summaryEnabled:n=!0,finderUiConfig:i,onSummaryCardClick:s,onSummaryShareClick:o,onAllCardsSwiped:r})=>{const{cards:a,finder:l,categories:c}=Uc(),{noMoreCards:u,getCardsByDirection:d,swipeHistory:A}=zc(),[h,m]=e.useState(!1),p=i??l,g=e.useCallback(()=>{r&&r(),n&&m(!0)},[r,n]);e.useEffect(()=>{m(!(!u||!n))},[u,n]);const f=e.useMemo(()=>({right:d("right"),left:d("left"),up:d("up"),down:d("down")}),[d,A]);return p?h&&n?t.jsx("div",{className:Kc,children:t.jsx(fc,{cardsByDirection:f,navigationUIConfig:p.navigation,summaryUIConfig:p.summary,onCardClick:s,onShareClick:o,visible:!0})}):t.jsx("div",{className:Kc,children:t.jsx(Gc,{cards:a,finderUiConfig:p,categories:c,historyUIConfig:p.history,filtersUIConfig:p.filters,volumeControlUIConfig:p.volumeControl,cardsCounterUIConfig:p.cardsCounter,navigationUIConfig:p.navigation,summaryUIConfig:p.summary,logoUIConfig:p.logo,onAllCardsSwiped:g})}):null},Zc="_mainBootstrap_1rzog_1";function Jc(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var _c,$c={exports:{}};_c=$c,function(){var t={}.hasOwnProperty;function e(){for(var t="",e=0;e<arguments.length;e++){var s=arguments[e];s&&(t=i(t,n(s)))}return t}function n(n){if("string"==typeof n||"number"==typeof n)return n;if("object"!=typeof n)return"";if(Array.isArray(n))return e.apply(null,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var s="";for(var o in n)t.call(n,o)&&n[o]&&(s=i(s,o));return s}function i(t,e){return e?t?t+" "+e:t+e:t}_c.exports?(e.default=e,_c.exports=e):window.classNames=e}();const tu=Jc($c.exports),eu=e.createContext(void 0),nu=({children:n})=>{const[i,s]=e.useState(!1),[o,r]=e.useState(!1),[a,l]=e.useState(!1),[c,u]=e.useState([]),[d,A]=e.useState(!0),h={buttonsVisible:i,summaryVisible:o,ctaTooltipVisible:a,selectedCategories:c,logoVisible:d,showButtons:e.useCallback(()=>{s(!0)},[]),hideButtons:e.useCallback(()=>{s(!1)},[]),showSummary:e.useCallback(()=>{r(!0)},[]),hideSummary:e.useCallback(()=>{r(!1)},[]),showCtaTooltip:e.useCallback(()=>{l(!0)},[]),hideCtaTooltip:e.useCallback(()=>{l(!1)},[]),setSelectedCategories:u,toggleLogo:e.useCallback(t=>{A(t)},[])};return t.jsx(eu.Provider,{value:h,children:n})},iu=({children:e,monitorService:n,dataService:i,backendUrl:s,finderId:o,data:r})=>t.jsx(Nc,{dataService:i,finderId:o,backendUrl:s,data:r,children:t.jsx(qc,{children:t.jsx(nu,{children:t.jsx(Wc,{monitorService:n,finderId:o,children:e})})})}),su=({monitorService:e,dataService:n,backendUrl:i,finderId:s,className:o="",data:r})=>t.jsx("div",{className:tu(Zc,o),children:t.jsx(iu,{monitorService:e,dataService:n,backendUrl:i,finderId:s,data:r,children:t.jsx(Xc,{})})});class ou{getMonitorUrl(){if("undefined"==typeof window)throw new Error("window is not available");if(!window.SWIPEFINDER_CAMPAIGN_MONITOR_URL)throw new Error("SWIPEFINDER_CAMPAIGN_MONITOR_URL is not set");return window.SWIPEFINDER_CAMPAIGN_MONITOR_URL}sendEvent(t){try{const e=this.getMonitorUrl();fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({finder_id:t.finderId,event_type:t.event,session_id:t.sessionId,card_id:t.cardId,card_view_duration:t.cardViewDuration,swipe_direction:t.direction})}).catch(t=>{})}catch(e){}}}class ru{processApiResponse(t){return{finder:t.finder,cards:(e=t.cards.items,e.map(t=>{if("image"===t.type){const{image:e,...n}=t;return{...n,imageUrl:e||t.imageUrl||""}}if("video"===t.type){const{video:e,...n}=t;return{...n,videoUrl:e||t.videoUrl||""}}return t})),categories:t.categories};var e}async loadFinderFromApi(t,e){try{const n=`${e}/api/finders/${t}/queue`,i=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({categories:[],exclude:[]})});if(!i.ok)throw new Error(`API returned status: ${i.status}`);const s=await i.json();return this.processApiResponse(s)}catch(n){return{finder:null,cards:[],categories:[]}}}}exports.SwipeFinder=({backendUrl:n,finderId:i,className:s,data:o,...r})=>{const a=e.useMemo(()=>new ou,[]),l=e.useMemo(()=>new ru,[]);return t.jsx(su,{monitorService:a,dataService:l,backendUrl:n,finderId:i,className:s,data:o,...r})};
1
+ (function(){if(typeof document!=="undefined"){var s=document.createElement("style");s.textContent="._card_doqsx_2{position:absolute;width:100%;height:100%;left:0;top:0;background-color:#fff;box-shadow:0 2px 8px #0003;overflow:hidden;transition:transform .3s ease;cursor:default;transform-origin:50% 100%;will-change:transform;z-index:1}._cardContent_doqsx_18{position:absolute;z-index:2;bottom:0;left:0;width:100%;height:100%;color:#fff}._gradientBottom_doqsx_29{position:absolute;z-index:1;bottom:0;left:0;width:100%;height:120px;background:linear-gradient(transparent,#000);pointer-events:none}._gradientTop_doqsx_41{position:absolute;z-index:1;top:0;left:0;width:100%;height:120px;background:linear-gradient(rgba(0,0,0,1),transparent);pointer-events:none}._cardName_doqsx_52{position:absolute;left:0;bottom:10%;font-weight:700;font-size:22px;padding:0 20px;text-shadow:1px 1px 2px rgba(0,0,0,.8);width:100%;text-align:left;white-space:pre-wrap}._image_trs4h_2{width:100%;height:100%;object-fit:cover}._videoContainer_119iz_3{width:100%;height:100%;position:relative;overflow:hidden}._cardVideo_119iz_10{width:100%;height:100%;object-fit:cover;position:absolute;top:0;left:0;z-index:1}._swipeableCard_14c6z_1{position:relative;width:100%;height:100%;will-change:transform,opacity;backface-visibility:hidden;-webkit-backface-visibility:hidden;touch-action:none;user-select:none;-webkit-user-select:none;pointer-events:auto}._swipeableCard_14c6z_1>*{pointer-events:none}._swipeableCard_14c6z_1 video,._swipeableCard_14c6z_1 img{pointer-events:none}._swipeHeadline_14c6z_25{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);font-size:24px;font-weight:700;color:#fff;z-index:200000}._ctaTooltip_1mai4_2{position:absolute;z-index:110;font-size:12px;top:0;right:-2px;background-color:#fff;color:#333;padding:10px 14px;border-radius:8px;font-weight:800;text-align:center;width:max-content;transition:opacity .3s ease;pointer-events:none;animation:_ctaTooltipBounce_1mai4_1 2s infinite;box-shadow:0 0 16px 1px #000;white-space:pre-line}._ctaTooltipArrow_1mai4_22{position:absolute;bottom:-8px;width:16px;height:16px;transform:translate(50%) rotate(45deg);z-index:0}@keyframes _ctaTooltipBounce_1mai4_1{0%,20%,50%,80%,to{transform:translateY(calc(-100% - 16px))}40%{transform:translateY(calc(-100% - 24px))}60%{transform:translateY(calc(-100% - 20px))}}._verticalEmojisButtons_14t5d_2{position:absolute;display:flex;flex-direction:column;align-items:center;z-index:100}._buttonContainer_14t5d_11{display:flex;flex-direction:column;align-items:center;justify-content:center;margin:8px 0}._button_14t5d_11{width:40px;height:40px;border-radius:50%;display:flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:0 2px 5px #0003;background-color:#fff;position:relative;-webkit-user-select:none;user-select:none;transition:transform .2s ease,background-color .2s ease;outline:none;border:none;-webkit-tap-highlight-color:transparent}._button_14t5d_11:focus,._button_14t5d_11:active{outline:none;border:none}._emojiIcon_14t5d_45{width:35px;height:35px;display:block;outline:none;pointer-events:none;position:relative;z-index:2}._buttonLabel_14t5d_56{white-space:pre-wrap;margin-top:5px}._buttonAnimation_14t5d_62{transform:scale(1.3);z-index:101;position:relative}._buttonAnimation_14t5d_62:before{content:\"\";position:absolute;top:-5px;left:-5px;right:-5px;bottom:-5px;border-radius:50%;border:5px solid rgba(255,255,255,.5);z-index:1}._buttonLikeAnimation_14t5d_80{background-color:#4cd964!important;transform:scale(1.3)!important}._buttonDislikeAnimation_14t5d_85{background-color:#ff3b30!important;transform:scale(1.3)!important}._buttonMaybeAnimation_14t5d_90{background-color:#fc0!important;transform:scale(1.3)!important}._buttonSeenAnimation_14t5d_95{background-color:#007aff!important;transform:scale(1.3)!important}._contrastMode_14t5d_101 ._buttonContainer_14t5d_11{display:flex;flex-direction:column;align-items:center;justify-content:center;margin:8px 0}._contrastModeButton_14t5d_109{background-color:#fffc!important;border:2px solid black!important;box-shadow:0 0 8px #00000080!important}._contrastModeButton_14t5d_109:hover{background-color:#fff!important}._contrastModeLabel_14t5d_119{color:#fff!important;text-shadow:1px 1px 3px black,-1px -1px 3px black,1px -1px 3px black,-1px 1px 3px black!important;font-weight:700!important;font-size:12px!important;text-align:center!important;display:block!important;margin-top:5px!important;text-transform:uppercase}._contrastModeLike_14t5d_130,._contrastModeDislike_14t5d_135,._contrastModeMaybe_14t5d_140,._contrastModeSeen_14t5d_145{color:#fff!important;filter:brightness(1.5)!important}._sideButtonsContainer_jjr9u_2{position:absolute;width:100%;height:100%;left:0;top:0;display:flex;justify-content:center;align-items:center;z-index:100;pointer-events:none}._sideButtonsWrapper_jjr9u_16{position:relative;width:100%;height:100%;display:grid;grid-template-columns:1fr auto 1fr;grid-template-rows:auto 1fr auto;padding:15px;box-sizing:border-box}._sideButtonContainer_jjr9u_28{display:flex;align-items:center;flex-direction:column;gap:4px}._sideButtonLeft_jjr9u_36{grid-column:1;grid-row:2;margin-right:auto;justify-self:start;align-self:center}._sideButtonRight_jjr9u_45{grid-column:3;grid-row:2;margin-left:auto;justify-self:end;align-self:center}._sideButtonTop_jjr9u_54{grid-column:2;grid-row:1;justify-self:center;align-self:start}._sideButtonBottom_jjr9u_62{grid-column:2;grid-row:3;justify-self:center;align-self:end}._sideButton_jjr9u_2{border-radius:50%;display:flex;flex-direction:column;align-items:center;justify-content:center;border:2px solid rgba(255,255,255,.4);background-color:#ffffffb3;backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);box-shadow:0 4px 12px #0000004d;transition:all .3s ease;-webkit-tap-highlight-color:transparent;pointer-events:auto;padding:0;margin:0;gap:4px}._sideButton_jjr9u_2:hover{border-color:#fff;background-color:#ffffffe6}._buttonContent_jjr9u_95{position:relative;display:flex;align-items:center;justify-content:center}._arrowWrapper_jjr9u_103,._emojiWrapper_jjr9u_104{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center}._arrowWrapper_jjr9u_103 svg{color:#000}._arrowRight_jjr9u_120{transform:rotate(0)}._arrowLeft_jjr9u_124{transform:rotate(180deg)}._arrowUp_jjr9u_128{transform:rotate(-90deg)}._arrowDown_jjr9u_132{transform:rotate(90deg)}._emojiIcon_jjr9u_137{pointer-events:none;user-select:none;-webkit-user-select:none}._buttonLabel_jjr9u_144{white-space:pre-wrap;text-align:center;color:#000;font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:.1em;line-height:1.2;user-select:none;-webkit-user-select:none;margin-top:0}@keyframes _moveRight_jjr9u_1{0%{transform:rotate(0) translate(0);opacity:.7}10%{transform:rotate(0) translate(6px);opacity:1}15%{transform:rotate(0) translate(12px);opacity:1}20%{transform:rotate(0) translate(12px);opacity:1}25%{transform:rotate(0) translate(0);opacity:.7}25.01%,to{transform:rotate(0) translate(0);opacity:.7}}@keyframes _moveLeft_jjr9u_1{0%,24.99%{transform:rotate(180deg) translate(0);opacity:.7}25%{transform:rotate(180deg) translate(0);opacity:.7}35%{transform:rotate(180deg) translate(6px);opacity:1}40%{transform:rotate(180deg) translate(12px);opacity:1}45%{transform:rotate(180deg) translate(12px);opacity:1}50%{transform:rotate(180deg) translate(0);opacity:.7}50.01%,to{transform:rotate(180deg) translate(0);opacity:.7}}@keyframes _moveUp_jjr9u_1{0%,49.99%{transform:rotate(-90deg) translate(0);opacity:.7}50%{transform:rotate(-90deg) translate(0);opacity:.7}60%{transform:rotate(-90deg) translate(6px);opacity:1}65%{transform:rotate(-90deg) translate(12px);opacity:1}70%{transform:rotate(-90deg) translate(12px);opacity:1}75%{transform:rotate(-90deg) translate(0);opacity:.7}75.01%,to{transform:rotate(-90deg) translate(0);opacity:.7}}@keyframes _moveDown_jjr9u_1{0%,74.99%{transform:rotate(90deg) translate(0);opacity:.7}75%{transform:rotate(90deg) translate(0);opacity:.7}85%{transform:rotate(90deg) translate(6px);opacity:1}90%{transform:rotate(90deg) translate(12px);opacity:1}95%{transform:rotate(90deg) translate(12px);opacity:1}to{transform:rotate(90deg) translate(0);opacity:.7}}._sideButton_jjr9u_2.like-btn ._arrowWrapper_jjr9u_103 svg._arrowRight_jjr9u_120{animation:_moveRight_jjr9u_1 8s infinite}._sideButton_jjr9u_2.dislike-btn ._arrowWrapper_jjr9u_103 svg._arrowLeft_jjr9u_124{animation:_moveLeft_jjr9u_1 8s infinite}._sideButton_jjr9u_2.maybe-btn ._arrowWrapper_jjr9u_103 svg._arrowUp_jjr9u_128{animation:_moveUp_jjr9u_1 8s infinite}._sideButton_jjr9u_2.seen-btn ._arrowWrapper_jjr9u_103 svg._arrowDown_jjr9u_132{animation:_moveDown_jjr9u_1 8s infinite}._horizontalCtaTooltip_1slua_1{position:absolute;transform:translate(-50%) translateY(-25%);left:50%;padding:10px 15px;border-radius:6px;font-weight:500;text-align:center;z-index:100;transition:opacity .3s ease;box-shadow:0 2px 8px #0003;animation:_horizontalCtaTooltipPulse_1slua_1 2s infinite ease-in-out;white-space:pre-line;background-color:#fff;color:#333;font-size:12px}._contrastMode_1slua_19 ._horizontalCtaTooltip_1slua_1{background-color:#00000080;color:#fff;border:1px solid white;font-weight:600}@keyframes _horizontalCtaTooltipPulse_1slua_1{0%{transform:translate(-50%) translateY(-25%) scale(1)}50%{transform:translate(-50%) translateY(-25%) scale(1.1)}to{transform:translate(-50%) translateY(-25%) scale(1)}}._sideButtonsContainer_1kkly_2{position:absolute;width:100%;height:100%;left:0;top:0;display:flex;justify-content:center;align-items:center;z-index:100;pointer-events:none}._sideButtonsWrapper_1kkly_16{position:relative;width:100%;height:100%;display:grid;grid-template-columns:1fr auto 1fr;grid-template-rows:auto 1fr auto;padding:15px;box-sizing:border-box}._sideButtonContainer_1kkly_28{display:flex;align-items:center;flex-direction:column;gap:4px}._sideButtonLeft_1kkly_36{grid-column:1;grid-row:2;margin-right:auto;justify-self:start;align-self:center}._sideButtonRight_1kkly_45{grid-column:3;grid-row:2;margin-left:auto;justify-self:end;align-self:center}._sideButtonTop_1kkly_54{grid-column:2;grid-row:1;justify-self:center;align-self:start}._sideButtonBottom_1kkly_62{grid-column:2;grid-row:3;justify-self:center;align-self:end}._sideButton_1kkly_2{border-radius:50%;display:flex;flex-direction:column;align-items:center;justify-content:center;border:2px solid rgba(255,255,255,.4);background-color:#ffffffb3;backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);box-shadow:0 4px 12px #0000004d;transition:all .3s ease;-webkit-tap-highlight-color:transparent;pointer-events:auto;padding:0;margin:0;gap:4px;-webkit-touch-callout:none;-webkit-user-select:none;touch-action:manipulation;cursor:pointer}._sideButton_1kkly_2:hover{border-color:#fff;background-color:#ffffffe6}._buttonContent_1kkly_99{position:relative;display:flex;align-items:center;justify-content:center}._buttonContent_1kkly_99 svg{color:#000}._buttonLabel_1kkly_111{white-space:pre-wrap;text-align:center;color:#000;font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:.1em;line-height:1.2;user-select:none;-webkit-user-select:none;margin-top:0}._arrowRight_1kkly_126{transform:rotate(0)}._arrowLeft_1kkly_130{transform:rotate(180deg)}._arrowUp_1kkly_134{transform:rotate(-90deg)}._arrowDown_1kkly_138{transform:rotate(90deg)}@keyframes _moveRight_1kkly_1{0%{transform:rotate(0) translate(0);opacity:.7}10%{transform:rotate(0) translate(6px);opacity:1}15%{transform:rotate(0) translate(12px);opacity:1}20%{transform:rotate(0) translate(12px);opacity:1}25%{transform:rotate(0) translate(0);opacity:.7}25.01%,to{transform:rotate(0) translate(0);opacity:.7}}@keyframes _moveLeft_1kkly_1{0%,24.99%{transform:rotate(180deg) translate(0);opacity:.7}25%{transform:rotate(180deg) translate(0);opacity:.7}35%{transform:rotate(180deg) translate(6px);opacity:1}40%{transform:rotate(180deg) translate(12px);opacity:1}45%{transform:rotate(180deg) translate(12px);opacity:1}50%{transform:rotate(180deg) translate(0);opacity:.7}50.01%,to{transform:rotate(180deg) translate(0);opacity:.7}}@keyframes _moveUp_1kkly_1{0%,49.99%{transform:rotate(-90deg) translate(0);opacity:.7}50%{transform:rotate(-90deg) translate(0);opacity:.7}60%{transform:rotate(-90deg) translate(6px);opacity:1}65%{transform:rotate(-90deg) translate(12px);opacity:1}70%{transform:rotate(-90deg) translate(12px);opacity:1}75%{transform:rotate(-90deg) translate(0);opacity:.7}75.01%,to{transform:rotate(-90deg) translate(0);opacity:.7}}@keyframes _moveDown_1kkly_1{0%,74.99%{transform:rotate(90deg) translate(0);opacity:.7}75%{transform:rotate(90deg) translate(0);opacity:.7}85%{transform:rotate(90deg) translate(6px);opacity:1}90%{transform:rotate(90deg) translate(12px);opacity:1}95%{transform:rotate(90deg) translate(12px);opacity:1}to{transform:rotate(90deg) translate(0);opacity:.7}}._sideButton_1kkly_2.like-btn ._buttonContent_1kkly_99 svg._arrowRight_1kkly_126{animation:_moveRight_1kkly_1 8s infinite}._sideButton_1kkly_2.dislike-btn ._buttonContent_1kkly_99 svg._arrowLeft_1kkly_130{animation:_moveLeft_1kkly_1 8s infinite}._sideButton_1kkly_2.maybe-btn ._buttonContent_1kkly_99 svg._arrowUp_1kkly_134{animation:_moveUp_1kkly_1 8s infinite}._sideButton_1kkly_2.seen-btn ._buttonContent_1kkly_99 svg._arrowDown_1kkly_138{animation:_moveDown_1kkly_1 8s infinite}._tooltipWrapper_1kkly_277{grid-column:2;grid-row:2;display:flex;align-items:center;justify-content:center}._swipeTutorialOverlay_jbb64_2{position:absolute;width:100%;height:100%;left:0;top:0;display:flex;justify-content:center;align-items:center;z-index:100;pointer-events:none}._handContainer_jbb64_16{display:flex;align-items:center;justify-content:center;pointer-events:none}._handIcon_jbb64_24{filter:drop-shadow(0 4px 8px rgba(0,0,0,.3));opacity:.9}._swipeableFeed_jamse_1{position:relative;width:100%;height:100%;overflow:hidden}._swipeableFeedCards_jamse_8{position:relative;width:100%;height:100%}._swipeableFeedCards_jamse_8>*{position:absolute;top:0;left:0;width:100%;height:100%}._swipeableFeedEmpty_jamse_22{display:flex;align-items:center;justify-content:center;width:100%;height:100%;color:#666;font-size:16px;text-align:center}._swipeTutorialContainer_jamse_33{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;z-index:150}._volumeControl_r52gg_2{position:absolute;z-index:1100;display:flex;align-items:center;gap:8px;margin:0}._volumeControlTopLeft_r52gg_12{top:10px;left:10px}._volumeControlTopRight_r52gg_17{top:10px;right:10px;flex-direction:row-reverse}._volumeControlBottomLeft_r52gg_23{bottom:80px;left:15px}._volumeControlBottomRight_r52gg_28{bottom:80px;right:15px;flex-direction:row-reverse}._volumeControlButton_r52gg_34{width:auto;height:30px;cursor:pointer;background-color:#0006;border-radius:50%;transition:background-color .2s ease;display:flex;align-items:center;justify-content:center;padding:4px;box-sizing:border-box;flex-shrink:0}._volumeControlButton_r52gg_34:hover{background-color:#000000b3}._volumeControlButton_r52gg_34 img{width:100%;height:100%;object-fit:contain}._volumeSlider_r52gg_60{background-color:#0006;border-radius:20px;padding:8px 12px;display:flex;align-items:center;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);opacity:0;pointer-events:none;transition:opacity .2s ease}._volumeSlider_r52gg_60:hover{background-color:#000000b3}._volumeControl_r52gg_2:hover ._volumeSlider_r52gg_60{opacity:1;pointer-events:auto}._volumeSliderInput_r52gg_81{width:100px;height:4px;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:#ffffff4d;border-radius:2px;outline:none;cursor:pointer}._volumeSliderInput_r52gg_81::-webkit-slider-thumb{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:12px;height:12px;border-radius:50%;background:#fff;cursor:pointer;transition:transform .1s ease}._volumeSliderInput_r52gg_81::-webkit-slider-thumb:hover{transform:scale(1.2)}._volumeSliderInput_r52gg_81::-moz-range-thumb{width:12px;height:12px;border-radius:50%;background:#fff;cursor:pointer;border:none;transition:transform .1s ease}._volumeSliderInput_r52gg_81::-moz-range-thumb:hover{transform:scale(1.2)}._historyButton_1xf6c_1{border-radius:50%;border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;z-index:1000;box-shadow:16px 20px 8px #00000026,inset -4px -4px 10px #0003;background-image:linear-gradient(135deg,#fff3,#0003);outline:none;-webkit-tap-highlight-color:transparent;-webkit-appearance:none;-moz-appearance:none;appearance:none}._historyCardsContent_1xf6c_17{margin:12px 0}._historyButton_1xf6c_1:focus{outline:none}._historyButton_1xf6c_1:active{outline:none;-webkit-tap-highlight-color:transparent}._historyButton_1xf6c_1:focus-visible{outline:none}._historyButton_1xf6c_1 img{pointer-events:none}._tooltip_1xf6c_39{display:flex;z-index:110;line-height:1.2;padding:10px 14px;position:absolute;top:0;border-radius:8px;font-weight:800;text-align:center;width:max-content;transition:opacity .3s ease;box-shadow:0 0 16px 1px #000;left:50%;white-space:pre-line;transform:translate(-50%) translateY(calc(-100% - 16px));animation:_historyButtonTooltipBounce_1xf6c_1 2s infinite}._tooltipArrow_1xf6c_59{position:absolute;bottom:-8px;left:50%;width:16px;height:16px;transform:translate(-50%) rotate(45deg);z-index:0}@keyframes _historyButtonTooltipBounce_1xf6c_1{0%,20%,50%,80%,to{transform:translate(-50%) translateY(calc(-100% - 16px))}40%{transform:translate(-50%) translateY(calc(-100% - 24px))}60%{transform:translate(-50%) translateY(calc(-100% - 20px))}}._drawerOverlay_1eftt_2{position:fixed;top:0;left:0;right:0;bottom:0;background-color:#00000080;z-index:999;opacity:0;visibility:hidden;transition:opacity .5s ease,visibility .5s ease}._drawerOverlayScoped_1eftt_16{position:absolute;top:0;left:0;right:0;bottom:0}._drawerOverlayVisible_1eftt_24{opacity:1;visibility:visible}._drawer_1eftt_2{position:fixed;bottom:0;left:0;right:0;height:80%;background:#fff;border-radius:20px 20px 0 0;z-index:1000;transform:translateY(100%);transition:transform .6s cubic-bezier(.25,.46,.45,.94);box-shadow:0 -8px 32px #0003;display:flex;flex-direction:column;overflow:hidden}._drawerScoped_1eftt_48{position:absolute;bottom:0;left:0;right:0}._drawerOpen_1eftt_55{transform:translateY(0)}._drawerHandle_1eftt_60{width:40px;height:4px;background-color:#0003;border-radius:2px;margin:12px auto 8px;flex-shrink:0;transition:background-color .2s ease}._drawerHandle_1eftt_60:hover{background-color:#0000004d}._drawerEmojisContainer_1eftt_75{display:flex;justify-content:space-between;padding:16px 20px;border-bottom:1px solid rgba(0,0,0,.1);flex-shrink:0}._drawerEmojiItem_1eftt_84{display:flex;flex-direction:column;align-items:center;gap:8px}._drawerEmojiItemActive_1eftt_91 ._drawerEmojiLabel_1eftt_91{color:#000;font-weight:700}._drawerEmojiButton_1eftt_97{display:flex;align-items:center;justify-content:center;padding:0;border-radius:50%;background:#fffc;border:2px solid rgba(0,0,0,.2);cursor:pointer;transition:all .3s ease;width:50px;height:50px;box-shadow:0 2px 8px #00000026;-webkit-tap-highlight-color:transparent}._drawerEmojiButtonActive_1eftt_113{background:#fff;border:3px solid rgba(0,0,0,.6);box-shadow:0 4px 12px #00000040;transform:scale(1.1)}._drawerEmojiLikeActive_1eftt_125{border-color:#4caf50;background:#4caf5026;box-shadow:0 4px 12px #4caf504d}._drawerEmojiDislikeActive_1eftt_135{border-color:#f44336;background:#f4433626;box-shadow:0 4px 12px #f443364d}._drawerEmojiMaybeActive_1eftt_145{border-color:#ff9800;background:#ff980026;box-shadow:0 4px 12px #ff98004d}._drawerEmojiSeenActive_1eftt_155{border-color:#2196f3;background:#2196f326;box-shadow:0 4px 12px #2196f34d}._drawerEmojiIcon_1eftt_162{width:32px;height:32px;object-fit:contain}._drawerEmojiLabel_1eftt_91{font-size:11px;font-weight:600;color:#000c;text-align:center;line-height:1.2;text-transform:uppercase;letter-spacing:.5px;white-space:pre-wrap}._drawerEmojiLike_1eftt_121:hover{border-color:#4caf50;background:#4caf501a}._drawerEmojiDislike_1eftt_131:hover{border-color:#f44336;background:#f443361a}._drawerEmojiMaybe_1eftt_141:hover{border-color:#ff9800;background:#ff98001a}._drawerEmojiSeen_1eftt_151:hover{border-color:#2196f3;background:#2196f31a}._drawerContent_1eftt_202{flex:1;padding:20px;-webkit-overflow-scrolling:touch;overflow-y:auto}._drawerCloseButton_1eftt_210{background:linear-gradient(135deg,#ff6b6b,#ee5a52);color:#fff;border:none;padding:12px 24px;margin:20px;border-radius:25px;font-size:16px;font-weight:600;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:8px;transition:all .3s ease;box-shadow:0 4px 16px #ff6b6b4d;outline:none;-webkit-tap-highlight-color:transparent;-webkit-appearance:none;-moz-appearance:none;appearance:none;align-self:center;min-height:48px;white-space:pre-wrap}._drawerCloseButton_1eftt_210:hover{transform:translateY(-2px);box-shadow:0 6px 20px #ff6b6b66}._drawerCloseButton_1eftt_210:active{transform:translateY(0);box-shadow:0 2px 8px #ff6b6b4d}._drawerCloseButton_1eftt_210:focus{outline:none}._drawerCloseButton_1eftt_210:focus-visible{outline:2px solid rgba(255,107,107,.5);outline-offset:2px}._drawerCloseIcon_1eftt_255{width:16px;height:16px;filter:brightness(0) invert(1)}@media (max-width: 768px){._drawer_1eftt_2{height:80%;border-radius:30px 30px 0 0}._drawerContent_1eftt_202{padding:16px}._drawerCloseButton_1eftt_210{margin:16px;padding:10px 20px;font-size:14px}}@media (max-width: 480px){._drawer_1eftt_2{height:80%;border-radius:30px 30px 0 0}._drawerContent_1eftt_202{padding:12px}._drawerCloseButton_1eftt_210{margin:12px;font-size:14px}}._cardListContainer_zrmnf_2{padding:20px;overscroll-behavior-y:contain;touch-action:pan-y;overflow-y:auto;height:100%;box-sizing:border-box}._cardListContainerNoPadding_zrmnf_11{padding:0;box-sizing:border-box}._summaryGridContainer_zrmnf_17{display:grid;grid-template-columns:1fr 1fr;gap:12px;padding:20px;box-sizing:border-box}._summaryGridItem_zrmnf_26{aspect-ratio:1;border-radius:8px;overflow:hidden;background:#0000000d;cursor:default}._summaryGridItemClickable_zrmnf_34{cursor:pointer}._gridPlaceholder_zrmnf_39{width:100%;height:100%;background:#f2f2f2;display:flex;align-items:center;justify-content:center;font-size:12px;color:#181818}._gridItemImage_zrmnf_51{width:100%;height:100%;object-fit:cover}._summaryCardItem_zrmnf_58{display:flex;gap:8px;padding:12px;border-radius:8px;background:#f2f2f2;color:#181818;margin-bottom:8px;align-items:center;cursor:default}._summaryCardItemClickable_zrmnf_70{cursor:pointer}._cardItemImage_zrmnf_75{width:60px;height:60px;border-radius:6px;object-fit:cover;flex-shrink:0}._cardItemPlaceholder_zrmnf_84{width:60px;height:60px;border-radius:6px;background:#d9d9d9;display:flex;align-items:center;justify-content:center;font-size:12px;color:#00000080;flex-shrink:0}._cardItemContent_zrmnf_98{flex:1;min-width:0;display:flex;flex-direction:column;justify-content:center}._cardItemTitle_zrmnf_107{margin:0 0 2px;font-size:14px;font-weight:600;line-height:1.2;text-align:left}._cardItemPrice_zrmnf_116{margin:0;font-size:12px;color:#000000b3;line-height:1.2}._summaryContainer_1gtok_3{display:flex;flex-direction:column;height:100%;width:100%;background-color:#fff;overflow:hidden;position:relative}._summaryShareButtonFixed_1gtok_14{position:absolute;bottom:10px;right:10px;width:45px;height:45px;font-size:12px;text-transform:uppercase;border-radius:50%;background-color:#2196f3;color:#fff;border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;box-shadow:0 4px 12px #00000026;transition:all .3s ease;z-index:1000;-webkit-tap-highlight-color:transparent}._summaryShareButtonFixed_1gtok_14:hover{background-color:#1976d2;box-shadow:0 6px 16px #0003;transform:scale(1.05)}._summaryShareButtonFixed_1gtok_14:active{transform:scale(.95);box-shadow:0 2px 8px #00000026}._summaryShareButtonFixed_1gtok_14 ._shareIcon_1gtok_47{width:24px;height:24px;filter:brightness(0) invert(1)}._summaryExplaination_1gtok_54{gap:8px;padding:12px;border-radius:8px;align-items:center;margin:12px 20px 0;font-size:14px;font-weight:600;line-height:1.2;text-align:center;justify-content:center;white-space:pre-wrap;background:#f2f2f2;color:#181818}._summaryTabs_1gtok_71{display:flex;justify-content:center;padding:16px 20px;background-color:#f5f5f5;border-bottom:1px solid #e0e0e0}._summaryTab_1gtok_71{display:flex;flex-direction:column;align-items:center;cursor:pointer;transition:all .3s ease;text-align:center;padding:0 5px;-webkit-tap-highlight-color:transparent}._summaryEmojiItem_1gtok_96{display:flex;flex-direction:column;align-items:center;gap:8px}._summaryEmojiButton_1gtok_108{display:flex;align-items:center;justify-content:center;padding:0;border-radius:50%;background:#fffc;border:2px solid rgba(0,0,0,.2);cursor:pointer;transition:all .3s ease;width:40px;height:40px;box-shadow:0 2px 8px #00000026;-webkit-tap-highlight-color:transparent}._summaryEmojiButtonActive_1gtok_124{background:#fff;border:3px solid rgba(0,0,0,.6);box-shadow:0 4px 12px #00000040;transform:scale(1.1)}._summaryEmojiLikeActive_1gtok_136{border-color:#4caf50;background:#4caf5026;box-shadow:0 4px 12px #4caf504d}._summaryEmojiDislikeActive_1gtok_146{border-color:#f44336;background:#f4433626;box-shadow:0 4px 12px #f443364d}._summaryEmojiMaybeActive_1gtok_156{border-color:#ff9800;background:#ff980026;box-shadow:0 4px 12px #ff98004d}._summaryEmojiSeenActive_1gtok_166{border-color:#2196f3;background:#2196f326;box-shadow:0 4px 12px #2196f34d}._summaryEmojiLike_1gtok_132:hover{border-color:#4caf50;background:#4caf501a}._summaryEmojiDislike_1gtok_142:hover{border-color:#f44336;background:#f443361a}._summaryEmojiMaybe_1gtok_152:hover{border-color:#ff9800;background:#ff98001a}._summaryEmojiSeen_1gtok_162:hover{border-color:#2196f3;background:#2196f31a}._summaryEmojiIcon_1gtok_194{width:28px;height:28px;object-fit:contain}._summaryEmojiLabel_1gtok_201{font-size:11px;font-weight:600;color:#000c;text-align:center;line-height:1.2;text-transform:uppercase;letter-spacing:.5px}._summaryEmojiItemActive_1gtok_103 ._summaryEmojiLabel_1gtok_201{color:#000;font-weight:700}._summaryContent_1gtok_217{flex:1;overflow:hidden;position:relative;background-color:#fff;min-height:0}._summaryPanel_1gtok_226{display:none;position:absolute;top:0;left:0;right:0;bottom:0;height:100%;width:100%;overflow-y:auto;min-height:0;box-sizing:border-box;overscroll-behavior:contain}._summaryPanelActive_1gtok_241{display:block}._summaryEmptyState_1gtok_246{text-align:center;padding:40px 20px;color:#181818}._summaryEmptyStateText_1gtok_252{margin:0 0 16px;font-size:18px;font-weight:600}._historyDrawerContent_x0jj6_1,._historyDrawerContent_x0jj6_1 .summary-container{height:100%;display:flex;flex-direction:column;overflow:hidden}._historyDrawerEmpty_x0jj6_15{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;padding:40px 20px;text-align:center;color:#666}._historyDrawerEmpty_x0jj6_15 p{margin:8px 0;font-size:16px}._historyDrawerEmptyHint_x0jj6_31{font-size:14px;color:#999}._historyDrawerTitle_x0jj6_36{margin:0 0 16px;padding:20px 20px 0;font-size:20px;font-weight:700;color:#333}._historyDrawerList_x0jj6_44{height:100%;display:flex;flex-direction:column;overflow:hidden}._historyDrawerList_x0jj6_44 .card-list-container{flex:1;overflow-y:auto}._historyDrawerGrouped_x0jj6_56{height:100%;display:flex;flex-direction:column;overflow-y:auto}._historyDrawerGroup_x0jj6_56{margin-bottom:24px}._historyDrawerGroup_x0jj6_56:last-child{margin-bottom:0}._historyDrawerGroupTitle_x0jj6_71{margin:0 0 12px;padding:20px 20px 0;font-size:18px;font-weight:700;color:#333}._historyDrawerGroup_x0jj6_56:first-child ._historyDrawerGroupTitle_x0jj6_71{padding-top:20px}._historyDrawerGroup_x0jj6_56 .card-list-container{padding-top:0}._historyDrawer_x0jj6_1 .drawer-content{padding:20px 0}._historyDrawer_x0jj6_1 .drawer-content .summary-tabs,._historyDrawer_x0jj6_1 .drawer-content .summary-content{background-color:transparent!important}._filtersButton_qio2f_1{position:absolute;z-index:1000;min-width:80px;height:40px;padding:8px 16px;border:none;border-radius:20px;cursor:pointer;display:flex;align-items:center;justify-content:center;outline:none;-webkit-tap-highlight-color:transparent;-webkit-appearance:none;-moz-appearance:none;appearance:none;font-size:14px;font-weight:500;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;text-align:center;white-space:pre-wrap;background-image:linear-gradient(135deg,#ffffff1a,#0000001a);transition:all .3s ease;box-shadow:0 4px 8px #00000026}._filtersButton_qio2f_1:hover{box-shadow:0 6px 12px #0003;transform:translateY(-1px)}._filtersButton_qio2f_1:active{transform:translateY(1px);box-shadow:0 2px 4px #00000026}._filtersButton_qio2f_1:focus{outline:none}._filtersButton_qio2f_1:focus-visible{outline:none}._filtersLeft_qio2f_46{left:20px;right:auto}._filtersMiddle_qio2f_51{left:50%;right:auto;transform:translate(-50%)}._filtersRight_qio2f_57{left:auto;right:20px}._filtersIcon_qio2f_63{pointer-events:none;flex-shrink:0}._content_hci8k_2{padding:12px 20px}._title_hci8k_7{margin:0 0 12px;font-size:16px;font-weight:600;color:#333;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;white-space:pre-wrap}._categories_hci8k_17{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:0}._pill_hci8k_25{display:inline-flex;align-items:center;padding:6px 12px;border-radius:20px;cursor:pointer;font-size:13px;font-weight:500;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;transition:all .2s ease;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}._noCategories_hci8k_40{width:100%;color:#999;font-style:italic;text-align:center;padding:20px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}._cardsCounter_1h26d_1{width:100%;text-align:left;font-size:14px;font-weight:700;color:#fff;text-shadow:1px 1px 2px rgba(0,0,0,.8);padding:5px 5px 5px 21px;pointer-events:none;white-space:pre-wrap}._logo_1rzq2_1{display:block;height:auto;max-width:100%;-webkit-user-select:none;user-select:none;pointer-events:none}._container_18bki_1{position:absolute}._interactiveFeed_1wsuw_1,._swippingJourney_15509_1{position:relative;width:100%;height:100%;overflow:hidden}._mainBootstrap_1rzog_1{width:100%;height:100%;position:relative}:root{--media-object-fit: cover}*{margin:0;padding:0;box-sizing:border-box;font-family:Arial,sans-serif}body{touch-action:pan-y;-webkit-user-select:none;user-select:none}";document.head.appendChild(s);}})();"use strict";var t,e,i,s,r,n,a,o,l,d,h,c,u,f,g,m,p,A,v,y,E=Object.defineProperty,T=t=>{throw TypeError(t)},S=(t,e,i)=>((t,e,i)=>e in t?E(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i),b=(t,e,i)=>e.has(t)||T("Cannot "+i),I=(t,e,i)=>(b(t,e,"read from private field"),i?i.call(t):e.get(t)),L=(t,e,i)=>e.has(t)?T("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),R=(t,e,i,s)=>(b(t,e,"write to private field"),s?s.call(t,i):e.set(t,i),i),k=(t,e,i)=>(b(t,e,"access private method"),i);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("react/jsx-runtime"),D=require("react"),C=D.createContext({});function x(t){const e=D.useRef(null);return null===e.current&&(e.current=t()),e.current}const P=D.createContext(null),M=D.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});const O="undefined"!=typeof window,B=O?D.useLayoutEffect:D.useEffect,F=t=>t;let N=F;const _=!1;const U=["read","resolveKeyframes","update","preRender","render","postRender"];function H(t,e){let i=!1,s=!0;const r={delta:0,timestamp:0,isProcessing:!1},n=()=>i=!0,a=U.reduce((t,e)=>(t[e]=function(t){let e=new Set,i=new Set,s=!1,r=!1;const n=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function o(e){n.has(e)&&(l.schedule(e),t()),e(a)}const l={schedule:(t,r=!1,a=!1)=>{const o=a&&s?e:i;return r&&n.add(t),o.has(t)||o.add(t),t},cancel:t=>{i.delete(t),n.delete(t)},process:t=>{a=t,s?r=!0:(s=!0,[e,i]=[i,e],e.forEach(o),e.clear(),s=!1,r&&(r=!1,l.process(t)))}};return l}(n),t),{}),{read:o,resolveKeyframes:l,update:d,preRender:h,render:c,postRender:u}=a,f=()=>{const n=performance.now();i=!1,r.delta=s?1e3/60:Math.max(Math.min(n-r.timestamp,40),1),r.timestamp=n,r.isProcessing=!0,o.process(r),l.process(r),d.process(r),h.process(r),c.process(r),u.process(r),r.isProcessing=!1,i&&e&&(s=!1,t(f))};return{schedule:U.reduce((e,n)=>{const o=a[n];return e[n]=(e,n=!1,a=!1)=>(i||(i=!0,s=!0,r.isProcessing||t(f)),o.schedule(e,n,a)),e},{}),cancel:t=>{for(let e=0;e<U.length;e++)a[U[e]].cancel(t)},state:r,steps:a}}const{schedule:j,cancel:V,state:G,steps:Q}=H("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:F,!0),K=D.createContext({strict:!1}),q={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},W={};for(const DE in q)W[DE]={isEnabled:t=>q[DE].some(e=>!!t[e])};const Y=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function $(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Y.has(t)}let z=t=>!$(t);try{(X=require("@emotion/is-prop-valid").default)&&(z=t=>t.startsWith("on")?!$(t):X(t))}catch(tv){}var X;function Z(t){if("undefined"==typeof Proxy)return t;const e=new Map;return new Proxy((...e)=>t(...e),{get:(i,s)=>"create"===s?t:(e.has(s)||e.set(s,t(s)),e.get(s))})}const J=D.createContext({});function tt(t){return"string"==typeof t||Array.isArray(t)}function et(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}const it=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],st=["initial",...it];function rt(t){return et(t.animate)||st.some(e=>tt(t[e]))}function nt(t){return Boolean(rt(t)||t.variants)}function at(t){const{initial:e,animate:i}=function(t,e){if(rt(t)){const{initial:e,animate:i}=t;return{initial:!1===e||tt(e)?e:void 0,animate:tt(i)?i:void 0}}return!1!==t.inherit?e:{}}(t,D.useContext(J));return D.useMemo(()=>({initial:e,animate:i}),[ot(e),ot(i)])}function ot(t){return Array.isArray(t)?t.join(" "):t}const lt=Symbol.for("motionComponentSymbol");function dt(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function ht(t,e,i){return D.useCallback(s=>{s&&t.onMount&&t.onMount(s),e&&(s?e.mount(s):e.unmount()),i&&("function"==typeof i?i(s):dt(i)&&(i.current=s))},[e])}const ct=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),ut="data-"+ct("framerAppearId"),{schedule:ft}=H(queueMicrotask,!1),gt=D.createContext({});function mt(t,e,i,s,r){var n,a;const{visualElement:o}=D.useContext(J),l=D.useContext(K),d=D.useContext(P),h=D.useContext(M).reducedMotion,c=D.useRef(null);s=s||l.renderer,!c.current&&s&&(c.current=s(t,{visualState:e,parent:o,props:i,presenceContext:d,blockInitialAnimation:!!d&&!1===d.initial,reducedMotionConfig:h}));const u=c.current,f=D.useContext(gt);!u||u.projection||!r||"html"!==u.type&&"svg"!==u.type||function(t,e,i,s){const{layoutId:r,layout:n,drag:a,dragConstraints:o,layoutScroll:l,layoutRoot:d}=e;t.projection=new i(t.latestValues,e["data-framer-portal-id"]?void 0:pt(t.parent)),t.projection.setOptions({layoutId:r,layout:n,alwaysMeasureLayout:Boolean(a)||o&&dt(o),visualElement:t,animationType:"string"==typeof n?n:"both",initialPromotionConfig:s,layoutScroll:l,layoutRoot:d})}(c.current,i,r,f);const g=D.useRef(!1);D.useInsertionEffect(()=>{u&&g.current&&u.update(i,d)});const m=i[ut],p=D.useRef(Boolean(m)&&!(null===(n=window.MotionHandoffIsComplete)||void 0===n?void 0:n.call(window,m))&&(null===(a=window.MotionHasOptimisedAnimation)||void 0===a?void 0:a.call(window,m)));return B(()=>{u&&(g.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),ft.render(u.render),p.current&&u.animationState&&u.animationState.animateChanges())}),D.useEffect(()=>{u&&(!p.current&&u.animationState&&u.animationState.animateChanges(),p.current&&(queueMicrotask(()=>{var t;null===(t=window.MotionHandoffMarkAsComplete)||void 0===t||t.call(window,m)}),p.current=!1))}),u}function pt(t){if(t)return!1!==t.options.allowProjection?t.projection:pt(t.parent)}function At({preloadedFeatures:t,createVisualElement:e,useRender:i,useVisualState:s,Component:r}){var n,a;function o(t,n){let a;const o={...D.useContext(M),...t,layoutId:vt(t)},{isStatic:l}=o,d=at(t),h=s(t,l);if(!l&&O){D.useContext(K).strict;const t=function(t){const{drag:e,layout:i}=W;if(!e&&!i)return{};const s={...e,...i};return{MeasureLayout:(null==e?void 0:e.isEnabled(t))||(null==i?void 0:i.isEnabled(t))?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}(o);a=t.MeasureLayout,d.visualElement=mt(r,h,o,e,t.ProjectionNode)}return w.jsxs(J.Provider,{value:d,children:[a&&d.visualElement?w.jsx(a,{visualElement:d.visualElement,...o}):null,i(r,t,ht(h,d.visualElement,n),h,l,d.visualElement)]})}t&&function(t){for(const e in t)W[e]={...W[e],...t[e]}}(t),o.displayName=`motion.${"string"==typeof r?r:`create(${null!==(a=null!==(n=r.displayName)&&void 0!==n?n:r.name)&&void 0!==a?a:""})`}`;const l=D.forwardRef(o);return l[lt]=r,l}function vt({layoutId:t}){const e=D.useContext(C).id;return e&&void 0!==t?e+"-"+t:t}const yt=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Et(t){return"string"==typeof t&&!t.includes("-")&&!!(yt.indexOf(t)>-1||/[A-Z]/u.test(t))}function Tt(t){const e=[{},{}];return null==t||t.values.forEach((t,i)=>{e[0][i]=t.get(),e[1][i]=t.getVelocity()}),e}function St(t,e,i,s){if("function"==typeof e){const[r,n]=Tt(s);e=e(void 0!==i?i:t.custom,r,n)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[r,n]=Tt(s);e=e(void 0!==i?i:t.custom,r,n)}return e}const bt=t=>Array.isArray(t),It=t=>bt(t)?t[t.length-1]||0:t,Lt=t=>Boolean(t&&t.getVelocity);function Rt(t){const e=Lt(t)?t.get():t;return i=e,Boolean(i&&"object"==typeof i&&i.mix&&i.toValue)?e.toValue():e;var i}const kt=t=>(e,i)=>{const s=D.useContext(J),r=D.useContext(P),n=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e,onUpdate:i},s,r,n){const a={latestValues:wt(s,r,n,t),renderState:e()};return i&&(a.onMount=t=>i({props:s,current:t,...a}),a.onUpdate=t=>i(t)),a}(t,e,s,r);return i?n():x(n)};function wt(t,e,i,s){const r={},n=s(t,{});for(const u in n)r[u]=Rt(n[u]);let{initial:a,animate:o}=t;const l=rt(t),d=nt(t);e&&d&&!l&&!1!==t.inherit&&(void 0===a&&(a=e.initial),void 0===o&&(o=e.animate));let h=!!i&&!1===i.initial;h=h||!1===a;const c=h?o:a;if(c&&"boolean"!=typeof c&&!et(c)){const e=Array.isArray(c)?c:[c];for(let i=0;i<e.length;i++){const s=St(t,e[i]);if(s){const{transitionEnd:t,transition:e,...i}=s;for(const s in i){let t=i[s];if(Array.isArray(t)){t=t[h?t.length-1:0]}null!==t&&(r[s]=t)}for(const s in t)r[s]=t[s]}}}return r}const Dt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ct=new Set(Dt),xt=t=>e=>"string"==typeof e&&e.startsWith(t),Pt=xt("--"),Mt=xt("var(--"),Ot=t=>!!Mt(t)&&Bt.test(t.split("/*")[0].trim()),Bt=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Ft=(t,e)=>e&&"number"==typeof t?e.transform(t):t,Nt=(t,e,i)=>i>e?e:i<t?t:i,_t={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},Ut={..._t,transform:t=>Nt(0,1,t)},Ht={..._t,default:1},jt=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),Vt=jt("deg"),Gt=jt("%"),Qt=jt("px"),Kt=jt("vh"),qt=jt("vw"),Wt={...Gt,parse:t=>Gt.parse(t)/100,transform:t=>Gt.transform(100*t)},Yt={borderWidth:Qt,borderTopWidth:Qt,borderRightWidth:Qt,borderBottomWidth:Qt,borderLeftWidth:Qt,borderRadius:Qt,radius:Qt,borderTopLeftRadius:Qt,borderTopRightRadius:Qt,borderBottomRightRadius:Qt,borderBottomLeftRadius:Qt,width:Qt,maxWidth:Qt,height:Qt,maxHeight:Qt,top:Qt,right:Qt,bottom:Qt,left:Qt,padding:Qt,paddingTop:Qt,paddingRight:Qt,paddingBottom:Qt,paddingLeft:Qt,margin:Qt,marginTop:Qt,marginRight:Qt,marginBottom:Qt,marginLeft:Qt,backgroundPositionX:Qt,backgroundPositionY:Qt},$t={rotate:Vt,rotateX:Vt,rotateY:Vt,rotateZ:Vt,scale:Ht,scaleX:Ht,scaleY:Ht,scaleZ:Ht,skew:Vt,skewX:Vt,skewY:Vt,distance:Qt,translateX:Qt,translateY:Qt,translateZ:Qt,x:Qt,y:Qt,z:Qt,perspective:Qt,transformPerspective:Qt,opacity:Ut,originX:Wt,originY:Wt,originZ:Qt},zt={..._t,transform:Math.round},Xt={...Yt,...$t,zIndex:zt,size:Qt,fillOpacity:Ut,strokeOpacity:Ut,numOctaves:zt},Zt={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Jt=Dt.length;function te(t,e,i){const{style:s,vars:r,transformOrigin:n}=t;let a=!1,o=!1;for(const l in e){const t=e[l];if(Ct.has(l))a=!0;else if(Pt(l))r[l]=t;else{const e=Ft(t,Xt[l]);l.startsWith("origin")?(o=!0,n[l]=e):s[l]=e}}if(e.transform||(a||i?s.transform=function(t,e,i){let s="",r=!0;for(let n=0;n<Jt;n++){const a=Dt[n],o=t[a];if(void 0===o)continue;let l=!0;if(l="number"==typeof o?o===(a.startsWith("scale")?1:0):0===parseFloat(o),!l||i){const t=Ft(o,Xt[a]);l||(r=!1,s+=`${Zt[a]||a}(${t}) `),i&&(e[a]=t)}}return s=s.trim(),i?s=i(e,r?"":s):r&&(s="none"),s}(e,t.transform,i):s.transform&&(s.transform="none")),o){const{originX:t="50%",originY:e="50%",originZ:i=0}=n;s.transformOrigin=`${t} ${e} ${i}`}}const ee={offset:"stroke-dashoffset",array:"stroke-dasharray"},ie={offset:"strokeDashoffset",array:"strokeDasharray"};function se(t,e,i){return"string"==typeof t?t:Qt.transform(e+i*t)}function re(t,{attrX:e,attrY:i,attrScale:s,originX:r,originY:n,pathLength:a,pathSpacing:o=1,pathOffset:l=0,...d},h,c){if(te(t,d,c),h)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:u,style:f,dimensions:g}=t;u.transform&&(g&&(f.transform=u.transform),delete u.transform),g&&(void 0!==r||void 0!==n||f.transform)&&(f.transformOrigin=function(t,e,i){return`${se(e,t.x,t.width)} ${se(i,t.y,t.height)}`}(g,void 0!==r?r:.5,void 0!==n?n:.5)),void 0!==e&&(u.x=e),void 0!==i&&(u.y=i),void 0!==s&&(u.scale=s),void 0!==a&&function(t,e,i=1,s=0,r=!0){t.pathLength=1;const n=r?ee:ie;t[n.offset]=Qt.transform(-s);const a=Qt.transform(e),o=Qt.transform(i);t[n.array]=`${a} ${o}`}(u,a,o,l,!1)}const ne=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),ae=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),oe=t=>"string"==typeof t&&"svg"===t.toLowerCase();function le(t,{style:e,vars:i},s,r){Object.assign(t.style,e,r&&r.getProjectionStyles(s));for(const n in i)t.style.setProperty(n,i[n])}const de=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function he(t,e,i,s){le(t,e,void 0,s);for(const r in e.attrs)t.setAttribute(de.has(r)?r:ct(r),e.attrs[r])}const ce={};function ue(t,{layout:e,layoutId:i}){return Ct.has(t)||t.startsWith("origin")||(e||void 0!==i)&&(!!ce[t]||"opacity"===t)}function fe(t,e,i){var s;const{style:r}=t,n={};for(const a in r)(Lt(r[a])||e.style&&Lt(e.style[a])||ue(a,t)||void 0!==(null===(s=null==i?void 0:i.getValue(a))||void 0===s?void 0:s.liveStyle))&&(n[a]=r[a]);return n}function ge(t,e,i){const s=fe(t,e,i);for(const r in t)if(Lt(t[r])||Lt(e[r])){s[-1!==Dt.indexOf(r)?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r]=t[r]}return s}const me=["x","y","width","height","cx","cy","r"],pe={useVisualState:kt({scrapeMotionValuesFromProps:ge,createRenderState:ae,onUpdate:({props:t,prevProps:e,current:i,renderState:s,latestValues:r})=>{if(!i)return;let n=!!t.drag;if(!n)for(const o in r)if(Ct.has(o)){n=!0;break}if(!n)return;let a=!e;if(e)for(let o=0;o<me.length;o++){const i=me[o];t[i]!==e[i]&&(a=!0)}a&&j.read(()=>{!function(t,e){try{e.dimensions="function"==typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}catch(i){e.dimensions={x:0,y:0,width:0,height:0}}}(i,s),j.render(()=>{re(s,r,oe(i.tagName),t.transformTemplate),he(i,s)})})}})},Ae={useVisualState:kt({scrapeMotionValuesFromProps:fe,createRenderState:ne})};function ve(t,e,i){for(const s in e)Lt(e[s])||ue(s,i)||(t[s]=e[s])}function ye(t,e){const i={};return ve(i,t.style||{},t),Object.assign(i,function({transformTemplate:t},e){return D.useMemo(()=>{const i={style:{},transform:{},transformOrigin:{},vars:{}};return te(i,e,t),Object.assign({},i.vars,i.style)},[e])}(t,e)),i}function Ee(t,e){const i={},s=ye(t,e);return t.drag&&!1!==t.dragListener&&(i.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(i.tabIndex=0),i.style=s,i}function Te(t,e,i,s){const r=D.useMemo(()=>{const i={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return re(i,e,oe(s),t.transformTemplate),{...i.attrs,style:{...i.style}}},[e]);if(t.style){const e={};ve(e,t.style,t),r.style={...e,...r.style}}return r}function Se(t=!1){return(e,i,s,{latestValues:r},n)=>{const a=(Et(e)?Te:Ee)(i,r,n,e),o=function(t,e,i){const s={};for(const r in t)"values"===r&&"object"==typeof t.values||(z(r)||!0===i&&$(r)||!e&&!$(r)||t.draggable&&r.startsWith("onDrag"))&&(s[r]=t[r]);return s}(i,"string"==typeof e,t),l=e!==D.Fragment?{...o,...a,ref:s}:{},{children:d}=i,h=D.useMemo(()=>Lt(d)?d.get():d,[d]);return D.createElement(e,{...l,children:h})}}function be(t,e){return function(i,{forwardMotionProps:s}={forwardMotionProps:!1}){return At({...Et(i)?pe:Ae,preloadedFeatures:t,useRender:Se(s),createVisualElement:e,Component:i})}}function Ie(t,e){if(!Array.isArray(e))return!1;const i=e.length;if(i!==t.length)return!1;for(let s=0;s<i;s++)if(e[s]!==t[s])return!1;return!0}function Le(t,e,i){const s=t.getProps();return St(s,e,void 0!==i?i:s.custom,t)}function Re(t,e){return t?t[e]||t.default||t:void 0}const ke=new Set(["width","height","top","left","right","bottom",...Dt]);let we;function De(){we=void 0}const Ce={now:()=>(void 0===we&&Ce.set(G.isProcessing||_?G.timestamp:performance.now()),we),set:t=>{we=t,queueMicrotask(De)}};function xe(t,e){-1===t.indexOf(e)&&t.push(e)}function Pe(t,e){const i=t.indexOf(e);i>-1&&t.splice(i,1)}class Me{constructor(){this.subscriptions=[]}add(t){return xe(this.subscriptions,t),()=>Pe(this.subscriptions,t)}notify(t,e,i){const s=this.subscriptions.length;if(s)if(1===s)this.subscriptions[0](t,e,i);else for(let r=0;r<s;r++){const s=this.subscriptions[r];s&&s(t,e,i)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function Oe(t,e){return e?t*(1e3/e):0}const Be={current:void 0};class Fe{constructor(t,e={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(t,e=!0)=>{const i=Ce.now();this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),e&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=Ce.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new Me);const i=this.events[t].add(e);return"change"===t?()=>{i(),j.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}setWithVelocity(t,e,i){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-i}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return Be.current&&Be.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=Ce.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return Oe(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Ne(t,e){return new Fe(t,e)}function _e(t,e,i){t.hasValue(e)?t.getValue(e).set(i):t.addValue(e,Ne(i))}function Ue(t,e){const i=Le(t,e);let{transitionEnd:s={},transition:r={},...n}=i||{};n={...n,...s};for(const a in n){_e(t,a,It(n[a]))}}function He(t,e){const i=t.getValue("willChange");if(s=i,Boolean(Lt(s)&&s.add))return i.add(e);var s}function je(t){return t.props[ut]}function Ve(t){let e;return()=>(void 0===e&&(e=t()),e)}const Ge=Ve(()=>void 0!==window.ScrollTimeline);class Qe{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let i=0;i<this.animations.length;i++)this.animations[i][t]=e}attachTimeline(t,e){const i=this.animations.map(i=>Ge()&&i.attachTimeline?i.attachTimeline(t):"function"==typeof e?e(i):void 0);return()=>{i.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let e=0;e<this.animations.length;e++)t=Math.max(t,this.animations[e].duration);return t}runAll(t){this.animations.forEach(e=>e[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class Ke extends Qe{then(t,e){return Promise.all(this.animations).then(t).catch(e)}}const qe=t=>1e3*t,We=t=>t/1e3;function Ye(t){return"function"==typeof t}function $e(t,e){t.timeline=e,t.onfinish=null}const ze=t=>Array.isArray(t)&&"number"==typeof t[0],Xe={linearEasing:void 0};function Ze(t,e){const i=Ve(t);return()=>{var t;return null!==(t=Xe[e])&&void 0!==t?t:i()}}const Je=Ze(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),ti=(t,e,i)=>{const s=e-t;return 0===s?1:(i-t)/s},ei=(t,e,i=10)=>{let s="";const r=Math.max(Math.round(e/i),2);for(let n=0;n<r;n++)s+=t(ti(0,r-1,n))+", ";return`linear(${s.substring(0,s.length-2)})`};function ii(t){return Boolean("function"==typeof t&&Je()||!t||"string"==typeof t&&(t in ri||Je())||ze(t)||Array.isArray(t)&&t.every(ii))}const si=([t,e,i,s])=>`cubic-bezier(${t}, ${e}, ${i}, ${s})`,ri={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:si([0,.65,.55,1]),circOut:si([.55,0,1,.45]),backIn:si([.31,.01,.66,-.59]),backOut:si([.33,1.53,.69,.99])};function ni(t,e){return t?"function"==typeof t&&Je()?ei(t,e):ze(t)?si(t):Array.isArray(t)?t.map(t=>ni(t,e)||ri.easeOut):ri[t]:void 0}const ai=(t,e,i)=>(((1-3*i+3*e)*t+(3*i-6*e))*t+3*e)*t;function oi(t,e,i,s){if(t===e&&i===s)return F;const r=e=>function(t,e,i,s,r){let n,a,o=0;do{a=e+(i-e)/2,n=ai(a,s,r)-t,n>0?i=a:e=a}while(Math.abs(n)>1e-7&&++o<12);return a}(e,0,1,t,i);return t=>0===t||1===t?t:ai(r(t),e,s)}const li=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,di=t=>e=>1-t(1-e),hi=oi(.33,1.53,.69,.99),ci=di(hi),ui=li(ci),fi=t=>(t*=2)<1?.5*ci(t):.5*(2-Math.pow(2,-10*(t-1))),gi=t=>1-Math.sin(Math.acos(t)),mi=di(gi),pi=li(gi),Ai=t=>/^0[^.\s]+$/u.test(t);function vi(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||Ai(t))}const yi=t=>Math.round(1e5*t)/1e5,Ei=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const Ti=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Si=(t,e)=>i=>Boolean("string"==typeof i&&Ti.test(i)&&i.startsWith(t)||e&&!function(t){return null==t}(i)&&Object.prototype.hasOwnProperty.call(i,e)),bi=(t,e,i)=>s=>{if("string"!=typeof s)return s;const[r,n,a,o]=s.match(Ei);return{[t]:parseFloat(r),[e]:parseFloat(n),[i]:parseFloat(a),alpha:void 0!==o?parseFloat(o):1}},Ii={..._t,transform:t=>Math.round((t=>Nt(0,255,t))(t))},Li={test:Si("rgb","red"),parse:bi("red","green","blue"),transform:({red:t,green:e,blue:i,alpha:s=1})=>"rgba("+Ii.transform(t)+", "+Ii.transform(e)+", "+Ii.transform(i)+", "+yi(Ut.transform(s))+")"};const Ri={test:Si("#"),parse:function(t){let e="",i="",s="",r="";return t.length>5?(e=t.substring(1,3),i=t.substring(3,5),s=t.substring(5,7),r=t.substring(7,9)):(e=t.substring(1,2),i=t.substring(2,3),s=t.substring(3,4),r=t.substring(4,5),e+=e,i+=i,s+=s,r+=r),{red:parseInt(e,16),green:parseInt(i,16),blue:parseInt(s,16),alpha:r?parseInt(r,16)/255:1}},transform:Li.transform},ki={test:Si("hsl","hue"),parse:bi("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:i,alpha:s=1})=>"hsla("+Math.round(t)+", "+Gt.transform(yi(e))+", "+Gt.transform(yi(i))+", "+yi(Ut.transform(s))+")"},wi={test:t=>Li.test(t)||Ri.test(t)||ki.test(t),parse:t=>Li.test(t)?Li.parse(t):ki.test(t)?ki.parse(t):Ri.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?Li.transform(t):ki.transform(t)},Di=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const Ci="number",xi="color",Pi=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Mi(t){const e=t.toString(),i=[],s={color:[],number:[],var:[]},r=[];let n=0;const a=e.replace(Pi,t=>(wi.test(t)?(s.color.push(n),r.push(xi),i.push(wi.parse(t))):t.startsWith("var(")?(s.var.push(n),r.push("var"),i.push(t)):(s.number.push(n),r.push(Ci),i.push(parseFloat(t))),++n,"${}")).split("${}");return{values:i,split:a,indexes:s,types:r}}function Oi(t){return Mi(t).values}function Bi(t){const{split:e,types:i}=Mi(t),s=e.length;return t=>{let r="";for(let n=0;n<s;n++)if(r+=e[n],void 0!==t[n]){const e=i[n];r+=e===Ci?yi(t[n]):e===xi?wi.transform(t[n]):t[n]}return r}}const Fi=t=>"number"==typeof t?0:t;const Ni={test:function(t){var e,i;return isNaN(t)&&"string"==typeof t&&((null===(e=t.match(Ei))||void 0===e?void 0:e.length)||0)+((null===(i=t.match(Di))||void 0===i?void 0:i.length)||0)>0},parse:Oi,createTransformer:Bi,getAnimatableNone:function(t){const e=Oi(t);return Bi(t)(e.map(Fi))}},_i=new Set(["brightness","contrast","saturate","opacity"]);function Ui(t){const[e,i]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[s]=i.match(Ei)||[];if(!s)return t;const r=i.replace(s,"");let n=_i.has(e)?1:0;return s!==i&&(n*=100),e+"("+n+r+")"}const Hi=/\b([a-z-]*)\(.*?\)/gu,ji={...Ni,getAnimatableNone:t=>{const e=t.match(Hi);return e?e.map(Ui).join(" "):t}},Vi={...Xt,color:wi,backgroundColor:wi,outlineColor:wi,fill:wi,stroke:wi,borderColor:wi,borderTopColor:wi,borderRightColor:wi,borderBottomColor:wi,borderLeftColor:wi,filter:ji,WebkitFilter:ji},Gi=t=>Vi[t];function Qi(t,e){let i=Gi(t);return i!==ji&&(i=Ni),i.getAnimatableNone?i.getAnimatableNone(e):void 0}const Ki=new Set(["auto","none","0"]);const qi=t=>t===_t||t===Qt,Wi=(t,e)=>parseFloat(t.split(", ")[e]),Yi=(t,e)=>(i,{transform:s})=>{if("none"===s||!s)return 0;const r=s.match(/^matrix3d\((.+)\)$/u);if(r)return Wi(r[1],e);{const e=s.match(/^matrix\((.+)\)$/u);return e?Wi(e[1],t):0}},$i=new Set(["x","y","z"]),zi=Dt.filter(t=>!$i.has(t));const Xi={width:({x:t},{paddingLeft:e="0",paddingRight:i="0"})=>t.max-t.min-parseFloat(e)-parseFloat(i),height:({y:t},{paddingTop:e="0",paddingBottom:i="0"})=>t.max-t.min-parseFloat(e)-parseFloat(i),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:Yi(4,13),y:Yi(5,14)};Xi.translateX=Xi.x,Xi.translateY=Xi.y;const Zi=new Set;let Ji=!1,ts=!1;function es(){if(ts){const t=Array.from(Zi).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),i=new Map;e.forEach(t=>{const e=function(t){const e=[];return zi.forEach(i=>{const s=t.getValue(i);void 0!==s&&(e.push([i,s.get()]),s.set(i.startsWith("scale")?1:0))}),e}(t);e.length&&(i.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=i.get(t);e&&e.forEach(([e,i])=>{var s;null===(s=t.getValue(e))||void 0===s||s.set(i)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}ts=!1,Ji=!1,Zi.forEach(t=>t.complete()),Zi.clear()}function is(){Zi.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(ts=!0)})}class ss{constructor(t,e,i,s,r,n=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=i,this.motionValue=s,this.element=r,this.isAsync=n}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Zi.add(this),Ji||(Ji=!0,j.read(is),j.resolveKeyframes(es))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:i,motionValue:s}=this;for(let r=0;r<t.length;r++)if(null===t[r])if(0===r){const r=null==s?void 0:s.get(),n=t[t.length-1];if(void 0!==r)t[0]=r;else if(i&&e){const s=i.readValue(e,n);null!=s&&(t[0]=s)}void 0===t[0]&&(t[0]=n),s&&void 0===r&&s.set(t[0])}else t[r]=t[r-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Zi.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Zi.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const rs=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),ns=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function as(t,e,i=1){const[s,r]=function(t){const e=ns.exec(t);if(!e)return[,];const[,i,s,r]=e;return[`--${null!=i?i:s}`,r]}(t);if(!s)return;const n=window.getComputedStyle(e).getPropertyValue(s);if(n){const t=n.trim();return rs(t)?parseFloat(t):t}return Ot(r)?as(r,e,i+1):r}const os=t=>e=>e.test(t),ls=[_t,Qt,Gt,Vt,qt,Kt,{test:t=>"auto"===t,parse:t=>t}],ds=t=>ls.find(os(t));class hs extends ss{constructor(t,e,i,s,r){super(t,e,i,s,r,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:i}=this;if(!e||!e.current)return;super.readKeyframes();for(let o=0;o<t.length;o++){let i=t[o];if("string"==typeof i&&(i=i.trim(),Ot(i))){const s=as(i,e.current);void 0!==s&&(t[o]=s),o===t.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!ke.has(i)||2!==t.length)return;const[s,r]=t,n=ds(s),a=ds(r);if(n!==a)if(qi(n)&&qi(a))for(let o=0;o<t.length;o++){const e=t[o];"string"==typeof e&&(t[o]=parseFloat(e))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,i=[];for(let s=0;s<t.length;s++)vi(t[s])&&i.push(s);i.length&&function(t,e,i){let s,r=0;for(;r<t.length&&!s;){const e=t[r];"string"==typeof e&&!Ki.has(e)&&Mi(e).values.length&&(s=t[r]),r++}if(s&&i)for(const n of e)t[n]=Qi(i,s)}(t,i,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:i}=this;if(!t||!t.current)return;"height"===i&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Xi[i](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const s=e[e.length-1];void 0!==s&&t.getValue(i,s).jump(s,!1)}measureEndState(){var t;const{element:e,name:i,unresolvedKeyframes:s}=this;if(!e||!e.current)return;const r=e.getValue(i);r&&r.jump(this.measuredOrigin,!1);const n=s.length-1,a=s[n];s[n]=Xi[i](e.measureViewportBox(),window.getComputedStyle(e.current)),null!==a&&void 0===this.finalKeyframe&&(this.finalKeyframe=a),(null===(t=this.removedTransforms)||void 0===t?void 0:t.length)&&this.removedTransforms.forEach(([t,i])=>{e.getValue(t).set(i)}),this.resolveNoneKeyframes()}}const cs=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Ni.test(t)&&"0"!==t||t.startsWith("url(")));const us=t=>null!==t;function fs(t,{repeat:e,repeatType:i="loop"},s){const r=t.filter(us),n=e&&"loop"!==i&&e%2==1?0:r.length-1;return n&&void 0!==s?s:r[n]}class gs{constructor({autoplay:t=!0,delay:e=0,type:i="keyframes",repeat:s=0,repeatDelay:r=0,repeatType:n="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Ce.now(),this.options={autoplay:t,delay:e,type:i,repeat:s,repeatDelay:r,repeatType:n,...a},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return this._resolved||this.hasAttemptedResolve||(is(),es()),this._resolved}onKeyframesResolved(t,e){this.resolvedAt=Ce.now(),this.hasAttemptedResolve=!0;const{name:i,type:s,velocity:r,delay:n,onComplete:a,onUpdate:o,isGenerator:l}=this.options;if(!l&&!function(t,e,i,s){const r=t[0];if(null===r)return!1;if("display"===e||"visibility"===e)return!0;const n=t[t.length-1],a=cs(r,e),o=cs(n,e);return!(!a||!o)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let i=0;i<t.length;i++)if(t[i]!==e)return!0}(t)||("spring"===i||Ye(i))&&s)}(t,i,s,r)){if(!n)return o&&o(fs(t,this.options,e)),a&&a(),void this.resolveFinishedPromise();this.options.duration=0}const d=this.initPlayback(t,e);!1!==d&&(this._resolved={keyframes:t,finalKeyframe:e,...d},this.onPostResolved())}onPostResolved(){}then(t,e){return this.currentFinishedPromise.then(t,e)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const ms=2e4;function ps(t){let e=0;let i=t.next(e);for(;!i.done&&e<ms;)e+=50,i=t.next(e);return e>=ms?1/0:e}const As=(t,e,i)=>t+(e-t)*i;function vs(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}function ys(t,e){return i=>i>0?e:t}const Es=(t,e,i)=>{const s=t*t,r=i*(e*e-s)+s;return r<0?0:Math.sqrt(r)},Ts=[Ri,Li,ki];function Ss(t){const e=(i=t,Ts.find(t=>t.test(i)));var i;if(!Boolean(e))return!1;let s=e.parse(t);return e===ki&&(s=function({hue:t,saturation:e,lightness:i,alpha:s}){t/=360,i/=100;let r=0,n=0,a=0;if(e/=100){const s=i<.5?i*(1+e):i+e-i*e,o=2*i-s;r=vs(o,s,t+1/3),n=vs(o,s,t),a=vs(o,s,t-1/3)}else r=n=a=i;return{red:Math.round(255*r),green:Math.round(255*n),blue:Math.round(255*a),alpha:s}}(s)),s}const bs=(t,e)=>{const i=Ss(t),s=Ss(e);if(!i||!s)return ys(t,e);const r={...i};return t=>(r.red=Es(i.red,s.red,t),r.green=Es(i.green,s.green,t),r.blue=Es(i.blue,s.blue,t),r.alpha=As(i.alpha,s.alpha,t),Li.transform(r))},Is=(t,e)=>i=>e(t(i)),Ls=(...t)=>t.reduce(Is),Rs=new Set(["none","hidden"]);function ks(t,e){return i=>As(t,e,i)}function ws(t){return"number"==typeof t?ks:"string"==typeof t?Ot(t)?ys:wi.test(t)?bs:xs:Array.isArray(t)?Ds:"object"==typeof t?wi.test(t)?bs:Cs:ys}function Ds(t,e){const i=[...t],s=i.length,r=t.map((t,i)=>ws(t)(t,e[i]));return t=>{for(let e=0;e<s;e++)i[e]=r[e](t);return i}}function Cs(t,e){const i={...t,...e},s={};for(const r in i)void 0!==t[r]&&void 0!==e[r]&&(s[r]=ws(t[r])(t[r],e[r]));return t=>{for(const e in s)i[e]=s[e](t);return i}}const xs=(t,e)=>{const i=Ni.createTransformer(e),s=Mi(t),r=Mi(e);return s.indexes.var.length===r.indexes.var.length&&s.indexes.color.length===r.indexes.color.length&&s.indexes.number.length>=r.indexes.number.length?Rs.has(t)&&!r.values.length||Rs.has(e)&&!s.values.length?function(t,e){return Rs.has(t)?i=>i<=0?t:e:i=>i>=1?e:t}(t,e):Ls(Ds(function(t,e){var i;const s=[],r={color:0,var:0,number:0};for(let n=0;n<e.values.length;n++){const a=e.types[n],o=t.indexes[a][r[a]],l=null!==(i=t.values[o])&&void 0!==i?i:0;s[n]=l,r[a]++}return s}(s,r),r.values),i):ys(t,e)};function Ps(t,e,i){if("number"==typeof t&&"number"==typeof e&&"number"==typeof i)return As(t,e,i);return ws(t)(t,e)}function Ms(t,e,i){const s=Math.max(e-5,0);return Oe(i-t(s),e-s)}const Os=100,Bs=10,Fs=1,Ns=0,_s=800,Us=.3,Hs=.3,js={granular:.01,default:2},Vs={granular:.005,default:.5},Gs=.01,Qs=10,Ks=.05,qs=1,Ws=.001;function Ys({duration:t=_s,bounce:e=Us,velocity:i=Ns,mass:s=Fs}){let r,n,a=1-e;a=Nt(Ks,qs,a),t=Nt(Gs,Qs,We(t)),a<1?(r=e=>{const s=e*a,r=s*t,n=s-i,o=zs(e,a),l=Math.exp(-r);return Ws-n/o*l},n=e=>{const s=e*a*t,n=s*i+i,o=Math.pow(a,2)*Math.pow(e,2)*t,l=Math.exp(-s),d=zs(Math.pow(e,2),a);return(-r(e)+Ws>0?-1:1)*((n-o)*l)/d}):(r=e=>Math.exp(-e*t)*((e-i)*t+1)-.001,n=e=>Math.exp(-e*t)*(t*t*(i-e)));const o=function(t,e,i){let s=i;for(let r=1;r<$s;r++)s-=t(s)/e(s);return s}(r,n,5/t);if(t=qe(t),isNaN(o))return{stiffness:Os,damping:Bs,duration:t};{const e=Math.pow(o,2)*s;return{stiffness:e,damping:2*a*Math.sqrt(s*e),duration:t}}}const $s=12;function zs(t,e){return t*Math.sqrt(1-e*e)}const Xs=["duration","bounce"],Zs=["stiffness","damping","mass"];function Js(t,e){return e.some(e=>void 0!==t[e])}function tr(t=Hs,e=Us){const i="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:r}=i;const n=i.keyframes[0],a=i.keyframes[i.keyframes.length-1],o={done:!1,value:n},{stiffness:l,damping:d,mass:h,duration:c,velocity:u,isResolvedFromDuration:f}=function(t){let e={velocity:Ns,stiffness:Os,damping:Bs,mass:Fs,isResolvedFromDuration:!1,...t};if(!Js(t,Zs)&&Js(t,Xs))if(t.visualDuration){const i=t.visualDuration,s=2*Math.PI/(1.2*i),r=s*s,n=2*Nt(.05,1,1-(t.bounce||0))*Math.sqrt(r);e={...e,mass:Fs,stiffness:r,damping:n}}else{const i=Ys(t);e={...e,...i,mass:Fs},e.isResolvedFromDuration=!0}return e}({...i,velocity:-We(i.velocity||0)}),g=u||0,m=d/(2*Math.sqrt(l*h)),p=a-n,A=We(Math.sqrt(l/h)),v=Math.abs(p)<5;let y;if(s||(s=v?js.granular:js.default),r||(r=v?Vs.granular:Vs.default),m<1){const t=zs(A,m);y=e=>{const i=Math.exp(-m*A*e);return a-i*((g+m*A*p)/t*Math.sin(t*e)+p*Math.cos(t*e))}}else if(1===m)y=t=>a-Math.exp(-A*t)*(p+(g+A*p)*t);else{const t=A*Math.sqrt(m*m-1);y=e=>{const i=Math.exp(-m*A*e),s=Math.min(t*e,300);return a-i*((g+m*A*p)*Math.sinh(s)+t*p*Math.cosh(s))/t}}const E={calculatedDuration:f&&c||null,next:t=>{const e=y(t);if(f)o.done=t>=c;else{let i=0;m<1&&(i=0===t?qe(g):Ms(y,t,e));const n=Math.abs(i)<=s,l=Math.abs(a-e)<=r;o.done=n&&l}return o.value=o.done?a:e,o},toString:()=>{const t=Math.min(ps(E),ms),e=ei(e=>E.next(t*e).value,t,30);return t+"ms "+e}};return E}function er({keyframes:t,velocity:e=0,power:i=.8,timeConstant:s=325,bounceDamping:r=10,bounceStiffness:n=500,modifyTarget:a,min:o,max:l,restDelta:d=.5,restSpeed:h}){const c=t[0],u={done:!1,value:c},f=t=>void 0===o?l:void 0===l||Math.abs(o-t)<Math.abs(l-t)?o:l;let g=i*e;const m=c+g,p=void 0===a?m:a(m);p!==m&&(g=p-c);const A=t=>-g*Math.exp(-t/s),v=t=>p+A(t),y=t=>{const e=A(t),i=v(t);u.done=Math.abs(e)<=d,u.value=u.done?p:i};let E,T;const S=t=>{var e;(e=u.value,void 0!==o&&e<o||void 0!==l&&e>l)&&(E=t,T=tr({keyframes:[u.value,f(u.value)],velocity:Ms(v,t,u.value),damping:r,stiffness:n,restDelta:d,restSpeed:h}))};return S(0),{calculatedDuration:null,next:t=>{let e=!1;return T||void 0!==E||(e=!0,y(t),S(t)),void 0!==E&&t>=E?T.next(t-E):(!e&&y(t),u)}}}const ir=oi(.42,0,1,1),sr=oi(0,0,.58,1),rr=oi(.42,0,.58,1),nr=t=>Array.isArray(t)&&"number"!=typeof t[0],ar={linear:F,easeIn:ir,easeInOut:rr,easeOut:sr,circIn:gi,circInOut:pi,circOut:mi,backIn:ci,backInOut:ui,backOut:hi,anticipate:fi},or=t=>{if(ze(t)){N(4===t.length);const[e,i,s,r]=t;return oi(e,i,s,r)}return"string"==typeof t?ar[t]:t};function lr(t,e,{clamp:i=!0,ease:s,mixer:r}={}){const n=t.length;if(N(n===e.length),1===n)return()=>e[0];if(2===n&&e[0]===e[1])return()=>e[1];const a=t[0]===t[1];t[0]>t[n-1]&&(t=[...t].reverse(),e=[...e].reverse());const o=function(t,e,i){const s=[],r=i||Ps,n=t.length-1;for(let a=0;a<n;a++){let i=r(t[a],t[a+1]);if(e){const t=Array.isArray(e)?e[a]||F:e;i=Ls(t,i)}s.push(i)}return s}(e,s,r),l=o.length,d=i=>{if(a&&i<t[0])return e[0];let s=0;if(l>1)for(;s<t.length-2&&!(i<t[s+1]);s++);const r=ti(t[s],t[s+1],i);return o[s](r)};return i?e=>d(Nt(t[0],t[n-1],e)):d}function dr(t,e){const i=t[t.length-1];for(let s=1;s<=e;s++){const r=ti(0,e,s);t.push(As(i,1,r))}}function hr(t){const e=[0];return dr(e,t.length-1),e}function cr({duration:t=300,keyframes:e,times:i,ease:s="easeInOut"}){const r=nr(s)?s.map(or):or(s),n={done:!1,value:e[0]},a=function(t,e){return t.map(t=>t*e)}(i&&i.length===e.length?i:hr(e),t),o=lr(a,e,{ease:Array.isArray(r)?r:(l=e,d=r,l.map(()=>d||rr).splice(0,l.length-1))});var l,d;return{calculatedDuration:t,next:e=>(n.value=o(e),n.done=e>=t,n)}}const ur=t=>{const e=({timestamp:e})=>t(e);return{start:()=>j.update(e,!0),stop:()=>V(e),now:()=>G.isProcessing?G.timestamp:Ce.now()}},fr={decay:er,inertia:er,tween:cr,keyframes:cr,spring:tr},gr=t=>t/100;class mr extends gs{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.teardown();const{onStop:t}=this.options;t&&t()};const{name:e,motionValue:i,element:s,keyframes:r}=this.options,n=(null==s?void 0:s.KeyframeResolver)||ss;this.resolver=new n(r,(t,e)=>this.onKeyframesResolved(t,e),e,i,s),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:e="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:r,velocity:n=0}=this.options,a=Ye(e)?e:fr[e]||cr;let o,l;a!==cr&&"number"!=typeof t[0]&&(o=Ls(gr,Ps(t[0],t[1])),t=[0,100]);const d=a({...this.options,keyframes:t});"mirror"===r&&(l=a({...this.options,keyframes:[...t].reverse(),velocity:-n})),null===d.calculatedDuration&&(d.calculatedDuration=ps(d));const{calculatedDuration:h}=d,c=h+s;return{generator:d,mirroredGenerator:l,mapPercentToKeyframes:o,calculatedDuration:h,resolvedDuration:c,totalDuration:c*(i+1)-s}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&t?this.state=this.pendingPlayState:this.pause()}tick(t,e=!1){const{resolved:i}=this;if(!i){const{keyframes:t}=this.options;return{done:!0,value:t[t.length-1]}}const{finalKeyframe:s,generator:r,mirroredGenerator:n,mapPercentToKeyframes:a,keyframes:o,calculatedDuration:l,totalDuration:d,resolvedDuration:h}=i;if(null===this.startTime)return r.next(0);const{delay:c,repeat:u,repeatType:f,repeatDelay:g,onUpdate:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-d/this.speed,this.startTime)),e?this.currentTime=t:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const p=this.currentTime-c*(this.speed>=0?1:-1),A=this.speed>=0?p<0:p>d;this.currentTime=Math.max(p,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=d);let v=this.currentTime,y=r;if(u){const t=Math.min(this.currentTime,d)/h;let e=Math.floor(t),i=t%1;!i&&t>=1&&(i=1),1===i&&e--,e=Math.min(e,u+1);Boolean(e%2)&&("reverse"===f?(i=1-i,g&&(i-=g/h)):"mirror"===f&&(y=n)),v=Nt(0,1,i)*h}const E=A?{done:!1,value:o[0]}:y.next(v);a&&(E.value=a(E.value));let{done:T}=E;A||null===l||(T=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&T);return S&&void 0!==s&&(E.value=fs(o,this.options,s)),m&&m(E.value),S&&this.finish(),E}get duration(){const{resolved:t}=this;return t?We(t.calculatedDuration):0}get time(){return We(this.currentTime)}set time(t){t=qe(t),this.currentTime=t,null!==this.holdTime||0===this.speed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=We(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:t=ur,onPlay:e,startTime:i}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),e&&e();const s=this.driver.now();null!==this.holdTime?this.startTime=s-this.holdTime:this.startTime?"finished"===this.state&&(this.startTime=s):this.startTime=null!=i?i:this.calcStartTime(),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;this._resolved?(this.state="paused",this.holdTime=null!==(t=this.currentTime)&&void 0!==t?t:0):this.pendingPlayState="paused"}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){null!==this.cancelTime&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const pr=new Set(["opacity","clipPath","filter","transform"]);function Ar(t,e,i,{delay:s=0,duration:r=300,repeat:n=0,repeatType:a="loop",ease:o="easeInOut",times:l}={}){const d={[e]:i};l&&(d.offset=l);const h=ni(o,r);return Array.isArray(h)&&(d.easing=h),t.animate(d,{delay:s,duration:r,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:n+1,direction:"reverse"===a?"alternate":"normal"})}const vr=Ve(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));const yr={anticipate:fi,backInOut:ui,circInOut:pi};class Er extends gs{constructor(t){super(t);const{name:e,motionValue:i,element:s,keyframes:r}=this.options;this.resolver=new hs(r,(t,e)=>this.onKeyframesResolved(t,e),e,i,s),this.resolver.scheduleResolve()}initPlayback(t,e){let{duration:i=300,times:s,ease:r,type:n,motionValue:a,name:o,startTime:l}=this.options;if(!a.owner||!a.owner.current)return!1;var d;if("string"==typeof r&&Je()&&r in yr&&(r=yr[r]),Ye((d=this.options).type)||"spring"===d.type||!ii(d.ease)){const{onComplete:e,onUpdate:a,motionValue:o,element:l,...d}=this.options,h=function(t,e){const i=new mr({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let s={done:!1,value:t[0]};const r=[];let n=0;for(;!s.done&&n<2e4;)s=i.sample(n),r.push(s.value),n+=10;return{times:void 0,keyframes:r,duration:n-10,ease:"linear"}}(t,d);1===(t=h.keyframes).length&&(t[1]=t[0]),i=h.duration,s=h.times,r=h.ease,n="keyframes"}const h=Ar(a.owner.current,o,t,{...this.options,duration:i,times:s,ease:r});return h.startTime=null!=l?l:this.calcStartTime(),this.pendingTimeline?($e(h,this.pendingTimeline),this.pendingTimeline=void 0):h.onfinish=()=>{const{onComplete:i}=this.options;a.set(fs(t,this.options,e)),i&&i(),this.cancel(),this.resolveFinishedPromise()},{animation:h,duration:i,times:s,type:n,ease:r,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:e}=t;return We(e)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:e}=t;return We(e.currentTime||0)}set time(t){const{resolved:e}=this;if(!e)return;const{animation:i}=e;i.currentTime=qe(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:e}=t;return e.playbackRate}set speed(t){const{resolved:e}=this;if(!e)return;const{animation:i}=e;i.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:e}=t;return e.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:e}=t;return e.startTime}attachTimeline(t){if(this._resolved){const{resolved:e}=this;if(!e)return F;const{animation:i}=e;$e(i,t)}else this.pendingTimeline=t;return F}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:e}=t;"finished"===e.playState&&this.updateFinishedPromise(),e.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:e}=t;e.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:e,keyframes:i,duration:s,type:r,ease:n,times:a}=t;if("idle"===e.playState||"finished"===e.playState)return;if(this.time){const{motionValue:t,onUpdate:e,onComplete:o,element:l,...d}=this.options,h=new mr({...d,keyframes:i,duration:s,type:r,ease:n,times:a,isGenerator:!0}),c=qe(this.time);t.setWithVelocity(h.sample(c-10).value,h.sample(c).value,10)}const{onStop:o}=this.options;o&&o(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:e,name:i,repeatDelay:s,repeatType:r,damping:n,type:a}=t;if(!(e&&e.owner&&e.owner.current instanceof HTMLElement))return!1;const{onUpdate:o,transformTemplate:l}=e.owner.getProps();return vr()&&i&&pr.has(i)&&!o&&!l&&!s&&"mirror"!==r&&0!==n&&"inertia"!==a}}const Tr={type:"spring",stiffness:500,damping:25,restSpeed:10},Sr={type:"keyframes",duration:.8},br={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Ir=(t,{keyframes:e})=>e.length>2?Sr:Ct.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:Tr:br;const Lr=(t,e,i,s={},r,n)=>a=>{const o=Re(s,t)||{},l=o.delay||s.delay||0;let{elapsed:d=0}=s;d-=qe(l);let h={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:e.getVelocity(),...o,delay:-d,onUpdate:t=>{e.set(t),o.onUpdate&&o.onUpdate(t)},onComplete:()=>{a(),o.onComplete&&o.onComplete()},name:t,motionValue:e,element:n?void 0:r};(function({when:t,delay:e,delayChildren:i,staggerChildren:s,staggerDirection:r,repeat:n,repeatType:a,repeatDelay:o,from:l,elapsed:d,...h}){return!!Object.keys(h).length})(o)||(h={...h,...Ir(t,h)}),h.duration&&(h.duration=qe(h.duration)),h.repeatDelay&&(h.repeatDelay=qe(h.repeatDelay)),void 0!==h.from&&(h.keyframes[0]=h.from);let c=!1;if((!1===h.type||0===h.duration&&!h.repeatDelay)&&(h.duration=0,0===h.delay&&(c=!0)),c&&!n&&void 0!==e.get()){const t=fs(h.keyframes,o);if(void 0!==t)return j.update(()=>{h.onUpdate(t),h.onComplete()}),new Ke([])}return!n&&Er.supports(h)?new Er(h):new mr(h)};function Rr({protectedKeys:t,needsAnimating:e},i){const s=t.hasOwnProperty(i)&&!0!==e[i];return e[i]=!1,s}function kr(t,e,{delay:i=0,transitionOverride:s,type:r}={}){var n;let{transition:a=t.getDefaultTransition(),transitionEnd:o,...l}=e;s&&(a=s);const d=[],h=r&&t.animationState&&t.animationState.getState()[r];for(const c in l){const e=t.getValue(c,null!==(n=t.latestValues[c])&&void 0!==n?n:null),s=l[c];if(void 0===s||h&&Rr(h,c))continue;const r={delay:i,...Re(a||{},c)};let o=!1;if(window.MotionHandoffAnimation){const e=je(t);if(e){const t=window.MotionHandoffAnimation(e,c,j);null!==t&&(r.startTime=t,o=!0)}}He(t,c),e.start(Lr(c,e,s,t.shouldReduceMotion&&ke.has(c)?{type:!1}:r,t,o));const u=e.animation;u&&d.push(u)}return o&&Promise.all(d).then(()=>{j.update(()=>{o&&Ue(t,o)})}),d}function wr(t,e,i={}){var s;const r=Le(t,e,"exit"===i.type?null===(s=t.presenceContext)||void 0===s?void 0:s.custom:void 0);let{transition:n=t.getDefaultTransition()||{}}=r||{};i.transitionOverride&&(n=i.transitionOverride);const a=r?()=>Promise.all(kr(t,r,i)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(s=0)=>{const{delayChildren:r=0,staggerChildren:a,staggerDirection:o}=n;return function(t,e,i=0,s=0,r=1,n){const a=[],o=(t.variantChildren.size-1)*s,l=1===r?(t=0)=>t*s:(t=0)=>o-t*s;return Array.from(t.variantChildren).sort(Dr).forEach((t,s)=>{t.notify("AnimationStart",e),a.push(wr(t,e,{...n,delay:i+l(s)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(a)}(t,e,r+s,a,o,i)}:()=>Promise.resolve(),{when:l}=n;if(l){const[t,e]="beforeChildren"===l?[a,o]:[o,a];return t().then(()=>e())}return Promise.all([a(),o(i.delay)])}function Dr(t,e){return t.sortNodePosition(e)}function Cr(t,e,i={}){let s;if(t.notify("AnimationStart",e),Array.isArray(e)){const r=e.map(e=>wr(t,e,i));s=Promise.all(r)}else if("string"==typeof e)s=wr(t,e,i);else{const r="function"==typeof e?Le(t,e,i.custom):e;s=Promise.all(kr(t,r,i))}return s.then(()=>{t.notify("AnimationComplete",e)})}const xr=st.length;function Pr(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&Pr(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let i=0;i<xr;i++){const s=st[i],r=t.props[s];(tt(r)||!1===r)&&(e[s]=r)}return e}const Mr=[...it].reverse(),Or=it.length;function Br(t){let e=function(t){return e=>Promise.all(e.map(({animation:e,options:i})=>Cr(t,e,i)))}(t),i=_r(),s=!0;const r=e=>(i,s)=>{var r;const n=Le(t,s,"exit"===e?null===(r=t.presenceContext)||void 0===r?void 0:r.custom:void 0);if(n){const{transition:t,transitionEnd:e,...s}=n;i={...i,...s,...e}}return i};function n(n){const{props:a}=t,o=Pr(t.parent)||{},l=[],d=new Set;let h={},c=1/0;for(let e=0;e<Or;e++){const u=Mr[e],f=i[u],g=void 0!==a[u]?a[u]:o[u],m=tt(g),p=u===n?f.isActive:null;!1===p&&(c=e);let A=g===o[u]&&g!==a[u]&&m;if(A&&s&&t.manuallyAnimateOnMount&&(A=!1),f.protectedKeys={...h},!f.isActive&&null===p||!g&&!f.prevProp||et(g)||"boolean"==typeof g)continue;const v=Fr(f.prevProp,g);let y=v||u===n&&f.isActive&&!A&&m||e>c&&m,E=!1;const T=Array.isArray(g)?g:[g];let S=T.reduce(r(u),{});!1===p&&(S={});const{prevResolvedValues:b={}}=f,I={...b,...S},L=e=>{y=!0,d.has(e)&&(E=!0,d.delete(e)),f.needsAnimating[e]=!0;const i=t.getValue(e);i&&(i.liveStyle=!1)};for(const t in I){const e=S[t],i=b[t];if(h.hasOwnProperty(t))continue;let s=!1;s=bt(e)&&bt(i)?!Ie(e,i):e!==i,s?null!=e?L(t):d.add(t):void 0!==e&&d.has(t)?L(t):f.protectedKeys[t]=!0}f.prevProp=g,f.prevResolvedValues=S,f.isActive&&(h={...h,...S}),s&&t.blockInitialAnimation&&(y=!1);y&&(!(A&&v)||E)&&l.push(...T.map(t=>({animation:t,options:{type:u}})))}if(d.size){const e={};d.forEach(i=>{const s=t.getBaseTarget(i),r=t.getValue(i);r&&(r.liveStyle=!0),e[i]=null!=s?s:null}),l.push({animation:e})}let u=Boolean(l.length);return!s||!1!==a.initial&&a.initial!==a.animate||t.manuallyAnimateOnMount||(u=!1),s=!1,u?e(l):Promise.resolve()}return{animateChanges:n,setActive:function(e,s){var r;if(i[e].isActive===s)return Promise.resolve();null===(r=t.variantChildren)||void 0===r||r.forEach(t=>{var i;return null===(i=t.animationState)||void 0===i?void 0:i.setActive(e,s)}),i[e].isActive=s;const a=n(e);for(const t in i)i[t].protectedKeys={};return a},setAnimateFunction:function(i){e=i(t)},getState:()=>i,reset:()=>{i=_r(),s=!0}}}function Fr(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!Ie(e,t)}function Nr(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function _r(){return{animate:Nr(!0),whileInView:Nr(),whileHover:Nr(),whileTap:Nr(),whileDrag:Nr(),whileFocus:Nr(),exit:Nr()}}class Ur{constructor(t){this.isMounted=!1,this.node=t}update(){}}let Hr=0;const jr={animation:{Feature:class extends Ur{constructor(t){super(t),t.animationState||(t.animationState=Br(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();et(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),null===(t=this.unmountControls)||void 0===t||t.call(this)}}},exit:{Feature:class extends Ur{constructor(){super(...arguments),this.id=Hr++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===i)return;const s=this.node.animationState.setActive("exit",!t);e&&!t&&s.then(()=>e(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}}},Vr={x:!1,y:!1};function Gr(){return Vr.x||Vr.y}const Qr=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary;function Kr(t,e,i,s={passive:!0}){return t.addEventListener(e,i,s),()=>t.removeEventListener(e,i)}function qr(t){return{point:{x:t.pageX,y:t.pageY}}}function Wr(t,e,i,s){return Kr(t,e,(t=>e=>Qr(e)&&t(e,qr(e)))(i),s)}const Yr=(t,e)=>Math.abs(t-e);class $r{constructor(t,e,{transformPagePoint:i,contextWindow:s,dragSnapToOrigin:r=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const t=Zr(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,i=function(t,e){const i=Yr(t.x,e.x),s=Yr(t.y,e.y);return Math.sqrt(i**2+s**2)}(t.offset,{x:0,y:0})>=3;if(!e&&!i)return;const{point:s}=t,{timestamp:r}=G;this.history.push({...s,timestamp:r});const{onStart:n,onMove:a}=this.handlers;e||(n&&n(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),a&&a(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=zr(e,this.transformPagePoint),j.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:i,onSessionEnd:s,resumeAnimation:r}=this.handlers;if(this.dragSnapToOrigin&&r&&r(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const n=Zr("pointercancel"===t.type?this.lastMoveEventInfo:zr(e,this.transformPagePoint),this.history);this.startEvent&&i&&i(t,n),s&&s(t,n)},!Qr(t))return;this.dragSnapToOrigin=r,this.handlers=e,this.transformPagePoint=i,this.contextWindow=s||window;const n=zr(qr(t),this.transformPagePoint),{point:a}=n,{timestamp:o}=G;this.history=[{...a,timestamp:o}];const{onSessionStart:l}=e;l&&l(t,Zr(n,this.history)),this.removeListeners=Ls(Wr(this.contextWindow,"pointermove",this.handlePointerMove),Wr(this.contextWindow,"pointerup",this.handlePointerUp),Wr(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),V(this.updatePoint)}}function zr(t,e){return e?{point:e(t.point)}:t}function Xr(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Zr({point:t},e){return{point:t,delta:Xr(t,tn(e)),offset:Xr(t,Jr(e)),velocity:en(e,.1)}}function Jr(t){return t[0]}function tn(t){return t[t.length-1]}function en(t,e){if(t.length<2)return{x:0,y:0};let i=t.length-1,s=null;const r=tn(t);for(;i>=0&&(s=t[i],!(r.timestamp-s.timestamp>qe(e)));)i--;if(!s)return{x:0,y:0};const n=We(r.timestamp-s.timestamp);if(0===n)return{x:0,y:0};const a={x:(r.x-s.x)/n,y:(r.y-s.y)/n};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function sn(t){return t.max-t.min}function rn(t,e,i,s=.5){t.origin=s,t.originPoint=As(e.min,e.max,t.origin),t.scale=sn(i)/sn(e),t.translate=As(i.min,i.max,t.origin)-t.originPoint,(t.scale>=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function nn(t,e,i,s){rn(t.x,e.x,i.x,s?s.originX:void 0),rn(t.y,e.y,i.y,s?s.originY:void 0)}function an(t,e,i){t.min=i.min+e.min,t.max=t.min+sn(e)}function on(t,e,i){t.min=e.min-i.min,t.max=t.min+sn(e)}function ln(t,e,i){on(t.x,e.x,i.x),on(t.y,e.y,i.y)}function dn(t,e,i){return{min:void 0!==e?t.min+e:void 0,max:void 0!==i?t.max+i-(t.max-t.min):void 0}}function hn(t,e){let i=e.min-t.min,s=e.max-t.max;return e.max-e.min<t.max-t.min&&([i,s]=[s,i]),{min:i,max:s}}const cn=.35;function un(t,e,i){return{min:fn(t,e),max:fn(t,i)}}function fn(t,e){return"number"==typeof t?t:t[e]||0}const gn=()=>({x:{min:0,max:0},y:{min:0,max:0}});function mn(t){return[t("x"),t("y")]}function pn({top:t,left:e,right:i,bottom:s}){return{x:{min:e,max:i},y:{min:t,max:s}}}function An(t){return void 0===t||1===t}function vn({scale:t,scaleX:e,scaleY:i}){return!An(t)||!An(e)||!An(i)}function yn(t){return vn(t)||En(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function En(t){return Tn(t.x)||Tn(t.y)}function Tn(t){return t&&"0%"!==t}function Sn(t,e,i){return i+e*(t-i)}function bn(t,e,i,s,r){return void 0!==r&&(t=Sn(t,r,s)),Sn(t,i,s)+e}function In(t,e=0,i=1,s,r){t.min=bn(t.min,e,i,s,r),t.max=bn(t.max,e,i,s,r)}function Ln(t,{x:e,y:i}){In(t.x,e.translate,e.scale,e.originPoint),In(t.y,i.translate,i.scale,i.originPoint)}const Rn=.999999999999,kn=1.0000000000001;function wn(t,e){t.min=t.min+e,t.max=t.max+e}function Dn(t,e,i,s,r=.5){In(t,e,i,As(t.min,t.max,r),s)}function Cn(t,e){Dn(t.x,e.x,e.scaleX,e.scale,e.originX),Dn(t.y,e.y,e.scaleY,e.scale,e.originY)}function xn(t,e){return pn(function(t,e){if(!e)return t;const i=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:i.y,left:i.x,bottom:s.y,right:s.x}}(t.getBoundingClientRect(),e))}const Pn=({current:t})=>t?t.ownerDocument.defaultView:null,Mn=new WeakMap;class On{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.visualElement=t}start(t,{snapToCursor:e=!1}={}){const{presenceContext:i}=this.visualElement;if(i&&!1===i.isPresent)return;const{dragSnapToOrigin:s}=this.getProps();this.panSession=new $r(t,{onSessionStart:t=>{const{dragSnapToOrigin:i}=this.getProps();i?this.pauseAnimation():this.stopAnimation(),e&&this.snapToCursor(qr(t).point)},onStart:(t,e)=>{const{drag:i,dragPropagation:s,onDragStart:r}=this.getProps();if(i&&!s&&(this.openDragLock&&this.openDragLock(),this.openDragLock="x"===(n=i)||"y"===n?Vr[n]?null:(Vr[n]=!0,()=>{Vr[n]=!1}):Vr.x||Vr.y?null:(Vr.x=Vr.y=!0,()=>{Vr.x=Vr.y=!1}),!this.openDragLock))return;var n;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),mn(t=>{let e=this.getAxisMotionValue(t).get()||0;if(Gt.test(e)){const{projection:i}=this.visualElement;if(i&&i.layout){const s=i.layout.layoutBox[t];if(s){e=sn(s)*(parseFloat(e)/100)}}}this.originPoint[t]=e}),r&&j.postRender(()=>r(t,e)),He(this.visualElement,"transform");const{animationState:a}=this.visualElement;a&&a.setActive("whileDrag",!0)},onMove:(t,e)=>{const{dragPropagation:i,dragDirectionLock:s,onDirectionLock:r,onDrag:n}=this.getProps();if(!i&&!this.openDragLock)return;const{offset:a}=e;if(s&&null===this.currentDirection)return this.currentDirection=function(t,e=10){let i=null;Math.abs(t.y)>e?i="y":Math.abs(t.x)>e&&(i="x");return i}(a),void(null!==this.currentDirection&&r&&r(this.currentDirection));this.updateAxis("x",e.point,a),this.updateAxis("y",e.point,a),this.visualElement.render(),n&&n(t,e)},onSessionEnd:(t,e)=>this.stop(t,e),resumeAnimation:()=>mn(t=>{var e;return"paused"===this.getAnimationState(t)&&(null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.play())})},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:s,contextWindow:Pn(this.visualElement)})}stop(t,e){const i=this.isDragging;if(this.cancel(),!i)return;const{velocity:s}=e;this.startAnimation(s);const{onDragEnd:r}=this.getProps();r&&j.postRender(()=>r(t,e))}cancel(){this.isDragging=!1;const{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),e&&e.setActive("whileDrag",!1)}updateAxis(t,e,i){const{drag:s}=this.getProps();if(!i||!Bn(t,s,this.currentDirection))return;const r=this.getAxisMotionValue(t);let n=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(n=function(t,{min:e,max:i},s){return void 0!==e&&t<e?t=s?As(e,t,s.min):Math.max(t,e):void 0!==i&&t>i&&(t=s?As(i,t,s.max):Math.min(t,i)),t}(n,this.constraints[t],this.elastic[t])),r.set(n)}resolveConstraints(){var t;const{dragConstraints:e,dragElastic:i}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):null===(t=this.visualElement.projection)||void 0===t?void 0:t.layout,r=this.constraints;e&&dt(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!e||!s)&&function(t,{top:e,left:i,bottom:s,right:r}){return{x:dn(t.x,i,r),y:dn(t.y,e,s)}}(s.layoutBox,e),this.elastic=function(t=cn){return!1===t?t=0:!0===t&&(t=cn),{x:un(t,"left","right"),y:un(t,"top","bottom")}}(i),r!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&mn(t=>{!1!==this.constraints&&this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const i={};return void 0!==e.min&&(i.min=e.min-t.min),void 0!==e.max&&(i.max=e.max-t.min),i}(s.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!dt(t))return!1;const i=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const r=function(t,e,i){const s=xn(t,i),{scroll:r}=e;return r&&(wn(s.x,r.offset.x),wn(s.y,r.offset.y)),s}(i,s.root,this.visualElement.getTransformPagePoint());let n=function(t,e){return{x:hn(t.x,e.x),y:hn(t.y,e.y)}}(s.layout.layoutBox,r);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(n));this.hasMutatedConstraints=!!t,t&&(n=pn(t))}return n}startAnimation(t){const{drag:e,dragMomentum:i,dragElastic:s,dragTransition:r,dragSnapToOrigin:n,onDragTransitionEnd:a}=this.getProps(),o=this.constraints||{},l=mn(a=>{if(!Bn(a,e,this.currentDirection))return;let l=o&&o[a]||{};n&&(l={min:0,max:0});const d=s?200:1e6,h=s?40:1e7,c={type:"inertia",velocity:i?t[a]:0,bounceStiffness:d,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...r,...l};return this.startAxisValueAnimation(a,c)});return Promise.all(l).then(a)}startAxisValueAnimation(t,e){const i=this.getAxisMotionValue(t);return He(this.visualElement,t),i.start(Lr(t,i,0,e,this.visualElement,!1))}stopAnimation(){mn(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){mn(t=>{var e;return null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.pause()})}getAnimationState(t){var e;return null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.state}getAxisMotionValue(t){const e=`_drag${t.toUpperCase()}`,i=this.visualElement.getProps(),s=i[e];return s||this.visualElement.getValue(t,(i.initial?i.initial[t]:void 0)||0)}snapToCursor(t){mn(e=>{const{drag:i}=this.getProps();if(!Bn(e,i,this.currentDirection))return;const{projection:s}=this.visualElement,r=this.getAxisMotionValue(e);if(s&&s.layout){const{min:i,max:n}=s.layout.layoutBox[e];r.set(t[e]-As(i,n,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:i}=this.visualElement;if(!dt(e)||!i||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};mn(t=>{const e=this.getAxisMotionValue(t);if(e&&!1!==this.constraints){const i=e.get();s[t]=function(t,e){let i=.5;const s=sn(t),r=sn(e);return r>s?i=ti(e.min,e.max-s,t.min):s>r&&(i=ti(t.min,t.max-r,e.min)),Nt(0,1,i)}({min:i,max:i},this.constraints[t])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),mn(e=>{if(!Bn(e,t,null))return;const i=this.getAxisMotionValue(e),{min:r,max:n}=this.constraints[e];i.set(As(r,n,s[e]))})}addListeners(){if(!this.visualElement.current)return;Mn.set(this.visualElement,this);const t=Wr(this.visualElement.current,"pointerdown",t=>{const{drag:e,dragListener:i=!0}=this.getProps();e&&i&&this.start(t)}),e=()=>{const{dragConstraints:t}=this.getProps();dt(t)&&t.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,s=i.addEventListener("measure",e);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),j.read(e);const r=Kr(window,"resize",()=>this.scalePositionWithinConstraints()),n=i.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(mn(e=>{const i=this.getAxisMotionValue(e);i&&(this.originPoint[e]+=t[e].translate,i.set(i.get()+t[e].translate))}),this.visualElement.render())});return()=>{r(),t(),s(),n&&n()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:i=!1,dragPropagation:s=!1,dragConstraints:r=!1,dragElastic:n=cn,dragMomentum:a=!0}=t;return{...t,drag:e,dragDirectionLock:i,dragPropagation:s,dragConstraints:r,dragElastic:n,dragMomentum:a}}}function Bn(t,e,i){return!(!0!==e&&e!==t||null!==i&&i!==t)}const Fn=t=>(e,i)=>{t&&j.postRender(()=>t(e,i))};const Nn={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function _n(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Un={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!Qt.test(t))return t;t=parseFloat(t)}return`${_n(t,e.target.x)}% ${_n(t,e.target.y)}%`}},Hn={correct:(t,{treeScale:e,projectionDelta:i})=>{const s=t,r=Ni.parse(t);if(r.length>5)return s;const n=Ni.createTransformer(t),a="number"!=typeof r[0]?1:0,o=i.x.scale*e.x,l=i.y.scale*e.y;r[0+a]/=o,r[1+a]/=l;const d=As(o,l,.5);return"number"==typeof r[2+a]&&(r[2+a]/=d),"number"==typeof r[3+a]&&(r[3+a]/=d),n(r)}};class jn extends D.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:i,layoutId:s}=this.props,{projection:r}=t;var n;n=Gn,Object.assign(ce,n),r&&(e.group&&e.group.add(r),i&&i.register&&s&&i.register(r),r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,onExitComplete:()=>this.safeToRemove()})),Nn.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:i,drag:s,isPresent:r}=this.props,n=i.projection;return n?(n.isPresent=r,s||t.layoutDependency!==e||void 0===e?n.willUpdate():this.safeToRemove(),t.isPresent!==r&&(r?n.promote():n.relegate()||j.postRender(()=>{const t=n.getStack();t&&t.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),ft.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:i}=this.props,{projection:s}=t;s&&(s.scheduleCheckAfterUnmount(),e&&e.group&&e.group.remove(s),i&&i.deregister&&i.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Vn(t){const[e,i]=function(t=!0){const e=D.useContext(P);if(null===e)return[!0,null];const{isPresent:i,onExitComplete:s,register:r}=e,n=D.useId();D.useEffect(()=>{t&&r(n)},[t]);const a=D.useCallback(()=>t&&s&&s(n),[n,s,t]);return!i&&s?[!1,a]:[!0]}(),s=D.useContext(C);return w.jsx(jn,{...t,layoutGroup:s,switchLayoutGroup:D.useContext(gt),isPresent:e,safeToRemove:i})}const Gn={borderRadius:{...Un,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Un,borderTopRightRadius:Un,borderBottomLeftRadius:Un,borderBottomRightRadius:Un,boxShadow:Hn};function Qn(t,e,i){const s=Lt(t)?t:Ne(t);return s.start(Lr("",s,e,i)),s.animation}function Kn(t){return t instanceof SVGElement&&"svg"!==t.tagName}const qn=(t,e)=>t.depth-e.depth;class Wn{constructor(){this.children=[],this.isDirty=!1}add(t){xe(this.children,t),this.isDirty=!0}remove(t){Pe(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(qn),this.isDirty=!1,this.children.forEach(t)}}const Yn=["TopLeft","TopRight","BottomLeft","BottomRight"],$n=Yn.length,zn=t=>"string"==typeof t?parseFloat(t):t,Xn=t=>"number"==typeof t||Qt.test(t);function Zn(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const Jn=ea(0,.5,mi),ta=ea(.5,.95,F);function ea(t,e,i){return s=>s<t?0:s>e?1:i(ti(t,e,s))}function ia(t,e){t.min=e.min,t.max=e.max}function sa(t,e){ia(t.x,e.x),ia(t.y,e.y)}function ra(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function na(t,e,i,s,r){return t=Sn(t-=e,1/i,s),void 0!==r&&(t=Sn(t,1/r,s)),t}function aa(t,e,[i,s,r],n,a){!function(t,e=0,i=1,s=.5,r,n=t,a=t){Gt.test(e)&&(e=parseFloat(e),e=As(a.min,a.max,e/100)-a.min);if("number"!=typeof e)return;let o=As(n.min,n.max,s);t===n&&(o-=e),t.min=na(t.min,e,i,o,r),t.max=na(t.max,e,i,o,r)}(t,e[i],e[s],e[r],e.scale,n,a)}const oa=["x","scaleX","originX"],la=["y","scaleY","originY"];function da(t,e,i,s){aa(t.x,e,oa,i?i.x:void 0,s?s.x:void 0),aa(t.y,e,la,i?i.y:void 0,s?s.y:void 0)}function ha(t){return 0===t.translate&&1===t.scale}function ca(t){return ha(t.x)&&ha(t.y)}function ua(t,e){return t.min===e.min&&t.max===e.max}function fa(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function ga(t,e){return fa(t.x,e.x)&&fa(t.y,e.y)}function ma(t){return sn(t.x)/sn(t.y)}function pa(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class Aa{constructor(){this.members=[]}add(t){xe(this.members,t),t.scheduleRender()}remove(t){if(Pe(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){const e=this.members.findIndex(e=>t===e);if(0===e)return!1;let i;for(let s=e;s>=0;s--){const t=this.members[s];if(!1!==t.isPresent){i=t;break}}return!!i&&(this.promote(i),!0)}promote(t,e){const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.instance&&i.scheduleRender(),t.scheduleRender(),t.resumeFrom=i,e&&(t.resumeFrom.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:s}=t.options;!1===s&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:e,resumingFrom:i}=t;e.onExitComplete&&e.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const va={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},ya="undefined"!=typeof window&&void 0!==window.MotionDebug,Ea=["","X","Y","Z"],Ta={visibility:"hidden"};let Sa=0;function ba(t,e,i,s){const{latestValues:r}=e;r[t]&&(i[t]=r[t],e.setStaticValue(t,0),s&&(s[t]=0))}function Ia(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const i=je(e);if(window.MotionHasOptimisedAnimation(i,"transform")){const{layout:e,layoutId:s}=t.options;window.MotionCancelOptimisedAnimation(i,"transform",j,!(e||s))}const{parent:s}=t;s&&!s.hasCheckedOptimisedAppear&&Ia(s)}function La({attachResizeListener:t,defaultParent:e,measureScroll:i,checkIsScrollRoot:s,resetTransform:r}){return class{constructor(t={},i=(null==e?void 0:e())){this.id=Sa++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,ya&&(va.totalNodes=va.resolvedTargetDeltas=va.recalculatedProjection=0),this.nodes.forEach(wa),this.nodes.forEach(Ba),this.nodes.forEach(Fa),this.nodes.forEach(Da),ya&&window.MotionDebug.record(va)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=i?i.root||i:this,this.path=i?[...i.path,i]:[],this.parent=i,this.depth=i?i.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new Wn)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new Me),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){const i=this.eventHandlers.get(t);i&&i.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}mount(e,i=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=Kn(e),this.instance=e;const{layoutId:s,layout:r,visualElement:n}=this.options;if(n&&!n.current&&n.mount(e),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),i&&(r||s)&&(this.isLayoutDirty=!0),t){let i;const s=()=>this.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,i&&i(),i=function(t,e){const i=Ce.now(),s=({timestamp:r})=>{const n=r-i;n>=e&&(V(s),t(n-e))};return j.read(s,!0),()=>V(s)}(s,250),Nn.hasAnimatedSinceResize&&(Nn.hasAnimatedSinceResize=!1,this.nodes.forEach(Oa))})}s&&this.root.registerSharedNode(s,this),!1!==this.options.animate&&n&&(s||r)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeTargetChanged:i,layout:s})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const r=this.options.transition||n.getDefaultTransition()||Va,{onLayoutAnimationStart:a,onLayoutAnimationComplete:o}=n.getProps(),l=!this.targetLayout||!ga(this.targetLayout,s)||i,d=!e&&i;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||d||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(t,d);const e={...Re(r,"layout"),onPlay:a,onComplete:o};(n.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||Oa(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=s})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,V(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Na),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Ia(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let r=0;r<this.path.length;r++){const t=this.path[r];t.shouldResetTransform=!0,t.updateScroll("snapshot"),t.options.layoutRoot&&t.willUpdate(!1)}const{layoutId:e,layout:i}=this.options;if(void 0===e&&!i)return;const s=this.getTransformTemplate();this.prevTransformTemplateValue=s?s(this.latestValues,""):void 0,this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}update(){this.updateScheduled=!1;if(this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(xa);this.isUpdating||this.nodes.forEach(Pa),this.isUpdating=!1,this.nodes.forEach(Ma),this.nodes.forEach(Ra),this.nodes.forEach(ka),this.clearAllSnapshots();const t=Ce.now();G.delta=Nt(0,1e3/60,t-G.timestamp),G.timestamp=t,G.isProcessing=!0,Q.update.process(G),Q.preRender.process(G),Q.render.process(G),G.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,ft.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Ca),this.sharedNodes.forEach(_a)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,j.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){j.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let i=0;i<this.path.length;i++){this.path[i].updateScroll()}const t=this.layout;this.layout=this.measure(!1),this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:e}=this.options;e&&e.notify("LayoutMeasure",this.layout.layoutBox,t?t.layoutBox:void 0)}updateScroll(t="measure"){let e=Boolean(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===t&&(e=!1),e){const e=s(this.instance);this.scroll={animationId:this.root.animationId,phase:t,isRoot:e,offset:i(this.instance),wasRoot:this.scroll?this.scroll.isRoot:e}}}resetTransform(){if(!r)return;const t=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,e=this.projectionDelta&&!ca(this.projectionDelta),i=this.getTransformTemplate(),s=i?i(this.latestValues,""):void 0,n=s!==this.prevTransformTemplateValue;t&&(e||yn(this.latestValues)||n)&&(r(this.instance,s),this.shouldResetTransform=!1,this.scheduleRender())}measure(t=!0){const e=this.measurePageBox();let i=this.removeElementScroll(e);var s;return t&&(i=this.removeTransform(i)),Ka((s=i).x),Ka(s.y),{animationId:this.root.animationId,measuredBox:e,layoutBox:i,latestValues:{},source:this.id}}measurePageBox(){var t;const{visualElement:e}=this.options;if(!e)return{x:{min:0,max:0},y:{min:0,max:0}};const i=e.measureViewportBox();if(!((null===(t=this.scroll)||void 0===t?void 0:t.wasRoot)||this.path.some(Wa))){const{scroll:t}=this.root;t&&(wn(i.x,t.offset.x),wn(i.y,t.offset.y))}return i}removeElementScroll(t){var e;const i={x:{min:0,max:0},y:{min:0,max:0}};if(sa(i,t),null===(e=this.scroll)||void 0===e?void 0:e.wasRoot)return i;for(let s=0;s<this.path.length;s++){const e=this.path[s],{scroll:r,options:n}=e;e!==this.root&&r&&n.layoutScroll&&(r.wasRoot&&sa(i,t),wn(i.x,r.offset.x),wn(i.y,r.offset.y))}return i}applyTransform(t,e=!1){const i={x:{min:0,max:0},y:{min:0,max:0}};sa(i,t);for(let s=0;s<this.path.length;s++){const t=this.path[s];!e&&t.options.layoutScroll&&t.scroll&&t!==t.root&&Cn(i,{x:-t.scroll.offset.x,y:-t.scroll.offset.y}),yn(t.latestValues)&&Cn(i,t.latestValues)}return yn(this.latestValues)&&Cn(i,this.latestValues),i}removeTransform(t){const e={x:{min:0,max:0},y:{min:0,max:0}};sa(e,t);for(let i=0;i<this.path.length;i++){const t=this.path[i];if(!t.instance)continue;if(!yn(t.latestValues))continue;vn(t.latestValues)&&t.updateSnapshot();const s=gn();sa(s,t.measurePageBox()),da(e,t.latestValues,t.snapshot?t.snapshot.layoutBox:void 0,s)}return yn(this.latestValues)&&da(e,this.latestValues),e}setTargetDelta(t){this.targetDelta=t,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(t){this.options={...this.options,...t,crossfade:void 0===t.crossfade||t.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==G.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(t=!1){var e;const i=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=i.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=i.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=i.isSharedProjectionDirty);const s=Boolean(this.resumingFrom)||this!==i;if(!(t||s&&this.isSharedProjectionDirty||this.isProjectionDirty||(null===(e=this.parent)||void 0===e?void 0:e.isProjectionDirty)||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:r,layoutId:n}=this.options;if(this.layout&&(r||n)){if(this.resolvedRelativeTargetAt=G.timestamp,!this.targetDelta&&!this.relativeTarget){const t=this.getClosestProjectingParent();t&&t.layout&&1!==this.animationProgress?(this.relativeParent=t,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},ln(this.relativeTargetOrigin,this.layout.layoutBox,t.layout.layoutBox),sa(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(this.relativeTarget||this.targetDelta){var a,o,l;if(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),a=this.target,o=this.relativeTarget,l=this.relativeParent.target,an(a.x,o.x,l.x),an(a.y,o.y,l.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):sa(this.target,this.layout.layoutBox),Ln(this.target,this.targetDelta)):sa(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const t=this.getClosestProjectingParent();t&&Boolean(t.resumingFrom)===Boolean(this.resumingFrom)&&!t.options.layoutScroll&&t.target&&1!==this.animationProgress?(this.relativeParent=t,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},ln(this.relativeTargetOrigin,this.target,t.target),sa(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}ya&&va.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(this.parent&&!vn(this.parent.latestValues)&&!En(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var t;const e=this.getLead(),i=Boolean(this.resumingFrom)||this!==e;let s=!0;if((this.isProjectionDirty||(null===(t=this.parent)||void 0===t?void 0:t.isProjectionDirty))&&(s=!1),i&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(s=!1),this.resolvedRelativeTargetAt===G.timestamp&&(s=!1),s)return;const{layout:r,layoutId:n}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!r&&!n)return;sa(this.layoutCorrected,this.layout.layoutBox);const a=this.treeScale.x,o=this.treeScale.y;!function(t,e,i,s=!1){const r=i.length;if(!r)return;let n,a;e.x=e.y=1;for(let o=0;o<r;o++){n=i[o],a=n.projectionDelta;const{visualElement:r}=n.options;r&&r.props.style&&"contents"===r.props.style.display||(s&&n.options.layoutScroll&&n.scroll&&n!==n.root&&Cn(t,{x:-n.scroll.offset.x,y:-n.scroll.offset.y}),a&&(e.x*=a.x.scale,e.y*=a.y.scale,Ln(t,a)),s&&yn(n.latestValues)&&Cn(t,n.latestValues))}e.x<kn&&e.x>Rn&&(e.x=1),e.y<kn&&e.y>Rn&&(e.y=1)}(this.layoutCorrected,this.treeScale,this.path,i),!e.layout||e.target||1===this.treeScale.x&&1===this.treeScale.y||(e.target=e.layout.layoutBox,e.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:l}=e;l?(this.projectionDelta&&this.prevProjectionDelta?(ra(this.prevProjectionDelta.x,this.projectionDelta.x),ra(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),nn(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.treeScale.x===a&&this.treeScale.y===o&&pa(this.projectionDelta.x,this.prevProjectionDelta.x)&&pa(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l)),ya&&va.recalculatedProjection++):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){var e;if(null===(e=this.options.visualElement)||void 0===e||e.scheduleRender(),t){const t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}}setAnimationOrigin(t,e=!1){const i=this.snapshot,s=i?i.latestValues:{},r={...this.latestValues},n={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;const a={x:{min:0,max:0},y:{min:0,max:0}},o=(i?i.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),d=!l||l.members.length<=1,h=Boolean(o&&!d&&!0===this.options.crossfade&&!this.path.some(ja));let c;this.animationProgress=0,this.mixTargetDelta=e=>{const i=e/1e3;var l,u,f,g,m,p;Ua(n.x,t.x,i),Ua(n.y,t.y,i),this.setTargetDelta(n),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ln(a,this.layout.layoutBox,this.relativeParent.layout.layoutBox),f=this.relativeTarget,g=this.relativeTargetOrigin,m=a,p=i,Ha(f.x,g.x,m.x,p),Ha(f.y,g.y,m.y,p),c&&(l=this.relativeTarget,u=c,ua(l.x,u.x)&&ua(l.y,u.y))&&(this.isProjectionDirty=!1),c||(c={x:{min:0,max:0},y:{min:0,max:0}}),sa(c,this.relativeTarget)),o&&(this.animationValues=r,function(t,e,i,s,r,n){r?(t.opacity=As(0,void 0!==i.opacity?i.opacity:1,Jn(s)),t.opacityExit=As(void 0!==e.opacity?e.opacity:1,0,ta(s))):n&&(t.opacity=As(void 0!==e.opacity?e.opacity:1,void 0!==i.opacity?i.opacity:1,s));for(let a=0;a<$n;a++){const r=`border${Yn[a]}Radius`;let n=Zn(e,r),o=Zn(i,r);void 0===n&&void 0===o||(n||(n=0),o||(o=0),0===n||0===o||Xn(n)===Xn(o)?(t[r]=Math.max(As(zn(n),zn(o),s),0),(Gt.test(o)||Gt.test(n))&&(t[r]+="%")):t[r]=o)}(e.rotate||i.rotate)&&(t.rotate=As(e.rotate||0,i.rotate||0,s))}(r,s,this.latestValues,i,h,d)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=i},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(V(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=j.update(()=>{Nn.hasAnimatedSinceResize=!0,this.currentAnimation=Qn(0,1e3,{...t,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onComplete:()=>{t.onComplete&&t.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:i,layout:s,latestValues:r}=t;if(e&&i&&s){if(this!==t&&this.layout&&s&&qa(this.options.animationType,this.layout.layoutBox,s.layoutBox)){i=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=sn(this.layout.layoutBox.x);i.x.min=t.target.x.min,i.x.max=i.x.min+e;const s=sn(this.layout.layoutBox.y);i.y.min=t.target.y.min,i.y.max=i.y.min+s}sa(e,i),Cn(e,r),nn(this.projectionDeltaWithTransform,this.layoutCorrected,e,r)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new Aa);this.sharedNodes.get(t).add(e);const i=e.options.initialPromotionConfig;e.promote({transition:i?i.transition:void 0,preserveFollowOpacity:i&&i.shouldPreserveFollowOpacity?i.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){var t;const{layoutId:e}=this.options;return e&&(null===(t=this.getStack())||void 0===t?void 0:t.lead)||this}getPrevLead(){var t;const{layoutId:e}=this.options;return e?null===(t=this.getStack())||void 0===t?void 0:t.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:i}={}){const s=this.getStack();s&&s.promote(this,i),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetSkewAndRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:i}=t;if((i.z||i.rotate||i.rotateX||i.rotateY||i.rotateZ||i.skewX||i.skewY)&&(e=!0),!e)return;const s={};i.z&&ba("z",t,s,this.animationValues);for(let r=0;r<Ea.length;r++)ba(`rotate${Ea[r]}`,t,s,this.animationValues),ba(`skew${Ea[r]}`,t,s,this.animationValues);t.render();for(const r in s)t.setStaticValue(r,s[r]),this.animationValues&&(this.animationValues[r]=s[r]);t.scheduleRender()}getProjectionStyles(t){var e,i;if(!this.instance||this.isSVG)return;if(!this.isVisible)return Ta;const s={visibility:""},r=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,s.opacity="",s.pointerEvents=Rt(null==t?void 0:t.pointerEvents)||"",s.transform=r?r(this.latestValues,""):"none",s;const n=this.getLead();if(!this.projectionDelta||!this.layout||!n.target){const e={};return this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=Rt(null==t?void 0:t.pointerEvents)||""),this.hasProjected&&!yn(this.latestValues)&&(e.transform=r?r({},""):"none",this.hasProjected=!1),e}const a=n.animationValues||n.latestValues;this.applyTransformsToTarget(),s.transform=function(t,e,i){let s="";const r=t.x.translate/e.x,n=t.y.translate/e.y,a=(null==i?void 0:i.z)||0;if((r||n||a)&&(s=`translate3d(${r}px, ${n}px, ${a}px) `),1===e.x&&1===e.y||(s+=`scale(${1/e.x}, ${1/e.y}) `),i){const{transformPerspective:t,rotate:e,rotateX:r,rotateY:n,skewX:a,skewY:o}=i;t&&(s=`perspective(${t}px) ${s}`),e&&(s+=`rotate(${e}deg) `),r&&(s+=`rotateX(${r}deg) `),n&&(s+=`rotateY(${n}deg) `),a&&(s+=`skewX(${a}deg) `),o&&(s+=`skewY(${o}deg) `)}const o=t.x.scale*e.x,l=t.y.scale*e.y;return 1===o&&1===l||(s+=`scale(${o}, ${l})`),s||"none"}(this.projectionDeltaWithTransform,this.treeScale,a),r&&(s.transform=r(a,s.transform));const{x:o,y:l}=this.projectionDelta;s.transformOrigin=`${100*o.origin}% ${100*l.origin}% 0`,n.animationValues?s.opacity=n===this?null!==(i=null!==(e=a.opacity)&&void 0!==e?e:this.latestValues.opacity)&&void 0!==i?i:1:this.preserveOpacity?this.latestValues.opacity:a.opacityExit:s.opacity=n===this?void 0!==a.opacity?a.opacity:"":void 0!==a.opacityExit?a.opacityExit:0;for(const d in ce){if(void 0===a[d])continue;const{correct:t,applyTo:e}=ce[d],i="none"===s.transform?a[d]:t(a[d],n);if(e){const t=e.length;for(let r=0;r<t;r++)s[e[r]]=i}else s[d]=i}return this.options.layoutId&&(s.pointerEvents=n===this?Rt(null==t?void 0:t.pointerEvents)||"":"none"),s}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(t=>{var e;return null===(e=t.currentAnimation)||void 0===e?void 0:e.stop()}),this.root.nodes.forEach(xa),this.root.sharedNodes.clear()}}}function Ra(t){t.updateLayout()}function ka(t){var e;const i=(null===(e=t.resumeFrom)||void 0===e?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&i&&t.hasListeners("didUpdate")){const{layoutBox:e,measuredBox:s}=t.layout,{animationType:r}=t.options,n=i.source!==t.layout.source;"size"===r?mn(t=>{const s=n?i.measuredBox[t]:i.layoutBox[t],r=sn(s);s.min=e[t].min,s.max=s.min+r}):qa(r,i.layoutBox,e)&&mn(s=>{const r=n?i.measuredBox[s]:i.layoutBox[s],a=sn(e[s]);r.max=r.min+a,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[s].max=t.relativeTarget[s].min+a)});const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};nn(a,e,i.layoutBox);const o={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};n?nn(o,t.applyTransform(s,!0),i.measuredBox):nn(o,e,i.layoutBox);const l=!ca(a);let d=!1;if(!t.resumeFrom){const s=t.getClosestProjectingParent();if(s&&!s.resumeFrom){const{snapshot:r,layout:n}=s;if(r&&n){const a={x:{min:0,max:0},y:{min:0,max:0}};ln(a,i.layoutBox,r.layoutBox);const o={x:{min:0,max:0},y:{min:0,max:0}};ln(o,e,n.layoutBox),ga(a,o)||(d=!0),s.options.layoutRoot&&(t.relativeTarget=o,t.relativeTargetOrigin=a,t.relativeParent=s)}}}t.notifyListeners("didUpdate",{layout:e,snapshot:i,delta:o,layoutDelta:a,hasLayoutChanged:l,hasRelativeTargetChanged:d})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function wa(t){ya&&va.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=Boolean(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Da(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Ca(t){t.clearSnapshot()}function xa(t){t.clearMeasurements()}function Pa(t){t.isLayoutDirty=!1}function Ma(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Oa(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Ba(t){t.resolveTargetDelta()}function Fa(t){t.calcProjection()}function Na(t){t.resetSkewAndRotation()}function _a(t){t.removeLeadSnapshot()}function Ua(t,e,i){t.translate=As(e.translate,0,i),t.scale=As(e.scale,1,i),t.origin=e.origin,t.originPoint=e.originPoint}function Ha(t,e,i,s){t.min=As(e.min,i.min,s),t.max=As(e.max,i.max,s)}function ja(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const Va={duration:.45,ease:[.4,0,.1,1]},Ga=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Qa=Ga("applewebkit/")&&!Ga("chrome/")?Math.round:F;function Ka(t){t.min=Qa(t.min),t.max=Qa(t.max)}function qa(t,e,i){return"position"===t||"preserve-aspect"===t&&(s=ma(e),r=ma(i),n=.2,!(Math.abs(s-r)<=n));var s,r,n}function Wa(t){var e;return t!==t.root&&(null===(e=t.scroll)||void 0===e?void 0:e.wasRoot)}const Ya=La({attachResizeListener:(t,e)=>Kr(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),$a={current:void 0},za=La({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!$a.current){const t=new Ya({});t.mount(window),t.setOptions({layoutScroll:!0}),$a.current=t}return $a.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),Xa={pan:{Feature:class extends Ur{constructor(){super(...arguments),this.removePointerDownListener=F}onPointerDown(t){this.session=new $r(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Pn(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:i,onPanEnd:s}=this.node.getProps();return{onSessionStart:Fn(t),onStart:Fn(e),onMove:i,onEnd:(t,e)=>{delete this.session,s&&j.postRender(()=>s(t,e))}}}mount(){this.removePointerDownListener=Wr(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends Ur{constructor(t){super(t),this.removeGroupControls=F,this.removeListeners=F,this.controls=new On(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||F}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:za,MeasureLayout:Vn}};function Za(t,e,i){var s;if(t instanceof Element)return[t];if("string"==typeof t){let e=document;const r=null!==(s=null==i?void 0:i[t])&&void 0!==s?s:e.querySelectorAll(t);return r?Array.from(r):[]}return Array.from(t)}function Ja(t,e){const i=Za(t),s=new AbortController;return[i,{passive:!0,...e,signal:s.signal},()=>s.abort()]}function to(t){return e=>{"touch"===e.pointerType||Gr()||t(e)}}function eo(t,e,i){const{props:s}=t;t.animationState&&s.whileHover&&t.animationState.setActive("whileHover","Start"===i);const r=s["onHover"+i];r&&j.postRender(()=>r(e,qr(e)))}const io=(t,e)=>!!e&&(t===e||io(t,e.parentElement)),so=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const ro=new WeakSet;function no(t){return e=>{"Enter"===e.key&&t(e)}}function ao(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function oo(t){return Qr(t)&&!Gr()}function lo(t,e,i={}){const[s,r,n]=Ja(t,i),a=t=>{const s=t.currentTarget;if(!oo(t)||ro.has(s))return;ro.add(s);const n=e(t),a=(t,e)=>{window.removeEventListener("pointerup",o),window.removeEventListener("pointercancel",l),oo(t)&&ro.has(s)&&(ro.delete(s),"function"==typeof n&&n(t,{success:e}))},o=t=>{a(t,i.useGlobalTarget||io(s,t.target))},l=t=>{a(t,!1)};window.addEventListener("pointerup",o,r),window.addEventListener("pointercancel",l,r)};return s.forEach(t=>{(function(t){return so.has(t.tagName)||-1!==t.tabIndex})(t)||null!==t.getAttribute("tabindex")||(t.tabIndex=0);(i.useGlobalTarget?window:t).addEventListener("pointerdown",a,r),t.addEventListener("focus",t=>((t,e)=>{const i=t.currentTarget;if(!i)return;const s=no(()=>{if(ro.has(i))return;ao(i,"down");const t=no(()=>{ao(i,"up")});i.addEventListener("keyup",t,e),i.addEventListener("blur",()=>ao(i,"cancel"),e)});i.addEventListener("keydown",s,e),i.addEventListener("blur",()=>i.removeEventListener("keydown",s),e)})(t,r),r)}),n}function ho(t,e,i){const{props:s}=t;t.animationState&&s.whileTap&&t.animationState.setActive("whileTap","Start"===i);const r=s["onTap"+("End"===i?"":i)];r&&j.postRender(()=>r(e,qr(e)))}const co=new WeakMap,uo=new WeakMap,fo=t=>{const e=co.get(t.target);e&&e(t)},go=t=>{t.forEach(fo)};function mo(t,e,i){const s=function({root:t,...e}){const i=t||document;uo.has(i)||uo.set(i,{});const s=uo.get(i),r=JSON.stringify(e);return s[r]||(s[r]=new IntersectionObserver(go,{root:t,...e})),s[r]}(e);return co.set(t,i),s.observe(t),()=>{co.delete(t),s.unobserve(t)}}const po={some:0,all:1};const Ao={inView:{Feature:class extends Ur{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:e,margin:i,amount:s="some",once:r}=t,n={root:e?e.current:void 0,rootMargin:i,threshold:"number"==typeof s?s:po[s]};return mo(this.node.current,n,t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,r&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:i,onViewportLeave:s}=this.node.getProps(),n=e?i:s;n&&n(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return i=>t[i]!==e[i]}(t,e))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends Ur{mount(){const{current:t}=this.node;t&&(this.unmount=lo(t,t=>(ho(this.node,t,"Start"),(t,{success:e})=>ho(this.node,t,e?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}},focus:{Feature:class extends Ur{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Ls(Kr(this.node.current,"focus",()=>this.onFocus()),Kr(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends Ur{mount(){const{current:t}=this.node;t&&(this.unmount=function(t,e,i={}){const[s,r,n]=Ja(t,i),a=to(t=>{const{target:i}=t,s=e(t);if("function"!=typeof s||!i)return;const n=to(t=>{s(t),i.removeEventListener("pointerleave",n)});i.addEventListener("pointerleave",n,r)});return s.forEach(t=>{t.addEventListener("pointerenter",a,r)}),n}(t,t=>(eo(this.node,t,"Start"),t=>eo(this.node,t,"End"))))}unmount(){}}}},vo={layout:{ProjectionNode:za,MeasureLayout:Vn}},yo={current:null},Eo={current:!1};const To=[...ls,wi,Ni],So=new WeakMap;const bo=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Io{scrapeMotionValuesFromProps(t,e,i){return{}}constructor({parent:t,props:e,presenceContext:i,reducedMotionConfig:s,blockInitialAnimation:r,visualState:n},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=ss,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=Ce.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,j.render(this.render,!1,!0))};const{latestValues:o,renderState:l,onUpdate:d}=n;this.onUpdate=d,this.latestValues=o,this.baseTarget={...o},this.initialValues=e.initial?{...o}:{},this.renderState=l,this.parent=t,this.props=e,this.presenceContext=i,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=a,this.blockInitialAnimation=Boolean(r),this.isControllingVariants=rt(e),this.isVariantNode=nt(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:h,...c}=this.scrapeMotionValuesFromProps(e,{},this);for(const u in c){const t=c[u];void 0!==o[u]&&Lt(t)&&t.set(o[u],!1)}}mount(t){this.current=t,So.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),Eo.current||function(){if(Eo.current=!0,O)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>yo.current=t.matches;t.addListener(e),e()}else yo.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||yo.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){So.delete(this.current),this.projection&&this.projection.unmount(),V(this.notifyUpdate),V(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}bindToMotionValue(t,e){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const i=Ct.has(t),s=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&j.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0)}),r=e.on("renderRequest",this.scheduleRender);let n;window.MotionCheckAppearSync&&(n=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{s(),r(),n&&n(),e.owner&&e.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in W){const e=W[t];if(!e)continue;const{isEnabled:i,Feature:s}=e;if(!this.features[t]&&s&&i(this.props)&&(this.features[t]=new s(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let i=0;i<bo.length;i++){const e=bo[i];this.propEventSubscriptions[e]&&(this.propEventSubscriptions[e](),delete this.propEventSubscriptions[e]);const s=t["on"+e];s&&(this.propEventSubscriptions[e]=this.on(e,s))}this.prevMotionValues=function(t,e,i){for(const s in e){const r=e[s],n=i[s];if(Lt(r))t.addValue(s,r);else if(Lt(n))t.addValue(s,Ne(r,{owner:t}));else if(n!==r)if(t.hasValue(s)){const e=t.getValue(s);!0===e.liveStyle?e.jump(r):e.hasAnimated||e.set(r)}else{const e=t.getStaticValue(s);t.addValue(s,Ne(void 0!==e?e:r,{owner:t}))}}for(const s in i)void 0===e[s]&&t.removeValue(s);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const i=this.values.get(t);e!==i&&(i&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let i=this.values.get(t);return void 0===i&&void 0!==e&&(i=Ne(null===e?void 0:e,{owner:this}),this.addValue(t,i)),i}readValue(t,e){var i;let s=void 0===this.latestValues[t]&&this.current?null!==(i=this.getBaseTargetFromProps(this.props,t))&&void 0!==i?i:this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var r;return null!=s&&("string"==typeof s&&(rs(s)||Ai(s))?s=parseFloat(s):(r=s,!To.find(os(r))&&Ni.test(e)&&(s=Qi(t,e))),this.setBaseTarget(t,Lt(s)?s.get():s)),Lt(s)?s.get():s}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;const{initial:i}=this.props;let s;if("string"==typeof i||"object"==typeof i){const r=St(this.props,i,null===(e=this.presenceContext)||void 0===e?void 0:e.custom);r&&(s=r[t])}if(i&&void 0!==s)return s;const r=this.getBaseTargetFromProps(this.props,t);return void 0===r||Lt(r)?void 0!==this.initialValues[t]&&void 0===s?void 0:this.baseTarget[t]:r}on(t,e){return this.events[t]||(this.events[t]=new Me),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}class Lo extends Io{constructor(){super(...arguments),this.KeyframeResolver=hs}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:i}){delete e[t],delete i[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Lt(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}class Ro extends Lo{constructor(){super(...arguments),this.type="html",this.renderInstance=le}readValueFromInstance(t,e){if(Ct.has(e)){const t=Gi(e);return t&&t.default||0}{const s=(i=t,window.getComputedStyle(i)),r=(Pt(e)?s.getPropertyValue(e):s[e])||0;return"string"==typeof r?r.trim():r}var i}measureInstanceViewportBox(t,{transformPagePoint:e}){return xn(t,e)}build(t,e,i){te(t,e,i.transformTemplate)}scrapeMotionValuesFromProps(t,e,i){return fe(t,e,i)}}class ko extends Lo{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=gn}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(Ct.has(e)){const t=Gi(e);return t&&t.default||0}return e=de.has(e)?e:ct(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,i){return ge(t,e,i)}build(t,e,i){re(t,e,this.isSVGTag,i.transformTemplate)}renderInstance(t,e,i,s){he(t,e,0,s)}mount(t){this.isSVGTag=oe(t.tagName),super.mount(t)}}const wo=Z(be({...jr,...Ao,...Xa,...vo},(t,e)=>Et(t)?new ko(e):new Ro(e,{allowProjection:t!==D.Fragment})));function Do(t){const e=x(()=>Ne(t)),{isStatic:i}=D.useContext(M);if(i){const[,i]=D.useState(t);D.useEffect(()=>e.on("change",i),[])}return e}function Co(t,e){const i=Do(e()),s=()=>i.set(e());return s(),B(()=>{const e=()=>j.preRender(s,!1,!0),i=t.map(t=>t.on("change",e));return()=>{i.forEach(t=>t()),V(s)}}),i}function xo(t,e,i,s){if("function"==typeof t)return function(t){Be.current=[],t();const e=Co(Be.current,t);return Be.current=void 0,e}(t);const r="function"==typeof e?e:function(...t){const e=!Array.isArray(t[0]),i=e?0:-1,s=t[0+i],r=t[1+i],n=t[2+i],a=t[3+i],o=lr(r,n,{mixer:(l=n[0],(t=>t&&"object"==typeof t&&t.mix)(l)?l.mix:void 0),...a});var l;return e?o(s):o}(e,i,s);return Array.isArray(t)?Po(t,r):Po([t],([t])=>r(t))}function Po(t,e){const i=x(()=>[]);return Co(t,()=>{i.length=0;const s=t.length;for(let e=0;e<s;e++)i[e]=t[e].get();return e(i)})}function Mo(t,e){[...e].reverse().forEach(i=>{const s=t.getVariant(i);s&&Ue(t,s),t.variantChildren&&t.variantChildren.forEach(t=>{Mo(t,e)})})}function Oo(){const t=new Set,e={subscribe:e=>(t.add(e),()=>{t.delete(e)}),start(e,i){const s=[];return t.forEach(t=>{s.push(Cr(t,e,{transitionOverride:i}))}),Promise.all(s)},set:e=>t.forEach(t=>{!function(t,e){Array.isArray(e)?Mo(t,e):"string"==typeof e?Mo(t,[e]):Ue(t,e)}(t,e)}),stop(){t.forEach(t=>{!function(t){t.values.forEach(t=>t.stop())}(t)})},mount:()=>()=>{e.stop()}};return e}function Bo(t,e=100,i){const s=i({...t,keyframes:[0,e]}),r=Math.min(ps(s),ms);return{type:"keyframes",ease:t=>s.next(r*t).value/e,duration:We(r)}}function Fo(t,e){return nr(t)?t[((t,e,i)=>{const s=e-t;return((i-t)%s+s)%s+t})(0,t.length,e)]:t}function No(t){return"object"==typeof t&&!Array.isArray(t)}function _o(t,e,i,s){return"string"==typeof t&&No(e)?Za(t,0,s):t instanceof NodeList?Array.from(t):Array.isArray(t)?t:[t]}function Uo(t,e,i){return t*(e+1)}function Ho(t,e,i,s){var r;return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?i:null!==(r=s.get(e))&&void 0!==r?r:t}function jo(t,e,i,s,r,n){!function(t,e,i){for(let s=0;s<t.length;s++){const r=t[s];r.at>e&&r.at<i&&(Pe(t,r),s--)}}(t,r,n);for(let a=0;a<e.length;a++)t.push({value:e[a],at:As(r,n,s[a]),easing:Fo(i,a)})}function Vo(t,e){for(let i=0;i<t.length;i++)t[i]=t[i]/(e+1)}function Go(t,e){return t.at===e.at?null===t.value?1:null===e.value?-1:0:t.at-e.at}function Qo(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function Ko(t,e){return e[t]||(e[t]=[]),e[t]}function qo(t){return Array.isArray(t)?t:[t]}function Wo(t,e){return t&&t[e]?{...t,...t[e]}:{...t}}const Yo=t=>"number"==typeof t,$o=t=>t.every(Yo);class zo extends Io{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,e){if(function(t,e){return t in e}(e,t)){const i=t[e];if("string"==typeof i||"number"==typeof i)return i}}getBaseTargetFromProps(){}removeValueFromRenderState(t,e){delete e.output[t]}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}build(t,e){Object.assign(t.output,e)}renderInstance(t,{output:e}){Object.assign(t,e)}sortInstanceNodePosition(){return 0}}function Xo(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},i=Kn(t)?new ko(e):new Ro(e);i.mount(t),So.set(t,i)}function Zo(t){const e=new zo({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});e.mount(t),So.set(t,e)}function Jo(t,e,i,s){const r=[];if(function(t,e){return Lt(t)||"number"==typeof t||"string"==typeof t&&!No(e)}(t,e))r.push(Qn(t,No(e)&&e.default||e,i&&i.default||i));else{const s=_o(t,e),n=s.length;for(let t=0;t<n;t++){const a=s[t],o=a instanceof Element?Xo:Zo;So.has(a)||o(a);const l=So.get(a),d={...i};"delay"in d&&"function"==typeof d.delay&&(d.delay=d.delay(t,n)),r.push(...kr(l,{...e,transition:d},{}))}}return r}function tl(t,e,i){const s=[],r=function(t,{defaultTransition:e={},...i}={},s,r){const n=e.duration||.3,a=new Map,o=new Map,l={},d=new Map;let h=0,c=0,u=0;for(let f=0;f<t.length;f++){const i=t[f];if("string"==typeof i){d.set(i,c);continue}if(!Array.isArray(i)){d.set(i.name,Ho(c,i.at,h,d));continue}let[s,a,g={}]=i;void 0!==g.at&&(c=Ho(c,g.at,h,d));let m=0;const p=(t,i,s,a=0,o=0)=>{const l=qo(t),{delay:d=0,times:h=hr(l),type:f="keyframes",repeat:g,repeatType:p,repeatDelay:A=0,...v}=i;let{ease:y=e.ease||"easeOut",duration:E}=i;const T="function"==typeof d?d(a,o):d,S=l.length,b=Ye(f)?f:null==r?void 0:r[f];if(S<=2&&b){let t=100;if(2===S&&$o(l)){const e=l[1]-l[0];t=Math.abs(e)}const e={...v};void 0!==E&&(e.duration=qe(E));const i=Bo(e,t,b);y=i.ease,E=i.duration}null!=E||(E=n);const I=c+T;1===h.length&&0===h[0]&&(h[1]=1);const L=h.length-l.length;if(L>0&&dr(h,L),1===l.length&&l.unshift(null),g){E=Uo(E,g);const t=[...l],e=[...h];y=Array.isArray(y)?[...y]:[y];const i=[...y];for(let s=0;s<g;s++){l.push(...t);for(let r=0;r<t.length;r++)h.push(e[r]+(s+1)),y.push(0===r?"linear":Fo(i,r-1))}Vo(h,g)}const R=I+E;jo(s,l,y,h,I,R),m=Math.max(T+E,m),u=Math.max(R,u)};if(Lt(s))p(a,g,Ko("default",Qo(s,o)));else{const t=_o(s,a,0,l),e=t.length;for(let i=0;i<e;i++){const s=Qo(t[i],o);for(const t in a)p(a[t],Wo(g,t),Ko(t,s),i,e)}}h=c,c+=m}return o.forEach((t,s)=>{for(const r in t){const n=t[r];n.sort(Go);const o=[],l=[],d=[];for(let t=0;t<n.length;t++){const{at:e,value:i,easing:s}=n[t];o.push(i),l.push(ti(0,u,e)),d.push(s||"easeOut")}0!==l[0]&&(l.unshift(0),o.unshift(o[0]),d.unshift("easeInOut")),1!==l[l.length-1]&&(l.push(1),o.push(null)),a.has(s)||a.set(s,{keyframes:{},transition:{}});const h=a.get(s);h.keyframes[r]=o,h.transition[r]={...e,duration:u,ease:d,times:l,...i}}}),a}(t,e,0,{spring:tr});return r.forEach(({keyframes:t,transition:e},i)=>{s.push(...Jo(i,t,e))}),s}const el=function(t,e,i){let s=[];var r;return r=t,s=Array.isArray(r)&&r.some(Array.isArray)?tl(t,e):Jo(t,e,i),new Ke(s)};function il(){const t=x(Oo);return B(t.mount,[]),t}const sl="_card_doqsx_2",rl="_cardContent_doqsx_18",nl="_gradientBottom_doqsx_29",al="_gradientTop_doqsx_41",ol="_cardName_doqsx_52",ll=({card:t,cardUIConfig:e,className:i="",children:s})=>{const{gradient:r,title:n}=e,a=r.color||"rgba(0, 0, 0, 1)",o=(()=>{if(!r.type)return{showTop:!1,showBottom:!1};const t=r.type.toLowerCase();return{showTop:"top"===t||"top-and-bottom"===t,showBottom:"bottom"===t||"top-and-bottom"===t}})();return w.jsxs("div",{id:t.id||void 0,className:`${sl} ${i}`.trim(),children:[s,o.showBottom&&w.jsx("div",{className:nl,style:{background:`linear-gradient(transparent, ${a})`}}),o.showTop&&w.jsx("div",{className:al,style:{background:`linear-gradient(${a}, transparent)`}}),n.enabled&&w.jsx("div",{className:rl,children:w.jsx("div",{className:ol,style:{fontSize:`${n.textSize}px`,bottom:`${n.positionBottom}%`},children:t.title||""})})]})},dl="_image_trs4h_2",hl=({card:t,onImageReady:e,ready:i=!0,lazyLoad:s=!1,className:r=""})=>{const n=D.useRef(null);return D.useEffect(()=>{if(n.current&&e&&i){const t=()=>{e(n.current)};if(!n.current.complete)return n.current.addEventListener("load",t),()=>{var e;null==(e=n.current)||e.removeEventListener("load",t)};e(n.current)}},[i]),w.jsx(w.Fragment,{children:t.imageUrl&&i&&w.jsx("img",{ref:n,src:t.imageUrl,alt:t.title||"",loading:s?"lazy":"eager",className:`${dl} ${r}`.trim()})})},cl=["abort","canplay","canplaythrough","durationchange","emptied","encrypted","ended","error","loadeddata","loadedmetadata","loadstart","pause","play","playing","progress","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting","waitingforkey","resize","enterpictureinpicture","leavepictureinpicture","webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"],ul=["autopictureinpicture","disablepictureinpicture","disableremoteplayback","autoplay","controls","controlslist","crossorigin","loop","muted","playsinline","poster","preload","src"];function fl(t){return`\n <style>\n :host {\n display: inline-flex;\n line-height: 0;\n flex-direction: column;\n justify-content: end;\n }\n\n audio {\n width: 100%;\n }\n </style>\n <slot name="media">\n <audio${pl(t)}></audio>\n </slot>\n <slot></slot>\n `}function gl(t){return`\n <style>\n :host {\n display: inline-block;\n line-height: 0;\n }\n\n video {\n max-width: 100%;\n max-height: 100%;\n min-width: 100%;\n min-height: 100%;\n object-fit: var(--media-object-fit, contain);\n object-position: var(--media-object-position, 50% 50%);\n }\n\n video::-webkit-media-text-track-container {\n transform: var(--media-webkit-text-track-transform);\n transition: var(--media-webkit-text-track-transition);\n }\n </style>\n <slot name="media">\n <video${pl(t)}></video>\n </slot>\n <slot></slot>\n `}function ml(t,{tag:e,is:i}){var s,r,n,a,o,l,d,h,c,u,f,g,m,p,A,v,y,E,T;const b=null==(r=null==(s=globalThis.document)?void 0:s.createElement)?void 0:r.call(s,e,{is:i}),w=b?function(t){const e=[];for(let i=Object.getPrototypeOf(t);i&&i!==HTMLElement.prototype;i=Object.getPrototypeOf(i)){const t=Object.getOwnPropertyNames(i);e.push(...t)}return e}(b):[];return n=class extends t{constructor(){super(...arguments),L(this,g),L(this,d,!1),L(this,h,null),L(this,c,new Map),L(this,u),L(this,f),S(this,"get"),S(this,"set"),S(this,"call")}static get observedAttributes(){var t,e;k(t=n,o,l).call(t);return[...(null==(e=null==b?void 0:b.constructor)?void 0:e.observedAttributes)??[],...ul]}get nativeEl(){var t;return k(this,g,m).call(this),I(this,h)??this.querySelector(":scope > [slot=media]")??this.querySelector(e)??(null==(t=this.shadowRoot)?void 0:t.querySelector(e))??null}set nativeEl(t){R(this,h,t)}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(t){this.toggleAttribute("muted",t)}get src(){return this.getAttribute("src")}set src(t){this.setAttribute("src",`${t}`)}get preload(){var t;return this.getAttribute("preload")??(null==(t=this.nativeEl)?void 0:t.preload)}set preload(t){this.setAttribute("preload",`${t}`)}init(){if(!this.shadowRoot){this.attachShadow({mode:"open"});const t=function(t){const e={};for(const i of t)e[i.name]=i.value;return e}(this.attributes);i&&(t.is=i),e&&(t.part=e),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(t)}this.nativeEl.muted=this.hasAttribute("muted");for(const t of w)k(this,g,E).call(this,t);k(this,g,p).call(this)}handleEvent(t){t.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(t.type,{detail:t.detail}))}attributeChangedCallback(t,e,i){k(this,g,m).call(this),k(this,g,T).call(this,t,e,i)}connectedCallback(){k(this,g,m).call(this),I(this,f)||k(this,g,p).call(this)}disconnectedCallback(){var t,e,i;null==(t=I(this,u))||t.disconnect(),R(this,u,void 0),I(this,f)&&(null==(e=this.shadowRoot)||e.removeEventListener("slotchange",I(this,f)),R(this,f,void 0));for(const s of this.constructor.Events)null==(i=this.shadowRoot)||i.removeEventListener(s,this,!0);I(this,c).forEach(t=>t.remove()),I(this,c).clear(),R(this,h,null)}},a=new WeakMap,o=new WeakSet,l=function(){if(I(this,a))return;R(this,a,!0);const t=new Set(this.observedAttributes);t.delete("muted");for(const e of w)if(!(e in this.prototype))if("function"==typeof b[e])this.prototype[e]=function(...t){k(this,g,m).call(this);return(()=>{var i;if(this.call)return this.call(e,...t);const s=null==(i=this.nativeEl)?void 0:i[e];return null==s?void 0:s.apply(this.nativeEl,t)})()};else{const i={get(){var i,s;k(this,g,m).call(this);const r=e.toLowerCase();if(t.has(r)){const t=this.getAttribute(r);return null!==t&&(""===t||t)}return(null==(i=this.get)?void 0:i.call(this,e))??(null==(s=this.nativeEl)?void 0:s[e])}};e!==e.toUpperCase()&&(i.set=function(i){k(this,g,m).call(this);const s=e.toLowerCase();t.has(s)?!0===i||!1===i||null==i?this.toggleAttribute(s,Boolean(i)):this.setAttribute(s,i):this.set?this.set(e,i):this.nativeEl&&(this.nativeEl[e]=i)}),Object.defineProperty(this.prototype,e,i)}},d=new WeakMap,h=new WeakMap,c=new WeakMap,u=new WeakMap,f=new WeakMap,g=new WeakSet,m=function(){I(this,d)||(R(this,d,!0),this.init())},p=function(){var t,e;R(this,u,new MutationObserver(k(this,g,v).bind(this))),R(this,f,()=>k(this,g,A).call(this)),null==(t=this.shadowRoot)||t.addEventListener("slotchange",I(this,f)),k(this,g,A).call(this);for(const i of this.constructor.Events)null==(e=this.shadowRoot)||e.addEventListener(i,this,!0)},A=function(){var t;const e=new Map(I(this,c)),i=null==(t=this.shadowRoot)?void 0:t.querySelector("slot:not([name])");(null==i?void 0:i.assignedElements({flatten:!0}).filter(t=>["track","source"].includes(t.localName))).forEach(t=>{var i,s;e.delete(t);let r=I(this,c).get(t);r||(r=t.cloneNode(),I(this,c).set(t,r),null==(i=I(this,u))||i.observe(t,{attributes:!0})),null==(s=this.nativeEl)||s.append(r),k(this,g,y).call(this,r)}),e.forEach((t,e)=>{t.remove(),I(this,c).delete(e)})},v=function(t){for(const e of t)if("attributes"===e.type){const{target:t,attributeName:i}=e,s=I(this,c).get(t);s&&i&&(s.setAttribute(i,t.getAttribute(i)??""),k(this,g,y).call(this,s))}},y=function(t){t&&"track"===t.localName&&t.default&&("chapters"===t.kind||"metadata"===t.kind)&&"disabled"===t.track.mode&&(t.track.mode="hidden")},E=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){const e=this[t];delete this[t],this[t]=e}},T=function(t,e,i){var s,r,a;["id","class"].includes(t)||!n.observedAttributes.includes(t)&&this.constructor.observedAttributes.includes(t)||(null===i?null==(s=this.nativeEl)||s.removeAttribute(t):(null==(r=this.nativeEl)?void 0:r.getAttribute(t))!==i&&(null==(a=this.nativeEl)||a.setAttribute(t,i)))},L(n,o),S(n,"getTemplateHTML",e.endsWith("audio")?fl:gl),S(n,"shadowRootOptions",{mode:"open"}),S(n,"Events",cl),L(n,a,!1),n}function pl(t){let e="";for(const i in t){if(!ul.includes(i))continue;const s=t[i];e+=""===s?` ${i}`:` ${i}="${s}"`}return e}const Al=ml(globalThis.HTMLElement??class{},{tag:"video"});ml(globalThis.HTMLElement??class{},{tag:"audio"});class vl extends Event{constructor(t,e){super(t),S(this,"track"),this.track=e.track}}const yl=new WeakMap;function El(t){return yl.get(t)??function(t,e){let i=yl.get(t);i||yl.set(t,i={});return Object.assign(i,e)}(t,{})}function Tl(t,e){const i=t.videoTracks;El(e).media=new WeakRef(t),El(e).renditionSet||(El(e).renditionSet=new Set);const s=El(i).trackSet;s.add(e);const r=s.size-1;r in bl.prototype||Object.defineProperty(bl.prototype,r,{get(){return[...El(this).trackSet][r]}}),queueMicrotask(()=>{i.dispatchEvent(new vl("addtrack",{track:e}))})}function Sl(t){var e,i;const s=null==(i=null==(e=El(t).media)?void 0:e.deref())?void 0:i.videoTracks;if(!s)return;El(s).trackSet.delete(t),queueMicrotask(()=>{s.dispatchEvent(new vl("removetrack",{track:t}))})}class bl extends EventTarget{constructor(){super(),L(this,s),L(this,t),L(this,e),L(this,i),El(this).trackSet=new Set}[Symbol.iterator](){return I(this,s,r).values()}get length(){return I(this,s,r).size}getTrackById(t){return[...I(this,s,r)].find(e=>e.id===t)??null}get selectedIndex(){return[...I(this,s,r)].findIndex(t=>t.selected)}get onaddtrack(){return I(this,t)}set onaddtrack(e){I(this,t)&&(this.removeEventListener("addtrack",I(this,t)),R(this,t,void 0)),"function"==typeof e&&(R(this,t,e),this.addEventListener("addtrack",e))}get onremovetrack(){return I(this,e)}set onremovetrack(t){I(this,e)&&(this.removeEventListener("removetrack",I(this,e)),R(this,e,void 0)),"function"==typeof t&&(R(this,e,t),this.addEventListener("removetrack",t))}get onchange(){return I(this,i)}set onchange(t){I(this,i)&&(this.removeEventListener("change",I(this,i)),R(this,i,void 0)),"function"==typeof t&&(R(this,i,t),this.addEventListener("change",t))}}t=new WeakMap,e=new WeakMap,i=new WeakMap,s=new WeakSet,r=function(){return El(this).trackSet};class Il extends Event{constructor(t,e){super(t),S(this,"rendition"),this.rendition=e.rendition}}function Ll(t){var e;const i=null==(e=El(t).media)?void 0:e.deref();return i?[...i.videoTracks].filter(t=>t.selected).flatMap(t=>[...El(t).renditionSet]):[]}class Rl extends EventTarget{constructor(){super(...arguments),L(this,n),L(this,a),L(this,o)}[Symbol.iterator](){return Ll(this).values()}get length(){return Ll(this).length}getRenditionById(t){return Ll(this).find(e=>`${e.id}`==`${t}`)??null}get selectedIndex(){return Ll(this).findIndex(t=>t.selected)}set selectedIndex(t){for(const[e,i]of Ll(this).entries())i.selected=e===t}get onaddrendition(){return I(this,n)}set onaddrendition(t){I(this,n)&&(this.removeEventListener("addrendition",I(this,n)),R(this,n,void 0)),"function"==typeof t&&(R(this,n,t),this.addEventListener("addrendition",t))}get onremoverendition(){return I(this,a)}set onremoverendition(t){I(this,a)&&(this.removeEventListener("removerendition",I(this,a)),R(this,a,void 0)),"function"==typeof t&&(R(this,a,t),this.addEventListener("removerendition",t))}get onchange(){return I(this,o)}set onchange(t){I(this,o)&&(this.removeEventListener("change",I(this,o)),R(this,o,void 0)),"function"==typeof t&&(R(this,o,t),this.addEventListener("change",t))}}n=new WeakMap,a=new WeakMap,o=new WeakMap;class kl{constructor(){S(this,"src"),S(this,"id"),S(this,"width"),S(this,"height"),S(this,"bitrate"),S(this,"frameRate"),S(this,"codec"),L(this,l,!1)}get selected(){return I(this,l)}set selected(t){I(this,l)!==t&&(R(this,l,t),function(t){var e,i;const s=null==(i=null==(e=El(t).media)?void 0:e.deref())?void 0:i.videoRenditions;s&&!El(s).changeRequested&&(El(s).changeRequested=!0,queueMicrotask(()=>{delete El(s).changeRequested,El(t).track.selected&&s.dispatchEvent(new Event("change"))}))}(this))}}l=new WeakMap;class wl{constructor(){S(this,"id"),S(this,"kind"),S(this,"label",""),S(this,"language",""),S(this,"sourceBuffer"),L(this,d,!1)}addRendition(t,e,i,s,r,n){const a=new kl;return a.src=t,a.width=e,a.height=i,a.frameRate=n,a.bitrate=r,a.codec=s,function(t,e){var i,s;const r=null==(s=null==(i=El(t).media)?void 0:i.deref())?void 0:s.videoRenditions;El(e).media=El(t).media,El(e).track=t;const n=El(t).renditionSet;n.add(e);const a=n.size-1;a in Rl.prototype||Object.defineProperty(Rl.prototype,a,{get(){return Ll(this)[a]}}),queueMicrotask(()=>{r&&t.selected&&r.dispatchEvent(new Il("addrendition",{rendition:e}))})}(this,a),a}removeRendition(t){!function(t){var e,i;const s=null==(i=null==(e=El(t).media)?void 0:e.deref())?void 0:i.videoRenditions,r=El(t).track;El(r).renditionSet.delete(t),queueMicrotask(()=>{const e=El(t).track;s&&e.selected&&s.dispatchEvent(new Il("removerendition",{rendition:t}))})}(t)}get selected(){return I(this,d)}set selected(t){I(this,d)!==t&&(R(this,d,t),!0===t&&function(t){var e,i;const s=(null==(i=null==(e=El(t).media)?void 0:e.deref())?void 0:i.videoTracks)??[];let r=!1;for(const n of s)n!==t&&(n.selected=!1,r=!0);if(r){if(El(s).changeRequested)return;El(s).changeRequested=!0,queueMicrotask(()=>{delete El(s).changeRequested,s.dispatchEvent(new Event("change"))})}}(this))}}function Dl(t){var e;const i=null==(e=El(t).media)?void 0:e.deref();return i?[...i.audioTracks].filter(t=>t.enabled).flatMap(t=>[...El(t).renditionSet]):[]}d=new WeakMap;class Cl extends EventTarget{constructor(){super(...arguments),L(this,h),L(this,c),L(this,u)}[Symbol.iterator](){return Dl(this).values()}get length(){return Dl(this).length}getRenditionById(t){return Dl(this).find(e=>`${e.id}`==`${t}`)??null}get selectedIndex(){return Dl(this).findIndex(t=>t.selected)}set selectedIndex(t){for(const[e,i]of Dl(this).entries())i.selected=e===t}get onaddrendition(){return I(this,h)}set onaddrendition(t){I(this,h)&&(this.removeEventListener("addrendition",I(this,h)),R(this,h,void 0)),"function"==typeof t&&(R(this,h,t),this.addEventListener("addrendition",t))}get onremoverendition(){return I(this,c)}set onremoverendition(t){I(this,c)&&(this.removeEventListener("removerendition",I(this,c)),R(this,c,void 0)),"function"==typeof t&&(R(this,c,t),this.addEventListener("removerendition",t))}get onchange(){return I(this,u)}set onchange(t){I(this,u)&&(this.removeEventListener("change",I(this,u)),R(this,u,void 0)),"function"==typeof t&&(R(this,u,t),this.addEventListener("change",t))}}h=new WeakMap,c=new WeakMap,u=new WeakMap;class xl{constructor(){S(this,"src"),S(this,"id"),S(this,"bitrate"),S(this,"codec"),L(this,f,!1)}get selected(){return I(this,f)}set selected(t){I(this,f)!==t&&(R(this,f,t),function(t){var e,i;const s=null==(i=null==(e=El(t).media)?void 0:e.deref())?void 0:i.audioRenditions;s&&!El(s).changeRequested&&(El(s).changeRequested=!0,queueMicrotask(()=>{delete El(s).changeRequested,El(t).track.enabled&&s.dispatchEvent(new Event("change"))}))}(this))}}function Pl(t,e){const i=t.audioTracks;El(e).media=new WeakRef(t),El(e).renditionSet||(El(e).renditionSet=new Set);const s=El(i).trackSet;s.add(e);const r=s.size-1;r in Ol.prototype||Object.defineProperty(Ol.prototype,r,{get(){return[...El(this).trackSet][r]}}),queueMicrotask(()=>{i.dispatchEvent(new vl("addtrack",{track:e}))})}function Ml(t){var e,i;const s=null==(i=null==(e=El(t).media)?void 0:e.deref())?void 0:i.audioTracks;if(!s)return;El(s).trackSet.delete(t),queueMicrotask(()=>{s.dispatchEvent(new vl("removetrack",{track:t}))})}f=new WeakMap;class Ol extends EventTarget{constructor(){super(),L(this,A),L(this,g),L(this,m),L(this,p),El(this).trackSet=new Set}[Symbol.iterator](){return I(this,A,v).values()}get length(){return I(this,A,v).size}getTrackById(t){return[...I(this,A,v)].find(e=>e.id===t)??null}get onaddtrack(){return I(this,g)}set onaddtrack(t){I(this,g)&&(this.removeEventListener("addtrack",I(this,g)),R(this,g,void 0)),"function"==typeof t&&(R(this,g,t),this.addEventListener("addtrack",t))}get onremovetrack(){return I(this,m)}set onremovetrack(t){I(this,m)&&(this.removeEventListener("removetrack",I(this,m)),R(this,m,void 0)),"function"==typeof t&&(R(this,m,t),this.addEventListener("removetrack",t))}get onchange(){return I(this,p)}set onchange(t){I(this,p)&&(this.removeEventListener("change",I(this,p)),R(this,p,void 0)),"function"==typeof t&&(R(this,p,t),this.addEventListener("change",t))}}g=new WeakMap,m=new WeakMap,p=new WeakMap,A=new WeakSet,v=function(){return El(this).trackSet};class Bl{constructor(){S(this,"id"),S(this,"kind"),S(this,"label",""),S(this,"language",""),S(this,"sourceBuffer"),L(this,y,!1)}addRendition(t,e,i){const s=new xl;return s.src=t,s.codec=e,s.bitrate=i,function(t,e){var i,s;const r=null==(s=null==(i=El(t).media)?void 0:i.deref())?void 0:s.audioRenditions;El(e).media=El(t).media,El(e).track=t;const n=El(t).renditionSet;n.add(e);const a=n.size-1;a in Cl.prototype||Object.defineProperty(Cl.prototype,a,{get(){return Dl(this)[a]}}),queueMicrotask(()=>{r&&t.enabled&&r.dispatchEvent(new Il("addrendition",{rendition:e}))})}(this,s),s}removeRendition(t){!function(t){var e,i;const s=null==(i=null==(e=El(t).media)?void 0:e.deref())?void 0:i.audioRenditions,r=El(t).track;El(r).renditionSet.delete(t),queueMicrotask(()=>{const e=El(t).track;s&&e.enabled&&s.dispatchEvent(new Il("removerendition",{rendition:t}))})}(t)}get enabled(){return I(this,y)}set enabled(t){I(this,y)!==t&&(R(this,y,t),function(t){var e,i;const s=null==(i=null==(e=El(t).media)?void 0:e.deref())?void 0:i.audioTracks;s&&!El(s).changeRequested&&(El(s).changeRequested=!0,queueMicrotask(()=>{delete El(s).changeRequested,s.dispatchEvent(new Event("change"))}))}(this))}}y=new WeakMap;const Fl=_l(globalThis.HTMLMediaElement,"video"),Nl=_l(globalThis.HTMLMediaElement,"audio");function _l(t,e){var i;if(null==t?void 0:t.prototype)return null==(i=Object.getOwnPropertyDescriptor(t.prototype,`${e}Tracks`))?void 0:i.get}const Ul=Number.isFinite||function(t){return"number"==typeof t&&isFinite(t)},Hl=Number.isSafeInteger||function(t){return"number"==typeof t&&Math.abs(t)<=jl},jl=Number.MAX_SAFE_INTEGER||9007199254740991;let Vl=function(t){return t.NETWORK_ERROR="networkError",t.MEDIA_ERROR="mediaError",t.KEY_SYSTEM_ERROR="keySystemError",t.MUX_ERROR="muxError",t.OTHER_ERROR="otherError",t}({}),Gl=function(t){return t.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",t.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",t.KEY_SYSTEM_NO_SESSION="keySystemNoSession",t.KEY_SYSTEM_NO_CONFIGURED_LICENSE="keySystemNoConfiguredLicense",t.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",t.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED="keySystemServerCertificateRequestFailed",t.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED="keySystemServerCertificateUpdateFailed",t.KEY_SYSTEM_SESSION_UPDATE_FAILED="keySystemSessionUpdateFailed",t.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED="keySystemStatusOutputRestricted",t.KEY_SYSTEM_STATUS_INTERNAL_ERROR="keySystemStatusInternalError",t.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR="keySystemDestroyMediaKeysError",t.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR="keySystemDestroyCloseSessionError",t.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR="keySystemDestroyRemoveSessionError",t.MANIFEST_LOAD_ERROR="manifestLoadError",t.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",t.MANIFEST_PARSING_ERROR="manifestParsingError",t.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",t.LEVEL_EMPTY_ERROR="levelEmptyError",t.LEVEL_LOAD_ERROR="levelLoadError",t.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",t.LEVEL_PARSING_ERROR="levelParsingError",t.LEVEL_SWITCH_ERROR="levelSwitchError",t.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",t.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",t.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",t.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",t.FRAG_LOAD_ERROR="fragLoadError",t.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",t.FRAG_DECRYPT_ERROR="fragDecryptError",t.FRAG_PARSING_ERROR="fragParsingError",t.FRAG_GAP="fragGap",t.REMUX_ALLOC_ERROR="remuxAllocError",t.KEY_LOAD_ERROR="keyLoadError",t.KEY_LOAD_TIMEOUT="keyLoadTimeOut",t.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",t.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",t.BUFFER_APPEND_ERROR="bufferAppendError",t.BUFFER_APPENDING_ERROR="bufferAppendingError",t.BUFFER_STALLED_ERROR="bufferStalledError",t.BUFFER_FULL_ERROR="bufferFullError",t.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",t.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",t.ASSET_LIST_LOAD_ERROR="assetListLoadError",t.ASSET_LIST_LOAD_TIMEOUT="assetListLoadTimeout",t.ASSET_LIST_PARSING_ERROR="assetListParsingError",t.INTERSTITIAL_ASSET_ITEM_ERROR="interstitialAssetItemError",t.INTERNAL_EXCEPTION="internalException",t.INTERNAL_ABORTED="aborted",t.ATTACH_MEDIA_ERROR="attachMediaError",t.UNKNOWN="unknown",t}({}),Ql=function(t){return t.MEDIA_ATTACHING="hlsMediaAttaching",t.MEDIA_ATTACHED="hlsMediaAttached",t.MEDIA_DETACHING="hlsMediaDetaching",t.MEDIA_DETACHED="hlsMediaDetached",t.MEDIA_ENDED="hlsMediaEnded",t.STALL_RESOLVED="hlsStallResolved",t.BUFFER_RESET="hlsBufferReset",t.BUFFER_CODECS="hlsBufferCodecs",t.BUFFER_CREATED="hlsBufferCreated",t.BUFFER_APPENDING="hlsBufferAppending",t.BUFFER_APPENDED="hlsBufferAppended",t.BUFFER_EOS="hlsBufferEos",t.BUFFERED_TO_END="hlsBufferedToEnd",t.BUFFER_FLUSHING="hlsBufferFlushing",t.BUFFER_FLUSHED="hlsBufferFlushed",t.MANIFEST_LOADING="hlsManifestLoading",t.MANIFEST_LOADED="hlsManifestLoaded",t.MANIFEST_PARSED="hlsManifestParsed",t.LEVEL_SWITCHING="hlsLevelSwitching",t.LEVEL_SWITCHED="hlsLevelSwitched",t.LEVEL_LOADING="hlsLevelLoading",t.LEVEL_LOADED="hlsLevelLoaded",t.LEVEL_UPDATED="hlsLevelUpdated",t.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",t.LEVELS_UPDATED="hlsLevelsUpdated",t.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",t.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",t.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",t.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",t.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",t.AUDIO_TRACK_UPDATED="hlsAudioTrackUpdated",t.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",t.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",t.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",t.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",t.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",t.SUBTITLE_TRACK_UPDATED="hlsSubtitleTrackUpdated",t.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",t.CUES_PARSED="hlsCuesParsed",t.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",t.INIT_PTS_FOUND="hlsInitPtsFound",t.FRAG_LOADING="hlsFragLoading",t.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",t.FRAG_LOADED="hlsFragLoaded",t.FRAG_DECRYPTED="hlsFragDecrypted",t.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",t.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",t.FRAG_PARSING_METADATA="hlsFragParsingMetadata",t.FRAG_PARSED="hlsFragParsed",t.FRAG_BUFFERED="hlsFragBuffered",t.FRAG_CHANGED="hlsFragChanged",t.FPS_DROP="hlsFpsDrop",t.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",t.MAX_AUTO_LEVEL_UPDATED="hlsMaxAutoLevelUpdated",t.ERROR="hlsError",t.DESTROYING="hlsDestroying",t.KEY_LOADING="hlsKeyLoading",t.KEY_LOADED="hlsKeyLoaded",t.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",t.BACK_BUFFER_REACHED="hlsBackBufferReached",t.STEERING_MANIFEST_LOADED="hlsSteeringManifestLoaded",t.ASSET_LIST_LOADING="hlsAssetListLoading",t.ASSET_LIST_LOADED="hlsAssetListLoaded",t.INTERSTITIALS_UPDATED="hlsInterstitialsUpdated",t.INTERSTITIALS_BUFFERED_TO_BOUNDARY="hlsInterstitialsBufferedToBoundary",t.INTERSTITIAL_ASSET_PLAYER_CREATED="hlsInterstitialAssetPlayerCreated",t.INTERSTITIAL_STARTED="hlsInterstitialStarted",t.INTERSTITIAL_ASSET_STARTED="hlsInterstitialAssetStarted",t.INTERSTITIAL_ASSET_ENDED="hlsInterstitialAssetEnded",t.INTERSTITIAL_ASSET_ERROR="hlsInterstitialAssetError",t.INTERSTITIAL_ENDED="hlsInterstitialEnded",t.INTERSTITIALS_PRIMARY_RESUMED="hlsInterstitialsPrimaryResumed",t.PLAYOUT_LIMIT_REACHED="hlsPlayoutLimitReached",t.EVENT_CUE_ENTER="hlsEventCueEnter",t}({});var Kl="manifest",ql="level",Wl="audioTrack",Yl="subtitleTrack",$l="main",zl="audio",Xl="subtitle";class Zl{constructor(t,e=0,i=0){this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=t,this.alpha_=t?Math.exp(Math.log(.5)/t):0,this.estimate_=e,this.totalWeight_=i}sample(t,e){const i=Math.pow(this.alpha_,t);this.estimate_=e*(1-i)+i*this.estimate_,this.totalWeight_+=t}getTotalWeight(){return this.totalWeight_}getEstimate(){if(this.alpha_){const t=1-Math.pow(this.alpha_,this.totalWeight_);if(t)return this.estimate_/t}return this.estimate_}}class Jl{constructor(t,e,i,s=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_=i,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new Zl(t),this.fast_=new Zl(e),this.defaultTTFB_=s,this.ttfb_=new Zl(t)}update(t,e){const{slow_:i,fast_:s,ttfb_:r}=this;i.halfLife!==t&&(this.slow_=new Zl(t,i.getEstimate(),i.getTotalWeight())),s.halfLife!==e&&(this.fast_=new Zl(e,s.getEstimate(),s.getTotalWeight())),r.halfLife!==t&&(this.ttfb_=new Zl(t,r.getEstimate(),r.getTotalWeight()))}sample(t,e){const i=(t=Math.max(t,this.minDelayMs_))/1e3,s=8*e/i;this.fast_.sample(i,s),this.slow_.sample(i,s)}sampleTTFB(t){const e=t/1e3,i=Math.sqrt(2)*Math.exp(-Math.pow(e,2)/2);this.ttfb_.sample(i,Math.max(t,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_}get defaultEstimate(){return this.defaultEstimate_}destroy(){}}function td(t,e,i){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var s=i.call(t,e);if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function ed(){return ed=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var s in i)({}).hasOwnProperty.call(i,s)&&(t[s]=i[s])}return t},ed.apply(null,arguments)}function id(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),i.push.apply(i,s)}return i}function sd(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?id(Object(i),!0).forEach(function(e){td(t,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):id(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}class rd{constructor(t,e){this.trace=void 0,this.debug=void 0,this.log=void 0,this.warn=void 0,this.info=void 0,this.error=void 0;const i=`[${t}]:`;this.trace=nd,this.debug=e.debug.bind(null,i),this.log=e.log.bind(null,i),this.warn=e.warn.bind(null,i),this.info=e.info.bind(null,i),this.error=e.error.bind(null,i)}}const nd=function(){},ad={trace:nd,debug:nd,log:nd,warn:nd,info:nd,error:nd};function od(){return ed({},ad)}function ld(t,e,i){return e[t]?e[t].bind(e):function(t,e){const i=self.console[t];return i?i.bind(self.console,`${e?"["+e+"] ":""}[${t}] >`):nd}(t,i)}const dd=od();const hd=dd;function cd(t=!0){if("undefined"==typeof self)return;return(t||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function ud(t,e){const i=Object.keys(t),s=Object.keys(e),r=i.length,n=s.length;return!r||!n||r===n&&!i.some(t=>-1===s.indexOf(t))}function fd(t,e=!1){if("undefined"!=typeof TextDecoder){const i=new TextDecoder("utf-8").decode(t);if(e){const t=i.indexOf("\0");return-1!==t?i.substring(0,t):i}return i.replace(/\0/g,"")}const i=t.length;let s,r,n,a="",o=0;for(;o<i;){if(s=t[o++],0===s&&e)return a;if(0!==s&&3!==s)switch(s>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:a+=String.fromCharCode(s);break;case 12:case 13:r=t[o++],a+=String.fromCharCode((31&s)<<6|63&r);break;case 14:r=t[o++],n=t[o++],a+=String.fromCharCode((15&s)<<12|(63&r)<<6|63&n)}}return a}function gd(t){let e="";for(let i=0;i<t.length;i++){let s=t[i].toString(16);s.length<2&&(s="0"+s),e+=s}return e}function md(t){return Uint8Array.from(t.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}function pd(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ad,vd={exports:{}};var yd,Ed,Td,Sd,bd,Id=Ad?vd.exports:(Ad=1,yd=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,Ed=/^(?=([^\/?#]*))\1([^]*)$/,Td=/(?:\/|^)\.(?=\/)/g,Sd=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,vd.exports=bd={buildAbsoluteURL:function(t,e,i){if(i=i||{},t=t.trim(),!(e=e.trim())){if(!i.alwaysNormalize)return t;var s=bd.parseURL(t);if(!s)throw new Error("Error trying to parse base URL.");return s.path=bd.normalizePath(s.path),bd.buildURLFromParts(s)}var r=bd.parseURL(e);if(!r)throw new Error("Error trying to parse relative URL.");if(r.scheme)return i.alwaysNormalize?(r.path=bd.normalizePath(r.path),bd.buildURLFromParts(r)):e;var n=bd.parseURL(t);if(!n)throw new Error("Error trying to parse base URL.");if(!n.netLoc&&n.path&&"/"!==n.path[0]){var a=Ed.exec(n.path);n.netLoc=a[1],n.path=a[2]}n.netLoc&&!n.path&&(n.path="/");var o={scheme:n.scheme,netLoc:r.netLoc,path:null,params:r.params,query:r.query,fragment:r.fragment};if(!r.netLoc&&(o.netLoc=n.netLoc,"/"!==r.path[0]))if(r.path){var l=n.path,d=l.substring(0,l.lastIndexOf("/")+1)+r.path;o.path=bd.normalizePath(d)}else o.path=n.path,r.params||(o.params=n.params,r.query||(o.query=n.query));return null===o.path&&(o.path=i.alwaysNormalize?bd.normalizePath(r.path):r.path),bd.buildURLFromParts(o)},parseURL:function(t){var e=yd.exec(t);return e?{scheme:e[1]||"",netLoc:e[2]||"",path:e[3]||"",params:e[4]||"",query:e[5]||"",fragment:e[6]||""}:null},normalizePath:function(t){for(t=t.split("").reverse().join("").replace(Td,"");t.length!==(t=t.replace(Sd,"")).length;);return t.split("").reverse().join("")},buildURLFromParts:function(t){return t.scheme+t.netLoc+t.path+t.params+t.query+t.fragment}});class Ld{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 Rd="audio",kd="video",wd="audiovideo";class Dd{constructor(t){this._byteRange=null,this._url=null,this._stats=null,this._streams=null,this.base=void 0,this.relurl=void 0,"string"==typeof t&&(t={url:t}),this.base=t,function(t,e){const i=Md(t,e);i&&(i.enumerable=!0,Object.defineProperty(t,e,i))}(this,"stats")}setByteRange(t,e){const i=t.split("@",2);let s;s=1===i.length?(null==e?void 0:e.byteRangeEndOffset)||0:parseInt(i[1]),this._byteRange=[s,parseInt(i[0])+s]}get baseurl(){return this.base.url}get byteRange(){return null===this._byteRange?[]:this._byteRange}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get elementaryStreams(){return null===this._streams&&(this._streams={[Rd]:null,[kd]:null,[wd]:null}),this._streams}set elementaryStreams(t){this._streams=t}get hasStats(){return null!==this._stats}get hasStreams(){return null!==this._streams}get stats(){return null===this._stats&&(this._stats=new Ld),this._stats}set stats(t){this._stats=t}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Id.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(t){this._url=t}clearElementaryStreamInfo(){const{elementaryStreams:t}=this;t[Rd]=null,t[kd]=null,t[wd]=null}}function Cd(t){return"initSegment"!==t.sn}class xd extends Dd{constructor(t,e){super(e),this._decryptdata=null,this._programDateTime=null,this._ref=null,this._bitrate=void 0,this.rawProgramDateTime=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.playlistOffset=0,this.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,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=t}get byteLength(){if(this.hasStats){const t=this.stats.total;if(t)return t}if(this.byteRange.length){const t=this.byteRange[0],e=this.byteRange[1];if(Ul(t)&&Ul(e))return e-t}return null}get bitrate(){return this.byteLength?8*this.byteLength/this.duration:this._bitrate?this._bitrate:null}set bitrate(t){this._bitrate=t}get decryptdata(){var t;const{levelkeys:e}=this;if(!e||e.NONE)return null;if(e.identity)this._decryptdata||(this._decryptdata=e.identity.getDecryptData(this.sn));else if(null==(t=this._decryptdata)||!t.keyId){const t=Object.keys(e);if(1===t.length){const i=this._decryptdata=e[t[0]]||null;i&&(this._decryptdata=i.getDecryptData(this.sn,e))}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(null===this.programDateTime)return null;const t=Ul(this.duration)?this.duration:0;return this.programDateTime+1e3*t}get encrypted(){var t;if(null!=(t=this._decryptdata)&&t.encrypted)return!0;if(this.levelkeys){var e;const t=Object.keys(this.levelkeys),i=t.length;if(i>1||1===i&&null!=(e=this.levelkeys[t[0]])&&e.encrypted)return!0}return!1}get programDateTime(){return null===this._programDateTime&&this.rawProgramDateTime&&(this.programDateTime=Date.parse(this.rawProgramDateTime)),this._programDateTime}set programDateTime(t){Ul(t)?this._programDateTime=t:this._programDateTime=this.rawProgramDateTime=null}get ref(){return Cd(this)?(this._ref||(this._ref={base:this.base,start:this.start,duration:this.duration,sn:this.sn,programDateTime:this.programDateTime}),this._ref):null}addStart(t){this.setStart(this.start+t)}setStart(t){this.start=t,this._ref&&(this._ref.start=t)}setDuration(t){this.duration=t,this._ref&&(this._ref.duration=t)}setKeyFormat(t){const e=this.levelkeys;if(e){var i;const s=e[t];!s||null!=(i=this._decryptdata)&&i.keyId||(this._decryptdata=s.getDecryptData(this.sn,e))}}abortRequests(){var t,e;null==(t=this.loader)||t.abort(),null==(e=this.keyLoader)||e.abort()}setElementaryStreamInfo(t,e,i,s,r,n=!1){const{elementaryStreams:a}=this,o=a[t];o?(o.startPTS=Math.min(o.startPTS,e),o.endPTS=Math.max(o.endPTS,i),o.startDTS=Math.min(o.startDTS,s),o.endDTS=Math.max(o.endDTS,r)):a[t]={startPTS:e,endPTS:i,startDTS:s,endDTS:r,partial:n}}}class Pd extends Dd{constructor(t,e,i,s,r){super(i),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.duration=t.decimalFloatingPoint("DURATION"),this.gap=t.bool("GAP"),this.independent=t.bool("INDEPENDENT"),this.relurl=t.enumeratedString("URI"),this.fragment=e,this.index=s;const n=t.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:t}=this;return!!(t.audio||t.video||t.audiovideo)}}function Md(t,e){const i=Object.getPrototypeOf(t);if(i){const t=Object.getOwnPropertyDescriptor(i,e);return t||Md(i,e)}}const Od=Math.pow(2,32)-1,Bd=[].push,Fd={video:1,audio:2,id3:3,text:4};function Nd(t){return String.fromCharCode.apply(null,t)}function _d(t,e){const i=t[e]<<8|t[e+1];return i<0?65536+i:i}function Ud(t,e){const i=jd(t,e);return i<0?4294967296+i:i}function Hd(t,e){let i=Ud(t,e);return i*=Math.pow(2,32),i+=Ud(t,e+4),i}function jd(t,e){return t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}function Vd(t,e){const i=[];if(!e.length)return i;const s=t.byteLength;for(let r=0;r<s;){const n=Ud(t,r),a=n>1?r+n:s;if(Nd(t.subarray(r+4,r+8))===e[0])if(1===e.length)i.push(t.subarray(r+8,a));else{const s=Vd(t.subarray(r+8,a),e.slice(1));s.length&&Bd.apply(i,s)}r=a}return i}function Gd(t){const e=[],i=t[0];let s=8;const r=Ud(t,s);s+=4;let n=0,a=0;0===i?(n=Ud(t,s),a=Ud(t,s+4),s+=8):(n=Hd(t,s),a=Hd(t,s+8),s+=16),s+=2;let o=t.length+a;const l=_d(t,s);s+=2;for(let d=0;d<l;d++){let i=s;const n=Ud(t,i);i+=4;const a=2147483647&n;if(1===(2147483648&n)>>>31)return hd.warn("SIDX has hierarchical references (not supported)"),null;const l=Ud(t,i);i+=4,e.push({referenceSize:a,subsegmentDuration:l,info:{duration:l/r,start:o,end:o+a-1}}),o+=a,i+=4,s=i}return{earliestPresentationTime:n,timescale:r,version:i,referencesCount:l,references:e}}function Qd(t){const e=[],i=Vd(t,["moov","trak"]);for(let s=0;s<i.length;s++){const t=i[s],r=Vd(t,["tkhd"])[0];if(r){let i=r[0];const s=Ud(r,0===i?12:20),n=Vd(t,["mdia","mdhd"])[0];if(n){i=n[0];const r=Ud(n,0===i?12:20),a=Vd(t,["mdia","hdlr"])[0];if(a){const i=Nd(a.subarray(8,12)),n={soun:Rd,vide:kd}[i],o=Kd(Vd(t,["mdia","minf","stbl","stsd"])[0]);n?(e[s]={timescale:r,type:n,stsd:o},e[n]=sd({timescale:r,id:s},o)):e[s]={timescale:r,type:i,stsd:o}}}}}return Vd(t,["moov","mvex","trex"]).forEach(t=>{const i=Ud(t,4),s=e[i];s&&(s.default={duration:Ud(t,12),flags:Ud(t,20)})}),e}function Kd(t){const e=t.subarray(8),i=e.subarray(86),s=Nd(e.subarray(4,8));let r,n=s;const a="enca"===s||"encv"===s;if(a){const t=Vd(e,[s])[0];Vd(t.subarray("enca"===s?28:78),["sinf"]).forEach(t=>{const e=Vd(t,["schm"])[0];if(e){const i=Nd(e.subarray(4,8));if("cbcs"===i||"cenc"===i){const e=Vd(t,["frma"])[0];e&&(n=Nd(e))}}})}const o=n;switch(n){case"avc1":case"avc2":case"avc3":case"avc4":{const t=Vd(i,["avcC"])[0];t&&t.length>3&&(n+="."+Yd(t[1])+Yd(t[2])+Yd(t[3]),r=qd("avc1"===o?"dva1":"dvav",i));break}case"mp4a":{const t=Vd(e,[s])[0],i=Vd(t.subarray(28),["esds"])[0];if(i&&i.length>7){let t=4;if(3!==i[t++])break;t=Wd(i,t),t+=2;const e=i[t++];if(128&e&&(t+=2),64&e&&(t+=i[t++]),4!==i[t++])break;t=Wd(i,t);const s=i[t++];if(64!==s)break;if(n+="."+Yd(s),t+=12,5!==i[t++])break;t=Wd(i,t);const r=i[t++];let a=(248&r)>>3;31===a&&(a+=1+((7&r)<<3)+((224&i[t])>>5)),n+="."+a}break}case"hvc1":case"hev1":{const t=Vd(i,["hvcC"])[0];if(t&&t.length>12){const e=t[1],i=["","A","B","C"][e>>6],s=31&e,r=Ud(t,2),a=(32&e)>>5?"H":"L",o=t[12],l=t.subarray(6,12);n+="."+i+s,n+="."+function(t){let e=0;for(let i=0;i<32;i++)e|=(t>>i&1)<<31-i;return e>>>0}(r).toString(16).toUpperCase(),n+="."+a+o;let d="";for(let t=l.length;t--;){const e=l[t];if(e||d){d="."+e.toString(16).toUpperCase()+d}}n+=d}r=qd("hev1"==o?"dvhe":"dvh1",i);break}case"dvh1":case"dvhe":case"dvav":case"dva1":case"dav1":n=qd(n,i)||n;break;case"vp09":{const t=Vd(i,["vpcC"])[0];if(t&&t.length>6){const e=t[4],i=t[5],s=t[6]>>4&15;n+="."+$d(e)+"."+$d(i)+"."+$d(s)}break}case"av01":{const t=Vd(i,["av1C"])[0];if(t&&t.length>2){const e=t[1]>>>5,s=31&t[1],a=t[2]>>>7?"H":"M",o=(64&t[2])>>6,l=(32&t[2])>>5,d=2===e&&o?l?12:10:o?10:8,h=(16&t[2])>>4,c=(8&t[2])>>3,u=(4&t[2])>>2,f=3&t[2],g=1,m=1,p=1,A=0;n+="."+e+"."+$d(s)+a+"."+$d(d)+"."+h+"."+c+u+f+"."+$d(g)+"."+$d(m)+"."+$d(p)+"."+A,r=qd("dav1",i)}break}}return{codec:n,encrypted:a,supplemental:r}}function qd(t,e){const i=Vd(e,["dvvC"]),s=i.length?i[0]:Vd(e,["dvcC"])[0];if(s){const e=s[2]>>1&127,i=s[2]<<5&32|s[3]>>3&31;return t+"."+$d(e)+"."+$d(i)}}function Wd(t,e){const i=e+5;for(;128&t[e++]&&e<i;);return e}function Yd(t){return("0"+t.toString(16).toUpperCase()).slice(-2)}function $d(t){return(t<10?"0":"")+t}function zd(t,e){Vd(t,["moov","trak"]).forEach(t=>{const i=Vd(t,["mdia","minf","stbl","stsd"])[0];if(!i)return;const s=i.subarray(8);let r=Vd(s,["enca"]);const n=r.length>0;n||(r=Vd(s,["encv"])),r.forEach(t=>{Vd(n?t.subarray(28):t.subarray(78),["sinf"]).forEach(t=>{const i=Xd(t);i&&e(i,n)})})})}function Xd(t){const e=Vd(t,["schm"])[0];if(e){const i=Nd(e.subarray(4,8));if("cbcs"===i||"cenc"===i){const e=Vd(t,["schi","tenc"])[0];if(e)return e}}}function Zd(t,e){const i=new Uint8Array(t.length+e.length);return i.set(t),i.set(e,t.length),i}function Jd(t,e){const i=[],s=e.samples,r=e.timescale,n=e.id;let a=!1;return Vd(s,["moof"]).map(o=>{const l=o.byteOffset-8;Vd(o,["traf"]).map(o=>{const d=Vd(o,["tfdt"]).map(t=>{const e=t[0];let i=Ud(t,4);return 1===e&&(i*=Math.pow(2,32),i+=Ud(t,8)),i/r})[0];return void 0!==d&&(t=d),Vd(o,["tfhd"]).map(d=>{const h=Ud(d,4),c=16777215&Ud(d,0);let u=0;const f=!!(16&c);let g=0;const m=!!(32&c);let p=8;h===n&&(!!(1&c)&&(p+=8),!!(2&c)&&(p+=4),!!(8&c)&&(u=Ud(d,p),p+=4),f&&(g=Ud(d,p),p+=4),m&&(p+=4),"video"===e.type&&(a=th(e.codec)),Vd(o,["trun"]).map(n=>{const o=n[0],d=16777215&Ud(n,0),h=!!(1&d);let c=0;const f=!!(4&d),m=!!(256&d);let p=0;const A=!!(512&d);let v=0;const y=!!(1024&d),E=!!(2048&d);let T=0;const S=Ud(n,4);let b=8;h&&(c=Ud(n,b),b+=4),f&&(b+=4);let I=c+l;for(let l=0;l<S;l++){if(m?(p=Ud(n,b),b+=4):p=u,A?(v=Ud(n,b),b+=4):v=g,y&&(b+=4),E&&(T=0===o?Ud(n,b):jd(n,b),b+=4),e.type===kd){let e=0;for(;e<v;){const n=Ud(s,I);if(I+=4,eh(a,s[I])){ih(s.subarray(I,I+n),a?2:1,t+T/r,i)}I+=n,e+=n+4}}t+=p/r}}))})})}),i}function th(t){if(!t)return!1;const e=t.substring(0,4);return"hvc1"===e||"hev1"===e||"dvh1"===e||"dvhe"===e}function eh(t,e){if(t){const t=e>>1&63;return 39===t||40===t}return 6===(31&e)}function ih(t,e,i,s){const r=sh(t);let n=0;n+=e;let a=0,o=0,l=0;for(;n<r.length;){a=0;do{if(n>=r.length)break;l=r[n++],a+=l}while(255===l);o=0;do{if(n>=r.length)break;l=r[n++],o+=l}while(255===l);const t=r.length-n;let e=n;if(o<t)n+=o;else if(o>t){hd.error(`Malformed SEI payload. ${o} is too small, only ${t} bytes left to parse.`);break}if(4===a){if(181===r[e++]){const t=_d(r,e);if(e+=2,49===t){const t=Ud(r,e);if(e+=4,1195456820===t){const t=r[e++];if(3===t){const n=r[e++],o=64&n,l=o?2+3*(31&n):0,d=new Uint8Array(l);if(o){d[0]=n;for(let t=1;t<l;t++)d[t]=r[e++]}s.push({type:t,payloadType:a,pts:i,bytes:d})}}}}}else if(5===a&&o>16){const t=[];for(let i=0;i<16;i++){const s=r[e++].toString(16);t.push(1==s.length?"0"+s:s),3!==i&&5!==i&&7!==i&&9!==i||t.push("-")}const n=o-16,l=new Uint8Array(n);for(let i=0;i<n;i++)l[i]=r[e++];s.push({payloadType:a,pts:i,uuid:t.join(""),userData:fd(l),userDataBytes:l})}}}function sh(t){const e=t.byteLength,i=[];let s=1;for(;s<e-2;)0===t[s]&&0===t[s+1]&&3===t[s+2]?(i.push(s+2),s+=2):s++;if(0===i.length)return t;const r=e-i.length,n=new Uint8Array(r);let a=0;for(s=0;s<r;a++,s++)a===i[0]&&(a++,i.shift()),n[s]=t[a];return n}function rh(t,e,i){if(16!==t.byteLength)throw new RangeError("Invalid system id");let s,r,n;s=0,r=new Uint8Array,n=new Uint8Array;const a=new Uint8Array(4);return i.byteLength>0&&new DataView(a.buffer).setUint32(0,i.byteLength,!1),function(t,...e){const i=e.length;let s=8,r=i;for(;r--;)s+=e[r].byteLength;const n=new Uint8Array(s);for(n[0]=s>>24&255,n[1]=s>>16&255,n[2]=s>>8&255,n[3]=255&s,n.set(t,4),r=0,s=8;r<i;r++)n.set(e[r],s),s+=e[r].byteLength;return n}([112,115,115,104],new Uint8Array([0,0,0,0]),t,n,r,a,i)}function nh(t){const e=t.getUint32(0),i=t.byteOffset,s=t.byteLength;if(s<e)return{offset:i,size:s};if(1886614376!==t.getUint32(4))return{offset:i,size:e};const r=t.getUint32(8)>>>24;if(0!==r&&1!==r)return{offset:i,size:e};const n=t.buffer,a=gd(new Uint8Array(n,i+12,16));let o=null,l=null,d=0;if(0===r)d=28;else{const r=t.getUint32(28);if(!r||s<32+16*r)return{offset:i,size:e};o=[];for(let t=0;t<r;t++)o.push(new Uint8Array(n,i+32+16*t,16));d=32+16*r}if(!d)return{offset:i,size:e};const h=t.getUint32(d);return e-32<h?{offset:i,size:e}:(l=new Uint8Array(n,i+d+4,h),{version:r,systemId:a,kids:o,data:l,offset:i,size:e})}const ah=()=>/\(Windows.+Firefox\//i.test(navigator.userAgent),oh={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,dav1:.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 lh(t,e){const i=oh[e];return!!i&&!!i[t.slice(0,4)]}function dh(t,e,i=!0){return!t.split(",").some(t=>!hh(t,e,i))}function hh(t,e,i=!0){var s;const r=cd(i);return null!=(s=null==r?void 0:r.isTypeSupported(ch(t,e)))&&s}function ch(t,e){return`${e}/mp4;codecs=${t}`}function uh(t){if(t){const e=t.substring(0,4);return oh.video[e]}return 2}function fh(t){const e=ah();return t.split(",").reduce((t,i)=>{const s=e&&th(i)?9:oh.video[i];return s?(2*s+t)/(t?3:2):(oh.audio[i]+t)/(t?2:1)},0)}const gh={};const mh=/flac|opus|mp4a\.40\.34/i;function ph(t,e=!0){return t.replace(mh,t=>function(t,e=!0){if(gh[t])return gh[t];const i={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"],"mp4a.40.34":["mp3"]}[t];for(let r=0;r<i.length;r++){var s;if(hh(i[r],"audio",e))return gh[t]=i[r],i[r];if("mp3"===i[r]&&null!=(s=cd(e))&&s.isTypeSupported("audio/mpeg"))return""}return t}(t.toLowerCase(),e))}function Ah(t,e){if(t&&(t.length>4||-1!==["ac-3","ec-3","alac","fLaC","Opus"].indexOf(t))&&(vh(t,"audio")||vh(t,"video")))return t;if(e){const i=e.split(",");if(i.length>1){if(t)for(let e=i.length;e--;)if(i[e].substring(0,4)===t.substring(0,4))return i[e];return i[0]}}return e||t}function vh(t,e){return lh(t,e)&&hh(t,e)}function yh(t){if(t.startsWith("av01.")){const e=t.split("."),i=["0","111","01","01","01","0"];for(let t=e.length;t>4&&t<10;t++)e[t]=i[t-4];return e.join(".")}return t}function Eh(t){const e=cd(t)||{isTypeSupported:()=>!1};return{mpeg:e.isTypeSupported("audio/mpeg"),mp3:e.isTypeSupported('audio/mp4; codecs="mp3"'),ac3:e.isTypeSupported('audio/mp4; codecs="ac-3"')}}function Th(t){return t.replace(/^.+codecs=["']?([^"']+).*$/,"$1")}const Sh={supported:!1,smooth:!1,powerEfficient:!1},bh={supported:!0,configurations:[],decodingInfoResults:[{supported:!0,powerEfficient:!0,smooth:!0}]};function Ih(t,e){return{supported:!1,configurations:e,decodingInfoResults:[Sh],error:t}}function Lh(t,e,i,s,r,n){const a=t.videoCodec,o=t.audioCodec?t.audioGroups:null,l=null==n?void 0:n.audioCodec,d=null==n?void 0:n.channels,h=d?parseInt(d):l?1/0:2;let c=null;if(null!=o&&o.length)try{c=1===o.length&&o[0]?e.groups[o[0]].channels:o.reduce((t,i)=>{if(i){const s=e.groups[i];if(!s)throw new Error(`Audio track group ${i} not found`);Object.keys(s.channels).forEach(e=>{t[e]=(t[e]||0)+s.channels[e]})}return t},{2:0})}catch(u){return!0}return void 0!==a&&(a.split(",").some(t=>th(t))||t.width>1920&&t.height>1088||t.height>1920&&t.width>1088||t.frameRate>Math.max(s,30)||"SDR"!==t.videoRange&&t.videoRange!==i||t.bitrate>Math.max(r,8e6))||!!c&&Ul(h)&&Object.keys(c).some(t=>parseInt(t)>h)}function Rh(t,e,i,s={}){const r=t.videoCodec;if(!r&&!t.audioCodec||!i)return Promise.resolve(bh);const n=[],a=function(t){var e;const i=null==(e=t.videoCodec)?void 0:e.split(","),s=wh(t),r=t.width||640,n=t.height||480,a=t.frameRate||30,o=t.videoRange.toLowerCase();return i?i.map(t=>{const e={contentType:ch(yh(t),"video"),width:r,height:n,bitrate:s,framerate:a};return"sdr"!==o&&(e.transferFunction=o),e}):[]}(t),o=a.length,l=function(t,e,i){var s;const r=null==(s=t.audioCodec)?void 0:s.split(","),n=wh(t);if(r&&t.audioGroups)return t.audioGroups.reduce((t,s)=>{var a;const o=s?null==(a=e.groups[s])?void 0:a.tracks:null;return o?o.reduce((t,e)=>{if(e.groupId===s){const s=parseFloat(e.channels||"");r.forEach(e=>{const r={contentType:ch(e,"audio"),bitrate:i?kh(e,n):n};s&&(r.channels=""+s),t.push(r)})}return t},t):t},[]);return[]}(t,e,o>0),d=l.length;for(let h=o||1*d||1;h--;){const t={type:"media-source"};if(o&&(t.video=a[h%o]),d){t.audio=l[h%d];const e=t.audio.bitrate;t.video&&e&&(t.video.bitrate-=e)}n.push(t)}if(r){const t=navigator.userAgent;if(r.split(",").some(t=>th(t))&&ah())return Promise.resolve(Ih(new Error(`Overriding Windows Firefox HEVC MediaCapabilities result based on user-agent string: (${t})`),n))}return Promise.all(n.map(t=>{const e=function(t){let e="";const{audio:i,video:s}=t;if(s){e+=`${Th(s.contentType)}_r${s.height}x${s.width}f${Math.ceil(s.framerate)}${s.transferFunction||"sd"}_${Math.ceil(s.bitrate/1e5)}`}if(i){e+=`${s?"_":""}${Th(i.contentType)}_c${i.channels}`}return e}(t);return s[e]||(s[e]=i.decodingInfo(t))})).then(t=>({supported:!t.some(t=>!t.supported),configurations:n,decodingInfoResults:t})).catch(t=>({supported:!1,configurations:n,decodingInfoResults:[],error:t}))}function kh(t,e){if(e<=1)return 1;let i=128e3;return"ec-3"===t?i=768e3:"ac-3"===t&&(i=64e4),Math.min(e/2,i)}function wh(t){return 1e3*Math.ceil(Math.max(.9*t.bitrate,t.averageBitrate)/1e3)||1}const Dh=["NONE","TYPE-0","TYPE-1",null];const Ch=["SDR","PQ","HLG"];var xh="",Ph="YES",Mh="v2";function Oh(t){const{canSkipUntil:e,canSkipDateRanges:i,age:s}=t;return e&&s<e/2?i?Mh:Ph:xh}class Bh{constructor(t,e,i){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=t,this.part=e,this.skip=i}addDirectives(t){const e=new self.URL(t);return void 0!==this.msn&&e.searchParams.set("_HLS_msn",this.msn.toString()),void 0!==this.part&&e.searchParams.set("_HLS_part",this.part.toString()),this.skip&&e.searchParams.set("_HLS_skip",this.skip),e.href}}class Fh{constructor(t){if(this._attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.url=void 0,this.frameRate=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.supplemental=void 0,this.videoCodec=void 0,this.width=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.supportedPromise=void 0,this.supportedResult=void 0,this._avgBitrate=0,this._audioGroups=void 0,this._subtitleGroups=void 0,this._urlId=0,this.url=[t.url],this._attrs=[t.attrs],this.bitrate=t.bitrate,t.details&&(this.details=t.details),this.id=t.id||0,this.name=t.name,this.width=t.width||0,this.height=t.height||0,this.frameRate=t.attrs.optionalFloat("FRAME-RATE",0),this._avgBitrate=t.attrs.decimalInteger("AVERAGE-BANDWIDTH"),this.audioCodec=t.audioCodec,this.videoCodec=t.videoCodec,this.codecSet=[t.videoCodec,t.audioCodec].filter(t=>!!t).map(t=>t.substring(0,4)).join(","),"supplemental"in t){var e;this.supplemental=t.supplemental;const i=null==(e=t.supplemental)?void 0:e.videoCodec;i&&i!==t.videoCodec&&(this.codecSet+=`,${i.substring(0,4)}`)}this.addGroupId("audio",t.attrs.AUDIO),this.addGroupId("text",t.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(t){return Nh(this._audioGroups,t)}hasSubtitleGroup(t){return Nh(this._subtitleGroups,t)}get audioGroups(){return this._audioGroups}get subtitleGroups(){return this._subtitleGroups}addGroupId(t,e){if(e)if("audio"===t){let t=this._audioGroups;t||(t=this._audioGroups=[]),-1===t.indexOf(e)&&t.push(e)}else if("text"===t){let t=this._subtitleGroups;t||(t=this._subtitleGroups=[]),-1===t.indexOf(e)&&t.push(e)}}get urlId(){return 0}set urlId(t){}get audioGroupIds(){return this.audioGroups?[this.audioGroupId]:void 0}get textGroupIds(){return this.subtitleGroups?[this.textGroupId]:void 0}get audioGroupId(){var t;return null==(t=this.audioGroups)?void 0:t[0]}get textGroupId(){var t;return null==(t=this.subtitleGroups)?void 0:t[0]}addFallback(){}}function Nh(t,e){return!(!e||!t)&&-1!==t.indexOf(e)}function _h(t,e){let i=!1,s=[];if(t&&(i="SDR"!==t,s=[t]),e){s=e.allowedVideoRanges||Ch.slice(0);const t="SDR"!==s.join("")&&!e.videoCodec;i=void 0!==e.preferHDR?e.preferHDR:t&&function(){if("function"==typeof matchMedia){const t=matchMedia("(dynamic-range: high)"),e=matchMedia("bad query");if(t.media!==e.media)return!0===t.matches}return!1}(),i||(s=["SDR"])}return{preferHDR:i,allowedVideoRanges:s}}const Uh=(t,e)=>JSON.stringify(t,(t=>{const e=new WeakSet;return(i,s)=>{if(t&&(s=t(i,s)),"object"==typeof s&&null!==s){if(e.has(s))return;e.add(s)}return s}})(e));function Hh(t,e){hd.log(`[abr] start candidates with "${t}" ignored because ${e}`)}function jh(t){return t.reduce((t,e)=>{let i=t.groups[e.groupId];i||(i=t.groups[e.groupId]={tracks:[],channels:{2:0},hasDefault:!1,hasAutoSelect:!1}),i.tracks.push(e);const s=e.channels||"2";return i.channels[s]=(i.channels[s]||0)+1,i.hasDefault=i.hasDefault||e.default,i.hasAutoSelect=i.hasAutoSelect||e.autoselect,i.hasDefault&&(t.hasDefaultAudio=!0),i.hasAutoSelect&&(t.hasAutoSelectAudio=!0),t},{hasDefaultAudio:!1,hasAutoSelectAudio:!1,groups:{}})}function Vh(t){if(!t)return t;const{lang:e,assocLang:i,characteristics:s,channels:r,audioCodec:n}=t;return{lang:e,assocLang:i,characteristics:s,channels:r,audioCodec:n}}function Gh(t,e,i){if("attrs"in t){const i=e.indexOf(t);if(-1!==i)return i}for(let s=0;s<e.length;s++){if(Qh(t,e[s],i))return s}return-1}function Qh(t,e,i){const{groupId:s,name:r,lang:n,assocLang:a,default:o}=t,l=t.forced;return(void 0===s||e.groupId===s)&&(void 0===r||e.name===r)&&(void 0===n||function(t,e="--"){if(t.length===e.length)return t===e;return t.startsWith(e)||e.startsWith(t)}(n,e.lang))&&(void 0===n||e.assocLang===a)&&(void 0===o||e.default===o)&&(void 0===l||e.forced===l)&&(!("characteristics"in t)||function(t,e=""){const i=t.split(","),s=e.split(",");return i.length===s.length&&!i.some(t=>-1===s.indexOf(t))}(t.characteristics||"",e.characteristics))&&(void 0===i||i(t,e))}function Kh(t,e){const{audioCodec:i,channels:s}=t;return!(void 0!==i&&(e.audioCodec||"").substring(0,4)!==i.substring(0,4)||void 0!==s&&s!==(e.channels||"2"))}function qh(t,e,i){for(let s=e;s>-1;s--)if(i(t[s]))return s;for(let s=e+1;s<t.length;s++)if(i(t[s]))return s;return-1}function Wh(t,e){var i;return!!t&&t!==(null==(i=e.loadLevelObj)?void 0:i.uri)}const Yh=function(t,e){let i=0,s=t.length-1,r=null,n=null;for(;i<=s;){r=(i+s)/2|0,n=t[r];const a=e(n);if(a>0)i=r+1;else{if(!(a<0))return n;s=r-1}}return null};function $h(t,e,i=0,s=0,r=.005){let n=null;if(t){n=e[1+t.sn-e[0].sn]||null;const s=t.endDTS-i;s>0&&s<15e-7&&(i+=15e-7),n&&t.level!==n.level&&n.end<=t.end&&(n=e[2+t.sn-e[0].sn]||null)}else 0===i&&0===e[0].start&&(n=e[0]);if(n&&((!t||t.level===n.level)&&0===zh(i,s,n)||function(t,e,i){if(e&&0===e.start&&e.level<t.level&&(e.endPTS||0)>0){const s=e.tagList.reduce((t,e)=>("INF"===e[0]&&(t+=parseFloat(e[1])),t),i);return t.start<=s}return!1}(n,t,Math.min(r,s))))return n;const a=Yh(e,zh.bind(null,i,s));return!a||a===t&&n?n:a}function zh(t=0,e=0,i){if(i.start<=t&&i.start+i.duration>t)return 0;const s=Math.min(e,i.duration+(i.deltaPTS?i.deltaPTS:0));return i.start+i.duration-s<=t?1:i.start-s>t&&i.start?-1:0}function Xh(t,e,i){const s=1e3*Math.min(e,i.duration+(i.deltaPTS?i.deltaPTS:0));return(i.endProgramDateTime||0)-s>t}function Zh(t,e,i){if(t&&t.startCC<=e&&t.endCC>=e){let s=t.fragments;const{fragmentHint:r}=t;let n;return r&&(s=s.concat(r)),Yh(s,t=>t.cc<e?1:t.cc>e?-1:(n=t,t.end<=i?1:t.start>i?-1:0)),n||null}return null}function Jh(t){switch(t.details){case Gl.FRAG_LOAD_TIMEOUT:case Gl.KEY_LOAD_TIMEOUT:case Gl.LEVEL_LOAD_TIMEOUT:case Gl.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function tc(t){return t.details.startsWith("key")}function ec(t){return tc(t)&&!!t.frag&&!t.frag.decryptdata}function ic(t,e){const i=Jh(e);return t.default[(i?"timeout":"error")+"Retry"]}function sc(t,e){const i="linear"===t.backoff?1:Math.pow(2,e);return Math.min(i*t.retryDelayMs,t.maxRetryDelayMs)}function rc(t){return sd(sd({},t),{errorRetry:null,timeoutRetry:null})}function nc(t,e,i,s){if(!t)return!1;const r=null==s?void 0:s.code,n=e<t.maxNumRetry&&(function(t){return ac(t)||!!t&&(t<400||t>499)}(r)||!!i);return t.shouldRetry?t.shouldRetry(t,e,i,s,n):n}function ac(t){return 0===t&&!1===navigator.onLine}var oc=0,lc=2,dc=3,hc=5,cc=0,uc=1,fc=2,gc=4;function mc(t){const e={action:oc,flags:cc};return t&&(e.resolved=!0),e}var pc="NOT_LOADED",Ac="APPENDING",vc="PARTIAL",yc="OK";class Ec{constructor(t){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=t,this._registerListeners()}_registerListeners(){const{hls:t}=this;t&&(t.on(Ql.MANIFEST_LOADING,this.onManifestLoading,this),t.on(Ql.BUFFER_APPENDED,this.onBufferAppended,this),t.on(Ql.FRAG_BUFFERED,this.onFragBuffered,this),t.on(Ql.FRAG_LOADED,this.onFragLoaded,this))}_unregisterListeners(){const{hls:t}=this;t&&(t.off(Ql.MANIFEST_LOADING,this.onManifestLoading,this),t.off(Ql.BUFFER_APPENDED,this.onBufferAppended,this),t.off(Ql.FRAG_BUFFERED,this.onFragBuffered,this),t.off(Ql.FRAG_LOADED,this.onFragLoaded,this))}destroy(){this._unregisterListeners(),this.hls=this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null}getAppendedFrag(t,e){const i=this.activePartLists[e];if(i)for(let s=i.length;s--;){const e=i[s];if(!e)break;if(e.start<=t&&t<=e.end&&e.loaded)return e}return this.getBufferedFrag(t,e)}getBufferedFrag(t,e){return this.getFragAtPos(t,e,!0)}getFragAtPos(t,e,i){const{fragments:s}=this,r=Object.keys(s);for(let n=r.length;n--;){const a=s[r[n]];if((null==a?void 0:a.body.type)===e&&(!i||a.buffered)){const e=a.body;if(e.start<=t&&t<=e.end)return e}}return null}detectEvictedFragments(t,e,i,s,r){this.timeRanges&&(this.timeRanges[t]=e);const n=(null==s?void 0:s.fragment.sn)||-1;Object.keys(this.fragments).forEach(s=>{const a=this.fragments[s];if(!a)return;if(n>=a.body.sn)return;if(!a.buffered&&(!a.loaded||r))return void(a.body.type===i&&this.removeFragment(a.body));const o=a.range[t];o&&(0!==o.time.length?o.time.some(t=>{const i=!this.isTimeBuffered(t.startPTS,t.endPTS,e);return i&&this.removeFragment(a.body),i}):this.removeFragment(a.body))})}detectPartialFragments(t){const e=this.timeRanges;if(!e||"initSegment"===t.frag.sn)return;const i=t.frag,s=Sc(i),r=this.fragments[s];if(!r||r.buffered&&i.gap)return;const n=!i.relurl;Object.keys(e).forEach(s=>{const a=i.elementaryStreams[s];if(!a)return;const o=e[s],l=n||!0===a.partial;r.range[s]=this.getBufferedTimes(i,t.part,l,o)}),r.loaded=null,Object.keys(r.range).length?(this.bufferedEnd(r,i),Tc(r)||this.removeParts(i.sn-1,i.type)):this.removeFragment(r.body)}bufferedEnd(t,e){t.buffered=!0;(t.body.endList=e.endList||t.body.endList)&&(this.endListFragments[t.body.type]=t)}removeParts(t,e){const i=this.activePartLists[e];i&&(this.activePartLists[e]=bc(i,e=>e.fragment.sn>=t))}fragBuffered(t,e){const i=Sc(t);let s=this.fragments[i];!s&&e&&(s=this.fragments[i]={body:t,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},t.gap&&(this.hasGaps=!0)),s&&(s.loaded=null,this.bufferedEnd(s,t))}getBufferedTimes(t,e,i,s){const r={time:[],partial:i},n=t.start,a=t.end,o=t.minEndPTS||a,l=t.maxStartPTS||n;for(let d=0;d<s.length;d++){const t=s.start(d)-this.bufferPadding,e=s.end(d)+this.bufferPadding;if(l>=t&&o<=e){r.time.push({startPTS:Math.max(n,s.start(d)),endPTS:Math.min(a,s.end(d))});break}if(n<e&&a>t){const t=Math.max(n,s.start(d)),e=Math.min(a,s.end(d));e>t&&(r.partial=!0,r.time.push({startPTS:t,endPTS:e}))}else if(a<=t)break}return r}getPartialFragment(t){let e,i,s,r=null,n=0;const{bufferPadding:a,fragments:o}=this;return Object.keys(o).forEach(l=>{const d=o[l];d&&Tc(d)&&(i=d.body.start-a,s=d.body.end+a,t>=i&&t<=s&&(e=Math.min(t-i,s-t),n<=e&&(r=d.body,n=e)))}),r}isEndListAppended(t){const e=this.endListFragments[t];return void 0!==e&&(e.buffered||Tc(e))}getState(t){const e=Sc(t),i=this.fragments[e];return i?i.buffered?Tc(i)?vc:yc:Ac:pc}isTimeBuffered(t,e,i){let s,r;for(let n=0;n<i.length;n++){if(s=i.start(n)-this.bufferPadding,r=i.end(n)+this.bufferPadding,t>=s&&e<=r)return!0;if(e<=s)return!1}return!1}onManifestLoading(){this.removeAllFragments()}onFragLoaded(t,e){if("initSegment"===e.frag.sn||e.frag.bitrateTest)return;const i=e.frag,s=e.part?null:e,r=Sc(i);this.fragments[r]={body:i,appendedPTS:null,loaded:s,buffered:!1,range:Object.create(null)}}onBufferAppended(t,e){const{frag:i,part:s,timeRanges:r,type:n}=e;if("initSegment"===i.sn)return;const a=i.type;if(s){let t=this.activePartLists[a];t||(this.activePartLists[a]=t=[]),t.push(s)}this.timeRanges=r;const o=r[n];this.detectEvictedFragments(n,o,a,s)}onFragBuffered(t,e){this.detectPartialFragments(e)}hasFragment(t){const e=Sc(t);return!!this.fragments[e]}hasFragments(t){const{fragments:e}=this,i=Object.keys(e);if(!t)return i.length>0;for(let s=i.length;s--;){const r=e[i[s]];if((null==r?void 0:r.body.type)===t)return!0}return!1}hasParts(t){var e;return!(null==(e=this.activePartLists[t])||!e.length)}removeFragmentsInRange(t,e,i,s,r){s&&!this.hasGaps||Object.keys(this.fragments).forEach(n=>{const a=this.fragments[n];if(!a)return;const o=a.body;o.type!==i||s&&!o.gap||o.start<e&&o.end>t&&(a.buffered||r)&&this.removeFragment(o)})}removeFragment(t){const e=Sc(t);t.clearElementaryStreamInfo();const i=this.activePartLists[t.type];if(i){const e=t.sn;this.activePartLists[t.type]=bc(i,t=>t.fragment.sn!==e)}delete this.fragments[e],t.endList&&delete this.endListFragments[t.type]}removeAllFragments(){var t;this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1;const e=null==(t=this.hls)||null==(t=t.latestLevelDetails)?void 0:t.partList;e&&e.forEach(t=>t.clearElementaryStreamInfo())}}function Tc(t){var e,i,s;return t.buffered&&!!(t.body.gap||null!=(e=t.range.video)&&e.partial||null!=(i=t.range.audio)&&i.partial||null!=(s=t.range.audiovideo)&&s.partial)}function Sc(t){return`${t.type}_${t.level}_${t.sn}`}function bc(t,e){return t.filter(t=>{const i=e(t);return i||t.clearElementaryStreamInfo(),i})}var Ic=0,Lc=1;class Rc{constructor(t,e,i){this.subtle=void 0,this.aesIV=void 0,this.aesMode=void 0,this.subtle=t,this.aesIV=e,this.aesMode=i}decrypt(t,e){switch(this.aesMode){case Ic:return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},e,t);case Lc:return this.subtle.decrypt({name:"AES-CTR",counter:this.aesIV,length:64},e,t);default:throw new Error(`[AESCrypto] invalid aes mode ${this.aesMode}`)}}}class kc{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_(t){const e=new DataView(t),i=new Uint32Array(4);for(let s=0;s<4;s++)i[s]=e.getUint32(4*s);return i}initTable(){const t=this.sBox,e=this.invSBox,i=this.subMix,s=i[0],r=i[1],n=i[2],a=i[3],o=this.invSubMix,l=o[0],d=o[1],h=o[2],c=o[3],u=new Uint32Array(256);let f=0,g=0,m=0;for(m=0;m<256;m++)u[m]=m<128?m<<1:m<<1^283;for(m=0;m<256;m++){let i=g^g<<1^g<<2^g<<3^g<<4;i=i>>>8^255&i^99,t[f]=i,e[i]=f;const o=u[f],m=u[o],p=u[m];let A=257*u[i]^16843008*i;s[f]=A<<24|A>>>8,r[f]=A<<16|A>>>16,n[f]=A<<8|A>>>24,a[f]=A,A=16843009*p^65537*m^257*o^16843008*f,l[i]=A<<24|A>>>8,d[i]=A<<16|A>>>16,h[i]=A<<8|A>>>24,c[i]=A,f?(f=o^u[u[u[p^o]]],g^=u[u[g]]):f=g=1}}expandKey(t){const e=this.uint8ArrayToUint32Array_(t);let i=!0,s=0;for(;s<e.length&&i;)i=e[s]===this.key[s],s++;if(i)return;this.key=e;const r=this.keySize=e.length;if(4!==r&&6!==r&&8!==r)throw new Error("Invalid aes key size="+r);const n=this.ksRows=4*(r+6+1);let a,o;const l=this.keySchedule=new Uint32Array(n),d=this.invKeySchedule=new Uint32Array(n),h=this.sBox,c=this.rcon,u=this.invSubMix,f=u[0],g=u[1],m=u[2],p=u[3];let A,v;for(a=0;a<n;a++)a<r?A=l[a]=e[a]:(v=A,a%r===0?(v=v<<8|v>>>24,v=h[v>>>24]<<24|h[v>>>16&255]<<16|h[v>>>8&255]<<8|h[255&v],v^=c[a/r|0]<<24):r>6&&a%r===4&&(v=h[v>>>24]<<24|h[v>>>16&255]<<16|h[v>>>8&255]<<8|h[255&v]),l[a]=A=(l[a-r]^v)>>>0);for(o=0;o<n;o++)a=n-o,v=3&o?l[a]:l[a-4],d[o]=o<4||a<=4?v:f[h[v>>>24]]^g[h[v>>>16&255]]^m[h[v>>>8&255]]^p[h[255&v]],d[o]=d[o]>>>0}networkToHostOrderSwap(t){return t<<24|(65280&t)<<8|(16711680&t)>>8|t>>>24}decrypt(t,e,i){const s=this.keySize+6,r=this.invKeySchedule,n=this.invSBox,a=this.invSubMix,o=a[0],l=a[1],d=a[2],h=a[3],c=this.uint8ArrayToUint32Array_(i);let u=c[0],f=c[1],g=c[2],m=c[3];const p=new Int32Array(t),A=new Int32Array(p.length);let v,y,E,T,S,b,I,L,R,k,w,D,C,x;const P=this.networkToHostOrderSwap;for(;e<p.length;){for(R=P(p[e]),k=P(p[e+1]),w=P(p[e+2]),D=P(p[e+3]),S=R^r[0],b=D^r[1],I=w^r[2],L=k^r[3],C=4,x=1;x<s;x++)v=o[S>>>24]^l[b>>16&255]^d[I>>8&255]^h[255&L]^r[C],y=o[b>>>24]^l[I>>16&255]^d[L>>8&255]^h[255&S]^r[C+1],E=o[I>>>24]^l[L>>16&255]^d[S>>8&255]^h[255&b]^r[C+2],T=o[L>>>24]^l[S>>16&255]^d[b>>8&255]^h[255&I]^r[C+3],S=v,b=y,I=E,L=T,C+=4;v=n[S>>>24]<<24^n[b>>16&255]<<16^n[I>>8&255]<<8^n[255&L]^r[C],y=n[b>>>24]<<24^n[I>>16&255]<<16^n[L>>8&255]<<8^n[255&S]^r[C+1],E=n[I>>>24]<<24^n[L>>16&255]<<16^n[S>>8&255]<<8^n[255&b]^r[C+2],T=n[L>>>24]<<24^n[S>>16&255]<<16^n[b>>8&255]<<8^n[255&I]^r[C+3],A[e]=P(v^u),A[e+1]=P(T^f),A[e+2]=P(E^g),A[e+3]=P(y^m),u=R,f=k,g=w,m=D,e+=4}return A.buffer}}class wc{constructor(t,e,i){this.subtle=void 0,this.key=void 0,this.aesMode=void 0,this.subtle=t,this.key=e,this.aesMode=i}expandKey(){const t=function(t){switch(t){case Ic:return"AES-CBC";case Lc:return"AES-CTR";default:throw new Error(`[FastAESKey] invalid aes mode ${t}`)}}(this.aesMode);return this.subtle.importKey("raw",this.key,{name:t},!1,["encrypt","decrypt"])}}class Dc{constructor(t,{removePKCS7Padding:e=!0}={}){if(this.logEnabled=!0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.useSoftware=void 0,this.enableSoftwareAES=void 0,this.enableSoftwareAES=t.enableSoftwareAES,this.removePKCS7Padding=e,e)try{const t=self.crypto;t&&(this.subtle=t.subtle||t.webkitSubtle)}catch(i){}this.useSoftware=!this.subtle}destroy(){this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null}isSync(){return this.useSoftware}flush(){const{currentResult:t,remainderData:e}=this;if(!t||e)return this.reset(),null;const i=new Uint8Array(t);return this.reset(),this.removePKCS7Padding?function(t){const e=t.byteLength,i=e&&new DataView(t.buffer).getUint8(e-1);return i?t.slice(0,e-i):t}(i):i}reset(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)}decrypt(t,e,i,s){return this.useSoftware?new Promise((r,n)=>{const a=ArrayBuffer.isView(t)?t:new Uint8Array(t);this.softwareDecrypt(a,e,i,s);const o=this.flush();o?r(o.buffer):n(new Error("[softwareDecrypt] Failed to decrypt data"))}):this.webCryptoDecrypt(new Uint8Array(t),e,i,s)}softwareDecrypt(t,e,i,s){const{currentIV:r,currentResult:n,remainderData:a}=this;if(s!==Ic||16!==e.byteLength)return hd.warn("SoftwareDecrypt: can only handle AES-128-CBC"),null;this.logOnce("JS AES decrypt"),a&&(t=Zd(a,t),this.remainderData=null);const o=this.getValidChunk(t);if(!o.length)return null;r&&(i=r);let l=this.softwareDecrypter;l||(l=this.softwareDecrypter=new kc),l.expandKey(e);const d=n;return this.currentResult=l.decrypt(o.buffer,0,i),this.currentIV=o.slice(-16).buffer,d||null}webCryptoDecrypt(t,e,i,s){if(this.key!==e||!this.fastAesKey){if(!this.subtle)return Promise.resolve(this.onWebCryptoError(t,e,i,s));this.key=e,this.fastAesKey=new wc(this.subtle,e,s)}return this.fastAesKey.expandKey().then(e=>{if(!this.subtle)return Promise.reject(new Error("web crypto not initialized"));this.logOnce("WebCrypto AES decrypt");return new Rc(this.subtle,new Uint8Array(i),s).decrypt(t.buffer,e)}).catch(r=>(hd.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${r.name}: ${r.message}`),this.onWebCryptoError(t,e,i,s)))}onWebCryptoError(t,e,i,s){const r=this.enableSoftwareAES;if(r){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(t,e,i,s);const r=this.flush();if(r)return r.buffer}throw new Error("WebCrypto"+(r?" and softwareDecrypt":"")+": failed to decrypt data")}getValidChunk(t){let e=t;const i=t.length-t.length%16;return i!==t.length&&(e=t.slice(0,i),this.remainderData=t.slice(i)),e}logOnce(t){this.logEnabled&&(hd.log(`[decrypter]: ${t}`),this.logEnabled=!1)}}const Cc=Math.pow(2,17);class xc{constructor(t){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=t}destroy(){this.loader&&(this.loader.destroy(),this.loader=null)}abort(){this.loader&&this.loader.abort()}load(t,e){const i=t.url;if(!i)return Promise.reject(new Oc({type:Vl.NETWORK_ERROR,details:Gl.FRAG_LOAD_ERROR,fatal:!1,frag:t,error:new Error("Fragment does not have a "+(i?"part list":"url")),networkDetails:null}));this.abort();const s=this.config,r=s.fLoader,n=s.loader;return new Promise((a,o)=>{if(this.loader&&this.loader.destroy(),t.gap){if(t.tagList.some(t=>"GAP"===t[0]))return void o(Mc(t));t.gap=!1}const l=this.loader=r?new r(s):new n(s),d=Pc(t);t.loader=l;const h=rc(s.fragLoadPolicy.default),c={loadPolicy:h,timeout:h.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:"initSegment"===t.sn?1/0:Cc};t.stats=l.stats;const u={onSuccess:(e,i,s,r)=>{this.resetLoader(t,l);let n=e.data;s.resetIV&&t.decryptdata&&(t.decryptdata.iv=new Uint8Array(n.slice(0,16)),n=n.slice(16)),a({frag:t,part:null,payload:n,networkDetails:r})},onError:(e,s,r,n)=>{this.resetLoader(t,l),o(new Oc({type:Vl.NETWORK_ERROR,details:Gl.FRAG_LOAD_ERROR,fatal:!1,frag:t,response:sd({url:i,data:void 0},e),error:new Error(`HTTP Error ${e.code} ${e.text}`),networkDetails:r,stats:n}))},onAbort:(e,i,s)=>{this.resetLoader(t,l),o(new Oc({type:Vl.NETWORK_ERROR,details:Gl.INTERNAL_ABORTED,fatal:!1,frag:t,error:new Error("Aborted"),networkDetails:s,stats:e}))},onTimeout:(e,i,s)=>{this.resetLoader(t,l),o(new Oc({type:Vl.NETWORK_ERROR,details:Gl.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,error:new Error(`Timeout after ${c.timeout}ms`),networkDetails:s,stats:e}))}};e&&(u.onProgress=(i,s,r,n)=>e({frag:t,part:null,payload:r,networkDetails:n})),l.load(d,c,u)})}loadPart(t,e,i){this.abort();const s=this.config,r=s.fLoader,n=s.loader;return new Promise((a,o)=>{if(this.loader&&this.loader.destroy(),t.gap||e.gap)return void o(Mc(t,e));const l=this.loader=r?new r(s):new n(s),d=Pc(t,e);t.loader=l;const h=rc(s.fragLoadPolicy.default),c={loadPolicy:h,timeout:h.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:Cc};e.stats=l.stats,l.load(d,c,{onSuccess:(s,r,n,o)=>{this.resetLoader(t,l),this.updateStatsFromPart(t,e);const d={frag:t,part:e,payload:s.data,networkDetails:o};i(d),a(d)},onError:(i,s,r,n)=>{this.resetLoader(t,l),o(new Oc({type:Vl.NETWORK_ERROR,details:Gl.FRAG_LOAD_ERROR,fatal:!1,frag:t,part:e,response:sd({url:d.url,data:void 0},i),error:new Error(`HTTP Error ${i.code} ${i.text}`),networkDetails:r,stats:n}))},onAbort:(i,s,r)=>{t.stats.aborted=e.stats.aborted,this.resetLoader(t,l),o(new Oc({type:Vl.NETWORK_ERROR,details:Gl.INTERNAL_ABORTED,fatal:!1,frag:t,part:e,error:new Error("Aborted"),networkDetails:r,stats:i}))},onTimeout:(i,s,r)=>{this.resetLoader(t,l),o(new Oc({type:Vl.NETWORK_ERROR,details:Gl.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,part:e,error:new Error(`Timeout after ${c.timeout}ms`),networkDetails:r,stats:i}))}})})}updateStatsFromPart(t,e){const i=t.stats,s=e.stats,r=s.total;if(i.loaded+=s.loaded,r){const s=Math.round(t.duration/e.duration),n=Math.min(Math.round(i.loaded/r),s),a=(s-n)*Math.round(i.loaded/n);i.total=i.loaded+a}else i.total=Math.max(i.loaded,i.total);const n=i.loading,a=s.loading;n.start?n.first+=a.first-a.start:(n.start=a.start,n.first=a.first),n.end=a.end}resetLoader(t,e){t.loader=null,this.loader===e&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),e.destroy()}}function Pc(t,e=null){const i=e||t,s={frag:t,part:e,responseType:"arraybuffer",url:i.url,headers:{},rangeStart:0,rangeEnd:0},r=i.byteRangeStartOffset,n=i.byteRangeEndOffset;if(Ul(r)&&Ul(n)){var a;let e=r,i=n;if("initSegment"===t.sn&&("AES-128"===(o=null==(a=t.decryptdata)?void 0:a.method)||"AES-256"===o)){const t=n-r;t%16&&(i=n+(16-t%16)),0!==r&&(s.resetIV=!0,e=r-16)}s.rangeStart=e,s.rangeEnd=i}var o;return s}function Mc(t,e){const i=new Error(`GAP ${t.gap?"tag":"attribute"} found`),s={type:Vl.MEDIA_ERROR,details:Gl.FRAG_GAP,fatal:!1,frag:t,error:i,networkDetails:null};return e&&(s.part=e),(e||t).stats.aborted=!0,new Oc(s)}class Oc extends Error{constructor(t){super(t.error.message),this.data=void 0,this.data=t}}class Bc extends rd{constructor(t,e){super(t,e),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(t){return!this._tickInterval&&(this._tickCallCount=0,this._tickInterval=self.setInterval(this._boundTick,t),!0)}clearInterval(){return!!this._tickInterval&&(self.clearInterval(this._tickInterval),this._tickInterval=null,!0)}clearNextTick(){return!!this._tickTimer&&(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0)}tick(){this._tickCallCount++,1===this._tickCallCount&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)}tickImmediate(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)}doTick(){}}class Fc{constructor(t,e,i,s=0,r=-1,n=!1){this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing={start:0,executeStart:0,executeEnd:0,end:0},this.buffering={audio:{start:0,executeStart:0,executeEnd:0,end:0},video:{start:0,executeStart:0,executeEnd:0,end:0},audiovideo:{start:0,executeStart:0,executeEnd:0,end:0}},this.level=t,this.sn=e,this.id=i,this.size=s,this.part=r,this.partial=n}}const Nc={length:0,start:()=>0,end:()=>0};class _c{static isBuffered(t,e){if(t){const i=_c.getBuffered(t);for(let t=i.length;t--;)if(e>=i.start(t)&&e<=i.end(t))return!0}return!1}static bufferedRanges(t){if(t){const e=_c.getBuffered(t);return _c.timeRangesToArray(e)}return[]}static timeRangesToArray(t){const e=[];for(let i=0;i<t.length;i++)e.push({start:t.start(i),end:t.end(i)});return e}static bufferInfo(t,e,i){if(t){const s=_c.bufferedRanges(t);if(s.length)return _c.bufferedInfo(s,e,i)}return{len:0,start:e,end:e,bufferedIndex:-1}}static bufferedInfo(t,e,i){e=Math.max(0,e),t.length>1&&t.sort((t,e)=>t.start-e.start||e.end-t.end);let s=-1,r=[];if(i)for(let d=0;d<t.length;d++){e>=t[d].start&&e<=t[d].end&&(s=d);const n=r.length;if(n){const e=r[n-1].end;t[d].start-e<i?t[d].end>e&&(r[n-1].end=t[d].end):r.push(t[d])}else r.push(t[d])}else r=t;let n,a=0,o=e,l=e;for(let d=0;d<r.length;d++){const t=r[d].start,h=r[d].end;if(-1===s&&e>=t&&e<=h&&(s=d),e+i>=t&&e<h)o=t,l=h,a=l-e;else if(e+i<t){n=t;break}}return{len:a,start:o||0,end:l||0,nextStart:n,buffered:t,bufferedIndex:s}}static getBuffered(t){try{return t.buffered||Nc}catch(e){return hd.log("failed to get media.buffered",e),Nc}}}const Uc=/\{\$([a-zA-Z0-9-_]+)\}/g;function Hc(t){return Uc.test(t)}function jc(t,e){if(null!==t.variableList||t.hasVariableRefs){const i=t.variableList;return e.replace(Uc,e=>{const s=e.substring(2,e.length-1),r=null==i?void 0:i[s];return void 0===r?(t.playlistParsingError||(t.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${s}"`)),e):r})}return e}function Vc(t,e,i){let s,r,n=t.variableList;if(n||(t.variableList=n={}),"QUERYPARAM"in e){s=e.QUERYPARAM;try{const t=new self.URL(i).searchParams;if(!t.has(s))throw new Error(`"${s}" does not match any query parameter in URI: "${i}"`);r=t.get(s)}catch(a){t.playlistParsingError||(t.playlistParsingError=new Error(`EXT-X-DEFINE QUERYPARAM: ${a.message}`))}}else s=e.NAME,r=e.VALUE;s in n?t.playlistParsingError||(t.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${s}"`)):n[s]=r||""}function Gc(t,e,i){const s=e.IMPORT;if(i&&s in i){let e=t.variableList;e||(t.variableList=e={}),e[s]=i[s]}else t.playlistParsingError||(t.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${s}"`))}const Qc=/^(\d+)x(\d+)$/,Kc=/(.+?)=(".*?"|.*?)(?:,|$)/g;class qc{constructor(t,e){"string"==typeof t&&(t=qc.parseAttrList(t,e)),ed(this,t)}get clientAttrs(){return Object.keys(this).filter(t=>"X-"===t.substring(0,2))}decimalInteger(t){const e=parseInt(this[t],10);return e>Number.MAX_SAFE_INTEGER?1/0:e}hexadecimalInteger(t){if(this[t]){let e=(this[t]||"0x").slice(2);e=(1&e.length?"0":"")+e;const i=new Uint8Array(e.length/2);for(let t=0;t<e.length/2;t++)i[t]=parseInt(e.slice(2*t,2*t+2),16);return i}return null}hexadecimalIntegerAsNumber(t){const e=parseInt(this[t],16);return e>Number.MAX_SAFE_INTEGER?1/0:e}decimalFloatingPoint(t){return parseFloat(this[t])}optionalFloat(t,e){const i=this[t];return i?parseFloat(i):e}enumeratedString(t){return this[t]}enumeratedStringList(t,e){const i=this[t];return(i?i.split(/[ ,]+/):[]).reduce((t,e)=>(t[e.toLowerCase()]=!0,t),e)}bool(t){return"YES"===this[t]}decimalResolution(t){const e=Qc.exec(this[t]);if(null!==e)return{width:parseInt(e[1],10),height:parseInt(e[2],10)}}static parseAttrList(t,e){let i;const s={};for(Kc.lastIndex=0;null!==(i=Kc.exec(t));){const r=i[1].trim();let n=i[2];const a=0===n.indexOf('"')&&n.lastIndexOf('"')===n.length-1;let o=!1;if(a)n=n.slice(1,-1);else switch(r){case"IV":case"SCTE35-CMD":case"SCTE35-IN":case"SCTE35-OUT":o=!0}if(e&&(a||o))n=jc(e,n);else if(!o&&!a)switch(r){case"CLOSED-CAPTIONS":if("NONE"===n)break;case"ALLOWED-CPC":case"CLASS":case"ASSOC-LANGUAGE":case"AUDIO":case"BYTERANGE":case"CHANNELS":case"CHARACTERISTICS":case"CODECS":case"DATA-ID":case"END-DATE":case"GROUP-ID":case"ID":case"IMPORT":case"INSTREAM-ID":case"KEYFORMAT":case"KEYFORMATVERSIONS":case"LANGUAGE":case"NAME":case"PATHWAY-ID":case"QUERYPARAM":case"RECENTLY-REMOVED-DATERANGES":case"SERVER-URI":case"STABLE-RENDITION-ID":case"STABLE-VARIANT-ID":case"START-DATE":case"SUBTITLES":case"SUPPLEMENTAL-CODECS":case"URI":case"VALUE":case"VIDEO":case"X-ASSET-LIST":case"X-ASSET-URI":hd.warn(`${t}: attribute ${r} is missing quotes`)}s[r]=n}return s}}function Wc(t){return"ID"!==t&&"CLASS"!==t&&"CUE"!==t&&"START-DATE"!==t&&"DURATION"!==t&&"END-DATE"!==t&&"END-ON-NEXT"!==t}function Yc(t){return"SCTE35-OUT"===t||"SCTE35-IN"===t||"SCTE35-CMD"===t}class $c{constructor(t,e,i=0){var s;if(this.attr=void 0,this.tagAnchor=void 0,this.tagOrder=void 0,this._startDate=void 0,this._endDate=void 0,this._dateAtEnd=void 0,this._cue=void 0,this._badValueForSameId=void 0,this.tagAnchor=(null==e?void 0:e.tagAnchor)||null,this.tagOrder=null!=(s=null==e?void 0:e.tagOrder)?s:i,e){const i=e.attr;for(const e in i)if(Object.prototype.hasOwnProperty.call(t,e)&&t[e]!==i[e]){hd.warn(`DATERANGE tag attribute: "${e}" does not match for tags with ID: "${t.ID}"`),this._badValueForSameId=e;break}t=ed(new qc({}),i,t)}if(this.attr=t,e?(this._startDate=e._startDate,this._cue=e._cue,this._endDate=e._endDate,this._dateAtEnd=e._dateAtEnd):this._startDate=new Date(t["START-DATE"]),"END-DATE"in this.attr){const t=(null==e?void 0:e.endDate)||new Date(this.attr["END-DATE"]);Ul(t.getTime())&&(this._endDate=t)}}get id(){return this.attr.ID}get class(){return this.attr.CLASS}get cue(){const t=this._cue;return void 0===t?this._cue=this.attr.enumeratedStringList(this.attr.CUE?"CUE":"X-CUE",{pre:!1,post:!1,once:!1}):t}get startTime(){const{tagAnchor:t}=this;return null===t||null===t.programDateTime?(hd.warn(`Expected tagAnchor Fragment with PDT set for DateRange "${this.id}": ${t}`),NaN):t.start+(this.startDate.getTime()-t.programDateTime)/1e3}get startDate(){return this._startDate}get endDate(){const t=this._endDate||this._dateAtEnd;if(t)return t;const e=this.duration;return null!==e?this._dateAtEnd=new Date(this._startDate.getTime()+1e3*e):null}get duration(){if("DURATION"in this.attr){const t=this.attr.decimalFloatingPoint("DURATION");if(Ul(t))return t}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 isInterstitial(){return"com.apple.hls.interstitial"===this.class}get isValid(){return!!this.id&&!this._badValueForSameId&&Ul(this.startDate.getTime())&&(null===this.duration||this.duration>=0)&&(!this.endOnNext||!!this.class)&&(!this.attr.CUE||!this.cue.pre&&!this.cue.post||this.cue.pre!==this.cue.post)&&(!this.isInterstitial||"X-ASSET-URI"in this.attr||"X-ASSET-LIST"in this.attr)}}class zc{constructor(t){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.dateRangeTagCount=0,this.live=!0,this.requestScheduled=-1,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!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.appliedTimelineOffset=void 0,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=t}reloaded(t){if(!t)return this.advanced=!0,void(this.updated=!0);const e=this.lastPartSn-t.lastPartSn,i=this.lastPartIndex-t.lastPartIndex;this.updated=this.endSN!==t.endSN||!!i||!!e||!this.live,this.advanced=this.endSN>t.endSN||e>0||0===e&&i>0,this.updated||this.advanced?this.misses=Math.floor(.6*t.misses):this.misses=t.misses+1}hasKey(t){return this.encryptedFragments.some(e=>{let i=e.decryptdata;return i||(e.setKeyFormat(t.keyFormat),i=e.decryptdata),!!i&&t.matches(i)})}get hasProgramDateTime(){return!!this.fragments.length&&Ul(this.fragments[this.fragments.length-1].programDateTime)}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||10}get drift(){const t=this.driftEndTime-this.driftStartTime;if(t>0){return 1e3*(this.driftEnd-this.driftStart)/t}return 1}get edge(){return this.partEnd||this.fragmentEnd}get partEnd(){var t;return null!=(t=this.partList)&&t.length?this.partList[this.partList.length-1].end:this.fragmentEnd}get fragmentEnd(){return this.fragments.length?this.fragments[this.fragments.length-1].end:0}get fragmentStart(){return this.fragments.length?this.fragments[0].start:0}get age(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}get lastPartIndex(){var t;return null!=(t=this.partList)&&t.length?this.partList[this.partList.length-1].index:-1}get maxPartIndex(){const t=this.partList;if(t){const e=this.lastPartIndex;if(-1!==e){for(let i=t.length;i--;)if(t[i].index>e)return t[i].index;return e}}return 0}get lastPartSn(){var t;return null!=(t=this.partList)&&t.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}get expired(){if(this.live&&this.age&&this.misses<3){const t=this.partEnd-this.fragmentStart;return this.age>Math.max(t,this.totalduration)+this.levelTargetDuration}return!1}}function Xc(t,e){return t.length===e.length&&!t.some((t,i)=>t!==e[i])}function Zc(t,e){return!t&&!e||!(!t||!e)&&Xc(t,e)}function Jc(t){return"AES-128"===t||"AES-256"===t||"AES-256-CTR"===t}function tu(t){switch(t){case"AES-128":case"AES-256":return Ic;case"AES-256-CTR":return Lc;default:throw new Error(`invalid full segment method ${t}`)}}function eu(t){return Uint8Array.from(atob(t),t=>t.charCodeAt(0))}function iu(t){return Uint8Array.from(unescape(encodeURIComponent(t)),t=>t.charCodeAt(0))}function su(t){const e=function(t,e,i){const s=t[e];t[e]=t[i],t[i]=s};e(t,0,3),e(t,1,2),e(t,4,5),e(t,6,7)}function ru(t){const e=t.split(":");let i=null;if("data"===e[0]&&2===e.length){const t=e[1].split(";"),s=t[t.length-1].split(",");if(2===s.length){const e="base64"===s[0],r=s[1];e?(t.splice(-1,1),i=eu(r)):i=function(t){const e=iu(t).subarray(0,16),i=new Uint8Array(16);return i.set(e,16-e.length),i}(r)}}return i}const nu="undefined"!=typeof self?self:void 0;var au={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},ou="org.w3.clearkey",lu="com.apple.streamingkeydelivery",du="com.microsoft.playready",hu="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed";function cu(t){switch(t){case lu:return au.FAIRPLAY;case du:return au.PLAYREADY;case hu:return au.WIDEVINE;case ou:return au.CLEARKEY}}function uu(t){switch(t){case au.FAIRPLAY:return lu;case au.PLAYREADY:return du;case au.WIDEVINE:return hu;case au.CLEARKEY:return ou}}function fu(t){const{drmSystems:e,widevineLicenseUrl:i}=t,s=e?[au.FAIRPLAY,au.WIDEVINE,au.PLAYREADY,au.CLEARKEY].filter(t=>!!e[t]):[];return!s[au.WIDEVINE]&&i&&s.push(au.WIDEVINE),s}const gu=null!=nu&&null!=(mu=nu.navigator)&&mu.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null;var mu;function pu(t){const e=new Uint16Array(t.buffer,t.byteOffset,t.byteLength/2),i=String.fromCharCode.apply(null,Array.from(e)),s=i.substring(i.indexOf("<"),i.length),r=(new DOMParser).parseFromString(s,"text/xml").getElementsByTagName("KID")[0];if(r){const t=r.childNodes[0]?r.childNodes[0].nodeValue:r.getAttribute("VALUE");if(t){const e=eu(t).subarray(0,16);return su(e),e}}return null}let Au={};class vu{static clearKeyUriToKeyIdMap(){Au={}}static setKeyIdForUri(t,e){Au[t]=e}static addKeyIdForUri(t){const e=Object.keys(Au).length%Number.MAX_SAFE_INTEGER,i=new Uint8Array(16);return new DataView(i.buffer,12,4).setUint32(0,e),Au[t]=i,i}constructor(t,e,i,s=[1],r=null,n){this.uri=void 0,this.method=void 0,this.keyFormat=void 0,this.keyFormatVersions=void 0,this.encrypted=void 0,this.isCommonEncryption=void 0,this.iv=null,this.key=null,this.keyId=null,this.pssh=null,this.method=t,this.uri=e,this.keyFormat=i,this.keyFormatVersions=s,this.iv=r,this.encrypted=!!t&&"NONE"!==t,this.isCommonEncryption=this.encrypted&&!Jc(t),null!=n&&n.startsWith("0x")&&(this.keyId=new Uint8Array(md(n)))}matches(t){return t.uri===this.uri&&t.method===this.method&&t.encrypted===this.encrypted&&t.keyFormat===this.keyFormat&&Xc(t.keyFormatVersions,this.keyFormatVersions)&&Zc(t.iv,this.iv)&&Zc(t.keyId,this.keyId)}isSupported(){if(this.method){if(Jc(this.method)||"NONE"===this.method)return!0;if("identity"===this.keyFormat)return"SAMPLE-AES"===this.method;switch(this.keyFormat){case lu:case hu:case du:case ou:return-1!==["SAMPLE-AES","SAMPLE-AES-CENC","SAMPLE-AES-CTR"].indexOf(this.method)}}return!1}getDecryptData(t,e){if(!this.encrypted||!this.uri)return null;if(Jc(this.method)){let e=this.iv;e||("number"!=typeof t&&(hd.warn(`missing IV for initialization segment with method="${this.method}" - compliance issue`),t=0),e=function(t){const e=new Uint8Array(16);for(let i=12;i<16;i++)e[i]=t>>8*(15-i)&255;return e}(t));return new vu(this.method,this.uri,"identity",this.keyFormatVersions,e)}if(this.keyId){const t=Au[this.uri];if(t&&!Xc(this.keyId,t)&&vu.setKeyIdForUri(this.uri,this.keyId),this.pssh)return this}const i=ru(this.uri);if(i)switch(this.keyFormat){case hu:if(this.pssh=i,!this.keyId){const t=function(t){const e=[];if(t instanceof ArrayBuffer){const i=t.byteLength;let s=0;for(;s+32<i;){const i=nh(new DataView(t,s));e.push(i),s+=i.size}}return e}(i.buffer);if(t.length){var s;const e=t[0];this.keyId=null!=(s=e.kids)&&s.length?e.kids[0]:null}}this.keyId||(this.keyId=yu(e));break;case du:{const t=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=rh(t,0,i),this.keyId=pu(i);break}default:{let t=i.subarray(0,16);if(16!==t.length){const e=new Uint8Array(16);e.set(t,16-t.length),t=e}this.keyId=t;break}}if(!this.keyId||16!==this.keyId.byteLength){let t;t=function(t){const e=null==t?void 0:t[hu];if(e)return e.keyId;return null}(e),t||(t=yu(e),t||(t=Au[this.uri])),t&&(this.keyId=t,vu.setKeyIdForUri(this.uri,t))}return this}}function yu(t){const e=null==t?void 0:t[du];if(e){const t=ru(e.uri);if(t)return pu(t)}return null}const Eu=/#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,Tu=/#EXT-X-MEDIA:(.*)/g,Su=/^#EXT(?:INF|-X-TARGETDURATION):/m,bu=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[^\r\n]*)/.source,/#.*/.source].join("|"),"g"),Iu=new RegExp([/#EXT-X-(PROGRAM-DATE-TIME|BYTERANGE|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 Lu{static findGroup(t,e){for(let i=0;i<t.length;i++){const s=t[i];if(s.id===e)return s}}static resolve(t,e){return Id.buildAbsoluteURL(e,t,{alwaysNormalize:!0})}static isMediaPlaylist(t){return Su.test(t)}static parseMasterPlaylist(t,e){const i={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:Hc(t)},s=[];if(Eu.lastIndex=0,!t.startsWith("#EXTM3U"))return i.playlistParsingError=new Error("no EXTM3U delimiter"),i;let r;for(;null!=(r=Eu.exec(t));)if(r[1]){var n;const t=new qc(r[1],i),a=jc(i,r[2]),o={attrs:t,bitrate:t.decimalInteger("BANDWIDTH")||t.decimalInteger("AVERAGE-BANDWIDTH"),name:t.NAME,url:Lu.resolve(a,e)},l=t.decimalResolution("RESOLUTION");l&&(o.width=l.width,o.height=l.height),Cu(t.CODECS,o);const d=t["SUPPLEMENTAL-CODECS"];d&&(o.supplemental={},Cu(d,o.supplemental)),null!=(n=o.unknownCodecs)&&n.length||s.push(o),i.levels.push(o)}else if(r[3]){const t=r[3],s=r[4];switch(t){case"SESSION-DATA":{const t=new qc(s,i),e=t["DATA-ID"];e&&(null===i.sessionData&&(i.sessionData={}),i.sessionData[e]=t);break}case"SESSION-KEY":{const t=wu(s,e,i);t.encrypted&&t.isSupported()?(null===i.sessionKeys&&(i.sessionKeys=[]),i.sessionKeys.push(t)):hd.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${s}"`);break}case"DEFINE":Vc(i,new qc(s,i),e);break;case"CONTENT-STEERING":{const t=new qc(s,i);i.contentSteering={uri:Lu.resolve(t["SERVER-URI"],e),pathwayId:t["PATHWAY-ID"]||"."};break}case"START":i.startTimeOffset=Du(s)}}const a=s.length>0&&s.length<i.levels.length;return i.levels=a?s:i.levels,0===i.levels.length&&(i.playlistParsingError=new Error("no levels found in manifest")),i}static parseMasterPlaylistMedia(t,e,i){let s;const r={},n=i.levels,a={AUDIO:n.map(t=>({id:t.attrs.AUDIO,audioCodec:t.audioCodec})),SUBTITLES:n.map(t=>({id:t.attrs.SUBTITLES,textCodec:t.textCodec})),"CLOSED-CAPTIONS":[]};let o=0;for(Tu.lastIndex=0;null!==(s=Tu.exec(t));){const t=new qc(s[1],i),n=t.TYPE;if(n){const i=a[n],s=r[n]||[];r[n]=s;const l=t.LANGUAGE,d=t["ASSOC-LANGUAGE"],h=t.CHANNELS,c=t.CHARACTERISTICS,u=t["INSTREAM-ID"],f={attrs:t,bitrate:0,id:o++,groupId:t["GROUP-ID"]||"",name:t.NAME||l||"",type:n,default:t.bool("DEFAULT"),autoselect:t.bool("AUTOSELECT"),forced:t.bool("FORCED"),lang:l,url:t.URI?Lu.resolve(t.URI,e):""};if(d&&(f.assocLang=d),h&&(f.channels=h),c&&(f.characteristics=c),u&&(f.instreamId=u),null!=i&&i.length){const t=Lu.findGroup(i,f.groupId)||i[0];xu(f,t,"audioCodec"),xu(f,t,"textCodec")}s.push(f)}}return r}static parseLevelPlaylist(t,e,i,s,r,n){var a;const o={url:e},l=new zc(e),d=l.fragments,h=[];let c,u,f,g,m=null,p=0,A=0,v=0,y=0,E=0,T=null,S=new xd(s,o),b=-1,I=!1,L=null;if(bu.lastIndex=0,l.m3u8=t,l.hasVariableRefs=Hc(t),"#EXTM3U"!==(null==(a=bu.exec(t))?void 0:a[0]))return l.playlistParsingError=new Error("Missing format identifier #EXTM3U"),l;for(;null!==(c=bu.exec(t));){I&&(I=!1,S=new xd(s,o),S.playlistOffset=v,S.setStart(v),S.sn=p,S.cc=y,E&&(S.bitrate=E),S.level=i,m&&(S.initSegment=m,m.rawProgramDateTime&&(S.rawProgramDateTime=m.rawProgramDateTime,m.rawProgramDateTime=null),L&&(S.setByteRange(L),L=null)));const t=c[1];if(t){S.duration=parseFloat(t);const e=(" "+c[2]).slice(1);S.title=e||null,S.tagList.push(e?["INF",t,e]:["INF",t])}else if(c[3]){if(Ul(S.duration)){S.playlistOffset=v,S.setStart(v),f&&Ou(S,f,l),S.sn=p,S.level=i,S.cc=y,d.push(S);const t=(" "+c[3]).slice(1);S.relurl=jc(l,t),Pu(S,T,h),T=S,v+=S.duration,p++,A=0,I=!0}}else{if(c=c[0].match(Iu),!c){hd.warn("No matches on slow regex match for level playlist!");continue}for(u=1;u<c.length&&void 0===c[u];u++);const t=(" "+c[u]).slice(1),r=(" "+c[u+1]).slice(1),a=c[u+2]?(" "+c[u+2]).slice(1):null;switch(t){case"BYTERANGE":T?S.setByteRange(r,T):S.setByteRange(r);break;case"PROGRAM-DATE-TIME":S.rawProgramDateTime=r,S.tagList.push(["PROGRAM-DATE-TIME",r]),-1===b&&(b=d.length);break;case"PLAYLIST-TYPE":l.type&&Bu(l,t,c),l.type=r.toUpperCase();break;case"MEDIA-SEQUENCE":0!==l.startSN?Bu(l,t,c):d.length>0&&Fu(l,t,c),p=l.startSN=parseInt(r);break;case"SKIP":{l.skippedSegments&&Bu(l,t,c);const e=new qc(r,l),i=e.decimalInteger("SKIPPED-SEGMENTS");if(Ul(i)){l.skippedSegments+=i;for(let t=i;t--;)d.push(null);p+=i}const s=e.enumeratedString("RECENTLY-REMOVED-DATERANGES");s&&(l.recentlyRemovedDateranges=(l.recentlyRemovedDateranges||[]).concat(s.split("\t")));break}case"TARGETDURATION":0!==l.targetduration&&Bu(l,t,c),l.targetduration=Math.max(parseInt(r),1);break;case"VERSION":null!==l.version&&Bu(l,t,c),l.version=parseInt(r);break;case"INDEPENDENT-SEGMENTS":break;case"ENDLIST":l.live||Bu(l,t,c),l.live=!1;break;case"#":(r||a)&&S.tagList.push(a?[r,a]:[r]);break;case"DISCONTINUITY":y++,S.tagList.push(["DIS"]);break;case"GAP":S.gap=!0,S.tagList.push([t]);break;case"BITRATE":S.tagList.push([t,r]),E=1e3*parseInt(r),Ul(E)?S.bitrate=E:E=0;break;case"DATERANGE":{const t=new qc(r,l),e=new $c(t,l.dateRanges[t.ID],l.dateRangeTagCount);l.dateRangeTagCount++,e.isValid||l.skippedSegments?l.dateRanges[e.id]=e:hd.warn(`Ignoring invalid DATERANGE tag: "${r}"`),S.tagList.push(["EXT-X-DATERANGE",r]);break}case"DEFINE":{const t=new qc(r,l);"IMPORT"in t?Gc(l,t,n):Vc(l,t,e)}break;case"DISCONTINUITY-SEQUENCE":0!==l.startCC?Bu(l,t,c):d.length>0&&Fu(l,t,c),l.startCC=y=parseInt(r);break;case"KEY":{const t=wu(r,e,l);if(t.isSupported()){if("NONE"===t.method){f=void 0;break}f||(f={});const e=f[t.keyFormat];null!=e&&e.matches(t)||(e&&(f=ed({},f)),f[t.keyFormat]=t)}else hd.warn(`[Keys] Ignoring unsupported EXT-X-KEY tag: "${r}"`);break}case"START":l.startTimeOffset=Du(r);break;case"MAP":{const t=new qc(r,l);if(S.duration){const e=new xd(s,o);Mu(e,t,i,f),m=e,S.initSegment=m,m.rawProgramDateTime&&!S.rawProgramDateTime&&(S.rawProgramDateTime=m.rawProgramDateTime)}else{const e=S.byteRangeEndOffset;if(e){const t=S.byteRangeStartOffset;L=`${e-t}@${t}`}else L=null;Mu(S,t,i,f),m=S,I=!0}m.cc=y;break}case"SERVER-CONTROL":g&&Bu(l,t,c),g=new qc(r),l.canBlockReload=g.bool("CAN-BLOCK-RELOAD"),l.canSkipUntil=g.optionalFloat("CAN-SKIP-UNTIL",0),l.canSkipDateRanges=l.canSkipUntil>0&&g.bool("CAN-SKIP-DATERANGES"),l.partHoldBack=g.optionalFloat("PART-HOLD-BACK",0),l.holdBack=g.optionalFloat("HOLD-BACK",0);break;case"PART-INF":{l.partTarget&&Bu(l,t,c);const e=new qc(r);l.partTarget=e.decimalFloatingPoint("PART-TARGET");break}case"PART":{let t=l.partList;t||(t=l.partList=[]);const e=A>0?t[t.length-1]:void 0,i=A++,s=new qc(r,l),n=new Pd(s,S,o,i,e);t.push(n),S.duration+=n.duration;break}case"PRELOAD-HINT":{const t=new qc(r,l);l.preloadHint=t;break}case"RENDITION-REPORT":{const t=new qc(r,l);l.renditionReports=l.renditionReports||[],l.renditionReports.push(t);break}default:hd.warn(`line parsed but not handled: ${c}`)}}}T&&!T.relurl?(d.pop(),v-=T.duration,l.partList&&(l.fragmentHint=T)):l.partList&&(Pu(S,T,h),S.cc=y,l.fragmentHint=S,f&&Ou(S,f,l)),l.targetduration||(l.playlistParsingError=new Error("Missing Target Duration"));const R=d.length,k=d[0],w=d[R-1];if(v+=l.skippedSegments*l.targetduration,v>0&&R&&w){l.averagetargetduration=v/R;const t=w.sn;l.endSN="initSegment"!==t?t:0,l.live||(w.endList=!0),b>0&&(!function(t,e){let i=t[e];for(let s=e;s--;){const e=t[s];if(!e)return;e.programDateTime=i.programDateTime-1e3*e.duration,i=e}}(d,b),k&&h.unshift(k))}return l.fragmentHint&&(v+=l.fragmentHint.duration),l.totalduration=v,h.length&&l.dateRangeTagCount&&k&&Ru(h,l),l.endCC=y,l}}function Ru(t,e){let i=t.length;if(!i){if(!e.hasProgramDateTime)return;{const s=e.fragments[e.fragments.length-1];t.push(s),i++}}const s=t[i-1],r=e.live?1/0:e.totalduration,n=Object.keys(e.dateRanges);for(let o=n.length;o--;){const l=e.dateRanges[n[o]],d=l.startDate.getTime();l.tagAnchor=s.ref;for(let s=i;s--;){var a;if((null==(a=t[s])?void 0:a.sn)<e.startSN)break;const i=ku(e,d,t,s,r);if(-1!==i){l.tagAnchor=e.fragments[i].ref;break}}}}function ku(t,e,i,s,r){const n=i[s];if(n){const o=n.programDateTime;if(e>=o||0===s){var a;if(e<=o+1e3*(((null==(a=i[s+1])?void 0:a.start)||r)-n.start)){const r=i[s].sn-t.startSN;if(r<0)return-1;const n=t.fragments;if(n.length>i.length){for(let a=(i[s+1]||n[n.length-1]).sn-t.startSN;a>r;a--){const t=n[a].programDateTime;if(e>=t&&e<t+1e3*n[a].duration)return a}}return r}}}return-1}function wu(t,e,i){var s,r;const n=new qc(t,i),a=null!=(s=n.METHOD)?s:"",o=n.URI,l=n.hexadecimalInteger("IV"),d=n.KEYFORMATVERSIONS,h=null!=(r=n.KEYFORMAT)?r:"identity";o&&n.IV&&!l&&hd.error(`Invalid IV: ${n.IV}`);const c=o?Lu.resolve(o,e):"",u=(d||"1").split("/").map(Number).filter(Number.isFinite);return new vu(a,c,h,u,l,n.KEYID)}function Du(t){const e=new qc(t).decimalFloatingPoint("TIME-OFFSET");return Ul(e)?e:null}function Cu(t,e){let i=(t||"").split(/[ ,]+/).filter(t=>t);["video","audio","text"].forEach(t=>{const s=i.filter(e=>lh(e,t));s.length&&(e[`${t}Codec`]=s.map(t=>t.split("/")[0]).join(","),i=i.filter(t=>-1===s.indexOf(t)))}),e.unknownCodecs=i}function xu(t,e,i){const s=e[i];s&&(t[i]=s)}function Pu(t,e,i){t.rawProgramDateTime?i.push(t):null!=e&&e.programDateTime&&(t.programDateTime=e.endProgramDateTime)}function Mu(t,e,i,s){t.relurl=e.URI,e.BYTERANGE&&t.setByteRange(e.BYTERANGE),t.level=i,t.sn="initSegment",s&&(t.levelkeys=s),t.initSegment=null}function Ou(t,e,i){t.levelkeys=e;const{encryptedFragments:s}=i;s.length&&s[s.length-1].levelkeys===e||!Object.keys(e).some(t=>e[t].isCommonEncryption)||s.push(t)}function Bu(t,e,i){t.playlistParsingError=new Error(`#EXT-X-${e} must not appear more than once (${i[0]})`)}function Fu(t,e,i){t.playlistParsingError=new Error(`#EXT-X-${e} must appear before the first Media Segment (${i[0]})`)}function Nu(t,e){const i=e.startPTS;if(Ul(i)){let s,r=0;e.sn>t.sn?(r=i-t.start,s=t):(r=t.start-i,s=e),s.duration!==r&&s.setDuration(r)}else if(e.sn>t.sn){t.cc===e.cc&&t.minEndPTS?e.setStart(t.start+(t.minEndPTS-t.start)):e.setStart(t.start+t.duration)}else e.setStart(Math.max(t.start-e.duration,0))}function _u(t,e,i,s,r,n,a){s-i<=0&&(a.warn("Fragment should have a positive duration",e),s=i+e.duration,n=r+e.duration);let o=i,l=s;const d=e.startPTS,h=e.endPTS;if(Ul(d)){const c=Math.abs(d-i);t&&c>t.totalduration?a.warn(`media timestamps and playlist times differ by ${c}s for level ${e.level} ${t.url}`):Ul(e.deltaPTS)?e.deltaPTS=Math.max(c,e.deltaPTS):e.deltaPTS=c,o=Math.max(i,d),i=Math.min(i,d),r=void 0!==e.startDTS?Math.min(r,e.startDTS):r,l=Math.min(s,h),s=Math.max(s,h),n=void 0!==e.endDTS?Math.max(n,e.endDTS):n}const c=i-e.start;0!==e.start&&e.setStart(i),e.setDuration(s-e.start),e.startPTS=i,e.maxStartPTS=o,e.startDTS=r,e.endPTS=s,e.minEndPTS=l,e.endDTS=n;const u=e.sn;if(!t||u<t.startSN||u>t.endSN)return 0;let f;const g=u-t.startSN,m=t.fragments;for(m[g]=e,f=g;f>0;f--)Nu(m[f],m[f-1]);for(f=g;f<m.length-1;f++)Nu(m[f],m[f+1]);return t.fragmentHint&&Nu(m[m.length-1],t.fragmentHint),t.PTSKnown=t.alignedSliding=!0,c}function Uu(t,e,i){if(t===e)return;let s=null;const r=t.fragments;for(let h=r.length-1;h>=0;h--){const t=r[h].initSegment;if(t){s=t;break}}let n;t.fragmentHint&&delete t.fragmentHint.endPTS,function(t,e,i){const s=e.skippedSegments,r=Math.max(t.startSN,e.startSN)-e.startSN,n=(t.fragmentHint?1:0)+(s?e.endSN:Math.min(t.endSN,e.endSN))-e.startSN,a=e.startSN-t.startSN,o=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,l=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments;for(let d=r;d<=n;d++){const r=l[a+d];let n=o[d];if(s&&!n&&r&&(n=e.fragments[d]=r),r&&n){i(r,n,d,o);const s=r.relurl,a=n.relurl;if(s&&Yu(s,a))return void(e.playlistParsingError=Hu(`media sequence mismatch ${n.sn}:`,t,e,r,n));if(r.cc!==n.cc)return void(e.playlistParsingError=Hu(`discontinuity sequence mismatch (${r.cc}!=${n.cc})`,t,e,r,n))}}}(t,e,(t,i,r,a)=>{if((!e.startCC||e.skippedSegments)&&i.cc!==t.cc){const s=t.cc-i.cc;for(let t=r;t<a.length;t++)a[t].cc+=s;e.endCC=a[a.length-1].cc}Ul(t.startPTS)&&Ul(t.endPTS)&&(i.setStart(i.startPTS=t.startPTS),i.startDTS=t.startDTS,i.maxStartPTS=t.maxStartPTS,i.endPTS=t.endPTS,i.endDTS=t.endDTS,i.minEndPTS=t.minEndPTS,i.setDuration(t.endPTS-t.startPTS),i.duration&&(n=i),e.PTSKnown=e.alignedSliding=!0),t.hasStreams&&(i.elementaryStreams=t.elementaryStreams),i.loader=t.loader,t.hasStats&&(i.stats=t.stats),t.initSegment&&(i.initSegment=t.initSegment,s=t.initSegment)});const a=e.fragments,o=e.fragmentHint?a.concat(e.fragmentHint):a;if(s&&o.forEach(t=>{var e;!t||t.initSegment&&t.initSegment.relurl!==(null==(e=s)?void 0:e.relurl)||(t.initSegment=s)}),e.skippedSegments){if(e.deltaUpdateFailed=a.some(t=>!t),e.deltaUpdateFailed){i.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let t=e.skippedSegments;t--;)a.shift();e.startSN=a[0].sn}else{e.canSkipDateRanges&&(e.dateRanges=function(t,e,i){const{dateRanges:s,recentlyRemovedDateranges:r}=e,n=ed({},t);r&&r.forEach(t=>{delete n[t]});const a=Object.keys(n).length;if(!a)return s;return Object.keys(s).forEach(t=>{const e=n[t],r=new $c(s[t].attr,e);r.isValid?(n[t]=r,e||(r.tagOrder+=a)):i.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${Uh(s[t].attr)}"`)}),n}(t.dateRanges,e,i));const s=t.fragments.filter(t=>t.rawProgramDateTime);if(t.hasProgramDateTime&&!e.hasProgramDateTime)for(let t=1;t<o.length;t++)null===o[t].programDateTime&&Pu(o[t],o[t-1],s);Ru(s,e)}e.endCC=a[a.length-1].cc}if(!e.startCC){var l;const i=Qu(t,e.startSN-1);e.startCC=null!=(l=null==i?void 0:i.cc)?l:a[0].cc}!function(t,e,i){if(t&&e){let s=0;for(let r=0,n=t.length;r<=n;r++){const n=t[r],a=e[r+s];n&&a&&n.index===a.index&&n.fragment.sn===a.fragment.sn?i(n,a):s--}}}(t.partList,e.partList,(t,e)=>{e.elementaryStreams=t.elementaryStreams,e.stats=t.stats}),n?_u(e,n,n.startPTS,n.endPTS,n.startDTS,n.endDTS,i):ju(t,e),a.length&&(e.totalduration=e.edge-a[0].start),e.driftStartTime=t.driftStartTime,e.driftStart=t.driftStart;const d=e.advancedDateTime;if(e.advanced&&d){const t=e.edge;e.driftStart||(e.driftStartTime=d,e.driftStart=t),e.driftEndTime=d,e.driftEnd=t}else e.driftEndTime=t.driftEndTime,e.driftEnd=t.driftEnd,e.advancedDateTime=t.advancedDateTime;-1===e.requestScheduled&&(e.requestScheduled=t.requestScheduled)}function Hu(t,e,i,s,r){return new Error(`${t} ${r.url}\nPlaylist starting @${e.startSN}\n${e.m3u8}\n\nPlaylist starting @${i.startSN}\n${i.m3u8}`)}function ju(t,e,i=!0){const s=e.startSN+e.skippedSegments-t.startSN,r=t.fragments,n=s>=0;let a=0;if(n&&s<r.length)a=r[s].start;else if(n&&e.startSN===t.endSN+1)a=t.fragmentEnd;else if(n&&i)a=t.fragmentStart+s*e.levelTargetDuration;else{if(e.skippedSegments||0!==e.fragmentStart)return;a=t.fragmentStart}Vu(e,a)}function Vu(t,e){if(e){const i=t.fragments;for(let s=t.skippedSegments;s<i.length;s++)i[s].addStart(e);t.fragmentHint&&t.fragmentHint.addStart(e)}}function Gu(t,e=1/0){let i=1e3*t.targetduration;if(t.updated){const s=t.fragments,r=4;if(s.length&&i*r>e){const t=1e3*s[s.length-1].duration;t<i&&(i=t)}}else i/=2;return Math.round(i)}function Qu(t,e,i){if(!t)return null;let s=t.fragments[e-t.startSN];return s||(s=t.fragmentHint,s&&s.sn===e?s:e<t.startSN&&i&&i.sn===e?i:null)}function Ku(t,e,i){return t?qu(t.partList,e,i):null}function qu(t,e,i){if(t)for(let s=t.length;s--;){const r=t[s];if(r.index===i&&r.fragment.sn===e)return r}return null}function Wu(t){t.forEach((t,e)=>{var i;null==(i=t.details)||i.fragments.forEach(t=>{t.level=e,t.initSegment&&(t.initSegment.level=e)})})}function Yu(t,e){return!(t===e||!e)&&$u(t)!==$u(e)}function $u(t){return t.replace(/\?[^?]*$/,"")}function zu(t,e){for(let s=0,r=t.length;s<r;s++){var i;if((null==(i=t[s])?void 0:i.cc)===e)return t[s]}return null}function Xu(t,e){const i=t.start+e;t.startPTS=i,t.setStart(i),t.endPTS=i+t.duration}function Zu(t,e){const i=e.fragments;for(let s=0,r=i.length;s<r;s++)Xu(i[s],t);e.fragmentHint&&Xu(e.fragmentHint,t),e.alignedSliding=!0}function Ju(t,e){if(!function(t,e){return!!(t&&e.startCC<t.endCC&&e.endCC>t.startCC)}(e,t))return;const i=Math.min(e.endCC,t.endCC),s=zu(e.fragments,i),r=zu(t.fragments,i);if(!s||!r)return;hd.log(`Aligning playlist at start of dicontinuity sequence ${i}`);Zu(s.start-r.start,t)}function tf(t,e){if(!t.hasProgramDateTime||!e.hasProgramDateTime)return;const i=t.fragments,s=e.fragments;if(!i.length||!s.length)return;let r,n;const a=Math.min(e.endCC,t.endCC);e.startCC<a&&t.startCC<a&&(r=zu(s,a),n=zu(i,a)),r&&n||(r=s[Math.floor(s.length/2)],n=zu(i,r.cc)||i[Math.floor(i.length/2)]);const o=r.programDateTime,l=n.programDateTime;if(!o||!l)return;Zu((l-o)/1e3-(n.start-r.start),t)}function ef(t,e,i){sf(t,e,i),t.addEventListener(e,i)}function sf(t,e,i){t.removeEventListener(e,i)}const rf=function(t){let e="";const i=t.length;for(let s=0;s<i;s++)e+=`[${t.start(s).toFixed(3)}-${t.end(s).toFixed(3)}]`;return e},nf="STOPPED",af="IDLE",of="KEY_LOADING",lf="FRAG_LOADING",df="FRAG_LOADING_WAITING_RETRY",hf="WAITING_TRACK",cf="PARSING",uf="PARSED",ff="ENDED",gf="ERROR",mf="WAITING_INIT_PTS",pf="WAITING_LEVEL";class Af extends Bc{constructor(t,e,i,s,r){super(s,t.logger),this.hls=void 0,this.fragPrevious=null,this.fragCurrent=null,this.fragmentTracker=void 0,this.transmuxer=null,this._state=nf,this.playlistType=void 0,this.media=null,this.mediaBuffer=null,this.config=void 0,this.bitrateTest=!1,this.lastCurrentTime=0,this.nextLoadPosition=0,this.startPosition=0,this.startTimeOffset=null,this.retryDate=0,this.levels=null,this.fragmentLoader=void 0,this.keyLoader=void 0,this.levelLastLoaded=null,this.startFragRequested=!1,this.decrypter=void 0,this.initPTS=[],this.buffering=!0,this.loadingParts=!1,this.loopSn=void 0,this.onMediaSeeking=()=>{const{config:t,fragCurrent:e,media:i,mediaBuffer:s,state:r}=this,n=i?i.currentTime:0,a=_c.bufferInfo(s||i,n,t.maxBufferHole),o=!a.len;if(this.log(`Media seeking to ${Ul(n)?n.toFixed(3):n}, state: ${r}, ${o?"out of":"in"} buffer`),this.state===ff)this.resetLoadingState();else if(e){const i=t.maxFragLookUpTolerance,s=e.start-i,r=e.start+e.duration+i;if(o||r<a.start||s>a.end){const t=n>r;(n<s||t)&&(t&&e.loader&&(this.log(`Cancelling fragment load for seek (sn: ${e.sn})`),e.abortRequests(),this.resetLoadingState()),this.fragPrevious=null)}}if(i){this.fragmentTracker.removeFragmentsInRange(n,1/0,this.playlistType,!0);if(n>this.lastCurrentTime&&(this.lastCurrentTime=n),!this.loadingParts){const t=Math.max(a.end,n),e=this.shouldLoadParts(this.getLevelDetails(),t);e&&(this.log(`LL-Part loading ON after seeking to ${n.toFixed(2)} with buffer @${t.toFixed(2)}`),this.loadingParts=e)}}this.hls.hasEnoughToStart||(this.log(`Setting ${o?"startPosition":"nextLoadPosition"} to ${n} for seek without enough to start`),this.nextLoadPosition=n,o&&(this.startPosition=n)),o&&this.state===af&&this.tickImmediate()},this.onMediaEnded=()=>{this.log("setting startPosition to 0 because media ended"),this.startPosition=this.lastCurrentTime=0},this.playlistType=r,this.hls=t,this.fragmentLoader=new xc(t.config),this.keyLoader=i,this.fragmentTracker=e,this.config=t.config,this.decrypter=new Dc(t.config)}registerListeners(){const{hls:t}=this;t.on(Ql.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(Ql.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(Ql.MANIFEST_LOADING,this.onManifestLoading,this),t.on(Ql.MANIFEST_LOADED,this.onManifestLoaded,this),t.on(Ql.ERROR,this.onError,this)}unregisterListeners(){const{hls:t}=this;t.off(Ql.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(Ql.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(Ql.MANIFEST_LOADING,this.onManifestLoading,this),t.off(Ql.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(Ql.ERROR,this.onError,this)}doTick(){this.onTickEnd()}onTickEnd(){}startLoad(t){}stopLoad(){if(this.state===nf)return;this.fragmentLoader.abort(),this.keyLoader.abort(this.playlistType);const t=this.fragCurrent;null!=t&&t.loader&&(t.abortRequests(),this.fragmentTracker.removeFragment(t)),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=nf}get startPositionValue(){const{nextLoadPosition:t,startPosition:e}=this;return-1===e&&t?t:e}get bufferingEnabled(){return this.buffering}pauseBuffering(){this.buffering=!1}resumeBuffering(){this.buffering=!0}get inFlightFrag(){return{frag:this.fragCurrent,state:this.state}}_streamEnded(t,e){if(e.live||!this.media)return!1;const i=t.end||0,s=this.config.timelineOffset||0;if(i<=s)return!1;const r=t.buffered;this.config.maxBufferHole&&r&&r.length>1&&(t=_c.bufferedInfo(r,t.start,0));const n=t.nextStart;if(n&&n>s&&n<e.edge)return!1;if(this.media.currentTime<t.start)return!1;const a=e.partList;if(null!=a&&a.length){const t=a[a.length-1];return _c.isBuffered(this.media,t.start+t.duration/2)}const o=e.fragments[e.fragments.length-1].type;return this.fragmentTracker.isEndListAppended(o)}getLevelDetails(){if(this.levels&&null!==this.levelLastLoaded)return this.levelLastLoaded.details}get timelineOffset(){const t=this.config.timelineOffset;var e;return t?(null==(e=this.getLevelDetails())?void 0:e.appliedTimelineOffset)||t:0}onMediaAttached(t,e){const i=this.media=this.mediaBuffer=e.media;ef(i,"seeking",this.onMediaSeeking),ef(i,"ended",this.onMediaEnded);const s=this.config;this.levels&&s.autoStartLoad&&this.state===nf&&this.startLoad(s.startPosition)}onMediaDetaching(t,e){const i=!!e.transferMedia,s=this.media;if(null!==s){if(s.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),sf(s,"seeking",this.onMediaSeeking),sf(s,"ended",this.onMediaEnded),this.keyLoader&&!i&&this.keyLoader.detach(),this.media=this.mediaBuffer=null,this.loopSn=void 0,i)return this.resetLoadingState(),void this.resetTransmuxer();this.loadingParts=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()}}onManifestLoading(){this.initPTS=[],this.levels=this.levelLastLoaded=this.fragCurrent=null,this.lastCurrentTime=this.startPosition=0,this.startFragRequested=!1}onError(t,e){}onManifestLoaded(t,e){this.startTimeOffset=e.startTimeOffset}onHandlerDestroying(){this.stopLoad(),this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null),super.onHandlerDestroying(),this.hls=this.onMediaSeeking=this.onMediaEnded=null}onHandlerDestroyed(){this.state=nf,this.fragmentLoader&&this.fragmentLoader.destroy(),this.keyLoader&&this.keyLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.keyLoader=this.fragmentLoader=this.fragmentTracker=null,super.onHandlerDestroyed()}loadFragment(t,e,i){this.startFragRequested=!0,this._loadFragForPlayback(t,e,i)}_loadFragForPlayback(t,e,i){this._doFragLoad(t,e,i,t=>{const e=t.frag;if(this.fragContextChanged(e))return this.warn(`${e.type} sn: ${e.sn}${t.part?" part: "+t.part.index:""} of ${this.fragInfo(e,!1,t.part)}) was dropped during download.`),void this.fragmentTracker.removeFragment(e);e.stats.chunkCount++,this._handleFragmentLoadProgress(t)}).then(t=>{if(!t)return;const e=this.state,i=t.frag;this.fragContextChanged(i)?(e===lf||!this.fragCurrent&&e===cf)&&(this.fragmentTracker.removeFragment(i),this.state=af):("payload"in t&&(this.log(`Loaded ${i.type} sn: ${i.sn} of ${this.playlistLabel()} ${i.level}`),this.hls.trigger(Ql.FRAG_LOADED,t)),this._handleFragmentLoadComplete(t))}).catch(e=>{this.state!==nf&&this.state!==gf&&(this.warn(`Frag error: ${(null==e?void 0:e.message)||e}`),this.resetFragmentLoading(t))})}clearTrackerIfNeeded(t){var e;const{fragmentTracker:i}=this;if(i.getState(t)===Ac){const e=t.type,s=this.getFwdBufferInfo(this.mediaBuffer,e),r=Math.max(t.duration,s?s.len:this.config.maxBufferLength),n=this.backtrackFragment;(1===(n?t.sn-n.sn:0)||this.reduceMaxBufferLength(r,t.duration))&&i.removeFragment(t)}else 0===(null==(e=this.mediaBuffer)?void 0:e.buffered.length)?i.removeAllFragments():i.hasParts(t.type)&&(i.detectPartialFragments({frag:t,part:null,stats:t.stats,id:t.type}),i.getState(t)===vc&&i.removeFragment(t))}checkLiveUpdate(t){if(t.updated&&!t.live){const e=t.fragments[t.fragments.length-1];this.fragmentTracker.detectPartialFragments({frag:e,part:null,stats:e.stats,id:e.type})}t.fragments[0]||(t.deltaUpdateFailed=!0)}waitForLive(t){const e=t.details;return(null==e?void 0:e.live)&&"EVENT"!==e.type&&(this.levelLastLoaded!==t||e.expired)}flushMainBuffer(t,e,i=null){if(!(t-e))return;const s={startOffset:t,endOffset:e,type:i};this.hls.trigger(Ql.BUFFER_FLUSHING,s)}_loadInitSegment(t,e){this._doFragLoad(t,e).then(t=>{const e=null==t?void 0:t.frag;if(!e||this.fragContextChanged(e)||!this.levels)throw new Error("init load aborted");return t}).then(t=>{const{hls:e}=this,{frag:i,payload:s}=t,r=i.decryptdata;if(s&&s.byteLength>0&&null!=r&&r.key&&r.iv&&Jc(r.method)){const n=self.performance.now();return this.decrypter.decrypt(new Uint8Array(s),r.key.buffer,r.iv.buffer,tu(r.method)).catch(t=>{throw e.trigger(Ql.ERROR,{type:Vl.MEDIA_ERROR,details:Gl.FRAG_DECRYPT_ERROR,fatal:!1,error:t,reason:t.message,frag:i}),t}).then(s=>{const r=self.performance.now();return e.trigger(Ql.FRAG_DECRYPTED,{frag:i,payload:s,stats:{tstart:n,tdecrypt:r}}),t.payload=s,this.completeInitSegmentLoad(t)})}return this.completeInitSegmentLoad(t)}).catch(e=>{this.state!==nf&&this.state!==gf&&(this.warn(e),this.resetFragmentLoading(t))})}completeInitSegmentLoad(t){const{levels:e}=this;if(!e)throw new Error("init load aborted, missing levels");const i=t.frag.stats;this.state!==nf&&(this.state=af),t.frag.data=new Uint8Array(t.payload),i.parsing.start=i.buffering.start=self.performance.now(),i.parsing.end=i.buffering.end=self.performance.now(),this.tick()}unhandledEncryptionError(t,e){var i,s;const r=t.tracks;if(r&&!e.encrypted&&(null!=(i=r.audio)&&i.encrypted||null!=(s=r.video)&&s.encrypted)&&(!this.config.emeEnabled||!this.keyLoader.emeController)){const t=this.media,i=new Error(`Encrypted track with no key in ${this.fragInfo(e)} (media ${t?"attached mediaKeys: "+t.mediaKeys:"detached"})`);return this.warn(i.message),!t||t.mediaKeys?!1:(this.hls.trigger(Ql.ERROR,{type:Vl.KEY_SYSTEM_ERROR,details:Gl.KEY_SYSTEM_NO_KEYS,fatal:!1,error:i,frag:e}),this.resetTransmuxer(),!0)}return!1}fragContextChanged(t){const{fragCurrent:e}=this;return!t||!e||t.sn!==e.sn||t.level!==e.level}fragBufferedComplete(t,e){const i=this.mediaBuffer?this.mediaBuffer:this.media;if(this.log(`Buffered ${t.type} sn: ${t.sn}${e?" part: "+e.index:""} of ${this.fragInfo(t,!1,e)} > buffer:${i?rf(_c.getBuffered(i)):"(detached)"})`),Cd(t)){var s;if(t.type!==Xl){const e=t.elementaryStreams;if(!Object.keys(e).some(t=>!!e[t]))return void(this.state=af)}const e=null==(s=this.levels)?void 0:s[t.level];null!=e&&e.fragmentError&&(this.log(`Resetting level fragment error count of ${e.fragmentError} on frag buffered`),e.fragmentError=0)}this.state=af}_handleFragmentLoadComplete(t){const{transmuxer:e}=this;if(!e)return;const{frag:i,part:s,partsLoaded:r}=t,n=!r||0===r.length||r.some(t=>!t),a=new Fc(i.level,i.sn,i.stats.chunkCount+1,0,s?s.index:-1,!n);e.flush(a)}_handleFragmentLoadProgress(t){}_doFragLoad(t,e,i=null,s){var r;this.fragCurrent=t;const n=e.details;if(!this.levels||!n)throw new Error(`frag load aborted, missing level${n?"":" detail"}s`);let a=null;if(!t.encrypted||null!=(r=t.decryptdata)&&r.key)t.encrypted||(a=this.keyLoader.loadClear(t,n.encryptedFragments,this.startFragRequested),a&&this.log("[eme] blocking frag load until media-keys acquired"));else if(this.log(`Loading key for ${t.sn} of [${n.startSN}-${n.endSN}], ${this.playlistLabel()} ${t.level}`),this.state=of,this.fragCurrent=t,a=this.keyLoader.load(t).then(t=>{if(!this.fragContextChanged(t.frag))return this.hls.trigger(Ql.KEY_LOADED,t),this.state===of&&(this.state=af),t}),this.hls.trigger(Ql.KEY_LOADING,{frag:t}),null===this.fragCurrent)return this.log("context changed in KEY_LOADING"),Promise.resolve(null);const o=this.fragPrevious;if(Cd(t)&&(!o||t.sn!==o.sn)){const i=this.shouldLoadParts(e.details,t.end);i!==this.loadingParts&&(this.log(`LL-Part loading ${i?"ON":"OFF"} loading sn ${null==o?void 0:o.sn}->${t.sn}`),this.loadingParts=i)}if(i=Math.max(t.start,i||0),this.loadingParts&&Cd(t)){const r=n.partList;if(r&&s){i>n.fragmentEnd&&n.fragmentHint&&(t=n.fragmentHint);const o=this.getNextPart(r,t,i);if(o>-1){const l=r[o];let d;return t=this.fragCurrent=l.fragment,this.log(`Loading ${t.type} sn: ${t.sn} part: ${l.index} (${o}/${r.length-1}) of ${this.fragInfo(t,!1,l)}) cc: ${t.cc} [${n.startSN}-${n.endSN}], target: ${parseFloat(i.toFixed(3))}`),this.nextLoadPosition=l.start+l.duration,this.state=lf,d=a?a.then(i=>!i||this.fragContextChanged(i.frag)?null:this.doFragPartsLoad(t,l,e,s)).catch(t=>this.handleFragLoadError(t)):this.doFragPartsLoad(t,l,e,s).catch(t=>this.handleFragLoadError(t)),this.hls.trigger(Ql.FRAG_LOADING,{frag:t,part:l,targetBufferTime:i}),null===this.fragCurrent?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):d}if(!t.url||this.loadedEndOfParts(r,i))return Promise.resolve(null)}}var l;if(Cd(t)&&this.loadingParts)this.log(`LL-Part loading OFF after next part miss @${i.toFixed(2)} Check buffer at sn: ${t.sn} loaded parts: ${null==(l=n.partList)?void 0:l.filter(t=>t.loaded).map(t=>`[${t.start}-${t.end}]`)}`),this.loadingParts=!1;else if(!t.url)return Promise.resolve(null);this.log(`Loading ${t.type} sn: ${t.sn} of ${this.fragInfo(t,!1)}) cc: ${t.cc} ${"["+n.startSN+"-"+n.endSN+"]"}, target: ${parseFloat(i.toFixed(3))}`),Ul(t.sn)&&!this.bitrateTest&&(this.nextLoadPosition=t.start+t.duration),this.state=lf;const d=this.config.progressive&&t.type!==Xl;let h;return h=d&&a?a.then(e=>!e||this.fragContextChanged(e.frag)?null:this.fragmentLoader.load(t,s)).catch(t=>this.handleFragLoadError(t)):Promise.all([this.fragmentLoader.load(t,d?s:void 0),a]).then(([t])=>(!d&&s&&s(t),t)).catch(t=>this.handleFragLoadError(t)),this.hls.trigger(Ql.FRAG_LOADING,{frag:t,targetBufferTime:i}),null===this.fragCurrent?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):h}doFragPartsLoad(t,e,i,s){return new Promise((r,n)=>{var a;const o=[],l=null==(a=i.details)?void 0:a.partList,d=e=>{this.fragmentLoader.loadPart(t,e,s).then(s=>{o[e.index]=s;const n=s.part;this.hls.trigger(Ql.FRAG_LOADED,s);const a=Ku(i.details,t.sn,e.index+1)||qu(l,t.sn,e.index+1);if(!a)return r({frag:t,part:n,partsLoaded:o});d(a)}).catch(n)};d(e)})}handleFragLoadError(t){if("data"in t){const e=t.data;e.frag&&e.details===Gl.INTERNAL_ABORTED?this.handleFragLoadAborted(e.frag,e.part):e.frag&&e.type===Vl.KEY_SYSTEM_ERROR?(e.frag.abortRequests(),this.resetStartWhenNotLoaded(),this.resetFragmentLoading(e.frag)):this.hls.trigger(Ql.ERROR,e)}else this.hls.trigger(Ql.ERROR,{type:Vl.OTHER_ERROR,details:Gl.INTERNAL_EXCEPTION,err:t,error:t,fatal:!0});return null}_handleTransmuxerFlush(t){const e=this.getCurrentContext(t);if(!e||this.state!==cf)return void(this.fragCurrent||this.state===nf||this.state===gf||(this.state=af));const{frag:i,part:s,level:r}=e,n=self.performance.now();i.stats.parsing.end=n,s&&(s.stats.parsing.end=n);const a=this.getLevelDetails(),o=a&&i.sn>a.endSN||this.shouldLoadParts(a,i.end);o!==this.loadingParts&&(this.log(`LL-Part loading ${o?"ON":"OFF"} after parsing segment ending @${i.end.toFixed(2)}`),this.loadingParts=o),this.updateLevelTiming(i,s,r,t.partial)}shouldLoadParts(t,e){if(this.config.lowLatencyMode){if(!t)return this.loadingParts;if(t.partList){var i;const r=t.partList[0];if(r.fragment.type===Xl)return!1;if(e>=r.end+((null==(i=t.fragmentHint)?void 0:i.duration)||0)){var s;if((this.hls.hasEnoughToStart?(null==(s=this.media)?void 0:s.currentTime)||this.lastCurrentTime:this.getLoadPosition())>r.start-r.fragment.duration)return!0}}}return!1}getCurrentContext(t){const{levels:e,fragCurrent:i}=this,{level:s,sn:r,part:n}=t;if(null==e||!e[s])return this.warn(`Levels object was unset while buffering fragment ${r} of ${this.playlistLabel()} ${s}. The current chunk will not be buffered.`),null;const a=e[s],o=a.details,l=n>-1?Ku(o,r,n):null,d=l?l.fragment:Qu(o,r,i);return d?(i&&i!==d&&(d.stats=i.stats),{frag:d,part:l,level:a}):null}bufferFragmentData(t,e,i,s,r){if(this.state!==cf)return;const{data1:n,data2:a}=t;let o=n;if(a&&(o=Zd(n,a)),!o.length)return;const l=this.initPTS[e.cc],d=l?-l.baseTime/l.timescale:void 0,h={type:t.type,frag:e,part:i,chunkMeta:s,offset:d,parent:e.type,data:o};if(this.hls.trigger(Ql.BUFFER_APPENDING,h),t.dropped&&t.independent&&!i){if(r)return;this.flushBufferGap(e)}}flushBufferGap(t){const e=this.media;if(!e)return;if(!_c.isBuffered(e,e.currentTime))return void this.flushMainBuffer(0,t.start);const i=e.currentTime,s=_c.bufferInfo(e,i,0),r=t.duration,n=Math.min(2*this.config.maxFragLookUpTolerance,.25*r),a=Math.max(Math.min(t.start-n,s.end-n),i+n);t.start-a>n&&this.flushMainBuffer(a,t.start)}getFwdBufferInfo(t,e){var i;const s=this.getLoadPosition();if(!Ul(s))return null;const r=this.lastCurrentTime>s||null!=(i=this.media)&&i.paused?0:this.config.maxBufferHole;return this.getFwdBufferInfoAtPos(t,s,e,r)}getFwdBufferInfoAtPos(t,e,i,s){const r=_c.bufferInfo(t,e,s);if(0===r.len&&void 0!==r.nextStart){const n=this.fragmentTracker.getBufferedFrag(e,i);if(n&&(r.nextStart<=n.end||n.gap)){const i=Math.max(Math.min(r.nextStart,n.end)-e,s);return _c.bufferInfo(t,e,i)}}return r}getMaxBufferLength(t){const{config:e}=this;let i;return i=t?Math.max(8*e.maxBufferSize/t,e.maxBufferLength):e.maxBufferLength,Math.min(i,e.maxMaxBufferLength)}reduceMaxBufferLength(t,e){const i=this.config,s=Math.max(Math.min(t-e,i.maxBufferLength),e),r=Math.max(t-3*e,i.maxMaxBufferLength/2,s);return r>=s&&(i.maxMaxBufferLength=r,this.warn(`Reduce max buffer length to ${r}s`),!0)}getAppendedFrag(t,e=$l){const i=this.fragmentTracker?this.fragmentTracker.getAppendedFrag(t,e):null;return i&&"fragment"in i?i.fragment:i}getNextFragment(t,e){const i=e.fragments,s=i.length;if(!s)return null;const{config:r}=this,n=i[0].start,a=r.lowLatencyMode&&!!e.partList;let o=null;if(e.live){const i=r.initialLiveManifestSize;if(s<i)return this.warn(`Not enough fragments to start playback (have: ${s}, need: ${i})`),null;if(!e.PTSKnown&&!this.startFragRequested&&-1===this.startPosition||t<n){var l;a&&!this.loadingParts&&(this.log("LL-Part loading ON for initial live fragment"),this.loadingParts=!0),o=this.getInitialLiveFragment(e);const i=this.hls.startPosition,s=this.hls.liveSyncPosition,r=o?(-1!==i&&i>=n?i:s)||o.start:t;this.log(`Setting startPosition to ${r} to match start frag at live edge. mainStart: ${i} liveSyncPosition: ${s} frag.start: ${null==(l=o)?void 0:l.start}`),this.startPosition=this.nextLoadPosition=r}}else t<=n&&(o=i[0]);if(!o){const i=this.loadingParts?e.partEnd:e.fragmentEnd;o=this.getFragmentAtPosition(t,i,e)}let d=this.filterReplacedPrimary(o,e);if(!d&&o){const t=o.sn-e.startSN;d=this.filterReplacedPrimary(i[t+1]||null,e)}return this.mapToInitFragWhenRequired(d)}isLoopLoading(t,e){const i=this.fragmentTracker.getState(t);return(i===yc||i===vc&&!!t.gap)&&this.nextLoadPosition>e}getNextFragmentLoopLoading(t,e,i,s,r){let n=null;if(t.gap&&(n=this.getNextFragment(this.nextLoadPosition,e),n&&!n.gap&&i.nextStart)){const t=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,i.nextStart,s,0);if(null!==t&&i.len+t.len>=r){const t=n.sn;return this.loopSn!==t&&(this.log(`buffer full after gaps in "${s}" playlist starting at sn: ${t}`),this.loopSn=t),null}}return this.loopSn=void 0,n}get primaryPrefetch(){if(vf(this.config)){var t;if(null==(t=this.hls.interstitialsManager)||null==(t=t.playingItem)?void 0:t.event)return!0}return!1}filterReplacedPrimary(t,e){if(!t)return t;if(vf(this.config)&&t.type!==Xl){const i=this.hls.interstitialsManager,s=null==i?void 0:i.bufferingItem;if(s){const i=s.event;if(i){if(i.appendInPlace||Math.abs(t.start-s.start)>1||0===s.start)return null}else{if(t.end<=s.start&&!1===(null==e?void 0:e.live))return null;if(t.start>s.end&&s.nextEvent&&(s.nextEvent.appendInPlace||t.start-s.end>1))return null}}const r=null==i?void 0:i.playerQueue;if(r)for(let e=r.length;e--;){const i=r[e].interstitial;if(i.appendInPlace&&t.start>=i.startTime&&t.end<=i.resumeTime)return null}}return t}mapToInitFragWhenRequired(t){return null==t||!t.initSegment||t.initSegment.data||this.bitrateTest?t:t.initSegment}getNextPart(t,e,i){let s=-1,r=!1,n=!0;for(let a=0,o=t.length;a<o;a++){const o=t[a];if(n=n&&!o.independent,s>-1&&i<o.start)break;const l=o.loaded;l?s=-1:(r||(o.independent||n)&&o.fragment===e)&&(o.fragment!==e&&this.warn(`Need buffer at ${i} but next unloaded part starts at ${o.start}`),s=a),r=l}return s}loadedEndOfParts(t,e){let i;for(let s=t.length;s--;){if(i=t[s],!i.loaded)return!1;if(e>i.start)return!0}return!1}getInitialLiveFragment(t){const e=t.fragments,i=this.fragPrevious;let s=null;if(i){if(t.hasProgramDateTime&&(this.log(`Live playlist, switching playlist, load frag with same PDT: ${i.programDateTime}`),s=function(t,e,i){if(null===e||!Array.isArray(t)||!t.length||!Ul(e))return null;if(e<(t[0].programDateTime||0))return null;if(e>=(t[t.length-1].endProgramDateTime||0))return null;for(let s=0;s<t.length;++s){const r=t[s];if(Xh(e,i,r))return r}return null}(e,i.endProgramDateTime,this.config.maxFragLookUpTolerance)),!s){const r=i.sn+1;if(r>=t.startSN&&r<=t.endSN){const n=e[r-t.startSN];i.cc===n.cc&&(s=n,this.log(`Live playlist, switching playlist, load frag with next SN: ${s.sn}`))}s||(s=Zh(t,i.cc,i.end),s&&this.log(`Live playlist, switching playlist, load frag with same CC: ${s.sn}`))}}else{const e=this.hls.liveSyncPosition;null!==e&&(s=this.getFragmentAtPosition(e,this.bitrateTest?t.fragmentEnd:t.edge,t))}return s}getFragmentAtPosition(t,e,i){const{config:s}=this;let{fragPrevious:r}=this,{fragments:n,endSN:a}=i;const{fragmentHint:o}=i,{maxFragLookUpTolerance:l}=s,d=i.partList,h=!!(this.loadingParts&&null!=d&&d.length&&o);let c;if(h&&!this.bitrateTest&&d[d.length-1].fragment.sn===o.sn&&(n=n.concat(o),a=o.sn),t<e){var u;c=$h(r,n,t,t<this.lastCurrentTime||t>e-l||null!=(u=this.media)&&u.paused||!this.startFragRequested?0:l)}else c=n[n.length-1];if(c){const t=c.sn-i.startSN,e=this.fragmentTracker.getState(c);if((e===yc||e===vc&&c.gap)&&(r=c),r&&c.sn===r.sn&&(!h||d[0].fragment.sn>c.sn||!i.live)){if(c.level===r.level){const e=n[t+1];c=c.sn<a&&this.fragmentTracker.getState(e)!==yc?e:null}}}return c}alignPlaylists(t,e,i){const s=t.fragments.length;if(!s)return this.warn("No fragments in live playlist"),0;const r=t.fragmentStart,n=!e,a=t.alignedSliding&&Ul(r);if(n||!a&&!r){!function(t,e){t&&(Ju(e,t),e.alignedSliding||tf(e,t),e.alignedSliding||e.skippedSegments||ju(t,e,!1))}(i,t);const r=t.fragmentStart;return this.log(`Live playlist sliding: ${r.toFixed(2)} start-sn: ${e?e.startSN:"na"}->${t.startSN} fragments: ${s}`),r}return r}waitForCdnTuneIn(t){return t.live&&t.canBlockReload&&t.partTarget&&t.tuneInGoal>Math.max(t.partHoldBack,3*t.partTarget)}setStartPosition(t,e){let i=this.startPosition;i<e&&(i=-1);const s=this.timelineOffset;if(-1===i){const r=null!==this.startTimeOffset,n=r?this.startTimeOffset:t.startTimeOffset;null!==n&&Ul(n)?(i=e+n,n<0&&(i+=t.edge),i=Math.min(Math.max(e,i),e+t.totalduration),this.log(`Setting startPosition to ${i} for start time offset ${n} found in ${r?"multivariant":"media"} playlist`),this.startPosition=i):t.live?(i=this.hls.liveSyncPosition||e,this.log(`Setting startPosition to -1 to start at live edge ${i}`),this.startPosition=-1):(this.log("setting startPosition to 0 by default"),this.startPosition=i=0),this.lastCurrentTime=i+s}this.nextLoadPosition=i+s}getLoadPosition(){var t;const{media:e}=this;let i=0;return null!=(t=this.hls)&&t.hasEnoughToStart&&e?i=e.currentTime:this.nextLoadPosition>=0&&(i=this.nextLoadPosition),i}handleFragLoadAborted(t,e){this.transmuxer&&t.type===this.playlistType&&Cd(t)&&t.stats.aborted&&(this.log(`Fragment ${t.sn}${e?" part "+e.index:""} of ${this.playlistLabel()} ${t.level} was aborted`),this.resetFragmentLoading(t))}resetFragmentLoading(t){this.fragCurrent&&(this.fragContextChanged(t)||this.state===df)||(this.state=af)}onFragmentOrKeyLoadError(t,e){var i;if(e.chunkMeta&&!e.frag){const t=this.getCurrentContext(e.chunkMeta);t&&(e.frag=t.frag)}const s=e.frag;if(!s||s.type!==t||!this.levels)return;var r;if(this.fragContextChanged(s))return void this.warn(`Frag load error must match current frag to retry ${s.url} > ${null==(r=this.fragCurrent)?void 0:r.url}`);const n=e.details===Gl.FRAG_GAP;n&&this.fragmentTracker.fragBuffered(s,!0);const a=e.errorAction;if(!a)return void(this.state=gf);const{action:o,flags:l,retryCount:d=0,retryConfig:h}=a,c=!!h,u=c&&o===hc,f=c&&!a.resolved&&l===uc,g=null==(i=this.hls.latestLevelDetails)?void 0:i.live;if(!u&&f&&Cd(s)&&!s.endList&&g&&!ec(e))this.resetFragmentErrors(t),this.treatAsGap(s),a.resolved=!0;else if((u||f)&&d<h.maxNumRetry){var m;const i=ac(null==(m=e.response)?void 0:m.code),r=sc(h,d);if(this.resetStartWhenNotLoaded(),this.retryDate=self.performance.now()+r,this.state=df,a.resolved=!0,i)return this.log("Waiting for connection (offline)"),this.retryDate=1/0,void(e.reason="offline");this.warn(`Fragment ${s.sn} of ${t} ${s.level} errored with ${e.details}, retrying loading ${d+1}/${h.maxNumRetry} in ${r}ms`)}else if(h){if(this.resetFragmentErrors(t),!(d<h.maxNumRetry))return void this.warn(`${e.details} reached or exceeded max retry (${d})`);n||o===dc||(a.resolved=!0)}else this.state=o===lc?pf:gf;this.tickImmediate()}checkRetryDate(){const t=self.performance.now(),e=this.retryDate,i=e===1/0;(!e||t>=e||i&&!ac(0))&&(i&&this.log("Connection restored (online)"),this.resetStartWhenNotLoaded(),this.state=af)}reduceLengthAndFlushBuffer(t){if(this.state===cf||this.state===uf){const e=t.frag,i=t.parent,s=this.getFwdBufferInfo(this.mediaBuffer,i),r=s&&s.len>.5;r&&this.reduceMaxBufferLength(s.len,(null==e?void 0:e.duration)||10);const n=!r;return n&&this.warn(`Buffer full error while media.currentTime (${this.getLoadPosition()}) is not buffered, flush ${i} buffer`),e&&(this.fragmentTracker.removeFragment(e),this.nextLoadPosition=e.start),this.resetLoadingState(),n}return!1}resetFragmentErrors(t){t===zl&&(this.fragCurrent=null),this.hls.hasEnoughToStart||(this.startFragRequested=!1),this.state!==nf&&(this.state=af)}afterBufferFlushed(t,e,i){if(!t)return;const s=_c.getBuffered(t);this.fragmentTracker.detectEvictedFragments(e,s,i),this.state===ff&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state!==nf&&(this.state=af)}resetStartWhenNotLoaded(){if(!this.hls.hasEnoughToStart){this.startFragRequested=!1;const t=this.levelLastLoaded,e=t?t.details:null;null!=e&&e.live?(this.log("resetting startPosition for live start"),this.startPosition=-1,this.setStartPosition(e,e.fragmentStart),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}}resetWhenMissingContext(t){this.log(`Loading context changed while buffering sn ${t.sn} of ${this.playlistLabel()} ${-1===t.level?"<removed>":t.level}. This chunk will not be buffered.`),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded(),this.resetLoadingState()}removeUnbufferedFrags(t=0){this.fragmentTracker.removeFragmentsInRange(t,1/0,this.playlistType,!1,!0)}updateLevelTiming(t,e,i,s){const r=i.details;if(!r)return void this.warn("level.details undefined");if(!Object.keys(t.elementaryStreams).reduce((e,n)=>{const a=t.elementaryStreams[n];if(a){const o=a.endPTS-a.startPTS;if(o<=0)return this.warn(`Could not parse fragment ${t.sn} ${n} duration reliably (${o})`),e||!1;const l=s?0:_u(r,t,a.startPTS,a.endPTS,a.startDTS,a.endDTS,this);return this.hls.trigger(Ql.LEVEL_PTS_UPDATED,{details:r,level:i,drift:l,type:n,frag:t,start:a.startPTS,end:a.endPTS}),!0}return e},!1)){var n;const e=null===(null==(n=this.transmuxer)?void 0:n.error);if((0===i.fragmentError||e&&(i.fragmentError<2||t.endList))&&this.treatAsGap(t,i),e){const e=new Error(`Found no media in fragment ${t.sn} of ${this.playlistLabel()} ${t.level} resetting transmuxer to fallback to playlist timing`);if(this.warn(e.message),this.hls.trigger(Ql.ERROR,{type:Vl.MEDIA_ERROR,details:Gl.FRAG_PARSING_ERROR,fatal:!1,error:e,frag:t,reason:`Found no media in msn ${t.sn} of ${this.playlistLabel()} "${i.url}"`}),!this.hls)return;this.resetTransmuxer()}}this.state=uf,this.log(`Parsed ${t.type} sn: ${t.sn}${e?" part: "+e.index:""} of ${this.fragInfo(t,!1,e)})`),this.hls.trigger(Ql.FRAG_PARSED,{frag:t,part:e})}playlistLabel(){return this.playlistType===$l?"level":"track"}fragInfo(t,e=!0,i){var s,r;return`${this.playlistLabel()} ${t.level} (${i?"part":"frag"}:[${(null!=(s=e&&!i?t.startPTS:(i||t).start)?s:NaN).toFixed(3)}-${(null!=(r=e&&!i?t.endPTS:(i||t).end)?r:NaN).toFixed(3)}]${i&&"main"===t.type?"INDEPENDENT="+(i.independent?"YES":"NO"):""}`}treatAsGap(t,e){e&&e.fragmentError++,t.gap=!0,this.fragmentTracker.removeFragment(t),this.fragmentTracker.fragBuffered(t,!0)}resetTransmuxer(){var t;null==(t=this.transmuxer)||t.reset()}recoverWorkerError(t){"demuxerWorker"===t.event&&(this.fragmentTracker.removeAllFragments(),this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null),this.resetStartWhenNotLoaded(),this.resetLoadingState())}set state(t){const e=this._state;e!==t&&(this._state=t,this.log(`${e}->${t}`))}get state(){return this._state}}function vf(t){return!!t.interstitialsController&&!1!==t.enableInterstitialPlayback}class yf{constructor(){this.chunks=[],this.dataLength=0}push(t){this.chunks.push(t),this.dataLength+=t.length}flush(){const{chunks:t,dataLength:e}=this;let i;return t.length?(i=1===t.length?t[0]:function(t,e){const i=new Uint8Array(e);let s=0;for(let r=0;r<t.length;r++){const e=t[r];i.set(e,s),s+=e.length}return i}(t,e),this.reset(),i):new Uint8Array(0)}reset(){this.chunks.length=0,this.dataLength=0}}var Ef,Tf={exports:{}};var Sf=(Ef||(Ef=1,function(t){var e=Object.prototype.hasOwnProperty,i="~";function s(){}function r(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function n(t,e,s,n,a){if("function"!=typeof s)throw new TypeError("The listener must be a function");var o=new r(s,n||t,a),l=i?i+e:e;return t._events[l]?t._events[l].fn?t._events[l]=[t._events[l],o]:t._events[l].push(o):(t._events[l]=o,t._eventsCount++),t}function a(t,e){0===--t._eventsCount?t._events=new s:delete t._events[e]}function o(){this._events=new s,this._eventsCount=0}Object.create&&(s.prototype=Object.create(null),(new s).__proto__||(i=!1)),o.prototype.eventNames=function(){var t,s,r=[];if(0===this._eventsCount)return r;for(s in t=this._events)e.call(t,s)&&r.push(i?s.slice(1):s);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},o.prototype.listeners=function(t){var e=i?i+t:t,s=this._events[e];if(!s)return[];if(s.fn)return[s.fn];for(var r=0,n=s.length,a=new Array(n);r<n;r++)a[r]=s[r].fn;return a},o.prototype.listenerCount=function(t){var e=i?i+t:t,s=this._events[e];return s?s.fn?1:s.length:0},o.prototype.emit=function(t,e,s,r,n,a){var o=i?i+t:t;if(!this._events[o])return!1;var l,d,h=this._events[o],c=arguments.length;if(h.fn){switch(h.once&&this.removeListener(t,h.fn,void 0,!0),c){case 1:return h.fn.call(h.context),!0;case 2:return h.fn.call(h.context,e),!0;case 3:return h.fn.call(h.context,e,s),!0;case 4:return h.fn.call(h.context,e,s,r),!0;case 5:return h.fn.call(h.context,e,s,r,n),!0;case 6:return h.fn.call(h.context,e,s,r,n,a),!0}for(d=1,l=new Array(c-1);d<c;d++)l[d-1]=arguments[d];h.fn.apply(h.context,l)}else{var u,f=h.length;for(d=0;d<f;d++)switch(h[d].once&&this.removeListener(t,h[d].fn,void 0,!0),c){case 1:h[d].fn.call(h[d].context);break;case 2:h[d].fn.call(h[d].context,e);break;case 3:h[d].fn.call(h[d].context,e,s);break;case 4:h[d].fn.call(h[d].context,e,s,r);break;default:if(!l)for(u=1,l=new Array(c-1);u<c;u++)l[u-1]=arguments[u];h[d].fn.apply(h[d].context,l)}}return!0},o.prototype.on=function(t,e,i){return n(this,t,e,i,!1)},o.prototype.once=function(t,e,i){return n(this,t,e,i,!0)},o.prototype.removeListener=function(t,e,s,r){var n=i?i+t:t;if(!this._events[n])return this;if(!e)return a(this,n),this;var o=this._events[n];if(o.fn)o.fn!==e||r&&!o.once||s&&o.context!==s||a(this,n);else{for(var l=0,d=[],h=o.length;l<h;l++)(o[l].fn!==e||r&&!o[l].once||s&&o[l].context!==s)&&d.push(o[l]);d.length?this._events[n]=1===d.length?d[0]:d:a(this,n)}return this},o.prototype.removeAllListeners=function(t){var e;return t?(e=i?i+t:t,this._events[e]&&a(this,e)):(this._events=new s,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=i,o.EventEmitter=o,t.exports=o}(Tf)),Tf.exports),bf=pd(Sf);const If="1.6.15",Lf={};function Rf(t,e){return e+10<=t.length&&51===t[e]&&68===t[e+1]&&73===t[e+2]&&t[e+3]<255&&t[e+4]<255&&t[e+6]<128&&t[e+7]<128&&t[e+8]<128&&t[e+9]<128}function kf(t,e){return e+10<=t.length&&73===t[e]&&68===t[e+1]&&51===t[e+2]&&t[e+3]<255&&t[e+4]<255&&t[e+6]<128&&t[e+7]<128&&t[e+8]<128&&t[e+9]<128}function wf(t,e){let i=0;return i=(127&t[e])<<21,i|=(127&t[e+1])<<14,i|=(127&t[e+2])<<7,i|=127&t[e+3],i}function Df(t,e){const i=e;let s=0;for(;kf(t,e);){s+=10;s+=wf(t,e+6),Rf(t,e+10)&&(s+=10),e+=s}if(s>0)return t.subarray(i,i+s)}function Cf(t,e){return 255===t[e]&&240==(246&t[e+1])}function xf(t,e){return 1&t[e+1]?7:9}function Pf(t,e){return(3&t[e+3])<<11|t[e+4]<<3|(224&t[e+5])>>>5}function Mf(t,e){return e+1<t.length&&Cf(t,e)}function Of(t,e){if(Mf(t,e)){const i=xf(t,e);if(e+i>=t.length)return!1;const s=Pf(t,e);if(s<=i)return!1;const r=e+s;return r===t.length||Mf(t,r)}return!1}function Bf(t,e,i,s,r){if(!t.samplerate){const n=function(t,e,i,s){const r=e[i+2],n=r>>2&15;if(n>12){const e=new Error(`invalid ADTS sampling index:${n}`);return void t.emit(Ql.ERROR,Ql.ERROR,{type:Vl.MEDIA_ERROR,details:Gl.FRAG_PARSING_ERROR,fatal:!0,error:e,reason:e.message})}const a=1+(r>>6&3),o=e[i+3]>>6&3|(1&r)<<2,l="mp4a.40."+a,d=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350][n];let h=n;5!==a&&29!==a||(h-=3);const c=[a<<3|(14&h)>>1,(1&h)<<7|o<<3];return hd.log(`manifest codec:${s}, parsed codec:${l}, channels:${o}, rate:${d} (ADTS object type:${a} sampling index:${n})`),{config:c,samplerate:d,channelCount:o,codec:l,parsedCodec:l,manifestCodec:s}}(e,i,s,r);if(!n)return;ed(t,n)}}function Ff(t){return 9216e4/t}function Nf(t,e,i,s,r){const n=s+r*Ff(t.samplerate),a=function(t,e){const i=xf(t,e);if(e+i<=t.length){const s=Pf(t,e)-i;if(s>0)return{headerLength:i,frameLength:s}}}(e,i);let o;if(a){const{frameLength:s,headerLength:r}=a,l=r+s,d=Math.max(0,i+l-e.length);d?(o=new Uint8Array(l-r),o.set(e.subarray(i+r,e.length),0)):o=e.subarray(i+r,i+l);const h={unit:o,pts:n};return d||t.samples.push(h),{sample:h,length:l,missing:d}}const l=e.length-i;o=new Uint8Array(l),o.set(e.subarray(i,e.length),0);return{sample:{unit:o,pts:n},length:l,missing:-1}}function _f(t,e){return kf(t,e)&&wf(t,e+6)+10<=t.length-e}function Uf(t,e=0,i=1/0){return function(t,e,i,s){const r=(n=t,n instanceof ArrayBuffer?n:n.buffer);var n;let a=1;"BYTES_PER_ELEMENT"in s&&(a=s.BYTES_PER_ELEMENT);const o=(u=t,u&&u.buffer instanceof ArrayBuffer&&void 0!==u.byteLength&&void 0!==u.byteOffset?t.byteOffset:0),l=(o+t.byteLength)/a,d=(o+e)/a,h=Math.floor(Math.max(0,Math.min(d,l))),c=Math.floor(Math.min(h+Math.max(i,0),l));var u;return new s(r,h,c-h)}(t,e,i,Uint8Array)}function Hf(t){const e={key:t.type,description:"",data:"",mimeType:null,pictureType:null};if(t.size<2)return;if(3!==t.data[0])return;const i=t.data.subarray(1).indexOf(0);if(-1===i)return;const s=fd(Uf(t.data,1,i)),r=t.data[2+i],n=t.data.subarray(3+i).indexOf(0);if(-1===n)return;const a=fd(Uf(t.data,3+i,n));let o;var l;return o="--\x3e"===s?fd(Uf(t.data,4+i+n)):(l=t.data.subarray(4+i+n))instanceof ArrayBuffer?l:0==l.byteOffset&&l.byteLength==l.buffer.byteLength?l.buffer:new Uint8Array(l).buffer,e.mimeType=s,e.pictureType=r,e.description=a,e.data=o,e}function jf(t){return"PRIV"===t.type?function(t){if(t.size<2)return;const e=fd(t.data,!0),i=new Uint8Array(t.data.subarray(e.length+1));return{key:t.type,info:e,data:i.buffer}}(t):"W"===t.type[0]?function(t){if("WXXX"===t.type){if(t.size<2)return;let e=1;const i=fd(t.data.subarray(e),!0);e+=i.length+1;const s=fd(t.data.subarray(e));return{key:t.type,info:i,data:s}}const e=fd(t.data);return{key:t.type,info:"",data:e}}(t):"APIC"===t.type?Hf(t):function(t){if(t.size<2)return;if("TXXX"===t.type){let e=1;const i=fd(t.data.subarray(e),!0);e+=i.length+1;const s=fd(t.data.subarray(e));return{key:t.type,info:i,data:s}}const e=fd(t.data.subarray(1));return{key:t.type,info:"",data:e}}(t)}function Vf(t){const e=String.fromCharCode(t[0],t[1],t[2],t[3]),i=wf(t,4);return{type:e,size:i,data:t.subarray(10,10+i)}}function Gf(t){let e=0;const i=[];for(;kf(t,e);){const s=wf(t,e+6);t[e+5]>>6&1&&(e+=10),e+=10;const r=e+s;for(;e+10<r;){const s=Vf(t.subarray(e)),r=jf(s);r&&i.push(r),e+=s.size+10}Rf(t,e)&&(e+=10)}return i}function Qf(t){return t&&"PRIV"===t.key&&"com.apple.streaming.transportStreamTimestamp"===t.info}function Kf(t){if(8===t.data.byteLength){const e=new Uint8Array(t.data),i=1&e[3];let s=(e[4]<<23)+(e[5]<<15)+(e[6]<<7)+e[7];return s/=45,i&&(s+=47721858.84),Math.round(s)}}function qf(t){const e=Gf(t);for(let i=0;i<e.length;i++){const t=e[i];if(Qf(t))return Kf(t)}}let Wf=function(t){return t.audioId3="org.id3",t.dateRange="com.apple.quicktime.HLS",t.emsg="https://aomedia.org/emsg/ID3",t.misbklv="urn:misb:KLV:bin:1910.1",t}({});function Yf(t="",e=9e4){return{type:t,id:-1,pid:-1,inputTimeScale:e,sequenceNumber:-1,samples:[],dropped:0}}class $f{constructor(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.basePTS=null,this.initPTS=null,this.lastPTS=null}resetInitSegment(t,e,i,s){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}}resetTimeStamp(t){this.initPTS=t,this.resetContiguity()}resetContiguity(){this.basePTS=null,this.lastPTS=null,this.frameIndex=0}canParse(t,e){return!1}appendFrame(t,e,i){}demux(t,e){this.cachedData&&(t=Zd(this.cachedData,t),this.cachedData=null);let i,s=Df(t,0),r=s?s.length:0;const n=this._audioTrack,a=this._id3Track,o=s?qf(s):void 0,l=t.length;for((null===this.basePTS||0===this.frameIndex&&Ul(o))&&(this.basePTS=zf(o,e,this.initPTS),this.lastPTS=this.basePTS),null===this.lastPTS&&(this.lastPTS=this.basePTS),s&&s.length>0&&a.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:s,type:Wf.audioId3,duration:Number.POSITIVE_INFINITY});r<l;){if(this.canParse(t,r)){const e=this.appendFrame(n,t,r);e?(this.frameIndex++,this.lastPTS=e.sample.pts,r+=e.length,i=r):r=l}else _f(t,r)?(s=Df(t,r),a.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:s,type:Wf.audioId3,duration:Number.POSITIVE_INFINITY}),r+=s.length,i=r):r++;if(r===l&&i!==l){const e=t.slice(i);this.cachedData?this.cachedData=Zd(this.cachedData,e):this.cachedData=e}}return{audioTrack:n,videoTrack:Yf(),id3Track:a,textTrack:Yf()}}demuxSampleAes(t,e,i){return Promise.reject(new Error(`[${this}] This demuxer does not support Sample-AES decryption`))}flush(t){const e=this.cachedData;return e&&(this.cachedData=null,this.demux(e,0)),{audioTrack:this._audioTrack,videoTrack:Yf(),id3Track:this._id3Track,textTrack:Yf()}}destroy(){this.cachedData=null,this._audioTrack=this._id3Track=void 0}}const zf=(t,e,i)=>{if(Ul(t))return 90*t;return 9e4*e+(i?9e4*i.baseTime/i.timescale:0)};let Xf=null;const Zf=[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],Jf=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],tg=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],eg=[0,1,1,4];function ig(t,e,i,s,r){if(i+24>e.length)return;const n=sg(e,i);if(n&&i+n.frameLength<=e.length){const a=s+r*(9e4*n.samplesPerFrame/n.sampleRate),o={unit:e.subarray(i,i+n.frameLength),pts:a,dts:a};return t.config=[],t.channelCount=n.channelCount,t.samplerate=n.sampleRate,t.samples.push(o),{sample:o,length:n.frameLength,missing:0}}}function sg(t,e){const i=t[e+1]>>3&3,s=t[e+1]>>1&3,r=t[e+2]>>4&15,n=t[e+2]>>2&3;if(1!==i&&0!==r&&15!==r&&3!==n){const a=t[e+2]>>1&1,o=t[e+3]>>6,l=1e3*Zf[14*(3===i?3-s:3===s?3:4)+r-1],d=Jf[3*(3===i?0:2===i?1:2)+n],h=3===o?1:2,c=tg[i][s],u=eg[s],f=8*c*u,g=Math.floor(c*l/d+a)*u;if(null===Xf){const t=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Xf=t?parseInt(t[1]):0}return!!Xf&&Xf<=87&&2===s&&l>=224e3&&0===o&&(t[e+3]=128|t[e+3]),{sampleRate:d,channelCount:h,frameLength:g,samplesPerFrame:f}}}function rg(t,e){return!(255!==t[e]||224&~t[e+1]||!(6&t[e+1]))}function ng(t,e){return e+1<t.length&&rg(t,e)}function ag(t,e){if(e+1<t.length&&rg(t,e)){const i=4,s=sg(t,e);let r=i;null!=s&&s.frameLength&&(r=s.frameLength);const n=e+r;return n===t.length||ng(t,n)}return!1}const og=(t,e)=>{let i=0,s=5;e+=s;const r=new Uint32Array(1),n=new Uint32Array(1),a=new Uint8Array(1);for(;s>0;){a[0]=t[e];const o=Math.min(s,8),l=8-o;n[0]=4278190080>>>24+l<<l,r[0]=(a[0]&n[0])>>l,i=i?i<<o|r[0]:r[0],e+=1,s-=o}return i};class lg extends $f{constructor(t){super(),this.observer=void 0,this.observer=t}resetInitSegment(t,e,i,s){super.resetInitSegment(t,e,i,s),this._audioTrack={container:"audio/ac-3",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"ac3",samples:[],manifestCodec:e,duration:s,inputTimeScale:9e4,dropped:0}}canParse(t,e){return e+64<t.length}appendFrame(t,e,i){const s=dg(t,e,i,this.basePTS,this.frameIndex);if(-1!==s){return{sample:t.samples[t.samples.length-1],length:s,missing:0}}}static probe(t){if(!t)return!1;const e=Df(t,0);if(!e)return!1;const i=e.length;return 11===t[i]&&119===t[i+1]&&void 0!==qf(e)&&og(t,i)<16}}function dg(t,e,i,s,r){if(i+8>e.length)return-1;if(11!==e[i]||119!==e[i+1])return-1;const n=e[i+4]>>6;if(n>=3)return-1;const a=[48e3,44100,32e3][n],o=63&e[i+4],l=2*[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][3*o+n];if(i+l>e.length)return-1;const d=e[i+6]>>5;let h=0;2===d?h+=2:(1&d&&1!==d&&(h+=2),4&d&&(h+=2));const c=(e[i+6]<<8|e[i+7])>>12-h&1,u=[2,1,2,3,3,4,4,5][d]+c,f=e[i+5]>>3,g=7&e[i+5],m=new Uint8Array([n<<6|f<<1|g>>2,(3&g)<<6|d<<3|c<<2|o>>4,o<<4&224]),p=s+r*(1536/a*9e4),A=e.subarray(i,i+l);return t.config=m,t.channelCount=u,t.samplerate=a,t.samples.push({unit:A,pts:p}),l}const hg=/\/emsg[-/]ID3/i;function cg(t,e){return Ul(t.presentationTime)?t.presentationTime/t.timeScale:e+t.presentationTimeDelta/t.timeScale}class ug{constructor(t,e,i){this.keyData=void 0,this.decrypter=void 0,this.keyData=i,this.decrypter=new Dc(e,{removePKCS7Padding:!1})}decryptBuffer(t){return this.decrypter.decrypt(t,this.keyData.key.buffer,this.keyData.iv.buffer,Ic)}decryptAacSample(t,e,i){const s=t[e].unit;if(s.length<=16)return;const r=s.subarray(16,s.length-s.length%16),n=r.buffer.slice(r.byteOffset,r.byteOffset+r.length);this.decryptBuffer(n).then(r=>{const n=new Uint8Array(r);s.set(n,16),this.decrypter.isSync()||this.decryptAacSamples(t,e+1,i)}).catch(i)}decryptAacSamples(t,e,i){for(;;e++){if(e>=t.length)return void i();if(!(t[e].unit.length<32)&&(this.decryptAacSample(t,e,i),!this.decrypter.isSync()))return}}getAvcEncryptedData(t){const e=16*Math.floor((t.length-48)/160)+16,i=new Int8Array(e);let s=0;for(let r=32;r<t.length-16;r+=160,s+=16)i.set(t.subarray(r,r+16),s);return i}getAvcDecryptedUnit(t,e){const i=new Uint8Array(e);let s=0;for(let r=32;r<t.length-16;r+=160,s+=16)t.set(i.subarray(s,s+16),r);return t}decryptAvcSample(t,e,i,s,r){const n=sh(r.data),a=this.getAvcEncryptedData(n);this.decryptBuffer(a.buffer).then(a=>{r.data=this.getAvcDecryptedUnit(n,a),this.decrypter.isSync()||this.decryptAvcSamples(t,e,i+1,s)}).catch(s)}decryptAvcSamples(t,e,i,s){if(t instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;e++,i=0){if(e>=t.length)return void s();const r=t[e].units;for(;!(i>=r.length);i++){const n=r[i];if(!(n.data.length<=48||1!==n.type&&5!==n.type||(this.decryptAvcSample(t,e,i,s,n),this.decrypter.isSync())))return}}}}class fg{constructor(){this.VideoSample=null}createVideoSample(t,e,i){return{key:t,frame:!1,pts:e,dts:i,units:[],length:0}}getLastNalUnit(t){var e;let i,s=this.VideoSample;if(s&&0!==s.units.length||(s=t[t.length-1]),null!=(e=s)&&e.units){const t=s.units;i=t[t.length-1]}return i}pushAccessUnit(t,e){if(t.units.length&&t.frame){if(void 0===t.pts){const i=e.samples,s=i.length;if(!s)return void e.dropped++;{const e=i[s-1];t.pts=e.pts,t.dts=e.dts}}e.samples.push(t)}}parseNALu(t,e,i){const s=e.byteLength;let r=t.naluState||0;const n=r,a=[];let o,l,d,h=0,c=-1,u=0;for(-1===r&&(c=0,u=this.getNALuType(e,0),r=0,h=1);h<s;)if(o=e[h++],r)if(1!==r)if(o)if(1===o){if(l=h-r-1,c>=0){const t={data:e.subarray(c,l),type:u};a.push(t)}else{const i=this.getLastNalUnit(t.samples);i&&(n&&h<=4-n&&i.state&&(i.data=i.data.subarray(0,i.data.byteLength-n)),l>0&&(i.data=Zd(i.data,e.subarray(0,l)),i.state=0))}h<s?(d=this.getNALuType(e,h),c=h,u=d,r=0):r=-1}else r=0;else r=3;else r=o?0:2;else r=o?0:1;if(c>=0&&r>=0){const t={data:e.subarray(c,s),type:u,state:r};a.push(t)}if(0===a.length){const i=this.getLastNalUnit(t.samples);i&&(i.data=Zd(i.data,e))}return t.naluState=r,a}}class gg{constructor(t){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=t,this.bytesAvailable=t.byteLength,this.word=0,this.bitsAvailable=0}loadWord(){const t=this.data,e=this.bytesAvailable,i=t.byteLength-e,s=new Uint8Array(4),r=Math.min(4,e);if(0===r)throw new Error("no bytes available");s.set(t.subarray(i,i+r)),this.word=new DataView(s.buffer).getUint32(0),this.bitsAvailable=8*r,this.bytesAvailable-=r}skipBits(t){let e;t=Math.min(t,8*this.bytesAvailable+this.bitsAvailable),this.bitsAvailable>t?(this.word<<=t,this.bitsAvailable-=t):(e=(t-=this.bitsAvailable)>>3,t-=e<<3,this.bytesAvailable-=e,this.loadWord(),this.word<<=t,this.bitsAvailable-=t)}readBits(t){let e=Math.min(this.bitsAvailable,t);const i=this.word>>>32-e;if(t>32&&hd.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=e,this.bitsAvailable>0)this.word<<=e;else{if(!(this.bytesAvailable>0))throw new Error("no bits available");this.loadWord()}return e=t-e,e>0&&this.bitsAvailable?i<<e|this.readBits(e):i}skipLZ(){let t;for(t=0;t<this.bitsAvailable;++t)if(this.word&2147483648>>>t)return this.word<<=t,this.bitsAvailable-=t,t;return this.loadWord(),t+this.skipLZ()}skipUEG(){this.skipBits(1+this.skipLZ())}skipEG(){this.skipBits(1+this.skipLZ())}readUEG(){const t=this.skipLZ();return this.readBits(t+1)-1}readEG(){const t=this.readUEG();return 1&t?1+t>>>1:-1*(t>>>1)}readBoolean(){return 1===this.readBits(1)}readUByte(){return this.readBits(8)}readUShort(){return this.readBits(16)}readUInt(){return this.readBits(32)}}class mg extends fg{parsePES(t,e,i,s){const r=this.parseNALu(t,i.data,s);let n,a=this.VideoSample,o=!1;i.data=null,a&&r.length&&!t.audFound&&(this.pushAccessUnit(a,t),a=this.VideoSample=this.createVideoSample(!1,i.pts,i.dts)),r.forEach(s=>{var r,l;switch(s.type){case 1:{let e=!1;n=!0;const r=s.data;if(o&&r.length>4){const t=this.readSliceType(r);2!==t&&4!==t&&7!==t&&9!==t||(e=!0)}var d;if(e)null!=(d=a)&&d.frame&&!a.key&&(this.pushAccessUnit(a,t),a=this.VideoSample=null);a||(a=this.VideoSample=this.createVideoSample(!0,i.pts,i.dts)),a.frame=!0,a.key=e;break}case 5:n=!0,null!=(r=a)&&r.frame&&!a.key&&(this.pushAccessUnit(a,t),a=this.VideoSample=null),a||(a=this.VideoSample=this.createVideoSample(!0,i.pts,i.dts)),a.key=!0,a.frame=!0;break;case 6:n=!0,ih(s.data,1,i.pts,e.samples);break;case 7:{var h,c;n=!0,o=!0;const e=s.data,i=this.readSPS(e);if(!t.sps||t.width!==i.width||t.height!==i.height||(null==(h=t.pixelRatio)?void 0:h[0])!==i.pixelRatio[0]||(null==(c=t.pixelRatio)?void 0:c[1])!==i.pixelRatio[1]){t.width=i.width,t.height=i.height,t.pixelRatio=i.pixelRatio,t.sps=[e];const s=e.subarray(1,4);let r="avc1.";for(let t=0;t<3;t++){let e=s[t].toString(16);e.length<2&&(e="0"+e),r+=e}t.codec=r}break}case 8:n=!0,t.pps=[s.data];break;case 9:n=!0,t.audFound=!0,null!=(l=a)&&l.frame&&(this.pushAccessUnit(a,t),a=null),a||(a=this.VideoSample=this.createVideoSample(!1,i.pts,i.dts));break;case 12:n=!0;break;default:n=!1}if(a&&n){a.units.push(s)}}),s&&a&&(this.pushAccessUnit(a,t),this.VideoSample=null)}getNALuType(t,e){return 31&t[e]}readSliceType(t){const e=new gg(t);return e.readUByte(),e.readUEG(),e.readUEG()}skipScalingList(t,e){let i,s=8,r=8;for(let n=0;n<t;n++)0!==r&&(i=e.readEG(),r=(s+i+256)%256),s=0===r?s:r}readSPS(t){const e=new gg(t);let i,s,r,n=0,a=0,o=0,l=0;const d=e.readUByte.bind(e),h=e.readBits.bind(e),c=e.readUEG.bind(e),u=e.readBoolean.bind(e),f=e.skipBits.bind(e),g=e.skipEG.bind(e),m=e.skipUEG.bind(e),p=this.skipScalingList.bind(this);d();const A=d();if(h(5),f(3),d(),m(),100===A||110===A||122===A||244===A||44===A||83===A||86===A||118===A||128===A){const t=c();if(3===t&&f(1),m(),m(),f(1),u())for(s=3!==t?8:12,r=0;r<s;r++)u()&&p(r<6?16:64,e)}m();const v=c();if(0===v)c();else if(1===v)for(f(1),g(),g(),i=c(),r=0;r<i;r++)g();m(),f(1);const y=c(),E=c(),T=h(1);0===T&&f(1),f(1),u()&&(n=c(),a=c(),o=c(),l=c());let S=[1,1];if(u()&&u()){switch(d()){case 1:S=[1,1];break;case 2:S=[12,11];break;case 3:S=[10,11];break;case 4:S=[16,11];break;case 5:S=[40,33];break;case 6:S=[24,11];break;case 7:S=[20,11];break;case 8:S=[32,11];break;case 9:S=[80,33];break;case 10:S=[18,11];break;case 11:S=[15,11];break;case 12:S=[64,33];break;case 13:S=[160,99];break;case 14:S=[4,3];break;case 15:S=[3,2];break;case 16:S=[2,1];break;case 255:S=[d()<<8|d(),d()<<8|d()]}}return{width:Math.ceil(16*(y+1)-2*n-2*a),height:(2-T)*(E+1)*16-(T?2:4)*(o+l),pixelRatio:S}}}class pg extends fg{constructor(...t){super(...t),this.initVPS=null}parsePES(t,e,i,s){const r=this.parseNALu(t,i.data,s);let n,a=this.VideoSample,o=!1;i.data=null,a&&r.length&&!t.audFound&&(this.pushAccessUnit(a,t),a=this.VideoSample=this.createVideoSample(!1,i.pts,i.dts)),r.forEach(s=>{var r,l;switch(s.type){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:a||(a=this.VideoSample=this.createVideoSample(!1,i.pts,i.dts)),a.frame=!0,n=!0;break;case 16:case 17:case 18:case 21:var d;if(n=!0,o)null!=(d=a)&&d.frame&&!a.key&&(this.pushAccessUnit(a,t),a=this.VideoSample=null);a||(a=this.VideoSample=this.createVideoSample(!0,i.pts,i.dts)),a.key=!0,a.frame=!0;break;case 19:case 20:n=!0,null!=(r=a)&&r.frame&&!a.key&&(this.pushAccessUnit(a,t),a=this.VideoSample=null),a||(a=this.VideoSample=this.createVideoSample(!0,i.pts,i.dts)),a.key=!0,a.frame=!0;break;case 39:n=!0,ih(s.data,2,i.pts,e.samples);break;case 32:n=!0,t.vps||("object"!=typeof t.params&&(t.params={}),t.params=ed(t.params,this.readVPS(s.data)),this.initVPS=s.data),t.vps=[s.data];break;case 33:if(n=!0,o=!0,void 0===t.vps||t.vps[0]===this.initVPS||void 0===t.sps||this.matchSPS(t.sps[0],s.data)||(this.initVPS=t.vps[0],t.sps=t.pps=void 0),!t.sps){const e=this.readSPS(s.data);t.width=e.width,t.height=e.height,t.pixelRatio=e.pixelRatio,t.codec=e.codecString,t.sps=[],"object"!=typeof t.params&&(t.params={});for(const i in e.params)t.params[i]=e.params[i]}this.pushParameterSet(t.sps,s.data,t.vps),a||(a=this.VideoSample=this.createVideoSample(!0,i.pts,i.dts)),a.key=!0;break;case 34:if(n=!0,"object"==typeof t.params){if(!t.pps){t.pps=[];const e=this.readPPS(s.data);for(const i in e)t.params[i]=e[i]}this.pushParameterSet(t.pps,s.data,t.vps)}break;case 35:n=!0,t.audFound=!0,null!=(l=a)&&l.frame&&(this.pushAccessUnit(a,t),a=null),a||(a=this.VideoSample=this.createVideoSample(!1,i.pts,i.dts));break;default:n=!1}if(a&&n){a.units.push(s)}}),s&&a&&(this.pushAccessUnit(a,t),this.VideoSample=null)}pushParameterSet(t,e,i){(i&&i[0]===this.initVPS||!i&&!t.length)&&t.push(e)}getNALuType(t,e){return(126&t[e])>>>1}ebsp2rbsp(t){const e=new Uint8Array(t.byteLength);let i=0;for(let s=0;s<t.byteLength;s++)s>=2&&3===t[s]&&0===t[s-1]&&0===t[s-2]||(e[i]=t[s],i++);return new Uint8Array(e.buffer,0,i)}pushAccessUnit(t,e){super.pushAccessUnit(t,e),this.initVPS&&(this.initVPS=null)}readVPS(t){const e=new gg(t);e.readUByte(),e.readUByte(),e.readBits(4),e.skipBits(2),e.readBits(6);return{numTemporalLayers:e.readBits(3)+1,temporalIdNested:e.readBoolean()}}readSPS(t){const e=new gg(this.ebsp2rbsp(t));e.readUByte(),e.readUByte(),e.readBits(4);const i=e.readBits(3);e.readBoolean();const s=e.readBits(2),r=e.readBoolean(),n=e.readBits(5),a=e.readUByte(),o=e.readUByte(),l=e.readUByte(),d=e.readUByte(),h=e.readUByte(),c=e.readUByte(),u=e.readUByte(),f=e.readUByte(),g=e.readUByte(),m=e.readUByte(),p=e.readUByte(),A=[],v=[];for(let K=0;K<i;K++)A.push(e.readBoolean()),v.push(e.readBoolean());if(i>0)for(let K=i;K<8;K++)e.readBits(2);for(let K=0;K<i;K++)A[K]&&(e.readUByte(),e.readUByte(),e.readUByte(),e.readUByte(),e.readUByte(),e.readUByte(),e.readUByte(),e.readUByte(),e.readUByte(),e.readUByte(),e.readUByte()),v[K]&&e.readUByte();e.readUEG();const y=e.readUEG();3==y&&e.skipBits(1);const E=e.readUEG(),T=e.readUEG(),S=e.readBoolean();let b=0,I=0,L=0,R=0;S&&(b+=e.readUEG(),I+=e.readUEG(),L+=e.readUEG(),R+=e.readUEG());const k=e.readUEG(),w=e.readUEG(),D=e.readUEG();for(let K=e.readBoolean()?0:i;K<=i;K++)e.skipUEG(),e.skipUEG(),e.skipUEG();e.skipUEG(),e.skipUEG(),e.skipUEG(),e.skipUEG(),e.skipUEG(),e.skipUEG();if(e.readBoolean()){if(e.readBoolean())for(let t=0;t<4;t++)for(let i=0;i<(3===t?2:6);i++){if(e.readBoolean()){const i=Math.min(64,1<<4+(t<<1));t>1&&e.readEG();for(let t=0;t<i;t++)e.readEG()}else e.readUEG()}}e.readBoolean(),e.readBoolean();e.readBoolean()&&(e.readUByte(),e.skipUEG(),e.skipUEG(),e.readBoolean());const C=e.readUEG();let x=0;for(let K=0;K<C;K++){let t=!1;if(0!==K&&(t=e.readBoolean()),t){K===C&&e.readUEG(),e.readBoolean(),e.readUEG();let t=0;for(let i=0;i<=x;i++){const i=e.readBoolean();let s=!1;i||(s=e.readBoolean()),(i||s)&&t++}x=t}else{const t=e.readUEG(),i=e.readUEG();x=t+i;for(let s=0;s<t;s++)e.readUEG(),e.readBoolean();for(let s=0;s<i;s++)e.readUEG(),e.readBoolean()}}if(e.readBoolean()){const t=e.readUEG();for(let i=0;i<t;i++){for(let t=0;t<D+4;t++)e.readBits(1);e.readBits(1)}}let P=0,M=1,O=1,B=!0,F=1,N=0;e.readBoolean(),e.readBoolean();let _=!1;if(e.readBoolean()){if(e.readBoolean()){const t=e.readUByte();t>0&&t<16?(M=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][t-1],O=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][t-1]):255===t&&(M=e.readBits(16),O=e.readBits(16))}e.readBoolean()&&e.readBoolean();if(e.readBoolean()){e.readBits(3),e.readBoolean();e.readBoolean()&&(e.readUByte(),e.readUByte(),e.readUByte())}e.readBoolean()&&(e.readUEG(),e.readUEG()),e.readBoolean(),e.readBoolean(),e.readBoolean(),_=e.readBoolean(),_&&(e.skipUEG(),e.skipUEG(),e.skipUEG(),e.skipUEG());if(e.readBoolean()){F=e.readBits(32),N=e.readBits(32);e.readBoolean()&&e.readUEG();if(e.readBoolean()){const t=e.readBoolean(),s=e.readBoolean();let r=!1;(t||s)&&(r=e.readBoolean(),r&&(e.readUByte(),e.readBits(5),e.readBoolean(),e.readBits(5)),e.readBits(4),e.readBits(4),r&&e.readBits(4),e.readBits(5),e.readBits(5),e.readBits(5));for(let n=0;n<=i;n++){B=e.readBoolean();let i=!1;B||e.readBoolean()?e.readEG():i=e.readBoolean();const n=i?1:e.readUEG()+1;if(t)for(let t=0;t<n;t++)e.readUEG(),e.readUEG(),r&&(e.readUEG(),e.readUEG()),e.skipBits(1);if(s)for(let t=0;t<n;t++)e.readUEG(),e.readUEG(),r&&(e.readUEG(),e.readUEG()),e.skipBits(1)}}}e.readBoolean()&&(e.readBoolean(),e.readBoolean(),e.readBoolean(),P=e.readUEG())}let U=E,H=T;if(S){let t=1,e=1;1===y?t=e=2:2==y&&(t=2),U=E-t*I-t*b,H=T-e*R-e*L}const j=s?["A","B","C"][s]:"",V=a<<24|o<<16|l<<8|d;let G=0;for(let K=0;K<32;K++)G=(G|(V>>K&1)<<31-K)>>>0;let Q=G.toString(16);1===n&&"2"===Q&&(Q="6");return{codecString:`hvc1.${j}${n}.${Q}.${r?"H":"L"}${p}.B0`,params:{general_tier_flag:r,general_profile_idc:n,general_profile_space:s,general_profile_compatibility_flags:[a,o,l,d],general_constraint_indicator_flags:[h,c,u,f,g,m],general_level_idc:p,bit_depth:k+8,bit_depth_luma_minus8:k,bit_depth_chroma_minus8:w,min_spatial_segmentation_idc:P,chroma_format_idc:y,frame_rate:{fixed:B,fps:N/F}},width:U,height:H,pixelRatio:[M,O]}}readPPS(t){const e=new gg(this.ebsp2rbsp(t));e.readUByte(),e.readUByte(),e.skipUEG(),e.skipUEG(),e.skipBits(2),e.skipBits(3),e.skipBits(2),e.skipUEG(),e.skipUEG(),e.skipEG(),e.skipBits(2);e.readBoolean()&&e.skipUEG(),e.skipEG(),e.skipEG(),e.skipBits(4);const i=e.readBoolean(),s=e.readBoolean();let r=1;return s&&i?r=0:s?r=3:i&&(r=2),{parallelismType:r}}matchSPS(t,e){return String.fromCharCode.apply(null,t).substr(3)===String.fromCharCode.apply(null,e).substr(3)}}const Ag=188;class vg{constructor(t,e,i,s){this.logger=void 0,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._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=t,this.config=e,this.typeSupported=i,this.logger=s,this.videoParser=null}static probe(t,e){const i=vg.syncOffset(t);return i>0&&e.warn(`MPEG2-TS detected but first sync word found @ offset ${i}`),-1!==i}static syncOffset(t){const e=t.length;let i=Math.min(940,e-Ag)+1,s=0;for(;s<i;){let r=!1,n=-1,a=0;for(let o=s;o<e;o+=Ag){if(71!==t[o]||e-o!==Ag&&71!==t[o+Ag]){if(a)return-1;break}if(a++,-1===n&&(n=o,0!==n&&(i=Math.min(n+18612,t.length-Ag)+1)),r||(r=0===yg(t,o)),r&&a>1&&(0===n&&a>2||o+Ag>i))return n}s++}return-1}static createTrack(t,e){return{container:"video"===t||"audio"===t?"video/mp2t":void 0,type:t,id:Fd[t],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:"audio"===t?e:void 0}}resetInitSegment(t,e,i,s){this.pmtParsed=!1,this._pmtId=-1,this._videoTrack=vg.createTrack("video"),this._videoTrack.duration=s,this._audioTrack=vg.createTrack("audio",s),this._id3Track=vg.createTrack("id3"),this._txtTrack=vg.createTrack("text"),this._audioTrack.segmentCodec="aac",this.videoParser=null,this.aacOverFlow=null,this.remainderData=null,this.audioCodec=e,this.videoCodec=i}resetTimeStamp(){}resetContiguity(){const{_audioTrack:t,_videoTrack:e,_id3Track:i}=this;t&&(t.pesData=null),e&&(e.pesData=null),i&&(i.pesData=null),this.aacOverFlow=null,this.remainderData=null}demux(t,e,i=!1,s=!1){let r;i||(this.sampleAes=null);const n=this._videoTrack,a=this._audioTrack,o=this._id3Track,l=this._txtTrack;let d=n.pid,h=n.pesData,c=a.pid,u=o.pid,f=a.pesData,g=o.pesData,m=null,p=this.pmtParsed,A=this._pmtId,v=t.length;if(this.remainderData&&(v=(t=Zd(this.remainderData,t)).length,this.remainderData=null),v<Ag&&!s)return this.remainderData=t,{audioTrack:a,videoTrack:n,id3Track:o,textTrack:l};const y=Math.max(0,vg.syncOffset(t));v-=(v-y)%Ag,v<t.byteLength&&!s&&(this.remainderData=new Uint8Array(t.buffer,v,t.buffer.byteLength-v));let E=0;for(let S=y;S<v;S+=Ag)if(71===t[S]){const e=!!(64&t[S+1]),s=yg(t,S);let v;if((48&t[S+3])>>4>1){if(v=S+5+t[S+4],v===S+Ag)continue}else v=S+4;switch(s){case d:e&&(h&&(r=Ig(h,this.logger))&&(this.readyVideoParser(n.segmentCodec),null!==this.videoParser&&this.videoParser.parsePES(n,l,r,!1)),h={data:[],size:0}),h&&(h.data.push(t.subarray(v,S+Ag)),h.size+=S+Ag-v);break;case c:if(e){if(f&&(r=Ig(f,this.logger)))switch(a.segmentCodec){case"aac":this.parseAACPES(a,r);break;case"mp3":this.parseMPEGPES(a,r);break;case"ac3":this.parseAC3PES(a,r)}f={data:[],size:0}}f&&(f.data.push(t.subarray(v,S+Ag)),f.size+=S+Ag-v);break;case u:e&&(g&&(r=Ig(g,this.logger))&&this.parseID3PES(o,r),g={data:[],size:0}),g&&(g.data.push(t.subarray(v,S+Ag)),g.size+=S+Ag-v);break;case 0:e&&(v+=t[v]+1),A=this._pmtId=Eg(t,v);break;case A:{e&&(v+=t[v]+1);const s=Tg(t,v,this.typeSupported,i,this.observer,this.logger);d=s.videoPid,d>0&&(n.pid=d,n.segmentCodec=s.segmentVideoCodec),c=s.audioPid,c>0&&(a.pid=c,a.segmentCodec=s.segmentAudioCodec),u=s.id3Pid,u>0&&(o.pid=u),null===m||p||(this.logger.warn(`MPEG-TS PMT found at ${S} after unknown PID '${m}'. Backtracking to sync byte @${y} to parse all TS packets.`),m=null,S=y-188),p=this.pmtParsed=!0;break}case 17:case 8191:break;default:m=s}}else E++;E>0&&Sg(this.observer,new Error(`Found ${E} TS packet/s that do not start with 0x47`),void 0,this.logger),n.pesData=h,a.pesData=f,o.pesData=g;const T={audioTrack:a,videoTrack:n,id3Track:o,textTrack:l};return s&&this.extractRemainingSamples(T),T}flush(){const{remainderData:t}=this;let e;return this.remainderData=null,e=t?this.demux(t,-1,!1,!0):{videoTrack:this._videoTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(e),this.sampleAes?this.decrypt(e,this.sampleAes):e}extractRemainingSamples(t){const{audioTrack:e,videoTrack:i,id3Track:s,textTrack:r}=t,n=i.pesData,a=e.pesData,o=s.pesData;let l;if(n&&(l=Ig(n,this.logger))?(this.readyVideoParser(i.segmentCodec),null!==this.videoParser&&(this.videoParser.parsePES(i,r,l,!0),i.pesData=null)):i.pesData=n,a&&(l=Ig(a,this.logger))){switch(e.segmentCodec){case"aac":this.parseAACPES(e,l);break;case"mp3":this.parseMPEGPES(e,l);break;case"ac3":this.parseAC3PES(e,l)}e.pesData=null}else null!=a&&a.size&&this.logger.log("last AAC PES packet truncated,might overlap between fragments"),e.pesData=a;o&&(l=Ig(o,this.logger))?(this.parseID3PES(s,l),s.pesData=null):s.pesData=o}demuxSampleAes(t,e,i){const s=this.demux(t,i,!0,!this.config.progressive),r=this.sampleAes=new ug(this.observer,this.config,e);return this.decrypt(s,r)}readyVideoParser(t){null===this.videoParser&&("avc"===t?this.videoParser=new mg:"hevc"===t&&(this.videoParser=new pg))}decrypt(t,e){return new Promise(i=>{const{audioTrack:s,videoTrack:r}=t;s.samples&&"aac"===s.segmentCodec?e.decryptAacSamples(s.samples,0,()=>{r.samples?e.decryptAvcSamples(r.samples,0,0,()=>{i(t)}):i(t)}):r.samples&&e.decryptAvcSamples(r.samples,0,0,()=>{i(t)})})}destroy(){this.observer&&this.observer.removeAllListeners(),this.config=this.logger=this.observer=null,this.aacOverFlow=this.videoParser=this.remainderData=this.sampleAes=null,this._videoTrack=this._audioTrack=this._id3Track=this._txtTrack=void 0}parseAACPES(t,e){let i=0;const s=this.aacOverFlow;let r,n,a,o=e.data;if(s){this.aacOverFlow=null;const e=s.missing,r=s.sample.unit.byteLength;if(-1===e)o=Zd(s.sample.unit,o);else{const n=r-e;s.sample.unit.set(o.subarray(0,e),n),t.samples.push(s.sample),i=s.missing}}for(r=i,n=o.length;r<n-1&&!Mf(o,r);r++);if(r!==i){let t;const e=r<n-1;if(t=e?`AAC PES did not start with ADTS header,offset:${r}`:"No ADTS header found in AAC PES",Sg(this.observer,new Error(t),e,this.logger),!e)return}if(Bf(t,this.observer,o,r,this.audioCodec),void 0!==e.pts)a=e.pts;else{if(!s)return void this.logger.warn("[tsdemuxer]: AAC PES unknown PTS");{const e=Ff(t.samplerate);a=s.sample.pts+e}}let l,d=0;for(;r<n;){if(l=Nf(t,o,r,a,d),r+=l.length,l.missing){this.aacOverFlow=l;break}for(d++;r<n-1&&!Mf(o,r);r++);}}parseMPEGPES(t,e){const i=e.data,s=i.length;let r=0,n=0;const a=e.pts;if(void 0!==a)for(;n<s;)if(ng(i,n)){const e=ig(t,i,n,a,r);if(!e)break;n+=e.length,r++}else n++;else this.logger.warn("[tsdemuxer]: MPEG PES unknown PTS")}parseAC3PES(t,e){{const i=e.data,s=e.pts;if(void 0===s)return void this.logger.warn("[tsdemuxer]: AC3 PES unknown PTS");const r=i.length;let n,a=0,o=0;for(;o<r&&(n=dg(t,i,o,s,a++))>0;)o+=n}}parseID3PES(t,e){if(void 0===e.pts)return void this.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");const i=ed({},e,{type:this._videoTrack?Wf.emsg:Wf.audioId3,duration:Number.POSITIVE_INFINITY});t.samples.push(i)}}function yg(t,e){return((31&t[e+1])<<8)+t[e+2]}function Eg(t,e){return(31&t[e+10])<<8|t[e+11]}function Tg(t,e,i,s,r,n){const a={audioPid:-1,videoPid:-1,id3Pid:-1,segmentVideoCodec:"avc",segmentAudioCodec:"aac"},o=e+3+((15&t[e+1])<<8|t[e+2])-4;for(e+=12+((15&t[e+10])<<8|t[e+11]);e<o;){const o=yg(t,e),l=(15&t[e+3])<<8|t[e+4];switch(t[e]){case 207:if(!s){bg("ADTS AAC",n);break}case 15:-1===a.audioPid&&(a.audioPid=o);break;case 21:-1===a.id3Pid&&(a.id3Pid=o);break;case 219:if(!s){bg("H.264",n);break}case 27:-1===a.videoPid&&(a.videoPid=o);break;case 3:case 4:i.mpeg||i.mp3?-1===a.audioPid&&(a.audioPid=o,a.segmentAudioCodec="mp3"):n.log("MPEG audio found, not supported in this browser");break;case 193:if(!s){bg("AC-3",n);break}case 129:i.ac3?-1===a.audioPid&&(a.audioPid=o,a.segmentAudioCodec="ac3"):n.log("AC-3 audio found, not supported in this browser");break;case 6:if(-1===a.audioPid&&l>0){let s=e+5,r=l;for(;r>2;){if(106===t[s])!0!==i.ac3?n.log("AC-3 audio found, not supported in this browser for now"):(a.audioPid=o,a.segmentAudioCodec="ac3");const e=t[s+1]+2;s+=e,r-=e}}break;case 194:case 135:return Sg(r,new Error("Unsupported EC-3 in M2TS found"),void 0,n),a;case 36:-1===a.videoPid&&(a.videoPid=o,a.segmentVideoCodec="hevc",n.log("HEVC in M2TS found"))}e+=l+5}return a}function Sg(t,e,i,s){s.warn(`parsing error: ${e.message}`),t.emit(Ql.ERROR,Ql.ERROR,{type:Vl.MEDIA_ERROR,details:Gl.FRAG_PARSING_ERROR,fatal:!1,levelRetry:i,error:e,reason:e.message})}function bg(t,e){e.log(`${t} with AES-128-CBC encryption found in unencrypted stream`)}function Ig(t,e){let i,s,r,n,a,o=0;const l=t.data;if(!t||0===t.size)return null;for(;l[0].length<19&&l.length>1;)l[0]=Zd(l[0],l[1]),l.splice(1,1);i=l[0];if(1===(i[0]<<16)+(i[1]<<8)+i[2]){if(s=(i[4]<<8)+i[5],s&&s>t.size-6)return null;const d=i[7];192&d&&(n=536870912*(14&i[9])+4194304*(255&i[10])+16384*(254&i[11])+128*(255&i[12])+(254&i[13])/2,64&d?(a=536870912*(14&i[14])+4194304*(255&i[15])+16384*(254&i[16])+128*(255&i[17])+(254&i[18])/2,n-a>54e5&&(e.warn(`${Math.round((n-a)/9e4)}s delta between PTS and DTS, align them`),n=a)):a=n),r=i[8];let h=r+9;if(t.size<=h)return null;t.size-=h;const c=new Uint8Array(t.size);for(let t=0,e=l.length;t<e;t++){i=l[t];let e=i.byteLength;if(h){if(h>e){h-=e;continue}i=i.subarray(h),e-=h,h=0}c.set(i,o),o+=e}return s&&(s-=r+3),{data:c,pts:n,dts:a,len:s}}return null}class Lg{static getSilentFrame(t,e){if("mp4a.40.2"===t){if(1===e)return new Uint8Array([0,200,0,128,35,128]);if(2===e)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(6===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224])}else{if(1===e)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===e)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(3===e)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}}}const Rg=Math.pow(2,32)-1;class kg{static init(){let t;for(t in kg.types={avc1:[],avcC:[],hvc1:[],hvcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],dac3:[],"ac-3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]},kg.types)kg.types.hasOwnProperty(t)&&(kg.types[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)]);const e=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),i=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);kg.HDLR_TYPES={video:e,audio:i};const s=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),r=new Uint8Array([0,0,0,0,0,0,0,0]);kg.STTS=kg.STSC=kg.STCO=r,kg.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),kg.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),kg.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),kg.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);const n=new Uint8Array([105,115,111,109]),a=new Uint8Array([97,118,99,49]),o=new Uint8Array([0,0,0,1]);kg.FTYP=kg.box(kg.types.ftyp,n,o,n,a),kg.DINF=kg.box(kg.types.dinf,kg.box(kg.types.dref,s))}static box(t,...e){let i=8,s=e.length;const r=s;for(;s--;)i+=e[s].byteLength;const n=new Uint8Array(i);for(n[0]=i>>24&255,n[1]=i>>16&255,n[2]=i>>8&255,n[3]=255&i,n.set(t,4),s=0,i=8;s<r;s++)n.set(e[s],i),i+=e[s].byteLength;return n}static hdlr(t){return kg.box(kg.types.hdlr,kg.HDLR_TYPES[t])}static mdat(t){return kg.box(kg.types.mdat,t)}static mdhd(t,e){e*=t;const i=Math.floor(e/(Rg+1)),s=Math.floor(e%(Rg+1));return kg.box(kg.types.mdhd,new Uint8Array([1,0,0,0,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,255&t,i>>24,i>>16&255,i>>8&255,255&i,s>>24,s>>16&255,s>>8&255,255&s,85,196,0,0]))}static mdia(t){return kg.box(kg.types.mdia,kg.mdhd(t.timescale||0,t.duration||0),kg.hdlr(t.type),kg.minf(t))}static mfhd(t){return kg.box(kg.types.mfhd,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t]))}static minf(t){return"audio"===t.type?kg.box(kg.types.minf,kg.box(kg.types.smhd,kg.SMHD),kg.DINF,kg.stbl(t)):kg.box(kg.types.minf,kg.box(kg.types.vmhd,kg.VMHD),kg.DINF,kg.stbl(t))}static moof(t,e,i){return kg.box(kg.types.moof,kg.mfhd(t),kg.traf(i,e))}static moov(t){let e=t.length;const i=[];for(;e--;)i[e]=kg.trak(t[e]);return kg.box.apply(null,[kg.types.moov,kg.mvhd(t[0].timescale||0,t[0].duration||0)].concat(i).concat(kg.mvex(t)))}static mvex(t){let e=t.length;const i=[];for(;e--;)i[e]=kg.trex(t[e]);return kg.box.apply(null,[kg.types.mvex,...i])}static mvhd(t,e){e*=t;const i=Math.floor(e/(Rg+1)),s=Math.floor(e%(Rg+1)),r=new Uint8Array([1,0,0,0,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,255&t,i>>24,i>>16&255,i>>8&255,255&i,s>>24,s>>16&255,s>>8&255,255&s,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 kg.box(kg.types.mvhd,r)}static sdtp(t){const e=t.samples||[],i=new Uint8Array(4+e.length);let s,r;for(s=0;s<e.length;s++)r=e[s].flags,i[s+4]=r.dependsOn<<4|r.isDependedOn<<2|r.hasRedundancy;return kg.box(kg.types.sdtp,i)}static stbl(t){return kg.box(kg.types.stbl,kg.stsd(t),kg.box(kg.types.stts,kg.STTS),kg.box(kg.types.stsc,kg.STSC),kg.box(kg.types.stsz,kg.STSZ),kg.box(kg.types.stco,kg.STCO))}static avc1(t){let e,i,s,r=[],n=[];for(e=0;e<t.sps.length;e++)i=t.sps[e],s=i.byteLength,r.push(s>>>8&255),r.push(255&s),r=r.concat(Array.prototype.slice.call(i));for(e=0;e<t.pps.length;e++)i=t.pps[e],s=i.byteLength,n.push(s>>>8&255),n.push(255&s),n=n.concat(Array.prototype.slice.call(i));const a=kg.box(kg.types.avcC,new Uint8Array([1,r[3],r[4],r[5],255,224|t.sps.length].concat(r).concat([t.pps.length]).concat(n))),o=t.width,l=t.height,d=t.pixelRatio[0],h=t.pixelRatio[1];return kg.box(kg.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,o>>8&255,255&o,l>>8&255,255&l,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]),a,kg.box(kg.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),kg.box(kg.types.pasp,new Uint8Array([d>>24,d>>16&255,d>>8&255,255&d,h>>24,h>>16&255,h>>8&255,255&h])))}static esds(t){const e=t.config;return new Uint8Array([0,0,0,0,3,25,0,1,0,4,17,64,21,0,0,0,0,0,0,0,0,0,0,0,5,2,...e,6,1,2])}static audioStsd(t){const e=t.samplerate||0;return new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount||0,0,16,0,0,0,0,e>>8&255,255&e,0,0])}static mp4a(t){return kg.box(kg.types.mp4a,kg.audioStsd(t),kg.box(kg.types.esds,kg.esds(t)))}static mp3(t){return kg.box(kg.types[".mp3"],kg.audioStsd(t))}static ac3(t){return kg.box(kg.types["ac-3"],kg.audioStsd(t),kg.box(kg.types.dac3,t.config))}static stsd(t){const{segmentCodec:e}=t;if("audio"===t.type){if("aac"===e)return kg.box(kg.types.stsd,kg.STSD,kg.mp4a(t));if("ac3"===e&&t.config)return kg.box(kg.types.stsd,kg.STSD,kg.ac3(t));if("mp3"===e&&"mp3"===t.codec)return kg.box(kg.types.stsd,kg.STSD,kg.mp3(t))}else{if(!t.pps||!t.sps)throw new Error("video track missing pps or sps");if("avc"===e)return kg.box(kg.types.stsd,kg.STSD,kg.avc1(t));if("hevc"===e&&t.vps)return kg.box(kg.types.stsd,kg.STSD,kg.hvc1(t))}throw new Error(`unsupported ${t.type} segment codec (${e}/${t.codec})`)}static tkhd(t){const e=t.id,i=(t.duration||0)*(t.timescale||0),s=t.width||0,r=t.height||0,n=Math.floor(i/(Rg+1)),a=Math.floor(i%(Rg+1));return kg.box(kg.types.tkhd,new Uint8Array([1,0,0,7,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,255&e,0,0,0,0,n>>24,n>>16&255,n>>8&255,255&n,a>>24,a>>16&255,a>>8&255,255&a,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,s>>8&255,255&s,0,0,r>>8&255,255&r,0,0]))}static traf(t,e){const i=kg.sdtp(t),s=t.id,r=Math.floor(e/(Rg+1)),n=Math.floor(e%(Rg+1));return kg.box(kg.types.traf,kg.box(kg.types.tfhd,new Uint8Array([0,0,0,0,s>>24,s>>16&255,s>>8&255,255&s])),kg.box(kg.types.tfdt,new Uint8Array([1,0,0,0,r>>24,r>>16&255,r>>8&255,255&r,n>>24,n>>16&255,n>>8&255,255&n])),kg.trun(t,i.length+16+20+8+16+8+8),i)}static trak(t){return t.duration=t.duration||4294967295,kg.box(kg.types.trak,kg.tkhd(t),kg.mdia(t))}static trex(t){const e=t.id;return kg.box(kg.types.trex,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,255&e,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}static trun(t,e){const i=t.samples||[],s=i.length,r=12+16*s,n=new Uint8Array(r);let a,o,l,d,h,c;for(e+=8+r,n.set(["video"===t.type?1:0,0,15,1,s>>>24&255,s>>>16&255,s>>>8&255,255&s,e>>>24&255,e>>>16&255,e>>>8&255,255&e],0),a=0;a<s;a++)o=i[a],l=o.duration,d=o.size,h=o.flags,c=o.cts,n.set([l>>>24&255,l>>>16&255,l>>>8&255,255&l,d>>>24&255,d>>>16&255,d>>>8&255,255&d,h.isLeading<<2|h.dependsOn,h.isDependedOn<<6|h.hasRedundancy<<4|h.paddingValue<<1|h.isNonSync,61440&h.degradPrio,15&h.degradPrio,c>>>24&255,c>>>16&255,c>>>8&255,255&c],12+16*a);return kg.box(kg.types.trun,n)}static initSegment(t){kg.types||kg.init();const e=kg.moov(t);return Zd(kg.FTYP,e)}static hvc1(t){const e=t.params,i=[t.vps,t.sps,t.pps],s=new Uint8Array([1,e.general_profile_space<<6|(e.general_tier_flag?32:0)|e.general_profile_idc,e.general_profile_compatibility_flags[0],e.general_profile_compatibility_flags[1],e.general_profile_compatibility_flags[2],e.general_profile_compatibility_flags[3],e.general_constraint_indicator_flags[0],e.general_constraint_indicator_flags[1],e.general_constraint_indicator_flags[2],e.general_constraint_indicator_flags[3],e.general_constraint_indicator_flags[4],e.general_constraint_indicator_flags[5],e.general_level_idc,240|e.min_spatial_segmentation_idc>>8,255&e.min_spatial_segmentation_idc,252|e.parallelismType,252|e.chroma_format_idc,248|e.bit_depth_luma_minus8,248|e.bit_depth_chroma_minus8,0,parseInt(e.frame_rate.fps),3|e.temporal_id_nested<<2|e.num_temporal_layers<<3|(e.frame_rate.fixed?64:0),i.length]);let r=s.length;for(let u=0;u<i.length;u+=1){r+=3;for(let t=0;t<i[u].length;t+=1)r+=2+i[u][t].length}const n=new Uint8Array(r);n.set(s,0),r=s.length;const a=i.length-1;for(let u=0;u<i.length;u+=1){n.set(new Uint8Array([32+u|(u===a?128:0),0,i[u].length]),r),r+=3;for(let t=0;t<i[u].length;t+=1)n.set(new Uint8Array([i[u][t].length>>8,255&i[u][t].length]),r),r+=2,n.set(i[u][t],r),r+=i[u][t].length}const o=kg.box(kg.types.hvcC,n),l=t.width,d=t.height,h=t.pixelRatio[0],c=t.pixelRatio[1];return kg.box(kg.types.hvc1,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,255&l,d>>8&255,255&d,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,kg.box(kg.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),kg.box(kg.types.pasp,new Uint8Array([h>>24,h>>16&255,h>>8&255,255&h,c>>24,c>>16&255,c>>8&255,255&c])))}}kg.types=void 0,kg.HDLR_TYPES=void 0,kg.STTS=void 0,kg.STSC=void 0,kg.STCO=void 0,kg.STSZ=void 0,kg.VMHD=void 0,kg.SMHD=void 0,kg.STSD=void 0,kg.FTYP=void 0,kg.DINF=void 0;function wg(t,e,i=1,s=!1){const r=t*e*i;return s?Math.round(r):r}function Dg(t,e=!1){return wg(t,1e3,1/9e4,e)}function Cg(t){const{baseTime:e,timescale:i,trackId:s}=t;return`${e/i} (${e}/${i}) trackId: ${s}`}let xg,Pg=null,Mg=null;function Og(t,e,i,s){return{duration:e,size:i,cts:s,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:t?2:1,isNonSync:t?0:1}}}class Bg extends rd{constructor(t,e,i,s){if(super("mp4-remuxer",s),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextVideoTs=null,this.nextAudioTs=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.videoTrackConfig=void 0,this.observer=t,this.config=e,this.typeSupported=i,this.ISGenerated=!1,null===Pg){const t=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Pg=t?parseInt(t[1]):0}if(null===Mg){const t=navigator.userAgent.match(/Safari\/(\d+)/i);Mg=t?parseInt(t[1]):0}}destroy(){this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null}resetTimeStamp(t){const e=this._initPTS;e&&t&&t.trackId===e.trackId&&t.baseTime===e.baseTime&&t.timescale===e.timescale||this.log(`Reset initPTS: ${e?Cg(e):e} > ${t?Cg(t):t}`),this._initPTS=this._initDTS=t}resetNextTimestamp(){this.log("reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){this.log("ISGenerated flag reset"),this.ISGenerated=!1,this.videoTrackConfig=void 0}getVideoStartPts(t){let e=!1;const i=t[0].pts,s=t.reduce((t,s)=>{let r=s.pts,n=r-t;return n<-4294967296&&(e=!0,r=Fg(r,i),n=r-t),n>0?t:r},i);return e&&this.debug("PTS rollover detected"),s}remux(t,e,i,s,r,n,a,o){let l,d,h,c,u,f,g=r,m=r;const p=t.pid>-1,A=e.pid>-1,v=e.samples.length,y=t.samples.length>0,E=a&&v>0||v>1;if((!p||y)&&(!A||E)||this.ISGenerated||a){if(this.ISGenerated){var T,S,b,I;const t=this.videoTrackConfig;(t&&(e.width!==t.width||e.height!==t.height||(null==(T=e.pixelRatio)?void 0:T[0])!==(null==(S=t.pixelRatio)?void 0:S[0])||(null==(b=e.pixelRatio)?void 0:b[1])!==(null==(I=t.pixelRatio)?void 0:I[1]))||!t&&E||null===this.nextAudioTs&&y)&&this.resetInitSegment()}this.ISGenerated||(h=this.generateIS(t,e,r,n));const i=this.isVideoContiguous;let s,a=-1;if(E&&(a=function(t){for(let e=0;e<t.length;e++)if(t[e].key)return e;return-1}(e.samples),!i&&this.config.forceKeyFrameOnDiscontinuity))if(f=!0,a>0){this.warn(`Dropped ${a} out of ${v} video samples due to a missing keyframe`);const t=this.getVideoStartPts(e.samples);e.samples=e.samples.slice(a),e.dropped+=a,m+=(e.samples[0].pts-t)/e.inputTimeScale,s=m}else-1===a&&(this.warn(`No keyframe found out of ${v} video samples`),f=!1);if(this.ISGenerated){if(y&&E){const i=this.getVideoStartPts(e.samples),s=(Fg(t.samples[0].pts,i)-i)/e.inputTimeScale;g+=Math.max(0,s),m+=Math.max(0,-s)}if(y){if(t.samplerate||(this.warn("regenerate InitSegment as audio detected"),h=this.generateIS(t,e,r,n)),d=this.remuxAudio(t,g,this.isAudioContiguous,n,A||E||o===zl?m:void 0),E){const s=d?d.endPTS-d.startPTS:0;e.inputTimeScale||(this.warn("regenerate InitSegment as video detected"),h=this.generateIS(t,e,r,n)),l=this.remuxVideo(e,m,i,s)}}else E&&(l=this.remuxVideo(e,m,i,0));l&&(l.firstKeyFrame=a,l.independent=-1!==a,l.firstKeyFramePTS=s)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(i.samples.length&&(u=Ng(i,r,this._initPTS,this._initDTS)),s.samples.length&&(c=_g(s,r,this._initPTS))),{audio:d,video:l,initSegment:h,independent:f,text:c,id3:u}}computeInitPts(t,e,i,s){const r=Math.round(i*e);let n=Fg(t,r);if(n<r+e)for(this.log(`Adjusting PTS for rollover in timeline near ${(r-n)/e} ${s}`);n<r+e;)n+=8589934592;return n-r}generateIS(t,e,i,s){const r=t.samples,n=e.samples,a=this.typeSupported,o={},l=this._initPTS;let d,h,c,u=!l||s,f="audio/mp4",g=-1;if(u&&(d=h=1/0),t.config&&r.length){switch(t.timescale=t.samplerate,t.segmentCodec){case"mp3":a.mpeg?(f="audio/mpeg",t.codec=""):a.mp3&&(t.codec="mp3");break;case"ac3":t.codec="ac-3"}o.audio={id:"audio",container:f,codec:t.codec,initSegment:"mp3"===t.segmentCodec&&a.mpeg?new Uint8Array(0):kg.initSegment([t]),metadata:{channelCount:t.channelCount}},u&&(g=t.id,c=t.inputTimeScale,l&&c===l.timescale?u=!1:d=h=this.computeInitPts(r[0].pts,c,i,"audio"))}if(e.sps&&e.pps&&n.length){if(e.timescale=e.inputTimeScale,o.video={id:"main",container:"video/mp4",codec:e.codec,initSegment:kg.initSegment([e]),metadata:{width:e.width,height:e.height}},u)if(g=e.id,c=e.inputTimeScale,l&&c===l.timescale)u=!1;else{const t=this.getVideoStartPts(n),e=Fg(n[0].dts,t),s=this.computeInitPts(e,c,i,"video"),r=this.computeInitPts(t,c,i,"video");h=Math.min(h,s),d=Math.min(d,r)}this.videoTrackConfig={width:e.width,height:e.height,pixelRatio:e.pixelRatio}}if(Object.keys(o).length)return this.ISGenerated=!0,u?(l&&this.warn(`Timestamps at playlist time: ${s?"":"~"}${i} ${d/c} != initPTS: ${l.baseTime/l.timescale} (${l.baseTime}/${l.timescale}) trackId: ${l.trackId}`),this.log(`Found initPTS at playlist time: ${i} offset: ${d/c} (${d}/${c}) trackId: ${g}`),this._initPTS={baseTime:d,timescale:c,trackId:g},this._initDTS={baseTime:h,timescale:c,trackId:g}):d=c=void 0,{tracks:o,initPTS:d,timescale:c,trackId:g}}remuxVideo(t,e,i,s){const r=t.inputTimeScale,n=t.samples,a=[],o=n.length,l=this._initPTS,d=l.baseTime*r/l.timescale;let h,c,u=this.nextVideoTs,f=8,g=this.videoSampleDuration,m=Number.POSITIVE_INFINITY,p=Number.NEGATIVE_INFINITY,A=!1;if(!i||null===u){const t=d+e*r,s=n[0].pts-Fg(n[0].dts,n[0].pts);Pg&&null!==u&&Math.abs(t-s-(u+d))<15e3?i=!0:u=t-s-d}const v=u+d;for(let B=0;B<o;B++){const t=n[B];t.pts=Fg(t.pts,v),t.dts=Fg(t.dts,v),t.dts<n[B>0?B-1:B].dts&&(A=!0)}A&&n.sort(function(t,e){const i=t.dts-e.dts,s=t.pts-e.pts;return i||s}),h=n[0].dts,c=n[n.length-1].dts;const y=c-h,E=y?Math.round(y/(o-1)):g||t.inputTimeScale/30;if(i){const i=h-v,s=i>E,r=i<-1;if((s||r)&&(s?this.warn(`${(t.segmentCodec||"").toUpperCase()}: ${Dg(i,!0)} ms (${i}dts) hole between fragments detected at ${e.toFixed(3)}`):this.warn(`${(t.segmentCodec||"").toUpperCase()}: ${Dg(-i,!0)} ms (${i}dts) overlapping between fragments detected at ${e.toFixed(3)}`),!r||v>=n[0].pts||Pg)){h=v;const t=n[0].pts-i;if(s)n[0].dts=h,n[0].pts=t;else{let e=!0;for(let s=0;s<n.length&&!(n[s].dts>t&&e);s++){const t=n[s].pts;if(n[s].dts-=i,n[s].pts-=i,s<n.length-1){const i=n[s+1].pts;e=i<=n[s].pts==i<=t}}}this.log(`Video: Initial PTS/DTS adjusted: ${Dg(t,!0)}/${Dg(h,!0)}, delta: ${Dg(i,!0)} ms`)}}h=Math.max(0,h);let T=0,S=0,b=h;for(let B=0;B<o;B++){const t=n[B],e=t.units,i=e.length;let s=0;for(let r=0;r<i;r++)s+=e[r].data.length;S+=s,T+=i,t.length=s,t.dts<b?(t.dts=b,b+=E/4|0||1):b=t.dts,m=Math.min(t.pts,m),p=Math.max(t.pts,p)}c=n[o-1].dts;const I=S+4*T+8;let L;try{L=new Uint8Array(I)}catch(O){return void this.observer.emit(Ql.ERROR,Ql.ERROR,{type:Vl.MUX_ERROR,details:Gl.REMUX_ALLOC_ERROR,fatal:!1,error:O,bytes:I,reason:`fail allocating video mdat ${I}`})}const R=new DataView(L.buffer);R.setUint32(0,I),L.set(kg.types.mdat,4);let k=!1,w=Number.POSITIVE_INFINITY,D=Number.POSITIVE_INFINITY,C=Number.NEGATIVE_INFINITY,x=Number.NEGATIVE_INFINITY;for(let B=0;B<o;B++){const t=n[B],e=t.units;let i,l=0;for(let s=0,r=e.length;s<r;s++){const t=e[s],i=t.data,r=t.data.byteLength;R.setUint32(f,r),f+=4,L.set(i,f),f+=r,l+=4+r}if(B<o-1)g=n[B+1].dts-t.dts,i=n[B+1].pts-t.pts;else{const e=this.config,a=B>0?t.dts-n[B-1].dts:E;if(i=B>0?t.pts-n[B-1].pts:E,e.stretchShortVideoTrack&&null!==this.nextAudioTs){const i=Math.floor(e.maxBufferHole*r),n=(s?m+s*r:this.nextAudioTs+d)-t.pts;n>i?(g=n-a,g<0?g=a:k=!0,this.log(`It is approximately ${n/90} ms to the next segment; using duration ${g/90} ms for the last video frame.`)):g=a}else g=a}const h=Math.round(t.pts-t.dts);w=Math.min(w,g),C=Math.max(C,g),D=Math.min(D,i),x=Math.max(x,i),a.push(Og(t.key,g,l,h))}if(a.length)if(Pg){if(Pg<70){const t=a[0].flags;t.dependsOn=2,t.isNonSync=0}}else if(Mg&&x-D<C-w&&E/C<.025&&0===a[0].cts){this.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");let t=h;for(let e=0,i=a.length;e<i;e++){const s=t+a[e].duration,r=t+a[e].cts;if(e<i-1){const t=s+a[e+1].cts;a[e].duration=t-r}else a[e].duration=e?a[e-1].duration:E;a[e].cts=0,t=s}}g=k||!g?E:g;const P=c+g;this.nextVideoTs=u=P-d,this.videoSampleDuration=g,this.isVideoContiguous=!0;const M={data1:kg.moof(t.sequenceNumber++,h,ed(t,{samples:a})),data2:L,startPTS:(m-d)/r,endPTS:(p+g-d)/r,startDTS:(h-d)/r,endDTS:u/r,type:"video",hasAudio:!1,hasVideo:!0,nb:a.length,dropped:t.dropped};return t.samples=[],t.dropped=0,M}getSamplesPerFrame(t){switch(t.segmentCodec){case"mp3":return 1152;case"ac3":return 1536;default:return 1024}}remuxAudio(t,e,i,s,r){const n=t.inputTimeScale,a=n/(t.samplerate?t.samplerate:n),o=this.getSamplesPerFrame(t),l=o*a,d=this._initPTS,h="mp3"===t.segmentCodec&&this.typeSupported.mpeg,c=[],u=void 0!==r;let f=t.samples,g=h?0:8,m=this.nextAudioTs||-1;const p=d.baseTime*n/d.timescale,A=p+e*n;if(this.isAudioContiguous=i=i||f.length&&m>0&&(s&&Math.abs(A-(m+p))<9e3||Math.abs(Fg(f[0].pts,A)-(m+p))<20*l),f.forEach(function(t){t.pts=Fg(t.pts,A)}),!i||m<0){const t=f.length;if(f=f.filter(t=>t.pts>=0),t!==f.length&&this.warn(`Removed ${f.length-t} of ${t} samples (initPTS ${p} / ${n})`),!f.length)return;m=0===r?0:s&&!u?Math.max(0,A-p):f[0].pts-p}if("aac"===t.segmentCodec){const e=this.config.maxAudioFramesDrift;for(let i=0,s=m+p;i<f.length;i++){const r=f[i],a=r.pts,o=a-s,d=Math.abs(1e3*o/n);if(o<=-e*l&&u)0===i&&(this.warn(`Audio frame @ ${(a/n).toFixed(3)}s overlaps marker by ${Math.round(1e3*o/n)} ms.`),this.nextAudioTs=m=a-p,s=a);else if(o>=e*l&&d<1e4&&u){let e=Math.round(o/l);for(s=a-e*l;s<0&&e&&l;)e--,s+=l;0===i&&(this.nextAudioTs=m=s-p),this.warn(`Injecting ${e} audio frames @ ${((s-p)/n).toFixed(3)}s due to ${Math.round(1e3*o/n)} ms gap.`);for(let n=0;n<e;n++){let e=Lg.getSilentFrame(t.parsedCodec||t.manifestCodec||t.codec,t.channelCount);e||(this.log("Unable to get silent frame for given audio codec; duplicating last frame instead."),e=r.unit.subarray()),f.splice(i,0,{unit:e,pts:s}),s+=l,i++}}r.pts=s,s+=l}}let v,y=null,E=null,T=0,S=f.length;for(;S--;)T+=f[S].unit.byteLength;for(let C=0,x=f.length;C<x;C++){const e=f[C],s=e.unit;let r=e.pts;if(null!==E){c[C-1].duration=Math.round((r-E)/a)}else{if(i&&"aac"===t.segmentCodec&&(r=m+p),y=r,!(T>0))return;T+=g;try{v=new Uint8Array(T)}catch(D){return void this.observer.emit(Ql.ERROR,Ql.ERROR,{type:Vl.MUX_ERROR,details:Gl.REMUX_ALLOC_ERROR,fatal:!1,error:D,bytes:T,reason:`fail allocating audio mdat ${T}`})}if(!h){new DataView(v.buffer).setUint32(0,T),v.set(kg.types.mdat,4)}}v.set(s,g);const n=s.byteLength;g+=n,c.push(Og(!0,o,n,0)),E=r}const b=c.length;if(!b)return;const I=c[c.length-1];m=E-p,this.nextAudioTs=m+a*I.duration;const L=h?new Uint8Array(0):kg.moof(t.sequenceNumber++,y/a,ed({},t,{samples:c}));t.samples=[];const R=(y-p)/n,k=this.nextAudioTs/n,w={data1:L,data2:v,startPTS:R,endPTS:k,startDTS:R,endDTS:k,type:"audio",hasAudio:!0,hasVideo:!1,nb:b};return this.isAudioContiguous=!0,w}}function Fg(t,e){let i;if(null===e)return t;for(i=e<t?-8589934592:8589934592;Math.abs(t-e)>4294967296;)t+=i;return t}function Ng(t,e,i,s){const r=t.samples.length;if(!r)return;const n=t.inputTimeScale;for(let o=0;o<r;o++){const r=t.samples[o];r.pts=Fg(r.pts-i.baseTime*n/i.timescale,e*n)/n,r.dts=Fg(r.dts-s.baseTime*n/s.timescale,e*n)/n}const a=t.samples;return t.samples=[],{samples:a}}function _g(t,e,i){const s=t.samples.length;if(!s)return;const r=t.inputTimeScale;for(let a=0;a<s;a++){const s=t.samples[a];s.pts=Fg(s.pts-i.baseTime*r/i.timescale,e*r)/r}t.samples.sort((t,e)=>t.pts-e.pts);const n=t.samples;return t.samples=[],{samples:n}}function Ug(t,e,i=!1){return void 0!==(null==t?void 0:t.start)?(t.start+(i?t.duration:0))/t.timescale:e}function Hg(t,e,i){const s=t.codec;if(s&&s.length>4)return s;if(e===Rd){if("ec-3"===s||"ac-3"===s||"alac"===s)return s;if("fLaC"===s||"Opus"===s){return ph(s,!1)}return i.warn(`Unhandled audio codec "${s}" in mp4 MAP`),s||"mp4a"}return i.warn(`Unhandled video codec "${s}" in mp4 MAP`),s||"avc1"}try{xg=self.performance.now.bind(self.performance)}catch(wE){xg=Date.now}const jg=[{demux:class{constructor(t,e){this.remainderData=null,this.timeOffset=0,this.config=void 0,this.videoTrack=void 0,this.audioTrack=void 0,this.id3Track=void 0,this.txtTrack=void 0,this.config=e}resetTimeStamp(){}resetInitSegment(t,e,i,s){const r=this.videoTrack=Yf("video",1),n=this.audioTrack=Yf("audio",1),a=this.txtTrack=Yf("text",1);if(this.id3Track=Yf("id3",1),this.timeOffset=0,null==t||!t.byteLength)return;const o=Qd(t);if(o.video){const{id:t,timescale:e,codec:i,supplemental:s}=o.video;r.id=t,r.timescale=a.timescale=e,r.codec=i,r.supplemental=s}if(o.audio){const{id:t,timescale:e,codec:i}=o.audio;n.id=t,n.timescale=e,n.codec=i}a.id=Fd.text,r.sampleDuration=0,r.duration=n.duration=s}resetContiguity(){this.remainderData=null}static probe(t){return function(t){const e=t.byteLength;for(let i=0;i<e;){const s=Ud(t,i);if(s>8&&109===t[i+4]&&111===t[i+5]&&111===t[i+6]&&102===t[i+7])return!0;i=s>1?i+s:e}return!1}(t)}demux(t,e){this.timeOffset=e;let i=t;const s=this.videoTrack,r=this.txtTrack;if(this.config.progressive){this.remainderData&&(i=Zd(this.remainderData,t));const e=function(t){const e={valid:null,remainder:null},i=Vd(t,["moof"]);if(i.length<2)return e.remainder=t,e;const s=i[i.length-1];return e.valid=t.slice(0,s.byteOffset-8),e.remainder=t.slice(s.byteOffset-8),e}(i);this.remainderData=e.remainder,s.samples=e.valid||new Uint8Array}else s.samples=i;const n=this.extractID3Track(s,e);return r.samples=Jd(e,s),{videoTrack:s,audioTrack:this.audioTrack,id3Track:n,textTrack:this.txtTrack}}flush(){const t=this.timeOffset,e=this.videoTrack,i=this.txtTrack;e.samples=this.remainderData||new Uint8Array,this.remainderData=null;const s=this.extractID3Track(e,this.timeOffset);return i.samples=Jd(t,e),{videoTrack:e,audioTrack:Yf(),id3Track:s,textTrack:Yf()}}extractID3Track(t,e){const i=this.id3Track;if(t.samples.length){const s=Vd(t.samples,["emsg"]);s&&s.forEach(t=>{const s=function(t){const e=t[0];let i="",s="",r=0,n=0,a=0,o=0,l=0,d=0;if(0===e){for(;"\0"!==Nd(t.subarray(d,d+1));)i+=Nd(t.subarray(d,d+1)),d+=1;for(i+=Nd(t.subarray(d,d+1)),d+=1;"\0"!==Nd(t.subarray(d,d+1));)s+=Nd(t.subarray(d,d+1)),d+=1;s+=Nd(t.subarray(d,d+1)),d+=1,r=Ud(t,12),n=Ud(t,16),o=Ud(t,20),l=Ud(t,24),d=28}else if(1===e){d+=4,r=Ud(t,d),d+=4;const e=Ud(t,d);d+=4;const n=Ud(t,d);for(d+=4,a=2**32*e+n,Hl(a)||(a=Number.MAX_SAFE_INTEGER,hd.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),o=Ud(t,d),d+=4,l=Ud(t,d),d+=4;"\0"!==Nd(t.subarray(d,d+1));)i+=Nd(t.subarray(d,d+1)),d+=1;for(i+=Nd(t.subarray(d,d+1)),d+=1;"\0"!==Nd(t.subarray(d,d+1));)s+=Nd(t.subarray(d,d+1)),d+=1;s+=Nd(t.subarray(d,d+1)),d+=1}return{schemeIdUri:i,value:s,timeScale:r,presentationTime:a,presentationTimeDelta:n,eventDuration:o,id:l,payload:t.subarray(d,t.byteLength)}}(t);if(hg.test(s.schemeIdUri)){const t=cg(s,e);let r=4294967295===s.eventDuration?Number.POSITIVE_INFINITY:s.eventDuration/s.timeScale;r<=.001&&(r=Number.POSITIVE_INFINITY);const n=s.payload;i.samples.push({data:n,len:n.byteLength,dts:t,pts:t,type:Wf.emsg,duration:r})}else if(this.config.enableEmsgKLVMetadata&&s.schemeIdUri.startsWith("urn:misb:KLV:bin:1910.1")){const t=cg(s,e);i.samples.push({data:s.payload,len:s.payload.byteLength,dts:t,pts:t,type:Wf.misbklv,duration:Number.POSITIVE_INFINITY})}})}return i}demuxSampleAes(t,e,i){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))}destroy(){this.config=null,this.remainderData=null,this.videoTrack=this.audioTrack=this.id3Track=this.txtTrack=void 0}},remux:class extends rd{constructor(t,e,i,s){super("passthrough-remuxer",s),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,this.isVideoContiguous=!1}destroy(){}resetTimeStamp(t){this.lastEndTime=null;const e=this.initPTS;e&&t&&e.baseTime===t.baseTime&&e.timescale===t.timescale||(this.initPTS=t)}resetNextTimestamp(){this.isVideoContiguous=!1,this.lastEndTime=null}resetInitSegment(t,e,i,s){this.audioCodec=e,this.videoCodec=i,this.generateInitSegment(t,s),this.emitInitSegment=!0}generateInitSegment(t,e){let{audioCodec:i,videoCodec:s}=this;if(null==t||!t.byteLength)return this.initTracks=void 0,void(this.initData=void 0);const{audio:r,video:n}=this.initData=Qd(t);if(e)!function(t,e){if(!t||!e)return;const i=e.keyId;i&&e.isCommonEncryption&&zd(t,(t,e)=>{const s=t.subarray(8,24);s.some(t=>0!==t)||(hd.log(`[eme] Patching keyId in 'enc${e?"a":"v"}>sinf>>tenc' box: ${gd(s)} -> ${gd(i)}`),t.set(i,8))})}(t,e);else{const t=r||n;null!=t&&t.encrypted&&this.warn(`Init segment with encrypted track with has no key ("${t.codec}")!`)}r&&(i=Hg(r,Rd,this)),n&&(s=Hg(n,kd,this));const a={};r&&n?a.audiovideo={container:"video/mp4",codec:i+","+s,supplemental:n.supplemental,encrypted:n.encrypted,initSegment:t,id:"main"}:r?a.audio={container:"audio/mp4",codec:i,encrypted:r.encrypted,initSegment:t,id:"audio"}:n?a.video={container:"video/mp4",codec:s,supplemental:n.supplemental,encrypted:n.encrypted,initSegment:t,id:"main"}:this.warn("initSegment does not contain moov or trak boxes."),this.initTracks=a}remux(t,e,i,s,r,n){var a,o;let{initPTS:l,lastEndTime:d}=this;const h={audio:void 0,video:void 0,text:s,id3:i,initSegment:void 0};Ul(d)||(d=this.lastEndTime=r||0);const c=e.samples;if(!c.length)return h;const u={initPTS:void 0,timescale:void 0,trackId:void 0};let f=this.initData;if(null!=(a=f)&&a.length||(this.generateInitSegment(c),f=this.initData),null==(o=f)||!o.length)return this.warn("Failed to generate initSegment."),h;this.emitInitSegment&&(u.tracks=this.initTracks,this.emitInitSegment=!1);const g=function(t,e,i){const s={},r=Vd(t,["moof","traf"]);for(let n=0;n<r.length;n++){const t=r[n],a=Vd(t,["tfhd"])[0],o=Ud(a,4),l=e[o];if(!l)continue;s[o]||(s[o]={start:NaN,duration:0,sampleCount:0,timescale:l.timescale,type:l.type});const d=s[o],h=Vd(t,["tfdt"])[0];if(h){const t=h[0];let e=Ud(h,4);1===t&&(e===Od?i.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"):(e*=Od+1,e+=Ud(h,8))),Ul(e)&&(!Ul(d.start)||e<d.start)&&(d.start=e)}const c=l.default,u=Ud(a,0)|(null==c?void 0:c.flags);let f=(null==c?void 0:c.duration)||0;8&u&&(f=Ud(a,2&u?12:8));const g=Vd(t,["trun"]);let m=d.start||0,p=0,A=f;for(let e=0;e<g.length;e++){const t=g[e],i=Ud(t,4),s=d.sampleCount;d.sampleCount+=i;const r=1&t[3],n=4&t[3],a=1&t[2],o=2&t[2],l=4&t[2],h=8&t[2];let c=8,u=i;for(r&&(c+=4),n&&i&&(1&t[c+1]||void 0!==d.keyFrameIndex||(d.keyFrameIndex=s),c+=4,a?(A=Ud(t,c),c+=4):A=f,o&&(c+=4),h&&(c+=4),m+=A,p+=A,u--);u--;)a?(A=Ud(t,c),c+=4):A=f,o&&(c+=4),l&&(1&t[c+1]||void 0===d.keyFrameIndex&&(d.keyFrameIndex=d.sampleCount-(u+1),d.keyFrameStart=m),c+=4),h&&(c+=4),m+=A,p+=A;!p&&f&&(p+=f*i)}d.duration+=p}if(!Object.keys(s).some(t=>s[t].duration)){let e=1/0,i=0;const r=Vd(t,["sidx"]);for(let t=0;t<r.length;t++){const s=Gd(r[t]);if(null!=s&&s.references){e=Math.min(e,s.earliestPresentationTime/s.timescale);const t=s.references.reduce((t,e)=>t+e.info.duration||0,0);i=Math.max(i,t+s.earliestPresentationTime/s.timescale)}}i&&Ul(i)&&Object.keys(s).forEach(t=>{s[t].duration||(s[t].duration=i*s[t].timescale-s[t].start)})}return s}(c,f,this),m=f.audio?g[f.audio.id]:null,p=f.video?g[f.video.id]:null,A=Ug(p,1/0),v=Ug(m,1/0),y=Ug(p,0,!0),E=Ug(m,0,!0);let T=r,S=0;const b=m&&(!p||!l&&v<A||l&&l.trackId===f.audio.id),I=b?m:p;if(I){const t=I.timescale,e=I.start-r*t,i=b?f.audio.id:f.video.id;T=I.start/t,S=b?E-v:y-A,!n&&l||!function(t,e,i,s){if(null===t)return!0;const r=Math.max(s,1),n=e-t.baseTime/t.timescale;return Math.abs(n-i)>r}(l,T,r,S)&&t===l.timescale||(l&&this.warn(`Timestamps at playlist time: ${n?"":"~"}${r} ${e/t} != initPTS: ${l.baseTime/l.timescale} (${l.baseTime}/${l.timescale}) trackId: ${l.trackId}`),this.log(`Found initPTS at playlist time: ${r} offset: ${T-r} (${e}/${t}) trackId: ${i}`),l=null,u.initPTS=e,u.timescale=t,u.trackId=i)}else this.warn(`No audio or video samples found for initPTS at playlist time: ${r}`);l?(u.initPTS=l.baseTime,u.timescale=l.timescale,u.trackId=l.trackId):(u.timescale&&void 0!==u.trackId&&void 0!==u.initPTS||(this.warn("Could not set initPTS"),u.initPTS=T,u.timescale=1,u.trackId=-1),this.initPTS=l={baseTime:u.initPTS,timescale:u.timescale,trackId:u.trackId});const L=T-l.baseTime/l.timescale,R=L+S;S>0?this.lastEndTime=R:(this.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const k=!!f.audio,w=!!f.video;let D="";k&&(D+="audio"),w&&(D+="video");const C={data1:c,startPTS:L,startDTS:L,endPTS:R,endDTS:R,type:D,hasAudio:k,hasVideo:w,nb:1,dropped:0,encrypted:!!f.audio&&f.audio.encrypted||!!f.video&&f.video.encrypted};h.audio=k&&!w?C:void 0,h.video=w?C:void 0;const x=null==p?void 0:p.sampleCount;if(x){const t=p.keyFrameIndex,e=-1!==t;C.nb=x,C.dropped=0===t||this.isVideoContiguous?0:e?t:x,C.independent=e,C.firstKeyFrame=t,e&&p.keyFrameStart&&(C.firstKeyFramePTS=(p.keyFrameStart-l.baseTime)/l.timescale),this.isVideoContiguous||(h.independent=e),this.isVideoContiguous||(this.isVideoContiguous=e),C.dropped&&this.warn(`fmp4 does not start with IDR: firstIDR ${t}/${x} dropped: ${C.dropped} start: ${C.firstKeyFramePTS||"NA"}`)}return h.initSegment=u,h.id3=Ng(i,r,l,l),s.samples.length&&(h.text=_g(s,r,l)),h}}},{demux:vg,remux:Bg},{demux:class extends $f{constructor(t,e){super(),this.observer=void 0,this.config=void 0,this.observer=t,this.config=e}resetInitSegment(t,e,i,s){super.resetInitSegment(t,e,i,s),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:e,duration:s,inputTimeScale:9e4,dropped:0}}static probe(t,e){if(!t)return!1;const i=Df(t,0);let s=(null==i?void 0:i.length)||0;if(ag(t,s))return!1;for(let r=t.length;s<r;s++)if(Of(t,s))return e.log("ADTS sync word found !"),!0;return!1}canParse(t,e){return function(t,e){return function(t,e){return e+5<t.length}(t,e)&&Cf(t,e)&&Pf(t,e)<=t.length-e}(t,e)}appendFrame(t,e,i){Bf(t,this.observer,e,i,t.manifestCodec);const s=Nf(t,e,i,this.basePTS,this.frameIndex);if(s&&0===s.missing)return s}},remux:Bg},{demux:class extends $f{resetInitSegment(t,e,i,s){super.resetInitSegment(t,e,i,s),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:e,duration:s,inputTimeScale:9e4,dropped:0}}static probe(t){if(!t)return!1;const e=Df(t,0);let i=(null==e?void 0:e.length)||0;if(e&&11===t[i]&&119===t[i+1]&&void 0!==qf(e)&&og(t,i)<=16)return!1;for(let s=t.length;i<s;i++)if(ag(t,i))return hd.log("MPEG Audio sync word found !"),!0;return!1}canParse(t,e){return function(t,e){return rg(t,e)&&4<=t.length-e}(t,e)}appendFrame(t,e,i){if(null!==this.basePTS)return ig(t,e,i,this.basePTS,this.frameIndex)}},remux:Bg}];jg.splice(2,0,{demux:lg,remux:Bg});class Vg{constructor(t,e,i,s,r,n){this.asyncResult=!1,this.logger=void 0,this.observer=void 0,this.typeSupported=void 0,this.config=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=t,this.typeSupported=e,this.config=i,this.id=r,this.logger=n}configure(t){this.transmuxConfig=t,this.decrypter&&this.decrypter.reset()}push(t,e,i,s){const r=i.transmuxing;r.executeStart=xg();let n=new Uint8Array(t);const{currentTransmuxState:a,transmuxConfig:o}=this;s&&(this.currentTransmuxState=s);const{contiguous:l,discontinuity:d,trackSwitch:h,accurateTimeOffset:c,timeOffset:u,initSegmentChange:f}=s||a,{audioCodec:g,videoCodec:m,defaultInitPts:p,duration:A,initSegmentData:v}=o,y=function(t,e){let i=null;t.byteLength>0&&null!=(null==e?void 0:e.key)&&null!==e.iv&&null!=e.method&&(i=e);return i}(n,e);if(y&&Jc(y.method)){const t=this.getDecrypter(),e=tu(y.method);if(!t.isSync())return this.asyncResult=!0,this.decryptionPromise=t.webCryptoDecrypt(n,y.key.buffer,y.iv.buffer,e).then(t=>{const e=this.push(t,null,i);return this.decryptionPromise=null,e}),this.decryptionPromise;{let s=t.softwareDecrypt(n,y.key.buffer,y.iv.buffer,e);if(i.part>-1){const e=t.flush();s=e?e.buffer:e}if(!s)return r.executeEnd=xg(),Gg(i);n=new Uint8Array(s)}}const E=this.needsProbing(d,h);if(E){const t=this.configureTransmuxer(n);if(t)return this.logger.warn(`[transmuxer] ${t.message}`),this.observer.emit(Ql.ERROR,Ql.ERROR,{type:Vl.MEDIA_ERROR,details:Gl.FRAG_PARSING_ERROR,fatal:!1,error:t,reason:t.message}),r.executeEnd=xg(),Gg(i)}(d||h||f||E)&&this.resetInitSegment(v,g,m,A,e),(d||f||E)&&this.resetInitialTimestamp(p),l||this.resetContiguity();const T=this.transmux(n,y,u,c,i);this.asyncResult=Qg(T);const S=this.currentTransmuxState;return S.contiguous=!0,S.discontinuity=!1,S.trackSwitch=!1,r.executeEnd=xg(),T}flush(t){const e=t.transmuxing;e.executeStart=xg();const{decrypter:i,currentTransmuxState:s,decryptionPromise:r}=this;if(r)return this.asyncResult=!0,r.then(()=>this.flush(t));const n=[],{timeOffset:a}=s;if(i){const e=i.flush();e&&n.push(this.push(e.buffer,null,t))}const{demuxer:o,remuxer:l}=this;if(!o||!l){e.executeEnd=xg();const i=[Gg(t)];return this.asyncResult?Promise.resolve(i):i}const d=o.flush(a);return Qg(d)?(this.asyncResult=!0,d.then(e=>(this.flushRemux(n,e,t),n))):(this.flushRemux(n,d,t),this.asyncResult?Promise.resolve(n):n)}flushRemux(t,e,i){const{audioTrack:s,videoTrack:r,id3Track:n,textTrack:a}=e,{accurateTimeOffset:o,timeOffset:l}=this.currentTransmuxState;this.logger.log(`[transmuxer.ts]: Flushed ${this.id} sn: ${i.sn}${i.part>-1?" part: "+i.part:""} of ${this.id===$l?"level":"track"} ${i.level}`);const d=this.remuxer.remux(s,r,n,a,l,o,!0,this.id);t.push({remuxResult:d,chunkMeta:i}),i.transmuxing.executeEnd=xg()}resetInitialTimestamp(t){const{demuxer:e,remuxer:i}=this;e&&i&&(e.resetTimeStamp(t),i.resetTimeStamp(t))}resetContiguity(){const{demuxer:t,remuxer:e}=this;t&&e&&(t.resetContiguity(),e.resetNextTimestamp())}resetInitSegment(t,e,i,s,r){const{demuxer:n,remuxer:a}=this;n&&a&&(n.resetInitSegment(t,e,i,s),a.resetInitSegment(t,e,i,r))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(t,e,i,s,r){let n;return n=e&&"SAMPLE-AES"===e.method?this.transmuxSampleAes(t,e,i,s,r):this.transmuxUnencrypted(t,i,s,r),n}transmuxUnencrypted(t,e,i,s){const{audioTrack:r,videoTrack:n,id3Track:a,textTrack:o}=this.demuxer.demux(t,e,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(r,n,a,o,e,i,!1,this.id),chunkMeta:s}}transmuxSampleAes(t,e,i,s,r){return this.demuxer.demuxSampleAes(t,e,i).then(t=>({remuxResult:this.remuxer.remux(t.audioTrack,t.videoTrack,t.id3Track,t.textTrack,i,s,!1,this.id),chunkMeta:r}))}configureTransmuxer(t){const{config:e,observer:i,typeSupported:s}=this;let r;for(let h=0,c=jg.length;h<c;h++){var n;if(null!=(n=jg[h].demux)&&n.probe(t,this.logger)){r=jg[h];break}}if(!r)return new Error("Failed to find demuxer by probing fragment data");const a=this.demuxer,o=this.remuxer,l=r.remux,d=r.demux;o&&o instanceof l||(this.remuxer=new l(i,e,s,this.logger)),a&&a instanceof d||(this.demuxer=new d(i,e,s,this.logger),this.probe=d.probe)}needsProbing(t,e){return!this.demuxer||!this.remuxer||t||e}getDecrypter(){let t=this.decrypter;return t||(t=this.decrypter=new Dc(this.config)),t}}const Gg=t=>({remuxResult:{},chunkMeta:t});function Qg(t){return"then"in t&&t.then instanceof Function}class Kg{constructor(t,e,i,s,r){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=t,this.videoCodec=e,this.initSegmentData=i,this.duration=s,this.defaultInitPts=r||null}}class qg{constructor(t,e,i,s,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=t,this.contiguous=e,this.accurateTimeOffset=i,this.trackSwitch=s,this.timeOffset=r,this.initSegmentChange=n}}let Wg=0;class Yg{constructor(t,e,i,s){this.error=null,this.hls=void 0,this.id=void 0,this.instanceNo=Wg++,this.observer=void 0,this.frag=null,this.part=null,this.useWorker=void 0,this.workerContext=null,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.onWorkerMessage=t=>{const e=t.data,i=this.hls;if(i&&null!=e&&e.event&&e.instanceNo===this.instanceNo)switch(e.event){case"init":{var s;const t=null==(s=this.workerContext)?void 0:s.objectURL;t&&self.URL.revokeObjectURL(t);break}case"transmuxComplete":this.handleTransmuxComplete(e.data);break;case"flush":this.onFlush(e.data);break;case"workerLog":i.logger[e.data.logType]&&i.logger[e.data.logType](e.data.message);break;default:e.data=e.data||{},e.data.frag=this.frag,e.data.part=this.part,e.data.id=this.id,i.trigger(e.event,e.data)}},this.onWorkerError=t=>{if(!this.hls)return;const e=new Error(`${t.message} (${t.filename}:${t.lineno})`);this.hls.config.enableWorker=!1,this.hls.logger.warn(`Error in "${this.id}" Web Worker, fallback to inline`),this.hls.trigger(Ql.ERROR,{type:Vl.OTHER_ERROR,details:Gl.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:e})};const r=t.config;this.hls=t,this.id=e,this.useWorker=!!r.enableWorker,this.onTransmuxComplete=i,this.onFlush=s;const n=(t,e)=>{(e=e||{}).frag=this.frag||void 0,t===Ql.ERROR&&(e.parent=this.id,e.part=this.part,this.error=e.error),this.hls.trigger(t,e)};this.observer=new bf,this.observer.on(Ql.FRAG_DECRYPTED,n),this.observer.on(Ql.ERROR,n);const a=Eh(r.preferManagedMediaSource);if(this.useWorker&&"undefined"!=typeof Worker){const i=this.hls.logger;if(r.workerPath||"function"==typeof __HLS_WORKER_BUNDLE__){try{r.workerPath?(i.log(`loading Web Worker ${r.workerPath} for "${e}"`),this.workerContext=function(t){const e=Lf[t];if(e)return e.clientCount++,e;const i=new self.URL(t,self.location.href).href,s={worker:new self.Worker(i),scriptURL:i,clientCount:1};return Lf[t]=s,s}(r.workerPath)):(i.log(`injecting Web Worker for "${e}"`),this.workerContext=function(){const t=Lf[If];if(t)return t.clientCount++,t;const e=new self.Blob([`var exports={};var module={exports:exports};function define(f){f()};define.amd=true;(${__HLS_WORKER_BUNDLE__.toString()})(true);`],{type:"text/javascript"}),i=self.URL.createObjectURL(e),s={worker:new self.Worker(i),objectURL:i,clientCount:1};return Lf[If]=s,s}());const{worker:t}=this.workerContext;t.addEventListener("message",this.onWorkerMessage),t.addEventListener("error",this.onWorkerError),t.postMessage({instanceNo:this.instanceNo,cmd:"init",typeSupported:a,id:e,config:Uh(r)})}catch(wE){i.warn(`Error setting up "${e}" Web Worker, fallback to inline`,wE),this.terminateWorker(),this.error=null,this.transmuxer=new Vg(this.observer,a,r,"",e,t.logger)}return}}this.transmuxer=new Vg(this.observer,a,r,"",e,t.logger)}reset(){if(this.frag=null,this.part=null,this.workerContext){const t=this.instanceNo;this.instanceNo=Wg++;const e=this.hls.config,i=Eh(e.preferManagedMediaSource);this.workerContext.worker.postMessage({instanceNo:this.instanceNo,cmd:"reset",resetNo:t,typeSupported:i,id:this.id,config:Uh(e)})}}terminateWorker(){if(this.workerContext){const{worker:t}=this.workerContext;this.workerContext=null,t.removeEventListener("message",this.onWorkerMessage),t.removeEventListener("error",this.onWorkerError),function(t){const e=Lf[t||If];if(e&&1===e.clientCount--){const{worker:i,objectURL:s}=e;delete Lf[t||If],s&&self.URL.revokeObjectURL(s),i.terminate()}}(this.hls.config.workerPath)}}destroy(){if(this.workerContext)this.terminateWorker(),this.onWorkerMessage=this.onWorkerError=null;else{const t=this.transmuxer;t&&(t.destroy(),this.transmuxer=null)}const t=this.observer;t&&t.removeAllListeners(),this.frag=null,this.part=null,this.observer=null,this.hls=null}push(t,e,i,s,r,n,a,o,l,d){var h,c;l.transmuxing.start=self.performance.now();const{instanceNo:u,transmuxer:f}=this,g=n?n.start:r.start,m=r.decryptdata,p=this.frag,A=!(p&&r.cc===p.cc),v=!(p&&l.level===p.level),y=p?l.sn-p.sn:-1,E=this.part?l.part-this.part.index:-1,T=0===y&&l.id>1&&l.id===(null==p?void 0:p.stats.chunkCount),S=!v&&(1===y||0===y&&(1===E||T&&E<=0)),b=self.performance.now();(v||y||0===r.stats.parsing.start)&&(r.stats.parsing.start=b),!n||!E&&S||(n.stats.parsing.start=b);const I=!(p&&(null==(h=r.initSegment)?void 0:h.url)===(null==(c=p.initSegment)?void 0:c.url)),L=new qg(A,S,o,v,g,I);if(!S||A||I){this.hls.logger.log(`[transmuxer-interface]: Starting new transmux session for ${r.type} sn: ${l.sn}${l.part>-1?" part: "+l.part:""} ${this.id===$l?"level":"track"}: ${l.level} id: ${l.id}\n discontinuity: ${A}\n trackSwitch: ${v}\n contiguous: ${S}\n accurateTimeOffset: ${o}\n timeOffset: ${g}\n initSegmentChange: ${I}`);const t=new Kg(i,s,e,a,d);this.configureTransmuxer(t)}if(this.frag=r,this.part=n,this.workerContext)this.workerContext.worker.postMessage({instanceNo:u,cmd:"demux",data:t,decryptdata:m,chunkMeta:l,state:L},t instanceof ArrayBuffer?[t]:[]);else if(f){const e=f.push(t,m,l,L);Qg(e)?e.then(t=>{this.handleTransmuxComplete(t)}).catch(t=>{this.transmuxerError(t,l,"transmuxer-interface push error")}):this.handleTransmuxComplete(e)}}flush(t){t.transmuxing.start=self.performance.now();const{instanceNo:e,transmuxer:i}=this;if(this.workerContext)this.workerContext.worker.postMessage({instanceNo:e,cmd:"flush",chunkMeta:t});else if(i){const e=i.flush(t);Qg(e)?e.then(e=>{this.handleFlushResult(e,t)}).catch(e=>{this.transmuxerError(e,t,"transmuxer-interface flush error")}):this.handleFlushResult(e,t)}}transmuxerError(t,e,i){this.hls&&(this.error=t,this.hls.trigger(Ql.ERROR,{type:Vl.MEDIA_ERROR,details:Gl.FRAG_PARSING_ERROR,chunkMeta:e,frag:this.frag||void 0,part:this.part||void 0,fatal:!1,error:t,err:t,reason:i}))}handleFlushResult(t,e){t.forEach(t=>{this.handleTransmuxComplete(t)}),this.onFlush(e)}configureTransmuxer(t){const{instanceNo:e,transmuxer:i}=this;this.workerContext?this.workerContext.worker.postMessage({instanceNo:e,cmd:"configure",config:t}):i&&i.configure(t)}handleTransmuxComplete(t){t.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(t)}}class $g extends rd{constructor(t,e){super(e,t.logger),this.hls=void 0,this.canLoad=!1,this.timer=-1,this.hls=t}destroy(){this.clearTimer(),this.hls=this.log=this.warn=null}clearTimer(){-1!==this.timer&&(self.clearTimeout(this.timer),this.timer=-1)}startLoad(){this.canLoad=!0,this.loadPlaylist()}stopLoad(){this.canLoad=!1,this.clearTimer()}switchParams(t,e,i){const s=null==e?void 0:e.renditionReports;if(s){let n=-1;for(let i=0;i<s.length;i++){const a=s[i];let o;try{o=new self.URL(a.URI,e.url).href}catch(r){this.warn(`Could not construct new URL for Rendition Report: ${r}`),o=a.URI||""}if(o===t){n=i;break}o===t.substring(0,o.length)&&(n=i)}if(-1!==n){const t=s[n],r=parseInt(t["LAST-MSN"])||e.lastPartSn;let a=parseInt(t["LAST-PART"])||e.lastPartIndex;if(this.hls.config.lowLatencyMode){const t=Math.min(e.age-e.partTarget,e.targetduration);a>=0&&t>e.partTarget&&(a+=1)}const o=i&&Oh(i);return new Bh(r,a>=0?a:void 0,o)}}}loadPlaylist(t){this.clearTimer()}loadingPlaylist(t,e){this.clearTimer()}shouldLoadPlaylist(t){return this.canLoad&&!!t&&!!t.url&&(!t.details||t.details.live)}getUrlWithDirectives(t,e){if(e)try{return e.addDirectives(t)}catch(i){this.warn(`Could not construct new URL with HLS Delivery Directives: ${i}`)}return t}playlistLoaded(t,e,i){const{details:s,stats:r}=e,n=self.performance.now(),a=r.loading.first?Math.max(0,n-r.loading.first):0;s.advancedDateTime=Date.now()-a;const o=this.hls.config.timelineOffset;if(o!==s.appliedTimelineOffset){const t=Math.max(o||0,0);s.appliedTimelineOffset=t,s.fragments.forEach(e=>{e.setStart(e.playlistOffset+t)})}if(s.live||null!=i&&i.live){const o="levelInfo"in e?e.levelInfo:e.track;if(s.reloaded(i),i&&s.fragments.length>0){Uu(i,s,this);const t=s.playlistParsingError;if(t){this.warn(t);const i=this.hls;if(!i.config.ignorePlaylistParsingErrors){var l;const{networkDetails:n}=e;return void i.trigger(Ql.ERROR,{type:Vl.NETWORK_ERROR,details:Gl.LEVEL_PARSING_ERROR,fatal:!1,url:s.url,error:t,reason:t.message,level:e.level||void 0,parent:null==(l=s.fragments[0])?void 0:l.type,networkDetails:n,stats:r})}s.playlistParsingError=null}}-1===s.requestScheduled&&(s.requestScheduled=r.loading.start);const d=this.hls.mainForwardBufferInfo,h=d?d.end-d.len:0,c=Gu(s,1e3*(s.edge-h));if(s.requestScheduled+c<n?s.requestScheduled=n:s.requestScheduled+=c,this.log(`live playlist ${t} ${s.advanced?"REFRESHED "+s.lastPartSn+"-"+s.lastPartIndex:s.updated?"UPDATED":"MISSED"}`),!this.canLoad||!s.live)return;let u,f,g;if(s.canBlockReload&&s.endSN&&s.advanced){const t=this.hls.config.lowLatencyMode,r=s.lastPartSn,a=s.endSN,l=s.lastPartIndex,d=r===a;-1!==l?d?(f=a+1,g=t?0:l):(f=r,g=t?l+1:s.maxPartIndex):f=a+1;const h=s.age,c=h+s.ageHeader;let m=Math.min(c-s.partTarget,1.5*s.targetduration);if(m>0){if(c>3*s.targetduration)this.log(`Playlist last advanced ${h.toFixed(2)}s ago. Omitting segment and part directives.`),f=void 0,g=void 0;else if(null!=i&&i.tuneInGoal&&c-s.partTarget>i.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${i.tuneInGoal} to: ${m} with playlist age: ${s.age}`),m=0;else{const t=Math.floor(m/s.targetduration);if(f+=t,void 0!==g){g+=Math.round(m%s.targetduration/s.partTarget)}this.log(`CDN Tune-in age: ${s.ageHeader}s last advanced ${h.toFixed(2)}s goal: ${m} skip sn ${t} to part ${g}`)}s.tuneInGoal=m}if(u=this.getDeliveryDirectives(s,e.deliveryDirectives,f,g),t||!d)return s.requestScheduled=n,void this.loadingPlaylist(o,u)}else(s.canBlockReload||s.canSkipUntil)&&(u=this.getDeliveryDirectives(s,e.deliveryDirectives,f,g));u&&void 0!==f&&s.canBlockReload&&(s.requestScheduled=r.loading.first+Math.max(c-2*a,c/2)),this.scheduleLoading(o,u,s)}else this.clearTimer()}scheduleLoading(t,e,i){const s=i||t.details;if(!s)return void this.loadingPlaylist(t,e);const r=self.performance.now(),n=s.requestScheduled;if(r>=n)return void this.loadingPlaylist(t,e);const a=n-r;this.log(`reload live playlist ${t.name||t.bitrate+"bps"} in ${Math.round(a)} ms`),this.clearTimer(),this.timer=self.setTimeout(()=>this.loadingPlaylist(t,e),a)}getDeliveryDirectives(t,e,i,s){let r=Oh(t);return null!=e&&e.skip&&t.deltaUpdateFailed&&(i=e.msn,s=e.part,r=xh),new Bh(i,s,r)}checkRetry(t){const e=t.details,i=Jh(t),s=t.errorAction,{action:r,retryCount:n=0,retryConfig:a}=s||{},o=!!s&&!!a&&(r===hc||!s.resolved&&r===lc);if(o){var l;if(n>=a.maxNumRetry)return!1;if(i&&null!=(l=t.context)&&l.deliveryDirectives)this.warn(`Retrying playlist loading ${n+1}/${a.maxNumRetry} after "${e}" without delivery-directives`),this.loadPlaylist();else{const t=sc(a,n);this.clearTimer(),this.timer=self.setTimeout(()=>this.loadPlaylist(),t),this.warn(`Retrying playlist loading ${n+1}/${a.maxNumRetry} after "${e}" in ${t}ms`)}t.levelRetry=!0,s.resolved=!0}return o}}function zg(t,e){if(t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(!Xg(t[i].attrs,e[i].attrs))return!1;return!0}function Xg(t,e,i){const s=t["STABLE-RENDITION-ID"];return s&&!i?s===e["STABLE-RENDITION-ID"]:!(i||["LANGUAGE","NAME","CHARACTERISTICS","AUTOSELECT","DEFAULT","FORCED","ASSOC-LANGUAGE"]).some(i=>t[i]!==e[i])}function Zg(t,e){return e.label.toLowerCase()===t.name.toLowerCase()&&(!e.language||e.language.toLowerCase()===(t.lang||"").toLowerCase())}class Jg{constructor(t){this.tracks=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.tracks=t}destroy(){this.tracks=this.queues=null}append(t,e,i){if(null===this.queues||null===this.tracks)return;const s=this.queues[e];s.push(t),1!==s.length||i||this.executeNext(e)}appendBlocker(t){return new Promise(e=>{const i={label:"async-blocker",execute:e,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.append(i,t)})}prependBlocker(t){return new Promise(e=>{if(this.queues){const i={label:"async-blocker-prepend",execute:e,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.queues[t].unshift(i)}})}removeBlockers(){null!==this.queues&&[this.queues.video,this.queues.audio,this.queues.audiovideo].forEach(t=>{var e;const i=null==(e=t[0])?void 0:e.label;"async-blocker"!==i&&"async-blocker-prepend"!==i||(t[0].execute(),t.splice(0,1))})}unblockAudio(t){if(null===this.queues)return;this.queues.audio[0]===t&&this.shiftAndExecuteNext("audio")}executeNext(t){if(null===this.queues||null===this.tracks)return;const e=this.queues[t];if(e.length){const r=e[0];try{r.execute()}catch(s){var i;if(r.onError(s),null===this.queues||null===this.tracks)return;const e=null==(i=this.tracks[t])?void 0:i.buffer;null!=e&&e.updating||this.shiftAndExecuteNext(t)}}}shiftAndExecuteNext(t){null!==this.queues&&(this.queues[t].shift(),this.executeNext(t))}current(t){var e;return(null==(e=this.queues)?void 0:e[t][0])||null}toString(){const{queues:t,tracks:e}=this;return null===t||null===e?"<destroyed>":`\n${this.list("video")}\n${this.list("audio")}\n${this.list("audiovideo")}}`}list(t){var e,i;return null!=(e=this.queues)&&e[t]||null!=(i=this.tracks)&&i[t]?`${t}: (${this.listSbInfo(t)}) ${this.listOps(t)}`:""}listSbInfo(t){var e;const i=null==(e=this.tracks)?void 0:e[t],s=null==i?void 0:i.buffer;return s?`SourceBuffer${s.updating?" updating":""}${i.ended?" ended":""}${i.ending?" ending":""}`:"none"}listOps(t){var e;return(null==(e=this.queues)?void 0:e[t].map(t=>t.label).join(", "))||""}}const tm=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/,em="HlsJsTrackRemovedError";class im extends Error{constructor(t){super(t),this.name=em}}function sm(t){const e=t.querySelectorAll("source");[].slice.call(e).forEach(e=>{t.removeChild(e)})}function rm(t){return"audio"===t?1:0}class nm{constructor(t){this.hls=void 0,this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.clientRect=void 0,this.streamController=void 0,this.hls=t,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}setStreamController(t){this.streamController=t}destroy(){this.hls&&this.unregisterListener(),this.timer&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null}registerListeners(){const{hls:t}=this;t.on(Ql.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),t.on(Ql.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(Ql.MANIFEST_PARSED,this.onManifestParsed,this),t.on(Ql.LEVELS_UPDATED,this.onLevelsUpdated,this),t.on(Ql.BUFFER_CODECS,this.onBufferCodecs,this),t.on(Ql.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListener(){const{hls:t}=this;t.off(Ql.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),t.off(Ql.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(Ql.MANIFEST_PARSED,this.onManifestParsed,this),t.off(Ql.LEVELS_UPDATED,this.onLevelsUpdated,this),t.off(Ql.BUFFER_CODECS,this.onBufferCodecs,this),t.off(Ql.MEDIA_DETACHING,this.onMediaDetaching,this)}onFpsDropLevelCapping(t,e){const i=this.hls.levels[e.droppedLevel];this.isLevelAllowed(i)&&this.restrictedLevels.push({bitrate:i.bitrate,height:i.height,width:i.width})}onMediaAttaching(t,e){this.media=e.media instanceof HTMLVideoElement?e.media:null,this.clientRect=null,this.timer&&this.hls.levels.length&&this.detectPlayerSize()}onManifestParsed(t,e){const i=this.hls;this.restrictedLevels=[],this.firstLevel=e.firstLevel,i.config.capLevelToPlayerSize&&e.video&&this.startCapping()}onLevelsUpdated(t,e){this.timer&&Ul(this.autoLevelCapping)&&this.detectPlayerSize()}onBufferCodecs(t,e){this.hls.config.capLevelToPlayerSize&&e.video&&this.startCapping()}onMediaDetaching(){this.stopCapping(),this.media=null}detectPlayerSize(){if(this.media){if(this.mediaHeight<=0||this.mediaWidth<=0)return void(this.clientRect=null);const t=this.hls.levels;if(t.length){const e=this.hls,i=this.getMaxLevel(t.length-1);i!==this.autoLevelCapping&&e.logger.log(`Setting autoLevelCapping to ${i}: ${t[i].height}p@${t[i].bitrate} for media ${this.mediaWidth}x${this.mediaHeight}`),e.autoLevelCapping=i,e.autoLevelEnabled&&e.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=e.autoLevelCapping}}}getMaxLevel(t){const e=this.hls.levels;if(!e.length)return-1;const i=e.filter((e,i)=>this.isLevelAllowed(e)&&i<=t);return this.clientRect=null,nm.getMaxLevelByMediaSize(i,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 t=this.media,e={width:0,height:0};if(t){const i=t.getBoundingClientRect();e.width=i.width,e.height=i.height,e.width||e.height||(e.width=i.right-i.left||t.width||0,e.height=i.bottom-i.top||t.height||0)}return this.clientRect=e,e}get mediaWidth(){return this.getDimensions().width*this.contentScaleFactor}get mediaHeight(){return this.getDimensions().height*this.contentScaleFactor}get contentScaleFactor(){let t=1;if(!this.hls.config.ignoreDevicePixelRatio)try{t=self.devicePixelRatio}catch(e){}return Math.min(t,this.hls.config.maxDevicePixelRatio)}isLevelAllowed(t){return!this.restrictedLevels.some(e=>t.bitrate===e.bitrate&&t.width===e.width&&t.height===e.height)}static getMaxLevelByMediaSize(t,e,i){if(null==t||!t.length)return-1;const s=(t,e)=>!e||(t.width!==e.width||t.height!==e.height);let r=t.length-1;const n=Math.max(e,i);for(let a=0;a<t.length;a+=1){const e=t[a];if((e.width>=n||e.height>=n)&&s(e,t[a+1])){r=a;break}}return r}}const am={MANIFEST:"m",AUDIO:"a",VIDEO:"v",MUXED:"av",INIT:"i",CAPTION:"c",TIMED_TEXT:"tt",KEY:"k",OTHER:"o"},om={HLS:"h"};class lm{constructor(t,e){Array.isArray(t)&&(t=t.map(t=>t instanceof lm?t:new lm(t))),this.value=t,this.params=e}}function dm(t,e,i,s){return new Error(`failed to ${t} "${r=e,Array.isArray(r)?JSON.stringify(r):r instanceof Map?"Map{}":r instanceof Set?"Set{}":"object"==typeof r?JSON.stringify(r):String(r)}" as ${i}`,{cause:s});var r}function hm(t,e,i){return dm("serialize",t,e,i)}class cm{constructor(t){this.description=t}}const um="Bare Item";function fm(t){if(!1===ArrayBuffer.isView(t))throw hm(t,"Byte Sequence");return`:${e=t,btoa(String.fromCharCode(...e))}:`;var e}function gm(t){if(function(t){return t<-999999999999999||999999999999999<t}(t))throw hm(t,"Integer");return t.toString()}function mm(t,e){if(t<0)return-mm(-t,e);const i=Math.pow(10,e);if(Math.abs(t*i%1-.5)<Number.EPSILON){const e=Math.floor(t*i);return(e%2==0?e:e+1)/i}return Math.round(t*i)/i}function pm(t){const e=mm(t,3);if(Math.floor(Math.abs(e)).toString().length>12)throw hm(t,"Decimal");const i=e.toString();return i.includes(".")?i:`${i}.0`}const Am=/[\x00-\x1f\x7f]+/;function vm(t){const e=(i=t).description||i.toString().slice(7,-1);var i;if(!1===/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(e))throw hm(e,"Token");return e}function ym(t){switch(typeof t){case"number":if(!Ul(t))throw hm(t,um);return Number.isInteger(t)?gm(t):pm(t);case"string":return function(t){if(Am.test(t))throw hm(t,"String");return`"${t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}(t);case"symbol":return vm(t);case"boolean":return function(t){if("boolean"!=typeof t)throw hm(t,"Boolean");return t?"?1":"?0"}(t);case"object":if(t instanceof Date)return function(t){return`@${gm(t.getTime()/1e3)}`}(t);if(t instanceof Uint8Array)return fm(t);if(t instanceof cm)return vm(t);default:throw hm(t,um)}}function Em(t){if(!1===/^[a-z*][a-z0-9\-_.*]*$/.test(t))throw hm(t,"Key");return t}function Tm(t){return null==t?"":Object.entries(t).map(([t,e])=>!0===e?`;${Em(t)}`:`;${Em(t)}=${ym(e)}`).join("")}function Sm(t){return t instanceof lm?`${ym(t.value)}${Tm(t.params)}`:ym(t)}function bm(t,e={whitespace:!0}){if("object"!=typeof t||null==t)throw hm(t,"Dict");const i=t instanceof Map?t.entries():Object.entries(t),s=(null==e?void 0:e.whitespace)?" ":"";return Array.from(i).map(([t,e])=>{e instanceof lm==!1&&(e=new lm(e));let i=Em(t);var s;return!0===e.value?i+=Tm(e.params):(i+="=",Array.isArray(e.value)?i+=`(${(s=e).value.map(Sm).join(" ")})${Tm(s.params)}`:i+=Sm(e)),i}).join(`,${s}`)}function Im(t,e){return bm(t,e)}const Lm="CMCD-Object",Rm="CMCD-Request",km="CMCD-Session",wm="CMCD-Status",Dm={br:Lm,ab:Lm,d:Lm,ot:Lm,tb:Lm,tpb:Lm,lb:Lm,tab:Lm,lab:Lm,url:Lm,pb:Rm,bl:Rm,tbl:Rm,dl:Rm,ltc:Rm,mtp:Rm,nor:Rm,nrr:Rm,rc:Rm,sn:Rm,sta:Rm,su:Rm,ttfb:Rm,ttfbb:Rm,ttlb:Rm,cmsdd:Rm,cmsds:Rm,smrt:Rm,df:Rm,cs:Rm,ts:Rm,cid:km,pr:km,sf:km,sid:km,st:km,v:km,msd:km,bs:wm,bsd:wm,cdn:wm,rtp:wm,bg:wm,pt:wm,ec:wm,e:wm},Cm=Rm;function xm(t,e){const i={};if(!t)return i;const s=Object.keys(t),r=e?(n=e,Object.keys(n).reduce((t,e)=>{var i;return null===(i=n[e])||void 0===i||i.forEach(i=>t[i]=e),t},{})):{};var n;return s.reduce((e,i)=>{var s;const n=Dm[i]||r[i]||Cm;return(null!==(s=e[n])&&void 0!==s?s:e[n]={})[i]=t[i],e},i)}const Pm="event";const Mm=t=>Math.round(t),Om=(t,e)=>Array.isArray(t)?t.map(t=>Om(t,e)):t instanceof lm&&"string"==typeof t.value?new lm(Om(t.value,e),t.params):(e.baseUrl&&(t=function(t,e){const i=new URL(t),s=new URL(e);if(i.origin!==s.origin)return t;const r=i.pathname.split("/").slice(1),n=s.pathname.split("/").slice(1,-1);for(;r[0]===n[0];)r.shift(),n.shift();for(;n.length;)n.shift(),r.unshift("..");return r.join("/")+i.search+i.hash}(t,e.baseUrl)),1===e.version?encodeURIComponent(t):t),Bm=t=>100*Mm(t/100),Fm={br:Mm,d:Mm,bl:Bm,dl:Bm,mtp:Bm,nor:(t,e)=>{let i=t;return e.version>=2&&(t instanceof lm&&"string"==typeof t.value?i=new lm([t]):"string"==typeof t&&(i=[t])),Om(i,e)},rtp:Bm,tb:Mm},Nm="request",_m="response",Um=["ab","bg","bl","br","bs","bsd","cdn","cid","cs","df","ec","lab","lb","ltc","msd","mtp","pb","pr","pt","sf","sid","sn","st","sta","tab","tb","tbl","tpb","ts","v"],Hm=["e"],jm=/^[a-zA-Z0-9-.]+-[a-zA-Z0-9-.]+$/;function Vm(t){return jm.test(t)}const Gm=["d","dl","nor","ot","rtp","su"];const Qm=["cmsdd","cmsds","rc","smrt","ttfb","ttfbb","ttlb","url"];const Km=["bl","br","bs","cid","d","dl","mtp","nor","nrr","ot","pr","rtp","sf","sid","st","su","tb","v"];function qm(t){return Km.includes(t)||Vm(t)}const Wm={[_m]:function(t){return Um.includes(t)||Gm.includes(t)||Qm.includes(t)||Vm(t)},[Pm]:function(t){return Um.includes(t)||Hm.includes(t)||Vm(t)},[Nm]:function(t){return Um.includes(t)||Gm.includes(t)||Vm(t)}};function Ym(t,e={}){const i={};if(null==t||"object"!=typeof t)return i;const s=e.version||t.v||1,r=e.reportingMode||Nm,n=1===s?qm:Wm[r];let a=Object.keys(t).filter(n);const o=e.filter;"function"==typeof o&&(a=a.filter(o));const l=r===_m||r===Pm;l&&!a.includes("ts")&&a.push("ts"),s>1&&!a.includes("v")&&a.push("v");const d=ed({},Fm,e.formatters),h={version:s,reportingMode:r,baseUrl:e.baseUrl};return a.sort().forEach(e=>{let r=t[e];const n=d[e];if("function"==typeof n&&(r=n(r,h)),"v"===e){if(1===s)return;r=s}"pr"==e&&1===r||(l&&"ts"===e&&!Ul(r)&&(r=Date.now()),function(t){return"number"==typeof t?Ul(t):null!=t&&""!==t&&!1!==t}(r)&&(function(t){return["ot","sf","st","e","sta"].includes(t)}(e)&&"string"==typeof r&&(r=new cm(r)),i[e]=r))}),i}function $m(t,e,i){return ed(t,function(t,e={}){const i={};if(!t)return i;const s=xm(Ym(t,e),null==e?void 0:e.customHeaderMap);return Object.entries(s).reduce((t,[e,i])=>{const s=Im(i,{whitespace:!1});return s&&(t[e]=s),t},i)}(e,i))}function zm(t,e={}){if(!t)return"";const i=function(t,e={}){return t?Im(Ym(t,e),{whitespace:!1}):""}(t,e);return encodeURIComponent(i)}const Xm=/CMCD=[^&#]+/;function Zm(t,e,i){const s=function(t,e={}){return t?`CMCD=${zm(t,e)}`:""}(e,i);if(!s)return t;if(Xm.test(t))return t.replace(Xm,s);const r=t.includes("?")?"&":"?";return`${t}${r}${s}`}function Jm(t,e,i,s){t&&Object.keys(e).forEach(r=>{const n=t.filter(t=>t.groupId===r).map(t=>{const n=ed({},t);return n.details=void 0,n.attrs=new qc(n.attrs),n.url=n.attrs.URI=tp(t.url,t.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",i),n.groupId=n.attrs["GROUP-ID"]=e[r],n.attrs["PATHWAY-ID"]=s,n});t.push(...n)})}function tp(t,e,i,s){const{HOST:r,PARAMS:n,[i]:a}=s;let o;e&&(o=null==a?void 0:a[e],o&&(t=o));const l=new self.URL(t);return r&&!o&&(l.host=r),n&&Object.keys(n).sort().forEach(t=>{t&&l.searchParams.set(t,n[t])}),l.href}class ep extends rd{constructor(t){super("eme",t.logger),this.hls=void 0,this.config=void 0,this.media=null,this.mediaResolved=void 0,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.mediaKeys=null,this.setMediaKeysQueue=ep.CDMCleanupPromise?[ep.CDMCleanupPromise]:[],this.bannedKeyIds={},this.onMediaEncrypted=t=>{const{initDataType:e,initData:i}=t,s=`"${t.type}" event: init data type: "${e}"`;if(this.debug(s),null!==i){if(!this.keyFormatPromise){let t=Object.keys(this.keySystemAccessPromises);t.length||(t=fu(this.config));const e=t.map(uu).filter(t=>!!t);this.keyFormatPromise=this.getKeyFormatPromise(e)}this.keyFormatPromise.then(r=>{const n=cu(r);if("sinf"!==e||n!==au.FAIRPLAY)return void this.log(`Ignoring "${t.type}" event with init data type: "${e}" for selected key-system ${n}`);let a;try{const t=Nd(new Uint8Array(i)),e=Xd(eu(JSON.parse(t).sinf));if(!e)throw new Error("'schm' box missing or not cbcs/cenc with schi > tenc");a=new Uint8Array(e.subarray(8,24))}catch(c){return void this.warn(`${s} Failed to parse sinf: ${c}`)}const o=gd(a),{keyIdToKeySessionPromise:l,mediaKeySessions:d}=this;let h=l[o];for(let t=0;t<d.length;t++){const s=d[t],r=s.decryptdata;if(!r.keyId)continue;const n=gd(r.keyId);if(Xc(a,r.keyId)||-1!==r.uri.replace(/-/g,"").indexOf(o)){if(h=l[n],!h)continue;if(r.pssh)break;delete l[n],r.pssh=new Uint8Array(i),r.keyId=a,h=l[o]=h.then(()=>this.generateRequestWithPreferredKeySession(s,e,i,"encrypted-event-key-match")),h.catch(t=>this.handleError(t));break}}h||this.handleError(new Error(`Key ID ${o} not encountered in playlist. Key-system sessions ${d.length}.`))}).catch(t=>this.handleError(t))}},this.onWaitingForKey=t=>{this.log(`"${t.type}" event`)},this.hls=t,this.config=t.config,this.registerListeners()}destroy(){this.onDestroying(),this.onMediaDetached();const t=this.config;t.requestMediaKeySystemAccessFunc=null,t.licenseXhrSetup=t.licenseResponseCallback=void 0,t.drmSystems=t.drmSystemOptions={},this.hls=this.config=this.keyIdToKeySessionPromise=null,this.onMediaEncrypted=this.onWaitingForKey=null}registerListeners(){this.hls.on(Ql.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(Ql.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(Ql.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(Ql.MANIFEST_LOADED,this.onManifestLoaded,this),this.hls.on(Ql.DESTROYING,this.onDestroying,this)}unregisterListeners(){this.hls.off(Ql.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(Ql.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(Ql.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(Ql.MANIFEST_LOADED,this.onManifestLoaded,this),this.hls.off(Ql.DESTROYING,this.onDestroying,this)}getLicenseServerUrl(t){const{drmSystems:e,widevineLicenseUrl:i}=this.config,s=null==e?void 0:e[t];return s?s.licenseUrl:t===au.WIDEVINE&&i?i:void 0}getLicenseServerUrlOrThrow(t){const e=this.getLicenseServerUrl(t);if(void 0===e)throw new Error(`no license server URL configured for key-system "${t}"`);return e}getServerCertificateUrl(t){const{drmSystems:e}=this.config,i=null==e?void 0:e[t];if(i)return i.serverCertificateUrl;this.log(`No Server Certificate in config.drmSystems["${t}"]`)}attemptKeySystemAccess(t){const e=this.hls.levels,i=(t,e,i)=>!!t&&i.indexOf(t)===e,s=e.map(t=>t.audioCodec).filter(i),r=e.map(t=>t.videoCodec).filter(i);return s.length+r.length===0&&r.push("avc1.42e01e"),new Promise((e,i)=>{const n=t=>{const a=t.shift();this.getMediaKeysPromise(a,s,r).then(t=>e({keySystem:a,mediaKeys:t})).catch(e=>{t.length?n(t):i(e instanceof rp?e:new rp({type:Vl.KEY_SYSTEM_ERROR,details:Gl.KEY_SYSTEM_NO_ACCESS,error:e,fatal:!0},e.message))})};n(t)})}requestMediaKeySystemAccess(t,e){const{requestMediaKeySystemAccessFunc:i}=this.config;if("function"!=typeof i){let t=`Configured requestMediaKeySystemAccess is not a function ${i}`;return null===gu&&"http:"===self.location.protocol&&(t=`navigator.requestMediaKeySystemAccess is not available over insecure protocol ${location.protocol}`),Promise.reject(new Error(t))}return i(t,e)}getMediaKeysPromise(t,e,i){var s;const r=function(t,e,i,s){let r;switch(t){case au.FAIRPLAY:r=["cenc","sinf"];break;case au.WIDEVINE:case au.PLAYREADY:r=["cenc"];break;case au.CLEARKEY:r=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${t}`)}return function(t,e,i,s){return[{initDataTypes:t,persistentState:s.persistentState||"optional",distinctiveIdentifier:s.distinctiveIdentifier||"optional",sessionTypes:s.sessionTypes||[s.sessionType||"temporary"],audioCapabilities:e.map(t=>({contentType:`audio/mp4; codecs=${t}`,robustness:s.audioRobustness||"",encryptionScheme:s.audioEncryptionScheme||null})),videoCapabilities:i.map(t=>({contentType:`video/mp4; codecs=${t}`,robustness:s.videoRobustness||"",encryptionScheme:s.videoEncryptionScheme||null}))}]}(r,e,i,s)}(t,e,i,this.config.drmSystemOptions||{});let n=this.keySystemAccessPromises[t],a=null==(s=n)?void 0:s.keySystemAccess;if(!a){this.log(`Requesting encrypted media "${t}" key-system access with config: ${Uh(r)}`),a=this.requestMediaKeySystemAccess(t,r);const e=n=this.keySystemAccessPromises[t]={keySystemAccess:a};return a.catch(e=>{this.log(`Failed to obtain access to key-system "${t}": ${e}`)}),a.then(i=>{this.log(`Access for key-system "${i.keySystem}" obtained`);const s=this.fetchServerCertificate(t);this.log(`Create media-keys for "${t}"`);const r=e.mediaKeys=i.createMediaKeys().then(i=>(this.log(`Media-keys created for "${t}"`),e.hasMediaKeys=!0,s.then(e=>e?this.setMediaKeysServerCertificate(i,t,e):i)));return r.catch(e=>{this.error(`Failed to create media-keys for "${t}"}: ${e}`)}),r})}return a.then(()=>n.mediaKeys)}createMediaKeySessionContext({decryptdata:t,keySystem:e,mediaKeys:i}){this.log(`Creating key-system session "${e}" keyId: ${gd(t.keyId||[])} keyUri: ${t.uri}`);const s=i.createSession(),r={decryptdata:t,keySystem:e,mediaKeys:i,mediaKeysSession:s,keyStatus:"status-pending"};return this.mediaKeySessions.push(r),r}renewKeySession(t){const e=t.decryptdata;if(e.pssh){const i=this.createMediaKeySessionContext(t),s=ip(e),r="cenc";this.keyIdToKeySessionPromise[s]=this.generateRequestWithPreferredKeySession(i,r,e.pssh.buffer,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(t)}updateKeySession(t,e){const i=t.mediaKeysSession;return this.log(`Updating key-session "${i.sessionId}" for keyId ${gd(t.decryptdata.keyId||[])}\n } (data length: ${e.byteLength})`),i.update(e)}getSelectedKeySystemFormats(){return Object.keys(this.keySystemAccessPromises).map(t=>({keySystem:t,hasMediaKeys:this.keySystemAccessPromises[t].hasMediaKeys})).filter(({hasMediaKeys:t})=>!!t).map(({keySystem:t})=>uu(t)).filter(t=>!!t)}getKeySystemAccess(t){return this.getKeySystemSelectionPromise(t).then(({keySystem:t,mediaKeys:e})=>this.attemptSetMediaKeys(t,e))}selectKeySystem(t){return new Promise((e,i)=>{this.getKeySystemSelectionPromise(t).then(({keySystem:t})=>{const s=uu(t);s?e(s):i(new Error(`Unable to find format for key-system "${t}"`))}).catch(i)})}selectKeySystemFormat(t){const e=Object.keys(t.levelkeys||{});return this.keyFormatPromise||(this.log(`Selecting key-system from fragment (sn: ${t.sn} ${t.type}: ${t.level}) key formats ${e.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(e)),this.keyFormatPromise}getKeyFormatPromise(t){const e=fu(this.config),i=t.map(cu).filter(t=>!!t&&-1!==e.indexOf(t));return this.selectKeySystem(i)}getKeyStatus(t){const{mediaKeySessions:e}=this;for(let i=0;i<e.length;i++){const s=sp(t,e[i]);if(s)return s}}loadKey(t){const e=t.keyInfo.decryptdata,i=ip(e),s=this.bannedKeyIds[i];if(s||"internal-error"===this.getKeyStatus(e)){const i=np(s||"internal-error",e);return this.handleError(i,t.frag),Promise.reject(i)}const r=`(keyId: ${i} format: "${e.keyFormat}" method: ${e.method} uri: ${e.uri})`;this.log(`Starting session for key ${r}`);const n=this.keyIdToKeySessionPromise[i];if(!n){const s=this.getKeySystemForKeyPromise(e).then(({keySystem:i,mediaKeys:s})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${t.frag.sn} ${t.frag.type}: ${t.frag.level} using key ${r}`),this.attemptSetMediaKeys(i,s).then(()=>(this.throwIfDestroyed(),this.createMediaKeySessionContext({keySystem:i,mediaKeys:s,decryptdata:e}))))).then(t=>{const i=e.pssh?e.pssh.buffer:null;return this.generateRequestWithPreferredKeySession(t,"cenc",i,"playlist-key")});return s.catch(e=>this.handleError(e,t.frag)),this.keyIdToKeySessionPromise[i]=s,s}return n.catch(i=>{if(i instanceof rp){const s=sd({},i.data);"internal-error"===this.getKeyStatus(e)&&(s.decryptdata=e);const r=new rp(s,i.message);this.handleError(r,t.frag)}}),n}throwIfDestroyed(t="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(t,e){if(this.hls)if(t instanceof rp){e&&(t.data.frag=e);const i=t.data.decryptdata;this.error(`${t.message}${i?` (${gd(i.keyId||[])})`:""}`),this.hls.trigger(Ql.ERROR,t.data)}else this.error(t.message),this.hls.trigger(Ql.ERROR,{type:Vl.KEY_SYSTEM_ERROR,details:Gl.KEY_SYSTEM_NO_KEYS,error:t,fatal:!0})}getKeySystemForKeyPromise(t){const e=ip(t),i=this.keyIdToKeySessionPromise[e];if(!i){const e=cu(t.keyFormat),i=e?[e]:fu(this.config);return this.attemptKeySystemAccess(i)}return i}getKeySystemSelectionPromise(t){if(t.length||(t=fu(this.config)),0===t.length)throw new rp({type:Vl.KEY_SYSTEM_ERROR,details:Gl.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${Uh({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(t)}attemptSetMediaKeys(t,e){if(this.mediaResolved=void 0,this.mediaKeys===e)return Promise.resolve();const i=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${t}"`);const s=Promise.all(i).then(()=>this.media?this.media.setMediaKeys(e):new Promise((t,i)=>{this.mediaResolved=()=>{if(this.mediaResolved=void 0,!this.media)return i(new Error("Attempted to set mediaKeys without media element attached"));this.mediaKeys=e,this.media.setMediaKeys(e).then(t).catch(i)}}));return this.mediaKeys=e,this.setMediaKeysQueue.push(s),s.then(()=>{this.log(`Media-keys set for "${t}"`),i.push(s),this.setMediaKeysQueue=this.setMediaKeysQueue.filter(t=>-1===i.indexOf(t))})}generateRequestWithPreferredKeySession(t,e,i,s){var r;const n=null==(r=this.config.drmSystems)||null==(r=r[t.keySystem])?void 0:r.generateRequest;if(n)try{const s=n.call(this.hls,e,i,t);if(!s)throw new Error("Invalid response from configured generateRequest filter");e=s.initDataType,i=s.initData?s.initData:null,t.decryptdata.pssh=i?new Uint8Array(i):null}catch(f){if(this.warn(f.message),this.hls&&this.hls.config.debug)throw f}if(null===i)return this.log(`Skipping key-session request for "${s}" (no initData)`),Promise.resolve(t);const a=ip(t.decryptdata),o=t.decryptdata.uri;this.log(`Generating key-session request for "${s}" keyId: ${a} URI: ${o} (init data type: ${e} length: ${i.byteLength})`);const l=new bf,d=t._onmessage=e=>{const i=t.mediaKeysSession;if(!i)return void l.emit("error",new Error("invalid state"));const{messageType:s,message:r}=e;this.log(`"${s}" message event for session "${i.sessionId}" message size: ${r.byteLength}`),"license-request"===s||"license-renewal"===s?this.renewLicense(t,r).catch(t=>{l.eventNames().length?l.emit("error",t):this.handleError(t)}):"license-release"===s?t.keySystem===au.FAIRPLAY&&this.updateKeySession(t,iu("acknowledged")).then(()=>this.removeSession(t)).catch(t=>this.handleError(t)):this.warn(`unhandled media key message type "${s}"`)},h=(t,e)=>{let i;e.keyStatus=t,t.startsWith("usable")?l.emit("resolved"):"internal-error"===t||"output-restricted"===t||"output-downscaled"===t?i=np(t,e.decryptdata):"expired"===t?i=new Error(`key expired (keyId: ${a})`):"released"===t?i=new Error("key released"):"status-pending"===t||this.warn(`unhandled key status change "${t}" (keyId: ${a})`),i&&(l.eventNames().length?l.emit("error",i):this.handleError(i))},c=t._onkeystatuseschange=e=>{if(!t.mediaKeysSession)return void l.emit("error",new Error("invalid state"));const i=this.getKeyStatuses(t);if(!Object.keys(i).some(t=>"status-pending"!==i[t]))return;if("expired"===i[a])return this.log(`Expired key ${Uh(i)} in key-session "${t.mediaKeysSession.sessionId}"`),void this.renewKeySession(t);let s=i[a];if(s)h(s,t);else{var r;const e=1e3;t.keyStatusTimeouts||(t.keyStatusTimeouts={}),(r=t.keyStatusTimeouts)[a]||(r[a]=self.setTimeout(()=>{if(!t.mediaKeysSession||!this.mediaKeys)return;const i=this.getKeyStatus(t.decryptdata);if(i&&"status-pending"!==i)return this.log(`No status for keyId ${a} in key-session "${t.mediaKeysSession.sessionId}". Using session key-status ${i} from other session.`),h(i,t);this.log(`key status for ${a} in key-session "${t.mediaKeysSession.sessionId}" timed out after ${e}ms`),s="internal-error",h(s,t)},e)),this.log(`No status for keyId ${a} (${Uh(i)}).`)}};ef(t.mediaKeysSession,"message",d),ef(t.mediaKeysSession,"keystatuseschange",c);const u=new Promise((t,e)=>{l.on("error",e),l.on("resolved",t)});return t.mediaKeysSession.generateRequest(e,i).then(()=>{this.log(`Request generated for key-session "${t.mediaKeysSession.sessionId}" keyId: ${a} URI: ${o}`)}).catch(e=>{throw new rp({type:Vl.KEY_SYSTEM_ERROR,details:Gl.KEY_SYSTEM_NO_SESSION,error:e,decryptdata:t.decryptdata,fatal:!1},`Error generating key-session request: ${e}`)}).then(()=>u).catch(e=>(l.removeAllListeners(),this.removeSession(t).then(()=>{throw e}))).then(()=>(l.removeAllListeners(),t))}getKeyStatuses(t){const e={};return t.mediaKeysSession.keyStatuses.forEach((i,s)=>{if("string"==typeof s&&"object"==typeof i){const t=s;s=i,i=t}const r="buffer"in s?new Uint8Array(s.buffer,s.byteOffset,s.byteLength):new Uint8Array(s);if(t.keySystem===au.PLAYREADY&&16===r.length){const t=gd(r);e[t]=i,su(r)}const n=gd(r);"internal-error"===i&&(this.bannedKeyIds[n]=i),this.log(`key status change "${i}" for keyStatuses keyId: ${n} key-session "${t.mediaKeysSession.sessionId}"`),e[n]=i}),e}fetchServerCertificate(t){const e=this.config,i=new(0,e.loader)(e),s=this.getServerCertificateUrl(t);return s?(this.log(`Fetching server certificate for "${t}"`),new Promise((r,n)=>{const a={responseType:"arraybuffer",url:s},o=e.certLoadPolicy.default,l={loadPolicy:o,timeout:o.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},d={onSuccess:(t,e,i,s)=>{r(t.data)},onError:(e,i,r,o)=>{n(new rp({type:Vl.KEY_SYSTEM_ERROR,details:Gl.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:r,response:sd({url:a.url,data:void 0},e)},`"${t}" certificate request failed (${s}). Status: ${e.code} (${e.text})`))},onTimeout:(e,i,r)=>{n(new rp({type:Vl.KEY_SYSTEM_ERROR,details:Gl.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:r,response:{url:a.url,data:void 0}},`"${t}" certificate request timed out (${s})`))},onAbort:(t,e,i)=>{n(new Error("aborted"))}};i.load(a,l,d)})):Promise.resolve()}setMediaKeysServerCertificate(t,e,i){return new Promise((s,r)=>{t.setServerCertificate(i).then(r=>{this.log(`setServerCertificate ${r?"success":"not supported by CDM"} (${i.byteLength}) on "${e}"`),s(t)}).catch(t=>{r(new rp({type:Vl.KEY_SYSTEM_ERROR,details:Gl.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:t,fatal:!0},t.message))})})}renewLicense(t,e){return this.requestLicense(t,new Uint8Array(e)).then(e=>this.updateKeySession(t,new Uint8Array(e)).catch(e=>{throw new rp({type:Vl.KEY_SYSTEM_ERROR,details:Gl.KEY_SYSTEM_SESSION_UPDATE_FAILED,decryptdata:t.decryptdata,error:e,fatal:!1},e.message)}))}unpackPlayReadyKeyMessage(t,e){const i=String.fromCharCode.apply(null,new Uint16Array(e.buffer));if(!i.includes("PlayReadyKeyMessage"))return t.setRequestHeader("Content-Type","text/xml; charset=utf-8"),e;const s=(new DOMParser).parseFromString(i,"application/xml"),r=s.querySelectorAll("HttpHeader");if(r.length>0){let e;for(let i=0,s=r.length;i<s;i++){var n,a;e=r[i];const s=null==(n=e.querySelector("name"))?void 0:n.textContent,o=null==(a=e.querySelector("value"))?void 0:a.textContent;s&&o&&t.setRequestHeader(s,o)}}const o=s.querySelector("Challenge"),l=null==o?void 0:o.textContent;if(!l)throw new Error("Cannot find <Challenge> in key message");return iu(atob(l))}setupLicenseXHR(t,e,i,s){const r=this.config.licenseXhrSetup;return r?Promise.resolve().then(()=>{if(!i.decryptdata)throw new Error("Key removed");return r.call(this.hls,t,e,i,s)}).catch(n=>{if(!i.decryptdata)throw n;return t.open("POST",e,!0),r.call(this.hls,t,e,i,s)}).then(i=>{t.readyState||t.open("POST",e,!0);return{xhr:t,licenseChallenge:i||s}}):(t.open("POST",e,!0),Promise.resolve({xhr:t,licenseChallenge:s}))}requestLicense(t,e){const i=this.config.keyLoadPolicy.default;return new Promise((s,r)=>{const n=this.getLicenseServerUrlOrThrow(t.keySystem);this.log(`Sending license request to URL: ${n}`);const a=new XMLHttpRequest;a.responseType="arraybuffer",a.onreadystatechange=()=>{if(!this.hls||!t.mediaKeysSession)return r(new Error("invalid state"));if(4===a.readyState)if(200===a.status){this._requestLicenseFailureCount=0;let e=a.response;this.log(`License received ${e instanceof ArrayBuffer?e.byteLength:e}`);const i=this.config.licenseResponseCallback;if(i)try{e=i.call(this.hls,a,n,t)}catch(o){this.error(o)}s(e)}else{const o=i.errorRetry,l=o?o.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>l||a.status>=400&&a.status<500)r(new rp({type:Vl.KEY_SYSTEM_ERROR,details:Gl.KEY_SYSTEM_LICENSE_REQUEST_FAILED,decryptdata:t.decryptdata,fatal:!0,networkDetails:a,response:{url:n,data:void 0,code:a.status,text:a.statusText}},`License Request XHR failed (${n}). Status: ${a.status} (${a.statusText})`));else{const i=l-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${i} attempts left`),this.requestLicense(t,e).then(s,r)}}},t.licenseXhr&&t.licenseXhr.readyState!==XMLHttpRequest.DONE&&t.licenseXhr.abort(),t.licenseXhr=a,this.setupLicenseXHR(a,n,t,e).then(({xhr:e,licenseChallenge:i})=>{t.keySystem==au.PLAYREADY&&(i=this.unpackPlayReadyKeyMessage(e,i)),e.send(i)}).catch(r)})}onDestroying(){this.unregisterListeners(),this._clear()}onMediaAttached(t,e){if(!this.config.emeEnabled)return;const i=e.media;this.media=i,ef(i,"encrypted",this.onMediaEncrypted),ef(i,"waitingforkey",this.onWaitingForKey);const s=this.mediaResolved;s?s():this.mediaKeys=i.mediaKeys}onMediaDetached(){const t=this.media;t&&(sf(t,"encrypted",this.onMediaEncrypted),sf(t,"waitingforkey",this.onWaitingForKey),this.media=null,this.mediaKeys=null)}_clear(){var t;this._requestLicenseFailureCount=0,this.keyIdToKeySessionPromise={},this.bannedKeyIds={};const e=this.mediaResolved;if(e&&e(),!this.mediaKeys&&!this.mediaKeySessions.length)return;const i=this.media,s=this.mediaKeySessions.slice();this.mediaKeySessions=[],this.mediaKeys=null,vu.clearKeyUriToKeyIdMap();const r=s.length;ep.CDMCleanupPromise=Promise.all(s.map(t=>this.removeSession(t)).concat((null==i||null==(t=i.setMediaKeys(null))?void 0:t.catch(t=>{this.log(`Could not clear media keys: ${t}`),this.hls&&this.hls.trigger(Ql.ERROR,{type:Vl.OTHER_ERROR,details:Gl.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR,fatal:!1,error:new Error(`Could not clear media keys: ${t}`)})}))||Promise.resolve())).catch(t=>{this.log(`Could not close sessions and clear media keys: ${t}`),this.hls&&this.hls.trigger(Ql.ERROR,{type:Vl.OTHER_ERROR,details:Gl.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close sessions and clear media keys: ${t}`)})}).then(()=>{r&&this.log("finished closing key sessions and clearing media keys")})}onManifestLoading(){this._clear()}onManifestLoaded(t,{sessionKeys:e}){if(e&&this.config.emeEnabled&&!this.keyFormatPromise){const t=e.reduce((t,e)=>(-1===t.indexOf(e.keyFormat)&&t.push(e.keyFormat),t),[]);this.log(`Selecting key-system from session-keys ${t.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(t)}}removeSession(t){const{mediaKeysSession:e,licenseXhr:i,decryptdata:s}=t;if(e){this.log(`Remove licenses and keys and close session "${e.sessionId}" keyId: ${gd((null==s?void 0:s.keyId)||[])}`),t._onmessage&&(e.removeEventListener("message",t._onmessage),t._onmessage=void 0),t._onkeystatuseschange&&(e.removeEventListener("keystatuseschange",t._onkeystatuseschange),t._onkeystatuseschange=void 0),i&&i.readyState!==XMLHttpRequest.DONE&&i.abort(),t.mediaKeysSession=t.decryptdata=t.licenseXhr=void 0;const r=this.mediaKeySessions.indexOf(t);r>-1&&this.mediaKeySessions.splice(r,1);const{keyStatusTimeouts:n}=t;n&&Object.keys(n).forEach(t=>self.clearTimeout(n[t]));const{drmSystemOptions:a}=this.config,o=function(t){var e;return!(!t||"persistent-license"!==t.sessionType&&(null==(e=t.sessionTypes)||!e.some(t=>"persistent-license"===t)))}(a)?new Promise((t,i)=>{self.setTimeout(()=>i(new Error("MediaKeySession.remove() timeout")),8e3),e.remove().then(t).catch(i)}):Promise.resolve();return o.catch(t=>{this.log(`Could not remove session: ${t}`),this.hls&&this.hls.trigger(Ql.ERROR,{type:Vl.OTHER_ERROR,details:Gl.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR,fatal:!1,error:new Error(`Could not remove session: ${t}`)})}).then(()=>e.close()).catch(t=>{this.log(`Could not close session: ${t}`),this.hls&&this.hls.trigger(Ql.ERROR,{type:Vl.OTHER_ERROR,details:Gl.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close session: ${t}`)})})}return Promise.resolve()}}function ip(t){if(!t)throw new Error("Could not read keyId of undefined decryptdata");if(null===t.keyId)throw new Error("keyId is null");return gd(t.keyId)}function sp(t,e){return t.keyId&&e.mediaKeysSession.keyStatuses.has(t.keyId)?e.mediaKeysSession.keyStatuses.get(t.keyId):t.matches(e.decryptdata)?e.keyStatus:void 0}ep.CDMCleanupPromise=void 0;class rp extends Error{constructor(t,e){super(e),this.data=void 0,t.error||(t.error=new Error(e)),this.data=t,t.err=t.error}}function np(t,e){const i="output-restricted"===t,s=i?Gl.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:Gl.KEY_SYSTEM_STATUS_INTERNAL_ERROR;return new rp({type:Vl.KEY_SYSTEM_ERROR,details:s,fatal:!1,decryptdata:e},i?"HDCP level output restricted":`key status changed to "${t}"`)}function ap(t,e){let i;try{i=new Event("addtrack")}catch(wE){i=document.createEvent("Event"),i.initEvent("addtrack",!1,!1)}i.track=t,e.dispatchEvent(i)}function op(t,e){const i=t.mode;if("disabled"===i&&(t.mode="hidden"),t.cues&&!t.cues.getCueById(e.id))try{if(t.addCue(e),!t.cues.getCueById(e.id))throw new Error(`addCue is failed for: ${e}`)}catch(wE){hd.debug(`[texttrack-utils]: ${wE}`);try{const i=new self.TextTrackCue(e.startTime,e.endTime,e.text);i.id=e.id,t.addCue(i)}catch(s){hd.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${s}`)}}"disabled"===i&&(t.mode=i)}function lp(t,e){const i=t.mode;if("disabled"===i&&(t.mode="hidden"),t.cues)for(let s=t.cues.length;s--;)e&&t.cues[s].removeEventListener("enter",e),t.removeCue(t.cues[s]);"disabled"===i&&(t.mode=i)}function dp(t,e,i,s){const r=t.mode;if("disabled"===r&&(t.mode="hidden"),t.cues&&t.cues.length>0){const r=function(t,e,i){const s=[],r=function(t,e){if(e<=t[0].startTime)return 0;const i=t.length-1;if(e>t[i].endTime)return-1;let s,r=0,n=i;for(;r<=n;)if(s=Math.floor((n+r)/2),e<t[s].startTime)n=s-1;else{if(!(e>t[s].startTime&&r<i))return s;r=s+1}return t[r].startTime-e<e-t[n].startTime?r:n}(t,e);if(r>-1)for(let n=r,a=t.length;n<a;n++){const r=t[n];if(r.startTime>=e&&r.endTime<=i)s.push(r);else if(r.startTime>i)return s}return s}(t.cues,e,i);for(let e=0;e<r.length;e++)s&&!s(r[e])||t.removeCue(r[e])}"disabled"===r&&(t.mode=r)}function hp(t){const e=[];for(let i=0;i<t.length;i++){const s=t[i];"subtitles"!==s.kind&&"captions"!==s.kind||!s.label||e.push(t[i])}return e}function cp(t){let e=5381,i=t.length;for(;i;)e=33*e^t.charCodeAt(--i);return(e>>>0).toString()}const up=.025;let fp=function(t){return t[t.Point=0]="Point",t[t.Range=1]="Range",t}({});function gp(t,e,i){return`${t.identifier}-${i+1}-${cp(e)}`}class mp{constructor(t,e){this.base=void 0,this._duration=null,this._timelineStart=null,this.appendInPlaceDisabled=void 0,this.appendInPlaceStarted=void 0,this.dateRange=void 0,this.hasPlayed=!1,this.cumulativeDuration=0,this.resumeOffset=NaN,this.playoutLimit=NaN,this.restrictions={skip:!1,jump:!1},this.snapOptions={out:!1,in:!1},this.assetList=[],this.assetListLoader=void 0,this.assetListResponse=null,this.resumeAnchor=void 0,this.error=void 0,this.resetOnResume=void 0,this.base=e,this.dateRange=t,this.setDateRange(t)}setDateRange(t){this.dateRange=t,this.resumeOffset=t.attr.optionalFloat("X-RESUME-OFFSET",this.resumeOffset),this.playoutLimit=t.attr.optionalFloat("X-PLAYOUT-LIMIT",this.playoutLimit),this.restrictions=t.attr.enumeratedStringList("X-RESTRICT",this.restrictions),this.snapOptions=t.attr.enumeratedStringList("X-SNAP",this.snapOptions)}reset(){var t;this.appendInPlaceStarted=!1,null==(t=this.assetListLoader)||t.destroy(),this.assetListLoader=void 0,this.supplementsPrimary||(this.assetListResponse=null,this.assetList=[],this._duration=null)}isAssetPastPlayoutLimit(t){var e;if(t>0&&t>=this.assetList.length)return!0;const i=this.playoutLimit;if(t<=0||isNaN(i))return!1;if(0===i)return!0;return((null==(e=this.assetList[t])?void 0:e.startOffset)||0)>i}findAssetIndex(t){return this.assetList.indexOf(t)}get identifier(){return this.dateRange.id}get startDate(){return this.dateRange.startDate}get startTime(){const t=this.dateRange.startTime;if(this.snapOptions.out){const e=this.dateRange.tagAnchor;if(e)return pp(t,e)}return t}get startOffset(){return this.cue.pre?0:this.startTime}get startIsAligned(){if(0===this.startTime||this.snapOptions.out)return!0;const t=this.dateRange.tagAnchor;if(t){const e=this.dateRange.startTime;return e-pp(e,t)<.1}return!1}get resumptionOffset(){const t=this.resumeOffset,e=Ul(t)?t:this.duration;return this.cumulativeDuration+e}get resumeTime(){const t=this.startOffset+this.resumptionOffset;if(this.snapOptions.in){const e=this.resumeAnchor;if(e)return pp(t,e)}return t}get appendInPlace(){return!!this.appendInPlaceStarted||!this.appendInPlaceDisabled&&!(this.cue.once||this.cue.pre||!this.startIsAligned||!(isNaN(this.playoutLimit)&&isNaN(this.resumeOffset)||this.resumeOffset&&this.duration&&Math.abs(this.resumeOffset-this.duration)<up))}set appendInPlace(t){this.appendInPlaceStarted?this.resetOnResume=!t:this.appendInPlaceDisabled=!t}get timelineStart(){return null!==this._timelineStart?this._timelineStart:this.startTime}set timelineStart(t){this._timelineStart=t}get duration(){const t=this.playoutLimit;let e;return e=null!==this._duration?this._duration:this.dateRange.duration?this.dateRange.duration:this.dateRange.plannedDuration||0,!isNaN(t)&&t<e&&(e=t),e}set duration(t){this._duration=t}get cue(){return this.dateRange.cue}get timelineOccupancy(){return"RANGE"===this.dateRange.attr["X-TIMELINE-OCCUPIES"]?fp.Range:fp.Point}get supplementsPrimary(){return"PRIMARY"===this.dateRange.attr["X-TIMELINE-STYLE"]}get contentMayVary(){return"NO"!==this.dateRange.attr["X-CONTENT-MAY-VARY"]}get assetUrl(){return this.dateRange.attr["X-ASSET-URI"]}get assetListUrl(){return this.dateRange.attr["X-ASSET-LIST"]}get baseUrl(){return this.base.url}get assetListLoaded(){return this.assetList.length>0||null!==this.assetListResponse}toString(){return`["${(t=this).identifier}" ${t.cue.pre?"<pre>":t.cue.post?"<post>":""}${t.timelineStart.toFixed(2)}-${t.resumeTime.toFixed(2)}]`;var t}}function pp(t,e){return t-e.start<e.duration/2&&!(Math.abs(t-(e.start+e.duration))<up)?e.start:e.start+e.duration}function Ap(t,e,i){const s=new self.URL(t,i);return"data:"!==s.protocol&&s.searchParams.set("_HLS_primary_id",e),s}function vp(t,e){for(;null!=(i=t.assetList[++e])&&i.error;)var i;return e}function yp(t){const e=t.timelineStart,i=t.duration||0;return`["${t.identifier}" ${e.toFixed(2)}-${(e+i).toFixed(2)}]`}class Ep{constructor(t,e,i,s){this.hls=void 0,this.interstitial=void 0,this.assetItem=void 0,this.tracks=null,this.hasDetails=!1,this.mediaAttached=null,this._currentTime=void 0,this._bufferedEosTime=void 0,this.checkPlayout=()=>{this.reachedPlayout(this.currentTime)&&this.hls&&this.hls.trigger(Ql.PLAYOUT_LIMIT_REACHED,{})};const r=this.hls=new t(e);this.interstitial=i,this.assetItem=s;const n=()=>{this.hasDetails=!0};r.once(Ql.LEVEL_LOADED,n),r.once(Ql.AUDIO_TRACK_LOADED,n),r.once(Ql.SUBTITLE_TRACK_LOADED,n),r.on(Ql.MEDIA_ATTACHING,(t,{media:e})=>{this.removeMediaListeners(),this.mediaAttached=e;this.interstitial.playoutLimit&&(e.addEventListener("timeupdate",this.checkPlayout),this.appendInPlace&&r.on(Ql.BUFFER_APPENDED,()=>{const t=this.bufferedEnd;this.reachedPlayout(t)&&(this._bufferedEosTime=t,r.trigger(Ql.BUFFERED_TO_END,void 0))}))})}get appendInPlace(){return this.interstitial.appendInPlace}loadSource(){const t=this.hls;if(t)if(t.url)t.levels.length&&!t.started&&t.startLoad(-1,!0);else{let i=this.assetItem.uri;try{i=Ap(i,t.config.primarySessionId||"").href}catch(e){}t.loadSource(i)}}bufferedInPlaceToEnd(t){var e;if(!this.appendInPlace)return!1;if(null!=(e=this.hls)&&e.bufferedToEnd)return!0;if(!t)return!1;const i=Math.min(this._bufferedEosTime||1/0,this.duration),s=this.timelineOffset,r=_c.bufferInfo(t,s,0);return this.getAssetTime(r.end)>=i-.02}reachedPlayout(t){const e=this.interstitial.playoutLimit;return this.startOffset+t>=e}get destroyed(){var t;return!(null!=(t=this.hls)&&t.userConfig)}get assetId(){return this.assetItem.identifier}get interstitialId(){return this.assetItem.parentIdentifier}get media(){var t;return(null==(t=this.hls)?void 0:t.media)||null}get bufferedEnd(){const t=this.media||this.mediaAttached;if(!t)return this._bufferedEosTime?this._bufferedEosTime:this.currentTime;const e=_c.bufferInfo(t,t.currentTime,.001);return this.getAssetTime(e.end)}get currentTime(){const t=this.media||this.mediaAttached;return t?this.getAssetTime(t.currentTime):this._currentTime||0}get duration(){const t=this.assetItem.duration;if(!t)return 0;const e=this.interstitial.playoutLimit;if(e){const i=e-this.startOffset;if(i>0&&i<t)return i}return t}get remaining(){const t=this.duration;return t?Math.max(0,t-this.currentTime):0}get startOffset(){return this.assetItem.startOffset}get timelineOffset(){var t;return(null==(t=this.hls)?void 0:t.config.timelineOffset)||0}set timelineOffset(t){const e=this.timelineOffset;if(t!==e){const i=t-e;if(Math.abs(i)>1/9e4&&this.hls){if(this.hasDetails)throw new Error("Cannot set timelineOffset after playlists are loaded");this.hls.config.timelineOffset=t}}}getAssetTime(t){const e=this.timelineOffset,i=this.duration;return Math.min(Math.max(0,t-e),i)}removeMediaListeners(){const t=this.mediaAttached;t&&(this._currentTime=t.currentTime,this.bufferSnapShot(),t.removeEventListener("timeupdate",this.checkPlayout))}bufferSnapShot(){var t;this.mediaAttached&&(null!=(t=this.hls)&&t.bufferedToEnd&&(this._bufferedEosTime=this.bufferedEnd))}destroy(){this.removeMediaListeners(),this.hls&&this.hls.destroy(),this.hls=null,this.tracks=this.mediaAttached=this.checkPlayout=null}attachMedia(t){var e;this.loadSource(),null==(e=this.hls)||e.attachMedia(t)}detachMedia(){var t;this.removeMediaListeners(),this.mediaAttached=null,null==(t=this.hls)||t.detachMedia()}resumeBuffering(){var t;null==(t=this.hls)||t.resumeBuffering()}pauseBuffering(){var t;null==(t=this.hls)||t.pauseBuffering()}transferMedia(){var t;return this.bufferSnapShot(),(null==(t=this.hls)?void 0:t.transferMedia())||null}resetDetails(){const t=this.hls;if(t&&this.hasDetails){t.stopLoad();const e=t=>delete t.details;t.levels.forEach(e),t.allAudioTracks.forEach(e),t.allSubtitleTracks.forEach(e),this.hasDetails=!1}}on(t,e,i){var s;null==(s=this.hls)||s.on(t,e)}once(t,e,i){var s;null==(s=this.hls)||s.once(t,e)}off(t,e,i){var s;null==(s=this.hls)||s.off(t,e)}toString(){var t;return`HlsAssetPlayer: ${yp(this.assetItem)} ${null==(t=this.hls)?void 0:t.sessionId} ${this.appendInPlace?"append-in-place":""}`}}class Tp extends rd{constructor(t,e){super("interstitials-sched",e),this.onScheduleUpdate=void 0,this.eventMap={},this.events=null,this.items=null,this.durations={primary:0,playout:0,integrated:0},this.onScheduleUpdate=t}destroy(){this.reset(),this.onScheduleUpdate=null}reset(){this.eventMap={},this.setDurations(0,0,0),this.events&&this.events.forEach(t=>t.reset()),this.events=this.items=null}resetErrorsInRange(t,e){return this.events?this.events.reduce((i,s)=>t<=s.startOffset&&e>s.startOffset?(delete s.error,i+1):i,0):0}get duration(){const t=this.items;return t?t[t.length-1].end:0}get length(){return this.items?this.items.length:0}getEvent(t){return t&&this.eventMap[t]||null}hasEvent(t){return t in this.eventMap}findItemIndex(t,e){if(t.event)return this.findEventIndex(t.event.identifier);let i=-1;t.nextEvent?i=this.findEventIndex(t.nextEvent.identifier)-1:t.previousEvent&&(i=this.findEventIndex(t.previousEvent.identifier)+1);const s=this.items;if(s)for(s[i]||(void 0===e&&(e=t.start),i=this.findItemIndexAtTime(e));i>=0&&null!=(r=s[i])&&r.event;){var r;i--}return i}findItemIndexAtTime(t,e){const i=this.items;if(i)for(let s=0;s<i.length;s++){let r=i[s];if(e&&"primary"!==e&&(r=r[e]),t===r.start||t>r.start&&t<r.end)return s}return-1}findJumpRestrictedIndex(t,e){const i=this.items;if(i)for(let s=t;s<=e&&i[s];s++){const t=i[s].event;if(null!=t&&t.restrictions.jump&&!t.appendInPlace)return s}return-1}findEventIndex(t){const e=this.items;if(e)for(let s=e.length;s--;){var i;if((null==(i=e[s].event)?void 0:i.identifier)===t)return s}return-1}findAssetIndex(t,e){const i=t.assetList,s=i.length;if(s>1)for(let r=0;r<s;r++){const t=i[r];if(!t.error){const i=t.timelineStart;if(e===i||e>i&&(e<i+(t.duration||0)||r===s-1))return r}}return 0}get assetIdAtEnd(){var t;const e=null==(t=this.items)||null==(t=t[this.length-1])?void 0:t.event;if(e){const t=e.assetList,i=t[t.length-1];if(i)return i.identifier}return null}parseInterstitialDateRanges(t,e){const i=t.main.details,{dateRanges:s}=i,r=this.events,n=this.parseDateRanges(s,{url:i.url},e),a=Object.keys(s),o=r?r.filter(t=>!a.includes(t.identifier)):[];n.length&&n.sort((t,e)=>{const i=t.cue.pre,s=t.cue.post,r=e.cue.pre,n=e.cue.post;if(i&&!r)return-1;if(r&&!i)return 1;if(s&&!n)return 1;if(n&&!s)return-1;if(!(i||r||s||n)){const i=t.startTime,s=e.startTime;if(i!==s)return i-s}return t.dateRange.tagOrder-e.dateRange.tagOrder}),this.events=n,o.forEach(t=>{this.removeEvent(t)}),this.updateSchedule(t,o)}updateSchedule(t,e=[],i=!1){const s=this.events||[];if(s.length||e.length||this.length<2){const r=this.items,n=this.parseSchedule(s,t);(i||e.length||(null==r?void 0:r.length)!==n.length||n.some((t,e)=>Math.abs(t.playout.start-r[e].playout.start)>.005||Math.abs(t.playout.end-r[e].playout.end)>.005))&&(this.items=n,this.onScheduleUpdate(e,r))}}parseDateRanges(t,e,i){const s=[],r=Object.keys(t);for(let n=0;n<r.length;n++){const a=r[n],o=t[a];if(o.isInterstitial){let t=this.eventMap[a];t?t.setDateRange(o):(t=new mp(o,e),this.eventMap[a]=t,!1===i&&(t.appendInPlace=i)),s.push(t)}}return s}parseSchedule(t,e){const i=[],s=e.main.details,r=s.live?1/0:s.edge;let n=0;if((t=t.filter(t=>!(t.error||t.cue.once&&t.hasPlayed))).length){this.resolveOffsets(t,e);let s=0,o=0;if(t.forEach((e,a)=>{const l=e.cue.pre,d=e.cue.post,h=t[a-1]||null,c=e.appendInPlace,u=d?r:e.startOffset,f=e.duration,g=e.timelineOccupancy===fp.Range?f:0,m=e.resumptionOffset,p=(null==h?void 0:h.startTime)===u,A=u+e.cumulativeDuration;let v=c?A+f:u+m;if(l||!d&&u<=0){const t=o;o+=g,e.timelineStart=A;const s=n;n+=f,i.push({event:e,start:A,end:v,playout:{start:s,end:n},integrated:{start:t,end:o}})}else{if(!(u<=r))return;{if(!p){const r=u-s;if(r>.033){const l=s,d=o;o+=r;const h=n;n+=r;const c={previousEvent:t[a-1]||null,nextEvent:e,start:l,end:l+r,playout:{start:h,end:n},integrated:{start:d,end:o}};i.push(c)}else r>0&&h&&(h.cumulativeDuration+=r,i[i.length-1].end=u)}d&&(v=A),e.timelineStart=A;const r=o;o+=g;const l=n;n+=f,i.push({event:e,start:A,end:v,playout:{start:l,end:n},integrated:{start:r,end:o}})}}const y=e.resumeTime;s=d||y>r?r:y}),s<r){var a;const t=s,e=o,l=r-s;o+=l;const d=n;n+=l,i.push({previousEvent:(null==(a=i[i.length-1])?void 0:a.event)||null,nextEvent:null,start:s,end:t+l,playout:{start:d,end:n},integrated:{start:e,end:o}})}this.setDurations(r,n,o)}else{const t=0;i.push({previousEvent:null,nextEvent:null,start:t,end:r,playout:{start:t,end:r},integrated:{start:t,end:r}}),this.setDurations(r,r,r)}return i}setDurations(t,e,i){this.durations={primary:t,playout:e,integrated:i}}resolveOffsets(t,e){const i=e.main.details,s=i.live?1/0:i.edge;let r=0,n=-1;t.forEach((a,o)=>{const l=a.cue.pre,d=a.cue.post,h=l?0:d?s:a.startTime;this.updateAssetDurations(a);if(n===h?a.cumulativeDuration=r:(r=0,n=h),!d&&a.snapOptions.in&&(a.resumeAnchor=$h(null,i.fragments,a.startOffset+a.resumptionOffset,0,0)||void 0),a.appendInPlace&&!a.appendInPlaceStarted){this.primaryCanResumeInPlaceAt(a,e)||(a.appendInPlace=!1)}if(!a.appendInPlace&&o+1<t.length){t[o+1].startTime-t[o].resumeTime<.033&&(t[o+1].appendInPlace=!1,t[o+1].appendInPlace&&this.warn(`Could not change append strategy for abutting event ${a}`))}const c=Ul(a.resumeOffset)?a.resumeOffset:a.duration;r+=c})}primaryCanResumeInPlaceAt(t,e){const i=t.resumeTime,s=t.startTime+t.resumptionOffset;if(Math.abs(i-s)>up)return this.log(`"${t.identifier}" resumption ${i} not aligned with estimated timeline end ${s}`),!1;return!Object.keys(e).some(s=>{const r=e[s].details,n=r.edge;if(i>=n)return this.log(`"${t.identifier}" resumption ${i} past ${s} playlist end ${n}`),!1;const a=$h(null,r.fragments,i);if(!a)return this.log(`"${t.identifier}" resumption ${i} does not align with any fragments in ${s} playlist (${r.fragStart}-${r.fragmentEnd})`),!0;const o="audio"===s?.175:0;return!(Math.abs(a.start-i)<up+o||Math.abs(a.end-i)<up+o)&&(this.log(`"${t.identifier}" resumption ${i} not aligned with ${s} fragment bounds (${a.start}-${a.end} sn: ${a.sn} cc: ${a.cc})`),!0)})}updateAssetDurations(t){if(!t.assetListLoaded)return;const e=t.timelineStart;let i=0,s=!1,r=!1;for(let n=0;n<t.assetList.length;n++){const a=t.assetList[n],o=e+i;a.startOffset=i,a.timelineStart=o,s||(s=null===a.duration),r||(r=!!a.error);i+=a.error?0:a.duration||0}t.duration=s&&!r?Math.max(i,t.duration):i}removeEvent(t){t.reset(),delete this.eventMap[t.identifier]}}function Sp(t){return`[${t.event?'"'+t.event.identifier+'"':"primary"}: ${t.start.toFixed(2)}-${t.end.toFixed(2)}]`}class bp{constructor(t){this.hls=void 0,this.hls=t}destroy(){this.hls=null}loadAssetList(t,e){const i=t.assetListUrl;let s;try{s=Ap(i,this.hls.sessionId,t.baseUrl)}catch(h){const e=this.assignAssetListError(t,Gl.ASSET_LIST_LOAD_ERROR,h,i);return void this.hls.trigger(Ql.ERROR,e)}e&&"data:"!==s.protocol&&s.searchParams.set("_HLS_start_offset",""+e);const r=this.hls.config,n=new(0,r.loader)(r),a={responseType:"json",url:s.href},o=r.interstitialAssetListLoadPolicy.default,l={loadPolicy:o,timeout:o.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},d={onSuccess:(e,i,s,r)=>{const n=e.data,a=null==n?void 0:n.ASSETS;if(!Array.isArray(a)){const e=this.assignAssetListError(t,Gl.ASSET_LIST_PARSING_ERROR,new Error("Invalid interstitial asset list"),s.url,i,r);return void this.hls.trigger(Ql.ERROR,e)}t.assetListResponse=n,this.hls.trigger(Ql.ASSET_LIST_LOADED,{event:t,assetListResponse:n,networkDetails:r})},onError:(e,i,s,r)=>{const n=this.assignAssetListError(t,Gl.ASSET_LIST_LOAD_ERROR,new Error(`Error loading X-ASSET-LIST: HTTP status ${e.code} ${e.text} (${i.url})`),i.url,r,s);this.hls.trigger(Ql.ERROR,n)},onTimeout:(e,i,s)=>{const r=this.assignAssetListError(t,Gl.ASSET_LIST_LOAD_TIMEOUT,new Error(`Timeout loading X-ASSET-LIST (${i.url})`),i.url,e,s);this.hls.trigger(Ql.ERROR,r)}};return n.load(a,l,d),this.hls.trigger(Ql.ASSET_LIST_LOADING,{event:t}),n}assignAssetListError(t,e,i,s,r,n){return t.error=i,{type:Vl.NETWORK_ERROR,details:e,fatal:!1,interstitial:t,url:s,error:i,networkDetails:n,stats:r}}}function Ip(t){var e;null==t||null==(e=t.play())||e.catch(()=>{})}function Lp(t,e){return`[${t}] Advancing timeline position to ${e}`}class Rp{constructor(t){this.buffered=void 0;const e=(e,i,s)=>{if((i>>>=0)>s-1)throw new DOMException(`Failed to execute '${e}' on 'TimeRanges': The index provided (${i}) is greater than the maximum bound (${s})`);return t[i][e]};this.buffered={get length(){return t.length},end:i=>e("end",i,t.length),start:i=>e("start",i,t.length)}}}const kp={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},wp=t=>String.fromCharCode(kp[t]||t),Dp=15,Cp=100,xp={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},Pp={17:2,18:4,21:6,22:8,23:10,19:13,20:15},Mp={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},Op={25:2,26:4,29:6,30:8,31:10,27:13,28:15},Bp=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class Fp{constructor(){this.time=null,this.verboseLevel=0}log(t,e){if(this.verboseLevel>=t){const i="function"==typeof e?e():e;hd.log(`${this.time} [${t}] ${i}`)}}}const Np=function(t){const e=[];for(let i=0;i<t.length;i++)e.push(t[i].toString(16));return e};class _p{constructor(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}reset(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}setStyles(t){const e=["foreground","underline","italics","background","flash"];for(let i=0;i<e.length;i++){const s=e[i];t.hasOwnProperty(s)&&(this[s]=t[s])}}isDefault(){return"white"===this.foreground&&!this.underline&&!this.italics&&"black"===this.background&&!this.flash}equals(t){return this.foreground===t.foreground&&this.underline===t.underline&&this.italics===t.italics&&this.background===t.background&&this.flash===t.flash}copy(t){this.foreground=t.foreground,this.underline=t.underline,this.italics=t.italics,this.background=t.background,this.flash=t.flash}toString(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash}}class Up{constructor(){this.uchar=" ",this.penState=new _p}reset(){this.uchar=" ",this.penState.reset()}setChar(t,e){this.uchar=t,this.penState.copy(e)}setPenState(t){this.penState.copy(t)}equals(t){return this.uchar===t.uchar&&this.penState.equals(t.penState)}copy(t){this.uchar=t.uchar,this.penState.copy(t.penState)}isEmpty(){return" "===this.uchar&&this.penState.isDefault()}}class Hp{constructor(t){this.chars=[],this.pos=0,this.currPenState=new _p,this.cueStartTime=null,this.logger=void 0;for(let e=0;e<Cp;e++)this.chars.push(new Up);this.logger=t}equals(t){for(let e=0;e<Cp;e++)if(!this.chars[e].equals(t.chars[e]))return!1;return!0}copy(t){for(let e=0;e<Cp;e++)this.chars[e].copy(t.chars[e])}isEmpty(){let t=!0;for(let e=0;e<Cp;e++)if(!this.chars[e].isEmpty()){t=!1;break}return t}setCursor(t){this.pos!==t&&(this.pos=t),this.pos<0?(this.logger.log(3,"Negative cursor position "+this.pos),this.pos=0):this.pos>Cp&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=Cp)}moveCursor(t){const e=this.pos+t;if(t>1)for(let i=this.pos+1;i<e+1;i++)this.chars[i].setPenState(this.currPenState);this.setCursor(e)}backSpace(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)}insertChar(t){t>=144&&this.backSpace();const e=wp(t);this.pos>=Cp?this.logger.log(0,()=>"Cannot insert "+t.toString(16)+" ("+e+") at position "+this.pos+". Skipping it!"):(this.chars[this.pos].setChar(e,this.currPenState),this.moveCursor(1))}clearFromPos(t){let e;for(e=t;e<Cp;e++)this.chars[e].reset()}clear(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()}clearToEndOfRow(){this.clearFromPos(this.pos)}getTextString(){const t=[];let e=!0;for(let i=0;i<Cp;i++){const s=this.chars[i].uchar;" "!==s&&(e=!1),t.push(s)}return e?"":t.join("")}setPenStyles(t){this.currPenState.setStyles(t);this.chars[this.pos].setPenState(this.currPenState)}}class jp{constructor(t){this.rows=[],this.currRow=14,this.nrRollUpRows=null,this.lastOutputScreen=null,this.logger=void 0;for(let e=0;e<Dp;e++)this.rows.push(new Hp(t));this.logger=t}reset(){for(let t=0;t<Dp;t++)this.rows[t].clear();this.currRow=14}equals(t){let e=!0;for(let i=0;i<Dp;i++)if(!this.rows[i].equals(t.rows[i])){e=!1;break}return e}copy(t){for(let e=0;e<Dp;e++)this.rows[e].copy(t.rows[e])}isEmpty(){let t=!0;for(let e=0;e<Dp;e++)if(!this.rows[e].isEmpty()){t=!1;break}return t}backSpace(){this.rows[this.currRow].backSpace()}clearToEndOfRow(){this.rows[this.currRow].clearToEndOfRow()}insertChar(t){this.rows[this.currRow].insertChar(t)}setPen(t){this.rows[this.currRow].setPenStyles(t)}moveCursor(t){this.rows[this.currRow].moveCursor(t)}setCursor(t){this.logger.log(2,"setCursor: "+t);this.rows[this.currRow].setCursor(t)}setPAC(t){this.logger.log(2,()=>"pacData = "+Uh(t));let e=t.row-1;if(this.nrRollUpRows&&e<this.nrRollUpRows-1&&(e=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==e){for(let e=0;e<Dp;e++)this.rows[e].clear();const t=this.currRow+1-this.nrRollUpRows,i=this.lastOutputScreen;if(i){const s=i.rows[t].cueStartTime,r=this.logger.time;if(null!==s&&null!==r&&s<r)for(let n=0;n<this.nrRollUpRows;n++)this.rows[e-this.nrRollUpRows+n+1].copy(i.rows[t+n])}}this.currRow=e;const i=this.rows[this.currRow];if(null!==t.indent){const e=t.indent,s=Math.max(e-1,0);i.setCursor(t.indent),t.color=i.chars[s].penState.foreground}const s={foreground:t.color,underline:t.underline,italics:t.italics,background:"black",flash:!1};this.setPen(s)}setBkgData(t){this.logger.log(2,()=>"bkgData = "+Uh(t)),this.backSpace(),this.setPen(t),this.insertChar(32)}setRollUpRows(t){this.nrRollUpRows=t}rollUp(){if(null===this.nrRollUpRows)return void this.logger.log(3,"roll_up but nrRollUpRows not set yet");this.logger.log(1,()=>this.getDisplayText());const t=this.currRow+1-this.nrRollUpRows,e=this.rows.splice(t,1)[0];e.clear(),this.rows.splice(this.currRow,0,e),this.logger.log(2,"Rolling up")}getDisplayText(t){t=t||!1;const e=[];let i="",s=-1;for(let r=0;r<Dp;r++){const i=this.rows[r].getTextString();i&&(s=r+1,t?e.push("Row "+s+": '"+i+"'"):e.push(i.trim()))}return e.length>0&&(i=t?"["+e.join(" | ")+"]":e.join("\n")),i}getTextAndFormat(){return this.rows}}class Vp{constructor(t,e,i){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=t,this.outputFilter=e,this.mode=null,this.verbose=0,this.displayedMemory=new jp(i),this.nonDisplayedMemory=new jp(i),this.lastOutputScreen=new jp(i),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=i}reset(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}getHandler(){return this.outputFilter}setHandler(t){this.outputFilter=t}setPAC(t){this.writeScreen.setPAC(t)}setBkgData(t){this.writeScreen.setBkgData(t)}setMode(t){t!==this.mode&&(this.mode=t,this.logger.log(2,()=>"MODE="+t),"MODE_POP-ON"===this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=t)}insertChars(t){for(let i=0;i<t.length;i++)this.writeScreen.insertChar(t[i]);const e=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(2,()=>e+": "+this.writeScreen.getDisplayText(!0)),"MODE_PAINT-ON"!==this.mode&&"MODE_ROLL-UP"!==this.mode||(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"),"MODE_TEXT"!==this.mode&&(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(t){this.logger.log(2,"RU("+t+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(t)}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"),"MODE_POP-ON"===this.mode){const t=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=t,this.writeScreen=this.nonDisplayedMemory,this.logger.log(1,()=>"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)}ccTO(t){this.logger.log(2,"TO("+t+") - Tab Offset"),this.writeScreen.moveCursor(t)}ccMIDROW(t){const e={flash:!1};if(e.underline=t%2==1,e.italics=t>=46,e.italics)e.foreground="white";else{const i=Math.floor(t/2)-16,s=["white","green","blue","cyan","red","yellow","magenta"];e.foreground=s[i]}this.logger.log(2,"MIDROW: "+Uh(e)),this.writeScreen.setPen(e)}outputDataUpdate(t=!1){const e=this.logger.time;null!==e&&this.outputFilter&&(null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,e,this.lastOutputScreen),t&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:e):this.cueStartTime=e,this.lastOutputScreen.copy(this.displayedMemory))}cueSplitAtTime(t){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,t,this.displayedMemory),this.cueStartTime=t))}}class Gp{constructor(t,e,i){this.channels=void 0,this.currentChannel=0,this.cmdHistory={a:null,b:null},this.logger=void 0;const s=this.logger=new Fp;this.channels=[null,new Vp(t,e,s),new Vp(t+1,i,s)]}getHandler(t){return this.channels[t].getHandler()}setHandler(t,e){this.channels[t].setHandler(e)}addData(t,e){this.logger.time=t;for(let i=0;i<e.length;i+=2){const t=127&e[i],s=127&e[i+1];let r=!1,n=null;if(0===t&&0===s)continue;this.logger.log(3,()=>"["+Np([e[i],e[i+1]])+"] -> ("+Np([t,s])+")");const a=this.cmdHistory;if(t>=16&&t<=31){if(Kp(t,s,a)){Qp(null,null,a),this.logger.log(3,()=>"Repeated command ("+Np([t,s])+") is dropped");continue}Qp(t,s,this.cmdHistory),r=this.parseCmd(t,s),r||(r=this.parseMidrow(t,s)),r||(r=this.parsePAC(t,s)),r||(r=this.parseBackgroundAttributes(t,s))}else Qp(null,null,a);if(!r&&(n=this.parseChars(t,s),n)){const t=this.currentChannel;if(t&&t>0){this.channels[t].insertChars(n)}else this.logger.log(2,"No channel found yet. TEXT-MODE?")}r||n||this.logger.log(2,()=>"Couldn't parse cleaned data "+Np([t,s])+" orig: "+Np([e[i],e[i+1]]))}}parseCmd(t,e){if(!((20===t||28===t||21===t||29===t)&&e>=32&&e<=47)&&!((23===t||31===t)&&e>=33&&e<=35))return!1;const i=20===t||21===t||23===t?1:2,s=this.channels[i];return 20===t||21===t||28===t||29===t?32===e?s.ccRCL():33===e?s.ccBS():34===e?s.ccAOF():35===e?s.ccAON():36===e?s.ccDER():37===e?s.ccRU(2):38===e?s.ccRU(3):39===e?s.ccRU(4):40===e?s.ccFON():41===e?s.ccRDC():42===e?s.ccTR():43===e?s.ccRTD():44===e?s.ccEDM():45===e?s.ccCR():46===e?s.ccENM():47===e&&s.ccEOC():s.ccTO(e-32),this.currentChannel=i,!0}parseMidrow(t,e){let i=0;if((17===t||25===t)&&e>=32&&e<=47){if(i=17===t?1:2,i!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;const s=this.channels[i];return!!s&&(s.ccMIDROW(e),this.logger.log(3,()=>"MIDROW ("+Np([t,e])+")"),!0)}return!1}parsePAC(t,e){let i;if(!((t>=17&&t<=23||t>=25&&t<=31)&&e>=64&&e<=127)&&!((16===t||24===t)&&e>=64&&e<=95))return!1;const s=t<=23?1:2;i=e>=64&&e<=95?1===s?xp[t]:Mp[t]:1===s?Pp[t]:Op[t];const r=this.channels[s];return!!r&&(r.setPAC(this.interpretPAC(i,e)),this.currentChannel=s,!0)}interpretPAC(t,e){let i;const s={color:null,italics:!1,indent:null,underline:!1,row:t};return i=e>95?e-96:e-64,s.underline=!(1&~i),i<=13?s.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(i/2)]:i<=15?(s.italics=!0,s.color="white"):s.indent=4*Math.floor((i-16)/2),s}parseChars(t,e){let i,s=null,r=null;if(t>=25?(i=2,r=t-8):(i=1,r=t),r>=17&&r<=19){let t;t=17===r?e+80:18===r?e+112:e+144,this.logger.log(2,()=>"Special char '"+wp(t)+"' in channel "+i),s=[t]}else t>=32&&t<=127&&(s=0===e?[t]:[t,e]);return s&&this.logger.log(3,()=>"Char codes = "+Np(s).join(",")),s}parseBackgroundAttributes(t,e){if(!((16===t||24===t)&&e>=32&&e<=47)&&!((23===t||31===t)&&e>=45&&e<=47))return!1;let i;const s={};16===t||24===t?(i=Math.floor((e-32)/2),s.background=Bp[i],e%2==1&&(s.background=s.background+"_semi")):45===e?s.background="transparent":(s.foreground="black",47===e&&(s.underline=!0));const r=t<=23?1:2;return this.channels[r].setBkgData(s),!0}reset(){for(let t=0;t<Object.keys(this.channels).length;t++){const e=this.channels[t];e&&e.reset()}Qp(null,null,this.cmdHistory)}cueSplitAtTime(t){for(let e=0;e<this.channels.length;e++){const i=this.channels[e];i&&i.cueSplitAtTime(t)}}}function Qp(t,e,i){i.a=t,i.b=e}function Kp(t,e,i){return i.a===t&&i.b===e}var qp=function(){if(null!=nu&&nu.VTTCue)return self.VTTCue;const t=["","lr","rl"],e=["start","middle","end","left","right"];function i(t,e){if("string"!=typeof e)return!1;if(!Array.isArray(t))return!1;const i=e.toLowerCase();return!!~t.indexOf(i)&&i}function s(t){return i(e,t)}function r(t,...e){let i=1;for(;i<arguments.length;i++){const e=arguments[i];for(const i in e)t[i]=e[i]}return t}function n(e,n,a){const o=this,l={enumerable:!0};o.hasBeenReset=!1;let d="",h=!1,c=e,u=n,f=a,g=null,m="",p=!0,A="auto",v="start",y=50,E="middle",T=50,S="middle";Object.defineProperty(o,"id",r({},l,{get:function(){return d},set:function(t){d=""+t}})),Object.defineProperty(o,"pauseOnExit",r({},l,{get:function(){return h},set:function(t){h=!!t}})),Object.defineProperty(o,"startTime",r({},l,{get:function(){return c},set:function(t){if("number"!=typeof t)throw new TypeError("Start time must be set to a number.");c=t,this.hasBeenReset=!0}})),Object.defineProperty(o,"endTime",r({},l,{get:function(){return u},set:function(t){if("number"!=typeof t)throw new TypeError("End time must be set to a number.");u=t,this.hasBeenReset=!0}})),Object.defineProperty(o,"text",r({},l,{get:function(){return f},set:function(t){f=""+t,this.hasBeenReset=!0}})),Object.defineProperty(o,"region",r({},l,{get:function(){return g},set:function(t){g=t,this.hasBeenReset=!0}})),Object.defineProperty(o,"vertical",r({},l,{get:function(){return m},set:function(e){const s=function(e){return i(t,e)}(e);if(!1===s)throw new SyntaxError("An invalid or illegal string was specified.");m=s,this.hasBeenReset=!0}})),Object.defineProperty(o,"snapToLines",r({},l,{get:function(){return p},set:function(t){p=!!t,this.hasBeenReset=!0}})),Object.defineProperty(o,"line",r({},l,{get:function(){return A},set:function(t){if("number"!=typeof t&&"auto"!==t)throw new SyntaxError("An invalid number or illegal string was specified.");A=t,this.hasBeenReset=!0}})),Object.defineProperty(o,"lineAlign",r({},l,{get:function(){return v},set:function(t){const e=s(t);if(!e)throw new SyntaxError("An invalid or illegal string was specified.");v=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"position",r({},l,{get:function(){return y},set:function(t){if(t<0||t>100)throw new Error("Position must be between 0 and 100.");y=t,this.hasBeenReset=!0}})),Object.defineProperty(o,"positionAlign",r({},l,{get:function(){return E},set:function(t){const e=s(t);if(!e)throw new SyntaxError("An invalid or illegal string was specified.");E=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"size",r({},l,{get:function(){return T},set:function(t){if(t<0||t>100)throw new Error("Size must be between 0 and 100.");T=t,this.hasBeenReset=!0}})),Object.defineProperty(o,"align",r({},l,{get:function(){return S},set:function(t){const e=s(t);if(!e)throw new SyntaxError("An invalid or illegal string was specified.");S=e,this.hasBeenReset=!0}})),o.displayState=void 0}return n.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},n}();class Wp{decode(t,e){if(!t)return"";if("string"!=typeof t)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(t))}}function Yp(t){function e(t,e,i,s){return 3600*(0|t)+60*(0|e)+(0|i)+parseFloat(s||0)}const i=t.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return i?parseFloat(i[2])>59?e(i[2],i[3],0,i[4]):e(i[1],i[2],i[3],i[4]):null}class $p{constructor(){this.values=Object.create(null)}set(t,e){this.get(t)||""===e||(this.values[t]=e)}get(t,e,i){return i?this.has(t)?this.values[t]:e[i]:this.has(t)?this.values[t]:e}has(t){return t in this.values}alt(t,e,i){for(let s=0;s<i.length;++s)if(e===i[s]){this.set(t,e);break}}integer(t,e){/^-?\d+$/.test(e)&&this.set(t,parseInt(e,10))}percent(t,e){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(e)){const i=parseFloat(e);if(i>=0&&i<=100)return this.set(t,i),!0}return!1}}function zp(t,e,i,s){const r=s?t.split(s):[t];for(const n in r){if("string"!=typeof r[n])continue;const t=r[n].split(i);if(2!==t.length)continue;e(t[0],t[1])}}const Xp=new qp(0,0,""),Zp="middle"===Xp.align?"middle":"center";function Jp(t,e,i){const s=t;function r(){const e=Yp(t);if(null===e)throw new Error("Malformed timestamp: "+s);return t=t.replace(/^[^\sa-zA-Z-]+/,""),e}function n(){t=t.replace(/^\s+/,"")}if(n(),e.startTime=r(),n(),"--\x3e"!==t.slice(0,3))throw new Error("Malformed time stamp (time stamps must be separated by '--\x3e'): "+s);t=t.slice(3),n(),e.endTime=r(),n(),function(t,e){const s=new $p;zp(t,function(t,e){let r;switch(t){case"region":for(let r=i.length-1;r>=0;r--)if(i[r].id===e){s.set(t,i[r].region);break}break;case"vertical":s.alt(t,e,["rl","lr"]);break;case"line":r=e.split(","),s.integer(t,r[0]),s.percent(t,r[0])&&s.set("snapToLines",!1),s.alt(t,r[0],["auto"]),2===r.length&&s.alt("lineAlign",r[1],["start",Zp,"end"]);break;case"position":r=e.split(","),s.percent(t,r[0]),2===r.length&&s.alt("positionAlign",r[1],["start",Zp,"end","line-left","line-right","auto"]);break;case"size":s.percent(t,e);break;case"align":s.alt(t,e,["start",Zp,"end","left","right"])}},/:/,/\s/),e.region=s.get("region",null),e.vertical=s.get("vertical","");let r=s.get("line","auto");"auto"===r&&-1===Xp.line&&(r=-1),e.line=r,e.lineAlign=s.get("lineAlign","start"),e.snapToLines=s.get("snapToLines",!0),e.size=s.get("size",100),e.align=s.get("align",Zp);let n=s.get("position","auto");"auto"===n&&50===Xp.position&&(n="start"===e.align||"left"===e.align?0:"end"===e.align||"right"===e.align?100:50),e.position=n}(t,e)}function tA(t){return t.replace(/<br(?: \/)?>/gi,"\n")}class eA{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new Wp,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}parse(t){const e=this;function i(){let t=e.buffer,i=0;for(t=tA(t);i<t.length&&"\r"!==t[i]&&"\n"!==t[i];)++i;const s=t.slice(0,i);return"\r"===t[i]&&++i,"\n"===t[i]&&++i,e.buffer=t.slice(i),s}function s(t){zp(t,function(t,e){},/:/)}t&&(e.buffer+=e.decoder.decode(t,{stream:!0}));try{let t="";if("INITIAL"===e.state){if(!/\r\n|\n/.test(e.buffer))return this;t=i();const s=t.match(/^()?WEBVTT([ \t].*)?$/);if(null==s||!s[0])throw new Error("Malformed WebVTT signature.");e.state="HEADER"}let n=!1;for(;e.buffer;){if(!/\r\n|\n/.test(e.buffer))return this;switch(n?n=!1:t=i(),e.state){case"HEADER":/:/.test(t)?s(t):t||(e.state="ID");continue;case"NOTE":t||(e.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(t)){e.state="NOTE";break}if(!t)continue;if(e.cue=new qp(0,0,""),e.state="CUE",-1===t.indexOf("--\x3e")){e.cue.id=t;continue}case"CUE":if(!e.cue){e.state="BADCUE";continue}try{Jp(t,e.cue,e.regionList)}catch(r){e.cue=null,e.state="BADCUE";continue}e.state="CUETEXT";continue;case"CUETEXT":{const i=-1!==t.indexOf("--\x3e");if(!t||i&&(n=!0)){e.oncue&&e.cue&&e.oncue(e.cue),e.cue=null,e.state="ID";continue}if(null===e.cue)continue;e.cue.text&&(e.cue.text+="\n"),e.cue.text+=t}continue;case"BADCUE":t||(e.state="ID")}}}catch(r){"CUETEXT"===e.state&&e.cue&&e.oncue&&e.oncue(e.cue),e.cue=null,e.state="INITIAL"===e.state?"BADWEBVTT":"BADCUE"}return this}flush(){const t=this;try{if((t.cue||"HEADER"===t.state)&&(t.buffer+="\n\n",t.parse()),"INITIAL"===t.state||"BADWEBVTT"===t.state)throw new Error("Malformed WebVTT signature.")}catch(e){t.onparsingerror&&t.onparsingerror(e)}return t.onflush&&t.onflush(),this}}const iA=/\r\n|\n\r|\n|\r/g,sA=function(t,e,i=0){return t.slice(i,i+e.length)===e};function rA(t,e,i){return cp(t.toString())+cp(e.toString())+cp(i)}function nA(t,e,i,s,r,n,a){const o=new eA,l=fd(new Uint8Array(t)).trim().replace(iA,"\n").split("\n"),d=[],h=e?function(t,e=1){return wg(t,9e4,1/e)}(e.baseTime,e.timescale):0;let c,u="00:00.000",f=0,g=0,m=!0;o.oncue=function(t){const n=i[s];let a=i.ccOffset;const o=(f-h)/9e4;if(null!=n&&n.new&&(void 0!==g?a=i.ccOffset=n.start:function(t,e,i){let s=t[e],r=t[s.prevCC];if(!r||!r.new&&s.new)return t.ccOffset=t.presentationOffset=s.start,void(s.new=!1);for(;null!=(n=r)&&n.new;){var n;t.ccOffset+=s.start-r.start,s.new=!1,s=r,r=t[s.prevCC]}t.presentationOffset=i}(i,s,o)),o){if(!e)return void(c=new Error("Missing initPTS for VTT MPEGTS"));a=o-i.presentationOffset}const l=t.endTime-t.startTime,u=Fg(9e4*(t.startTime+a-g),9e4*r)/9e4;t.startTime=Math.max(u,0),t.endTime=Math.max(u+l,0);const m=t.text.trim();t.text=decodeURIComponent(encodeURIComponent(m)),t.id||(t.id=rA(t.startTime,t.endTime,m)),t.endTime>0&&d.push(t)},o.onparsingerror=function(t){c=t},o.onflush=function(){c?a(c):n(d)},l.forEach(t=>{if(m){if(sA(t,"X-TIMESTAMP-MAP=")){m=!1,t.slice(16).split(",").forEach(t=>{sA(t,"LOCAL:")?u=t.slice(6):sA(t,"MPEGTS:")&&(f=parseInt(t.slice(7)))});try{g=function(t){let e=parseInt(t.slice(-3));const i=parseInt(t.slice(-6,-4)),s=parseInt(t.slice(-9,-7)),r=t.length>9?parseInt(t.substring(0,t.indexOf(":"))):0;if(!(Ul(e)&&Ul(i)&&Ul(s)&&Ul(r)))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${t}`);return e+=1e3*i,e+=6e4*s,e+=36e5*r,e}(u)/1e3}catch(e){c=e}return}""===t&&(m=!1)}o.parse(t+"\n")}),o.flush()}const aA="stpp.ttml.im1t",oA=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,lA=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,dA={left:"start",center:"center",right:"end",start:"start",end:"end"};function hA(t,e,i,s){const r=Vd(new Uint8Array(t),["mdat"]);if(0===r.length)return void s(new Error("Could not parse IMSC1 mdat"));const n=r.map(t=>fd(t)),a=function(t,e,i=1,s=!1){return wg(t,e,1/i,s)}(e.baseTime,1,e.timescale);try{n.forEach(t=>i(function(t,e){const i=(new DOMParser).parseFromString(t,"text/xml"),s=i.getElementsByTagName("tt")[0];if(!s)throw new Error("Invalid ttml");const r={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},n=Object.keys(r).reduce((t,e)=>(t[e]=s.getAttribute(`ttp:${e}`)||r[e],t),{}),a="preserve"!==s.getAttribute("xml:space"),o=uA(cA(s,"styling","style")),l=uA(cA(s,"layout","region")),d=cA(s,"body","[begin]");return[].map.call(d,t=>{const i=fA(t,a);if(!i||!t.hasAttribute("begin"))return null;const s=pA(t.getAttribute("begin"),n),r=pA(t.getAttribute("dur"),n);let d=pA(t.getAttribute("end"),n);if(null===s)throw mA(t);if(null===d){if(null===r)throw mA(t);d=s+r}const h=new qp(s-e,d-e,i);h.id=rA(h.startTime,h.endTime,h.text);const c=function(t,e,i){const s="http://www.w3.org/ns/ttml#styling";let r=null;const n=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],a=null!=t&&t.hasAttribute("style")?t.getAttribute("style"):null;a&&i.hasOwnProperty(a)&&(r=i[a]);return n.reduce((i,n)=>{const a=gA(e,s,n)||gA(t,s,n)||gA(r,s,n);return a&&(i[n]=a),i},{})}(l[t.getAttribute("region")],o[t.getAttribute("style")],o),{textAlign:u}=c;if(u){const t=dA[u];t&&(h.lineAlign=t),h.align=u}return ed(h,c),h}).filter(t=>null!==t)}(t,a)))}catch(o){s(o)}}function cA(t,e,i){const s=t.getElementsByTagName(e)[0];return s?[].slice.call(s.querySelectorAll(i)):[]}function uA(t){return t.reduce((t,e)=>{const i=e.getAttribute("xml:id");return i&&(t[i]=e),t},{})}function fA(t,e){return[].slice.call(t.childNodes).reduce((t,i,s)=>{var r;return"br"===i.nodeName&&s?t+"\n":null!=(r=i.childNodes)&&r.length?fA(i,e):e?t+i.textContent.trim().replace(/\s+/g," "):t+i.textContent},"")}function gA(t,e,i){return t&&t.hasAttributeNS(e,i)?t.getAttributeNS(e,i):null}function mA(t){return new Error(`Could not parse ttml timestamp ${t}`)}function pA(t,e){if(!t)return null;let i=Yp(t);return null===i&&(oA.test(t)?i=function(t,e){const i=oA.exec(t),s=(0|i[4])+(0|i[5])/e.subFrameRate;return 3600*(0|i[1])+60*(0|i[2])+(0|i[3])+s/e.frameRate}(t,e):lA.test(t)&&(i=function(t,e){const i=lA.exec(t),s=Number(i[1]);switch(i[2]){case"h":return 3600*s;case"m":return 60*s;case"ms":return 1e3*s;case"f":return s/e.frameRate;case"t":return s/e.tickRate}return s}(t,e))),i}class AA{constructor(t,e){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=t,this.trackName=e}dispatchCue(){null!==this.startTime&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null)}newCue(t,e,i){(null===this.startTime||this.startTime>t)&&(this.startTime=t),this.endTime=e,this.screen=i,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}}function vA(t){return t.characteristics&&/transcribes-spoken-dialog/gi.test(t.characteristics)&&/describes-music-and-sound/gi.test(t.characteristics)?"captions":"subtitles"}function yA(t,e){return!!t&&t.kind===vA(e)&&Zg(e,t)}function EA(t,e,i,s){return Math.min(e,s)-Math.max(t,i)}const TA=/\s/,SA={newCue(t,e,i,s){const r=[];let n,a,o,l,d;const h=self.VTTCue||self.TextTrackCue;for(let u=0;u<s.rows.length;u++)if(n=s.rows[u],o=!0,l=0,d="",!n.isEmpty()){var c;for(let t=0;t<n.chars.length;t++)TA.test(n.chars[t].uchar)&&o?l++:(d+=n.chars[t].uchar,o=!1);n.cueStartTime=e,e===i&&(i+=1e-4),l>=16?l--:l++;const s=tA(d.trim()),f=rA(e,i,s);null!=t&&null!=(c=t.cues)&&c.getCueById(f)||(a=new h(e,i,s),a.id=f,a.line=u+1,a.align="left",a.position=10+Math.min(80,10*Math.floor(8*l/32)),r.push(a))}return t&&r.length&&(r.sort((t,e)=>"auto"===t.line||"auto"===e.line?0:t.line>8&&e.line>8?e.line-t.line:t.line-e.line),r.forEach(e=>op(t,e))),r}};const bA=/(\d+)-(\d+)\/(\d+)/;class IA{constructor(t){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=t.fetchSetup||LA,this.controller=new self.AbortController,this.stats=new Ld}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 t;this.abortInternal(),null!=(t=this.callbacks)&&t.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)}load(t,e,i){const s=this.stats;if(s.loading.start)throw new Error("Loader can only be used once.");s.loading.start=self.performance.now();const r=function(t,e){const i={method:"GET",mode:"cors",credentials:"same-origin",signal:e,headers:new self.Headers(ed({},t.headers))};t.rangeEnd&&i.headers.set("Range","bytes="+t.rangeStart+"-"+String(t.rangeEnd-1));return i}(t,this.controller.signal),n="arraybuffer"===t.responseType,a=n?"byteLength":"length",{maxTimeToFirstByteMs:o,maxLoadTimeMs:l}=e.loadPolicy;this.context=t,this.config=e,this.callbacks=i,this.request=this.fetchSetup(t,r),self.clearTimeout(this.requestTimeout),e.timeout=o&&Ul(o)?o:l,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(s,t,this.response))},e.timeout);(Qg(this.request)?this.request.then(self.fetch):self.fetch(this.request)).then(i=>{var r;this.response=this.loader=i;const a=Math.max(self.performance.now(),s.loading.start);if(self.clearTimeout(this.requestTimeout),e.timeout=l,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(s,t,this.response))},l-(a-s.loading.start)),!i.ok){const{status:t,statusText:e}=i;throw new RA(e||"fetch, bad network response",t,i)}s.loading.first=a,s.total=function(t){const e=t.get("Content-Range");if(e){const t=function(t){const e=bA.exec(t);if(e)return parseInt(e[2])-parseInt(e[1])+1}(e);if(Ul(t))return t}const i=t.get("Content-Length");if(i)return parseInt(i)}(i.headers)||s.total;const o=null==(r=this.callbacks)?void 0:r.onProgress;return o&&Ul(e.highWaterMark)?this.loadProgressively(i,s,t,e.highWaterMark,o):n?i.arrayBuffer():"json"===t.responseType?i.json():i.text()}).then(i=>{var r,n;const o=this.response;if(!o)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),s.loading.end=Math.max(self.performance.now(),s.loading.first);const l=i[a];l&&(s.loaded=s.total=l);const d={url:o.url,data:i,code:o.status},h=null==(r=this.callbacks)?void 0:r.onProgress;h&&!Ul(e.highWaterMark)&&h(s,t,i,o),null==(n=this.callbacks)||n.onSuccess(d,s,t,o)}).catch(e=>{var i;if(self.clearTimeout(this.requestTimeout),s.aborted)return;const r=e&&e.code||0,n=e?e.message:null;null==(i=this.callbacks)||i.onError({code:r,text:n},t,e?e.details:null,s)})}getCacheAge(){let t=null;if(this.response){const e=this.response.headers.get("age");t=e?parseFloat(e):null}return t}getResponseHeader(t){return this.response?this.response.headers.get(t):null}loadProgressively(t,e,i,s=0,r){const n=new yf,a=t.body.getReader(),o=()=>a.read().then(a=>{if(a.done)return n.dataLength&&r(e,i,n.flush().buffer,t),Promise.resolve(new ArrayBuffer(0));const l=a.value,d=l.length;return e.loaded+=d,d<s||n.dataLength?(n.push(l),n.dataLength>=s&&r(e,i,n.flush().buffer,t)):r(e,i,l.buffer,t),o()}).catch(()=>Promise.reject());return o()}}function LA(t,e){return new self.Request(t.url,e)}class RA extends Error{constructor(t,e,i){super(t),this.code=void 0,this.details=void 0,this.code=e,this.details=i}}const kA=/^age:\s*[\d.]+\s*$/im;class wA{constructor(t){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=t&&t.xhrSetup||null,this.stats=new Ld,this.retryDelay=0}destroy(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null,this.context=null,this.xhrSetup=null}abortInternal(){const t=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),t&&(t.onreadystatechange=null,t.onprogress=null,4!==t.readyState&&(this.stats.aborted=!0,t.abort()))}abort(){var t;this.abortInternal(),null!=(t=this.callbacks)&&t.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}load(t,e,i){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=t,this.config=e,this.callbacks=i,this.loadInternal()}loadInternal(){const{config:t,context:e}=this;if(!t||!e)return;const i=this.loader=new self.XMLHttpRequest,s=this.stats;s.loading.first=0,s.loaded=0,s.aborted=!1;const r=this.xhrSetup;r?Promise.resolve().then(()=>{if(this.loader===i&&!this.stats.aborted)return r(i,e.url)}).catch(t=>{if(this.loader===i&&!this.stats.aborted)return i.open("GET",e.url,!0),r(i,e.url)}).then(()=>{this.loader!==i||this.stats.aborted||this.openAndSendXhr(i,e,t)}).catch(t=>{var r;null==(r=this.callbacks)||r.onError({code:i.status,text:t.message},e,i,s)}):this.openAndSendXhr(i,e,t)}openAndSendXhr(t,e,i){t.readyState||t.open("GET",e.url,!0);const s=e.headers,{maxTimeToFirstByteMs:r,maxLoadTimeMs:n}=i.loadPolicy;if(s)for(const a in s)t.setRequestHeader(a,s[a]);e.rangeEnd&&t.setRequestHeader("Range","bytes="+e.rangeStart+"-"+(e.rangeEnd-1)),t.onreadystatechange=this.readystatechange.bind(this),t.onprogress=this.loadprogress.bind(this),t.responseType=e.responseType,self.clearTimeout(this.requestTimeout),i.timeout=r&&Ul(r)?r:n,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),i.timeout),t.send()}readystatechange(){const{context:t,loader:e,stats:i}=this;if(!t||!e)return;const s=e.readyState,r=this.config;if(!i.aborted&&s>=2&&(0===i.loading.first&&(i.loading.first=Math.max(self.performance.now(),i.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-(i.loading.first-i.loading.start)))),4===s)){self.clearTimeout(this.requestTimeout),e.onreadystatechange=null,e.onprogress=null;const s=e.status,l="text"===e.responseType?e.responseText:null;if(s>=200&&s<300){const r=null!=l?l:e.response;if(null!=r){var n,a;i.loading.end=Math.max(self.performance.now(),i.loading.first);const o="arraybuffer"===e.responseType?r.byteLength:r.length;i.loaded=i.total=o,i.bwEstimate=8e3*i.total/(i.loading.end-i.loading.first);const l=null==(n=this.callbacks)?void 0:n.onProgress;l&&l(i,t,r,e);const d={url:e.responseURL,data:r,code:s};return void(null==(a=this.callbacks)||a.onSuccess(d,i,t,e))}}const d=r.loadPolicy.errorRetry;var o;if(nc(d,i.retry,!1,{url:t.url,data:void 0,code:s}))this.retry(d);else hd.error(`${s} while loading ${t.url}`),null==(o=this.callbacks)||o.onError({code:s,text:e.statusText},t,e,i)}}loadtimeout(){if(!this.config)return;const t=this.config.loadPolicy.timeoutRetry;if(nc(t,this.stats.retry,!0))this.retry(t);else{var e;hd.warn(`timeout while loading ${null==(e=this.context)?void 0:e.url}`);const t=this.callbacks;t&&(this.abortInternal(),t.onTimeout(this.stats,this.context,this.loader))}}retry(t){const{context:e,stats:i}=this;this.retryDelay=sc(t,i.retry),i.retry++,hd.warn(`${status?"HTTP Status "+status:"Timeout"} while loading ${null==e?void 0:e.url}, retrying ${i.retry}/${t.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(t){const e=this.stats;e.loaded=t.loaded,t.lengthComputable&&(e.total=t.total)}getCacheAge(){let t=null;if(this.loader&&kA.test(this.loader.getAllResponseHeaders())){const e=this.loader.getResponseHeader("age");t=e?parseFloat(e):null}return t}getResponseHeader(t){return this.loader&&new RegExp(`^${t}:\\s*[\\d.]+\\s*$`,"im").test(this.loader.getAllResponseHeaders())?this.loader.getResponseHeader(t):null}}const DA=sd(sd({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,maxDevicePixelRatio:Number.POSITIVE_INFINITY,preferManagedMediaSource:!0,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,frontBufferFlushThreshold:1/0,startOnSegmentBoundary:!1,maxBufferSize:6e7,maxFragLookUpTolerance:.25,maxBufferHole:.1,detectStallWithCurrentTimeMs:1250,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,nudgeOnVideoHole:!0,liveSyncMode:"edge",liveSyncDurationCount:3,liveSyncOnStallIncrease:1,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,ignorePlaylistParsingErrors:!1,loader:wA,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:class extends rd{constructor(t){super("abr",t.logger),this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=-1,this.firstSelection=-1,this._nextAutoLevel=-1,this.nextAutoLevelKey="",this.audioTracksByGroup=null,this.codecTiers=null,this.timer=-1,this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.rebufferNotice=-1,this.supportedCache={},this.bwEstimator=void 0,this._abandonRulesCheck=t=>{var e;const{fragCurrent:i,partCurrent:s,hls:r}=this,{autoLevelEnabled:n,media:a}=r;if(!i||!a)return;const o=performance.now(),l=s?s.stats:i.stats,d=s?s.duration:i.duration,h=o-l.loading.start,c=r.minAutoLevel,u=i.level,f=this._nextAutoLevel;if(l.aborted||l.loaded&&l.loaded===l.total||u<=c)return this.clearTimer(),void(this._nextAutoLevel=-1);if(!n)return;const g=f>-1&&f!==u,m=!!t||g;if(!m&&(a.paused||!a.playbackRate||!a.readyState))return;const p=r.mainForwardBufferInfo;if(!m&&null===p)return;const A=this.bwEstimator.getEstimateTTFB(),v=Math.abs(a.playbackRate);if(h<=Math.max(A,d/(2*v)*1e3))return;const y=p?p.len/v:0,E=l.loading.first?l.loading.first-l.loading.start:-1,T=l.loaded&&E>-1,S=this.getBwEstimate(),b=r.levels,I=b[u],L=Math.max(l.loaded,Math.round(d*(i.bitrate||I.averageBitrate)/8));let R=T?h-E:h;R<1&&T&&(R=Math.min(h,8*l.loaded/S));const k=T?1e3*l.loaded/R:0,w=A/1e3,D=k?(L-l.loaded)/k:8*L/S+w;if(D<=y)return;const C=k?8*k:S,x=!0===(null==(e=(null==t?void 0:t.details)||this.hls.latestLevelDetails)?void 0:e.live),P=this.hls.config.abrBandWidthUpFactor;let M,O=Number.POSITIVE_INFINITY;for(M=u-1;M>c;M--){const t=b[M].maxBitrate,e=!b[M].details||x;if(O=this.getTimeToLoadFrag(w,C,d*t,e),O<Math.min(y,d+w))break}if(O>=D)return;if(O>10*d)return;T?this.bwEstimator.sample(h-Math.min(A,E),l.loaded):this.bwEstimator.sampleTTFB(h);const B=b[M].maxBitrate;this.getBwEstimate()*P>B&&this.resetEstimator(B);const F=this.findBestLevel(B,c,M,0,y,1,1);F>-1&&(M=F),this.warn(`Fragment ${i.sn}${s?" part "+s.index:""} of level ${u} is loading too slowly;\n Fragment duration: ${i.duration.toFixed(3)}\n Time to underbuffer: ${y.toFixed(3)} s\n Estimated load time for current fragment: ${D.toFixed(3)} s\n Estimated load time for down switch fragment: ${O.toFixed(3)} s\n TTFB estimate: ${0|E} ms\n Current BW estimate: ${Ul(S)?0|S:"Unknown"} bps\n New BW estimate: ${0|this.getBwEstimate()} bps\n Switching to level ${M} @ ${0|B} bps`),r.nextLoadLevel=r.nextAutoLevel=M,this.clearTimer();const N=()=>{if(this.clearTimer(),this.fragCurrent===i&&this.hls.loadLevel===M&&M>0){const t=this.getStarvationDelay();if(this.warn(`Aborting inflight request ${M>0?"and switching down":""}\n Fragment duration: ${i.duration.toFixed(3)} s\n Time to underbuffer: ${t.toFixed(3)} s`),i.abortRequests(),this.fragCurrent=this.partCurrent=null,M>c){let e=this.findBestLevel(this.hls.levels[c].bitrate,c,M,0,t,1,1);-1===e&&(e=c),this.hls.nextLoadLevel=this.hls.nextAutoLevel=e,this.resetEstimator(this.hls.levels[e].bitrate)}}};g||D>2*O?N():this.timer=self.setInterval(N,1e3*O),r.trigger(Ql.FRAG_LOAD_EMERGENCY_ABORTED,{frag:i,part:s,stats:l})},this.hls=t,this.bwEstimator=this.initEstimator(),this.registerListeners()}resetEstimator(t){t&&(this.log(`setting initial bwe to ${t}`),this.hls.config.abrEwmaDefaultEstimate=t),this.firstSelection=-1,this.bwEstimator=this.initEstimator()}initEstimator(){const t=this.hls.config;return new Jl(t.abrEwmaSlowVoD,t.abrEwmaFastVoD,t.abrEwmaDefaultEstimate)}registerListeners(){const{hls:t}=this;t.on(Ql.MANIFEST_LOADING,this.onManifestLoading,this),t.on(Ql.FRAG_LOADING,this.onFragLoading,this),t.on(Ql.FRAG_LOADED,this.onFragLoaded,this),t.on(Ql.FRAG_BUFFERED,this.onFragBuffered,this),t.on(Ql.LEVEL_SWITCHING,this.onLevelSwitching,this),t.on(Ql.LEVEL_LOADED,this.onLevelLoaded,this),t.on(Ql.LEVELS_UPDATED,this.onLevelsUpdated,this),t.on(Ql.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),t.on(Ql.ERROR,this.onError,this)}unregisterListeners(){const{hls:t}=this;t&&(t.off(Ql.MANIFEST_LOADING,this.onManifestLoading,this),t.off(Ql.FRAG_LOADING,this.onFragLoading,this),t.off(Ql.FRAG_LOADED,this.onFragLoaded,this),t.off(Ql.FRAG_BUFFERED,this.onFragBuffered,this),t.off(Ql.LEVEL_SWITCHING,this.onLevelSwitching,this),t.off(Ql.LEVEL_LOADED,this.onLevelLoaded,this),t.off(Ql.LEVELS_UPDATED,this.onLevelsUpdated,this),t.off(Ql.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),t.off(Ql.ERROR,this.onError,this))}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this._abandonRulesCheck=this.supportedCache=null,this.fragCurrent=this.partCurrent=null}onManifestLoading(t,e){this.lastLoadedFragLevel=-1,this.firstSelection=-1,this.lastLevelLoadSec=0,this.supportedCache={},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(t,e){const i=e.frag;if(!this.ignoreFragment(i)){var s;if(!i.bitrateTest)this.fragCurrent=i,this.partCurrent=null!=(s=e.part)?s:null;this.clearTimer(),this.timer=self.setInterval(this._abandonRulesCheck,100)}}onLevelSwitching(t,e){this.clearTimer()}onError(t,e){if(!e.fatal)switch(e.details){case Gl.BUFFER_ADD_CODEC_ERROR:case Gl.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1;break;case Gl.FRAG_LOAD_TIMEOUT:{const t=e.frag,{fragCurrent:i,partCurrent:s}=this;if(t&&i&&t.sn===i.sn&&t.level===i.level){const e=performance.now(),i=s?s.stats:t.stats,r=e-i.loading.start,n=i.loading.first?i.loading.first-i.loading.start:-1;if(i.loaded&&n>-1){const t=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(r-Math.min(t,n),i.loaded)}else this.bwEstimator.sampleTTFB(r)}break}}}getTimeToLoadFrag(t,e,i,s){return t+i/e+(s?t+this.lastLevelLoadSec:0)}onLevelLoaded(t,e){const i=this.hls.config,{loading:s}=e.stats,r=s.end-s.first;Ul(r)&&(this.lastLevelLoadSec=r/1e3),e.details.live?this.bwEstimator.update(i.abrEwmaSlowLive,i.abrEwmaFastLive):this.bwEstimator.update(i.abrEwmaSlowVoD,i.abrEwmaFastVoD),this.timer>-1&&this._abandonRulesCheck(e.levelInfo)}onFragLoaded(t,{frag:e,part:i}){const s=i?i.stats:e.stats;if(e.type===$l&&this.bwEstimator.sampleTTFB(s.loading.first-s.loading.start),!this.ignoreFragment(e)){if(this.clearTimer(),e.level===this._nextAutoLevel&&(this._nextAutoLevel=-1),this.firstSelection=-1,this.hls.config.abrMaxWithRealBitrate){const t=i?i.duration:e.duration,r=this.hls.levels[e.level],n=(r.loaded?r.loaded.bytes:0)+s.loaded,a=(r.loaded?r.loaded.duration:0)+t;r.loaded={bytes:n,duration:a},r.realBitrate=Math.round(8*n/a)}if(e.bitrateTest){const t={stats:s,frag:e,part:i,id:e.type};this.onFragBuffered(Ql.FRAG_BUFFERED,t),e.bitrateTest=!1}else this.lastLoadedFragLevel=e.level}}onFragBuffered(t,e){const{frag:i,part:s}=e,r=null!=s&&s.stats.loaded?s.stats:i.stats;if(r.aborted)return;if(this.ignoreFragment(i))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(),i.bitrateTest?this.bitrateTestDelay=n/1e3:this.bitrateTestDelay=0}ignoreFragment(t){return t.type!==$l||"initSegment"===t.sn}clearTimer(){this.timer>-1&&(self.clearInterval(this.timer),this.timer=-1)}get firstAutoLevel(){const{maxAutoLevel:t,minAutoLevel:e}=this.hls,i=this.getBwEstimate(),s=this.hls.config.maxStarvationDelay,r=this.findBestLevel(i,e,t,0,s,1,1);if(r>-1)return r;const n=this.hls.firstLevel,a=Math.min(Math.max(n,e),t);return this.warn(`Could not find best starting auto level. Defaulting to first in playlist ${n} clamped to ${a}`),a}get forcedAutoLevel(){return this.nextAutoLevelKey?-1:this._nextAutoLevel}get nextAutoLevel(){const t=this.forcedAutoLevel,e=this.bwEstimator.canEstimate(),i=this.lastLoadedFragLevel>-1;if(!(-1===t||e&&i&&this.nextAutoLevelKey!==this.getAutoLevelKey()))return t;const s=e&&i?this.getNextABRAutoLevel():this.firstAutoLevel;if(-1!==t){const e=this.hls.levels;if(e.length>Math.max(t,s)&&e[t].loadError<=e[s].loadError)return t}return this._nextAutoLevel=s,this.nextAutoLevelKey=this.getAutoLevelKey(),s}getAutoLevelKey(){return`${this.getBwEstimate()}_${this.getStarvationDelay().toFixed(2)}`}getNextABRAutoLevel(){const{fragCurrent:t,partCurrent:e,hls:i}=this;if(i.levels.length<=1)return i.loadLevel;const{maxAutoLevel:s,config:r,minAutoLevel:n}=i,a=e?e.duration:t?t.duration:0,o=this.getBwEstimate(),l=this.getStarvationDelay();let d=r.abrBandWidthFactor,h=r.abrBandWidthUpFactor;if(l){const t=this.findBestLevel(o,n,s,l,0,d,h);if(t>=0)return this.rebufferNotice=-1,t}let c=a?Math.min(a,r.maxStarvationDelay):r.maxStarvationDelay;if(!l){const t=this.bitrateTestDelay;if(t){c=(a?Math.min(a,r.maxLoadingDelay):r.maxLoadingDelay)-t,this.info(`bitrate test took ${Math.round(1e3*t)}ms, set first fragment max fetchDuration to ${Math.round(1e3*c)} ms`),d=h=1}}const u=this.findBestLevel(o,n,s,l,c,d,h);if(this.rebufferNotice!==u&&(this.rebufferNotice=u,this.info(`${l?"rebuffering expected":"buffer is empty"}, optimal quality level ${u}`)),u>-1)return u;const f=i.levels[n],g=i.loadLevelObj;return g&&(null==f?void 0:f.bitrate)<g.bitrate?n:i.loadLevel}getStarvationDelay(){const t=this.hls,e=t.media;if(!e)return 1/0;const i=e&&0!==e.playbackRate?Math.abs(e.playbackRate):1,s=t.mainForwardBufferInfo;return(s?s.len:0)/i}getBwEstimate(){return this.bwEstimator.canEstimate()?this.bwEstimator.getEstimate():this.hls.config.abrEwmaDefaultEstimate}findBestLevel(t,e,i,s,r,n,a){var o;const l=s+r,d=this.lastLoadedFragLevel,h=-1===d?this.hls.firstLevel:d,{fragCurrent:c,partCurrent:u}=this,{levels:f,allAudioTracks:g,loadLevel:m,config:p}=this.hls;if(1===f.length)return 0;const A=f[h],v=!(null==(o=this.hls.latestLevelDetails)||!o.live),y=-1===m||-1===d;let E,T="SDR",S=(null==A?void 0:A.frameRate)||0;const{audioPreference:b,videoPreference:I}=p,L=this.audioTracksByGroup||(this.audioTracksByGroup=jh(g));let R=-1;if(y){if(-1!==this.firstSelection)return this.firstSelection;const s=this.codecTiers||(this.codecTiers=function(t,e,i,s){return t.slice(i,s+1).reduce((t,i,s)=>{if(!i.codecSet)return t;const r=i.audioGroups;let n=t[i.codecSet];n||(t[i.codecSet]=n={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,minIndex:s,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!r,fragmentError:0}),n.minBitrate=Math.min(n.minBitrate,i.bitrate);const a=Math.min(i.height,i.width);return n.minHeight=Math.min(n.minHeight,a),n.minFramerate=Math.min(n.minFramerate,i.frameRate),n.minIndex=Math.min(n.minIndex,s),n.maxScore=Math.max(n.maxScore,i.score),n.fragmentError+=i.fragmentError,n.videoRanges[i.videoRange]=(n.videoRanges[i.videoRange]||0)+1,r&&r.forEach(t=>{if(!t)return;const i=e.groups[t];i&&(n.hasDefaultAudio=n.hasDefaultAudio||e.hasDefaultAudio?i.hasDefault:i.hasAutoSelect||!e.hasDefaultAudio&&!e.hasAutoSelectAudio,Object.keys(i.channels).forEach(t=>{n.channels[t]=(n.channels[t]||0)+i.channels[t]}))}),t},{})}(f,L,e,i)),r=function(t,e,i,s,r){const n=Object.keys(t),a=null==s?void 0:s.channels,o=null==s?void 0:s.audioCodec,l=null==r?void 0:r.videoCodec,d=a&&2===parseInt(a);let h=!1,c=!1,u=1/0,f=1/0,g=1/0,m=1/0,p=0,A=[];const{preferHDR:v,allowedVideoRanges:y}=_h(e,r);for(let b=n.length;b--;){const e=t[n[b]];h||(h=e.channels[2]>0),u=Math.min(u,e.minHeight),f=Math.min(f,e.minFramerate),g=Math.min(g,e.minBitrate),y.filter(t=>e.videoRanges[t]>0).length>0&&(c=!0)}u=Ul(u)?u:0,f=Ul(f)?f:0;const E=Math.max(1080,u),T=Math.max(30,f);g=Ul(g)?g:i,i=Math.max(g,i),c||(e=void 0);const S=n.length>1;return{codecSet:n.reduce((e,s)=>{const r=t[s];if(s===e)return e;if(A=c?y.filter(t=>r.videoRanges[t]>0):[],S){if(r.minBitrate>i)return Hh(s,`min bitrate of ${r.minBitrate} > current estimate of ${i}`),e;if(!r.hasDefaultAudio)return Hh(s,"no renditions with default or auto-select sound found"),e;if(o&&s.indexOf(o.substring(0,4))%5!=0)return Hh(s,`audio codec preference "${o}" not found`),e;if(a&&!d){if(!r.channels[a])return Hh(s,`no renditions with ${a} channel sound found (channels options: ${Object.keys(r.channels)})`),e}else if((!o||d)&&h&&0===r.channels[2])return Hh(s,"no renditions with stereo sound found"),e;if(r.minHeight>E)return Hh(s,`min resolution of ${r.minHeight} > maximum of ${E}`),e;if(r.minFramerate>T)return Hh(s,`min framerate of ${r.minFramerate} > maximum of ${T}`),e;if(!A.some(t=>r.videoRanges[t]>0))return Hh(s,`no variants with VIDEO-RANGE of ${Uh(A)} found`),e;if(l&&s.indexOf(l.substring(0,4))%5!=0)return Hh(s,`video codec preference "${l}" not found`),e;if(r.maxScore<p)return Hh(s,`max score of ${r.maxScore} < selected max of ${p}`),e}return e&&(fh(s)>=fh(e)||r.fragmentError>t[e].fragmentError)?e:(m=r.minIndex,p=r.maxScore,s)},void 0),videoRanges:A,preferHDR:v,minFramerate:f,minBitrate:g,minIndex:m}}(s,T,t,b,I),{codecSet:n,videoRanges:a,minFramerate:o,minBitrate:l,minIndex:d,preferHDR:h}=r;R=d,E=n,T=h?a[a.length-1]:a[0],S=o,t=Math.max(t,l),this.log(`picked start tier ${Uh(r)}`)}else E=null==A?void 0:A.codecSet,T=null==A?void 0:A.videoRange;const k=u?u.duration:c?c.duration:0,w=this.bwEstimator.getEstimateTTFB()/1e3,D=[];for(let x=i;x>=e;x--){var C;const e=f[x],o=x>h;if(!e)continue;if(p.useMediaCapabilities&&!e.supportedResult&&!e.supportedPromise){const i=navigator.mediaCapabilities;"function"==typeof(null==i?void 0:i.decodingInfo)&&Lh(e,L,T,S,t,b)?(e.supportedPromise=Rh(e,L,i,this.supportedCache),e.supportedPromise.then(t=>{if(!this.hls)return;e.supportedResult=t;const i=this.hls.levels,s=i.indexOf(e);t.error?this.warn(`MediaCapabilities decodingInfo error: "${t.error}" for level ${s} ${Uh(t)}`):t.supported?t.decodingInfoResults.some(t=>!1===t.smooth||!1===t.powerEfficient)&&this.log(`MediaCapabilities decodingInfo for level ${s} not smooth or powerEfficient: ${Uh(t)}`):(this.warn(`Unsupported MediaCapabilities decodingInfo result for level ${s} ${Uh(t)}`),s>-1&&i.length>1&&(this.log(`Removing unsupported level ${s}`),this.hls.removeLevel(s),-1===this.hls.loadLevel&&(this.hls.nextLoadLevel=0)))}).catch(t=>{this.warn(`Error handling MediaCapabilities decodingInfo: ${t}`)})):e.supportedResult=bh}if((E&&e.codecSet!==E||T&&e.videoRange!==T||o&&S>e.frameRate||!o&&S>0&&S<e.frameRate||null!=(C=e.supportedResult)&&null!=(C=C.decodingInfoResults)&&C.some(t=>!1===t.smooth))&&(!y||x!==R)){D.push(x);continue}const c=e.details,g=(u?null==c?void 0:c.partTarget:null==c?void 0:c.averagetargetduration)||k;let A;A=o?a*t:n*t;const I=k&&s>=2*k&&0===r?e.averageBitrate:e.maxBitrate,P=this.getTimeToLoadFrag(w,A,I*g,void 0===c);if(A>=I&&(x===d||0===e.loadError&&0===e.fragmentError)&&(P<=w||!Ul(P)||v&&!this.bitrateTestDelay||P<l)){const t=this.forcedAutoLevel;return x===m||-1!==t&&t===m||(D.length&&this.trace(`Skipped level(s) ${D.join(",")} of ${i} max with CODECS and VIDEO-RANGE:"${f[D[0]].codecs}" ${f[D[0]].videoRange}; not compatible with "${E}" ${T}`),this.info(`switch candidate:${h}->${x} adjustedbw(${Math.round(A)})-bitrate=${Math.round(A-I)} ttfb:${w.toFixed(1)} avgDuration:${g.toFixed(1)} maxFetchDuration:${l.toFixed(1)} fetchDuration:${P.toFixed(1)} firstSelection:${y} codecSet:${e.codecSet} videoRange:${e.videoRange} hls.loadLevel:${m}`)),y&&(this.firstSelection=x),x}}return-1}set nextAutoLevel(t){const e=this.deriveNextAutoLevel(t);this._nextAutoLevel!==e&&(this.nextAutoLevelKey="",this._nextAutoLevel=e)}deriveNextAutoLevel(t){const{maxAutoLevel:e,minAutoLevel:i}=this.hls;return Math.min(Math.max(t,i),e)}},bufferController:class extends rd{constructor(t,e){var i;super("buffer-controller",t.logger),this.hls=void 0,this.fragmentTracker=void 0,this.details=null,this._objectUrl=null,this.operationQueue=null,this.bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.lastMpegAudioChunk=null,this.blockedAudioAppend=null,this.lastVideoAppendEnd=0,this.appendSource=void 0,this.transferData=void 0,this.overrides=void 0,this.appendErrors={audio:0,video:0,audiovideo:0},this.tracks={},this.sourceBuffers=[[null,null],[null,null]],this._onEndStreaming=t=>{var e;this.hls&&"open"===(null==(e=this.mediaSource)?void 0:e.readyState)&&this.hls.pauseBuffering()},this._onStartStreaming=t=>{this.hls&&this.hls.resumeBuffering()},this._onMediaSourceOpen=t=>{const{media:e,mediaSource:i}=this;t&&this.log("Media source opened"),e&&i&&(i.removeEventListener("sourceopen",this._onMediaSourceOpen),e.removeEventListener("emptied",this._onMediaEmptied),this.updateDuration(),this.hls.trigger(Ql.MEDIA_ATTACHED,{media:e,mediaSource:i}),null!==this.mediaSource&&this.checkPendingTracks())},this._onMediaSourceClose=()=>{this.log("Media source closed")},this._onMediaSourceEnded=()=>{this.log("Media source ended")},this._onMediaEmptied=()=>{const{mediaSrc:t,_objectUrl:e}=this;t!==e&&this.error(`Media element src was set while attaching MediaSource (${e} > ${t})`)},this.hls=t,this.fragmentTracker=e,this.appendSource=(i=cd(t.config.preferManagedMediaSource),"undefined"!=typeof self&&i===self.ManagedMediaSource),this.initTracks(),this.registerListeners()}hasSourceTypes(){return Object.keys(this.tracks).length>0}destroy(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=this.blockedAudioAppend=null,this.transferData=this.overrides=void 0,this.operationQueue&&(this.operationQueue.destroy(),this.operationQueue=null),this.hls=this.fragmentTracker=null,this._onMediaSourceOpen=this._onMediaSourceClose=null,this._onMediaSourceEnded=null,this._onStartStreaming=this._onEndStreaming=null}registerListeners(){const{hls:t}=this;t.on(Ql.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(Ql.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(Ql.MANIFEST_LOADING,this.onManifestLoading,this),t.on(Ql.MANIFEST_PARSED,this.onManifestParsed,this),t.on(Ql.BUFFER_RESET,this.onBufferReset,this),t.on(Ql.BUFFER_APPENDING,this.onBufferAppending,this),t.on(Ql.BUFFER_CODECS,this.onBufferCodecs,this),t.on(Ql.BUFFER_EOS,this.onBufferEos,this),t.on(Ql.BUFFER_FLUSHING,this.onBufferFlushing,this),t.on(Ql.LEVEL_UPDATED,this.onLevelUpdated,this),t.on(Ql.FRAG_PARSED,this.onFragParsed,this),t.on(Ql.FRAG_CHANGED,this.onFragChanged,this),t.on(Ql.ERROR,this.onError,this)}unregisterListeners(){const{hls:t}=this;t.off(Ql.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(Ql.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(Ql.MANIFEST_LOADING,this.onManifestLoading,this),t.off(Ql.MANIFEST_PARSED,this.onManifestParsed,this),t.off(Ql.BUFFER_RESET,this.onBufferReset,this),t.off(Ql.BUFFER_APPENDING,this.onBufferAppending,this),t.off(Ql.BUFFER_CODECS,this.onBufferCodecs,this),t.off(Ql.BUFFER_EOS,this.onBufferEos,this),t.off(Ql.BUFFER_FLUSHING,this.onBufferFlushing,this),t.off(Ql.LEVEL_UPDATED,this.onLevelUpdated,this),t.off(Ql.FRAG_PARSED,this.onFragParsed,this),t.off(Ql.FRAG_CHANGED,this.onFragChanged,this),t.off(Ql.ERROR,this.onError,this)}transferMedia(){const{media:t,mediaSource:e}=this;if(!t)return null;const i={};if(this.operationQueue){const t=this.isUpdating();t||this.operationQueue.removeBlockers();const e=this.isQueued();(t||e)&&this.warn(`Transfering MediaSource with${e?" operations in queue":""}${t?" updating SourceBuffer(s)":""} ${this.operationQueue}`),this.operationQueue.destroy()}const s=this.transferData;return!this.sourceBufferCount&&s&&s.mediaSource===e?ed(i,s.tracks):this.sourceBuffers.forEach(t=>{const[e]=t;e&&(i[e]=ed({},this.tracks[e]),this.removeBuffer(e)),t[0]=t[1]=null}),{media:t,mediaSource:e,tracks:i}}initTracks(){this.sourceBuffers=[[null,null],[null,null]],this.tracks={},this.resetQueue(),this.resetAppendErrors(),this.lastMpegAudioChunk=this.blockedAudioAppend=null,this.lastVideoAppendEnd=0}onManifestLoading(){this.bufferCodecEventsTotal=0,this.details=null}onManifestParsed(t,e){var i;let s=2;(e.audio&&!e.video||!e.altAudio)&&(s=1),this.bufferCodecEventsTotal=s,this.log(`${s} bufferCodec event(s) expected.`),null!=(i=this.transferData)&&i.mediaSource&&this.sourceBufferCount&&s&&this.bufferCreated()}onMediaAttaching(t,e){const i=this.media=e.media;this.transferData=this.overrides=void 0;const s=cd(this.appendSource);if(s){const t=!!e.mediaSource;(t||e.overrides)&&(this.transferData=e,this.overrides=e.overrides);const n=this.mediaSource=e.mediaSource||new s;if(this.assignMediaSource(n),t)this._objectUrl=i.src,this.attachTransferred();else{const t=this._objectUrl=self.URL.createObjectURL(n);if(this.appendSource)try{i.removeAttribute("src");const e=self.ManagedMediaSource;i.disableRemotePlayback=i.disableRemotePlayback||e&&n instanceof e,sm(i),function(t,e){const i=self.document.createElement("source");i.type="video/mp4",i.src=e,t.appendChild(i)}(i,t),i.load()}catch(r){i.src=t}else i.src=t}i.addEventListener("emptied",this._onMediaEmptied)}}assignMediaSource(t){var e,i;this.log(`${(null==(e=this.transferData)?void 0:e.mediaSource)===t?"transferred":"created"} media source: ${null==(i=t.constructor)?void 0:i.name}`),t.addEventListener("sourceopen",this._onMediaSourceOpen),t.addEventListener("sourceended",this._onMediaSourceEnded),t.addEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(t.addEventListener("startstreaming",this._onStartStreaming),t.addEventListener("endstreaming",this._onEndStreaming))}attachTransferred(){const t=this.media,e=this.transferData;if(!e||!t)return;const i=this.tracks,s=e.tracks,r=s?Object.keys(s):null,n=r?r.length:0,a=()=>{Promise.resolve().then(()=>{this.media&&this.mediaSourceOpenOrEnded&&this._onMediaSourceOpen()})};if(s&&r&&n){if(!this.tracksReady)return this.hls.config.startFragPrefetch=!0,void this.log("attachTransferred: waiting for SourceBuffer track info");if(this.log(`attachTransferred: (bufferCodecEventsTotal ${this.bufferCodecEventsTotal})\nrequired tracks: ${Uh(i,(t,e)=>"initSegment"===t?void 0:e)};\ntransfer tracks: ${Uh(s,(t,e)=>"initSegment"===t?void 0:e)}}`),!ud(s,i)){e.mediaSource=null,e.tracks=void 0;const r=t.currentTime,n=this.details,a=Math.max(r,(null==n?void 0:n.fragments[0].start)||0);return a-r>1?void this.log(`attachTransferred: waiting for playback to reach new tracks start time ${r} -> ${a}`):(this.warn(`attachTransferred: resetting MediaSource for incompatible tracks ("${Object.keys(s)}"->"${Object.keys(i)}") start time: ${a} currentTime: ${r}`),this.onMediaDetaching(Ql.MEDIA_DETACHING,{}),this.onMediaAttaching(Ql.MEDIA_ATTACHING,e),void(t.currentTime=a))}this.transferData=void 0,r.forEach(t=>{const e=t,i=s[e];if(i){const t=i.buffer;if(t){const s=this.fragmentTracker,r=i.id;if(s.hasFragments(r)||s.hasParts(r)){const i=_c.getBuffered(t);s.detectEvictedFragments(e,i,r,null,!0)}const n=rm(e),a=[e,t];this.sourceBuffers[n]=a,t.updating&&this.operationQueue&&this.operationQueue.prependBlocker(e),this.trackSourceBuffer(e,i)}}}),a(),this.bufferCreated()}else this.log("attachTransferred: MediaSource w/o SourceBuffers"),a()}get mediaSourceOpenOrEnded(){var t;const e=null==(t=this.mediaSource)?void 0:t.readyState;return"open"===e||"ended"===e}onMediaDetaching(t,e){const i=!!e.transferMedia;this.transferData=this.overrides=void 0;const{media:s,mediaSource:r,_objectUrl:n}=this;if(r){if(this.log("media source "+(i?"transferring":"detaching")),i)this.sourceBuffers.forEach(([t])=>{t&&this.removeBuffer(t)}),this.resetQueue();else{if(this.mediaSourceOpenOrEnded){const t="open"===r.readyState;try{const e=r.sourceBuffers;for(let i=e.length;i--;)t&&e[i].abort(),r.removeSourceBuffer(e[i]);t&&r.endOfStream()}catch(wE){this.warn(`onMediaDetaching: ${wE.message} while calling endOfStream`)}}this.sourceBufferCount&&this.onBufferReset()}r.removeEventListener("sourceopen",this._onMediaSourceOpen),r.removeEventListener("sourceended",this._onMediaSourceEnded),r.removeEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(r.removeEventListener("startstreaming",this._onStartStreaming),r.removeEventListener("endstreaming",this._onEndStreaming)),this.mediaSource=null,this._objectUrl=null}s&&(s.removeEventListener("emptied",this._onMediaEmptied),i||(n&&self.URL.revokeObjectURL(n),this.mediaSrc===n?(s.removeAttribute("src"),this.appendSource&&sm(s),s.load()):this.warn("media|source.src was changed by a third party - skip cleanup")),this.media=null),this.hls.trigger(Ql.MEDIA_DETACHED,e)}onBufferReset(){this.sourceBuffers.forEach(([t])=>{t&&this.resetBuffer(t)}),this.initTracks()}resetBuffer(t){var e;const i=null==(e=this.tracks[t])?void 0:e.buffer;if(this.removeBuffer(t),i)try{var s;null!=(s=this.mediaSource)&&s.sourceBuffers.length&&this.mediaSource.removeSourceBuffer(i)}catch(wE){this.warn(`onBufferReset ${t}`,wE)}delete this.tracks[t]}removeBuffer(t){this.removeBufferListeners(t),this.sourceBuffers[rm(t)]=[null,null];const e=this.tracks[t];e&&(e.buffer=void 0)}resetQueue(){this.operationQueue&&this.operationQueue.destroy(),this.operationQueue=new Jg(this.tracks)}onBufferCodecs(t,e){var i;const s=this.tracks,r=Object.keys(e);this.log(`BUFFER_CODECS: "${r}" (current SB count ${this.sourceBufferCount})`);const n="audiovideo"in e&&(s.audio||s.video)||s.audiovideo&&("audio"in e||"video"in e),a=!n&&this.sourceBufferCount&&this.media&&r.some(t=>!s[t]);n||a?this.warn(`Unsupported transition between "${Object.keys(s)}" and "${r}" SourceBuffers`):(r.forEach(t=>{var i,r;const n=e[t],{id:a,codec:o,levelCodec:l,container:d,metadata:h,supplemental:c}=n;let u=s[t];const f=null==(i=this.transferData)||null==(i=i.tracks)?void 0:i[t],g=null!=f&&f.buffer?f:u,m=(null==g?void 0:g.pendingCodec)||(null==g?void 0:g.codec),p=null==g?void 0:g.levelCodec;u||(u=s[t]={buffer:void 0,listeners:[],codec:o,supplemental:c,container:d,levelCodec:l,metadata:h,id:a});const A=Ah(m,p),v=null==A?void 0:A.replace(tm,"$1");let y=Ah(o,l);const E=null==(r=y)?void 0:r.replace(tm,"$1");y&&A&&v!==E&&("audio"===t.slice(0,5)&&(y=ph(y,this.appendSource)),this.log(`switching codec ${m} to ${y}`),y!==(u.pendingCodec||u.codec)&&(u.pendingCodec=y),u.container=d,this.appendChangeType(t,d,y))}),(this.tracksReady||this.sourceBufferCount)&&(e.tracks=this.sourceBufferTracks),this.sourceBufferCount||(this.bufferCodecEventsTotal>1&&!this.tracks.video&&!e.video&&"main"===(null==(i=e.audio)?void 0:i.id)&&(this.log("Main audio-only"),this.bufferCodecEventsTotal=1),this.mediaSourceOpenOrEnded&&this.checkPendingTracks()))}get sourceBufferTracks(){return Object.keys(this.tracks).reduce((t,e)=>{const i=this.tracks[e];return t[e]={id:i.id,container:i.container,codec:i.codec,levelCodec:i.levelCodec},t},{})}appendChangeType(t,e,i){const s=`${e};codecs=${i}`,r={label:`change-type=${s}`,execute:()=>{const r=this.tracks[t];if(r){const n=r.buffer;null!=n&&n.changeType&&(this.log(`changing ${t} sourceBuffer type to ${s}`),n.changeType(s),r.codec=i,r.container=e)}this.shiftAndExecuteNext(t)},onStart:()=>{},onComplete:()=>{},onError:e=>{this.warn(`Failed to change ${t} SourceBuffer type`,e)}};this.append(r,t,this.isPending(this.tracks[t]))}blockAudio(t){var e;const i=t.start,s=i+.05*t.duration;if(!0===(null==(e=this.fragmentTracker.getAppendedFrag(i,$l))?void 0:e.gap))return;const r={label:"block-audio",execute:()=>{var t;const e=this.tracks.video;(this.lastVideoAppendEnd>s||null!=e&&e.buffer&&_c.isBuffered(e.buffer,s)||!0===(null==(t=this.fragmentTracker.getAppendedFrag(s,$l))?void 0:t.gap))&&(this.blockedAudioAppend=null,this.shiftAndExecuteNext("audio"))},onStart:()=>{},onComplete:()=>{},onError:t=>{this.warn("Error executing block-audio operation",t)}};this.blockedAudioAppend={op:r,frag:t},this.append(r,"audio",!0)}unblockAudio(){const{blockedAudioAppend:t,operationQueue:e}=this;t&&e&&(this.blockedAudioAppend=null,e.unblockAudio(t.op))}onBufferAppending(t,e){const{tracks:i}=this,{data:s,type:r,parent:n,frag:a,part:o,chunkMeta:l,offset:d}=e,h=l.buffering[r],{sn:c,cc:u}=a,f=self.performance.now();h.start=f;const g=a.stats.buffering,m=o?o.stats.buffering:null;0===g.start&&(g.start=f),m&&0===m.start&&(m.start=f);const p=i.audio;let A=!1;"audio"===r&&"audio/mpeg"===(null==p?void 0:p.container)&&(A=!this.lastMpegAudioChunk||1===l.id||this.lastMpegAudioChunk.sn!==l.sn,this.lastMpegAudioChunk=l);const v=i.video,y=null==v?void 0:v.buffer;if(y&&"initSegment"!==c){const t=o||a,e=this.blockedAudioAppend;if("audio"!==r||"main"===n||this.blockedAudioAppend||v.ending||v.ended){if("video"===r){const i=t.end;if(e){const t=e.frag.start;(i>t||i<this.lastVideoAppendEnd||_c.isBuffered(y,t))&&this.unblockAudio()}this.lastVideoAppendEnd=i}}else{const e=t.start+.05*t.duration,i=y.buffered,s=this.currentOp("video");i.length||s?!s&&!_c.isBuffered(y,e)&&this.lastVideoAppendEnd<e&&this.blockAudio(t):this.blockAudio(t)}}const E=(o||a).start,T={label:`append-${r}`,execute:()=>{var t;h.executeStart=self.performance.now();const e=null==(t=this.tracks[r])?void 0:t.buffer;e&&(A?this.updateTimestampOffset(e,E,.1,r,c,u):void 0!==d&&Ul(d)&&this.updateTimestampOffset(e,d,1e-6,r,c,u)),this.appendExecutor(s,r)},onStart:()=>{},onComplete:()=>{const t=self.performance.now();h.executeEnd=h.end=t,0===g.first&&(g.first=t),m&&0===m.first&&(m.first=t);const e={};this.sourceBuffers.forEach(([t,i])=>{t&&(e[t]=_c.getBuffered(i))}),this.appendErrors[r]=0,"audio"===r||"video"===r?this.appendErrors.audiovideo=0:(this.appendErrors.audio=0,this.appendErrors.video=0),this.hls.trigger(Ql.BUFFER_APPENDED,{type:r,frag:a,part:o,chunkMeta:l,parent:a.type,timeRanges:e})},onError:t=>{var e;const i={type:Vl.MEDIA_ERROR,parent:a.type,details:Gl.BUFFER_APPEND_ERROR,sourceBufferName:r,frag:a,part:o,chunkMeta:l,error:t,err:t,fatal:!1},s=null==(e=this.media)?void 0:e.error;if(t.code===DOMException.QUOTA_EXCEEDED_ERR||"QuotaExceededError"==t.name||"quota"in t)i.details=Gl.BUFFER_FULL_ERROR;else if(t.code===DOMException.INVALID_STATE_ERR&&this.mediaSourceOpenOrEnded&&!s)i.errorAction=mc(!0);else if(t.name===em&&0===this.sourceBufferCount)i.errorAction=mc(!0);else{const t=++this.appendErrors[r];this.warn(`Failed ${t}/${this.hls.config.appendErrorMaxRetry} times to append segment in "${r}" sourceBuffer (${s||"no media error"})`),(t>=this.hls.config.appendErrorMaxRetry||s)&&(i.fatal=!0)}this.hls.trigger(Ql.ERROR,i)}};this.log(`queuing "${r}" append sn: ${c}${o?" p: "+o.index:""} of ${a.type===$l?"level":"track"} ${a.level} cc: ${u}`),this.append(T,r,this.isPending(this.tracks[r]))}getFlushOp(t,e,i){return this.log(`queuing "${t}" remove ${e}-${i}`),{label:"remove",execute:()=>{this.removeExecutor(t,e,i)},onStart:()=>{},onComplete:()=>{this.hls.trigger(Ql.BUFFER_FLUSHED,{type:t})},onError:s=>{this.warn(`Failed to remove ${e}-${i} from "${t}" SourceBuffer`,s)}}}onBufferFlushing(t,e){const{type:i,startOffset:s,endOffset:r}=e;i?this.append(this.getFlushOp(i,s,r),i):this.sourceBuffers.forEach(([t])=>{t&&this.append(this.getFlushOp(t,s,r),t)})}onFragParsed(t,e){const{frag:i,part:s}=e,r=[],n=s?s.elementaryStreams:i.elementaryStreams;n[wd]?r.push("audiovideo"):(n[Rd]&&r.push("audio"),n[kd]&&r.push("video"));0===r.length&&this.warn(`Fragments must have at least one ElementaryStreamType set. type: ${i.type} level: ${i.level} sn: ${i.sn}`),this.blockBuffers(()=>{const t=self.performance.now();i.stats.buffering.end=t,s&&(s.stats.buffering.end=t);const e=s?s.stats:i.stats;this.hls.trigger(Ql.FRAG_BUFFERED,{frag:i,part:s,stats:e,id:i.type})},r).catch(t=>{this.warn(`Fragment buffered callback ${t}`),this.stepOperationQueue(this.sourceBufferTypes)})}onFragChanged(t,e){this.trimBuffers()}get bufferedToEnd(){return this.sourceBufferCount>0&&!this.sourceBuffers.some(([t])=>{if(t){const e=this.tracks[t];if(e)return!e.ended||e.ending}return!1})}onBufferEos(t,e){var i;this.sourceBuffers.forEach(([t])=>{if(t){const i=this.tracks[t];e.type&&e.type!==t||(i.ending=!0,i.ended||(i.ended=!0,this.log(`${t} buffer reached EOS`)))}});const s=!1!==(null==(i=this.overrides)?void 0:i.endOfStream);this.sourceBufferCount>0&&!this.sourceBuffers.some(([t])=>{var e;return t&&!(null!=(e=this.tracks[t])&&e.ended)})?s?(this.log("Queueing EOS"),this.blockUntilOpen(()=>{this.tracksEnded();const{mediaSource:t}=this;t&&"open"===t.readyState?(this.log("Calling mediaSource.endOfStream()"),t.endOfStream(),this.hls.trigger(Ql.BUFFERED_TO_END,void 0)):t&&this.log(`Could not call mediaSource.endOfStream(). mediaSource.readyState: ${t.readyState}`)})):(this.tracksEnded(),this.hls.trigger(Ql.BUFFERED_TO_END,void 0)):"video"===e.type&&this.unblockAudio()}tracksEnded(){this.sourceBuffers.forEach(([t])=>{if(null!==t){const e=this.tracks[t];e&&(e.ending=!1)}})}onLevelUpdated(t,{details:e}){e.fragments.length&&(this.details=e,this.updateDuration())}updateDuration(){this.blockUntilOpen(()=>{const t=this.getDurationAndRange();t&&this.updateMediaSource(t)})}onError(t,e){if(e.details===Gl.BUFFER_APPEND_ERROR&&e.frag){var i;const t=null==(i=e.errorAction)?void 0:i.nextAutoLevel;Ul(t)&&t!==e.frag.level&&this.resetAppendErrors()}}resetAppendErrors(){this.appendErrors={audio:0,video:0,audiovideo:0}}trimBuffers(){const{hls:t,details:e,media:i}=this;if(!i||null===e)return;if(!this.sourceBufferCount)return;const s=t.config,r=i.currentTime,n=e.levelTargetDuration,a=e.live&&null!==s.liveBackBufferLength?s.liveBackBufferLength:s.backBufferLength;if(Ul(a)&&a>=0){const t=Math.max(a,n),e=Math.floor(r/n)*n-t;this.flushBackBuffer(r,n,e)}const o=s.frontBufferFlushThreshold;if(Ul(o)&&o>0){const t=Math.max(s.maxBufferLength,o),e=Math.max(t,n),i=Math.floor(r/n)*n+e;this.flushFrontBuffer(r,n,i)}}flushBackBuffer(t,e,i){this.sourceBuffers.forEach(([t,e])=>{if(e){const r=_c.getBuffered(e);if(r.length>0&&i>r.start(0)){var s;this.hls.trigger(Ql.BACK_BUFFER_REACHED,{bufferEnd:i});const e=this.tracks[t];if(null!=(s=this.details)&&s.live)this.hls.trigger(Ql.LIVE_BACK_BUFFER_REACHED,{bufferEnd:i});else if(null!=e&&e.ended)return void this.log(`Cannot flush ${t} back buffer while SourceBuffer is in ended state`);this.hls.trigger(Ql.BUFFER_FLUSHING,{startOffset:0,endOffset:i,type:t})}}})}flushFrontBuffer(t,e,i){this.sourceBuffers.forEach(([e,s])=>{if(s){const r=_c.getBuffered(s),n=r.length;if(n<2)return;const a=r.start(n-1),o=r.end(n-1);if(i>a||t>=a&&t<=o)return;this.hls.trigger(Ql.BUFFER_FLUSHING,{startOffset:a,endOffset:1/0,type:e})}})}getDurationAndRange(){var t;const{details:e,mediaSource:i}=this;if(!e||!this.media||"open"!==(null==i?void 0:i.readyState))return null;const s=e.edge;if(e.live&&this.hls.config.liveDurationInfinity){if(e.fragments.length&&i.setLiveSeekableRange){const t=Math.max(0,e.fragmentStart);return{duration:1/0,start:t,end:Math.max(t,s)}}return{duration:1/0}}const r=null==(t=this.overrides)?void 0:t.duration;if(r)return Ul(r)?{duration:r}:null;const n=this.media.duration;return s>(Ul(i.duration)?i.duration:0)&&s>n||!Ul(n)?{duration:s}:null}updateMediaSource({duration:t,start:e,end:i}){const s=this.mediaSource;this.media&&s&&"open"===s.readyState&&(s.duration!==t&&(Ul(t)&&this.log(`Updating MediaSource duration to ${t.toFixed(3)}`),s.duration=t),void 0!==e&&void 0!==i&&(this.log(`MediaSource duration is set to ${s.duration}. Setting seekable range to ${e}-${i}.`),s.setLiveSeekableRange(e,i)))}get tracksReady(){const t=this.pendingTrackCount;return t>0&&(t>=this.bufferCodecEventsTotal||this.isPending(this.tracks.audiovideo))}checkPendingTracks(){const{bufferCodecEventsTotal:t,pendingTrackCount:e,tracks:i}=this;if(this.log(`checkPendingTracks (pending: ${e} codec events expected: ${t}) ${Uh(i)}`),this.tracksReady){var s;const t=null==(s=this.transferData)?void 0:s.tracks;t&&Object.keys(t).length?this.attachTransferred():this.createSourceBuffers()}}bufferCreated(){if(this.sourceBufferCount){const t={};this.sourceBuffers.forEach(([e,i])=>{if(e){const s=this.tracks[e];t[e]={buffer:i,container:s.container,codec:s.codec,supplemental:s.supplemental,levelCodec:s.levelCodec,id:s.id,metadata:s.metadata}}}),this.hls.trigger(Ql.BUFFER_CREATED,{tracks:t}),this.log(`SourceBuffers created. Running queue: ${this.operationQueue}`),this.sourceBuffers.forEach(([t])=>{this.executeNext(t)})}else{const t=new Error("could not create source buffer for media codec(s)");this.hls.trigger(Ql.ERROR,{type:Vl.MEDIA_ERROR,details:Gl.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:t,reason:t.message})}}createSourceBuffers(){const{tracks:t,sourceBuffers:e,mediaSource:i}=this;if(!i)throw new Error("createSourceBuffers called when mediaSource was null");for(const n in t){const a=n,o=t[a];if(this.isPending(o)){const t=this.getTrackCodec(o,a),n=`${o.container};codecs=${t}`;o.codec=t,this.log(`creating sourceBuffer(${n})${this.currentOp(a)?" Queued":""} ${Uh(o)}`);try{const t=i.addSourceBuffer(n),s=rm(a),r=[a,t];e[s]=r,o.buffer=t}catch(r){var s;return this.error(`error while trying to add sourceBuffer: ${r.message}`),this.shiftAndExecuteNext(a),null==(s=this.operationQueue)||s.removeBlockers(),delete this.tracks[a],void this.hls.trigger(Ql.ERROR,{type:Vl.MEDIA_ERROR,details:Gl.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:r,sourceBufferName:a,mimeType:n,parent:o.id})}this.trackSourceBuffer(a,o)}}this.bufferCreated()}getTrackCodec(t,e){const i=t.supplemental;let s=t.codec;i&&("video"===e||"audiovideo"===e)&&dh(i,"video")&&(s=function(t,e){const i=[];if(t){const e=t.split(",");for(let t=0;t<e.length;t++)lh(e[t],"video")||i.push(e[t])}return e&&i.push(e),i.join(",")}(s,i));const r=Ah(s,t.levelCodec);return r?"audio"===e.slice(0,5)?ph(r,this.appendSource):r:""}trackSourceBuffer(t,e){const i=e.buffer;if(!i)return;const s=this.getTrackCodec(e,t);this.tracks[t]={buffer:i,codec:s,container:e.container,levelCodec:e.levelCodec,supplemental:e.supplemental,metadata:e.metadata,id:e.id,listeners:[]},this.removeBufferListeners(t),this.addBufferListener(t,"updatestart",this.onSBUpdateStart),this.addBufferListener(t,"updateend",this.onSBUpdateEnd),this.addBufferListener(t,"error",this.onSBUpdateError),this.appendSource&&this.addBufferListener(t,"bufferedchange",(t,e)=>{const i=e.removedRanges;null!=i&&i.length&&this.hls.trigger(Ql.BUFFER_FLUSHED,{type:t})})}get mediaSrc(){var t,e;const i=(null==(t=this.media)||null==(e=t.querySelector)?void 0:e.call(t,"source"))||this.media;return null==i?void 0:i.src}onSBUpdateStart(t){const e=this.currentOp(t);e&&e.onStart()}onSBUpdateEnd(t){var e;if("closed"===(null==(e=this.mediaSource)?void 0:e.readyState))return void this.resetBuffer(t);const i=this.currentOp(t);i&&(i.onComplete(),this.shiftAndExecuteNext(t))}onSBUpdateError(t,e){var i;const s=new Error(`${t} SourceBuffer error. MediaSource readyState: ${null==(i=this.mediaSource)?void 0:i.readyState}`);this.error(`${s}`,e),this.hls.trigger(Ql.ERROR,{type:Vl.MEDIA_ERROR,details:Gl.BUFFER_APPENDING_ERROR,sourceBufferName:t,error:s,fatal:!1});const r=this.currentOp(t);r&&r.onError(s)}updateTimestampOffset(t,e,i,s,r,n){const a=e-t.timestampOffset;Math.abs(a)>=i&&(this.log(`Updating ${s} SourceBuffer timestampOffset to ${e} (sn: ${r} cc: ${n})`),t.timestampOffset=e)}removeExecutor(t,e,i){const{media:s,mediaSource:r}=this,n=this.tracks[t],a=null==n?void 0:n.buffer;if(!s||!r||!a)return this.warn(`Attempting to remove from the ${t} SourceBuffer, but it does not exist`),void this.shiftAndExecuteNext(t);const o=Ul(s.duration)?s.duration:1/0,l=Ul(r.duration)?r.duration:1/0,d=Math.max(0,e),h=Math.min(i,o,l);h>d&&(!n.ending||n.ended)?(n.ended=!1,this.log(`Removing [${d},${h}] from the ${t} SourceBuffer`),a.remove(d,h)):this.shiftAndExecuteNext(t)}appendExecutor(t,e){const i=this.tracks[e],s=null==i?void 0:i.buffer;if(!s)throw new im(`Attempting to append to the ${e} SourceBuffer, but it does not exist`);i.ending=!1,i.ended=!1,s.appendBuffer(t)}blockUntilOpen(t){if(this.isUpdating()||this.isQueued())this.blockBuffers(t).catch(t=>{this.warn(`SourceBuffer blocked callback ${t}`),this.stepOperationQueue(this.sourceBufferTypes)});else try{t()}catch(e){this.warn(`Callback run without blocking ${this.operationQueue} ${e}`)}}isUpdating(){return this.sourceBuffers.some(([t,e])=>t&&e.updating)}isQueued(){return this.sourceBuffers.some(([t])=>t&&!!this.currentOp(t))}isPending(t){return!!t&&!t.buffer}blockBuffers(t,e=this.sourceBufferTypes){if(!e.length)return this.log("Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(t);const{operationQueue:i}=this,s=e.map(t=>this.appendBlocker(t));return e.length>1&&!!this.blockedAudioAppend&&this.unblockAudio(),Promise.all(s).then(e=>{i===this.operationQueue&&(t(),this.stepOperationQueue(this.sourceBufferTypes))})}stepOperationQueue(t){t.forEach(t=>{var e;const i=null==(e=this.tracks[t])?void 0:e.buffer;i&&!i.updating&&this.shiftAndExecuteNext(t)})}append(t,e,i){this.operationQueue&&this.operationQueue.append(t,e,i)}appendBlocker(t){if(this.operationQueue)return this.operationQueue.appendBlocker(t)}currentOp(t){return this.operationQueue?this.operationQueue.current(t):null}executeNext(t){t&&this.operationQueue&&this.operationQueue.executeNext(t)}shiftAndExecuteNext(t){this.operationQueue&&this.operationQueue.shiftAndExecuteNext(t)}get pendingTrackCount(){return Object.keys(this.tracks).reduce((t,e)=>t+(this.isPending(this.tracks[e])?1:0),0)}get sourceBufferCount(){return this.sourceBuffers.reduce((t,[e])=>t+(e?1:0),0)}get sourceBufferTypes(){return this.sourceBuffers.map(([t])=>t).filter(t=>!!t)}addBufferListener(t,e,i){const s=this.tracks[t];if(!s)return;const r=s.buffer;if(!r)return;const n=i.bind(this,t);s.listeners.push({event:e,listener:n}),r.addEventListener(e,n)}removeBufferListeners(t){const e=this.tracks[t];if(!e)return;const i=e.buffer;i&&(e.listeners.forEach(t=>{i.removeEventListener(t.event,t.listener)}),e.listeners.length=0)}},capLevelController:nm,errorController:class extends rd{constructor(t){super("error-controller",t.logger),this.hls=void 0,this.playlistError=0,this.hls=t,this.registerListeners()}registerListeners(){const t=this.hls;t.on(Ql.ERROR,this.onError,this),t.on(Ql.MANIFEST_LOADING,this.onManifestLoading,this),t.on(Ql.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const t=this.hls;t&&(t.off(Ql.ERROR,this.onError,this),t.off(Ql.ERROR,this.onErrorOut,this),t.off(Ql.MANIFEST_LOADING,this.onManifestLoading,this),t.off(Ql.LEVEL_UPDATED,this.onLevelUpdated,this))}destroy(){this.unregisterListeners(),this.hls=null}startLoad(t){}stopLoad(){this.playlistError=0}getVariantLevelIndex(t){return(null==t?void 0:t.type)===$l?t.level:this.getVariantIndex()}getVariantIndex(){var t;const e=this.hls,i=e.currentLevel;return null!=(t=e.loadLevelObj)&&t.details||-1===i?e.loadLevel:i}variantHasKey(t,e){if(t){var i;if(null!=(i=t.details)&&i.hasKey(e))return!0;const s=t.audioGroups;if(s){return this.hls.allAudioTracks.filter(t=>s.indexOf(t.groupId)>=0).some(t=>{var i;return null==(i=t.details)?void 0:i.hasKey(e)})}}return!1}onManifestLoading(){this.playlistError=0}onLevelUpdated(){this.playlistError=0}onError(t,e){var i;if(e.fatal)return;const s=this.hls,r=e.context;switch(e.details){case Gl.FRAG_LOAD_ERROR:case Gl.FRAG_LOAD_TIMEOUT:case Gl.KEY_LOAD_ERROR:case Gl.KEY_LOAD_TIMEOUT:return void(e.errorAction=this.getFragRetryOrSwitchAction(e));case Gl.FRAG_PARSING_ERROR:if(null!=(i=e.frag)&&i.gap)return void(e.errorAction=mc());case Gl.FRAG_GAP:case Gl.FRAG_DECRYPT_ERROR:return e.errorAction=this.getFragRetryOrSwitchAction(e),void(e.errorAction.action=lc);case Gl.LEVEL_EMPTY_ERROR:case Gl.LEVEL_PARSING_ERROR:{var n;const t=e.parent===$l?e.level:s.loadLevel;e.details===Gl.LEVEL_EMPTY_ERROR&&null!=(n=e.context)&&null!=(n=n.levelDetails)&&n.live?e.errorAction=this.getPlaylistRetryOrSwitchAction(e,t):(e.levelRetry=!1,e.errorAction=this.getLevelSwitchAction(e,t))}return;case Gl.LEVEL_LOAD_ERROR:case Gl.LEVEL_LOAD_TIMEOUT:return void("number"==typeof(null==r?void 0:r.level)&&(e.errorAction=this.getPlaylistRetryOrSwitchAction(e,r.level)));case Gl.AUDIO_TRACK_LOAD_ERROR:case Gl.AUDIO_TRACK_LOAD_TIMEOUT:case Gl.SUBTITLE_LOAD_ERROR:case Gl.SUBTITLE_TRACK_LOAD_TIMEOUT:if(r){const t=s.loadLevelObj;if(t&&(r.type===Wl&&t.hasAudioGroup(r.groupId)||r.type===Yl&&t.hasSubtitleGroup(r.groupId)))return e.errorAction=this.getPlaylistRetryOrSwitchAction(e,s.loadLevel),e.errorAction.action=lc,void(e.errorAction.flags=uc)}return;case Gl.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:return void(e.errorAction={action:lc,flags:fc});case Gl.KEY_SYSTEM_SESSION_UPDATE_FAILED:case Gl.KEY_SYSTEM_STATUS_INTERNAL_ERROR:case Gl.KEY_SYSTEM_NO_SESSION:return void(e.errorAction={action:lc,flags:gc});case Gl.BUFFER_ADD_CODEC_ERROR:case Gl.REMUX_ALLOC_ERROR:case Gl.BUFFER_APPEND_ERROR:var a;if(!e.errorAction)e.errorAction=this.getLevelSwitchAction(e,null!=(a=e.level)?a:s.loadLevel);return;case Gl.INTERNAL_EXCEPTION:case Gl.BUFFER_APPENDING_ERROR:case Gl.BUFFER_FULL_ERROR:case Gl.LEVEL_SWITCH_ERROR:case Gl.BUFFER_STALLED_ERROR:case Gl.BUFFER_SEEK_OVER_HOLE:case Gl.BUFFER_NUDGE_ON_STALL:return void(e.errorAction=mc())}e.type===Vl.KEY_SYSTEM_ERROR&&(e.levelRetry=!1,e.errorAction=mc())}getPlaylistRetryOrSwitchAction(t,e){const i=ic(this.hls.config.playlistLoadPolicy,t),s=this.playlistError++;if(nc(i,s,Jh(t),t.response))return{action:hc,flags:cc,retryConfig:i,retryCount:s};const r=this.getLevelSwitchAction(t,e);return i&&(r.retryConfig=i,r.retryCount=s),r}getFragRetryOrSwitchAction(t){const e=this.hls,i=this.getVariantLevelIndex(t.frag),s=e.levels[i],{fragLoadPolicy:r,keyLoadPolicy:n}=e.config,a=ic(tc(t)?n:r,t),o=e.levels.reduce((t,e)=>t+e.fragmentError,0);if(s&&(t.details!==Gl.FRAG_GAP&&s.fragmentError++,!ec(t))){if(nc(a,o,Jh(t),t.response))return{action:hc,flags:cc,retryConfig:a,retryCount:o}}const l=this.getLevelSwitchAction(t,i);return a&&(l.retryConfig=a,l.retryCount=o),l}getLevelSwitchAction(t,e){const i=this.hls;null==e&&(e=i.loadLevel);const s=this.hls.levels[e];if(s){var r,n;const e=t.details;s.loadError++,e===Gl.BUFFER_APPEND_ERROR&&s.fragmentError++;let l=-1;const{levels:d,loadLevel:h,minAutoLevel:c,maxAutoLevel:u}=i;i.autoLevelEnabled||i.config.preserveManualLevelOnError||(i.loadLevel=-1);const f=null==(r=t.frag)?void 0:r.type,g=(f===zl&&e===Gl.FRAG_PARSING_ERROR||"audio"===t.sourceBufferName&&(e===Gl.BUFFER_ADD_CODEC_ERROR||e===Gl.BUFFER_APPEND_ERROR))&&d.some(({audioCodec:t})=>s.audioCodec!==t),m="video"===t.sourceBufferName&&(e===Gl.BUFFER_ADD_CODEC_ERROR||e===Gl.BUFFER_APPEND_ERROR)&&d.some(({codecSet:t,audioCodec:e})=>s.codecSet!==t&&s.audioCodec===e),{type:p,groupId:A}=null!=(n=t.context)?n:{};for(let i=d.length;i--;){const r=(i+h)%d.length;if(r!==h&&r>=c&&r<=u&&0===d[r].loadError){var a,o;const i=d[r];if(e===Gl.FRAG_GAP&&f===$l&&t.frag){const e=d[r].details;if(e){const i=$h(t.frag,e.fragments,t.frag.start);if(null!=i&&i.gap)continue}}else{if(p===Wl&&i.hasAudioGroup(A)||p===Yl&&i.hasSubtitleGroup(A))continue;if(f===zl&&null!=(a=s.audioGroups)&&a.some(t=>i.hasAudioGroup(t))||f===Xl&&null!=(o=s.subtitleGroups)&&o.some(t=>i.hasSubtitleGroup(t))||g&&s.audioCodec===i.audioCodec||m&&s.codecSet===i.codecSet||!g&&s.codecSet!==i.codecSet)continue}l=r;break}}if(l>-1&&i.loadLevel!==l)return t.levelRetry=!0,this.playlistError=0,{action:lc,flags:cc,nextAutoLevel:l}}return{action:lc,flags:uc}}onErrorOut(t,e){var i;switch(null==(i=e.errorAction)?void 0:i.action){case oc:break;case lc:this.sendAlternateToPenaltyBox(e),e.errorAction.resolved||e.details===Gl.FRAG_GAP?/MediaSource readyState: ended/.test(e.error.message)&&(this.warn(`MediaSource ended after "${e.sourceBufferName}" sourceBuffer append error. Attempting to recover from media error.`),this.hls.recoverMediaError()):e.fatal=!0}e.fatal&&this.hls.stopLoad()}sendAlternateToPenaltyBox(t){const e=this.hls,i=t.errorAction;if(!i)return;const{flags:s}=i,r=i.nextAutoLevel;switch(s){case cc:this.switchLevel(t,r);break;case fc:{const s=this.getVariantLevelIndex(t.frag),r=e.levels[s],n=null==r?void 0:r.attrs["HDCP-LEVEL"];if(i.hdcpLevel=n,"NONE"===n)this.warn("HDCP policy resticted output with HDCP-LEVEL=NONE");else if(n){e.maxHdcpLevel=Dh[Dh.indexOf(n)-1],i.resolved=!0,this.warn(`Restricting playback to HDCP-LEVEL of "${e.maxHdcpLevel}" or lower`);break}}case gc:{const e=t.decryptdata;if(e){const s=this.hls.levels,r=s.length;for(let i=r;i--;){var n,a;if(this.variantHasKey(s[i],e))this.log(`Banned key found in level ${i} (${s[i].bitrate}bps) or audio group "${null==(n=s[i].audioGroups)?void 0:n.join(",")}" (${null==(a=t.frag)?void 0:a.type} fragment) ${gd(e.keyId||[])}`),s[i].fragmentError++,s[i].loadError++,this.log(`Removing level ${i} with key error (${t.error})`),this.hls.removeLevel(i)}const o=t.frag;if(this.hls.levels.length<r)i.resolved=!0;else if(o&&o.type!==$l){const t=o.decryptdata;t&&!e.matches(t)&&(i.resolved=!0)}}break}}i.resolved||this.switchLevel(t,r)}switchLevel(t,e){if(void 0!==e&&t.errorAction&&(this.warn(`switching to level ${e} after ${t.details}`),this.hls.nextAutoLevel=e,t.errorAction.resolved=!0,this.hls.nextLoadLevel=this.hls.nextAutoLevel,t.details===Gl.BUFFER_ADD_CODEC_ERROR&&t.mimeType&&"audiovideo"!==t.sourceBufferName)){const e=Th(t.mimeType),i=this.hls.levels;for(let s=i.length;s--;)i[s][`${t.sourceBufferName}Codec`]===e&&(this.log(`Removing level ${s} for ${t.details} ("${e}" not supported)`),this.hls.removeLevel(s))}}},fpsController:class{constructor(t){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=t,this.registerListeners()}setStreamController(t){this.streamController=t}registerListeners(){this.hls.on(Ql.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.on(Ql.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListeners(){this.hls.off(Ql.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.off(Ql.MEDIA_DETACHING,this.onMediaDetaching,this)}destroy(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}onMediaAttaching(t,e){const i=this.hls.config;if(i.capLevelOnFPSDrop){const t=e.media instanceof self.HTMLVideoElement?e.media:null;this.media=t,t&&"function"==typeof t.getVideoPlaybackQuality&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),i.fpsDroppedMonitoringPeriod)}}onMediaDetaching(){this.media=null}checkFPS(t,e,i){const s=performance.now();if(e){if(this.lastTime){const t=s-this.lastTime,r=i-this.lastDroppedFrames,n=e-this.lastDecodedFrames,a=1e3*r/t,o=this.hls;if(o.trigger(Ql.FPS_DROP,{currentDropped:r,currentDecoded:n,totalDroppedFrames:i}),a>0&&r>o.config.fpsDroppedMonitoringThreshold*n){let t=o.currentLevel;o.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+t),t>0&&(-1===o.autoLevelCapping||o.autoLevelCapping>=t)&&(t-=1,o.trigger(Ql.FPS_DROP_LEVEL_CAPPING,{level:t,droppedLevel:o.currentLevel}),o.autoLevelCapping=t,this.streamController.nextLevelSwitch())}}this.lastTime=s,this.lastDroppedFrames=i,this.lastDecodedFrames=e}}checkFPSInterval(){const t=this.media;if(t)if(this.isVideoPlaybackQualityAvailable){const e=t.getVideoPlaybackQuality();this.checkFPS(t,e.totalVideoFrames,e.droppedVideoFrames)}else this.checkFPS(t,t.webkitDecodedFrameCount,t.webkitDroppedFrameCount)}},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:gu,requireKeySystemAccessOnStart:!1,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableEmsgKLVMetadata:!1,enableID3MetadataCues:!0,enableInterstitialPlayback:!0,interstitialAppendInPlace:!0,interstitialLiveLookAhead:10,useMediaCapabilities:!0,preserveManualLevelOnError:!1,certLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null}},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}}},interstitialAssetListLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:3e4,timeoutRetry:{maxNumRetry:0,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:0,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},{cueHandler:SA,enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}),{},{subtitleStreamController:class extends Af{constructor(t,e,i){super(t,e,i,"subtitle-stream-controller",Xl),this.currentTrackId=-1,this.tracksBuffered=[],this.mainDetails=null,this.registerListeners()}onHandlerDestroying(){this.unregisterListeners(),super.onHandlerDestroying(),this.mainDetails=null}registerListeners(){super.registerListeners();const{hls:t}=this;t.on(Ql.LEVEL_LOADED,this.onLevelLoaded,this),t.on(Ql.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.on(Ql.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),t.on(Ql.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.on(Ql.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),t.on(Ql.BUFFER_FLUSHING,this.onBufferFlushing,this)}unregisterListeners(){super.unregisterListeners();const{hls:t}=this;t.off(Ql.LEVEL_LOADED,this.onLevelLoaded,this),t.off(Ql.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.off(Ql.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),t.off(Ql.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.off(Ql.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),t.off(Ql.BUFFER_FLUSHING,this.onBufferFlushing,this)}startLoad(t,e){this.stopLoad(),this.state=af,this.setInterval(500),this.nextLoadPosition=this.lastCurrentTime=t+this.timelineOffset,this.startPosition=e?-1:t,this.tick()}onManifestLoading(){super.onManifestLoading(),this.mainDetails=null}onMediaDetaching(t,e){this.tracksBuffered=[],super.onMediaDetaching(t,e)}onLevelLoaded(t,e){this.mainDetails=e.details}onSubtitleFragProcessed(t,e){const{frag:i,success:s}=e;if(this.fragContextChanged(i)||(Cd(i)&&(this.fragPrevious=i),this.state=af),!s)return;const r=this.tracksBuffered[this.currentTrackId];if(!r)return;let n;const a=i.start;for(let l=0;l<r.length;l++)if(a>=r[l].start&&a<=r[l].end){n=r[l];break}const o=i.start+i.duration;n?n.end=o:(n={start:a,end:o},r.push(n)),this.fragmentTracker.fragBuffered(i),this.fragBufferedComplete(i,null),this.media&&this.tick()}onBufferFlushing(t,e){const{startOffset:i,endOffset:s}=e;if(0===i&&s!==Number.POSITIVE_INFINITY){const t=s-1;if(t<=0)return;e.endOffsetSubtitles=Math.max(0,t),this.tracksBuffered.forEach(e=>{for(let i=0;i<e.length;)if(e[i].end<=t)e.shift();else{if(!(e[i].start<t))break;e[i].start=t,i++}}),this.fragmentTracker.removeFragmentsInRange(i,t,Xl)}}onError(t,e){const i=e.frag;(null==i?void 0:i.type)===Xl&&(e.details===Gl.FRAG_GAP&&this.fragmentTracker.fragBuffered(i,!0),this.fragCurrent&&this.fragCurrent.abortRequests(),this.state!==nf&&(this.state=af))}onSubtitleTracksUpdated(t,{subtitleTracks:e}){this.levels&&zg(this.levels,e)?this.levels=e.map(t=>new Fh(t)):(this.tracksBuffered=[],this.levels=e.map(t=>{const e=new Fh(t);return this.tracksBuffered[e.id]=[],e}),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,Xl),this.fragPrevious=null,this.mediaBuffer=null)}onSubtitleTrackSwitch(t,e){var i;if(this.currentTrackId=e.id,null==(i=this.levels)||!i.length||-1===this.currentTrackId)return void this.clearInterval();const s=this.levels[this.currentTrackId];null!=s&&s.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,s&&this.state!==nf&&this.setInterval(500)}onSubtitleTrackLoaded(t,e){var i;const{currentTrackId:s,levels:r}=this,{details:n,id:a}=e;if(!r)return void this.warn(`Subtitle tracks were reset while loading level ${a}`);const o=r[a];if(a>=r.length||!o)return;this.log(`Subtitle track ${a} loaded [${n.startSN},${n.endSN}]${n.lastPartSn?`[part-${n.lastPartSn}-${n.lastPartIndex}]`:""},duration:${n.totalduration}`),this.mediaBuffer=this.mediaBufferTimeRanges;let l=0;if(n.live||null!=(i=o.details)&&i.live){if(n.deltaUpdateFailed)return;const t=this.mainDetails;if(!t)return void(this.startFragRequested=!1);const e=t.fragments[0];var d;if(o.details)l=this.alignPlaylists(n,o.details,null==(d=this.levelLastLoaded)?void 0:d.details),0===l&&e&&(l=e.start,Vu(n,l));else n.hasProgramDateTime&&t.hasProgramDateTime?(tf(n,t),l=n.fragmentStart):e&&(l=e.start,Vu(n,l));t&&!this.startFragRequested&&this.setStartPosition(t,l)}if(o.details=n,this.levelLastLoaded=o,a===s&&(this.hls.trigger(Ql.SUBTITLE_TRACK_UPDATED,{details:n,id:a,groupId:e.groupId}),this.tick(),n.live&&!this.fragCurrent&&this.media&&this.state===af)){$h(null,n.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),o.details=void 0)}}_handleFragmentLoadComplete(t){const{frag:e,payload:i}=t,s=e.decryptdata,r=this.hls;if(!this.fragContextChanged(e)&&i&&i.byteLength>0&&null!=s&&s.key&&s.iv&&Jc(s.method)){const t=performance.now();this.decrypter.decrypt(new Uint8Array(i),s.key.buffer,s.iv.buffer,tu(s.method)).catch(t=>{throw r.trigger(Ql.ERROR,{type:Vl.MEDIA_ERROR,details:Gl.FRAG_DECRYPT_ERROR,fatal:!1,error:t,reason:t.message,frag:e}),t}).then(i=>{const s=performance.now();r.trigger(Ql.FRAG_DECRYPTED,{frag:e,payload:i,stats:{tstart:t,tdecrypt:s}})}).catch(t=>{this.warn(`${t.name}: ${t.message}`),this.state=af})}}doTick(){if(this.media){if(this.state===af){const{currentTrackId:t,levels:e}=this,i=null==e?void 0:e[t];if(!i||!e.length||!i.details)return;if(this.waitForLive(i))return;const{config:s}=this,r=this.getLoadPosition(),n=_c.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],r,s.maxBufferHole),{end:a,len:o}=n,l=i.details;if(o>this.hls.maxBufferLength+l.levelTargetDuration)return;const d=l.fragments,h=d.length,c=l.edge;let u=null;const f=this.fragPrevious;if(a<c){const t=s.maxFragLookUpTolerance,e=a>c-t?0:t;u=$h(f,d,Math.max(d[0].start,a),e),!u&&f&&f.start<d[0].start&&(u=d[0])}else u=d[h-1];if(u=this.filterReplacedPrimary(u,i.details),!u)return;const g=d[u.sn-l.startSN-1];if(g&&g.cc===u.cc&&this.fragmentTracker.getState(g)===pc&&(u=g),this.fragmentTracker.getState(u)===pc){const t=this.mapToInitFragWhenRequired(u);t&&this.loadFragment(t,i,a)}}}else this.state=af}loadFragment(t,e,i){Cd(t)?super.loadFragment(t,e,i):this._loadInitSegment(t,e)}get mediaBufferTimeRanges(){return new Rp(this.tracksBuffered[this.currentTrackId]||[])}},subtitleTrackController:class extends $g{constructor(t){super(t,"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.useTextTrackPolling=!1,this.subtitlePollingInterval=-1,this._subtitleDisplay=!0,this.asyncPollTrackChange=()=>this.pollTrackChange(0),this.onTextTracksChanged=()=>{if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;let t=null;const e=hp(this.media.textTracks);for(let s=0;s<e.length;s++)if("hidden"===e[s].mode)t=e[s];else if("showing"===e[s].mode){t=e[s];break}const i=this.findTrackForTextTrack(t);this.subtitleTrack!==i&&this.setSubtitleTrack(i)},this.registerListeners()}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,this.onTextTracksChanged=this.asyncPollTrackChange=null,super.destroy()}get subtitleDisplay(){return this._subtitleDisplay}set subtitleDisplay(t){this._subtitleDisplay=t,this.trackId>-1&&this.toggleTrackModes()}registerListeners(){const{hls:t}=this;t.on(Ql.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(Ql.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(Ql.MANIFEST_LOADING,this.onManifestLoading,this),t.on(Ql.MANIFEST_PARSED,this.onManifestParsed,this),t.on(Ql.LEVEL_LOADING,this.onLevelLoading,this),t.on(Ql.LEVEL_SWITCHING,this.onLevelSwitching,this),t.on(Ql.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.on(Ql.ERROR,this.onError,this)}unregisterListeners(){const{hls:t}=this;t.off(Ql.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(Ql.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(Ql.MANIFEST_LOADING,this.onManifestLoading,this),t.off(Ql.MANIFEST_PARSED,this.onManifestParsed,this),t.off(Ql.LEVEL_LOADING,this.onLevelLoading,this),t.off(Ql.LEVEL_SWITCHING,this.onLevelSwitching,this),t.off(Ql.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.off(Ql.ERROR,this.onError,this)}onMediaAttached(t,e){this.media=e.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(t){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.onTextTracksChanged,t)}onMediaDetaching(t,e){const i=this.media;if(!i)return;const s=!!e.transferMedia;if(self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||i.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),this.subtitleTrack=-1,this.media=null,s)return;hp(i.textTracks).forEach(t=>{lp(t)})}onManifestLoading(){this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0}onManifestParsed(t,e){this.tracks=e.subtitleTracks}onSubtitleTrackLoaded(t,e){const{id:i,groupId:s,details:r}=e,n=this.tracksInGroup[i];if(!n||n.groupId!==s)return void this.warn(`Subtitle track with id:${i} and group:${s} not found in active group ${null==n?void 0:n.groupId}`);const a=n.details;n.details=e.details,this.log(`Subtitle track ${i} "${n.name}" lang:${n.lang} group:${s} loaded [${r.startSN}-${r.endSN}]`),i===this.trackId&&this.playlistLoaded(i,e,a)}onLevelLoading(t,e){this.switchLevel(e.level)}onLevelSwitching(t,e){this.switchLevel(e.level)}switchLevel(t){const e=this.hls.levels[t];if(!e)return;const i=e.subtitleGroups||null,s=this.groupIds;let r=this.currentTrack;if(!i||(null==s?void 0:s.length)!==(null==i?void 0:i.length)||null!=i&&i.some(t=>-1===(null==s?void 0:s.indexOf(t)))){this.groupIds=i,this.trackId=-1,this.currentTrack=null;const t=this.tracks.filter(t=>!i||-1!==i.indexOf(t.groupId));if(t.length)this.selectDefaultTrack&&!t.some(t=>t.default)&&(this.selectDefaultTrack=!1),t.forEach((t,e)=>{t.id=e});else if(!r&&!this.tracksInGroup.length)return;this.tracksInGroup=t;const e=this.hls.config.subtitlePreference;if(!r&&e){this.selectDefaultTrack=!1;const i=Gh(e,t);if(i>-1)r=t[i];else{const t=Gh(e,this.tracks);r=this.tracks[t]}}let s=this.findTrackId(r);-1===s&&r&&(s=this.findTrackId(null));const n={subtitleTracks:t};this.log(`Updating subtitle tracks, ${t.length} track(s) found in "${null==i?void 0:i.join(",")}" group-id`),this.hls.trigger(Ql.SUBTITLE_TRACKS_UPDATED,n),-1!==s&&-1===this.trackId&&this.setSubtitleTrack(s)}}findTrackId(t){const e=this.tracksInGroup,i=this.selectDefaultTrack;for(let s=0;s<e.length;s++){const r=e[s];if((!i||r.default)&&(i||t)&&(!t||Qh(r,t)))return s}if(t){for(let i=0;i<e.length;i++){const s=e[i];if(Xg(t.attrs,s.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return i}for(let i=0;i<e.length;i++){const s=e[i];if(Xg(t.attrs,s.attrs,["LANGUAGE"]))return i}}return-1}findTrackForTextTrack(t){if(t){const e=this.tracksInGroup;for(let i=0;i<e.length;i++){if(Zg(e[i],t))return i}}return-1}onError(t,e){!e.fatal&&e.context&&(e.context.type!==Yl||e.context.id!==this.trackId||this.groupIds&&-1===this.groupIds.indexOf(e.context.groupId)||this.checkRetry(e))}get allSubtitleTracks(){return this.tracks}get subtitleTracks(){return this.tracksInGroup}get subtitleTrack(){return this.trackId}set subtitleTrack(t){this.selectDefaultTrack=!1,this.setSubtitleTrack(t)}setSubtitleOption(t){if(this.hls.config.subtitlePreference=t,t){if(-1===t.id)return this.setSubtitleTrack(-1),null;const e=this.allSubtitleTracks;if(this.selectDefaultTrack=!1,e.length){const i=this.currentTrack;if(i&&Qh(t,i))return i;const s=Gh(t,this.tracksInGroup);if(s>-1){const t=this.tracksInGroup[s];return this.setSubtitleTrack(s),t}if(i)return null;{const i=Gh(t,e);if(i>-1)return e[i]}}}return null}loadPlaylist(t){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentTrack)&&this.scheduleLoading(this.currentTrack,t)}loadingPlaylist(t,e){super.loadingPlaylist(t,e);const i=t.id,s=t.groupId,r=this.getUrlWithDirectives(t.url,e),n=t.details,a=null==n?void 0:n.age;this.log(`Loading subtitle ${i} "${t.name}" lang:${t.lang} group:${s}${void 0!==(null==e?void 0:e.msn)?" at sn "+e.msn+" part "+e.part:""}${a&&n.live?" age "+a.toFixed(1)+(n.type&&" "+n.type||""):""} ${r}`),this.hls.trigger(Ql.SUBTITLE_TRACK_LOADING,{url:r,id:i,groupId:s,deliveryDirectives:e||null,track:t})}toggleTrackModes(){const{media:t}=this;if(!t)return;const e=hp(t.textTracks),i=this.currentTrack;let s;if(i&&(s=e.filter(t=>Zg(i,t))[0],s||this.warn(`Unable to find subtitle TextTrack with name "${i.name}" and language "${i.lang}"`)),[].slice.call(e).forEach(t=>{"disabled"!==t.mode&&t!==s&&(t.mode="disabled")}),s){const t=this.subtitleDisplay?"showing":"hidden";s.mode!==t&&(s.mode=t)}}setSubtitleTrack(t){const e=this.tracksInGroup;if(!this.media)return void(this.queuedDefaultTrack=t);if(t<-1||t>=e.length||!Ul(t))return void this.warn(`Invalid subtitle track id: ${t}`);this.selectDefaultTrack=!1;const i=this.currentTrack,s=e[t]||null;if(this.trackId=t,this.currentTrack=s,this.toggleTrackModes(),!s)return void this.hls.trigger(Ql.SUBTITLE_TRACK_SWITCH,{id:t});const r=!!s.details&&!s.details.live;if(t===this.trackId&&s===i&&r)return;this.log(`Switching to subtitle-track ${t}`+(s?` "${s.name}" lang:${s.lang} group:${s.groupId}`:""));const{id:n,groupId:a="",name:o,type:l,url:d}=s;this.hls.trigger(Ql.SUBTITLE_TRACK_SWITCH,{id:n,groupId:a,name:o,type:l,url:d});const h=this.switchParams(s.url,null==i?void 0:i.details,s.details);this.loadPlaylist(h)}},timelineController:class{constructor(t){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={ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}},this.captionsProperties=void 0,this.hls=t,this.config=t.config,this.Cues=t.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}},t.on(Ql.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(Ql.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(Ql.MANIFEST_LOADING,this.onManifestLoading,this),t.on(Ql.MANIFEST_LOADED,this.onManifestLoaded,this),t.on(Ql.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.on(Ql.FRAG_LOADING,this.onFragLoading,this),t.on(Ql.FRAG_LOADED,this.onFragLoaded,this),t.on(Ql.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),t.on(Ql.FRAG_DECRYPTED,this.onFragDecrypted,this),t.on(Ql.INIT_PTS_FOUND,this.onInitPtsFound,this),t.on(Ql.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),t.on(Ql.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:t}=this;t.off(Ql.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(Ql.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(Ql.MANIFEST_LOADING,this.onManifestLoading,this),t.off(Ql.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(Ql.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.off(Ql.FRAG_LOADING,this.onFragLoading,this),t.off(Ql.FRAG_LOADED,this.onFragLoaded,this),t.off(Ql.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),t.off(Ql.FRAG_DECRYPTED,this.onFragDecrypted,this),t.off(Ql.INIT_PTS_FOUND,this.onInitPtsFound,this),t.off(Ql.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),t.off(Ql.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.media=null,this.cea608Parser1=this.cea608Parser2=void 0}initCea608Parsers(){const t=new AA(this,"textTrack1"),e=new AA(this,"textTrack2"),i=new AA(this,"textTrack3"),s=new AA(this,"textTrack4");this.cea608Parser1=new Gp(1,t,e),this.cea608Parser2=new Gp(3,i,s)}addCues(t,e,i,s,r){let n=!1;for(let a=r.length;a--;){const t=r[a],s=EA(t[0],t[1],e,i);if(s>=0&&(t[0]=Math.min(t[0],e),t[1]=Math.max(t[1],i),n=!0,s/(i-e)>.5))return}if(n||r.push([e,i]),this.config.renderTextTracksNatively){const r=this.captionsTracks[t];this.Cues.newCue(r,e,i,s)}else{const r=this.Cues.newCue(null,e,i,s);this.hls.trigger(Ql.CUES_PARSED,{type:"captions",cues:r,track:t})}}onInitPtsFound(t,{frag:e,id:i,initPTS:s,timescale:r,trackId:n}){const{unparsedVttFrags:a}=this;i===$l&&(this.initPTS[e.cc]={baseTime:s,timescale:r,trackId:n}),a.length&&(this.unparsedVttFrags=[],a.forEach(t=>{this.initPTS[t.frag.cc]?this.onFragLoaded(Ql.FRAG_LOADED,t):this.hls.trigger(Ql.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t.frag,error:new Error("Subtitle discontinuity domain does not match main")})}))}getExistingTrack(t,e){const{media:i}=this;if(i)for(let s=0;s<i.textTracks.length;s++){const r=i.textTracks[s];if(yA(r,{name:t,lang:e,characteristics:"transcribes-spoken-dialog,describes-music-and-sound"}))return r}return null}createCaptionsTrack(t){this.config.renderTextTracksNatively?this.createNativeTrack(t):this.createNonNativeTrack(t)}createNativeTrack(t){if(this.captionsTracks[t])return;const{captionsProperties:e,captionsTracks:i,media:s}=this,{label:r,languageCode:n}=e[t],a=this.getExistingTrack(r,n);if(a)i[t]=a,lp(i[t]),ap(i[t],s);else{const e=this.createTextTrack("captions",r,n);e&&(e[t]=!0,i[t]=e)}}createNonNativeTrack(t){if(this.nonNativeCaptionsTracks[t])return;const e=this.captionsProperties[t];if(!e)return;const i={_id:t,label:e.label,kind:"captions",default:!!e.media&&!!e.media.default,closedCaptions:e.media};this.nonNativeCaptionsTracks[t]=i,this.hls.trigger(Ql.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[i]})}createTextTrack(t,e,i){const s=this.media;if(s)return s.addTextTrack(t,e,i)}onMediaAttaching(t,e){this.media=e.media,e.mediaSource||this._cleanTracks()}onMediaDetaching(t,e){const i=!!e.transferMedia;if(this.media=null,i)return;const{captionsTracks:s}=this;Object.keys(s).forEach(t=>{lp(s[t]),delete s[t]}),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs={ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}},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:t}=this;if(!t)return;const e=t.textTracks;if(e)for(let i=0;i<e.length;i++)lp(e[i])}onSubtitleTracksUpdated(t,e){const i=e.subtitleTracks||[],s=i.some(t=>t.textCodec===aA);if(this.config.enableWebVTT||s&&this.config.enableIMSC1){if(zg(this.tracks,i))return void(this.tracks=i);if(this.textTracks=[],this.tracks=i,this.config.renderTextTracksNatively){const t=this.media,e=t?hp(t.textTracks):null;if(this.tracks.forEach((t,i)=>{let s;if(e){let i=null;for(let s=0;s<e.length;s++)if(e[s]&&yA(e[s],t)){i=e[s],e[s]=null;break}i&&(s=i)}if(s)lp(s);else{const e=vA(t);s=this.createTextTrack(e,t.name,t.lang),s&&(s.mode="disabled")}s&&this.textTracks.push(s)}),null!=e&&e.length){const t=e.filter(t=>null!==t).map(t=>t.label);t.length&&this.hls.logger.warn(`Media element contains unused subtitle tracks: ${t.join(", ")}. Replace media element for each source to clear TextTracks and captions menu.`)}}else if(this.tracks.length){const t=this.tracks.map(t=>({label:t.name,kind:t.type.toLowerCase(),default:t.default,subtitleTrack:t}));this.hls.trigger(Ql.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:t})}}}onManifestLoaded(t,e){this.config.enableCEA708Captions&&e.captions&&e.captions.forEach(t=>{const e=/(?:CC|SERVICE)([1-4])/.exec(t.instreamId);if(!e)return;const i=`textTrack${e[1]}`,s=this.captionsProperties[i];s&&(s.label=t.name,t.lang&&(s.languageCode=t.lang),s.media=t)})}closedCaptionsForLevel(t){const e=this.hls.levels[t.level];return null==e?void 0:e.attrs["CLOSED-CAPTIONS"]}onFragLoading(t,e){if(this.enabled&&e.frag.type===$l){var i,s;const{cea608Parser1:t,cea608Parser2:r,lastSn:n}=this,{cc:a,sn:o}=e.frag,l=null!=(i=null==(s=e.part)?void 0:s.index)?i:-1;t&&r&&(o!==n+1||o===n&&l!==this.lastPartIndex+1||a!==this.lastCc)&&(t.reset(),r.reset()),this.lastCc=a,this.lastSn=o,this.lastPartIndex=l}}onFragLoaded(t,e){const{frag:i,payload:s}=e;if(i.type===Xl)if(s.byteLength){const t=i.decryptdata,r="stats"in e;if(null==t||!t.encrypted||r){const t=this.tracks[i.level],r=this.vttCCs;r[i.cc]||(r[i.cc]={start:i.start,prevCC:this.prevCC,new:!0},this.prevCC=i.cc),t&&t.textCodec===aA?this._parseIMSC1(i,s):this._parseVTTs(e)}}else this.hls.trigger(Ql.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:i,error:new Error("Empty subtitle payload")})}_parseIMSC1(t,e){const i=this.hls;hA(e,this.initPTS[t.cc],e=>{this._appendCues(e,t.level),i.trigger(Ql.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:t})},e=>{i.logger.log(`Failed to parse IMSC1: ${e}`),i.trigger(Ql.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t,error:e})})}_parseVTTs(t){var e;const{frag:i,payload:s}=t,{initPTS:r,unparsedVttFrags:n}=this,a=r.length-1;if(!r[i.cc]&&-1===a)return void n.push(t);const o=this.hls;nA(null!=(e=i.initSegment)&&e.data?Zd(i.initSegment.data,new Uint8Array(s)).buffer:s,this.initPTS[i.cc],this.vttCCs,i.cc,i.start,t=>{this._appendCues(t,i.level),o.trigger(Ql.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:i})},e=>{const r="Missing initPTS for VTT MPEGTS"===e.message;r?n.push(t):this._fallbackToIMSC1(i,s),o.logger.log(`Failed to parse VTT cue: ${e}`),r&&a>i.cc||o.trigger(Ql.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:i,error:e})})}_fallbackToIMSC1(t,e){const i=this.tracks[t.level];i.textCodec||hA(e,this.initPTS[t.cc],()=>{i.textCodec=aA,this._parseIMSC1(t,e)},()=>{i.textCodec="wvtt"})}_appendCues(t,e){const i=this.hls;if(this.config.renderTextTracksNatively){const i=this.textTracks[e];if(!i||"disabled"===i.mode)return;t.forEach(t=>op(i,t))}else{const s=this.tracks[e];if(!s)return;const r=s.default?"default":"subtitles"+e;i.trigger(Ql.CUES_PARSED,{type:"subtitles",cues:t,track:r})}}onFragDecrypted(t,e){const{frag:i}=e;i.type===Xl&&this.onFragLoaded(Ql.FRAG_LOADED,e)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(t,e){if(!this.enabled||!this.config.enableCEA708Captions)return;const{frag:i,samples:s}=e;if(i.type!==$l||"NONE"!==this.closedCaptionsForLevel(i))for(let r=0;r<s.length;r++){const t=s[r].bytes;if(t){this.cea608Parser1||this.initCea608Parsers();const e=this.extractCea608Data(t);this.cea608Parser1.addData(s[r].pts,e[0]),this.cea608Parser2.addData(s[r].pts,e[1])}}}onBufferFlushing(t,{startOffset:e,endOffset:i,endOffsetSubtitles:s,type:r}){const{media:n}=this;if(n&&!(n.currentTime<i)){if(!r||"video"===r){const{captionsTracks:t}=this;Object.keys(t).forEach(s=>dp(t[s],e,i))}if(this.config.renderTextTracksNatively&&0===e&&void 0!==s){const{textTracks:t}=this;Object.keys(t).forEach(i=>dp(t[i],e,s))}}}extractCea608Data(t){const e=[[],[]],i=31&t[0];let s=2;for(let r=0;r<i;r++){const i=t[s++],r=127&t[s++],n=127&t[s++];if(0===r&&0===n)continue;if(!!(4&i)){const t=3&i;0!==t&&1!==t||(e[t].push(r),e[t].push(n))}}return e}},audioStreamController:class extends Af{constructor(t,e,i){super(t,e,i,"audio-stream-controller",zl),this.mainAnchor=null,this.mainFragLoading=null,this.audioOnly=!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.resetItem()}resetItem(){this.mainDetails=this.mainAnchor=this.mainFragLoading=this.bufferedTrack=this.switchingTrack=this.waitingData=this.cachedTrackLoadedData=null}registerListeners(){super.registerListeners();const{hls:t}=this;t.on(Ql.LEVEL_LOADED,this.onLevelLoaded,this),t.on(Ql.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),t.on(Ql.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.on(Ql.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.on(Ql.BUFFER_RESET,this.onBufferReset,this),t.on(Ql.BUFFER_CREATED,this.onBufferCreated,this),t.on(Ql.BUFFER_FLUSHING,this.onBufferFlushing,this),t.on(Ql.BUFFER_FLUSHED,this.onBufferFlushed,this),t.on(Ql.INIT_PTS_FOUND,this.onInitPtsFound,this),t.on(Ql.FRAG_LOADING,this.onFragLoading,this),t.on(Ql.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){const{hls:t}=this;t&&(super.unregisterListeners(),t.off(Ql.LEVEL_LOADED,this.onLevelLoaded,this),t.off(Ql.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),t.off(Ql.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.off(Ql.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.off(Ql.BUFFER_RESET,this.onBufferReset,this),t.off(Ql.BUFFER_CREATED,this.onBufferCreated,this),t.off(Ql.BUFFER_FLUSHING,this.onBufferFlushing,this),t.off(Ql.BUFFER_FLUSHED,this.onBufferFlushed,this),t.off(Ql.INIT_PTS_FOUND,this.onInitPtsFound,this),t.off(Ql.FRAG_LOADING,this.onFragLoading,this),t.off(Ql.FRAG_BUFFERED,this.onFragBuffered,this))}onInitPtsFound(t,{frag:e,id:i,initPTS:s,timescale:r,trackId:n}){if(i===$l){const t=e.cc,i=this.fragCurrent;if(this.initPTS[t]={baseTime:s,timescale:r,trackId:n},this.log(`InitPTS for cc: ${t} found from main: ${s/r} (${s}/${r}) trackId: ${n}`),this.mainAnchor=e,this.state===mf){const i=this.waitingData;(!i&&!this.loadingParts||i&&i.frag.cc!==t)&&this.syncWithAnchor(e,null==i?void 0:i.frag)}else!this.hls.hasEnoughToStart&&i&&i.cc!==t?(i.abortRequests(),this.syncWithAnchor(e,i)):this.state===af&&this.tick()}}getLoadPosition(){return!this.startFragRequested&&this.nextLoadPosition>=0?this.nextLoadPosition:super.getLoadPosition()}syncWithAnchor(t,e){var i;const s=(null==(i=this.mainFragLoading)?void 0:i.frag)||null;if(e&&(null==s?void 0:s.cc)===e.cc)return;const r=(s||t).cc,n=Zh(this.getLevelDetails(),r,this.getLoadPosition());n&&(this.log(`Syncing with main frag at ${n.start} cc ${n.cc}`),this.startFragRequested=!1,this.nextLoadPosition=n.start,this.resetLoadingState(),this.state===af&&this.doTickIdle())}startLoad(t,e){if(!this.levels)return this.startPosition=t,void(this.state=nf);const i=this.lastCurrentTime;this.stopLoad(),this.setInterval(100),i>0&&-1===t?(this.log(`Override startPosition with lastCurrentTime @${i.toFixed(3)}`),t=i,this.state=af):this.state=hf,this.nextLoadPosition=this.lastCurrentTime=t+this.timelineOffset,this.startPosition=e?-1:t,this.tick()}doTick(){switch(this.state){case af:this.doTickIdle();break;case hf:{const{levels:t,trackId:e}=this,i=null==t?void 0:t[e],s=null==i?void 0:i.details;if(s&&!this.waitForLive(i)){if(this.waitForCdnTuneIn(s))break;this.state=mf}break}case df:this.checkRetryDate();break;case mf:{const t=this.waitingData;if(t){const{frag:e,part:i,cache:s,complete:r}=t,n=this.mainAnchor;if(void 0!==this.initPTS[e.cc]){this.waitingData=null,this.state=lf;const t={frag:e,part:i,payload:s.flush().buffer,networkDetails:null};this._handleFragmentLoadProgress(t),r&&super._handleFragmentLoadComplete(t)}else n&&n.cc!==t.frag.cc&&this.syncWithAnchor(n,t.frag)}else this.state=af}}this.onTickEnd()}resetLoadingState(){const t=this.waitingData;t&&(this.fragmentTracker.removeFragment(t.frag),this.waitingData=null),super.resetLoadingState()}onTickEnd(){const{media:t}=this;null!=t&&t.readyState&&(this.lastCurrentTime=t.currentTime)}doTickIdle(){var t;const{hls:e,levels:i,media:s,trackId:r}=this,n=e.config;if(!this.buffering||!s&&!this.primaryPrefetch&&(this.startFragRequested||!n.startFragPrefetch)||null==i||!i[r])return;const a=i[r],o=a.details;if(!o||this.waitForLive(a)||this.waitForCdnTuneIn(o))return this.state=hf,void(this.startFragRequested=!1);const l=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&l&&(this.bufferFlushed=!1,this.afterBufferFlushed(l,Rd,zl));const d=this.getFwdBufferInfo(l,zl);if(null===d)return;if(!this.switchingTrack&&this._streamEnded(d,o))return e.trigger(Ql.BUFFER_EOS,{type:"audio"}),void(this.state=ff);const h=d.len,c=e.maxBufferLength,u=o.fragments,f=u[0].start,g=this.getLoadPosition(),m=this.flushing?g:d.end;if(this.switchingTrack&&s){const t=g;o.PTSKnown&&t<f&&(d.end>f||d.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),s.currentTime=f+.05)}if(h>=c&&!this.switchingTrack&&m<u[u.length-1].start)return;let p=this.getNextFragment(m,o);if(p&&this.isLoopLoading(p,m)&&(p=this.getNextFragmentLoopLoading(p,o,d,$l,c)),!p)return void(this.bufferFlushed=!0);let A=(null==(t=this.mainFragLoading)?void 0:t.frag)||null;if(!this.audioOnly&&this.startFragRequested&&A&&Cd(p)&&!p.endList&&(!o.live||!this.loadingParts&&m<this.hls.liveSyncPosition)&&(this.fragmentTracker.getState(A)===yc&&(this.mainFragLoading=A=null),A&&Cd(A))){if(p.start>A.end){const t=this.fragmentTracker.getFragAtPos(m,$l);t&&t.end>A.end&&(A=t,this.mainFragLoading={frag:t,targetBufferTime:null})}if(p.start>A.end)return}this.loadFragment(p,a,m)}onMediaDetaching(t,e){this.bufferFlushed=this.flushing=!1,super.onMediaDetaching(t,e)}onAudioTracksUpdated(t,{audioTracks:e}){this.resetTransmuxer(),this.levels=e.map(t=>new Fh(t))}onAudioTrackSwitching(t,e){const i=!!e.url;this.trackId=e.id;const{fragCurrent:s}=this;s&&(s.abortRequests(),this.removeUnbufferedFrags(s.start)),this.resetLoadingState(),i?(this.switchingTrack=e,this.flushAudioIfNeeded(e),this.state!==nf&&(this.setInterval(100),this.state=af,this.tick())):(this.resetTransmuxer(),this.switchingTrack=null,this.bufferedTrack=e,this.clearInterval())}onManifestLoading(){super.onManifestLoading(),this.bufferFlushed=this.flushing=this.audioOnly=!1,this.resetItem(),this.trackId=-1}onLevelLoaded(t,e){this.mainDetails=e.details;const i=this.cachedTrackLoadedData;i&&(this.cachedTrackLoadedData=null,this.onAudioTrackLoaded(Ql.AUDIO_TRACK_LOADED,i))}onAudioTrackLoaded(t,e){var i;const{levels:s}=this,{details:r,id:n,groupId:a,track:o}=e;if(!s)return void this.warn(`Audio tracks reset while loading track ${n} "${o.name}" of "${a}"`);const l=this.mainDetails;if(!l||r.endCC>l.endCC||l.expired)return this.cachedTrackLoadedData=e,void(this.state!==nf&&(this.state=hf));this.cachedTrackLoadedData=null,this.log(`Audio track ${n} "${o.name}" of "${a}" loaded [${r.startSN},${r.endSN}]${r.lastPartSn?`[part-${r.lastPartSn}-${r.lastPartIndex}]`:""},duration:${r.totalduration}`);const d=s[n];let h=0;if(r.live||null!=(i=d.details)&&i.live){if(this.checkLiveUpdate(r),r.deltaUpdateFailed)return;var c;if(d.details)h=this.alignPlaylists(r,d.details,null==(c=this.levelLastLoaded)?void 0:c.details);r.alignedSliding||(Ju(r,l),r.alignedSliding||tf(r,l),h=r.fragmentStart)}d.details=r,this.levelLastLoaded=d,this.startFragRequested||this.setStartPosition(l,h),this.hls.trigger(Ql.AUDIO_TRACK_UPDATED,{details:r,id:n,groupId:e.groupId}),this.state!==hf||this.waitForCdnTuneIn(r)||(this.state=af),this.tick()}_handleFragmentLoadProgress(t){var e;const i=t.frag,{part:s,payload:r}=t,{config:n,trackId:a,levels:o}=this;if(!o)return void this.warn(`Audio tracks were reset while fragment load was in progress. Fragment ${i.sn} of level ${i.level} will not be buffered`);const l=o[a];if(!l)return void this.warn("Audio track is undefined on fragment load progress");const d=l.details;if(!d)return this.warn("Audio track details undefined on fragment load progress"),void this.removeUnbufferedFrags(i.start);const h=n.defaultAudioCodec||l.audioCodec||"mp4a.40.2";let c=this.transmuxer;c||(c=this.transmuxer=new Yg(this.hls,zl,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const u=this.initPTS[i.cc],f=null==(e=i.initSegment)?void 0:e.data;if(void 0!==u){const t=!1,e=s?s.index:-1,n=-1!==e,a=new Fc(i.level,i.sn,i.stats.chunkCount,r.byteLength,e,n);c.push(r,f,h,"",i,s,d.totalduration,t,a,u)}else{this.log(`Unknown video PTS for cc ${i.cc}, waiting for video PTS before demuxing audio frag ${i.sn} of [${d.startSN} ,${d.endSN}],track ${a}`);const{cache:t}=this.waitingData=this.waitingData||{frag:i,part:s,cache:new yf,complete:!1};t.push(new Uint8Array(r)),this.state!==nf&&(this.state=mf)}}_handleFragmentLoadComplete(t){this.waitingData?this.waitingData.complete=!0:super._handleFragmentLoadComplete(t)}onBufferReset(){this.mediaBuffer=null}onBufferCreated(t,e){this.bufferFlushed=this.flushing=!1;const i=e.tracks.audio;i&&(this.mediaBuffer=i.buffer||null)}onFragLoading(t,e){!this.audioOnly&&e.frag.type===$l&&Cd(e.frag)&&(this.mainFragLoading=e,this.state===af&&this.tick())}onFragBuffered(t,e){const{frag:i,part:s}=e;if(i.type===zl)if(this.fragContextChanged(i))this.warn(`Fragment ${i.sn}${s?" p: "+s.index:""} of level ${i.level} finished buffering, but was aborted. state: ${this.state}, audioSwitch: ${this.switchingTrack?this.switchingTrack.name:"false"}`);else{if(Cd(i)){this.fragPrevious=i;const t=this.switchingTrack;t&&(this.bufferedTrack=t,this.switchingTrack=null,this.hls.trigger(Ql.AUDIO_TRACK_SWITCHED,sd({},t)))}this.fragBufferedComplete(i,s),this.media&&this.tick()}else this.audioOnly||i.type!==$l||i.elementaryStreams.video||i.elementaryStreams.audiovideo||(this.audioOnly=!0,this.mainFragLoading=null)}onError(t,e){var i;if(e.fatal)this.state=gf;else switch(e.details){case Gl.FRAG_GAP:case Gl.FRAG_PARSING_ERROR:case Gl.FRAG_DECRYPT_ERROR:case Gl.FRAG_LOAD_ERROR:case Gl.FRAG_LOAD_TIMEOUT:case Gl.KEY_LOAD_ERROR:case Gl.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(zl,e);break;case Gl.AUDIO_TRACK_LOAD_ERROR:case Gl.AUDIO_TRACK_LOAD_TIMEOUT:case Gl.LEVEL_PARSING_ERROR:e.levelRetry||this.state!==hf||(null==(i=e.context)?void 0:i.type)!==Wl||(this.state=af);break;case Gl.BUFFER_ADD_CODEC_ERROR:case Gl.BUFFER_APPEND_ERROR:if("audio"!==e.parent)return;this.reduceLengthAndFlushBuffer(e)||this.resetLoadingState();break;case Gl.BUFFER_FULL_ERROR:if("audio"!==e.parent)return;this.reduceLengthAndFlushBuffer(e)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case Gl.INTERNAL_EXCEPTION:this.recoverWorkerError(e)}}onBufferFlushing(t,{type:e}){e!==kd&&(this.flushing=!0)}onBufferFlushed(t,{type:e}){if(e!==kd){this.flushing=!1,this.bufferFlushed=!0,this.state===ff&&(this.state=af);const t=this.mediaBuffer||this.media;t&&(this.afterBufferFlushed(t,e,zl),this.tick())}}_handleTransmuxComplete(t){var e;const i="audio",{hls:s}=this,{remuxResult:r,chunkMeta:n}=t,a=this.getCurrentContext(n);if(!a)return void this.resetWhenMissingContext(n);const{frag:o,part:l,level:d}=a,{details:h}=d,{audio:c,text:u,id3:f,initSegment:g}=r;if(!this.fragContextChanged(o)&&h){if(this.state=cf,this.switchingTrack&&c&&this.completeAudioSwitch(this.switchingTrack),null!=g&&g.tracks){const t=o.initSegment||o;if(this.unhandledEncryptionError(g,o))return;this._bufferInitSegment(d,g.tracks,t,n),s.trigger(Ql.FRAG_PARSING_INIT_SEGMENT,{frag:t,id:i,tracks:g.tracks})}if(c){const{startPTS:t,endPTS:e,startDTS:i,endDTS:s}=c;l&&(l.elementaryStreams[Rd]={startPTS:t,endPTS:e,startDTS:i,endDTS:s}),o.setElementaryStreamInfo(Rd,t,e,i,s),this.bufferFragmentData(c,o,l,n)}if(null!=f&&null!=(e=f.samples)&&e.length){const t=ed({id:i,frag:o,details:h},f);s.trigger(Ql.FRAG_PARSING_METADATA,t)}if(u){const t=ed({id:i,frag:o,details:h},u);s.trigger(Ql.FRAG_PARSING_USERDATA,t)}}else this.fragmentTracker.removeFragment(o)}_bufferInitSegment(t,e,i,s){if(this.state!==cf)return;if(e.video&&delete e.video,e.audiovideo&&delete e.audiovideo,!e.audio)return;const r=e.audio;r.id=zl;const n=t.audioCodec;this.log(`Init audio buffer, container:${r.container}, codecs[level/parsed]=[${n}/${r.codec}]`),n&&1===n.split(",").length&&(r.levelCodec=n),this.hls.trigger(Ql.BUFFER_CODECS,e);const a=r.initSegment;if(null!=a&&a.byteLength){const t={type:"audio",frag:i,part:null,chunkMeta:s,parent:i.type,data:a};this.hls.trigger(Ql.BUFFER_APPENDING,t)}this.tickImmediate()}loadFragment(t,e,i){const s=this.fragmentTracker.getState(t);var r;if(this.switchingTrack||s===pc||s===vc)if(Cd(t))if(null!=(r=e.details)&&r.live&&!this.initPTS[t.cc]){this.log(`Waiting for video PTS in continuity counter ${t.cc} of live stream before loading audio fragment ${t.sn} of level ${this.trackId}`),this.state=mf;const i=this.mainDetails;i&&i.fragmentStart!==e.details.fragmentStart&&tf(e.details,i)}else super.loadFragment(t,e,i);else this._loadInitSegment(t,e);else this.clearTrackerIfNeeded(t)}flushAudioIfNeeded(t){if(this.media&&this.bufferedTrack){const{name:e,lang:i,assocLang:s,characteristics:r,audioCodec:n,channels:a}=this.bufferedTrack;Qh({name:e,lang:i,assocLang:s,characteristics:r,audioCodec:n,channels:a},t,Kh)||(Wh(t.url,this.hls)?(this.log("Switching audio track : flushing all audio"),super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"),this.bufferedTrack=null):this.bufferedTrack=t)}}completeAudioSwitch(t){const{hls:e}=this;this.flushAudioIfNeeded(t),this.bufferedTrack=t,this.switchingTrack=null,e.trigger(Ql.AUDIO_TRACK_SWITCHED,sd({},t))}},audioTrackController:class extends $g{constructor(t){super(t,"audio-track-controller"),this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.registerListeners()}registerListeners(){const{hls:t}=this;t.on(Ql.MANIFEST_LOADING,this.onManifestLoading,this),t.on(Ql.MANIFEST_PARSED,this.onManifestParsed,this),t.on(Ql.LEVEL_LOADING,this.onLevelLoading,this),t.on(Ql.LEVEL_SWITCHING,this.onLevelSwitching,this),t.on(Ql.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.on(Ql.ERROR,this.onError,this)}unregisterListeners(){const{hls:t}=this;t.off(Ql.MANIFEST_LOADING,this.onManifestLoading,this),t.off(Ql.MANIFEST_PARSED,this.onManifestParsed,this),t.off(Ql.LEVEL_LOADING,this.onLevelLoading,this),t.off(Ql.LEVEL_SWITCHING,this.onLevelSwitching,this),t.off(Ql.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.off(Ql.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(t,e){this.tracks=e.audioTracks||[]}onAudioTrackLoaded(t,e){const{id:i,groupId:s,details:r}=e,n=this.tracksInGroup[i];if(!n||n.groupId!==s)return void this.warn(`Audio track with id:${i} and group:${s} not found in active group ${null==n?void 0:n.groupId}`);const a=n.details;n.details=e.details,this.log(`Audio track ${i} "${n.name}" lang:${n.lang} group:${s} loaded [${r.startSN}-${r.endSN}]`),i===this.trackId&&this.playlistLoaded(i,e,a)}onLevelLoading(t,e){this.switchLevel(e.level)}onLevelSwitching(t,e){this.switchLevel(e.level)}switchLevel(t){const e=this.hls.levels[t];if(!e)return;const i=e.audioGroups||null,s=this.groupIds;let r=this.currentTrack;if(!i||(null==s?void 0:s.length)!==(null==i?void 0:i.length)||null!=i&&i.some(t=>-1===(null==s?void 0:s.indexOf(t)))){this.groupIds=i,this.trackId=-1,this.currentTrack=null;const t=this.tracks.filter(t=>!i||-1!==i.indexOf(t.groupId));if(t.length)this.selectDefaultTrack&&!t.some(t=>t.default)&&(this.selectDefaultTrack=!1),t.forEach((t,e)=>{t.id=e});else if(!r&&!this.tracksInGroup.length)return;this.tracksInGroup=t;const e=this.hls.config.audioPreference;if(!r&&e){const i=Gh(e,t,Kh);if(i>-1)r=t[i];else{const t=Gh(e,this.tracks);r=this.tracks[t]}}let s=this.findTrackId(r);-1===s&&r&&(s=this.findTrackId(null));const a={audioTracks:t};this.log(`Updating audio tracks, ${t.length} track(s) found in group(s): ${null==i?void 0:i.join(",")}`),this.hls.trigger(Ql.AUDIO_TRACKS_UPDATED,a);const o=this.trackId;if(-1!==s&&-1===o)this.setAudioTrack(s);else if(t.length&&-1===o){var n;const e=new Error(`No audio track selected for current audio group-ID(s): ${null==(n=this.groupIds)?void 0:n.join(",")} track count: ${t.length}`);this.warn(e.message),this.hls.trigger(Ql.ERROR,{type:Vl.MEDIA_ERROR,details:Gl.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:e})}}}onError(t,e){!e.fatal&&e.context&&(e.context.type!==Wl||e.context.id!==this.trackId||this.groupIds&&-1===this.groupIds.indexOf(e.context.groupId)||this.checkRetry(e))}get allAudioTracks(){return this.tracks}get audioTracks(){return this.tracksInGroup}get audioTrack(){return this.trackId}set audioTrack(t){this.selectDefaultTrack=!1,this.setAudioTrack(t)}setAudioOption(t){const e=this.hls;if(e.config.audioPreference=t,t){const i=this.allAudioTracks;if(this.selectDefaultTrack=!1,i.length){const s=this.currentTrack;if(s&&Qh(t,s,Kh))return s;const r=Gh(t,this.tracksInGroup,Kh);if(r>-1){const t=this.tracksInGroup[r];return this.setAudioTrack(r),t}if(s){let s=e.loadLevel;-1===s&&(s=e.firstAutoLevel);const r=function(t,e,i,s,r){const n=e[s],a=e.reduce((t,e,i)=>{const s=e.uri;return(t[s]||(t[s]=[])).push(i),t},{})[n.uri];a.length>1&&(s=Math.max.apply(Math,a));const o=n.videoRange,l=n.frameRate,d=n.codecSet.substring(0,4),h=qh(e,s,e=>{if(e.videoRange!==o||e.frameRate!==l||e.codecSet.substring(0,4)!==d)return!1;const s=e.audioGroups,n=i.filter(t=>!s||-1!==s.indexOf(t.groupId));return Gh(t,n,r)>-1});return h>-1?h:qh(e,s,e=>{const s=e.audioGroups,n=i.filter(t=>!s||-1!==s.indexOf(t.groupId));return Gh(t,n,r)>-1})}(t,e.levels,i,s,Kh);if(-1===r)return null;e.nextLoadLevel=r}if(t.channels||t.audioCodec){const e=Gh(t,i);if(e>-1)return i[e]}}}return null}setAudioTrack(t){const e=this.tracksInGroup;if(t<0||t>=e.length)return void this.warn(`Invalid audio track id: ${t}`);this.selectDefaultTrack=!1;const i=this.currentTrack,s=e[t],r=s.details&&!s.details.live;if(t===this.trackId&&s===i&&r)return;if(this.log(`Switching to audio-track ${t} "${s.name}" lang:${s.lang} group:${s.groupId} channels:${s.channels}`),this.trackId=t,this.currentTrack=s,this.hls.trigger(Ql.AUDIO_TRACK_SWITCHING,sd({},s)),r)return;const n=this.switchParams(s.url,null==i?void 0:i.details,s.details);this.loadPlaylist(n)}findTrackId(t){const e=this.tracksInGroup;for(let i=0;i<e.length;i++){const s=e[i];if((!this.selectDefaultTrack||s.default)&&(!t||Qh(t,s,Kh)))return i}if(t){const{name:i,lang:s,assocLang:r,characteristics:n,audioCodec:a,channels:o}=t;for(let t=0;t<e.length;t++){if(Qh({name:i,lang:s,assocLang:r,characteristics:n,audioCodec:a,channels:o},e[t],Kh))return t}for(let l=0;l<e.length;l++){const i=e[l];if(Xg(t.attrs,i.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return l}for(let l=0;l<e.length;l++){const i=e[l];if(Xg(t.attrs,i.attrs,["LANGUAGE"]))return l}}return-1}loadPlaylist(t){super.loadPlaylist();const e=this.currentTrack;this.shouldLoadPlaylist(e)&&Wh(e.url,this.hls)&&this.scheduleLoading(e,t)}loadingPlaylist(t,e){super.loadingPlaylist(t,e);const i=t.id,s=t.groupId,r=this.getUrlWithDirectives(t.url,e),n=t.details,a=null==n?void 0:n.age;this.log(`Loading audio-track ${i} "${t.name}" lang:${t.lang} group:${s}${void 0!==(null==e?void 0:e.msn)?" at sn "+e.msn+" part "+e.part:""}${a&&n.live?" age "+a.toFixed(1)+(n.type&&" "+n.type||""):""} ${r}`),this.hls.trigger(Ql.AUDIO_TRACK_LOADING,{url:r,id:i,groupId:s,deliveryDirectives:e||null,track:t})}},emeController:ep,cmcdController:class{constructor(t){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=t=>{try{this.apply(t,{ot:am.MANIFEST,su:!this.initialized})}catch(e){this.hls.logger.warn("Could not generate manifest CMCD data.",e)}},this.applyFragmentData=t=>{try{const{frag:e,part:i}=t,s=this.hls.levels[e.level],r=this.getObjectType(e),n={d:1e3*(i||e).duration,ot:r};r!==am.VIDEO&&r!==am.AUDIO&&r!=am.MUXED||(n.br=s.bitrate/1e3,n.tb=this.getTopBandwidth(r)/1e3,n.bl=this.getBufferLength(r));const a=i?this.getNextPart(i):this.getNextFrag(e);null!=a&&a.url&&a.url!==e.url&&(n.nor=a.url),this.apply(t,n)}catch(e){this.hls.logger.warn("Could not generate segment CMCD data.",e)}},this.hls=t;const e=this.config=t.config,{cmcd:i}=e;null!=i&&(e.pLoader=this.createPlaylistLoader(),e.fLoader=this.createFragmentLoader(),this.sid=i.sessionId||t.sessionId,this.cid=i.contentId,this.useHeaders=!0===i.useHeaders,this.includeKeys=i.includeKeys,this.registerListeners())}registerListeners(){const t=this.hls;t.on(Ql.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(Ql.MEDIA_DETACHED,this.onMediaDetached,this),t.on(Ql.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const t=this.hls;t.off(Ql.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(Ql.MEDIA_DETACHED,this.onMediaDetached,this),t.off(Ql.BUFFER_CREATED,this.onBufferCreated,this)}destroy(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null,this.onWaiting=this.onPlaying=this.media=null}onMediaAttached(t,e){this.media=e.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(t,e){var i,s;this.audioBuffer=null==(i=e.tracks.audio)?void 0:i.buffer,this.videoBuffer=null==(s=e.tracks.video)?void 0:s.buffer}createData(){var t;return{v:1,sf:om.HLS,sid:this.sid,cid:this.cid,pr:null==(t=this.media)?void 0:t.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(t,e={}){ed(e,this.createData());const i=e.ot===am.INIT||e.ot===am.VIDEO||e.ot===am.MUXED;this.starved&&i&&(e.bs=!0,e.su=!0,this.starved=!1),null==e.su&&(e.su=this.buffering);const{includeKeys:s}=this;s&&(e=Object.keys(e).reduce((t,i)=>(s.includes(i)&&(t[i]=e[i]),t),{}));const r={baseUrl:t.url};this.useHeaders?(t.headers||(t.headers={}),$m(t.headers,e,r)):t.url=Zm(t.url,e,r)}getNextFrag(t){var e;const i=null==(e=this.hls.levels[t.level])?void 0:e.details;if(i){const e=t.sn-i.startSN;return i.fragments[e+1]}}getNextPart(t){var e;const{index:i,fragment:s}=t,r=null==(e=this.hls.levels[s.level])||null==(e=e.details)?void 0:e.partList;if(r){const{sn:t}=s;for(let e=r.length-1;e>=0;e--){const s=r[e];if(s.index===i&&s.fragment.sn===t)return r[e+1]}}}getObjectType(t){const{type:e}=t;return"subtitle"===e?am.TIMED_TEXT:"initSegment"===t.sn?am.INIT:"audio"===e?am.AUDIO:"main"===e?this.hls.audioTracks.length?am.VIDEO:am.MUXED:void 0}getTopBandwidth(t){let e,i=0;const s=this.hls;if(t===am.AUDIO)e=s.audioTracks;else{const t=s.maxAutoLevel,i=t>-1?t+1:s.levels.length;e=s.levels.slice(0,i)}return e.forEach(t=>{t.bitrate>i&&(i=t.bitrate)}),i>0?i:NaN}getBufferLength(t){const e=this.media,i=t===am.AUDIO?this.audioBuffer:this.videoBuffer;if(!i||!e)return NaN;return 1e3*_c.bufferInfo(i,e.currentTime,this.config.maxBufferHole).len}createPlaylistLoader(){const{pLoader:t}=this.config,e=this.applyPlaylistData,i=t||this.config.loader;return class{constructor(t){this.loader=void 0,this.loader=new i(t)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(t,i,s){e(t),this.loader.load(t,i,s)}}}createFragmentLoader(){const{fLoader:t}=this.config,e=this.applyFragmentData,i=t||this.config.loader;return class{constructor(t){this.loader=void 0,this.loader=new i(t)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(t,i,s){e(t),this.loader.load(t,i,s)}}}},contentSteeringController:class extends rd{constructor(t){super("content-steering",t.logger),this.hls=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=t,this.registerListeners()}registerListeners(){const t=this.hls;t.on(Ql.MANIFEST_LOADING,this.onManifestLoading,this),t.on(Ql.MANIFEST_LOADED,this.onManifestLoaded,this),t.on(Ql.MANIFEST_PARSED,this.onManifestParsed,this),t.on(Ql.ERROR,this.onError,this)}unregisterListeners(){const t=this.hls;t&&(t.off(Ql.MANIFEST_LOADING,this.onManifestLoading,this),t.off(Ql.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(Ql.MANIFEST_PARSED,this.onManifestParsed,this),t.off(Ql.ERROR,this.onError,this))}pathways(){return(this.levels||[]).reduce((t,e)=>(-1===t.indexOf(e.pathwayId)&&t.push(e.pathwayId),t),[])}get pathwayPriority(){return this._pathwayPriority}set pathwayPriority(t){this.updatePathwayPriority(t)}startLoad(){if(this.started=!0,this.clearTimeout(),this.enabled&&this.uri){if(this.updated){const t=1e3*this.timeToLoad-(performance.now()-this.updated);if(t>0)return void this.scheduleRefresh(this.uri,t)}this.loadSteeringManifest(this.uri)}}stopLoad(){this.started=!1,this.loader&&(this.loader.destroy(),this.loader=null),this.clearTimeout()}clearTimeout(){-1!==this.reloadTimer&&(self.clearTimeout(this.reloadTimer),this.reloadTimer=-1)}destroy(){this.unregisterListeners(),this.stopLoad(),this.hls=null,this.levels=this.audioTracks=this.subtitleTracks=null}removeLevel(t){const e=this.levels;e&&(this.levels=e.filter(e=>e!==t))}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(t,e){const{contentSteering:i}=e;null!==i&&(this.pathwayId=i.pathwayId,this.uri=i.uri,this.started&&this.startLoad())}onManifestParsed(t,e){this.audioTracks=e.audioTracks,this.subtitleTracks=e.subtitleTracks}onError(t,e){const{errorAction:i}=e;if((null==i?void 0:i.action)===lc&&i.flags===uc){const t=this.levels;let s=this._pathwayPriority,r=this.pathwayId;if(e.context){const{groupId:i,pathwayId:s,type:n}=e.context;i&&t?r=this.getPathwayForGroupId(i,n,r):s&&(r=s)}r in this.penalizedPathways||(this.penalizedPathways[r]=performance.now()),!s&&t&&(s=this.pathways()),s&&s.length>1&&(this.updatePathwayPriority(s),i.resolved=this.pathwayId!==r),e.details!==Gl.BUFFER_APPEND_ERROR||e.fatal?i.resolved||this.warn(`Could not resolve ${e.details} ("${e.error.message}") with content-steering for Pathway: ${r} levels: ${t?t.length:t} priorities: ${Uh(s)} penalized: ${Uh(this.penalizedPathways)}`):i.resolved=!0}}filterParsedLevels(t){this.levels=t;let e=this.getLevelsForPathway(this.pathwayId);if(0===e.length){const i=t[0].pathwayId;this.log(`No levels found in Pathway ${this.pathwayId}. Setting initial Pathway to "${i}"`),e=this.getLevelsForPathway(i),this.pathwayId=i}return e.length!==t.length&&this.log(`Found ${e.length}/${t.length} levels in Pathway "${this.pathwayId}"`),e}getLevelsForPathway(t){return null===this.levels?[]:this.levels.filter(e=>t===e.pathwayId)}updatePathwayPriority(t){let e;this._pathwayPriority=t;const i=this.penalizedPathways,s=performance.now();Object.keys(i).forEach(t=>{s-i[t]>3e5&&delete i[t]});for(let r=0;r<t.length;r++){const s=t[r];if(s in i)continue;if(s===this.pathwayId)return;const n=this.hls.nextLoadLevel,a=this.hls.levels[n];if(e=this.getLevelsForPathway(s),e.length>0){this.log(`Setting Pathway to "${s}"`),this.pathwayId=s,Wu(e),this.hls.trigger(Ql.LEVELS_UPDATED,{levels:e});const t=this.hls.levels[n];a&&t&&this.levels&&(t.attrs["STABLE-VARIANT-ID"]!==a.attrs["STABLE-VARIANT-ID"]&&t.bitrate!==a.bitrate&&this.log(`Unstable Pathways change from bitrate ${a.bitrate} to ${t.bitrate}`),this.hls.nextLoadLevel=n);break}}}getPathwayForGroupId(t,e,i){const s=this.getLevelsForPathway(i).concat(this.levels||[]);for(let r=0;r<s.length;r++)if(e===Wl&&s[r].hasAudioGroup(t)||e===Yl&&s[r].hasSubtitleGroup(t))return s[r].pathwayId;return i}clonePathways(t){const e=this.levels;if(!e)return;const i={},s={};t.forEach(t=>{const{ID:r,"BASE-ID":n,"URI-REPLACEMENT":a}=t;if(e.some(t=>t.pathwayId===r))return;const o=this.getLevelsForPathway(n).map(t=>{const e=new qc(t.attrs);e["PATHWAY-ID"]=r;const n=e.AUDIO&&`${e.AUDIO}_clone_${r}`,o=e.SUBTITLES&&`${e.SUBTITLES}_clone_${r}`;n&&(i[e.AUDIO]=n,e.AUDIO=n),o&&(s[e.SUBTITLES]=o,e.SUBTITLES=o);const l=tp(t.uri,e["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",a),d=new Fh({attrs:e,audioCodec:t.audioCodec,bitrate:t.bitrate,height:t.height,name:t.name,url:l,videoCodec:t.videoCodec,width:t.width});if(t.audioGroups)for(let i=1;i<t.audioGroups.length;i++)d.addGroupId("audio",`${t.audioGroups[i]}_clone_${r}`);if(t.subtitleGroups)for(let i=1;i<t.subtitleGroups.length;i++)d.addGroupId("text",`${t.subtitleGroups[i]}_clone_${r}`);return d});e.push(...o),Jm(this.audioTracks,i,a,r),Jm(this.subtitleTracks,s,a,r)})}loadSteeringManifest(t){const e=this.hls.config,i=e.loader;let s;this.loader&&this.loader.destroy(),this.loader=new i(e);try{s=new self.URL(t)}catch(d){return this.enabled=!1,void this.log(`Failed to parse Steering Manifest URI: ${t}`)}if("data:"!==s.protocol){const t=0|(this.hls.bandwidthEstimate||e.abrEwmaDefaultEstimate);s.searchParams.set("_HLS_pathway",this.pathwayId),s.searchParams.set("_HLS_throughput",""+t)}const r={responseType:"json",url:s.href},n=e.steeringManifestLoadPolicy.default,a=n.errorRetry||n.timeoutRetry||{},o={loadPolicy:n,timeout:n.maxLoadTimeMs,maxRetry:a.maxNumRetry||0,retryDelay:a.retryDelayMs||0,maxRetryDelay:a.maxRetryDelayMs||0},l={onSuccess:(t,e,i,r)=>{this.log(`Loaded steering manifest: "${s}"`);const n=t.data;if(1!==(null==n?void 0:n.VERSION))return void this.log(`Steering VERSION ${n.VERSION} not supported!`);this.updated=performance.now(),this.timeToLoad=n.TTL;const{"RELOAD-URI":a,"PATHWAY-CLONES":o,"PATHWAY-PRIORITY":l}=n;if(a)try{this.uri=new self.URL(a,s).href}catch(d){return this.enabled=!1,void this.log(`Failed to parse Steering Manifest RELOAD-URI: ${a}`)}this.scheduleRefresh(this.uri||i.url),o&&this.clonePathways(o);const h={steeringManifest:n,url:s.toString()};this.hls.trigger(Ql.STEERING_MANIFEST_LOADED,h),l&&this.updatePathwayPriority(l)},onError:(t,e,i,s)=>{if(this.log(`Error loading steering manifest: ${t.code} ${t.text} (${e.url})`),this.stopLoad(),410===t.code)return this.enabled=!1,void this.log(`Steering manifest ${e.url} no longer available`);let r=1e3*this.timeToLoad;if(429===t.code){const t=this.loader;if("function"==typeof(null==t?void 0:t.getResponseHeader)){const e=t.getResponseHeader("Retry-After");e&&(r=1e3*parseFloat(e))}return void this.log(`Steering manifest ${e.url} rate limited`)}this.scheduleRefresh(this.uri||e.url,r)},onTimeout:(t,e,i)=>{this.log(`Timeout loading steering manifest (${e.url})`),this.scheduleRefresh(this.uri||e.url)}};this.log(`Requesting steering manifest: ${s}`),this.loader.load(r,o,l)}scheduleRefresh(t,e=1e3*this.timeToLoad){this.clearTimeout(),this.reloadTimer=self.setTimeout(()=>{var e;const i=null==(e=this.hls)?void 0:e.media;!i||i.ended?this.scheduleRefresh(t,1e3*this.timeToLoad):this.loadSteeringManifest(t)},e)}},interstitialsController:class extends rd{constructor(t,e){super("interstitials",t.logger),this.HlsPlayerClass=void 0,this.hls=void 0,this.assetListLoader=void 0,this.mediaSelection=null,this.altSelection=null,this.media=null,this.detachedData=null,this.requiredTracks=null,this.manager=null,this.playerQueue=[],this.bufferedPos=-1,this.timelinePos=-1,this.schedule=void 0,this.playingItem=null,this.bufferingItem=null,this.waitingItem=null,this.endedItem=null,this.playingAsset=null,this.endedAsset=null,this.bufferingAsset=null,this.shouldPlay=!1,this.onPlay=()=>{this.shouldPlay=!0},this.onPause=()=>{this.shouldPlay=!1},this.onSeeking=()=>{const t=this.currentTime;if(void 0===t||this.playbackDisabled||!this.schedule)return;const e=t-this.timelinePos;if(Math.abs(e)<1/7056e5)return;const i=e<=-.01;this.timelinePos=t,this.bufferedPos=t;const s=this.playingItem;if(!s)return void this.checkBuffer();if(i){this.schedule.resetErrorsInRange(t,t-e)&&this.updateSchedule(!0)}if(this.checkBuffer(),i&&t<s.start||t>=s.end){var r;const e=this.findItemIndex(s);let n=this.schedule.findItemIndexAtTime(t);if(-1===n&&(n=e+(i?-1:1),this.log(`seeked ${i?"back ":""}to position not covered by schedule ${t} (resolving from ${e} to ${n})`)),!this.isInterstitial(s)&&null!=(r=this.media)&&r.paused&&(this.shouldPlay=!1),!i&&n>e){const t=this.schedule.findJumpRestrictedIndex(e+1,n);if(t>e)return void this.setSchedulePosition(t)}return void this.setSchedulePosition(n)}const n=this.playingAsset;if(!n){if(this.playingLastItem&&this.isInterstitial(s)){const e=s.event.assetList[0];e&&(this.endedItem=this.playingItem,this.playingItem=null,this.setScheduleToAssetAtTime(t,e))}return}const a=n.timelineStart,o=n.duration||0;var l;(i&&t<a||t>=a+o)&&(null!=(l=s.event)&&l.appendInPlace&&(this.clearAssetPlayers(s.event,s),this.flushFrontBuffer(t)),this.setScheduleToAssetAtTime(t,n))},this.onTimeupdate=()=>{const t=this.currentTime;if(void 0===t||this.playbackDisabled)return;if(!(t>this.timelinePos))return;this.timelinePos=t,t>this.bufferedPos&&this.checkBuffer();const e=this.playingItem;if(!e||this.playingLastItem)return;if(t>=e.end){this.timelinePos=e.end;const t=this.findItemIndex(e);this.setSchedulePosition(t+1)}const i=this.playingAsset;if(!i)return;t>=i.timelineStart+(i.duration||0)&&this.setScheduleToAssetAtTime(t,i)},this.onScheduleUpdate=(t,e)=>{const i=this.schedule;if(!i)return;const s=this.playingItem,r=i.events||[],n=i.items||[],a=i.durations,o=t.map(t=>t.identifier),l=!(!r.length&&!o.length);(l||e)&&this.log(`INTERSTITIALS_UPDATED (${r.length}): ${r}\nSchedule: ${n.map(t=>Sp(t))} pos: ${this.timelinePos}`),o.length&&this.log(`Removed events ${o}`);let d=null,h=null;s&&(d=this.updateItem(s,this.timelinePos),this.itemsMatch(s,d)?this.playingItem=d:this.waitingItem=this.endedItem=null),this.waitingItem=this.updateItem(this.waitingItem),this.endedItem=this.updateItem(this.endedItem);const c=this.bufferingItem;if(c&&(h=this.updateItem(c,this.bufferedPos),this.itemsMatch(c,h)?this.bufferingItem=h:c.event&&(this.bufferingItem=this.playingItem,this.clearInterstitial(c.event,null))),t.forEach(t=>{t.assetList.forEach(t=>{this.clearAssetPlayer(t.identifier,null)})}),this.playerQueue.forEach(t=>{if(t.interstitial.appendInPlace){const i=t.assetItem.timelineStart,s=t.timelineOffset-i;if(s)try{t.timelineOffset=i}catch(e){Math.abs(s)>up&&this.warn(`${e} ("${t.assetId}" ${t.timelineOffset}->${i})`)}}}),l||e){if(this.hls.trigger(Ql.INTERSTITIALS_UPDATED,{events:r.slice(0),schedule:n.slice(0),durations:a,removedIds:o}),this.isInterstitial(s)&&o.includes(s.event.identifier))return this.warn(`Interstitial "${s.event.identifier}" removed while playing`),void this.primaryFallback(s.event);s&&this.trimInPlace(d,s),c&&h!==d&&this.trimInPlace(h,c),this.checkBuffer()}},this.hls=t,this.HlsPlayerClass=e,this.assetListLoader=new bp(t),this.schedule=new Tp(this.onScheduleUpdate,t.logger),this.registerListeners()}registerListeners(){const t=this.hls;t&&(t.on(Ql.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(Ql.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(Ql.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(Ql.MANIFEST_LOADING,this.onManifestLoading,this),t.on(Ql.LEVEL_UPDATED,this.onLevelUpdated,this),t.on(Ql.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.on(Ql.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),t.on(Ql.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),t.on(Ql.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),t.on(Ql.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),t.on(Ql.ASSET_LIST_LOADED,this.onAssetListLoaded,this),t.on(Ql.BUFFER_APPENDED,this.onBufferAppended,this),t.on(Ql.BUFFER_FLUSHED,this.onBufferFlushed,this),t.on(Ql.BUFFERED_TO_END,this.onBufferedToEnd,this),t.on(Ql.MEDIA_ENDED,this.onMediaEnded,this),t.on(Ql.ERROR,this.onError,this),t.on(Ql.DESTROYING,this.onDestroying,this))}unregisterListeners(){const t=this.hls;t&&(t.off(Ql.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(Ql.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(Ql.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(Ql.MANIFEST_LOADING,this.onManifestLoading,this),t.off(Ql.LEVEL_UPDATED,this.onLevelUpdated,this),t.off(Ql.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.off(Ql.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),t.off(Ql.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),t.off(Ql.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),t.off(Ql.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),t.off(Ql.ASSET_LIST_LOADED,this.onAssetListLoaded,this),t.off(Ql.BUFFER_CODECS,this.onBufferCodecs,this),t.off(Ql.BUFFER_APPENDED,this.onBufferAppended,this),t.off(Ql.BUFFER_FLUSHED,this.onBufferFlushed,this),t.off(Ql.BUFFERED_TO_END,this.onBufferedToEnd,this),t.off(Ql.MEDIA_ENDED,this.onMediaEnded,this),t.off(Ql.ERROR,this.onError,this),t.off(Ql.DESTROYING,this.onDestroying,this))}startLoad(){this.resumeBuffering()}stopLoad(){this.pauseBuffering()}resumeBuffering(){var t;null==(t=this.getBufferingPlayer())||t.resumeBuffering()}pauseBuffering(){var t;null==(t=this.getBufferingPlayer())||t.pauseBuffering()}destroy(){this.unregisterListeners(),this.stopLoad(),this.assetListLoader&&this.assetListLoader.destroy(),this.emptyPlayerQueue(),this.clearScheduleState(),this.schedule&&this.schedule.destroy(),this.media=this.detachedData=this.mediaSelection=this.requiredTracks=this.altSelection=this.schedule=this.manager=null,this.hls=this.HlsPlayerClass=this.log=null,this.assetListLoader=null,this.onPlay=this.onPause=this.onSeeking=this.onTimeupdate=null,this.onScheduleUpdate=null}onDestroying(){const t=this.primaryMedia||this.media;t&&this.removeMediaListeners(t)}removeMediaListeners(t){sf(t,"play",this.onPlay),sf(t,"pause",this.onPause),sf(t,"seeking",this.onSeeking),sf(t,"timeupdate",this.onTimeupdate)}onMediaAttaching(t,e){const i=this.media=e.media;ef(i,"seeking",this.onSeeking),ef(i,"timeupdate",this.onTimeupdate),ef(i,"play",this.onPlay),ef(i,"pause",this.onPause)}onMediaAttached(t,e){const i=this.effectivePlayingItem,s=this.detachedData;if(this.detachedData=null,null===i)this.checkStart();else if(!s){this.clearScheduleState();const t=this.findItemIndex(i);this.setSchedulePosition(t)}}clearScheduleState(){this.log("clear schedule state"),this.playingItem=this.bufferingItem=this.waitingItem=this.endedItem=this.playingAsset=this.endedAsset=this.bufferingAsset=null}onMediaDetaching(t,e){const i=!!e.transferMedia,s=this.media;if(this.media=null,!i&&(s&&this.removeMediaListeners(s),this.detachedData)){const t=this.getBufferingPlayer();t&&(this.log(`Removing schedule state for detachedData and ${t}`),this.playingAsset=this.endedAsset=this.bufferingAsset=this.bufferingItem=this.waitingItem=this.detachedData=null,t.detachMedia()),this.shouldPlay=!1}}get interstitialsManager(){if(!this.hls)return null;if(this.manager)return this.manager;const t=this,e=()=>t.bufferingItem||t.waitingItem,i=e=>e?t.getAssetPlayer(e.identifier):e,s=(e,s,n,a,o)=>{if(e){let l=e[s].start;const d=e.event;if(d){if("playout"===s||d.timelineOccupancy!==fp.Point){const t=i(n);(null==t?void 0:t.interstitial)===d&&(l+=t.assetItem.startOffset+t[o])}}else{l+=("bufferedPos"===a?r():t[a])-e.start}return l}return 0},r=()=>{const e=t.bufferedPos;return e===Number.MAX_VALUE?n("primary"):Math.max(e,0)},n=e=>{var i,s;return null!=(i=t.primaryDetails)&&i.live?t.primaryDetails.edge:(null==(s=t.schedule)?void 0:s.durations[e])||0},a=(e,r)=>{var n,a;const o=t.effectivePlayingItem;if(null!=o&&null!=(n=o.event)&&n.restrictions.skip||!t.schedule)return;t.log(`seek to ${e} "${r}"`);const l=t.effectivePlayingItem,d=t.schedule.findItemIndexAtTime(e,r),h=null==(a=t.schedule.items)?void 0:a[d],c=t.getBufferingPlayer(),u=null==c?void 0:c.interstitial,f=null==u?void 0:u.appendInPlace,g=l&&t.itemsMatch(l,h);if(l&&(f||g)){const n=i(t.playingAsset),a=(null==n?void 0:n.media)||t.primaryMedia;if(a){const i="primary"===r?a.currentTime:s(l,r,t.playingAsset,"timelinePos","currentTime"),o=e-i,d=(f?i:a.currentTime)+o;if(d>=0&&(!n||f||d<=n.duration))return void(a.currentTime=d)}}if(h){let i=e;if("primary"!==r){const t=e-h[r].start;i=h.start+t}const s=!t.isInterstitial(h);if(t.isInterstitial(l)&&!l.event.appendInPlace||!s&&!h.event.appendInPlace){if(l){const n=t.findItemIndex(l);if(d>n){const e=t.schedule.findJumpRestrictedIndex(n+1,d);if(e>n)return void t.setSchedulePosition(e)}let a=0;if(s)t.timelinePos=i,t.checkBuffer();else{const t=h.event.assetList,i=e-(h[r]||h).start;for(let e=t.length;e--;){const s=t[e];if(s.duration&&i>=s.startOffset&&i<s.startOffset+s.duration){a=e;break}}}t.setSchedulePosition(d,a)}}else{const e=t.media||(f?null==c?void 0:c.media:null);e&&(e.currentTime=i)}}},o=()=>{const i=t.effectivePlayingItem;if(t.isInterstitial(i))return i;const s=e();return t.isInterstitial(s)?s:null},l={get bufferedEnd(){const i=e(),r=t.bufferingItem;var n;return r&&r===i&&(s(r,"playout",t.bufferingAsset,"bufferedPos","bufferedEnd")-r.playout.start||(null==(n=t.bufferingAsset)?void 0:n.startOffset))||0},get currentTime(){const e=o(),i=t.effectivePlayingItem;return i&&i===e?s(i,"playout",t.effectivePlayingAsset,"timelinePos","currentTime")-i.playout.start:0},set currentTime(e){const i=o(),s=t.effectivePlayingItem;s&&s===i&&a(e+s.playout.start,"playout")},get duration(){const t=o();return t?t.playout.end-t.playout.start:0},get assetPlayers(){var e;const i=null==(e=o())?void 0:e.event.assetList;return i?i.map(e=>t.getAssetPlayer(e.identifier)):[]},get playingIndex(){var e;const i=null==(e=o())?void 0:e.event;return i&&t.effectivePlayingAsset?i.findAssetIndex(t.effectivePlayingAsset):-1},get scheduleItem(){return o()}};return this.manager={get events(){var e;return(null==(e=t.schedule)||null==(e=e.events)?void 0:e.slice(0))||[]},get schedule(){var e;return(null==(e=t.schedule)||null==(e=e.items)?void 0:e.slice(0))||[]},get interstitialPlayer(){return o()?l:null},get playerQueue(){return t.playerQueue.slice(0)},get bufferingAsset(){return t.bufferingAsset},get bufferingItem(){return e()},get bufferingIndex(){const i=e();return t.findItemIndex(i)},get playingAsset(){return t.effectivePlayingAsset},get playingItem(){return t.effectivePlayingItem},get playingIndex(){const e=t.effectivePlayingItem;return t.findItemIndex(e)},primary:{get bufferedEnd(){return r()},get currentTime(){const e=t.timelinePos;return e>0?e:0},set currentTime(t){a(t,"primary")},get duration(){return n("primary")},get seekableStart(){var e;return(null==(e=t.primaryDetails)?void 0:e.fragmentStart)||0}},integrated:{get bufferedEnd(){return s(e(),"integrated",t.bufferingAsset,"bufferedPos","bufferedEnd")},get currentTime(){return s(t.effectivePlayingItem,"integrated",t.effectivePlayingAsset,"timelinePos","currentTime")},set currentTime(t){a(t,"integrated")},get duration(){return n("integrated")},get seekableStart(){var e;return((e,i)=>{var s;if(0!==e&&"primary"!==i&&null!=(s=t.schedule)&&s.length){var r;const s=t.schedule.findItemIndexAtTime(e),n=null==(r=t.schedule.items)?void 0:r[s];if(n)return e+(n[i].start-n.start)}return e})((null==(e=t.primaryDetails)?void 0:e.fragmentStart)||0,"integrated")}},skip:()=>{const e=t.effectivePlayingItem,i=null==e?void 0:e.event;if(i&&!i.restrictions.skip){const s=t.findItemIndex(e);if(i.appendInPlace){const t=e.playout.start+e.event.duration;a(t+.001,"playout")}else t.advanceAfterAssetEnded(i,s,1/0)}}}}get effectivePlayingItem(){return this.waitingItem||this.playingItem||this.endedItem}get effectivePlayingAsset(){return this.playingAsset||this.endedAsset}get playingLastItem(){var t;const e=this.playingItem,i=null==(t=this.schedule)?void 0:t.items;return!!(this.playbackStarted&&e&&i)&&this.findItemIndex(e)===i.length-1}get playbackStarted(){return null!==this.effectivePlayingItem}get currentTime(){var t,e;if(null===this.mediaSelection)return;const i=this.waitingItem||this.playingItem;if(this.isInterstitial(i)&&!i.event.appendInPlace)return;let s=this.media;!s&&null!=(t=this.bufferingItem)&&null!=(t=t.event)&&t.appendInPlace&&(s=this.primaryMedia);const r=null==(e=s)?void 0:e.currentTime;return void 0!==r&&Ul(r)?r:void 0}get primaryMedia(){var t;return this.media||(null==(t=this.detachedData)?void 0:t.media)||null}isInterstitial(t){return!(null==t||!t.event)}retreiveMediaSource(t,e){const i=this.getAssetPlayer(t);i&&this.transferMediaFromPlayer(i,e)}transferMediaFromPlayer(t,e){const i=t.interstitial.appendInPlace,s=t.media;if(i&&s===this.primaryMedia){if(this.bufferingAsset=null,(!e||this.isInterstitial(e)&&!e.event.appendInPlace)&&e&&s)return void(this.detachedData={media:s});const i=t.transferMedia();this.log(`transfer MediaSource from ${t} ${Uh(i)}`),this.detachedData=i}else e&&s&&(this.shouldPlay||(this.shouldPlay=!s.paused))}transferMediaTo(t,e){var i,s;if(t.media===e)return;let r=null;const n=this.hls,a=t!==n,o=a&&t.interstitial.appendInPlace,l=null==(i=this.detachedData)?void 0:i.mediaSource;let d;if(n.media)o&&(r=n.transferMedia(),this.detachedData=r),d="Primary";else if(l){const t=this.getBufferingPlayer();t?(r=t.transferMedia(),d=`${t}`):d="detached MediaSource"}else d="detached media";if(!r)if(l)r=this.detachedData,this.log(`using detachedData: MediaSource ${Uh(r)}`);else if(!this.detachedData||n.media===e){const t=this.playerQueue;t.length>1&&t.forEach(t=>{if(a&&t.interstitial.appendInPlace!==o){const e=t.interstitial;this.clearInterstitial(t.interstitial,null),e.appendInPlace=!1,e.appendInPlace&&this.warn(`Could not change append strategy for queued assets ${e}`)}}),this.hls.detachMedia(),this.detachedData={media:e}}const h=r&&"mediaSource"in r&&"closed"!==(null==(s=r.mediaSource)?void 0:s.readyState),c=h&&r?r:e;this.log(`${h?"transfering MediaSource":"attaching media"} to ${a?t:"Primary"} from ${d} (media.currentTime: ${e.currentTime})`);const u=this.schedule;if(c===r&&u){const e=a&&t.assetId===u.assetIdAtEnd;c.overrides={duration:u.duration,endOfStream:!a||e,cueRemoval:!a}}t.attachMedia(c)}onInterstitialCueEnter(){this.onTimeupdate()}checkStart(){const t=this.schedule,e=null==t?void 0:t.events;if(!e||this.playbackDisabled||!this.media)return;-1===this.bufferedPos&&(this.bufferedPos=0);const i=this.timelinePos,s=this.effectivePlayingItem;if(-1===i){const i=this.hls.startPosition;if(this.log(Lp("checkStart",i)),this.timelinePos=i,e.length&&e[0].cue.pre){const i=t.findEventIndex(e[0].identifier);this.setSchedulePosition(i)}else if(i>=0||!this.primaryLive){const e=this.timelinePos=i>0?i:0,s=t.findItemIndexAtTime(e);this.setSchedulePosition(s)}}else if(s&&!this.playingItem){const e=t.findItemIndex(s);this.setSchedulePosition(e)}}advanceAssetBuffering(t,e){const i=t.event,s=i.findAssetIndex(e),r=vp(i,s);if(i.isAssetPastPlayoutLimit(r)){if(this.schedule){var n;const e=null==(n=this.schedule.items)?void 0:n[this.findItemIndex(t)+1];e&&this.bufferedToItem(e)}}else this.bufferedToEvent(t,r)}advanceAfterAssetEnded(t,e,i){const s=vp(t,i);if(t.isAssetPastPlayoutLimit(s)){if(this.schedule){const i=this.schedule.items;if(i){const s=e+1;if(s>=i.length)return void this.setSchedulePosition(-1);const r=t.resumeTime;this.timelinePos<r&&(this.log(Lp("advanceAfterAssetEnded",r)),this.timelinePos=r,t.appendInPlace&&this.advanceInPlace(r),this.checkBuffer(this.bufferedPos<r)),this.setSchedulePosition(s)}}}else{if(t.appendInPlace){const e=t.assetList[s];e&&this.advanceInPlace(e.timelineStart)}this.setSchedulePosition(e,s)}}setScheduleToAssetAtTime(t,e){const i=this.schedule;if(!i)return;const s=e.parentIdentifier,r=i.getEvent(s);if(r){const e=i.findEventIndex(s),n=i.findAssetIndex(r,t);this.advanceAfterAssetEnded(r,e,n-1)}}setSchedulePosition(t,e){var i;const s=null==(i=this.schedule)?void 0:i.items;if(!s||this.playbackDisabled)return;const r=t>=0?s[t]:null;this.log(`setSchedulePosition ${t}, ${e} (${r?Sp(r):r}) pos: ${this.timelinePos}`);const n=this.waitingItem||this.playingItem,a=this.playingLastItem;if(this.isInterstitial(n)){const i=n.event,d=this.playingAsset,h=null==d?void 0:d.identifier,c=h?this.getAssetPlayer(h):null;if(c&&h&&(!this.eventItemsMatch(n,r)||void 0!==e&&h!==i.assetList[e].identifier)){var o;const e=i.findAssetIndex(d);if(this.log(`INTERSTITIAL_ASSET_ENDED ${e+1}/${i.assetList.length} ${yp(d)}`),this.endedAsset=d,this.playingAsset=null,this.hls.trigger(Ql.INTERSTITIAL_ASSET_ENDED,{asset:d,assetListIndex:e,event:i,schedule:s.slice(0),scheduleIndex:t,player:c}),n!==this.playingItem)return void(this.itemsMatch(n,this.playingItem)&&!this.playingAsset&&this.advanceAfterAssetEnded(i,this.findItemIndex(this.playingItem),e));this.retreiveMediaSource(h,r),!c.media||null!=(o=this.detachedData)&&o.mediaSource||c.detachMedia()}if(!this.eventItemsMatch(n,r)&&(this.endedItem=n,this.playingItem=null,this.log(`INTERSTITIAL_ENDED ${i} ${Sp(n)}`),i.hasPlayed=!0,this.hls.trigger(Ql.INTERSTITIAL_ENDED,{event:i,schedule:s.slice(0),scheduleIndex:t}),i.cue.once)){var l;this.updateSchedule();const t=null==(l=this.schedule)?void 0:l.items;if(r&&t){const i=this.findItemIndex(r);this.advanceSchedule(i,t,e,n,a)}return}}this.advanceSchedule(t,s,e,n,a)}advanceSchedule(t,e,i,s,r){const n=this.schedule;if(!n)return;const a=e[t]||null,o=this.primaryMedia,l=this.playerQueue;if(l.length&&l.forEach(e=>{const i=e.interstitial,s=n.findEventIndex(i.identifier);(s<t||s>t+1)&&this.clearInterstitial(i,a)}),this.isInterstitial(a)){this.timelinePos=Math.min(Math.max(this.timelinePos,a.start),a.end);const r=a.event;if(void 0===i){const e=vp(r,(i=n.findAssetIndex(r,this.timelinePos))-1);if(r.isAssetPastPlayoutLimit(e)||r.appendInPlace&&this.timelinePos===a.end)return void this.advanceAfterAssetEnded(r,t,i);i=e}const l=this.waitingItem;this.assetsBuffered(a,o)||this.setBufferingItem(a);let d=this.preloadAssets(r,i);if(this.eventItemsMatch(a,l||s)||(this.waitingItem=a,this.log(`INTERSTITIAL_STARTED ${Sp(a)} ${r.appendInPlace?"append in place":""}`),this.hls.trigger(Ql.INTERSTITIAL_STARTED,{event:r,schedule:e.slice(0),scheduleIndex:t})),!r.assetListLoaded)return void this.log(`Waiting for ASSET-LIST to complete loading ${r}`);if(r.assetListLoader&&(r.assetListLoader.destroy(),r.assetListLoader=void 0),!o)return void this.log(`Waiting for attachMedia to start Interstitial ${r}`);this.waitingItem=this.endedItem=null,this.playingItem=a;const h=r.assetList[i];if(!h)return void this.advanceAfterAssetEnded(r,t,i||0);if(d||(d=this.getAssetPlayer(h.identifier)),null===d||d.destroyed){const t=r.assetList.length;this.warn(`asset ${i+1}/${t} player destroyed ${r}`),d=this.createAssetPlayer(r,h,i),d.loadSource()}if(!this.eventItemsMatch(a,this.bufferingItem)&&r.appendInPlace&&this.isAssetBuffered(h))return;this.startAssetPlayer(d,i,e,t,o),this.shouldPlay&&Ip(d.media)}else a?(this.resumePrimary(a,t,s),this.shouldPlay&&Ip(this.hls.media)):r&&this.isInterstitial(s)&&(this.endedItem=null,this.playingItem=s,s.event.appendInPlace||this.attachPrimary(n.durations.primary,null))}get playbackDisabled(){return!1===this.hls.config.enableInterstitialPlayback}get primaryDetails(){var t;return null==(t=this.mediaSelection)?void 0:t.main.details}get primaryLive(){var t;return!(null==(t=this.primaryDetails)||!t.live)}resumePrimary(t,e,i){var s,r;if(this.playingItem=t,this.playingAsset=this.endedAsset=null,this.waitingItem=this.endedItem=null,this.bufferedToItem(t),this.log(`resuming ${Sp(t)}`),null==(s=this.detachedData)||!s.mediaSource){let i=this.timelinePos;(i<t.start||i>=t.end)&&(i=this.getPrimaryResumption(t,e),this.log(Lp("resumePrimary",i)),this.timelinePos=i),this.attachPrimary(i,t)}if(!i)return;const n=null==(r=this.schedule)?void 0:r.items;n&&(this.log(`INTERSTITIALS_PRIMARY_RESUMED ${Sp(t)}`),this.hls.trigger(Ql.INTERSTITIALS_PRIMARY_RESUMED,{schedule:n.slice(0),scheduleIndex:e}),this.checkBuffer())}getPrimaryResumption(t,e){const i=t.start;if(this.primaryLive){const t=this.primaryDetails;if(0===e)return this.hls.startPosition;if(t&&(i<t.fragmentStart||i>t.edge))return this.hls.liveSyncPosition||-1}return i}isAssetBuffered(t){const e=this.getAssetPlayer(t.identifier);if(null!=e&&e.hls)return e.hls.bufferedToEnd;return _c.bufferInfo(this.primaryMedia,this.timelinePos,0).end+1>=t.timelineStart+(t.duration||0)}attachPrimary(t,e,i){e?this.setBufferingItem(e):this.bufferingItem=this.playingItem,this.bufferingAsset=null;const s=this.primaryMedia;if(!s)return;const r=this.hls;r.media?this.checkBuffer():(this.transferMediaTo(r,s),i&&this.startLoadingPrimaryAt(t,i)),i||(this.log(Lp("attachPrimary",t)),this.timelinePos=t,this.startLoadingPrimaryAt(t,i))}startLoadingPrimaryAt(t,e){var i;const s=this.hls;!s.loadingEnabled||!s.media||Math.abs(((null==(i=s.mainForwardBufferInfo)?void 0:i.start)||s.media.currentTime)-t)>.5?s.startLoad(t,e):s.bufferingEnabled||s.resumeBuffering()}onManifestLoading(){var t;this.stopLoad(),null==(t=this.schedule)||t.reset(),this.emptyPlayerQueue(),this.clearScheduleState(),this.shouldPlay=!1,this.bufferedPos=this.timelinePos=-1,this.mediaSelection=this.altSelection=this.manager=this.requiredTracks=null,this.hls.off(Ql.BUFFER_CODECS,this.onBufferCodecs,this),this.hls.on(Ql.BUFFER_CODECS,this.onBufferCodecs,this)}onLevelUpdated(t,e){if(-1===e.level||!this.schedule)return;const i=this.hls.levels[e.level];if(!i.details)return;const s=sd(sd({},this.mediaSelection||this.altSelection),{},{main:i});this.mediaSelection=s,this.schedule.parseInterstitialDateRanges(s,this.hls.config.interstitialAppendInPlace),!this.effectivePlayingItem&&this.schedule.items&&this.checkStart()}onAudioTrackUpdated(t,e){const i=this.hls.audioTracks[e.id],s=this.mediaSelection;if(!s)return void(this.altSelection=sd(sd({},this.altSelection),{},{audio:i}));const r=sd(sd({},s),{},{audio:i});this.mediaSelection=r}onSubtitleTrackUpdated(t,e){const i=this.hls.subtitleTracks[e.id],s=this.mediaSelection;if(!s)return void(this.altSelection=sd(sd({},this.altSelection),{},{subtitles:i}));const r=sd(sd({},s),{},{subtitles:i});this.mediaSelection=r}onAudioTrackSwitching(t,e){const i=Vh(e);this.playerQueue.forEach(({hls:t})=>t&&(t.setAudioOption(e)||t.setAudioOption(i)))}onSubtitleTrackSwitch(t,e){const i=Vh(e);this.playerQueue.forEach(({hls:t})=>t&&(t.setSubtitleOption(e)||-1!==e.id&&t.setSubtitleOption(i)))}onBufferCodecs(t,e){const i=e.tracks;i&&(this.requiredTracks=i)}onBufferAppended(t,e){this.checkBuffer()}onBufferFlushed(t,e){const i=this.playingItem;if(i&&!this.itemsMatch(i,this.bufferingItem)&&!this.isInterstitial(i)){const t=this.timelinePos;this.bufferedPos=t,this.checkBuffer()}}onBufferedToEnd(t){if(!this.schedule)return;const e=this.schedule.events;if(this.bufferedPos<Number.MAX_VALUE&&e){for(let t=0;t<e.length;t++){const s=e[t];if(s.cue.post){var i;const t=this.schedule.findEventIndex(s.identifier),e=null==(i=this.schedule.items)?void 0:i[t];this.isInterstitial(e)&&this.eventItemsMatch(e,this.bufferingItem)&&this.bufferedToItem(e,0);break}}this.bufferedPos=Number.MAX_VALUE}}onMediaEnded(t){const e=this.playingItem;if(!this.playingLastItem&&e){const t=this.findItemIndex(e);this.setSchedulePosition(t+1)}else this.shouldPlay=!1}updateItem(t,e){var i;const s=null==(i=this.schedule)?void 0:i.items;if(t&&s){return s[this.findItemIndex(t,e)]||null}return null}trimInPlace(t,e){if(this.isInterstitial(t)&&t.event.appendInPlace&&e.end-t.end>.25){t.event.assetList.forEach((e,i)=>{t.event.isAssetPastPlayoutLimit(i)&&this.clearAssetPlayer(e.identifier,null)});const i=t.end+.25,s=_c.bufferInfo(this.primaryMedia,i,0);if(s.end>i||(s.nextStart||0)>i){this.log(`trim buffered interstitial ${Sp(t)} (was ${Sp(e)})`);const s=!0;this.attachPrimary(i,null,s),this.flushFrontBuffer(i)}}}itemsMatch(t,e){return!!e&&(t===e||t.event&&e.event&&this.eventItemsMatch(t,e)||!t.event&&!e.event&&this.findItemIndex(t)===this.findItemIndex(e))}eventItemsMatch(t,e){var i;return!!e&&(t===e||t.event.identifier===(null==(i=e.event)?void 0:i.identifier))}findItemIndex(t,e){return t&&this.schedule?this.schedule.findItemIndex(t,e):-1}updateSchedule(t=!1){var e;const i=this.mediaSelection;i&&(null==(e=this.schedule)||e.updateSchedule(i,[],t))}checkBuffer(t){var e;const i=null==(e=this.schedule)?void 0:e.items;if(!i)return;const s=_c.bufferInfo(this.primaryMedia,this.timelinePos,0);t&&(this.bufferedPos=this.timelinePos),t||(t=s.len<1),this.updateBufferedPos(s.end,i,t)}updateBufferedPos(t,e,i){const s=this.schedule,r=this.bufferingItem;if(this.bufferedPos>t||!s)return;if(1===e.length&&this.itemsMatch(e[0],r))return void(this.bufferedPos=t);const n=this.playingItem,a=this.findItemIndex(n);let o=s.findItemIndexAtTime(t);if(this.bufferedPos<t){var l;const i=this.findItemIndex(r),s=Math.min(i+1,e.length-1),n=e[s];if((-1===o&&r&&t>=r.end||null!=(l=n.event)&&l.appendInPlace&&t+.01>=n.start)&&(o=s),this.isInterstitial(r)){const t=r.event;if(s-a>1&&!1===t.appendInPlace)return;if(0===t.assetList.length&&t.assetListLoader)return}if(this.bufferedPos=t,o>i&&o>a)this.bufferedToItem(n);else{const e=this.primaryDetails;this.primaryLive&&e&&t>e.edge-e.targetduration&&n.start<e.edge+this.hls.config.interstitialLiveLookAhead&&this.isInterstitial(n)&&this.preloadAssets(n.event,0)}}else i&&n&&!this.itemsMatch(n,r)&&(o===a?this.bufferedToItem(n):o===a+1&&this.bufferedToItem(e[o]))}assetsBuffered(t,e){return 0!==t.event.assetList.length&&!t.event.assetList.some(t=>{const i=this.getAssetPlayer(t.identifier);return!(null!=i&&i.bufferedInPlaceToEnd(e))})}setBufferingItem(t){const e=this.bufferingItem,i=this.schedule;if(!this.itemsMatch(t,e)&&i){const{items:s,events:r}=i;if(!s||!r)return e;const n=this.isInterstitial(t),a=this.getBufferingPlayer();this.bufferingItem=t,this.bufferedPos=Math.max(t.start,Math.min(t.end,this.timelinePos));const o=a?a.remaining:e?e.end-this.timelinePos:0;if(this.log(`INTERSTITIALS_BUFFERED_TO_BOUNDARY ${Sp(t)}`+(e?` (${o.toFixed(2)} remaining)`:"")),!this.playbackDisabled)if(n){const e=i.findAssetIndex(t.event,this.bufferedPos);t.event.assetList.forEach((t,i)=>{const s=this.getAssetPlayer(t.identifier);s&&(i===e&&s.loadSource(),s.resumeBuffering())})}else this.hls.resumeBuffering(),this.playerQueue.forEach(t=>t.pauseBuffering());this.hls.trigger(Ql.INTERSTITIALS_BUFFERED_TO_BOUNDARY,{events:r.slice(0),schedule:s.slice(0),bufferingIndex:this.findItemIndex(t),playingIndex:this.findItemIndex(this.playingItem)})}else this.bufferingItem!==t&&(this.bufferingItem=t);return e}bufferedToItem(t,e=0){const i=this.setBufferingItem(t);if(!this.playbackDisabled)if(this.isInterstitial(t))this.bufferedToEvent(t,e);else if(null!==i){this.bufferingAsset=null;const e=this.detachedData;if(e)if(e.mediaSource){const e=!0;this.attachPrimary(t.start,t,e)}else this.preloadPrimary(t);else this.preloadPrimary(t)}}preloadPrimary(t){const e=this.findItemIndex(t),i=this.getPrimaryResumption(t,e);this.startLoadingPrimaryAt(i)}bufferedToEvent(t,e){const i=t.event,s=0===i.assetList.length&&!i.assetListLoader,r=i.cue.once;if(s||!r){const t=this.preloadAssets(i,e);if(null!=t&&t.interstitial.appendInPlace){const e=this.primaryMedia;e&&this.bufferAssetPlayer(t,e)}}}preloadAssets(t,e){const i=t.assetUrl,s=t.assetList.length,r=0===s&&!t.assetListLoader,n=t.cue.once;if(r){const r=t.timelineStart;if(t.appendInPlace){var a;const e=this.playingItem;this.isInterstitial(e)||(null==e||null==(a=e.nextEvent)?void 0:a.identifier)!==t.identifier||this.flushFrontBuffer(r+.25)}let n,o=0;if(!this.playingItem&&this.primaryLive&&(o=this.hls.startPosition,-1===o&&(o=this.hls.liveSyncPosition||0)),o&&!t.cue.pre&&!t.cue.post){const t=o-r;t>0&&(n=Math.round(1e3*t)/1e3)}if(this.log(`Load interstitial asset ${e+1}/${i?1:s} ${t}${n?` live-start: ${o} start-offset: ${n}`:""}`),i)return this.createAsset(t,0,0,r,t.duration,i);const l=this.assetListLoader.loadAssetList(t,n);l&&(t.assetListLoader=l)}else if(!n&&s){for(let r=e;r<s;r++){const e=t.assetList[r],i=this.getAssetPlayerQueueIndex(e.identifier);-1!==i&&!this.playerQueue[i].destroyed||e.error||this.createAssetPlayer(t,e,r)}const i=t.assetList[e];if(i){const t=this.getAssetPlayer(i.identifier);return t&&t.loadSource(),t}}return null}flushFrontBuffer(t){const e=this.requiredTracks;if(!e)return;this.log(`Removing front buffer starting at ${t}`);Object.keys(e).forEach(e=>{this.hls.trigger(Ql.BUFFER_FLUSHING,{startOffset:t,endOffset:1/0,type:e})})}getAssetPlayerQueueIndex(t){const e=this.playerQueue;for(let i=0;i<e.length;i++)if(t===e[i].assetId)return i;return-1}getAssetPlayer(t){const e=this.getAssetPlayerQueueIndex(t);return this.playerQueue[e]||null}getBufferingPlayer(){const{playerQueue:t,primaryMedia:e}=this;if(e)for(let i=0;i<t.length;i++)if(t[i].media===e)return t[i];return null}createAsset(t,e,i,s,r,n){const a={parentIdentifier:t.identifier,identifier:gp(t,n,e),duration:r,startOffset:i,timelineStart:s,uri:n};return this.createAssetPlayer(t,a,e)}createAssetPlayer(t,e,i){const s=this.hls,r=s.userConfig;let n=r.videoPreference;const a=s.loadLevelObj||s.levels[s.currentLevel];(n||a)&&(n=ed({},n),a.videoCodec&&(n.videoCodec=a.videoCodec),a.videoRange&&(n.allowedVideoRanges=[a.videoRange]));const o=s.audioTracks[s.audioTrack],l=s.subtitleTracks[s.subtitleTrack];let d=0;if(this.primaryLive||t.appendInPlace){const t=this.timelinePos-e.timelineStart;if(t>1){const i=e.duration;i&&t<i&&(d=t)}}const h=e.identifier,c=sd(sd({},r),{},{maxMaxBufferLength:Math.min(180,s.config.maxMaxBufferLength),autoStartLoad:!0,startFragPrefetch:!0,primarySessionId:s.sessionId,assetPlayerId:h,abrEwmaDefaultEstimate:s.bandwidthEstimate,interstitialsController:void 0,startPosition:d,liveDurationInfinity:!1,testBandwidth:!1,videoPreference:n,audioPreference:o||r.audioPreference,subtitlePreference:l||r.subtitlePreference});t.appendInPlace&&(t.appendInPlaceStarted=!0,e.timelineStart&&(c.timelineOffset=e.timelineStart));const u=c.cmcd;null!=u&&u.sessionId&&u.contentId&&(c.cmcd=ed({},u,{contentId:cp(e.uri)})),this.getAssetPlayer(h)&&this.warn(`Duplicate date range identifier ${t} and asset ${h}`);const f=new Ep(this.HlsPlayerClass,c,t,e);this.playerQueue.push(f),t.assetList[i]=e;let g=!0;const m=s=>{if(s.live){var r;const e=new Error(`Interstitials MUST be VOD assets ${t}`),s={fatal:!0,type:Vl.OTHER_ERROR,details:Gl.INTERSTITIAL_ASSET_ITEM_ERROR,error:e},n=(null==(r=this.schedule)?void 0:r.findEventIndex(t.identifier))||-1;return void this.handleAssetItemError(s,t,n,i,e.message)}const n=s.edge-s.fragmentStart,a=e.duration;(g||null===a||n>a)&&(g=!1,this.log(`Interstitial asset "${h}" duration change ${a} > ${n}`),e.duration=n,this.updateSchedule())};f.on(Ql.LEVEL_UPDATED,(t,{details:e})=>m(e)),f.on(Ql.LEVEL_PTS_UPDATED,(t,{details:e})=>m(e)),f.on(Ql.EVENT_CUE_ENTER,()=>this.onInterstitialCueEnter());const p=(t,e)=>{const i=this.getAssetPlayer(h);if(i&&e.tracks){i.off(Ql.BUFFER_CODECS,p),i.tracks=e.tracks;const t=this.primaryMedia;this.bufferingAsset===i.assetItem&&t&&!i.media&&this.bufferAssetPlayer(i,t)}};f.on(Ql.BUFFER_CODECS,p);f.on(Ql.BUFFERED_TO_END,()=>{var i;const s=this.getAssetPlayer(h);if(this.log(`buffered to end of asset ${s}`),!s||!this.schedule)return;const r=this.schedule.findEventIndex(t.identifier),n=null==(i=this.schedule.items)?void 0:i[r];this.isInterstitial(n)&&this.advanceAssetBuffering(n,e)});const A=e=>()=>{if(!this.getAssetPlayer(h)||!this.schedule)return;this.shouldPlay=!0;const i=this.schedule.findEventIndex(t.identifier);this.advanceAfterAssetEnded(t,i,e)};return f.once(Ql.MEDIA_ENDED,A(i)),f.once(Ql.PLAYOUT_LIMIT_REACHED,A(1/0)),f.on(Ql.ERROR,(e,s)=>{if(!this.schedule)return;const r=this.getAssetPlayer(h);if(s.details===Gl.BUFFER_STALLED_ERROR)return null!=r&&r.appendInPlace?void this.handleInPlaceStall(t):(this.onTimeupdate(),void this.checkBuffer(!0));this.handleAssetItemError(s,t,this.schedule.findEventIndex(t.identifier),i,`Asset player error ${s.error} ${t}`)}),f.on(Ql.DESTROYING,()=>{if(!this.getAssetPlayer(h)||!this.schedule)return;const e=new Error(`Asset player destroyed unexpectedly ${h}`),s={fatal:!0,type:Vl.OTHER_ERROR,details:Gl.INTERSTITIAL_ASSET_ITEM_ERROR,error:e};this.handleAssetItemError(s,t,this.schedule.findEventIndex(t.identifier),i,e.message)}),this.log(`INTERSTITIAL_ASSET_PLAYER_CREATED ${yp(e)}`),this.hls.trigger(Ql.INTERSTITIAL_ASSET_PLAYER_CREATED,{asset:e,assetListIndex:i,event:t,player:f}),f}clearInterstitial(t,e){this.clearAssetPlayers(t,e),t.reset()}clearAssetPlayers(t,e){t.assetList.forEach(t=>{this.clearAssetPlayer(t.identifier,e)})}resetAssetPlayer(t){const e=this.getAssetPlayerQueueIndex(t);if(-1!==e){this.log(`reset asset player "${t}" after error`);const i=this.playerQueue[e];this.transferMediaFromPlayer(i,null),i.resetDetails()}}clearAssetPlayer(t,e){const i=this.getAssetPlayerQueueIndex(t);if(-1!==i){const t=this.playerQueue[i];this.log(`clear ${t} toSegment: ${e?Sp(e):e}`),this.transferMediaFromPlayer(t,e),this.playerQueue.splice(i,1),t.destroy()}}emptyPlayerQueue(){let t;for(;t=this.playerQueue.pop();)t.destroy();this.playerQueue=[]}startAssetPlayer(t,e,i,s,r){const{interstitial:n,assetItem:a,assetId:o}=t,l=n.assetList.length,d=this.playingAsset;this.endedAsset=null,this.playingAsset=a,d&&d.identifier===o||(d&&(this.clearAssetPlayer(d.identifier,i[s]),delete d.error),this.log(`INTERSTITIAL_ASSET_STARTED ${e+1}/${l} ${yp(a)}`),this.hls.trigger(Ql.INTERSTITIAL_ASSET_STARTED,{asset:a,assetListIndex:e,event:n,schedule:i.slice(0),scheduleIndex:s,player:t})),this.bufferAssetPlayer(t,r)}bufferAssetPlayer(t,e){var i,s;if(!this.schedule)return;const{interstitial:r,assetItem:n}=t,a=this.schedule.findEventIndex(r.identifier),o=null==(i=this.schedule.items)?void 0:i[a];if(!o)return;t.loadSource(),this.setBufferingItem(o),this.bufferingAsset=n;const l=this.getBufferingPlayer();if(l===t)return;const d=r.appendInPlace;if(d&&!1===(null==l?void 0:l.interstitial.appendInPlace))return;const h=(null==l?void 0:l.tracks)||(null==(s=this.detachedData)?void 0:s.tracks)||this.requiredTracks;if(d&&n!==this.playingAsset){if(!t.tracks)return void this.log(`Waiting for track info before buffering ${t}`);if(h&&!ud(h,t.tracks)){const e=new Error(`Asset ${yp(n)} SourceBuffer tracks ('${Object.keys(t.tracks)}') are not compatible with primary content tracks ('${Object.keys(h)}')`),i={fatal:!0,type:Vl.OTHER_ERROR,details:Gl.INTERSTITIAL_ASSET_ITEM_ERROR,error:e},s=r.findAssetIndex(n);return void this.handleAssetItemError(i,r,a,s,e.message)}}this.transferMediaTo(t,e)}handleInPlaceStall(t){const e=this.schedule,i=this.primaryMedia;if(!e||!i)return;const s=i.currentTime,r=e.findAssetIndex(t,s),n=t.assetList[r];if(n){const a=this.getAssetPlayer(n.identifier);if(a){const o=a.currentTime||s-n.timelineStart,l=a.duration-o;if(this.warn(`Stalled at ${o} of ${o+l} in ${a} ${t} (media.currentTime: ${s})`),o&&(l/i.playbackRate<.5||a.bufferedInPlaceToEnd(i))&&a.hls){const i=e.findEventIndex(t.identifier);this.advanceAfterAssetEnded(t,i,r)}}}}advanceInPlace(t){const e=this.primaryMedia;e&&e.currentTime<t&&(e.currentTime=t)}handleAssetItemError(t,e,i,s,r){if(t.details===Gl.BUFFER_STALLED_ERROR)return;const n=e.assetList[s]||null;if(this.warn(`INTERSTITIAL_ASSET_ERROR ${n?yp(n):n} ${t.error}`),!this.schedule)return;const a=(null==n?void 0:n.identifier)||"",o=this.getAssetPlayerQueueIndex(a),l=this.playerQueue[o]||null,d=this.schedule.items,h=ed({},t,{fatal:!1,errorAction:mc(!0),asset:n,assetListIndex:s,event:e,schedule:d,scheduleIndex:i,player:l});if(this.hls.trigger(Ql.INTERSTITIAL_ASSET_ERROR,h),!t.fatal)return;const c=this.playingAsset,u=this.bufferingAsset,f=new Error(r);if(n&&(this.clearAssetPlayer(a,null),n.error=f),e.assetList.some(t=>!t.error))for(let g=s;g<e.assetList.length;g++)this.resetAssetPlayer(e.assetList[g].identifier);else e.error=f;this.updateSchedule(!0),e.error?this.primaryFallback(e):c&&c.identifier===a?this.advanceAfterAssetEnded(e,i,s):u&&u.identifier===a&&this.isInterstitial(this.bufferingItem)&&this.advanceAssetBuffering(this.bufferingItem,u)}primaryFallback(t){const e=t.timelineStart,i=this.effectivePlayingItem;let s=this.timelinePos;if(i){this.log(`Fallback to primary from event "${t.identifier}" start: ${e} pos: ${s} playing: ${Sp(i)} error: ${t.error}`),-1===s&&(s=this.hls.startPosition);const r=this.updateItem(i,s);this.itemsMatch(i,r)&&this.clearInterstitial(t,null),t.appendInPlace&&(this.attachPrimary(e,null),this.flushFrontBuffer(e))}else if(-1===s)return void this.checkStart();if(!this.schedule)return;const r=this.schedule.findItemIndexAtTime(s);this.setSchedulePosition(r)}onAssetListLoaded(t,e){var i,s;const r=e.event,n=r.identifier,a=e.assetListResponse.ASSETS;if(null==(i=this.schedule)||!i.hasEvent(n))return;const o=r.timelineStart,l=r.duration;let d=0;a.forEach((t,e)=>{const i=parseFloat(t.DURATION);this.createAsset(r,e,d,o+d,i,t.URI),d+=i}),r.duration=d,this.log(`Loaded asset-list with duration: ${d} (was: ${l}) ${r}`);const h=this.waitingItem,c=(null==h?void 0:h.event.identifier)===n;this.updateSchedule();const u=null==(s=this.bufferingItem)?void 0:s.event;if(c){var f;const t=this.schedule.findEventIndex(n),e=null==(f=this.schedule.items)?void 0:f[t];if(e){if(!this.playingItem&&this.timelinePos>e.end){if(this.schedule.findItemIndexAtTime(this.timelinePos)!==t)return r.error=new Error(`Interstitial ${a.length?"no longer within playback range":"asset-list is empty"} ${this.timelinePos} ${r}`),this.log(r.error.message),this.updateSchedule(!0),void this.primaryFallback(r)}this.setBufferingItem(e)}this.setSchedulePosition(t)}else if((null==u?void 0:u.identifier)===n){const t=r.assetList[0];if(t){const e=this.getAssetPlayer(t.identifier);if(u.appendInPlace){const t=this.primaryMedia;e&&t&&this.bufferAssetPlayer(e,t)}else e&&e.loadSource()}}}onError(t,e){if(this.schedule)switch(e.details){case Gl.ASSET_LIST_PARSING_ERROR:case Gl.ASSET_LIST_LOAD_ERROR:case Gl.ASSET_LIST_LOAD_TIMEOUT:{const t=e.interstitial;t&&(this.updateSchedule(!0),this.primaryFallback(t));break}case Gl.BUFFER_STALLED_ERROR:{const t=this.endedItem||this.waitingItem||this.playingItem;if(this.isInterstitial(t)&&t.event.appendInPlace)return void this.handleInPlaceStall(t.event);this.log(`Primary player stall @${this.timelinePos} bufferedPos: ${this.bufferedPos}`),this.onTimeupdate(),this.checkBuffer(!0);break}}}}});function CA(t){return t&&"object"==typeof t?Array.isArray(t)?t.map(CA):Object.keys(t).reduce((e,i)=>(e[i]=CA(t[i]),e),{}):t}function xA(t,e){const i=t.loader;if(i!==IA&&i!==wA)e.log("[config]: Custom loader detected, cannot enable progressive streaming"),t.progressive=!1;else{(function(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(t){}return!1})()&&(t.loader=IA,t.progressive=!0,t.enableSoftwareAES=!0,e.log("[config]: Progressive streaming enabled, using FetchLoader"))}}class PA extends Bc{constructor(t,e){super("gap-controller",t.logger),this.hls=void 0,this.fragmentTracker=void 0,this.media=null,this.mediaSource=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.buffered={},this.lastCurrentTime=0,this.ended=0,this.waiting=0,this.onMediaPlaying=()=>{this.ended=0,this.waiting=0},this.onMediaWaiting=()=>{var t;null!=(t=this.media)&&t.seeking||(this.waiting=self.performance.now(),this.tick())},this.onMediaEnded=()=>{var t;this.hls&&(this.ended=(null==(t=this.media)?void 0:t.currentTime)||1,this.hls.trigger(Ql.MEDIA_ENDED,{stalled:!1}))},this.hls=t,this.fragmentTracker=e,this.registerListeners()}registerListeners(){const{hls:t}=this;t&&(t.on(Ql.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(Ql.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(Ql.BUFFER_APPENDED,this.onBufferAppended,this))}unregisterListeners(){const{hls:t}=this;t&&(t.off(Ql.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(Ql.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(Ql.BUFFER_APPENDED,this.onBufferAppended,this))}destroy(){super.destroy(),this.unregisterListeners(),this.media=this.hls=this.fragmentTracker=null,this.mediaSource=void 0}onMediaAttached(t,e){this.setInterval(100),this.mediaSource=e.mediaSource;const i=this.media=e.media;ef(i,"playing",this.onMediaPlaying),ef(i,"waiting",this.onMediaWaiting),ef(i,"ended",this.onMediaEnded)}onMediaDetaching(t,e){this.clearInterval();const{media:i}=this;i&&(sf(i,"playing",this.onMediaPlaying),sf(i,"waiting",this.onMediaWaiting),sf(i,"ended",this.onMediaEnded),this.media=null),this.mediaSource=void 0}onBufferAppended(t,e){this.buffered=e.timeRanges}get hasBuffered(){return Object.keys(this.buffered).length>0}tick(){var t;if(null==(t=this.media)||!t.readyState||!this.hasBuffered)return;const e=this.media.currentTime;this.poll(e,this.lastCurrentTime),this.lastCurrentTime=e}poll(t,e){var i,s;const r=null==(i=this.hls)?void 0:i.config;if(!r)return;const n=this.media;if(!n)return;const{seeking:a}=n,o=this.seeking&&!a,l=!this.seeking&&a,d=n.paused&&!a||n.ended||0===n.playbackRate;if(this.seeking=a,t!==e)return e&&(this.ended=0),this.moved=!0,a||(this.nudgeRetry=0,r.nudgeOnVideoHole&&!d&&t>e&&this.nudgeOnVideoHole(t,e)),void(0===this.waiting&&this.stallResolved(t));if(l||o)return void(o&&this.stallResolved(t));if(d)return this.nudgeRetry=0,this.stallResolved(t),void(!this.ended&&n.ended&&this.hls&&(this.ended=t||1,this.hls.trigger(Ql.MEDIA_ENDED,{stalled:!1})));if(!_c.getBuffered(n).length)return void(this.nudgeRetry=0);const h=_c.bufferInfo(n,t,0),c=h.nextStart||0,u=this.fragmentTracker;if(a&&u&&this.hls){const e=MA(this.hls.inFlightFragments,t),i=h.len>2,s=!c||e||c-t>2&&!u.getPartialFragment(t);if(i||s)return;this.moved=!1}const f=null==(s=this.hls)?void 0:s.latestLevelDetails;if(!this.moved&&null!==this.stalled&&u){if(!(h.len>0)&&!c)return;const e=Math.max(c,h.start||0)-t,i=!(null==f||!f.live)?2*f.targetduration:2,s=BA(t,u);if(e>0&&(e<=i||s))return void(n.paused||this._trySkipBufferHole(s))}const g=r.detectStallWithCurrentTimeMs,m=self.performance.now(),p=this.waiting;let A=this.stalled;if(null===A){if(!(p>0&&m-p<g))return void(this.stalled=m);A=this.stalled=p}const v=m-A;if(!a&&(v>=g||p)&&this.hls){var y;if("ended"===(null==(y=this.mediaSource)?void 0:y.readyState)&&(null==f||!f.live)&&Math.abs(t-((null==f?void 0:f.edge)||0))<1){if(this.ended)return;return this.ended=t||1,void this.hls.trigger(Ql.MEDIA_ENDED,{stalled:!0})}if(this._reportStall(h),!this.media||!this.hls)return}const E=_c.bufferInfo(n,t,r.maxBufferHole);this._tryFixBufferStall(E,v,t)}stallResolved(t){const e=this.stalled;if(e&&this.hls&&(this.stalled=null,this.stallReported)){const i=self.performance.now()-e;this.log(`playback not stuck anymore @${t}, after ${Math.round(i)}ms`),this.stallReported=!1,this.waiting=0,this.hls.trigger(Ql.STALL_RESOLVED,{})}}nudgeOnVideoHole(t,e){var i;const s=this.buffered.video;if(this.hls&&this.media&&this.fragmentTracker&&null!=(i=this.buffered.audio)&&i.length&&s&&s.length>1&&t>s.end(0)){const i=_c.bufferedInfo(_c.timeRangesToArray(this.buffered.audio),t,0);if(i.len>1&&e>=i.start){const i=_c.timeRangesToArray(s),r=_c.bufferedInfo(i,e,0).bufferedIndex;if(r>-1&&r<i.length-1){const e=_c.bufferedInfo(i,t,0).bufferedIndex,s=i[r].end,n=i[r+1].start;if((-1===e||e>r)&&n-s<1&&t-s<2){const i=new Error(`nudging playhead to flush pipeline after video hole. currentTime: ${t} hole: ${s} -> ${n} buffered index: ${e}`);this.warn(i.message),this.media.currentTime+=1e-6;let r=BA(t,this.fragmentTracker);r&&"fragment"in r?r=r.fragment:r||(r=void 0);const a=_c.bufferInfo(this.media,t,0);this.hls.trigger(Ql.ERROR,{type:Vl.MEDIA_ERROR,details:Gl.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:i,reason:i.message,frag:r,buffer:a.len,bufferInfo:a})}}}}}_tryFixBufferStall(t,e,i){var s,r;const{fragmentTracker:n,media:a}=this,o=null==(s=this.hls)?void 0:s.config;if(!a||!n||!o)return;const l=null==(r=this.hls)?void 0:r.latestLevelDetails,d=BA(i,n);if(d||null!=l&&l.live&&i<l.fragmentStart){if(this._trySkipBufferHole(d)||!this.media)return}const h=t.buffered,c=this.adjacentTraversal(t,i);(h&&h.length>1&&t.len>o.maxBufferHole||t.nextStart&&(t.nextStart-i<o.maxBufferHole||c))&&(e>1e3*o.highBufferWatchdogPeriod||this.waiting)&&(this.warn("Trying to nudge playhead over buffer-hole"),this._tryNudgeBuffer(t))}adjacentTraversal(t,e){const i=this.fragmentTracker,s=t.nextStart;if(i&&s){const t=i.getFragAtPos(e,$l),r=i.getFragAtPos(s,$l);if(t&&r)return r.sn-t.sn<2}return!1}_reportStall(t){const{hls:e,media:i,stallReported:s,stalled:r}=this;if(!s&&null!==r&&i&&e){this.stallReported=!0;const s=new Error(`Playback stalling at @${i.currentTime} due to low buffer (${Uh(t)})`);this.warn(s.message),e.trigger(Ql.ERROR,{type:Vl.MEDIA_ERROR,details:Gl.BUFFER_STALLED_ERROR,fatal:!1,error:s,buffer:t.len,bufferInfo:t,stalled:{start:r}})}}_trySkipBufferHole(t){var e;const{fragmentTracker:i,media:s}=this,r=null==(e=this.hls)?void 0:e.config;if(!s||!i||!r)return 0;const n=s.currentTime,a=_c.bufferInfo(s,n,0),o=n<a.start?a.start:a.nextStart;if(o&&this.hls){const e=a.len<=r.maxBufferHole,d=a.len>0&&a.len<1&&s.readyState<3,h=o-n;if(h>0&&(e||d)){if(h>r.maxBufferHole){let e=!1;if(0===n){const t=i.getAppendedFrag(0,$l);t&&o<t.end&&(e=!0)}if(!e&&t){var l;if(null==(l=this.hls.loadLevelObj)||!l.details)return 0;if(MA(this.hls.inFlightFragments,o))return 0;let e=!1,s=t.end;for(;s<o;){const t=BA(s,i);if(!t){e=!0;break}s+=t.duration}if(e)return 0}}const e=Math.max(o+.05,n+.1);if(this.warn(`skipping hole, adjusting currentTime from ${n} to ${e}`),this.moved=!0,s.currentTime=e,null==t||!t.gap){const i=new Error(`fragment loaded with buffer holes, seeking from ${n} to ${e}`),s={type:Vl.MEDIA_ERROR,details:Gl.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:i,reason:i.message,buffer:a.len,bufferInfo:a};t&&("fragment"in t?s.part=t:s.frag=t),this.hls.trigger(Ql.ERROR,s)}return e}}return 0}_tryNudgeBuffer(t){const{hls:e,media:i,nudgeRetry:s}=this,r=null==e?void 0:e.config;if(!i||!r)return 0;const n=i.currentTime;if(this.nudgeRetry++,s<r.nudgeMaxRetry){const a=n+(s+1)*r.nudgeOffset,o=new Error(`Nudging 'currentTime' from ${n} to ${a}`);this.warn(o.message),i.currentTime=a,e.trigger(Ql.ERROR,{type:Vl.MEDIA_ERROR,details:Gl.BUFFER_NUDGE_ON_STALL,error:o,fatal:!1,buffer:t.len,bufferInfo:t})}else{const i=new Error(`Playhead still not moving while enough data buffered @${n} after ${r.nudgeMaxRetry} nudges`);this.error(i.message),e.trigger(Ql.ERROR,{type:Vl.MEDIA_ERROR,details:Gl.BUFFER_STALLED_ERROR,error:i,fatal:!0,buffer:t.len,bufferInfo:t})}}}function MA(t,e){const i=OA(t.main);if(i&&i.start<=e)return i;const s=OA(t.audio);return s&&s.start<=e?s:null}function OA(t){if(!t)return null;switch(t.state){case af:case nf:case ff:case gf:return null}return t.frag}function BA(t,e){return e.getAppendedFrag(t,$l)||e.getPartialFragment(t)}function FA(){if("undefined"!=typeof self)return self.VTTCue||self.TextTrackCue}function NA(t,e,i,s,r){let n=new t(e,i,"");try{n.value=s,r&&(n.type=r)}catch(a){n=new t(e,i,Uh(r?sd({type:r},s):s))}return n}const _A=(()=>{const t=FA();try{t&&new t(0,Number.POSITIVE_INFINITY,"")}catch(e){return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();class UA{constructor(t){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.removeCues=!0,this.assetCue=void 0,this.onEventCueEnter=()=>{this.hls&&this.hls.trigger(Ql.EVENT_CUE_ENTER,{})},this.hls=t,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=this.onEventCueEnter=null}_registerListeners(){const{hls:t}=this;t&&(t.on(Ql.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(Ql.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(Ql.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(Ql.MANIFEST_LOADING,this.onManifestLoading,this),t.on(Ql.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),t.on(Ql.BUFFER_FLUSHING,this.onBufferFlushing,this),t.on(Ql.LEVEL_UPDATED,this.onLevelUpdated,this),t.on(Ql.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this))}_unregisterListeners(){const{hls:t}=this;t&&(t.off(Ql.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(Ql.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(Ql.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(Ql.MANIFEST_LOADING,this.onManifestLoading,this),t.off(Ql.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),t.off(Ql.BUFFER_FLUSHING,this.onBufferFlushing,this),t.off(Ql.LEVEL_UPDATED,this.onLevelUpdated,this),t.off(Ql.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this))}onMediaAttaching(t,e){var i;this.media=e.media,!1===(null==(i=e.overrides)?void 0:i.cueRemoval)&&(this.removeCues=!1)}onMediaAttached(){var t;const e=null==(t=this.hls)?void 0:t.latestLevelDetails;e&&this.updateDateRangeCues(e)}onMediaDetaching(t,e){this.media=null;!!e.transferMedia||(this.id3Track&&(this.removeCues&&lp(this.id3Track,this.onEventCueEnter),this.id3Track=null),this.dateRangeCuesAppended={})}onManifestLoading(){this.dateRangeCuesAppended={}}createTrack(t){const e=this.getID3Track(t.textTracks);return e.mode="hidden",e}getID3Track(t){if(this.media){for(let e=0;e<t.length;e++){const i=t[e];if("metadata"===i.kind&&"id3"===i.label)return ap(i,this.media),i}return this.media.addTextTrack("metadata","id3")}}onFragParsingMetadata(t,e){if(!this.media||!this.hls)return;const{enableEmsgMetadataCues:i,enableID3MetadataCues:s}=this.hls.config;if(!i&&!s)return;const{samples:r}=e;this.id3Track||(this.id3Track=this.createTrack(this.media));const n=FA();if(n)for(let a=0;a<r.length;a++){const t=r[a].type;if(t===Wf.emsg&&!i||!s)continue;const e=Gf(r[a].data),o=r[a].pts;let l=o+r[a].duration;l>_A&&(l=_A);l-o<=0&&(l=o+.25);for(let i=0;i<e.length;i++){const s=e[i];if(!Qf(s)){this.updateId3CueEnds(o,t);const e=NA(n,o,l,s,t);e&&this.id3Track.addCue(e)}}}}updateId3CueEnds(t,e){var i;const s=null==(i=this.id3Track)?void 0:i.cues;if(s)for(let r=s.length;r--;){const i=s[r];i.type===e&&i.startTime<t&&i.endTime===_A&&(i.endTime=t)}}onBufferFlushing(t,{startOffset:e,endOffset:i,type:s}){const{id3Track:r,hls:n}=this;if(!n)return;const{config:{enableEmsgMetadataCues:a,enableID3MetadataCues:o}}=n;if(r&&(a||o)){let t;t="audio"===s?t=>t.type===Wf.audioId3&&o:"video"===s?t=>t.type===Wf.emsg&&a:t=>t.type===Wf.audioId3&&o||t.type===Wf.emsg&&a,dp(r,e,i,t)}}onLevelUpdated(t,{details:e}){this.updateDateRangeCues(e,!0)}onLevelPtsUpdated(t,e){Math.abs(e.drift)>.01&&this.updateDateRangeCues(e.details)}updateDateRangeCues(t,e){if(!this.hls||!this.media)return;const{assetPlayerId:i,timelineOffset:s,enableDateRangeMetadataCues:r,interstitialsController:n}=this.hls.config;if(!r)return;const a=FA();if(i&&s&&!n){const{fragmentStart:e,fragmentEnd:s}=t;let r=this.assetCue;r?(r.startTime=e,r.endTime=s):a&&(r=this.assetCue=NA(a,e,s,{assetPlayerId:this.hls.config.assetPlayerId},"hlsjs.interstitial.asset"),r&&(r.id=i,this.id3Track||(this.id3Track=this.createTrack(this.media)),this.id3Track.addCue(r),r.addEventListener("enter",this.onEventCueEnter)))}if(!t.hasProgramDateTime)return;const{id3Track:o}=this,{dateRanges:l}=t,d=Object.keys(l);let h=this.dateRangeCuesAppended;var c;if(o&&e)if(null!=(c=o.cues)&&c.length){const t=Object.keys(h).filter(t=>!d.includes(t));for(let e=t.length;e--;){var u;const i=t[e],s=null==(u=h[i])?void 0:u.cues;delete h[i],s&&Object.keys(s).forEach(t=>{const e=s[t];if(e){e.removeEventListener("enter",this.onEventCueEnter);try{o.removeCue(e)}catch(i){}}})}}else h=this.dateRangeCuesAppended={};const f=t.fragments[t.fragments.length-1];if(0!==d.length&&Ul(null==f?void 0:f.programDateTime)){this.id3Track||(this.id3Track=this.createTrack(this.media));for(let t=0;t<d.length;t++){const e=d[t],i=l[e],s=i.startTime,r=h[e],o=(null==r?void 0:r.cues)||{};let c=(null==r?void 0:r.durationKnown)||!1,u=_A;const{duration:f,endDate:g}=i;if(g&&null!==f)u=s+f,c=!0;else if(i.endOnNext&&!c){const t=d.reduce((t,e)=>{if(e!==i.id){const s=l[e];if(s.class===i.class&&s.startDate>i.startDate&&(!t||i.startDate<t.startDate))return s}return t},null);t&&(u=t.startTime,c=!0)}const m=Object.keys(i.attr);for(let t=0;t<m.length;t++){const l=m[t];if(!Wc(l))continue;const d=o[l];if(d)!c||null!=r&&r.durationKnown?Math.abs(d.startTime-s)>.01&&(d.startTime=s,d.endTime=u):d.endTime=u;else if(a){let t=i.attr[l];Yc(l)&&(t=md(t));const r=NA(a,s,u,{key:l,data:t},Wf.dateRange);r&&(r.id=e,this.id3Track.addCue(r),o[l]=r,n&&("X-ASSET-LIST"!==l&&"X-ASSET-URL"!==l||r.addEventListener("enter",this.onEventCueEnter)))}}h[e]={cues:o,dateRange:i,durationKnown:c}}}}}class HA{constructor(t){this.hls=void 0,this.config=void 0,this.media=null,this.currentTime=0,this.stallCount=0,this._latency=null,this._targetLatencyUpdated=!1,this.onTimeupdate=()=>{const{media:t}=this,e=this.levelDetails;if(!t||!e)return;this.currentTime=t.currentTime;const i=this.computeLatency();if(null===i)return;this._latency=i;const{lowLatencyMode:s,maxLiveSyncPlaybackRate:r}=this.config;if(!s||1===r||!e.live)return;const n=this.targetLatency;if(null===n)return;const a=i-n;if(a<Math.min(this.maxLatency,n+e.targetduration)&&a>.05&&this.forwardBufferLength>1){const e=Math.min(2,Math.max(1,r)),i=Math.round(2/(1+Math.exp(-.75*a-this.edgeStalled))*20)/20,s=Math.min(e,Math.max(1,i));this.changeMediaPlaybackRate(t,s)}else 1!==t.playbackRate&&0!==t.playbackRate&&this.changeMediaPlaybackRate(t,1)},this.hls=t,this.config=t.config,this.registerListeners()}get levelDetails(){var t;return(null==(t=this.hls)?void 0:t.latestLevelDetails)||null}get latency(){return this._latency||0}get maxLatency(){const{config:t}=this;if(void 0!==t.liveMaxLatencyDuration)return t.liveMaxLatencyDuration;const e=this.levelDetails;return e?t.liveMaxLatencyDurationCount*e.targetduration:0}get targetLatency(){const t=this.levelDetails;if(null===t||null===this.hls)return null;const{holdBack:e,partHoldBack:i,targetduration:s}=t,{liveSyncDuration:r,liveSyncDurationCount:n,lowLatencyMode:a}=this.config,o=this.hls.userConfig;let l=a&&i||e;(this._targetLatencyUpdated||o.liveSyncDuration||o.liveSyncDurationCount||0===l)&&(l=void 0!==r?r:n*s);const d=s;return l+Math.min(this.stallCount*this.config.liveSyncOnStallIncrease,d)}set targetLatency(t){this.stallCount=0,this.config.liveSyncDuration=t,this._targetLatencyUpdated=!0}get liveSyncPosition(){const t=this.estimateLiveEdge(),e=this.targetLatency;if(null===t||null===e)return null;const i=this.levelDetails;if(null===i)return null;const s=i.edge,r=t-e-this.edgeStalled,n=s-i.totalduration,a=s-(this.config.lowLatencyMode&&i.partTarget||i.targetduration);return Math.min(Math.max(n,r),a)}get drift(){const t=this.levelDetails;return null===t?1:t.drift}get edgeStalled(){const t=this.levelDetails;if(null===t)return 0;const e=3*(this.config.lowLatencyMode&&t.partTarget||t.targetduration);return Math.max(t.age-e,0)}get forwardBufferLength(){const{media:t}=this,e=this.levelDetails;if(!t||!e)return 0;const i=t.buffered.length;return(i?t.buffered.end(i-1):e.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.hls=null}registerListeners(){const{hls:t}=this;t&&(t.on(Ql.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(Ql.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(Ql.MANIFEST_LOADING,this.onManifestLoading,this),t.on(Ql.LEVEL_UPDATED,this.onLevelUpdated,this),t.on(Ql.ERROR,this.onError,this))}unregisterListeners(){const{hls:t}=this;t&&(t.off(Ql.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(Ql.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(Ql.MANIFEST_LOADING,this.onManifestLoading,this),t.off(Ql.LEVEL_UPDATED,this.onLevelUpdated,this),t.off(Ql.ERROR,this.onError,this))}onMediaAttached(t,e){this.media=e.media,this.media.addEventListener("timeupdate",this.onTimeupdate)}onMediaDetaching(){this.media&&(this.media.removeEventListener("timeupdate",this.onTimeupdate),this.media=null)}onManifestLoading(){this._latency=null,this.stallCount=0}onLevelUpdated(t,{details:e}){e.advanced&&this.onTimeupdate(),!e.live&&this.media&&this.media.removeEventListener("timeupdate",this.onTimeupdate)}onError(t,e){var i;e.details===Gl.BUFFER_STALLED_ERROR&&(this.stallCount++,this.hls&&null!=(i=this.levelDetails)&&i.live&&this.hls.logger.warn("[latency-controller]: Stall detected, adjusting target latency"))}changeMediaPlaybackRate(t,e){var i,s;t.playbackRate!==e&&(null==(i=this.hls)||i.logger.debug(`[latency-controller]: latency=${this.latency.toFixed(3)}, targetLatency=${null==(s=this.targetLatency)?void 0:s.toFixed(3)}, forwardBufferLength=${this.forwardBufferLength.toFixed(3)}: adjusting playback rate from ${t.playbackRate} to ${e}`),t.playbackRate=e)}estimateLiveEdge(){const t=this.levelDetails;return null===t?null:t.edge+t.age}computeLatency(){const t=this.estimateLiveEdge();return null===t?null:t-this.currentTime}}class jA extends $g{constructor(t,e){super(t,"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=e,this._registerListeners()}_registerListeners(){const{hls:t}=this;t.on(Ql.MANIFEST_LOADING,this.onManifestLoading,this),t.on(Ql.MANIFEST_LOADED,this.onManifestLoaded,this),t.on(Ql.LEVEL_LOADED,this.onLevelLoaded,this),t.on(Ql.LEVELS_UPDATED,this.onLevelsUpdated,this),t.on(Ql.FRAG_BUFFERED,this.onFragBuffered,this),t.on(Ql.ERROR,this.onError,this)}_unregisterListeners(){const{hls:t}=this;t.off(Ql.MANIFEST_LOADING,this.onManifestLoading,this),t.off(Ql.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(Ql.LEVEL_LOADED,this.onLevelLoaded,this),t.off(Ql.LEVELS_UPDATED,this.onLevelsUpdated,this),t.off(Ql.FRAG_BUFFERED,this.onFragBuffered,this),t.off(Ql.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(t,e){this.resetLevels()}onManifestLoaded(t,e){const i=this.hls.config.preferManagedMediaSource,s=[],r={},n={};let a=!1,o=!1,l=!1;e.levels.forEach(t=>{const e=t.attrs;let{audioCodec:d,videoCodec:h}=t;d&&(t.audioCodec=d=ph(d,i)||void 0),h&&(h=t.videoCodec=function(t){const e=t.split(",");for(let i=0;i<e.length;i++){const t=e[i].split(".");t.length>2&&"avc1"===t[0]&&(e[i]=`avc1.${parseInt(t[1]).toString(16)}${("000"+parseInt(t[2]).toString(16)).slice(-4)}`)}return e.join(",")}(h));const{width:c,height:u,unknownCodecs:f}=t,g=(null==f?void 0:f.length)||0;if(a||(a=!(!c||!u)),o||(o=!!h),l||(l=!!d),g||d&&!this.isAudioSupported(d)||h&&!this.isVideoSupported(h))return void this.log(`Some or all CODECS not supported "${e.CODECS}"`);const{CODECS:m,"FRAME-RATE":p,"HDCP-LEVEL":A,"PATHWAY-ID":v,RESOLUTION:y,"VIDEO-RANGE":E}=e,T=`${`${v||"."}-`}${t.bitrate}-${y}-${p}-${m}-${E}-${A}`;if(r[T])if(r[T].uri===t.url||t.attrs["PATHWAY-ID"])r[T].addGroupId("audio",e.AUDIO),r[T].addGroupId("text",e.SUBTITLES);else{const e=n[T]+=1;t.attrs["PATHWAY-ID"]=new Array(e+1).join(".");const i=this.createLevel(t);r[T]=i,s.push(i)}else{const e=this.createLevel(t);r[T]=e,n[T]=1,s.push(e)}}),this.filterAndSortMediaOptions(s,e,a,o,l)}createLevel(t){const e=new Fh(t),i=t.supplemental;if(null!=i&&i.videoCodec&&!this.isVideoSupported(i.videoCodec)){const t=new Error(`SUPPLEMENTAL-CODECS not supported "${i.videoCodec}"`);this.log(t.message),e.supportedResult=Ih(t,[])}return e}isAudioSupported(t){return dh(t,"audio",this.hls.config.preferManagedMediaSource)}isVideoSupported(t){return dh(t,"video",this.hls.config.preferManagedMediaSource)}filterAndSortMediaOptions(t,e,i,s,r){var n;let a=[],o=[],l=t;const d=(null==(n=e.stats)?void 0:n.parsing)||{};if((i||s)&&r&&(l=l.filter(({videoCodec:t,videoRange:e,width:i,height:s})=>{return(!!t||!(!i||!s))&&(!!(r=e)&&Ch.indexOf(r)>-1);var r})),0===l.length)return Promise.resolve().then(()=>{if(this.hls){let t="no level with compatible codecs found in manifest",i=t;e.levels.length&&(i=`one or more CODECS in variant not supported: ${Uh(e.levels.map(t=>t.attrs.CODECS).filter((t,e,i)=>i.indexOf(t)===e))}`,this.warn(i),t+=` (${i})`);const s=new Error(t);this.hls.trigger(Ql.ERROR,{type:Vl.MEDIA_ERROR,details:Gl.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:e.url,error:s,reason:i})}}),void(d.end=performance.now());e.audioTracks&&(a=e.audioTracks.filter(t=>!t.audioCodec||this.isAudioSupported(t.audioCodec)),VA(a)),e.subtitles&&(o=e.subtitles,VA(o));const h=l.slice(0);l.sort((t,e)=>{if(t.attrs["HDCP-LEVEL"]!==e.attrs["HDCP-LEVEL"])return(t.attrs["HDCP-LEVEL"]||"")>(e.attrs["HDCP-LEVEL"]||"")?1:-1;if(i&&t.height!==e.height)return t.height-e.height;if(t.frameRate!==e.frameRate)return t.frameRate-e.frameRate;if(t.videoRange!==e.videoRange)return Ch.indexOf(t.videoRange)-Ch.indexOf(e.videoRange);if(t.videoCodec!==e.videoCodec){const i=uh(t.videoCodec),s=uh(e.videoCodec);if(i!==s)return s-i}if(t.uri===e.uri&&t.codecSet!==e.codecSet){const i=fh(t.codecSet),s=fh(e.codecSet);if(i!==s)return s-i}return t.averageBitrate!==e.averageBitrate?t.averageBitrate-e.averageBitrate:0});let c=h[0];if(this.steering&&(l=this.steering.filterParsedLevels(l),l.length!==h.length))for(let A=0;A<h.length;A++)if(h[A].pathwayId===l[0].pathwayId){c=h[A];break}this._levels=l;for(let A=0;A<l.length;A++)if(l[A]===c){var u;this._firstLevel=A;const t=c.bitrate,e=this.hls.bandwidthEstimate;if(this.log(`manifest loaded, ${l.length} level(s) found, first bitrate: ${t}`),void 0===(null==(u=this.hls.userConfig)?void 0:u.abrEwmaDefaultEstimate)){const i=Math.min(t,this.hls.config.abrEwmaDefaultEstimateMax);i>e&&e===this.hls.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=i)}break}const f=r&&!s,g=this.hls.config,m=!(!g.audioStreamController||!g.audioTrackController),p={levels:l,audioTracks:a,subtitleTracks:o,sessionData:e.sessionData,sessionKeys:e.sessionKeys,firstLevel:this._firstLevel,stats:e.stats,audio:r,video:s,altAudio:m&&!f&&a.some(t=>!!t.url)};d.end=performance.now(),this.hls.trigger(Ql.MANIFEST_PARSED,p)}get levels(){return 0===this._levels.length?null:this._levels}get loadLevelObj(){return this.currentLevel}get level(){return this.currentLevelIndex}set level(t){const e=this._levels;if(0===e.length)return;if(t<0||t>=e.length){const i=new Error("invalid level idx"),s=t<0;if(this.hls.trigger(Ql.ERROR,{type:Vl.OTHER_ERROR,details:Gl.LEVEL_SWITCH_ERROR,level:t,fatal:s,error:i,reason:i.message}),s)return;t=Math.min(t,e.length-1)}const i=this.currentLevelIndex,s=this.currentLevel,r=s?s.attrs["PATHWAY-ID"]:void 0,n=e[t],a=n.attrs["PATHWAY-ID"];if(this.currentLevelIndex=t,this.currentLevel=n,i===t&&s&&r===a)return;this.log(`Switching to level ${t} (${n.height?n.height+"p ":""}${n.videoRange?n.videoRange+" ":""}${n.codecSet?n.codecSet+" ":""}@${n.bitrate})${a?" with Pathway "+a:""} from level ${i}${r?" with Pathway "+r:""}`);const o={level:t,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(Ql.LEVEL_SWITCHING,o);const l=n.details;if(!l||l.live){const t=this.switchParams(n.uri,null==s?void 0:s.details,l);this.loadPlaylist(t)}}get manualLevel(){return this.manualLevelIndex}set manualLevel(t){this.manualLevelIndex=t,void 0===this._startLevel&&(this._startLevel=t),-1!==t&&(this.level=t)}get firstLevel(){return this._firstLevel}set firstLevel(t){this._firstLevel=t}get startLevel(){if(void 0===this._startLevel){const t=this.hls.config.startLevel;return void 0!==t?t:this.hls.firstAutoLevel}return this._startLevel}set startLevel(t){this._startLevel=t}get pathways(){return this.steering?this.steering.pathways():[]}get pathwayPriority(){return this.steering?this.steering.pathwayPriority:null}set pathwayPriority(t){if(this.steering){const e=this.steering.pathways(),i=t.filter(t=>-1!==e.indexOf(t));if(t.length<1)return void this.warn(`pathwayPriority ${t} should contain at least one pathway from list: ${e}`);this.steering.pathwayPriority=i}}onError(t,e){!e.fatal&&e.context&&e.context.type===ql&&e.context.level===this.level&&this.checkRetry(e)}onFragBuffered(t,{frag:e}){if(void 0!==e&&e.type===$l){const t=e.elementaryStreams;if(!Object.keys(t).some(e=>!!t[e]))return;const i=this._levels[e.level];null!=i&&i.loadError&&(this.log(`Resetting level error count of ${i.loadError} on frag buffered`),i.loadError=0)}}onLevelLoaded(t,e){var i;const{level:s,details:r}=e,n=e.levelInfo;var a;if(!n)return this.warn(`Invalid level index ${s}`),void(null!=(a=e.deliveryDirectives)&&a.skip&&(r.deltaUpdateFailed=!0));if(n===this.currentLevel||e.withoutMultiVariant){0===n.fragmentError&&(n.loadError=0);let t=n.details;t===e.details&&t.advanced&&(t=void 0),this.playlistLoaded(s,e,t)}else null!=(i=e.deliveryDirectives)&&i.skip&&(r.deltaUpdateFailed=!0)}loadPlaylist(t){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentLevel)&&this.scheduleLoading(this.currentLevel,t)}loadingPlaylist(t,e){super.loadingPlaylist(t,e);const i=this.getUrlWithDirectives(t.uri,e),s=this.currentLevelIndex,r=t.attrs["PATHWAY-ID"],n=t.details,a=null==n?void 0:n.age;this.log(`Loading level index ${s}${void 0!==(null==e?void 0:e.msn)?" at sn "+e.msn+" part "+e.part:""}${r?" Pathway "+r:""}${a&&n.live?" age "+a.toFixed(1)+(n.type&&" "+n.type||""):""} ${i}`),this.hls.trigger(Ql.LEVEL_LOADING,{url:i,level:s,levelInfo:t,pathwayId:t.attrs["PATHWAY-ID"],id:0,deliveryDirectives:e||null})}get nextLoadLevel(){return-1!==this.manualLevelIndex?this.manualLevelIndex:this.hls.nextAutoLevel}set nextLoadLevel(t){this.level=t,-1===this.manualLevelIndex&&(this.hls.nextAutoLevel=t)}removeLevel(t){var e;if(1===this._levels.length)return;const i=this._levels.filter((e,i)=>i!==t||(this.steering&&this.steering.removeLevel(e),e===this.currentLevel&&(this.currentLevel=null,this.currentLevelIndex=-1,e.details&&e.details.fragments.forEach(t=>t.level=-1)),!1));Wu(i),this._levels=i,this.currentLevelIndex>-1&&null!=(e=this.currentLevel)&&e.details&&(this.currentLevelIndex=this.currentLevel.details.fragments[0].level),this.manualLevelIndex>-1&&(this.manualLevelIndex=this.currentLevelIndex);const s=i.length-1;this._firstLevel=Math.min(this._firstLevel,s),this._startLevel&&(this._startLevel=Math.min(this._startLevel,s)),this.hls.trigger(Ql.LEVELS_UPDATED,{levels:i})}onLevelsUpdated(t,{levels:e}){this._levels=e}checkMaxAutoUpdated(){const{autoLevelCapping:t,maxAutoLevel:e,maxHdcpLevel:i}=this.hls;this._maxAutoLevel!==e&&(this._maxAutoLevel=e,this.hls.trigger(Ql.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:t,levels:this.levels,maxAutoLevel:e,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:i}))}}function VA(t){const e={};t.forEach(t=>{const i=t.groupId||"";t.id=e[i]=e[i]||0,e[i]++})}function GA(){return self.SourceBuffer||self.WebKitSourceBuffer}function QA(){if(!cd())return!1;const t=GA();return!t||t.prototype&&"function"==typeof t.prototype.appendBuffer&&"function"==typeof t.prototype.remove}class KA extends Af{constructor(t,e,i){super(t,e,i,"stream-controller",$l),this.audioCodecSwap=!1,this.level=-1,this._forceStartLoad=!1,this._hasEnoughToStart=!1,this.altAudio=0,this.audioOnly=!1,this.fragPlaying=null,this.fragLastKbps=0,this.couldBacktrack=!1,this.backtrackFragment=null,this.audioCodecSwitch=!1,this.videoBuffer=null,this.onMediaPlaying=()=>{this.tick()},this.onMediaSeeked=()=>{const t=this.media,e=t?t.currentTime:null;if(null===e||!Ul(e))return;if(this.log(`Media seeked to ${e.toFixed(3)}`),!this.getBufferedFrag(e))return;const i=this.getFwdBufferInfoAtPos(t,e,$l,0);null!==i&&0!==i.len?this.tick():this.warn(`Main forward buffer length at ${e} on "seeked" event ${i?i.len:"empty"})`)},this.registerListeners()}registerListeners(){super.registerListeners();const{hls:t}=this;t.on(Ql.MANIFEST_PARSED,this.onManifestParsed,this),t.on(Ql.LEVEL_LOADING,this.onLevelLoading,this),t.on(Ql.LEVEL_LOADED,this.onLevelLoaded,this),t.on(Ql.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),t.on(Ql.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.on(Ql.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),t.on(Ql.BUFFER_CREATED,this.onBufferCreated,this),t.on(Ql.BUFFER_FLUSHED,this.onBufferFlushed,this),t.on(Ql.LEVELS_UPDATED,this.onLevelsUpdated,this),t.on(Ql.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){super.unregisterListeners();const{hls:t}=this;t.off(Ql.MANIFEST_PARSED,this.onManifestParsed,this),t.off(Ql.LEVEL_LOADED,this.onLevelLoaded,this),t.off(Ql.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),t.off(Ql.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.off(Ql.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),t.off(Ql.BUFFER_CREATED,this.onBufferCreated,this),t.off(Ql.BUFFER_FLUSHED,this.onBufferFlushed,this),t.off(Ql.LEVELS_UPDATED,this.onLevelsUpdated,this),t.off(Ql.FRAG_BUFFERED,this.onFragBuffered,this)}onHandlerDestroying(){this.onMediaPlaying=this.onMediaSeeked=null,this.unregisterListeners(),super.onHandlerDestroying()}startLoad(t,e){if(this.levels){const{lastCurrentTime:i,hls:s}=this;if(this.stopLoad(),this.setInterval(100),this.level=-1,!this.startFragRequested){let t=s.startLevel;-1===t&&(s.config.testBandwidth&&this.levels.length>1?(t=0,this.bitrateTest=!0):t=s.firstAutoLevel),s.nextLoadLevel=t,this.level=s.loadLevel,this._hasEnoughToStart=!!e}i>0&&-1===t&&!e&&(this.log(`Override startPosition with lastCurrentTime @${i.toFixed(3)}`),t=i),this.state=af,this.nextLoadPosition=this.lastCurrentTime=t+this.timelineOffset,this.startPosition=e?-1:t,this.tick()}else this._forceStartLoad=!0,this.state=nf}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case pf:{const{levels:t,level:e}=this,i=null==t?void 0:t[e],s=null==i?void 0:i.details;if(s&&(!s.live||this.levelLastLoaded===i&&!this.waitForLive(i))){if(this.waitForCdnTuneIn(s))break;this.state=af;break}if(this.hls.nextLoadLevel!==this.level){this.state=af;break}break}case df:this.checkRetryDate()}this.state===af&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){var t;super.onTickEnd(),null!=(t=this.media)&&t.readyState&&!1===this.media.seeking&&(this.lastCurrentTime=this.media.currentTime),this.checkFragmentChanged()}doTickIdle(){const{hls:t,levelLastLoaded:e,levels:i,media:s}=this;if(null===e||!s&&!this.primaryPrefetch&&(this.startFragRequested||!t.config.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;const r=this.buffering?t.nextLoadLevel:t.loadLevel;if(null==i||!i[r])return;const n=i[r],a=this.getMainFwdBufferInfo();if(null===a)return;const o=this.getLevelDetails();if(o&&this._streamEnded(a,o)){const t={};return 2===this.altAudio&&(t.type="video"),this.hls.trigger(Ql.BUFFER_EOS,t),void(this.state=ff)}if(!this.buffering)return;t.loadLevel!==r&&-1===t.manualLevel&&this.log(`Adapting to level ${r} from level ${this.level}`),this.level=t.nextLoadLevel=r;const l=n.details;if(!l||this.state===pf||this.waitForLive(n))return this.level=r,this.state=pf,void(this.startFragRequested=!1);const d=a.len,h=this.getMaxBufferLength(n.maxBitrate);if(d>=h)return;this.backtrackFragment&&this.backtrackFragment.start>a.end&&(this.backtrackFragment=null);const c=this.backtrackFragment?this.backtrackFragment.start:a.end;let u=this.getNextFragment(c,l);if(this.couldBacktrack&&!this.fragPrevious&&u&&Cd(u)&&this.fragmentTracker.getState(u)!==yc){var f;const t=(null!=(f=this.backtrackFragment)?f:u).sn-l.startSN,e=l.fragments[t-1];e&&u.cc===e.cc&&(u=e,this.fragmentTracker.removeFragment(e))}else this.backtrackFragment&&a.len&&(this.backtrackFragment=null);if(u&&this.isLoopLoading(u,c)){if(!u.gap){const t=this.audioOnly&&!this.altAudio?Rd:kd,e=(t===kd?this.videoBuffer:this.mediaBuffer)||this.media;e&&this.afterBufferFlushed(e,t,$l)}u=this.getNextFragmentLoopLoading(u,l,a,$l,h)}u&&(!u.initSegment||u.initSegment.data||this.bitrateTest||(u=u.initSegment),this.loadFragment(u,n,c))}loadFragment(t,e,i){const s=this.fragmentTracker.getState(t);s===pc||s===vc?Cd(t)?this.bitrateTest?(this.log(`Fragment ${t.sn} of level ${t.level} is being downloaded to test bitrate and will not be buffered`),this._loadBitrateTestFrag(t,e)):super.loadFragment(t,e,i):this._loadInitSegment(t,e):this.clearTrackerIfNeeded(t)}getBufferedFrag(t){return this.fragmentTracker.getBufferedFrag(t,$l)}followingBufferedFrag(t){return t?this.getBufferedFrag(t.end+.5):null}immediateLevelSwitch(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}nextLevelSwitch(){const{levels:t,media:e}=this;if(null!=e&&e.readyState){let i;const s=this.getAppendedFrag(e.currentTime);s&&s.start>1&&this.flushMainBuffer(0,s.start-1);const r=this.getLevelDetails();if(null!=r&&r.live){const t=this.getMainFwdBufferInfo();if(!t||t.len<2*r.targetduration)return}if(!e.paused&&t){const e=t[this.hls.nextLoadLevel],s=this.fragLastKbps;i=s&&this.fragCurrent?this.fragCurrent.duration*e.maxBitrate/(1e3*s)+1:0}else i=0;const n=this.getBufferedFrag(e.currentTime+i);if(n){const t=this.followingBufferedFrag(n);if(t){this.abortCurrentFrag();const e=t.maxStartPTS?t.maxStartPTS:t.start,i=t.duration,s=Math.max(n.end,e+Math.min(Math.max(i-this.config.maxFragLookUpTolerance,i*(this.couldBacktrack?.5:.125)),i*(this.couldBacktrack?.75:.25)));this.flushMainBuffer(s,Number.POSITIVE_INFINITY)}}}}abortCurrentFrag(){const t=this.fragCurrent;switch(this.fragCurrent=null,this.backtrackFragment=null,t&&(t.abortRequests(),this.fragmentTracker.removeFragment(t)),this.state){case of:case lf:case df:case cf:case uf:this.state=af}this.nextLoadPosition=this.getLoadPosition()}flushMainBuffer(t,e){super.flushMainBuffer(t,e,2===this.altAudio?"video":null)}onMediaAttached(t,e){super.onMediaAttached(t,e);const i=e.media;ef(i,"playing",this.onMediaPlaying),ef(i,"seeked",this.onMediaSeeked)}onMediaDetaching(t,e){const{media:i}=this;i&&(sf(i,"playing",this.onMediaPlaying),sf(i,"seeked",this.onMediaSeeked)),this.videoBuffer=null,this.fragPlaying=null,super.onMediaDetaching(t,e);!!e.transferMedia||(this._hasEnoughToStart=!1)}onManifestLoading(){super.onManifestLoading(),this.log("Trigger BUFFER_RESET"),this.hls.trigger(Ql.BUFFER_RESET,void 0),this.couldBacktrack=!1,this.fragLastKbps=0,this.fragPlaying=this.backtrackFragment=null,this.altAudio=0,this.audioOnly=!1}onManifestParsed(t,e){let i=!1,s=!1;for(let r=0;r<e.levels.length;r++){const t=e.levels[r].audioCodec;t&&(i=i||-1!==t.indexOf("mp4a.40.2"),s=s||-1!==t.indexOf("mp4a.40.5"))}this.audioCodecSwitch=i&&s&&!function(){var t;const e=GA();return"function"==typeof(null==e||null==(t=e.prototype)?void 0:t.changeType)}(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=e.levels,this.startFragRequested=!1}onLevelLoading(t,e){const{levels:i}=this;if(!i||this.state!==af)return;const s=e.levelInfo;(!s.details||s.details.live&&(this.levelLastLoaded!==s||s.details.expired)||this.waitForCdnTuneIn(s.details))&&(this.state=pf)}onLevelLoaded(t,e){var i;const{levels:s,startFragRequested:r}=this,n=e.level,a=e.details,o=a.totalduration;if(!s)return void this.warn(`Levels were reset while loading level ${n}`);this.log(`Level ${n} loaded [${a.startSN},${a.endSN}]${a.lastPartSn?`[part-${a.lastPartSn}-${a.lastPartIndex}]`:""}, cc [${a.startCC}, ${a.endCC}] duration:${o}`);const l=e.levelInfo,d=this.fragCurrent;!d||this.state!==lf&&this.state!==df||d.level!==e.level&&d.loader&&this.abortCurrentFrag();let h=0;if(a.live||null!=(i=l.details)&&i.live){var c;if(this.checkLiveUpdate(a),a.deltaUpdateFailed)return;h=this.alignPlaylists(a,l.details,null==(c=this.levelLastLoaded)?void 0:c.details)}if(l.details=a,this.levelLastLoaded=l,r||this.setStartPosition(a,h),this.hls.trigger(Ql.LEVEL_UPDATED,{details:a,level:n}),this.state===pf){if(this.waitForCdnTuneIn(a))return;this.state=af}r&&a.live&&this.synchronizeToLiveEdge(a),this.tick()}synchronizeToLiveEdge(t){const{config:e,media:i}=this;if(!i)return;const s=this.hls.liveSyncPosition,r=this.getLoadPosition(),n=t.fragmentStart,a=t.edge,o=r>=n-e.maxFragLookUpTolerance&&r<=a;if(null!==s&&i.duration>s&&(r<s||!o)){const n=void 0!==e.liveMaxLatencyDuration?e.liveMaxLatencyDuration:e.liveMaxLatencyDurationCount*t.targetduration;if((!o&&i.readyState<4||r<a-n)&&(this._hasEnoughToStart||(this.nextLoadPosition=s),i.readyState))if(this.warn(`Playback: ${r.toFixed(3)} is located too far from the end of live sliding playlist: ${a}, reset currentTime to : ${s.toFixed(3)}`),"buffered"===this.config.liveSyncMode){var l;const t=_c.bufferInfo(i,s,0);if(null==(l=t.buffered)||!l.length)return void(i.currentTime=s);if(t.start<=r)return void(i.currentTime=s);const{nextStart:e}=_c.bufferedInfo(t.buffered,r,0);e&&(i.currentTime=e)}else i.currentTime=s}}_handleFragmentLoadProgress(t){var e;const i=t.frag,{part:s,payload:r}=t,{levels:n}=this;if(!n)return void this.warn(`Levels were reset while fragment load was in progress. Fragment ${i.sn} of level ${i.level} will not be buffered`);const a=n[i.level];if(!a)return void this.warn(`Level ${i.level} not found on progress`);const o=a.details;if(!o)return this.warn(`Dropping fragment ${i.sn} of level ${i.level} after level details were reset`),void this.fragmentTracker.removeFragment(i);const l=a.videoCodec,d=o.PTSKnown||!o.live,h=null==(e=i.initSegment)?void 0:e.data,c=this._getAudioCodec(a),u=this.transmuxer=this.transmuxer||new Yg(this.hls,$l,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),f=s?s.index:-1,g=-1!==f,m=new Fc(i.level,i.sn,i.stats.chunkCount,r.byteLength,f,g),p=this.initPTS[i.cc];u.push(r,h,c,l,i,s,o.totalduration,d,m,p)}onAudioTrackSwitching(t,e){const i=this.hls,s=0!==this.altAudio;if(Wh(e.url,i))this.altAudio=1;else{if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;const t=this.fragCurrent;t&&(this.log("Switching to main audio track, cancel main fragment load"),t.abortRequests(),this.fragmentTracker.removeFragment(t)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();if(s)return this.altAudio=0,this.fragmentTracker.removeAllFragments(),i.once(Ql.BUFFER_FLUSHED,()=>{this.hls&&this.hls.trigger(Ql.AUDIO_TRACK_SWITCHED,e)}),void i.trigger(Ql.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null});i.trigger(Ql.AUDIO_TRACK_SWITCHED,e)}}onAudioTrackSwitched(t,e){const i=Wh(e.url,this.hls);if(i){const t=this.videoBuffer;t&&this.mediaBuffer!==t&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=t)}this.altAudio=i?2:0,this.tick()}onBufferCreated(t,e){const i=e.tracks;let s,r,n=!1;for(const a in i){const t=i[a];if("main"===t.id){if(r=a,s=t,"video"===a){const t=i[a];t&&(this.videoBuffer=t.buffer)}}else n=!0}n&&s?(this.log(`Alternate track found, use ${r}.buffered to schedule main fragment loading`),this.mediaBuffer=s.buffer):this.mediaBuffer=this.media}onFragBuffered(t,e){const{frag:i,part:s}=e,r=i.type===$l;if(r){if(this.fragContextChanged(i))return this.warn(`Fragment ${i.sn}${s?" p: "+s.index:""} of level ${i.level} finished buffering, but was aborted. state: ${this.state}`),void(this.state===uf&&(this.state=af));const t=s?s.stats:i.stats;this.fragLastKbps=Math.round(8*t.total/(t.buffering.end-t.loading.first)),Cd(i)&&(this.fragPrevious=i),this.fragBufferedComplete(i,s)}const n=this.media;n&&(!this._hasEnoughToStart&&_c.getBuffered(n).length&&(this._hasEnoughToStart=!0,this.seekToStartPos()),r&&this.tick())}get hasEnoughToStart(){return this._hasEnoughToStart}onError(t,e){var i;if(e.fatal)this.state=gf;else switch(e.details){case Gl.FRAG_GAP:case Gl.FRAG_PARSING_ERROR:case Gl.FRAG_DECRYPT_ERROR:case Gl.FRAG_LOAD_ERROR:case Gl.FRAG_LOAD_TIMEOUT:case Gl.KEY_LOAD_ERROR:case Gl.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError($l,e);break;case Gl.LEVEL_LOAD_ERROR:case Gl.LEVEL_LOAD_TIMEOUT:case Gl.LEVEL_PARSING_ERROR:e.levelRetry||this.state!==pf||(null==(i=e.context)?void 0:i.type)!==ql||(this.state=af);break;case Gl.BUFFER_ADD_CODEC_ERROR:case Gl.BUFFER_APPEND_ERROR:if("main"!==e.parent)return;this.reduceLengthAndFlushBuffer(e)&&this.resetLoadingState();break;case Gl.BUFFER_FULL_ERROR:if("main"!==e.parent)return;if(this.reduceLengthAndFlushBuffer(e)){!this.config.interstitialsController&&this.config.assetPlayerId?this._hasEnoughToStart=!0:this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}break;case Gl.INTERNAL_EXCEPTION:this.recoverWorkerError(e)}}onFragLoadEmergencyAborted(){this.state=af,this._hasEnoughToStart||(this.startFragRequested=!1,this.nextLoadPosition=this.lastCurrentTime),this.tickImmediate()}onBufferFlushed(t,{type:e}){if(e!==Rd||!this.altAudio){const t=(e===kd?this.videoBuffer:this.mediaBuffer)||this.media;t&&(this.afterBufferFlushed(t,e,$l),this.tick())}}onLevelsUpdated(t,e){this.level>-1&&this.fragCurrent&&(this.level=this.fragCurrent.level,-1===this.level&&this.resetWhenMissingContext(this.fragCurrent)),this.levels=e.levels}swapAudioCodec(){this.audioCodecSwap=!this.audioCodecSwap}seekToStartPos(){const{media:t}=this;if(!t)return;const e=t.currentTime;let i=this.startPosition;if(i>=0&&e<i){if(t.seeking)return void this.log(`could not seek to ${i}, already seeking at ${e}`);const s=this.timelineOffset;s&&i&&(i+=s);const r=this.getLevelDetails(),n=_c.getBuffered(t),a=n.length?n.start(0):0,o=a-i,l=Math.max(this.config.maxBufferHole,this.config.maxFragLookUpTolerance);(this.config.startOnSegmentBoundary||o>0&&(o<l||this.loadingParts&&o<2*((null==r?void 0:r.partTarget)||0)))&&(this.log(`adjusting start position by ${o} to match buffer start`),i+=o,this.startPosition=i),e<i&&(this.log(`seek to target start position ${i} from current time ${e} buffer start ${a}`),t.currentTime=i)}}_getAudioCodec(t){let e=this.config.defaultAudioCodec||t.audioCodec;return this.audioCodecSwap&&e&&(this.log("Swapping audio codec"),e=-1!==e.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),e}_loadBitrateTestFrag(t,e){t.bitrateTest=!0,this._doFragLoad(t,e).then(t=>{const{hls:i}=this,s=null==t?void 0:t.frag;if(!s||this.fragContextChanged(s))return;e.fragmentError=0,this.state=af,this.startFragRequested=!1,this.bitrateTest=!1;const r=s.stats;r.parsing.start=r.parsing.end=r.buffering.start=r.buffering.end=self.performance.now(),i.trigger(Ql.FRAG_LOADED,t),s.bitrateTest=!1}).catch(e=>{this.state!==nf&&this.state!==gf&&(this.warn(e),this.resetFragmentLoading(t))})}_handleTransmuxComplete(t){const e=this.playlistType,{hls:i}=this,{remuxResult:s,chunkMeta:r}=t,n=this.getCurrentContext(r);if(!n)return void this.resetWhenMissingContext(r);const{frag:a,part:o,level:l}=n,{video:d,text:h,id3:c,initSegment:u}=s,{details:f}=l,g=this.altAudio?void 0:s.audio;if(this.fragContextChanged(a))this.fragmentTracker.removeFragment(a);else{if(this.state=cf,u){const t=u.tracks;if(t){const s=a.initSegment||a;if(this.unhandledEncryptionError(u,a))return;this._bufferInitSegment(l,t,s,r),i.trigger(Ql.FRAG_PARSING_INIT_SEGMENT,{frag:s,id:e,tracks:t})}const s=u.initPTS,n=u.timescale,o=this.initPTS[a.cc];if(Ul(s)&&(!o||o.baseTime!==s||o.timescale!==n)){const t=u.trackId;this.initPTS[a.cc]={baseTime:s,timescale:n,trackId:t},i.trigger(Ql.INIT_PTS_FOUND,{frag:a,id:e,initPTS:s,timescale:n,trackId:t})}}if(d&&f){g&&"audiovideo"===d.type&&this.logMuxedErr(a);const t=f.fragments[a.sn-1-f.startSN],e=a.sn===f.startSN,i=!t||a.cc>t.cc;if(!1!==s.independent){const{startPTS:t,endPTS:s,startDTS:n,endDTS:l}=d;if(o)o.elementaryStreams[d.type]={startPTS:t,endPTS:s,startDTS:n,endDTS:l};else if(d.firstKeyFrame&&d.independent&&1===r.id&&!i&&(this.couldBacktrack=!0),d.dropped&&d.independent){const r=this.getMainFwdBufferInfo(),n=(r?r.end:this.getLoadPosition())+this.config.maxBufferHole,o=d.firstKeyFramePTS?d.firstKeyFramePTS:t;if(!e&&n<o-this.config.maxBufferHole&&!i)return void this.backtrack(a);i&&(a.gap=!0),a.setElementaryStreamInfo(d.type,a.start,s,a.start,l,!0)}else e&&t-(f.appliedTimelineOffset||0)>2&&(a.gap=!0);a.setElementaryStreamInfo(d.type,t,s,n,l),this.backtrackFragment&&(this.backtrackFragment=a),this.bufferFragmentData(d,a,o,r,e||i)}else{if(!e&&!i)return void this.backtrack(a);a.gap=!0}}if(g){const{startPTS:t,endPTS:e,startDTS:i,endDTS:s}=g;o&&(o.elementaryStreams[Rd]={startPTS:t,endPTS:e,startDTS:i,endDTS:s}),a.setElementaryStreamInfo(Rd,t,e,i,s),this.bufferFragmentData(g,a,o,r)}if(f&&null!=c&&c.samples.length){const t={id:e,frag:a,details:f,samples:c.samples};i.trigger(Ql.FRAG_PARSING_METADATA,t)}if(f&&h){const t={id:e,frag:a,details:f,samples:h.samples};i.trigger(Ql.FRAG_PARSING_USERDATA,t)}}}logMuxedErr(t){this.warn(`${Cd(t)?"Media":"Init"} segment with muxed audiovideo where only video expected: ${t.url}`)}_bufferInitSegment(t,e,i,s){if(this.state!==cf)return;this.audioOnly=!!e.audio&&!e.video,this.altAudio&&!this.audioOnly&&(delete e.audio,e.audiovideo&&this.logMuxedErr(i));const{audio:r,video:n,audiovideo:a}=e;if(r){const i=t.audioCodec;let s=Ah(r.codec,i);"mp4a"===s&&(s="mp4a.40.5");const n=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){s&&(s=-1!==s.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5");const t=r.metadata;t&&"channelCount"in t&&1!==(t.channelCount||1)&&-1===n.indexOf("firefox")&&(s="mp4a.40.5")}s&&-1!==s.indexOf("mp4a.40.5")&&-1!==n.indexOf("android")&&"audio/mpeg"!==r.container&&(s="mp4a.40.2",this.log(`Android: force audio codec to ${s}`)),i&&i!==s&&this.log(`Swapping manifest audio codec "${i}" for "${s}"`),r.levelCodec=s,r.id=$l,this.log(`Init audio buffer, container:${r.container}, codecs[selected/level/parsed]=[${s||""}/${i||""}/${r.codec}]`),delete e.audiovideo}if(n){n.levelCodec=t.videoCodec,n.id=$l;const i=n.codec;if(4===(null==i?void 0:i.length))switch(i){case"hvc1":case"hev1":n.codec="hvc1.1.6.L120.90";break;case"av01":n.codec="av01.0.04M.08";break;case"avc1":n.codec="avc1.42e01e"}this.log(`Init video buffer, container:${n.container}, codecs[level/parsed]=[${t.videoCodec||""}/${i}]${n.codec!==i?" parsed-corrected="+n.codec:""}${n.supplemental?" supplemental="+n.supplemental:""}`),delete e.audiovideo}a&&(this.log(`Init audiovideo buffer, container:${a.container}, codecs[level/parsed]=[${t.codecs}/${a.codec}]`),delete e.video,delete e.audio);const o=Object.keys(e);if(o.length){if(this.hls.trigger(Ql.BUFFER_CODECS,e),!this.hls)return;o.forEach(t=>{const r=e[t].initSegment;null!=r&&r.byteLength&&this.hls.trigger(Ql.BUFFER_APPENDING,{type:t,data:r,frag:i,part:null,chunkMeta:s,parent:i.type})})}this.tickImmediate()}getMainFwdBufferInfo(){const t=this.mediaBuffer&&2===this.altAudio?this.mediaBuffer:this.media;return this.getFwdBufferInfo(t,$l)}get maxBufferLength(){const{levels:t,level:e}=this,i=null==t?void 0:t[e];return i?this.getMaxBufferLength(i.maxBitrate):this.config.maxBufferLength}backtrack(t){this.couldBacktrack=!0,this.backtrackFragment=t,this.resetTransmuxer(),this.flushBufferGap(t),this.fragmentTracker.removeFragment(t),this.fragPrevious=null,this.nextLoadPosition=t.start,this.state=af}checkFragmentChanged(){const t=this.media;let e=null;if(t&&t.readyState>1&&!1===t.seeking){const i=t.currentTime;if(_c.isBuffered(t,i)?e=this.getAppendedFrag(i):_c.isBuffered(t,i+.1)&&(e=this.getAppendedFrag(i+.1)),e){this.backtrackFragment=null;const t=this.fragPlaying,i=e.level;t&&e.sn===t.sn&&t.level===i||(this.fragPlaying=e,this.hls.trigger(Ql.FRAG_CHANGED,{frag:e}),t&&t.level===i||this.hls.trigger(Ql.LEVEL_SWITCHED,{level:i}))}}}get nextLevel(){const t=this.nextBufferedFrag;return t?t.level:-1}get currentFrag(){var t;if(this.fragPlaying)return this.fragPlaying;const e=(null==(t=this.media)?void 0:t.currentTime)||this.lastCurrentTime;return Ul(e)?this.getAppendedFrag(e):null}get currentProgramDateTime(){var t;const e=(null==(t=this.media)?void 0:t.currentTime)||this.lastCurrentTime;if(Ul(e)){const t=this.getLevelDetails(),i=this.currentFrag||(t?$h(null,t.fragments,e):null);if(i){const t=i.programDateTime;if(null!==t){const s=t+1e3*(e-i.start);return new Date(s)}}}return null}get currentLevel(){const t=this.currentFrag;return t?t.level:-1}get nextBufferedFrag(){const t=this.currentFrag;return t?this.followingBufferedFrag(t):null}get forceStartLoad(){return this._forceStartLoad}}class qA extends rd{constructor(t,e){super("key-loader",e),this.config=void 0,this.keyIdToKeyInfo={},this.emeController=null,this.config=t}abort(t){for(const i in this.keyIdToKeyInfo){const s=this.keyIdToKeyInfo[i].loader;if(s){var e;if(t&&t!==(null==(e=s.context)?void 0:e.frag.type))return;s.abort()}}}detach(){for(const t in this.keyIdToKeyInfo){const e=this.keyIdToKeyInfo[t];(e.mediaKeySessionContext||e.decryptdata.isCommonEncryption)&&delete this.keyIdToKeyInfo[t]}}destroy(){this.detach();for(const t in this.keyIdToKeyInfo){const e=this.keyIdToKeyInfo[t].loader;e&&e.destroy()}this.keyIdToKeyInfo={}}createKeyLoadError(t,e=Gl.KEY_LOAD_ERROR,i,s,r){return new Oc({type:Vl.NETWORK_ERROR,details:e,fatal:!1,frag:t,response:r,error:i,networkDetails:s})}loadClear(t,e,i){if(this.emeController&&this.config.emeEnabled&&!this.emeController.getSelectedKeySystemFormats().length){if(e.length)for(let s=0,r=e.length;s<r;s++){const n=e[s];if(t.cc<=n.cc&&(!Cd(t)||!Cd(n)||t.sn<n.sn)||!i&&s==r-1)return this.emeController.selectKeySystemFormat(n).then(t=>{if(!this.emeController)return;n.setKeyFormat(t);const e=cu(t);return e?this.emeController.getKeySystemAccess([e]):void 0})}if(this.config.requireKeySystemAccessOnStart){const t=fu(this.config);if(t.length)return this.emeController.getKeySystemAccess(t)}}return null}load(t){return!t.decryptdata&&t.encrypted&&this.emeController&&this.config.emeEnabled?this.emeController.selectKeySystemFormat(t).then(e=>this.loadInternal(t,e)):this.loadInternal(t)}loadInternal(t,e){var i,s;e&&t.setKeyFormat(e);const r=t.decryptdata;if(!r){const i=new Error(e?`Expected frag.decryptdata to be defined after setting format ${e}`:`Missing decryption data on fragment in onKeyLoading (emeEnabled with controller: ${this.emeController&&this.config.emeEnabled})`);return Promise.reject(this.createKeyLoadError(t,Gl.KEY_LOAD_ERROR,i))}const n=r.uri;if(!n)return Promise.reject(this.createKeyLoadError(t,Gl.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${n}"`)));const a=WA(r);let o=this.keyIdToKeyInfo[a];if(null!=(i=o)&&i.decryptdata.key)return r.key=o.decryptdata.key,Promise.resolve({frag:t,keyInfo:o});if(this.emeController&&null!=(s=o)&&s.keyLoadPromise){switch(this.emeController.getKeyStatus(o.decryptdata)){case"usable":case"usable-in-future":return o.keyLoadPromise.then(e=>{const{keyInfo:i}=e;return r.key=i.decryptdata.key,{frag:t,keyInfo:i}})}}switch(this.log(`${this.keyIdToKeyInfo[a]?"Rel":"L"}oading${r.keyId?" keyId: "+gd(r.keyId):""} URI: ${r.uri} from ${t.type} ${t.level}`),o=this.keyIdToKeyInfo[a]={decryptdata:r,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},r.method){case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return"identity"===r.keyFormat?this.loadKeyHTTP(o,t):this.loadKeyEME(o,t);case"AES-128":case"AES-256":case"AES-256-CTR":return this.loadKeyHTTP(o,t);default:return Promise.reject(this.createKeyLoadError(t,Gl.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${r.method}"`)))}}loadKeyEME(t,e){const i={frag:e,keyInfo:t};if(this.emeController&&this.config.emeEnabled){var s;if(!t.decryptdata.keyId&&null!=(s=e.initSegment)&&s.data){const i=function(t){const e=[];return zd(t,t=>e.push(t.subarray(8,24))),e}(e.initSegment.data);if(i.length){let e=i[0];e.some(t=>0!==t)?(this.log(`Using keyId found in init segment ${gd(e)}`),vu.setKeyIdForUri(t.decryptdata.uri,e)):(e=vu.addKeyIdForUri(t.decryptdata.uri),this.log(`Generating keyId to patch media ${gd(e)}`)),t.decryptdata.keyId=e}}if(!t.decryptdata.keyId&&!Cd(e))return Promise.resolve(i);const r=this.emeController.loadKey(i);return(t.keyLoadPromise=r.then(e=>(t.mediaKeySessionContext=e,i))).catch(i=>{throw t.keyLoadPromise=null,"data"in i&&(i.data.frag=e),i})}return Promise.resolve(i)}loadKeyHTTP(t,e){const i=this.config,s=new(0,i.loader)(i);return e.keyLoader=t.loader=s,t.keyLoadPromise=new Promise((r,n)=>{const a={keyInfo:t,frag:e,responseType:"arraybuffer",url:t.decryptdata.uri},o=i.keyLoadPolicy.default,l={loadPolicy:o,timeout:o.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},d={onSuccess:(t,e,i,s)=>{const{frag:a,keyInfo:o}=i,l=WA(o.decryptdata);if(!a.decryptdata||o!==this.keyIdToKeyInfo[l])return n(this.createKeyLoadError(a,Gl.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),s));o.decryptdata.key=a.decryptdata.key=new Uint8Array(t.data),a.keyLoader=null,o.loader=null,r({frag:a,keyInfo:o})},onError:(t,i,s,r)=>{this.resetLoader(i),n(this.createKeyLoadError(e,Gl.KEY_LOAD_ERROR,new Error(`HTTP Error ${t.code} loading key ${t.text}`),s,sd({url:a.url,data:void 0},t)))},onTimeout:(t,i,s)=>{this.resetLoader(i),n(this.createKeyLoadError(e,Gl.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),s))},onAbort:(t,i,s)=>{this.resetLoader(i),n(this.createKeyLoadError(e,Gl.INTERNAL_ABORTED,new Error("key loading aborted"),s))}};s.load(a,l,d)})}resetLoader(t){const{frag:e,keyInfo:i,url:s}=t,r=i.loader;e.keyLoader===r&&(e.keyLoader=null,i.loader=null);const n=WA(i.decryptdata)||s;delete this.keyIdToKeyInfo[n],r&&r.destroy()}}function WA(t){if(t.keyFormat!==lu){const e=t.keyId;if(e)return gd(e)}return t.uri}function YA(t){const{type:e}=t;switch(e){case Wl:return zl;case Yl:return Xl;default:return $l}}function $A(t,e){let i=t.url;return void 0!==i&&0!==i.indexOf("data:")||(i=e.url),i}class zA{constructor(t){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.onManifestLoaded=this.checkAutostartLoad,this.hls=t,this.registerListeners()}startLoad(t){}stopLoad(){this.destroyInternalLoaders()}registerListeners(){const{hls:t}=this;t.on(Ql.MANIFEST_LOADING,this.onManifestLoading,this),t.on(Ql.LEVEL_LOADING,this.onLevelLoading,this),t.on(Ql.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.on(Ql.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),t.on(Ql.LEVELS_UPDATED,this.onLevelsUpdated,this)}unregisterListeners(){const{hls:t}=this;t.off(Ql.MANIFEST_LOADING,this.onManifestLoading,this),t.off(Ql.LEVEL_LOADING,this.onLevelLoading,this),t.off(Ql.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.off(Ql.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),t.off(Ql.LEVELS_UPDATED,this.onLevelsUpdated,this)}createInternalLoader(t){const e=this.hls.config,i=e.pLoader,s=e.loader,r=new(i||s)(e);return this.loaders[t.type]=r,r}getInternalLoader(t){return this.loaders[t.type]}resetInternalLoader(t){this.loaders[t]&&delete this.loaders[t]}destroyInternalLoaders(){for(const t in this.loaders){const e=this.loaders[t];e&&e.destroy(),this.resetInternalLoader(t)}}destroy(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}onManifestLoading(t,e){const{url:i}=e;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:Kl,url:i,deliveryDirectives:null,levelOrTrack:null})}onLevelLoading(t,e){const{id:i,level:s,pathwayId:r,url:n,deliveryDirectives:a,levelInfo:o}=e;this.load({id:i,level:s,pathwayId:r,responseType:"text",type:ql,url:n,deliveryDirectives:a,levelOrTrack:o})}onAudioTrackLoading(t,e){const{id:i,groupId:s,url:r,deliveryDirectives:n,track:a}=e;this.load({id:i,groupId:s,level:null,responseType:"text",type:Wl,url:r,deliveryDirectives:n,levelOrTrack:a})}onSubtitleTrackLoading(t,e){const{id:i,groupId:s,url:r,deliveryDirectives:n,track:a}=e;this.load({id:i,groupId:s,level:null,responseType:"text",type:Yl,url:r,deliveryDirectives:n,levelOrTrack:a})}onLevelsUpdated(t,e){const i=this.loaders[ql];if(i){const t=i.context;t&&!e.levels.some(e=>e===t.levelOrTrack)&&(i.abort(),delete this.loaders[ql])}}load(t){var e;const i=this.hls.config;let s,r=this.getInternalLoader(t);if(r){const e=this.hls.logger,i=r.context;if(i&&i.levelOrTrack===t.levelOrTrack&&(i.url===t.url||i.deliveryDirectives&&!t.deliveryDirectives))return void(i.url===t.url?e.log(`[playlist-loader]: ignore ${t.url} ongoing request`):e.log(`[playlist-loader]: ignore ${t.url} in favor of ${i.url}`));e.log(`[playlist-loader]: aborting previous loader for type: ${t.type}`),r.abort()}if(s=t.type===Kl?i.manifestLoadPolicy.default:ed({},i.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),r=this.createInternalLoader(t),Ul(null==(e=t.deliveryDirectives)?void 0:e.part)){let e;if(t.type===ql&&null!==t.level?e=this.hls.levels[t.level].details:t.type===Wl&&null!==t.id?e=this.hls.audioTracks[t.id].details:t.type===Yl&&null!==t.id&&(e=this.hls.subtitleTracks[t.id].details),e){const t=e.partTarget,i=e.targetduration;if(t&&i){const e=1e3*Math.max(3*t,.8*i);s=ed({},s,{maxTimeToFirstByteMs:Math.min(e,s.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(e,s.maxTimeToFirstByteMs)})}}}const n=s.errorRetry||s.timeoutRetry||{},a={loadPolicy:s,timeout:s.maxLoadTimeMs,maxRetry:n.maxNumRetry||0,retryDelay:n.retryDelayMs||0,maxRetryDelay:n.maxRetryDelayMs||0},o={onSuccess:(t,e,i,s)=>{const r=this.getInternalLoader(i);this.resetInternalLoader(i.type);const n=t.data;e.parsing.start=performance.now(),Lu.isMediaPlaylist(n)||i.type!==Kl?this.handleTrackOrLevelPlaylist(t,e,i,s||null,r):this.handleMasterPlaylist(t,e,i,s)},onError:(t,e,i,s)=>{this.handleNetworkError(e,i,!1,t,s)},onTimeout:(t,e,i)=>{this.handleNetworkError(e,i,!0,void 0,t)}};r.load(t,a,o)}checkAutostartLoad(){if(!this.hls)return;const{config:{autoStartLoad:t,startPosition:e},forceStartLoad:i}=this.hls;(t||i)&&(this.hls.logger.log(`${t?"auto":"force"} startLoad with configured startPosition ${e}`),this.hls.startLoad(e))}handleMasterPlaylist(t,e,i,s){const r=this.hls,n=t.data,a=$A(t,i),o=Lu.parseMasterPlaylist(n,a);if(o.playlistParsingError)return e.parsing.end=performance.now(),void this.handleManifestParsingError(t,i,o.playlistParsingError,s,e);const{contentSteering:l,levels:d,sessionData:h,sessionKeys:c,startTimeOffset:u,variableList:f}=o;this.variableList=f,d.forEach(t=>{const{unknownCodecs:e}=t;if(e){const{preferManagedMediaSource:i}=this.hls.config;let{audioCodec:s,videoCodec:r}=t;for(let n=e.length;n--;){const a=e[n];dh(a,"audio",i)?(t.audioCodec=s=s?`${s},${a}`:a,oh.audio[s.substring(0,4)]=2,e.splice(n,1)):dh(a,"video",i)&&(t.videoCodec=r=r?`${r},${a}`:a,oh.video[r.substring(0,4)]=2,e.splice(n,1))}}});const{AUDIO:g=[],SUBTITLES:m,"CLOSED-CAPTIONS":p}=Lu.parseMasterPlaylistMedia(n,a,o);if(g.length){g.some(t=>!t.url)||!d[0].audioCodec||d[0].attrs.AUDIO||(this.hls.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),g.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new qc({}),bitrate:0,url:""}))}r.trigger(Ql.MANIFEST_LOADED,{levels:d,audioTracks:g,subtitles:m,captions:p,contentSteering:l,url:a,stats:e,networkDetails:s,sessionData:h,sessionKeys:c,startTimeOffset:u,variableList:f})}handleTrackOrLevelPlaylist(t,e,i,s,r){const n=this.hls,{id:a,level:o,type:l}=i,d=$A(t,i),h=Ul(o)?o:Ul(a)?a:0,c=YA(i),u=Lu.parseLevelPlaylist(t.data,d,h,c,0,this.variableList);if(l===Kl){const t={attrs:new qc({}),bitrate:0,details:u,name:"",url:d};u.requestScheduled=e.loading.start+Gu(u,0),n.trigger(Ql.MANIFEST_LOADED,{levels:[t],audioTracks:[],url:d,stats:e,networkDetails:s,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}e.parsing.end=performance.now(),i.levelDetails=u,this.handlePlaylistLoaded(u,t,e,i,s,r)}handleManifestParsingError(t,e,i,s,r){this.hls.trigger(Ql.ERROR,{type:Vl.NETWORK_ERROR,details:Gl.MANIFEST_PARSING_ERROR,fatal:e.type===Kl,url:t.url,err:i,error:i,reason:i.message,response:t,context:e,networkDetails:s,stats:r})}handleNetworkError(t,e,i=!1,s,r){let n=`A network ${i?"timeout":"error"+(s?" (status "+s.code+")":"")} occurred while loading ${t.type}`;t.type===ql?n+=`: ${t.level} id: ${t.id}`:t.type!==Wl&&t.type!==Yl||(n+=` id: ${t.id} group-id: "${t.groupId}"`);const a=new Error(n);this.hls.logger.warn(`[playlist-loader]: ${n}`);let o=Gl.UNKNOWN,l=!1;const d=this.getInternalLoader(t);switch(t.type){case Kl:o=i?Gl.MANIFEST_LOAD_TIMEOUT:Gl.MANIFEST_LOAD_ERROR,l=!0;break;case ql:o=i?Gl.LEVEL_LOAD_TIMEOUT:Gl.LEVEL_LOAD_ERROR,l=!1;break;case Wl:o=i?Gl.AUDIO_TRACK_LOAD_TIMEOUT:Gl.AUDIO_TRACK_LOAD_ERROR,l=!1;break;case Yl:o=i?Gl.SUBTITLE_TRACK_LOAD_TIMEOUT:Gl.SUBTITLE_LOAD_ERROR,l=!1}d&&this.resetInternalLoader(t.type);const h={type:Vl.NETWORK_ERROR,details:o,fatal:l,url:t.url,loader:d,context:t,error:a,networkDetails:e,stats:r};if(s){const i=(null==e?void 0:e.url)||t.url;h.response=sd({url:i,data:void 0},s)}this.hls.trigger(Ql.ERROR,h)}handlePlaylistLoaded(t,e,i,s,r,n){const a=this.hls,{type:o,level:l,levelOrTrack:d,id:h,groupId:c,deliveryDirectives:u}=s,f=$A(e,s),g=YA(s);let m="number"==typeof s.level&&g===$l?l:void 0;const p=t.playlistParsingError;if(p){if(this.hls.logger.warn(`${p} ${t.url}`),!a.config.ignorePlaylistParsingErrors)return void a.trigger(Ql.ERROR,{type:Vl.NETWORK_ERROR,details:Gl.LEVEL_PARSING_ERROR,fatal:!1,url:f,error:p,reason:p.message,response:e,context:s,level:m,parent:g,networkDetails:r,stats:i});t.playlistParsingError=null}if(!t.fragments.length){const n=t.playlistParsingError=new Error("No Segments found in Playlist");return void a.trigger(Ql.ERROR,{type:Vl.NETWORK_ERROR,details:Gl.LEVEL_EMPTY_ERROR,fatal:!1,url:f,error:n,reason:n.message,response:e,context:s,level:m,parent:g,networkDetails:r,stats:i})}switch(t.live&&n&&(n.getCacheAge&&(t.ageHeader=n.getCacheAge()||0),n.getCacheAge&&!isNaN(t.ageHeader)||(t.ageHeader=0)),o){case Kl:case ql:if(m)if(d){if(d!==a.levels[m]){const t=a.levels.indexOf(d);t>-1&&(m=t)}}else m=0;a.trigger(Ql.LEVEL_LOADED,{details:t,levelInfo:d||a.levels[0],level:m||0,id:h||0,stats:i,networkDetails:r,deliveryDirectives:u,withoutMultiVariant:o===Kl});break;case Wl:a.trigger(Ql.AUDIO_TRACK_LOADED,{details:t,track:d,id:h||0,groupId:c||"",stats:i,networkDetails:r,deliveryDirectives:u});break;case Yl:a.trigger(Ql.SUBTITLE_TRACK_LOADED,{details:t,track:d,id:h||0,groupId:c||"",stats:i,networkDetails:r,deliveryDirectives:u})}}}class XA{static get version(){return If}static isMSESupported(){return QA()}static isSupported(){return function(){if(!QA())return!1;const t=cd();return"function"==typeof(null==t?void 0:t.isTypeSupported)&&(["avc1.42E01E,mp4a.40.2","av01.0.01M.08","vp09.00.50.08"].some(e=>t.isTypeSupported(ch(e,"video")))||["mp4a.40.2","fLaC"].some(e=>t.isTypeSupported(ch(e,"audio"))))}()}static getMediaSource(){return cd()}static get Events(){return Ql}static get MetadataSchema(){return Wf}static get ErrorTypes(){return Vl}static get ErrorDetails(){return Gl}static get DefaultConfig(){return XA.defaultConfig?XA.defaultConfig:DA}static set DefaultConfig(t){XA.defaultConfig=t}constructor(t={}){this.config=void 0,this.userConfig=void 0,this.logger=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new bf,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.audioStreamController=void 0,this.subtititleStreamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.interstitialsController=void 0,this.gapController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this._url=null,this._sessionId=void 0,this.triggeringException=void 0,this.started=!1;const e=this.logger=function(t,e,i){const s=od();if("object"==typeof console&&!0===t||"object"==typeof t){const n=["debug","log","info","warn","error"];n.forEach(e=>{s[e]=ld(e,t,i)});try{s.log(`Debug logs enabled for "${e}" in hls.js version 1.6.15`)}catch(r){return od()}n.forEach(e=>{dd[e]=ld(e,t)})}else ed(dd,s);return s}(t.debug||!1,"Hls instance",t.assetPlayerId),i=this.config=function(t,e,i){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(void 0!==e.liveMaxLatencyDurationCount&&(void 0===e.liveSyncDurationCount||e.liveMaxLatencyDurationCount<=e.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(void 0!==e.liveMaxLatencyDuration&&(void 0===e.liveSyncDuration||e.liveMaxLatencyDuration<=e.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');const s=CA(t),r=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return["manifest","level","frag"].forEach(t=>{const n=`${"level"===t?"playlist":t}LoadPolicy`,a=void 0===e[n],o=[];r.forEach(i=>{const r=`${t}Loading${i}`,l=e[r];if(void 0!==l&&a){o.push(r);const t=s[n].default;switch(e[n]={default:t},i){case"TimeOut":t.maxLoadTimeMs=l,t.maxTimeToFirstByteMs=l;break;case"MaxRetry":t.errorRetry.maxNumRetry=l,t.timeoutRetry.maxNumRetry=l;break;case"RetryDelay":t.errorRetry.retryDelayMs=l,t.timeoutRetry.retryDelayMs=l;break;case"MaxRetryTimeout":t.errorRetry.maxRetryDelayMs=l,t.timeoutRetry.maxRetryDelayMs=l}}}),o.length&&i.warn(`hls.js config: "${o.join('", "')}" setting(s) are deprecated, use "${n}": ${Uh(e[n])}`)}),sd(sd({},s),e)}(XA.DefaultConfig,t,e);this.userConfig=t,i.progressive&&xA(i,e);const{abrController:s,bufferController:r,capLevelController:n,errorController:a,fpsController:o}=i,l=new a(this),d=this.abrController=new s(this),h=new Ec(this),c=i.interstitialsController,u=c?this.interstitialsController=new c(this,XA):null,f=this.bufferController=new r(this,h),g=this.capLevelController=new n(this),m=new o(this),p=new zA(this),A=i.contentSteeringController,v=A?new A(this):null,y=this.levelController=new jA(this,v),E=new UA(this),T=new qA(this.config,this.logger),S=this.streamController=new KA(this,h,T),b=this.gapController=new PA(this,h);g.setStreamController(S),m.setStreamController(S);const I=[p,y,S];u&&I.splice(1,0,u),v&&I.splice(1,0,v),this.networkControllers=I;const L=[d,f,b,g,m,E,h];this.audioTrackController=this.createController(i.audioTrackController,I);const R=i.audioStreamController;R&&I.push(this.audioStreamController=new R(this,h,T)),this.subtitleTrackController=this.createController(i.subtitleTrackController,I);const k=i.subtitleStreamController;k&&I.push(this.subtititleStreamController=new k(this,h,T)),this.createController(i.timelineController,L),T.emeController=this.emeController=this.createController(i.emeController,L),this.cmcdController=this.createController(i.cmcdController,L),this.latencyController=this.createController(HA,L),this.coreComponents=L,I.push(l);const w=l.onErrorOut;"function"==typeof w&&this.on(Ql.ERROR,w,l),this.on(Ql.MANIFEST_LOADED,p.onManifestLoaded,p)}createController(t,e){if(t){const i=new t(this);return e&&e.push(i),i}return null}on(t,e,i=this){this._emitter.on(t,e,i)}once(t,e,i=this){this._emitter.once(t,e,i)}removeAllListeners(t){this._emitter.removeAllListeners(t)}off(t,e,i=this,s){this._emitter.off(t,e,i,s)}listeners(t){return this._emitter.listeners(t)}emit(t,e,i){return this._emitter.emit(t,e,i)}trigger(t,e){if(this.config.debug)return this.emit(t,t,e);try{return this.emit(t,t,e)}catch(i){if(this.logger.error("An internal error happened while handling event "+t+'. Error message: "'+i.message+'". Here is a stacktrace:',i),!this.triggeringException){this.triggeringException=!0;const e=t===Ql.ERROR;this.trigger(Ql.ERROR,{type:Vl.OTHER_ERROR,details:Gl.INTERNAL_EXCEPTION,fatal:e,event:t,error:i}),this.triggeringException=!1}}return!1}listenerCount(t){return this._emitter.listenerCount(t)}destroy(){this.logger.log("destroy"),this.trigger(Ql.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 t=this.config;t.xhrSetup=t.fetchSetup=void 0,this.userConfig=null}attachMedia(t){if(!t||"media"in t&&!t.media){const e=new Error(`attachMedia failed: invalid argument (${t})`);return void this.trigger(Ql.ERROR,{type:Vl.OTHER_ERROR,details:Gl.ATTACH_MEDIA_ERROR,fatal:!0,error:e})}this.logger.log("attachMedia"),this._media&&(this.logger.warn("media must be detached before attaching"),this.detachMedia());const e="media"in t,i=e?t.media:t,s=e?t:{media:i};this._media=i,this.trigger(Ql.MEDIA_ATTACHING,s)}detachMedia(){this.logger.log("detachMedia"),this.trigger(Ql.MEDIA_DETACHING,{}),this._media=null}transferMedia(){this._media=null;const t=this.bufferController.transferMedia();return this.trigger(Ql.MEDIA_DETACHING,{transferMedia:t}),t}loadSource(t){this.stopLoad();const e=this.media,i=this._url,s=this._url=Id.buildAbsoluteURL(self.location.href,t,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.logger.log(`loadSource:${s}`),e&&i&&(i!==s||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(e)),this.trigger(Ql.MANIFEST_LOADING,{url:t})}get url(){return this._url}get hasEnoughToStart(){return this.streamController.hasEnoughToStart}get startPosition(){return this.streamController.startPositionValue}startLoad(t=-1,e){this.logger.log(`startLoad(${t+(e?", <skip seek to start>":"")})`),this.started=!0,this.resumeBuffering();for(let i=0;i<this.networkControllers.length&&(this.networkControllers[i].startLoad(t,e),this.started&&this.networkControllers);i++);}stopLoad(){this.logger.log("stopLoad"),this.started=!1;for(let t=0;t<this.networkControllers.length&&(this.networkControllers[t].stopLoad(),!this.started&&this.networkControllers);t++);}get loadingEnabled(){return this.started}get bufferingEnabled(){return this.streamController.bufferingEnabled}resumeBuffering(){this.bufferingEnabled||(this.logger.log("resume buffering"),this.networkControllers.forEach(t=>{t.resumeBuffering&&t.resumeBuffering()}))}pauseBuffering(){this.bufferingEnabled&&(this.logger.log("pause buffering"),this.networkControllers.forEach(t=>{t.pauseBuffering&&t.pauseBuffering()}))}get inFlightFragments(){const t={[$l]:this.streamController.inFlightFrag};return this.audioStreamController&&(t[zl]=this.audioStreamController.inFlightFrag),this.subtititleStreamController&&(t[Xl]=this.subtititleStreamController.inFlightFrag),t}swapAudioCodec(){this.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){this.logger.log("recoverMediaError");const t=this._media,e=null==t?void 0:t.currentTime;this.detachMedia(),t&&(this.attachMedia(t),e&&this.startLoad(e))}removeLevel(t){this.levelController.removeLevel(t)}get sessionId(){let t=this._sessionId;return t||(t=this._sessionId=function(){try{return crypto.randomUUID()}catch(t){try{const t=URL.createObjectURL(new Blob),e=t.toString();return URL.revokeObjectURL(t),e.slice(e.lastIndexOf("/")+1)}catch(e){let t=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const i=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"==e?i:3&i|8).toString(16)})}}}()),t}get levels(){const t=this.levelController.levels;return t||[]}get latestLevelDetails(){return this.streamController.getLevelDetails()||null}get loadLevelObj(){return this.levelController.loadLevelObj}get currentLevel(){return this.streamController.currentLevel}set currentLevel(t){this.logger.log(`set currentLevel:${t}`),this.levelController.manualLevel=t,this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(t){this.logger.log(`set nextLevel:${t}`),this.levelController.manualLevel=t,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(t){this.logger.log(`set loadLevel:${t}`),this.levelController.manualLevel=t}get nextLoadLevel(){return this.levelController.nextLoadLevel}set nextLoadLevel(t){this.levelController.nextLoadLevel=t}get firstLevel(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)}set firstLevel(t){this.logger.log(`set firstLevel:${t}`),this.levelController.firstLevel=t}get startLevel(){const t=this.levelController.startLevel;return-1===t&&this.abrController.forcedAutoLevel>-1?this.abrController.forcedAutoLevel:t}set startLevel(t){this.logger.log(`set startLevel:${t}`),-1!==t&&(t=Math.max(t,this.minAutoLevel)),this.levelController.startLevel=t}get capLevelToPlayerSize(){return this.config.capLevelToPlayerSize}set capLevelToPlayerSize(t){const e=!!t;e!==this.config.capLevelToPlayerSize&&(e?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=e)}get autoLevelCapping(){return this._autoLevelCapping}get bandwidthEstimate(){const{bwEstimator:t}=this.abrController;return t?t.getEstimate():NaN}set bandwidthEstimate(t){this.abrController.resetEstimator(t)}get abrEwmaDefaultEstimate(){const{bwEstimator:t}=this.abrController;return t?t.defaultEstimate:NaN}get ttfbEstimate(){const{bwEstimator:t}=this.abrController;return t?t.getEstimateTTFB():NaN}set autoLevelCapping(t){this._autoLevelCapping!==t&&(this.logger.log(`set autoLevelCapping:${t}`),this._autoLevelCapping=t,this.levelController.checkMaxAutoUpdated())}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(t){(function(t){return Dh.indexOf(t)>-1})(t)&&this._maxHdcpLevel!==t&&(this._maxHdcpLevel=t,this.levelController.checkMaxAutoUpdated())}get autoLevelEnabled(){return-1===this.levelController.manualLevel}get manualLevel(){return this.levelController.manualLevel}get minAutoLevel(){const{levels:t,config:{minAutoBitrate:e}}=this;if(!t)return 0;const i=t.length;for(let s=0;s<i;s++)if(t[s].maxBitrate>=e)return s;return 0}get maxAutoLevel(){const{levels:t,autoLevelCapping:e,maxHdcpLevel:i}=this;let s;if(s=-1===e&&null!=t&&t.length?t.length-1:e,i)for(let r=s;r--;){const e=t[r].attrs["HDCP-LEVEL"];if(e&&e<=i)return r}return s}get firstAutoLevel(){return this.abrController.firstAutoLevel}get nextAutoLevel(){return this.abrController.nextAutoLevel}set nextAutoLevel(t){this.abrController.nextAutoLevel=t}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}get maxBufferLength(){return this.streamController.maxBufferLength}setAudioOption(t){var e;return(null==(e=this.audioTrackController)?void 0:e.setAudioOption(t))||null}setSubtitleOption(t){var e;return(null==(e=this.subtitleTrackController)?void 0:e.setSubtitleOption(t))||null}get allAudioTracks(){const t=this.audioTrackController;return t?t.allAudioTracks:[]}get audioTracks(){const t=this.audioTrackController;return t?t.audioTracks:[]}get audioTrack(){const t=this.audioTrackController;return t?t.audioTrack:-1}set audioTrack(t){const e=this.audioTrackController;e&&(e.audioTrack=t)}get allSubtitleTracks(){const t=this.subtitleTrackController;return t?t.allSubtitleTracks:[]}get subtitleTracks(){const t=this.subtitleTrackController;return t?t.subtitleTracks:[]}get subtitleTrack(){const t=this.subtitleTrackController;return t?t.subtitleTrack:-1}get media(){return this._media}set subtitleTrack(t){const e=this.subtitleTrackController;e&&(e.subtitleTrack=t)}get subtitleDisplay(){const t=this.subtitleTrackController;return!!t&&t.subtitleDisplay}set subtitleDisplay(t){const e=this.subtitleTrackController;e&&(e.subtitleDisplay=t)}get lowLatencyMode(){return this.config.lowLatencyMode}set lowLatencyMode(t){this.config.lowLatencyMode=t}get liveSyncPosition(){return this.latencyController.liveSyncPosition}get latency(){return this.latencyController.latency}get maxLatency(){return this.latencyController.maxLatency}get targetLatency(){return this.latencyController.targetLatency}set targetLatency(t){this.latencyController.targetLatency=t}get drift(){return this.latencyController.drift}get forceStartLoad(){return this.streamController.forceStartLoad}get pathways(){return this.levelController.pathways}get pathwayPriority(){return this.levelController.pathwayPriority}set pathwayPriority(t){this.levelController.pathwayPriority=t}get bufferedToEnd(){var t;return!(null==(t=this.bufferController)||!t.bufferedToEnd)}get interstitialsManager(){var t;return(null==(t=this.interstitialsController)?void 0:t.interstitialsManager)||null}getMediaDecodingInfo(t,e=this.allAudioTracks){return Rh(t,jh(e),navigator.mediaCapabilities)}}XA.defaultConfig=void 0;const ZA=(JA=function(t){if(!(null==t?void 0:t.prototype))return t;const e=_l(t,"video");e&&!`${e}`.includes("[native code]")||Object.defineProperty(t.prototype,"videoTracks",{get(){return function(t){let e=El(t).videoTracks;if(!e&&(e=new bl,El(t).videoTracks=e,Fl)){const i=Fl.call(t.nativeEl??t);for(const e of i)Tl(t,e);const s=()=>{e.dispatchEvent(new Event("change"))},r=s=>{if([...e].some(t=>t instanceof wl))for(const t of i)Sl(t);else Tl(t,s.track)},n=t=>{Sl(t.track)};i.addEventListener("change",s),i.addEventListener("addtrack",r),i.addEventListener("removetrack",n)}return e}(this)}});const i=_l(t,"audio");i&&!`${i}`.includes("[native code]")||Object.defineProperty(t.prototype,"audioTracks",{get(){return function(t){let e=El(t).audioTracks;if(!e&&(e=new Ol,El(t).audioTracks=e,Nl)){const i=Nl.call(t.nativeEl??t);for(const e of i)Pl(t,e);const s=()=>{e.dispatchEvent(new Event("change"))},r=s=>{if([...e].some(t=>t instanceof Bl))for(const t of i)Ml(t);else Pl(t,s.track)},n=t=>{Ml(t.track)};i.addEventListener("change",s),i.addEventListener("addtrack",r),i.addEventListener("removetrack",n)}return e}(this)}}),"addVideoTrack"in t.prototype||(t.prototype.addVideoTrack=function(t,e="",i=""){const s=new wl;return s.kind=t,s.label=e,s.language=i,Tl(this,s),s}),"removeVideoTrack"in t.prototype||(t.prototype.removeVideoTrack=Sl),"addAudioTrack"in t.prototype||(t.prototype.addAudioTrack=function(t,e="",i=""){const s=new Bl;return s.kind=t,s.label=e,s.language=i,Pl(this,s),s}),"removeAudioTrack"in t.prototype||(t.prototype.removeAudioTrack=Ml),"videoRenditions"in t.prototype||Object.defineProperty(t.prototype,"videoRenditions",{get(){return s(this)}});const s=t=>{let e=El(t).videoRenditions;return e||(e=new Rl,El(e).media=new WeakRef(t),El(t).videoRenditions=e),e};"audioRenditions"in t.prototype||Object.defineProperty(t.prototype,"audioRenditions",{get(){return r(this)}});const r=t=>{let e=El(t).audioRenditions;return e||(e=new Cl,El(e).media=new WeakRef(t),El(t).audioRenditions=e),e};return t}(Al),tv=class extends JA{constructor(){super(),L(this,sv),L(this,ev,null),L(this,iv,null),L(this,nv,()=>{var t,e,i;(null==(t=this.nativeEl)?void 0:t.webkitCurrentPlaybackTargetIsWireless)?null==(e=this.api)||e.stopLoad():null==(i=this.api)||i.startLoad()}),k(this,sv,av).call(this,"config")}get config(){return I(this,iv)}set config(t){R(this,iv,t)}attributeChangedCallback(t,e,i){"src"!==t&&super.attributeChangedCallback(t,e,i),"src"===t&&e!=i&&this.load()}async load(){var t,e;const i=!this.api;if(k(this,sv,rv).call(this),this.src){if(i&&!I(this,iv)&&R(this,iv,JSON.parse((null==(t=this.shadowRoot.getElementById("config"))?void 0:t.textContent)||"{}")),XA.isSupported()){switch(await Promise.resolve(),this.api=new XA({liveDurationInfinity:!0,autoStartLoad:!1,...this.config}),this.api.loadSource(this.src),this.api.attachMedia(this.nativeEl),this.nativeEl.preload){case"none":{const t=()=>this.api.startLoad();this.nativeEl.addEventListener("play",t,{once:!0}),this.api.on(XA.Events.DESTROYING,()=>{this.nativeEl.removeEventListener("play",t)});break}case"metadata":{const t=this.api.config.maxBufferLength,e=this.api.config.maxBufferSize;this.api.config.maxBufferLength=1,this.api.config.maxBufferSize=1;const i=()=>{this.api.config.maxBufferLength=t,this.api.config.maxBufferSize=e};this.nativeEl.addEventListener("play",i,{once:!0}),this.api.on(XA.Events.DESTROYING,()=>{this.nativeEl.removeEventListener("play",i)}),this.api.startLoad();break}default:this.api.startLoad()}this.nativeEl.webkitCurrentPlaybackTargetIsWireless&&this.api.stopLoad(),this.nativeEl.addEventListener("webkitcurrentplaybacktargetiswirelesschanged",I(this,nv)),R(this,ev,document.createElement("source")),I(this,ev).setAttribute("type","application/x-mpegURL"),I(this,ev).setAttribute("src",this.src),this.nativeEl.disableRemotePlayback=!1,this.nativeEl.append(I(this,ev));const t=new WeakMap;this.api.on(XA.Events.MANIFEST_PARSED,(e,i)=>{this.nativeEl.autoplay&&this.nativeEl.paused&&this.nativeEl.play().catch(t=>{}),r();let s=this.videoTracks.getTrackById("main");s||(s=this.addVideoTrack("main"),s.id="main",s.selected=!0);for(const[r,n]of i.levels.entries()){const e=s.addRendition(n.url[0],n.width,n.height,n.videoCodec,n.bitrate);t.set(n,`${r}`),e.id=`${r}`}for(let[t,r]of i.audioTracks.entries()){const e=r.default?"main":"alternative",i=this.addAudioTrack(e,r.name,r.lang);i.id=`${t}`,r.default&&(i.enabled=!0)}}),this.audioTracks.addEventListener("change",()=>{var t;const e=+(null==(t=[...this.audioTracks].find(t=>t.enabled))?void 0:t.id),i=this.api.audioTracks.map(t=>t.id);e!=this.api.audioTrack&&i.includes(e)&&(this.api.audioTrack=e)}),this.api.on(XA.Events.LEVELS_UPDATED,(e,i)=>{const s=this.videoTracks[this.videoTracks.selectedIndex??0];if(!s)return;const r=i.levels.map(e=>t.get(e));for(const t of this.videoRenditions)t.id&&!r.includes(t.id)&&s.removeRendition(t)});let i=null;this.api.on(XA.Events.ERROR,(t,e)=>{e.type===XA.ErrorTypes.NETWORK_ERROR&&e.details===XA.ErrorDetails.FRAG_LOAD_ERROR&&(i=e.frag.level)}),this.api.on(XA.Events.LEVEL_SWITCHED,(t,e)=>{const s=e.level;null!==i&&s<i&&(this.videoRenditions.selectedIndex=s,i=null)});const s=t=>{const e=t.target.selectedIndex;e!=this.api.nextLevel&&(this.api.nextLevel=e)};null==(e=this.videoRenditions)||e.addEventListener("change",s);const r=()=>{for(const t of this.videoTracks)this.removeVideoTrack(t);for(const t of this.audioTracks)this.removeAudioTrack(t)};return void this.api.once(XA.Events.DESTROYING,r)}await Promise.resolve(),this.nativeEl.canPlayType("application/vnd.apple.mpegurl")&&(this.nativeEl.src=this.src)}}},ev=new WeakMap,iv=new WeakMap,sv=new WeakSet,rv=function(){var t,e;null==(t=I(this,ev))||t.remove(),null==(e=this.nativeEl)||e.removeEventListener("webkitcurrentplaybacktargetiswirelesschanged",I(this,nv)),this.api&&(this.api.detachMedia(),this.api.destroy(),this.api=null)},nv=new WeakMap,av=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){const e=this[t];delete this[t],this[t]=e}},S(tv,"shadowRootOptions",{...JA.shadowRootOptions}),S(tv,"getTemplateHTML",(t,e={})=>{const{src:i,...s}=t;return`\n <script type="application/json" id="config">\n ${JSON.stringify(e.config||{})}\n <\/script>\n ${JA.getTemplateHTML(s)}\n `}),tv);var JA,tv,ev,iv,sv,rv,nv,av;globalThis.customElements&&!globalThis.customElements.get("hls-video")&&globalThis.customElements.define("hls-video",ZA);const ov="_videoContainer_119iz_3",lv="_cardVideo_119iz_10",dv=({card:t,cardIndex:e=0,isActive:i=!1,isMuted:s,volume:r=.5,onVideoReady:n,onPlayRequested:a,ready:o=!0,className:l=""})=>{const d=D.useRef(null);D.useEffect(()=>{d.current&&n&&o&&n(d.current)},[o]),D.useEffect(()=>{i&&d.current&&a&&o&&a(d.current)},[i,o]),D.useEffect(()=>{d.current&&o&&(d.current.muted=s,void 0!==d.current.volume&&(d.current.volume=r))},[s,r,o]),D.useEffect(()=>{if(!d.current||!t.videoUrl)return;const e=d.current;e.setAttribute("src",t.videoUrl),t.videoThumbnail&&(e.poster=t.videoThumbnail,e.setAttribute("poster",t.videoThumbnail)),e.autoplay=!1,e.muted=s},[t.videoUrl,t.videoThumbnail,s]);const h=0===e||1===e?"none":"auto";return w.jsx(w.Fragment,{children:t.videoUrl&&o&&w.jsx("div",{className:ov,children:w.jsx("hls-video",{ref:d,id:`video-card-${t.id}`,class:lv,src:t.videoUrl,muted:s,loop:!0,playsInline:!0,preload:h,...t.videoThumbnail?{poster:t.videoThumbnail}:{}})})})},hv="_swipeableCard_14c6z_1",cv="_swipeHeadline_14c6z_25",uv=t=>"video"===t.type,fv=100,gv=1,mv=.35,pv=.25,Av=.35,vv=600,yv=(t,e,i=!1)=>{const s=Math.abs(t)>Math.abs(e)?t>0?"right":"left":e>0?"down":"up";return i?s.charAt(0).toUpperCase()+s.slice(1):s},Ev=D.forwardRef(({card:t,cardIndex:e=0,cardUIConfig:i,isActive:s=!1,swipeOptions:r,creation:n,isAnimating:a=!1,animateDirection:o,onSwipeLeft:l,onSwipeRight:d,onSwipeUp:h,onSwipeDown:c,isMuted:u=!0,volume:f=.5,onVideoReady:g,onPlayRequested:m,onImageReady:p,ready:A=!0,className:v="",zIndex:y,tutorialXOffset:E=0},T)=>{const S=D.useRef(null),b=Do(0),I=Do(0),L=Do(1),[R,k]=D.useState({text:"",opacity:0}),C=D.useRef(null),x=D.useRef(0),P=D.useRef(null),M=xo(b,t=>t+E),O=D.useCallback(()=>r||((null==n?void 0:n.swipeOptions)?n.swipeOptions:{right:{enabled:!0,gesture:!0,label:"RIGHT"},left:{enabled:!0,gesture:!0,label:"LEFT"},up:{enabled:!0,gesture:!0,label:"UP"},down:{enabled:!0,gesture:!0,label:"DOWN"}}),[r,n]),B=D.useCallback(()=>{const t=O();return{right:t.right.label,left:t.left.label,up:t.up.label,down:t.down.label}},[O]),F=D.useCallback((t,e)=>{if(!s||a)return;const{offset:i}=e;P.current||(Math.abs(i.x)>5||Math.abs(i.y)>5)&&(P.current=Math.abs(i.x)>Math.abs(i.y)?"x":"y");const r=O(),n="x"===P.current?i.x:0,o="y"===P.current?i.y:0,l=n>0&&r.right.enabled&&r.right.gesture||n<0&&r.left.enabled&&r.left.gesture,d=o<0&&r.up.enabled&&r.up.gesture||o>0&&r.down.enabled&&r.down.gesture;if("x"===P.current&&!l)return;if("y"===P.current&&!d)return;b.set(n),I.set(o);const h=Math.sqrt(n**2+o**2);L.set((t=>1-Math.min(t/(4*fv),1)*(1-mv))(h));const c=yv(n,o,!0),u=Math.min(h/fv*3,gv);if(c!==C.current||Math.abs(u-x.current)>.05){C.current=c,x.current=u;const t=B(),e="Left"===c?t.left:"Right"===c?t.right:"Up"===c?t.up:"Down"===c?t.down:"";k({text:e,opacity:u})}},[s,a,O,B,b,I,L]),N=D.useCallback((t,e)=>{if(!s||a)return;const{offset:i}=e,r="x"===P.current?i.x:0,n="y"===P.current?i.y:0;P.current=null;const o=O(),u=r>0&&o.right.enabled&&o.right.gesture||r<0&&o.left.enabled&&o.left.gesture,f=n<0&&o.up.enabled&&o.up.gesture||n>0&&o.down.enabled&&o.down.gesture;if(Math.abs(r)>fv&&u||Math.abs(n)>fv&&f){const t=yv(r,n);el(L,pv,{duration:Av,ease:"easeOut"}),requestAnimationFrame(()=>{"right"===t&&d?(d(),k({text:"",opacity:0})):"left"===t&&l?(l(),k({text:"",opacity:0})):"up"===t&&h?(h(),k({text:"",opacity:0})):"down"===t&&c&&(c(),k({text:"",opacity:0}))})}else el(b,0,{type:"spring",stiffness:400,damping:30,duration:.15}),el(I,0,{type:"spring",stiffness:400,damping:30,duration:.15}),el(L,1,{type:"spring",stiffness:400,damping:30,duration:.15});C.current=null,x.current=0},[s,a,O,l,d,h,c,b,I,L]),_=D.useRef(null);D.useEffect(()=>{if(o&&o!==_.current&&s&&S.current){_.current=o;const t=S.current.getBoundingClientRect(),e=t.width,i=t.height,s="up"===o?1.25*-i:"down"===o?1.25*i:0;el(b,"left"===o?1.25*-e:"right"===o?1.25*e:0,{duration:vv/1e3,ease:"easeOut"}),el(I,s,{duration:vv/1e3,ease:"easeOut"}),el(L,pv,{duration:Av,ease:"easeOut"})}else!o&&_.current&&(_.current=null,b.set(0),I.set(0),L.set(1))},[o,s,L,b,I]),D.useEffect(()=>{s||(b.set(0),I.set(0),L.set(1),k({text:"",opacity:0}),P.current=null)},[s,b,I,L]),D.useImperativeHandle(T,()=>({fadeOut:()=>{el(L,pv,{duration:Av,ease:"easeOut"})}}),[L]);const U=O(),H=U.left.enabled&&U.left.gesture||U.right.enabled&&U.right.gesture,j=U.up.enabled&&U.up.gesture||U.down.enabled&&U.down.gesture;return w.jsxs(wo.div,{ref:S,drag:s&&!a&&(H||j),dragConstraints:{left:0,right:0,top:0,bottom:0},dragElastic:1,dragPropagation:!1,onDrag:F,onDragEnd:N,className:`${hv} ${v}`.trim(),style:{x:M,y:I,opacity:L,zIndex:y,cursor:s&&!a&&(H||j)?"grab":"default"},whileDrag:{cursor:"grabbing"},children:[w.jsx(ll,{card:t,cardUIConfig:i,children:uv(t)?w.jsx(dv,{card:t,cardIndex:e,isActive:s,isMuted:u,volume:f,onVideoReady:e=>{g&&g(e,t.id)},onPlayRequested:e=>{m&&m(e,t.id)},ready:A}):w.jsx(hl,{card:t,onImageReady:e=>{p&&p(e,t.id)},ready:A})}),w.jsx("div",{className:cv,style:{opacity:R.opacity},children:R.text})]})}),Tv="_ctaTooltip_1mai4_2",Sv="_ctaTooltipArrow_1mai4_22",bv=({currentCardId:t,currentCardIndex:e=0,totalCards:i=10,tooltipText:s,tooltipTextColor:r,tooltipTextSize:n,tooltipBackgroundColor:a,tooltipKeep:o=!1,assetTooltips:l={},buttonContainerId:d="buttonsContainer",onFirstSwipe:h,className:c=""})=>{var u;const[f,g]=D.useState(t??null),[m,p]=D.useState(e),[A,v]=D.useState(i),[y,E]=D.useState(e>0),T=D.useRef(null),S=D.useRef(e),b=f&&(null==(u=l[f])?void 0:u.enabled)?l[f]:null,I=(null==b?void 0:b.text)??s??null,L=!(m>=A)&&""!==(I??"")&&(!y||o);D.useEffect(()=>{void 0!==t&&g(t)},[t]),D.useEffect(()=>{const t=S.current;S.current=e,p(e),e>0&&0===t&&!y?(E(!0),h&&h()):e>0&&!y&&E(!0)},[e,y,h]),D.useEffect(()=>{v(i)},[i]);const[R,k]=D.useState(100);D.useEffect(()=>{const t=document.getElementById(d);if(!t)return;const e=new ResizeObserver(t=>{for(const e of t)k(e.contentRect.width)});return e.observe(t),T.current=e,()=>{T.current&&(T.current.disconnect(),T.current=null)}},[d]);const C=(null==b?void 0:b.textColor)??r,x=(null==b?void 0:b.textSize)??n,P=(null==b?void 0:b.backgroundColor)??a;if(!I)return null;const M=I.replace(/<br>/g,"\n"),O=P??"#FFFFFF",B=`calc((${R}px / 2) + 2px)`;return w.jsxs("div",{className:`${Tv} ${c}`.trim(),style:{fontSize:x?`${x}px`:"12px",backgroundColor:O,color:C??"#333333",opacity:L?1:0},children:[M,w.jsx("div",{className:Sv,style:{right:B,backgroundColor:O}})]})},Iv={verticalEmojisButtons:"_verticalEmojisButtons_14t5d_2",buttonContainer:"_buttonContainer_14t5d_11",button:"_button_14t5d_11",emojiIcon:"_emojiIcon_14t5d_45",buttonLabel:"_buttonLabel_14t5d_56",buttonAnimation:"_buttonAnimation_14t5d_62",buttonLikeAnimation:"_buttonLikeAnimation_14t5d_80",buttonDislikeAnimation:"_buttonDislikeAnimation_14t5d_85",buttonMaybeAnimation:"_buttonMaybeAnimation_14t5d_90",buttonSeenAnimation:"_buttonSeenAnimation_14t5d_95",contrastMode:"_contrastMode_14t5d_101",contrastModeButton:"_contrastModeButton_14t5d_109",contrastModeLabel:"_contrastModeLabel_14t5d_119",contrastModeLike:"_contrastModeLike_14t5d_130",contrastModeDislike:"_contrastModeDislike_14t5d_135",contrastModeMaybe:"_contrastModeMaybe_14t5d_140",contrastModeSeen:"_contrastModeSeen_14t5d_145"},Lv=({buttons:t,tooltipText:e,tooltipTextColor:i,tooltipTextSize:s,tooltipBackgroundColor:r,tooltipKeep:n,verticalPosition:a,horizontalPosition:o,buttonClass:l,containerClass:d,labelClass:h,onButtonClick:c,isAnimating:u=!1,visible:f=!0,className:g="",id:m="buttonsContainer",currentCardIndex:p,totalCards:A,onFirstSwipe:v})=>{const[y,E]=D.useState(null),T=D.useRef(null),S=D.useRef(null);D.useEffect(()=>()=>{S.current&&clearTimeout(S.current)},[]);const b=e&&e.trim().length>0;return f?w.jsxs("div",{ref:T,id:m,className:`${Iv.verticalEmojisButtons} contrast-mode ${d||""} ${g}`.trim(),style:{...void 0!==a&&{top:`${a}px`},...void 0!==o&&{right:`${o}px`}},children:[b&&w.jsx(bv,{tooltipText:e,tooltipTextColor:i,tooltipTextSize:s,tooltipBackgroundColor:r,tooltipKeep:n,buttonContainerId:m,currentCardIndex:p,totalCards:A,onFirstSwipe:v}),t.map(t=>{const e=y===t.id;return w.jsxs("div",{className:Iv.buttonContainer,children:[w.jsx("div",{className:`${Iv.button} ${t.action}-btn ${l||""} ${Iv.contrastModeButton} ${Iv[`contrastMode${t.action.charAt(0).toUpperCase()+t.action.slice(1)}`]||""} ${e&&Iv[`button${t.action.charAt(0).toUpperCase()+t.action.slice(1)}Animation`]||""}`.trim(),onClick:()=>(t=>{u||(E(t.id),S.current&&clearTimeout(S.current),S.current=setTimeout(()=>{E(null)},300),c&&c(t.action,t.id))})(t),children:w.jsx("img",{src:t.icon,alt:t.altText,className:Iv.emojiIcon})}),w.jsx("span",{className:`${Iv.buttonLabel} ${Iv.contrastModeLabel} ${h||""}`.trim(),children:t.label})]},t.id)})]}):null},Rv={sideButtonsContainer:"_sideButtonsContainer_jjr9u_2",sideButtonsWrapper:"_sideButtonsWrapper_jjr9u_16",sideButtonContainer:"_sideButtonContainer_jjr9u_28",sideButtonLeft:"_sideButtonLeft_jjr9u_36",sideButtonRight:"_sideButtonRight_jjr9u_45",sideButtonTop:"_sideButtonTop_jjr9u_54",sideButtonBottom:"_sideButtonBottom_jjr9u_62",sideButton:"_sideButton_jjr9u_2",buttonContent:"_buttonContent_jjr9u_95",arrowWrapper:"_arrowWrapper_jjr9u_103",emojiWrapper:"_emojiWrapper_jjr9u_104",arrowRight:"_arrowRight_jjr9u_120",arrowLeft:"_arrowLeft_jjr9u_124",arrowUp:"_arrowUp_jjr9u_128",arrowDown:"_arrowDown_jjr9u_132",emojiIcon:"_emojiIcon_jjr9u_137",buttonLabel:"_buttonLabel_jjr9u_144",moveRight:"_moveRight_jjr9u_1",moveLeft:"_moveLeft_jjr9u_1",moveUp:"_moveUp_jjr9u_1",moveDown:"_moveDown_jjr9u_1"},kv=({direction:t,size:e=32})=>w.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:(()=>{switch(t){case"right":default:return Rv.arrowRight;case"left":return Rv.arrowLeft;case"up":return Rv.arrowUp;case"down":return Rv.arrowDown}})(),children:w.jsx("path",{d:"M5 12h14M12 5l7 7-7 7"})}),wv=({button:t,position:e,onButtonClick:i,isAnimating:s,buttonClass:r,labelClass:n,currentAnimation:a=0,showEmoji:o=!1,buttonSize:l=80})=>{const d=il(),h=(()=>{switch(t.action){case"like":default:return"right";case"dislike":return"left";case"maybe":return"up";case"seen":return"down"}})(),c=["right","left","up","down"][a]===h,u=.4*l,f=Rv[`sideButton${e.charAt(0).toUpperCase()+e.slice(1)}`]||"";return w.jsx("div",{className:`${Rv.sideButtonContainer} ${f}`,children:w.jsxs(wo.button,{onClick:async()=>{s||(await d.start({scale:1.2,transition:{type:"spring",stiffness:400,damping:17,duration:.15}}),await d.start({scale:1,transition:{type:"spring",stiffness:400,damping:17,duration:.15}}),i&&i(t.action,t.id))},onContextMenu:t=>t.preventDefault(),className:`${Rv.sideButton} ${t.action}-btn ${r||""}`.trim(),animate:d,whileHover:{scale:1.1,transition:{duration:.2}},style:{WebkitTouchCallout:"none",WebkitUserSelect:"none",touchAction:"manipulation",cursor:"pointer",pointerEvents:"auto",width:`${l}px`,height:`${l}px`},"aria-label":t.altText,children:[w.jsxs("div",{className:Rv.buttonContent,style:{width:`${u}px`,height:`${u}px`},children:[w.jsx("div",{className:Rv.arrowWrapper,style:{opacity:c&&o?0:1,transition:"opacity 0.15s ease"},children:w.jsx(kv,{direction:h,size:u})}),w.jsx("div",{className:Rv.emojiWrapper,style:{opacity:c&&o?1:0,transition:"opacity 0.15s ease"},children:w.jsx("img",{src:t.icon,alt:t.altText,className:Rv.emojiIcon,style:{width:`${u}px`,height:`${u}px`}})})]}),w.jsx("span",{className:`${Rv.buttonLabel} ${n||""}`.trim(),children:t.label})]})})},Dv=({buttons:t,buttonClass:e,containerClass:i,labelClass:s,buttonSize:r=80,onButtonClick:n,isAnimating:a=!1,visible:o=!0,className:l="",id:d="buttonsContainer"})=>{const[h,c]=D.useState(0),[u,f]=D.useState(!1),g=t.find(t=>"like"===t.action&&!1!==t.enabled),m=t.find(t=>"dislike"===t.action&&!1!==t.enabled),p=t.find(t=>"maybe"===t.action&&!1!==t.enabled),A=t.find(t=>"seen"===t.action&&!1!==t.enabled);return D.useEffect(()=>{f(!1);const t=setTimeout(()=>{f(!0)},300),e=setTimeout(()=>{f(!1)},1500);return()=>{clearTimeout(t),clearTimeout(e)}},[h]),D.useEffect(()=>{const t=setInterval(()=>{c(t=>(t+1)%4)},2e3);return()=>clearInterval(t)},[]),o?w.jsx("div",{id:d,className:`${Rv.sideButtonsContainer} ${i||""} ${l}`.trim(),children:w.jsxs("div",{className:Rv.sideButtonsWrapper,children:[p&&w.jsx(wv,{button:p,position:"top",onButtonClick:n,isAnimating:a,buttonClass:e,labelClass:s,currentAnimation:h,showEmoji:u,buttonSize:r}),m&&w.jsx(wv,{button:m,position:"left",onButtonClick:n,isAnimating:a,buttonClass:e,labelClass:s,currentAnimation:h,showEmoji:u,buttonSize:r}),g&&w.jsx(wv,{button:g,position:"right",onButtonClick:n,isAnimating:a,buttonClass:e,labelClass:s,currentAnimation:h,showEmoji:u,buttonSize:r}),A&&w.jsx(wv,{button:A,position:"bottom",onButtonClick:n,isAnimating:a,buttonClass:e,labelClass:s,currentAnimation:h,showEmoji:u,buttonSize:r})]})}):null},Cv="_horizontalCtaTooltip_1slua_1",xv=({currentCardId:t,currentCardIndex:e=0,tooltipText:i,tooltipTextColor:s,tooltipTextSize:r,tooltipBackgroundColor:n,tooltipKeep:a=!1,tooltipBottomOffset:o,assetTooltips:l={},onFirstSwipe:d,className:h=""})=>{var c;const[u,f]=D.useState(t??null),[g,m]=D.useState(e),[p,A]=D.useState(e>0),v=D.useRef(e),y=u&&(null==(c=l[u])?void 0:c.enabled)?l[u]:null,E=(null==y?void 0:y.text)??i??null,T=(0===g||a||((null==y?void 0:y.enabled)??!1))&&""!==(E??"")&&(!p||a);D.useEffect(()=>{void 0!==t&&f(t)},[t]),D.useEffect(()=>{const t=v.current;v.current=e,m(e),e>0&&0===t&&!p?(A(!0),d&&d()):e>0&&!p&&A(!0)},[e,p,d]);const S=(null==y?void 0:y.textColor)??s,b=(null==y?void 0:y.textSize)??r,I=(null==y?void 0:y.backgroundColor)??n,L=(null==y?void 0:y.bottomOffset)??o;if(!E)return null;const R=E.replace(/<br>/g,"\n");return w.jsx("div",{className:`${Cv} ${h}`.trim(),style:{bottom:void 0!==L?`calc(${L}px + 50%)`:"50%",backgroundColor:I??"#FFFFFF",color:S??"#333333",fontSize:b?`${b}px`:"12px",opacity:T?1:0,pointerEvents:T?"auto":"none"},children:R})},Pv={sideButtonsContainer:"_sideButtonsContainer_1kkly_2",sideButtonsWrapper:"_sideButtonsWrapper_1kkly_16",sideButtonContainer:"_sideButtonContainer_1kkly_28",sideButtonLeft:"_sideButtonLeft_1kkly_36",sideButtonRight:"_sideButtonRight_1kkly_45",sideButtonTop:"_sideButtonTop_1kkly_54",sideButtonBottom:"_sideButtonBottom_1kkly_62",sideButton:"_sideButton_1kkly_2",buttonContent:"_buttonContent_1kkly_99",buttonLabel:"_buttonLabel_1kkly_111",arrowRight:"_arrowRight_1kkly_126",arrowLeft:"_arrowLeft_1kkly_130",arrowUp:"_arrowUp_1kkly_134",arrowDown:"_arrowDown_1kkly_138",moveRight:"_moveRight_1kkly_1",moveLeft:"_moveLeft_1kkly_1",moveUp:"_moveUp_1kkly_1",moveDown:"_moveDown_1kkly_1",tooltipWrapper:"_tooltipWrapper_1kkly_277"},Mv=({direction:t,size:e=32})=>w.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:(()=>{switch(t){case"right":default:return Pv.arrowRight;case"left":return Pv.arrowLeft;case"up":return Pv.arrowUp;case"down":return Pv.arrowDown}})(),children:w.jsx("path",{d:"M5 12h14M12 5l7 7-7 7"})}),Ov=({button:t,position:e,onButtonClick:i,isAnimating:s,buttonClass:r,labelClass:n,currentAnimation:a=0,buttonSize:o=80})=>{const l=il(),d=(()=>{switch(t.action){case"like":default:return"right";case"dislike":return"left";case"maybe":return"up";case"seen":return"down"}})(),h=.4*o,c=Pv[`sideButton${e.charAt(0).toUpperCase()+e.slice(1)}`]||"";return w.jsx("div",{className:`${Pv.sideButtonContainer} ${c}`,children:w.jsxs(wo.button,{onClick:async()=>{s||(await l.start({scale:1.2,transition:{type:"spring",stiffness:400,damping:17,duration:.15}}),await l.start({scale:1,transition:{type:"spring",stiffness:400,damping:17,duration:.15}}),i&&i(t.action,t.id))},onContextMenu:t=>t.preventDefault(),className:`${Pv.sideButton} ${t.action}-btn ${r||""}`.trim(),animate:l,whileHover:{scale:1.1,transition:{duration:.2}},style:{width:`${o}px`,height:`${o}px`},"aria-label":t.altText,children:[w.jsx("div",{className:Pv.buttonContent,style:{width:`${h}px`,height:`${h}px`},children:w.jsx(Mv,{direction:d,size:h})}),w.jsx("span",{className:`${Pv.buttonLabel} ${n||""}`.trim(),children:t.label})]})})},Bv=({buttons:t,ctaText:e,isDemoMode:i=!1,tooltipTextColor:s,tooltipTextSize:r,tooltipBackgroundColor:n,tooltipKeep:a,tooltipBottomOffset:o,currentCardIndex:l,onFirstSwipe:d,buttonClass:h,containerClass:c,labelClass:u,buttonSize:f=80,onButtonClick:g,isAnimating:m=!1,visible:p=!0,className:A="",id:v="buttonsContainer"})=>{const[y,E]=D.useState(0),T=t.find(t=>"like"===t.action&&t.enabled),S=t.find(t=>"dislike"===t.action&&t.enabled),b=t.find(t=>"maybe"===t.action&&t.enabled),I=t.find(t=>"seen"===t.action&&t.enabled);if(D.useEffect(()=>{const t=setInterval(()=>{E(t=>(t+1)%4)},2e3);return()=>clearInterval(t)},[]),!p)return null;const L=i&&e&&e.trim().length>0;return w.jsx("div",{id:v,className:`${Pv.sideButtonsContainer} ${c||""} ${A}`.trim(),children:w.jsxs("div",{className:Pv.sideButtonsWrapper,children:[b&&w.jsx(Ov,{button:b,position:"top",onButtonClick:g,isAnimating:m,buttonClass:h,labelClass:u,currentAnimation:y,buttonSize:f}),S&&w.jsx(Ov,{button:S,position:"left",onButtonClick:g,isAnimating:m,buttonClass:h,labelClass:u,currentAnimation:y,buttonSize:f}),L&&w.jsx("div",{className:Pv.tooltipWrapper,children:w.jsx(xv,{tooltipText:e,tooltipTextColor:s,tooltipTextSize:r,tooltipBackgroundColor:n,tooltipKeep:a,tooltipBottomOffset:o,currentCardIndex:l??0,onFirstSwipe:d})}),T&&w.jsx(Ov,{button:T,position:"right",onButtonClick:g,isAnimating:m,buttonClass:h,labelClass:u,currentAnimation:y,buttonSize:f}),I&&w.jsx(Ov,{button:I,position:"bottom",onButtonClick:g,isAnimating:m,buttonClass:h,labelClass:u,currentAnimation:y,buttonSize:f})]})})},Fv="_swipeTutorialOverlay_jbb64_2",Nv="_handContainer_jbb64_16",_v="_handIcon_jbb64_24",Uv="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABBwAAAQ4AQAAAACC3fKIAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAnRSTlMAAHaTzTgAAAACYktHRAAB3YoTpAAAAAd0SU1FB+oCCwgOA99Ta6kAABV7SURBVHja7Z1PsqwqEsY1HDBk2jOWwtK0ozfmDnoLLsGhEW1o3z/nVKklmh9kJt53YfTOfVXUTyA/kgSTqiqllFJKKaWUUkoppZRSSinl7y71OrDX6RbwC806sUO0a4d9wa8rN0Ozoq3brij2bbEr2Lr1uq4995BY1xltOvaR+aOHsS4268o+Mn/0MNbFP/oPbLv7sqJd7Pghfg4zrIt/9t8iADGi/beyywQ4zn5+gVkofo51qItrKYgFbTpmCLuCXfyLmlkyLfpgVgDCoXX+/sIgADFgMiEDMYIyIQIxgTIhAjGDMiECsYAyIQKxgjIhA9FhMiED0YOfF4EYMAuVgRgxC5WBmDALlYGYMQsV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C10IxS3g2IVs1C68b9p2S1084AjdUiwWyjd8F62zD2R7yun9sbMD+Fog2LTGxM/hKFV3q5yFrprZ5IRCVjorvqR0mkSFroVoZnUGwIWuqu/uzchEePY/cBIaYhJAoLQ3duPSBjHTgFCP7BlkDCOnY0GfmHHIGIcOwk47XC7Y1gqkXLzG/t2kDGO/dD//JEDg4xx7EXgvgwyEBaC6GUgDATRyUA0CIOQcXyOvasySUG0AMQoBeHzj8vD/HRTpBgQ85jFIJoHjEvEPAY5iDb/uERGphwDfWQughDNA8YlfWQOkhA+7xQKjUzJIUEemaJDYu9xZxoSVLmSZaCNzFkYwmZ1aBC56oUhquwGShwUsziEeUBvUAZFJw5xrxSTPMP99DEoQNSZ5ZLUH5MKhM3fG7f20VX5+0OnIW76Q6khLpti1GK4kgq1hrhoil6PIdwUig0RbIpKtZiMYnndFr02w0lbLFUppZRSSimllFJKKaWUUkoppZQSKP8HUbkEDAG+x4EAAAAldEVYdGRhdGU6Y3JlYXRlADIwMjYtMDItMTFUMDg6MTQ6MDMrMDA6MDCAmdYbAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDI2LTAyLTExVDA4OjE0OjAzKzAwOjAw8cRupwAAAABJRU5ErkJggg==",Hv=({size:t=80,src:e,alt:i})=>w.jsx("img",{src:e,alt:i,className:_v,style:{width:`${t}px`,height:`${t}px`}}),jv=({visible:t=!0,onCardMove:e,animationDuration:i=3e3,startDelay:s=500,className:r="",id:n="swipeTutorialOverlay"})=>{const a=il(),o=D.useRef(null),l=D.useRef(!1),[d,h]=D.useState(Uv);return D.useEffect(()=>{if(!t)return a.set({x:0}),h(Uv),e&&e(0),o.current&&(cancelAnimationFrame(o.current),o.current=null),void(l.current=!1);if(l.current)return;l.current=!0;return(async()=>{for(await new Promise(t=>setTimeout(t,s));t&&l.current;)h(Uv),await a.start({x:0,transition:{duration:.4,ease:"easeOut"}}),await new Promise(t=>setTimeout(t,1e3)),h("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABBwA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJB0/x/Bt3TKC4gr+QAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyNi0wMi0xMVQwODoxMzo0NyswMDowMBJA54sAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjYtMDItMTFUMDg6MTM6NDcrMDA6MDBjHV83AAAAAElFTkSuQmCC"),await Promise.all([a.start({x:90,transition:{duration:i/1e3,ease:"easeOut"}}),e?new Promise(t=>{const s=Date.now(),r=()=>{const n=Date.now()-s,a=Math.min(n/i,1),l=1-Math.pow(1-a,3);e(150*l),a<1?o.current=requestAnimationFrame(r):t()};r()}):Promise.resolve()]),h(Uv),await Promise.all([a.start({x:0,transition:{duration:.5,ease:"easeInOut"}}),e?new Promise(t=>{const i=Date.now(),s=()=>{const r=Date.now()-i,n=Math.min(r/500,1),a=1-Math.pow(1-n,3);e(150*(1-a)),n<1?o.current=requestAnimationFrame(s):(e(0),t())};s()}):Promise.resolve()]),await new Promise(t=>setTimeout(t,500)),h("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABBwAAAQ4CAQAAAAArweuAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QA/4ePzL8AAE5dSURBVHja7d13vG5VfSf+777tnMu9F5AL3AKCYAHEQhDUYDdxYhJ1HAvjaOxiTXOS0ZlkJslk0pNfzGSMLcWGGks0oCLWSEws9KaJqKBSbu/tnFvO+v3BBUFuec45+3n2Wmu/33m9fBnkPHvv7157rc9eu0UAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAtKZRgul4V1oQ949HxLEREbEhro3vxvYYi+PiBSoJgODAj3wyjceKOPM+//y2WB2bYyKeqZYACA5E/Hm6X5wUZ8SKQ/w7U3F1/Ftsj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cz1gkOADCAxze+jjOOCQ4AMIDDDAAGYGK5KkKYBYd/3pFYAZ2ezNpyce9EgCzZ+6BweOmGpTNjAPQymAgOXA4e8wz1HG0KwHQHjMPHDhYqkE9zDgArQ4QGxWBe9kgNtR2lCsBMAzmHhAY6mTGARjSoNE025WhpybdzVDzsa0EwHD5wkW/eHm04AAwaxvSMYrQhyHFmCI4ALRne1qkCNVJMcdIIjgADM+WdKQi1DKEGEMEB4ARnqt68kJcoDieqgA6HICaZkIZCrLV0xKYcQDyYQYiz7CwI1YaKxAcAPGBQ9sZi4wRCA6AEMGB7YkFxgQEB6CCM9+0UBGGOxQYCxAcgB6cIad5ijBtu2NMz88seKoCKNb8pmmaZqtCDGRnNE3TNI3YAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAxf5/YGXrivgArHYAAAAldEVYdGRhdGU6Y3JlYXRlADIwMjYtMDItMTFUMDg6MTM6MjArMDA6MDARiNCCAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDI2LTAyLTExVDA4OjEzOjIwKzAwOjAwYNVoPgAAAABJRU5ErkJggg=="),await Promise.all([a.start({x:-90,transition:{duration:i/1e3,ease:"easeOut"}}),e?new Promise(t=>{const s=Date.now(),r=()=>{const n=Date.now()-s,a=Math.min(n/i,1),l=1-Math.pow(1-a,3);e(-150*l),a<1?o.current=requestAnimationFrame(r):t()};r()}):Promise.resolve()]),h(Uv),await Promise.all([a.start({x:0,transition:{duration:.5,ease:"easeInOut"}}),e?new Promise(t=>{const i=Date.now(),s=()=>{const r=Date.now()-i,n=Math.min(r/500,1),a=1-Math.pow(1-n,3);e(-150*(1-a)),n<1?o.current=requestAnimationFrame(s):(e(0),t())};s()}):Promise.resolve()]),await new Promise(t=>setTimeout(t,1e3))})(),()=>{l.current=!1,o.current&&(cancelAnimationFrame(o.current),o.current=null)}},[t,a,e,i,s]),t?w.jsx("div",{id:n,className:`${Fv} ${r}`.trim(),children:w.jsx(wo.div,{className:Nv,animate:a,initial:{x:0},children:w.jsx(Hv,{size:80,src:d,alt:"Swipe tutorial hand"})})}):null},Vv="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='144'%20height='144'%20fill='%23000'%20xmlns:v='https://vecta.io/nano'%3e%3cpath%20d='M71.998%20105c6.8%200%2012.975-1.925%2018.525-5.775S100.098%2090.3%20102.598%2084h-9.9c-2.2%203.7-5.125%206.625-8.775%208.775S76.298%2096%2071.998%2096s-8.275-1.075-11.925-3.225S53.498%2087.7%2051.298%2084h-9.9c2.5%206.3%206.525%2011.375%2012.075%2015.225S65.198%20105%2071.998%20105zM52.395%2051.002c-3.2%200-6.175.9-8.925%202.7a23.03%2023.03%200%200%200-6.825%206.9l7.5%204.95c1-1.5%202.2-2.775%203.6-3.825s2.95-1.575%204.65-1.575%203.25.525%204.65%201.575%202.6%202.275%203.6%203.675l7.5-4.95c-1.8-2.7-4.075-4.95-6.825-6.75s-5.725-2.7-8.925-2.7zm42%200c-3.2%200-6.175.9-8.925%202.7a23.03%2023.03%200%200%200-6.825%206.9l7.5%204.95c1-1.4%202.2-2.625%203.6-3.675s2.95-1.575%204.65-1.575%203.275.5%204.725%201.5%202.626%202.25%203.525%203.75l7.5-4.95a23.03%2023.03%200%200%200-6.825-6.9c-2.75-1.8-5.725-2.7-8.925-2.7z'/%3e%3c/svg%3e",Gv="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='144'%20height='144'%20fill='none'%20xmlns:v='https://vecta.io/nano'%3e%3cpath%20d='M37.498%2095.998h9v-1.5c0-7.1%202.475-13.125%207.425-18.075s10.975-7.425%2018.075-7.425%2013.125%202.475%2018.075%207.425%207.425%2010.975%207.425%2018.075v1.5h9v-1.5c0-9.6-3.35-17.75-10.05-24.45s-14.85-10.05-24.45-10.05-17.75%203.35-24.45%2010.05-10.05%2014.85-10.05%2024.45v1.5zm5.1-40.5c4.1-.6%208.425-2.2%2012.975-4.8s8.175-5.55%2010.875-8.85l-6.9-5.7c-2%202.4-4.775%204.6-8.325%206.6s-6.825%203.25-9.825%203.75l1.2%209zm58.8%200l1.2-9c-3-.5-6.275-1.75-9.825-3.75s-6.325-4.2-8.325-6.6l-6.9%205.7c2.7%203.3%206.325%206.25%2010.875%208.85s8.875%204.2%2012.975%204.8z'%20fill='%23000'/%3e%3c/svg%3e",Qv="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='145'%20height='144'%20fill='%23000'%20xmlns:v='https://vecta.io/nano'%3e%3cdefs%3e%3cclipPath%20id='iconClip'%3e%3ccircle%20cx='50%25'%20cy='50%25'%20r='50%25'/%3e%3c/clipPath%3e%3c/defs%3e%3cg%20clip-path='url(%23iconClip)'%3e%3cpath%20d='M49.734%2084.513a2%202%200%200%200%201.284%202.52l30.434%209.889a2%202%200%200%200%202.52-1.284l1.545-4.755a2%202%200%200%200-1.284-2.52L53.8%2078.474a2%202%200%200%200-2.52%201.284l-1.545%204.755zm44.815-11.736c2.378.773%204.669.597%206.874-.526s3.694-2.874%204.467-5.252.597-4.669-.527-6.874-2.874-3.694-5.252-4.467-4.669-.597-6.874.527-3.694%202.874-4.466%205.252-.597%204.669.527%206.874%202.874%203.694%205.252%204.466zM54.605%2059.799c2.378.773%204.669.597%206.874-.526s3.694-2.874%204.467-5.252.597-4.669-.527-6.874-2.874-3.694-5.252-4.466-4.669-.597-6.874.526-3.694%202.874-4.466%205.252-.597%204.669.526%206.874%202.874%203.694%205.252%204.467z'/%3e%3c/g%3e%3c/svg%3e",Kv="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='144'%20height='144'%20fill='none'%20xmlns:v='https://vecta.io/nano'%3e%3cpath%20d='M63.601%2099.602l42.3-42.3-8.4-8.4-33.9%2033.9-17.1-17.1-8.4%208.4%2025.5%2025.5z'%20fill='%23000'/%3e%3c/svg%3e",qv="_swipeableFeed_jamse_1",Wv="_swipeableFeedCards_jamse_8",Yv="_swipeableFeedEmpty_jamse_22",$v="_swipeTutorialContainer_jamse_33",zv=({cards:t,finderUiConfig:e,buttonStyle:i="vertical-emojis",maxVisibleCards:s=2,isMuted:r=!0,volume:n=.5,currentCardIndex:a,setCurrentCardIndex:o,addSwipeToHistory:l,setIsAnimating:d,isAnimating:h,setNoMoreCards:c,sendSwipeEvent:u,sendImpressionEvent:f,startCardImpression:g,onAllCardsSwiped:m,onCardSwiped:p,swipeTutorialEnabled:A=!1,swipeTutorialDuration:v=3e3,swipeTutorialStartDelay:y=500,id:E="swipeableFeed"})=>{const[T,S]=D.useState(!1),[b,I]=D.useState(null),[L,R]=D.useState({}),[k,C]=D.useState(0),x=D.useRef(null),P=D.useCallback(async t=>{if(!t)return;if(!("HLS-VIDEO"===t.tagName||"VIDEO"===t.tagName||"play"in t))return;const e=t;try{(void 0===e.readyState||e.readyState<2)&&await new Promise(t=>{const i=()=>{e.removeEventListener("loadeddata",i),t()};e.addEventListener("loadeddata",i),setTimeout(()=>{e.removeEventListener("loadeddata",i),t()},3e3)}),void 0!==e.currentTime&&(e.currentTime=0);let t=0;const i=5,s=async()=>{try{e.play&&await e.play()}catch(r){t<i&&(t++,e.load&&e.load(),setTimeout(s,500*t))}};setTimeout(()=>{s()},200)}catch(i){}},[]),M=D.useMemo(()=>t.slice(a,a+s),[t,a,s]),O=a<t.length,B=D.useCallback(e=>{if(h||!O)return;const i=t[a];i&&(d(!0),S(!0),C(0),i.id&&u(i.id,e),l(e,i),null==p||p(i,e),I(e),setTimeout(()=>{const e=a+1;if(I(null),e>=t.length)return d(!1),c(!0),void(null==m||m());const i=t[e];if(!(!i||(L[e]??!1))&&i){const t=(i=0)=>{if(i>20)return d(!1),void o(e);L[e]??!1?(d(!1),o(e)):setTimeout(()=>t(i+1),100)};t()}else d(!1),o(e);if(e<t.length){const i=t[e];(null==i?void 0:i.id)&&(g(i.id),f(i.id),"video"===i.type&&i.videoUrl&&setTimeout(()=>{var t;const e=null==(t=x.current)?void 0:t.querySelector(`[id="${i.id}"]`);if(e){const t=e.querySelector("hls-video, video");t&&P(t)}},100))}},600))},[h,O,t,a,d,o,c,u,f,g,l,p,m,P,L,c]),F=D.useCallback((t,e)=>{if(h||!O)return;const i={like:"right",dislike:"left",maybe:"up",seen:"down"}[t];i&&B(i)},[h,O,B]),N=D.useCallback(t=>{C(t)},[]),_=D.useCallback(e=>{const i=t.findIndex(t=>t.id===e);i>=0&&R(t=>({...t,[i]:!0}))},[t]),U=D.useCallback((t,e)=>{e&&_(e)},[_]),H=D.useCallback((e,i)=>{if(!e)return;const s=t[a];s&&i===s.id&&P(e)},[P,t,a]),j=D.useCallback((t,e)=>{e&&_(e)},[_]),V=D.useRef(new Set);D.useEffect(()=>{M.forEach((t,e)=>{const i=a+e;"image"===t.type&&t.id&&!V.current.has(i)&&(V.current.add(i),R(t=>({...t,[i]:!0})))});const t=new Set(M.map((t,e)=>a+e));V.current.forEach(e=>{t.has(e)||V.current.delete(e)})},[M,a]),D.useEffect(()=>{if(t.length>0&&0===a){const e=t[0];(null==e?void 0:e.id)&&(g(e.id),f(e.id))}},[t,a,g,f]),D.useEffect(()=>{C(0)},[a]);const G=D.useMemo(()=>e.navigation.options||{right:{enabled:!0,gesture:!0,label:"RIGHT"},left:{enabled:!0,gesture:!0,label:"LEFT"},up:{enabled:!0,gesture:!1,label:"UP"},down:{enabled:!0,gesture:!1,label:"DOWN"}},[e.navigation.options]),Q=D.useMemo(()=>{const s={tooltipText:e.navigationDemoTooltip.text,tooltipTextColor:e.navigationDemoTooltip.textColor,tooltipTextSize:e.navigationDemoTooltip.textSize,tooltipBackgroundColor:e.navigationDemoTooltip.backgroundColor,tooltipKeep:e.navigationDemoTooltip.keep,onButtonClick:F,isAnimating:h,visible:O,currentCardIndex:a,totalCards:t.length,onFirstSwipe:()=>S(!0)};switch(i){case"vertical-emojis":{const t=[{id:"likeBtn",action:"like",label:G.right.label,icon:Vv,altText:"Yes"},{id:"dislikeBtn",action:"dislike",label:G.left.label,icon:Gv,altText:"No"},{id:"maybeBtn",action:"maybe",label:G.up.label,icon:Qv,altText:"Maybe"},{id:"seenBtn",action:"seen",label:G.down.label,icon:Kv,altText:"Seen"}].filter(t=>{var e;const i={like:"right",dislike:"left",maybe:"up",seen:"down"}[t.action];return(null==(e=G[i])?void 0:e.enabled)??!0});return{component:Lv,props:{...s,buttons:t,verticalPosition:e.navigation.positionTop,horizontalPosition:e.navigation.positionRight}}}case"side-emojis":{const t=[{id:"likeBtn",action:"like",label:G.right.label,icon:Vv,altText:"Yes"},{id:"dislikeBtn",action:"dislike",label:G.left.label,icon:Gv,altText:"No"}].filter(t=>{var e;const i={like:"right",dislike:"left"}[t.action];return(null==(e=G[i])?void 0:e.enabled)??!0});return{component:Dv,props:{...s,buttons:t}}}case"side-arrows":{const t=[{id:"likeBtn",action:"like",label:G.right.label,icon:Vv,altText:"Yes",enabled:G.right.enabled},{id:"dislikeBtn",action:"dislike",label:G.left.label,icon:Gv,altText:"No",enabled:G.left.enabled},{id:"maybeBtn",action:"maybe",label:G.up.label,icon:Qv,altText:"Maybe",enabled:G.up.enabled},{id:"seenBtn",action:"seen",label:G.down.label,icon:Kv,altText:"Seen",enabled:G.down.enabled}];return{component:Bv,props:{...s,buttons:t,ctaText:e.navigationDemoTooltip.text,isDemoMode:Boolean(e.navigationDemoTooltip.text&&!T),tooltipBottomOffset:e.navigationDemoTooltip.bottomOffset}}}default:return null}},[i,e.navigation.options,G,F,h,O,a,t.length,T]),K=D.useCallback(()=>{G.left.enabled&&G.left.gesture&&B("left")},[G.left,B]),q=D.useCallback(()=>{G.right.enabled&&G.right.gesture&&B("right")},[G.right,B]),W=D.useCallback(()=>{G.up.enabled&&G.up.gesture&&B("up")},[G.up,B]),Y=D.useCallback(()=>{G.down.enabled&&G.down.gesture&&B("down")},[G.down,B]);return 0===t.length?w.jsx("div",{className:qv,id:E,children:w.jsx("div",{className:Yv,children:"No cards available"})}):w.jsxs("div",{ref:x,className:qv,id:E,children:[w.jsx("div",{className:Wv,children:M.map((t,i)=>{const o=a+i,l=0===i,d=l&&(L[o]??!0)&&!h,c=s-i;return w.jsx(Ev,{card:t,cardUIConfig:e.card,cardIndex:o,isActive:l,swipeOptions:G,isAnimating:h&&l,animateDirection:l?b:null,onSwipeLeft:d?K:void 0,onSwipeRight:d?q:void 0,onSwipeUp:d?W:void 0,onSwipeDown:d?Y:void 0,onVideoReady:U,onPlayRequested:H,onImageReady:j,isMuted:r,volume:n,ready:!0,zIndex:c,tutorialXOffset:l?k:0},t.id)})}),(()=>{if(!Q||!O)return null;const{component:t,props:e}=Q;return w.jsx(t,{...e})})(),A&&O&&!T&&M.length>0&&w.jsx("div",{className:$v,children:w.jsx(jv,{visible:!0,onCardMove:N,animationDuration:v,startDelay:y})})]})},Xv="_volumeControl_r52gg_2",Zv="_volumeControlTopLeft_r52gg_12",Jv="_volumeControlTopRight_r52gg_17",ty="_volumeControlBottomLeft_r52gg_23",ey="_volumeControlBottomRight_r52gg_28",iy="_volumeControlButton_r52gg_34",sy="_volumeSlider_r52gg_60",ry="_volumeSliderInput_r52gg_81",ny="_volumeSliderLeft_r52gg_122",ay="_volumeSliderRight_r52gg_126",oy=({volumeControlUIConfig:t,isMuted:e,volume:i,visible:s=!0,className:r="",onToggleMute:n,onVolumeChange:a})=>{const{position:o,size:l,volumeControl:d}=t,h="top-left"===o||"bottom-left"===o?"right":"left";if(!s)return null;const c=D.useMemo(()=>{switch(o){case"top-left":return Zv;case"top-right":default:return Jv;case"bottom-left":return ty;case"bottom-right":return ey}},[o]);return w.jsxs("div",{className:`${Xv} ${c} ${r}`.trim(),style:{height:`${l}px`},children:[w.jsx("div",{className:iy,onClick:t=>{t.stopPropagation(),n()},style:{height:`${l}px`},children:w.jsx("img",{src:e?"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20fill='none'%20xmlns:v='https://vecta.io/nano'%3e%3cmask%20id='A'%20maskUnits='userSpaceOnUse'%20x='0'%20y='0'%20width='24'%20height='24'%20mask-type='alpha'%3e%3cpath%20fill='%23d9d9d9'%20d='M0%200h24v24H0z'/%3e%3c/mask%3e%3cg%20mask='url(%23A)'%3e%3cpath%20d='M19.801%2022.601l-3.025-3.025a8.31%208.31%200%200%201-1.325.688%209.48%209.48%200%200%201-1.45.462v-2.05l.688-.25c.225-.083.438-.183.637-.3l-3.325-3.325v5.2l-5-5h-4v-6h3.2l-4.8-4.8%201.4-1.4%2018.4%2018.4-1.4%201.4zm-.2-5.8l-1.45-1.45c.283-.517.496-1.058.638-1.625a7.19%207.19%200%200%200%20.212-1.75%206.86%206.86%200%200%200-1.375-4.2c-.917-1.233-2.125-2.067-3.625-2.5v-2.05c2.067.467%203.75%201.512%205.05%203.137s1.95%203.496%201.95%205.613c0%20.883-.121%201.733-.363%202.55s-.587%201.575-1.037%202.275zm-3.35-3.35l-2.25-2.25v-3.25a4.15%204.15%200%200%201%201.838%201.65c.442.733.662%201.533.662%202.4a4.34%204.34%200%200%201-.062.738%204.28%204.28%200%200%201-.187.712zm-4.25-4.25l-2.6-2.6%202.6-2.6v5.2zm-2%205.95v-2.35l-1.8-1.8h-3.2v2h2.85l2.15%202.15z'%20fill='%23fff'/%3e%3c/g%3e%3c/svg%3e":"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20fill='none'%20xmlns:v='https://vecta.io/nano'%3e%3cmask%20id='A'%20maskUnits='userSpaceOnUse'%20x='0'%20y='0'%20width='24'%20height='24'%20mask-type='alpha'%3e%3cpath%20fill='%23d9d9d9'%20d='M0%200h24v24H0z'/%3e%3c/mask%3e%3cg%20mask='url(%23A)'%3e%3cpath%20d='M14%2020.727v-2.05c1.5-.433%202.708-1.267%203.625-2.5S19%2013.543%2019%2011.977s-.458-2.967-1.375-4.2S15.5%205.71%2014%205.277v-2.05c2.067.467%203.75%201.513%205.05%203.138S21%209.86%2021%2011.977s-.65%203.988-1.95%205.612-2.983%202.671-5.05%203.138zM3%2015.002v-6h4l5-5v16l-5-5H3zm11%201v-8.05a4.15%204.15%200%200%201%201.838%201.65c.442.733.662%201.533.662%202.4%200%20.85-.221%201.637-.662%202.363S14.783%2015.635%2014%2016.002zm-4-7.15l-2.15%202.15H5v2h2.85l2.15%202.15v-6.3z'%20fill='%23fff'/%3e%3c/g%3e%3c/svg%3e",alt:"Volume control"})}),d&&w.jsx("div",{className:`${sy} ${"left"===h?ny:ay}`,onClick:t=>t.stopPropagation(),style:{height:`${l}px`,borderRadius:`${l}px`},children:w.jsx("input",{type:"range",min:"0",max:"1",step:"0.01",value:i,onChange:t=>{const i=parseFloat(t.target.value)||1;e&&n(),a(i)},className:ry,onClick:t=>t.stopPropagation()})})]})},ly="_historyButton_1xf6c_1",dy="_tooltip_1xf6c_39",hy="_tooltipArrow_1xf6c_59",cy=({historyUIConfig:t,show:e=!1,onOpenHistory:i,className:s=""})=>{const{enabled:r,buttonSize:n,buttonColor:a,tooltipText:o,tooltipTextSize:l,tooltipTextColor:d,tooltipBackgroundColor:h,tooltipTimeout:c}=t,[u,f]=D.useState(!1),g=D.useRef(null);D.useEffect(()=>{e&&r?(f(!0),g.current&&clearTimeout(g.current),g.current=window.setTimeout(()=>{f(!1),g.current=null},c)):(f(!1),g.current&&(clearTimeout(g.current),g.current=null))},[e,r,c]),D.useEffect(()=>()=>{g.current&&clearTimeout(g.current)},[]);if(!r||!e)return null;const m=.6*n;return w.jsxs("button",{className:`${ly} ${s}`.trim(),onClick:()=>{i&&i()},"aria-label":"Open history",style:{width:`${n}px`,height:`${n}px`,backgroundColor:a},children:[w.jsx("img",{src:"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='33'%20height='32'%20fill='none'%20xmlns:v='https://vecta.io/nano'%3e%3cmask%20id='A'%20maskUnits='userSpaceOnUse'%20x='0'%20y='0'%20width='33'%20height='32'%20mask-type='alpha'%3e%3cpath%20fill='%23d9d9d9'%20d='M.5%200h32v32H.5z'/%3e%3c/mask%3e%3cg%20mask='url(%23A)'%3e%3cpath%20d='M16.5%2018.001l8-5.333-8-5.333v10.667zM8.1%2029.168a2.5%202.5%200%200%201-1.983-.517A2.56%202.56%200%200%201%205.1%2026.868L3.334%2012.301c-.089-.733.089-1.389.533-1.967s1.033-.911%201.767-1l1.533-.2v10.867c0%201.467.522%202.722%201.567%203.767s2.3%201.567%203.767%201.567h12.4c-.133.533-.4.995-.8%201.383s-.889.617-1.467.683L8.1%2029.168zm4.4-6.5c-.733%200-1.361-.261-1.883-.783s-.783-1.15-.783-1.883V5.335c0-.733.261-1.361.783-1.883s1.15-.783%201.883-.783h14.667c.733%200%201.361.261%201.883.783s.783%201.15.783%201.883v14.667c0%20.733-.261%201.361-.783%201.883s-1.15.783-1.883.783H12.5z'%20fill='%23fff'/%3e%3c/g%3e%3c/svg%3e",alt:"History",style:{width:`${m}px`,height:`${m}px`}}),u&&o&&w.jsxs("span",{className:dy,style:{fontSize:`${l}px`,backgroundColor:h,color:d},children:[(o??"").replace(/<br>/g,"\n"),w.jsx("span",{className:hy,style:{backgroundColor:h}})]})]})},uy="_drawerOverlay_1eftt_2",fy="_drawerOverlayScoped_1eftt_16",gy="_drawerOverlayVisible_1eftt_24",my="_drawer_1eftt_2",py="_drawerScoped_1eftt_48",Ay="_drawerOpen_1eftt_55",vy="_drawerHandle_1eftt_60",yy="_drawerContent_1eftt_202",Ey="_drawerCloseButton_1eftt_210",Ty="_drawerCloseIcon_1eftt_255",Sy=({isOpen:t,onClose:e,height:i="50%",maxHeight:s,showHandle:r=!0,showCloseButton:n=!0,className:a="",closeButtonText:o="Close",handleEscKey:l=!0,lockBodyScroll:d=!0,scoped:h=!1,children:c})=>{const u=D.useRef(null),f=D.useRef(null),[g,m]=D.useState(!1);D.useEffect(()=>{t?requestAnimationFrame(()=>{m(!0)}):m(!1)},[t]);const p=t=>{if(!t||t===document.body)return null;const e=t.parentElement;if(!e)return null;const i=window.getComputedStyle(e);return"auto"===i.overflow||"scroll"===i.overflow||"auto"===i.overflowY||"scroll"===i.overflowY||e.scrollHeight>e.clientHeight?e:p(e)};D.useEffect(()=>{if(!d||h)return;const i=i=>{"Escape"===i.key&&t&&e()};if(t){document.addEventListener("keydown",i);const t=(u.current?p(u.current):null)||document.body,e=(()=>{var t;const e=document.createElement("div");e.style.visibility="hidden",e.style.overflow="scroll",e.style.msOverflowStyle="scrollbar",document.body.appendChild(e);const i=document.createElement("div");e.appendChild(i);const s=e.offsetWidth-i.offsetWidth;return null==(t=e.parentNode)||t.removeChild(e),s})(),s=window.getComputedStyle(t).paddingRight,r=parseInt(s,10)||0,n=t.style.overflow,a=t.style.paddingRight;return t.style.overflow="hidden",t===document.body&&(t.style.paddingRight=`${r+e}px`),()=>{document.removeEventListener("keydown",i),t.style.overflow=n,t.style.paddingRight=a}}return()=>{document.removeEventListener("keydown",i)}},[t,e,d]);const A={height:i,...s&&{maxHeight:s}},v=`${my} ${h?py:""} ${a} ${g?Ay:""}`.trim(),y=`${uy} ${h?fy:""} ${g?gy:""}`.trim();return t?w.jsxs(w.Fragment,{children:[w.jsx("div",{ref:f,className:y,onClick:t=>{t.target===f.current&&e()},"aria-hidden":!1}),w.jsxs("div",{ref:u,className:v,style:A,"aria-hidden":!1,role:"dialog","aria-modal":"true",onKeyDown:t=>{l&&"Escape"===t.key&&e()},tabIndex:-1,children:[r&&w.jsx("div",{className:vy}),w.jsx("div",{className:yy,children:c}),n&&w.jsxs("button",{className:Ey,onClick:e,"aria-label":"Close drawer",children:[w.jsx("img",{src:"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20fill='none'%20xmlns:v='https://vecta.io/nano'%3e%3cmask%20id='A'%20maskUnits='userSpaceOnUse'%20x='0'%20y='0'%20width='24'%20height='24'%20mask-type='alpha'%3e%3cpath%20fill='%23d9d9d9'%20d='M0%200h24v24H0z'/%3e%3c/mask%3e%3cg%20mask='url(%23A)'%3e%3cpath%20d='M6.4%2019L5%2017.6L10.6%2012L5%206.4L6.4%205L12%2010.6L17.6%205L19%206.4L13.4%2012L19%2017.6L17.6%2019L12%2013.4L6.4%2019Z'%20fill='%23fff'/%3e%3c/g%3e%3c/svg%3e",alt:"Close",className:Ty}),o]})]})]}):null},by="_cardListContainer_zrmnf_2",Iy="_summaryGridContainer_zrmnf_17",Ly="_summaryGridItem_zrmnf_26",Ry="_summaryGridItemClickable_zrmnf_34",ky="_gridPlaceholder_zrmnf_39",wy="_gridItemImage_zrmnf_51",Dy="_summaryCardItem_zrmnf_58",Cy="_summaryCardItemClickable_zrmnf_70",xy="_cardItemImage_zrmnf_75",Py="_cardItemPlaceholder_zrmnf_84",My="_cardItemContent_zrmnf_98",Oy="_cardItemTitle_zrmnf_107",By="_cardItemPrice_zrmnf_116",Fy=({cards:t,clickable:e=!1,padding:i="20px",layout:s="list",onCardClick:r,cardItemBackgroundColor:n,cardItemTextColor:a})=>{const o=(t,e,i)=>{r&&r(t,e,i)},l=n||"#F2F2F2",d=a||"#181818";return"grid"===s?w.jsx("div",{className:Iy,children:t.map((t,i)=>{const s="card"in t?t.card:t;if(!s)return null;const r="image"===s.type?s.imageUrl:s.summaryImage??s.videoThumbnail;return w.jsx("div",{className:`${Ly} ${e?Ry:""}`,"data-card-id":s.id||"","data-card-url":s.url||"","data-card-position":s.position||"",onClick:e?()=>o(s.id,s.url,s.position):void 0,children:r?w.jsx("img",{src:r,className:wy,alt:"Card image"}):w.jsx("div",{className:ky,style:{background:l,color:d},children:"No image"})},s.id||i)})}):w.jsx("div",{className:by,style:{padding:"0"===i?"0":i},children:t.map((t,i)=>{const s="card"in t?t.card:t;if(!s)return null;const r="image"===s.type?s.imageUrl:s.summaryImage??s.videoThumbnail;return w.jsxs("div",{className:`${Dy} ${e?Cy:""}`,style:{background:l,color:d},"data-card-id":s.id||"","data-card-url":s.url||"","data-card-position":s.position||"",onClick:e?()=>o(s.id,s.url,s.position):void 0,children:[r?w.jsx("img",{src:r,className:xy,alt:"Card image"}):w.jsx("div",{className:Py,children:"No image"}),w.jsxs("div",{className:My,children:[w.jsx("h4",{className:Oy,children:s.title||"Untitled"}),s.price&&w.jsxs("p",{className:By,children:[s.price," ",s.currency||""]})]})]},s.id||i)})})},Ny={summaryContainer:"_summaryContainer_1gtok_3",summaryShareButtonFixed:"_summaryShareButtonFixed_1gtok_14",shareIcon:"_shareIcon_1gtok_47",summaryExplaination:"_summaryExplaination_1gtok_54",summaryTabs:"_summaryTabs_1gtok_71",summaryTab:"_summaryTab_1gtok_71",summaryTabActive:"_summaryTabActive_1gtok_91",summaryEmojiItem:"_summaryEmojiItem_1gtok_96",summaryEmojiItemActive:"_summaryEmojiItemActive_1gtok_103",summaryEmojiButton:"_summaryEmojiButton_1gtok_108",summaryEmojiButtonActive:"_summaryEmojiButtonActive_1gtok_124",summaryEmojiLike:"_summaryEmojiLike_1gtok_132",summaryEmojiLikeActive:"_summaryEmojiLikeActive_1gtok_136",summaryEmojiDislike:"_summaryEmojiDislike_1gtok_142",summaryEmojiDislikeActive:"_summaryEmojiDislikeActive_1gtok_146",summaryEmojiMaybe:"_summaryEmojiMaybe_1gtok_152",summaryEmojiMaybeActive:"_summaryEmojiMaybeActive_1gtok_156",summaryEmojiSeen:"_summaryEmojiSeen_1gtok_162",summaryEmojiSeenActive:"_summaryEmojiSeenActive_1gtok_166",summaryEmojiIcon:"_summaryEmojiIcon_1gtok_194",summaryEmojiLabel:"_summaryEmojiLabel_1gtok_201",summaryContent:"_summaryContent_1gtok_217",summaryPanel:"_summaryPanel_1gtok_226",summaryPanelActive:"_summaryPanelActive_1gtok_241",summaryEmptyState:"_summaryEmptyState_1gtok_246",summaryEmptyStateText:"_summaryEmptyStateText_1gtok_252",summaryExplainationRight:"_summaryExplainationRight_1gtok_259",summaryExplainationLeft:"_summaryExplainationLeft_1gtok_263",summaryExplainationUp:"_summaryExplainationUp_1gtok_267",summaryExplainationDown:"_summaryExplainationDown_1gtok_271"},_y=({cardsByDirection:t,navigationUIConfig:e,summaryUIConfig:i,onCardClick:s,onShareClick:r,visible:n=!0,className:a=""})=>{const o=e.options,{endCardType:l="list",explanationTexts:d={},tabsBackgroundColor:h="#f5f5f5",tabsBorderColor:c="#e0e0e0",cardItemBackgroundColor:u="#F2F2F2",cardItemTextColor:f="#181818",contentBackgroundColor:g="#ffffff",explanationVisible:m=!1}=i,[p,A]=D.useState(null),v={right:Vv,left:Gv,up:Qv,down:Kv},y=(t,e)=>`${Ny.summaryEmojiButton} ${Ny[`summaryEmoji${t.charAt(0).toUpperCase()+t.slice(1)}`]||""} ${e?Ny.summaryEmojiButtonActive:""} ${e&&Ny[`summaryEmoji${t.charAt(0).toUpperCase()+t.slice(1)}Active`]||""}`.trim(),E=D.useMemo(()=>[{key:"right",config:o.right},{key:"up",config:o.up},{key:"down",config:o.down},{key:"left",config:o.left}].filter(t=>t.config.enabled),[o]);D.useEffect(()=>{E.length>0&&null===p&&A(E[0].key)},[E]);const T=(t,e,i)=>{s&&s(t,e,i)};if(!n||0===E.length)return null;const S=100/E.length;return w.jsxs("div",{className:`${Ny.summaryContainer} ${a}`.trim(),children:[w.jsx("div",{className:Ny.summaryTabs,style:{backgroundColor:h,borderBottom:`1px solid ${c}`},children:E.map(t=>{const e=p===t.key,i={right:"like",left:"dislike",up:"maybe",down:"seen"}[t.key];return w.jsx("div",{className:`${Ny.summaryTab} ${e?Ny.summaryTabActive:""}`,style:{width:`${S}%`,boxSizing:"border-box"},onClick:()=>A(t.key),children:w.jsxs("div",{className:`${Ny.summaryEmojiItem} ${e?Ny.summaryEmojiItemActive:""}`,children:[w.jsx("div",{className:y(i,e),children:w.jsx("img",{src:v[t.key],alt:t.config.label,className:Ny.summaryEmojiIcon})}),w.jsx("span",{className:Ny.summaryEmojiLabel,children:t.config.label})]})},t.key)})}),w.jsx("div",{className:Ny.summaryContent,style:{backgroundColor:g},children:E.map(e=>{const i=p===e.key,s=(r=e.key,t[r]||[]);var r;const n=(t=>{var e;return(null==(e=d[t])?void 0:e.replace(/\\A/g,"\n"))||""})(e.key);return w.jsx("div",{className:`${Ny.summaryPanel} ${i?Ny.summaryPanelActive:""}`,"data-panel":e.key,children:0===s.length?w.jsx("div",{className:Ny.summaryEmptyState,style:{color:f},children:w.jsx("h3",{className:Ny.summaryEmptyStateText,children:"No cards"})}):w.jsxs(w.Fragment,{children:[n&&w.jsx("div",{className:`${Ny.summaryExplaination} ${Ny[`summaryExplaination${e.key.charAt(0).toUpperCase()+e.key.slice(1)}`]||""}`,style:{display:m?"flex":"none",background:u,color:f},children:n}),w.jsx(Fy,{cards:s,clickable:!0,padding:"20px",layout:l,onCardClick:T,cardItemBackgroundColor:u,cardItemTextColor:f})]})},e.key)})}),r&&w.jsx("button",{className:Ny.summaryShareButtonFixed,onClick:()=>{if(!r)return;const e=t.right.map(t=>t.id).filter(t=>null!=t&&""!==t),i=t.up.map(t=>t.id).filter(t=>null!=t&&""!==t);r(e,i)},"aria-label":"Share",children:"share"})]})},Uy="_historyDrawerContent_x0jj6_1",Hy="_historyDrawerEmpty_x0jj6_15",jy="_historyDrawerEmptyHint_x0jj6_31",Vy="_historyDrawer_x0jj6_1",Gy=({isOpen:t,onClose:e,swipeHistory:i,getCardsByDirection:s,historyUIConfig:r,navigationUIConfig:n,summaryUIConfig:a,onCardClick:o,className:l="",scoped:d=!1})=>{const{drawerHeight:h,drawerMaxHeight:c,drawerCloseButtonText:u}=r,f=D.useMemo(()=>({right:s("right"),left:s("left"),up:s("up"),down:s("down")}),[s,i]),g=i.length>0;return w.jsx(Sy,{isOpen:t,onClose:e,height:`${h}%`,maxHeight:`${c}%`,showHandle:!0,showCloseButton:!0,closeButtonText:u,scoped:d,className:`${Vy} ${l}`.trim(),children:w.jsx("div",{className:Uy,children:g?w.jsx(_y,{cardsByDirection:f,navigationUIConfig:n,summaryUIConfig:a,onCardClick:o,visible:!0}):w.jsxs("div",{className:Hy,children:[w.jsx("p",{children:"No swipe history yet"}),w.jsx("p",{className:jy,children:"Swipe some cards to see them here"})]})})})},Qy="_filtersButton_qio2f_1",Ky="_filtersIcon_qio2f_63",qy=({filtersUIConfig:t,onClick:e,className:i=""})=>{const{enabled:s,buttonText:r,buttonColor:n,iconSize:a,textColor:o,showIcon:l}=t;if(!s)return null;const d={gap:l&&r?"8px":"0",background:n,color:o},h={width:`${a}px`,height:`${a}px`,color:o};return w.jsxs("button",{className:`${Qy} ${i}`.trim(),style:d,onClick:()=>{e&&e()},onFocus:t=>t.currentTarget.blur(),"aria-label":"Open filters",children:[l&&w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:a,height:a,viewBox:"0 0 24 24",fill:"none",stroke:o,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:Ky,style:h,"aria-hidden":"true",children:w.jsx("polygon",{points:"22,3 2,3 10,12.46 10,19 14,21 14,12.46"})}),r&&w.jsx("span",{children:r})]})},Wy="_content_hci8k_2",Yy="_title_hci8k_7",$y="_categories_hci8k_17",zy="_pill_hci8k_25",Xy="_noCategories_hci8k_40",Zy=({isOpen:t,onClose:e,filtersUIConfig:i,categories:s=[],selectedCategories:r=[],onFilterChange:n,scoped:a=!1,className:o=""})=>{const{drawerCategoriesTitle:l,drawerCloseButtonText:d}=i,h=new Set(r),[c,u]=D.useState(null),f=t=>{const e=new Set(r);"all"===t?e.clear():e.has(t)?e.delete(t):e.add(t),n&&n(Array.from(e))},g=(t,e)=>{const i=c===t,s="all"===t&&0===h.size;return{background:e||s?"#007bff":i?"#e9ecef":"#f5f5f5",color:e||s?"white":"#666",border:"2px solid "+(e||s?"#0056b3":"transparent"),transform:i?"translateY(-1px)":"none"}};return w.jsx(Sy,{isOpen:t,onClose:e,height:"auto",maxHeight:"70%",className:o,showHandle:!0,showCloseButton:!0,closeButtonText:d,scoped:a,children:w.jsxs("div",{className:Wy,children:[w.jsx("h3",{className:Yy,children:l}),w.jsx("div",{className:$y,children:0===s.length?w.jsx("div",{className:Xy,children:"No categories available"}):w.jsxs(w.Fragment,{children:[w.jsx("div",{className:zy,style:g("all",0===h.size),onMouseEnter:()=>u("all"),onMouseLeave:()=>u(null),onClick:()=>f("all"),children:"All"}),s.map(t=>w.jsx("div",{className:zy,style:g(t.id,h.has(t.id)),onMouseEnter:()=>u(t.id),onMouseLeave:()=>u(null),onClick:()=>f(t.id),children:t.name},t.id))]})})]})})},Jy="_cardsCounter_1h26d_1",tE=({cardsCounterUIConfig:t,currentCardIndex:e,totalCards:i,className:s=""})=>{const{enabled:r,text:n,textSize:a}=t;if(!r)return null;const o=Math.min(e+1,i);let l;return l=t.text.includes("{current}")||t.text.includes("{total}")?n.replace(/{current}/g,o.toString()).replace(/{total}/g,i.toString()):`${n} ${o} / ${i}`,w.jsx("div",{className:`${Jy} ${s}`.trim(),style:{fontSize:a},children:l})},eE="_logo_1rzq2_1",iE=({logoUIConfig:t,visible:e,className:i=""})=>{const{enabled:s,url:r,size:n}=t;if(!s||!r||!e)return null;const a={...void 0!==n&&{width:`${n}px`}};return w.jsx("img",{src:r,alt:"Logo",className:`${eE} ${i}`.trim(),style:a})},sE="_container_18bki_1",rE=({children:t,x:e,y:i,centered:s=!1,zIndex:r,className:n=""})=>{const a={...void 0!==e&&{left:"number"==typeof e?`${e}px`:e},...void 0!==i&&{top:"number"==typeof i?`${i}px`:i},...s&&{transform:"translate(-50%, -50%)"},...void 0!==r&&{zIndex:r}};return w.jsx("div",{className:`${sE} ${n}`.trim(),style:a,children:t})},nE=D.createContext(void 0),aE=({children:t,dataService:e,finderId:i,backendUrl:s,data:r,initialCards:n=[],initialFinder:a=null,initialCategories:o=[]})=>{const l=D.useRef(!1),[d,h]=D.useState(()=>r?e.processApiResponse(r).cards:n),[c,u]=D.useState(()=>r?e.processApiResponse(r).finder:a),[f,g]=D.useState(()=>r?e.processApiResponse(r).categories:o),[m,p]=D.useState(!1),[A,v]=D.useState(null);D.useEffect(()=>{if(r){const t=e.processApiResponse(r);u(t.finder),h(t.cards),g(t.categories),p(!1),v(null),l.current=!0}},[r,e]);const y=D.useCallback(async()=>{if(i&&s){p(!0),v(null);try{const t=await e.loadFinderFromApi(i,s);u(t.finder),h(t.cards),g(t.categories)}catch(wE){const e=wE instanceof Error?wE.message:"Failed to load finder";v(e)}finally{p(!1),l.current=!0}}else v("finderId and backendUrl are required to load finder")},[e,i,s]);D.useEffect(()=>{r||y()},[y,r]);const E={cards:d,finder:c,categories:f,loading:m,error:A,isInitiallyLoaded:l.current,setCards:h,setFinder:u,setCategories:g,loadFinder:y};return w.jsx(nE.Provider,{value:E,children:t})},oE=()=>{const t=D.useContext(nE);if(void 0===t)throw new Error("useData must be used within a DataProvider");return t},lE=D.createContext(void 0),dE=({children:t})=>{const{finder:e,isInitiallyLoaded:i}=oE(),[s,r]=D.useState(0),[n,a]=D.useState([]),[o,l]=D.useState(!1),[d,h]=D.useState(!0),[c,u]=D.useState(!1),[f,g]=D.useState(!1),[m,p]=D.useState(!0),[A,v]=D.useState(.5),[y,E]=D.useState(!0),[T,S]=D.useState([]),[b,I]=D.useState([]),[L,R]=D.useState([]);D.useEffect(()=>{i&&e&&(p(0===e.initialVolume),v(e.initialVolume))},[i,e]);const k=D.useCallback((t,e)=>{a(i=>{const s=i.findIndex(t=>t.card.id&&e.id&&t.card.id===e.id);return[...-1!==s?i.filter((t,e)=>e!==s):i,{direction:t,card:e,timestamp:Date.now()}]})},[]),C=D.useCallback(()=>{a([])},[]),x=D.useCallback(t=>n.filter(e=>e.direction===t).map(t=>t.card),[n]),P=D.useCallback(()=>{p(t=>!t)},[]),M=D.useCallback(t=>{v(t)},[]),O=D.useCallback(t=>{setTimeout(()=>{E(!0)},t)},[]),B=D.useCallback(t=>{S(t),I(t),R([])},[]);D.useEffect(()=>{let t;t=0===L.length?[...T]:T.filter(t=>t.categoryIds&&t.categoryIds.some(t=>L.includes(t))),I(t),T.length>0&&r(0)},[L,T]);const F={currentCardIndex:s,swipeHistory:n,isAnimating:o,demoActive:d,noMoreCards:c,userHasInteracted:f,isMuted:m,volume:A,logoVisible:y,allCards:T,filteredCards:b,selectedCategories:L,setCurrentCardIndex:r,addSwipeToHistory:k,clearSwipeHistory:C,setIsAnimating:l,setDemoActive:h,setNoMoreCards:u,setUserHasInteracted:g,getCardsByDirection:x,setIsMuted:p,setVolume:M,toggleMute:P,showLogo:O,setCards:B,setSelectedCategories:R};return w.jsx(lE.Provider,{value:F,children:t})},hE=()=>{const t=D.useContext(lE);if(void 0===t)throw new Error("useAppState must be used within an AppStateProvider");return t},cE=D.createContext(void 0),uE=({children:t,monitorService:e,finderId:i})=>{const[s]=D.useState(()=>crypto.randomUUID()),r=D.useRef({}),[n,a]=D.useState(!1),o=D.useRef([]),l=D.useCallback(()=>{const t=[...o.current];o.current=[],t.forEach(t=>{e.sendEvent({sessionId:s,finderId:i,event:t.event,cardId:t.cardId,cardViewDuration:t.cardViewDuration,direction:t.direction})})},[e,s,i]),d=D.useCallback(()=>{!n&&o.current.length>0&&l(),a(!0)},[n,l]),h=D.useCallback(t=>{n?e.sendEvent({sessionId:s,finderId:i,event:t.event,cardId:t.cardId,cardViewDuration:t.cardViewDuration,direction:t.direction}):o.current.push({...t,finderId:i,timestamp:Date.now()})},[e,s,n]),c=D.useCallback(()=>{i&&h({event:"impression"})},[i,h]),u=D.useCallback(t=>{i&&(r.current[t]=Date.now(),h({event:"impression",cardId:t}))},[i,h]),f=D.useCallback(t=>{r.current[t]=Date.now()},[]),g=D.useCallback((t,e)=>{if(i){let i=0;r.current[t]&&(i=(Date.now()-r.current[t])/1e3,delete r.current[t]),h({event:"swipe",cardId:t,direction:e,cardViewDuration:Math.round(i)})}},[i,h]),m=D.useCallback(t=>{i&&h({event:"click",cardId:t})},[i,h]),p=D.useCallback(()=>{i&&h({event:"click"})},[i,h]),A=D.useMemo(()=>({sessionId:s,sendImpressionEvent:u,sendSwipeEvent:g,sendClickEvent:m,sendButtonClickEvent:p,sendCreativeImpressionEvent:c,startCardImpression:f,setConsentGranted:d}),[s,u,g,m,p,c,f,d]);return w.jsx(cE.Provider,{value:A,children:t})},fE="_interactiveFeed_1wsuw_1",gE=({cards:t,categories:e=[],finderUiConfig:i,buttonStyle:s="vertical-emojis",maxVisibleCards:r=2,volumeControlUIConfig:n,historyUIConfig:a,onOpenHistory:o,onHistoryCardClick:l,filtersUIConfig:d,onFilterChange:h,onAllCardsSwiped:c,onCardSwiped:u,initialMuted:f=!0,cardsCounterUIConfig:g,navigationUIConfig:m,summaryUIConfig:p,logoUIConfig:A,className:v="",id:y})=>{const{currentCardIndex:E,setCurrentCardIndex:T,swipeHistory:S,getCardsByDirection:b,isMuted:I,volume:L,toggleMute:R,setVolume:k,showLogo:C,logoVisible:x,filteredCards:P,selectedCategories:M,setCards:O,setSelectedCategories:B,addSwipeToHistory:F,setIsAnimating:N,isAnimating:_,setNoMoreCards:U}=hE(),{sendSwipeEvent:H,sendImpressionEvent:j,startCardImpression:V}=(()=>{const t=D.useContext(cE);if(void 0===t)throw new Error("useMonitoring must be used within a MonitoringProvider");return t})();D.useEffect(()=>{(null==A?void 0:A.url)&&A.autoHideTimeout>0&&C(A.autoHideTimeout)},[A,C]),D.useEffect(()=>{O(t)},[t,O]);const[G,Q]=D.useState(!1),[K,q]=D.useState(!1),W=D.useCallback(t=>{B(t),h&&h(t)},[B,h]),Y=D.useMemo(()=>E>0,[E]),$=D.useMemo(()=>e,[e]),z=D.useCallback(()=>{Q(!0),o&&o()},[o]),X=D.useCallback(()=>{Q(!1)},[]),Z=D.useCallback(()=>{q(!0)},[]),J=D.useCallback(()=>{q(!1)},[]);return w.jsxs("div",{className:fE,children:[w.jsx(zv,{cards:P,finderUiConfig:i,buttonStyle:s,maxVisibleCards:r,isMuted:I,volume:L,currentCardIndex:E,setCurrentCardIndex:T,addSwipeToHistory:F,setIsAnimating:N,isAnimating:_,setNoMoreCards:U,sendSwipeEvent:H,sendImpressionEvent:j,startCardImpression:V,onAllCardsSwiped:c,onCardSwiped:u,id:y}),n.enabled&&w.jsx(oy,{volumeControlUIConfig:n,isMuted:I,volume:L,onToggleMute:R,onVolumeChange:k}),a.enabled&&w.jsx(rE,{x:`${a.buttonLeftPosition}%`,y:100-a.buttonBottomPosition+"%",centered:!0,zIndex:1e3,children:w.jsx(cy,{historyUIConfig:a,show:Y,onOpenHistory:z})}),d.enabled&&w.jsx(rE,{x:`${d.buttonLeftPosition}%`,y:100-d.buttonBottomPosition+"%",centered:50===d.buttonLeftPosition,zIndex:1e3,children:w.jsx(qy,{filtersUIConfig:d,onClick:Z})}),d.enabled&&w.jsx(Zy,{isOpen:K,onClose:J,filtersUIConfig:d,categories:$,selectedCategories:M,onFilterChange:W,scoped:!0}),a.enabled&&w.jsx(Gy,{isOpen:G,onClose:X,swipeHistory:S,getCardsByDirection:b,historyUIConfig:a,navigationUIConfig:m,summaryUIConfig:p,onCardClick:l,scoped:!0}),g.enabled&&w.jsx(rE,{x:`${g.positionLeft}%`,y:100-g.positionBottom+"%",zIndex:100,children:w.jsx(tE,{cardsCounterUIConfig:g,currentCardIndex:E,totalCards:P.length})}),A.enabled&&w.jsx(rE,{x:`${A.positionX}%`,y:`${A.positionY}%`,centered:!0,zIndex:100,children:w.jsx(iE,{logoUIConfig:A,visible:x})})]})},mE="_swippingJourney_15509_1",pE=({summaryEnabled:t=!0,finderUiConfig:e,onSummaryCardClick:i,onSummaryShareClick:s,onAllCardsSwiped:r})=>{const{cards:n,finder:a,categories:o}=oE(),{noMoreCards:l,getCardsByDirection:d,swipeHistory:h}=hE(),[c,u]=D.useState(!1),f=e??a,g=D.useCallback(()=>{r&&r(),t&&u(!0)},[r,t]);D.useEffect(()=>{u(!(!l||!t))},[l,t]);const m=D.useMemo(()=>({right:d("right"),left:d("left"),up:d("up"),down:d("down")}),[d,h]);return f?c&&t?w.jsx("div",{className:mE,children:w.jsx(_y,{cardsByDirection:m,navigationUIConfig:f.navigation,summaryUIConfig:f.summary,onCardClick:i,onShareClick:s,visible:!0})}):w.jsx("div",{className:mE,children:w.jsx(gE,{cards:n,finderUiConfig:f,categories:o,historyUIConfig:f.history,filtersUIConfig:f.filters,volumeControlUIConfig:f.volumeControl,cardsCounterUIConfig:f.cardsCounter,navigationUIConfig:f.navigation,summaryUIConfig:f.summary,logoUIConfig:f.logo,onAllCardsSwiped:g})}):null},AE="_mainBootstrap_1rzog_1";function vE(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var yE,EE={exports:{}};yE=EE,function(){var t={}.hasOwnProperty;function e(){for(var t="",e=0;e<arguments.length;e++){var r=arguments[e];r&&(t=s(t,i(r)))}return t}function i(i){if("string"==typeof i||"number"==typeof i)return i;if("object"!=typeof i)return"";if(Array.isArray(i))return e.apply(null,i);if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]"))return i.toString();var r="";for(var n in i)t.call(i,n)&&i[n]&&(r=s(r,n));return r}function s(t,e){return e?t?t+" "+e:t+e:t}yE.exports?(e.default=e,yE.exports=e):window.classNames=e}();const TE=vE(EE.exports),SE=D.createContext(void 0),bE=({children:t})=>{const[e,i]=D.useState(!1),[s,r]=D.useState(!1),[n,a]=D.useState(!1),[o,l]=D.useState([]),[d,h]=D.useState(!0),c={buttonsVisible:e,summaryVisible:s,ctaTooltipVisible:n,selectedCategories:o,logoVisible:d,showButtons:D.useCallback(()=>{i(!0)},[]),hideButtons:D.useCallback(()=>{i(!1)},[]),showSummary:D.useCallback(()=>{r(!0)},[]),hideSummary:D.useCallback(()=>{r(!1)},[]),showCtaTooltip:D.useCallback(()=>{a(!0)},[]),hideCtaTooltip:D.useCallback(()=>{a(!1)},[]),setSelectedCategories:l,toggleLogo:D.useCallback(t=>{h(t)},[])};return w.jsx(SE.Provider,{value:c,children:t})},IE=({children:t,monitorService:e,dataService:i,backendUrl:s,finderId:r,data:n})=>w.jsx(aE,{dataService:i,finderId:r,backendUrl:s,data:n,children:w.jsx(dE,{children:w.jsx(bE,{children:w.jsx(uE,{monitorService:e,finderId:r,children:t})})})}),LE=({monitorService:t,dataService:e,backendUrl:i,finderId:s,className:r="",data:n})=>w.jsx("div",{className:TE(AE,r),children:w.jsx(IE,{monitorService:t,dataService:e,backendUrl:i,finderId:s,data:n,children:w.jsx(pE,{})})});class RE{getMonitorUrl(){if("undefined"==typeof window)throw new Error("window is not available");if(!window.SWIPEFINDER_CAMPAIGN_MONITOR_URL)throw new Error("SWIPEFINDER_CAMPAIGN_MONITOR_URL is not set");return window.SWIPEFINDER_CAMPAIGN_MONITOR_URL}sendEvent(t){try{const e=this.getMonitorUrl();fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({finder_id:t.finderId,event_type:t.event,session_id:t.sessionId,card_id:t.cardId,card_view_duration:t.cardViewDuration,swipe_direction:t.direction})}).catch(t=>{})}catch(e){}}}class kE{processApiResponse(t){return{finder:t.finder,cards:(e=t.cards.items,e.map(t=>{if("image"===t.type){const{image:e,...i}=t;return{...i,imageUrl:e||t.imageUrl||""}}if("video"===t.type){const{video:e,...i}=t;return{...i,videoUrl:e||t.videoUrl||""}}return t})),categories:t.categories};var e}async loadFinderFromApi(t,e){try{const i=`${e}/api/finders/${t}/queue`,s=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({categories:[],exclude:[]})});if(!s.ok)throw new Error(`API returned status: ${s.status}`);const r=await s.json();return this.processApiResponse(r)}catch(i){return{finder:null,cards:[],categories:[]}}}}exports.SwipeFinder=({backendUrl:t,finderId:e,className:i,data:s,...r})=>{const n=D.useMemo(()=>new RE,[]),a=D.useMemo(()=>new kE,[]);return w.jsx(LE,{monitorService:n,dataService:a,backendUrl:t,finderId:e,className:i,data:s,...r})};