@spteck/react-controls-v2 2.4.1 → 2.4.3
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.
|
@@ -4,5 +4,7 @@ export interface IGridProps extends IBaseProps {
|
|
|
4
4
|
styles?: React.CSSProperties;
|
|
5
5
|
gridItemAutoFlow?: "fit" | "fill";
|
|
6
6
|
minItemWidth?: number;
|
|
7
|
+
enableInfiniteScroll?: boolean;
|
|
8
|
+
onScroll?: (event: React.UIEvent<HTMLDivElement>) => void;
|
|
7
9
|
}
|
|
8
10
|
//# sourceMappingURL=IGridProps.d.ts.map
|
|
@@ -2,5 +2,6 @@ import { IGridProps } from './IGridProps';
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
export declare const useGridStyles: (props: IGridProps) => {
|
|
4
4
|
gridStyles: (containerWidth: number, containerHeight: number) => React.CSSProperties;
|
|
5
|
+
scrollbarClassName: string | undefined;
|
|
5
6
|
};
|
|
6
7
|
//# sourceMappingURL=useGridStyles.d.ts.map
|
package/dist/index.cjs
CHANGED
|
@@ -12,7 +12,23 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
|
|
|
12
12
|
font-weight: ${t.fontWeight};
|
|
13
13
|
font-style: ${t.fontStyle};
|
|
14
14
|
font-display: swap;
|
|
15
|
-
}`,o=document.createElement(`style`);o.setAttribute(`data-brand-font`,e.name),o.textContent=a,document.head.appendChild(o),se.add(n)})}function le(e){if(e){if(e.d)return e.d;if(e.BrandFontLibraryUrl||e.SiteUrl)return e}}var ue=new Set([`woff2`,`woff`,`ttf`,`otf`,`eot`]),de={thin:100,hairline:100,extralight:200,ultralight:200,light:300,regular:400,normal:400,medium:500,semibold:600,demibold:600,bold:700,extrabold:800,ultrabold:800,black:900,heavy:900};function fe(e,t){let n=(e?.trim()||t.replace(/\.[^.]+$/,``)).toLowerCase(),r=n.includes(`italic`)||n.includes(`oblique`),i=n.replace(/italic|oblique/gi,``).trim().replace(/[\s_-]+/g,``),a=de[i]??400;if(a===400&&i!==`regular`&&i!==`normal`&&i!==``){for(let[e,t]of Object.entries(de))if(i.includes(e)){a=t;break}}return{fontWeight:a,fontStyle:r?`italic`:`normal`}}var pe=`_SPFontFamilyName`,me=`_SPFontFaces`,he=`_spFontVisible`,ge=[{id:`fluent-base`,name:`'Segoe UI', 'Segoe UI Web (West European)', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', sans-serif`,isDefault:!0,fontFaces:[]},{id:`fluent-monospace`,name:`'Cascadia Code', 'Cascadia Mono', Consolas, 'Courier New', monospace`,isDefault:!1,fontFaces:[]},{id:`fluent-numeric`,name:`'Bahnschrift', 'Segoe UI', 'Segoe UI Web (West European)', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', sans-serif`,isDefault:!1,fontFaces:[]}],_e=(e={})=>{let{siteUrl:n,disabled:r,fonts:i}=e,a=R(),{warn:o,error:s}=z(),[c,l]=(0,t.useState)(i??[]),[u,d]=(0,t.useState)(!r&&!i),[f,p]=(0,t.useState)(),[m,h]=(0,t.useState)(!1),g=(0,t.useRef)(!1),_=(0,t.useCallback)(async()=>{if(r)return;let e=n??a?.pageContext?.web?.absoluteUrl;if(!e){let e=`useBrandCenterFonts: no siteUrl provided and pageContext.web.absoluteUrl is not available.`;o(e),p(e),d(!1);return}d(!0),p(void 0);try{let t=`${e}/_api/SP.BrandCenter/Configuration`,n=async t=>{if(a?.graphClient)return a.graphClient.get(t);let n={Accept:`application/json;odata=nometadata`};a?.authProvider&&(n.Authorization=`Bearer ${await a.authProvider.getAccessToken([`${new URL(e).origin}/.default`])}`);let r=await fetch(t,{credentials:a?.authProvider?void 0:`include`,headers:n});if(!r.ok)throw Error(`SharePoint REST returned ${r.status}: ${t}`);return await r.json()},r=le(await n(t)),i=r?.BrandFontLibraryUrl,s=typeof i==`string`?i:i?.DecodedUrl,c=r?.IsBrandCenterSiteFeatureEnabled===!0||String(r?.IsBrandCenterSiteFeatureEnabled).toLowerCase()===`true`;if(!s||!c){o(`useBrandCenterFonts: Brand Center is not configured for this tenant — using Fluent UI 9 defaults.`),h(!1),l(ge),d(!1);return}let u=r?.SiteUrl,f=typeof u==`string`?u:u?.DecodedUrl??e,p=new URL(f).origin,m=s.startsWith(`http`)?new URL(s).pathname:s,g=await n(`${f}/_api/web/GetList('${encodeURIComponent(m)}')/items?$select=Id,FileLeafRef,FileRef,${pe},${me},${he},File/Name,File/ServerRelativeUrl&$expand=File&$top=5000`),_=g.d?.results??g.value??[],v=new Map;for(let e of _){let t=e.File?.Name??e.FileLeafRef??``,n=t.split(`.`).pop()?.toLowerCase()??``;if(!ue.has(n)||e[he]===!1)continue;let r=e[pe]??t.replace(/\.[^.]+$/,``).split(/[-_]/)[0]??t,i=v.get(r);i?i.items.push(e):v.set(r,{items:[e]})}let y=[];for(let[e,t]of v){let n=[];for(let e of t.items){let t=e.File?.Name??e.FileLeafRef??``,r=e.File?.ServerRelativeUrl??e.FileRef??``;if(!r)continue;let i=e[me],{fontWeight:a,fontStyle:o}=fe(i,t),s=`${p}${r}`;n.push({url:s,fontWeight:a,fontStyle:o})}n.length>0&&y.push({id:e,name:e,isDefault:!1,fontFaces:n})}y.length>0&&!y.some(e=>e.isDefault)&&(y[0].isDefault=!0),y.forEach(ce),l(y),h(!0)}catch(e){let t=e instanceof Error?e.message:String(e);s(`useBrandCenterFonts: failed to load fonts — falling back to Fluent UI 9 defaults`,e instanceof Error?e:void 0),p(t),h(!1),l(ge)}finally{d(!1)}},[r,n,a?.pageContext?.web?.absoluteUrl,a?.graphClient,a?.authProvider]);(0,t.useEffect)(()=>{if(i){i.forEach(ce);return}!g.current&&!r&&(g.current=!0,_())},[_,i,r]);let v=c.find(e=>e.isDefault);return{fonts:c,fontFamilyNames:c.map(e=>e.name),defaultFont:v,loading:u,error:f,isBrandCenterAvailable:m,refresh:_}},B=()=>{let e=t.useCallback((e,t)=>`${e}${t}`,[]),n=t.useCallback(e=>{if(!e)return!1;try{return!!new URL(e)}catch{return!1}},[]),r=e=>e.charAt(0)===`/`&&e.charAt(1)===`/`?e.substring(1,e.length):e,a=t.useCallback(e=>e?new RegExp(/^[{]?[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}[}]?$/).test(e)===!0:!1,[]),o=t.useCallback(e=>{if(!e)return``;let t=e.split(`/`);return t[t.length-1]},[]),s=t.useCallback(e=>{let t=window.location.hostname,n=`https://${t}`;if(e.indexOf(`${n}/sites/`)>-1||e.indexOf(`${n}/teams/`)>-1){let r=e.split(t)[1].split(`/`)[2],i=`https://${t}/sites/${r}`;return e.indexOf(`${n}/teams/`)>-1&&(i=`https://${t}/teams/${r}`),i}return n},[]),c=t.useCallback(e=>{let t=e.split(window.location.hostname)[1];return t=r(t),t},[]),l=t.useCallback(e=>encodeURIComponent(e.replace(/[%]/g,`%25`)).replace(/[']/g,`%27%27`).replace(/[&]/g,`%26`).replace(/[#]/g,`%23`).replace(/[?]/g,`%3F`).replace(/[/]/g,`%2F`).replace(/[+]/g,`%2B`),[]),u=t.useCallback(e=>e==null?!1:Object.prototype.hasOwnProperty.call(e,`extraSmall`)||Object.prototype.hasOwnProperty.call(e,`small`)||Object.prototype.hasOwnProperty.call(e,`medium`)||Object.prototype.hasOwnProperty.call(e,`large`)||Object.prototype.hasOwnProperty.call(e,`extraLarge`),[]),d=t.useCallback((e,t)=>e[t.toString().toLowerCase()],[]),f=t.useCallback(e=>e>=P.XXXLarge?`XXXLarge`:e>=P.ExtraExtraLarge?`ExtraExtraLarge`:e>=P.ExtraLarge?`ExtraLarge`:e>=Number(P.Large)?`Large`:e>=Number(P.Medium)?`Medium`:e>=Number(P.Small)?`Small`:`ExtraSmall`,[]),p=t.useCallback((e,t)=>{let n=f(t),r={ExtraSmall:`xs`,Small:`s`,Medium:`m`,Large:`l`,ExtraLarge:`xl`,ExtraExtraLarge:`xxl`},i=e;return u(e)&&(i=d(e,n??`Medium`)||r[n]),i},[f,u,d]),m=t.useCallback((e,t,n)=>{if(!e)return`none`;if(typeof e==`string`&&(/^\d+px$/.test(e)||/^\d+%$/.test(e)))return e;let r=n,a={padding:`spacingHorizontal`,vertical:`spacingVertical`,horizontal:`spacingHorizontal`};switch(p(e,t)){case`none`:return i.tokens[`${a[r]}None`];case`xxs`:return i.tokens[`${a[r]}XXS`];case`xs`:return i.tokens[`${a[r]}XS`];case`sNudge`:return i.tokens[`${a[r]}SNudge`];case`s`:return i.tokens[`${a[r]}S`];case`mNudge`:return i.tokens[`${a[r]}MNudge`];case`m`:return i.tokens[`${a[r]}M`];case`l`:return i.tokens[`${a[r]}L`];case`xl`:return i.tokens[`${a[r]}XL`];case`xxl`:return i.tokens[`${a[r]}XXL`];case`xxxl`:return i.tokens[`${a[r]}XXXL`];default:return i.tokens[`${a[r]}M`]}},[p]);return{getCacheKey:e,validateUrl:n,trimBeginDoubleSlash:r,isValidGUID:a,getPageNameFromUrl:o,getSPSiteAbsoluteUrl:s,getFileServerRelativeUrlFromAbsoluteUrl:c,encodeRestUrl:l,getSpacing:m,getCurrentDevice:f,getBaseStyles:t.useCallback((e,t,n)=>{let{verticalSpacing:r,horizontalSpacing:i,paddingLeft:a,paddingRight:o,paddingBottom:s,background:c,width:l,maxWidth:u,height:d,maxHeight:f,marginLeft:p,marginRight:h,marginTop:g,marginBottom:_,paddingTop:v,padding:y,margin:b,styles:x}=e,S=m(v,t,`padding`),C=m(a,t,`padding`),w=m(o,t,`padding`),T=m(s,t,`padding`),E=m(y,t,`padding`),D=m(p,t,`padding`),O=m(h,t,`padding`),k=m(g,t,`padding`),A=m(_,t,`padding`),j=m(b,t,`padding`);E&&(S=S===`none`?E:S,C=C===`none`?E:C,w=w===`none`?E:w,T=T===`none`?E:T),j&&(D=D===`none`?j:D,O=O===`none`?j:O,k=k===`none`?j:k,A=A===`none`?j:A);let M=`${m(r,t,`vertical`)} ${m(i,t,`horizontal`)}`,{padding:N,margin:ee,paddingTop:P,paddingLeft:F,paddingRight:I,paddingBottom:L,marginTop:R,marginLeft:z,marginRight:te,marginBottom:ne,...re}=x??{};return{...re,gap:M,paddingTop:S,paddingLeft:C,paddingRight:w,paddingBottom:T,marginLeft:D,marginRight:O,marginTop:k,marginBottom:A,background:c,width:l??void 0,height:d??void 0,maxWidth:u??void 0,maxHeight:f??void 0,overflow:`auto`}},[m]),getLayoutBreakPoint:t.useCallback((e,t)=>{let n=f(t),r=e;return u(e)&&(r=d(e,n??`Medium`)||``),r},[f,u,d])}},ve={"en-US":o.enUS,"es-ES":o.es,"fr-FR":o.fr,"de-DE":o.de,"it-IT":o.it,"pt-BR":o.pt,"pt-PT":o.pt,"ja-JP":o.ja,"ko-KR":o.ko,"zh-CN":o.zhCN},ye=(e,t)=>{let n=t&&ve[t]||o.enUS,{error:r}=z();return{getFormatRelative:e=>{try{return(0,a.formatDistanceToNow)(typeof e==`string`?(0,a.parseISO)(e):e,{addSuffix:!0,locale:n})}catch(e){return r(`Error formatting relative time:`,e instanceof Error?e:void 0),``}},convertDateToUTC:e=>{try{let t=typeof e==`string`?(0,a.parseISO)(e):e;return new Date(t.toUTCString())}catch(e){return r(`Error converting to UTC:`,e instanceof Error?e:void 0),new Date}},formatDate:(e,t=`PPpp`)=>{try{return(0,a.format)(typeof e==`string`?(0,a.parseISO)(e):e,t,{locale:n})}catch(e){return r(`Error formatting date:`,e instanceof Error?e:void 0),``}},getTimezoneOffset:()=>new Date().getTimezoneOffset(),convertToTimezone:(n,i)=>{try{let r=typeof n==`string`?(0,a.parseISO)(n):n,o=i||e||Intl.DateTimeFormat().resolvedOptions().timeZone;return r.toLocaleString(t||`en-US`,{timeZone:o})}catch(e){return r(`Error converting timezone:`,e instanceof Error?e:void 0),(typeof n==`string`?new Date(n):n).toString()}}}},be=(e,t,n)=>{let{getFormatRelative:r,formatDate:i}=ye(t,e);return{formatUtcDate:(e,t=`PP`)=>{let n=(0,a.differenceInDays)(new Date,(0,a.parseISO)(e)),o=``;return e!==void 0&&(o=n>7?i(e,t):r(e)),o},formatTime:n=>n.toLocaleTimeString(e,{timeZone:t}),convertDateToUTC:n=>{let r=typeof n==`string`?new Date(n):n,i=new Intl.DateTimeFormat(e,{timeZone:t,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1}).formatToParts(r),a,o,s,c,l,u;for(let e of i)switch(e.type){case`year`:a=e.value;break;case`month`:o=e.value;break;case`day`:s=e.value;break;case`hour`:c=e.value;break;case`minute`:l=e.value;break;case`second`:u=e.value;break;default:break}let d=`${a}-${o}-${s}T${c}:${l}:${u}Z`;return new Date(d)}}},xe=process.env.NODE_ENV!==`production`,Se=`data:image/`,Ce=()=>{let{error:e}=z(),n=(0,t.useCallback)(async e=>{let t=await fetch(e).then(e=>e.text());return`data:image/svg+xml;base64,`+btoa(t)},[]),r=(0,t.useCallback)(async(t,n,r)=>new Promise((i,a)=>{let o=new Image;o.crossOrigin=`anonymous`,o.addEventListener(`load`,()=>{let t=document.createElement(`canvas`);t.width=n??o.width,t.height=r??o.height,t?.getContext(`2d`)?.drawImage(o,0,0,n??o.width,r??o.height);let s;try{s=t.toDataURL(`image/png`,1),i(s)}catch(t){xe&&e(`[ImageService.getBase64Image]: Err='${t.message}'`),a(t)}}),o.addEventListener(`error`,t=>{xe&&e(`[ImageService.getBase64Image]: Image load error='${t.message}'`),a(t)}),o.src=t}),[]),i=(0,t.useCallback)(e=>!(0,s.isEmpty)(e)&&e.indexOf(Se)>=0,[]);return{getBase64ImageFromDOMImg:(0,t.useCallback)(t=>{try{let e=document.getElementById(t),n=document.createElement(`canvas`);return n.width=e.width,n.height=e.height,n.getContext(`2d`)?.drawImage(e,0,0),n.toDataURL(`image/png`)}catch(t){xe&&e(`[getBase64ImageFromDOMImg]: Err='${t.message}'`);return}},[]),isBase64Image:i,getImageBase64:r,base64FromSVGUrl:n}};function we(e,t=0){let n=null;return function(...r){let i=this;n&&clearTimeout(n),n=setTimeout(()=>{e.apply(i,r)},t)}}function Te(e,t=0){let n=null,r=0;return function(...i){let a=this,o=Date.now();r||=o;let s=t-(o-r);s<=0||s>t?(n&&=(clearTimeout(n),null),r=o,e.apply(a,i)):n||=setTimeout(()=>{r=Date.now(),n=null,e.apply(a,i)},s)}}function Ee(e){if(typeof e!=`object`||!e)return e;if(e instanceof Date)return new Date(e.getTime());if(e instanceof Array)return e.map(e=>Ee(e));if(e instanceof Object){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n]=Ee(e[n]));return t}return e}function De(e){return e==null?!0:typeof e==`string`||Array.isArray(e)?e.length===0:typeof e==`object`?Object.keys(e).length===0:!1}function Oe(e,t,n){let r=Array.isArray(t)?t:t.split(`.`),i=e;for(let e of r){if(i==null)return n;i=i[e]}return i===void 0?n:i}function ke(e,t,n){let r=Array.isArray(t)?t:t.split(`.`),i=r.pop();if(!i)return e;let a=e;for(let e of r)(!(e in a)||typeof a[e]!=`object`)&&(a[e]={}),a=a[e];return a[i]=n,e}function Ae(e){return Array.from(new Set(e))}function je(e,t){let n=new Set;return e.filter(e=>{let r=t(e);return n.has(r)?!1:(n.add(r),!0)})}function Me(e,t){return e.reduce((e,n)=>{let r=String(t(n));return e[r]||(e[r]=[]),e[r].push(n),e},{})}function Ne(e,t){return e.map(t)}function Pe(e,t){return e.filter(t)}function Fe(e,t){return e.some(t)}function Ie(e,t){return e.every(t)}var V=function(e){return e.HTML=`html`,e.MARKDOWN=`markdown`,e.ADAPTIVE_CARD=`adaptiveCard`,e.PLAIN_TEXT=`plainText`,e}({}),Le=e=>{try{let t=JSON.parse(e);return typeof t==`object`&&!!t}catch{return!1}},Re=e=>{try{let t=JSON.parse(e);return t&&typeof t==`object`&&(t.type===`AdaptiveCard`||t.$schema?.includes(`adaptivecards.io`))}catch{return!1}},ze=e=>{let t=e.trim(),n=[/^<!DOCTYPE\s+html/i,/^<html[\s>]/i,/^<\?xml/i,/<(div|span|p|h[1-6]|table|ul|ol|li|a|img|br|hr|strong|em|b|i)[\s>]/i],r=/<[^>]+>/.test(t),i=/^<[^>]+>/.test(t),a=(t.match(/<(?!\/)[^>]+>/g)||[]).length;return n.some(e=>e.test(t))||r&&i&&a>0},Be=e=>{let t=e.trim(),n=[/^#{1,6}\s+.+$/m,/\*\*.*?\*\*/,/\*.*?\*/,/__.*?__/,/_.*?_/,/\[.*?\]\(.*?\)/,/^\s*[-*+]\s+/m,/^\s*\d+\.\s+/m,/`[^`]+`/,/^```/m,/^\|.*\|.*\|$/m,/^>\s+/m,/^\s*---\s*$/m].some(e=>e.test(t)),r=/^<[^>]+>/.test(t);return n&&!r},Ve=(e,t,n=!1)=>{let r=t.filter(t=>t.test(e)).length/t.length;return n?1-r:r},He=e=>{if(typeof e==`object`&&e){let t=e;if(t.type===`AdaptiveCard`||t.$schema?.includes(`adaptivecards.io`))return{type:V.ADAPTIVE_CARD,content:e,confidence:1};e=JSON.stringify(e,null,2)}let t=e,n=t.trim();if(!n||n.length<3)return{type:V.PLAIN_TEXT,content:t,confidence:1};if(Le(n)&&Re(n))return{type:V.ADAPTIVE_CARD,content:JSON.parse(n),confidence:1};if(ze(n)){let e=Math.max(.7,Ve(n,[/^<!DOCTYPE\s+html/i,/^<html[\s>]/i,/<(div|span|p|h[1-6]|table|ul|ol|li)[\s>]/i]));return{type:V.HTML,content:t,confidence:e}}if(Be(n)){let e=Math.max(.6,Ve(n,[/^#{1,6}\s+.+$/m,/\*\*.*?\*\*/,/\[.*?\]\(.*?\)/,/^\s*[-*+]\s+/m,/`[^`]+`/,/^```/m,/^\|.*\|.*\|$/m]));return{type:V.MARKDOWN,content:t,confidence:e}}return{type:V.PLAIN_TEXT,content:t,confidence:.5}},Ue=e=>He(e).type,We=e=>{let{styles:n}=e,{getBaseStyles:r}=B();return{cardStyles:t.useCallback((t,i)=>({...r(e,t,i),...n}),[r,e,n]),bodyCardDefaultStyles:t.useMemo(()=>({display:`flex`,flexDirection:`column`,justifyContent:`start`,alignItems:`stretch`,overflow:`unset`}),[])}},Ge=e=>{let{className:r,cardBody:a,cardBodyClassName:o,cardHeader:s,cardHeaderClassName:l,cardHeaderImage:u,cardHeaderAction:d,cardHeaderDescription:f,cardFooterAction:p,cardFooterClassName:m,cardFooterContent:h,cardPreviewImage:g,cardPreviewLogo:_,cardPreviewPosition:v=`top`}=e,{cardStyles:y,bodyCardDefaultStyles:b}=We(e),x=t.useRef(null),[S,C]=t.useState(0),[w,T]=t.useState(0);return t.useEffect(()=>{let e;return x.current&&(e=new c.ResizeObserver(e=>{for(let t of e){let{width:e,height:n}=t.contentRect;C(e),T(n)}}),e.observe(x.current)),()=>{e&&e.disconnect()}},[]),(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(`div`,{ref:x,children:(0,n.jsxs)(i.Card,{className:r,style:y(S,w),...e,children:[g&&v===`top`&&(0,n.jsxs)(i.CardPreview,{logo:_,children:[g,` `]}),s&&(0,n.jsx)(i.CardHeader,{className:l,image:u,header:s,description:f,action:d}),g&&v===`afterHeader`&&(0,n.jsxs)(i.CardPreview,{logo:_,children:[g,` `]}),a&&(0,n.jsx)(`div`,{className:(0,i.mergeClasses)(o),style:b,children:a}),g&&v===`bottom`&&(0,n.jsxs)(i.CardPreview,{logo:_,children:[g,` `]}),h&&(0,n.jsx)(i.CardFooter,{action:p,className:m,children:h})]})})})},Ke=e=>{let{cols:n,verticalSpacing:r,horizontalSpacing:i,styles:a,gridItemAutoFlow:o,minItemWidth:s}=e,{getSpacing:c,getCurrentDevice:l,getBaseStyles:u}=B();return{gridStyles:t.useCallback((t,d)=>{let f=u(e,t,d),p=`${c(r,t,`vertical`)} ${c(i,t,`horizontal`)}`,m=l(t),h=`repeat(auto-${o??`fill`}, minmax(min(100%, ${s??250}px), 1fr))`;if(n&&n>0){let e=n??0;switch(m){case`ExtraSmall`:e=Math.min(n,1);break;case`Small`:e=Math.min(n,2);break;case`Medium`:e=Math.min(n,3);break;case`Large`:e=Math.min(n,4);break;case`ExtraLarge`:e=Math.min(n,4);break;case`ExtraExtraLarge`:e=Math.min(n,5);break;case`XXXLarge`:e=Math.min(n,6);break;default:e=0}h=`repeat(${e}, minmax(auto, 1fr))`}return{...f,display:`grid`,gridTemplateColumns:h,gap:p,overflow:`hidden`,...a}},[u,e,c,r,i,l,n,a,o,s])}},qe=e=>{let{children:r,className:i}=e,{gridStyles:a}=Ke(e),o=t.useRef(null),[s,l]=t.useState(0),[u,d]=t.useState(0);return t.useEffect(()=>{let e;return o.current&&(e=new c.ResizeObserver(e=>{for(let t of e){let{width:e,height:n}=t.contentRect;l(e),d(n)}}),e.observe(o.current)),()=>{e&&e.disconnect()}},[]),(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(`div`,{className:i,style:a(s,u),ref:o,children:r})})},Je=e=>{let{maxWith:n}=e,{getBaseStyles:r}=B();return{rootStyles:t.useCallback((t,i)=>({...r(e,t,i),maxWidth:n}),[r,n,e]),layoutGridStyles:(0,l.css)({display:`grid`,overflow:`hidden`})}},Ye={areas:[`header header header`,`sidebar content sidebar`,`footer footer footer`],columns:`1fr 3fr 1fr`,rows:`auto 1fr auto`},Xe=e=>{let{className:r,children:a,layoutConfig:o=Ye}=e,s=t.useRef(null),[l,u]=t.useState(0),[d,f]=t.useState(0),{rootStyles:p,layoutGridStyles:m}=Je({...e,layoutConfig:o}),h=((e,n)=>{let r;return t.useCallback((...t)=>{clearTimeout(r),r=setTimeout(()=>e(...t),n)},[e,n])})((e,t)=>{u(e),f(t)},200);return t.useEffect(()=>{if(!s.current)return;let e=new c.ResizeObserver(e=>{for(let t of e){let{width:e,height:n}=t.contentRect;h(e,n)}});return e.observe(s.current),()=>e.disconnect()},[h]),(0,n.jsx)(`div`,{id:`-Layout`,className:(0,i.mergeClasses)(r,m),style:{...p(l,d),gridTemplateAreas:o.areas.join(` `),gridTemplateColumns:o.columns,gridTemplateRows:o.rows},ref:s,children:t.Children.map(a,(e,r)=>t.isValidElement(e)?(0,n.jsx)(`div`,{style:{gridArea:e.props?.area??`area-${r}`},children:e},r):e)})},Ze=e=>{let{area:t,children:r}=e;return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(`div`,{style:{gridArea:t},children:r})})},Qe=e=>{let{verticalSpacing:n,horizontalSpacing:r}=e,{getSpacing:i}=B();return{spaceStyles:t.useCallback(e=>e?r?{width:i(r,e,`horizontal`)}:n?{height:i(n,e,`vertical`)}:{}:{},[i,r,n])}},$e=e=>{let r=t.useRef(null),[i,a]=t.useState(0),{spaceStyles:o}=Qe(e);return t.useEffect(()=>{let e;return r.current&&(e=new c.ResizeObserver(e=>{for(let t of e){let{width:e}=t.contentRect;a(e)}}),e.observe(r.current)),()=>{e&&e.disconnect()}},[]),(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(`div`,{id:`-space`,style:o(i),ref:r})})},et=e=>{let{horizontal:n,horizontalAlign:r,verticalAlign:i,verticalFill:a,wrap:o,columnGap:s,RowGap:c}=e,{getBaseStyles:l}=B();return{stackStyles:t.useCallback((t,u)=>{let d=i||`start`,f=n?r:`start`,p=n?{flexFlow:o?`row wrap`:`row nowrap`,height:`100%`}:{height:`100%`,maxHeight:`100%`},m=l(e,t,u);return{columnGap:s,rowGap:c,display:`flex`,flexDirection:n?`row`:`column`,alignItems:d,justifyContent:f,...p,height:a?`100%`:m.height,...m,...e.styles}},[l,n,r,e,i,a,o])}},H=e=>{let{children:r,className:i}=e,{stackStyles:a}=et(e),o=t.useRef(null),[s,l]=t.useState(0),[u,d]=t.useState(0);return t.useEffect(()=>{let e;return o.current&&(e=new c.ResizeObserver(e=>{for(let t of e){let{width:e,height:n}=t.contentRect;l(e),d(n)}}),e.observe(o.current)),()=>{e&&e.disconnect()}},[]),(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(`div`,{className:i,style:a(s,u),ref:o,children:r})})},tt=e=>{let{children:r,grow:i,disableShrink:a,shrink:o,order:s,alignSelf:l,verticalFill:u}=e,{getBaseStyles:d}=B(),f=t.useRef(null),[p,m]=t.useState(0),[h,g]=t.useState(0),_=d(e,p,h);return t.useEffect(()=>{let e;return f.current&&(e=new c.ResizeObserver(e=>{for(let t of e){let{width:e,height:n}=t.contentRect;m(e),g(n)}}),e.observe(f.current)),()=>{e&&e.disconnect()}},[]),(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(`div`,{ref:f,style:{..._,alignSelf:l,order:s,height:u?`100%`:`auto`,flexGrow:i?typeof i==`boolean`?1:i:void 0,flexShrink:a||!i&&!o?0:1,minWidth:0,minHeight:0,width:`auto`},children:r})})},nt=({ratio:e,children:t,maxWidth:r,maxHeight:i,style:a={},...o})=>{let s={position:`relative`,width:`100%`,paddingTop:`${100/e}%`,maxWidth:r||`none`,maxHeight:i||`none`,...a},c={position:`absolute`,top:0,left:0,width:`100%`,height:`100%`};return(0,n.jsx)(`div`,{style:s,...o,children:(0,n.jsx)(`div`,{style:c,children:t})})},rt=e=>{let{styles:n}=e,{getBaseStyles:r}=B();return{aspectRatioStyles:t.useCallback((t,i)=>({...r(e,t,i),...n}),[r,e,n])}},it=e=>{let{styles:n}=e,{getBaseStyles:r}=B();return{centerStyles:t.useCallback((t,i)=>({...r(e,t,i),...n,overflow:`hidden`,display:`flex`,justifyContent:`center`,alignItems:`center`,width:`100%`,height:`100%`}),[r,e,n]),childrenStyles:(0,l.css)({justifyContent:`center`,textAlign:`center`})}},at=e=>{let{className:r,children:i}=e,a=t.useRef(null),[o,s]=t.useState(0),[l,u]=t.useState(0),{centerStyles:d}=it(e),f=(e,t)=>{let n;return(...r)=>{clearTimeout(n),n=setTimeout(()=>e(...r),t)}};return t.useEffect(()=>{let e=f(e=>{for(let t of e){let{width:e,height:n}=t.contentRect;s(e),u(n)}},200),t=new c.ResizeObserver(t=>{e(t)});return a.current&&t.observe(a.current),()=>{t.disconnect()}},[]),(0,n.jsx)(`div`,{id:`center`,className:r,style:{...d(o,l),display:`flex`,justifyContent:`center`,alignItems:`center`,height:`100%`,width:`100%`},ref:a,children:i})},ot=e=>{let{maxWidth:n}=e,{getBaseStyles:r}=B();return{containerStyles:t.useCallback((t,i)=>!t||!i?{}:{...r(e,t,i),maxWidth:n},[r,n,e])}},st=e=>{let{className:r,children:i,style:a,alignItems:o=`center`,justifyContent:l=`center`,flexDirection:u=`row`,centerContent:d=!0}=e,f=t.useRef(null),[p,m]=t.useState(0),[h,g]=t.useState(0),{containerStyles:_}=ot(e),v=t.useMemo(()=>(0,s.debounce)(e=>{for(let t of e){let{width:e,height:n}=t.contentRect;m(e),g(n)}},200),[]);t.useEffect(()=>{let e=new c.ResizeObserver(e=>{v(e)});return f.current&&e.observe(f.current),()=>{e.disconnect(),v.cancel()}},[v]);let y=t.useMemo(()=>{if(!a)return;let{padding:e,margin:t,...n}=a;return n},[a]);return(0,n.jsx)(`div`,{id:`container`,className:r,style:{..._(p,h),display:`flex`,justifyContent:l,alignItems:o,flexDirection:u,...y},ref:f,children:d?(0,n.jsx)(at,{children:i}):i})},ct=e=>{let[n,r]=(0,t.useState)(!0),[i,a]=(0,t.useState)(!0),o=(0,t.useCallback)(()=>{e&&e.scrollPrev()},[e]),s=(0,t.useCallback)(()=>{e&&e.scrollNext()},[e]),c=(0,t.useCallback)(e=>{r(!e.canScrollPrev()),a(!e.canScrollNext())},[]);return(0,t.useEffect)(()=>{e&&(c(e),e.on(`reInit`,c),e.on(`select`,c))},[e,c]),{prevBtnDisabled:n,nextBtnDisabled:i,onPrevButtonClick:o,onNextButtonClick:s}},lt=(e,n)=>{let{getCurrentDevice:r}=B(),a=t.useCallback(()=>{let e=r(n),t=`95%`;switch(e){case`Medium`:t=`45%`;break;case`Large`:t=`calc(95% / 4)`;break;case`ExtraLarge`:t=`calc(95% / 5)`;break;case`ExtraExtraLarge`:t=`calc(95% / 6)`;break;default:t=`95%`;break}return t},[n,r]),o=t.useCallback(()=>{let e=r(n),t=i.tokens.spacingVerticalM;switch(e){case`Medium`:t=i.tokens.spacingVerticalM;break;case`Large`:t=i.tokens.spacingVerticalL;break;case`ExtraLarge`:t=i.tokens.spacingVerticalXL;break;default:t=i.tokens.spacingVerticalM;break}return t},[n,r]);return{enableControls:(0,l.css)({display:`flex`,justifyContent:`space-between`,alignItems:`stretch`,gap:10,padding:5}),embla__viewport:(0,l.css)({overflow:`hidden`,paddingTop:`10px`,paddingBottom:`20px`}),embla__container:(0,l.css)({backfaceVisibility:`hidden`,display:`flex`,touchAction:`pan-y`}),embla:(0,l.css)({".embla":{}}),embla__slide:(0,l.css)({minWidth:0,flex:`0 0 ${a()}`,paddingLeft:`${o()}`}),embla__buttons:(0,l.css)({display:`grid`,gridTemplateColumns:`repeat(2, 1fr)`,gap:0,alignItems:`center`})}},ut=e=>{let{styles:n}=e,{getBaseStyles:r}=B();return{carouselStyles:t.useCallback((t,i)=>({...r(e,t,i),...n}),[r,e,n])}},dt=()=>({titleStyles:(0,l.css)({display:`-webkit-box`,overflow:`hidden`,textOverflow:`ellipsis`,WebkitLineClamp:`1`,WebkitBoxOrient:`vertical`,textAlign:`start`})}),ft=e=>{let{className:r,items:a,title:o}=e,s=t.useRef(null),[l,f]=t.useState(0),[p,m]=t.useState(0),{carouselStyles:h}=ut(e),[g,_]=(0,u.default)(),v=dt(),{enableControls:y,embla__slide:b,embla__container:x,embla__viewport:S,embla__buttons:C}=lt(e,l),{prevBtnDisabled:w,nextBtnDisabled:T,onPrevButtonClick:E,onNextButtonClick:D}=ct(_);return t.useEffect(()=>{let e;return s.current&&(e=new c.ResizeObserver(e=>{for(let t of e){let{width:e,height:n}=t.contentRect;f(e),m(n)}}),f(s.current.clientWidth),m(s.current.clientHeight),e.observe(s.current)),()=>{e&&e.disconnect()}},[]),(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(`div`,{id:`-carousel`,role:`region`,"aria-roledescription":`carousel`,"aria-label":o||`Carousel`,className:(0,i.mergeClasses)(r,`embla`),style:{...h(l,p)},ref:s,children:[(0,n.jsxs)(`div`,{className:y,children:[(0,n.jsx)(i.Subtitle2,{className:v.titleStyles,children:o}),(0,n.jsxs)(`div`,{className:C,children:[(0,n.jsx)(i.Button,{onClick:E,disabled:w,appearance:`subtle`,icon:(0,n.jsx)(d.ChevronLeftRegular,{}),"aria-label":`Previous slide`}),(0,n.jsx)(i.Button,{onClick:D,disabled:T,appearance:`subtle`,icon:(0,n.jsx)(d.ChevronRightRegular,{}),"aria-label":`Next slide`})]})]}),(0,n.jsx)(`div`,{className:S,ref:g,children:(0,n.jsx)(`div`,{className:x,children:a.map((e,t)=>(0,n.jsx)(`div`,{className:b,role:`group`,"aria-roledescription":`slide`,"aria-label":`Slide ${t+1} of ${a.length}`,children:e},t))})})]})})},pt=e=>{let{direction:t=`horizontal`,resizerSize:n=6}=e,r=t===`horizontal`;return{root:(0,l.css)({position:`relative`,width:`100%`,height:`100%`}),pane:e=>{let t=e===void 0?void 0:typeof e==`number`?`${e}px`:e;return(0,l.css)({overflow:`auto`,position:`relative`,...r?{width:t,height:`100%`}:{height:t,width:`100%`}})},secondaryPane:(0,l.css)({flex:1,overflow:`auto`,position:`relative`,minWidth:0,minHeight:0}),resizer:(0,l.css)({flex:`0 0 auto`,...r?{width:n,cursor:`col-resize`,height:`100%`}:{height:n,cursor:`row-resize`,width:`100%`},backgroundColor:i.tokens.colorNeutralStroke1,transition:`background-color 150ms ease`,userSelect:`none`,zIndex:1}),resizerActive:(0,l.css)({backgroundColor:i.tokens.colorBrandStroke1}),resizerGrip:(0,l.css)({gap:`2px`}),gripDot:(0,l.css)({width:3,height:3,borderRadius:`50%`,backgroundColor:i.tokens.colorNeutralForeground3})}},U={xs:i.tokens.spacingHorizontalXS,s:i.tokens.spacingHorizontalS,m:i.tokens.spacingHorizontalM,l:i.tokens.spacingHorizontalL,xl:i.tokens.spacingHorizontalXL,xxl:i.tokens.spacingHorizontalXXL},W=t.default.memo(t.default.forwardRef(({direction:e=`vertical`,justifyContent:t=`flex-start`,alignItems:r=`stretch`,gap:a,columnGap:o,rowGap:s,margin:c,padding:u,marginTop:d,marginBottom:f,marginLeft:p,marginRight:m,paddingTop:h,paddingBottom:g,paddingLeft:_,paddingRight:v,width:y,height:b,wrap:x=!1,children:S,style:C,className:w,overflow:T,background:E},D)=>(0,n.jsx)(`div`,{ref:D,className:(0,i.mergeClasses)(w,(0,l.css)({display:`flex`,flexDirection:e===`horizontal`?`row`:`column`,justifyContent:t,alignItems:r,gap:a&&U[a]?U[a]:a,columnGap:o&&U[o]?U[o]:o,rowGap:s&&U[s]?U[s]:s,margin:c&&U[c]?U[c]:c,padding:u&&U[u]?U[u]:u,marginTop:d&&U[d]?U[d]:d,marginBottom:f&&U[f]?U[f]:f,marginLeft:p&&U[p]?U[p]:p,marginRight:m&&U[m]?U[m]:m,paddingTop:h&&U[h]?U[h]:h,paddingBottom:g&&U[g]?U[g]:g,paddingLeft:_&&U[_]?U[_]:_,paddingRight:v&&U[v]?U[v]:v,width:y,height:b,overflow:T,flexWrap:x?`wrap`:`nowrap`,backgroundColor:E,...C})),children:S}))),mt=e=>{let{direction:r=`horizontal`,defaultSize:i=`50%`,minSize:a=100,maxSize:o=1/0,minSecondarySize:s=100,resizable:c=!0,onResize:l,onResizeEnd:u,primaryContent:d,secondaryContent:f,className:p,styles:m}=e,h=pt(e),g=r===`horizontal`,_=t.useRef(null),v=t.useRef(null),[y,b]=t.useState(null),[x,S]=t.useState(!1),[C,w]=t.useState(!1);t.useEffect(()=>{if(y!==null||!_.current)return;let e=_.current.getBoundingClientRect(),t=g?e.width:e.height;if(typeof i==`number`)b(Math.min(Math.max(i,a),o));else if(typeof i==`string`&&i.endsWith(`%`)){let e=parseFloat(i)/100;b(Math.min(Math.max(t*e,a),o))}else b(t/2)},[i,a,o,g,y]);let T=t.useCallback(t=>{if(!_.current)return t;let n=_.current.getBoundingClientRect(),r=(g?n.width:n.height)-(e.resizerSize??6)-s;return Math.min(Math.max(t,a),Math.min(o,r))},[g,o,a,s,e.resizerSize]),E=t.useCallback(e=>{if(!c)return;e.preventDefault(),S(!0);let t=g?e.clientX:e.clientY,n=y??0,r=e=>{let r=T(n+((g?e.clientX:e.clientY)-t));b(r),l?.(r)},i=()=>{if(S(!1),document.removeEventListener(`mousemove`,r),document.removeEventListener(`mouseup`,i),v.current){let e=g?v.current.getBoundingClientRect().width:v.current.getBoundingClientRect().height;u?.(e)}};document.addEventListener(`mousemove`,r),document.addEventListener(`mouseup`,i)},[c,g,y,T,l,u]),D=t.useCallback(e=>{if(!c)return;S(!0);let t=e.touches[0],n=g?t.clientX:t.clientY,r=y??0,i=e=>{let t=e.touches[0],i=T(r+((g?t.clientX:t.clientY)-n));b(i),l?.(i)},a=()=>{if(S(!1),document.removeEventListener(`touchmove`,i),document.removeEventListener(`touchend`,a),v.current){let e=g?v.current.getBoundingClientRect().width:v.current.getBoundingClientRect().height;u?.(e)}};document.addEventListener(`touchmove`,i,{passive:!1}),document.addEventListener(`touchend`,a)},[c,g,y,T,l,u]),O=t.useCallback(e=>{if(!c||y===null)return;let t=e.shiftKey?50:10,n=0;if(g?e.key===`ArrowLeft`?n=-t:e.key===`ArrowRight`&&(n=t):e.key===`ArrowUp`?n=-t:e.key===`ArrowDown`&&(n=t),n!==0){e.preventDefault();let t=T(y+n);b(t),l?.(t),u?.(t)}},[c,y,g,T,l,u]);t.useEffect(()=>(x?(document.body.style.userSelect=`none`,document.body.style.cursor=g?`col-resize`:`row-resize`):(document.body.style.userSelect=``,document.body.style.cursor=``),()=>{document.body.style.userSelect=``,document.body.style.cursor=``}),[x,g]);let k=t.useRef(null),A=[h.resizer,C||x?h.resizerActive:``].filter(Boolean).join(` `);return t.useEffect(()=>{if(!c||!k.current)return;let e=k.current,t=e=>E(e),n=e=>D(e),r=e=>O(e),i=()=>w(!0),a=()=>w(!1);return e.addEventListener(`mousedown`,t),e.addEventListener(`touchstart`,n),e.addEventListener(`keydown`,r),e.addEventListener(`mouseenter`,i),e.addEventListener(`mouseleave`,a),()=>{e.removeEventListener(`mousedown`,t),e.removeEventListener(`touchstart`,n),e.removeEventListener(`keydown`,r),e.removeEventListener(`mouseenter`,i),e.removeEventListener(`mouseleave`,a)}},[c,E,D,O]),(0,n.jsxs)(W,{ref:_,className:[h.root,p].filter(Boolean).join(` `),style:{height:`100%`,width:`100%`,...m},direction:g?`horizontal`:`vertical`,overflow:`hidden`,children:[(0,n.jsx)(W,{ref:v,className:h.pane(y??void 0),style:{flex:`0 0 auto`},children:d}),c&&(0,n.jsx)(`div`,{ref:k,className:A,style:{flex:`0 0 auto`,display:`flex`,alignItems:`center`,justifyContent:`center`},role:`separator`,"aria-orientation":g?`vertical`:`horizontal`,"aria-valuenow":Math.round(y??a),"aria-valuemin":a,"aria-valuemax":o===1/0?void 0:o,"aria-label":`Resize pane`,tabIndex:0,children:(0,n.jsxs)(W,{className:h.resizerGrip,direction:g?`vertical`:`horizontal`,alignItems:`center`,justifyContent:`center`,children:[(0,n.jsx)(W,{className:h.gripDot,children:``}),(0,n.jsx)(W,{className:h.gripDot,children:``}),(0,n.jsx)(W,{className:h.gripDot,children:``})]})}),(0,n.jsx)(W,{className:h.secondaryPane,style:{flex:1,minWidth:0,minHeight:0},children:f})]})},ht=({anchorPoint:e,isOpen:r,onClose:a,excludeRefs:o,children:s,theme:c})=>{let l=(0,t.useRef)(null),[u,d]=(0,t.useState)(null);(0,t.useLayoutEffect)(()=>{if(!r){d(null);return}if(l.current){let t=l.current.getBoundingClientRect(),n=e.left,r=e.top;n+t.width>window.innerWidth&&(n=window.innerWidth-t.width-10),r+t.height>window.innerHeight&&(r=window.innerHeight-t.height-10),d({left:n,top:r})}},[e,r,s]);let p=t.default.useCallback(e=>{let t=e.target;if(l.current&&!l.current.contains(t)){if(o&&o.some(e=>e.current&&e.current.contains(t)))return;a()}},[a,o]);if((0,t.useEffect)(()=>{if(!r)return;let e=requestAnimationFrame(()=>{document.addEventListener(`mousedown`,p)}),t=e=>{e.key===`Escape`&&a()};return document.addEventListener(`keydown`,t),()=>{cancelAnimationFrame(e),document.removeEventListener(`mousedown`,p),document.removeEventListener(`keydown`,t)}},[r,p,a]),!r)return null;let m=u||e;return f.default.createPortal(c?(0,n.jsx)(i.FluentProvider,{theme:c,children:(0,n.jsx)(i.Card,{ref:l,role:`dialog`,"aria-modal":`true`,style:{position:`fixed`,zIndex:1e3,top:m.top,left:m.left},children:s})}):(0,n.jsx)(i.Card,{ref:l,role:`dialog`,"aria-modal":`true`,style:{position:`fixed`,zIndex:1e3,top:m.top,left:m.left},children:s}),document.body)},gt=(0,i.makeStyles)({labelContainer:{display:`flex`,flexDirection:`row`,justifyContent:`flex-start`,alignItems:`center`,...i.shorthands.gap(`6px`)},iconStyles:{width:`26px`},item:{paddingLeft:`15px`}}),_t=e=>{let{label:r,icon:a,isRequired:o}=e,s=gt();return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(`div`,{className:s.labelContainer,children:[a&&t.isValidElement(a)?a:(0,n.jsx)(p.Icon,{icon:a,className:s.iconStyles,width:`20px`,height:`20px`,color:i.tokens.colorBrandForeground1,"aria-hidden":`true`}),(0,n.jsx)(i.Caption1,{style:{color:i.tokens.colorBrandForeground1},children:r}),(0,n.jsx)(i.Caption1,{style:{color:i.tokens.colorPaletteRedForeground1},children:o?` *`:``})]})})},vt=(0,i.makeStyles)({root:{display:`flex`,justifyContent:`center`,alignItems:`center`,height:`100%`,width:`100%`},spinner:{width:`100px`,height:`100px`}}),yt=e=>{let{size:t,label:r,labelPosition:a,style:o,className:s}=e,c=vt();return(0,n.jsx)(`div`,{className:c.root,children:(0,n.jsx)(i.Spinner,{style:o,className:(0,i.mergeClasses)(c.spinner,s),size:t,label:r,labelPosition:a,"aria-label":r?void 0:`Loading`})})},bt={xs:i.tokens.fontSizeBase200,s:i.tokens.fontSizeBase300,m:i.tokens.fontSizeBase400,l:i.tokens.fontSizeBase500,xl:i.tokens.fontSizeBase600,xxl:i.tokens.fontSizeHero700},G={xs:i.tokens.spacingHorizontalXS,s:i.tokens.spacingHorizontalS,m:i.tokens.spacingHorizontalM,l:i.tokens.spacingHorizontalL,xl:i.tokens.spacingHorizontalXL,xxl:i.tokens.spacingHorizontalXXL},xt={regular:i.tokens.fontWeightRegular,semibold:i.tokens.fontWeightSemibold,bold:i.tokens.fontWeightBold},St=e=>{let{fontSize:t,fontFamily:r,fontWeight:a,numberOfLines:o,as:s,padding:c,paddingTop:u,paddingBottom:d,paddingLeft:f,paddingRight:p,margin:m,marginTop:h,marginBottom:g,marginLeft:_,marginRight:v,children:y,style:b,className:x,color:S,block:C,truncate:w,wrap:T}=e,E=(0,l.css)({color:S,padding:c&&G[c]?G[c]:c,paddingTop:u&&G[u]?G[u]:u,paddingBottom:d&&G[d]?G[d]:d,paddingLeft:f&&G[f]?G[f]:f,paddingRight:p&&G[p]?G[p]:p,margin:m&&G[m]?G[m]:m,marginTop:h&&G[h]?G[h]:h,marginBottom:g&&G[g]?G[g]:g,marginLeft:_&&G[_]?G[_]:_,marginRight:v&&G[v]?G[v]:v}),D={...b,...r?{fontFamily:r}:{},...t?{fontSize:bt[t]?bt[t]:t}:{},...a?{fontWeight:xt[a]?xt[a]:a}:{},...o?{display:`-webkit-box`,WebkitBoxOrient:`vertical`,overflow:`hidden`,WebkitLineClamp:o}:{}};return(0,n.jsx)(i.Text,{as:s,className:(0,i.mergeClasses)(x,E),style:D,block:C,truncate:w,wrap:T,children:y})},Ct=e=>{let{onSelected:r,value:a,styles:o,options:s,apparence:c,shape:l,label:u}=e,d=t.useRef(),[f,p]=t.useState(a??s[0]),[m,h]=t.useState({option:[a?a?.key:s?.[0]?.key]}),g=t.useRef(null);t.useEffect(()=>{a!==void 0&&(p(a),h({option:[a.key]})),d.current=s.find(e=>e.key===(a?.key??s[0]?.key))?.icon},[a]);let[_,v]=t.useState(!1),y=t.useCallback((e,t)=>{v(t.open)},[]),b=t.useCallback(e=>e?.text??``,[]),x=t.useCallback((e,{name:t,checkedItems:n})=>{if(t===`option`){let e=n[0];p(s.find(t=>t.key===e)),h({option:n}),d.current=s.find(t=>t.key===e)?.icon,r(s.find(t=>t.key===e))}},[s,r]);return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(i.Field,{label:u,style:o,ref:g,children:(0,n.jsxs)(i.Menu,{open:_,onOpenChange:y,children:[(0,n.jsx)(i.MenuTrigger,{disableButtonEnhancement:!0,children:(0,n.jsx)(i.MenuButton,{shape:l??`circular`,icon:d.current,appearance:c??`secondary`,children:b(f)??`No data available`})}),(0,n.jsx)(i.MenuPopover,{children:(0,n.jsx)(i.MenuList,{onCheckedValueChange:x,checkedValues:m,style:{width:g.current?.offsetWidth},children:s.map(e=>(0,n.jsx)(i.MenuItemRadio,{name:`option`,value:e.key,icon:e.icon,disabled:e.disabled,children:b(e)},e.key))})})]})})})},wt=()=>({styles:{container:(0,l.css)({display:`flex`,alignItems:`center`,alignContent:`center`,overflow:`hidden`,whiteSpace:`nowrap`,padding:`8px`,backgroundColor:`transparent`}),breadcrumbItem:(0,l.css)({minWidth:`fit-content`,padding:0,margin:`0px`}),separator:(0,l.css)({marginRight:`8px`})},getStyles:(e,t)=>{let{icon:n}=e;switch(t){case`small`:return(0,l.css)({fontSize:`12px`,padding:`4px`,paddingLeft:n?`0px`:`4px`});case`medium`:return(0,l.css)({fontSize:`14px`,padding:`6px`,paddingLeft:n?`0px`:`6px`});case`large`:return(0,l.css)({fontSize:`16px`,padding:`8px`,paddingLeft:n?`0px`:`8px`});case`current`:return(0,l.css)({fontWeight:i.tokens.fontWeightBold,cursor:`default`,display:`-webkit-box`,"-webkit-line-clamp":`1`,"-webkit-box-orient":`vertical`,overflow:`hidden`,textAlign:`start`,textOverflow:`ellipsis`,wordBreak:`break-word`,fontFamily:i.tokens.fontFamilyBase});default:return(0,l.css)({fontSize:`14px`,padding:`6px`,paddingLeft:n?`0px`:`6px`})}}}),Tt=({items:e,theme:r,size:a=`medium`})=>{let[o,s]=(0,t.useState)(!1),c=(0,t.useRef)(null),l=(0,t.useRef)(null),[u,p]=(0,t.useState)({top:0,left:0,position:`absolute`}),{getStyles:m}=wt();return(0,t.useEffect)(()=>{let e=e=>{!c.current?.contains(e.target)&&!l.current?.contains(e.target)&&o&&s(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[o]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(i.Button,{ref:c,icon:(0,n.jsx)(d.MoreHorizontalRegular,{}),appearance:`transparent`,onClick:()=>{if(c.current){let e=c.current.getBoundingClientRect(),t=window.innerWidth,n=window.innerHeight,r=l.current?.offsetWidth||200,i=l.current?.offsetHeight||100,a=e.bottom+window.scrollY,o=e.left+window.scrollX;o+r>t&&(o=t-r-10),a+i>n&&(a=e.top+window.scrollY-i),p({top:a,left:o,position:`absolute`}),s(e=>!e)}},"aria-label":`More items`}),o&&(0,f.createPortal)(r?(0,n.jsx)(i.FluentProvider,{theme:r,children:(0,n.jsx)(i.Card,{ref:l,style:{...u,zIndex:1e3,padding:`8px`,minWidth:`150px`},children:e.map((e,t)=>(0,n.jsx)(i.Button,{icon:e.icon?e.icon:null,appearance:`transparent`,onClick:()=>{e.onClick?.(),s(!1)},children:(0,n.jsx)(i.Text,{className:m(e,a),children:e.label})},`overflow-${t}`))})}):(0,n.jsx)(i.Card,{ref:l,style:{...u,zIndex:1e3,padding:`8px`,minWidth:`150px`},children:e.map((e,t)=>(0,n.jsx)(i.Button,{icon:e.icon?e.icon:null,appearance:`transparent`,onClick:()=>{e.onClick?.(),s(!1)},children:(0,n.jsx)(i.Text,{className:m(e,a),children:e.label})},`overflow-${t}`))}),document.body)]})},Et=(e,t)=>{let n;return(...r)=>{clearTimeout(n),n=setTimeout(()=>e(...r),t)}},Dt=({items:e,maxWidth:r=`100%`,styles:a,theme:o,size:s=`medium`,currentIndex:l=e.length-1,className:u})=>{let{styles:f,getStyles:p}=wt(),m=(0,t.useRef)(null),[h,g]=(0,t.useState)([]),[_,v]=(0,t.useState)([]);return(0,t.useEffect)(()=>{let t=()=>{if(!m.current)return;let t=m.current.offsetWidth,n=0,r=[],i=[];e.forEach(e=>{n+80<=t-50?(r.push(e),n+=80):i.push(e)}),g(r),v(i)},n=Et(t,100),r=new c.ResizeObserver(()=>{n()});return m.current&&r.observe(m.current),t(),()=>{r.disconnect()}},[e]),(0,n.jsx)(`div`,{ref:m,className:(0,i.mergeClasses)(f.container,u),style:{maxWidth:r,...a},children:(0,n.jsxs)(H,{horizontal:!0,verticalAlign:`center`,horizontalAlign:`start`,children:[h.map((e,r)=>(0,n.jsxs)(t.default.Fragment,{children:[r===l?(0,n.jsxs)(H,{horizontal:!0,verticalAlign:`center`,horizontalAlign:`start`,columnGap:5,styles:{overflow:`hidden`},children:[e.icon?t.default.cloneElement(e.icon,{style:{fontSize:s===`large`?`20px`:s===`medium`?`16px`:`12px`}}):null,(0,n.jsx)(i.Text,{className:(0,i.mergeClasses)(f.breadcrumbItem,p(e,s),p(e,`current`)),"aria-current":`page`,children:e.label},e.label)]}):(0,n.jsx)(i.Button,{icon:e.icon?e.icon:null,appearance:`transparent`,className:`${f.breadcrumbItem}`,onClick:e.onClick,children:(0,n.jsx)(i.Text,{className:p(e,s),children:e.label})},e.label),r<h.length-1&&(0,n.jsx)(d.ChevronRightRegular,{style:{fontSize:s===`large`?`20px`:s===`medium`?`16px`:`12px`}})]},e.label??`breadcrumb-${r}`)),_.length>0&&(0,n.jsx)(Tt,{items:_,theme:o})]})})},Ot=({icon:e,hoverIcon:r,imageSrc:a,width:o=24,height:s=24,color:c,hoverColor:l,onClick:u,enabled:d=!0,ariaLabel:f})=>{let p=c||i.tokens.colorBrandBackground,m=l||i.tokens.colorBrandBackgroundHover,h=i.tokens.fontFamilyBase,[g,_]=(0,t.useState)(!1),v=(0,t.useCallback)(()=>{d&&_(!0)},[d]),y=(0,t.useCallback)(()=>{d&&_(!1)},[d]),b=(0,t.useMemo)(()=>d&&g&&r?r:e,[g,r,e,d]),x=(0,t.useMemo)(()=>({width:o,height:s,color:g?m:p,display:`flex`,alignItems:`center`,justifyContent:`center`,opacity:d?1:.5,fontFamily:h,fontSize:`inherit`}),[o,s,g,m,p,d,h]),S=(0,t.useMemo)(()=>({border:`none`,background:`none`,padding:0,cursor:d?`pointer`:`default`}),[d]),C=(0,t.useMemo)(()=>({width:o,height:s,objectFit:`contain`,opacity:d?1:.5}),[o,s,d]);return(0,n.jsx)(i.Button,{onClick:d?u:void 0,onMouseEnter:v,onMouseLeave:y,disabled:!d,style:S,"aria-label":f??`Icon Button`,children:a?(0,n.jsx)(`img`,{src:a,alt:`icon`,style:C}):t.default.cloneElement(b,{style:{...b.props.style,...x}})})},kt=t.default.memo(Ot),At=()=>({getSpanSlots:t.useCallback((e,t)=>{let n=new Date(e),r=new Date(t),i=n.getHours(),a=n.getMinutes(),o=i*2+(a>=1?1:0),s=r.getHours(),c=r.getMinutes(),l=s*2+(c>=1?2:0);return{spanSlots:l-o,startSlot:o,endSlot:l}},[]),generateLightAndHoverColors:t.useCallback((e,t=20,n=10)=>{let r=e=>{let t=parseInt(e.slice(1,3),16)/255,n=parseInt(e.slice(3,5),16)/255,r=parseInt(e.slice(5,7),16)/255,i=Math.max(t,n,r),a=Math.min(t,n,r),o=i-a,s=0,c=0,l=(i+a)/2;if(o!==0){switch(c=l>.5?o/(2-i-a):o/(i+a),i){case t:s=(n-r)/o+(n<r?6:0);break;case n:s=(r-t)/o+2;break;case r:s=(t-n)/o+4;break}s/=6}return{h:s*360,s:c*100,l:l*100}},i=(e,t,n)=>{let r=t*Math.min(n,100-n)/100,i=t=>{let i=(t+e/30)%12,a=n-r*Math.max(Math.min(i-3,9-i,1),-1);return Math.round(255*a).toString(16).padStart(2,`0`)};return`#${i(0)}${i(8)}${i(4)}`},{h:a,s:o,l:s}=r(e);return{lightColor:i(a,o,Math.min(s+t,100)),hoverColor:i(a,o,Math.min(s+n,100))}},[]),getEventColors:t.useCallback(e=>{let t={backgroundColor:i.tokens.colorNeutralBackground3,hoverColor:i.tokens.colorNeutralBackground3Hover};return{"no category":t,meeting:{backgroundColor:i.tokens.colorPaletteBlueBackground2,hoverColor:i.tokens.colorPaletteBlueBorderActive},appointment:{backgroundColor:i.tokens.colorPaletteGreenBackground2,hoverColor:i.tokens.colorPaletteGreenBorderActive},task:{backgroundColor:i.tokens.colorPaletteRedBackground2,hoverColor:i.tokens.colorPaletteRedBorderActive},deadline:{backgroundColor:i.tokens.colorPaletteYellowBackground2,hoverColor:i.tokens.colorPaletteYellowBorderActive},holiday:{backgroundColor:i.tokens.colorPalettePurpleBackground2,hoverColor:i.tokens.colorPalettePurpleBorderActive},celebration:{backgroundColor:i.tokens.colorPaletteDarkOrangeBackground2,hoverColor:i.tokens.colorPaletteDarkOrangeBorderActive},reminder:{backgroundColor:i.tokens.colorPaletteTealBackground2,hoverColor:i.tokens.colorPaletteTealBorderActive},workshop:{backgroundColor:i.tokens.colorPaletteTealBackground2,hoverColor:i.tokens.colorPaletteTealBorderActive},webinar:{backgroundColor:i.tokens.colorPaletteMagentaBackground2,hoverColor:i.tokens.colorPaletteMagentaBorderActive},conference:{backgroundColor:i.tokens.colorPaletteBrownBackground2,hoverColor:i.tokens.colorPaletteBrownBorderActive}}[e.toLowerCase()]||t},[]),generateColor:t.useCallback(e=>{let t=0;for(let n=0;n<e.length;n++)t=e.charCodeAt(n)+((t<<5)-t);let n=(t&16777215).toString(16).toUpperCase();return`#${`00000`.substring(0,6-n.length)+n}`},[]),getCalendarColors:t.useCallback(e=>{let t={beige:{backgroundColor:i.tokens.colorPaletteBeigeBackground2,hoverColor:i.tokens.colorPaletteBeigeBorderActive},blue:{backgroundColor:i.tokens.colorPaletteBlueBackground2,hoverColor:i.tokens.colorPaletteBlueBorderActive},brown:{backgroundColor:i.tokens.colorPaletteBrownBackground2,hoverColor:i.tokens.colorPaletteBrownBorderActive},gold:{backgroundColor:i.tokens.colorPaletteGoldBackground2,hoverColor:i.tokens.colorPaletteGoldBorderActive},lavender:{backgroundColor:i.tokens.colorPaletteLavenderBackground2,hoverColor:i.tokens.colorPaletteLavenderBorderActive},magenta:{backgroundColor:i.tokens.colorPaletteMagentaBackground2,hoverColor:i.tokens.colorPaletteMagentaBorderActive},navy:{backgroundColor:i.tokens.colorPaletteNavyBackground2,hoverColor:i.tokens.colorPaletteNavyBorderActive},pink:{backgroundColor:i.tokens.colorPalettePinkBackground2,hoverColor:i.tokens.colorPalettePinkBorderActive},plum:{backgroundColor:i.tokens.colorPalettePlumBackground2,hoverColor:i.tokens.colorPalettePlumBorderActive},purple:{backgroundColor:i.tokens.colorPalettePurpleBackground2,hoverColor:i.tokens.colorPalettePurpleBorderActive},red:{backgroundColor:i.tokens.colorPaletteRedBackground2,hoverColor:i.tokens.colorPaletteRedBorderActive},teal:{backgroundColor:i.tokens.colorPaletteTealBackground2,hoverColor:i.tokens.colorPaletteTealBorderActive},anchor:{backgroundColor:i.tokens.colorPaletteAnchorBackground2,hoverColor:i.tokens.colorPaletteAnchorBorderActive},"dark-red":{backgroundColor:i.tokens.colorPaletteDarkRedBackground2,hoverColor:i.tokens.colorPaletteDarkRedBorderActive},cranberry:{backgroundColor:i.tokens.colorPaletteCranberryBackground2,hoverColor:i.tokens.colorPaletteCranberryBorderActive},pumpkin:{backgroundColor:i.tokens.colorPalettePumpkinBackground2,hoverColor:i.tokens.colorPalettePumpkinBorderActive},peach:{backgroundColor:i.tokens.colorPalettePeachBackground2,hoverColor:i.tokens.colorPalettePeachBorderActive},marigold:{backgroundColor:i.tokens.colorPaletteMarigoldBackground2,hoverColor:i.tokens.colorPaletteMarigoldBorderActive},brass:{backgroundColor:i.tokens.colorPaletteBrassBackground2,hoverColor:i.tokens.colorPaletteBrassBorderActive},forest:{backgroundColor:i.tokens.colorPaletteForestBackground2,hoverColor:i.tokens.colorPaletteForestBorderActive},seafoam:{backgroundColor:i.tokens.colorPaletteSeafoamBackground2,hoverColor:i.tokens.colorPaletteSeafoamBorderActive},"dark-green":{backgroundColor:i.tokens.colorPaletteDarkGreenBackground2,hoverColor:i.tokens.colorPaletteDarkGreenBorderActive},"light-teal":{backgroundColor:i.tokens.colorPaletteLightTealBackground2,hoverColor:i.tokens.colorPaletteLightTealBorderActive},steel:{backgroundColor:i.tokens.colorPaletteSteelBackground2,hoverColor:i.tokens.colorPaletteSteelBorderActive},"royal-blue":{backgroundColor:i.tokens.colorPaletteRoyalBlueBackground2,hoverColor:i.tokens.colorPaletteRoyalBlueBorderActive},cornflower:{backgroundColor:i.tokens.colorPaletteCornflowerBackground2,hoverColor:i.tokens.colorPaletteCornflowerBorderActive},grape:{backgroundColor:i.tokens.colorPaletteGrapeBackground2,hoverColor:i.tokens.colorPaletteGrapeBorderActive},lilac:{backgroundColor:i.tokens.colorPaletteLilacBackground2,hoverColor:i.tokens.colorPaletteLilacBorderActive},mink:{backgroundColor:i.tokens.colorPaletteMinkBackground2,hoverColor:i.tokens.colorPaletteMinkBorderActive},platinum:{backgroundColor:i.tokens.colorPalettePlatinumBackground2,hoverColor:i.tokens.colorPalettePlatinumBorderActive}},n=t[`royal-blue`];return t[e]||n},[]),formatDate:t.useCallback((e,t)=>(0,a.format)((0,a.parseISO)(e),t),[])}),jt={start:`Start`,end:`End`,location:`Location`,attendees:`Attendees`,details:`Details`},Mt=`32px`,Nt=e=>({styles:{banner:(0,l.css)({display:`flex`,justifyContent:`center`,alignContent:`center`,alignItems:`center`,padding:`5px 10px 0px 10px`}),fieldContainer:(0,l.css)({paddingLeft:Mt}),title:(0,l.css)({lineClamp:2,overflow:`hidden`,display:`-webkit-box`,WebkitBoxOrient:`vertical`,wordBreak:`break-word`,WebkitLineClamp:2})}}),Pt=({fieldLabel:e,fieldValue:t,icon:r})=>(0,n.jsxs)(H,{children:[(0,n.jsx)(_t,{label:e,icon:r}),(0,n.jsx)(H,{paddingLeft:Mt,children:(0,n.jsx)(i.Body1,{children:t})})]}),Ft=e=>{let{event:r,strings:a=jt}=e,{title:o,start:s,end:c,location:l,category:u,attendees:d,weblink:f}=r,{styles:p}=Nt(r),{formatDate:m}=At(),h=m(s,`PPp`),g=m(c,`PPp`),_=(0,i.partitionAvatarGroupItems)({items:d?.map(e=>e.id)||[]}),v=t.useCallback(e=>d?.find(t=>t.id===e)||void 0,[d]),y=t.useCallback(()=>(0,n.jsxs)(H,{children:[(0,n.jsx)(_t,{label:a.attendees,icon:`ph:users-three`}),(0,n.jsx)(H,{paddingLeft:Mt,children:(0,n.jsxs)(i.AvatarGroup,{layout:`stack`,children:[_.inlineItems.map(e=>(0,n.jsx)(i.AvatarGroupItem,{name:v(e)?.name,image:{src:v(e)?.imageUrl}},e)),_.overflowItems&&(0,n.jsx)(i.AvatarGroupPopover,{children:_.overflowItems.map(e=>(0,n.jsx)(i.AvatarGroupItem,{name:v(e)?.name,image:{src:v(e)?.imageUrl}},e))})]})})]}),[_,v,a.attendees]);return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(Ge,{appearance:`subtle`,padding:`m`,paddingTop:`s`,width:`250px`,cardBody:(0,n.jsxs)(H,{RowGap:10,children:[(0,n.jsx)(`div`,{className:p.banner,children:(0,n.jsx)(i.Subtitle1,{className:p.title,children:o})}),(0,n.jsx)(i.Divider,{}),u&&(0,n.jsx)(H,{horizontal:!0,horizontalAlign:`end`,width:`100%`,children:(0,n.jsx)(i.Badge,{appearance:`filled`,children:u})}),(0,n.jsx)(Pt,{fieldLabel:a.start,fieldValue:h,icon:`mingcute:time-line`}),(0,n.jsx)(Pt,{fieldLabel:a.end,fieldValue:g,icon:`mingcute:time-line`}),(0,n.jsx)(Pt,{fieldLabel:a.location,fieldValue:l,icon:`mingcute:location-line`}),(0,n.jsx)(y,{})]}),cardFooterContent:(0,n.jsx)(H,{horizontal:!0,horizontalAlign:`end`,width:`100%`,children:(0,n.jsx)(i.Button,{appearance:`subtle`,onClick:()=>{window.open(f,`_blank`)},children:a.details})})})})},It=()=>({styles:{calendarWrapper:(0,l.css)({padding:`20px`,paddingTop:`10px`,overflow:`auto`,flex:1,display:`grid`,gridTemplateColumns:`repeat(7, 1fr)`,gridTemplateRows:`auto`,gridAutoRows:`minmax(100px, 1fr)`,gap:`1px`,width:`calc(100% - 40px)`}),header:(0,l.css)({display:`flex`,justifyContent:`start`,gap:`10px`,alignItems:`center`,padding:`16px`}),dayHeader:(0,l.css)({textAlign:`start`,padding:`8px`,borderBottom:`1px solid ${i.tokens.colorNeutralStroke1}`}),day:(0,l.css)({display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,border:`1px solid ${i.tokens.colorNeutralStroke1}`,backgroundColor:i.tokens.colorNeutralBackground1,position:`relative`}),otherMonthDay:(0,l.css)({color:i.tokens.colorNeutralStroke2,backgroundColor:i.tokens.colorNeutralBackground2}),cardDay:(0,l.css)({height:`100%`,minHeight:100,borderRadius:0,overflow:`hidden !important`,rowGap:5}),cardDayOnHover:(0,l.css)({":hover":{backgroundColor:i.tokens.colorNeutralBackground2}}),currentDay:(0,l.css)({borderTop:`5px solid ${i.tokens.colorBrandBackground}`}),currentDayLabel:(0,l.css)({color:i.tokens.colorBrandBackground,fontWeight:600}),eventCard:(0,l.css)({display:`flex`,flexDirection:`column`,alignItems:`flex-start`,zIndex:1}),eventContainer:(0,l.css)({display:`flex`,flexDirection:`column`,overflowY:`auto`,paddingTop:`5px`,paddingBottom:`5px`,paddingLeft:`5px`,paddingRight:`5px`,"::-webkit-scrollbar":{width:`5px`,height:`5px`},"::-webkit-scrollbar-track":{background:i.tokens.colorNeutralBackground4,borderRadius:`10px`},"::-webkit-scrollbar-thumb":{background:i.tokens.colorBrandStroke2Hover,borderRadius:`10px`},"::-webkit-scrollbar-thumb:hover":{background:i.tokens.colorNeutralStroke2}}),eventCardWeekView:(0,l.css)({backgroundColor:i.tokens.colorBrandBackground,color:i.tokens.colorNeutralForegroundOnBrand,borderRadius:`4px`,padding:`4px`,margin:`2px`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,height:`100%`}),popoverContent:(0,l.css)({padding:0,borderTopWidth:20,borderTopStyle:`solid`}),cardMonthTitle:(0,l.css)({display:`-webkit-box`,"-webkit-line-clamp":`1`,"-webkit-box-orient":`vertical`,textAlign:`start`,textOverflow:`ellipsis`,paddingLeft:`8px`,wordBreak:`break-word`,overflow:`hidden`})},applyEventHouverColorClass:(e,t)=>(0,l.css)({backgroundColor:e??i.tokens.colorBrandBackground,":hover":{backgroundColor:t??i.tokens.colorBrandBackgroundHover}})}),Lt=e=>{let r=(0,i.useId)(),{events:o,date:s,onCardHoverChange:c,columnHeight:l}=e,{styles:u,applyEventHouverColorClass:d}=It(),f=t.useRef(null),{getEventColors:p,getCalendarColors:m}=At(),h=t.useCallback(e=>{c&&c(!0,e)},[c]),g=t.useCallback(e=>{c&&c(!1,e)},[c]),_=t.useCallback(e=>{f.current?.setTarget(e)},[f]),v=t.useCallback((e,t,r)=>(0,n.jsx)(`div`,{ref:_,children:(0,n.jsx)(Ge,{className:(0,i.mergeClasses)(u.eventCard,d(r.backgroundColor,r.backgroundColor)),paddingTop:`4px`,paddingBottom:`4px`,paddingLeft:`8px`,paddingRight:`8px`,marginTop:e===0?`0px`:`5px`,cardHeader:(0,n.jsx)(i.Caption1,{className:u.cardMonthTitle,children:t.title}),onMouseEnter:()=>h(t.title),onMouseLeave:()=>g(t.title)})},t.id??`card-${e}`),[h,g,d]),y=t.useCallback((e,t,a)=>(0,n.jsxs)(i.Popover,{withArrow:!0,mouseLeaveDelay:30,closeOnScroll:!0,closeOnIframeFocus:!0,openOnHover:!0,children:[(0,n.jsx)(i.PopoverTrigger,{children:v(t,e,a)}),(0,n.jsx)(i.PopoverSurface,{"aria-labelledby":r,className:(0,i.mergeClasses)(u.popoverContent),children:(0,n.jsx)(Ft,{event:e})})]},t),[v,r,u.popoverContent]);return!o||!o?.length?(0,n.jsx)(n.Fragment,{children:` `}):(0,n.jsx)(`div`,{style:{height:l},className:u.eventContainer,children:o.map((e,n)=>{if(!(0,a.isWithinInterval)(s,{start:(0,a.startOfDay)(new Date(e.start)),end:(0,a.endOfDay)(new Date(e.end))}))return null;let r;r=e.color?m(e.color):p(e.category);let o=e.onRenderInMonthView?.(e),c=e.id??`event-${n}`;return t.isValidElement(o)?t.cloneElement(o,{key:c,className:(0,i.mergeClasses)(o.props.className,u.eventCard)}):e.enableOnHouver?y(e,n,r):v(n,e,r)})})},Rt=e=>{let{day:r,currentMonth:o,events:s,date:c,columnHeight:l,onDayClick:u}=e,{styles:d}=It(),f=new Date,[p,m]=t.useState(!1),h=t.useMemo(()=>(0,a.isSameDay)(c,f),[c,f]),g=t.useMemo(()=>(0,n.jsx)(H,{horizontal:!0,horizontalAlign:`start`,verticalAlign:`center`,paddingLeft:`m`,paddingRight:`m`,children:(0,n.jsxs)(i.Body2,{className:d.currentDayLabel,children:[r,` `,f.toLocaleString(`default`,{month:`short`})]})}),[r]),_=t.useCallback(e=>{m(e)},[]);return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(Ge,{onClick:u?()=>u(c):void 0,className:(0,i.mergeClasses)(d.cardDay,o?``:d.otherMonthDay,h?d.currentDay:``,p?``:d.cardDayOnHover),cardHeader:h?g:(0,n.jsx)(H,{horizontal:!0,paddingLeft:`m`,paddingRight:`m`,children:(0,n.jsx)(i.Body2,{children:r})}),paddingTop:`m`,paddingBottom:`m`,paddingLeft:`0px`,paddingRight:`0px`,cardBody:(0,n.jsx)(Lt,{events:s,date:c,onCardHoverChange:_,columnHeight:l-60})})})},zt=()=>({styles:{container:(0,l.css)({display:`flex`,flexDirection:`column`,width:`calc(100% - 40px)`,height:`100vh`,overflow:`hidden`,padding:`20px`}),header:(0,l.css)({display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:`16px`,borderBottom:`1px solid ${i.tokens.colorNeutralStroke1}`}),weekGrid:(0,l.css)({display:`grid`,gridTemplateColumns:`80px repeat(7, 1fr)`,gridTemplateRows:`50px 40px repeat(48, 33px)`,height:`fit-content`,overflowY:`auto`,border:`1px solid ${i.tokens.colorNeutralStroke1}`,maxHeight:`calc(100vh - 100px)`,scrollbarWidth:`thin`,scrollbarColor:`${i.tokens.colorBrandBackground} ${i.tokens.colorNeutralBackground1}`,"&::-webkit-scrollbar":{width:`8px`},"&::-webkit-scrollbar-track":{background:i.tokens.colorNeutralBackground1},"&::-webkit-scrollbar-thumb":{background:i.tokens.colorBrandBackground,borderRadius:`4px`},"&::-webkit-scrollbar-thumb:hover":{background:i.tokens.colorBrandBackgroundHover}}),blankHeader:(0,l.css)({gridColumn:`1`,backgroundColor:i.tokens.colorNeutralBackground3,borderBottom:`3px solid ${i.tokens.colorNeutralStroke3}`,position:`sticky`,top:0,zIndex:10}),timeColumn:(0,l.css)({gridColumn:`1`,gridRow:`3 / span 49`,display:`flex`,flexDirection:`column`,backgroundColor:i.tokens.colorNeutralBackground1,borderRight:`1px solid ${i.tokens.colorNeutralStroke1}`}),timeCell:(0,l.css)({height:`100%`,display:`flex`,alignItems:`center`,fontSize:`12px`,color:i.tokens.colorNeutralForeground3,borderBottom:`1px solid ${i.tokens.colorNeutralStroke1}`,justifyContent:`center`}),fullDayRow:(0,l.css)({gridRow:`2`,display:`grid`,gridTemplateColumns:`80px repeat(7, 1fr)`,gap:`0`,padding:`0`,backgroundColor:i.tokens.colorNeutralBackground2,borderBottom:`3px solid ${i.tokens.colorNeutralStroke2}`}),fullDayLabel:(0,l.css)({gridColumn:`1`,display:`flex`,alignItems:`center`,justifyContent:`center`,alignContent:`center`,color:i.tokens.colorBrandBackground,padding:`5px`,borderRight:`1px solid ${i.tokens.colorNeutralStroke1}`,borderBottom:`3px solid ${i.tokens.colorNeutralStroke2}`}),fullDayCell:(0,l.css)({borderRight:`1px solid ${i.tokens.colorNeutralStroke1}`,display:`flex`,flexDirection:`row`,gap:`0px`,padding:`4px`,borderBottom:`3px solid ${i.tokens.colorNeutralStroke2}`,overflow:`hidden`}),fullDayEvent:(0,l.css)({flex:`1 1 auto`,minWidth:`24px`,height:`24px`,padding:`4px 8px`,backgroundColor:i.tokens.colorBrandBackground,borderRadius:`4px`,overflow:`hidden`,display:`flex`,alignItems:`center`,justifyContent:`center`}),dayHeaderCell:(0,l.css)({textAlign:`center`,backgroundColor:i.tokens.colorNeutralBackground2,padding:`8px`,fontWeight:`bold`,borderBottom:`1px solid ${i.tokens.colorNeutralStroke1}`,position:`sticky`,top:0,zIndex:10}),todayHeaderCell:(0,l.css)({borderTop:`5px solid ${i.tokens.colorBrandBackground}`}),eventCard:(0,l.css)({padding:2,alignItems:`center`,justifyContent:`center`,marginRight:`2px`,zIndex:1,position:`absolute`,alignContent:`center`,overflow:`hidden`,":hover":{pointerEvents:`auto`,cursor:`pointer`}}),event:(0,l.css)({height:`100%`,backgroundColor:i.tokens.colorBrandBackground,borderRadius:`4px`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,overflow:`hidden`,display:`flex`,alignItems:`center`,justifyContent:`center`,marginRight:`2px`,zIndex:1,position:`absolute`,alignContent:`center`,":hover":{pointerEvents:`auto`,cursor:`pointer`}}),dayCell:(0,l.css)({borderBottom:`1px solid ${i.tokens.colorNeutralStroke1}`,borderRight:`1px solid ${i.tokens.colorNeutralStroke1}`,position:`relative`,overflow:`visible`,FlexDirection:`column`,gap:`4px`}),currentTimeIndicator:(0,l.css)({position:`absolute`,left:0,height:`2px`,backgroundColor:i.tokens.colorPaletteRedBorderActive,width:`100%`,zIndex:1}),currentHalfHourCell:(0,l.css)({border:`2px solid ${i.tokens.colorPaletteRedBorderActive}`}),eventTitle:(0,l.css)({display:`-webkit-box`,"-webkit-line-clamp":`1`,"-webkit-box-orient":`vertical`,textAlign:`start`,textOverflow:`ellipsis`,paddingLeft:`8px`,wordBreak:`break-word`,overflow:`hidden`}),popoverContent:(0,l.css)({padding:0,borderTopWidth:20,borderTopStyle:`solid`})},applyEventHouverColorClass:t.default.useCallback((e,t)=>(0,l.css)({backgroundColor:e??i.tokens.colorBrandBackground,":hover":{backgroundColor:t??i.tokens.colorBrandBackgroundHover}}),[i.tokens.colorBrandBackground,i.tokens.colorBrandBackgroundHover]),appyDynamicStyles:t.default.useCallback((e,t,n,r)=>(0,l.css)({flex:`0 0 calc(100% / ${t})`,height:`${n*r}px`,left:`${e*10}%`,width:`calc(${100-e*10}% - 8px)`,margin:4,marginTop:0,marginBottom:0}),[])}),Bt={timeSeparator:` - `,hourSuffix:`H`},Vt=({event:e,colors:r,spanSlots:a,rowHeight:o,eventIndex:s,eventCount:c,strings:l=Bt})=>{let u=(0,i.useId)(),{styles:d,applyEventHouverColorClass:f,appyDynamicStyles:p}=zt(),m=t.useRef(null),{formatDate:h}=At(),g=t.useMemo(()=>(0,n.jsx)(`div`,{children:(0,n.jsxs)(H,{columnGap:4,verticalAlign:`center`,children:[(0,n.jsx)(i.Caption1Strong,{className:d.eventTitle,children:e.title}),(0,n.jsxs)(H,{columnGap:4,horizontal:!0,verticalAlign:`center`,horizontalAlign:`start`,children:[(0,n.jsxs)(i.Caption1,{children:[h(e.start,`HH:mm`),l.hourSuffix]}),l.timeSeparator,(0,n.jsxs)(i.Caption1,{children:[h(e.end,`HH:mm`),l.hourSuffix]})]})]})}),[e,h,l,d.eventTitle]);return(0,n.jsx)(i.Card,{ref:m,className:(0,i.mergeClasses)(d.eventCard,f(r.backgroundColor,r.backgroundColor),p(s,c,o,a)),children:e.enableOnHouver?(0,n.jsxs)(i.Popover,{withArrow:!0,mouseLeaveDelay:50,closeOnScroll:!0,closeOnIframeFocus:!0,openOnHover:!0,children:[(0,n.jsx)(i.PopoverTrigger,{children:g}),(0,n.jsx)(i.PopoverSurface,{"aria-labelledby":u,className:(0,i.mergeClasses)(d.popoverContent),children:(0,n.jsx)(Ft,{event:e})})]}):g},e.id)},Ht=({event:e,eventCount:r,spanSlots:a,rowHeight:o,eventIndex:s,view:c})=>{let{styles:l,appyDynamicStyles:u}=zt(),{getEventColors:d,getCalendarColors:f}=At(),p=e.color?f(e.color):d(e.category),m=c===`day`?e.onRenderInDayView?.(e):e.onRenderInWeekView?.(e);return t.isValidElement(m)?t.cloneElement(m,{event:e,className:(0,i.mergeClasses)(m.props.className,l.eventCard,u(s,r,o,a)),style:{...m.props.style}}):(0,n.jsx)(Vt,{event:e,colors:p,spanSlots:a,rowHeight:o,eventIndex:s,eventCount:r},e.id)},Ut=e=>{let n=(0,t.useCallback)(e=>e.map(e=>({...e,id:e.id||(0,m.v4)()})),[]),r=(0,t.useCallback)(t=>new Date(new Date(t).toLocaleString(void 0,{timeZone:e})),[e]);return{getMonthCalendar:(0,t.useCallback)((e,t,i)=>{let o=n(e),s=new Date(t,i+1,0).getDate(),c={};for(let e=1;e<=s;e++){let n=(0,a.format)(new Date(t,i,e),`yyyy-MM-dd`);c[n]=[]}return o.forEach(e=>{let t=r(e.start),n=r(e.end),i=new Date(t);for(;i<=n;){let t=(0,a.format)(i,`yyyy-MM-dd`);c[t]&&c[t].push(e),i.setDate(i.getDate()+1)}}),c},[r]),getWeekEvents:(0,t.useCallback)((e,t)=>{let i=[],o=r(t),s=n(e);for(let e=0;e<7;e++){let t=new Date(o);t.setDate(o.getDate()+e);let n=(0,a.format)(t,`yyyy-MM-dd`),c=Array.from({length:48},(e,t)=>({time:`${String(Math.floor(t/2)).padStart(2,`0`)}:${t%2==0?`00`:`30`}`,events:[]})),l=[];s.forEach(e=>{let t=r(e.start),i=r(e.end);if(e.isFullDay){(0,a.format)(t,`yyyy-MM-dd`)<=n&&(0,a.format)(i,`yyyy-MM-dd`)>=n&&l.push(e);return}if((0,a.format)(t,`yyyy-MM-dd`)<=n&&(0,a.format)(i,`yyyy-MM-dd`)>=n){let r=new Date(t);for(;r<=i;){if((0,a.format)(r,`yyyy-MM-dd`)===n){let t=r.getHours()*2+(r.getMinutes()>=30?1:0);c[t]&&c[t].events.push(e)}r.setMinutes(r.getMinutes()+30)}}}),i.push({date:n,fullDayEvents:l,timeSlots:c})}return i},[r])}},Wt=()=>({styles:{container:(0,l.css)({display:`flex`,flexDirection:`column`,width:`calc(100% - 40px)`,height:`100vh`,overflow:`hidden`,padding:`20px`}),header:(0,l.css)({display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:`16px`,borderBottom:`1px solid ${i.tokens.colorNeutralStroke1}`}),dayGrid:(0,l.css)({display:`grid`,gridTemplateColumns:`80px 1fr`,gridTemplateRows:`50px 40px repeat(48, 33px)`,height:`calc(100vh - 100px)`,overflowY:`auto`,border:`1px solid ${i.tokens.colorNeutralStroke1}`,maxHeight:`fit-content`,scrollbarWidth:`thin`,scrollbarColor:`${i.tokens.colorBrandBackground} ${i.tokens.colorNeutralBackground1}`,"&::-webkit-scrollbar":{width:`8px`},"&::-webkit-scrollbar-track":{background:i.tokens.colorNeutralBackground1},"&::-webkit-scrollbar-thumb":{background:i.tokens.colorBrandBackground,borderRadius:`4px`},"&::-webkit-scrollbar-thumb:hover":{background:i.tokens.colorBrandBackgroundHover}}),blankHeader:(0,l.css)({gridColumn:`1`,backgroundColor:i.tokens.colorNeutralBackground3,borderBottom:`3px solid ${i.tokens.colorNeutralStroke3}`}),timeColumn:(0,l.css)({gridColumn:`1`,gridRow:`3 / span 49`,display:`flex`,flexDirection:`column`,backgroundColor:i.tokens.colorNeutralBackground1,borderRight:`1px solid ${i.tokens.colorNeutralStroke1}`}),timeCell:(0,l.css)({height:`100%`,maxHeight:`32px`,minHeight:`32px`,display:`flex`,alignItems:`center`,fontSize:`12px`,color:i.tokens.colorNeutralForeground3,borderBottom:`1px solid ${i.tokens.colorNeutralStroke1}`,justifyContent:`center`}),fullDayRow:(0,l.css)({gridRow:`2`,display:`grid`,gridTemplateColumns:`80px 33px`,gap:`0`,padding:`0`,backgroundColor:i.tokens.colorNeutralBackground2,borderBottom:`3px solid ${i.tokens.colorNeutralStroke2}`}),fullDayLabel:(0,l.css)({gridColumn:`1`,display:`flex`,alignItems:`center`,justifyContent:`center`,alignContent:`center`,color:i.tokens.colorBrandBackground,padding:`5px`,borderRight:`1px solid ${i.tokens.colorNeutralStroke1}`,borderBottom:`3px solid ${i.tokens.colorNeutralStroke2}`}),fullDayCell:(0,l.css)({borderRight:`1px solid ${i.tokens.colorNeutralStroke1}`,display:`flex`,flexDirection:`row`,gap:`2px`,padding:`4px`,borderBottom:`3px solid ${i.tokens.colorNeutralStroke2}`,overflow:`hidden`}),fullDayEvent:(0,l.css)({flex:`1 1 auto`,minWidth:`24px`,height:`24px`,padding:`4px 8px`,backgroundColor:i.tokens.colorBrandBackground,color:i.tokens.colorNeutralForegroundOnBrand,borderRadius:`4px`,overflow:`hidden`,display:`flex`,alignItems:`center`,justifyContent:`center`}),dayHeaderCell:(0,l.css)({textAlign:`center`,backgroundColor:i.tokens.colorNeutralBackground2,padding:`8px`,fontWeight:`bold`,borderBottom:`1px solid ${i.tokens.colorNeutralStroke1}`}),todayHeaderCell:(0,l.css)({borderTop:`5px solid ${i.tokens.colorBrandBackground}`}),eventCard:(0,l.css)({alignItems:`center`,justifyContent:`center`,marginRight:`2px`,zIndex:1,position:`absolute`,alignContent:`center`,overflow:`hidden`}),dayCell:(0,l.css)({borderBottom:`1px solid ${i.tokens.colorNeutralStroke1}`,borderRight:`1px solid ${i.tokens.colorNeutralStroke1}`,position:`relative`,overflow:`visible`,FlexDirection:`column`,gap:`4px`}),currentTimeIndicator:(0,l.css)({position:`absolute`,left:0,height:`2px`,backgroundColor:i.tokens.colorPaletteRedBorderActive,width:`100%`,zIndex:1}),currentHalfHourCell:(0,l.css)({border:`2px solid ${i.tokens.colorPaletteRedBorderActive}`}),eventTitle:(0,l.css)({display:`-webkit-box`,"-webkit-line-clamp":`1`,"-webkit-box-orient":`vertical`,textAlign:`start`,textOverflow:`ellipsis`,paddingLeft:`8px`,wordBreak:`break-word`,overflow:`hidden`})},applyEventHouverColorClass:(e,t)=>(0,l.css)({backgroundColor:e??i.tokens.colorBrandBackground,":hover":{backgroundColor:t??i.tokens.colorBrandBackgroundHover}})}),Gt={allDay:`All Day`},Kt=33,qt=e=>{let{events:r,currentDay:o,height:s,strings:c=Gt}=e,{styles:l}=Wt(),u=(0,t.useRef)(null),{getSpanSlots:d,getEventColors:f,getCalendarColors:p}=At(),m=Intl.DateTimeFormat().resolvedOptions().timeZone,{getWeekEvents:h}=Ut(m),g=t.useCallback(()=>Array.from({length:24},(e,r)=>(0,n.jsxs)(t.Fragment,{children:[(0,n.jsx)(`div`,{className:l.timeCell,children:(0,n.jsxs)(i.Body1Strong,{children:[r,`:00`]})}),(0,n.jsx)(`div`,{className:l.timeCell})]},r)),[l.timeCell]),_=t.useCallback(()=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`div`,{className:l.blankHeader}),Array.from({length:1},(e,t)=>{let r=(0,a.addDays)(o,t),s=(0,a.isToday)(r)?l.todayHeaderCell:``;return(0,n.jsxs)(`div`,{className:(0,i.mergeClasses)(l.dayHeaderCell,s),children:[(0,n.jsx)(i.Text,{weight:`semibold`,size:600,style:{paddingRight:10},children:(0,a.format)(r,`dd`)}),(0,n.jsx)(i.Subtitle1,{children:(0,a.format)(r,`LLLL, yyyy`)})]},t)})]}),[o,l.blankHeader,l.dayHeaderCell,l.todayHeaderCell]),v=t.useCallback(()=>{let e=h(r,o.toISOString());return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`div`,{className:l.fullDayLabel,children:(0,n.jsx)(i.Body1,{children:c.allDay})}),Array.from({length:1},(t,r)=>{let s=(0,a.format)((0,a.addDays)(o,r),`yyyy-MM-dd`),c=e.find(e=>e.date===s)?.fullDayEvents||[];return(0,n.jsx)(`div`,{className:l.fullDayCell,children:c.map(e=>(0,n.jsx)(`div`,{className:l.fullDayEvent,style:{gridColumn:`${r+2}`,backgroundColor:e.color?p(e.color).backgroundColor:f(e.category).backgroundColor},children:(0,n.jsx)(i.Caption1Strong,{className:l.eventTitle,children:e.title})},e.id))},r)})]})},[o,h,l.fullDayCell,l.fullDayEvent,l.fullDayLabel,l.eventTitle,p,f,r,c.allDay]),y=t.useCallback(()=>{let e=h(r,o.toISOString());return Array.from({length:1},(r,i)=>{let s=(0,a.format)((0,a.addDays)(o,i),`yyyy-MM-dd`),c=e.find(e=>e.date===s);return(0,n.jsx)(t.Fragment,{children:c?.timeSlots.map((e,t)=>{let r=e.events.length;return(0,n.jsx)(`div`,{className:l.dayCell,style:{gridRow:t+3},children:e.events.map((e,i)=>{let{spanSlots:a,startSlot:o}=d(new Date(e.start),new Date(e.end));return t===o?(0,n.jsx)(Ht,{event:e,eventCount:r,spanSlots:a,rowHeight:Kt,eventIndex:i,view:`day`},e.id):null})},t)})},i)})},[o,d,h,l.dayCell,r]);return(0,n.jsx)(`div`,{className:l.container,style:{height:s},children:(0,n.jsxs)(`div`,{ref:u,className:l.dayGrid,children:[(0,n.jsx)(`div`,{className:l.timeColumn,children:g()}),_(),v(),y()]})})},K=function(e){return e.Day=`day`,e.Week=`week`,e.Month=`month`,e}({}),Jt={month:`Month`,week:`Week`,day:`Day`},Yt=e=>{let{onSelected:r,value:a,strings:o=Jt}=e,[s,c]=t.useState(a??K.Month),[l,u]=t.useState({view:[a??K.Month]}),f=t.useMemo(()=>(0,d.bundleIcon)(d.CalendarDayFilled,d.CalendarDayRegular),[]),p=t.useMemo(()=>(0,d.bundleIcon)(d.CalendarMonthFilled,d.CalendarMonthRegular),[]),m=t.useMemo(()=>(0,d.bundleIcon)(d.CalendarWorkWeekFilled,d.CalendarWorkWeekRegular),[]);t.useEffect(()=>{a!==void 0&&(c(a),u({view:[a]}))},[a]);let[h,g]=t.useState(!1),_=t.useCallback((e,t)=>{g(t.open)},[]),v=t.useCallback(()=>{switch(s){case K.Month:return(0,n.jsx)(p,{});case K.Week:return(0,n.jsx)(m,{});case K.Day:return(0,n.jsx)(f,{});default:return(0,n.jsx)(p,{})}},[s]),y=t.useCallback(e=>{switch(e){case K.Month:return o.month;case K.Week:return o.week;case K.Day:return o.day;default:return o.month}},[o]),b=t.useCallback((e,{name:t,checkedItems:n})=>{if(t===`view`){let e=n[0];c(e),u({view:n}),r(e)}},[r]);return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(i.Menu,{open:h,onOpenChange:_,children:[(0,n.jsx)(i.MenuTrigger,{disableButtonEnhancement:!0,children:(0,n.jsx)(i.MenuButton,{shape:`circular`,icon:v(),style:{minWidth:`150px`},children:y(s)})}),(0,n.jsx)(i.MenuPopover,{children:(0,n.jsxs)(i.MenuList,{onCheckedValueChange:b,checkedValues:l,children:[(0,n.jsx)(i.MenuItemRadio,{icon:(0,n.jsx)(f,{}),name:`view`,value:K.Day,children:o.day}),(0,n.jsx)(i.MenuItemRadio,{icon:(0,n.jsx)(m,{}),name:`view`,value:K.Week,children:o.week}),(0,n.jsx)(i.MenuItemRadio,{icon:(0,n.jsx)(p,{}),name:`view`,value:K.Month,children:o.month})]})})]})})},Xt=t.memo(e=>{let{onSelected:a,value:o}=e,[s,c]=t.useState(o??new Date),[l,u]=t.useState(()=>(0,r.format)(o??new Date,`dd MMM, yyyy`)),[f,p]=t.useState(!1),m=t.useCallback((e,t)=>{p(t.open)},[]),g=t.useMemo(()=>(0,d.bundleIcon)(d.CalendarMonthFilled,d.CalendarMonthRegular),[]),_=t.useCallback(e=>{if(e){let t=Intl.DateTimeFormat().resolvedOptions().timeZone,n=(0,r.utcToZonedTime)(e,t);c(n),u((0,r.format)(n,`dd MMM, yyyy`)),a(n),p(!1)}},[a]);return(0,n.jsxs)(i.Menu,{open:f,onOpenChange:m,children:[(0,n.jsx)(i.MenuTrigger,{disableButtonEnhancement:!0,children:(0,n.jsx)(i.MenuButton,{shape:`circular`,icon:(0,n.jsx)(g,{}),style:{minWidth:`200px`},"aria-label":`Select date: ${l}`,children:l})}),(0,n.jsx)(i.MenuPopover,{style:{maxWidth:`fit-content`},children:(0,n.jsx)(i.MenuList,{children:(0,n.jsx)(h.Calendar,{highlightSelectedMonth:!0,showGoToToday:!0,onSelectDate:_,value:s})})})]})}),Zt=()=>({root:(0,l.css)({outline:`none`})}),Qt={months:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],shortMonths:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],days:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],shortDays:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],goToToday:`Go to today`},$t=e=>{let{onDateChange:r,defaultSelectedDate:i,onDismiss:a,strings:o=Qt}=e,s=Zt(),[c,l]=t.useState(i??new Date),u=t.useCallback((e,t)=>{l(e),r(e),a()},[r,a]);return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(h.Calendar,{className:s.root,dateRangeType:h.DateRangeType.Month,highlightSelectedMonth:!0,isDayPickerVisible:!1,onSelectDate:u,value:c,onDismiss:a,showGoToToday:!1,allFocusable:!1,strings:o})})},en=e=>{let{onSelected:r,value:o}=e,s=(0,d.bundleIcon)(d.CalendarMonthFilled,d.CalendarMonthRegular),[c,l]=t.useState(o??new Date);t.useEffect(()=>{r(o??new Date),l(o??new Date)},[o]);let[u,f]=t.useState(!1),p=(e,t)=>{f(t.open)},m=t.useCallback(e=>{r(e),l(e)},[]);return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(i.Menu,{open:u,onOpenChange:p,children:[(0,n.jsx)(i.MenuTrigger,{disableButtonEnhancement:!0,children:(0,n.jsx)(i.MenuButton,{shape:`circular`,icon:(0,n.jsx)(s,{}),style:{minWidth:`200px`},"aria-label":`Select month: ${(0,a.format)(c,`MMMM yyyy`)}`,children:(0,a.format)(c,`MMMM yyyy`)})}),(0,n.jsx)(i.MenuPopover,{children:(0,n.jsx)(i.MenuList,{children:(0,n.jsx)($t,{onDateChange:m,defaultSelectedDate:c,onDismiss:()=>{f(!1)}})})})]})})},tn={selectWeekPlaceholder:`Select a week`},nn=e=>{let t=Intl.DateTimeFormat().resolvedOptions().timeZone,n=(0,r.format)(e.start,`MMM`,{timeZone:t}),i=(0,r.format)(e.end,`MMM`,{timeZone:t});return(0,r.format)(e.start,`yyyy`,{timeZone:t})===(0,r.format)(e.end,`yyyy`,{timeZone:t})?n===i?`${(0,r.format)(e.start,`dd`,{timeZone:t})} - ${(0,r.format)(e.end,`dd MMM yyyy`,{timeZone:t})}`:`${(0,r.format)(e.start,`dd MMM`,{timeZone:t})} - ${(0,r.format)(e.end,`dd MMM yyyy`,{timeZone:t})}`:`${(0,r.format)(e.start,`dd MMM yyyy`,{timeZone:t})} - ${(0,r.format)(e.end,`dd MMM yyyy`,{timeZone:t})}`},rn=e=>{let t=Intl.DateTimeFormat().resolvedOptions().timeZone,n=(0,r.utcToZonedTime)(e,t),i=new Date(n);i.setDate(n.getDate()-n.getDay());let a=new Date(i);return a.setDate(i.getDate()+6),{start:(0,r.utcToZonedTime)(i,t),end:(0,r.utcToZonedTime)(a,t)}},an=t.memo(e=>{let{onSelected:r,value:a,strings:o=tn}=e,s=h.DateRangeType.Week,[c,l]=t.useState(a??new Date),[u,f]=t.useState(()=>{let e=a??new Date;return e?nn(rn(e)):o.selectWeekPlaceholder}),[p,m]=t.useState(!1),g=t.useCallback((e,t)=>{m(t.open)},[]),_=t.useMemo(()=>(0,d.bundleIcon)(d.CalendarMonthFilled,d.CalendarMonthRegular),[]),v=t.useCallback(e=>{if(e){l(e);let t=rn(e);f(nn(t)),r({startDate:t.start,endDate:t.end}),m(!1)}},[r]),y=t.useMemo(()=>0,[]);return(0,n.jsxs)(i.Menu,{open:p,onOpenChange:g,children:[(0,n.jsx)(i.MenuTrigger,{disableButtonEnhancement:!0,children:(0,n.jsx)(i.MenuButton,{shape:`circular`,icon:(0,n.jsx)(_,{}),style:{minWidth:`200px`},"aria-label":`Select week: ${u}`,children:u})}),(0,n.jsx)(i.MenuPopover,{style:{maxWidth:`fit-content`},children:(0,n.jsx)(i.MenuList,{children:(0,n.jsx)(h.Calendar,{dateRangeType:s,highlightSelectedMonth:!0,showGoToToday:!0,onSelectDate:v,value:c,firstDayOfWeek:y})})})]})}),on={today:`Today`,previous:`Previous`,next:`Next`},sn=t.memo(({selectedView:e,onSelectedView:r,currentDate:a,setCurrentDate:o,onWeekChange:s,onMonthChange:c,onDayChange:l,strings:u=on})=>{let f=t.useMemo(()=>(0,d.bundleIcon)(d.ArrowDownFilled,d.ArrowDownRegular),[]),p=t.useMemo(()=>(0,d.bundleIcon)(d.ArrowUpFilled,d.ArrowUpRegular),[]),m=t.useCallback(e=>{s(e.startDate),o(e.startDate)},[s,o]),h=t.useCallback(e=>{c(e),o(e)},[c,o]),g=t.useCallback(e=>{l(e),o(e)},[l,o]),_=t.useCallback(()=>{switch(e){case K.Month:return(0,n.jsx)(en,{onSelected:h,value:a});case K.Week:return(0,n.jsx)(an,{onSelected:m,value:a});case K.Day:return(0,n.jsx)(Xt,{onSelected:g,value:a});default:return(0,n.jsx)(en,{onSelected:h,value:a})}},[e,h,m,g,a]),v=t.useCallback(()=>(0,n.jsx)(i.Tooltip,{content:u.today,relationship:`label`,children:(0,n.jsx)(i.Button,{shape:`circular`,icon:(0,n.jsx)(d.CalendarTodayRegular,{}),size:`medium`,onClick:()=>l(new Date),children:u.today})}),[l,u.today]),y=t.useCallback(t=>{let n=new Date(a);switch(e){case K.Month:n.setMonth(n.getMonth()+t),c(n);break;case K.Week:n.setDate(n.getDate()+t*7),s(n);break;case K.Day:n.setDate(n.getDate()+t),l(n);break;default:break}o(n)},[a,e,c,s,l,o]);return(0,n.jsxs)(H,{width:`calc(100% - 40px)`,height:`fit-content`,horizontal:!0,horizontalAlign:`space-between`,verticalAlign:`center`,paddingLeft:`20px`,paddingRight:`20px`,paddingBottom:`10px`,paddingTop:`10px`,columnGap:10,styles:{overflow:`hidden`},children:[(0,n.jsxs)(H,{horizontal:!0,horizontalAlign:`start`,verticalAlign:`center`,columnGap:10,children:[(0,n.jsx)(v,{}),(0,n.jsx)(_,{}),(0,n.jsx)(i.Tooltip,{content:u.previous,relationship:`label`,children:(0,n.jsx)(i.Button,{size:`medium`,icon:(0,n.jsx)(p,{fontSize:14}),onClick:()=>y(-1)})}),(0,n.jsx)(i.Tooltip,{content:u.next,relationship:`label`,children:(0,n.jsx)(i.Button,{size:`medium`,icon:(0,n.jsx)(f,{fontSize:14}),onClick:()=>y(1)})})]}),(0,n.jsx)(H,{horizontal:!0,horizontalAlign:`start`,verticalAlign:`center`,columnGap:10,children:(0,n.jsx)(Yt,{onSelected:r,value:e})})]})}),cn={allDay:`All Day`},ln=e=>{let{events:r,currentDay:o,height:s,strings:l=cn}=e,{styles:u}=zt(),[d]=(0,t.useState)(o),[f,p]=(0,t.useState)(32),m=(0,t.useRef)(null),{getSpanSlots:h,getEventColors:g,getCalendarColors:_,formatDate:v}=At(),y=(0,a.startOfWeek)(d,{weekStartsOn:0}),b=Intl.DateTimeFormat().resolvedOptions().timeZone,{getWeekEvents:x}=Ut(b);(0,t.useEffect)(()=>{let e=new c.ResizeObserver(()=>{if(m.current){let e=m.current.querySelector(`.dayCell`);e&&p(e.offsetHeight)}});return m.current&&e.observe(m.current),()=>{e.disconnect()}},[]);let S=t.useCallback(()=>Array.from({length:24},(e,r)=>(0,n.jsxs)(t.Fragment,{children:[(0,n.jsx)(`div`,{className:u.timeCell,children:(0,n.jsxs)(i.Body1Strong,{children:[r,`:00`]})}),(0,n.jsx)(`div`,{className:u.timeCell})]},r)),[u.timeCell]),C=t.useCallback(()=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`div`,{className:u.blankHeader}),Array.from({length:7},(e,t)=>{let r=(0,a.addDays)(y,t),o=(0,a.isToday)(r)?u.todayHeaderCell:``;return(0,n.jsxs)(`div`,{className:(0,i.mergeClasses)(u.dayHeaderCell,o),children:[(0,n.jsx)(i.Text,{weight:`regular`,size:600,style:{paddingRight:10},children:v(r.toISOString(),`dd`)}),(0,n.jsx)(i.Body1,{children:v(r.toISOString(),`EEE`)})]},t)})]}),[y,u,v]),w=t.useCallback(()=>{let e=x(r,y.toISOString());return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`div`,{className:u.fullDayLabel,children:(0,n.jsx)(i.Body1,{children:l.allDay})}),Array.from({length:7},(t,r)=>{let o=v((0,a.addDays)(y,r).toISOString(),`yyyy-MM-dd`),s=e.find(e=>e.date===o)?.fullDayEvents||[];return(0,n.jsx)(`div`,{className:u.fullDayCell,children:s.map(e=>(0,n.jsx)(`div`,{className:u.fullDayEvent,style:{gridColumn:`${r+2}`,backgroundColor:e.color?_(e.color).backgroundColor:g(e.category).backgroundColor},children:(0,n.jsx)(i.Caption1Strong,{className:u.eventTitle,children:e.title})},e.id))},r)})]})},[y,u,x,_,g,r,v,l.allDay]),T=t.useCallback(()=>{let e=x(r,y.toISOString());return Array.from({length:7},(t,r)=>{let i=(0,a.format)((0,a.addDays)(y,r),`yyyy-MM-dd`);return(0,n.jsx)(n.Fragment,{children:e.find(e=>e.date===i)?.timeSlots.map((e,t)=>{let r=e.events.length;return(0,n.jsx)(`div`,{className:u.dayCell,style:{gridRow:t+3},children:e.events.map((e,i)=>{let{spanSlots:a,startSlot:o}=h(new Date(e.start),new Date(e.end));return t===o?(0,n.jsx)(Ht,{event:e,eventCount:r,spanSlots:a,rowHeight:f,eventIndex:i,view:`week`},e.id):null})},t)})})})},[y,u,x,h,f,r]);return(0,n.jsx)(`div`,{className:u.container,style:{height:s},children:(0,n.jsxs)(`div`,{ref:m,className:u.weekGrid,children:[(0,n.jsx)(`div`,{className:u.timeColumn,children:S()}),C(),w(),T()]})})},un={daysOfWeek:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`]},dn=({currentDate:e,rowHeight:t,getCalendarDays:r,getEventsForDay:a,styles:o,onDaySlotClick:s,height:c,calendarRef:l,strings:u})=>{let d=u?.daysOfWeek||un.daysOfWeek;return(0,n.jsx)(H,{height:c,width:`100%`,verticalAlign:`start`,horizontalAlign:`start`,children:(0,n.jsxs)(`div`,{className:o.calendarWrapper,ref:l,role:`grid`,"aria-label":`Calendar`,children:[d.map(e=>(0,n.jsx)(i.Body1,{className:o.dayHeader,role:`columnheader`,children:e},e)),r(e).map((e,r)=>{let{day:i,currentMonth:o}=e,c=o?a(e):[];return(0,n.jsx)(Rt,{day:i,date:e.date,currentMonth:e.currentMonth,events:c,columnHeight:t||0,onDayClick:s},r)})]})})},fn=t.memo(({events:e,currentDay:t,height:r,strings:i})=>(0,n.jsx)(ln,{events:e,currentDay:t,height:r,strings:i})),pn=t.memo(({events:e,currentDay:t,height:r,strings:i})=>(0,n.jsx)(qt,{currentDay:t,events:e,height:r,strings:i})),mn=({events:e,height:r=800,theme:o,onDayChange:s,onMonthChange:l,onWeekChange:u,onViewChange:d,onDaySlotClick:f,defaultView:p,strings:m})=>{let{styles:h}=It(),g=(0,t.useRef)(null),[_,v]=(0,t.useState)(null),y=(0,t.useRef)(0),[b,x]=(0,t.useState)(new Date),[S,C]=(0,t.useState)(p??K.Month),{getMonthCalendar:w}=Ut(Intl.DateTimeFormat().resolvedOptions().timeZone),T=t.useCallback(e=>{let t=e.getMonth(),n=(0,a.startOfWeek)((0,a.startOfMonth)(e));return Array.from({length:42},(e,r)=>{let i=(0,a.addDays)(n,r);return{day:i.getDate(),currentMonth:i.getMonth()===t,date:i}})},[42]),E=t.useCallback(e=>{l&&l(e),x(e)},[l]),D=t.useCallback(e=>{s&&s(e),x(e)},[s]),O=t.useCallback(e=>{u&&u(e),x(e)},[u]),k=t.useCallback(e=>{d&&d(e),C(e)},[d]),A=t.useCallback(t=>{let{date:n}=t;return w(e,b.getFullYear(),b.getMonth())[(0,a.format)(n,`yyyy-MM-dd`)]?.flatMap(e=>e)||[]},[b,e]),j=t.useCallback(()=>{g.current&&requestAnimationFrame(()=>{if(g.current){let e=g.current.querySelector(`.${h.calendarWrapper} > div:nth-child(8)`);e&&(v(e.offsetHeight),y.current=e.offsetHeight)}})},[h.calendarWrapper]);(0,t.useEffect)(()=>{let e=new c.ResizeObserver(j);return g.current&&e.observe(g.current),j(),window.addEventListener(`resize`,j),()=>{e.disconnect(),window.removeEventListener(`resize`,j)}},[j,S]),(0,t.useEffect)(()=>{C(p||K.Month)},[p]);let M=t.useCallback(()=>{switch(S){case K.Month:return(0,n.jsx)(dn,{events:e,currentDate:b,rowHeight:_,getCalendarDays:T,getEventsForDay:A,styles:h,onDaySlotClick:f,height:r,calendarRef:g,strings:m?.calendarControl});case K.Week:return(0,n.jsx)(fn,{events:e,currentDay:b,height:r,strings:m?.weekView});case K.Day:return(0,n.jsx)(pn,{events:e,currentDay:b,height:r,strings:m?.dayView});default:return(0,n.jsx)(dn,{events:e,currentDate:b,rowHeight:_,getCalendarDays:T,getEventsForDay:A,styles:h,onDaySlotClick:f,height:r,calendarRef:g,strings:m?.calendarControl})}},[S,e,b,_,T,A,h,f,r]),N=(0,n.jsxs)(H,{height:`100%`,verticalAlign:`start`,children:[(0,n.jsx)(sn,{selectedView:S,onSelectedView:k,currentDate:b,setCurrentDate:x,onWeekChange:O,onMonthChange:E,onDayChange:D,strings:m?.toolbar}),(0,n.jsx)(M,{})]});return(0,n.jsx)(i.IdPrefixProvider,{value:`calendarControl-`,children:o?(0,n.jsx)(i.FluentProvider,{theme:o,applyStylesToPortals:!0,style:{width:`100%`},children:N}):(0,n.jsx)(`div`,{style:{width:`100%`},children:N})})},hn=()=>({tagPickerControl:(0,l.css)({border:`1px solid ${i.tokens.colorNeutralStroke2} !important`,borderRadius:`50px !important`,backgroundColor:`${i.tokens.colorNeutralBackground1} !important`,padding:`0px 10px`,boxShadow:`none`,transition:`all 0.2s ease !important`,"&::after":{content:`""`,position:`absolute`,inset:`-1px`,borderRadius:`inherit`,border:`2px solid transparent`,pointerEvents:`none`},"&:hover":{borderColor:`${i.tokens.colorBrandStroke1} !important`},"&:focus-within":{borderColor:`${i.tokens.colorBrandStroke1} !important`,boxShadow:`0 0 0 2px ${i.tokens.colorBrandBackground2} !important`}})}),gn=({options:e,onChange:r,renderItem:a,validate:o,label:s,placeholder:c,defaultValue:l,message:u,messageType:f,required:p,size:m,hint:h})=>{let g=l?e.find(e=>e.value===l):void 0,[_,v]=(0,t.useState)(l||``),[y,b]=(0,t.useState)(g?.text||``),[x,S]=(0,t.useState)(``),C=hn(),w=(e,t)=>{let n=t.optionValue||``,i=t.optionText||``;v(n),b(i);let a=o?o(n):``;S(a),!a&&r&&r(n)},T=t.useMemo(()=>x?`error`:f===`warning`?`warning`:f===`info`?`success`:`none`,[x,f]);return(0,n.jsx)(i.Field,{label:s,required:p,validationMessage:t.useMemo(()=>x||u,[x,u]),validationMessageIcon:t.useCallback(()=>{switch(T){case`error`:return(0,n.jsx)(d.ErrorCircle12Filled,{});case`warning`:return(0,n.jsx)(d.Warning12Filled,{});case`success`:return(0,n.jsx)(d.CheckmarkCircle12Filled,{});default:return null}},[T])(),size:m,hint:h,validationState:T,children:(0,n.jsx)(i.Dropdown,{placeholder:c,onOptionSelect:w,value:y,selectedOptions:_?[_]:[],className:C.tagPickerControl,children:e.map(e=>{let t=e.icon??e.checkIcon;return(0,n.jsx)(i.Option,{value:e.value,disabled:e.disabled,as:e.as,text:e.text||``,children:a?a(e):(0,n.jsxs)(n.Fragment,{children:[t&&(0,n.jsx)(`span`,{style:{marginRight:4,display:`inline-flex`,alignItems:`center`},children:t}),e.text]})},e.value)})})})},_n=()=>({inputRoot:(0,l.css)({border:`1px solid ${i.tokens.colorNeutralStroke2} !important`,borderBottom:`1px solid ${i.tokens.colorNeutralStroke2} !important`,borderRadius:`50px !important`,backgroundColor:`${i.tokens.colorNeutralBackground1} !important`,padding:`0px 10px !important`,boxShadow:`none !important`,transition:`all 0.2s ease`,"&::after":{display:`none !important`,borderWidth:`0 !important`,content:`"none !important"`},"&:hover":{borderColor:`${i.tokens.colorBrandStroke1} !important`},"&:focus-within":{borderColor:`${i.tokens.colorBrandStroke1} !important`,boxShadow:`0 0 0 2px ${i.tokens.colorBrandBackground2} !important`}})}),vn=({value:r,type:a=`text`,shape:o=`normal`,onChange:s,validate:c,label:l,placeholder:u,message:f,messageType:p,required:m,size:h,hint:g,disabled:_,readOnly:v,min:y,max:b,step:x,contentBefore:S,contentAfter:C})=>{let[w,T]=(0,t.useState)(r===void 0?``:String(r)),[E,D]=(0,t.useState)(``),O=_n(),k=e.c(),A=r!==void 0,j=A?String(r):w,M=(0,t.useCallback)(e=>{if(m&&e.trim()===``)return a===`number`?k.numberRequired:k.fieldRequired;if(a===`number`&&e.trim()!==``){let t=Number(e);if(isNaN(t))return k.invalidNumber;if(y!==void 0&&t<y)return k.valueMustBeAtLeast.replace(`{0}`,String(y));if(b!==void 0&&t>b)return k.valueMustBeAtMost.replace(`{0}`,String(b))}return c?c(a===`number`&&e.trim()!==``?Number(e):e):``},[m,a,c,y,b,k]),N=(0,t.useCallback)((e,t)=>{let n=t.value;if(a===`number`&&n!==``&&!/^-?\d*\.?\d*$/.test(n))return;A||T(n);let r=M(n);D(r),!r&&s&&s(a===`number`&&n.trim()!==``?Number(n):n)},[a,A,M,s]),ee=(0,t.useCallback)(()=>{D(M(j))},[M,j]),P=(0,t.useMemo)(()=>E?`error`:p===`warning`?`warning`:p===`info`?`success`:`none`,[E,p]),F=(0,t.useMemo)(()=>E||f,[E,f]),I=(0,t.useCallback)(()=>{switch(P){case`error`:return(0,n.jsx)(d.ErrorCircle12Filled,{});case`warning`:return(0,n.jsx)(d.Warning12Filled,{});case`success`:return(0,n.jsx)(d.CheckmarkCircle12Filled,{});default:return null}},[P]),L=o===`circular`?O.inputRoot:void 0;return(0,n.jsx)(i.Field,{label:l,required:m,validationMessage:F,validationMessageIcon:I(),size:h,hint:g,validationState:P,children:(0,n.jsx)(i.Input,{value:j,placeholder:u,onChange:N,onBlur:ee,disabled:_,readOnly:v,type:`text`,inputMode:a===`number`?`decimal`:`text`,step:a===`number`?x:void 0,className:L,contentBefore:S,contentAfter:C})})},yn=()=>({searchBoxStyles:g.css`
|
|
15
|
+
}`,o=document.createElement(`style`);o.setAttribute(`data-brand-font`,e.name),o.textContent=a,document.head.appendChild(o),se.add(n)})}function le(e){if(e){if(e.d)return e.d;if(e.BrandFontLibraryUrl||e.SiteUrl)return e}}var ue=new Set([`woff2`,`woff`,`ttf`,`otf`,`eot`]),de={thin:100,hairline:100,extralight:200,ultralight:200,light:300,regular:400,normal:400,medium:500,semibold:600,demibold:600,bold:700,extrabold:800,ultrabold:800,black:900,heavy:900};function fe(e,t){let n=(e?.trim()||t.replace(/\.[^.]+$/,``)).toLowerCase(),r=n.includes(`italic`)||n.includes(`oblique`),i=n.replace(/italic|oblique/gi,``).trim().replace(/[\s_-]+/g,``),a=de[i]??400;if(a===400&&i!==`regular`&&i!==`normal`&&i!==``){for(let[e,t]of Object.entries(de))if(i.includes(e)){a=t;break}}return{fontWeight:a,fontStyle:r?`italic`:`normal`}}var pe=`_SPFontFamilyName`,me=`_SPFontFaces`,he=`_spFontVisible`,ge=[{id:`fluent-base`,name:`'Segoe UI', 'Segoe UI Web (West European)', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', sans-serif`,isDefault:!0,fontFaces:[]},{id:`fluent-monospace`,name:`'Cascadia Code', 'Cascadia Mono', Consolas, 'Courier New', monospace`,isDefault:!1,fontFaces:[]},{id:`fluent-numeric`,name:`'Bahnschrift', 'Segoe UI', 'Segoe UI Web (West European)', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', sans-serif`,isDefault:!1,fontFaces:[]}],_e=(e={})=>{let{siteUrl:n,disabled:r,fonts:i}=e,a=R(),{warn:o,error:s}=z(),[c,l]=(0,t.useState)(i??[]),[u,d]=(0,t.useState)(!r&&!i),[f,p]=(0,t.useState)(),[m,h]=(0,t.useState)(!1),g=(0,t.useRef)(!1),_=(0,t.useCallback)(async()=>{if(r)return;let e=n??a?.pageContext?.web?.absoluteUrl;if(!e){let e=`useBrandCenterFonts: no siteUrl provided and pageContext.web.absoluteUrl is not available.`;o(e),p(e),d(!1);return}d(!0),p(void 0);try{let t=`${e}/_api/SP.BrandCenter/Configuration`,n=async t=>{if(a?.graphClient)return a.graphClient.get(t);let n={Accept:`application/json;odata=nometadata`};a?.authProvider&&(n.Authorization=`Bearer ${await a.authProvider.getAccessToken([`${new URL(e).origin}/.default`])}`);let r=await fetch(t,{credentials:a?.authProvider?void 0:`include`,headers:n});if(!r.ok)throw Error(`SharePoint REST returned ${r.status}: ${t}`);return await r.json()},r=le(await n(t)),i=r?.BrandFontLibraryUrl,s=typeof i==`string`?i:i?.DecodedUrl,c=r?.IsBrandCenterSiteFeatureEnabled===!0||String(r?.IsBrandCenterSiteFeatureEnabled).toLowerCase()===`true`;if(!s||!c){o(`useBrandCenterFonts: Brand Center is not configured for this tenant — using Fluent UI 9 defaults.`),h(!1),l(ge),d(!1);return}let u=r?.SiteUrl,f=typeof u==`string`?u:u?.DecodedUrl??e,p=new URL(f).origin,m=s.startsWith(`http`)?new URL(s).pathname:s,g=await n(`${f}/_api/web/GetList('${encodeURIComponent(m)}')/items?$select=Id,FileLeafRef,FileRef,${pe},${me},${he},File/Name,File/ServerRelativeUrl&$expand=File&$top=5000`),_=g.d?.results??g.value??[],v=new Map;for(let e of _){let t=e.File?.Name??e.FileLeafRef??``,n=t.split(`.`).pop()?.toLowerCase()??``;if(!ue.has(n)||e[he]===!1)continue;let r=e[pe]??t.replace(/\.[^.]+$/,``).split(/[-_]/)[0]??t,i=v.get(r);i?i.items.push(e):v.set(r,{items:[e]})}let y=[];for(let[e,t]of v){let n=[];for(let e of t.items){let t=e.File?.Name??e.FileLeafRef??``,r=e.File?.ServerRelativeUrl??e.FileRef??``;if(!r)continue;let i=e[me],{fontWeight:a,fontStyle:o}=fe(i,t),s=`${p}${r}`;n.push({url:s,fontWeight:a,fontStyle:o})}n.length>0&&y.push({id:e,name:e,isDefault:!1,fontFaces:n})}y.length>0&&!y.some(e=>e.isDefault)&&(y[0].isDefault=!0),y.forEach(ce),l(y),h(!0)}catch(e){let t=e instanceof Error?e.message:String(e);s(`useBrandCenterFonts: failed to load fonts — falling back to Fluent UI 9 defaults`,e instanceof Error?e:void 0),p(t),h(!1),l(ge)}finally{d(!1)}},[r,n,a?.pageContext?.web?.absoluteUrl,a?.graphClient,a?.authProvider]);(0,t.useEffect)(()=>{if(i){i.forEach(ce);return}!g.current&&!r&&(g.current=!0,_())},[_,i,r]);let v=c.find(e=>e.isDefault);return{fonts:c,fontFamilyNames:c.map(e=>e.name),defaultFont:v,loading:u,error:f,isBrandCenterAvailable:m,refresh:_}},B=()=>{let e=t.useCallback((e,t)=>`${e}${t}`,[]),n=t.useCallback(e=>{if(!e)return!1;try{return!!new URL(e)}catch{return!1}},[]),r=e=>e.charAt(0)===`/`&&e.charAt(1)===`/`?e.substring(1,e.length):e,a=t.useCallback(e=>e?new RegExp(/^[{]?[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}[}]?$/).test(e)===!0:!1,[]),o=t.useCallback(e=>{if(!e)return``;let t=e.split(`/`);return t[t.length-1]},[]),s=t.useCallback(e=>{let t=window.location.hostname,n=`https://${t}`;if(e.indexOf(`${n}/sites/`)>-1||e.indexOf(`${n}/teams/`)>-1){let r=e.split(t)[1].split(`/`)[2],i=`https://${t}/sites/${r}`;return e.indexOf(`${n}/teams/`)>-1&&(i=`https://${t}/teams/${r}`),i}return n},[]),c=t.useCallback(e=>{let t=e.split(window.location.hostname)[1];return t=r(t),t},[]),l=t.useCallback(e=>encodeURIComponent(e.replace(/[%]/g,`%25`)).replace(/[']/g,`%27%27`).replace(/[&]/g,`%26`).replace(/[#]/g,`%23`).replace(/[?]/g,`%3F`).replace(/[/]/g,`%2F`).replace(/[+]/g,`%2B`),[]),u=t.useCallback(e=>e==null?!1:Object.prototype.hasOwnProperty.call(e,`extraSmall`)||Object.prototype.hasOwnProperty.call(e,`small`)||Object.prototype.hasOwnProperty.call(e,`medium`)||Object.prototype.hasOwnProperty.call(e,`large`)||Object.prototype.hasOwnProperty.call(e,`extraLarge`),[]),d=t.useCallback((e,t)=>e[t.toString().toLowerCase()],[]),f=t.useCallback(e=>e>=P.XXXLarge?`XXXLarge`:e>=P.ExtraExtraLarge?`ExtraExtraLarge`:e>=P.ExtraLarge?`ExtraLarge`:e>=Number(P.Large)?`Large`:e>=Number(P.Medium)?`Medium`:e>=Number(P.Small)?`Small`:`ExtraSmall`,[]),p=t.useCallback((e,t)=>{let n=f(t),r={ExtraSmall:`xs`,Small:`s`,Medium:`m`,Large:`l`,ExtraLarge:`xl`,ExtraExtraLarge:`xxl`},i=e;return u(e)&&(i=d(e,n??`Medium`)||r[n]),i},[f,u,d]),m=t.useCallback((e,t,n)=>{if(!e)return`none`;if(typeof e==`string`&&(/^\d+px$/.test(e)||/^\d+%$/.test(e)))return e;let r=n,a={padding:`spacingHorizontal`,vertical:`spacingVertical`,horizontal:`spacingHorizontal`};switch(p(e,t)){case`none`:return i.tokens[`${a[r]}None`];case`xxs`:return i.tokens[`${a[r]}XXS`];case`xs`:return i.tokens[`${a[r]}XS`];case`sNudge`:return i.tokens[`${a[r]}SNudge`];case`s`:return i.tokens[`${a[r]}S`];case`mNudge`:return i.tokens[`${a[r]}MNudge`];case`m`:return i.tokens[`${a[r]}M`];case`l`:return i.tokens[`${a[r]}L`];case`xl`:return i.tokens[`${a[r]}XL`];case`xxl`:return i.tokens[`${a[r]}XXL`];case`xxxl`:return i.tokens[`${a[r]}XXXL`];default:return i.tokens[`${a[r]}M`]}},[p]);return{getCacheKey:e,validateUrl:n,trimBeginDoubleSlash:r,isValidGUID:a,getPageNameFromUrl:o,getSPSiteAbsoluteUrl:s,getFileServerRelativeUrlFromAbsoluteUrl:c,encodeRestUrl:l,getSpacing:m,getCurrentDevice:f,getBaseStyles:t.useCallback((e,t,n)=>{let{verticalSpacing:r,horizontalSpacing:i,paddingLeft:a,paddingRight:o,paddingBottom:s,background:c,width:l,maxWidth:u,height:d,maxHeight:f,marginLeft:p,marginRight:h,marginTop:g,marginBottom:_,paddingTop:v,padding:y,margin:b,styles:x}=e,S=m(v,t,`padding`),C=m(a,t,`padding`),w=m(o,t,`padding`),T=m(s,t,`padding`),E=m(y,t,`padding`),D=m(p,t,`padding`),O=m(h,t,`padding`),k=m(g,t,`padding`),A=m(_,t,`padding`),j=m(b,t,`padding`);E&&(S=S===`none`?E:S,C=C===`none`?E:C,w=w===`none`?E:w,T=T===`none`?E:T),j&&(D=D===`none`?j:D,O=O===`none`?j:O,k=k===`none`?j:k,A=A===`none`?j:A);let M=`${m(r,t,`vertical`)} ${m(i,t,`horizontal`)}`,{padding:N,margin:ee,paddingTop:P,paddingLeft:F,paddingRight:I,paddingBottom:L,marginTop:R,marginLeft:z,marginRight:te,marginBottom:ne,...re}=x??{};return{...re,gap:M,paddingTop:S,paddingLeft:C,paddingRight:w,paddingBottom:T,marginLeft:D,marginRight:O,marginTop:k,marginBottom:A,background:c,width:l??void 0,height:d??void 0,maxWidth:u??void 0,maxHeight:f??void 0,overflow:`auto`}},[m]),getLayoutBreakPoint:t.useCallback((e,t)=>{let n=f(t),r=e;return u(e)&&(r=d(e,n??`Medium`)||``),r},[f,u,d])}},ve={"en-US":o.enUS,"es-ES":o.es,"fr-FR":o.fr,"de-DE":o.de,"it-IT":o.it,"pt-BR":o.pt,"pt-PT":o.pt,"ja-JP":o.ja,"ko-KR":o.ko,"zh-CN":o.zhCN},ye=(e,t)=>{let n=t&&ve[t]||o.enUS,{error:r}=z();return{getFormatRelative:e=>{try{return(0,a.formatDistanceToNow)(typeof e==`string`?(0,a.parseISO)(e):e,{addSuffix:!0,locale:n})}catch(e){return r(`Error formatting relative time:`,e instanceof Error?e:void 0),``}},convertDateToUTC:e=>{try{let t=typeof e==`string`?(0,a.parseISO)(e):e;return new Date(t.toUTCString())}catch(e){return r(`Error converting to UTC:`,e instanceof Error?e:void 0),new Date}},formatDate:(e,t=`PPpp`)=>{try{return(0,a.format)(typeof e==`string`?(0,a.parseISO)(e):e,t,{locale:n})}catch(e){return r(`Error formatting date:`,e instanceof Error?e:void 0),``}},getTimezoneOffset:()=>new Date().getTimezoneOffset(),convertToTimezone:(n,i)=>{try{let r=typeof n==`string`?(0,a.parseISO)(n):n,o=i||e||Intl.DateTimeFormat().resolvedOptions().timeZone;return r.toLocaleString(t||`en-US`,{timeZone:o})}catch(e){return r(`Error converting timezone:`,e instanceof Error?e:void 0),(typeof n==`string`?new Date(n):n).toString()}}}},be=(e,t,n)=>{let{getFormatRelative:r,formatDate:i}=ye(t,e);return{formatUtcDate:(e,t=`PP`)=>{let n=(0,a.differenceInDays)(new Date,(0,a.parseISO)(e)),o=``;return e!==void 0&&(o=n>7?i(e,t):r(e)),o},formatTime:n=>n.toLocaleTimeString(e,{timeZone:t}),convertDateToUTC:n=>{let r=typeof n==`string`?new Date(n):n,i=new Intl.DateTimeFormat(e,{timeZone:t,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1}).formatToParts(r),a,o,s,c,l,u;for(let e of i)switch(e.type){case`year`:a=e.value;break;case`month`:o=e.value;break;case`day`:s=e.value;break;case`hour`:c=e.value;break;case`minute`:l=e.value;break;case`second`:u=e.value;break;default:break}let d=`${a}-${o}-${s}T${c}:${l}:${u}Z`;return new Date(d)}}},xe=process.env.NODE_ENV!==`production`,Se=`data:image/`,Ce=()=>{let{error:e}=z(),n=(0,t.useCallback)(async e=>{let t=await fetch(e).then(e=>e.text());return`data:image/svg+xml;base64,`+btoa(t)},[]),r=(0,t.useCallback)(async(t,n,r)=>new Promise((i,a)=>{let o=new Image;o.crossOrigin=`anonymous`,o.addEventListener(`load`,()=>{let t=document.createElement(`canvas`);t.width=n??o.width,t.height=r??o.height,t?.getContext(`2d`)?.drawImage(o,0,0,n??o.width,r??o.height);let s;try{s=t.toDataURL(`image/png`,1),i(s)}catch(t){xe&&e(`[ImageService.getBase64Image]: Err='${t.message}'`),a(t)}}),o.addEventListener(`error`,t=>{xe&&e(`[ImageService.getBase64Image]: Image load error='${t.message}'`),a(t)}),o.src=t}),[]),i=(0,t.useCallback)(e=>!(0,s.isEmpty)(e)&&e.indexOf(Se)>=0,[]);return{getBase64ImageFromDOMImg:(0,t.useCallback)(t=>{try{let e=document.getElementById(t),n=document.createElement(`canvas`);return n.width=e.width,n.height=e.height,n.getContext(`2d`)?.drawImage(e,0,0),n.toDataURL(`image/png`)}catch(t){xe&&e(`[getBase64ImageFromDOMImg]: Err='${t.message}'`);return}},[]),isBase64Image:i,getImageBase64:r,base64FromSVGUrl:n}};function we(e,t=0){let n=null;return function(...r){let i=this;n&&clearTimeout(n),n=setTimeout(()=>{e.apply(i,r)},t)}}function Te(e,t=0){let n=null,r=0;return function(...i){let a=this,o=Date.now();r||=o;let s=t-(o-r);s<=0||s>t?(n&&=(clearTimeout(n),null),r=o,e.apply(a,i)):n||=setTimeout(()=>{r=Date.now(),n=null,e.apply(a,i)},s)}}function Ee(e){if(typeof e!=`object`||!e)return e;if(e instanceof Date)return new Date(e.getTime());if(e instanceof Array)return e.map(e=>Ee(e));if(e instanceof Object){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n]=Ee(e[n]));return t}return e}function De(e){return e==null?!0:typeof e==`string`||Array.isArray(e)?e.length===0:typeof e==`object`?Object.keys(e).length===0:!1}function Oe(e,t,n){let r=Array.isArray(t)?t:t.split(`.`),i=e;for(let e of r){if(i==null)return n;i=i[e]}return i===void 0?n:i}function ke(e,t,n){let r=Array.isArray(t)?t:t.split(`.`),i=r.pop();if(!i)return e;let a=e;for(let e of r)(!(e in a)||typeof a[e]!=`object`)&&(a[e]={}),a=a[e];return a[i]=n,e}function Ae(e){return Array.from(new Set(e))}function je(e,t){let n=new Set;return e.filter(e=>{let r=t(e);return n.has(r)?!1:(n.add(r),!0)})}function Me(e,t){return e.reduce((e,n)=>{let r=String(t(n));return e[r]||(e[r]=[]),e[r].push(n),e},{})}function Ne(e,t){return e.map(t)}function Pe(e,t){return e.filter(t)}function Fe(e,t){return e.some(t)}function Ie(e,t){return e.every(t)}var V=function(e){return e.HTML=`html`,e.MARKDOWN=`markdown`,e.ADAPTIVE_CARD=`adaptiveCard`,e.PLAIN_TEXT=`plainText`,e}({}),Le=e=>{try{let t=JSON.parse(e);return typeof t==`object`&&!!t}catch{return!1}},Re=e=>{try{let t=JSON.parse(e);return t&&typeof t==`object`&&(t.type===`AdaptiveCard`||t.$schema?.includes(`adaptivecards.io`))}catch{return!1}},ze=e=>{let t=e.trim(),n=[/^<!DOCTYPE\s+html/i,/^<html[\s>]/i,/^<\?xml/i,/<(div|span|p|h[1-6]|table|ul|ol|li|a|img|br|hr|strong|em|b|i)[\s>]/i],r=/<[^>]+>/.test(t),i=/^<[^>]+>/.test(t),a=(t.match(/<(?!\/)[^>]+>/g)||[]).length;return n.some(e=>e.test(t))||r&&i&&a>0},Be=e=>{let t=e.trim(),n=[/^#{1,6}\s+.+$/m,/\*\*.*?\*\*/,/\*.*?\*/,/__.*?__/,/_.*?_/,/\[.*?\]\(.*?\)/,/^\s*[-*+]\s+/m,/^\s*\d+\.\s+/m,/`[^`]+`/,/^```/m,/^\|.*\|.*\|$/m,/^>\s+/m,/^\s*---\s*$/m].some(e=>e.test(t)),r=/^<[^>]+>/.test(t);return n&&!r},Ve=(e,t,n=!1)=>{let r=t.filter(t=>t.test(e)).length/t.length;return n?1-r:r},He=e=>{if(typeof e==`object`&&e){let t=e;if(t.type===`AdaptiveCard`||t.$schema?.includes(`adaptivecards.io`))return{type:V.ADAPTIVE_CARD,content:e,confidence:1};e=JSON.stringify(e,null,2)}let t=e,n=t.trim();if(!n||n.length<3)return{type:V.PLAIN_TEXT,content:t,confidence:1};if(Le(n)&&Re(n))return{type:V.ADAPTIVE_CARD,content:JSON.parse(n),confidence:1};if(ze(n)){let e=Math.max(.7,Ve(n,[/^<!DOCTYPE\s+html/i,/^<html[\s>]/i,/<(div|span|p|h[1-6]|table|ul|ol|li)[\s>]/i]));return{type:V.HTML,content:t,confidence:e}}if(Be(n)){let e=Math.max(.6,Ve(n,[/^#{1,6}\s+.+$/m,/\*\*.*?\*\*/,/\[.*?\]\(.*?\)/,/^\s*[-*+]\s+/m,/`[^`]+`/,/^```/m,/^\|.*\|.*\|$/m]));return{type:V.MARKDOWN,content:t,confidence:e}}return{type:V.PLAIN_TEXT,content:t,confidence:.5}},Ue=e=>He(e).type,We=e=>{let{styles:n}=e,{getBaseStyles:r}=B();return{cardStyles:t.useCallback((t,i)=>({...r(e,t,i),...n}),[r,e,n]),bodyCardDefaultStyles:t.useMemo(()=>({display:`flex`,flexDirection:`column`,justifyContent:`start`,alignItems:`stretch`,overflow:`unset`}),[])}},Ge=e=>{let{className:r,cardBody:a,cardBodyClassName:o,cardHeader:s,cardHeaderClassName:l,cardHeaderImage:u,cardHeaderAction:d,cardHeaderDescription:f,cardFooterAction:p,cardFooterClassName:m,cardFooterContent:h,cardPreviewImage:g,cardPreviewLogo:_,cardPreviewPosition:v=`top`}=e,{cardStyles:y,bodyCardDefaultStyles:b}=We(e),x=t.useRef(null),[S,C]=t.useState(0),[w,T]=t.useState(0);return t.useEffect(()=>{let e;return x.current&&(e=new c.ResizeObserver(e=>{for(let t of e){let{width:e,height:n}=t.contentRect;C(e),T(n)}}),e.observe(x.current)),()=>{e&&e.disconnect()}},[]),(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(`div`,{ref:x,children:(0,n.jsxs)(i.Card,{className:r,style:y(S,w),...e,children:[g&&v===`top`&&(0,n.jsxs)(i.CardPreview,{logo:_,children:[g,` `]}),s&&(0,n.jsx)(i.CardHeader,{className:l,image:u,header:s,description:f,action:d}),g&&v===`afterHeader`&&(0,n.jsxs)(i.CardPreview,{logo:_,children:[g,` `]}),a&&(0,n.jsx)(`div`,{className:(0,i.mergeClasses)(o),style:b,children:a}),g&&v===`bottom`&&(0,n.jsxs)(i.CardPreview,{logo:_,children:[g,` `]}),h&&(0,n.jsx)(i.CardFooter,{action:p,className:m,children:h})]})})})},Ke=e=>{let{cols:n,verticalSpacing:r,horizontalSpacing:a,styles:o,gridItemAutoFlow:s,minItemWidth:c,enableInfiniteScroll:u}=e,{getSpacing:d,getCurrentDevice:f,getBaseStyles:p}=B();return{gridStyles:t.useCallback((t,l)=>{let m=p(e,t,l),h=`${d(r,t,`vertical`)} ${d(a,t,`horizontal`)}`,g=f(t),_=`repeat(auto-${s??`fill`}, minmax(min(100%, ${c??250}px), 1fr))`;if(n&&n>0){let e=n??0;switch(g){case`ExtraSmall`:e=Math.min(n,1);break;case`Small`:e=Math.min(n,2);break;case`Medium`:e=Math.min(n,3);break;case`Large`:e=Math.min(n,4);break;case`ExtraLarge`:e=Math.min(n,4);break;case`ExtraExtraLarge`:e=Math.min(n,5);break;case`XXXLarge`:e=Math.min(n,6);break;default:e=0}_=`repeat(${e}, minmax(auto, 1fr))`}return{...m,display:`grid`,gridTemplateColumns:_,gap:h,overflow:`hidden`,overflowY:u?`auto`:`hidden`,...u?{scrollbarWidth:`thin`,scrollbarColor:`${i.tokens.colorBrandBackground} ${i.tokens.colorNeutralBackground3}`,paddingRight:`10px`}:{},...o}},[p,e,d,r,a,f,n,o,s,c,u]),scrollbarClassName:t.useMemo(()=>{if(u)return l.css`
|
|
16
|
+
&::-webkit-scrollbar {
|
|
17
|
+
width: 6px !important;
|
|
18
|
+
height: 6px !important;
|
|
19
|
+
}
|
|
20
|
+
&::-webkit-scrollbar-track {
|
|
21
|
+
background: ${i.tokens.colorNeutralBackground3} !important;
|
|
22
|
+
border-radius: ${i.tokens.borderRadiusMedium} !important;
|
|
23
|
+
}
|
|
24
|
+
&::-webkit-scrollbar-thumb {
|
|
25
|
+
background: ${i.tokens.colorBrandBackground} !important;
|
|
26
|
+
border-radius: ${i.tokens.borderRadiusMedium} !important;
|
|
27
|
+
}
|
|
28
|
+
&::-webkit-scrollbar-thumb:hover {
|
|
29
|
+
background: ${i.tokens.colorBrandBackgroundHover} !important;
|
|
30
|
+
}
|
|
31
|
+
`},[u])}},qe=e=>{let{children:r,className:i,onScroll:a}=e,{gridStyles:o,scrollbarClassName:s}=Ke(e),l=t.useRef(null),[u,d]=t.useState(0),[f,p]=t.useState(0);return t.useEffect(()=>{let e;return l.current&&(e=new c.ResizeObserver(e=>{for(let t of e){let{width:e,height:n}=t.contentRect;d(e),p(n)}}),e.observe(l.current)),()=>{e&&e.disconnect()}},[]),(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(`div`,{className:[i,s].filter(Boolean).join(` `),style:o(u,f),ref:l,onScroll:t.useCallback(e=>{if(!a)return;let{scrollTop:t,scrollHeight:n,clientHeight:r}=e.currentTarget;(t+r)/n>=.95&&a(e)},[a]),children:r})})},Je=e=>{let{maxWith:n}=e,{getBaseStyles:r}=B();return{rootStyles:t.useCallback((t,i)=>({...r(e,t,i),maxWidth:n}),[r,n,e]),layoutGridStyles:(0,l.css)({display:`grid`,overflow:`hidden`})}},Ye={areas:[`header header header`,`sidebar content sidebar`,`footer footer footer`],columns:`1fr 3fr 1fr`,rows:`auto 1fr auto`},Xe=e=>{let{className:r,children:a,layoutConfig:o=Ye}=e,s=t.useRef(null),[l,u]=t.useState(0),[d,f]=t.useState(0),{rootStyles:p,layoutGridStyles:m}=Je({...e,layoutConfig:o}),h=((e,n)=>{let r;return t.useCallback((...t)=>{clearTimeout(r),r=setTimeout(()=>e(...t),n)},[e,n])})((e,t)=>{u(e),f(t)},200);return t.useEffect(()=>{if(!s.current)return;let e=new c.ResizeObserver(e=>{for(let t of e){let{width:e,height:n}=t.contentRect;h(e,n)}});return e.observe(s.current),()=>e.disconnect()},[h]),(0,n.jsx)(`div`,{id:`-Layout`,className:(0,i.mergeClasses)(r,m),style:{...p(l,d),gridTemplateAreas:o.areas.join(` `),gridTemplateColumns:o.columns,gridTemplateRows:o.rows},ref:s,children:t.Children.map(a,(e,r)=>t.isValidElement(e)?(0,n.jsx)(`div`,{style:{gridArea:e.props?.area??`area-${r}`},children:e},r):e)})},Ze=e=>{let{area:t,children:r}=e;return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(`div`,{style:{gridArea:t},children:r})})},Qe=e=>{let{verticalSpacing:n,horizontalSpacing:r}=e,{getSpacing:i}=B();return{spaceStyles:t.useCallback(e=>e?r?{width:i(r,e,`horizontal`)}:n?{height:i(n,e,`vertical`)}:{}:{},[i,r,n])}},$e=e=>{let r=t.useRef(null),[i,a]=t.useState(0),{spaceStyles:o}=Qe(e);return t.useEffect(()=>{let e;return r.current&&(e=new c.ResizeObserver(e=>{for(let t of e){let{width:e}=t.contentRect;a(e)}}),e.observe(r.current)),()=>{e&&e.disconnect()}},[]),(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(`div`,{id:`-space`,style:o(i),ref:r})})},et=e=>{let{horizontal:n,horizontalAlign:r,verticalAlign:i,verticalFill:a,wrap:o,columnGap:s,RowGap:c}=e,{getBaseStyles:l}=B();return{stackStyles:t.useCallback((t,u)=>{let d=i||`start`,f=n?r:`start`,p=n?{flexFlow:o?`row wrap`:`row nowrap`,height:`100%`}:{height:`100%`,maxHeight:`100%`},m=l(e,t,u);return{columnGap:s,rowGap:c,display:`flex`,flexDirection:n?`row`:`column`,alignItems:d,justifyContent:f,...p,height:a?`100%`:m.height,...m,...e.styles}},[l,n,r,e,i,a,o])}},H=e=>{let{children:r,className:i}=e,{stackStyles:a}=et(e),o=t.useRef(null),[s,l]=t.useState(0),[u,d]=t.useState(0);return t.useEffect(()=>{let e;return o.current&&(e=new c.ResizeObserver(e=>{for(let t of e){let{width:e,height:n}=t.contentRect;l(e),d(n)}}),e.observe(o.current)),()=>{e&&e.disconnect()}},[]),(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(`div`,{className:i,style:a(s,u),ref:o,children:r})})},tt=e=>{let{children:r,grow:i,disableShrink:a,shrink:o,order:s,alignSelf:l,verticalFill:u}=e,{getBaseStyles:d}=B(),f=t.useRef(null),[p,m]=t.useState(0),[h,g]=t.useState(0),_=d(e,p,h);return t.useEffect(()=>{let e;return f.current&&(e=new c.ResizeObserver(e=>{for(let t of e){let{width:e,height:n}=t.contentRect;m(e),g(n)}}),e.observe(f.current)),()=>{e&&e.disconnect()}},[]),(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(`div`,{ref:f,style:{..._,alignSelf:l,order:s,height:u?`100%`:`auto`,flexGrow:i?typeof i==`boolean`?1:i:void 0,flexShrink:a||!i&&!o?0:1,minWidth:0,minHeight:0,width:`auto`},children:r})})},nt=({ratio:e,children:t,maxWidth:r,maxHeight:i,style:a={},...o})=>{let s={position:`relative`,width:`100%`,paddingTop:`${100/e}%`,maxWidth:r||`none`,maxHeight:i||`none`,...a},c={position:`absolute`,top:0,left:0,width:`100%`,height:`100%`};return(0,n.jsx)(`div`,{style:s,...o,children:(0,n.jsx)(`div`,{style:c,children:t})})},rt=e=>{let{styles:n}=e,{getBaseStyles:r}=B();return{aspectRatioStyles:t.useCallback((t,i)=>({...r(e,t,i),...n}),[r,e,n])}},it=e=>{let{styles:n}=e,{getBaseStyles:r}=B();return{centerStyles:t.useCallback((t,i)=>({...r(e,t,i),...n,overflow:`hidden`,display:`flex`,justifyContent:`center`,alignItems:`center`,width:`100%`,height:`100%`}),[r,e,n]),childrenStyles:(0,l.css)({justifyContent:`center`,textAlign:`center`})}},at=e=>{let{className:r,children:i}=e,a=t.useRef(null),[o,s]=t.useState(0),[l,u]=t.useState(0),{centerStyles:d}=it(e),f=(e,t)=>{let n;return(...r)=>{clearTimeout(n),n=setTimeout(()=>e(...r),t)}};return t.useEffect(()=>{let e=f(e=>{for(let t of e){let{width:e,height:n}=t.contentRect;s(e),u(n)}},200),t=new c.ResizeObserver(t=>{e(t)});return a.current&&t.observe(a.current),()=>{t.disconnect()}},[]),(0,n.jsx)(`div`,{id:`center`,className:r,style:{...d(o,l),display:`flex`,justifyContent:`center`,alignItems:`center`,height:`100%`,width:`100%`},ref:a,children:i})},ot=e=>{let{maxWidth:n}=e,{getBaseStyles:r}=B();return{containerStyles:t.useCallback((t,i)=>!t||!i?{}:{...r(e,t,i),maxWidth:n},[r,n,e])}},st=e=>{let{className:r,children:i,style:a,alignItems:o=`center`,justifyContent:l=`center`,flexDirection:u=`row`,centerContent:d=!0}=e,f=t.useRef(null),[p,m]=t.useState(0),[h,g]=t.useState(0),{containerStyles:_}=ot(e),v=t.useMemo(()=>(0,s.debounce)(e=>{for(let t of e){let{width:e,height:n}=t.contentRect;m(e),g(n)}},200),[]);t.useEffect(()=>{let e=new c.ResizeObserver(e=>{v(e)});return f.current&&e.observe(f.current),()=>{e.disconnect(),v.cancel()}},[v]);let y=t.useMemo(()=>{if(!a)return;let{padding:e,margin:t,...n}=a;return n},[a]);return(0,n.jsx)(`div`,{id:`container`,className:r,style:{..._(p,h),display:`flex`,justifyContent:l,alignItems:o,flexDirection:u,...y},ref:f,children:d?(0,n.jsx)(at,{children:i}):i})},ct=e=>{let[n,r]=(0,t.useState)(!0),[i,a]=(0,t.useState)(!0),o=(0,t.useCallback)(()=>{e&&e.scrollPrev()},[e]),s=(0,t.useCallback)(()=>{e&&e.scrollNext()},[e]),c=(0,t.useCallback)(e=>{r(!e.canScrollPrev()),a(!e.canScrollNext())},[]);return(0,t.useEffect)(()=>{e&&(c(e),e.on(`reInit`,c),e.on(`select`,c))},[e,c]),{prevBtnDisabled:n,nextBtnDisabled:i,onPrevButtonClick:o,onNextButtonClick:s}},lt=(e,n)=>{let{getCurrentDevice:r}=B(),a=t.useCallback(()=>{let e=r(n),t=`95%`;switch(e){case`Medium`:t=`45%`;break;case`Large`:t=`calc(95% / 4)`;break;case`ExtraLarge`:t=`calc(95% / 5)`;break;case`ExtraExtraLarge`:t=`calc(95% / 6)`;break;default:t=`95%`;break}return t},[n,r]),o=t.useCallback(()=>{let e=r(n),t=i.tokens.spacingVerticalM;switch(e){case`Medium`:t=i.tokens.spacingVerticalM;break;case`Large`:t=i.tokens.spacingVerticalL;break;case`ExtraLarge`:t=i.tokens.spacingVerticalXL;break;default:t=i.tokens.spacingVerticalM;break}return t},[n,r]);return{enableControls:(0,l.css)({display:`flex`,justifyContent:`space-between`,alignItems:`stretch`,gap:10,padding:5}),embla__viewport:(0,l.css)({overflow:`hidden`,paddingTop:`10px`,paddingBottom:`20px`}),embla__container:(0,l.css)({backfaceVisibility:`hidden`,display:`flex`,touchAction:`pan-y`}),embla:(0,l.css)({".embla":{}}),embla__slide:(0,l.css)({minWidth:0,flex:`0 0 ${a()}`,paddingLeft:`${o()}`}),embla__buttons:(0,l.css)({display:`grid`,gridTemplateColumns:`repeat(2, 1fr)`,gap:0,alignItems:`center`})}},ut=e=>{let{styles:n}=e,{getBaseStyles:r}=B();return{carouselStyles:t.useCallback((t,i)=>({...r(e,t,i),...n}),[r,e,n])}},dt=()=>({titleStyles:(0,l.css)({display:`-webkit-box`,overflow:`hidden`,textOverflow:`ellipsis`,WebkitLineClamp:`1`,WebkitBoxOrient:`vertical`,textAlign:`start`})}),ft=e=>{let{className:r,items:a,title:o}=e,s=t.useRef(null),[l,f]=t.useState(0),[p,m]=t.useState(0),{carouselStyles:h}=ut(e),[g,_]=(0,u.default)(),v=dt(),{enableControls:y,embla__slide:b,embla__container:x,embla__viewport:S,embla__buttons:C}=lt(e,l),{prevBtnDisabled:w,nextBtnDisabled:T,onPrevButtonClick:E,onNextButtonClick:D}=ct(_);return t.useEffect(()=>{let e;return s.current&&(e=new c.ResizeObserver(e=>{for(let t of e){let{width:e,height:n}=t.contentRect;f(e),m(n)}}),f(s.current.clientWidth),m(s.current.clientHeight),e.observe(s.current)),()=>{e&&e.disconnect()}},[]),(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(`div`,{id:`-carousel`,role:`region`,"aria-roledescription":`carousel`,"aria-label":o||`Carousel`,className:(0,i.mergeClasses)(r,`embla`),style:{...h(l,p)},ref:s,children:[(0,n.jsxs)(`div`,{className:y,children:[(0,n.jsx)(i.Subtitle2,{className:v.titleStyles,children:o}),(0,n.jsxs)(`div`,{className:C,children:[(0,n.jsx)(i.Button,{onClick:E,disabled:w,appearance:`subtle`,icon:(0,n.jsx)(d.ChevronLeftRegular,{}),"aria-label":`Previous slide`}),(0,n.jsx)(i.Button,{onClick:D,disabled:T,appearance:`subtle`,icon:(0,n.jsx)(d.ChevronRightRegular,{}),"aria-label":`Next slide`})]})]}),(0,n.jsx)(`div`,{className:S,ref:g,children:(0,n.jsx)(`div`,{className:x,children:a.map((e,t)=>(0,n.jsx)(`div`,{className:b,role:`group`,"aria-roledescription":`slide`,"aria-label":`Slide ${t+1} of ${a.length}`,children:e},t))})})]})})},pt=e=>{let{direction:t=`horizontal`,resizerSize:n=6}=e,r=t===`horizontal`;return{root:(0,l.css)({position:`relative`,width:`100%`,height:`100%`}),pane:e=>{let t=e===void 0?void 0:typeof e==`number`?`${e}px`:e;return(0,l.css)({overflow:`auto`,position:`relative`,...r?{width:t,height:`100%`}:{height:t,width:`100%`}})},secondaryPane:(0,l.css)({flex:1,overflow:`auto`,position:`relative`,minWidth:0,minHeight:0}),resizer:(0,l.css)({flex:`0 0 auto`,...r?{width:n,cursor:`col-resize`,height:`100%`}:{height:n,cursor:`row-resize`,width:`100%`},backgroundColor:i.tokens.colorNeutralStroke1,transition:`background-color 150ms ease`,userSelect:`none`,zIndex:1}),resizerActive:(0,l.css)({backgroundColor:i.tokens.colorBrandStroke1}),resizerGrip:(0,l.css)({gap:`2px`}),gripDot:(0,l.css)({width:3,height:3,borderRadius:`50%`,backgroundColor:i.tokens.colorNeutralForeground3})}},U={xs:i.tokens.spacingHorizontalXS,s:i.tokens.spacingHorizontalS,m:i.tokens.spacingHorizontalM,l:i.tokens.spacingHorizontalL,xl:i.tokens.spacingHorizontalXL,xxl:i.tokens.spacingHorizontalXXL},W=t.default.memo(t.default.forwardRef(({direction:e=`vertical`,justifyContent:t=`flex-start`,alignItems:r=`stretch`,gap:a,columnGap:o,rowGap:s,margin:c,padding:u,marginTop:d,marginBottom:f,marginLeft:p,marginRight:m,paddingTop:h,paddingBottom:g,paddingLeft:_,paddingRight:v,width:y,height:b,wrap:x=!1,children:S,style:C,className:w,overflow:T,background:E},D)=>(0,n.jsx)(`div`,{ref:D,className:(0,i.mergeClasses)(w,(0,l.css)({display:`flex`,flexDirection:e===`horizontal`?`row`:`column`,justifyContent:t,alignItems:r,gap:a&&U[a]?U[a]:a,columnGap:o&&U[o]?U[o]:o,rowGap:s&&U[s]?U[s]:s,margin:c&&U[c]?U[c]:c,padding:u&&U[u]?U[u]:u,marginTop:d&&U[d]?U[d]:d,marginBottom:f&&U[f]?U[f]:f,marginLeft:p&&U[p]?U[p]:p,marginRight:m&&U[m]?U[m]:m,paddingTop:h&&U[h]?U[h]:h,paddingBottom:g&&U[g]?U[g]:g,paddingLeft:_&&U[_]?U[_]:_,paddingRight:v&&U[v]?U[v]:v,width:y,height:b,overflow:T,flexWrap:x?`wrap`:`nowrap`,backgroundColor:E,...C})),children:S}))),mt=e=>{let{direction:r=`horizontal`,defaultSize:i=`50%`,minSize:a=100,maxSize:o=1/0,minSecondarySize:s=100,resizable:c=!0,onResize:l,onResizeEnd:u,primaryContent:d,secondaryContent:f,className:p,styles:m}=e,h=pt(e),g=r===`horizontal`,_=t.useRef(null),v=t.useRef(null),[y,b]=t.useState(null),[x,S]=t.useState(!1),[C,w]=t.useState(!1);t.useEffect(()=>{if(y!==null||!_.current)return;let e=_.current.getBoundingClientRect(),t=g?e.width:e.height;if(typeof i==`number`)b(Math.min(Math.max(i,a),o));else if(typeof i==`string`&&i.endsWith(`%`)){let e=parseFloat(i)/100;b(Math.min(Math.max(t*e,a),o))}else b(t/2)},[i,a,o,g,y]);let T=t.useCallback(t=>{if(!_.current)return t;let n=_.current.getBoundingClientRect(),r=(g?n.width:n.height)-(e.resizerSize??6)-s;return Math.min(Math.max(t,a),Math.min(o,r))},[g,o,a,s,e.resizerSize]),E=t.useCallback(e=>{if(!c)return;e.preventDefault(),S(!0);let t=g?e.clientX:e.clientY,n=y??0,r=e=>{let r=T(n+((g?e.clientX:e.clientY)-t));b(r),l?.(r)},i=()=>{if(S(!1),document.removeEventListener(`mousemove`,r),document.removeEventListener(`mouseup`,i),v.current){let e=g?v.current.getBoundingClientRect().width:v.current.getBoundingClientRect().height;u?.(e)}};document.addEventListener(`mousemove`,r),document.addEventListener(`mouseup`,i)},[c,g,y,T,l,u]),D=t.useCallback(e=>{if(!c)return;S(!0);let t=e.touches[0],n=g?t.clientX:t.clientY,r=y??0,i=e=>{let t=e.touches[0],i=T(r+((g?t.clientX:t.clientY)-n));b(i),l?.(i)},a=()=>{if(S(!1),document.removeEventListener(`touchmove`,i),document.removeEventListener(`touchend`,a),v.current){let e=g?v.current.getBoundingClientRect().width:v.current.getBoundingClientRect().height;u?.(e)}};document.addEventListener(`touchmove`,i,{passive:!1}),document.addEventListener(`touchend`,a)},[c,g,y,T,l,u]),O=t.useCallback(e=>{if(!c||y===null)return;let t=e.shiftKey?50:10,n=0;if(g?e.key===`ArrowLeft`?n=-t:e.key===`ArrowRight`&&(n=t):e.key===`ArrowUp`?n=-t:e.key===`ArrowDown`&&(n=t),n!==0){e.preventDefault();let t=T(y+n);b(t),l?.(t),u?.(t)}},[c,y,g,T,l,u]);t.useEffect(()=>(x?(document.body.style.userSelect=`none`,document.body.style.cursor=g?`col-resize`:`row-resize`):(document.body.style.userSelect=``,document.body.style.cursor=``),()=>{document.body.style.userSelect=``,document.body.style.cursor=``}),[x,g]);let k=t.useRef(null),A=[h.resizer,C||x?h.resizerActive:``].filter(Boolean).join(` `);return t.useEffect(()=>{if(!c||!k.current)return;let e=k.current,t=e=>E(e),n=e=>D(e),r=e=>O(e),i=()=>w(!0),a=()=>w(!1);return e.addEventListener(`mousedown`,t),e.addEventListener(`touchstart`,n),e.addEventListener(`keydown`,r),e.addEventListener(`mouseenter`,i),e.addEventListener(`mouseleave`,a),()=>{e.removeEventListener(`mousedown`,t),e.removeEventListener(`touchstart`,n),e.removeEventListener(`keydown`,r),e.removeEventListener(`mouseenter`,i),e.removeEventListener(`mouseleave`,a)}},[c,E,D,O]),(0,n.jsxs)(W,{ref:_,className:[h.root,p].filter(Boolean).join(` `),style:{height:`100%`,width:`100%`,...m},direction:g?`horizontal`:`vertical`,overflow:`hidden`,children:[(0,n.jsx)(W,{ref:v,className:h.pane(y??void 0),style:{flex:`0 0 auto`},children:d}),c&&(0,n.jsx)(`div`,{ref:k,className:A,style:{flex:`0 0 auto`,display:`flex`,alignItems:`center`,justifyContent:`center`},role:`separator`,"aria-orientation":g?`vertical`:`horizontal`,"aria-valuenow":Math.round(y??a),"aria-valuemin":a,"aria-valuemax":o===1/0?void 0:o,"aria-label":`Resize pane`,tabIndex:0,children:(0,n.jsxs)(W,{className:h.resizerGrip,direction:g?`vertical`:`horizontal`,alignItems:`center`,justifyContent:`center`,children:[(0,n.jsx)(W,{className:h.gripDot,children:``}),(0,n.jsx)(W,{className:h.gripDot,children:``}),(0,n.jsx)(W,{className:h.gripDot,children:``})]})}),(0,n.jsx)(W,{className:h.secondaryPane,style:{flex:1,minWidth:0,minHeight:0},children:f})]})},ht=({anchorPoint:e,isOpen:r,onClose:a,excludeRefs:o,children:s,theme:c})=>{let l=(0,t.useRef)(null),[u,d]=(0,t.useState)(null);(0,t.useLayoutEffect)(()=>{if(!r){d(null);return}if(l.current){let t=l.current.getBoundingClientRect(),n=e.left,r=e.top;n+t.width>window.innerWidth&&(n=window.innerWidth-t.width-10),r+t.height>window.innerHeight&&(r=window.innerHeight-t.height-10),d({left:n,top:r})}},[e,r,s]);let p=t.default.useCallback(e=>{let t=e.target;if(l.current&&!l.current.contains(t)){if(o&&o.some(e=>e.current&&e.current.contains(t)))return;a()}},[a,o]);if((0,t.useEffect)(()=>{if(!r)return;let e=requestAnimationFrame(()=>{document.addEventListener(`mousedown`,p)}),t=e=>{e.key===`Escape`&&a()};return document.addEventListener(`keydown`,t),()=>{cancelAnimationFrame(e),document.removeEventListener(`mousedown`,p),document.removeEventListener(`keydown`,t)}},[r,p,a]),!r)return null;let m=u||e;return f.default.createPortal(c?(0,n.jsx)(i.FluentProvider,{theme:c,children:(0,n.jsx)(i.Card,{ref:l,role:`dialog`,"aria-modal":`true`,style:{position:`fixed`,zIndex:1e3,top:m.top,left:m.left},children:s})}):(0,n.jsx)(i.Card,{ref:l,role:`dialog`,"aria-modal":`true`,style:{position:`fixed`,zIndex:1e3,top:m.top,left:m.left},children:s}),document.body)},gt=(0,i.makeStyles)({labelContainer:{display:`flex`,flexDirection:`row`,justifyContent:`flex-start`,alignItems:`center`,...i.shorthands.gap(`6px`)},iconStyles:{width:`26px`},item:{paddingLeft:`15px`}}),_t=e=>{let{label:r,icon:a,isRequired:o}=e,s=gt();return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(`div`,{className:s.labelContainer,children:[a&&t.isValidElement(a)?a:(0,n.jsx)(p.Icon,{icon:a,className:s.iconStyles,width:`20px`,height:`20px`,color:i.tokens.colorBrandForeground1,"aria-hidden":`true`}),(0,n.jsx)(i.Caption1,{style:{color:i.tokens.colorBrandForeground1},children:r}),(0,n.jsx)(i.Caption1,{style:{color:i.tokens.colorPaletteRedForeground1},children:o?` *`:``})]})})},vt=(0,i.makeStyles)({root:{display:`flex`,justifyContent:`center`,alignItems:`center`,height:`100%`,width:`100%`},spinner:{width:`100px`,height:`100px`}}),yt=e=>{let{size:t,label:r,labelPosition:a,style:o,className:s}=e,c=vt();return(0,n.jsx)(`div`,{className:c.root,children:(0,n.jsx)(i.Spinner,{style:o,className:(0,i.mergeClasses)(c.spinner,s),size:t,label:r,labelPosition:a,"aria-label":r?void 0:`Loading`})})},bt={xs:i.tokens.fontSizeBase200,s:i.tokens.fontSizeBase300,m:i.tokens.fontSizeBase400,l:i.tokens.fontSizeBase500,xl:i.tokens.fontSizeBase600,xxl:i.tokens.fontSizeHero700},G={xs:i.tokens.spacingHorizontalXS,s:i.tokens.spacingHorizontalS,m:i.tokens.spacingHorizontalM,l:i.tokens.spacingHorizontalL,xl:i.tokens.spacingHorizontalXL,xxl:i.tokens.spacingHorizontalXXL},xt={regular:i.tokens.fontWeightRegular,semibold:i.tokens.fontWeightSemibold,bold:i.tokens.fontWeightBold},St=e=>{let{fontSize:t,fontFamily:r,fontWeight:a,numberOfLines:o,as:s,padding:c,paddingTop:u,paddingBottom:d,paddingLeft:f,paddingRight:p,margin:m,marginTop:h,marginBottom:g,marginLeft:_,marginRight:v,children:y,style:b,className:x,color:S,block:C,truncate:w,wrap:T}=e,E=(0,l.css)({color:S,padding:c&&G[c]?G[c]:c,paddingTop:u&&G[u]?G[u]:u,paddingBottom:d&&G[d]?G[d]:d,paddingLeft:f&&G[f]?G[f]:f,paddingRight:p&&G[p]?G[p]:p,margin:m&&G[m]?G[m]:m,marginTop:h&&G[h]?G[h]:h,marginBottom:g&&G[g]?G[g]:g,marginLeft:_&&G[_]?G[_]:_,marginRight:v&&G[v]?G[v]:v}),D={...b,...r?{fontFamily:r}:{},...t?{fontSize:bt[t]?bt[t]:t}:{},...a?{fontWeight:xt[a]?xt[a]:a}:{},...o?{display:`-webkit-box`,WebkitBoxOrient:`vertical`,overflow:`hidden`,WebkitLineClamp:o}:{}};return(0,n.jsx)(i.Text,{as:s,className:(0,i.mergeClasses)(x,E),style:D,block:C,truncate:w,wrap:T,children:y})},Ct=e=>{let{onSelected:r,value:a,styles:o,options:s,apparence:c,shape:l,label:u}=e,d=t.useRef(),[f,p]=t.useState(a??s[0]),[m,h]=t.useState({option:[a?a?.key:s?.[0]?.key]}),g=t.useRef(null);t.useEffect(()=>{a!==void 0&&(p(a),h({option:[a.key]})),d.current=s.find(e=>e.key===(a?.key??s[0]?.key))?.icon},[a]);let[_,v]=t.useState(!1),y=t.useCallback((e,t)=>{v(t.open)},[]),b=t.useCallback(e=>e?.text??``,[]),x=t.useCallback((e,{name:t,checkedItems:n})=>{if(t===`option`){let e=n[0];p(s.find(t=>t.key===e)),h({option:n}),d.current=s.find(t=>t.key===e)?.icon,r(s.find(t=>t.key===e))}},[s,r]);return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(i.Field,{label:u,style:o,ref:g,children:(0,n.jsxs)(i.Menu,{open:_,onOpenChange:y,children:[(0,n.jsx)(i.MenuTrigger,{disableButtonEnhancement:!0,children:(0,n.jsx)(i.MenuButton,{shape:l??`circular`,icon:d.current,appearance:c??`secondary`,children:b(f)??`No data available`})}),(0,n.jsx)(i.MenuPopover,{children:(0,n.jsx)(i.MenuList,{onCheckedValueChange:x,checkedValues:m,style:{width:g.current?.offsetWidth},children:s.map(e=>(0,n.jsx)(i.MenuItemRadio,{name:`option`,value:e.key,icon:e.icon,disabled:e.disabled,children:b(e)},e.key))})})]})})})},wt=()=>({styles:{container:(0,l.css)({display:`flex`,alignItems:`center`,alignContent:`center`,overflow:`hidden`,whiteSpace:`nowrap`,padding:`8px`,backgroundColor:`transparent`}),breadcrumbItem:(0,l.css)({minWidth:`fit-content`,padding:0,margin:`0px`}),separator:(0,l.css)({marginRight:`8px`})},getStyles:(e,t)=>{let{icon:n}=e;switch(t){case`small`:return(0,l.css)({fontSize:`12px`,padding:`4px`,paddingLeft:n?`0px`:`4px`});case`medium`:return(0,l.css)({fontSize:`14px`,padding:`6px`,paddingLeft:n?`0px`:`6px`});case`large`:return(0,l.css)({fontSize:`16px`,padding:`8px`,paddingLeft:n?`0px`:`8px`});case`current`:return(0,l.css)({fontWeight:i.tokens.fontWeightBold,cursor:`default`,display:`-webkit-box`,"-webkit-line-clamp":`1`,"-webkit-box-orient":`vertical`,overflow:`hidden`,textAlign:`start`,textOverflow:`ellipsis`,wordBreak:`break-word`,fontFamily:i.tokens.fontFamilyBase});default:return(0,l.css)({fontSize:`14px`,padding:`6px`,paddingLeft:n?`0px`:`6px`})}}}),Tt=({items:e,theme:r,size:a=`medium`})=>{let[o,s]=(0,t.useState)(!1),c=(0,t.useRef)(null),l=(0,t.useRef)(null),[u,p]=(0,t.useState)({top:0,left:0,position:`absolute`}),{getStyles:m}=wt();return(0,t.useEffect)(()=>{let e=e=>{!c.current?.contains(e.target)&&!l.current?.contains(e.target)&&o&&s(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[o]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(i.Button,{ref:c,icon:(0,n.jsx)(d.MoreHorizontalRegular,{}),appearance:`transparent`,onClick:()=>{if(c.current){let e=c.current.getBoundingClientRect(),t=window.innerWidth,n=window.innerHeight,r=l.current?.offsetWidth||200,i=l.current?.offsetHeight||100,a=e.bottom+window.scrollY,o=e.left+window.scrollX;o+r>t&&(o=t-r-10),a+i>n&&(a=e.top+window.scrollY-i),p({top:a,left:o,position:`absolute`}),s(e=>!e)}},"aria-label":`More items`}),o&&(0,f.createPortal)(r?(0,n.jsx)(i.FluentProvider,{theme:r,children:(0,n.jsx)(i.Card,{ref:l,style:{...u,zIndex:1e3,padding:`8px`,minWidth:`150px`},children:e.map((e,t)=>(0,n.jsx)(i.Button,{icon:e.icon?e.icon:null,appearance:`transparent`,onClick:()=>{e.onClick?.(),s(!1)},children:(0,n.jsx)(i.Text,{className:m(e,a),children:e.label})},`overflow-${t}`))})}):(0,n.jsx)(i.Card,{ref:l,style:{...u,zIndex:1e3,padding:`8px`,minWidth:`150px`},children:e.map((e,t)=>(0,n.jsx)(i.Button,{icon:e.icon?e.icon:null,appearance:`transparent`,onClick:()=>{e.onClick?.(),s(!1)},children:(0,n.jsx)(i.Text,{className:m(e,a),children:e.label})},`overflow-${t}`))}),document.body)]})},Et=(e,t)=>{let n;return(...r)=>{clearTimeout(n),n=setTimeout(()=>e(...r),t)}},Dt=({items:e,maxWidth:r=`100%`,styles:a,theme:o,size:s=`medium`,currentIndex:l=e.length-1,className:u})=>{let{styles:f,getStyles:p}=wt(),m=(0,t.useRef)(null),[h,g]=(0,t.useState)([]),[_,v]=(0,t.useState)([]);return(0,t.useEffect)(()=>{let t=()=>{if(!m.current)return;let t=m.current.offsetWidth,n=0,r=[],i=[];e.forEach(e=>{n+80<=t-50?(r.push(e),n+=80):i.push(e)}),g(r),v(i)},n=Et(t,100),r=new c.ResizeObserver(()=>{n()});return m.current&&r.observe(m.current),t(),()=>{r.disconnect()}},[e]),(0,n.jsx)(`div`,{ref:m,className:(0,i.mergeClasses)(f.container,u),style:{maxWidth:r,...a},children:(0,n.jsxs)(H,{horizontal:!0,verticalAlign:`center`,horizontalAlign:`start`,children:[h.map((e,r)=>(0,n.jsxs)(t.default.Fragment,{children:[r===l?(0,n.jsxs)(H,{horizontal:!0,verticalAlign:`center`,horizontalAlign:`start`,columnGap:5,styles:{overflow:`hidden`},children:[e.icon?t.default.cloneElement(e.icon,{style:{fontSize:s===`large`?`20px`:s===`medium`?`16px`:`12px`}}):null,(0,n.jsx)(i.Text,{className:(0,i.mergeClasses)(f.breadcrumbItem,p(e,s),p(e,`current`)),"aria-current":`page`,children:e.label},e.label)]}):(0,n.jsx)(i.Button,{icon:e.icon?e.icon:null,appearance:`transparent`,className:`${f.breadcrumbItem}`,onClick:e.onClick,children:(0,n.jsx)(i.Text,{className:p(e,s),children:e.label})},e.label),r<h.length-1&&(0,n.jsx)(d.ChevronRightRegular,{style:{fontSize:s===`large`?`20px`:s===`medium`?`16px`:`12px`}})]},e.label??`breadcrumb-${r}`)),_.length>0&&(0,n.jsx)(Tt,{items:_,theme:o})]})})},Ot=({icon:e,hoverIcon:r,imageSrc:a,width:o=24,height:s=24,color:c,hoverColor:l,onClick:u,enabled:d=!0,ariaLabel:f})=>{let p=c||i.tokens.colorBrandBackground,m=l||i.tokens.colorBrandBackgroundHover,h=i.tokens.fontFamilyBase,[g,_]=(0,t.useState)(!1),v=(0,t.useCallback)(()=>{d&&_(!0)},[d]),y=(0,t.useCallback)(()=>{d&&_(!1)},[d]),b=(0,t.useMemo)(()=>d&&g&&r?r:e,[g,r,e,d]),x=(0,t.useMemo)(()=>({width:o,height:s,color:g?m:p,display:`flex`,alignItems:`center`,justifyContent:`center`,opacity:d?1:.5,fontFamily:h,fontSize:`inherit`}),[o,s,g,m,p,d,h]),S=(0,t.useMemo)(()=>({border:`none`,background:`none`,padding:0,cursor:d?`pointer`:`default`}),[d]),C=(0,t.useMemo)(()=>({width:o,height:s,objectFit:`contain`,opacity:d?1:.5}),[o,s,d]);return(0,n.jsx)(i.Button,{onClick:d?u:void 0,onMouseEnter:v,onMouseLeave:y,disabled:!d,style:S,"aria-label":f??`Icon Button`,children:a?(0,n.jsx)(`img`,{src:a,alt:`icon`,style:C}):t.default.cloneElement(b,{style:{...b.props.style,...x}})})},kt=t.default.memo(Ot),At=()=>({getSpanSlots:t.useCallback((e,t)=>{let n=new Date(e),r=new Date(t),i=n.getHours(),a=n.getMinutes(),o=i*2+(a>=1?1:0),s=r.getHours(),c=r.getMinutes(),l=s*2+(c>=1?2:0);return{spanSlots:l-o,startSlot:o,endSlot:l}},[]),generateLightAndHoverColors:t.useCallback((e,t=20,n=10)=>{let r=e=>{let t=parseInt(e.slice(1,3),16)/255,n=parseInt(e.slice(3,5),16)/255,r=parseInt(e.slice(5,7),16)/255,i=Math.max(t,n,r),a=Math.min(t,n,r),o=i-a,s=0,c=0,l=(i+a)/2;if(o!==0){switch(c=l>.5?o/(2-i-a):o/(i+a),i){case t:s=(n-r)/o+(n<r?6:0);break;case n:s=(r-t)/o+2;break;case r:s=(t-n)/o+4;break}s/=6}return{h:s*360,s:c*100,l:l*100}},i=(e,t,n)=>{let r=t*Math.min(n,100-n)/100,i=t=>{let i=(t+e/30)%12,a=n-r*Math.max(Math.min(i-3,9-i,1),-1);return Math.round(255*a).toString(16).padStart(2,`0`)};return`#${i(0)}${i(8)}${i(4)}`},{h:a,s:o,l:s}=r(e);return{lightColor:i(a,o,Math.min(s+t,100)),hoverColor:i(a,o,Math.min(s+n,100))}},[]),getEventColors:t.useCallback(e=>{let t={backgroundColor:i.tokens.colorNeutralBackground3,hoverColor:i.tokens.colorNeutralBackground3Hover};return{"no category":t,meeting:{backgroundColor:i.tokens.colorPaletteBlueBackground2,hoverColor:i.tokens.colorPaletteBlueBorderActive},appointment:{backgroundColor:i.tokens.colorPaletteGreenBackground2,hoverColor:i.tokens.colorPaletteGreenBorderActive},task:{backgroundColor:i.tokens.colorPaletteRedBackground2,hoverColor:i.tokens.colorPaletteRedBorderActive},deadline:{backgroundColor:i.tokens.colorPaletteYellowBackground2,hoverColor:i.tokens.colorPaletteYellowBorderActive},holiday:{backgroundColor:i.tokens.colorPalettePurpleBackground2,hoverColor:i.tokens.colorPalettePurpleBorderActive},celebration:{backgroundColor:i.tokens.colorPaletteDarkOrangeBackground2,hoverColor:i.tokens.colorPaletteDarkOrangeBorderActive},reminder:{backgroundColor:i.tokens.colorPaletteTealBackground2,hoverColor:i.tokens.colorPaletteTealBorderActive},workshop:{backgroundColor:i.tokens.colorPaletteTealBackground2,hoverColor:i.tokens.colorPaletteTealBorderActive},webinar:{backgroundColor:i.tokens.colorPaletteMagentaBackground2,hoverColor:i.tokens.colorPaletteMagentaBorderActive},conference:{backgroundColor:i.tokens.colorPaletteBrownBackground2,hoverColor:i.tokens.colorPaletteBrownBorderActive}}[e.toLowerCase()]||t},[]),generateColor:t.useCallback(e=>{let t=0;for(let n=0;n<e.length;n++)t=e.charCodeAt(n)+((t<<5)-t);let n=(t&16777215).toString(16).toUpperCase();return`#${`00000`.substring(0,6-n.length)+n}`},[]),getCalendarColors:t.useCallback(e=>{let t={beige:{backgroundColor:i.tokens.colorPaletteBeigeBackground2,hoverColor:i.tokens.colorPaletteBeigeBorderActive},blue:{backgroundColor:i.tokens.colorPaletteBlueBackground2,hoverColor:i.tokens.colorPaletteBlueBorderActive},brown:{backgroundColor:i.tokens.colorPaletteBrownBackground2,hoverColor:i.tokens.colorPaletteBrownBorderActive},gold:{backgroundColor:i.tokens.colorPaletteGoldBackground2,hoverColor:i.tokens.colorPaletteGoldBorderActive},lavender:{backgroundColor:i.tokens.colorPaletteLavenderBackground2,hoverColor:i.tokens.colorPaletteLavenderBorderActive},magenta:{backgroundColor:i.tokens.colorPaletteMagentaBackground2,hoverColor:i.tokens.colorPaletteMagentaBorderActive},navy:{backgroundColor:i.tokens.colorPaletteNavyBackground2,hoverColor:i.tokens.colorPaletteNavyBorderActive},pink:{backgroundColor:i.tokens.colorPalettePinkBackground2,hoverColor:i.tokens.colorPalettePinkBorderActive},plum:{backgroundColor:i.tokens.colorPalettePlumBackground2,hoverColor:i.tokens.colorPalettePlumBorderActive},purple:{backgroundColor:i.tokens.colorPalettePurpleBackground2,hoverColor:i.tokens.colorPalettePurpleBorderActive},red:{backgroundColor:i.tokens.colorPaletteRedBackground2,hoverColor:i.tokens.colorPaletteRedBorderActive},teal:{backgroundColor:i.tokens.colorPaletteTealBackground2,hoverColor:i.tokens.colorPaletteTealBorderActive},anchor:{backgroundColor:i.tokens.colorPaletteAnchorBackground2,hoverColor:i.tokens.colorPaletteAnchorBorderActive},"dark-red":{backgroundColor:i.tokens.colorPaletteDarkRedBackground2,hoverColor:i.tokens.colorPaletteDarkRedBorderActive},cranberry:{backgroundColor:i.tokens.colorPaletteCranberryBackground2,hoverColor:i.tokens.colorPaletteCranberryBorderActive},pumpkin:{backgroundColor:i.tokens.colorPalettePumpkinBackground2,hoverColor:i.tokens.colorPalettePumpkinBorderActive},peach:{backgroundColor:i.tokens.colorPalettePeachBackground2,hoverColor:i.tokens.colorPalettePeachBorderActive},marigold:{backgroundColor:i.tokens.colorPaletteMarigoldBackground2,hoverColor:i.tokens.colorPaletteMarigoldBorderActive},brass:{backgroundColor:i.tokens.colorPaletteBrassBackground2,hoverColor:i.tokens.colorPaletteBrassBorderActive},forest:{backgroundColor:i.tokens.colorPaletteForestBackground2,hoverColor:i.tokens.colorPaletteForestBorderActive},seafoam:{backgroundColor:i.tokens.colorPaletteSeafoamBackground2,hoverColor:i.tokens.colorPaletteSeafoamBorderActive},"dark-green":{backgroundColor:i.tokens.colorPaletteDarkGreenBackground2,hoverColor:i.tokens.colorPaletteDarkGreenBorderActive},"light-teal":{backgroundColor:i.tokens.colorPaletteLightTealBackground2,hoverColor:i.tokens.colorPaletteLightTealBorderActive},steel:{backgroundColor:i.tokens.colorPaletteSteelBackground2,hoverColor:i.tokens.colorPaletteSteelBorderActive},"royal-blue":{backgroundColor:i.tokens.colorPaletteRoyalBlueBackground2,hoverColor:i.tokens.colorPaletteRoyalBlueBorderActive},cornflower:{backgroundColor:i.tokens.colorPaletteCornflowerBackground2,hoverColor:i.tokens.colorPaletteCornflowerBorderActive},grape:{backgroundColor:i.tokens.colorPaletteGrapeBackground2,hoverColor:i.tokens.colorPaletteGrapeBorderActive},lilac:{backgroundColor:i.tokens.colorPaletteLilacBackground2,hoverColor:i.tokens.colorPaletteLilacBorderActive},mink:{backgroundColor:i.tokens.colorPaletteMinkBackground2,hoverColor:i.tokens.colorPaletteMinkBorderActive},platinum:{backgroundColor:i.tokens.colorPalettePlatinumBackground2,hoverColor:i.tokens.colorPalettePlatinumBorderActive}},n=t[`royal-blue`];return t[e]||n},[]),formatDate:t.useCallback((e,t)=>(0,a.format)((0,a.parseISO)(e),t),[])}),jt={start:`Start`,end:`End`,location:`Location`,attendees:`Attendees`,details:`Details`},Mt=`32px`,Nt=e=>({styles:{banner:(0,l.css)({display:`flex`,justifyContent:`center`,alignContent:`center`,alignItems:`center`,padding:`5px 10px 0px 10px`}),fieldContainer:(0,l.css)({paddingLeft:Mt}),title:(0,l.css)({lineClamp:2,overflow:`hidden`,display:`-webkit-box`,WebkitBoxOrient:`vertical`,wordBreak:`break-word`,WebkitLineClamp:2})}}),Pt=({fieldLabel:e,fieldValue:t,icon:r})=>(0,n.jsxs)(H,{children:[(0,n.jsx)(_t,{label:e,icon:r}),(0,n.jsx)(H,{paddingLeft:Mt,children:(0,n.jsx)(i.Body1,{children:t})})]}),Ft=e=>{let{event:r,strings:a=jt}=e,{title:o,start:s,end:c,location:l,category:u,attendees:d,weblink:f}=r,{styles:p}=Nt(r),{formatDate:m}=At(),h=m(s,`PPp`),g=m(c,`PPp`),_=(0,i.partitionAvatarGroupItems)({items:d?.map(e=>e.id)||[]}),v=t.useCallback(e=>d?.find(t=>t.id===e)||void 0,[d]),y=t.useCallback(()=>(0,n.jsxs)(H,{children:[(0,n.jsx)(_t,{label:a.attendees,icon:`ph:users-three`}),(0,n.jsx)(H,{paddingLeft:Mt,children:(0,n.jsxs)(i.AvatarGroup,{layout:`stack`,children:[_.inlineItems.map(e=>(0,n.jsx)(i.AvatarGroupItem,{name:v(e)?.name,image:{src:v(e)?.imageUrl}},e)),_.overflowItems&&(0,n.jsx)(i.AvatarGroupPopover,{children:_.overflowItems.map(e=>(0,n.jsx)(i.AvatarGroupItem,{name:v(e)?.name,image:{src:v(e)?.imageUrl}},e))})]})})]}),[_,v,a.attendees]);return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(Ge,{appearance:`subtle`,padding:`m`,paddingTop:`s`,width:`250px`,cardBody:(0,n.jsxs)(H,{RowGap:10,children:[(0,n.jsx)(`div`,{className:p.banner,children:(0,n.jsx)(i.Subtitle1,{className:p.title,children:o})}),(0,n.jsx)(i.Divider,{}),u&&(0,n.jsx)(H,{horizontal:!0,horizontalAlign:`end`,width:`100%`,children:(0,n.jsx)(i.Badge,{appearance:`filled`,children:u})}),(0,n.jsx)(Pt,{fieldLabel:a.start,fieldValue:h,icon:`mingcute:time-line`}),(0,n.jsx)(Pt,{fieldLabel:a.end,fieldValue:g,icon:`mingcute:time-line`}),(0,n.jsx)(Pt,{fieldLabel:a.location,fieldValue:l,icon:`mingcute:location-line`}),(0,n.jsx)(y,{})]}),cardFooterContent:(0,n.jsx)(H,{horizontal:!0,horizontalAlign:`end`,width:`100%`,children:(0,n.jsx)(i.Button,{appearance:`subtle`,onClick:()=>{window.open(f,`_blank`)},children:a.details})})})})},It=()=>({styles:{calendarWrapper:(0,l.css)({padding:`20px`,paddingTop:`10px`,overflow:`auto`,flex:1,display:`grid`,gridTemplateColumns:`repeat(7, 1fr)`,gridTemplateRows:`auto`,gridAutoRows:`minmax(100px, 1fr)`,gap:`1px`,width:`calc(100% - 40px)`}),header:(0,l.css)({display:`flex`,justifyContent:`start`,gap:`10px`,alignItems:`center`,padding:`16px`}),dayHeader:(0,l.css)({textAlign:`start`,padding:`8px`,borderBottom:`1px solid ${i.tokens.colorNeutralStroke1}`}),day:(0,l.css)({display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,border:`1px solid ${i.tokens.colorNeutralStroke1}`,backgroundColor:i.tokens.colorNeutralBackground1,position:`relative`}),otherMonthDay:(0,l.css)({color:i.tokens.colorNeutralStroke2,backgroundColor:i.tokens.colorNeutralBackground2}),cardDay:(0,l.css)({height:`100%`,minHeight:100,borderRadius:0,overflow:`hidden !important`,rowGap:5}),cardDayOnHover:(0,l.css)({":hover":{backgroundColor:i.tokens.colorNeutralBackground2}}),currentDay:(0,l.css)({borderTop:`5px solid ${i.tokens.colorBrandBackground}`}),currentDayLabel:(0,l.css)({color:i.tokens.colorBrandBackground,fontWeight:600}),eventCard:(0,l.css)({display:`flex`,flexDirection:`column`,alignItems:`flex-start`,zIndex:1}),eventContainer:(0,l.css)({display:`flex`,flexDirection:`column`,overflowY:`auto`,paddingTop:`5px`,paddingBottom:`5px`,paddingLeft:`5px`,paddingRight:`5px`,"::-webkit-scrollbar":{width:`5px`,height:`5px`},"::-webkit-scrollbar-track":{background:i.tokens.colorNeutralBackground4,borderRadius:`10px`},"::-webkit-scrollbar-thumb":{background:i.tokens.colorBrandStroke2Hover,borderRadius:`10px`},"::-webkit-scrollbar-thumb:hover":{background:i.tokens.colorNeutralStroke2}}),eventCardWeekView:(0,l.css)({backgroundColor:i.tokens.colorBrandBackground,color:i.tokens.colorNeutralForegroundOnBrand,borderRadius:`4px`,padding:`4px`,margin:`2px`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,height:`100%`}),popoverContent:(0,l.css)({padding:0,borderTopWidth:20,borderTopStyle:`solid`}),cardMonthTitle:(0,l.css)({display:`-webkit-box`,"-webkit-line-clamp":`1`,"-webkit-box-orient":`vertical`,textAlign:`start`,textOverflow:`ellipsis`,paddingLeft:`8px`,wordBreak:`break-word`,overflow:`hidden`})},applyEventHouverColorClass:(e,t)=>(0,l.css)({backgroundColor:e??i.tokens.colorBrandBackground,":hover":{backgroundColor:t??i.tokens.colorBrandBackgroundHover}})}),Lt=e=>{let r=(0,i.useId)(),{events:o,date:s,onCardHoverChange:c,columnHeight:l}=e,{styles:u,applyEventHouverColorClass:d}=It(),f=t.useRef(null),{getEventColors:p,getCalendarColors:m}=At(),h=t.useCallback(e=>{c&&c(!0,e)},[c]),g=t.useCallback(e=>{c&&c(!1,e)},[c]),_=t.useCallback(e=>{f.current?.setTarget(e)},[f]),v=t.useCallback((e,t,r)=>(0,n.jsx)(`div`,{ref:_,children:(0,n.jsx)(Ge,{className:(0,i.mergeClasses)(u.eventCard,d(r.backgroundColor,r.backgroundColor)),paddingTop:`4px`,paddingBottom:`4px`,paddingLeft:`8px`,paddingRight:`8px`,marginTop:e===0?`0px`:`5px`,cardHeader:(0,n.jsx)(i.Caption1,{className:u.cardMonthTitle,children:t.title}),onMouseEnter:()=>h(t.title),onMouseLeave:()=>g(t.title)})},t.id??`card-${e}`),[h,g,d]),y=t.useCallback((e,t,a)=>(0,n.jsxs)(i.Popover,{withArrow:!0,mouseLeaveDelay:30,closeOnScroll:!0,closeOnIframeFocus:!0,openOnHover:!0,children:[(0,n.jsx)(i.PopoverTrigger,{children:v(t,e,a)}),(0,n.jsx)(i.PopoverSurface,{"aria-labelledby":r,className:(0,i.mergeClasses)(u.popoverContent),children:(0,n.jsx)(Ft,{event:e})})]},t),[v,r,u.popoverContent]);return!o||!o?.length?(0,n.jsx)(n.Fragment,{children:` `}):(0,n.jsx)(`div`,{style:{height:l},className:u.eventContainer,children:o.map((e,n)=>{if(!(0,a.isWithinInterval)(s,{start:(0,a.startOfDay)(new Date(e.start)),end:(0,a.endOfDay)(new Date(e.end))}))return null;let r;r=e.color?m(e.color):p(e.category);let o=e.onRenderInMonthView?.(e),c=e.id??`event-${n}`;return t.isValidElement(o)?t.cloneElement(o,{key:c,className:(0,i.mergeClasses)(o.props.className,u.eventCard)}):e.enableOnHouver?y(e,n,r):v(n,e,r)})})},Rt=e=>{let{day:r,currentMonth:o,events:s,date:c,columnHeight:l,onDayClick:u}=e,{styles:d}=It(),f=new Date,[p,m]=t.useState(!1),h=t.useMemo(()=>(0,a.isSameDay)(c,f),[c,f]),g=t.useMemo(()=>(0,n.jsx)(H,{horizontal:!0,horizontalAlign:`start`,verticalAlign:`center`,paddingLeft:`m`,paddingRight:`m`,children:(0,n.jsxs)(i.Body2,{className:d.currentDayLabel,children:[r,` `,f.toLocaleString(`default`,{month:`short`})]})}),[r]),_=t.useCallback(e=>{m(e)},[]);return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(Ge,{onClick:u?()=>u(c):void 0,className:(0,i.mergeClasses)(d.cardDay,o?``:d.otherMonthDay,h?d.currentDay:``,p?``:d.cardDayOnHover),cardHeader:h?g:(0,n.jsx)(H,{horizontal:!0,paddingLeft:`m`,paddingRight:`m`,children:(0,n.jsx)(i.Body2,{children:r})}),paddingTop:`m`,paddingBottom:`m`,paddingLeft:`0px`,paddingRight:`0px`,cardBody:(0,n.jsx)(Lt,{events:s,date:c,onCardHoverChange:_,columnHeight:l-60})})})},zt=()=>({styles:{container:(0,l.css)({display:`flex`,flexDirection:`column`,width:`calc(100% - 40px)`,height:`100vh`,overflow:`hidden`,padding:`20px`}),header:(0,l.css)({display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:`16px`,borderBottom:`1px solid ${i.tokens.colorNeutralStroke1}`}),weekGrid:(0,l.css)({display:`grid`,gridTemplateColumns:`80px repeat(7, 1fr)`,gridTemplateRows:`50px 40px repeat(48, 33px)`,height:`fit-content`,overflowY:`auto`,border:`1px solid ${i.tokens.colorNeutralStroke1}`,maxHeight:`calc(100vh - 100px)`,scrollbarWidth:`thin`,scrollbarColor:`${i.tokens.colorBrandBackground} ${i.tokens.colorNeutralBackground1}`,"&::-webkit-scrollbar":{width:`8px`},"&::-webkit-scrollbar-track":{background:i.tokens.colorNeutralBackground1},"&::-webkit-scrollbar-thumb":{background:i.tokens.colorBrandBackground,borderRadius:`4px`},"&::-webkit-scrollbar-thumb:hover":{background:i.tokens.colorBrandBackgroundHover}}),blankHeader:(0,l.css)({gridColumn:`1`,backgroundColor:i.tokens.colorNeutralBackground3,borderBottom:`3px solid ${i.tokens.colorNeutralStroke3}`,position:`sticky`,top:0,zIndex:10}),timeColumn:(0,l.css)({gridColumn:`1`,gridRow:`3 / span 49`,display:`flex`,flexDirection:`column`,backgroundColor:i.tokens.colorNeutralBackground1,borderRight:`1px solid ${i.tokens.colorNeutralStroke1}`}),timeCell:(0,l.css)({height:`100%`,display:`flex`,alignItems:`center`,fontSize:`12px`,color:i.tokens.colorNeutralForeground3,borderBottom:`1px solid ${i.tokens.colorNeutralStroke1}`,justifyContent:`center`}),fullDayRow:(0,l.css)({gridRow:`2`,display:`grid`,gridTemplateColumns:`80px repeat(7, 1fr)`,gap:`0`,padding:`0`,backgroundColor:i.tokens.colorNeutralBackground2,borderBottom:`3px solid ${i.tokens.colorNeutralStroke2}`}),fullDayLabel:(0,l.css)({gridColumn:`1`,display:`flex`,alignItems:`center`,justifyContent:`center`,alignContent:`center`,color:i.tokens.colorBrandBackground,padding:`5px`,borderRight:`1px solid ${i.tokens.colorNeutralStroke1}`,borderBottom:`3px solid ${i.tokens.colorNeutralStroke2}`}),fullDayCell:(0,l.css)({borderRight:`1px solid ${i.tokens.colorNeutralStroke1}`,display:`flex`,flexDirection:`row`,gap:`0px`,padding:`4px`,borderBottom:`3px solid ${i.tokens.colorNeutralStroke2}`,overflow:`hidden`}),fullDayEvent:(0,l.css)({flex:`1 1 auto`,minWidth:`24px`,height:`24px`,padding:`4px 8px`,backgroundColor:i.tokens.colorBrandBackground,borderRadius:`4px`,overflow:`hidden`,display:`flex`,alignItems:`center`,justifyContent:`center`}),dayHeaderCell:(0,l.css)({textAlign:`center`,backgroundColor:i.tokens.colorNeutralBackground2,padding:`8px`,fontWeight:`bold`,borderBottom:`1px solid ${i.tokens.colorNeutralStroke1}`,position:`sticky`,top:0,zIndex:10}),todayHeaderCell:(0,l.css)({borderTop:`5px solid ${i.tokens.colorBrandBackground}`}),eventCard:(0,l.css)({padding:2,alignItems:`center`,justifyContent:`center`,marginRight:`2px`,zIndex:1,position:`absolute`,alignContent:`center`,overflow:`hidden`,":hover":{pointerEvents:`auto`,cursor:`pointer`}}),event:(0,l.css)({height:`100%`,backgroundColor:i.tokens.colorBrandBackground,borderRadius:`4px`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,overflow:`hidden`,display:`flex`,alignItems:`center`,justifyContent:`center`,marginRight:`2px`,zIndex:1,position:`absolute`,alignContent:`center`,":hover":{pointerEvents:`auto`,cursor:`pointer`}}),dayCell:(0,l.css)({borderBottom:`1px solid ${i.tokens.colorNeutralStroke1}`,borderRight:`1px solid ${i.tokens.colorNeutralStroke1}`,position:`relative`,overflow:`visible`,FlexDirection:`column`,gap:`4px`}),currentTimeIndicator:(0,l.css)({position:`absolute`,left:0,height:`2px`,backgroundColor:i.tokens.colorPaletteRedBorderActive,width:`100%`,zIndex:1}),currentHalfHourCell:(0,l.css)({border:`2px solid ${i.tokens.colorPaletteRedBorderActive}`}),eventTitle:(0,l.css)({display:`-webkit-box`,"-webkit-line-clamp":`1`,"-webkit-box-orient":`vertical`,textAlign:`start`,textOverflow:`ellipsis`,paddingLeft:`8px`,wordBreak:`break-word`,overflow:`hidden`}),popoverContent:(0,l.css)({padding:0,borderTopWidth:20,borderTopStyle:`solid`})},applyEventHouverColorClass:t.default.useCallback((e,t)=>(0,l.css)({backgroundColor:e??i.tokens.colorBrandBackground,":hover":{backgroundColor:t??i.tokens.colorBrandBackgroundHover}}),[i.tokens.colorBrandBackground,i.tokens.colorBrandBackgroundHover]),appyDynamicStyles:t.default.useCallback((e,t,n,r)=>(0,l.css)({flex:`0 0 calc(100% / ${t})`,height:`${n*r}px`,left:`${e*10}%`,width:`calc(${100-e*10}% - 8px)`,margin:4,marginTop:0,marginBottom:0}),[])}),Bt={timeSeparator:` - `,hourSuffix:`H`},Vt=({event:e,colors:r,spanSlots:a,rowHeight:o,eventIndex:s,eventCount:c,strings:l=Bt})=>{let u=(0,i.useId)(),{styles:d,applyEventHouverColorClass:f,appyDynamicStyles:p}=zt(),m=t.useRef(null),{formatDate:h}=At(),g=t.useMemo(()=>(0,n.jsx)(`div`,{children:(0,n.jsxs)(H,{columnGap:4,verticalAlign:`center`,children:[(0,n.jsx)(i.Caption1Strong,{className:d.eventTitle,children:e.title}),(0,n.jsxs)(H,{columnGap:4,horizontal:!0,verticalAlign:`center`,horizontalAlign:`start`,children:[(0,n.jsxs)(i.Caption1,{children:[h(e.start,`HH:mm`),l.hourSuffix]}),l.timeSeparator,(0,n.jsxs)(i.Caption1,{children:[h(e.end,`HH:mm`),l.hourSuffix]})]})]})}),[e,h,l,d.eventTitle]);return(0,n.jsx)(i.Card,{ref:m,className:(0,i.mergeClasses)(d.eventCard,f(r.backgroundColor,r.backgroundColor),p(s,c,o,a)),children:e.enableOnHouver?(0,n.jsxs)(i.Popover,{withArrow:!0,mouseLeaveDelay:50,closeOnScroll:!0,closeOnIframeFocus:!0,openOnHover:!0,children:[(0,n.jsx)(i.PopoverTrigger,{children:g}),(0,n.jsx)(i.PopoverSurface,{"aria-labelledby":u,className:(0,i.mergeClasses)(d.popoverContent),children:(0,n.jsx)(Ft,{event:e})})]}):g},e.id)},Ht=({event:e,eventCount:r,spanSlots:a,rowHeight:o,eventIndex:s,view:c})=>{let{styles:l,appyDynamicStyles:u}=zt(),{getEventColors:d,getCalendarColors:f}=At(),p=e.color?f(e.color):d(e.category),m=c===`day`?e.onRenderInDayView?.(e):e.onRenderInWeekView?.(e);return t.isValidElement(m)?t.cloneElement(m,{event:e,className:(0,i.mergeClasses)(m.props.className,l.eventCard,u(s,r,o,a)),style:{...m.props.style}}):(0,n.jsx)(Vt,{event:e,colors:p,spanSlots:a,rowHeight:o,eventIndex:s,eventCount:r},e.id)},Ut=e=>{let n=(0,t.useCallback)(e=>e.map(e=>({...e,id:e.id||(0,m.v4)()})),[]),r=(0,t.useCallback)(t=>new Date(new Date(t).toLocaleString(void 0,{timeZone:e})),[e]);return{getMonthCalendar:(0,t.useCallback)((e,t,i)=>{let o=n(e),s=new Date(t,i+1,0).getDate(),c={};for(let e=1;e<=s;e++){let n=(0,a.format)(new Date(t,i,e),`yyyy-MM-dd`);c[n]=[]}return o.forEach(e=>{let t=r(e.start),n=r(e.end),i=new Date(t);for(;i<=n;){let t=(0,a.format)(i,`yyyy-MM-dd`);c[t]&&c[t].push(e),i.setDate(i.getDate()+1)}}),c},[r]),getWeekEvents:(0,t.useCallback)((e,t)=>{let i=[],o=r(t),s=n(e);for(let e=0;e<7;e++){let t=new Date(o);t.setDate(o.getDate()+e);let n=(0,a.format)(t,`yyyy-MM-dd`),c=Array.from({length:48},(e,t)=>({time:`${String(Math.floor(t/2)).padStart(2,`0`)}:${t%2==0?`00`:`30`}`,events:[]})),l=[];s.forEach(e=>{let t=r(e.start),i=r(e.end);if(e.isFullDay){(0,a.format)(t,`yyyy-MM-dd`)<=n&&(0,a.format)(i,`yyyy-MM-dd`)>=n&&l.push(e);return}if((0,a.format)(t,`yyyy-MM-dd`)<=n&&(0,a.format)(i,`yyyy-MM-dd`)>=n){let r=new Date(t);for(;r<=i;){if((0,a.format)(r,`yyyy-MM-dd`)===n){let t=r.getHours()*2+(r.getMinutes()>=30?1:0);c[t]&&c[t].events.push(e)}r.setMinutes(r.getMinutes()+30)}}}),i.push({date:n,fullDayEvents:l,timeSlots:c})}return i},[r])}},Wt=()=>({styles:{container:(0,l.css)({display:`flex`,flexDirection:`column`,width:`calc(100% - 40px)`,height:`100vh`,overflow:`hidden`,padding:`20px`}),header:(0,l.css)({display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:`16px`,borderBottom:`1px solid ${i.tokens.colorNeutralStroke1}`}),dayGrid:(0,l.css)({display:`grid`,gridTemplateColumns:`80px 1fr`,gridTemplateRows:`50px 40px repeat(48, 33px)`,height:`calc(100vh - 100px)`,overflowY:`auto`,border:`1px solid ${i.tokens.colorNeutralStroke1}`,maxHeight:`fit-content`,scrollbarWidth:`thin`,scrollbarColor:`${i.tokens.colorBrandBackground} ${i.tokens.colorNeutralBackground1}`,"&::-webkit-scrollbar":{width:`8px`},"&::-webkit-scrollbar-track":{background:i.tokens.colorNeutralBackground1},"&::-webkit-scrollbar-thumb":{background:i.tokens.colorBrandBackground,borderRadius:`4px`},"&::-webkit-scrollbar-thumb:hover":{background:i.tokens.colorBrandBackgroundHover}}),blankHeader:(0,l.css)({gridColumn:`1`,backgroundColor:i.tokens.colorNeutralBackground3,borderBottom:`3px solid ${i.tokens.colorNeutralStroke3}`}),timeColumn:(0,l.css)({gridColumn:`1`,gridRow:`3 / span 49`,display:`flex`,flexDirection:`column`,backgroundColor:i.tokens.colorNeutralBackground1,borderRight:`1px solid ${i.tokens.colorNeutralStroke1}`}),timeCell:(0,l.css)({height:`100%`,maxHeight:`32px`,minHeight:`32px`,display:`flex`,alignItems:`center`,fontSize:`12px`,color:i.tokens.colorNeutralForeground3,borderBottom:`1px solid ${i.tokens.colorNeutralStroke1}`,justifyContent:`center`}),fullDayRow:(0,l.css)({gridRow:`2`,display:`grid`,gridTemplateColumns:`80px 33px`,gap:`0`,padding:`0`,backgroundColor:i.tokens.colorNeutralBackground2,borderBottom:`3px solid ${i.tokens.colorNeutralStroke2}`}),fullDayLabel:(0,l.css)({gridColumn:`1`,display:`flex`,alignItems:`center`,justifyContent:`center`,alignContent:`center`,color:i.tokens.colorBrandBackground,padding:`5px`,borderRight:`1px solid ${i.tokens.colorNeutralStroke1}`,borderBottom:`3px solid ${i.tokens.colorNeutralStroke2}`}),fullDayCell:(0,l.css)({borderRight:`1px solid ${i.tokens.colorNeutralStroke1}`,display:`flex`,flexDirection:`row`,gap:`2px`,padding:`4px`,borderBottom:`3px solid ${i.tokens.colorNeutralStroke2}`,overflow:`hidden`}),fullDayEvent:(0,l.css)({flex:`1 1 auto`,minWidth:`24px`,height:`24px`,padding:`4px 8px`,backgroundColor:i.tokens.colorBrandBackground,color:i.tokens.colorNeutralForegroundOnBrand,borderRadius:`4px`,overflow:`hidden`,display:`flex`,alignItems:`center`,justifyContent:`center`}),dayHeaderCell:(0,l.css)({textAlign:`center`,backgroundColor:i.tokens.colorNeutralBackground2,padding:`8px`,fontWeight:`bold`,borderBottom:`1px solid ${i.tokens.colorNeutralStroke1}`}),todayHeaderCell:(0,l.css)({borderTop:`5px solid ${i.tokens.colorBrandBackground}`}),eventCard:(0,l.css)({alignItems:`center`,justifyContent:`center`,marginRight:`2px`,zIndex:1,position:`absolute`,alignContent:`center`,overflow:`hidden`}),dayCell:(0,l.css)({borderBottom:`1px solid ${i.tokens.colorNeutralStroke1}`,borderRight:`1px solid ${i.tokens.colorNeutralStroke1}`,position:`relative`,overflow:`visible`,FlexDirection:`column`,gap:`4px`}),currentTimeIndicator:(0,l.css)({position:`absolute`,left:0,height:`2px`,backgroundColor:i.tokens.colorPaletteRedBorderActive,width:`100%`,zIndex:1}),currentHalfHourCell:(0,l.css)({border:`2px solid ${i.tokens.colorPaletteRedBorderActive}`}),eventTitle:(0,l.css)({display:`-webkit-box`,"-webkit-line-clamp":`1`,"-webkit-box-orient":`vertical`,textAlign:`start`,textOverflow:`ellipsis`,paddingLeft:`8px`,wordBreak:`break-word`,overflow:`hidden`})},applyEventHouverColorClass:(e,t)=>(0,l.css)({backgroundColor:e??i.tokens.colorBrandBackground,":hover":{backgroundColor:t??i.tokens.colorBrandBackgroundHover}})}),Gt={allDay:`All Day`},Kt=33,qt=e=>{let{events:r,currentDay:o,height:s,strings:c=Gt}=e,{styles:l}=Wt(),u=(0,t.useRef)(null),{getSpanSlots:d,getEventColors:f,getCalendarColors:p}=At(),m=Intl.DateTimeFormat().resolvedOptions().timeZone,{getWeekEvents:h}=Ut(m),g=t.useCallback(()=>Array.from({length:24},(e,r)=>(0,n.jsxs)(t.Fragment,{children:[(0,n.jsx)(`div`,{className:l.timeCell,children:(0,n.jsxs)(i.Body1Strong,{children:[r,`:00`]})}),(0,n.jsx)(`div`,{className:l.timeCell})]},r)),[l.timeCell]),_=t.useCallback(()=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`div`,{className:l.blankHeader}),Array.from({length:1},(e,t)=>{let r=(0,a.addDays)(o,t),s=(0,a.isToday)(r)?l.todayHeaderCell:``;return(0,n.jsxs)(`div`,{className:(0,i.mergeClasses)(l.dayHeaderCell,s),children:[(0,n.jsx)(i.Text,{weight:`semibold`,size:600,style:{paddingRight:10},children:(0,a.format)(r,`dd`)}),(0,n.jsx)(i.Subtitle1,{children:(0,a.format)(r,`LLLL, yyyy`)})]},t)})]}),[o,l.blankHeader,l.dayHeaderCell,l.todayHeaderCell]),v=t.useCallback(()=>{let e=h(r,o.toISOString());return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`div`,{className:l.fullDayLabel,children:(0,n.jsx)(i.Body1,{children:c.allDay})}),Array.from({length:1},(t,r)=>{let s=(0,a.format)((0,a.addDays)(o,r),`yyyy-MM-dd`),c=e.find(e=>e.date===s)?.fullDayEvents||[];return(0,n.jsx)(`div`,{className:l.fullDayCell,children:c.map(e=>(0,n.jsx)(`div`,{className:l.fullDayEvent,style:{gridColumn:`${r+2}`,backgroundColor:e.color?p(e.color).backgroundColor:f(e.category).backgroundColor},children:(0,n.jsx)(i.Caption1Strong,{className:l.eventTitle,children:e.title})},e.id))},r)})]})},[o,h,l.fullDayCell,l.fullDayEvent,l.fullDayLabel,l.eventTitle,p,f,r,c.allDay]),y=t.useCallback(()=>{let e=h(r,o.toISOString());return Array.from({length:1},(r,i)=>{let s=(0,a.format)((0,a.addDays)(o,i),`yyyy-MM-dd`),c=e.find(e=>e.date===s);return(0,n.jsx)(t.Fragment,{children:c?.timeSlots.map((e,t)=>{let r=e.events.length;return(0,n.jsx)(`div`,{className:l.dayCell,style:{gridRow:t+3},children:e.events.map((e,i)=>{let{spanSlots:a,startSlot:o}=d(new Date(e.start),new Date(e.end));return t===o?(0,n.jsx)(Ht,{event:e,eventCount:r,spanSlots:a,rowHeight:Kt,eventIndex:i,view:`day`},e.id):null})},t)})},i)})},[o,d,h,l.dayCell,r]);return(0,n.jsx)(`div`,{className:l.container,style:{height:s},children:(0,n.jsxs)(`div`,{ref:u,className:l.dayGrid,children:[(0,n.jsx)(`div`,{className:l.timeColumn,children:g()}),_(),v(),y()]})})},K=function(e){return e.Day=`day`,e.Week=`week`,e.Month=`month`,e}({}),Jt={month:`Month`,week:`Week`,day:`Day`},Yt=e=>{let{onSelected:r,value:a,strings:o=Jt}=e,[s,c]=t.useState(a??K.Month),[l,u]=t.useState({view:[a??K.Month]}),f=t.useMemo(()=>(0,d.bundleIcon)(d.CalendarDayFilled,d.CalendarDayRegular),[]),p=t.useMemo(()=>(0,d.bundleIcon)(d.CalendarMonthFilled,d.CalendarMonthRegular),[]),m=t.useMemo(()=>(0,d.bundleIcon)(d.CalendarWorkWeekFilled,d.CalendarWorkWeekRegular),[]);t.useEffect(()=>{a!==void 0&&(c(a),u({view:[a]}))},[a]);let[h,g]=t.useState(!1),_=t.useCallback((e,t)=>{g(t.open)},[]),v=t.useCallback(()=>{switch(s){case K.Month:return(0,n.jsx)(p,{});case K.Week:return(0,n.jsx)(m,{});case K.Day:return(0,n.jsx)(f,{});default:return(0,n.jsx)(p,{})}},[s]),y=t.useCallback(e=>{switch(e){case K.Month:return o.month;case K.Week:return o.week;case K.Day:return o.day;default:return o.month}},[o]),b=t.useCallback((e,{name:t,checkedItems:n})=>{if(t===`view`){let e=n[0];c(e),u({view:n}),r(e)}},[r]);return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(i.Menu,{open:h,onOpenChange:_,children:[(0,n.jsx)(i.MenuTrigger,{disableButtonEnhancement:!0,children:(0,n.jsx)(i.MenuButton,{shape:`circular`,icon:v(),style:{minWidth:`150px`},children:y(s)})}),(0,n.jsx)(i.MenuPopover,{children:(0,n.jsxs)(i.MenuList,{onCheckedValueChange:b,checkedValues:l,children:[(0,n.jsx)(i.MenuItemRadio,{icon:(0,n.jsx)(f,{}),name:`view`,value:K.Day,children:o.day}),(0,n.jsx)(i.MenuItemRadio,{icon:(0,n.jsx)(m,{}),name:`view`,value:K.Week,children:o.week}),(0,n.jsx)(i.MenuItemRadio,{icon:(0,n.jsx)(p,{}),name:`view`,value:K.Month,children:o.month})]})})]})})},Xt=t.memo(e=>{let{onSelected:a,value:o}=e,[s,c]=t.useState(o??new Date),[l,u]=t.useState(()=>(0,r.format)(o??new Date,`dd MMM, yyyy`)),[f,p]=t.useState(!1),m=t.useCallback((e,t)=>{p(t.open)},[]),g=t.useMemo(()=>(0,d.bundleIcon)(d.CalendarMonthFilled,d.CalendarMonthRegular),[]),_=t.useCallback(e=>{if(e){let t=Intl.DateTimeFormat().resolvedOptions().timeZone,n=(0,r.utcToZonedTime)(e,t);c(n),u((0,r.format)(n,`dd MMM, yyyy`)),a(n),p(!1)}},[a]);return(0,n.jsxs)(i.Menu,{open:f,onOpenChange:m,children:[(0,n.jsx)(i.MenuTrigger,{disableButtonEnhancement:!0,children:(0,n.jsx)(i.MenuButton,{shape:`circular`,icon:(0,n.jsx)(g,{}),style:{minWidth:`200px`},"aria-label":`Select date: ${l}`,children:l})}),(0,n.jsx)(i.MenuPopover,{style:{maxWidth:`fit-content`},children:(0,n.jsx)(i.MenuList,{children:(0,n.jsx)(h.Calendar,{highlightSelectedMonth:!0,showGoToToday:!0,onSelectDate:_,value:s})})})]})}),Zt=()=>({root:(0,l.css)({outline:`none`})}),Qt={months:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],shortMonths:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],days:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],shortDays:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],goToToday:`Go to today`},$t=e=>{let{onDateChange:r,defaultSelectedDate:i,onDismiss:a,strings:o=Qt}=e,s=Zt(),[c,l]=t.useState(i??new Date),u=t.useCallback((e,t)=>{l(e),r(e),a()},[r,a]);return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(h.Calendar,{className:s.root,dateRangeType:h.DateRangeType.Month,highlightSelectedMonth:!0,isDayPickerVisible:!1,onSelectDate:u,value:c,onDismiss:a,showGoToToday:!1,allFocusable:!1,strings:o})})},en=e=>{let{onSelected:r,value:o}=e,s=(0,d.bundleIcon)(d.CalendarMonthFilled,d.CalendarMonthRegular),[c,l]=t.useState(o??new Date);t.useEffect(()=>{r(o??new Date),l(o??new Date)},[o]);let[u,f]=t.useState(!1),p=(e,t)=>{f(t.open)},m=t.useCallback(e=>{r(e),l(e)},[]);return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(i.Menu,{open:u,onOpenChange:p,children:[(0,n.jsx)(i.MenuTrigger,{disableButtonEnhancement:!0,children:(0,n.jsx)(i.MenuButton,{shape:`circular`,icon:(0,n.jsx)(s,{}),style:{minWidth:`200px`},"aria-label":`Select month: ${(0,a.format)(c,`MMMM yyyy`)}`,children:(0,a.format)(c,`MMMM yyyy`)})}),(0,n.jsx)(i.MenuPopover,{children:(0,n.jsx)(i.MenuList,{children:(0,n.jsx)($t,{onDateChange:m,defaultSelectedDate:c,onDismiss:()=>{f(!1)}})})})]})})},tn={selectWeekPlaceholder:`Select a week`},nn=e=>{let t=Intl.DateTimeFormat().resolvedOptions().timeZone,n=(0,r.format)(e.start,`MMM`,{timeZone:t}),i=(0,r.format)(e.end,`MMM`,{timeZone:t});return(0,r.format)(e.start,`yyyy`,{timeZone:t})===(0,r.format)(e.end,`yyyy`,{timeZone:t})?n===i?`${(0,r.format)(e.start,`dd`,{timeZone:t})} - ${(0,r.format)(e.end,`dd MMM yyyy`,{timeZone:t})}`:`${(0,r.format)(e.start,`dd MMM`,{timeZone:t})} - ${(0,r.format)(e.end,`dd MMM yyyy`,{timeZone:t})}`:`${(0,r.format)(e.start,`dd MMM yyyy`,{timeZone:t})} - ${(0,r.format)(e.end,`dd MMM yyyy`,{timeZone:t})}`},rn=e=>{let t=Intl.DateTimeFormat().resolvedOptions().timeZone,n=(0,r.utcToZonedTime)(e,t),i=new Date(n);i.setDate(n.getDate()-n.getDay());let a=new Date(i);return a.setDate(i.getDate()+6),{start:(0,r.utcToZonedTime)(i,t),end:(0,r.utcToZonedTime)(a,t)}},an=t.memo(e=>{let{onSelected:r,value:a,strings:o=tn}=e,s=h.DateRangeType.Week,[c,l]=t.useState(a??new Date),[u,f]=t.useState(()=>{let e=a??new Date;return e?nn(rn(e)):o.selectWeekPlaceholder}),[p,m]=t.useState(!1),g=t.useCallback((e,t)=>{m(t.open)},[]),_=t.useMemo(()=>(0,d.bundleIcon)(d.CalendarMonthFilled,d.CalendarMonthRegular),[]),v=t.useCallback(e=>{if(e){l(e);let t=rn(e);f(nn(t)),r({startDate:t.start,endDate:t.end}),m(!1)}},[r]),y=t.useMemo(()=>0,[]);return(0,n.jsxs)(i.Menu,{open:p,onOpenChange:g,children:[(0,n.jsx)(i.MenuTrigger,{disableButtonEnhancement:!0,children:(0,n.jsx)(i.MenuButton,{shape:`circular`,icon:(0,n.jsx)(_,{}),style:{minWidth:`200px`},"aria-label":`Select week: ${u}`,children:u})}),(0,n.jsx)(i.MenuPopover,{style:{maxWidth:`fit-content`},children:(0,n.jsx)(i.MenuList,{children:(0,n.jsx)(h.Calendar,{dateRangeType:s,highlightSelectedMonth:!0,showGoToToday:!0,onSelectDate:v,value:c,firstDayOfWeek:y})})})]})}),on={today:`Today`,previous:`Previous`,next:`Next`},sn=t.memo(({selectedView:e,onSelectedView:r,currentDate:a,setCurrentDate:o,onWeekChange:s,onMonthChange:c,onDayChange:l,strings:u=on})=>{let f=t.useMemo(()=>(0,d.bundleIcon)(d.ArrowDownFilled,d.ArrowDownRegular),[]),p=t.useMemo(()=>(0,d.bundleIcon)(d.ArrowUpFilled,d.ArrowUpRegular),[]),m=t.useCallback(e=>{s(e.startDate),o(e.startDate)},[s,o]),h=t.useCallback(e=>{c(e),o(e)},[c,o]),g=t.useCallback(e=>{l(e),o(e)},[l,o]),_=t.useCallback(()=>{switch(e){case K.Month:return(0,n.jsx)(en,{onSelected:h,value:a});case K.Week:return(0,n.jsx)(an,{onSelected:m,value:a});case K.Day:return(0,n.jsx)(Xt,{onSelected:g,value:a});default:return(0,n.jsx)(en,{onSelected:h,value:a})}},[e,h,m,g,a]),v=t.useCallback(()=>(0,n.jsx)(i.Tooltip,{content:u.today,relationship:`label`,children:(0,n.jsx)(i.Button,{shape:`circular`,icon:(0,n.jsx)(d.CalendarTodayRegular,{}),size:`medium`,onClick:()=>l(new Date),children:u.today})}),[l,u.today]),y=t.useCallback(t=>{let n=new Date(a);switch(e){case K.Month:n.setMonth(n.getMonth()+t),c(n);break;case K.Week:n.setDate(n.getDate()+t*7),s(n);break;case K.Day:n.setDate(n.getDate()+t),l(n);break;default:break}o(n)},[a,e,c,s,l,o]);return(0,n.jsxs)(H,{width:`calc(100% - 40px)`,height:`fit-content`,horizontal:!0,horizontalAlign:`space-between`,verticalAlign:`center`,paddingLeft:`20px`,paddingRight:`20px`,paddingBottom:`10px`,paddingTop:`10px`,columnGap:10,styles:{overflow:`hidden`},children:[(0,n.jsxs)(H,{horizontal:!0,horizontalAlign:`start`,verticalAlign:`center`,columnGap:10,children:[(0,n.jsx)(v,{}),(0,n.jsx)(_,{}),(0,n.jsx)(i.Tooltip,{content:u.previous,relationship:`label`,children:(0,n.jsx)(i.Button,{size:`medium`,icon:(0,n.jsx)(p,{fontSize:14}),onClick:()=>y(-1)})}),(0,n.jsx)(i.Tooltip,{content:u.next,relationship:`label`,children:(0,n.jsx)(i.Button,{size:`medium`,icon:(0,n.jsx)(f,{fontSize:14}),onClick:()=>y(1)})})]}),(0,n.jsx)(H,{horizontal:!0,horizontalAlign:`start`,verticalAlign:`center`,columnGap:10,children:(0,n.jsx)(Yt,{onSelected:r,value:e})})]})}),cn={allDay:`All Day`},ln=e=>{let{events:r,currentDay:o,height:s,strings:l=cn}=e,{styles:u}=zt(),[d]=(0,t.useState)(o),[f,p]=(0,t.useState)(32),m=(0,t.useRef)(null),{getSpanSlots:h,getEventColors:g,getCalendarColors:_,formatDate:v}=At(),y=(0,a.startOfWeek)(d,{weekStartsOn:0}),b=Intl.DateTimeFormat().resolvedOptions().timeZone,{getWeekEvents:x}=Ut(b);(0,t.useEffect)(()=>{let e=new c.ResizeObserver(()=>{if(m.current){let e=m.current.querySelector(`.dayCell`);e&&p(e.offsetHeight)}});return m.current&&e.observe(m.current),()=>{e.disconnect()}},[]);let S=t.useCallback(()=>Array.from({length:24},(e,r)=>(0,n.jsxs)(t.Fragment,{children:[(0,n.jsx)(`div`,{className:u.timeCell,children:(0,n.jsxs)(i.Body1Strong,{children:[r,`:00`]})}),(0,n.jsx)(`div`,{className:u.timeCell})]},r)),[u.timeCell]),C=t.useCallback(()=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`div`,{className:u.blankHeader}),Array.from({length:7},(e,t)=>{let r=(0,a.addDays)(y,t),o=(0,a.isToday)(r)?u.todayHeaderCell:``;return(0,n.jsxs)(`div`,{className:(0,i.mergeClasses)(u.dayHeaderCell,o),children:[(0,n.jsx)(i.Text,{weight:`regular`,size:600,style:{paddingRight:10},children:v(r.toISOString(),`dd`)}),(0,n.jsx)(i.Body1,{children:v(r.toISOString(),`EEE`)})]},t)})]}),[y,u,v]),w=t.useCallback(()=>{let e=x(r,y.toISOString());return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`div`,{className:u.fullDayLabel,children:(0,n.jsx)(i.Body1,{children:l.allDay})}),Array.from({length:7},(t,r)=>{let o=v((0,a.addDays)(y,r).toISOString(),`yyyy-MM-dd`),s=e.find(e=>e.date===o)?.fullDayEvents||[];return(0,n.jsx)(`div`,{className:u.fullDayCell,children:s.map(e=>(0,n.jsx)(`div`,{className:u.fullDayEvent,style:{gridColumn:`${r+2}`,backgroundColor:e.color?_(e.color).backgroundColor:g(e.category).backgroundColor},children:(0,n.jsx)(i.Caption1Strong,{className:u.eventTitle,children:e.title})},e.id))},r)})]})},[y,u,x,_,g,r,v,l.allDay]),T=t.useCallback(()=>{let e=x(r,y.toISOString());return Array.from({length:7},(t,r)=>{let i=(0,a.format)((0,a.addDays)(y,r),`yyyy-MM-dd`);return(0,n.jsx)(n.Fragment,{children:e.find(e=>e.date===i)?.timeSlots.map((e,t)=>{let r=e.events.length;return(0,n.jsx)(`div`,{className:u.dayCell,style:{gridRow:t+3},children:e.events.map((e,i)=>{let{spanSlots:a,startSlot:o}=h(new Date(e.start),new Date(e.end));return t===o?(0,n.jsx)(Ht,{event:e,eventCount:r,spanSlots:a,rowHeight:f,eventIndex:i,view:`week`},e.id):null})},t)})})})},[y,u,x,h,f,r]);return(0,n.jsx)(`div`,{className:u.container,style:{height:s},children:(0,n.jsxs)(`div`,{ref:m,className:u.weekGrid,children:[(0,n.jsx)(`div`,{className:u.timeColumn,children:S()}),C(),w(),T()]})})},un={daysOfWeek:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`]},dn=({currentDate:e,rowHeight:t,getCalendarDays:r,getEventsForDay:a,styles:o,onDaySlotClick:s,height:c,calendarRef:l,strings:u})=>{let d=u?.daysOfWeek||un.daysOfWeek;return(0,n.jsx)(H,{height:c,width:`100%`,verticalAlign:`start`,horizontalAlign:`start`,children:(0,n.jsxs)(`div`,{className:o.calendarWrapper,ref:l,role:`grid`,"aria-label":`Calendar`,children:[d.map(e=>(0,n.jsx)(i.Body1,{className:o.dayHeader,role:`columnheader`,children:e},e)),r(e).map((e,r)=>{let{day:i,currentMonth:o}=e,c=o?a(e):[];return(0,n.jsx)(Rt,{day:i,date:e.date,currentMonth:e.currentMonth,events:c,columnHeight:t||0,onDayClick:s},r)})]})})},fn=t.memo(({events:e,currentDay:t,height:r,strings:i})=>(0,n.jsx)(ln,{events:e,currentDay:t,height:r,strings:i})),pn=t.memo(({events:e,currentDay:t,height:r,strings:i})=>(0,n.jsx)(qt,{currentDay:t,events:e,height:r,strings:i})),mn=({events:e,height:r=800,theme:o,onDayChange:s,onMonthChange:l,onWeekChange:u,onViewChange:d,onDaySlotClick:f,defaultView:p,strings:m})=>{let{styles:h}=It(),g=(0,t.useRef)(null),[_,v]=(0,t.useState)(null),y=(0,t.useRef)(0),[b,x]=(0,t.useState)(new Date),[S,C]=(0,t.useState)(p??K.Month),{getMonthCalendar:w}=Ut(Intl.DateTimeFormat().resolvedOptions().timeZone),T=t.useCallback(e=>{let t=e.getMonth(),n=(0,a.startOfWeek)((0,a.startOfMonth)(e));return Array.from({length:42},(e,r)=>{let i=(0,a.addDays)(n,r);return{day:i.getDate(),currentMonth:i.getMonth()===t,date:i}})},[42]),E=t.useCallback(e=>{l&&l(e),x(e)},[l]),D=t.useCallback(e=>{s&&s(e),x(e)},[s]),O=t.useCallback(e=>{u&&u(e),x(e)},[u]),k=t.useCallback(e=>{d&&d(e),C(e)},[d]),A=t.useCallback(t=>{let{date:n}=t;return w(e,b.getFullYear(),b.getMonth())[(0,a.format)(n,`yyyy-MM-dd`)]?.flatMap(e=>e)||[]},[b,e]),j=t.useCallback(()=>{g.current&&requestAnimationFrame(()=>{if(g.current){let e=g.current.querySelector(`.${h.calendarWrapper} > div:nth-child(8)`);e&&(v(e.offsetHeight),y.current=e.offsetHeight)}})},[h.calendarWrapper]);(0,t.useEffect)(()=>{let e=new c.ResizeObserver(j);return g.current&&e.observe(g.current),j(),window.addEventListener(`resize`,j),()=>{e.disconnect(),window.removeEventListener(`resize`,j)}},[j,S]),(0,t.useEffect)(()=>{C(p||K.Month)},[p]);let M=t.useCallback(()=>{switch(S){case K.Month:return(0,n.jsx)(dn,{events:e,currentDate:b,rowHeight:_,getCalendarDays:T,getEventsForDay:A,styles:h,onDaySlotClick:f,height:r,calendarRef:g,strings:m?.calendarControl});case K.Week:return(0,n.jsx)(fn,{events:e,currentDay:b,height:r,strings:m?.weekView});case K.Day:return(0,n.jsx)(pn,{events:e,currentDay:b,height:r,strings:m?.dayView});default:return(0,n.jsx)(dn,{events:e,currentDate:b,rowHeight:_,getCalendarDays:T,getEventsForDay:A,styles:h,onDaySlotClick:f,height:r,calendarRef:g,strings:m?.calendarControl})}},[S,e,b,_,T,A,h,f,r]),N=(0,n.jsxs)(H,{height:`100%`,verticalAlign:`start`,children:[(0,n.jsx)(sn,{selectedView:S,onSelectedView:k,currentDate:b,setCurrentDate:x,onWeekChange:O,onMonthChange:E,onDayChange:D,strings:m?.toolbar}),(0,n.jsx)(M,{})]});return(0,n.jsx)(i.IdPrefixProvider,{value:`calendarControl-`,children:o?(0,n.jsx)(i.FluentProvider,{theme:o,applyStylesToPortals:!0,style:{width:`100%`},children:N}):(0,n.jsx)(`div`,{style:{width:`100%`},children:N})})},hn=()=>({dropdownRoot:(0,l.css)({border:`1px solid ${i.tokens.colorNeutralStroke2} !important`,borderBottom:`1px solid ${i.tokens.colorNeutralStroke2} !important`,borderRadius:`50px !important`,backgroundColor:`${i.tokens.colorNeutralBackground1} !important`,padding:`0px 10px !important`,boxShadow:`none !important`,transition:`all 0.2s ease`,"&::after":{display:`none !important`,borderWidth:`0 !important`,content:`"none !important"`},"&:hover":{borderColor:`${i.tokens.colorBrandStroke1} !important`},"&:focus-within":{borderColor:`${i.tokens.colorBrandStroke1} !important`,boxShadow:`0 0 0 2px ${i.tokens.colorBrandBackground2} !important`}})}),gn=({options:e,onChange:r,renderItem:a,validate:o,label:s,placeholder:c,defaultValue:l,message:u,messageType:f,required:p,size:m,hint:h})=>{let g=l?e.find(e=>e.value===l):void 0,[_,v]=(0,t.useState)(l||``),[y,b]=(0,t.useState)(g?.text||``),[x,S]=(0,t.useState)(``),C=hn(),w=(e,t)=>{let n=t.optionValue||``,i=t.optionText||``;v(n),b(i);let a=o?o(n):``;S(a),!a&&r&&r(n)},T=t.useMemo(()=>x?`error`:f===`warning`?`warning`:f===`info`?`success`:`none`,[x,f]);return(0,n.jsx)(i.Field,{label:s,required:p,validationMessage:t.useMemo(()=>x||u,[x,u]),validationMessageIcon:t.useCallback(()=>{switch(T){case`error`:return(0,n.jsx)(d.ErrorCircle12Filled,{});case`warning`:return(0,n.jsx)(d.Warning12Filled,{});case`success`:return(0,n.jsx)(d.CheckmarkCircle12Filled,{});default:return null}},[T])(),size:m,hint:h,validationState:T,children:(0,n.jsx)(i.Dropdown,{placeholder:c,onOptionSelect:w,value:y,selectedOptions:_?[_]:[],className:C.dropdownRoot,children:e.map(e=>{let t=e.icon??e.checkIcon;return(0,n.jsx)(i.Option,{value:e.value,disabled:e.disabled,as:e.as,text:e.text||``,children:a?a(e):(0,n.jsxs)(n.Fragment,{children:[t&&(0,n.jsx)(`span`,{style:{marginRight:4,display:`inline-flex`,alignItems:`center`},children:t}),e.text]})},e.value)})})})},_n=()=>({inputRoot:(0,l.css)({border:`1px solid ${i.tokens.colorNeutralStroke2} !important`,borderBottom:`1px solid ${i.tokens.colorNeutralStroke2} !important`,borderRadius:`50px !important`,backgroundColor:`${i.tokens.colorNeutralBackground1} !important`,padding:`0px 10px !important`,boxShadow:`none !important`,transition:`all 0.2s ease`,"&::after":{display:`none !important`,borderWidth:`0 !important`,content:`"none !important"`},"&:hover":{borderColor:`${i.tokens.colorBrandStroke1} !important`},"&:focus-within":{borderColor:`${i.tokens.colorBrandStroke1} !important`,boxShadow:`0 0 0 2px ${i.tokens.colorBrandBackground2} !important`}})}),vn=({value:r,type:a=`text`,shape:o=`normal`,onChange:s,validate:c,label:l,placeholder:u,message:f,messageType:p,required:m,size:h,hint:g,disabled:_,readOnly:v,min:y,max:b,step:x,contentBefore:S,contentAfter:C})=>{let[w,T]=(0,t.useState)(r===void 0?``:String(r)),[E,D]=(0,t.useState)(``),O=_n(),k=e.c(),A=r!==void 0,j=A?String(r):w,M=(0,t.useCallback)(e=>{if(m&&e.trim()===``)return a===`number`?k.numberRequired:k.fieldRequired;if(a===`number`&&e.trim()!==``){let t=Number(e);if(isNaN(t))return k.invalidNumber;if(y!==void 0&&t<y)return k.valueMustBeAtLeast.replace(`{0}`,String(y));if(b!==void 0&&t>b)return k.valueMustBeAtMost.replace(`{0}`,String(b))}return c?c(a===`number`&&e.trim()!==``?Number(e):e):``},[m,a,c,y,b,k]),N=(0,t.useCallback)((e,t)=>{let n=t.value;if(a===`number`&&n!==``&&!/^-?\d*\.?\d*$/.test(n))return;A||T(n);let r=M(n);D(r),!r&&s&&s(a===`number`&&n.trim()!==``?Number(n):n)},[a,A,M,s]),ee=(0,t.useCallback)(()=>{D(M(j))},[M,j]),P=(0,t.useMemo)(()=>E?`error`:p===`warning`?`warning`:p===`info`?`success`:`none`,[E,p]),F=(0,t.useMemo)(()=>E||f,[E,f]),I=(0,t.useCallback)(()=>{switch(P){case`error`:return(0,n.jsx)(d.ErrorCircle12Filled,{});case`warning`:return(0,n.jsx)(d.Warning12Filled,{});case`success`:return(0,n.jsx)(d.CheckmarkCircle12Filled,{});default:return null}},[P]),L=o===`circular`?O.inputRoot:void 0;return(0,n.jsx)(i.Field,{label:l,required:m,validationMessage:F,validationMessageIcon:I(),size:h,hint:g,validationState:P,children:(0,n.jsx)(i.Input,{value:j,placeholder:u,onChange:N,onBlur:ee,disabled:_,readOnly:v,type:`text`,inputMode:a===`number`?`decimal`:`text`,step:a===`number`?x:void 0,className:L,contentBefore:S,contentAfter:C})})},yn=()=>({searchBoxStyles:g.css`
|
|
16
32
|
border: 1px solid ${i.tokens.colorNeutralStroke2};
|
|
17
33
|
border-radius: 50px;
|
|
18
34
|
background-color: ${i.tokens.colorNeutralBackground1};
|
|
@@ -335,7 +351,7 @@ import { AISearchIcon } from './AISearchIcon';
|
|
|
335
351
|
align-items: center !important;
|
|
336
352
|
padding: ${i.tokens.spacingVerticalS} ${i.tokens.spacingHorizontalM};
|
|
337
353
|
background-color: ${i.tokens.colorNeutralBackground1};
|
|
338
|
-
|
|
354
|
+
|
|
339
355
|
min-height: 48px;
|
|
340
356
|
gap: ${i.tokens.spacingHorizontalXS};
|
|
341
357
|
white-space: nowrap;
|
package/dist/index.js
CHANGED
|
@@ -993,73 +993,106 @@ var Sa = /* @__PURE__ */ function(e) {
|
|
|
993
993
|
})
|
|
994
994
|
}) });
|
|
995
995
|
}, Ma = (e) => {
|
|
996
|
-
let { cols: t, verticalSpacing: n, horizontalSpacing: r, styles: i, gridItemAutoFlow: a, minItemWidth: o } = e, { getSpacing:
|
|
997
|
-
return {
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
996
|
+
let { cols: t, verticalSpacing: n, horizontalSpacing: r, styles: i, gridItemAutoFlow: a, minItemWidth: o, enableInfiniteScroll: s } = e, { getSpacing: c, getCurrentDevice: l, getBaseStyles: u } = na();
|
|
997
|
+
return {
|
|
998
|
+
gridStyles: w.useCallback((d, f) => {
|
|
999
|
+
let p = u(e, d, f), m = `${c(n, d, "vertical")} ${c(r, d, "horizontal")}`, h = l(d), g = `repeat(auto-${a ?? "fill"}, minmax(min(100%, ${o ?? 250}px), 1fr))`;
|
|
1000
|
+
if (t && t > 0) {
|
|
1001
|
+
let e = t ?? 0;
|
|
1002
|
+
switch (h) {
|
|
1003
|
+
case "ExtraSmall":
|
|
1004
|
+
e = Math.min(t, 1);
|
|
1005
|
+
break;
|
|
1006
|
+
case "Small":
|
|
1007
|
+
e = Math.min(t, 2);
|
|
1008
|
+
break;
|
|
1009
|
+
case "Medium":
|
|
1010
|
+
e = Math.min(t, 3);
|
|
1011
|
+
break;
|
|
1012
|
+
case "Large":
|
|
1013
|
+
e = Math.min(t, 4);
|
|
1014
|
+
break;
|
|
1015
|
+
case "ExtraLarge":
|
|
1016
|
+
e = Math.min(t, 4);
|
|
1017
|
+
break;
|
|
1018
|
+
case "ExtraExtraLarge":
|
|
1019
|
+
e = Math.min(t, 5);
|
|
1020
|
+
break;
|
|
1021
|
+
case "XXXLarge":
|
|
1022
|
+
e = Math.min(t, 6);
|
|
1023
|
+
break;
|
|
1024
|
+
default: e = 0;
|
|
1025
|
+
}
|
|
1026
|
+
g = `repeat(${e}, minmax(auto, 1fr))`;
|
|
1024
1027
|
}
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1028
|
+
return {
|
|
1029
|
+
...p,
|
|
1030
|
+
display: "grid",
|
|
1031
|
+
gridTemplateColumns: g,
|
|
1032
|
+
gap: m,
|
|
1033
|
+
overflow: "hidden",
|
|
1034
|
+
overflowY: s ? "auto" : "hidden",
|
|
1035
|
+
...s ? {
|
|
1036
|
+
scrollbarWidth: "thin",
|
|
1037
|
+
scrollbarColor: `${V.colorBrandBackground} ${V.colorNeutralBackground3}`,
|
|
1038
|
+
paddingRight: "10px"
|
|
1039
|
+
} : {},
|
|
1040
|
+
...i
|
|
1041
|
+
};
|
|
1042
|
+
}, [
|
|
1043
|
+
u,
|
|
1044
|
+
e,
|
|
1045
|
+
c,
|
|
1046
|
+
n,
|
|
1047
|
+
r,
|
|
1048
|
+
l,
|
|
1049
|
+
t,
|
|
1050
|
+
i,
|
|
1051
|
+
a,
|
|
1052
|
+
o,
|
|
1053
|
+
s
|
|
1054
|
+
]),
|
|
1055
|
+
scrollbarClassName: w.useMemo(() => {
|
|
1056
|
+
if (s) return H`
|
|
1057
|
+
&::-webkit-scrollbar {
|
|
1058
|
+
width: 6px !important;
|
|
1059
|
+
height: 6px !important;
|
|
1060
|
+
}
|
|
1061
|
+
&::-webkit-scrollbar-track {
|
|
1062
|
+
background: ${V.colorNeutralBackground3} !important;
|
|
1063
|
+
border-radius: ${V.borderRadiusMedium} !important;
|
|
1064
|
+
}
|
|
1065
|
+
&::-webkit-scrollbar-thumb {
|
|
1066
|
+
background: ${V.colorBrandBackground} !important;
|
|
1067
|
+
border-radius: ${V.borderRadiusMedium} !important;
|
|
1068
|
+
}
|
|
1069
|
+
&::-webkit-scrollbar-thumb:hover {
|
|
1070
|
+
background: ${V.colorBrandBackgroundHover} !important;
|
|
1071
|
+
}
|
|
1072
|
+
`;
|
|
1073
|
+
}, [s])
|
|
1074
|
+
};
|
|
1047
1075
|
}, Na = (e) => {
|
|
1048
|
-
let { children: t, className: n } = e, { gridStyles:
|
|
1076
|
+
let { children: t, className: n, onScroll: r } = e, { gridStyles: i, scrollbarClassName: a } = Ma(e), o = w.useRef(null), [s, c] = w.useState(0), [l, u] = w.useState(0);
|
|
1049
1077
|
return w.useEffect(() => {
|
|
1050
1078
|
let e;
|
|
1051
|
-
return
|
|
1079
|
+
return o.current && (e = new Sn((e) => {
|
|
1052
1080
|
for (let t of e) {
|
|
1053
1081
|
let { width: e, height: n } = t.contentRect;
|
|
1054
|
-
|
|
1082
|
+
c(e), u(n);
|
|
1055
1083
|
}
|
|
1056
|
-
}), e.observe(
|
|
1084
|
+
}), e.observe(o.current)), () => {
|
|
1057
1085
|
e && e.disconnect();
|
|
1058
1086
|
};
|
|
1059
1087
|
}, []), /* @__PURE__ */ F(P, { children: /* @__PURE__ */ F("div", {
|
|
1060
|
-
className: n,
|
|
1061
|
-
style:
|
|
1062
|
-
ref:
|
|
1088
|
+
className: [n, a].filter(Boolean).join(" "),
|
|
1089
|
+
style: i(s, l),
|
|
1090
|
+
ref: o,
|
|
1091
|
+
onScroll: w.useCallback((e) => {
|
|
1092
|
+
if (!r) return;
|
|
1093
|
+
let { scrollTop: t, scrollHeight: n, clientHeight: i } = e.currentTarget;
|
|
1094
|
+
(t + i) / n >= .95 && r(e);
|
|
1095
|
+
}, [r]),
|
|
1063
1096
|
children: t
|
|
1064
1097
|
}) });
|
|
1065
1098
|
}, Pa = (e) => {
|
|
@@ -3957,20 +3990,18 @@ var Sa = /* @__PURE__ */ function(e) {
|
|
|
3957
3990
|
children: A
|
|
3958
3991
|
})
|
|
3959
3992
|
});
|
|
3960
|
-
}, ts = () => ({
|
|
3993
|
+
}, ts = () => ({ dropdownRoot: H({
|
|
3961
3994
|
border: `1px solid ${V.colorNeutralStroke2} !important`,
|
|
3995
|
+
borderBottom: `1px solid ${V.colorNeutralStroke2} !important`,
|
|
3962
3996
|
borderRadius: "50px !important",
|
|
3963
3997
|
backgroundColor: `${V.colorNeutralBackground1} !important`,
|
|
3964
|
-
padding: "0px 10px",
|
|
3965
|
-
boxShadow: "none",
|
|
3966
|
-
transition: "all 0.2s ease
|
|
3998
|
+
padding: "0px 10px !important",
|
|
3999
|
+
boxShadow: "none !important",
|
|
4000
|
+
transition: "all 0.2s ease",
|
|
3967
4001
|
"&::after": {
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
borderRadius: "inherit",
|
|
3972
|
-
border: "2px solid transparent",
|
|
3973
|
-
pointerEvents: "none"
|
|
4002
|
+
display: "none !important",
|
|
4003
|
+
borderWidth: "0 !important",
|
|
4004
|
+
content: "\"none !important\""
|
|
3974
4005
|
},
|
|
3975
4006
|
"&:hover": { borderColor: `${V.colorBrandStroke1} !important` },
|
|
3976
4007
|
"&:focus-within": {
|
|
@@ -4004,7 +4035,7 @@ var Sa = /* @__PURE__ */ function(e) {
|
|
|
4004
4035
|
onOptionSelect: b,
|
|
4005
4036
|
value: h,
|
|
4006
4037
|
selectedOptions: p ? [p] : [],
|
|
4007
|
-
className: y.
|
|
4038
|
+
className: y.dropdownRoot,
|
|
4008
4039
|
children: e.map((e) => {
|
|
4009
4040
|
let t = e.icon ?? e.checkIcon;
|
|
4010
4041
|
return /* @__PURE__ */ F(lt, {
|
|
@@ -8334,7 +8365,7 @@ var hl = () => ({
|
|
|
8334
8365
|
align-items: center !important;
|
|
8335
8366
|
padding: ${V.spacingVerticalS} ${V.spacingHorizontalM};
|
|
8336
8367
|
background-color: ${V.colorNeutralBackground1};
|
|
8337
|
-
|
|
8368
|
+
|
|
8338
8369
|
min-height: 48px;
|
|
8339
8370
|
gap: ${V.spacingHorizontalXS};
|
|
8340
8371
|
white-space: nowrap;
|