@wavv/ui 1.8.13 → 1.8.14

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.
@@ -15,7 +15,7 @@
15
15
  *
16
16
  * This source code is licensed under the MIT license found in the
17
17
  * LICENSE file in the root directory of this source tree.
18
- */"production"===process.env.NODE_ENV?As.exports=function(){if(js)return Ts;js=1;var e,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),s=Symbol.for("react.context"),c=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen");function g(e){if("object"==typeof e&&null!==e){var h=e.$$typeof;switch(h){case t:switch(e=e.type){case r:case i:case o:case u:case f:return e;default:switch(e=e&&e.$$typeof){case c:case s:case l:case p:case d:case a:return e;default:return h}}case n:return h}}}return e=Symbol.for("react.module.reference"),Ts.ContextConsumer=s,Ts.ContextProvider=a,Ts.Element=t,Ts.ForwardRef=l,Ts.Fragment=r,Ts.Lazy=p,Ts.Memo=d,Ts.Portal=n,Ts.Profiler=i,Ts.StrictMode=o,Ts.Suspense=u,Ts.SuspenseList=f,Ts.isAsyncMode=function(){return!1},Ts.isConcurrentMode=function(){return!1},Ts.isContextConsumer=function(e){return g(e)===s},Ts.isContextProvider=function(e){return g(e)===a},Ts.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Ts.isForwardRef=function(e){return g(e)===l},Ts.isFragment=function(e){return g(e)===r},Ts.isLazy=function(e){return g(e)===p},Ts.isMemo=function(e){return g(e)===d},Ts.isPortal=function(e){return g(e)===n},Ts.isProfiler=function(e){return g(e)===i},Ts.isStrictMode=function(e){return g(e)===o},Ts.isSuspense=function(e){return g(e)===u},Ts.isSuspenseList=function(e){return g(e)===f},Ts.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===r||t===i||t===o||t===u||t===f||t===h||"object"==typeof t&&null!==t&&(t.$$typeof===p||t.$$typeof===d||t.$$typeof===a||t.$$typeof===s||t.$$typeof===l||t.$$typeof===e||void 0!==t.getModuleId)},Ts.typeOf=g,Ts}():As.exports=(Ms||(Ms=1,"production"!==process.env.NODE_ENV&&function(){var e,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),s=Symbol.for("react.context"),c=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen");function g(e){if("object"==typeof e&&null!==e){var h=e.$$typeof;switch(h){case t:var g=e.type;switch(g){case r:case i:case o:case u:case f:return g;default:var v=g&&g.$$typeof;switch(v){case c:case s:case l:case p:case d:case a:return v;default:return h}}case n:return h}}}e=Symbol.for("react.module.reference");var v=s,y=a,m=t,b=l,w=r,x=p,C=d,_=n,S=i,k=o,O=u,E=f,j=!1,A=!1;Ps.ContextConsumer=v,Ps.ContextProvider=y,Ps.Element=m,Ps.ForwardRef=b,Ps.Fragment=w,Ps.Lazy=x,Ps.Memo=C,Ps.Portal=_,Ps.Profiler=S,Ps.StrictMode=k,Ps.Suspense=O,Ps.SuspenseList=E,Ps.isAsyncMode=function(e){return j||(j=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1},Ps.isConcurrentMode=function(e){return A||(A=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1},Ps.isContextConsumer=function(e){return g(e)===s},Ps.isContextProvider=function(e){return g(e)===a},Ps.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Ps.isForwardRef=function(e){return g(e)===l},Ps.isFragment=function(e){return g(e)===r},Ps.isLazy=function(e){return g(e)===p},Ps.isMemo=function(e){return g(e)===d},Ps.isPortal=function(e){return g(e)===n},Ps.isProfiler=function(e){return g(e)===i},Ps.isStrictMode=function(e){return g(e)===o},Ps.isSuspense=function(e){return g(e)===u},Ps.isSuspenseList=function(e){return g(e)===f},Ps.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===r||t===i||t===o||t===u||t===f||t===h||"object"==typeof t&&null!==t&&(t.$$typeof===p||t.$$typeof===d||t.$$typeof===a||t.$$typeof===s||t.$$typeof===l||t.$$typeof===e||void 0!==t.getModuleId)},Ps.typeOf=g}()),Ps);var Ds=As.exports;function Ls(e,n,r){return void 0===n&&(n=0),void 0===r&&(r=[]),t.Children.toArray(e).reduce((function(e,o,i){return Ds.isFragment(o)?e.push.apply(e,Ls(o.props.children,n+1,r.concat(o.key||i))):t.isValidElement(o)?e.push(t.cloneElement(o,{key:r.concat(String(o.key)).join(".")})):"string"!=typeof o&&"number"!=typeof o||e.push(o),e}),[])}const Is=({id:n,children:o,containerRef:i,parentSelector:a,width:s,maxHeight:c=200,offsetY:l,offsetX:u,centerY:f,centerX:d,direction:p})=>{const[h,g]=t.useState(),v=t.useRef(null);t.useLayoutEffect((()=>{const{current:e}=i||v;if(e&&p){const{scrollWidth:t,scrollHeight:n}=e,r="left"===p||"right"===p;g((r?t:n<c?n:c)+((r?u:l)||4))}}),[i,p]);const y=e.jsx(Rs,{id:n,ref:i||v,offsetX:u,offsetY:l,width:s,maxHeight:c,centerY:f,centerX:d,optionsPosition:{direction:p,amount:h},children:o});if(a){const e=document.querySelector(a);return e?r.createPortal(y,e):y}return y};Is.Item=t=>{var{children:n,id:r,onClick:o,selected:i,noSelect:a,contentPosition:s,color:l,accented:u}=t,f=c(t,["children","id","onClick","selected","noSelect","contentPosition","color","accented"]);return e.jsx(Ns,Object.assign({id:null==r?void 0:r.toString(),onClick:o,selected:i,noSelect:a,contentPosition:s,color:l,accented:u,tabIndex:a?-1:0},f,{children:n}))};const Rs=W.div((({theme:{elevation3:e,font:t,options:n},width:r,maxHeight:o,offsetY:i,offsetX:a})=>({boxSizing:"border-box",position:"absolute",fontFamily:t.family.default,fontSize:t.size.md,width:r||"max-content",maxHeight:o,backgroundColor:n.background,borderRadius:4,boxShadow:e,zIndex:2,overflowY:"auto",top:i?-i:"100%",left:a||void 0})),(({centerY:e,centerX:t})=>({top:e?"50%":void 0,left:t?"50%":void 0,transform:`translate(${t?"-50%":0}, ${e?"-50%":0})`})),(({optionsPosition:e})=>{const{direction:t,amount:n}=e;return t&&n?{left:"left"===t?-n:void 0,right:"right"===t?-n:void 0,top:"top"===t?-n:void 0}:{}})),Ns=W.div({border:"none",padding:"5px 16px",display:"flex",alignItems:"center",userSelect:"none"},(({theme:{optionItem:e},accented:t,selected:n,noSelect:r=!1})=>({color:t?e.color.accent:e.color.inactive,cursor:r?"inherit":"pointer",backgroundColor:!r&&n?e.background.active:e.background.inactive,"&:hover":{backgroundColor:r?e.background.inactive:e.background.active},"&:focus":{outline:"none",backgroundColor:e.background.active}})),(({color:e})=>({color:e})),(({contentPosition:e})=>({justifyContent:"start"===e||"end"===e?`flex-${e}`:e}))),Bs=(e,t)=>{if(!e)return[];const{search:n,filter:r,inputText:o}=t;return n&&r&&o?e.filter((e=>{const t=e=>{if(!e)return!1;const t=o.toLowerCase();return e.toString().toLowerCase().includes(t)};let n=t(e.label);return!n&&"id"in e&&(n=t(e.id)),n||!("value"in e)||"string"!=typeof e.value&&"number"!=typeof e.value||(n=t(e.value)),!n&&"body"in e&&(n=t(e.body)),!n&&"header"in e&&(n=t(e.header)),n})):e},Fs=n=>e.jsxs(t.Fragment,{children:[n.leftElement||null,n.header&&n.body?e.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[e.jsx(Hs,{children:n.header}),e.jsx(Vs,{children:n.body})]}):n.label,n.rightElement&&e.jsx("div",{style:{marginLeft:"auto"},children:n.rightElement})]}),zs=(n,r,o,i,a)=>{const{selected:s}=a,l=((t,n,r,o)=>{if(t&&t.length>0)return Bs(t,o).map((t=>{const o=t.onClick?e=>{t.onClick&&t.onClick(e),r()}:e=>n(t,e);return e.jsx(Is.Item,{id:t.id,onClick:o,children:Fs(t)},t.id)}));return[]})(n,o,i,c(a,["selected"])),u=((e,n,r)=>e?Ls(e).map((e=>e?t.cloneElement(e,{setValue:n,close:r}):null)):[])(r,o,i);return Ls([...l,...u]).map(((e,n)=>e?t.cloneElement(e,{selected:s===n}):null))},Hs=W.div((({theme:e})=>({fontSize:e.font.size.md,color:e.scale10}))),Vs=W.div((({theme:e})=>({fontSize:e.font.size.sm,color:e.scale6}))),Ks=e=>{let t="top",n="center";if(!e)return{side:t,align:n};const[r,o]=e.split(" ");return"left"===r&&(t="left"),"right"===r&&(t="right"),"bottom"===r&&(t="bottom"),"left"!==o&&"top"!==o||(n="start"),"right"!==o&&"bottom"!==o||(n="end"),{side:t,align:n}},Us=(e,t)=>!t.includes(e),$s=t=>{var{children:n,options:r,id:o,position:i="bottom",trigger:a,open:s,offset:l=4,arrow:u,width:f,maxHeight:d=200,container:p,zIndex:h,disableScrollLock:g,onChange:v,afterShow:y,afterHide:m}=t,b=c(t,["children","options","id","position","trigger","open","offset","arrow","width","maxHeight","container","zIndex","disableScrollLock","onChange","afterShow","afterHide"]);return e.jsxs(ms,{onOpenChange:e=>{y&&e&&y(),m&&!e&&m()},open:s,modal:!g,children:[e.jsx(bs,{asChild:!0,children:e.jsx(nc,Object.assign({},b,{children:a}))}),e.jsx(ws,{container:p,children:e.jsxs(Gs,{id:o,maxHeight:d,width:f,zIndex:h,side:Ks(i).side,align:Ks(i).align,sideOffset:l,children:[r&&(null==r?void 0:r.length)>0&&r.map((t=>e.jsx(Ws,{id:t.id,onClick:t.onClick||(e=>{((e,t)=>{v&&v(e,t)})(t,e)}),children:Fs(t)},t.id))),n,u&&e.jsx(Ss,{className:"menu-arrow"})]})})]})},Ws=t=>{var{children:n,id:r,disabled:o,onClick:i}=t,a=c(t,["children","id","disabled","onClick"]);return e.jsx(Qs,Object.assign({id:null==r?void 0:r.toString(),disabled:o,onSelect:i},a,{children:n}))};$s.Item=Ws,$s.Sub=t=>{var{children:n,id:r,label:o,zIndex:i,disabled:a,container:s}=t,l=c(t,["children","id","label","zIndex","disabled","container"]);return e.jsxs(ks,{children:[e.jsxs(ec,{disabled:a,children:[o,e.jsx(rc,{children:e.jsx(oc,{children:e.jsx(fn,{name:"chevron-right",size:"small",inheritColor:a})})})]}),e.jsx(ws,{container:s,children:e.jsx(Ys,Object.assign({sideOffset:2,alignOffset:-5,zIndex:i,id:r},l,{children:n}))})]})},$s.Separator=()=>e.jsx(tc,{});const qs=({theme:e,width:t,maxHeight:n,zIndex:r})=>({fontFamily:null==e?void 0:e.font.family.default,fontSize:null==e?void 0:e.font.size.md,width:t||"max-content",maxHeight:n,backgroundColor:null==e?void 0:e.options.background,borderRadius:4,boxShadow:null==e?void 0:e.elevation3,zIndex:r,boxSizing:"border-box",overflowY:"auto"}),Zs={shouldForwardProp:e=>Us(e,["maxHeight","zIndex"])},Gs=W(xs,Zs)(qs,(({theme:{options:e}})=>({"& > span > .menu-arrow":{fill:e.background,filter:"drop-shadow(0px 4px 2px rgba(0, 0, 0, 0.1))"},'&[data-side="bottom"] > span > .menu-arrow':{filter:"drop-shadow(0px -2px 2px rgba(0, 0, 0, 0.1))"}}))),Ys=W(Es,Zs)(qs),Xs=({theme:e,color:t,accented:n,disabled:r,contentPosition:o})=>{const i="start"===o||"end"===o?`flex-${o}`:o,a=n?null==e?void 0:e.optionItem.color.accent:null==e?void 0:e.optionItem.color.inactive;return{border:"none",padding:"4px 16px",display:"flex",alignItems:"center",userSelect:"none",position:"relative",justifyContent:i,color:t||a,cursor:r?"inherit":"pointer",backgroundColor:null==e?void 0:e.optionItem.background.inactive,"&[data-highlighted]":{backgroundColor:null==e?void 0:e.optionItem.background.active},"&[data-disabled]":{color:null==e?void 0:e.scale4},"&:focus":{outline:"none",backgroundColor:null==e?void 0:e.optionItem.background.active}}},Js={shouldForwardProp:e=>Us(e,["selected","noSelect","contentPosition","color","accented"])},Qs=W(Cs,Js)(Xs),ec=W(Os,Js)(Xs),tc=W(_s)((({theme:e})=>({height:1,backgroundColor:e.scale2,margin:"4px 8px"}))),nc=W.div({display:"inline-block"}),rc=W.div({marginLeft:"auto",width:16,height:16}),oc=W.div({position:"absolute",right:8}),ic=t=>{var{size:n,color:r,center:o,background:i,zIndex:a,margin:s,marginTop:l,marginBottom:u,marginRight:f,marginLeft:d,position:p,top:h,bottom:g,right:v,left:y}=t,m=c(t,["size","color","center","background","zIndex","margin","marginTop","marginBottom","marginRight","marginLeft","position","top","bottom","right","left"]);const b={margin:s,marginTop:l,marginBottom:u,marginRight:f,marginLeft:d,position:p,top:h,bottom:g,right:v,left:y};return e.jsx(ac,Object.assign({},b,{center:o,background:i,zIndex:a,children:e.jsx(cc,{children:e.jsx(fn,Object.assign({},m,{size:n,name:"loading",color:r,inheritColor:!r}))})}))},ac=W.div({width:"max-content",height:"max-content"},(({center:e,zIndex:t})=>e&&{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:null!=t?t:1}),(({center:e,background:t})=>{if(!e||!t)return null;return{background:"string"==typeof t?t:"rgba(0, 0, 0, 0.5)",width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"}}),cn,ln),sc=n.keyframes({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),cc=W.div({animation:`${sc} 1s linear infinite`,width:"max-content",height:"max-content"}),lc=({size:t})=>e.jsx(uc,{className:"button-loader",children:e.jsx(ic,{size:t})}),uc=W.div({position:"absolute",top:"50%",left:"50%",transform:"translate(-50%,-50%)",display:"flex",justifyContent:"center",alignItems:"center"}),fc=n=>{var{children:r,disabled:o,outline:i,size:a,small:s,large:l,secondary:u,negative:f,positive:d,caution:p,collapse:h}=n,g=c(n,["children","disabled","outline","size","small","large","secondary","negative","positive","caution","collapse"]);if(r){const n=t.Children.count(r);return e.jsx(dc,Object.assign({},g,{children:t.Children.map(r,((e,r)=>{let c;if(n>1&&(c=0===r?"right":r===n-1?"left":"middle"),e){let n=e;"trigger"in e.props&&(n=e.props.trigger);const r=n,g=s||r.props.small,v=l||r.props.large,y=a||r.props.size,m=o||r.props.disabled,b=i||r.props.outline,w=u||r.props.secondary,x=f||r.props.negative,C=d||r.props.positive,_=p||r.props.caution,S=h||r.props.collapse,k=t.cloneElement(n,{joined:c,size:y,small:g,large:v,disabled:m,outline:b,secondary:w,negative:x,positive:C,caution:_,collapse:S});return"trigger"in e.props?t.cloneElement(e,{trigger:k}):k}return null}))}))}return null},dc=W.div((({width:e})=>({display:"inline-flex",width:e})),cn),pc=t=>{const{content:n,children:r,dropdown:o,options:i}=t,a=c(t,["content","children","dropdown","options"]),s=n||r;return o&&i?e.jsx(gc,Object.assign({options:i},a,{children:s})):e.jsx(hc,Object.assign({},a,{children:s}))};pc.Group=fc;const hc=t=>{var{children:r,onClick:o,icon:i,iconPosition:a,iconColor:s,joined:l,size:u,small:f,large:d,isLoading:p,collapse:h,backgroundColor:g,color:v,type:y,animation:m,iconAnimation:b}=t,w=c(t,["children","onClick","icon","iconPosition","iconColor","joined","size","small","large","isLoading","collapse","backgroundColor","color","type","animation","iconAnimation"]);const{button:x}=n.useTheme(),C=i&&(!r||h),_="right"===a;let S=u||"medium";f?S="small":d&&(S="large");const k=x[S],{iconSize:O}=k,E=h&&i;return e.jsxs(vc,Object.assign({},w,{type:y||"button",size:S,iconOnly:C,iconRight:_,joined:l,onClick:o,isLoading:p,color:v,backgroundColor:g,animation:m,children:[i?e.jsx(fn,{size:O,name:i,marginRight:C||_?0:4,marginLeft:!C&&_?4:0,color:s,inheritColor:!s,animation:b}):null,!E&&e.jsx("span",{children:r}),p&&e.jsx(lc,{size:O})]}))},gc=n=>{var{children:r,options:o,onClick:i,afterShow:a,afterHide:s,secondary:l,negative:u,positive:f,caution:d,outline:p,size:h,small:g,large:v,disabled:y,isLoading:m,direction:b,collapse:w,width:x,zIndex:C,disableScrollLock:_}=n,S=c(n,["children","options","onClick","afterShow","afterHide","secondary","negative","positive","caution","outline","size","small","large","disabled","isLoading","direction","collapse","width","zIndex","disableScrollLock"]);const[k,O]=t.useState(!1),E={secondary:l,negative:u,positive:f,caution:d,outline:p,size:h,small:g,large:v,disabled:y};return e.jsx(yc,{children:e.jsxs(fc,{width:w?void 0:x,children:[e.jsx(hc,Object.assign({},E,S,{width:x&&!w?"100%":void 0,collapse:w,isLoading:m,onClick:e=>{i&&i(e)},children:e.jsx(mc,{children:r})})),e.jsx($s,{position:`${b||"bottom"} right`,afterShow:()=>{a&&a(),O(!0)},afterHide:()=>{s&&s(),O(!1)},options:o,trigger:e.jsx(hc,Object.assign({},E,{icon:k?"caret-up":"caret-down",preventPointerEvents:m,tabIndex:-1})),zIndex:C,disableScrollLock:_})]})})},vc=W.button((({theme:{accent:e,font:t,button:n},size:r="medium",joined:o,circle:i,iconOnly:a,iconRight:s,width:c,height:l,animation:u})=>{const f=i||a&&!o,d=n[r],p=c||"max-content",{height:h,font:g,padding:v,iconOnlyPadding:y}=d,m=l||h,b=a||f?y:v;return{display:"inline-flex",alignItems:"center",justifyContent:"center",flexDirection:s?"row-reverse":"row",fontSize:g,width:f?m:p,height:m,fontFamily:t.family.default,fontWeight:t.weight.bold,borderRadius:f?"50%":30,cursor:"pointer",outline:"none",padding:`0px ${b}px`,position:"relative",animation:u,"&:focus-visible":{outline:`${e} solid 1px`}}}),(({theme:e,joined:t,iconOnly:n,outline:r,negative:o,positive:i,caution:a,secondary:s,disabled:c,subtle:l,link:u})=>{const{button:f,size:d}=e;let p=f.primary;l?p=f.subtle:u?p=f.link:c?p=f.disabled:o?p=f.negative:i?p=f.positive:a?p=f.caution:s&&(p=f.secondary);const h=r?p.outlineBackground:p.background;let g=r?p.outlineColor:p.color;if(u||l){let e=f.subtle;u&&(e=f.link),c?g=f.disabled.color:o?g=e.negativeColor:i?g=e.positiveColor:a?g=e.cautionColor:s&&(g=e.secondaryColor)}const v="left"===t||"middle"===t,y="right"===t||"middle"===t,m=n?d.xs:d.sm;return{backgroundColor:h.default,color:g.default,border:r&&!u?"1px solid":"none",borderColor:p.border.default,"&:hover":{backgroundColor:h.hover,color:g.hover,borderColor:r&&!c?p.border.hover:void 0},"&:active":{backgroundColor:h.active,color:g.active,borderColor:r&&!c?p.border.active:void 0},"&:disabled":{backgroundColor:l?"transparent":void 0,cursor:"not-allowed"},borderTopLeftRadius:v?0:void 0,borderBottomLeftRadius:v?0:void 0,borderTopRightRadius:y?0:void 0,borderBottomRightRadius:y?0:void 0,paddingLeft:v?m:void 0,paddingRight:y?m:void 0,borderRight:y?`1px solid ${r?p.border.default:p.divider}`:void 0,borderLeft:v?"none":void 0}}),(({link:e})=>({height:e?"max-content":void 0,width:e?"max-content":void 0,padding:e?0:void 0})),(({isLoading:e,preventPointerEvents:t})=>({pointerEvents:e||t?"none":void 0,"& > *":{visibility:e?"hidden":void 0},"& > .button-loader":{visibility:e?"visible":void 0}})),(({theme:{name:e},backgroundColor:t,color:n,disabled:r})=>{const o="dark"===e?ar:cr,i="dark"===e?cr:ar;return r||!n&&!t?{}:{backgroundColor:t,color:n,"&:hover":{backgroundColor:t?o(.05,t):void 0,color:n?i(.05,n):void 0},"&:active":{backgroundColor:t?o(.1,t):void 0,color:n?i(.1,n):void 0}}}),cn),yc=W.div({display:"inline-flex",flexDirection:"column",position:"relative"}),mc=W.div({marginRight:8}),bc=t=>{var{value:n,max:r=100,step:o=1,width:i,height:a,disabled:s,onChange:l}=t,u=c(t,["value","max","step","width","height","disabled","onChange"]);return e.jsx(xc,Object.assign({},u,{type:"range",max:r,value:n,percent:n/r*100,onChange:e=>{const{value:t}=e.target;l&&l(+t)},step:o,width:i,height:a,disabled:s,readOnly:!l}))},wc=(e,t)=>({appearance:"none",backgroundColor:t?"transparent":e.color.brand,height:e.size.sm,width:e.size.sm,border:"none",borderRadius:"50%"}),xc=W.input((({theme:e,percent:t,width:n,height:r,disabled:o,readOnly:i})=>{const a=o?e.scale0:e.scale1,s=o?e.scale1:e.color.brand;return{appearance:"none",display:"block",width:n||"100%",height:r||2,borderRadius:24,outline:"none",background:`linear-gradient(to right, ${s} 0%, ${s} ${t}%, ${a} ${t}%, ${a} 100%)`,"&::-webkit-slider-thumb":wc(e,o||i),"&::-moz-range-thumb":wc(e,o||i),"&:focus-visible":{outline:o||i?"none":`${e.accent} solid 1px`}}}),cn),Cc=t.forwardRef(((n,r)=>{var{src:o,title:i,width:a,infoPosition:s,centerAlignContent:l,small:u,collapsed:f,hideSliderOnStop:d,hideTimeOnStop:p,fontSizeTitle:h,fontSizeTime:g,onPlay:v,onPause:y,onStop:m}=n,b=c(n,["src","title","width","infoPosition","centerAlignContent","small","collapsed","hideSliderOnStop","hideTimeOnStop","fontSizeTitle","fontSizeTime","onPlay","onPause","onStop"]);const[w,x]=t.useState(!1),[C,_]=t.useState(!0),[S,k]=t.useState(0),[O,E]=t.useState(0),[j,A]=t.useState(""),[T,M]=t.useState(""),P=t.useRef(null),D=()=>{const{current:e}=P;e&&e.play().catch((()=>{throw Error("Video failed to play")}))},L=()=>{const{current:e}=P;e&&e.pause()},I=()=>{const{current:e}=P;e&&e.load()};t.useImperativeHandle(r,(()=>({play:D,pause:L,stop:I})),[P,w]);const R=e=>{x(!1),_(!0),m&&m(e)};t.useEffect((()=>{(()=>{const{current:e}=P;!!e&&e.paused})()}),[w]);const N=e=>{const t=(e/100).toFixed(2),[n,r]=t.split(".");return`${n}:${r}`},B=C&&d,F=C&&p;return e.jsxs(_c,Object.assign({width:a},b,{children:[e.jsx(pc,{outline:!0,small:u,icon:w?"pause":"play",onClick:()=>{w?L():D()},marginRight:8}),!f&&e.jsxs(Sc,{alignDataTop:"top"===s,children:[!B&&e.jsx(bc,{value:S,max:O,step:.1,onChange:e=>{(null==P?void 0:P.current)&&(P.current.currentTime=e)}}),e.jsxs(kc,{alignTop:"top"===s,noSlider:B,relative:l||B,children:[i?e.jsx(Oc,{fontSize:h,children:i}):e.jsx("div",{}),!F&&e.jsxs(Oc,{secondary:!0,fontSize:g,children:[j&&!C?`${j} / `:"",T]})]})]}),e.jsxs("audio",{ref:P,onPlay:e=>{x(!0),_(!1),v&&v(e)},onPause:e=>{x(!1),y&&y(e)},onEmptied:R,onEnded:R,onTimeUpdate:()=>{const{current:e}=P;if(e){const{currentTime:t}=e,n=N(t);k(t),A(n)}},onDurationChange:()=>{const{current:e}=P;if(e){const{duration:t}=e,n=N(t);E(t),M(n)}},children:[e.jsx("track",{kind:"captions"}),e.jsx("source",{src:o})]})]}))})),_c=W.div((({width:e=250})=>({display:"flex",alignItems:"center",width:e})),cn),Sc=W.div((({alignDataTop:e})=>({display:"flex",flexDirection:e?"column-reverse":"column",position:"relative",width:"100%"}))),kc=W.div((({alignTop:e,noSlider:t,relative:n})=>({position:n?"relative":"absolute",top:e||t?void 0:6,bottom:e&&!t?6:void 0,display:"flex",justifyContent:"space-between",alignItems:"flex-end",width:"100%"}))),Oc=W.div((({theme:e,secondary:t,fontSize:n})=>({color:t?e.scale6:e.scale10,fontSize:n||10})));var Ec={},jc={};Object.defineProperty(jc,"__esModule",{value:!0}),jc.defaultOptions=void 0,jc.defaultOptions={lowercase:!1,precision:1,space:!1,units:["","K","M","B","T","P","E"]};var Ac={};Object.defineProperty(Ac,"__esModule",{value:!0}),Ac.getLocales=Ac.getFractionDigits=Ac.roundTo=Ac.parseValue=void 0,Ac.parseValue=function(e){const t=parseFloat(null==e?void 0:e.toString());if(isNaN(t))throw new Error("Input value is not a number");if(t>Number.MAX_SAFE_INTEGER||t<Number.MIN_SAFE_INTEGER)throw new RangeError("Input value is outside of safe integer range");return t},Ac.roundTo=function(e,t){if(!Number.isFinite(e))throw new Error("Input value is not a finite number");if(!Number.isInteger(t)||t<0)throw new Error("Precision is not a positive integer");return Number.isInteger(e)?e:parseFloat(e.toFixed(t))},Ac.getFractionDigits=function(e){var t;if(Number.isInteger(e))return 0;const n=e.toString().split(".")[1];return null!==(t=null==n?void 0:n.length)&&void 0!==t?t:0},Ac.getLocales=function(){var e;return"undefined"==typeof navigator?[]:Array.from(null!==(e=navigator.languages)&&void 0!==e?e:[])},Object.defineProperty(Ec,"__esModule",{value:!0}),Ec.millify=void 0;const Tc=jc,Mc=Ac,Pc=1e3;function*Dc(e){let t=Pc;for(;;){const n=e/t;if(n<1)return;yield n,t*=Pc}}function Lc(e,t){var n,r;const o=t?{...Tc.defaultOptions,...t}:Tc.defaultOptions;if(!Array.isArray(o.units)||!o.units.length)throw new Error("Option `units` must be a non-empty array");let i;try{i=Mc.parseValue(e)}catch(t){return t instanceof Error&&console.warn(`WARN: ${t.message} (millify)`),String(e)}const a=i<0?"-":"";i=Math.abs(i);let s=0;for(const e of Dc(i))i=e,s+=1;if(s>=o.units.length)return e.toString();let c=Mc.roundTo(i,o.precision);for(const e of Dc(c))c=e,s+=1;const l=null!==(n=o.units[s])&&void 0!==n?n:"",u=o.lowercase?l.toLowerCase():l,f=o.space?" ":"";return`${a}${c.toLocaleString(null!==(r=o.locales)&&void 0!==r?r:Mc.getLocales(),{minimumFractionDigits:Mc.getFractionDigits(c)})}${f}${u}`}Ec.millify=Lc;var Ic,Rc=Ec.default=Lc,Nc={exports:{}};
18
+ */"production"===process.env.NODE_ENV?As.exports=function(){if(js)return Ts;js=1;var e,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),s=Symbol.for("react.context"),c=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen");function g(e){if("object"==typeof e&&null!==e){var h=e.$$typeof;switch(h){case t:switch(e=e.type){case r:case i:case o:case u:case f:return e;default:switch(e=e&&e.$$typeof){case c:case s:case l:case p:case d:case a:return e;default:return h}}case n:return h}}}return e=Symbol.for("react.module.reference"),Ts.ContextConsumer=s,Ts.ContextProvider=a,Ts.Element=t,Ts.ForwardRef=l,Ts.Fragment=r,Ts.Lazy=p,Ts.Memo=d,Ts.Portal=n,Ts.Profiler=i,Ts.StrictMode=o,Ts.Suspense=u,Ts.SuspenseList=f,Ts.isAsyncMode=function(){return!1},Ts.isConcurrentMode=function(){return!1},Ts.isContextConsumer=function(e){return g(e)===s},Ts.isContextProvider=function(e){return g(e)===a},Ts.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Ts.isForwardRef=function(e){return g(e)===l},Ts.isFragment=function(e){return g(e)===r},Ts.isLazy=function(e){return g(e)===p},Ts.isMemo=function(e){return g(e)===d},Ts.isPortal=function(e){return g(e)===n},Ts.isProfiler=function(e){return g(e)===i},Ts.isStrictMode=function(e){return g(e)===o},Ts.isSuspense=function(e){return g(e)===u},Ts.isSuspenseList=function(e){return g(e)===f},Ts.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===r||t===i||t===o||t===u||t===f||t===h||"object"==typeof t&&null!==t&&(t.$$typeof===p||t.$$typeof===d||t.$$typeof===a||t.$$typeof===s||t.$$typeof===l||t.$$typeof===e||void 0!==t.getModuleId)},Ts.typeOf=g,Ts}():As.exports=(Ms||(Ms=1,"production"!==process.env.NODE_ENV&&function(){var e,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),s=Symbol.for("react.context"),c=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen");function g(e){if("object"==typeof e&&null!==e){var h=e.$$typeof;switch(h){case t:var g=e.type;switch(g){case r:case i:case o:case u:case f:return g;default:var v=g&&g.$$typeof;switch(v){case c:case s:case l:case p:case d:case a:return v;default:return h}}case n:return h}}}e=Symbol.for("react.module.reference");var v=s,y=a,m=t,b=l,w=r,x=p,C=d,_=n,S=i,k=o,O=u,E=f,j=!1,A=!1;Ps.ContextConsumer=v,Ps.ContextProvider=y,Ps.Element=m,Ps.ForwardRef=b,Ps.Fragment=w,Ps.Lazy=x,Ps.Memo=C,Ps.Portal=_,Ps.Profiler=S,Ps.StrictMode=k,Ps.Suspense=O,Ps.SuspenseList=E,Ps.isAsyncMode=function(e){return j||(j=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1},Ps.isConcurrentMode=function(e){return A||(A=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1},Ps.isContextConsumer=function(e){return g(e)===s},Ps.isContextProvider=function(e){return g(e)===a},Ps.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Ps.isForwardRef=function(e){return g(e)===l},Ps.isFragment=function(e){return g(e)===r},Ps.isLazy=function(e){return g(e)===p},Ps.isMemo=function(e){return g(e)===d},Ps.isPortal=function(e){return g(e)===n},Ps.isProfiler=function(e){return g(e)===i},Ps.isStrictMode=function(e){return g(e)===o},Ps.isSuspense=function(e){return g(e)===u},Ps.isSuspenseList=function(e){return g(e)===f},Ps.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===r||t===i||t===o||t===u||t===f||t===h||"object"==typeof t&&null!==t&&(t.$$typeof===p||t.$$typeof===d||t.$$typeof===a||t.$$typeof===s||t.$$typeof===l||t.$$typeof===e||void 0!==t.getModuleId)},Ps.typeOf=g}()),Ps);var Ds=As.exports;function Ls(e,n,r){return void 0===n&&(n=0),void 0===r&&(r=[]),t.Children.toArray(e).reduce((function(e,o,i){return Ds.isFragment(o)?e.push.apply(e,Ls(o.props.children,n+1,r.concat(o.key||i))):t.isValidElement(o)?e.push(t.cloneElement(o,{key:r.concat(String(o.key)).join(".")})):"string"!=typeof o&&"number"!=typeof o||e.push(o),e}),[])}const Is=({id:n,children:o,containerRef:i,parentSelector:a,width:s,maxHeight:c=200,offsetY:l,offsetX:u,centerY:f,centerX:d,direction:p})=>{const[h,g]=t.useState(),v=t.useRef(null);t.useLayoutEffect((()=>{const{current:e}=i||v;if(e&&p){const{scrollWidth:t,scrollHeight:n}=e,r="left"===p||"right"===p;g((r?t:n<c?n:c)+((r?u:l)||4))}}),[i,p]);const y=e.jsx(Rs,{id:n,ref:i||v,offsetX:u,offsetY:l,width:s,maxHeight:c,centerY:f,centerX:d,optionsPosition:{direction:p,amount:h},children:o});if(a){const e=document.querySelector(a);return e?r.createPortal(y,e):y}return y};Is.Item=t=>{var{children:n,id:r,onClick:o,selected:i,noSelect:a,contentPosition:s,color:l,accented:u}=t,f=c(t,["children","id","onClick","selected","noSelect","contentPosition","color","accented"]);return e.jsx(Ns,Object.assign({id:null==r?void 0:r.toString(),onClick:o,selected:i,noSelect:a,contentPosition:s,color:l,accented:u,tabIndex:a?-1:0},f,{children:n}))};const Rs=W.div((({theme:{elevation3:e,font:t,options:n},width:r,maxHeight:o,offsetY:i,offsetX:a})=>({boxSizing:"border-box",position:"absolute",fontFamily:t.family.default,fontSize:t.size.md,width:r||"max-content",maxHeight:o,backgroundColor:n.background,borderRadius:4,boxShadow:e,zIndex:2,overflowY:"auto",top:i?-i:"100%",left:a||void 0})),(({centerY:e,centerX:t})=>({top:e?"50%":void 0,left:t?"50%":void 0,transform:`translate(${t?"-50%":0}, ${e?"-50%":0})`})),(({optionsPosition:e})=>{const{direction:t,amount:n}=e;return t&&n?{left:"left"===t?-n:void 0,right:"right"===t?-n:void 0,top:"top"===t?-n:void 0}:{}})),Ns=W.div({border:"none",padding:"5px 16px",display:"flex",alignItems:"center",userSelect:"none"},(({theme:{optionItem:e},accented:t,selected:n,noSelect:r=!1})=>({color:t?e.color.accent:e.color.inactive,cursor:r?"inherit":"pointer",backgroundColor:!r&&n?e.background.active:e.background.inactive,"&:hover":{backgroundColor:r?e.background.inactive:e.background.active},"&:focus":{outline:"none",backgroundColor:e.background.active}})),(({color:e})=>({color:e})),(({contentPosition:e})=>({justifyContent:"start"===e||"end"===e?`flex-${e}`:e}))),Bs=(e,t)=>{if(!e)return[];const{search:n,filter:r,inputText:o}=t;return n&&r&&o?e.filter((e=>{const t=e=>{if(!e)return!1;const t=o.toLowerCase();return e.toString().toLowerCase().includes(t)};let n=t(e.label);return!n&&"id"in e&&(n=t(e.id)),n||!("value"in e)||"string"!=typeof e.value&&"number"!=typeof e.value||(n=t(e.value)),!n&&"body"in e&&(n=t(e.body)),!n&&"header"in e&&(n=t(e.header)),n})):e},Fs=n=>e.jsxs(t.Fragment,{children:[n.leftElement||null,n.header&&n.body?e.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[e.jsx(Hs,{children:n.header}),e.jsx(Vs,{children:n.body})]}):n.label,n.rightElement&&e.jsx("div",{style:{marginLeft:"auto"},children:n.rightElement})]}),zs=(n,r,o,i,a)=>{const{selected:s}=a,l=((t,n,r,o)=>{if(t&&t.length>0)return Bs(t,o).map((t=>{const o=t.onClick?e=>{t.onClick&&t.onClick(e),r()}:e=>n(t,e);return e.jsx(Is.Item,{id:t.id,onClick:o,children:Fs(t)},t.id)}));return[]})(n,o,i,c(a,["selected"])),u=((e,n,r)=>e?Ls(e).map((e=>e?t.cloneElement(e,{setValue:n,close:r}):null)):[])(r,o,i);return Ls([...l,...u]).map(((e,n)=>e?t.cloneElement(e,{selected:s===n}):null))},Hs=W.div((({theme:e})=>({fontSize:e.font.size.md,color:e.scale10}))),Vs=W.div((({theme:e})=>({fontSize:e.font.size.sm,color:e.scale6}))),Ks=e=>{let t="top",n="center";if(!e)return{side:t,align:n};const[r,o]=e.split(" ");return"left"===r&&(t="left"),"right"===r&&(t="right"),"bottom"===r&&(t="bottom"),"left"!==o&&"top"!==o||(n="start"),"right"!==o&&"bottom"!==o||(n="end"),{side:t,align:n}},Us=(e,t)=>!t.includes(e),$s=t=>{var{children:n,options:r,id:o,position:i="bottom",trigger:a,open:s,offset:l=4,arrow:u,width:f,maxHeight:d=200,container:p,zIndex:h,disableScrollLock:g,onChange:v,afterShow:y,afterHide:m}=t,b=c(t,["children","options","id","position","trigger","open","offset","arrow","width","maxHeight","container","zIndex","disableScrollLock","onChange","afterShow","afterHide"]);return e.jsxs(ms,{onOpenChange:e=>{y&&e&&y(),m&&!e&&m()},open:s,modal:!g,children:[e.jsx(bs,{asChild:!0,children:e.jsx(nc,Object.assign({},b,{children:a}))}),e.jsx(ws,{container:p,children:e.jsxs(Gs,{id:o,maxHeight:d,width:f,zIndex:h,side:Ks(i).side,align:Ks(i).align,sideOffset:l,children:[r&&(null==r?void 0:r.length)>0&&r.map((t=>e.jsx(Ws,{id:t.id,onClick:t.onClick||(e=>{((e,t)=>{v&&v(e,t)})(t,e)}),children:Fs(t)},t.id))),n,u&&e.jsx(Ss,{className:"menu-arrow"})]})})]})},Ws=t=>{var{children:n,id:r,disabled:o,onClick:i}=t,a=c(t,["children","id","disabled","onClick"]);return e.jsx(Qs,Object.assign({id:null==r?void 0:r.toString(),disabled:o,onSelect:i},a,{children:n}))};$s.Item=Ws,$s.Sub=t=>{var{children:n,id:r,label:o,zIndex:i,disabled:a,container:s}=t,l=c(t,["children","id","label","zIndex","disabled","container"]);return e.jsxs(ks,{children:[e.jsxs(ec,{disabled:a,children:[o,e.jsx(rc,{children:e.jsx(oc,{children:e.jsx(fn,{name:"chevron-right",size:"small",inheritColor:a})})})]}),e.jsx(ws,{container:s,children:e.jsx(Ys,Object.assign({sideOffset:2,alignOffset:-5,zIndex:i,id:r},l,{children:n}))})]})},$s.Separator=()=>e.jsx(tc,{});const qs=({theme:e,width:t,maxHeight:n,zIndex:r})=>({fontFamily:null==e?void 0:e.font.family.default,fontSize:null==e?void 0:e.font.size.md,width:t||"max-content",maxHeight:n,backgroundColor:null==e?void 0:e.options.background,borderRadius:4,boxShadow:null==e?void 0:e.elevation3,zIndex:r,boxSizing:"border-box",overflowY:"auto"}),Zs={shouldForwardProp:e=>Us(e,["maxHeight","zIndex"])},Gs=W(xs,Zs)(qs,(({theme:{options:e}})=>({"& > span > .menu-arrow":{fill:e.background,filter:"drop-shadow(0px 4px 2px rgba(0, 0, 0, 0.1))"},'&[data-side="bottom"] > span > .menu-arrow':{filter:"drop-shadow(0px -2px 2px rgba(0, 0, 0, 0.1))"}}))),Ys=W(Es,Zs)(qs),Xs=({theme:e,color:t,accented:n,disabled:r,contentPosition:o})=>{const i="start"===o||"end"===o?`flex-${o}`:o,a=n?null==e?void 0:e.optionItem.color.accent:null==e?void 0:e.optionItem.color.inactive;return{border:"none",padding:"4px 16px",display:"flex",alignItems:"center",userSelect:"none",position:"relative",justifyContent:i,color:t||a,cursor:r?"inherit":"pointer",backgroundColor:null==e?void 0:e.optionItem.background.inactive,"&[data-highlighted]":{backgroundColor:null==e?void 0:e.optionItem.background.active},"&[data-disabled]":{color:null==e?void 0:e.scale4},"&:focus":{outline:"none",backgroundColor:null==e?void 0:e.optionItem.background.active}}},Js={shouldForwardProp:e=>Us(e,["selected","noSelect","contentPosition","color","accented"])},Qs=W(Cs,Js)(Xs),ec=W(Os,Js)(Xs),tc=W(_s)((({theme:e})=>({height:1,backgroundColor:e.scale2,margin:"4px 8px"}))),nc=W.div({display:"inline-flex"}),rc=W.div({marginLeft:"auto",width:16,height:16}),oc=W.div({position:"absolute",right:8}),ic=t=>{var{size:n,color:r,center:o,background:i,zIndex:a,margin:s,marginTop:l,marginBottom:u,marginRight:f,marginLeft:d,position:p,top:h,bottom:g,right:v,left:y}=t,m=c(t,["size","color","center","background","zIndex","margin","marginTop","marginBottom","marginRight","marginLeft","position","top","bottom","right","left"]);const b={margin:s,marginTop:l,marginBottom:u,marginRight:f,marginLeft:d,position:p,top:h,bottom:g,right:v,left:y};return e.jsx(ac,Object.assign({},b,{center:o,background:i,zIndex:a,children:e.jsx(cc,{children:e.jsx(fn,Object.assign({},m,{size:n,name:"loading",color:r,inheritColor:!r}))})}))},ac=W.div({width:"max-content",height:"max-content"},(({center:e,zIndex:t})=>e&&{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:null!=t?t:1}),(({center:e,background:t})=>{if(!e||!t)return null;return{background:"string"==typeof t?t:"rgba(0, 0, 0, 0.5)",width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"}}),cn,ln),sc=n.keyframes({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),cc=W.div({animation:`${sc} 1s linear infinite`,width:"max-content",height:"max-content"}),lc=({size:t})=>e.jsx(uc,{className:"button-loader",children:e.jsx(ic,{size:t})}),uc=W.div({position:"absolute",top:"50%",left:"50%",transform:"translate(-50%,-50%)",display:"flex",justifyContent:"center",alignItems:"center"}),fc=n=>{var{children:r,disabled:o,outline:i,size:a,small:s,large:l,secondary:u,negative:f,positive:d,caution:p,collapse:h}=n,g=c(n,["children","disabled","outline","size","small","large","secondary","negative","positive","caution","collapse"]);if(r){const n=t.Children.count(r);return e.jsx(dc,Object.assign({},g,{children:t.Children.map(r,((e,r)=>{let c;if(n>1&&(c=0===r?"right":r===n-1?"left":"middle"),e){let n=e;"trigger"in e.props&&(n=e.props.trigger);const r=n,g=s||r.props.small,v=l||r.props.large,y=a||r.props.size,m=o||r.props.disabled,b=i||r.props.outline,w=u||r.props.secondary,x=f||r.props.negative,C=d||r.props.positive,_=p||r.props.caution,S=h||r.props.collapse,k=t.cloneElement(n,{joined:c,size:y,small:g,large:v,disabled:m,outline:b,secondary:w,negative:x,positive:C,caution:_,collapse:S});return"trigger"in e.props?t.cloneElement(e,{trigger:k}):k}return null}))}))}return null},dc=W.div((({width:e})=>({display:"inline-flex",width:e})),cn),pc=t=>{const{content:n,children:r,dropdown:o,options:i}=t,a=c(t,["content","children","dropdown","options"]),s=n||r;return o&&i?e.jsx(gc,Object.assign({options:i},a,{children:s})):e.jsx(hc,Object.assign({},a,{children:s}))};pc.Group=fc;const hc=t=>{var{children:r,onClick:o,icon:i,iconPosition:a,iconColor:s,joined:l,size:u,small:f,large:d,isLoading:p,collapse:h,backgroundColor:g,color:v,type:y,animation:m,iconAnimation:b}=t,w=c(t,["children","onClick","icon","iconPosition","iconColor","joined","size","small","large","isLoading","collapse","backgroundColor","color","type","animation","iconAnimation"]);const{button:x}=n.useTheme(),C=i&&(!r||h),_="right"===a;let S=u||"medium";f?S="small":d&&(S="large");const k=x[S],{iconSize:O}=k,E=h&&i;return e.jsxs(vc,Object.assign({},w,{type:y||"button",size:S,iconOnly:C,iconRight:_,joined:l,onClick:o,isLoading:p,color:v,backgroundColor:g,animation:m,children:[i?e.jsx(fn,{size:O,name:i,marginRight:C||_?0:4,marginLeft:!C&&_?4:0,color:s,inheritColor:!s,animation:b}):null,!E&&e.jsx("span",{children:r}),p&&e.jsx(lc,{size:O})]}))},gc=n=>{var{children:r,options:o,onClick:i,afterShow:a,afterHide:s,secondary:l,negative:u,positive:f,caution:d,outline:p,size:h,small:g,large:v,disabled:y,isLoading:m,direction:b,collapse:w,width:x,zIndex:C,disableScrollLock:_}=n,S=c(n,["children","options","onClick","afterShow","afterHide","secondary","negative","positive","caution","outline","size","small","large","disabled","isLoading","direction","collapse","width","zIndex","disableScrollLock"]);const[k,O]=t.useState(!1),E={secondary:l,negative:u,positive:f,caution:d,outline:p,size:h,small:g,large:v,disabled:y};return e.jsx(yc,{children:e.jsxs(fc,{width:w?void 0:x,children:[e.jsx(hc,Object.assign({},E,S,{width:x&&!w?"100%":void 0,collapse:w,isLoading:m,onClick:e=>{i&&i(e)},children:e.jsx(mc,{children:r})})),e.jsx($s,{position:`${b||"bottom"} right`,afterShow:()=>{a&&a(),O(!0)},afterHide:()=>{s&&s(),O(!1)},options:o,trigger:e.jsx(hc,Object.assign({},E,{icon:k?"caret-up":"caret-down",preventPointerEvents:m,tabIndex:-1})),zIndex:C,disableScrollLock:_})]})})},vc=W.button((({theme:{accent:e,font:t,button:n},size:r="medium",joined:o,circle:i,iconOnly:a,iconRight:s,width:c,height:l,animation:u})=>{const f=i||a&&!o,d=n[r],p=c||"max-content",{height:h,font:g,padding:v,iconOnlyPadding:y}=d,m=l||h,b=a||f?y:v;return{display:"inline-flex",alignItems:"center",justifyContent:"center",flexDirection:s?"row-reverse":"row",fontSize:g,width:f?m:p,height:m,fontFamily:t.family.default,fontWeight:t.weight.bold,borderRadius:f?"50%":30,cursor:"pointer",outline:"none",padding:`0px ${b}px`,position:"relative",animation:u,"&:focus-visible":{outline:`${e} solid 1px`}}}),(({theme:e,joined:t,iconOnly:n,outline:r,negative:o,positive:i,caution:a,secondary:s,disabled:c,subtle:l,link:u})=>{const{button:f,size:d}=e;let p=f.primary;l?p=f.subtle:u?p=f.link:c?p=f.disabled:o?p=f.negative:i?p=f.positive:a?p=f.caution:s&&(p=f.secondary);const h=r?p.outlineBackground:p.background;let g=r?p.outlineColor:p.color;if(u||l){let e=f.subtle;u&&(e=f.link),c?g=f.disabled.color:o?g=e.negativeColor:i?g=e.positiveColor:a?g=e.cautionColor:s&&(g=e.secondaryColor)}const v="left"===t||"middle"===t,y="right"===t||"middle"===t,m=n?d.xs:d.sm;return{backgroundColor:h.default,color:g.default,border:r&&!u?"1px solid":"none",borderColor:p.border.default,"&:hover":{backgroundColor:h.hover,color:g.hover,borderColor:r&&!c?p.border.hover:void 0},"&:active":{backgroundColor:h.active,color:g.active,borderColor:r&&!c?p.border.active:void 0},"&:disabled":{backgroundColor:l?"transparent":void 0,cursor:"not-allowed"},borderTopLeftRadius:v?0:void 0,borderBottomLeftRadius:v?0:void 0,borderTopRightRadius:y?0:void 0,borderBottomRightRadius:y?0:void 0,paddingLeft:v?m:void 0,paddingRight:y?m:void 0,borderRight:y?`1px solid ${r?p.border.default:p.divider}`:void 0,borderLeft:v?"none":void 0}}),(({link:e})=>({height:e?"max-content":void 0,width:e?"max-content":void 0,padding:e?0:void 0})),(({isLoading:e,preventPointerEvents:t})=>({pointerEvents:e||t?"none":void 0,"& > *":{visibility:e?"hidden":void 0},"& > .button-loader":{visibility:e?"visible":void 0}})),(({theme:{name:e},backgroundColor:t,color:n,disabled:r})=>{const o="dark"===e?ar:cr,i="dark"===e?cr:ar;return r||!n&&!t?{}:{backgroundColor:t,color:n,"&:hover":{backgroundColor:t?o(.05,t):void 0,color:n?i(.05,n):void 0},"&:active":{backgroundColor:t?o(.1,t):void 0,color:n?i(.1,n):void 0}}}),cn),yc=W.div({display:"inline-flex",flexDirection:"column",position:"relative"}),mc=W.div({marginRight:8}),bc=t=>{var{value:n,max:r=100,step:o=1,width:i,height:a,disabled:s,onChange:l}=t,u=c(t,["value","max","step","width","height","disabled","onChange"]);return e.jsx(xc,Object.assign({},u,{type:"range",max:r,value:n,percent:n/r*100,onChange:e=>{const{value:t}=e.target;l&&l(+t)},step:o,width:i,height:a,disabled:s,readOnly:!l}))},wc=(e,t)=>({appearance:"none",backgroundColor:t?"transparent":e.color.brand,height:e.size.sm,width:e.size.sm,border:"none",borderRadius:"50%"}),xc=W.input((({theme:e,percent:t,width:n,height:r,disabled:o,readOnly:i})=>{const a=o?e.scale0:e.scale1,s=o?e.scale1:e.color.brand;return{appearance:"none",display:"block",width:n||"100%",height:r||2,borderRadius:24,outline:"none",background:`linear-gradient(to right, ${s} 0%, ${s} ${t}%, ${a} ${t}%, ${a} 100%)`,"&::-webkit-slider-thumb":wc(e,o||i),"&::-moz-range-thumb":wc(e,o||i),"&:focus-visible":{outline:o||i?"none":`${e.accent} solid 1px`}}}),cn),Cc=t.forwardRef(((n,r)=>{var{src:o,title:i,width:a,infoPosition:s,centerAlignContent:l,small:u,collapsed:f,hideSliderOnStop:d,hideTimeOnStop:p,fontSizeTitle:h,fontSizeTime:g,onPlay:v,onPause:y,onStop:m}=n,b=c(n,["src","title","width","infoPosition","centerAlignContent","small","collapsed","hideSliderOnStop","hideTimeOnStop","fontSizeTitle","fontSizeTime","onPlay","onPause","onStop"]);const[w,x]=t.useState(!1),[C,_]=t.useState(!0),[S,k]=t.useState(0),[O,E]=t.useState(0),[j,A]=t.useState(""),[T,M]=t.useState(""),P=t.useRef(null),D=()=>{const{current:e}=P;e&&e.play().catch((()=>{throw Error("Video failed to play")}))},L=()=>{const{current:e}=P;e&&e.pause()},I=()=>{const{current:e}=P;e&&e.load()};t.useImperativeHandle(r,(()=>({play:D,pause:L,stop:I})),[P,w]);const R=e=>{x(!1),_(!0),m&&m(e)};t.useEffect((()=>{(()=>{const{current:e}=P;!!e&&e.paused})()}),[w]);const N=e=>{const t=(e/100).toFixed(2),[n,r]=t.split(".");return`${n}:${r}`},B=C&&d,F=C&&p;return e.jsxs(_c,Object.assign({width:a},b,{children:[e.jsx(pc,{outline:!0,small:u,icon:w?"pause":"play",onClick:()=>{w?L():D()},marginRight:8}),!f&&e.jsxs(Sc,{alignDataTop:"top"===s,children:[!B&&e.jsx(bc,{value:S,max:O,step:.1,onChange:e=>{(null==P?void 0:P.current)&&(P.current.currentTime=e)}}),e.jsxs(kc,{alignTop:"top"===s,noSlider:B,relative:l||B,children:[i?e.jsx(Oc,{fontSize:h,children:i}):e.jsx("div",{}),!F&&e.jsxs(Oc,{secondary:!0,fontSize:g,children:[j&&!C?`${j} / `:"",T]})]})]}),e.jsxs("audio",{ref:P,onPlay:e=>{x(!0),_(!1),v&&v(e)},onPause:e=>{x(!1),y&&y(e)},onEmptied:R,onEnded:R,onTimeUpdate:()=>{const{current:e}=P;if(e){const{currentTime:t}=e,n=N(t);k(t),A(n)}},onDurationChange:()=>{const{current:e}=P;if(e){const{duration:t}=e,n=N(t);E(t),M(n)}},children:[e.jsx("track",{kind:"captions"}),e.jsx("source",{src:o})]})]}))})),_c=W.div((({width:e=250})=>({display:"flex",alignItems:"center",width:e})),cn),Sc=W.div((({alignDataTop:e})=>({display:"flex",flexDirection:e?"column-reverse":"column",position:"relative",width:"100%"}))),kc=W.div((({alignTop:e,noSlider:t,relative:n})=>({position:n?"relative":"absolute",top:e||t?void 0:6,bottom:e&&!t?6:void 0,display:"flex",justifyContent:"space-between",alignItems:"flex-end",width:"100%"}))),Oc=W.div((({theme:e,secondary:t,fontSize:n})=>({color:t?e.scale6:e.scale10,fontSize:n||10})));var Ec={},jc={};Object.defineProperty(jc,"__esModule",{value:!0}),jc.defaultOptions=void 0,jc.defaultOptions={lowercase:!1,precision:1,space:!1,units:["","K","M","B","T","P","E"]};var Ac={};Object.defineProperty(Ac,"__esModule",{value:!0}),Ac.getLocales=Ac.getFractionDigits=Ac.roundTo=Ac.parseValue=void 0,Ac.parseValue=function(e){const t=parseFloat(null==e?void 0:e.toString());if(isNaN(t))throw new Error("Input value is not a number");if(t>Number.MAX_SAFE_INTEGER||t<Number.MIN_SAFE_INTEGER)throw new RangeError("Input value is outside of safe integer range");return t},Ac.roundTo=function(e,t){if(!Number.isFinite(e))throw new Error("Input value is not a finite number");if(!Number.isInteger(t)||t<0)throw new Error("Precision is not a positive integer");return Number.isInteger(e)?e:parseFloat(e.toFixed(t))},Ac.getFractionDigits=function(e){var t;if(Number.isInteger(e))return 0;const n=e.toString().split(".")[1];return null!==(t=null==n?void 0:n.length)&&void 0!==t?t:0},Ac.getLocales=function(){var e;return"undefined"==typeof navigator?[]:Array.from(null!==(e=navigator.languages)&&void 0!==e?e:[])},Object.defineProperty(Ec,"__esModule",{value:!0}),Ec.millify=void 0;const Tc=jc,Mc=Ac,Pc=1e3;function*Dc(e){let t=Pc;for(;;){const n=e/t;if(n<1)return;yield n,t*=Pc}}function Lc(e,t){var n,r;const o=t?{...Tc.defaultOptions,...t}:Tc.defaultOptions;if(!Array.isArray(o.units)||!o.units.length)throw new Error("Option `units` must be a non-empty array");let i;try{i=Mc.parseValue(e)}catch(t){return t instanceof Error&&console.warn(`WARN: ${t.message} (millify)`),String(e)}const a=i<0?"-":"";i=Math.abs(i);let s=0;for(const e of Dc(i))i=e,s+=1;if(s>=o.units.length)return e.toString();let c=Mc.roundTo(i,o.precision);for(const e of Dc(c))c=e,s+=1;const l=null!==(n=o.units[s])&&void 0!==n?n:"",u=o.lowercase?l.toLowerCase():l,f=o.space?" ":"";return`${a}${c.toLocaleString(null!==(r=o.locales)&&void 0!==r?r:Mc.getLocales(),{minimumFractionDigits:Mc.getFractionDigits(c)})}${f}${u}`}Ec.millify=Lc;var Ic,Rc=Ec.default=Lc,Nc={exports:{}};
19
19
  /*!
20
20
  Copyright (c) 2018 Jed Watson.
21
21
  Licensed under the MIT License (MIT), see