Spaces:
Running
Running
| ;(self.webpackChunk_carbon_ai_chat_examples_web_components_basic=self.webpackChunk_carbon_ai_chat_examples_web_components_basic||[]).push([[3122],{1020:function(e,n,t){t.d(n,{C:function(){return r},d:function(){return l}});var a=t(23108),i=t.n(a);const l=i().oneOf(["default","inline"]),r=i().oneOf(["sm","md","lg"])},2226:function(e,n,t){t.d(n,{D:function(){return c},w:function(){return s}});var a=t(22078),i=t(23108),l=t.n(i),r=t(7378);const o=r.createContext(1),s=r.forwardRef(function({as:e="section",level:n,...t},i){const l=r.useContext(o),s=n??l+1,c=e;return r.createElement(o.Provider,{value:Math.min(s,6)},r.createElement(c,(0,a._P)({ref:i},t)))});s.propTypes={as:l().elementType,children:l().node,className:l().string,level:l().number};const c=r.forwardRef((e,n)=>{const t=`h${r.useContext(o)}`;return r.createElement(t,(0,a._P)({ref:n},e))});c.propTypes={children:l().node,className:l().string}},2388:function(e,n,t){t(22078);var a=t(23108),i=t.n(a);t(7378),t(3698),t(12669),t(21570),t(40948);i().node,i().string},10265:function(e,n,t){t.d(n,{a:function(){return a},x:function(){return i}});function a(e,n){switch(n.type){case"enableIcons":return{...e,hasIcons:!0};case"enableSelectableItems":return{...e,hasSelectableItems:!0};case"registerItem":{const t=n.payload,a=e.items.filter(e=>e.ref.current),i=t.ref.current?.nextElementSibling,l=a.findIndex(e=>e.ref.current===i);return a.splice(l<0?a.length:l,0,t),{...e,items:a}}}}const i=(0,t(7378).createContext)({state:{isRoot:!0,hasIcons:!1,hasSelectableItems:!1,size:null,items:[],requestCloseRoot:()=>{}},dispatch:e=>{}})},15051:function(e,n,t){t.d(n,{I:function(){return y}});var a=t(22078),i=t(7378),l=t(23108),r=t.n(l),o=t(3698),s=t.n(o),c=t(14053),d=t(1182),u=(t(56117),t(16932)),m=(t(70327),t(75466)),f=t(52216),p=t(12669),b=t(71060),g=t(19033),h=t(88512);const y=(0,i.forwardRef)(({children:e,className:n,disabled:t,kind:l="primary",label:r,size:o="lg",menuAlignment:y="bottom",tabIndex:v=0,menuTarget:x,...$},_)=>{const E=(0,g.u)("enable-v12-dynamic-floating-styles"),N=(0,f.Bi)("MenuButton"),w=(0,p.M)(),C=(0,i.useRef)(null);let O=[];E||(O=[(0,b.UU)({crossAxis:!1})]),"bottom"!==y&&"top"!==y||O.push((0,b.Ej)({apply({rects:e,elements:n}){Object.assign(n.floating.style,{width:`${e.reference.width}px`})}}));const{refs:k,floatingStyles:I,placement:R,middlewareData:T}=(0,b.we)({placement:y,strategy:"fixed",transform:!1,middleware:O,whileElementsMounted:b.ll}),M=(0,h.A)(_,C),{open:S,handleClick:A,handleMousedown:P,handleClose:z}=(0,m.F)(C);(0,i.useLayoutEffect)(()=>{Object.keys(I).forEach(e=>{if(k.floating.current){let n=I[e];["top","right","bottom","left"].includes(e)&&Number(n)&&(n+="px"),k.floating.current.style[e]=n}})},[I,k.floating,T,R,S]);const D=s()(`${w}--menu-button__container`,n),q=s()(`${w}--menu-button__trigger`,{[`${w}--menu-button__trigger--open`]:S}),B=s()(`${w}--menu-button__${y}`);return i.createElement("div",(0,a._P)({},$,{ref:M,"aria-owns":S?N:void 0,className:D}),i.createElement(d.Ay,{ref:k.setReference,className:q,size:o,tabIndex:v,kind:l,renderIcon:c.yQN,disabled:t,"aria-haspopup":!0,"aria-expanded":S,onClick:function(){C.current&&A()},onMouseDown:P,"aria-controls":S?N:void 0},r),i.createElement(u.W,{containerRef:C,menuAlignment:y,className:B,ref:k.setFloating,id:N,legacyAutoalign:!1,label:r,size:o,open:S,onClose:z,target:x},e))});y.propTypes={children:r().node.isRequired,className:r().string,disabled:r().bool,kind:r().oneOf(["primary","tertiary","ghost"]),label:r().string.isRequired,menuAlignment:r().oneOf(["top","top-start","top-end","bottom","bottom-start","bottom-end"]),size:r().oneOf(["sm","md","lg"]),tabIndex:r().number,menuTarget:r().instanceOf("undefined"!=typeof Element?Element:Object)}},16932:function(e,n,t){t.d(n,{W:function(){return y}});var a=t(22078),i=t(3698),l=t.n(i),r=t(23108),o=t.n(r),s=t(7378),c=t(44059),d=t(68344),u=t(22595),m=t(47819),f=t(12669),p=t(46317),b=t(10265),g=(t(20972),t(65141)),h=t(75551);const y=(0,s.forwardRef)(function({children:e,className:n,containerRef:t,label:i,menuAlignment:r,onClose:o,onOpen:p,open:y,size:v="sm",legacyAutoalign:x="true",target:$=h.S&&document.body,x:_=0,y:E=0,...N},w){const C=(0,f.M)(),O=(0,s.useRef)(null),k=(0,s.useContext)(b.x),I=k.state.isRoot,R=I?v:k.state.size,[T,M]=(0,s.useReducer)(b.a,{...k.state,isRoot:!1,size:v,requestCloseRoot:I?K:k.state.requestCloseRoot}),S=(0,s.useMemo)(()=>({state:T,dispatch:M}),[T,M]),A=(0,s.useRef)(null),P=(0,m.a)([w,A]),[z,D]=(0,s.useState)([-1,-1]),q=S.state.items.filter(e=>!e.disabled&&e.ref.current);let B;if(t?.current){const{width:e}=t.current.getBoundingClientRect();B=e}const{direction:j}=(0,g.D)();function W(){if(A.current){if(O.current=document.activeElement,x){const e=function(){const e={x:U(_),y:U(E)};if(!e.x||!e.y)return[-1,-1];return[L(e.x,"x")??-1,L(e.y,"y")??-1]}();"rtl"!==document?.dir&&"rtl"!==j||N?.id?.includes("MenuButton")?(A.current.style.insetInlineStart=`${e[0]}px`,A.current.style.insetInlineEnd="initial"):(A.current.style.insetInlineStart="initial",A.current.style.insetInlineEnd=`${e[0]}px`),A.current.style.insetBlockStart=`${e[1]}px`,D(e)}A.current.focus(),p&&p()}}function K(){O.current&&O.current.focus(),o&&o()}function F(e){const n=q?.filter(e=>e?.ref?.current);if(!n?.length)return;const t=q.findIndex(e=>e.ref?.current?.contains(document.activeElement));let a=t;if(-1===t?a=0:e&&((0,u.Y)(e,d.Do)&&(a-=1),(0,u.Y)(e,d.yd)&&(a+=1)),a<0&&(a=n.length-1),a>=n.length&&(a=0),a!==t){const t=n[a];t?.ref?.current?.focus(),e?.preventDefault()}}function L(e,n){if(!A.current)return;const{width:t,height:a}=A.current.getBoundingClientRect(),i=I?"vertical":"horizontal",l={x:{max:window.innerWidth,size:t,anchor:"horizontal"===i?e[1]:e[0],reversedAnchor:"horizontal"===i?e[0]:e[1],offset:0},y:{max:window.innerHeight,size:a,anchor:"horizontal"===i?e[0]:e[1],reversedAnchor:"horizontal"===i?e[1]:e[0],offset:I?0:4}};if(B&&B<l.x.size&&("bottom"===r||"top"===r)&&(l.x.size=B),B&&("bottom-end"===r||"top-end"===r)&&l.x.anchor>=87&&B<l.x.size){const e=l.x.anchor+l.x.reversedAnchor;l.x.anchor=l.x.anchor+e}const{max:o,size:s,anchor:c,reversedAnchor:d,offset:u}=l[n],m=[o-8-s-c>=0&&c-u,d-s>=0&&d-s+u,o-8-s],f="top"===r||"top-end"===r||"top-start"===r;"number"==typeof m[0]&&f&&m[0]>=0&&!m[1]&&"y"===n?A.current.style.transform="translate(0)":f&&!m[0]&&"y"===n&&(m[0]=c-u);const p=m.find(e=>!1!==e);return p>=8?p:8}function Y(e){return null!=e}function U(e){if(Array.isArray(e)){const n=e.filter(Y);return 2===n.length?n:void 0}return[e,e]}(0,s.useEffect)(()=>{if(y){const e=requestAnimationFrame(()=>{q.length>0&&F()});return()=>cancelAnimationFrame(e)}},[y,q]),(0,s.useEffect)(()=>{y?W():D([-1,-1])},[y]);const Q=l()(n,`${C}--menu`,`${C}--menu--${R}`,{[`${C}--menu--box-shadow-top`]:r&&"top"===r.slice(0,3),[`${C}--menu--open`]:y,[`${C}--menu--shown`]:y&&!x||z[0]>=0&&z[1]>=0,[`${C}--menu--with-icons`]:S.state.hasIcons,[`${C}--menu--with-selectable-items`]:S.state.hasSelectableItems,[`${C}--autoalign`]:!x}),V=s.createElement(b.x.Provider,{value:S},s.createElement("ul",(0,a._P)({},N,{className:Q,role:"menu",ref:P,"aria-label":i,tabIndex:-1,onKeyDown:function(e){e.stopPropagation(),((0,u.Y)(e,d.uf)||!I&&(0,u.Y)(e,d.nk))&&o?K():F(e)},onBlur:function(e){y&&o&&I&&!A.current?.contains(e.relatedTarget)&&K()}}),e));return $&&I?y&&(0,c.createPortal)(V,$)||null:V});y.propTypes={children:o().node,className:o().string,label:o().string,menuAlignment:o().string,mode:(0,p.C)(o().oneOf(["full","basic"]),"Menus now always support both icons as well as selectable items and nesting."),onClose:o().func,onOpen:o().func,open:o().bool,size:o().oneOf(["xs","sm","md","lg"]),target:o().object,x:o().oneOfType([o().number,o().arrayOf(o().number)]),y:o().oneOfType([o().number,o().arrayOf(o().number)])}},18895:function(e,n,t){t.d(n,{Ay:function(){return T}});var a=t(1020),i=t(22078),l=t(3698),r=t.n(l),o=t(7378),s=t(23108),c=t.n(s),d=t(46317),u=t(12669),m=(t(5632),t(98039));const f=e=>{27===e.keyCode&&e.stopPropagation()},p=e=>{e.preventDefault(),e.stopPropagation()},b=(0,o.forwardRef)((e,n)=>{const{children:t,className:a,disabled:l=!1,type:s="default",size:c,invalid:d,invalidText:b,invalidTextId:g,warn:h,warnText:y,warnTextId:v,light:x,isOpen:$,..._}=e,E=(0,u.M)(),{isFluid:N}=(0,o.useContext)(m.c),w=!d&&h,C=r()({...a&&{[a]:!0},[`${E}--list-box`]:!0,[`${E}--list-box--${c}`]:c,[`${E}--list-box--inline`]:"inline"===s,[`${E}--list-box--disabled`]:l,[`${E}--list-box--light`]:x,[`${E}--list-box--expanded`]:$,[`${E}--list-box--invalid`]:d,[`${E}--list-box--warning`]:w});return o.createElement(o.Fragment,null,o.createElement("div",(0,i._P)({},_,{className:C,ref:n,onKeyDown:f,onClick:p,"data-invalid":d||void 0}),t),N&&o.createElement("hr",{className:`${E}--list-box__divider`}),d?o.createElement("div",{className:`${E}--form-requirement`,id:g},b):null,w?o.createElement("div",{className:`${E}--form-requirement`,id:v},y):null)});function g({children:e,disabled:n,tabIndex:t,...a}){const l=(0,u.M)();return o.createElement("div",(0,i._P)({className:`${l}--list-box__field`,tabIndex:!n&&t||-1},a),e)}b.displayName="ListBox",b.propTypes={children:c().node,className:c().string,disabled:c().bool,invalid:c().bool,invalidText:c().node,invalidTextId:c().string,isOpen:c().bool,light:(0,d.C)(c().bool,"The `light` prop for `ListBox` has been deprecated in favor of the new `Layer` component. It will be removed in the next major release."),size:a.C,type:a.d,warn:c().bool,warnText:c().string,warnTextId:c().string},g.propTypes={"aria-haspopup":c().oneOfType([c().string,c().bool]),children:c().node,disabled:c().bool,role:c().string,tabIndex:c().oneOfType([c().number,c().string])};var h=t(47819);const y=(0,o.forwardRef)(({children:e,isActive:n=!1,isHighlighted:t=!1,title:a,...l},s)=>{const c=(0,u.M)(),d=s&&"function"!=typeof s?s.menuItemOptionRef:void 0,{isTruncated:m,ref:f}=((e,n=[])=>{const t=(0,o.useRef)(null),a=(0,h.a)([...e?[e]:[],t]),[i,l]=(0,o.useState)(!1);return(0,o.useEffect)(()=>{const e=t.current;if(e){const{offsetWidth:n,scrollWidth:t}=e;l(n<t)}},[t,...n]),{isTruncated:i,ref:a}})(d,[e]),p=r()(`${c}--list-box__menu-item`,{[`${c}--list-box__menu-item--active`]:n,[`${c}--list-box__menu-item--highlighted`]:t});return o.createElement("li",(0,i._P)({},l,{className:p,title:m?a:void 0}),o.createElement("div",{className:`${c}--list-box__menu-item__option`,ref:f},e))});y.displayName="ListBoxMenuItem",y.propTypes={children:c().node,disabled:c().bool,isActive:c().bool,isHighlighted:c().bool,title:c().string};const v=(0,o.forwardRef)(({children:e,id:n,...t},a)=>{const l=(0,u.M)();return o.createElement("ul",(0,i._P)({ref:a,id:n,className:`${l}--list-box__menu`,role:"listbox"},t),e)});v.displayName="ListBoxMenu",v.propTypes={children:c().oneOfType([c().node,c().arrayOf(c().oneOf([y])),c().shape({type:c().oneOf([y])}),c().bool]),id:c().string.isRequired};var x=t(14053);const $={"close.menu":"Close menu","open.menu":"Open menu"},_=e=>$[e],E=({isOpen:e,translateWithId:n=_})=>{const t=(0,u.M)(),a=r()(`${t}--list-box__menu-icon`,{[`${t}--list-box__menu-icon--open`]:e}),i=n(e?"close.menu":"open.menu");return o.createElement("div",{className:a},o.createElement(x.yQN,{name:"chevron--down","aria-label":i},o.createElement("title",null,i)))};var N,w;E.propTypes={isOpen:c().bool.isRequired,translateWithId:c().func};const C="clear.all",O="clear.selection",k={[C]:"Clear all selected items",[O]:"Clear selected item"},I=e=>k[e],R=({clearSelection:e,selectionCount:n,translateWithId:t=I,disabled:a,onClearSelection:i,readOnly:l})=>{const s=(0,u.M)(),c=r()(`${s}--list-box__selection`,{[`${s}--tag--filter`]:n,[`${s}--list-box__selection--multi`]:n}),d=n=>{n.stopPropagation(),a||l||(e(n),i&&i(n))},m=t(n?"clear.all":"clear.selection"),f=r()(`${s}--tag`,`${s}--tag--filter`,`${s}--tag--high-contrast`,{[`${s}--tag--disabled`]:a});return n?o.createElement("div",{className:f},o.createElement("span",{className:`${s}--tag__label`,title:`${n}`},n),o.createElement("div",{role:"button",tabIndex:-1,className:`${s}--tag__close-icon`,onClick:d,"aria-label":t("clear.all"),title:m,"aria-disabled":!!l||void 0},N||(N=o.createElement(x.bm,null)))):o.createElement("div",{role:"button",className:c,tabIndex:-1,onClick:d,"aria-label":m,title:m},n,w||(w=o.createElement(x.bm,null)))};R.propTypes={clearSelection:c().func.isRequired,disabled:c().bool,onClearSelection:c().func,readOnly:c().bool,selectionCount:c().number,translateWithId:c().func};const T=Object.assign(b,{Field:g,Menu:v,MenuIcon:E,MenuItem:y,Selection:R})},19842:function(e,n,t){t.d(n,{K:function(){return m}});var a=t(22078),i=t(3698),l=t.n(i),r=t(23108),o=t.n(r),s=t(7378),c=t(12669);const d=["xs","sm","md","lg","xl","2xl"],u=["condensed","normal"];s.forwardRef(({as:e="div",children:n,className:t,density:i,size:r,...o},m)=>{const f=(0,c.M)(),p=l()(t,`${f}--layout`,{[`${f}--layout--size-${r}`]:r&&d.includes(r),[`${f}--layout--density-${i}`]:i&&u.includes(i)});return s.createElement(e,(0,a._P)({},o,{ref:m,className:p}),n)}).propTypes={as:o().oneOfType([o().func,o().string,o().elementType]),children:o().node,className:o().string,density:o().oneOf(u),size:o().oneOf(d)};const m=s.forwardRef(({as:e="div",children:n,className:t,density:i,size:r,...o},d)=>{const u=(0,c.M)(),m=l()(t,Object.entries({size:r,density:i}).map(([e,n])=>({[`${u}--layout-constraint--${e}__default-${n?.default}`]:n?.default,[`${u}--layout-constraint--${e}__min-${n?.min}`]:n?.min,[`${u}--layout-constraint--${e}__max-${n?.max}`]:n?.max})));return s.createElement(e,(0,a._P)({},o,{ref:d,className:m}),n)});m.propTypes={as:o().oneOfType([o().func,o().string,o().elementType]),children:o().node,className:o().string,density:o().shape({min:o().oneOf(u),default:o().oneOf(u),max:o().oneOf(u)}),size:o().shape({min:o().oneOf(d),default:o().oneOf(d),max:o().oneOf(d)})}},20972:function(e,n,t){t(22078);var a=t(23108),i=t.n(a);t(7378),t(92257);i().oneOfType([i().func,i().string,i().elementType]),i().node,i().oneOf(["ltr","rtl"]).isRequired},21784:function(e,n,t){t.d(n,{A:function(){return u}});var a=t(22078),i=t(3698),l=t.n(i),r=t(23108),o=t.n(r),s=t(7378),c=t(12669),d=t(46317);function u({active:e=!0,className:n,withOverlay:t=!0,small:i=!1,description:r="loading",...o}){const d=(0,c.M)(),u=l()(n,{[`${d}--loading`]:!0,[`${d}--loading--small`]:i,[`${d}--loading--stop`]:!e}),m=l()({[`${d}--loading-overlay`]:!0,[`${d}--loading-overlay--stop`]:!e}),f=s.createElement("div",(0,a._P)({},o,{"aria-atomic":"true","aria-live":e?"assertive":"off",className:u}),s.createElement("svg",{className:`${d}--loading__svg`,viewBox:"0 0 100 100"},s.createElement("title",null,r),i?s.createElement("circle",{className:`${d}--loading__background`,cx:"50%",cy:"50%",r:"42"}):null,s.createElement("circle",{className:`${d}--loading__stroke`,cx:"50%",cy:"50%",r:i?"42":"44"})));return t?s.createElement("div",{className:m},f):f}u.propTypes={active:o().bool,className:o().string,description:o().string,id:(0,d.C)(o().string,"\nThe prop `id` is no longer needed."),small:o().bool,withOverlay:o().bool}},30102:function(e,n,t){t.d(n,{A:function(){return c}});var a=t(23108),i=t.n(a),l=t(7378),r=t(46317),o=t(12669),s=t(47819);const c=l.forwardRef((e,n)=>{const{"aria-label":t,ariaLabel:a,checked:i=!1,disabled:r,id:c,indeterminate:d,name:u,onChange:m=()=>{},onClick:f,onKeyDown:p,title:b}=e,g=(0,o.M)(),h=(0,l.useRef)(null),y=(0,s.a)([h,n]),v={checked:i,className:`${g}--checkbox`,disabled:r,id:c,name:u,onClick:f?function(e){d&&(e.target.checked=!1);f?.(e)}:f,onChange:e=>{m(e.target.checked,c,e)},onKeyDown:p,ref:y,type:"checkbox"};return d&&(v.checked=!1),(0,l.useEffect)(()=>{h?.current&&(h.current.indeterminate=d||!1)},[d]),l.createElement("div",{className:`${g}--checkbox--inline`},l.createElement("input",v),l.createElement("label",{htmlFor:c,className:`${g}--checkbox-label`,title:b,onClick:e=>{e.stopPropagation()}},l.createElement("span",{className:`${g}--visually-hidden`},a||t)))});c.propTypes={"aria-label":i().string.isRequired,ariaLabel:(0,r.C)(i().string.isRequired,"The `ariaLabel` prop has been deprecated in favor of `aria-label`. This prop will be removed in the next major release."),checked:i().bool,disabled:i().bool,id:i().string.isRequired,indeterminate:i().bool,name:i().string.isRequired,onChange:i().func,onClick:i().func,onKeyDown:i().func,title:i().string}},40526:function(e,n,t){var a=t(23108),i=t.n(a),l=t(7378),r=t(3698),o=t.n(r),s=t(12669),c=t(14053);const d={failed:c.xai,"caution-major":c.n2,"caution-minor":c.ORV,undefined:c.Xuf,succeeded:c._jO,normal:c.cRJ,"in-progress":c.T5t,incomplete:c.ndn,"not-started":c.Vg2,pending:c.GUC,unknown:c.Bgr,informative:c.eI$};l.forwardRef(({className:e,kind:n,label:t,size:a=16,...i},r)=>{const c=(0,s.M)(),u=o()(`${c}--icon-indicator`,e,{[`${c}--icon-indicator--20`]:20==a}),m=d[n];return m?l.createElement("div",{className:u,ref:r},l.createElement(m,{size:a,className:`${c}--icon-indicator--${n}`}),t):null}).propTypes={className:i().string,kind:i().oneOf(["failed","caution-major","caution-minor","undefined","succeeded","normal","in-progress","incomplete","not-started","pending","unknown","informative"]).isRequired,label:i().string.isRequired,size:i().oneOf([16,20])}},40882:function(e,n,t){t.d(n,{A:function(){return d}});var a=t(22078),i=t(3698),l=t.n(i),r=t(23108),o=t.n(r),s=t(7378),c=t(12669);const d=s.forwardRef(({as:e,children:n,className:t,href:i,disabled:r=!1,inline:o=!1,visited:d=!1,renderIcon:u,size:m,target:f,...p},b)=>{const g=(0,c.M)(),h={className:l()(`${g}--link`,t,{[`${g}--link--disabled`]:r,[`${g}--link--inline`]:o,[`${g}--link--visited`]:d,[`${g}--link--${m}`]:m}),rel:"_blank"===f?"noopener":void 0,target:f};r?(h.role="link",h["aria-disabled"]=!0):h.href=i;const y=e??"a";return s.createElement(y,(0,a._P)({ref:b},h,p,{onClick:e=>{r?(e.preventDefault(),e.stopPropagation()):p.onClick&&p.onClick(e)}}),n,!o&&u&&s.createElement("div",{className:`${g}--link__icon`},s.createElement(u,null)))});d.displayName="Link",d.propTypes={as:o().elementType,children:o().node,className:o().string,disabled:o().bool,href:o().string,inline:o().bool,renderIcon:o().oneOfType([o().func,o().object]),size:o().oneOf(["sm","md","lg"]),visited:o().bool}},41141:function(e,n,t){t.d(n,{K:function(){return h},R:function(){return g}});var a=t(22078),i=t(23108),l=t.n(i),r=t(7378),o=t(3698),s=t.n(o),c=(t(89599),t(7980)),d=t(52216),u=t(12669),m=t(93463),f=t(35068),p=t(72728),b=t(10182);const g=["primary","secondary","ghost","tertiary"],h=r.forwardRef(({align:e,autoAlign:n=!1,badgeCount:t,children:i,className:l,closeOnActivation:o=!0,defaultOpen:f=!1,disabled:b,dropShadow:g=!1,enterDelayMs:h=100,highContrast:y=!0,kind:v,label:x,leaveDelayMs:$=100,wrapperClasses:_,size:E,isSelected:N,...w},C)=>{const O=(0,u.M)(),k=s()(_,`${O}--icon-tooltip`,{[`${O}--icon-tooltip--disabled`]:b}),I=(0,d.Bi)("badge-indicator");return r.createElement(c.m,{align:e,autoAlign:n,closeOnActivation:o,className:k,defaultOpen:f,dropShadow:g,enterDelayMs:h,highContrast:y,label:x,leaveDelayMs:$},r.createElement(m.A,(0,a._P)({},w,{disabled:b,kind:v,ref:C,size:E,isSelected:N,hasIconOnly:!0,className:l,"aria-describedby":w["aria-describedby"]||t&&I}),i,!b&&void 0!==t&&r.createElement(p.T,{id:I,count:t>0?t:void 0})))});h.propTypes={align:(0,f.A)(l().oneOf(["top","top-left","top-right","bottom","bottom-left","bottom-right","left","left-bottom","left-top","right","right-bottom","right-top","top-start","top-end","bottom-start","bottom-end","left-end","left-start","right-end","right-start"]),["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"],b.F),autoAlign:l().bool,badgeCount:l().number,href:l().string,children:l().node,className:l().string,closeOnActivation:l().bool,defaultOpen:l().bool,dropShadow:l().bool,disabled:l().bool,enterDelayMs:l().number,isSelected:l().bool,highContrast:l().bool,kind:l().oneOf(g),label:l().node.isRequired,leaveDelayMs:l().number,rel:l().string,size:l().oneOf(["sm","md","lg"]),target:l().string,wrapperClasses:l().string}},44709:function(e,n,t){t.d(n,{l:function(){return a}});const a=t(7378).createContext(1)},52898:function(e,n,t){t.d(n,{A:function(){return b}});var a,i,l=t(22078),r=t(3698),o=t.n(r),s=t(7378),c=t(23108),d=t.n(c),u=t(14053),m=t(12669);const f={"clear.all":"Clear all selected items","clear.selection":"Clear selected item"};function p(e){return f[e]}function b({clearSelection:e,selectionCount:n,translateWithId:t=p,disabled:r,readOnly:c,onClearSelection:d,...f}){const b=(0,m.M)(),g=o()(`${b}--list-box__selection`,{[`${b}--tag--filter`]:n,[`${b}--list-box__selection--multi`]:n}),h=t(n?"clear.all":"clear.selection"),y=o()(`${b}--tag`,`${b}--tag--filter`,`${b}--tag--high-contrast`,{[`${b}--tag--disabled`]:r});function v(n){n.stopPropagation(),r||c||(e(n),d&&d(n))}return n?s.createElement("div",{className:y},s.createElement("span",{className:`${b}--tag__label`,title:n?.toString()},n),s.createElement("button",{"aria-label":h,className:`${b}--tag__close-icon`,disabled:r||c,onClick:v,tabIndex:-1,title:h,type:"button","aria-disabled":!!c||void 0},a||(a=s.createElement(u.bm,null)))):s.createElement("button",(0,l._P)({},f,{"aria-label":h,className:g,disabled:r||c,onClick:v,tabIndex:-1,title:h,type:"button","aria-disabled":!!c||void 0}),i||(i=s.createElement(u.bm,null)))}b.propTypes={clearSelection:d().func.isRequired,disabled:d().bool,readOnly:d().bool,onClearSelection:d().func,onClick:d().func,onMouseUp:d().func,onKeyDown:d().func,selectionCount:d().number,translateWithId:d().func}},65141:function(e,n,t){t.d(n,{D:function(){return l}});var a=t(7378),i=t(92257);function l(){return(0,a.useContext)(i.$)}},70327:function(e,n,t){t.d(n,{Dr:function(){return E}});var a,i,l,r=t(22078),o=t(3698),s=t.n(o),c=t(23108),d=t.n(c),u=t(7378),m=t(71060),f=t(14053),p=t(68344),b=t(22595),g=t(61537),h=t(47819),y=t(12669),v=t(16932),x=t(10265),$=(t(20972),t(65141)),_=(t(21570),t(40948));const E=(0,u.forwardRef)(function({children:e,className:n,disabled:t,kind:o="default",label:c,onClick:d,renderIcon:g,shortcut:E,...N},w){const[C,O]=(0,u.useState)(!1),[k,I]=(0,u.useState)(!1),{refs:R,floatingStyles:T,context:M}=(0,m.we)({open:C,onOpenChange:O,placement:k?"left-start":"right-start",whileElementsMounted:m.ll,middleware:[(0,m.cY)({mainAxis:-6,crossAxis:-6})],strategy:"fixed"}),{getReferenceProps:S,getFloatingProps:A}=(0,m.bv)([(0,m.Mk)(M,{delay:100,enabled:!0,handleClose:(0,m.iB)({requireIntent:!1})})]),P=(0,y.M)(),z=(0,u.useContext)(x.x),D=(0,u.useRef)(null),q=(0,h.a)([w,D,R.setReference]),B=Boolean(e),j=t&&!B,W="danger"===o&&!B;function K(){D.current&&O(!0)}function F(e){j||(B?K():(z.state.requestCloseRoot(e),d&&d(e)))}const L=(0,u.useRef)(!1),Y=e=>(0,b.Y)(e,p.xy)||(0,b.Y)(e,p.$x);const U=s()(n,`${P}--menu-item`,{[`${P}--menu-item--disabled`]:j,[`${P}--menu-item--danger`]:W});(0,u.useEffect)(()=>{z.dispatch({type:"registerItem",payload:{ref:D,disabled:Boolean(t)}})},[]);const{direction:Q}=(0,$.D)();return(0,u.useEffect)(()=>{"rtl"===document?.dir||"rtl"===Q?I(!0):I(!1)},[Q]),(0,u.useEffect)(()=>{g&&!z.state.hasIcons&&z.dispatch({type:"enableIcons"})},[g,z.state.hasIcons,z]),(0,u.useEffect)(()=>{Object.keys(T).forEach(e=>{R.floating.current&&"position"!==e&&(R.floating.current.style[e]=T[e])})},[T,R.floating]),u.createElement(m.s3,{context:M,order:["reference","floating"],modal:!1},u.createElement("li",(0,r._P)({role:"menuitem"},N,{ref:q,className:U,tabIndex:t?-1:0,"aria-disabled":j??void 0,"aria-haspopup":B??void 0,"aria-expanded":B?C:void 0,onClick:F,onKeyDown:function(e){B&&(0,b.Y)(e,p.Qp)&&(K(),requestAnimationFrame(()=>{R.floating.current?.focus()}),e.stopPropagation(),e.preventDefault()),L.current=Y(e),N.onKeyDown&&N.onKeyDown(e)},onKeyUp:function(e){L.current&&Y(e)&&F(e),L.current=!1}},S()),u.createElement("div",{className:`${P}--menu-item__selection-icon`},N["aria-checked"]&&(a||(a=u.createElement(f.MGO,null)))),u.createElement("div",{className:`${P}--menu-item__icon`},g&&u.createElement(g,null)),u.createElement(_.E,{as:"div",className:`${P}--menu-item__label`,title:c},c),E&&!B&&u.createElement("div",{className:`${P}--menu-item__shortcut`},E),B&&u.createElement(u.Fragment,null,u.createElement("div",{className:`${P}--menu-item__shortcut`},k?i||(i=u.createElement(f.ZK0,null)):l||(l=u.createElement(f.K3R,null))),u.createElement(v.W,(0,r._P)({label:c,open:C,onClose:()=>{O(!1),D.current?.focus()},ref:R.setFloating},A()),e))))});E.propTypes={children:d().node,className:d().string,disabled:d().bool,kind:d().oneOf(["default","danger"]),label:d().string.isRequired,onClick:d().func,renderIcon:d().oneOfType([d().func,d().object]),shortcut:d().string};(0,u.forwardRef)(function({className:e,defaultSelected:n,label:t,onChange:a,selected:i,...l},o){const c=(0,y.M)(),d=(0,u.useContext)(x.x),[m,f]=(0,g.i)({value:i,onChange:a,defaultValue:n??!1});(0,u.useEffect)(()=>{d.state.hasSelectableItems||d.dispatch({type:"enableSelectableItems"})},[d.state.hasSelectableItems,d]);const p=s()(e,`${c}--menu-item-selectable--selected`);return u.createElement(E,(0,r._P)({},l,{ref:o,label:t,className:p,role:"menuitemcheckbox","aria-checked":m,onClick:function(){f(!m)}}))}).propTypes={className:d().string,defaultSelected:d().bool,label:d().string.isRequired,onChange:d().func,selected:d().bool};(0,u.forwardRef)(function({children:e,className:n,label:t,...a},i){const l=(0,y.M)(),o=s()(n,`${l}--menu-item-group`);return u.createElement("li",{className:o,role:"none",ref:i},u.createElement("ul",(0,r._P)({},a,{role:"group","aria-label":t}),e))}).propTypes={children:d().node,className:d().string,label:d().string.isRequired};const N=e=>e.toString();(0,u.forwardRef)(function({className:e,defaultSelectedItem:n,items:t,itemToString:a=N,label:i,onChange:l,selectedItem:o,...c},d){const m=(0,y.M)(),f=(0,u.useContext)(x.x),[p,b]=(0,g.i)({value:o,onChange:l,defaultValue:n??{}});(0,u.useEffect)(()=>{f.state.hasSelectableItems||f.dispatch({type:"enableSelectableItems"})},[f.state.hasSelectableItems,f]);const h=s()(e,`${m}--menu-item-radio-group`);return u.createElement("li",{className:h,role:"none",ref:d},u.createElement("ul",(0,r._P)({},c,{role:"group","aria-label":i}),t.map((e,n)=>u.createElement(E,{key:n,label:a(e),role:"menuitemradio","aria-checked":e===p,onClick:n=>{!function(e){b(e)}(e)}}))))}).propTypes={className:d().string,defaultSelectedItem:d().any,itemToString:d().func,items:d().array,label:d().string.isRequired,onChange:d().func,selectedItem:d().any};(0,u.forwardRef)(function({className:e,...n},t){const a=(0,y.M)(),i=s()(e,`${a}--menu-item-divider`);return u.createElement("li",(0,r._P)({},n,{className:i,role:"separator",ref:t}))}).propTypes={className:d().string}},86100:function(e,n,t){t.d(n,{A:function(){return m}});var a=t(22078),i=t(7378),l=t(23108),r=t.n(l),o=t(3698),s=t.n(o),c=t(14053),d=t(21784),u=t(12669);const m=({className:e,status:n="active",iconDescription:t,description:l,onSuccess:r,successDelay:o=1500,...m})=>{const f=(0,u.M)(),p=s()(`${f}--inline-loading`,e),b=(0,i.useRef)(null);(0,i.useEffect)(()=>("finished"===n&&(b.current=setTimeout(()=>{r&&r()},o)),()=>{b.current&&(clearTimeout(b.current),b.current=null)}),[n,r,o]);const g=l&&i.createElement("div",{className:`${f}--inline-loading__text`},l),h=(()=>{let e=t||n;return"error"===n?i.createElement(c.xai,{className:`${f}--inline-loading--error`},i.createElement("title",null,e)):"finished"===n?i.createElement(c._jO,{className:`${f}--inline-loading__checkmark-container`},i.createElement("title",null,e)):"active"===n?(t||(e="loading"),i.createElement(d.A,{small:!0,description:e,withOverlay:!1,active:"active"===n})):"inactive"===n?(t||(e="not loading"),i.createElement("title",{className:`${f}--inline-loading__inactive-status`},e)):void 0})(),y=h&&i.createElement("div",{className:`${f}--inline-loading__animation`},h);return i.createElement("div",(0,a._P)({className:p},m,{"aria-live":m["aria-live"]??"assertive"}),y,g)};m.propTypes={className:r().string,description:r().node,iconDescription:r().string,onSuccess:r().func,status:r().oneOf(["inactive","active","finished","error"]),successDelay:r().number}},90372:function(e,n,t){t.d(n,{A:function(){return g}});var a,i=t(22078),l=t(3698),r=t.n(l),o=t(7378),s=t(23108),c=t.n(s),d=t(14053),u=t(12669);const m="close.menu",f="open.menu",p={[m]:"Close",[f]:"Open"},b=e=>p[e],g=o.forwardRef(({isOpen:e,translateWithId:n=b,...t},l)=>{const s=(0,u.M)(),c=r()({[`${s}--list-box__menu-icon`]:!0,[`${s}--list-box__menu-icon--open`]:e}),m=n(e?"close.menu":"open.menu");return o.createElement("button",(0,i._P)({},t,{"aria-label":m,title:m,className:c,type:"button",tabIndex:-1,ref:l}),a||(a=o.createElement(d.yQN,null)))});g.propTypes={isOpen:c().bool.isRequired,translateWithId:c().func}},92257:function(e,n,t){t.d(n,{$:function(){return a}});const a=t(7378).createContext({direction:"ltr"})},92963:function(e,n,t){t.d(n,{W:function(){return g}});var a=t(22078),i=t(7378),l=t(23108),r=t.n(l),o=t(3698),s=t.n(o),c=t(12669),d=t(44709);const u=["one","two","three"],m=[0,1,2],f=m[0],p=m[m.length-1];var b=t(64209);const g=i.forwardRef((e,n)=>{const{as:t,className:l,children:r,level:o,withBackground:m=!1,...g}=e,h=i.useContext(d.l),y=o??h,v=(0,c.M)(),x=s()(`${v}--layer-${u[y]}`,{[`${v}--layer__with-background`]:m},l),$=(0,b.q)(y+1,f,p),_=t||"div";return i.createElement(d.l.Provider,{value:$},i.createElement(_,(0,a._P)({ref:n},g,{className:x}),r))});g.displayName="Layer",g.propTypes={as:r().oneOfType([r().func,r().string,r().elementType]),children:r().node,className:r().string,level:r().oneOf([0,1,2]),withBackground:r().bool}},94329:function(e,n,t){var a=t(23108),i=t.n(a);t(7378),t(5924);i().node,i().string},97395:function(e,n,t){t(22078);var a=t(23108),i=t.n(a);t(7378),t(3698),t(12669);i().string}}]); |