@mux/mux-player
Version:
An open source Mux player web component that Just Worksâ„¢
1,457 lines (1,393 loc) • 201 kB
JavaScript
"use strict";
var mediaThemeNews = (() => {
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __typeError = (msg) => {
throw TypeError(msg);
};
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
// src/themes/news/index.ts
var index_exports = {};
__export(index_exports, {
default: () => index_default
});
// src/themes/news/news.html
var news_default = `<template id="media-theme-news">
<style>
media-controller {
font-size: 13px;
font-family: Roboto, Arial, sans-serif;
--media-font-family: Roboto, helvetica neue, segoe ui, arial, sans-serif;
-webkit-font-smoothing: antialiased;
--media-secondary-color: transparent;
--media-menu-background: rgba(28, 28, 28, 0.9);
--media-control-hover-background: var(--media-secondary-color);
--media-range-track-height: 3px;
--media-range-thumb-height: 13px;
--media-range-thumb-width: 13px;
--media-range-thumb-border-radius: 13px;
--media-preview-thumbnail-border: 2px solid #fff;
--media-preview-thumbnail-border-radius: 2px;
--media-tooltip-display: none;
}
/* The biggest size controller is tied to going fullscreen
instead of a player width */
media-controller[mediaisfullscreen] {
font-size: 17px;
--media-range-thumb-height: 20px;
--media-range-thumb-width: 20px;
--media-range-thumb-border-radius: 10px;
--media-range-track-height: 4px;
}
.nw-button {
position: relative;
display: inline-block;
width: 36px;
padding: 0 2px;
height: 100%;
opacity: 0.9;
transition: opacity 0.1s cubic-bezier(0.4, 0, 1, 1);
}
[breakpointmd] .nw-button {
width: 48px;
}
[mediaisfullscreen] .nw-button {
width: 54px;
}
.nw-button svg {
height: 100%;
width: 100%;
fill: var(--media-primary-color, #fff);
fill-rule: evenodd;
}
.svg-shadow {
stroke: #000;
stroke-opacity: 0.15;
stroke-width: 2px;
fill: none;
}
</style>
<media-controller
breakpoints="sm:300 md:480"
defaultsubtitles="{{defaultsubtitles}}"
defaultduration="{{defaultduration}}"
gesturesdisabled="{{disabled}}"
hotkeys="{{hotkeys}}"
nohotkeys="{{nohotkeys}}"
mediaadbreak="{{mediaadbreak}}"
part="controller"
>
<slot name="media" slot="media"></slot>
<slot name="poster" slot="poster"></slot>
<media-error-dialog slot="dialog"></media-error-dialog>
<!-- Rendition Menu -->
<style>
media-rendition-menu,
media-captions-menu {
position: absolute;
border-radius: 0.3rem;
right: 12px;
bottom: 61px;
z-index: 70;
will-change: width, height;
text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
transition: opacity 0.1s cubic-bezier(0, 0, 0.2, 1);
user-select: none;
--media-settings-menu-min-width: 220px;
--media-menu-item-checked-background: #f72210;
--media-menu-item-checked-indicator-display: none;
font-weight: 500;
}
[mediaisfullscreen] media-rendition-menu {
--media-settings-menu-min-width: 320px;
right: 24px;
bottom: 70px;
}
media-chrome-menu-item {
height: 40px;
font-size: 13px;
font-weight: 500;
padding-top: 0;
padding-bottom: 0;
}
[mediaisfullscreen] media-settings-menu-item {
font-size: 20px;
height: 50px;
}
media-settings-menu-item[submenusize='0'] {
display: none;
}
/* Also hide if only 'Auto' is added. */
.quality-settings[submenusize='1'] {
display: none;
}
</style>
<media-rendition-menu anchor="auto" hidden> </media-rendition-menu>
<media-captions-menu hidden anchor="auto"></media-captions-menu>
<!-- Time Range / Progress Bar -->
<style>
media-play-button[slot='centered-chrome'] {
display: grid;
grid-template-columns: 1.5rem auto;
align-items: center;
gap: 1.2rem;
background: #000;
border-radius: 2rem;
opacity: 1;
padding: 1rem;
font-size: 1.3rem;
font-weight: 400;
text-transform: uppercase;
margin: 0;
scale: 0.7;
}
[breakpointsm] media-play-button[slot='centered-chrome'] {
scale: 1;
}
media-play-button[slot='centered-chrome'] {
display: none;
}
media-play-button[slot='centered-chrome'][mediapaused] {
display: block;
line-height: 1;
color: white;
}
media-play-button[slot='centered-chrome'][mediapaused]:hover {
color: #f72210;
}
media-play-button[slot='centered-chrome'] p {
margin: 0;
align-items: center;
display: flex;
gap: 0.25rem;
}
media-play-button[slot='centered-chrome'] svg {
width: 1.8rem;
height: auto;
}
media-play-button[slot='centered-chrome'] media-duration-display {
display: none;
font-size: 1.3rem;
}
media-controller[mediacurrenttime='0'] media-duration-display {
display: block;
color: inherit;
padding: 0 0.3rem;
}
media-controller:not([mediacurrenttime='0']) media-duration-display {
display: none;
}
media-controller[mediacurrenttime='0'] media-play-button[slot='centered-chrome'] span {
display: none;
}
</style>
<media-play-button slot="centered-chrome">
<p slot="play">
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path
d="M10 18C5.59 18 2 14.41 2 10C2 5.59 5.59 2 10 2C14.41 2 18 5.59 18 10C18 14.41 14.41 18 10 18ZM10 0C8.68678 0 7.38642 0.258658 6.17317 0.761205C4.95991 1.26375 3.85752 2.00035 2.92893 2.92893C1.05357 4.8043 0 7.34784 0 10C0 12.6522 1.05357 15.1957 2.92893 17.0711C3.85752 17.9997 4.95991 18.7362 6.17317 19.2388C7.38642 19.7413 8.68678 20 10 20C12.6522 20 15.1957 18.9464 17.0711 17.0711C18.9464 15.1957 20 12.6522 20 10C20 8.68678 19.7413 7.38642 19.2388 6.17317C18.7362 4.95991 17.9997 3.85752 17.0711 2.92893C16.1425 2.00035 15.0401 1.26375 13.8268 0.761205C12.6136 0.258658 11.3132 0 10 0ZM8 14.5L14 10L8 5.5V14.5Z"
fill="currentColor"
/>
</svg>
<span>Continue</span>
<media-duration-display></media-duration-display>
</p>
</media-play-button>
<!-- Time Range / Progress Bar -->
<style>
media-time-range {
position: absolute;
bottom: 36px;
width: 100%;
height: 5px;
z-index: 2;
--media-range-track-background: rgba(255, 255, 255, 0.2);
--media-range-track-pointer-background: rgba(255, 255, 255, 0.5);
--media-time-range-buffered-color: rgba(255, 255, 255, 0.4);
--media-range-bar-color: var(--media-accent-color, #f72210);
--media-range-thumb-border-radius: 13px;
--media-range-thumb-background: var(--media-accent-color, #f72210);
--media-range-thumb-transition: transform 0.1s linear;
--media-range-thumb-transform: scale(0) translate(0%, 0%);
}
media-time-range:hover {
--media-range-track-height: 5px;
--media-range-thumb-transform: scale(1) translate(0%, 0%);
}
[breakpointmd] media-time-range {
bottom: 47px;
}
[mediaisfullscreen] media-time-range {
bottom: 52.5px;
height: 8px;
}
[mediaisfullscreen] media-time-range:hover {
--media-range-track-height: 8px;
}
media-preview-thumbnail {
margin-bottom: 5px;
}
media-preview-chapter-display {
padding-block: 0;
}
media-preview-time-display {
padding-top: 0;
background: #d8d8d8;
color: black;
padding: 0.25rem 0.5rem;
text-shadow: none;
display: block !important;
opacity: 1;
margin-bottom: 1rem;
}
</style>
<media-time-range>
<media-preview-thumbnail slot="preview"></media-preview-thumbnail>
<media-preview-chapter-display slot="preview"></media-preview-chapter-display>
<media-preview-time-display slot="preview"></media-preview-time-display>
</media-time-range>
<!-- Control Bar -->
<style>
media-control-bar {
height: 36px;
line-height: 36px;
padding-inline: 6px;
}
[breakpointmd] media-control-bar {
height: 48px;
line-height: 48px;
}
[mediaisfullscreen] media-control-bar {
height: 54px;
line-height: 54px;
}
media-control-bar {
--gradient-steps:
hsl(0 0% 0% / 0) 0%, hsl(0 0% 0% / 0.013) 8.1%, hsl(0 0% 0% / 0.049) 15.5%, hsl(0 0% 0% / 0.104) 22.5%,
hsl(0 0% 0% / 0.175) 29%, hsl(0 0% 0% / 0.259) 35.3%, hsl(0 0% 0% / 0.352) 41.2%, hsl(0 0% 0% / 0.45) 47.1%,
hsl(0 0% 0% / 0.55) 52.9%, hsl(0 0% 0% / 0.648) 58.8%, hsl(0 0% 0% / 0.741) 64.7%, hsl(0 0% 0% / 0.825) 71%,
hsl(0 0% 0% / 0.896) 77.5%, hsl(0 0% 0% / 0.951) 84.5%, hsl(0 0% 0% / 0.987) 91.9%, hsl(0 0% 0%) 100%;
}
media-control-bar::before {
content: '';
position: absolute;
width: 100%;
bottom: 0;
left: 0;
padding-bottom: min(100px, 25%);
background: linear-gradient(to bottom, var(--gradient-steps));
opacity: 0.8;
pointer-events: none;
}
media-control-bar > * {
position: relative;
}
</style>
<media-control-bar>
<!-- Play/Pause -->
<style>
media-play-button {
--media-button-icon-width: 30px;
padding: 6px 10px;
}
media-play-button :is(#play-p1, #play-p2, #pause-p1, #pause-p2) {
transition: clip-path 0.25s ease-in;
}
/* Slow down the play icon part hiding slightly
to achieve the morphing look a little better */
media-play-button:not([mediapaused]) #play-p2,
media-play-button:not([mediapaused]) #play-p2 {
transition: clip-path 0.35s ease-in;
}
/* Show icon */
media-play-button :is(#pause-p1, #pause-p2),
media-play-button[mediapaused] :is(#play-p1, #play-p2) {
clip-path: inset(0);
}
/* Hide icon wth clip path mask */
media-play-button #play-p1 {
clip-path: inset(0 100% 0 0);
}
media-play-button #play-p2 {
clip-path: inset(0 20% 0 100%);
}
media-play-button[mediapaused] #pause-p1 {
clip-path: inset(50% 0 50% 0);
}
media-play-button[mediapaused] #pause-p2 {
clip-path: inset(50% 0 50% 0);
}
</style>
<media-play-button mediapaused class="nw-button">
<svg slot="icon" viewBox="0 0 36 36">
<use class="svg-shadow" xlink:href="#icon-play"></use>
<g id="icon-play">
<path id="play-p1" d="M18.5 14L12 10V26L18.5 22V14Z" />
<path id="play-p2" d="M18 13.6953L25 18L18 22.3086V13.6953Z" />
<path id="pause-p1" d="M16 10H12V26H16V10Z" />
<path id="pause-p2" d="M21 10H25V26H21V10Z" />
</g>
</svg>
</media-play-button>
<template if="breakpointsm">
<template if="mediaadbreak == null">
<media-seek-backward-button seekoffset="10">
<svg slot="icon" width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
<path
d="M16.908 21.7465C16.616 21.2426 16.2047 20.8212 15.7116 20.5206C15.2185 20.22 14.6594 20.0499 14.0851 20.0257C13.5109 20.0499 12.9518 20.22 12.4587 20.5206C11.9656 20.8212 11.5543 21.2426 11.2623 21.7465C10.5893 22.8804 10.2336 24.18 10.2336 25.5047C10.2336 26.8295 10.5893 28.129 11.2623 29.2629C11.5543 29.7668 11.9656 30.1882 12.4587 30.4888C12.9518 30.7894 13.5109 30.9595 14.0851 30.9838C14.6594 30.9595 15.2185 30.7894 15.7116 30.4888C16.2047 30.1882 16.616 29.7668 16.908 29.2629C17.581 28.129 17.9367 26.8295 17.9367 25.5047C17.9367 24.18 17.581 22.8804 16.908 21.7465ZM14.0851 29.409C12.8412 29.409 11.7886 27.6233 11.7886 25.4966C11.7886 23.3699 12.8412 21.5841 14.0851 21.5841C15.3291 21.5841 16.3817 23.3699 16.3817 25.4966C16.3817 27.6233 15.3451 29.409 14.0851 29.409ZM7.16351 30.9838V22.7043L6.39798 23.4836L5.31349 22.3796L7.38679 20.2692C7.49386 20.1598 7.63043 20.0853 7.77917 20.0551C7.92792 20.0248 8.08213 20.0403 8.22225 20.0994C8.36236 20.1585 8.48206 20.2587 8.56615 20.3872C8.65024 20.5157 8.69493 20.6667 8.69456 20.8211V31L7.16351 30.9838ZM33 9.8468V30.1883C32.9972 30.3941 32.9157 30.5907 32.7727 30.7362C32.6298 30.8817 32.4366 30.9647 32.2345 30.9675H22.2348V27.8343H29.9219V12.1845H11.4696V15.3177C11.4696 16.1782 10.8954 16.4866 10.1937 16.0158L3.52726 11.4865C3.30225 11.371 3.13094 11.17 3.05035 10.927C2.96977 10.6839 2.98641 10.4184 3.09666 10.1877C3.18836 9.99697 3.33987 9.84275 3.52726 9.7494L10.1937 5.22005C10.8954 4.74926 11.4696 5.05771 11.4696 5.91812V9.05133H32.2185C32.4248 9.05443 32.6218 9.13923 32.7677 9.28775C32.9136 9.43626 32.997 9.6368 33 9.8468Z"
fill="currentColor"
/>
</svg>
</media-seek-backward-button>
</template>
</template>
<!-- Time Display -->
<style>
media-time-display {
padding-top: 6px;
padding-bottom: 6px;
font-size: 13px;
}
[mediaisfullscreen] media-time-display {
font-size: 20px;
}
</style>
<template if="breakpointsm">
<template if="mediaadbreak == null">
<media-time-display showduration></media-time-display>
</template>
<template if="mediaadbreak != null">
<span>Advertisement</span>
<media-time-display remaining></media-time-display>
</template>
</template>
<template if="!breakpointsm">
<template if="mediaadbreak == null">
<media-time-display></media-time-display>
</template>
<template if="mediaadbreak != null">
<span>Ad</span>
<media-time-display remaining></media-time-display>
</template>
</template>
<!-- Control Spacer -->
<style>
.control-spacer {
flex-grow: 1;
}
</style>
<span class="control-spacer"></span>
<!-- Volume/Mute -->
<style>
media-mute-button :is(#icon-muted, #icon-volume) {
transition: clip-path 0.3s ease-out;
}
media-mute-button #icon-muted {
clip-path: inset(0 0 100% 0);
}
media-mute-button[mediavolumelevel='off'] #icon-muted {
clip-path: inset(0);
}
media-mute-button #icon-volume {
clip-path: inset(0);
}
media-mute-button[mediavolumelevel='off'] #icon-volume {
clip-path: inset(100% 0 0 0);
}
media-mute-button #volume-high,
media-mute-button[mediavolumelevel='off'] #volume-high {
opacity: 1;
transition: opacity 0.3s;
}
media-mute-button[mediavolumelevel='low'] #volume-high,
media-mute-button[mediavolumelevel='medium'] #volume-high {
opacity: 0.2;
}
media-volume-range {
height: 36px;
--media-range-track-background: rgba(255, 255, 255, 0.2);
}
media-mute-button + media-volume-range {
width: 0;
overflow: hidden;
transition: width 0.2s ease-in;
}
/* Expand volume control in all relevant states */
media-mute-button:hover + media-volume-range,
media-mute-button:focus + media-volume-range,
media-mute-button:focus-within + media-volume-range,
media-volume-range:hover,
media-volume-range:focus,
media-volume-range:focus-within {
width: 70px;
}
</style>
<media-mute-button class="nw-button">
<svg slot="icon" viewBox="0 0 36 36">
<g id="icon-volume">
<path id="speaker" d="M13 15H9V21H13L18 26V10L13 15Z" />
<path
id="volume-low"
d="M20 22.0323C21.4818 21.2959 22.5 19.7669 22.5 18C22.5 16.2332 21.4818 14.7041 20 13.9678V22.0323Z"
/>
<path
id="volume-high"
d="M20 9.22302V11.2899C22.8915 12.1505 25 14.829 25 18C25 21.171 22.8915 23.8495 20 24.7101V26.777C24.008 25.8675 27 22.2832 27 18C27 13.7168 24.008 10.1325 20 9.22302Z"
/>
</g>
<g id="icon-muted">
<path
d="M10.2207 8.80817L8.80762 10.2213L13.2929 14.7065L13 14.9995H9V20.9995H13L18 25.9995V19.4136L22.1922 23.6058C21.5401 24.0942 20.8 24.4715 20 24.7096V26.7764C21.3453 26.4712 22.5761 25.8646 23.6177 25.0314L25.7782 27.1918L27.1924 25.7776L27.1913 25.7766L27.1902 25.7776L10.2207 8.80817Z"
/>
<path
d="M25.8817 22.3478C26.5944 21.0589 27 19.5766 27 17.9995C27 13.7163 24.008 10.132 20 9.22247V11.2894C22.8915 12.1499 25 14.8284 25 17.9995C25 19.0177 24.7826 19.9851 24.3917 20.8578L25.8817 22.3478Z"
/>
<path
d="M22.4139 18.88C22.4704 18.5952 22.5 18.3008 22.5 17.9995C22.5 16.2326 21.4818 14.7036 20 13.9672V16.4661L22.4139 18.88Z"
/>
<path d="M18 14.4661V9.99945L15.7667 12.2328L18 14.4661Z" />
</g>
</svg>
</media-mute-button>
<media-volume-range></media-volume-range>
<!-- Settings Menu Button -->
<template if="mediaadbreak == null">
<style>
media-settings-menu-button svg {
transition: transform 0.1s cubic-bezier(0.4, 0, 1, 1);
transform: rotateZ(0deg);
}
media-settings-menu-button[aria-expanded='true'] svg {
transform: rotateZ(30deg);
}
</style>
<media-rendition-menu-button class="nw-button">
<svg slot="icon" viewBox="0 0 36 36">
<use class="svg-shadow" xlink:href="#settings-icon"></use>
<path
id="settings-icon"
d="M11.8153 12.0477L14.2235 12.9602C14.6231 12.6567 15.0599 12.3996 15.5258 12.1971L15.9379 9.66561C16.5985 9.50273 17.2891 9.41632 18 9.41632C18.7109 9.41632 19.4016 9.50275 20.0622 9.66566L20.4676 12.1555C20.9584 12.3591 21.418 12.6227 21.8372 12.9372L24.1846 12.0477C25.1391 13.0392 25.8574 14.2597 26.249 15.6186L24.3196 17.1948C24.3531 17.4585 24.3704 17.7272 24.3704 18C24.3704 18.2727 24.3531 18.5415 24.3196 18.8051L26.249 20.3814C25.8574 21.7403 25.1391 22.9607 24.1846 23.9522L21.8372 23.0628C21.4179 23.3772 20.9584 23.6408 20.4676 23.8445L20.0622 26.3343C19.4016 26.4972 18.7109 26.5836 18 26.5836C17.2891 26.5836 16.5985 26.4972 15.9379 26.3344L15.5258 23.8029C15.0599 23.6003 14.6231 23.3433 14.2236 23.0398L11.8154 23.9523C10.8609 22.9608 10.1426 21.7404 9.75098 20.3815L11.7633 18.7375C11.7352 18.4955 11.7208 18.2495 11.7208 18C11.7208 17.7505 11.7352 17.5044 11.7633 17.2625L9.75098 15.6185C10.1426 14.2596 10.8609 13.0392 11.8153 12.0477ZM18 20.75C19.5188 20.75 20.75 19.5188 20.75 18C20.75 16.4812 19.5188 15.25 18 15.25C16.4812 15.25 15.25 16.4812 15.25 18C15.25 19.5188 16.4812 20.75 18 20.75Z"
/>
</svg>
</media-rendition-menu-button>
<media-captions-menu-button></media-captions-menu-button>
</template>
<!-- Fullscreen Button -->
<style>
/* Having trouble getting @property to work in the shadow dom
to clean this up. Like https://codepen.io/luwes/pen/oNRyZyx */
media-fullscreen-button path {
translate: 0% 0%;
}
media-fullscreen-button:hover path {
animation: 0.35s up-left-bounce cubic-bezier(0.34, 1.56, 0.64, 1);
}
media-fullscreen-button:hover .urbounce {
animation-name: up-right-bounce;
}
media-fullscreen-button:hover .dlbounce {
animation-name: down-left-bounce;
}
media-fullscreen-button:hover .drbounce {
animation-name: down-right-bounce;
}
@keyframes up-left-bounce {
0% {
translate: 0 0;
}
50% {
translate: -4% -4%;
}
}
@keyframes up-right-bounce {
0% {
translate: 0 0;
}
50% {
translate: 4% -4%;
}
}
@keyframes down-left-bounce {
0% {
translate: 0 0;
}
50% {
translate: -4% 4%;
}
}
@keyframes down-right-bounce {
0% {
translate: 0 0;
}
50% {
translate: 4% 4%;
}
}
</style>
<media-fullscreen-button class="nw-button">
<svg slot="enter" viewBox="0 0 36 36">
<use class="svg-shadow" xlink:href="#fs-enter-paths"></use>
<g id="fs-enter-paths">
<path class="ulbounce" d="M11 15H9V9H15V11H11V15Z" />
<path class="urbounce" d="M21 11L21 9L27 9L27 15L25 15L25 11L21 11Z" />
<path class="dlbounce" d="M15 25L15 27L9 27L9 21L11 21L11 25L15 25Z" />
<path class="drbounce" d="M25 21L27 21L27 27L21 27L21 25L25 25L25 21Z" />
</g>
</svg>
<svg slot="exit" viewBox="0 0 36 36">
<use class="svg-shadow" xlink:href="#fs-exit-paths"></use>
<g id="fs-exit-paths">
<path class="drbounce" d="M14 9L16 9L16 16L9 16L9 14L14 14L14 9Z" />
<path class="dlbounce" d="M27 14L27 16L20 16L20 9L22 9L22 14L27 14Z" />
<path class="urbounce" d="M9 22L9 20L16 20L16 27L14 27L14 22L9 22Z" />
<path class="ulbounce" d="M22 27H20V20H27V22H22V27Z" />
</g>
</svg>
</media-fullscreen-button>
</media-control-bar>
</media-controller>
</template>
`;
// src/polyfills/index.ts
var EventTarget = class {
addEventListener() {
}
removeEventListener() {
}
dispatchEvent(_event) {
return true;
}
};
if (typeof DocumentFragment === "undefined") {
class DocumentFragment3 extends EventTarget {
}
globalThis.DocumentFragment = DocumentFragment3;
}
var HTMLElement = class extends EventTarget {
};
var HTMLVideoElement = class extends EventTarget {
};
var customElements = {
get(_name) {
return void 0;
},
define(_name, _constructor, _options) {
},
getName(_constructor) {
return null;
},
upgrade(_root) {
},
whenDefined(_name) {
return Promise.resolve(HTMLElement);
}
};
var _detail;
var CustomEvent2 = class {
constructor(_typeArg, eventInitDict = {}) {
__privateAdd(this, _detail);
__privateSet(this, _detail, eventInitDict == null ? void 0 : eventInitDict.detail);
}
get detail() {
return __privateGet(this, _detail);
}
initCustomEvent() {
}
};
_detail = new WeakMap();
function createElement(_tagName, _options) {
return new HTMLElement();
}
var globalThisShim = {
document: {
createElement
},
DocumentFragment,
customElements,
CustomEvent: CustomEvent2,
EventTarget,
HTMLElement,
HTMLVideoElement
};
var isServer = typeof window === "undefined" || typeof globalThis.customElements === "undefined";
var internalGlobalThis = isServer ? globalThisShim : globalThis;
var internalDocument = isServer ? globalThisShim.document : globalThis.document;
// node_modules/media-chrome/dist/constants.js
var MediaUIEvents = {
MEDIA_PLAY_REQUEST: "mediaplayrequest",
MEDIA_PAUSE_REQUEST: "mediapauserequest",
MEDIA_MUTE_REQUEST: "mediamuterequest",
MEDIA_UNMUTE_REQUEST: "mediaunmuterequest",
MEDIA_LOOP_REQUEST: "medialooprequest",
MEDIA_VOLUME_REQUEST: "mediavolumerequest",
MEDIA_SEEK_REQUEST: "mediaseekrequest",
MEDIA_AIRPLAY_REQUEST: "mediaairplayrequest",
MEDIA_ENTER_FULLSCREEN_REQUEST: "mediaenterfullscreenrequest",
MEDIA_EXIT_FULLSCREEN_REQUEST: "mediaexitfullscreenrequest",
MEDIA_PREVIEW_REQUEST: "mediapreviewrequest",
MEDIA_ENTER_PIP_REQUEST: "mediaenterpiprequest",
MEDIA_EXIT_PIP_REQUEST: "mediaexitpiprequest",
MEDIA_ENTER_CAST_REQUEST: "mediaentercastrequest",
MEDIA_EXIT_CAST_REQUEST: "mediaexitcastrequest",
MEDIA_SHOW_TEXT_TRACKS_REQUEST: "mediashowtexttracksrequest",
MEDIA_HIDE_TEXT_TRACKS_REQUEST: "mediahidetexttracksrequest",
MEDIA_SHOW_SUBTITLES_REQUEST: "mediashowsubtitlesrequest",
MEDIA_DISABLE_SUBTITLES_REQUEST: "mediadisablesubtitlesrequest",
MEDIA_TOGGLE_SUBTITLES_REQUEST: "mediatogglesubtitlesrequest",
MEDIA_PLAYBACK_RATE_REQUEST: "mediaplaybackraterequest",
MEDIA_RENDITION_REQUEST: "mediarenditionrequest",
MEDIA_AUDIO_TRACK_REQUEST: "mediaaudiotrackrequest",
MEDIA_SEEK_TO_LIVE_REQUEST: "mediaseektoliverequest",
REGISTER_MEDIA_STATE_RECEIVER: "registermediastatereceiver",
UNREGISTER_MEDIA_STATE_RECEIVER: "unregistermediastatereceiver"
};
var MediaStateReceiverAttributes = {
MEDIA_CHROME_ATTRIBUTES: "mediachromeattributes",
MEDIA_CONTROLLER: "mediacontroller"
};
var MediaUIProps = {
MEDIA_AIRPLAY_UNAVAILABLE: "mediaAirplayUnavailable",
MEDIA_AUDIO_TRACK_ENABLED: "mediaAudioTrackEnabled",
MEDIA_AUDIO_TRACK_LIST: "mediaAudioTrackList",
MEDIA_AUDIO_TRACK_UNAVAILABLE: "mediaAudioTrackUnavailable",
MEDIA_BUFFERED: "mediaBuffered",
MEDIA_CAST_UNAVAILABLE: "mediaCastUnavailable",
MEDIA_CHAPTERS_CUES: "mediaChaptersCues",
MEDIA_CURRENT_TIME: "mediaCurrentTime",
MEDIA_DURATION: "mediaDuration",
MEDIA_ENDED: "mediaEnded",
MEDIA_ERROR: "mediaError",
MEDIA_ERROR_CODE: "mediaErrorCode",
MEDIA_ERROR_MESSAGE: "mediaErrorMessage",
MEDIA_FULLSCREEN_UNAVAILABLE: "mediaFullscreenUnavailable",
MEDIA_HAS_PLAYED: "mediaHasPlayed",
MEDIA_HEIGHT: "mediaHeight",
MEDIA_IS_AIRPLAYING: "mediaIsAirplaying",
MEDIA_IS_CASTING: "mediaIsCasting",
MEDIA_IS_FULLSCREEN: "mediaIsFullscreen",
MEDIA_IS_PIP: "mediaIsPip",
MEDIA_LOADING: "mediaLoading",
MEDIA_MUTED: "mediaMuted",
MEDIA_LOOP: "mediaLoop",
MEDIA_PAUSED: "mediaPaused",
MEDIA_PIP_UNAVAILABLE: "mediaPipUnavailable",
MEDIA_PLAYBACK_RATE: "mediaPlaybackRate",
MEDIA_PREVIEW_CHAPTER: "mediaPreviewChapter",
MEDIA_PREVIEW_COORDS: "mediaPreviewCoords",
MEDIA_PREVIEW_IMAGE: "mediaPreviewImage",
MEDIA_PREVIEW_TIME: "mediaPreviewTime",
MEDIA_RENDITION_LIST: "mediaRenditionList",
MEDIA_RENDITION_SELECTED: "mediaRenditionSelected",
MEDIA_RENDITION_UNAVAILABLE: "mediaRenditionUnavailable",
MEDIA_SEEKABLE: "mediaSeekable",
MEDIA_STREAM_TYPE: "mediaStreamType",
MEDIA_SUBTITLES_LIST: "mediaSubtitlesList",
MEDIA_SUBTITLES_SHOWING: "mediaSubtitlesShowing",
MEDIA_TARGET_LIVE_WINDOW: "mediaTargetLiveWindow",
MEDIA_TIME_IS_LIVE: "mediaTimeIsLive",
MEDIA_VOLUME: "mediaVolume",
MEDIA_VOLUME_LEVEL: "mediaVolumeLevel",
MEDIA_VOLUME_UNAVAILABLE: "mediaVolumeUnavailable",
MEDIA_LANG: "mediaLang",
MEDIA_WIDTH: "mediaWidth"
};
var MediaUIPropsEntries = Object.entries(
MediaUIProps
);
var MediaUIAttributes = MediaUIPropsEntries.reduce(
(dictObj, [key, propName]) => {
dictObj[key] = propName.toLowerCase();
return dictObj;
},
{}
);
var AdditionalStateChangeEvents = {
USER_INACTIVE_CHANGE: "userinactivechange",
BREAKPOINTS_CHANGE: "breakpointchange",
BREAKPOINTS_COMPUTED: "breakpointscomputed"
};
var MediaStateChangeEvents = MediaUIPropsEntries.reduce(
(dictObj, [key, propName]) => {
dictObj[key] = propName.toLowerCase();
return dictObj;
},
{ ...AdditionalStateChangeEvents }
);
var StateChangeEventToAttributeMap = Object.entries(
MediaStateChangeEvents
).reduce(
(mapObj, [key, eventType]) => {
const attrName = MediaUIAttributes[key];
if (attrName) {
mapObj[eventType] = attrName;
}
return mapObj;
},
{ userinactivechange: "userinactive" }
);
var AttributeToStateChangeEventMap = Object.entries(
MediaUIAttributes
).reduce(
(mapObj, [key, attrName]) => {
const evtType = MediaStateChangeEvents[key];
if (evtType) {
mapObj[attrName] = evtType;
}
return mapObj;
},
{ userinactive: "userinactivechange" }
);
var TextTrackKinds = {
SUBTITLES: "subtitles",
CAPTIONS: "captions",
DESCRIPTIONS: "descriptions",
CHAPTERS: "chapters",
METADATA: "metadata"
};
// node_modules/media-chrome/dist/utils/server-safe-globals.js
var EventTarget2 = class {
addEventListener() {
}
removeEventListener() {
}
dispatchEvent() {
return true;
}
};
var Node = class extends EventTarget2 {
};
var Element = class extends Node {
constructor() {
super(...arguments);
this.role = null;
}
};
var ResizeObserver = class {
observe() {
}
unobserve() {
}
disconnect() {
}
};
var documentShim = {
createElement: function() {
return new globalThisShim2.HTMLElement();
},
createElementNS: function() {
return new globalThisShim2.HTMLElement();
},
addEventListener() {
},
removeEventListener() {
},
dispatchEvent(_event) {
return false;
}
};
var globalThisShim2 = {
ResizeObserver,
document: documentShim,
Node,
Element,
HTMLElement: class HTMLElement2 extends Element {
constructor() {
super(...arguments);
this.innerHTML = "";
}
get content() {
return new globalThisShim2.DocumentFragment();
}
},
DocumentFragment: class DocumentFragment2 extends EventTarget2 {
},
customElements: {
get: function() {
},
define: function() {
},
whenDefined: function() {
}
},
localStorage: {
getItem(_key) {
return null;
},
setItem(_key, _value2) {
},
removeItem(_key) {
}
},
CustomEvent: function CustomEvent3() {
},
getComputedStyle: function() {
},
navigator: {
languages: [],
get userAgent() {
return "";
}
},
matchMedia(media) {
return {
matches: false,
media
};
},
DOMParser: class DOMParser {
parseFromString(string, _contentType) {
return {
body: {
textContent: string
}
};
}
}
};
var isServer2 = "global" in globalThis && (globalThis == null ? void 0 : globalThis.global) === globalThis || // node or node-like environments, whether or not there are global polyfills like jsdom
typeof window === "undefined" || typeof window.customElements === "undefined";
var isShimmed = Object.keys(globalThisShim2).every((key) => key in globalThis);
var GlobalThis = isServer2 && !isShimmed ? globalThisShim2 : globalThis;
var Document2 = isServer2 && !isShimmed ? documentShim : globalThis.document;
// node_modules/media-chrome/dist/utils/template-parts.js
var __accessCheck2 = (obj, member, msg) => {
if (!member.has(obj))
throw TypeError("Cannot " + msg);
};
var __privateGet2 = (obj, member, getter) => {
__accessCheck2(obj, member, "read from private field");
return getter ? getter.call(obj) : member.get(obj);
};
var __privateAdd2 = (obj, member, value) => {
if (member.has(obj))
throw TypeError("Cannot add the same private member more than once");
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
};
var __privateSet2 = (obj, member, value, setter) => {
__accessCheck2(obj, member, "write to private field");
setter ? setter.call(obj, value) : member.set(obj, value);
return value;
};
var _parts;
var _processor;
var _items;
var _value;
var _element;
var _attributeName;
var _namespaceURI;
var _list;
var list_get;
var _parentNode;
var _nodes;
var ELEMENT = 1;
var STRING = 0;
var PART = 1;
var defaultProcessor = {
processCallback(instance, parts, state) {
if (!state)
return;
for (const [expression, part] of parts) {
if (expression in state) {
const value = state[expression];
if (typeof value === "boolean" && part instanceof AttrPart && typeof part.element[part.attributeName] === "boolean") {
part.booleanValue = value;
} else if (typeof value === "function" && part instanceof AttrPart) {
part.element[part.attributeName] = value;
} else {
part.value = value;
}
}
}
}
};
var TemplateInstance = class extends GlobalThis.DocumentFragment {
constructor(template2, state, processor2 = defaultProcessor) {
var _a3;
super();
__privateAdd2(this, _parts, void 0);
__privateAdd2(this, _processor, void 0);
this.append(template2.content.cloneNode(true));
__privateSet2(this, _parts, parse(this));
__privateSet2(this, _processor, processor2);
(_a3 = processor2.createCallback) == null ? void 0 : _a3.call(processor2, this, __privateGet2(this, _parts), state);
processor2.processCallback(this, __privateGet2(this, _parts), state);
}
update(state) {
__privateGet2(this, _processor).processCallback(this, __privateGet2(this, _parts), state);
}
};
_parts = /* @__PURE__ */ new WeakMap();
_processor = /* @__PURE__ */ new WeakMap();
var parse = (element, parts = []) => {
let type, value;
for (const attr of element.attributes || []) {
if (attr.value.includes("{{")) {
const list = new AttrPartList();
for ([type, value] of tokenize(attr.value)) {
if (!type)
list.append(value);
else {
const part = new AttrPart(element, attr.name, attr.namespaceURI);
list.append(part);
parts.push([value, part]);
}
}
attr.value = list.toString();
}
}
for (const node of element.childNodes) {
if (node.nodeType === ELEMENT && !(node instanceof HTMLTemplateElement)) {
parse(node, parts);
} else {
const data = node.data;
if (node.nodeType === ELEMENT || data.includes("{{")) {
const items = [];
if (data) {
for ([type, value] of tokenize(data))
if (!type)
items.push(new Text(value));
else {
const part = new ChildNodePart(element);
items.push(part);
parts.push([value, part]);
}
} else if (node instanceof HTMLTemplateElement) {
const part = new InnerTemplatePart(element, node);
items.push(part);
parts.push([part.expression, part]);
}
node.replaceWith(
...items.flatMap((part) => part.replacementNodes || [part])
);
}
}
}
return parts;
};
var mem = {};
var tokenize = (text) => {
let value = "", open = 0, tokens = mem[text], i = 0, c;
if (tokens)
return tokens;
else
tokens = [];
for (; c = text[i]; i++) {
if (c === "{" && text[i + 1] === "{" && text[i - 1] !== "\\" && text[i + 2] && ++open == 1) {
if (value)
tokens.push([STRING, value]);
value = "";
i++;
} else if (c === "}" && text[i + 1] === "}" && text[i - 1] !== "\\" && !--open) {
tokens.push([PART, value.trim()]);
value = "";
i++;
} else
value += c || "";
}
if (value)
tokens.push([STRING, (open > 0 ? "{{" : "") + value]);
return mem[text] = tokens;
};
var FRAGMENT = 11;
var Part = class {
get value() {
return "";
}
set value(val) {
}
toString() {
return this.value;
}
};
var attrPartToList = /* @__PURE__ */ new WeakMap();
var AttrPartList = class {
constructor() {
__privateAdd2(this, _items, []);
}
[Symbol.iterator]() {
return __privateGet2(this, _items).values();
}
get length() {
return __privateGet2(this, _items).length;
}
item(index) {
return __privateGet2(this, _items)[index];
}
append(...items) {
for (const item of items) {
if (item instanceof AttrPart) {
attrPartToList.set(item, this);
}
__privateGet2(this, _items).push(item);
}
}
toString() {
return __privateGet2(this, _items).join("");
}
};
_items = /* @__PURE__ */ new WeakMap();
var AttrPart = class extends Part {
constructor(element, attributeName, namespaceURI) {
super();
__privateAdd2(this, _list);
__privateAdd2(this, _value, "");
__privateAdd2(this, _element, void 0);
__privateAdd2(this, _attributeName, void 0);
__privateAdd2(this, _namespaceURI, void 0);
__privateSet2(this, _element, element);
__privateSet2(this, _attributeName, attributeName);
__privateSet2(this, _namespaceURI, namespaceURI);
}
get attributeName() {
return __privateGet2(this, _attributeName);
}
get attributeNamespace() {
return __privateGet2(this, _namespaceURI);
}
get element() {
return __privateGet2(this, _element);
}
get value() {
return __privateGet2(this, _value);
}
set value(newValue) {
if (__privateGet2(this, _value) === newValue)
return;
__privateSet2(this, _value, newValue);
if (!__privateGet2(this, _list, list_get) || __privateGet2(this, _list, list_get).length === 1) {
if (newValue == null) {
__privateGet2(this, _element).removeAttributeNS(
__privateGet2(this, _namespaceURI),
__privateGet2(this, _attributeName)
);
} else {
__privateGet2(this, _element).setAttributeNS(
__privateGet2(this, _namespaceURI),
__privateGet2(this, _attributeName),
newValue
);
}
} else {
__privateGet2(this, _element).setAttributeNS(
__privateGet2(this, _namespaceURI),
__privateGet2(this, _attributeName),
__privateGet2(this, _list, list_get).toString()
);
}
}
get booleanValue() {
return __privateGet2(this, _element).hasAttributeNS(
__privateGet2(this, _namespaceURI),
__privateGet2(this, _attributeName)
);
}
set booleanValue(value) {
if (!__privateGet2(this, _list, list_get) || __privateGet2(this, _list, list_get).length === 1)
this.value = value ? "" : null;
else
throw new DOMException("Value is not fully templatized");
}
};
_value = /* @__PURE__ */ new WeakMap();
_element = /* @__PURE__ */ new WeakMap();
_attributeName = /* @__PURE__ */ new WeakMap();
_namespaceURI = /* @__PURE__ */ new WeakMap();
_list = /* @__PURE__ */ new WeakSet();
list_get = function() {
return attrPartToList.get(this);
};
var ChildNodePart = class extends Part {
constructor(parentNode, nodes) {
super();
__privateAdd2(this, _parentNode, void 0);
__privateAdd2(this, _nodes, void 0);
__privateSet2(this, _parentNode, parentNode);
__privateSet2(this, _nodes, nodes ? [...nodes] : [new Text()]);
}
get replacementNodes() {
return __privateGet2(this, _nodes);
}
get parentNode() {
return __privateGet2(this, _parentNode);
}
get nextSibling() {
return __privateGet2(this, _nodes)[__privateGet2(this, _nodes).length - 1].nextSibling;
}
get previousSibling() {
return __privateGet2(this, _nodes)[0].previousSibling;
}
// FIXME: not sure why do we need string serialization here? Just because parent class has type DOMString?
get value() {
return __privateGet2(this, _nodes).map((node) => node.textContent).join("");
}
set value(newValue) {
this.replace(newValue);
}
replace(...nodes) {
const normalisedNodes = nodes.flat().flatMap(
(node) => node == null ? [new Text()] : node.forEach ? [...node] : node.nodeType === FRAGMENT ? [...node.childNodes] : node.nodeType ? [node] : [new Text(node)]
);
if (!normalisedNodes.length)
normalisedNodes.push(new Text());
__privateSet2(this, _nodes, swapdom(
__privateGet2(this, _nodes)[0].parentNode,
__privateGet2(this, _nodes),
normalisedNodes,
this.nextSibling
));
}
};
_parentNode = /* @__PURE__ */ new WeakMap();
_nodes = /* @__PURE__ */ new WeakMap();
var InnerTemplatePart = class extends ChildNodePart {
constructor(parentNode, template2) {
const directive = template2.getAttribute("directive") || template2.getAttribute("type");
let expression = template2.getAttribute("expression") || template2.getAttribute(directive) || "";
if (expression.startsWith("{{"))
expression = expression.trim().slice(2, -2).trim();
super(parentNode);
this.expression = expression;
this.template = template2;
this.directive = directive;
}
};
function swapdom(parent, a, b, end = null) {
let i = 0, cur, next, bi, n = b.length, m = a.length;
while (i < n && i < m && a[i] == b[i])
i++;
while (i < n && i < m && b[n - 1] == a[m - 1])
end = b[--m, --n];
if (i == m)
while (i < n)
parent.insertBefore(b[i++], end);
if (i == n)
while (i < m)
parent.removeChild(a[i++]);
else {
cur = a[i];
while (i < n) {
bi = b[i++], next = cur ? cur.nextSibling : end;
if (cur == bi)
cur = next;
else if (i < n && b[i] == next)
parent.replaceChild(bi, cur), cur = next;
else
parent.insertBefore(bi, cur);
}
while (cur != end)
next = cur.nextSibling, parent.removeChild(cur), cur = next;
}
return b;
}
// node_modules/media-chrome/dist/utils/utils.js
function parseRenditionList(renditions) {
return renditions == null ? void 0 : renditions.split(/\s+/).map(parseRendition);
}
function parseRendition(rendition) {
if (rendition) {
const [id, width, height] = rendition.split(":");
return { id, width: +width, height: +height };
}
}
function parseAudioTrackList(audioTracks) {
return audioTracks == null ? void 0 : audioTracks.split(/\s+/).map(parseAudioTrack);
}
function parseAudioTrack(audioTrack) {
if (audioTrack) {
const [id, kind, language, label] = audioTrack.split(":");
return {
id,
kind,
language,
label
};
}
}
function camelCase(name) {
return name.replace(/[-_]([a-z])/g, ($0, $1) => $1.toUpperCase());
}
function isNumericString(str) {
if (typeof str != "string")
return false;
return !isNaN(str) && !isNaN(parseFloat(str));
}
// node_modules/media-chrome/dist/utils/template-processor.js
var pipeModifiers = {
string: (value) => String(value)
};
var PartialTemplate = class {
constructor(template2) {
this.template = template2;
this.state = void 0;
}
};
var templates = /* @__PURE__ */ new WeakMap();
var templateInstances = /* @__PURE__ */ new WeakMap();
var Directives = {
partial: (part, state) => {
state[part.expression] = new PartialTemplate(part.template);
},
if: (part, state) => {
var _a3;
if (evaluateExpression(part.expression, state)) {
if (templates.get(part) !== part.template) {
templates.set(part, part.template);
const tpl = new TemplateInstance(part.template, state, processor);
part.replace(tpl);
templateInstances.set(part, tpl);
} else {
(_a3 = templateInstances.get(part)) == null ? void 0 : _a3.update(state);
}
} else {
part.replace("");
templates.delete(part);
templateInstances.delete(part);
}
}
};
var DirectiveNames = Object.keys(Directives);
var processor = {
processCallback(instance, parts, state) {
var _a3, _b2;
if (!state)
return;
for (const [expression, part] of parts) {
if (part instanceof InnerTemplatePart) {
if (!part.directive) {
const directive = DirectiveNames.find(
(n) => part.template.hasAttribute(n)
);
if (directive) {
part.directive = directive;
part.expression = part.template.getAttribute(directive);
}
}
(_a3 = Directives[part.directive]) == null ? void 0 : _a3.call(Directives, part, state);
continue;
}
let value = evaluateExpression(expression, state);
if (value instanceof PartialTemplate) {
if (templates.get(part) !== value.template) {
templates.set(part, value.template);
value = new TemplateInstance(value.template, value.state, processor);
part.value = value;
templateInstances.set(part, value);
} else {
(_b2 = templateInstances.get(part)) == null ? void 0 : _b2.update(value.state);
}
continue;
}
if (value) {
if (part instanceof AttrPart) {
if (part.attributeName.startsWith("aria-")) {
value = String(value);
}
}
if (part instanceof AttrPart) {
if (typeof value === "boolean") {
part.booleanValue = value;
} else if (typeof value === "function") {
part.element[part.attributeName] = value;
} else {
part.value = value;
}
} else {
part.value = value;
templates.delete(part);
templateInstances.delete(part);
}
} else {
if (part instanceof AttrPart) {
part.value = void 0;
} else {
part.value = void 0;
templates.delete(part);
templateInstances.delete(part);
}
}
}
}
};
var operators = {
"!": (a) => !a,
"!!": (a) => !!a,
"==": (a, b) => a == b,
"!=": (a, b) => a != b,
">": (a, b) => a > b,
">=": (a, b) => a >= b,
"<": (a, b) => a < b,
"<=": (a, b) => a <= b,
"??": (a, b) => a != null ? a : b,
"|": (a, b) => {
var _a3;
return (_a3 = pipeModifiers[b]) == null ? void 0 : _a3.call(pipeModifiers, a);
}
};
function tokenizeExpression(expr) {
return tokenize2(expr, {
boolean: /true|false/,
number: /-?\d+\.?\d*/,
string: /(["'])((?:\\.|[^\\])*?)\1/,
operator: /[!=><][=!]?|\?\?|\|/,
ws: /\s+/,
param: /[$a-z_][$\w]*/i
}).filter(({ type }) => type !== "ws");
}
function evaluateExpression(expr, state = {}) {
var _a3, _b2, _c, _d, _e, _f, _g;
const tokens = tokenizeExpression(expr);
if (tokens.length === 0 || tokens.some(({ type }) => !type)) {
return invalidExpression(expr);
}
if (((_a3 = tokens[0]) == null ? void 0 : _a3.token) === ">") {
const partial = state[(_b2 = tokens[1]) == null ? void 0 : _b2.token];
if (!partial) {
return invalidExpression(expr);
}
const partialState = { ...state };
partial.state = partialState;
const args = tokens.slice(2);
for (let i = 0; i < args.length; i += 3) {
const name = (_c = args[i]) == null ? void 0 : _c.token;
const operator = (_d = args[i + 1]) == null ? void 0 : _d.token;
const value = (_e = args[i + 2]) == null ? void 0 : _e.token;
if (name && operator === "=") {
partialState[name] = getParamValue(value, state);
}
}
return partial;
}
if (tokens.length === 1) {
if (!isValidParam(tokens[0])) {
return invalidExpression(expr);
}
return getParamValue(tokens[0].token, state);
}
if (tokens.length === 2) {
const operator = (_f = tokens[0]) == null ? void 0 : _f.token;
const run = operators[operator];
if (!run || !isValidParam(tokens[1])) {
return invalidExpression(expr);
}
const a = getParamValue(tokens[1].token, state);
return run(a);
}
if (tokens.length === 3) {