@protonradio/proton-ui 0.10.13-beta.1 → 0.10.13-beta.2
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.
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -6
- package/dist/index.es.js +3 -3
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -43,5 +43,5 @@ React keys must be passed directly to JSX without using spread:
|
|
|
43
43
|
*
|
|
44
44
|
* This source code is licensed under the MIT license found in the
|
|
45
45
|
* LICENSE file in the root directory of this source tree.
|
|
46
|
-
*/var ql;function bv(){return ql||(ql=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var t=u,e=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(x){{for(var B=arguments.length,S=new Array(B>1?B-1:0),w=1;w<B;w++)S[w-1]=arguments[w];r("error",x,S)}}function r(x,B,S){{var w=e.ReactDebugCurrentFrame,I=w.getStackAddendum();I!==""&&(B+="%s",S=S.concat([I]));var h=S.map(function(A){return String(A)});h.unshift("Warning: "+B),Function.prototype.apply.call(console[x],console,h)}}function l(x,B){return x===B&&(x!==0||1/x===1/B)||x!==x&&B!==B}var o=typeof Object.is=="function"?Object.is:l,i=t.useState,s=t.useEffect,a=t.useLayoutEffect,c=t.useDebugValue,d=!1,f=!1;function p(x,B,S){d||t.startTransition!==void 0&&(d=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var w=B();if(!f){var I=B();o(w,I)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}var h=i({inst:{value:w,getSnapshot:B}}),A=h[0].inst,C=h[1];return a(function(){A.value=w,A.getSnapshot=B,v(A)&&C({inst:A})},[x,w,B]),s(function(){v(A)&&C({inst:A});var k=function(){v(A)&&C({inst:A})};return x(k)},[x]),c(w),w}function v(x){var B=x.getSnapshot,S=x.value;try{var w=B();return!o(S,w)}catch{return!0}}function b(x,B,S){return B()}var y=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",$=!y,D=$?b:p,E=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:D;Jn.useSyncExternalStore=E,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Jn}process.env.NODE_ENV==="production"?$r.exports=mv():$r.exports=bv();var gv=$r.exports;const Iu=u.createContext(!1),Ot=u.createContext(null);function yv(t){if(u.useContext(Ot))return t.content;let{collection:n,document:r}=Cv(t.createCollection);return u.createElement(u.Fragment,null,u.createElement(vv,null,u.createElement(Ot.Provider,{value:r},t.content)),u.createElement($v,{render:t.children,collection:n}))}function $v({collection:t,render:e}){return e(t)}function xv(t,e,n){let r=Xe(),l=u.useRef(r);l.current=r;let o=u.useCallback(()=>l.current?n():e(),[e,n]);return gv.useSyncExternalStore(t,o)}const Ev=typeof u.useSyncExternalStore=="function"?u.useSyncExternalStore:xv;function Cv(t){let[e]=u.useState(()=>new fv((t==null?void 0:t())||new dv)),n=u.useCallback(i=>e.subscribe(i),[e]),r=u.useCallback(()=>{let i=e.getCollection();return e.isSSR&&e.resetAfterSSR(),i},[e]),l=u.useCallback(()=>(e.isSSR=!0,e.getCollection()),[e]),o=Ev(n,r,l);return Y(()=>(e.isMounted=!0,()=>{e.isMounted=!1}),[e]),{collection:o,document:e}}const xr=u.createContext(null);function Sv(t,e,n,r,l,o){let i=u.useCallback(a=>{a==null||a.setProps(e,n,r,o)},[e,n,r,o]),s=u.useContext(xr);if(s){let a=s.ownerDocument.nodesByProps.get(e);return a||(a=s.ownerDocument.createElement(t),a.setProps(e,n,r,o),s.appendChild(a),s.ownerDocument.updateCollection(),s.ownerDocument.nodesByProps.set(e,a)),l?u.createElement(xr.Provider,{value:a},l):null}return u.createElement(t,{ref:i},l)}function Pv(t,e){let n=({node:l})=>e(l.props,l.props.ref,l),r=u.forwardRef((l,o)=>{if(!u.useContext(Iu)){if(e.length>=3)throw new Error(e.name+" cannot be rendered outside a collection.");return e(l,o)}return Sv(t,l,o,"children"in l?l.children:null,null,s=>u.createElement(n,{node:s}))});return r.displayName=e.name,r}function Dv(t){return _u({...t,addIdAndValue:!0})}const Xl=u.createContext(null);function wv(t){let e=u.useContext(Xl),n=((e==null?void 0:e.dependencies)||[]).concat(t.dependencies),r=t.idScope||(e==null?void 0:e.idScope),l=Dv({...t,idScope:r,dependencies:n});return u.useContext(Ot)&&(l=u.createElement(Av,null,l)),e=u.useMemo(()=>({dependencies:n,idScope:r}),[r,...n]),u.createElement(Xl.Provider,{value:e},l)}function Av({children:t}){let e=u.useContext(Ot),n=u.useMemo(()=>u.createElement(Ot.Provider,{value:null},u.createElement(Iu.Provider,{value:!0},t)),[t]);return Xe()?u.createElement(xr.Provider,{value:e},n):xt.createPortal(n,e)}const Tv=u.createContext(null),kv={CollectionRoot({collection:t,renderDropIndicator:e}){return Zl(t,null,e)},CollectionBranch({collection:t,parent:e,renderDropIndicator:n}){return Zl(t,e,n)}};function Zl(t,e,n){return _u({items:e?t.getChildren(e.key):t,dependencies:[n],children(r){var l;let o=r.render(r);if(!n||r.type!=="item")return o;let i=r.key,s=t.getKeyAfter(i);return u.createElement(u.Fragment,null,n({type:"item",key:i,dropPosition:"before"}),o,(s==null||((l=t.getItem(s))===null||l===void 0?void 0:l.type)!=="item")&&n({type:"item",key:i,dropPosition:"after"}))}})}const Fu=u.createContext(kv);function Bv(t){return u.useMemo(()=>t!=null?new Set([t]):null,[t])}const Jl=Symbol("default");function kn({values:t,children:e}){for(let[n,r]of t)e=u.createElement(n.Provider,{value:r},e);return e}function St(t){let{className:e,style:n,children:r,defaultClassName:l,defaultChildren:o,defaultStyle:i,values:s}=t;return u.useMemo(()=>{let a,c,d;return typeof e=="function"?a=e({...s,defaultClassName:l}):a=e,typeof n=="function"?c=n({...s,defaultStyle:i||{}}):c=n,typeof r=="function"?d=r({...s,defaultChildren:o}):r==null?d=o:d=r,{className:a??l,style:c||i?{...i,...c}:void 0,children:d??o,"data-rac":""}},[e,n,r,l,o,i,s])}function Nu(t,e){let n=u.useContext(t);if(e===null)return null;if(n&&typeof n=="object"&&"slots"in n&&n.slots){let r=new Intl.ListFormat().format(Object.keys(n.slots).map(o=>`"${o}"`));if(!e&&!n.slots[Jl])throw new Error(`A slot prop is required. Valid slot names are ${r}.`);let l=e||Jl;if(!n.slots[l])throw new Error(`Invalid slot "${e}". Valid slot names are ${r}.`);return n.slots[l]}return n}function Yt(t,e,n){let r=Nu(n,t.slot)||{},{ref:l,...o}=r,i=gn(u.useMemo(()=>Ic(e,l),[e,l])),s=z(o,t);return"style"in o&&o.style&&"style"in t&&t.style&&(typeof o.style=="function"||typeof t.style=="function"?s.style=a=>{let c=typeof o.style=="function"?o.style(a):o.style,d={...a.defaultStyle,...c},f=typeof t.style=="function"?t.style({...a,defaultStyle:d}):t.style;return{...d,...f}}:s.style={...o.style,...t.style}),[s,i]}function Rv(){let[t,e]=u.useState(!0),n=u.useRef(!1),r=u.useCallback(l=>{n.current=!0,e(!!l)},[]);return Y(()=>{n.current||e(!1)},[]),[r,t]}function Kv(t,e=!0){let[n,r]=u.useState(!0);return Lu(t,n&&e,u.useCallback(()=>r(!1),[])),n&&e}function Mv(t,e){let[n,r]=u.useState(!1),[l,o]=u.useState("idle");return!e&&t.current&&l==="idle"&&(n=!0,r(!0),o("exiting")),!t.current&&l==="exited"&&o("idle"),Lu(t,n,u.useCallback(()=>{o("exited"),r(!1)},[])),n}function Lu(t,e,n){let r=u.useRef(null);e&&t.current&&(r.current=window.getComputedStyle(t.current).animation),Y(()=>{if(e&&t.current){let l=window.getComputedStyle(t.current);if(l.animationName&&l.animationName!=="none"&&l.animation!==r.current){let o=s=>{s.target===t.current&&(i.removeEventListener("animationend",o),xt.flushSync(()=>{n()}))},i=t.current;return i.addEventListener("animationend",o),()=>{i.removeEventListener("animationend",o)}}else n()}},[t,e,n])}const _v=u.createContext(null),Iv=new Set(["form","formAction","formEncType","formMethod","formNoValidate","formTarget","name","value"]),Fv=u.createContext({});function Nv(t,e){[t,e]=Yt(t,e,Fv),t=Lv(t);let n=t,{isPending:r}=n,{buttonProps:l,isPressed:o}=Wt(t,e),{focusProps:i,isFocused:s,isFocusVisible:a}=Ht(t),{hoverProps:c,isHovered:d}=Et({...t,isDisabled:t.isDisabled||r}),f={isHovered:d,isPressed:(n.isPressed||o)&&!r,isFocused:s,isFocusVisible:a,isDisabled:t.isDisabled||!1,isPending:r??!1},p=St({...t,values:f,defaultClassName:"react-aria-Button"}),v=ce(l.id),b=ce(),y=l["aria-labelledby"];r&&(y?y=`${y} ${b}`:l["aria-label"]&&(y=`${v} ${b}`));let $=u.useRef(r);return u.useEffect(()=>{let D={"aria-labelledby":y||v};(!$.current&&s&&r||$.current&&s&&!r)&&pn(D,"assertive"),$.current=r},[r,s,y,v]),u.createElement("button",{...ie(t,{propNames:Iv}),...z(l,i,c),...p,id:v,ref:e,"aria-labelledby":y,slot:t.slot||void 0,"aria-disabled":r?"true":l["aria-disabled"],"data-disabled":t.isDisabled||void 0,"data-pressed":f.isPressed||void 0,"data-hovered":d||void 0,"data-focused":s||void 0,"data-pending":r||void 0,"data-focus-visible":a||void 0},u.createElement(_v.Provider,{value:{id:b}},p.children))}function Lv(t){return t.isPending&&(t.onPress=void 0,t.onPressStart=void 0,t.onPressEnd=void 0,t.onPressChange=void 0,t.onPressUp=void 0,t.onKeyDown=void 0,t.onKeyUp=void 0,t.onClick=void 0,t.href=void 0),t}const Ou=hv(Nv),Ov=u.createContext({}),jv=u.createContext({}),zv=u.createContext({}),ju=u.createContext({placement:"bottom"});function Vv(t,e){[t,e]=Yt(t,e,ju);let n=t.placement,r={position:"absolute",[n]:"100%",transform:n==="top"||n==="bottom"?"translateX(-50%)":"translateY(-50%)"},l=St({...t,defaultClassName:"react-aria-OverlayArrow",values:{placement:n}});return l.style&&Object.keys(l.style).forEach(o=>l.style[o]===void 0&&delete l.style[o]),u.createElement("div",{...t,...l,style:{...r,...l.style},ref:e,"data-placement":n})}const Hv=u.forwardRef(Vv),Er=u.createContext(null),Wv=u.createContext(null),Uv=u.createContext({}),zu=u.createContext(null),Yr=u.createContext(null),Vu=u.createContext(null);function Yv(t){let e=$p(t),n=u.useRef(null),{menuTriggerProps:r,menuProps:l}=ps({...t,type:"menu"},e,n),[o,i]=u.useState(null),s=u.useCallback(()=>{n.current&&i(n.current.offsetWidth+"px")},[n]);tr({ref:n,onResize:s});let a=u.useRef(null);return u.createElement(kn,{values:[[zu,{...l,ref:a}],[Wv,e],[Vu,e],[Er,{trigger:"MenuTrigger",triggerRef:n,scrollRef:a,placement:"bottom start",style:{"--trigger-width":o}}]]},u.createElement(fd,{...r,ref:n,isPressed:e.isOpen},t.children))}const Gv=u.createContext(null);function qv(t,e){return[t,e]=Yt(t,e,zu),u.createElement(yv,{content:u.createElement(wv,t)},n=>n.size>0&&u.createElement(Xv,{props:t,collection:n,menuRef:e}))}function Xv({props:t,collection:e,menuRef:n}){let r=wu({...t,collection:e,children:void 0}),[l,o]=u.useState(null),{isVirtualized:i,CollectionRoot:s}=u.useContext(Fu),{menuProps:a}=hs({...t,isVirtualized:i},r,n),c=u.useContext(Vu),d=u.useContext(Er),f=(d==null?void 0:d.trigger)==="SubmenuTrigger";xo({ref:n,onInteractOutside:$=>{c&&!(l!=null&&l.contains($.target))&&c.close()},isDisabled:f||(c==null?void 0:c.expandedKeysStack.length)===0});let p=u.useRef(null),[v,b]=u.useState({left:0});u.useEffect(()=>{if(l&&p.current!==l&&v.left===0){p.current=l;let{left:$}=l.getBoundingClientRect();b({left:-1*$})}},[v,l]);let y=St({defaultClassName:"react-aria-Menu",className:t.className,style:t.style,values:{}});return u.createElement(Vt,null,u.createElement("div",{...ie(t),...a,...y,ref:n,slot:t.slot||void 0,onScroll:t.onScroll},u.createElement(kn,{values:[[Yr,r],[zv,{elementType:"div"}],[Er,{UNSTABLE_portalContainer:l||void 0}],[Tv,{render:Jv}],[Gv,{parentMenuRef:n}],[Cr,null]]},u.createElement(s,{collection:e,persistedKeys:Bv(r.selectionManager.focusedKey),scrollRef:n}))),u.createElement("div",{ref:o,style:{width:"100vw",position:"absolute",top:0,...v}}))}const Zv=u.forwardRef(qv);function Jv(t,e,n){var r,l;let o=u.useContext(Yr),{CollectionBranch:i}=u.useContext(Fu),[s,a]=Rv();var c;let{headingProps:d,groupProps:f}=zf({heading:a,"aria-label":(c=n.props["aria-label"])!==null&&c!==void 0?c:void 0}),p=St({defaultClassName:"react-aria-Section",className:(r=n.props)===null||r===void 0?void 0:r.className,style:(l=n.props)===null||l===void 0?void 0:l.style,values:{}});return u.createElement("section",{...ie(t),...f,...p,ref:e},u.createElement(jv.Provider,{value:{...d,ref:s}},u.createElement(i,{collection:o.collection,parent:n})))}const Cr=u.createContext(null),Qv=Pv("item",function(e,n,r){var l;[e,n]=Yt(e,n,Cr);let o=(l=Nu(Cr))===null||l===void 0?void 0:l.id,i=u.useContext(Yr),s=gn(n),{menuItemProps:a,labelProps:c,descriptionProps:d,keyboardShortcutProps:f,...p}=ms({...e,id:o,key:r.key},i,s),{isFocusVisible:v,focusProps:b}=Ht(),{hoverProps:y,isHovered:$}=Et({isDisabled:p.isDisabled}),D=St({...e,id:void 0,children:r.rendered,defaultClassName:"react-aria-MenuItem",values:{...p,isHovered:$,isFocusVisible:v,selectionMode:i.selectionManager.selectionMode,selectionBehavior:i.selectionManager.selectionBehavior,hasSubmenu:!!e["aria-haspopup"],isOpen:e["aria-expanded"]==="true"}}),E=e.href?"a":"div";return u.createElement(E,{...z(a,b,y),...D,ref:s,"data-disabled":p.isDisabled||void 0,"data-hovered":$||void 0,"data-focused":p.isFocused||void 0,"data-focus-visible":v||void 0,"data-pressed":p.isPressed||void 0,"data-selected":p.isSelected||void 0,"data-selection-mode":i.selectionManager.selectionMode==="none"?void 0:i.selectionManager.selectionMode,"data-has-submenu":!!e["aria-haspopup"]||void 0,"data-open":e["aria-expanded"]==="true"||void 0},u.createElement(kn,{values:[[Ov,{slots:{label:c,description:d}}],[Uv,f]]},D.children))}),Gr=u.createContext(null),Hu=u.createContext(null);function eh(t){let e=Du(t),n=u.useRef(null),{triggerProps:r,tooltipProps:l}=mp(t,e,n);return u.createElement(kn,{values:[[Gr,e],[Hu,{...l,triggerRef:n}]]},u.createElement(Id,{...r,ref:n},t.children))}function th({UNSTABLE_portalContainer:t,...e},n){[e,n]=Yt(e,n,Hu);let r=u.useContext(Gr),l=Du(e),o=e.isOpen!=null||e.defaultOpen!=null||!r?l:r,i=Mv(n,o.isOpen)||e.isExiting||!1;return!o.isOpen&&!i?null:u.createElement(Sf,{portalContainer:t},u.createElement(rh,{...e,tooltipRef:n,isExiting:i}))}const nh=u.forwardRef(th);function rh(t){let e=u.useContext(Gr),n=u.useRef(null),[r,l]=u.useState(0);Y(()=>{n.current&&e.isOpen&&l(n.current.getBoundingClientRect().width)},[e.isOpen,n]);let{overlayProps:o,arrowProps:i,placement:s}=Fo({placement:t.placement||"top",targetRef:t.triggerRef,overlayRef:t.tooltipRef,offset:t.offset,crossOffset:t.crossOffset,isOpen:e.isOpen,arrowSize:r,arrowBoundaryOffset:t.arrowBoundaryOffset,shouldFlip:t.shouldFlip}),a=Kv(t.tooltipRef,!!s)||t.isEntering||!1,c=St({...t,defaultClassName:"react-aria-Tooltip",values:{placement:s,isEntering:a,isExiting:t.isExiting,state:e}});t=z(t,o);let{tooltipProps:d}=hp(t,e);return u.createElement("div",{...d,ref:t.tooltipRef,...c,style:{...o.style,...c.style},"data-placement":s,"data-entering":a||void 0,"data-exiting":t.isExiting||void 0},u.createElement(ju.Provider,{value:{...i,placement:s,ref:n}},c.children))}const lh=({size:t})=>g.jsx("svg",{viewBox:"0 0 24 24",width:t,height:t,children:g.jsx("path",{fill:"currentColor",d:"M4 14c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm8 0c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm8 0c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"})});function oh({renderTrigger:t,menuId:e,size:n=24,actions:r,disabled:l,onClose:o,testId:i,menuTestId:s}){const{className:a}=ve(),c=$t.useBreakpoint(Ee.BREAKPOINTS.SMALL),[d,f]=u.useState(!1),p=u.useRef(null),v={disabled:l,"data-testid":i,"aria-label":"Menu"},b=g.jsx(Ou,{...v,ref:p,onPress:()=>f($=>!$),isDisabled:l,className:`proton-ResponsiveMenuTrigger__button ${a}`,children:g.jsx(lh,{size:n})}),y=t?t({...v,onClick:()=>f($=>!$)},d):b;return u.useEffect(()=>()=>{d&&(o==null||o())},[d,o]),c?g.jsxs(g.Fragment,{children:[y,d&&g.jsx(Wr,{id:e,actions:r,isOpen:d,onClose:()=>{f(!1)},showCancel:!0,"data-testid":s})]}):g.jsxs(Yv,{children:[y,d&&g.jsx(Tn,{state:{isOpen:d,setOpen:f,open:()=>f(!0),close:()=>f(!1),toggle:()=>f(!d)},triggerRef:p,arrow:!1,children:g.jsx(Zv,{className:"proton-ListBox proton-ResponsiveMenuTrigger__menu",id:e,autoFocus:!0,"data-testid":s,children:r.map($=>g.jsx(Qv,{href:$.to,target:"_blank",rel:"noopener noreferrer",onAction:()=>{var D;(D=$.onAction)==null||D.call($,$.key),setTimeout(()=>{f(!1)},200)},className:"proton-ListBox__item proton-ResponsiveMenuTrigger__menu-item",children:$.label},$.key))})})]})}const Wu=t=>{let e=u.useRef(null),{state:n}=t,{listBoxProps:r}=_f(t,n,e);return g.jsx("ul",{...r,ref:e,"data-testid":"listbox",className:"proton-ListBox",children:[...n.collection].map(l=>g.jsx(ih,{item:l,state:n},l.key))})};function ih({item:t,state:e}){let n=u.useRef(null),{optionProps:r,isSelected:l,isFocused:o,isDisabled:i}=Of({key:t.key},e,n);return g.jsx("li",{...r,className:N.csx("proton-ListBox__item",o&&"proton-ListBox__item--focused",l&&"proton-ListBox__item--selected",i&&"proton-ListBox__item--disabled"),ref:n,children:t.rendered})}const Uu=u.forwardRef((t,e)=>{let{buttonProps:n}=Wt({...t,isDisabled:t.disabled},e);return g.jsx("button",{...n,ref:e,className:N.csx("proton-Select__trigger",t.disabled&&"proton-Select__trigger--disabled",!t.isOpen&&"proton-Select__trigger--closed",t.isOpen&&"proton-Select__trigger--opened"),children:t.children})});function sh({label:t,name:e,isDisabled:n,disabledKeys:r,selectedKey:l,onSelectionChange:o,onOpen:i,onClose:s,items:a,"data-testid":c,children:d}){const f={label:t,isDisabled:n,disabledKeys:r,selectedKey:l,items:a,"data-testid":c,children:d,onSelectionChange:o,onOpenChange:x=>{x?i==null||i():s==null||s()}},p=$u(f),v=u.useRef(null),b=u.useRef(null),{labelProps:y,triggerProps:$,valueProps:D,menuProps:E}=Fa({...f,label:t||e},p,v);return u.useEffect(()=>{p.isOpen&&b.current&&v.current&&!b.current.style.minWidth&&(b.current.style.minWidth=`${v.current.offsetWidth}px`)}),g.jsxs("div",{className:"proton-Select","aria-label":t||e,"aria-disabled":n,children:[t?g.jsx("div",{...y,className:"proton-Select__label","data-testid":"select-label",children:t}):g.jsx("div",{...y}),g.jsx(Na,{isDisabled:n,state:p,triggerRef:v,label:t||e,name:e,"data-testid":"hidden-select-container"}),g.jsxs(Uu,{...$,isOpen:p.isOpen,ref:v,disabled:n,"data-testid":c,children:[g.jsx("div",{...D,className:"proton-Select__value",children:p.selectedItem?p.selectedItem.rendered:"Select an option"}),g.jsx("div",{className:N.csx("proton-Select__trigger_icon",p.isOpen&&"proton-Select__trigger_icon--flipped"),"aria-hidden":"true",children:g.jsxs("svg",{id:"caret-down",viewBox:"0 0 512 512",children:[g.jsx("title",{children:p.isOpen?"caret down":"caret up"}),g.jsx("path",{fill:"currentColor",d:"M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7L86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z"})]})})]}),p.isOpen&&g.jsx("div",{className:"proton-Select__popover",children:g.jsx(Tn,{state:p,triggerRef:v,popoverRef:b,placement:"bottom start","data-testid":"select-popover",children:g.jsx(Wu,{...E,state:p})})})]})}const ah={Menu:sh,Option:Fr};function uh({label:t,name:e,isDisabled:n,disabledKeys:r,selectedKey:l,onSelectionChange:o,onOpen:i,onClose:s,items:a,"data-testid":c,children:d}){const f={label:t,isDisabled:n,disabledKeys:r,selectedKey:l,onSelectionChange:o,onOpenChange:S=>{S?i==null||i():s==null||s()},items:a,"data-testid":c,children:d},p=$u(f),v=$t.useBreakpoint(Ee.BREAKPOINTS.MEDIUM),b=u.useRef(null),y=u.useRef(null),{labelProps:$,triggerProps:D,valueProps:E,menuProps:x}=Fa({...f,label:t||e},p,b);u.useEffect(()=>{p.isOpen&&y.current&&b.current&&!y.current.style.minWidth&&(y.current.style.minWidth=`${b.current.offsetWidth}px`)});const B=(a==null?void 0:a.map(S=>({key:S.name,label:S.name,onAction:w=>{o==null||o(w),p.close()}})))||[];return g.jsxs("div",{className:"proton-Select","aria-label":t||e,"aria-disabled":n,children:[t?g.jsx("div",{...$,className:"proton-Select__label","data-testid":"select-label",children:t}):g.jsx("div",{...$}),g.jsx(Na,{isDisabled:n,state:p,triggerRef:b,label:t||e,name:e,"data-testid":"hidden-select-container"}),g.jsxs(Uu,{...D,isOpen:p.isOpen,ref:b,disabled:n,"data-testid":c,children:[g.jsx("div",{...E,children:p.selectedItem?p.selectedItem.rendered:"Select an option"}),g.jsx("div",{className:N.csx("proton-Select__trigger_icon",p.isOpen&&"proton-Select__trigger_icon--flipped"),"aria-hidden":"true",children:g.jsxs("svg",{id:"caret-down",viewBox:"0 0 512 512",children:[g.jsx("title",{children:p.isOpen?"caret down":"caret up"}),g.jsx("path",{fill:"currentColor",d:"M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7L86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z"})]})})]}),p.isOpen&&g.jsx(g.Fragment,{children:v?g.jsx(Wr,{isOpen:p.isOpen,onClose:()=>p.close(),actions:B,selectedKeys:l?[l.toString()]:void 0}):g.jsx("div",{className:"proton-Select__popover",children:g.jsx(Tn,{state:p,triggerRef:b,popoverRef:y,placement:"bottom start","data-testid":"select-popover",children:g.jsx(Wu,{...x,state:p})})})})]})}const ch={Menu:uh,Option:Fr};function dh(t){let e={...t,isSelected:t.isOn,"data-testid":void 0},n=u.useRef(null),r=of(e),{inputProps:l}=np(e,r,n);return g.jsxs("label",{className:N.csx("proton-Switch",t.isDisabled&&"proton-Switch--disabled",r.isSelected&&"proton-Switch--on"),"data-on":r.isSelected||void 0,"data-disabled":t.isDisabled||void 0,"data-testid":t["data-testid"]||void 0,"aria-label":t.label||void 0,children:[g.jsx(Mr,{children:g.jsx("input",{...l,ref:n})}),t.label&&g.jsx("div",{className:"proton-Switch__label",children:t.label}),g.jsxs("div",{className:"proton-Switch__wrapper",children:[g.jsx("div",{className:"proton-Switch__toggle",children:g.jsx("div",{className:"proton-Switch__slider"})}),t.children&&g.jsx("div",{className:"proton-Switch__description",children:t.children})]})]})}function fh({item:t,state:e,children:n}){let r=u.useRef(),{rowProps:l}=fp({node:t},e);return g.jsx("tr",{className:N.csx("proton-Table__headerRow"),...l,ref:r,children:n})}function ph({column:t,state:e}){var a,c;let n=u.useRef(),{columnHeaderProps:r}=cp({node:t},e,n);const{align:l="left"}=t.props;let{isFocusVisible:o,focusProps:i}=Ht(),s=((a=e.sortDescriptor)==null?void 0:a.direction)==="ascending"?"▲":"▼";return g.jsxs("th",{...z(r,i),colSpan:t.colspan,className:N.csx("proton-Table__header",`proton-Table__header--${l}`,o?"proton-Table__header--focused":null),ref:n,children:[t.rendered,t.props.allowsSorting&&g.jsx("span",{"aria-hidden":"true",className:N.csx("proton-Table__headerSortIcon"),style:{visibility:((c=e.sortDescriptor)==null?void 0:c.column)===t.key?"visible":"hidden"},children:s})]})}function Ql({type:t,children:e,isHidden:n=!1}){let{rowGroupProps:r}=vp();return g.jsx(t,{...r,className:N.csx("proton-Table__rowGroup",t==="thead"?"proton-Table__rowGroup--header":"proton-Table__rowGroup--body"),style:n?{display:"none"}:void 0,children:e})}function vh({item:t,children:e,state:n,backgroundColor:r,onClick:l,showLines:o=!0}){let i=u.useRef(),s=n.selectionManager.isSelected(t.key),{rowProps:a,isPressed:c}=dp({node:t},n,i),{isFocusVisible:d,focusProps:f}=Ht();return g.jsx("tr",{className:N.csx("proton-Table__row",s?"proton-Table__row--selected":null,c?"proton-Table__row--pressed":null,d?"proton-Table__row--focused":null,o&&"proton-Table__row--showLines",l&&"proton-Table--clickable"),style:r?{backgroundColor:r}:void 0,...z(a,f),ref:i,onClick:l?()=>l(t.key):void 0,children:e})}function hh({cell:t,state:e,width:n,onClick:r}){let l=u.useRef(),{gridCellProps:o}=pp({node:t},e,l),{isFocusVisible:i,focusProps:s}=Ht();const{align:a="left"}=t.props;return g.jsx("td",{...z(o,s),className:N.csx("proton-Table__cell",i?"proton-Table__cell--focused":null,`proton-Table__cell--${a}`,r&&"proton-Table--clickable"),style:n?{width:n}:void 0,ref:l,onClick:r?()=>r(t.key):void 0,children:t.rendered})}const mh=Kp,bh=_p,gh=Mp,yh=Rp;function $h(t){var o;let e=kp({...t}),n=u.useRef(),{collection:r}=e,{gridProps:l}=ap({...t,"aria-label":t["aria-label"]||"Table"},e,n);return g.jsxs("table",{...l,ref:n,className:N.csx("proton-Table"),children:[g.jsx(Ql,{type:"thead",isHidden:(o=t.headerProps)==null?void 0:o.isHidden,children:r.headerRows.map(i=>g.jsx(fh,{item:i,state:e,children:Array.from(r.getChildren(i.key)).map(s=>g.jsx(ph,{column:s,state:e},s.key))},i.key))}),g.jsx(Ql,{type:"tbody",children:Array.from(r.body.childNodes).map(i=>g.jsx(vh,{item:i,state:e,backgroundColor:i.props.backgroundColor,showLines:r.body.props.showLines,onClick:i.props.onClick,children:Array.from(r.getChildren(i.key)).map(s=>g.jsx(hh,{cell:s,state:e,width:s.props.width,onClick:s.props.onClick},s.key))},i.key))})]})}const xh=({children:t,maxWidth:e,singleLine:n=!0,lines:r=1,title:l,"data-testid":o})=>g.jsx("div",{className:N.csx("proton-TextEllipsis",n||r===1?"proton-TextEllipsis--single-line":r>1?"proton-TextEllipsis--multi-line":""),style:{maxWidth:e,WebkitLineClamp:r},title:l,"data-testid":o,children:t});function Yu({children:t,arrow:e,...n}){const{style:r,className:l}=ve();return g.jsxs(nh,{...n,className:N.csx("proton__Tooltip","proton-Dialog",l),style:r,children:[e&&g.jsx(Hv,{className:N.csx("proton__TooltipArrow",l),children:g.jsx("svg",{width:8,height:8,viewBox:"0 0 8 8",children:g.jsx("path",{d:"M0 0 L4 4 L8 0"})})}),t]})}function Gu({children:t,delay:e=500,closeDelay:n=500,isDisabled:r,defaultOpen:l,onOpenChange:o,disableTriggerClick:i,content:s,...a}){const[c,d]=u.useState(!1),f=u.useRef(!1),p=u.useRef(!1);return s===""?null:g.jsxs(eh,{delay:e,closeDelay:n,isDisabled:r,isOpen:c,defaultOpen:l,onOpenChange:v=>{v&&!f.current&&(p.current=!0),o&&o(v),f.current||d(v),f.current=!1},children:[i?g.jsx("span",{className:"proton__TooltipTrigger","aria-label":"Show tooltip",children:t}):g.jsx(Ou,{className:"proton__TooltipTrigger","aria-label":"Show tooltip",onPress:()=>{i||r||p.current||(f.current=!0,d(!c))},children:t}),g.jsx(Yu,{...a,children:s})]})}const Eh=({to:t,children:e,tooltipProps:n,"data-testid":r})=>{const{className:l}=ve(),o=n?g.jsx(Gu,{delay:50,closeDelay:75,...n,children:e}):e;if(t){const i=N.isUrlExternal(t);return g.jsx("span",{className:N.csx("proton-TextEmphasis",n&&"proton-TextEmphasis--tooltip",l),children:g.jsx("a",{"data-testid":r,href:t,target:i?"_blank":void 0,rel:i?"noopener noreferrer":void 0,onClick:i?void 0:s=>N.handleInternalNavigation(s,t),children:o})})}return g.jsx("span",{className:N.csx("proton-TextEmphasis",n&&"proton-TextEmphasis--tooltip",l),"data-testid":r,children:o})},Ch=({width:t="100%",height:e="1.5rem",borderRadius:n="4px"})=>{const{theme:r,palette:l}=ve(),o={"--tombstone-custom-background":l.PRIMARY.PRIMARY_MEDIUM,"--tombstone-custom-primary":N.transparentize(l.PRIMARY.PRIMARY_DARK,.9),"--tombstone-custom-secondary":N.transparentize(l.SECONDARY.SECONDARY_DARK,.7)};return g.jsx("div",{className:`tombstone ${r}`,style:{...o,width:t,height:e,borderRadius:n}})};function Sh({amplitude:t,isDisabled:e,isPlayed:n,isHovered:r,isVisible:l,hasAnimated:o,resolution:i,spacing:s,index:a}){const c=l?`${Math.max(t*100,4)}%`:"0%";return g.jsxs("div",{className:N.csx("proton-Waveform__bar-wrapper"),style:{width:`${i}px`,marginRight:`${s}px`},children:[g.jsx("div",{className:N.csx("proton-Waveform__bar","proton-Waveform__bar--upper",e&&"proton-Waveform__bar--disabled",n&&"proton-Waveform__bar--played",l&&"proton-Waveform__bar--visible",o&&"proton-Waveform__bar--animated"),style:{"--target-height":`calc(${c} / 2)`,"--index":a}}),g.jsx("div",{className:N.csx("proton-Waveform__bar","proton-Waveform__bar--lower",e&&"proton-Waveform__bar--disabled",n&&"proton-Waveform__bar--played",l&&"proton-Waveform__bar--visible",o&&"proton-Waveform__bar--animated"),style:{"--target-height":`calc(${c} / 2)`,"--index":a}}),r&&!e&&!n&&g.jsx("div",{className:"proton-Waveform__bar--hover",style:{"--hover-height":c}})]})}const Ph=kh(100);function Dh({data:t,resolution:e=2,startDuration:n,endDuration:r,currentTime:l=0,showTimestamps:o=!1,totalDuration:i,disabled:s,disabledMessage:a,onClick:c,"data-testid":d}){var P;const{className:f}=ve(),p=u.useRef(null),[v,b]=u.useState([]),[y,$]=u.useState(null),[D,E]=u.useState(!1),[x,B]=u.useState(!1),S=t||Ph,w=e;u.useEffect(()=>{if(!p.current)return;const M=K=>{const Z=Math.floor(K/(e+w)),le=Ah(S,Z);b(le)},T=p.current.clientWidth;M(T);const j=new ResizeObserver(K=>{K&&K[0]&&M(K[0].contentRect.width)});return j.observe(p.current),()=>j.disconnect()},[S,e,w]),u.useEffect(()=>{const M=setTimeout(()=>E(!0),50),T=setTimeout(()=>B(!0),500);return()=>{clearTimeout(M),clearTimeout(T)}},[]);const I=M=>{if(!p.current)return;const T=p.current.getBoundingClientRect(),K=(M.clientX-T.left)/T.width*i;$(K)},h=()=>{$(null)},A=e+w,C=(M,T)=>{var Z;const j=M/i*100;return(T==="start"?Math.floor(j/100*v.length):Math.ceil(j/100*v.length))*A/((Z=p.current)==null?void 0:Z.clientWidth)*100},k=(P=p.current)==null?void 0:P.clientWidth,F=u.useMemo(()=>s&&a?a:t?null:"Waveform Unavailable",[s,a,t]);return g.jsxs("div",{className:N.csx("proton-Waveform",f),"data-testid":d,children:[o&&g.jsx(eo,{direction:"left",seconds:l}),g.jsxs("div",{ref:p,className:"proton-Waveform__container",onMouseMove:I,onMouseLeave:h,onClick:M=>{if(!p.current||s)return;const T=p.current.getBoundingClientRect(),K=(M.clientX-T.left)/T.width*i;c==null||c(K,M)},"data-disabled":s,"data-testid":"waveform-container",children:[n!==void 0&&r!==void 0&&g.jsx("div",{className:"proton-Waveform__active-region",style:{left:p.current?`calc(${C(n,"start")}%`:"0%",right:p.current?`calc(${100-C(r,"end")}% - 2px)`:"0%"}}),y!==null&&g.jsx("div",{className:"proton-Waveform__hover-line",style:{left:`${y/i*100}%`}}),v.map((M,T)=>{const j=T/v.length*i,K=n!==void 0&&r!==void 0&&(j<n||j>r),Z=l===0?!1:j<=l,le=y!==null&&j<=y;return g.jsx(Sh,{amplitude:M,isDisabled:s||K,isPlayed:Z,isHovered:le,isVisible:D,hasAnimated:x,resolution:e,spacing:w,index:T},T)})]}),F&&g.jsx("div",{className:"proton-Waveform__bar-unavailable",style:{fontSize:k<325?"0.85rem":"1rem"},children:F}),o&&g.jsx(eo,{direction:"right",seconds:i})]})}function eo({direction:t,seconds:e}){return g.jsx("div",{className:N.csx("proton-Waveform__timestamp",`proton-Waveform__timestamp--${t}`),children:wh(e)})}function wh(t){const e=Math.floor(t/60),n=Math.floor(t%60);return`${e}:${n<10?"0":""}${n.toFixed(0)}`}function Ah(t,e){const n=t.length,r=n/e,l=new Array(e).fill(0).map((o,i)=>{const s=i*r,a=Math.floor(s),c=Math.min(a+1,n-1),d=s-a;return t[a]*(1-d)+t[c]*d});return Th(l)}function Th(t){const e=Math.min(...t),n=Math.max(...t);return t.map(r=>{const l=(r-e)/(n-e);return Math.max(l*.8+.1,.1)})}function kh(t){return Array.from({length:t},(e,n)=>{const l=n/(t-1)*6*2*Math.PI-Math.PI/2;return Math.sin(l)*.5+.5})}const qu=({children:t})=>g.jsx("h2",{className:"proton-Modal__title",children:t}),Xu=({children:t})=>g.jsx("h3",{className:"proton-Modal__subtitle",children:t}),Zu=({children:t})=>g.jsx("div",{className:"proton-Modal__body",children:t}),Bh=t=>g.jsx("div",{className:"proton-Modal__action",children:g.jsx(Pn,{...t})}),Rh=({children:t})=>g.jsx(Vt,{autoFocus:!0,children:g.jsx("div",{className:"proton-Modal__actions",children:t})}),Kh=({title:t,subtitle:e,body:n,onClose:r,children:l,isClosing:o,"data-testid":i})=>{const s=u.useRef(null),a=Ut({isOpen:!0,onOpenChange:r}),{modalProps:c}=kf({isDismissable:!1},a,s),{dialogProps:d}=bs({role:"dialog"},s);_r();const f=u.useRef(null),{buttonProps:p}=Wt({onPress:r,"aria-label":"Close"},f);return g.jsx(Vt,{contain:!0,restoreFocus:!0,autoFocus:!0,children:g.jsxs("div",{"data-testid":i,className:N.csx("proton-Modal",o&&"proton-Modal--closing"),...z(c,d),ref:s,children:[g.jsx("button",{name:"Close",className:"proton-Modal__close-button",...p,ref:f,children:"×"}),t&&g.jsx(qu,{children:t}),e&&g.jsx(Xu,{children:e}),n&&g.jsx(Zu,{children:n}),g.jsx("div",{className:"proton-Modal__content",children:l})]})})},Mh=({isOpen:t,onClose:e,title:n,subtitle:r,body:l,children:o,isOverlay:i=!0,"data-testid":s})=>{const a=u.useRef(null),{isClosing:c,handleClose:d}=$t.useIsClosing({onClose:e,overlayRef:a}),f=$t.useBreakpoint(Ee.BREAKPOINTS.MEDIUM);if(!t)return null;const p=g.jsx(Kh,{isOpen:t,title:n,subtitle:r,body:l,onClose:d,isClosing:c,"data-testid":s,children:o});return i||f?g.jsx(Dn,{fadeIn:!0,ref:a,onClose:d,children:p}):p},_h=Object.assign(Mh,{Title:qu,Subtitle:Xu,Body:Zu,Action:Bh,Actions:Rh});exports.ActionMenu=Wr;exports.Badge=Wp;exports.BadgeVariants=Hp;exports.Banner=Le;exports.Button=Pn;exports.ButtonGroup=Ru;exports.Cell=bh;exports.Column=mh;exports.CopyInput=sv;exports.Dialog=Qp;exports.Elevation=uv;exports.Icon=nv;exports.ImageBackground=lv;exports.Input=An;exports.Modal=_h;exports.Popover=Tn;exports.ResponsiveMenuTrigger=oh;exports.ResponsiveSelect=ch;exports.Row=gh;exports.ScreenOverlay=Dn;exports.SearchInput=iv;exports.Section=Ff;exports.Select=ah;exports.Switch=dh;exports.Table=$h;exports.TableBody=yh;exports.TableHeader=Bp;exports.TextEllipsis=xh;exports.TextEmphasis=Eh;exports.ThemeProvider=Tu;exports.Tombstone=Ch;exports.Tooltip=Yu;exports.TooltipTrigger=Gu;exports.Waveform=Dh;exports.usePopoverTrigger=cv;exports.useTheme=ve;
|
|
46
|
+
*/var ql;function bv(){return ql||(ql=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var t=u,e=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(x){{for(var B=arguments.length,S=new Array(B>1?B-1:0),w=1;w<B;w++)S[w-1]=arguments[w];r("error",x,S)}}function r(x,B,S){{var w=e.ReactDebugCurrentFrame,I=w.getStackAddendum();I!==""&&(B+="%s",S=S.concat([I]));var h=S.map(function(A){return String(A)});h.unshift("Warning: "+B),Function.prototype.apply.call(console[x],console,h)}}function l(x,B){return x===B&&(x!==0||1/x===1/B)||x!==x&&B!==B}var o=typeof Object.is=="function"?Object.is:l,i=t.useState,s=t.useEffect,a=t.useLayoutEffect,c=t.useDebugValue,d=!1,f=!1;function p(x,B,S){d||t.startTransition!==void 0&&(d=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var w=B();if(!f){var I=B();o(w,I)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}var h=i({inst:{value:w,getSnapshot:B}}),A=h[0].inst,C=h[1];return a(function(){A.value=w,A.getSnapshot=B,v(A)&&C({inst:A})},[x,w,B]),s(function(){v(A)&&C({inst:A});var k=function(){v(A)&&C({inst:A})};return x(k)},[x]),c(w),w}function v(x){var B=x.getSnapshot,S=x.value;try{var w=B();return!o(S,w)}catch{return!0}}function b(x,B,S){return B()}var y=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",$=!y,D=$?b:p,E=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:D;Jn.useSyncExternalStore=E,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Jn}process.env.NODE_ENV==="production"?$r.exports=mv():$r.exports=bv();var gv=$r.exports;const Iu=u.createContext(!1),Ot=u.createContext(null);function yv(t){if(u.useContext(Ot))return t.content;let{collection:n,document:r}=Cv(t.createCollection);return u.createElement(u.Fragment,null,u.createElement(vv,null,u.createElement(Ot.Provider,{value:r},t.content)),u.createElement($v,{render:t.children,collection:n}))}function $v({collection:t,render:e}){return e(t)}function xv(t,e,n){let r=Xe(),l=u.useRef(r);l.current=r;let o=u.useCallback(()=>l.current?n():e(),[e,n]);return gv.useSyncExternalStore(t,o)}const Ev=typeof u.useSyncExternalStore=="function"?u.useSyncExternalStore:xv;function Cv(t){let[e]=u.useState(()=>new fv((t==null?void 0:t())||new dv)),n=u.useCallback(i=>e.subscribe(i),[e]),r=u.useCallback(()=>{let i=e.getCollection();return e.isSSR&&e.resetAfterSSR(),i},[e]),l=u.useCallback(()=>(e.isSSR=!0,e.getCollection()),[e]),o=Ev(n,r,l);return Y(()=>(e.isMounted=!0,()=>{e.isMounted=!1}),[e]),{collection:o,document:e}}const xr=u.createContext(null);function Sv(t,e,n,r,l,o){let i=u.useCallback(a=>{a==null||a.setProps(e,n,r,o)},[e,n,r,o]),s=u.useContext(xr);if(s){let a=s.ownerDocument.nodesByProps.get(e);return a||(a=s.ownerDocument.createElement(t),a.setProps(e,n,r,o),s.appendChild(a),s.ownerDocument.updateCollection(),s.ownerDocument.nodesByProps.set(e,a)),l?u.createElement(xr.Provider,{value:a},l):null}return u.createElement(t,{ref:i},l)}function Pv(t,e){let n=({node:l})=>e(l.props,l.props.ref,l),r=u.forwardRef((l,o)=>{if(!u.useContext(Iu)){if(e.length>=3)throw new Error(e.name+" cannot be rendered outside a collection.");return e(l,o)}return Sv(t,l,o,"children"in l?l.children:null,null,s=>u.createElement(n,{node:s}))});return r.displayName=e.name,r}function Dv(t){return _u({...t,addIdAndValue:!0})}const Xl=u.createContext(null);function wv(t){let e=u.useContext(Xl),n=((e==null?void 0:e.dependencies)||[]).concat(t.dependencies),r=t.idScope||(e==null?void 0:e.idScope),l=Dv({...t,idScope:r,dependencies:n});return u.useContext(Ot)&&(l=u.createElement(Av,null,l)),e=u.useMemo(()=>({dependencies:n,idScope:r}),[r,...n]),u.createElement(Xl.Provider,{value:e},l)}function Av({children:t}){let e=u.useContext(Ot),n=u.useMemo(()=>u.createElement(Ot.Provider,{value:null},u.createElement(Iu.Provider,{value:!0},t)),[t]);return Xe()?u.createElement(xr.Provider,{value:e},n):xt.createPortal(n,e)}const Tv=u.createContext(null),kv={CollectionRoot({collection:t,renderDropIndicator:e}){return Zl(t,null,e)},CollectionBranch({collection:t,parent:e,renderDropIndicator:n}){return Zl(t,e,n)}};function Zl(t,e,n){return _u({items:e?t.getChildren(e.key):t,dependencies:[n],children(r){var l;let o=r.render(r);if(!n||r.type!=="item")return o;let i=r.key,s=t.getKeyAfter(i);return u.createElement(u.Fragment,null,n({type:"item",key:i,dropPosition:"before"}),o,(s==null||((l=t.getItem(s))===null||l===void 0?void 0:l.type)!=="item")&&n({type:"item",key:i,dropPosition:"after"}))}})}const Fu=u.createContext(kv);function Bv(t){return u.useMemo(()=>t!=null?new Set([t]):null,[t])}const Jl=Symbol("default");function kn({values:t,children:e}){for(let[n,r]of t)e=u.createElement(n.Provider,{value:r},e);return e}function St(t){let{className:e,style:n,children:r,defaultClassName:l,defaultChildren:o,defaultStyle:i,values:s}=t;return u.useMemo(()=>{let a,c,d;return typeof e=="function"?a=e({...s,defaultClassName:l}):a=e,typeof n=="function"?c=n({...s,defaultStyle:i||{}}):c=n,typeof r=="function"?d=r({...s,defaultChildren:o}):r==null?d=o:d=r,{className:a??l,style:c||i?{...i,...c}:void 0,children:d??o,"data-rac":""}},[e,n,r,l,o,i,s])}function Nu(t,e){let n=u.useContext(t);if(e===null)return null;if(n&&typeof n=="object"&&"slots"in n&&n.slots){let r=new Intl.ListFormat().format(Object.keys(n.slots).map(o=>`"${o}"`));if(!e&&!n.slots[Jl])throw new Error(`A slot prop is required. Valid slot names are ${r}.`);let l=e||Jl;if(!n.slots[l])throw new Error(`Invalid slot "${e}". Valid slot names are ${r}.`);return n.slots[l]}return n}function Yt(t,e,n){let r=Nu(n,t.slot)||{},{ref:l,...o}=r,i=gn(u.useMemo(()=>Ic(e,l),[e,l])),s=z(o,t);return"style"in o&&o.style&&"style"in t&&t.style&&(typeof o.style=="function"||typeof t.style=="function"?s.style=a=>{let c=typeof o.style=="function"?o.style(a):o.style,d={...a.defaultStyle,...c},f=typeof t.style=="function"?t.style({...a,defaultStyle:d}):t.style;return{...d,...f}}:s.style={...o.style,...t.style}),[s,i]}function Rv(){let[t,e]=u.useState(!0),n=u.useRef(!1),r=u.useCallback(l=>{n.current=!0,e(!!l)},[]);return Y(()=>{n.current||e(!1)},[]),[r,t]}function Kv(t,e=!0){let[n,r]=u.useState(!0);return Lu(t,n&&e,u.useCallback(()=>r(!1),[])),n&&e}function Mv(t,e){let[n,r]=u.useState(!1),[l,o]=u.useState("idle");return!e&&t.current&&l==="idle"&&(n=!0,r(!0),o("exiting")),!t.current&&l==="exited"&&o("idle"),Lu(t,n,u.useCallback(()=>{o("exited"),r(!1)},[])),n}function Lu(t,e,n){let r=u.useRef(null);e&&t.current&&(r.current=window.getComputedStyle(t.current).animation),Y(()=>{if(e&&t.current){let l=window.getComputedStyle(t.current);if(l.animationName&&l.animationName!=="none"&&l.animation!==r.current){let o=s=>{s.target===t.current&&(i.removeEventListener("animationend",o),xt.flushSync(()=>{n()}))},i=t.current;return i.addEventListener("animationend",o),()=>{i.removeEventListener("animationend",o)}}else n()}},[t,e,n])}const _v=u.createContext(null),Iv=new Set(["form","formAction","formEncType","formMethod","formNoValidate","formTarget","name","value"]),Fv=u.createContext({});function Nv(t,e){[t,e]=Yt(t,e,Fv),t=Lv(t);let n=t,{isPending:r}=n,{buttonProps:l,isPressed:o}=Wt(t,e),{focusProps:i,isFocused:s,isFocusVisible:a}=Ht(t),{hoverProps:c,isHovered:d}=Et({...t,isDisabled:t.isDisabled||r}),f={isHovered:d,isPressed:(n.isPressed||o)&&!r,isFocused:s,isFocusVisible:a,isDisabled:t.isDisabled||!1,isPending:r??!1},p=St({...t,values:f,defaultClassName:"react-aria-Button"}),v=ce(l.id),b=ce(),y=l["aria-labelledby"];r&&(y?y=`${y} ${b}`:l["aria-label"]&&(y=`${v} ${b}`));let $=u.useRef(r);return u.useEffect(()=>{let D={"aria-labelledby":y||v};(!$.current&&s&&r||$.current&&s&&!r)&&pn(D,"assertive"),$.current=r},[r,s,y,v]),u.createElement("button",{...ie(t,{propNames:Iv}),...z(l,i,c),...p,id:v,ref:e,"aria-labelledby":y,slot:t.slot||void 0,"aria-disabled":r?"true":l["aria-disabled"],"data-disabled":t.isDisabled||void 0,"data-pressed":f.isPressed||void 0,"data-hovered":d||void 0,"data-focused":s||void 0,"data-pending":r||void 0,"data-focus-visible":a||void 0},u.createElement(_v.Provider,{value:{id:b}},p.children))}function Lv(t){return t.isPending&&(t.onPress=void 0,t.onPressStart=void 0,t.onPressEnd=void 0,t.onPressChange=void 0,t.onPressUp=void 0,t.onKeyDown=void 0,t.onKeyUp=void 0,t.onClick=void 0,t.href=void 0),t}const Ou=hv(Nv),Ov=u.createContext({}),jv=u.createContext({}),zv=u.createContext({}),ju=u.createContext({placement:"bottom"});function Vv(t,e){[t,e]=Yt(t,e,ju);let n=t.placement,r={position:"absolute",[n]:"100%",transform:n==="top"||n==="bottom"?"translateX(-50%)":"translateY(-50%)"},l=St({...t,defaultClassName:"react-aria-OverlayArrow",values:{placement:n}});return l.style&&Object.keys(l.style).forEach(o=>l.style[o]===void 0&&delete l.style[o]),u.createElement("div",{...t,...l,style:{...r,...l.style},ref:e,"data-placement":n})}const Hv=u.forwardRef(Vv),Er=u.createContext(null),Wv=u.createContext(null),Uv=u.createContext({}),zu=u.createContext(null),Yr=u.createContext(null),Vu=u.createContext(null);function Yv(t){let e=$p(t),n=u.useRef(null),{menuTriggerProps:r,menuProps:l}=ps({...t,type:"menu"},e,n),[o,i]=u.useState(null),s=u.useCallback(()=>{n.current&&i(n.current.offsetWidth+"px")},[n]);tr({ref:n,onResize:s});let a=u.useRef(null);return u.createElement(kn,{values:[[zu,{...l,ref:a}],[Wv,e],[Vu,e],[Er,{trigger:"MenuTrigger",triggerRef:n,scrollRef:a,placement:"bottom start",style:{"--trigger-width":o}}]]},u.createElement(fd,{...r,ref:n,isPressed:e.isOpen},t.children))}const Gv=u.createContext(null);function qv(t,e){return[t,e]=Yt(t,e,zu),u.createElement(yv,{content:u.createElement(wv,t)},n=>n.size>0&&u.createElement(Xv,{props:t,collection:n,menuRef:e}))}function Xv({props:t,collection:e,menuRef:n}){let r=wu({...t,collection:e,children:void 0}),[l,o]=u.useState(null),{isVirtualized:i,CollectionRoot:s}=u.useContext(Fu),{menuProps:a}=hs({...t,isVirtualized:i},r,n),c=u.useContext(Vu),d=u.useContext(Er),f=(d==null?void 0:d.trigger)==="SubmenuTrigger";xo({ref:n,onInteractOutside:$=>{c&&!(l!=null&&l.contains($.target))&&c.close()},isDisabled:f||(c==null?void 0:c.expandedKeysStack.length)===0});let p=u.useRef(null),[v,b]=u.useState({left:0});u.useEffect(()=>{if(l&&p.current!==l&&v.left===0){p.current=l;let{left:$}=l.getBoundingClientRect();b({left:-1*$})}},[v,l]);let y=St({defaultClassName:"react-aria-Menu",className:t.className,style:t.style,values:{}});return u.createElement(Vt,null,u.createElement("div",{...ie(t),...a,...y,ref:n,slot:t.slot||void 0,onScroll:t.onScroll},u.createElement(kn,{values:[[Yr,r],[zv,{elementType:"div"}],[Er,{UNSTABLE_portalContainer:l||void 0}],[Tv,{render:Jv}],[Gv,{parentMenuRef:n}],[Cr,null]]},u.createElement(s,{collection:e,persistedKeys:Bv(r.selectionManager.focusedKey),scrollRef:n}))),u.createElement("div",{ref:o,style:{width:"100vw",position:"absolute",top:0,...v}}))}const Zv=u.forwardRef(qv);function Jv(t,e,n){var r,l;let o=u.useContext(Yr),{CollectionBranch:i}=u.useContext(Fu),[s,a]=Rv();var c;let{headingProps:d,groupProps:f}=zf({heading:a,"aria-label":(c=n.props["aria-label"])!==null&&c!==void 0?c:void 0}),p=St({defaultClassName:"react-aria-Section",className:(r=n.props)===null||r===void 0?void 0:r.className,style:(l=n.props)===null||l===void 0?void 0:l.style,values:{}});return u.createElement("section",{...ie(t),...f,...p,ref:e},u.createElement(jv.Provider,{value:{...d,ref:s}},u.createElement(i,{collection:o.collection,parent:n})))}const Cr=u.createContext(null),Qv=Pv("item",function(e,n,r){var l;[e,n]=Yt(e,n,Cr);let o=(l=Nu(Cr))===null||l===void 0?void 0:l.id,i=u.useContext(Yr),s=gn(n),{menuItemProps:a,labelProps:c,descriptionProps:d,keyboardShortcutProps:f,...p}=ms({...e,id:o,key:r.key},i,s),{isFocusVisible:v,focusProps:b}=Ht(),{hoverProps:y,isHovered:$}=Et({isDisabled:p.isDisabled}),D=St({...e,id:void 0,children:r.rendered,defaultClassName:"react-aria-MenuItem",values:{...p,isHovered:$,isFocusVisible:v,selectionMode:i.selectionManager.selectionMode,selectionBehavior:i.selectionManager.selectionBehavior,hasSubmenu:!!e["aria-haspopup"],isOpen:e["aria-expanded"]==="true"}}),E=e.href?"a":"div";return u.createElement(E,{...z(a,b,y),...D,ref:s,"data-disabled":p.isDisabled||void 0,"data-hovered":$||void 0,"data-focused":p.isFocused||void 0,"data-focus-visible":v||void 0,"data-pressed":p.isPressed||void 0,"data-selected":p.isSelected||void 0,"data-selection-mode":i.selectionManager.selectionMode==="none"?void 0:i.selectionManager.selectionMode,"data-has-submenu":!!e["aria-haspopup"]||void 0,"data-open":e["aria-expanded"]==="true"||void 0},u.createElement(kn,{values:[[Ov,{slots:{label:c,description:d}}],[Uv,f]]},D.children))}),Gr=u.createContext(null),Hu=u.createContext(null);function eh(t){let e=Du(t),n=u.useRef(null),{triggerProps:r,tooltipProps:l}=mp(t,e,n);return u.createElement(kn,{values:[[Gr,e],[Hu,{...l,triggerRef:n}]]},u.createElement(Id,{...r,ref:n},t.children))}function th({UNSTABLE_portalContainer:t,...e},n){[e,n]=Yt(e,n,Hu);let r=u.useContext(Gr),l=Du(e),o=e.isOpen!=null||e.defaultOpen!=null||!r?l:r,i=Mv(n,o.isOpen)||e.isExiting||!1;return!o.isOpen&&!i?null:u.createElement(Sf,{portalContainer:t},u.createElement(rh,{...e,tooltipRef:n,isExiting:i}))}const nh=u.forwardRef(th);function rh(t){let e=u.useContext(Gr),n=u.useRef(null),[r,l]=u.useState(0);Y(()=>{n.current&&e.isOpen&&l(n.current.getBoundingClientRect().width)},[e.isOpen,n]);let{overlayProps:o,arrowProps:i,placement:s}=Fo({placement:t.placement||"top",targetRef:t.triggerRef,overlayRef:t.tooltipRef,offset:t.offset,crossOffset:t.crossOffset,isOpen:e.isOpen,arrowSize:r,arrowBoundaryOffset:t.arrowBoundaryOffset,shouldFlip:t.shouldFlip}),a=Kv(t.tooltipRef,!!s)||t.isEntering||!1,c=St({...t,defaultClassName:"react-aria-Tooltip",values:{placement:s,isEntering:a,isExiting:t.isExiting,state:e}});t=z(t,o);let{tooltipProps:d}=hp(t,e);return u.createElement("div",{...d,ref:t.tooltipRef,...c,style:{...o.style,...c.style},"data-placement":s,"data-entering":a||void 0,"data-exiting":t.isExiting||void 0},u.createElement(ju.Provider,{value:{...i,placement:s,ref:n}},c.children))}const lh=({size:t})=>g.jsx("svg",{viewBox:"0 0 24 24",width:t,height:t,children:g.jsx("path",{fill:"currentColor",d:"M4 14c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm8 0c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm8 0c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"})});function oh({renderTrigger:t,menuId:e,size:n=24,actions:r,disabled:l,onClose:o,testId:i,menuTestId:s}){const{className:a}=ve(),c=$t.useBreakpoint(Ee.BREAKPOINTS.SMALL),[d,f]=u.useState(!1),p=u.useRef(null),v={disabled:l,"data-testid":i,"aria-label":"Menu"},b=g.jsx(Ou,{...v,ref:p,onPress:()=>f($=>!$),isDisabled:l,className:`proton-ResponsiveMenuTrigger__button ${a}`,children:g.jsx(lh,{size:n})}),y=t?t({...v,onClick:()=>f($=>!$)},d):b;return u.useEffect(()=>()=>{d&&(o==null||o())},[d,o]),c?g.jsxs(g.Fragment,{children:[y,d&&g.jsx(Wr,{id:e,actions:r,isOpen:d,onClose:()=>{f(!1)},showCancel:!0,"data-testid":s})]}):g.jsxs(Yv,{children:[y,d&&g.jsx(Tn,{state:{isOpen:d,setOpen:f,open:()=>f(!0),close:()=>f(!1),toggle:()=>f(!d)},triggerRef:p,arrow:!1,children:g.jsx(Zv,{className:"proton-ListBox proton-ResponsiveMenuTrigger__menu",id:e,autoFocus:!0,"data-testid":s,children:r.map($=>g.jsx(Qv,{href:$.to,target:"_blank",rel:"noopener noreferrer",onAction:()=>{var D;(D=$.onAction)==null||D.call($,$.key),setTimeout(()=>{f(!1)},200)},className:"proton-ListBox__item proton-ResponsiveMenuTrigger__menu-item",children:$.label},$.key))})})]})}const Wu=t=>{let e=u.useRef(null),{state:n}=t,{listBoxProps:r}=_f(t,n,e);return g.jsx("ul",{...r,ref:e,"data-testid":"listbox",className:"proton-ListBox",children:[...n.collection].map(l=>g.jsx(ih,{item:l,state:n},l.key))})};function ih({item:t,state:e}){let n=u.useRef(null),{optionProps:r,isSelected:l,isFocused:o,isDisabled:i}=Of({key:t.key},e,n);return g.jsx("li",{...r,className:N.csx("proton-ListBox__item",o&&"proton-ListBox__item--focused",l&&"proton-ListBox__item--selected",i&&"proton-ListBox__item--disabled"),ref:n,children:t.rendered})}const Uu=u.forwardRef((t,e)=>{let{buttonProps:n}=Wt({...t,isDisabled:t.disabled},e);return g.jsx("button",{...n,ref:e,className:N.csx("proton-Select__trigger",t.disabled&&"proton-Select__trigger--disabled",!t.isOpen&&"proton-Select__trigger--closed",t.isOpen&&"proton-Select__trigger--opened"),children:t.children})});function sh({label:t,name:e,isDisabled:n,disabledKeys:r,selectedKey:l,onSelectionChange:o,onOpen:i,onClose:s,items:a,"data-testid":c,children:d}){const f={label:t,isDisabled:n,disabledKeys:r,selectedKey:l,items:a,"data-testid":c,children:d,onSelectionChange:o,onOpenChange:x=>{x?i==null||i():s==null||s()}},p=$u(f),v=u.useRef(null),b=u.useRef(null),{labelProps:y,triggerProps:$,valueProps:D,menuProps:E}=Fa({...f,label:t||e},p,v);return u.useEffect(()=>{p.isOpen&&b.current&&v.current&&!b.current.style.minWidth&&(b.current.style.minWidth=`${v.current.offsetWidth}px`)}),g.jsxs("div",{className:"proton-Select","aria-label":t||e,"aria-disabled":n,children:[t?g.jsx("div",{...y,className:"proton-Select__label","data-testid":"select-label",children:t}):g.jsx("div",{...y}),g.jsx(Na,{isDisabled:n,state:p,triggerRef:v,label:t||e,name:e,"data-testid":"hidden-select-container"}),g.jsxs(Uu,{...$,isOpen:p.isOpen,ref:v,disabled:n,"data-testid":c,children:[g.jsx("div",{...D,className:"proton-Select__value",children:p.selectedItem?p.selectedItem.rendered:"Select an option"}),g.jsx("div",{className:N.csx("proton-Select__trigger_icon",p.isOpen&&"proton-Select__trigger_icon--flipped"),"aria-hidden":"true",children:g.jsxs("svg",{id:"caret-down",viewBox:"0 0 512 512",children:[g.jsx("title",{children:p.isOpen?"caret down":"caret up"}),g.jsx("path",{fill:"currentColor",d:"M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7L86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z"})]})})]}),p.isOpen&&g.jsx("div",{className:"proton-Select__popover",children:g.jsx(Tn,{state:p,triggerRef:v,popoverRef:b,placement:"bottom start","data-testid":"select-popover",children:g.jsx(Wu,{...E,state:p})})})]})}const ah={Menu:sh,Option:Fr};function uh({label:t,name:e,isDisabled:n,disabledKeys:r,selectedKey:l,onSelectionChange:o,onOpen:i,onClose:s,items:a,"data-testid":c,children:d}){const f={label:t,isDisabled:n,disabledKeys:r,selectedKey:l,onSelectionChange:o,onOpenChange:S=>{S?i==null||i():s==null||s()},"data-testid":c,children:d},p=$u(f),v=$t.useBreakpoint(Ee.BREAKPOINTS.MEDIUM),b=u.useRef(null),y=u.useRef(null),{labelProps:$,triggerProps:D,valueProps:E,menuProps:x}=Fa({...f,label:t||e},p,b);u.useEffect(()=>{p.isOpen&&y.current&&b.current&&!y.current.style.minWidth&&(y.current.style.minWidth=`${b.current.offsetWidth}px`)});const B=(a==null?void 0:a.map(S=>({key:S.key,label:S.label,to:S.to,onAction:w=>{o==null||o(w),p.close()}})))||[];return g.jsxs("div",{className:"proton-Select","aria-label":t||e,"aria-disabled":n,children:[t?g.jsx("div",{...$,className:"proton-Select__label","data-testid":"select-label",children:t}):g.jsx("div",{...$}),g.jsx(Na,{isDisabled:n,state:p,triggerRef:b,label:t||e,name:e,"data-testid":"hidden-select-container"}),g.jsxs(Uu,{...D,isOpen:p.isOpen,ref:b,disabled:n,"data-testid":c,children:[g.jsx("div",{...E,children:p.selectedItem?p.selectedItem.rendered:"Select an option"}),g.jsx("div",{className:N.csx("proton-Select__trigger_icon",p.isOpen&&"proton-Select__trigger_icon--flipped"),"aria-hidden":"true",children:g.jsxs("svg",{id:"caret-down",viewBox:"0 0 512 512",children:[g.jsx("title",{children:p.isOpen?"caret down":"caret up"}),g.jsx("path",{fill:"currentColor",d:"M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7L86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z"})]})})]}),p.isOpen&&g.jsx(g.Fragment,{children:v?g.jsx(Wr,{isOpen:p.isOpen,onClose:()=>p.close(),actions:B,selectedKeys:l?[l.toString()]:void 0}):g.jsx("div",{className:"proton-Select__popover",children:g.jsx(Tn,{state:p,triggerRef:b,popoverRef:y,placement:"bottom start","data-testid":"select-popover",children:g.jsx(Wu,{...x,state:p})})})})]})}const ch={Menu:uh,Option:Fr};function dh(t){let e={...t,isSelected:t.isOn,"data-testid":void 0},n=u.useRef(null),r=of(e),{inputProps:l}=np(e,r,n);return g.jsxs("label",{className:N.csx("proton-Switch",t.isDisabled&&"proton-Switch--disabled",r.isSelected&&"proton-Switch--on"),"data-on":r.isSelected||void 0,"data-disabled":t.isDisabled||void 0,"data-testid":t["data-testid"]||void 0,"aria-label":t.label||void 0,children:[g.jsx(Mr,{children:g.jsx("input",{...l,ref:n})}),t.label&&g.jsx("div",{className:"proton-Switch__label",children:t.label}),g.jsxs("div",{className:"proton-Switch__wrapper",children:[g.jsx("div",{className:"proton-Switch__toggle",children:g.jsx("div",{className:"proton-Switch__slider"})}),t.children&&g.jsx("div",{className:"proton-Switch__description",children:t.children})]})]})}function fh({item:t,state:e,children:n}){let r=u.useRef(),{rowProps:l}=fp({node:t},e);return g.jsx("tr",{className:N.csx("proton-Table__headerRow"),...l,ref:r,children:n})}function ph({column:t,state:e}){var a,c;let n=u.useRef(),{columnHeaderProps:r}=cp({node:t},e,n);const{align:l="left"}=t.props;let{isFocusVisible:o,focusProps:i}=Ht(),s=((a=e.sortDescriptor)==null?void 0:a.direction)==="ascending"?"▲":"▼";return g.jsxs("th",{...z(r,i),colSpan:t.colspan,className:N.csx("proton-Table__header",`proton-Table__header--${l}`,o?"proton-Table__header--focused":null),ref:n,children:[t.rendered,t.props.allowsSorting&&g.jsx("span",{"aria-hidden":"true",className:N.csx("proton-Table__headerSortIcon"),style:{visibility:((c=e.sortDescriptor)==null?void 0:c.column)===t.key?"visible":"hidden"},children:s})]})}function Ql({type:t,children:e,isHidden:n=!1}){let{rowGroupProps:r}=vp();return g.jsx(t,{...r,className:N.csx("proton-Table__rowGroup",t==="thead"?"proton-Table__rowGroup--header":"proton-Table__rowGroup--body"),style:n?{display:"none"}:void 0,children:e})}function vh({item:t,children:e,state:n,backgroundColor:r,onClick:l,showLines:o=!0}){let i=u.useRef(),s=n.selectionManager.isSelected(t.key),{rowProps:a,isPressed:c}=dp({node:t},n,i),{isFocusVisible:d,focusProps:f}=Ht();return g.jsx("tr",{className:N.csx("proton-Table__row",s?"proton-Table__row--selected":null,c?"proton-Table__row--pressed":null,d?"proton-Table__row--focused":null,o&&"proton-Table__row--showLines",l&&"proton-Table--clickable"),style:r?{backgroundColor:r}:void 0,...z(a,f),ref:i,onClick:l?()=>l(t.key):void 0,children:e})}function hh({cell:t,state:e,width:n,onClick:r}){let l=u.useRef(),{gridCellProps:o}=pp({node:t},e,l),{isFocusVisible:i,focusProps:s}=Ht();const{align:a="left"}=t.props;return g.jsx("td",{...z(o,s),className:N.csx("proton-Table__cell",i?"proton-Table__cell--focused":null,`proton-Table__cell--${a}`,r&&"proton-Table--clickable"),style:n?{width:n}:void 0,ref:l,onClick:r?()=>r(t.key):void 0,children:t.rendered})}const mh=Kp,bh=_p,gh=Mp,yh=Rp;function $h(t){var o;let e=kp({...t}),n=u.useRef(),{collection:r}=e,{gridProps:l}=ap({...t,"aria-label":t["aria-label"]||"Table"},e,n);return g.jsxs("table",{...l,ref:n,className:N.csx("proton-Table"),children:[g.jsx(Ql,{type:"thead",isHidden:(o=t.headerProps)==null?void 0:o.isHidden,children:r.headerRows.map(i=>g.jsx(fh,{item:i,state:e,children:Array.from(r.getChildren(i.key)).map(s=>g.jsx(ph,{column:s,state:e},s.key))},i.key))}),g.jsx(Ql,{type:"tbody",children:Array.from(r.body.childNodes).map(i=>g.jsx(vh,{item:i,state:e,backgroundColor:i.props.backgroundColor,showLines:r.body.props.showLines,onClick:i.props.onClick,children:Array.from(r.getChildren(i.key)).map(s=>g.jsx(hh,{cell:s,state:e,width:s.props.width,onClick:s.props.onClick},s.key))},i.key))})]})}const xh=({children:t,maxWidth:e,singleLine:n=!0,lines:r=1,title:l,"data-testid":o})=>g.jsx("div",{className:N.csx("proton-TextEllipsis",n||r===1?"proton-TextEllipsis--single-line":r>1?"proton-TextEllipsis--multi-line":""),style:{maxWidth:e,WebkitLineClamp:r},title:l,"data-testid":o,children:t});function Yu({children:t,arrow:e,...n}){const{style:r,className:l}=ve();return g.jsxs(nh,{...n,className:N.csx("proton__Tooltip","proton-Dialog",l),style:r,children:[e&&g.jsx(Hv,{className:N.csx("proton__TooltipArrow",l),children:g.jsx("svg",{width:8,height:8,viewBox:"0 0 8 8",children:g.jsx("path",{d:"M0 0 L4 4 L8 0"})})}),t]})}function Gu({children:t,delay:e=500,closeDelay:n=500,isDisabled:r,defaultOpen:l,onOpenChange:o,disableTriggerClick:i,content:s,...a}){const[c,d]=u.useState(!1),f=u.useRef(!1),p=u.useRef(!1);return s===""?null:g.jsxs(eh,{delay:e,closeDelay:n,isDisabled:r,isOpen:c,defaultOpen:l,onOpenChange:v=>{v&&!f.current&&(p.current=!0),o&&o(v),f.current||d(v),f.current=!1},children:[i?g.jsx("span",{className:"proton__TooltipTrigger","aria-label":"Show tooltip",children:t}):g.jsx(Ou,{className:"proton__TooltipTrigger","aria-label":"Show tooltip",onPress:()=>{i||r||p.current||(f.current=!0,d(!c))},children:t}),g.jsx(Yu,{...a,children:s})]})}const Eh=({to:t,children:e,tooltipProps:n,"data-testid":r})=>{const{className:l}=ve(),o=n?g.jsx(Gu,{delay:50,closeDelay:75,...n,children:e}):e;if(t){const i=N.isUrlExternal(t);return g.jsx("span",{className:N.csx("proton-TextEmphasis",n&&"proton-TextEmphasis--tooltip",l),children:g.jsx("a",{"data-testid":r,href:t,target:i?"_blank":void 0,rel:i?"noopener noreferrer":void 0,onClick:i?void 0:s=>N.handleInternalNavigation(s,t),children:o})})}return g.jsx("span",{className:N.csx("proton-TextEmphasis",n&&"proton-TextEmphasis--tooltip",l),"data-testid":r,children:o})},Ch=({width:t="100%",height:e="1.5rem",borderRadius:n="4px"})=>{const{theme:r,palette:l}=ve(),o={"--tombstone-custom-background":l.PRIMARY.PRIMARY_MEDIUM,"--tombstone-custom-primary":N.transparentize(l.PRIMARY.PRIMARY_DARK,.9),"--tombstone-custom-secondary":N.transparentize(l.SECONDARY.SECONDARY_DARK,.7)};return g.jsx("div",{className:`tombstone ${r}`,style:{...o,width:t,height:e,borderRadius:n}})};function Sh({amplitude:t,isDisabled:e,isPlayed:n,isHovered:r,isVisible:l,hasAnimated:o,resolution:i,spacing:s,index:a}){const c=l?`${Math.max(t*100,4)}%`:"0%";return g.jsxs("div",{className:N.csx("proton-Waveform__bar-wrapper"),style:{width:`${i}px`,marginRight:`${s}px`},children:[g.jsx("div",{className:N.csx("proton-Waveform__bar","proton-Waveform__bar--upper",e&&"proton-Waveform__bar--disabled",n&&"proton-Waveform__bar--played",l&&"proton-Waveform__bar--visible",o&&"proton-Waveform__bar--animated"),style:{"--target-height":`calc(${c} / 2)`,"--index":a}}),g.jsx("div",{className:N.csx("proton-Waveform__bar","proton-Waveform__bar--lower",e&&"proton-Waveform__bar--disabled",n&&"proton-Waveform__bar--played",l&&"proton-Waveform__bar--visible",o&&"proton-Waveform__bar--animated"),style:{"--target-height":`calc(${c} / 2)`,"--index":a}}),r&&!e&&!n&&g.jsx("div",{className:"proton-Waveform__bar--hover",style:{"--hover-height":c}})]})}const Ph=kh(100);function Dh({data:t,resolution:e=2,startDuration:n,endDuration:r,currentTime:l=0,showTimestamps:o=!1,totalDuration:i,disabled:s,disabledMessage:a,onClick:c,"data-testid":d}){var P;const{className:f}=ve(),p=u.useRef(null),[v,b]=u.useState([]),[y,$]=u.useState(null),[D,E]=u.useState(!1),[x,B]=u.useState(!1),S=t||Ph,w=e;u.useEffect(()=>{if(!p.current)return;const M=K=>{const Z=Math.floor(K/(e+w)),le=Ah(S,Z);b(le)},T=p.current.clientWidth;M(T);const j=new ResizeObserver(K=>{K&&K[0]&&M(K[0].contentRect.width)});return j.observe(p.current),()=>j.disconnect()},[S,e,w]),u.useEffect(()=>{const M=setTimeout(()=>E(!0),50),T=setTimeout(()=>B(!0),500);return()=>{clearTimeout(M),clearTimeout(T)}},[]);const I=M=>{if(!p.current)return;const T=p.current.getBoundingClientRect(),K=(M.clientX-T.left)/T.width*i;$(K)},h=()=>{$(null)},A=e+w,C=(M,T)=>{var Z;const j=M/i*100;return(T==="start"?Math.floor(j/100*v.length):Math.ceil(j/100*v.length))*A/((Z=p.current)==null?void 0:Z.clientWidth)*100},k=(P=p.current)==null?void 0:P.clientWidth,F=u.useMemo(()=>s&&a?a:t?null:"Waveform Unavailable",[s,a,t]);return g.jsxs("div",{className:N.csx("proton-Waveform",f),"data-testid":d,children:[o&&g.jsx(eo,{direction:"left",seconds:l}),g.jsxs("div",{ref:p,className:"proton-Waveform__container",onMouseMove:I,onMouseLeave:h,onClick:M=>{if(!p.current||s)return;const T=p.current.getBoundingClientRect(),K=(M.clientX-T.left)/T.width*i;c==null||c(K,M)},"data-disabled":s,"data-testid":"waveform-container",children:[n!==void 0&&r!==void 0&&g.jsx("div",{className:"proton-Waveform__active-region",style:{left:p.current?`calc(${C(n,"start")}%`:"0%",right:p.current?`calc(${100-C(r,"end")}% - 2px)`:"0%"}}),y!==null&&g.jsx("div",{className:"proton-Waveform__hover-line",style:{left:`${y/i*100}%`}}),v.map((M,T)=>{const j=T/v.length*i,K=n!==void 0&&r!==void 0&&(j<n||j>r),Z=l===0?!1:j<=l,le=y!==null&&j<=y;return g.jsx(Sh,{amplitude:M,isDisabled:s||K,isPlayed:Z,isHovered:le,isVisible:D,hasAnimated:x,resolution:e,spacing:w,index:T},T)})]}),F&&g.jsx("div",{className:"proton-Waveform__bar-unavailable",style:{fontSize:k<325?"0.85rem":"1rem"},children:F}),o&&g.jsx(eo,{direction:"right",seconds:i})]})}function eo({direction:t,seconds:e}){return g.jsx("div",{className:N.csx("proton-Waveform__timestamp",`proton-Waveform__timestamp--${t}`),children:wh(e)})}function wh(t){const e=Math.floor(t/60),n=Math.floor(t%60);return`${e}:${n<10?"0":""}${n.toFixed(0)}`}function Ah(t,e){const n=t.length,r=n/e,l=new Array(e).fill(0).map((o,i)=>{const s=i*r,a=Math.floor(s),c=Math.min(a+1,n-1),d=s-a;return t[a]*(1-d)+t[c]*d});return Th(l)}function Th(t){const e=Math.min(...t),n=Math.max(...t);return t.map(r=>{const l=(r-e)/(n-e);return Math.max(l*.8+.1,.1)})}function kh(t){return Array.from({length:t},(e,n)=>{const l=n/(t-1)*6*2*Math.PI-Math.PI/2;return Math.sin(l)*.5+.5})}const qu=({children:t})=>g.jsx("h2",{className:"proton-Modal__title",children:t}),Xu=({children:t})=>g.jsx("h3",{className:"proton-Modal__subtitle",children:t}),Zu=({children:t})=>g.jsx("div",{className:"proton-Modal__body",children:t}),Bh=t=>g.jsx("div",{className:"proton-Modal__action",children:g.jsx(Pn,{...t})}),Rh=({children:t})=>g.jsx(Vt,{autoFocus:!0,children:g.jsx("div",{className:"proton-Modal__actions",children:t})}),Kh=({title:t,subtitle:e,body:n,onClose:r,children:l,isClosing:o,"data-testid":i})=>{const s=u.useRef(null),a=Ut({isOpen:!0,onOpenChange:r}),{modalProps:c}=kf({isDismissable:!1},a,s),{dialogProps:d}=bs({role:"dialog"},s);_r();const f=u.useRef(null),{buttonProps:p}=Wt({onPress:r,"aria-label":"Close"},f);return g.jsx(Vt,{contain:!0,restoreFocus:!0,autoFocus:!0,children:g.jsxs("div",{"data-testid":i,className:N.csx("proton-Modal",o&&"proton-Modal--closing"),...z(c,d),ref:s,children:[g.jsx("button",{name:"Close",className:"proton-Modal__close-button",...p,ref:f,children:"×"}),t&&g.jsx(qu,{children:t}),e&&g.jsx(Xu,{children:e}),n&&g.jsx(Zu,{children:n}),g.jsx("div",{className:"proton-Modal__content",children:l})]})})},Mh=({isOpen:t,onClose:e,title:n,subtitle:r,body:l,children:o,isOverlay:i=!0,"data-testid":s})=>{const a=u.useRef(null),{isClosing:c,handleClose:d}=$t.useIsClosing({onClose:e,overlayRef:a}),f=$t.useBreakpoint(Ee.BREAKPOINTS.MEDIUM);if(!t)return null;const p=g.jsx(Kh,{isOpen:t,title:n,subtitle:r,body:l,onClose:d,isClosing:c,"data-testid":s,children:o});return i||f?g.jsx(Dn,{fadeIn:!0,ref:a,onClose:d,children:p}):p},_h=Object.assign(Mh,{Title:qu,Subtitle:Xu,Body:Zu,Action:Bh,Actions:Rh});exports.ActionMenu=Wr;exports.Badge=Wp;exports.BadgeVariants=Hp;exports.Banner=Le;exports.Button=Pn;exports.ButtonGroup=Ru;exports.Cell=bh;exports.Column=mh;exports.CopyInput=sv;exports.Dialog=Qp;exports.Elevation=uv;exports.Icon=nv;exports.ImageBackground=lv;exports.Input=An;exports.Modal=_h;exports.Popover=Tn;exports.ResponsiveMenuTrigger=oh;exports.ResponsiveSelect=ch;exports.Row=gh;exports.ScreenOverlay=Dn;exports.SearchInput=iv;exports.Section=Ff;exports.Select=ah;exports.Switch=dh;exports.Table=$h;exports.TableBody=yh;exports.TableHeader=Bp;exports.TextEllipsis=xh;exports.TextEmphasis=Eh;exports.ThemeProvider=Tu;exports.Tombstone=Ch;exports.Tooltip=Yu;exports.TooltipTrigger=Gu;exports.Waveform=Dh;exports.usePopoverTrigger=cv;exports.useTheme=ve;
|
|
47
47
|
//# sourceMappingURL=index.cjs.js.map
|