PageSourceSearch

https://www.mapka.ai/static/js/index.CcFifQPt.js

js mapka.ai collected 2026-10-05 14:52:46 UTC 443,000 bytes, 33 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Table.C9zkVDcb.js","./rolldown-runtime.C0FnF6B9.js","./emotion-is-prop-valid.esm.CuYlOKOk.js","./emotion-styled.browser.esm.Dj5rZcu_.js","./protobuf.Bpsvwqxh.js","./utils.BVKswTgl.js","./loglevel.xXLtmX_e.js","./getColors.CymiOtHO.js","./types.cZoyy9Y-.js","./isArrayLike.Crw2F5li.js","./isSymbol.CmW3dkoN.js","./merge.D4_AOTv8.js","./toString.tRXNBxtF.js","./_isIterateeCall.BUStsXAd.js","./isArrayLikeObject.B3Zf3PTL.js","./StreamlitMarkdown.URFTuuY_.js","./emotion-react.browser.esm.DBDHL_YU.js","./last.DfjdtCRp.js","./_baseFlatten.IOj0lc7G.js","./UriUtil.DzB8oLds.js","./useCrossOriginAttribute.BNe8nzCu.js","./useEmotionTheme.cgGerbj0.js","./Tooltip.J-aaVqsl.js","./react-dom.BzV73oHg.js","./useFloatingOverlay.DP8o9Tmt.js","./lib.DuoFSfCJ.js","./lib.DaUKNU-6.js","./lib.CMmWlZtt.js","./space-separated-tokens.BqhiSyze.js","./ErrorElement.CZxpg0mG.js","./preload-helper.HclGiUj8.js","./pandasStylerUtils.By9eJAUc.js","./_baseIndexOf.CYLdY-L6.js","./_hasUnicode.Cp9Achgk.js","./range.DL19EGGd.js","./unzip.BaBcYNJz.js","./_baseProperty.BV6HSwpm.js","./recordbatch.DqFeZyUe.js","./serialization.BdCe8Hfp.js","./moment.Ok9d1Jk7.js","./numbro.DLZxPTzv.js","./ArrowVegaLiteChart.CnqICc92.js","./utils.UWs8FDy4.js","./FormClearHelper.DQyO4WEk.js","./index.esm.M9ThdiDn.js","./DataFrame.CZ6u6FRw.js","./isString.C7-zy-83.js","./isEmpty.DjruDP6v.js","./FlexContext.C2pOT4NU.js","./DynamicIcon.CPTEN0lY.js","./Icon.vdHFYnd8.js","./useTimeout.DgWF0Nme.js","./Check.esm.Cipw9iKh.js","./toConsumableArray.DL1akTfG.js","./Delete.esm.qg4sJoHs.js","./FileDownload.esm.BqHa9DH4.js","./Toolbar.TCG1mQzn.js","./styled-components.DuYBb88g.js","./useFocusRing.CDbi6AXW.js","./useButton.sIM084dT.js","./useFocusable.BGrS8kdy.js","./usePress.DSzZSVxr.js","./textSelection.TBFd5B_K.js","./useToggleState.M3PTobVF.js","./SelectionIndicator.BSp0qhd3.js","./FocusScope.B2StaDbT.js","./horizontalOverflowFade.BB1N5Tky.js","./BaseButton.zX9IAlMO.js","./useCopyToClipboard.C-ywP4Jl.js","./useRequiredContext.DBsQavvD.js","./_baseAssignValue.DPvIkN18.js","./withFullScreenWrapper.D_pC5DjL.js","./useDebouncedCallback.DmVKnuOW.js","./dist.M42-4E3x.js","./reactJsonViewCompat.CMfXJ98m.js","./resolveDefaultExport.DJbX7TqQ.js","./formatNumber.BjVk99bB.js","./sprintfjs.ih5FFOBP.js","./formatMoment.CVxEWQ-Q.js","./createDownloadLinkElement.szflUduS.js","./styled-components.CO_R0WlO.js","./linear.6duwCeOq.js","./defaultLocale.CNPGWpMu.js","./init.ZlXS9mIS.js","./string.2gFcx07-.js","./value.D6n4OHqi.js","./ordinal.BefGibR5.js","./time.txmWlDeM.js","./range.EplFIxc7.js","./cubic.eRia_ypQ.js","./threshold.DoT4oT5R.js","./colors.Cg5Vh3br.js","./treemap.BfjIY-m6.js","../css/DataFrame.DUkanX9_.css","./ContentCopy.esm.B7i0-ihs.js","./TableChart.esm.o-QINulw.js","./downloadDataUrl.DgUN6zlz.js","./Audio.CEpG_cwN.js","./Balloons.DCOHPjUs.js","./Particles.BgCinPs0.js","./DeckGlJsonChart.Cwh7y9Xq.js","./useBasicWidgetState.zd4Mr3p5.js","../css/DeckGlJsonChart.s6LXjV0D.css","./EChartsChart.xboV5vie.js","./GraphVizChart.BcyMJFej.js","./src.CO5Z61DO.js","./Html.BWKIiOvA.js","./purify.es.CYRiAeUx.js","./IFrame.CJEcrs1k.js","./IFrameUtil.PlC_b34Z.js","./ImageList.Diw5VWen.js","./Json.DfzTeKsg.js","./LinkButton.CSp4iDJ5.js","./iconPosition.Ch88GaMF.js","./Metric.B02FwwbX.js","./styled-components.wtDqCLAZ.js","./WidgetLabelHelpIconInline._QMPwlXq.js","./PageLink.BKVzgcLV.js","./PlotlyChart.DbjBdK9w.js","./Progress.D-aKfW--.js","./ProgressBar.BqlRBelx.js","./ProgressBar.BtQV66eX.js","./useLabel.lVVixOvu.js","./useNumberFormatter.CDGMCuzz.js","./NumberFormatter.CHYrjPj-.js","./Snow.BM4wYEfZ.js","./Spinner.DRKa_gCK.js","./StreamlitSyntaxHighlighter.DjwkZDHJ.js","./hastscript.HMW3Cnwp.js","./Toast.D2J7TkN_.js","./Video.Bioiuj5R.js","./AudioInput.XXvnX2J8.js","./zip.DLtjLZjW.js","./WidgetLabel.BkYqdlQq.js","./WidgetLabelHelpIcon.DdJPZIAX.js","./useWaveformController.CJR-kTbh.js","./urls.B0fCYwet.js","./Button.O77LRFsV.js","./ButtonGroup.Cx22Hfn9.js","./ComponentInstance.BwNBFYRP.js","./withCalculatedWidth.BB46r2uk.js","./CameraInput.B3VD66Ch.js","./UploadFileInfo.WAP1L8Dh.js","./ChatInput.C_woB0a7.js","./utils.B2S3VTEX.js","./ErrorOutline.esm.C2eXn1c_.js","./Cancel.esm.CTsGLAQG.js","./InputInstru
1ctions.D6M63hIK.js","./useTextInputAutoExpand.BD0LAvnm.js","./inputUtils.CD44xxT-.js","./Checkbox.CNx9itha.js","./Text.DurHytoy.js","./useFormValidation.D_EeMFdi.js","./useFormReset.B5dINuwX.js","./useSlot.DBjYxDVG.js","./ColorPicker.BL3ihIcu.js","./map.C_LElyNk.js","./_baseEach.PLhpSRgM.js","./_baseIsEqual.sdZCjgvS.js","./_baseMap.OhVc4KF-.js","./isUndefined.Dk8JX1dj.js","./DateInput.Cy1iyJU0.js","./DateField.H0giVp-E.js","./useDescription.C9ZPiKDT.js","./LiveAnnouncer.B5rbC36U.js","./useField.CNyPK5GZ.js","./Input.DGBb6gnA.js","./useFilter.uZjHVT-e.js","./useCollator.FXXJK2Vb.js","./ReorderedSegments.DPYUawpt.js","./useCollection.DOwgVAYY.js","./shim.BbyJgaa_.js","./useMenuTrigger.Cn9YZS24.js","./Autocomplete.kV4wwzw9.js","./useLoadMoreSentinel.Cx-JEQXv.js","./DateTimeInput.DGlI1YM6.js","./DownloadButton.BHgWCdF6.js","./Feedback.CMkDF62V.js","./FileUploader.CoRA2jyX.js","./FormSubmitContent.CNp7e-aj.js","./Multiselect.mQJuGPmL.js","./fuzzyFilterSelectOptions.CSCkTHkf.js","./sortBy.BN5z75-Y.js","./useTextField.9okiSWF0.js","./MenuButton.DJLNl_Ul.js","./NumberInput.Df2wSd59.js","./TextField.0J3PX-wt.js","./Pagination.8gNQgOnm.js","./useResizeObserver.3kyCQ1g6.js","./Radio.CzyUQudO.js","./Selectbox.B6TvsQ3N.js","./Slider.DAVZJBXN.js","./TextArea.BCoUcqsn.js","./useUpdateUiValue.BiKSuMNg.js","./TextInput.DZMdozJH.js","./TimeInput.DVHGNTs_.js","./BidiComponent.CzdAZaBu.js","./_arrayReduce.CiwPAjrV.js","./lib.Dd69Svmo.js","./axios.CdukPVqq.js","./iframeResizer.contentWindow.CwEfsvtk.js"])))=>i.map(i=>d[i]);
2import{o as e,r as t,t as n}from"./rolldown-runtime.C0FnF6B9.js";import{r}from"./emotion-is-prop-valid.esm.CuYlOKOk.js";import{_ as i,a,b as o,i as s,l as c,o as l,r as u,t as d,v as f,y as p}from"./emotion-styled.browser.esm.Dj5rZcu_.js";import{t as m}from"./loglevel.xXLtmX_e.js";import{t as h}from"./react-dom.BzV73oHg.js";import{i as g,n as _,t as v}from"./emotion-react.browser.esm.DBDHL_YU.js";import{A as y,D as b,G as x,J as S,K as C,L as w,N as T,O as E,P as D,R as O,S as k,T as A,U as ee,W as j,a as M,b as N,c as te,d as ne,i as re,j as ie,m as ae,q as oe,r as P,t as se,u as F,w as ce,x as le,y as ue}from"./protobuf.Bpsvwqxh.js";import{C as I,D as de,E as L,S as fe,T as pe,a as me,f as he,w as ge}from"./getColors.CymiOtHO.js";import{n as R,t as z}from"./types.cZoyy9Y-.js";import{r as _e}from"./toString.tRXNBxtF.js";import{i as ve,o as ye}from"./isArrayLike.Crw2F5li.js";import{d as be,u as xe}from"./merge.D4_AOTv8.js";import{g as Se,h as Ce,m as we}from"./isArrayLikeObject.B3Zf3PTL.js";import{n as Te}from"./last.DfjdtCRp.js";import{B as Ee,C as De,D as Oe,F as ke,G as Ae,H as je,I as Me,J as Ne,K as Pe,L as Fe,M as Ie,Q as Le,R as Re,S as ze,T as Be,U as Ve,V as He,X as Ue,Y as We,_ as Ge,a as Ke,c as qe,ct as Je,d as Ye,dt as Xe,et as Ze,f as Qe,g as $e,h as et,i as tt,it as nt,l as rt,lt as it,m as at,n as ot,nt as st,p as ct,q as lt,r as ut,rt as dt,st as ft,t as pt,tt as mt,u as ht,ut as gt,v as _t,w as vt,x as yt,y as bt,z as xt}from"./utils.BVKswTgl.js";import{E as St,T as Ct,_ as wt,a as Tt,b as Et,d as Dt,f as Ot,g as kt,h as At,i as jt,l as Mt,m as Nt,n as Pt,o as Ft,r as It,t as Lt,u as Rt,v as zt,x as Bt,y as Vt}from"./StreamlitMarkdown.URFTuuY_.js";import{t as Ht}from"./_baseIsEqual.sdZCjgvS.js";import{i as Ut,r as Wt,t as Gt}from"./_baseEach.PLhpSRgM.js";import{a as Kt,n as qt,r as Jt,t as Yt}from"./utils.UWs8FDy4.js";import{n as Xt,t as Zt}from"./FlexContext.C2pOT4NU.js";import{n as Qt}from"./Icon.vdHFYnd8.js";import{i as $t,r as en,t as B}from"./DynamicIcon.CPTEN0lY.js";import{i as tn,r as nn,t as rn}from"./UriUtil.DzB8oLds.js";import{t as an}from"./useCrossOriginAttribute.BNe8nzCu.js";import{t as on}from"./useEmotionTheme.cgGerbj0.js";import{$ as sn,C as cn,D as ln,G as un,H as dn,J as fn,N as pn,Q as mn,S as hn,T as gn,U as _n,W as vn,X as yn,Y as bn,Z as xn,at as Sn,c as Cn,ct as wn,d as Tn,dt as En,et as Dn,ft as On,ht as kn,i as An,it as jn,l as Mn,lt as Nn,mt as Pn,n as Fn,nt as In,o as Ln,pt as Rn,q as zn,s as Bn,st as Vn,t as Hn,tt as Un,u as Wn,ut as Gn,v as Kn,x as qn,y as Jn}from"./Tooltip.J-aaVqsl.js";import{S as Yn,_ as Xn,b as Zn,c as Qn,f as $n,g as er,i as tr,m as nr,n as rr,o as ir,p as ar,r as or,t as sr,v as cr}from"./useCollection.DOwgVAYY.js";import{a as lr,d as ur,r as dr,s as fr,t as pr}from"./useFocusRing.CDbi6AXW.js";import{a as mr,i as hr}from"./useDescription.C9ZPiKDT.js";import{r as gr}from"./useLabel.lVVixOvu.js";import{i as _r,t as vr}from"./LiveAnnouncer.B5rbC36U.js";import{n as yr,t as br}from"./useFocusable.BGrS8kdy.js";import{n as xr,r as Sr}from"./Text.DurHytoy.js";import{t as Cr}from"./shim.BbyJgaa_.js";import{n as wr,r as Tr}from"./usePress.DSzZSVxr.js";import{n as Er}from"./ProgressBar.BtQV66eX.js";import{t as Dr}from"./useButton.sIM084dT.js";import{n as Or,r as kr,t as Ar}from"./SelectionIndicator.BSp0qhd3.js";
2import{a as jr,n as Mr,r as Nr,t as Pr}from"./FocusScope.B2StaDbT.js";import{D as Fr,O as Ir,c as Lr,n as Rr,o as zr,s as Br,t as V}from"./styled-components.DuYBb88g.js";import{t as Vr}from"./BaseButton.zX9IAlMO.js";import{a as Hr,c as Ur,d as Wr,i as Gr,l as Kr,n as qr,o as Jr,r as Yr,s as Xr}from"./ErrorElement.CZxpg0mG.js";import{a as Zr,r as Qr,t as $r}from"./useFloatingOverlay.DP8o9Tmt.js";import{t as H}from"./preload-helper.HclGiUj8.js";import{n as ei}from"./FormClearHelper.DQyO4WEk.js";import{t as ti}from"./useTimeout.DgWF0Nme.js";import{n as ni,t as ri}from"./useResizeObserver.3kyCQ1g6.js";import{a as ii,i as ai,n as oi,o as si,r as ci,t as li}from"./index.esm.M9ThdiDn.js";import{t as ui}from"./Check.esm.Cipw9iKh.js";import{t as di}from"./ContentCopy.esm.B7i0-ihs.js";import{n as fi}from"./Toolbar.TCG1mQzn.js";import{t as pi}from"./useCopyToClipboard.C-ywP4Jl.js";import{t as mi}from"./useRequiredContext.DBsQavvD.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var hi=n((e=>{var t=h();e.createRoot=t.createRoot,e.hydrateRoot=t.hydrateRoot})),gi=n(((e,t)=>{var n=typeof Element<`u`,r=typeof Map==`function`,i=typeof Set==`function`,a=typeof ArrayBuffer==`function`&&!!ArrayBuffer.isView;function o(e,t){if(e===t)return!0;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(e.constructor!==t.constructor)return!1;var s,c,l;if(Array.isArray(e)){if(s=e.length,s!=t.length)return!1;for(c=s;c--!==0;)if(!o(e[c],t[c]))return!1;return!0}var u;if(r&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(u=e.entries();!(c=u.next()).done;)if(!t.has(c.value[0]))return!1;for(u=e.entries();!(c=u.next()).done;)if(!o(c.value[1],t.get(c.value[0])))return!1;return!0}if(i&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(u=e.entries();!(c=u.next()).done;)if(!t.has(c.value[0]))return!1;return!0}if(a&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(s=e.length,s!=t.length)return!1;for(c=s;c--!==0;)if(e[c]!==t[c])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf==`function`&&typeof t.valueOf==`function`)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString==`function`&&typeof t.toString==`function`)return e.toString()===t.toString();if(l=Object.keys(e),s=l.length,s!==Object.keys(t).length)return!1;for(c=s;c--!==0;)if(!Object.prototype.hasOwnProperty.call(t,l[c]))return!1;if(n&&e instanceof Element)return!1;for(c=s;c--!==0;)if(!((l[c]===`_owner`||l[c]===`__v`||l[c]===`__o`)&&e.$$typeof)&&!o(e[l[c]],t[l[c]]))return!1;return!0}return e!==e&&t!==t}t.exports=function(e,t){try{return o(e,t)}catch(e){if((e.message||``).match(/stack|recursion/i))return console.warn(`react-fast-compare cannot handle circular refs`),!1;throw e}}})),_i=n(((e,t)=>{t.exports=function(e,t,n,r,i,a,o,s){if(!e){var c;if(t===void 0)c=Error(`Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.`);else{var l=[n,r,i,a,o,s],u=0;c=Error(t.replace(/%s/g,function(){return l[u++]})),c.name=`Invariant Violation`}throw c.framesToPop=1,c}}})),vi=n(((e,t)=>{t.exports=function(e,t,n,r){var i=n?n.call(r,e,t):void 0;if(i!==void 0)return!!i;if(e===t)return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var a=Object.keys(e),o=Object.keys(t);if(a.length!==o.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(t),c=0;c<a.length;c++){var l=a[c];if(!s(l))return!1;var u=e[l],d=t[l];if(i=n?n.call(r,u,d,l):void 0,i===!1||i===void 0&&u!==d)return!1}return!0}})),yi=e(m(),1),bi=hi(),U=e(r()),xi=e(gi()),Si=e(_i()),Ci=e(vi()),wi=(e=>(e.BASE=`base`,e.BODY=`body`,e.HEAD=`head`,e.HTML=`html`,e.LINK=`link`,e.META=`meta`,e.NOSCRIPT=`noscript`,e.SCRIPT=`script`,e.STYLE=`style`,e.TITLE=`title`,e.FRAGMENT=`Symbol(react.fragment)`,e))(wi||{}),Ti={link:{rel:[`amphtml`,`canonical`,`alternate`]},script:{type:[`application/ld+json`]}
2,meta:{charset:``,name:[`generator`,`robots`,`description`],property:[`og:type`,`og:title`,`og:url`,`og:image`,`og:image:alt`,`og:description`,`twitter:url`,`twitter:title`,`twitter:description`,`twitter:image`,`twitter:image:alt`,`twitter:card`,`twitter:site`]}},Ei=Object.values(wi),Di={accesskey:`accessKey`,charset:`charSet`,class:`className`,contenteditable:`contentEditable`,contextmenu:`contextMenu`,"http-equiv":`httpEquiv`,itemprop:`itemProp`,tabindex:`tabIndex`},Oi=Object.entries(Di).reduce((e,[t,n])=>(e[n]=t,e),{}),ki=`data-rh`,Ai={DEFAULT_TITLE:`defaultTitle`,DEFER:`defer`,ENCODE_SPECIAL_CHARACTERS:`encodeSpecialCharacters`,ON_CHANGE_CLIENT_STATE:`onChangeClientState`,TITLE_TEMPLATE:`titleTemplate`,PRIORITIZE_SEO_TAGS:`prioritizeSeoTags`},ji=(e,t)=>{for(let n=e.length-1;n>=0;--n){let r=e[n];if(Object.prototype.hasOwnProperty.call(r,t))return r[t]}return null},Mi=e=>{let t=ji(e,`title`),n=ji(e,Ai.TITLE_TEMPLATE);if(Array.isArray(t)&&(t=t.join(``)),n&&t)return n.replace(/%s/g,()=>t);let r=ji(e,Ai.DEFAULT_TITLE);return t||r||void 0},Ni=e=>ji(e,Ai.ON_CHANGE_CLIENT_STATE)||(()=>{}),Pi=(e,t)=>t.filter(t=>t[e]!==void 0).map(t=>t[e]).reduce((e,t)=>({...e,...t}),{}),Fi=(e,t)=>t.filter(e=>e.base!==void 0).map(e=>e.base).reverse().reduce((t,n)=>{if(!t.length){let r=Object.keys(n);for(let i=0;i<r.length;i+=1){let a=r[i].toLowerCase();if(e.indexOf(a)!==-1&&n[a])return t.concat(n)}}return t},[]),Ii=e=>console&&typeof console.warn==`function`&&console.warn(e),Li=(e,t,n)=>{let r={};return n.filter(t=>Array.isArray(t[e])?!0:(t[e]!==void 0&&Ii(`Helmet: ${e} should be of type "Array". Instead found type "${typeof t[e]}"`),!1)).map(t=>t[e]).reverse().reduce((e,n)=>{let i={};n.filter(e=>{let n,a=Object.keys(e);for(let r=0;r<a.length;r+=1){let i=a[r],o=i.toLowerCase();t.indexOf(o)!==-1&&(n!==`rel`||e[n].toLowerCase()!==`canonical`)&&(o!==`rel`||e[o].toLowerCase()!==`stylesheet`)&&(n=o),t.indexOf(i)!==-1&&(i===`innerHTML`||i===`cssText`||i===`itemprop`)&&(n=i)}if(!n||!e[n])return!1;let o=e[n].toLowerCase();return r[n]||(r[n]={}),i[n]||(i[n]={}),!r[n][o]&&(i[n][o]=!0,!0)}).reverse().forEach(t=>e.push(t));let a=Object.keys(i);for(let e=0;e<a.length;e+=1){let t=a[e],n={...r[t],...i[t]};r[t]=n}return e},[]).reverse()},Ri=(e,t)=>{if(Array.isArray(e)&&e.length){for(let n=0;n<e.length;n+=1)if(e[n][t])return!0}return!1},zi=e=>({baseTag:Fi([`href`],e),bodyAttributes:Pi(`bodyAttributes`,e),defer:ji(e,Ai.DEFER),encode:ji(e,Ai.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:Pi(`htmlAttributes`,e),linkTags:Li(`link`,[`rel`,`href`],e),metaTags:Li(`meta`,[`name`,`charset`,`http-equiv`,`property`,`itemprop`],e),noscriptTags:Li(`noscript`,[`innerHTML`],e),onChangeClientState:Ni(e),scriptTags:Li(`script`,[`src`,`innerHTML`],e),styleTags:Li(`style`,[`cssText`],e),title:Mi(e),titleAttributes:Pi(`titleAttributes`,e),prioritizeSeoTags:Ri(e,Ai.PRIORITIZE_SEO_TAGS)}),Bi=e=>Array.isArray(e)?e.join(``):e,Vi=(e,t)=>{let n=Object.keys(e);for(let r=0;r<n.length;r+=1)if(t[n[r]]&&t[n[r]].includes(e[n[r]]))return!0;return!1},Hi=(e,t)=>Array.isArray(e)?e.reduce((e,n)=>(Vi(n,t)?e.priority.push(n):e.default.push(n),e),{priority:[],default:[]}):{default:e,priority:[]},Ui=(e,t)=>({...e,[t]:void 0}),Wi=[`noscript`,`script`,`style`],Gi=(e,t=!0)=>t===!1?String(e):String(e).replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#x27;`),Ki=e=>Object.keys(e).reduce((t,n)=>{let r=e[n]===void 0?`${n}`:`${n}="${e[n]}"`;return t?`${t} ${r}`:r},``),qi=(e,t,n,r)=>{let i=Ki(n),a=Bi(t);return i?`<${e} ${ki}="true" ${i}>${Gi(a,r)}</${e}>`:`<${e} ${ki}="true">${Gi(a,r)}</${e}>`},Ji=(e,t,n=!0)=>t.reduce((t,r)=>{let i=r,a=Object.keys(i).filter(e=>e!==`innerHTML`&&e!==`cssText`).reduce((e,t)=>{let r=i[t]===void 0?t:`${t}="${Gi(i[t],n)}"`;return e?`${e} ${r}`:r},``),o=i.innerHTML||i.cssText||``;return`${t}<${e} ${ki}="true" ${a}${Wi.indexOf(e)===-1?`/>`:`>${o}</${e}>`}`},``),Yi=(e,t={})=>Object.keys(e).reduce((t,n)=>{let r=Di[n];return t[r||n]=e[n],t},t),Xi=(e,t,n)=>{let r=Yi(n,{key:t,[ki]:!0});return[U.createElement(`title`,r,t)]},Zi=(e,t)=>t.map((t,n)=>{let r={key:n,[ki]:!0};
2return Object.keys(t).forEach(e=>{let n=Di[e]||e;if(n===`innerHTML`||n===`cssText`){let e=t.innerHTML||t.cssText;r.dangerouslySetInnerHTML={__html:e}}else r[n]=t[e]}),U.createElement(e,r)}),Qi=(e,t,n=!0)=>{switch(e){case`title`:return{toComponent:()=>Xi(e,t.title,t.titleAttributes),toString:()=>qi(e,t.title,t.titleAttributes,n)};case`bodyAttributes`:case`htmlAttributes`:return{toComponent:()=>Yi(t),toString:()=>Ki(t)};default:return{toComponent:()=>Zi(e,t),toString:()=>Ji(e,t,n)}}},$i=({metaTags:e,linkTags:t,scriptTags:n,encode:r})=>{let i=Hi(e,Ti.meta),a=Hi(t,Ti.link),o=Hi(n,Ti.script);return{priorityMethods:{toComponent:()=>[...Zi(`meta`,i.priority),...Zi(`link`,a.priority),...Zi(`script`,o.priority)],toString:()=>`${Qi(`meta`,i.priority,r)} ${Qi(`link`,a.priority,r)} ${Qi(`script`,o.priority,r)}`},metaTags:i.default,linkTags:a.default,scriptTags:o.default}},ea=e=>{let{baseTag:t,bodyAttributes:n,encode:r=!0,htmlAttributes:i,noscriptTags:a,styleTags:o,title:s=``,titleAttributes:c,prioritizeSeoTags:l}=e,{linkTags:u,metaTags:d,scriptTags:f}=e,p={toComponent:()=>[],toString:()=>``};return l&&({priorityMethods:p,linkTags:u,metaTags:d,scriptTags:f}=$i(e)),{priority:p,base:Qi(`base`,t,r),bodyAttributes:Qi(`bodyAttributes`,n,r),htmlAttributes:Qi(`htmlAttributes`,i,r),link:Qi(`link`,u,r),meta:Qi(`meta`,d,r),noscript:Qi(`noscript`,a,r),script:Qi(`script`,f,r),style:Qi(`style`,o,r),title:Qi(`title`,{title:s,titleAttributes:c},r)}},ta=[],na=!!(typeof window<`u`&&window.document&&window.document.createElement),ra=class{instances=[];canUseDOM=na;context;value={setHelmet:e=>{this.context.helmet=e},helmetInstances:{get:()=>this.canUseDOM?ta:this.instances,add:e=>{(this.canUseDOM?ta:this.instances).push(e)},remove:e=>{let t=(this.canUseDOM?ta:this.instances).indexOf(e);(this.canUseDOM?ta:this.instances).splice(t,1)}}};constructor(e,t){this.context=e,this.canUseDOM=t||!1,t||(e.helmet=ea({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:``,titleAttributes:{}}))}},ia=parseInt(`18.3.1`.split(`.`)[0],10)>=19,aa=U.createContext({}),oa=class e extends U.Component{static canUseDOM=na;helmetData;constructor(t){super(t),this.helmetData=ia?null:new ra(this.props.context||{},e.canUseDOM)}render(){return ia?U.createElement(U.Fragment,null,this.props.children):U.createElement(aa.Provider,{value:this.helmetData.value},this.props.children)}},sa=(e,t)=>{let n=document.head||document.querySelector(`head`),r=n.querySelectorAll(`${e}[${ki}]`),i=[].slice.call(r),a=[],o;return t&&t.length&&t.forEach(t=>{let n=document.createElement(e);for(let e in t)if(Object.prototype.hasOwnProperty.call(t,e)){if(e===`innerHTML`)n.innerHTML=t.innerHTML;else if(e===`cssText`){let e=t.cssText;n.appendChild(document.createTextNode(e))}else{let r=e,i=t[r]===void 0?``:t[r];n.setAttribute(e,i)}}n.setAttribute(ki,`true`),i.some((e,t)=>(o=t,n.isEqualNode(e)))?i.splice(o,1):a.push(n)}
2),i.forEach(e=>e.parentNode?.removeChild(e)),a.forEach(e=>n.appendChild(e)),{oldTags:i,newTags:a}},ca=(e,t)=>{let n=document.getElementsByTagName(e)[0];if(!n)return;let r=n.getAttribute(ki),i=r?r.split(`,`):[],a=[...i],o=Object.keys(t);for(let e of o){let r=t[e]||``;n.getAttribute(e)!==r&&n.setAttribute(e,r),i.indexOf(e)===-1&&i.push(e);let o=a.indexOf(e);o!==-1&&a.splice(o,1)}for(let e=a.length-1;e>=0;--e)n.removeAttribute(a[e]);i.length===a.length?n.removeAttribute(ki):n.getAttribute(ki)!==o.join(`,`)&&n.setAttribute(ki,o.join(`,`))},la=(e,t)=>{e!==void 0&&document.title!==e&&(document.title=Bi(e)),ca(`title`,t)},ua=(e,t)=>{let{baseTag:n,bodyAttributes:r,htmlAttributes:i,linkTags:a,metaTags:o,noscriptTags:s,onChangeClientState:c,scriptTags:l,styleTags:u,title:d,titleAttributes:f}=e;ca(`body`,r),ca(`html`,i),la(d,f);let p={baseTag:sa(`base`,n),linkTags:sa(`link`,a),metaTags:sa(`meta`,o),noscriptTags:sa(`noscript`,s),scriptTags:sa(`script`,l),styleTags:sa(`style`,u)},m={},h={};Object.keys(p).forEach(e=>{let{newTags:t,oldTags:n}=p[e];t.length&&(m[e]=t),n.length&&(h[e]=p[e].oldTags)}),t&&t(),c(e,m,h)},da=null,fa=e=>{da&&cancelAnimationFrame(da),e.defer?da=requestAnimationFrame(()=>{ua(e,()=>{da=null})}):(ua(e),da=null)},pa=class extends U.Component{rendered=!1;shouldComponentUpdate(e){return!(0,Ci.default)(e,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){let{helmetInstances:e}=this.props.context;e.remove(this),this.emitChange()}emitChange(){let{helmetInstances:e,setHelmet:t}=this.props.context,n=null,r=zi(e.get().map(e=>{let{context:t,...n}=e.props;return n}));oa.canUseDOM?fa(r):ea&&(n=ea(r)),t(n)}init(){if(this.rendered)return;this.rendered=!0;let{helmetInstances:e}=this.props.context;e.add(this),this.emitChange()}render(){return this.init(),null}},ma=[],ha=e=>{let t={};for(let n of Object.keys(e))t[Oi[n]||n]=e[n];return t},ga=e=>{let t={};for(let n of Object.keys(e)){let r=Di[n];t[r||n]=e[n]}return t},_a=(e,t)=>{if(!na)return;let n=document.getElementsByTagName(e)[0];if(!n)return;let r=`data-rh-managed`,i=n.getAttribute(r),a=i?i.split(`,`):[],o=Object.keys(t);for(let e of a)o.includes(e)||n.removeAttribute(e);for(let e of o){let r=t[e];r==null||r===!1?n.removeAttribute(e):r===!0?n.setAttribute(e,``):n.setAttribute(e,String(r))}o.length>0?n.setAttribute(r,o.join(`,`)):n.removeAttribute(r)},va=()=>{let e={},t={};for(let n of ma){let{htmlAttributes:r,bodyAttributes:i}=n.props;r&&Object.assign(e,ha(r)),i&&Object.assign(t,ha(i))}_a(`html`,e),_a(`body`,t)},ya=class extends U.Component{componentDidMount(){ma.push(this),va()}componentDidUpdate(){va()}componentWillUnmount(){let e=ma.indexOf(this);e!==-1&&ma.splice(e,1),va()}resolveTitle(){let{title:e,titleTemplate:t,defaultTitle:n}=this.props;return e&&t?t.replace(/%s/g,()=>Array.isArray(e)?e.join(``):e):e||n||void 0}renderTitle(){let e=this.resolveTitle();if(e===void 0)return null;let t=this.props.titleAttributes||{};return U.createElement(`title`,ga(t),e)}renderBase(){let{base:e}=this.props;return e?U.createElement(`base`,ga(e)):null}renderMeta(){let{meta:e}=this.props;return!e||!Array.isArray(e)?null:e.map((e,t)=>U.createElement(`meta`,{key:t,...ga(e)}))}renderLink(){let{link:e}=this.props;return!e||!Array.isArray(e)?null:e.map((e,t)=>U.createElement(`link`,{key:t,...ga(e)}))}renderScript(){let{script:e}=this.props;return!e||!Array.isArray(e)?null:e.map((e,t)=>{let{innerHTML:n,...r}=e,i=ga(r);return n&&(i.dangerouslySetInnerHTML={__html:n}),U.createElement(`script`,{key:t,...i})})}renderStyle(){let{style:e}=this.props;return!e||!Array.isArray(e)?null:e.map((e,t)=>{let{cssText:n,...r}=e,i=ga(r);return n&&(i.dangerouslySetInnerHTML={__html:n}),U.createElement(`style`,{key:t,...i})})}renderNoscript(){let{noscript:e}=this.props;return!e||!Array.isArray(e)?null:e.map((e,t)=>{let{innerHTML:n,...r}=e,i=ga(r);return n&&(i.dangerouslySetInnerHTML={__html:n}),U.createElement(`noscript`,{key:t,...i})})}render(){return U.createElement(U.Fragment,null,this.renderTitle(),this.renderBase(),this.renderMeta(),this.renderLink(),this.renderScript(),this.renderStyle(),this.renderNoscript())}},ba=class extends U.Component{static defaultProps={defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1};shouldComponentUpdate(e){return!(0,xi.default)(Ui(this.props,`helmetData`),Ui(e,`helmetData`))}mapNestedChildrenToProps(e,t){if(!t)return null;switch(e.type){case`script`:case`noscript`:return{innerHTML:t};case`style`:return{cssText:t};default:throw Error(`<${e.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`)}}flattenArrayTypeChildren(e,t,n,r){return{...t,[e.type]:[...t[e.type]||[],{...n,...this.mapNestedChildrenToProps(e,r)}]}}mapObjectTypeChildren(e,t,n,r){switch(e.type){case`title`:return{...t,[e.type]:r,titleAttributes:{...n}};case`body`:return{...t,bodyAttributes:{...n}};case`html`:return{...t,htmlAttributes:{...n}};default:return{...t,[e.type]:{...n}}}}mapArrayTypeChildrenToProps(e,t){let n={...t};return Object.keys(e).forEach(t=>{n={...n,[t]:e[t]}}),n}
2warnOnInvalidChildren(e,t){return(0,Si.default)(Ei.some(t=>e.type===t),typeof e.type==`function`?`You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information.`:`Only elements types ${Ei.join(`, `)} are allowed. Helmet does not support rendering <${e.type}> elements. Refer to our API for more information.`),(0,Si.default)(!t||typeof t==`string`||Array.isArray(t)&&!t.some(e=>typeof e!=`string`),`Helmet expects a string as a child of <${e.type}>. Did you forget to wrap your children in braces? ( <${e.type}>{\`\`}</${e.type}> ) Refer to our API for more information.`),!0}mapChildrenToProps(e,t){let n={};return U.Children.forEach(e,e=>{if(!e||!e.props)return;let{children:r,...i}=e.props,a=Object.keys(i).reduce((e,t)=>(e[Oi[t]||t]=i[t],e),{}),{type:o}=e;switch(typeof o==`symbol`?o=o.toString():this.warnOnInvalidChildren(e,r),o){case`Symbol(react.fragment)`:t=this.mapChildrenToProps(r,t);break;case`link`:case`meta`:case`noscript`:case`script`:case`style`:n=this.flattenArrayTypeChildren(e,n,a,r);break;default:t=this.mapObjectTypeChildren(e,t,a,r)}}),this.mapArrayTypeChildrenToProps(n,t)}render(){let{children:e,...t}=this.props,n={...t},{helmetData:r}=t;return e&&(n=this.mapChildrenToProps(e,n)),r&&!(r instanceof ra)&&(r=new ra(r.context,!0),delete n.helmetData),ia?U.createElement(ya,{...n}):r?U.createElement(pa,{...n,context:r.value}):U.createElement(aa.Consumer,null,e=>U.createElement(pa,{...n,context:e}))}},xa=({fontFaces:e})=>{let t=e.map(e=>{let{family:t,weight:n,weightRange:r,url:i,style:a,unicodeRange:o}=e,s=r||n;return`
3      @font-face {
4        font-family: ${t};
5        src: url(${i}) format("woff2");
6        font-display: swap;
7        ${a?`font-style: ${a};`:``}
8        ${s?`font-weight: ${s};`:``}
9        ${o?`unicode-range: ${o};`:``}
10      }
11    `});return s(v,{styles:[_(t)]})},Sa=({fontSources:e})=>s(ba,{children:Object.entries(e).map(([e,t])=>s(`link`,{id:e,rel:`stylesheet`,href:t},e))}),Ca=()=>window.location.hostname===`localhost`||window.location.hostname===`127.0.0.1`,wa=`NO_SCRIPT_RUN_ID`;function Ta(e,t,n,r){for(var i=-1,a=e==null?0:e.length;++i<a;){var o=e[i];t(r,o,n(o),e)}return r}function Ea(e,t,n,r){return Gt(e,function(e,i,a){t(r,e,n(e),a)}),r}function Da(e,t){return function(n,r){var i=_e(n)?Ta:Ea,a=t?t():{};return i(n,e,Wt(r,2),a)}}var Oa=Object.prototype.hasOwnProperty,ka=Da(function(e,t,n){Oa.call(e,n)?e[n].push(t):be(e,n,[t])});function Aa(e,t){return Ht(e,t)}function ja(e,t,n,r){if(!ye(e))return e;t=Se(t,e);for(var i=-1,a=t.length,o=a-1,s=e;s!=null&&++i<a;){var c=Ce(t[i]),l=n;if(c===`__proto__`||c===`constructor`||c===`prototype`)return e;if(i!=o){var u=s[c];l=r?r(u,c,s):void 0,l===void 0&&(l=ye(u)?u:ve(t[i+1])?[]:{})}xe(s,c,l),s=s[c]}return e}function Ma(e,t,n){for(var r=-1,i=t.length,a={};++r<i;){var o=t[r],s=we(e,o);n(s,o)&&ja(a,Se(o,e),s)}return a}function Na(e,t){return Ma(e,t,function(t,n){return Ut(e,n)})}var Pa=Te(function(e,t){return e==null?{}:Na(e,t)}),Fa=class e{constructor(e=``,t=!0){this.prefix=e,this.isLast=t}visitBlockNode(t){let n=this.isLast?`└── `:`├── `,r=this.prefix+(this.isLast?`    `:`│   `),i=`${this.prefix}${n}BlockNode [${t.children.length} children]`;return t.scriptRunId!==`NO_SCRIPT_RUN_ID`&&(i+=` (run: ${t.scriptRunId.slice(0,6)})`),i+=`
12`,t.children.forEach((n,a)=>{let o=a===t.children.length-1,s=new e(r,o);i+=n.accept(s)}),i}visitElementNode(e){let t=this.isLast?`└── `:`├── `,n=`${this.prefix}${t}ElementNode [${e.element.type}]`;if(e.element.type===`text`&&e.element.text?.body){let t=e.element.text.body.length>30?`${e.element.text.body.slice(0,30)}...`:e.element.text.body;n+=` "${t}"`}return e.scriptRunId!==`NO_SCRIPT_RUN_ID`&&(n+=` (run: ${e.scriptRunId.slice(0,6)})`),e.fragmentId&&(n+=` (fragment: ${e.fragmentId.slice(0,6)})`),n+=` (activeScriptHash: ${e.activeScriptHash.slice(0,6)})`,n+=`
13`,n}visitTransientNode(t){let n=this.isLast?`└── `:`├── `,r=this.prefix+(this.isLast?`    `:`│   `),i=`${this.prefix}${n}TransientNode [${t.transientNodes.length} transient]`;if(t.scriptRunId!==`NO_SCRIPT_RUN_ID`&&(i+=` (run: ${t.scriptRunId.slice(0,6)})`),i+=`
14`,t.anchor){i+=`${r}├── anchor:\n`;let n=new e(r+`│   `,!0);i+=t.anchor.accept(n)}return t.transientNodes.length>0&&(i+=`${r}
14└── transient nodes:\n`,t.transientNodes.forEach((n,a)=>{let o=a===t.transientNodes.length-1,s=o?`└── `:`├── `,c=r+`    `+(o?`    `:`│   `);i+=`${r}    ${s}:\n`;let l=new e(c,!0);i+=n.accept(l)})),i}static generateDebugString(t,n=``,r=!0){let i=new e(n,r);return t.accept(i)}},Ia=class e{constructor(e,t,n,r){this.scriptRunId=e,this.anchor=t,this.transientNodes=n??[],this.deltaMsgReceivedAt=r??Date.now(),this.fragmentId=void 0,this.activeScriptHash=void 0}updateTransientNodes(e){let t=[];return this.transientNodes.forEach(n=>{let r=e(n);r&&t.push(r)}),t}accept(e){return e.visitTransientNode(this)}debug(){return this.accept(new Fa)}replaceTransientNodeWithSelf(t){return!this.deltaMsgReceivedAt||!t.deltaMsgReceivedAt||this.deltaMsgReceivedAt>=t.deltaMsgReceivedAt?new e(this.scriptRunId,this.anchor??t.anchor,this.transientNodes,this.deltaMsgReceivedAt):t}},La=class e{constructor(e,t,n){this.currentScriptRunId=e,this.fragmentIdsThisRun=t??[],this.fragmentIdOfBlock=n}get isFragmentRun(){return this.fragmentIdsThisRun.length>0}visitBlockNode(t){let n=null;if(this.isFragmentRun){if(this.fragmentIdOfBlock&&t.scriptRunId!==this.currentScriptRunId)return;t.fragmentId&&this.fragmentIdsThisRun.includes(t.fragmentId)&&t.scriptRunId===this.currentScriptRunId&&(n=new e(this.currentScriptRunId,this.fragmentIdsThisRun,t.fragmentId))}else if(t.scriptRunId!==this.currentScriptRunId)return;let r=[],i=!1;return t.children.forEach(e=>{let t=e.accept(n??this);t!==e&&(i=!0),t!==void 0&&r.push(t)}),i?new Ra(t.activeScriptHash,r,t.deltaBlock,this.currentScriptRunId,t.fragmentId,t.deltaMsgReceivedAt):t}visitElementNode(e){return e.element.type===`toast`||this.isFragmentRun&&(!e.fragmentId||!this.fragmentIdOfBlock||e.scriptRunId===this.currentScriptRunId)||e.scriptRunId===this.currentScriptRunId?e:void 0}visitTransientNode(e){if(e.scriptRunId===this.currentScriptRunId&&e.transientNodes.length===0&&e.anchor)return e.anchor.accept(this);let t=e.anchor?.accept(this),n=e.updateTransientNodes(e=>e.accept(this));if(!(!t&&n.length===0))return n.length===0?t:new Ia(e.scriptRunId,t,n,e.deltaMsgReceivedAt)}},Ra=class{constructor(e,t,n,r,i,a){this.activeScriptHash=e,this.children=t??[],this.deltaBlock=n??new M({}),this.scriptRunId=r??`NO_SCRIPT_RUN_ID`,this.fragmentId=i,this.deltaMsgReceivedAt=a}get isEmpty(){return this.children.length===0}replaceTransientNodeWithSelf(e){if(e.scriptRunId!==this.scriptRunId||e.transientNodes.length===0)return this;let t=e.updateTransientNodes(e=>e.accept(new La(this.scriptRunId)));return t.length===0?this:new Ia(this.scriptRunId,this,t,e.deltaMsgReceivedAt)}accept(e){return e.visitBlockNode(this)}debug(){return this.accept(new Fa)}},za=class{constructor(e,t,n,r,i,a){this.element=e,this.metadata=t,this.scriptRunId=n,this.activeScriptHash=r,this.fragmentId=i,this.elementHash=a}accept(e){return e.visitElementNode(this)}debug(){return this.accept(new Fa)}replaceTransientNodeWithSelf(e){if(e.scriptRunId!==this.scriptRunId||e.transientNodes.length===0)return this;let t=e.updateTransientNodes(e=>e.accept(new La(this.scriptRunId)));return t.length===0?this:new Ia(this.scriptRunId,this,t,e.deltaMsgReceivedAt)}},Ba=class{constructor(e){this.fragmentIdsThisRun=e??[]}visitBlockNode(e){if(this.fragmentIdsThisRun.length>0&&e.fragmentId&&!this.fragmentIdsThisRun.includes(e.fragmentId))return e;let t=[],n=!1;return e.children.forEach(e=>{let r=e.accept(this);r!==e&&(n=!0),r!==void 0&&t.push(r)}),n?new Ra(e.activeScriptHash,t,e.deltaBlock,e.scriptRunId,e.fragmentId,e.deltaMsgReceivedAt):e}visitElementNode(e){return e}visitTransientNode(e){return e.anchor}},Va=class e{constructor(){this.elements=new Set,this.blockIds=new Set}visitElementNode(e){return this.elements.add(e.element),this.elements}visitBlockNode(e){e.deltaBlock?.id&&this.blockIds.add(e.deltaBlock.id);for(let t of e.children)t.accept(this);return this.elements}visitTransientNode(e){return e.transientNodes.forEach(e=>{e.accept(this)}),e.anchor?.accept(this),this.elements}static collectElements(t){let n=new e;return t.accept(n),n.elements}},Ha=class e{constructor(e){this.mainScriptHash=e}
14visitElementNode(e){if(e.activeScriptHash===this.mainScriptHash)return e}visitBlockNode(e){if(e.activeScriptHash!==this.mainScriptHash)return;let t=!1,n=[];for(let r of e.children){let e=r.accept(this);e!==r&&(t=!0),e!==void 0&&n.push(e)}return t?new Ra(e.activeScriptHash,n,e.deltaBlock,e.scriptRunId,e.fragmentId,e.deltaMsgReceivedAt):e}visitTransientNode(e){let t=e.anchor?.accept(this),n=e.updateTransientNodes(e=>e.accept(this));if(!(!t&&n.length===0))return n.length===0?t:new Ia(e.scriptRunId,t,n,e.deltaMsgReceivedAt)}static filterNode(t,n){let r=new e(n);return t.accept(r)}},Ua=class e{constructor(e){this.deltaPath=e}visitElementNode(e){}visitBlockNode(t){if(this.deltaPath.length===0)return;let[n,...r]=this.deltaPath;if(n<0||n>=t.children.length)return;if(r.length===0)return t.children[n];let i=new e(r);return t.children[n].accept(i)}visitTransientNode(e){return this.deltaPath.length===0?e.anchor:e.anchor?.accept(this)}static getNodeAtPath(t,n){let r=new e(n);return t.accept(r)}},Wa=class e{constructor(e,t,n){this.deltaPath=e,this.nodeToSet=t,this.scriptRunId=n}visitElementNode(e){if(this.deltaPath.length>0)throw Error(`'setIn' cannot be called on an ElementNode`);
14return this.nodeToSet instanceof Ia&&!this.nodeToSet.anchor?new Ia(this.nodeToSet.scriptRunId,e,this.nodeToSet.transientNodes,this.nodeToSet.deltaMsgReceivedAt):this.nodeToSet}visitTransientNode(e){if(this.deltaPath.length===0)return this.nodeToSet.replaceTransientNodeWithSelf(e);if(e.anchor){let t=e.anchor.accept(this);return new Ia(e.scriptRunId,t,e.transientNodes,e.deltaMsgReceivedAt)}throw Error(`TransientNode has no anchor to set node at`)}visitBlockNode(t){if(this.deltaPath.length===0)return this.nodeToSet instanceof Ia&&!this.nodeToSet.anchor?new Ia(this.nodeToSet.scriptRunId,t,this.nodeToSet.transientNodes,this.nodeToSet.deltaMsgReceivedAt):this.nodeToSet;let[n,...r]=this.deltaPath;if(n<0||n>t.children.length)throw Error(`Bad delta path index ${n} (should be between [0, ${t.children.length}])`);let i=[],a=new e(r,this.nodeToSet,this.scriptRunId);if(t.children[n]){let e=0;for(;e<t.children.length;){let r=t.children[e];if(e!==n){i.push(r),e++;continue}let o=r.accept(a);!(r instanceof Ia)&&o instanceof Ia&&o.anchor!==r?(i.push(o),i.push(r)):i.push(o),e++}}else{if(r.length>0)throw Error(`Cannot set a node at a delta path`);i=t.children.slice(),i[n]=this.nodeToSet}return new Ra(t.activeScriptHash,i,t.deltaBlock,this.scriptRunId,t.fragmentId,t.deltaMsgReceivedAt)}static setNodeAtPath(t,n,r,i){let a=new e(n,r,i);return t.accept(a)}};function Ga(e,t,n){return!!t&&n.type!==void 0&&e instanceof za&&e.elementHash===t&&e.element.type===n.type&&!n.hasOneShotEffect}var Ka=class e{static empty(t=``,n=!0,r,i){let a=[],o;switch(Ee()){case Ie.NONE:break;case Ie.V1:n&&(o=Je(`Please wait...`));break;default:o=ft()}o&&a.push(new za(o,le.create({}),wa,t));let s=new Ra(t,a,new M({allowEmpty:!0}),wa),c=r||new Ra(t,[],new M({allowEmpty:!0}),`NO_SCRIPT_RUN_ID`),l=new Ra(t,[],new M({allowEmpty:!0}),wa),u=new Ra(t,[],new M({allowEmpty:!0}),wa),d=i?{logo:i,activeScriptHash:t,scriptRunId:wa}:null;return new e(t,new Ra(t,[s,c,l,u]),d)}constructor(e,t,n=null){if(this.mainScriptHash=e,this.root=t,this.appLogo=n,this.root.children.length!==4||z(this.main)||z(this.sidebar)||z(this.event)||z(this.bottom))throw Error(`Invalid root node children! ${t.debug()}`)}get main(){let[e]=this.root.children;return e}get sidebar(){let[,e]=this.root.children;return e}get event(){let[,,e]=this.root.children;return e}get bottom(){let[,,,e]=this.root.children;return e}get logo(){return this.appLogo?.logo??null}appRootWithLogo(t,n){return new e(this.mainScriptHash,this.root,{logo:t,...n})}applyDelta(e,t,n,r){let{deltaPath:i,activeScriptHash:a}=n;switch(t.type){case`newElement`:{let o=t.newElement,s=Ua.getNodeAtPath(this.root,i),c=Ga(s,r,o);return this.addElement(i,e,c?s.element:o,n,a,t.fragmentId,r)}case`addBlock`:{let n=Date.now();return this.addBlock(i,t.addBlock,e,a,t.fragmentId,n)}case`newTransient`:{let r=t.newTransient;return this.addTransient(i,e,r,n,a,t.fragmentId)}default:throw Error(`Unrecognized deltaType: '${t.type}'`)}}ensureBlockNode(e,t=this.mainScriptHash){return e??new Ra(t)}filterMainScriptElements(t){let n=this.main.scriptRunId,r=new Ha(t),i=this.root.children.map(e=>this.ensureBlockNode(e.accept(r),t)),a=this.appLogo?.activeScriptHash===t?this.appLogo:null;return new e(t,new Ra(t,i,new M({allowEmpty:!0}),n),a)}clearStaleNodes(t,n){let r=new La(t,n),i=this.root.children.map(e=>this.ensureBlockNode(e.accept(r))),a=n&&n.length>0||this.appLogo?.scriptRunId===t?this.appLogo:null;return new e(this.mainScriptHash,new Ra(this.mainScriptHash,i,new M({allowEmpty:!0}),t),a)}clearTransientNodes(t){let n=new Ba(t),r=this.root.children.map(e=>this.ensureBlockNode(e.accept(n)));return new e(this.mainScriptHash,new Ra(this.mainScriptHash,r,new M({allowEmpty:!0}),this.main.scriptRunId),this.appLogo)}getElements(){return this.getActiveIds().elements}getActiveIds(){let e=new Va;return this.main.accept(e),this.sidebar.accept(e),this.event.accept(e),this.bottom.accept(e),{elements:e.elements,blockIds:e.blockIds}}addElement(t,n,r,i,a,o,s){let c=new za(r,i,n,a,o,s);return new e(this.mainScriptHash,Wa.setNodeAtPath(this.root,t,c,n),this.appLogo)}addBlock(t,n,r,i,a,o){let s=Ua.getNodeAtPath(this.root,t),c=s instanceof Ia?s.anchor??s:s,l=[];c instanceof Ra&&c.deltaBlock.type===n.type&&(n.dialog&&c.deltaBlock.dialog&&n.id!==c.deltaBlock.id||(l=c.children));let u=new Ra(i,l,n,r,a,o);return new e(this.mainScriptHash,Wa.setNodeAtPath(this.root,t,u,r),this.appLogo)}addTransient(t,n,r,i,a,o,s){let c=new Ia(n,void 0,r.elements.map(e=>new za(e,i,n,a,o)),s);return new e(this.mainScriptHash,Wa.setNodeAtPath(this.root,t,c,n),this.appLogo)}getChildName(e){switch(e){case this.main:return`main`;case this.sidebar:return`sidebar`;case this.event:return`event`;case this.bottom:return`bottom`;default:return`unknown`}}debug(){let e=`AppRoot
15`;
15return this.root.children.forEach((t,n)=>{let r=n===this.root.children.length-1,i=this.getChildName(t),a=r?`└── `:`├── `,o=r?`    `:`│   `;e+=`${a}${i}:\n`;let s=new Fa(o,!0);e+=t.accept(s)}),e}},qa=`data-step`,Ja=`--st-step-connector-bottom`,Ya=`& > [${qa}="true"]:has(+ [${qa}="true"])`,Xa=e=>{let t=e.type,n=t?e[t]:void 0;if(!n||typeof n!=`object`)return;let r=n,i={useContainerWidth:r.useContainerWidth,height:r.height,width:r.width,widthConfig:r.widthConfig};if(i.useContainerWidth!==void 0||i.height!==void 0||i.width!==void 0||i.widthConfig!==void 0)return i},Za=e=>typeof e==`number`&&e>=0&&!isNaN(e),Qa=e=>typeof e==`number`&&e>0&&!isNaN(e),$a=(e,t)=>{if(t?.useContainerWidth)return{type:`stretch`};let n=e.widthConfig?.useStretch||t?.widthConfig?.useStretch,r=e?.widthConfig?.useContent||t?.widthConfig?.useContent,i=e?.widthConfig?.pixelWidth||t?.widthConfig?.pixelWidth||e.widthConfig?.pixelWidth===0,a=e.widthConfig?.remWidth;return n?{type:`stretch`}:r?{type:`content`}:a&&Za(e.widthConfig?.remWidth)?{type:`rem`,rem:e.widthConfig.remWidth}:i&&Za(e.widthConfig?.pixelWidth)?{type:`pixel`,pixels:e.widthConfig.pixelWidth}:i&&Za(t?.widthConfig?.pixelWidth)?{type:`pixel`,pixels:t.widthConfig.pixelWidth}:Qa(t?.width)&&!e.widthConfig?{type:`pixel`,pixels:t.width}:{type:`auto`}},eo=(e,t)=>{let n=!!e.heightConfig?.useStretch,r=!!e.heightConfig?.useContent,i=!!e.heightConfig?.pixelHeight||e.heightConfig?.pixelHeight===0,a=e.height
15Config?.remHeight;return n?{type:`stretch`}:r?{type:`content`}:a&&Za(e.heightConfig?.remHeight)?{type:`rem`,rem:e.heightConfig.remHeight}:i&&Za(e.heightConfig?.pixelHeight)?{type:`pixel`,pixels:e.heightConfig.pixelHeight}:Qa(t?.height)&&!e.heightConfig?{type:`pixel`,pixels:t.height}:{type:`auto`}},to=(e,t,n,r)=>{if(n===Yt.HORIZONTAL)switch(e.type){case`pixel`:return`0 0 ${e.pixels}px`;case`rem`:return`0 0 ${e.rem}rem`;case`content`:return`0 0 fit-content`;case`stretch`:return`1 1 ${r??`fit-content`}`;case`auto`:return;default:I(e)}else if(n===Yt.VERTICAL)switch(t.type){case`pixel`:return`0 0 ${t.pixels}px`;case`rem`:return`0 0 ${t.rem}rem`;case`content`:case`stretch`:case`auto`:return;default:I(t)}},no=e=>e?.direction,ro=(e,t,n=32)=>t===void 0||e===void 0||e===`fit-content`?e:t<qe(e)&&t>n?`${t-n}px`:e,io=({element:e,subElement:t,styleOverrides:n,minStretchBehavior:r})=>{let i=(0,U.useContext)(Zt);return(0,U.useMemo)(()=>{if(!e)return{width:`auto`,height:`auto`,overflow:`visible`};let a=$a(e,t),o,s;switch(a.type){case`stretch`:o=`100%`;break;case`rem`:o=`${a.rem}rem`;break;case`pixel`:o=`${a.pixels}px`;break;case`content`:o=`fit-content`;break;case`auto`:o=`auto`;break;default:I(a)}let c=no(i);i?.isInContentWidthContainer&&a.type===`stretch`&&r!==void 0&&(s=ro(r,i?.parentWidth));let l=eo(e,t),u,d=`visible`;switch(l.type){case`stretch`:u=`100%`;break;case`content`:u=`auto`;break;case`rem`:u=`${l.rem}rem`;break;case`pixel`:u=`${l.pixels}px`,d=`auto`;break;case`auto`:u=`auto`;break;default:I(l)}let f=to(a,l,c,r),p=Jt(`textAlignmentConfig`in e?e.textAlignmentConfig:void 0);return{width:o,height:u,overflow:d,flex:f,minWidth:s,textAlign:p,...n}},[e,t,n,i,r])},W=function(e){return e.NOT_RUNNING=`notRunning`,e.RUNNING=`running`,e.RERUN_REQUESTED=`rerunRequested`,e.STOP_REQUESTED=`stopRequested`,e.COMPILATION_ERROR=`compilationError`,e}({}),ao=`<null>`,oo=(0,U.createContext)({scriptRunState:W.NOT_RUNNING,scriptRunId:ao,fragmentIdsThisRun:[],scriptRunFinishedSequence:0,scriptRunFinishedFragmentIds:[],stopScript:()=>{}});oo.displayName=`ScriptRunContext`;var so=d(`div`,{target:`exttvjz0`})(({theme:e,background:t})=>{let n=he(e);return{width:`100%`,display:`flex`,alignItems:`flex-start`,gap:e.spacing.sm,padding:e.spacing.lg,paddingRight:t?e.spacing.lg:0,borderRadius:e.radii.default,...t?{backgroundColor:fe(n?e.colors.gray20:e.colors.gray90,.5)}:{}}}),co=d(`div`,{target:`exttvjz1`})(({theme:e})=>({color:e.colors.bodyText,margin:`auto`,flexGrow:1,minWidth:0})),lo=d(`div`,{target:`exttvjz2`})(({theme:e})=>{let t=he(e);return{display:`flex`,border:`${e.sizes.borderWidth} solid ${t?e.colors.gray40:e.colors.gray85}`,backgroundColor:t?e.colors.white:e.colors.gray100,color:t?e.colors.gray90:e.colors.white,lineHeight:e.lineHeights.none,fontSize:e.fontSizes.md,flexShrink:0,width:e.sizes.chatAvatarSize,height:e.sizes.chatAvatarSize,borderRadius:e.radii.default,alignItems:`center`,justifyContent:`center`}}),uo=d(`div`,{target:`exttvjz3`})(({theme:e,background:t})=>{let n=he(e);return{display:`flex`,width:e.sizes.chatAvatarSize,height:e.sizes.chatAvatarSize,flexShrink:0,borderRadius:e.radii.default,alignItems:`center`,justifyContent:`center`,backgroundColor:t,color:n?e.colors.white:e.colors.gray100}}),fo=d(`img`,{target:`exttvjz4`})(({theme:e})=>({width:e.sizes.chatAvatarSize,height:e.sizes.chatAvatarSize,flexShrink:0,borderRadius:e.radii.default,objectFit:`cover`,display:`flex`}));function po(e){let{avatar:t,avatarType:n,name:r,endpoints:i}=e,a=on(),o=an(t);if(t)switch(n){case void 0:break;case M.ChatMessage.AvatarType.IMAGE:return s(fo,{src:i.buildMediaURL(t),alt:`${r} avatar`,crossOrigin:o});case M.ChatMessage.AvatarType.EMOJI:return s(lo,{children:t});case M.ChatMessage.AvatarType.ICON:if(t===`user`)return s(uo,{"data-testid":`stChatMessageAvatarUser`,background:a.colors.redColor,children:s(B,{size:`lg`,iconValue:`:material/face:`})});if(t===`assistant`)return s(uo,{"data-testid":`stChatMessageAvatarAssistant`,background:a.colors.orangeColor,children:s(B,{size:`lg`,iconValue:`:material/smart_toy:`})});if(t.startsWith(`:material`))return s(lo,{"data-testid":`stChatMessageAvatarCustom`,children:s(B,{size:`lg`,iconValue:t,color:a.colors.bodyText})})}return s(lo,{children:r?r.charAt(0).toUpperCase():`🧑‍💻`})}var mo=(0,U.memo)(({endpoints:e,element:t,children:n})=>{let{avatar:r,avatarType:i,name:o}=t;return a(so,{className:`stChatMessage`,"data-testid":`stChatMessage`,background:[`user`,`human`].includes(o.toLowerCase()),children:[s(po,{name:o,avatar:r,avatarType:i,endpoints:e}),s(co,{"data-testid":`stChatMessageContent`,"aria-label":`Chat message from ${o}`,children:n})]})}),ho=(0,U.createContext)({}),go=Sr(function(e,t){[e,t]=Un(e,t,ho);let n=e,{isPending:r}=n,{buttonProps:i,isPressed:a}=Dr(e,t);i=vo(i,r);let{focusProps:o,isFocused:s,isFocusVisible:c}=pr(e),{hoverProps:l,isHovered:u}=Kn({...e,isDisabled:e.isDisabled||r}
15),d={isHovered:u,isPressed:(n.isPressed||a)&&!r,isFocused:s,isFocusVisible:c,isDisabled:e.isDisabled||!1,isPending:r??!1},f=In({...e,values:d,defaultClassName:`react-aria-Button`}),p=On(i.id),m=On(),h=i[`aria-labelledby`];r&&(h?h=`${h} ${m}`:i[`aria-label`]&&(h=`${p} ${m}`));let g=(0,U.useRef)(r);(0,U.useEffect)(()=>{let e={"aria-labelledby":h||p};(!g.current&&s&&r||g.current&&s&&!r)&&vr(e,`assertive`),g.current=r},[r,s,h,p]);let _=qn(e,{global:!0});return delete _.onClick,U.createElement(Sn.button,{...Nn(_,f,i,o,l),type:i.type===`submit`&&r?`button`:i.type,id:p,ref:t,"aria-labelledby":h,slot:e.slot||void 0,"aria-disabled":r?`true`:i[`aria-disabled`],"data-disabled":e.isDisabled||void 0,"data-pressed":d.isPressed||void 0,"data-hovered":u||void 0,"data-focused":s||void 0,"data-pending":r||void 0,"data-focus-visible":c||void 0},U.createElement(Er.Provider,{value:{id:m}},f.children))}),_o=/Focus|Blur|Hover|Pointer(Enter|Leave|Over|Out)|Mouse(Enter|Leave|Over|Out)/;function vo(e,t){if(t){for(let t in e)t.startsWith(`on`)&&!_o.test(t)&&(e[t]=void 0);e.href=void 0,e.target=void 0}return e}var yo=(0,U.createContext)({}),bo=(0,U.forwardRef)(function(e,t){[e,t]=Un(e,t,yo);let{children:n,level:r=3,className:i,...a}=e,o=Sn[`h${r}`];return U.createElement(o,{...a,ref:t,className:i??`react-aria-Heading`},n)}),xo={border:0,clip:`rect(0 0 0 0)`,clipPath:`inset(50%)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:0,position:`absolute`,width:`1px`,whiteSpace:`nowrap`};function So(e={}){let{style:t,isFocusable:n}=e,[r,i]=(0,U.useState)(!1),{focusWithinProps:a}=Jn({isDisabled:!n,onFocusWithinChange:e=>i(e)}),o=(0,U.useMemo)(()=>r?t:t?{...xo,...t}:xo,[r]);return{visuallyHiddenProps:{...a,style:o}}}function Co(e){let{children:t,elementType:n=`div`,isFocusable:r,style:i,...a}=e,{visuallyHiddenProps:o}=So(e);return U.createElement(n,Nn(a,o),t)}var wo=class{constructor(e){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.iterable=e;let t=e=>{if(this.keyMap.set(e.key,e),e.childNodes&&e.type===`section`)for(let n of e.childNodes)t(n)};for(let n of e)t(n);let n=null,r=0,i=0;for(let[e,t]of this.keyMap)n?(n.nextKey=e,t.prevKey=n.key):(this.firstKey=e,t.prevKey=void 0),t.type===`item`&&(t.index=r++),(t.type===`section`||t.type===`item`)&&i++,n=t,n.nextKey=void 0;this._size=i,this.lastKey=n?.key??null}*[Symbol.iterator](){yield*this.iterable}get size(){return this._size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){let t=this.keyMap.get(e);return t?t.prevKey??null:null}getKeyAfter(e){let t=this.keyMap.get(e);return t?t.nextKey??null:null}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){return this.keyMap.get(e)??null}at(e){let t=[...this.getKeys()];return this.getItem(t[e])}getChildren(e){return this.keyMap.get(e)?.childNodes||[]}};function To(e){let{filter:t,layoutDelegate:n}=e,r=or(e),i=(0,U.useMemo)(()=>e.disabledKeys?new Set(e.disabledKeys):new Set,[e.disabledKeys]),a=(0,U.useCallback)(e=>t?new wo(t(e)):new wo(e),[t]),o=(0,U.useMemo)(()=>({suppressTextValueWarning:e.suppressTextValueWarning}),[e.suppressTextValueWarning]),s=sr(e,a,o),c=(0,U.useMemo)(()=>new rr(s,r,{layoutDelegate:n}),[s,r,n]);return Do(s,c),{collection:s,disabledKeys:i,selectionManager:c}}function Eo(e,t){let n=(0,U.useMemo)(()=>t?e.collection.filter(t):e.collection,[e.collection,t]),r=e.selectionManager.withCollection(n);return Do(n,r),{collection:n,selectionManager:r,disabledKeys:e.disabledKeys}}function Do(e,t){let n=(0,U.useRef)(null);(0,U.useEffect)(()=>{if(t.focusedKey!=null&&!e.getItem(t.focusedKey)&&n.current){let r=n.current.getKeyAfter(t.focusedKey),i=null;for(;r!=null;){let a=e.getItem(r);if(a&&a.type===`item`&&!t.isDisabled(r)){i=r;break}r=n.current.getKeyAfter(r)}if(i==null)for(r=n.current.getKeyBefore(t.focusedKey);r!=null;){let a=e.getItem(r);if(a&&a.type===`item`&&!t.isDisabled(r)){i=r;break}r=n.current.getKeyBefore(r)}t.setFocusedKey(i)}n.current=e},[e,t])}var Oo=typeof HTMLElement<`u`&&`inert`in HTMLElement.prototype;function ko(e){return e.dataset.liveAnnouncer===`true`||e.dataset.reactAriaTopLayer!==void 0}var Ao=new WeakMap,jo=[];function Mo(e,t){let n=mn(e?.[0]),r=t instanceof n.Element?{root:t}:t,i=r?.root??document.body,a=r?.shouldUseInert&&Oo,o=new Set(e),s=new Set,c=e=>
vendor: 5,329 bytes, lines 15-19
15a&&e instanceof n.HTMLElement?e.inert:e.getAttribute(`aria-hidden`)===`true`,l=(e,t)=>{a&&e instanceof n.HTMLElement?e.inert=t:t?e.setAttribute(`aria-hidden`,`true`):(e.removeAttribute(`aria-hidden`),e instanceof n.HTMLElement&&(e.inert=!1))},u=new Set;if(fn()){let t=i.getRootNode();for(let n of e){let e=n.getRootNode();for(;yn(e)&&e!==t;)u.add(e),e=e.host.getRootNode()}}let d=e=>{for(let t of e.querySelectorAll(`[data-live-announcer], [data-react-aria-top-layer]`))o.add(t);let t=e=>{if(s.has(e)||o.has(e)||e.parentElement&&s.has(e.parentElement)&&e.parentElement.getAttribute(`role`)!==`row`)return NodeFilter.FILTER_REJECT;for(let t of o)if(_n(e,t))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},n=jr(xn(e),e,NodeFilter.SHOW_ELEMENT,{acceptNode:t}),r=t(e);if(r===NodeFilter.FILTER_ACCEPT&&f(e),r!==NodeFilter.FILTER_REJECT){let e=n.nextNode();for(;e!=null;)f(e),e=n.nextNode()}},f=e=>{let t=Ao.get(e)??0;c(e)&&t===0||(t===0&&l(e,!0),s.add(e),Ao.set(e,t+1))};jo.length&&jo[jo.length-1].disconnect(),d(i);let p=new MutationObserver(e=>{for(let t of e)if(t.type===`childList`){if(t.target.isConnected&&![...o,...s].some(e=>_n(e,t.target)))for(let e of t.addedNodes)(e instanceof HTMLElement||e instanceof SVGElement)&&ko(e)?o.add(e):e instanceof Element&&d(e);if(fn()){for(let e of u)if(!e.isConnected){p.disconnect();break}}}});p.observe(i,{childList:!0,subtree:!0});let m=new Set;if(fn())for(let e of u){let t=new MutationObserver(e=>{for(let t of e)if(t.type===`childList`){if(t.target.isConnected&&![...o,...s].some(e=>_n(e,t.target)))for(let e of t.addedNodes)(e instanceof HTMLElement||e instanceof SVGElement)&&ko(e)?o.add(e):e instanceof Element&&d(e);if(fn()){for(let e of u)if(!e.isConnected){p.disconnect();break}}}});t.observe(e,{childList:!0,subtree:!0}),m.add(t)}let h={visibleNodes:o,hiddenNodes:s,observe(){p.observe(i,{childList:!0,subtree:!0})},disconnect(){p.disconnect()}};return jo.push(h),()=>{if(p.disconnect(),fn())for(let e of m)e.disconnect();for(let e of s){let t=Ao.get(e);t!=null&&(t===1?(l(e,!1),Ao.delete(e)):Ao.set(e,t-1))}h===jo[jo.length-1]?(jo.pop(),jo.length&&jo[jo.length-1].observe()):jo.splice(jo.indexOf(h),1)}}function No(e){let t=jo[jo.length-1];if(t&&!t.visibleNodes.has(e))return t.visibleNodes.add(e),()=>{t.visibleNodes.delete(e)}}function Po(e){let{ref:t,onInteractOutside:n,isDisabled:r,onInteractOutsideStart:i}=e,a=(0,U.useRef)({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}),o=gn(e=>{n&&Fo(e,t)&&(i&&i(e),a.current.isPointerDown=!0)}),s=gn(e=>{n&&n(e)});(0,U.useEffect)(()=>{let e=a.current;if(r)return;let n=t.current,i=xn(n);if(typeof PointerEvent<`u`){let n=n=>{e.isPointerDown&&Fo(n,t)&&s(n),e.isPointerDown=!1};return i.addEventListener(`pointerdown`,o,!0),i.addEventListener(`click`,n,!0),()=>{i.removeEventListener(`pointerdown`,o,!0),i.removeEventListener(`click`,n,!0)}}},[t,r])}function Fo(e,t){if(e.button>0)return!1;let n=zn(e);if(n){let e=n.ownerDocument;if(!e||!_n(e.documentElement,n)||n.closest(`[data-react-aria-top-layer]`))return!1}return t.current?!e.composedPath().includes(t.current):!1}var Io=[];function Lo(e,t){let{onClose:n,shouldCloseOnBlur:r,isOpen:i,isDismissable:a=!1,isKeyboardDismissDisabled:o=!1,shouldCloseOnInteractOutside:s}=e,c=(0,U.useRef)(void 0);(0,U.useEffect)(()=>{if(i&&!Io.includes(t))return Io.push(t),()=>{let e=Io.indexOf(t);e>=0&&Io.splice(e,1)}},[i,t]);let l=()=>{Io[Io.length-1]===t&&n&&n()},u=e=>{let n=Io[Io.length-1];c.current=n,(!s||s(zn(e)))&&n===t&&e.stopPropagation()},d=e=>{(!s||s(zn(e)))&&(Io[Io.length-1]===t&&e.stopPropagation(),c.current===t&&l()),c.current=void 0},{keyboardProps:f}=dr({shortcuts:{Escape:()=>{if(!o){l();return}return!1}}});Po({ref:t,onInteractOutside:a&&i?d:void 0,onInteractOutsideStart:u});let{focusWithinProps:p}=Jn({isDisabled:!r,onBlurWithin:e=>{!e.relatedTarget||Pr(e.relatedTarget)||(!s||s(e.relatedTarget))&&n?.()}});return{overlayProps:{...f,...p},underlayProps:{}}}var Ro=typeof document<`u`&&window.visualViewport,zo=0,Bo;function Vo(e={}){let{isDisabled:t}=e;Pn(()=>{if(!t)return zo++,zo===1&&(Bo=pn()&&ln()?Uo():Ho()),()=>{zo--,zo===0&&Bo()}},[t])}function Ho(){let e=window.innerWidth-document.documentElement.clientWidth;return kn(e>0&&(`scrollbarGutter`in document.documentElement.style?bn(document.documentElement,`scrollbar-gutter`,`stable`):bn(document.documentElement,`padding-right`,`${e}px`)),bn(document.documentElement,`overflow`,`hidden`))}function Uo(){let e=bn(document.documentElement,`overflow`,`hidden`),t,n=!1,r=e=>{let r=zn(e);t=mr(r)?r:hr(r,!0),n=!1;let i=r.ownerDocument.defaultView.getSelection();i&&!i.isCollapsed&&i.containsNode(r,!0)&&(n=!0),e.composedPath().some(e=>e instanceof HTMLInputElement&&e.type===`range`)&&(n=!0),`selectionStart`in r&&`selectionEnd`in r&&r.selectionStart<r.selectionEnd&&r.ownerDocument.activeElement===r&&(n=!0)},i=document.createElement(`style`),a=Tr();a&&(i.nonce=a),i.textContent=`@layer {
16  * {
17    overscroll-behavior: contain;
18  }
19}`,document.head.prepend(i);let o=e=>{if(!(e.touches.length===2||n)){if(!t||t===document.documentElement||t===document.body){e.preventDefault();return}t.scrollHeight===t.clientHeight&&t.scrollWidth===t.clientWidth&&e.preventDefault()}},s=e=>{let t=zn(e),n=e.relatedTarget;n&&Yn(n)?(n.focus({preventScroll:!0}),Wo(n,Yn(t))):n||(t.parentElement?.closest(`[tabindex]`))?.focu
19s({preventScroll:!0})},c=HTMLElement.prototype.focus;Reflect.defineProperty(HTMLElement.prototype,"focus",{configurable:!0,writable:!0,value:function(e){let t=un(),n=t!=null&&Yn(t);c.call(this,{...e,preventScroll:!0}),(!e||!e.preventScroll)&&Wo(this,n)}});let l=kn(sn(document,`touchstart`,r,{passive:!1,capture:!0}),sn(document,`touchmove`,o,{passive:!1,capture:!0}),sn(document,`blur`,s,!0));return()=>{e(),l(),i.remove(),Reflect.defineProperty(HTMLElement.prototype,"focus",{configurable:!0,writable:!0,value:c})}}function Wo(e,t){t||!Ro?Go(e):Ro.addEventListener(`resize`,()=>Go(e),{once:!0})}function Go(e){let t=document.scrollingElement||document.documentElement,n=e;for(;n&&n!==t;){let e=hr(n);if(e!==document.documentElement&&e!==document.body&&e!==n){let t=e.getBoundingClientRect(),r=n.getBoundingClientRect();if(r.top<t.top||r.bottom>t.top+n.clientHeight){let n=t.bottom;Ro&&(n=Math.min(n,Ro.offsetTop+Ro.height));let i=r.top-t.top-((n-t.top)/2-r.height/2);e.scrollTo({top:Math.max(0,Math.min(e.scrollHeight-e.clientHeight,e.scrollTop+i)),behavior:`smooth`})}}n=e.parentElement}}var Ko={};Ko={dismiss:`تجاهل`};var qo={};qo={dismiss:`Отхвърляне`};var Jo={};Jo={dismiss:`Odstranit`};var Yo={};Yo={dismiss:`Luk`};var Xo={};Xo={dismiss:`Schließen`};var Zo={};Zo={dismiss:`Απόρριψη`};var Qo={};Qo={dismiss:`Dismiss`};var $o={};$o={dismiss:`Descartar`};var es={};es={dismiss:`Lõpeta`};var ts={};ts={dismiss:`Hylkää`};var ns={};ns={dismiss:`Rejeter`};var rs={};rs={dismiss:`התעלם`};var is={};is={dismiss:`Odbaci`};var as={};as={dismiss:`Elutasítás`};var os={};os={dismiss:`Ignora`};var ss={};ss={dismiss:`閉じる`};var cs={};cs={dismiss:`무시`};var ls={};ls={dismiss:`Atmesti`};var us={};us={dismiss:`Nerādīt`};var ds={};ds={dismiss:`Lukk`};var fs={};fs={dismiss:`Negeren`};var ps={};ps={dismiss:`Zignoruj`};var ms={};ms={dismiss:`Descartar`};var hs={};hs={dismiss:`Dispensar`};var gs={};gs={dismiss:`Revocare`};var _s={};_s={dismiss:`Пропустить`};var vs={};vs={dismiss:`Zrušiť`};var ys={};ys={dismiss:`Opusti`};var bs={};bs={dismiss:`Odbaci`};var xs={};xs={dismiss:`Avvisa`};var Ss={};Ss={dismiss:`Kapat`};var Cs={};Cs={dismiss:`Скасувати`};var ws={};ws={dismiss:`取消`};var Ts={};Ts={dismiss:`關閉`};var Es={};Es={"ar-AE":Ko,"bg-BG":qo,"cs-CZ":Jo,"da-DK":Yo,"de-DE":Xo,"el-GR":Zo,"en-US":Qo,"es-ES":$o,"et-EE":es,"fi-FI":ts,"fr-FR":ns,"he-IL":rs,"hr-HR":is,"hu-HU":as,"it-IT":os,"ja-JP":ss,"ko-KR":cs,"lt-LT":ls,"lv-LV":us,"nb-NO":ds,"nl-NL":fs,"pl-PL":ps,"pt-BR":ms,"pt-PT":hs,"ro-RO":gs,"ru-RU":_s,"sk-SK":vs,"sl-SI":ys,"sr-SP":bs,"sv-SE":xs,"tr-TR":Ss,"uk-UA":Cs,"zh-CN":ws,"zh-TW":Ts};function Ds(e){return e&&e.__esModule?e.default:e}function Os(e){let{onDismiss:t,...n}=e,r=_r(Ds(Es),`@react-aria/overlays`),i=gr(n,r.format(`dismiss`)),a=()=>{t&&t()};return U.createElement(Co,null,U.createElement(`button`,{...i,tabIndex:-1,onClick:a,style:{width:1,height:1}}))}function ks({children:e}){let t=(0,U.useMemo)(()=>({register:()=>{}}),[]);return U.createElement(wr.Provider,{value:t},e)}var As=e(h(),1),js=U.createContext(null);function Ms(e){let t=Rn(),{portalContainer:n=t?null:document.body,isExiting:r}=e,[i,a]=(0,U.useState)(!1),o=(0,U.useMemo)(()=>({contain:i,setContain:a}),[i,a]),{getContainer:s}=Tn();if(!e.portalContainer&&s&&(n=s()),!n)return null;let c=e.children;return e.disableFocusManagement||(c=U.createElement(Mr,{restoreFocus:!0,contain:(e.shouldContainFocus||i)&&!r},c)),c=U.createElement(js.Provider,{value:o},U.createElement(ks,null,U.createElement(yr.Provider,{value:null},c))),As.createPortal(c,n)}function Ns(){let e=(0,U.useContext)(js)?.setContain;Pn(()=>{e?.(!0)},[e])}function Ps(e,t){let{role:n=`dialog`}=e,r=En();r=e[`aria-label`]?void 0:r;let i=En();i=n===`alertdialog`&&!e[`aria-describedby`]?i:void 0;let a=(0,U.useRef)(!1);(0,U.useEffect)(()=>{if(t.current&&!vn(t.current)){lr(t.current);let e=setTimeout(()=>{(un()===t.current||un()===document.body)&&(a.current=!0,t.current&&(t.current.blur(),lr(t.current)),a.current=!1)},500);return()=>{clearTimeout(e)}}},[t]),Ns(),(0,U.useRef)(!1),(0,U.useEffect)(()=>{});let o=e[`aria-describedby`]??i;return{dialogProps:{...qn(e,{labelable:!0}),role:n,tabIndex:-1,"aria-labelledby":e[`aria-labelledby`]??r,"aria-describedby":o,onBlur:e=>{a.current&&e.stopPropagation()}},titleProps:{id:r},contentProps:{id:i}}}var Fs=(0,U.createContext)(null),Is=(0,U.createContext)(null),Ls=(0,U.forwardRef)(function(e,t){let n=e[`aria-labelledby`];[e,t]=Un(e,t,Fs);let{dialogProps:r,titleProps:i,contentProps:a}=Ps({...e,"aria-labelledby":n},t),o=(0,U.useContext)(Is);!r[`aria-label`]&&!r[`aria-labelledby`]&&e[`aria-labelledby`]&&(r[`aria-labelledby`]=e[`aria-labelledby`]);let s=In({defaultClassName:`react-aria-Dialog`,className:e.className,style:e.style,children:e.children,values:{close:o?.close||(()=>{})}}),c=qn(e,{global:!0});return U.createElement(Sn.section,{...Nn(c,s,r),render:e.render,ref:t,slot:e.slot||void 0},U.createElement(Dn,{values:[[yo,{slots:{[jn]:{},title:{...i,level:2}}}],[xr,{slots:{[jn]:{},description:a}}],[ho,{slots:{[jn]:{},close:{onPress:()=>o?.close()}}}]]},s.children))});function Rs(e,t){let n=t?.isDisabled,[r,i]=(0,U.useState)(!1);return Pn(()=>
19{if(e?.current&&!n){let t=()=>{if(e.current){let t=Nr(e.current,{tabbable:!0});i(!!t.nextNode())}};t();let n=new MutationObserver(t);return n.observe(e.current,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`tabIndex`,`disabled`]}),()=>{n.disconnect()}}}),!n&&r}function zs(e,t,n){let{overlayProps:r,underlayProps:i}=Lo({...e,isOpen:t.isOpen,onClose:t.close},n);return Vo({isDisabled:!t.isOpen}),Ns(),(0,U.useEffect)(()=>{if(t.isOpen&&n.current)return Mo([n.current],{shouldUseInert:!0})},[t.isOpen,n]),{modalProps:Nn(r),underlayProps:i}}var Bs=typeof document<`u`&&window.visualViewport;function Vs(){let e=Rn(),[t,n]=(0,U.useState)(()=>e?{width:0,height:0}:Hs());return(0,U.useEffect)(()=>{let e=e=>{n(t=>e.width===t.width&&e.height===t.height?t:e)},t=()=>{Bs&&Bs.scale>1||e(Hs())},r,i=t=>{Bs&&Bs.scale>1||Yn(zn(t))&&(r=requestAnimationFrame(()=>{let t=un();(!t||!Yn(t))&&e({width:document.documentElement.clientWidth,height:document.documentElement.clientHeight})}))};return e(Hs()),pn()&&ln()&&window.addEventListener(`blur`,i,!0),Bs?Bs.addEventListener(`resize`,t):window.addEventListener(`resize`,t),()=>{cancelAnimationFrame(r),pn()&&ln()&&window.removeEventListener(`blur`,i,!0),Bs?Bs.removeEventListener(`resize`,t):window.removeEventListener(`resize`,t)}},[]),t}function Hs(){return{width:Bs?Math.min(Bs.width*Bs.scale,document.documentElement.clientWidth):document.documentElement.clientWidth,height:Bs?Bs.height*Bs.scale:document.documentElement.clientHeight}}var Us=(0,U.createContext)(null),Ws=(0,U.createContext)(null),Gs=(0,U.forwardRef)(function(e,t){if((0,U.useContext)(Ws))return U.createElement(Ys,{...e,modalRef:t},e.children);let{isDismissable:n,isKeyboardDismissDisabled:r,isOpen:i,defaultOpen:a,onOpenChange:o,children:s,isEntering:c,isExiting:l,UNSTABLE_portalContainer:u,shouldCloseOnInteractOutside:d,...f}=e;return U.createElement(qs,{isDismissable:n,isKeyboardDismissDisabled:r,isOpen:i,defaultOpen:a,onOpenChange:o,isEntering:c,isExiting:l,UNSTABLE_portalContainer:u,shouldCloseOnInteractOutside:d},U.createElement(Ys,{...f,modalRef:t},s))});function Ks(e,t){[e,t]=Un(e,t,Us);let n=(0,U.useContext)(Is),r=Wn(e),i=e.isOpen!=null||e.defaultOpen!=null||!n?r:n,a=wn(t),o=(0,U.useRef)(null),s=Cn(a,i.isOpen),c=Cn(o,i.isOpen),l=s||c||e.isExiting||!1,u=Rn();return!i.isOpen&&!l||u?null:U.createElement(Js,{...e,state:i,isExiting:l,overlayRef:a,modalRef:o})}var qs=(0,U.forwardRef)(Ks);function Js({UNSTABLE_portalContainer:e,...t}){let n=t.modalRef,{state:r}=t,{modalProps:i,underlayProps:a}=zs(t,r,n),o=Mn(t.overlayRef)||t.isEntering||!1,s=In({...t,defaultClassName:`react-aria-ModalOverlay`,values:{isEntering:o,isExiting:t.isExiting,state:r}}),c=Vs(),l,u;if(typeof document<`u`){let e=mr(document.body)?document.body:document.scrollingElement||document.documentElement,t=e.getBoundingClientRect().width%1,n=e.getBoundingClientRect().height%1;l=e.scrollWidth-t,u=e.scrollHeight-n}let d={...s.style,"--visual-viewport-width":c.width+`px`,"--visual-viewport-height":c.height+`px`,"--page-width":l===void 0?void 0:l+`px`,"--page-height":u===void 0?void 0:u+`px`};return U.createElement(Ms,{isExiting:t.isExiting,portalContainer:e},U.createElement(Sn.div,{...Nn(qn(t,{global:!0}),a),...s,style:d,ref:t.overlayRef,"data-entering":o||void 0,"data-exiting":t.isExiting||void 0},U.createElement(Dn,{values:[[Ws,{modalProps:i,modalRef:n,isExiting:t.isExiting,isDismissable:t.isDismissable}],[Is,r]]},s.children)))}function Ys(e){let{modalProps:t,modalRef:n,isExiting:r,isDismissable:i}=(0,U.useContext)(Ws),a=(0,U.useContext)(Is),o=(0,U.useMemo)(()=>Gn(e.modalRef,n),[e.modalRef,n]),s=wn(o),c=Mn(s),l=In({...e,defaultClassName:`react-aria-Modal`,values:{isEntering:c,isExiting:r,state:a}});return U.createElement(Sn.div,{...Nn(qn(e,{global:!0}),t),...l,ref:s,"data-entering":c||void 0,"data-exiting":r||void 0},i&&U.createElement(Os,{onDismiss:a.close}),l.children)}var Xs=new WeakMap;function Zs(e,t,n){return e?(typeof t==`string`&&(t=t.replace(/\s+/g,``)),`${Xs.get(e)}-${n}-${t}`):``}function Qs(e,t,n){let{key:r,isDisabled:i,shouldSelectOnPressUp:a}=e,{selectionManager:o,selectedKey:s}=t,c=r===s,l=i||t.isDisabled||t.selectionManager.isDisabled(r),u=t.collection.getItem(r),{itemProps:d,isPressed:f}=ir({selectionManager:o,key:r,ref:n,isDisabled:l,shouldSelectOnPressUp:a??u?.props.href!=null,linkBehavior:`selection`}),p=Zs(t,r,`tab`),m=Zs(t,r,`tabpanel`),{tabIndex:h}=d,g=qn(u?.props,{labelable:!0});delete g.id;let _=ur(u?.props),{focusableProps:v}=br({...u?.props,isDisabled:l},n);return{tabProps:Nn(g,v,_,d,{id:p,"aria-selected":c,"aria-disabled":l||void 0,"aria-controls":c?m:void 0,tabIndex:l?void 0:h,role:`tab`}),isSelected:c,isDisabled:l,isPressed:f}}function $s(e,t,n){let r=Rs(n)?void 0:0,i=Zs(t,e.id??t?.selectedKey,`tabpanel`),a=gr({...e,id:i,"aria-labelledby":Zs(t,t?.selectedKey,`tab`)});return{tabPanelProps:Nn(a,{tabIndex:r,role:`tabpanel`,"aria-describedby":e[`aria-describedby`],"aria-details":e[`aria-details`]})}}var ec=class{constructor(e,t,n,r=new Set){this.collection=e,this.flipDirection=t===`rtl`,this.disabledKeys=r,this.tabDirection=n===`horizontal`}getKeyLeftOf(e){return this.flipDirection?this.getNextKey(e):this.getPreviousKey(e)}getKeyRightOf(e){return this.flipDirection?this.getPreviousKey(e):this.getNextKey(e)}isDisabled(e){return this.disabledKeys.has(e)||!!this.collection.getItem(e)?.props?.isDisabled}getFirstKey(){let e=this.collection.getFirstKey();return e!=null&&this.isDisabled(e)&&(e=this.getNextKey(e)),e}getLastKey(){let e=this.collection.getLastKey();return e!=null&&this.isDisabled(e)&&(e=this.getPreviousKey(e)),e}
19getKeyAbove(e){return this.tabDirection?null:this.getPreviousKey(e)}getKeyBelow(e){return this.tabDirection?null:this.getNextKey(e)}getNextKey(e){let t=e;do t=this.collection.getKeyAfter(t),t??=this.collection.getFirstKey();while(t!=null&&this.isDisabled(t)&&t!==e);return t}getPreviousKey(e){let t=e;do t=this.collection.getKeyBefore(t),t??=this.collection.getLastKey();while(t!=null&&this.isDisabled(t)&&t!==e);return t}};function tc(e,t,n){let{orientation:r=`horizontal`,keyboardActivation:i=`automatic`}=e,{collection:a,selectionManager:o,disabledKeys:s}=t,{direction:c}=cn(),l=(0,U.useMemo)(()=>new ec(a,c,r,s),[a,s,r,c]),{collectionProps:u}=Qn({ref:n,selectionManager:o,keyboardDelegate:l,selectOnFocus:i===`automatic`,disallowEmptySelection:!0,scrollRef:n,linkBehavior:`selection`}),d=On();Xs.set(t,d);let f=gr({...e,id:d});return{tabListProps:{...Nn(u,f),role:`tablist`,"aria-orientation":r,tabIndex:void 0}}}function nc(e){let[t,n]=hn(e.selectedKey,e.defaultSelectedKey??null,e.onSelectionChange),r=(0,U.useMemo)(()=>t==null?[]:[t],[t]),{collection:i,disabledKeys:a,selectionManager:o}=To({...e,selectionMode:`single`,disallowEmptySelection:!0,allowDuplicateSelectionEvents:!0,selectedKeys:r,onSelectionChange:r=>{if(r===`all`)return;let i=r.values().next().value??null;i===t&&e.onSelectionChange&&e.onSelectionChange(i),n(i)}});return{collection:i,disabledKeys:a,selectionManager:o,selectedKey:t,setSelectedKey:n,selectedItem:t==null?null:i.getItem(t)}}function rc(e){let t=nc({...e,onSelectionChange:e.onSelectionChange?t=>{t!=null&&e.onSelectionChange?.(t)}:void 0,suppressTextValueWarning:!0,defaultSelectedKey:e.defaultSelectedKey??ic(e.collection,e.disabledKeys?new Set(e.disabledKeys):new Set)??void 0}),{selectionManager:n,collection:r,selectedKey:i}=t,a=(0,U.useRef)(i);return(0,U.useEffect)(()=>{let o=i;e.selectedKey==null&&(n.isEmpty||o==null||!r.getItem(o))&&(o=ic(r,t.disabledKeys),o!=null&&n.setSelectedKeys([o])),(o!=null&&n.focusedKey==null||!n.isFocused&&o!==a.current)&&n.setFocusedKey(o),a.current=o}),{...t,isDisabled:e.isDisabled||!1}}function ic(e,t){let n=null;if(e){for(n=e.getFirstKey();n!=null&&(t.has(n)||e.getItem(n)?.props?.isDisabled)&&n!==e.getLastKey();)n=e.getKeyAfter(n);n!=null&&(t.has(n)||e.getItem(n)?.props?.isDisabled)&&n===e.getLastKey()&&(n=e.getFirstKey())}return n}var ac=(0,U.createContext)(null),oc=(0,U.createContext)(null),sc=(0,U.forwardRef)(function(e,t){[e,t]=Un(e,t,ac);let{children:n,orientation:r=`horizontal`}=e;return n=(0,U.useMemo)(()=>typeof n==`function`?n({orientation:r,defaultChildren:null}):n,[n,r]),U.createElement(Xn,{content:n},n=>U.createElement(cc,{props:e,collection:n,tabsRef:t}))});function cc({props:e,tabsRef:t,collection:n}){let{orientation:r=`horizontal`}=e,i=rc({...e,collection:n,children:void 0}),{focusProps:a,isFocused:o,isFocusVisible:s}=pr({within:!0}),c=(0,U.useMemo)(()=>({orientation:r,isFocusWithin:o,isFocusVisible:s}),[r,o,s]),l=In({...e,defaultClassName:`react-aria-Tabs`,values:c}),u=qn(e,{global:!0});return U.createElement(Sn.div,{...Nn(u,l,a),ref:t,slot:e.slot||void 0,"data-focused":o||void 0,"data-orientation":r,"data-focus-visible":s||void 0,"data-disabled":i.isDisabled||void 0},U.createElement(Dn,{values:[[ac,e],[oc,i]]},l.children))}var lc=(0,U.forwardRef)(function(e,t){return(0,U.useContext)(oc)?U.createElement(uc,{props:e,forwardedRef:t}):U.createElement(cr,e)});function uc({props:e,forwardedRef:t}){let n=(0,U.useContext)(oc),{CollectionRoot:r}=(0,U.useContext)($n),{orientation:i=`horizontal`,keyboardActivation:a=`automatic`}=Vn(ac),o=wn(t),{tabListProps:s}=tc({...e,orientation:i,keyboardActivation:a},n,o),c=In({...e,children:null,defaultClassName:`react-aria-TabList`,values:{orientation:i,state:n}}),l=qn(e,{global:!0});return delete l.id,U.createElement(Sn.div,{...Nn(l,c,s),ref:o,"data-orientation":i||void 0},U.createElement(kr,null,U.createElement(r,{collection:n.collection,persistedKeys:ar(n.selectionManager.focusedKey)})))}var dc=class extends Zn{static{this.type=`item`}},fc=er(dc,(e,t,n)=>{let r=(0,U.useContext)(oc),i=wn(t),{tabProps:a,isSelected:o,isDisabled:s,isPressed:c}=Qs({key:n.key,...e},r,i),{focusProps:l,isFocused:u,isFocusVisible:d}=pr(),{hoverProps:f,isHovered:p}=Kn({isDisabled:s,onHoverStart:e.onHoverStart,onHoverEnd:e.onHoverEnd,onHoverChange:e.onHoverChange}),m=In({...e,id:void 0,children:n.rendered,defaultClassName:`react-aria-Tab`,values:{isSelected:o,isDisabled:s,isFocused:u,isFocusVisible:d,isPressed:c,isHovered:p}}),h=n.props.href?Sn.a:Sn.div,g=qn(e,{global:!0});return delete g.id,delete g.onClick,U.createElement(h,{...Nn(g,m,a,l,f),ref:i,"data-selected":o||void 0,"data-disabled":s||void 0,"data-focused":u||void 0,"data-focus-visible":d||void 0,"data-pressed":c||void 0,"data-hovered":p||void 0},U.createElement(Or.Provider,{value:{isSelected:o}},m.children))}),pc=Sr(function(e,t){let n=(0,U.useContext)(oc),r=wn(t),i=n.selectedKey===e.id,[a,o]=(0,U.useState)(n.selectedKey==null?null:i);a==null&&n.selectedKey!=null?o(i):!i&&a&&o(!1);let s=Cn(r,i);return!i&&!e.shouldForceMount&&!s?null:U.createElement(mc,{...e,tabPanelRef:r,isInitiallySelected:a||
19!1,isExiting:s})});function mc(e){let t=(0,U.useContext)(oc),{id:n,tabPanelRef:r,isInitiallySelected:i,isExiting:a,...o}=e,{tabPanelProps:s}=$s(e,t,r),{focusProps:c,isFocused:l,isFocusVisible:u}=pr(),d=t.selectedKey===e.id,f=Mn(r)&&!i,p=In({...e,defaultClassName:`react-aria-TabPanel`,values:{isFocused:l,isFocusVisible:u,isInert:tr(!d),isEntering:f,isExiting:a,state:t}}),m=qn(o,{global:!0});delete m.id;let h=d?Nn(m,s,c,p):Nn(m,p);return U.createElement(Sn.div,{...h,ref:r,"data-focused":l||void 0,"data-focus-visible":u||void 0,inert:tr(!d||e.inert),"data-inert":d?void 0:`true`,"data-entering":f||void 0,"data-exiting":a||void 0},U.createElement(Dn,{values:[[ac,null],[oc,null]]},U.createElement($n.Provider,{value:nr},p.children)))}var hc={};hc={close:`إغلاق`,notifications:(e,t)=>`${t.plural(e.count,{one:()=>`${t.number(e.count)} \u{625}\u{634}\u{639}\u{627}\u{631}`,other:()=>`${t.number(e.count)} \u{625}\u{634}\u{639}\u{627}\u{631}\u{627}\u{62A}`})}.`};var gc={};gc={close:`Затвори`,notifications:(e,t)=>`${t.plural(e.count,{one:()=>`${t.number(e.count)} \u{438}\u{437}\u{432}\u{435}\u{441}\u{442}\u{438}\u{435}`,other:()=>`${t.number(e.count)} \u{438}\u{437}\u{432}\u{435}\u{441}\u{442}\u{438}\u{44F}`})}.`};var _c={};_c={close:`Zavřít`,notifications:(e,t)=>`${t.plural(e.count,{one:()=>`${t.number(e.count)} ozn\xe1men\xed`,other:()=>`${t.number(e.count)} ozn\xe1men\xed`})}.`};var vc={};vc={close:`Luk`,notifications:(e,t)=>`${t.plural(e.count,{one:()=>`${t.number(e.count)} besked`,other:()=>`${t.number(e.count)} beskeder`})}.`};var yc={};yc={close:`Schließen`,notifications:(e,t)=>`${t.plural(e.count,{one:()=>`${t.number(e.count)} Benachrichtigung`,other:()=>`${t.number(e.count)} Benachrichtigungen`})}.`};var bc={};bc={close:`Κλείσιμο`,notifications:(e,t)=>`${t.plural(e.count,{one:()=>`${t.number(e.count)} \u{3B5}\u{3B9}\u{3B4}\u{3BF}\u{3C0}\u{3BF}\u{3AF}\u{3B7}\u{3C3}\u{3B7}`,other:()=>`${t.number(e.count)} \u{3B5}\u{3B9}\u{3B4}\u{3BF}\u{3C0}\u{3BF}\u{3B9}\u{3AE}\u{3C3}\u{3B5}\u{3B9}\u{3C2}`})}.`};var xc={};xc={close:`Close`,notifications:(e,t)=>`${t.plural(e.count,{one:()=>`${t.number(e.count)} notification`,other:()=>`${t.number(e.count)} notifications`})}.`};var Sc={};Sc={close:`Cerrar`,notifications:(e,t)=>`${t.plural(e.count,{one:()=>`${t.number(e.count)} notificaci\xf3n`,other:()=>`${t.number(e.count)} notificaciones`})}.`};var Cc={};Cc={close:`Sule`,notifications:(e,t)=>`${t.plural(e.count,{one:()=>`${t.number(e.count)} teatis`,other:()=>`${t.number(e.count)} teatist`})}.`};var wc={};wc={close:`Sulje`,notifications:(e,t)=>`${t.plural(e.count,{one:()=>`${t.number(e.count)} ilmoitus`,other:()=>`${t.number(e.count)} ilmoitusta`})}.`};var Tc={};Tc={close:`Fermer`,notifications:(e,t)=>`${t.plural(e.count,{one:()=>`${t.number(e.count)} notification`,other:()=>`${t.number(e.count)} notifications`})}.`};var Ec={};Ec={close:`סגור`,notifications:(e,t)=>`${t.plural(e.count,{one:()=>`${t.number(e.count)} \u{5D4}\u{5EA}\u{5E8}\u{5D0}\u{5D4}`,other:()=>`${t.number(e.count)} \u{5D4}\u{5EA}\u{5E8}\u{5D0}\u{5D5}\u{5EA}`})}.`};var Dc={};Dc={close:`Zatvori`,notifications:(e,t)=>`${t.plural(e.count,{one:()=>`${t.number(e.count)} obavijest`,other:()=>`${t.number(e.count)} obavijesti`})}.`};var Oc={};Oc={close:`Bezárás`,notifications:(e,t)=>`${t.plural(e.count,{one:()=>`${t.number(e.count)} \xe9rtes\xedt\xe9s`,other:()=>`${t.number(e.count)} \xe9rtes\xedt\xe9s`})}.`};var kc={};kc={close:`Chiudi`,notifications:(e,t)=>`${t.plural(e.count,{one:()=>`${t.number(e.count)} notifica`,other:()=>`${t.number(e.count)} notifiche`})}.`};var Ac={};Ac={close:`閉じる`,notifications:(e,t)=>`${t.plural(e.count,{one:()=>`${t.number(e.count)} \u{500B}\u{306E}\u{901A}\u{77E5}`,other:()=>`${t.number(e.count)} \u{500B}\u{306E}\u{901A}\u{77E5}`})}\u{3002}`};var jc={};jc={close:`닫기`,notifications:(e,t)=>`${t.plural(e.count,{one:()=>`${t.number(e.count)}\u{AC1C} \u{C54C}\u{B9BC}`,other:()=>`${t.number(e.count)}\u{AC1C} \u{C54C}\u{B9BC}`})}.`};var Mc={};Mc={close:`Uždaryti`,notifications:(e,t)=>`${t.plural(e.count,{one:()=>`${t.number(e.count)} prane\u{161}imas`,other:()=>`${t.number(e.count)} prane\u{161}imai`})}.`};var Nc={};Nc={close:`Aizvērt`,notifications:(e,t)=>`${t.plural(e.count,{one:()=>`${t.number(e.count)} pazi\u{146}ojums`,other:()=>`${t.number(e.count)} pazi\u{146}ojumi`})}.`};var Pc={};Pc={close:`Lukk`,notifications:(e,t)=>`${t.plural(e.count,{one:()=>`${t.number(e.count)} varsling`,other:()=>`${t.number(e.count)} varsler`})}.`};var Fc={};Fc={close:`Sluiten`,notifications:(e,t)=>`${t.plural(e.count,{one:()=>`${t.number(e.count)} melding`,other:()=>`${t.number(e.count)} meldingen`})}.`};var Ic={};Ic={close:`Zamknij`,notifications:(e,t)=>`${t.plural(e.count,{one:()=>`${t.number(e.count)} powiadomienie`,few:()=>`${t.number(e.count)} powiadomienia`,many:()=>`${t.number(e.count)} powiadomie\u{144}`,other:()=>`${t.number(e.count)} powiadomienia`})}.`};var Lc={};Lc={close:`Fechar`,notifications:(e,t)=>`${t.plural(e.count,{one:()=>`${t.number(e.count)} notifica\xe7\xe3o`,other:()=>`${t.number(e.count)} notifica\xe7\xf5es`})}.`};var Rc={};Rc={close:`Fechar`,notifications:(e,t)=>`${t.plural(e.count,{one:()=>`${t.number(e.count)} notifica\xe7\xe3o`,other:()=>`${t.number(e.count)} notifica\xe7\xf5es`})}.`};var zc={};zc={close:`Închideţi`,notifications:(e,t)=>`${t.plural(e.count,{one:()=>`${t.number(e.count)} notificare`,other:()=>`${t.number(e.count)} notific\u{103}ri`})}.`};var Bc={};Bc={close:`Закрыть`,notifications:(e,t)=>`${t.plural(e.count,{one:()=>`${t.number(e.count)} \u{443}\u{432}\u{435}\u{434}\u{43E}\u{43C}\u{43B}\u{435}\u{43D}\u{438}\u{435}`,other:()=>`${t.number(e.count)} \u{443}\u{432}\u{435}\u{434}\u{43E}\u{43C}\u{43B}\u{435}\u{43D}\u{438}\u{44F}`})}.`};var Vc={};Vc={close:`Zatvoriť`,notifications:(e,t)=>`${t.plural(e.count,{one:()=>`${t.number(e.count)} ozn\xe1menie`,few:()=>`${t.number(e.count)} ozn\xe1menia`,other:()=>`${t.number(e.count)} ozn\xe1men\xed`})}.`};var Hc={};Hc={close:`Zapri`,notifications:(e,t)=>`${t.plural(e.count,{one:()=>`${t.number(e.count)} obvestilo`,two:()=>`${t.number(e.count)} obvestili`,few:()=>`${t.number(e.count)} obvestila`,other:()=>`${t.number(e.count)} obvestil`})}.`};var Uc={};Uc={close:`Zatvori`,notifications:(e,t)=>`${t.plural(e.count,{one:()=>`${t.number(e.count)} obave\u{161}tenje`,other:()=>`${t.number(e.count)} obave\u{161}tenja`})}.`};var Wc={};Wc={close:`Stäng`,notifications:(e,t)=>`${t.plural(e.count,{one:()=>`${t.number(e.count)} meddelande`,other:()=>`${t.number(e.count)} meddelanden`})}.`};var Gc={};Gc={close:`Kapat`,notifications:(e,t)=>`${t.plural(e.count,{one:()=>`${t.number(e.count)} bildirim`,other:()=>`${t.number(e.count)} bildirim`})}.`};var Kc={};Kc={close:`Закрити`,notifications:(e,t)=>`${t.plural(e.count,{one:()=>`${t.number(e.count)} \u{441}\u{43F}\u{43E}\u{432}\u{456}\u{449}\u{435}\u{43D}\u{43D}\u{44F}`,other:()=>`${t.number(e.count)} \u{441}\u{43F}\u{43E}\u{432}\u{456}\u{449}\u{435}\u{43D}\u{43D}\u{44F}`})}.`};var qc={};qc={close:`关闭`,notifications:(e,t)=>`${t.plural(e.count,{one:()=>`${t.number(e.count)} \u{4E2A}\u{901A}\u{77E5}`,other:()=>`${t.number(e.count)} \u{4E2A}\u{901A}\u{77E5}`})}\u{3002}`};var Jc={};Jc={close:`關閉`,notifications:(e,t)=>`${t.plural(e.count,{one:()=>`${t.number(e.count)} \u{500B}\u{901A}\u{77E5}`,other:()=>`${t.number(e.count)} \u{500B}\u{901A}\u{77E5}`})}\u{3002}`};var Yc={};Yc={"ar-AE":hc,"bg-BG":gc,"cs-CZ":_c,"da-DK":vc,"de-DE":yc,"el-GR":bc,"en-US":xc,"es-ES":Sc,"et-EE":Cc,"fi-FI":wc,"fr-FR":Tc,"he-IL":Ec,"hr-HR":Dc,"hu-HU":Oc,"it-IT":kc,"ja-JP":Ac,"ko-KR":jc,"lt-LT":Mc,"lv-LV":Nc,"nb-NO":Pc,"nl-NL":Fc,"pl-PL":Ic,"pt-BR":Lc,"pt-PT":Rc,"ro-RO":zc,"ru-RU":Bc,"sk-SK":Vc,"sl-SI":Hc,"sr-SP":Uc,"sv-SE":Wc,"tr-TR":Gc,"uk-UA":Kc,"zh-CN":qc,"zh-TW":Jc};
19function Xc(e){return e&&e.__esModule?e.default:e}function Zc(e,t,n){let{key:r,timer:i,timeout:a}=e.toast;(0,U.useEffect)(()=>{if(i!=null&&a!=null)return i.reset(a),()=>{i.pause()}},[i,a]);let o=On(),s=En(),c=_r(Xc(Yc),`@react-aria/toast`),[l,u]=(0,U.useState)(!1);return Pn(()=>{u(!0)},[]),{toastProps:{...qn(e,{labelable:!0}),role:`alertdialog`,"aria-modal":`false`,"aria-labelledby":e[`aria-labelledby`]||o,"aria-describedby":e[`aria-describedby`]||s,tabIndex:0},contentProps:{role:`alert`,"aria-atomic":`true`,"aria-hidden":l?void 0:`true`},titleProps:{id:o},descriptionProps:{id:s},closeButtonProps:{"aria-label":c.format(`close`),onPress:()=>t.close(r)}}}var Qc=Cr(),$c=1,el=Symbol.for(`react-aria-landmark-manager`);function tl(e){return document.addEventListener(`react-aria-landmark-manager-change`,e),()=>document.removeEventListener(`react-aria-landmark-manager-change`,e)}function nl(){if(typeof document>`u`)return null;let e=document[el];return e&&e.version>=$c?e:(document[el]=new il,document.dispatchEvent(new CustomEvent(`react-aria-landmark-manager-change`)),document[el])}function rl(){return(0,Qc.useSyncExternalStore)(tl,nl,nl)}var il=class{constructor(){this.landmarks=[],this.isListening=!1,this.refCount=0,this.version=$c,this.f6Handler=this.f6Handler.bind(this),this.focusinHandler=this.focusinHandler.bind(this),this.focusoutHandler=this.focusoutHandler.bind(this)}setupIfNeeded(){this.isListening||=(document.addEventListener(`keydown`,this.f6Handler,{capture:!0}),document.addEventListener(`focusin`,this.focusinHandler,{capture:!0}),document.addEventListener(`focusout`,this.focusoutHandler,{capture:!0}),!0)}teardownIfNeeded(){!this.isListening||this.landmarks.length>0||this.refCount>0||(document.removeEventListener(`keydown`,this.f6Handler,{capture:!0}),document.removeEventListener(`focusin`,this.focusinHandler,{capture:!0}),document.removeEventListener(`focusout`,this.focusoutHandler,{capture:!0}),this.isListening=!1)}focusLandmark(e,t){this.landmarks.find(t=>t.ref.current===e)?.focus?.(t)}getLandmarksByRole(e){return new Set(this.landmarks.filter(t=>t.role===e))}getLandmarkByRole(e){return this.landmarks.find(t=>t.role===e)}addLandmark(e){if(this.setupIfNeeded(),this.landmarks.find(t=>t.ref===e.ref)||!e.ref.current)return;if(this.landmarks.filter(e=>e.role===`main`).length,this.landmarks.length===0){this.landmarks=[e],this.checkLabels(e.role);return}let t=0,n=this.landmarks.length-1;for(;t<=n;){let r=Math.floor((t+n)/2),i=e.ref.current.compareDocumentPosition(this.landmarks[r].ref.current);i&Node.DOCUMENT_POSITION_PRECEDING||i&Node.DOCUMENT_POSITION_CONTAINS?t=r+1:n=r-1}this.landmarks.splice(t,0,e),this.checkLabels(e.role)}updateLandmark(e){let t=this.landmarks.findIndex(t=>t.ref===e.ref);t>=0&&(this.landmarks[t]={...this.landmarks[t],...e},this.checkLabels(this.landmarks[t].role))}removeLandmark(e){this.landmarks=this.landmarks.filter(t=>t.ref!==e),this.teardownIfNeeded()}checkLabels(e){let t=this.getLandmarksByRole(e);t.size>1&&[...t].filter(e=>!e.label).length}closestLandmark(e){let t=new Map(this.landmarks.map(e=>[e.ref.current,e])),n=e;for(;n&&!t.has(n)&&n!==document.body&&n.parentElement;)n=n.parentElement;return t.get(n)}getNextLandmark(e,{backward:t}){let n=this.closestLandmark(e),r=t?this.landmarks.length-1:0;n&&(r=this.landmarks.indexOf(n)+(t?-1:1));let i=()=>{if(r<0){if(!e.dispatchEvent(new CustomEvent(`react-aria-landmark-navigation`,{detail:{direction:`backward`},bubbles:!0,cancelable:!0})))return!0;r=this.landmarks.length-1}else if(r>=this.landmarks.length){if(!e.dispatchEvent(new CustomEvent(`react-aria-landmark-navigation`,{detail:{direction:`forward`},bubbles:!0,cancelable:!0})))return!0;r=0}return r<0||r>=this.landmarks.length};if(i())return;let a=r;for(;this.landmarks[r].ref.current?.closest(`[aria-hidden=true]`);){if(r+=t?-1:1,i())return;if(r===a)break}return this.landmarks[r]}f6Handler(e){e.key===`F6`&&(e.altKey?this.focusMain():this.navigate(zn(e),e.shiftKey))&&(e.preventDefault(),e.stopPropagation())}focusMain(){let e=this.getLandmarkByRole(`main`);return e&&e.ref.current&&e.ref.current.isConnected?(this.focusLandmark(e.ref.current,`forward`),!0):!1}navigate(e,t){let n=this.getNextLandmark(e,{backward:t});if(!n)return!1;if(n.lastFocused){let e=n.lastFocused;if(_n(document.body,e))return e.focus(),!0}return n.ref.current&&n.ref.current.isConnected?(this.focusLandmark(n.ref.current,t?`backward`:`forward`),!0):!1}focusinHandler(e){let t=this.closestLandmark(zn(e));t&&t.ref.current!==zn(e)&&this.updateLandmark({ref:t.ref,lastFocused:zn(e)});let n=e.relatedTarget;if(n){let e=this.closestLandmark(n);e&&e.ref.current===n&&e.blur()}}focusoutHandler(e){let t=zn(e),n=e.relatedTarget;if(!n||n===document){let e=this.closestLandmark(t);e&&e.ref.current===t&&e.blur()}}createLandmarkController(){let e=this;return e.refCount++,e.setupIfNeeded(),{navigate(t,n){let r=n?.from||document.activeElement;return e.navigate(r,t===`backward`)},focusNext(t){let n=t?.from||document.activeElement;return e.navigate(n,!1)},focusPrevious(t){let n=t?.from||document.activeElement;return e.navigate(n,!0)},focusMain(){return e.focusMain()},dispose(){e&&=(e.refCount--,e.teardownIfNeeded(),null)}}}registerLandmark(e){return this.landmarks.find(t=>t.ref===e.ref)?this.updateLandmark(e):this.addLandmark(e),()=>this.removeLandmark(e.ref)}};function al(e,t){let{role:n,"aria-label":r,"aria-labelledby":i,focus:a}=e,o=rl(),s=r||i,[c,l]=(0,U.useState)(!1),u=(0,U.useCallback)(()=>{l(!0)},[l]),d=(0,U.useCallback)(()=>{l(!1)},[l]);return Pn(()=>
19{if(o)return o.registerLandmark({ref:t,label:s,role:n,focus:a||u,blur:d})},[o,s,t,n,a,u,d]),(0,U.useEffect)(()=>{c&&t.current?.focus()},[c,t]),{landmarkProps:{role:n,tabIndex:c?-1:void 0,"aria-label":r,"aria-labelledby":i}}}function ol(e){return e&&e.__esModule?e.default:e}function sl(e,t,n){let r=_r(ol(Yc),`@react-aria/toast`),{landmarkProps:i}=al({role:`region`,"aria-label":e[`aria-label`]||r.format(`notifications`,{count:t.visibleToasts.length})},n),a=(0,U.useRef)(!1),o=(0,U.useRef)(!1),s=(0,U.useCallback)(()=>{a.current||o.current?t.pauseAll():t.resumeAll()},[t]),{hoverProps:c}=Kn({onHoverStart:()=>{a.current=!0,s()},onHoverEnd:()=>{a.current=!1,s()}}),l=(0,U.useRef)([]),u=(0,U.useRef)(t.visibleToasts),d=(0,U.useRef)(null);Pn(()=>{if(d.current===-1||t.visibleToasts.length===0||!n.current){l.current=[],u.current=t.visibleToasts;return}if(l.current=[...n.current.querySelectorAll(`[role="alertdialog"]`)],u.current.length===t.visibleToasts.length&&t.visibleToasts.every((e,t)=>e.key===u.current[t].key)){u.current=t.visibleToasts;return}let e=u.current.map((e,n)=>({...e,i:n,isRemoved:!t.visibleToasts.some(t=>e.key===t.key)})),r=e.findIndex(e=>e.i===d.current&&e.isRemoved);if(r>-1){if(fr()===`pointer`&&f.current?.isConnected)dn(f.current);else{let t=0,n,i;for(;t<=r;)e[t].isRemoved||(i=Math.max(0,t-1)),t++;for(;t<e.length;){if(!e[t].isRemoved){n=t-1;break}t++}i===void 0&&n===void 0&&(i=0),i>=0&&i<l.current.length?dn(l.current[i]):n>=0&&n<l.current.length&&dn(l.current[n])}}u.current=t.visibleToasts},[t.visibleToasts,n]);let f=(0,U.useRef)(null),{focusWithinProps:p}=Jn({onFocusWithin:e=>{o.current=!0,f.current=e.relatedTarget,s()},onBlurWithin:()=>{o.current=!1,f.current=null,s()}});return(0,U.useEffect)(()=>{t.visibleToasts.length===0&&f.current?.isConnected&&(fr()===`pointer`?dn(f.current):f.current.focus(),f.current=null)},[n,t.visibleToasts.length]),(0,U.useEffect)(()=>()=>{f.current?.isConnected&&(fr()===`pointer`?dn(f.current):f.current.focus(),f.current=null)},[n]),{regionProps:Nn(i,c,p,{tabIndex:-1,"data-react-aria-top-layer":!0,onFocus:e=>{let t=zn(e).closest(`[role="alertdialog"]`);d.current=l.current.findIndex(e=>e===t)},onBlur:()=>{d.current=-1}})}}function cl(e){let t=(0,U.useCallback)(t=>e.subscribe(t),[e]),n=(0,U.useCallback)(()=>e.visibleToasts,[e]);return{visibleToasts:(0,Qc.useSyncExternalStore)(t,n,n),add:(t,n)=>e.add(t,n),close:t=>e.close(t),pauseAll:()=>e.pauseAll(),resumeAll:()=>e.resumeAll()}}var ll=class{constructor(e){this.queue=[],this.subscriptions=new Set,this.visibleToasts=[],this.maxVisibleToasts=e?.maxVisibleToasts??1/0,this.wrapUpdate=e?.wrapUpdate}runWithWrapUpdate(e,t){this.wrapUpdate?this.wrapUpdate(e,t):e()}subscribe(e){return this.subscriptions.add(e),()=>this.subscriptions.delete(e)}add(e,t={}){let n=`_`+Math.random().toString(36).slice(2),r={...t,content:e,key:n,timer:t.timeout?new ul(()=>this.close(n),t.timeout):void 0};return this.queue.unshift(r),this.updateVisibleToasts(`add`),n}close(e){let t=this.queue.findIndex(t=>t.key===e);t>=0&&(this.queue[t].onClose?.(),this.queue.splice(t,1)),this.updateVisibleToasts(`remove`)}updateVisibleToasts(e){this.visibleToasts=this.queue.slice(0,this.maxVisibleToasts),this.runWithWrapUpdate(()=>{for(let e of this.subscriptions)e()},e)}pauseAll(){for(let e of this.visibleToasts)e.timer&&e.timer.pause()}resumeAll(){for(let e of this.visibleToasts)e.timer&&e.timer.resume()}clear(){this.queue=[],this.updateVisibleToasts(`clear`)}},ul=class{constructor(e,t){this.startTime=null,this.remaining=t,this.callback=e}reset(e){this.remaining=e,this.resume()}pause(){this.timerId!=null&&(clearTimeout(this.timerId),this.timerId=null,this.remaining-=Date.now()-this.startTime)}resume(){this.remaining<=0||(this.startTime=Date.now(),this.timerId=setTimeout(()=>{this.timerId=null,this.remaining=0,this.callback()},this.remaining))}},dl=(0,U.createContext)(null),fl=(0,U.forwardRef)(function(e,t){let n=Rn(),r=cl(e.queue),i=wn(t),{regionProps:a}=sl(e,r,i),{focusProps:o,isFocused:s,isFocusVisible:c}=pr(),{hoverProps:l,isHovered:u}=Kn({}),d=In({...e,children:void 0,defaultClassName:`react-aria-ToastRegion`,values:{visibleToasts:r.visibleToasts,isHovered:u,isFocused:s,isFocusVisible:c}}),{direction:f}=cn(),p,{getContainer:m}=Tn();n||(p=document.body,m&&(p=m()));let h=qn(e,{global:!0}),g=U.createElement(dl.Provider,{value:r},U.createElement(Sn.div,{...Nn(h,d,a,o,l),dir:f,ref:i,"data-hovered":u||void 0,"data-focused":s||void 0,"data-focus-visible":c||void 0},typeof e.children==`function`?U.createElement(pl,{...e,render:void 0,className:void 0,style:{display:`contents`}},e.children):e.children));return r.visibleToasts.length>0&&p?(0,As.createPortal)(g,p):null}),pl=(0,U.forwardRef)(function(e,t){let n=(0,U.useContext)(dl),{hoverProps:r,isH
19overed:i}=Kn({}),a=In({...e,children:void 0,defaultClassName:`react-aria-ToastList`,values:{visibleToasts:n.visibleToasts,isFocused:!1,isFocusVisible:!1,isHovered:i}});return U.createElement(Sn.ol,{...r,...a,ref:t},n.visibleToasts.map(t=>U.createElement(`li`,{key:t.key,style:{display:`contents`}},e.children({toast:t}))))}),ml=(0,U.forwardRef)(function(e,t){let n=(0,U.useContext)(dl),r=wn(t),{toastProps:i,contentProps:a,titleProps:o,descriptionProps:s,closeButtonProps:c}=Zc(e,n,r),{focusProps:l,isFocused:u,isFocusVisible:d}=pr(),f=In({...e,defaultClassName:`react-aria-Toast`,values:{toast:e.toast,isFocused:u,isFocusVisible:d}}),p=qn(e,{global:!0});return U.createElement(Sn.div,{...Nn(p,f,i,l),ref:r,"data-focused":u||void 0,"data-focus-visible":d||void 0},U.createElement(Dn,{values:[[hl,a],[xr,{slots:{[jn]:{},title:o,description:s}}],[ho,{slots:{[jn]:{},close:c}}]]},f.children))}),hl=(0,U.createContext)({}),gl=d(qs,{target:`ee2kfji0`})(({theme:e})=>({position:`fixed`,inset:0,background:e.colors.darkenedBgMix25,display:`flex`,alignItems:`flex-start`,justifyContent:`center`,paddingTop:e.spacing.threeXL,paddingBottom:e.spacing.threeXL,zIndex:e.zIndices.modal,overflowY:`auto`})),_l=d(Gs,{target:`ee2kfji1`})(({theme:e,$dialogWidth:t})=>{let n=`calc(100% - ${e.spacing.lg} - ${e.spacing.lg})`;return{outline:`none`,background:e.colors.bgColor,borderRadius:e.radii.xxl,boxShadow:e.shadows.popover,margin:e.spacing.lg,minWidth:`min(${e.sizes.minPopupWidth}, ${n})`,maxWidth:n,overflow:`hidden`,display:`flex`,flexDirection:`column`,position:`relative`,...t!==void 0&&{width:t}}}),vl=d(Ls,{target:`ee2kfji2`})({outline:`none`,display:`flex`,flexDirection:`column`,overflow:`visible`}),yl=d(`button`,{target:`ee2kfji3`})(({theme:e})=>({position:`absolute`,top:`calc(${e.spacing.twoXL} + ${e.spacing.xs} - ${e.spacing.twoXS})`,right:e.spacing.twoXL,background:`transparent`,border:`none`,cursor:`pointer`,color:e.colors.bodyText,padding:e.spacing.twoXS,display:`flex`,alignItems:`center`,justifyContent:`center`,borderRadius:e.radii.sm,"&:hover":{color:e.colors.fadedText60},"&:focus-visible":{outline:`none`,boxShadow:e.shadows.focusRing}})),bl=d(bo,{target:`ee2kfji4`})(({theme:e})=>({padding:`${e.spacing.twoXL} ${e.spacing.twoXL} ${e.spacing.md}`,margin:0,fontFamily:e.genericFonts.bodyFont,fontSize:e.fontSizes.xl,fontWeight:e.fontWeights.bold,lineHeight:e.lineHeights.small,display:`flex`,alignItems:`center`,flexDirection:`row`,flexShrink:0})),xl=d(`div`,{target:`ee2kfji5`})(({theme:e})=>({padding:`${e.spacing.md} ${e.spacing.twoXL} ${e.spacing.twoXL}`,color:e.colors.bodyText,fontSize:e.fontSizes.md})),Sl=d(`div`,{target:`ee2kfji6`})(({theme:e})=>({padding:e.spacing.md,flexShrink:0,display:`flex`,justifyContent:`flex-end`,alignItems:`center`,flexWrap:`wrap`})),Cl=d(`span`,{target:`ee2kfji7`})(({theme:e})=>({marginRight:e.spacing.twoXS}));function wl({children:e}){return s(bl,{slot:`title`,children:e})}function Tl({children:e}){return s(xl,{children:e})}function El({children:e}){return s(Sl,{children:e})}var Dl=e=>s(Cl,{children:s(Vr,{...e})});function Ol(e){return e.closest(`[data-st-overlay-root="true"]`)===null}function kl(e,t,n,r){if(e===`large`&&r)return r;if(e===`medium`&&t&&n)return`calc(${t} + ${n})`;if(e!==`auto`)return`31.25rem`}function Al({isOpen:e,onClose:t,closeable:n=!0,size:r,width:i,children:o}){let{sizes:c,spacing:l}=on(),d=kl(r,c.contentMaxWidth,l.lg,c.dialogLargeWidth);return s(gl,{isOpen:e??!1,isDismissable:n,isKeyboardDismissDisabled:!n,shouldCloseOnInteractOutside:Ol,onOpenChange:e=>{e||t?.()},className:`stDialog`,"data-testid":`stDialog`,children:s(_l,{$dialogWidth:i??d,children:s(vl,{children:({close:e})=>a(u,{children:[n&&s(yl,{"aria-label":`Close`,type:`button`,onClick:e,children:s(`svg`,{"aria-hidden":`true`,height:`10`,viewBox:`0 0 10 10`,width:`10`,xmlns:`http://www.w3.org/2000/svg`,children:s(`path`,{d:`M9 1L5 5M1 9L5 5M5 5L1 1M5 5L9 9`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`2`})})}),o]})})})})}var jl=e(Ct());function Ml(){return Ml=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ml.apply(this,arguments)}function Nl(e,t){if(e==null)return{};var n=Pl(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Pl(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var Fl=(0,U.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=e.size,a=i===void 0?24:i,o=Nl(e,[`color`,`size`]);return U.createElement(`svg`,Ml({ref:t,xmlns:`http://www.w3.org/2000/svg`,
19width:a,height:a,viewBox:`0 0 24 24`,fill:`none`,stroke:r,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},o),U.createElement(`polyline`,{points:`20 6 9 17 4 12`}))});Fl.propTypes={color:jl.default.string,size:jl.default.oneOfType([jl.default.string,jl.default.number])},Fl.displayName=`Check`;function Il(){return Il=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Il.apply(this,arguments)}function Ll(e,t){if(e==null)return{};var n=Rl(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Rl(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var zl=(0,U.forwardRef)(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=e.size,a=i===void 0?24:i,o=Ll(e,[`color`,`size`]);return U.createElement(`svg`,Il({ref:t,xmlns:`http://www.w3.org/2000/svg`,width:a,height:a,viewBox:`0 0 24 24`,fill:`none`,stroke:r,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},o),U.createElement(`rect`,{x:`9`,y:`9`,width:`13`,height:`13`,rx:`2`,ry:`2`}),U.createElement(`path`,{d:`M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1`}))});zl.propTypes={color:jl.default.string,size:jl.default.oneOfType([jl.default.string,jl.default.number])},zl.displayName=`Copy`;var Bl=d(`span`,{target:`e1yteq8v0`})(({theme:e})=>({display:`flex`,alignItems:`center`,gap:e.spacing.sm,marginRight:e.spacing.threeXL})),Vl=d(`span`,{target:`e1yteq8v1`})(()=>({display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0}));function Hl(e){switch(e){case M.Dialog.DialogWidth.MEDIUM:return`medium`;case M.Dialog.DialogWidth.LARGE:return`large`;case M.Dialog.DialogWidth.SMALL:return`default`;default:return I(e),`default`}}var Ul=({element:e,deltaMsgReceivedAt:t,children:n,widgetMgr:r,fragmentId:i})=>{let{title:o,dismissible:c,width:l,isOpen:d,id:f,icon:p}=e,[m,h]=(0,U.useState)(!1);(0,U.useEffect)(()=>{R(d)&&h(d)},[d,t]);let g=(0,U.useCallback)(()=>{h(!1),f&&r&&r.setTriggerValue(f,{formId:``,fragmentId:i,fromUser:!0})},[f,r,i]),_=(0,U.useCallback)(t=>{if(m&&t.key.toLowerCase()===`r`&&!e.dismissible){let e=t.target;if(e&&(e.isContentEditable||e.tagName===`INPUT`||e.tagName===`TEXTAREA`||e.tagName===`SELECT`))return;t.preventDefault(),t.stopImmediatePropagation()}},[m,e.dismissible]);return(0,U.useEffect)(()=>{if(m&&!e.dismissible)return document.addEventListener(`keydown`,_,!0),()=>{document.removeEventListener(`keydown`,_,!0)}},[m,e.dismissible,_]),m?a(Al,{isOpen:!0,closeable:c,onClose:g,size:Hl(l),children:[s(wl,{children:a(Bl,{children:[p&&s(Vl,{"data-testid":`stDialogIcon`,children:s(B,{iconValue:p,size:`lg`})}),s(It,{source:o,allowHTML:!1,isLabel:!0,inheritFont:!0})]})}),s(Tl,{children:n})]}):s(u,{})};function Wl(e){return s(St.Provider,{value:!0,children:s(Ul,{...e})})}var Gl=(0,U.memo)(Wl),Kl=(e,t)=>e.length===t.length&&e.every((e,n)=>Object.is(e,t[n])),ql=(e,t,n=Kl)=>{let[r,i]=(0,U.useState)(t);n(r,t)||(i(t),e())},Jl=({widgetMgr:e,id:t,formId:n,key:r,defaultValue:i})=>{(0,U.useEffect)(()=>{let n=e.getElementState(t,r);z(n)&&R(i)&&e.setElementState(t,r,i)},[e,t,r,i]);let[a,o]=(0,U.useState)(e.getElementState(t,r)??i),s=(0,U.useCallback)(n=>{e.setElementState(t,r,n),o(n)},[e,t,r]),c=(0,U.useMemo)(()=>({formId:n||``}),[n]),l=(0,U.useCallback)(()=>s(i),[i,s]);return ei({element:c,widgetMgr:e,onFormCleared:l}),[a,s]},Yl=`1s ease-in 0.5s`,Xl={opacity:Oe.stale,transition:`opacity ${Yl}`},Zl={position:`absolute`,width:`1px`,height:`1px`,padding:0,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,border:0},{Type:Ql}=M.Expandable,$l=d(`span`,{target:`e1a0jn2t0`})(Zl),eu=d(`div`,{target:`e1a0jn2t1`})(({expanderType:e})=>({width:`100%`,...e===Ql.STEP&&{position:`relative`}})),tu=d(`details`,{target:`e1a0jn2t2`})(({isStale:e,hasBorder:t,theme:n})=>({marginBottom:0,marginTop:0,width:`100%`,...t?{borderStyle:`solid`,borderWidth:n.sizes.borderWidth,borderColor:n.colors.borderColor,borderRadius:n.radii.default,...e?{borderColor:n.colors.borderColorLight,transition:`border ${Yl}`}:{}}:{border:`none`,borderRadius:0}})),nu=d(`span`,{target:`e1a0jn2t3`})(({theme:e,expanderType:t})=>{let n=t===Ql.STEP;return{display:`flex`,alignItems:n?`flex-start`:`center`,flexGrow:1,minWidth:0,width:`100%`,maxWidth:`100%`,overflow:`hidden`,gap:n?e.spacing.md:e.spacing.sm}}),ru=d(`div`,{target:`e1a0jn2t4`})(({theme:e,expanderType:t})=>({display:`flex`,overflow:`hidden`,...t!==Ql.COMPACT&&{width:`100%`,flexGrow:1},...t===Ql.STEP&&{alignItems:`center`,minHeight:e.iconSizes.xl}})),iu=d(`div`,{target:`e1a0jn2t5`})(({theme:e})=>({display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0,width:e.iconSizes.xl,height:e.iconSizes.xl}));function au(e,t){switch(e){case`error`:return t.colors.redTextColor;case`muted`:return t.colors.fadedText60;default:return t.colors.bodyText}}var ou=d(`div`,{target:`e1a0jn2t6`})(({theme:e,tone:t})=>({display:`flex`,color:au(t,e)})),su=d(`div`,{target:`e1a0jn2t7`})(({theme:e})=>({display:`none`,color:e.colors.fadedText60})),cu=d(`div`,{target:`e1a0jn2t8`})(({theme:e})=>({position:`absolute`,top:e.iconSizes.xl,bottom:`var(${Ja}
19, 0)`,left:`calc((${e.iconSizes.xl} - ${e.sizes.borderWidth}) / 2)`,width:e.sizes.borderWidth,backgroundColor:e.colors.borderColor})),lu=d(`div`,{target:`e1a0jn2t9`})(({isStale:e})=>({display:`flex`,width:`100%`,minWidth:0,overflow:`hidden`,...e&&Xl}));function uu(e,t,n){switch(e){case Ql.STEP:return{paddingInline:0,paddingBlock:0,backgroundColor:`transparent`,borderRadius:t.radii.default,[`&:hover ${ou}, &:focus-visible ${ou}`]:{display:`none`},[`&:hover ${su}, &:focus-visible ${su}`]:{display:`flex`}};case Ql.COMPACT:return{paddingLeft:0,paddingRight:0,paddingTop:t.spacing.twoXS,paddingBottom:t.spacing.twoXS,backgroundColor:`transparent`,borderRadius:t.radii.default,opacity:t.opacities.secondary,transition:`opacity 150ms ease`,"&:hover, &:focus-visible":{opacity:1},"&:has(.stMarkdownShimmer)":{opacity:1}};default:return{paddingLeft:t.spacing.md,paddingRight:t.spacing.md,paddingTop:t.spacing.twoXS,paddingBottom:t.spacing.twoXS,minHeight:`calc(${t.sizes.minElementHeight} - 2 * ${t.sizes.borderWidth})`,backgroundColor:n?t.colors.bgMix:`transparent`,borderRadius:n?`${t.radii.default} ${t.radii.default} 0 0`:t.radii.default,transition:n?`border-radius 200ms cubic-bezier(0.23, 1, 0.32, 1), background-color 150ms ease`:`border-radius 200ms cubic-bezier(0.23, 1, 0.32, 1) 300ms, background-color 150ms ease`,"&:hover, &:focus-visible":{backgroundColor:t.colors.darkenedBgMix15},"&:active":{backgroundColor:t.colors.darkenedBgMix25}}}}var du=d(`summary`,{target:`e1a0jn2t10`})(({theme:e,isStale:t,expanded:n,expanderType:r})=>({position:`relative`,display:`flex`,width:`100%`,minWidth:0,overflow:`hidden`,"&:focus":{outline:`none`},"&:focus-visible":{boxShadow:e.shadows.focusRing},fontSize:`inherit`,alignItems:`center`,cursor:`pointer`,listStyleType:`none`,"&::-webkit-details-marker":{display:`none`},...uu(r,e,n),...t&&Xl})),fu=d(`div`,{target:`e1a0jn2t11`})(({theme:e,expanderType:t})=>{switch(t){case Ql.STEP:return{padding:0,paddingLeft:`calc(${e.iconSizes.xl} + ${e.spacing.md})`,paddingTop:e.spacing.sm,paddingBottom:e.spacing.sm,borderTop:`none`};case Ql.COMPACT:return{padding:0,paddingTop:e.spacing.sm,borderTop:`none`};default:return{padding:e.spacing.lg,borderTop:`${e.sizes.borderWidth} solid ${e.colors.borderColor}`}}}),pu=500,mu=`cubic-bezier(0.23, 1, 0.32, 1)`,hu=1e3;function gu(e,t,n,r={}){let{duration:i=pu,easing:a=mu,onFinish:o}=r,s=e.animate({height:[`${t}px`,`${n}px`]},{duration:i,easing:a}),c=setTimeout(()=>{s.playState!==`finished`&&s.playState!==`idle`&&s.finish()},i+hu);return{cancel:()=>s.cancel(),finished:new Promise(t=>{s.addEventListener(`finish`,()=>{clearTimeout(c),e.style.height=``,e.style.overflow=``,o?.(),t()}),s.addEventListener(`cancel`,()=>{clearTimeout(c),t()})})}}var _u=10,vu=5;function yu({backendExpanded:e,label:t,onToggle:n,hasBorder:r=!0}){let[i,a]=(0,U.useState)(e??!1),o=r?2:0,s=(0,U.useRef)(null),c=(0,U.useRef)(null),l=(0,U.useRef)(null),u=(0,U.useRef)(null),d=(0,U.useRef)(i),f=(0,U.useRef)(t),p=(0,U.useRef)(!1),[m,h]=(0,U.useState)(null),g=(0,U.useCallback)(e=>{s.current=e,e&&(e.open=d.current),h(e)},[]),_=(0,U.useCallback)(()=>{u.current?.cancel(),u.current=null;let e=s.current;e&&(e.style.height=``,e.style.overflow=``)},[]),v=(0,U.useCallback)(e=>{let t=s.current,n=c.current,r=l.current;if(!t||!n)return;let i=t.getBoundingClientRect().height,a=n.getBoundingClientRect().height;if(_(),t.style.height=`${i}px`,t.style.overflow=`hidden`,e){t.open=!0;let e=r?.getBoundingClientRect().height??0;if(e>0){let n=a+e+o;u.current=gu(t,i,n)}else t.style.height=``,t.style.overflow=``}else{let e=a+o;u.current=gu(t,i,e,{onFinish:()=>{s.current&&(s.current.open=!1)}})}},[_,o]),y=(0,U.useCallback)((e,t)=>{let n=s.current;n&&(_(),n.style.height=`${e}px`,n.style.overflow=`hidden`,u.current=gu(n,e,t))},[_]),{clear:b,restart:x}=ti(()=>{let e=l.current,t=s.current,n=c.current;if(!e||!t||!n||!t.open||!d.current)return;let r=e.getBoundingClientRect().height,i=n.getBoundingClientRect().height,a=t.getBoundingClientRect().height,u=i+r+o;Math.abs(a-u)>vu&&y(a,u)},_u,{autoStart:!1});return(0,U.useEffect)(()=>{let n=!p.current;p.current=!0;let r=t!==f.current;if(f.current=t,r){_();let t=e??!1;d.current=t,a(t),s.current&&(s.current.open=t);return}if(!z(e)){if(n){s.current&&(s.current.open=e);return}e!==d.current&&(d.current=e,a(e),v(e))}},[e,t,_,v]),(0,U.useEffect)(()=>{let e=l.current,t=m;if(!e||!t)return;let n=new ResizeObserver(()=>{t.open&&x()});return n.observe(e),()=>{n.disconnect(),b()}},[m,b,x]),(0,U.useEffect)(()=>()=>{_(),b()},[_,b]),{isOpen:i,detailsRef:g,summaryRef:c,contentRef:l,handleToggle:(0,U.useCallback)(e=>{e.preventDefault();let t=!d.current;d.current=t,a(t),v(t),n?.(t)},[n,v])}}var bu={":material/check:":`stExpanderIconCheck`,":material/error:":`stExpanderIconError`,spinner:`stExpanderIconSpinner`},{State:xu,Type:Su}
19=M.Expandable,Cu={[xu.RUNNING]:{iconValue:`spinner`,tone:`muted`,stateLabel:`running`},[xu.COMPLETE]:{iconValue:`:material/check_circle:`,tone:`muted`,stateLabel:`complete`},[xu.ERROR]:{iconValue:`:material/error:`,tone:`error`,stateLabel:`error`}},wu=`:material/circle:`;function Tu(e,t){return e||(t?{iconValue:t,tone:`default`}:{iconValue:wu,tone:`muted`})}var Eu=e=>{let{icon:t}=e;return t?s(B,{size:`base`,iconValue:t,testid:bu[t]||`stExpanderIcon`}):s(u,{})},Du=(0,U.memo)(({element:e,isStale:t,empty:n,widgetMgr:r,blockId:i,fragmentId:o,children:c})=>{let{label:l,icon:d,type:f,state:p}=e,[m,h]=(0,U.useState)(!1),g=e.id||void 0,_=!!(r&&g),v=!!i&&!_,[y,b]=Jl({widgetMgr:r,id:v?i??``:``,key:`expanded`,defaultValue:e.expanded??!1}),x=v?y:e.expanded;ql(()=>{!g||!R(e.expanded)||r.setBoolValue(g,e.expanded,{formId:void 0,fragmentId:o,fromUser:!1})},[g,e.expanded]);let S=(0,U.useCallback)(e=>{r&&g&&r.setBoolValue(g,e,{formId:void 0,fragmentId:o,fromUser:!0})},[r,g,o]),C=(0,U.useCallback)(e=>{b(e)},[b]),w=_?S:v?C:void 0,T=f===Su.COMPACT,E=f===Su.STEP,D=f===Su.DEFAULT,O=!E||!n,k=T&&d===`spinner`&&l.includes(`:shimmer[`),A=!T&&(!d||m),ee=T?!!d&&!k:d&&!m,{isOpen:j,detailsRef:M,summaryRef:N,contentRef:te,handleToggle:ne}=yu({backendExpanded:x,label:l,onToggle:w,hasBorder:D}),re=()=>{h(!0)},ie=()=>{h(!1)},ae=Cu[p],oe=Tu(ae,d),P=E?ae?.stateLabel:void 0,se=a(nu,{expanderType:f,children:[E?a(iu,{"aria-hidden":`true`,children:[s(ou,{tone:oe.tone,"data-testid":`stExpanderStepIcon`,children:s(B,{iconValue:oe.iconValue,size:`lg`})}),O&&s(su,{"data-testid":`stExpanderStepChevron`,children:s(B,{iconValue:j?`:material/keyboard_arrow_down:`:`:material/keyboard_arrow_right:`,size:`lg`})})]}):a(u,{children:[A&&s(B,{iconValue:j?`:material/keyboard_arrow_down:`:`:material/keyboard_arrow_right:`,size:`base`}),ee&&s(Eu,{icon:d})]}),s(ru,{expanderType:f,children:s(It,{source:l,allowHTML:!1,isLabel:!0})}),P&&s($l,{children:` — ${P}`}),T&&s(B,{iconValue:j?`:material/keyboard_arrow_down:`:`:material/chevron_right:`,size:`lg`})]});return O?a(eu,{className:`stExpander`,"data-testid":`stExpander`,expanderType:f,children:[E&&s(cu,{"data-testid":`stExpanderStepConnector`}),a(tu,{isStale:t,hasBorder:D,ref:M,onMouseEnter:E?void 0:re,onMouseLeave:E?void 0:ie,children:[s(du,{onClick:ne,ref:N,isStale:t,expanded:j,expanderType:f,"aria-expanded":E?j:void 0,children:se}),s(fu,{"data-testid":`stExpanderDetails`,ref:te,expanderType:f,inert:j?void 0:``,children:c})]})]}):s(eu,{className:`stExpander`,"data-testid":`stExpander`,expanderType:f,children:s(lu,{isStale:t,children:se})})}),Ou=`portal`,ku=`stFloatingOverlayPortal`;function Au({children:e,help:t,placement:n,containerWidth:r,constrainWidth:i}){return t?a(u,{children:[s(Ir,{children:s(Ot,{content:t,placement:n||Hn.TOP,containerWidth:r,constrainWidth:i,onMouseEnterDelay:500,children:e})}),s(Fr,{children:e})]}):e}var ju=typeof navigator<`u`&&navigator.userAgent.toLowerCase().indexOf(`firefox`)>0;function Mu(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r):e.attachEvent&&e.attachEvent(`on${t}`,n)}function Nu(e,t,n,r){e&&(e.removeEventListener?e.removeEventListener(t,n,r):e.detachEvent&&e.detachEvent(`on${t}`,n))}function Pu(e,t){let n=t.slice(0,t.length-1),r=[];for(let t=0;t<n.length;t++)r.push(e[n[t].toLowerCase()]);return r}function Fu(e){typeof e!=`string`&&(e=``),e=e.replace(/\s/g,``);let t=e.split(`,`),n=t.lastIndexOf(``);for(;n>=0;)t[n-1]+=`,`,t.splice(n,1),n=t.lastIndexOf(``);return t}function Iu(e,t){let n=e.length>=t.length?e:t,r=e.length>=t.length?t:e,i=!0;for(let e=0;e<n.length;e++)r.indexOf(n[e])===-1&&(i=!1);return i}function Lu(e,t,n){let r=e.keyCode||e.which||e.charCode;if(e.key){let r=e.key.toLowerCase();if(r in t)return t[r];if(r in n)return n[r];if(/^[a-z]$/i.test(e.key))return e.key.toUpperCase().charCodeAt(0)}return e.code&&/^Key[A-Z]$/.test(e.code)&&(r=e.code.charCodeAt(3)),r}var Ru={backspace:8,"⌫":8,tab:9,clear:12,enter:13,"↩":13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,arrowup:38,arrowdown:40,arrowleft:37,arrowright:39,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal
19:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":ju?173:189,"=":ju?61:187,";":ju?59:186,"'":222,"{":219,"}":221,"[":219,"]":221,"\\":220},zu={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,meta:91,command:91},Bu={16:`shiftKey`,18:`altKey`,17:`ctrlKey`,91:`metaKey`,shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},Vu={16:!1,18:!1,17:!1,91:!1},G={};for(let e=1;e<20;e++)Ru[`f${e}`]=111+e;var K=[],Hu=null,Uu=null,Wu=`all`,Gu=new Map,Ku=e=>Ru[e.toLowerCase()]||zu[e.toLowerCase()]||e.toUpperCase().charCodeAt(0),qu=e=>Object.keys(Ru).find(t=>Ru[t]===e),Ju=e=>Object.keys(zu).find(t=>zu[t]===e),Yu=e=>{Wu=e||`all`},Xu=()=>Wu||`all`,Zu=()=>K.slice(0),Qu=()=>K.map(e=>qu(e)||Ju(e)||String.fromCharCode(e)),$u=()=>{let e=[];return Object.keys(G).forEach(t=>{G[t].forEach(({key:t,scope:n,mods:r,shortcut:i})=>{e.push({scope:n,shortcut:i,mods:r,keys:t.split(`+`).map(e=>Ku(e))})})}),e},ed=e=>{let t=e.target||e.srcElement,{tagName:n}=t,r=!0,i=n===`INPUT`&&![`checkbox`,`radio`,`range`,`button`,`file`,`reset`,`submit`,`color`].includes(t.type);return(t.isContentEditable||(i||n===`TEXTAREA`||n===`SELECT`)&&!t.readOnly)&&(r=!1),r},td=e=>(typeof e==`string`&&(e=Ku(e)),K.indexOf(e)!==-1),nd=(e,t)=>{let n,r;e||=Xu();for(let t in G)if(Object.prototype.hasOwnProperty.call(G,t))for(n=G[t],r=0;r<n.length;)n[r].scope===e?n.splice(r,1).forEach(({element:e})=>ud(e)):r++;Xu()===e&&Yu(t||`all`)};function rd(e){let t=Lu(e,Ru,zu);e.key&&e.key.toLowerCase()===`capslock`&&(t=Ku(e.key));let n=K.indexOf(t);if(n>=0&&K.splice(n,1),e.key&&e.key.toLowerCase()===`meta`&&K.splice(0,K.length),(t===93||t===224)&&(t=91),t in Vu){Vu[t]=!1;for(let e in zu)zu[e]===t&&(cd[e]=!1)}}var id=(e,...t)=>{if(e===void 0)Object.keys(G).forEach(e=>{Array.isArray(G[e])&&G[e].forEach(e=>ad(e)),delete G[e]}),ud(null);else if(Array.isArray(e))e.forEach(e=>{e.key&&ad(e)});else if(typeof e==`object`)e.key&&ad(e);else if(typeof e==`string`){let[n,r]=t;typeof n==`function`&&(r=n,n=``),ad({key:e,scope:n,method:r,splitKey:`+`})}},ad=({key:e,scope:t,method:n,splitKey:r=`+`})=>{Fu(e).forEach(e=>{let i=e.split(r),a=i.length,o=i[a-1],s=o===`*`?`*`:Ku(o);if(!G[s])return;t||=Xu();let c=a>1?Pu(zu,i):[],l=[];G[s]=G[s].filter(e=>{let r=(!n||e.method===n)&&e.scope===t&&Iu(e.mods,c);return r&&l.push(e.element),!r}),l.forEach(e=>ud(e))})};function od(e,t,n,r){if(t.element!==r)return;let i;if(t.scope===n||t.scope===`all`){i=t.mods.length>0;for(let e in Vu)Object.prototype.hasOwnProperty.call(Vu,e)&&(!Vu[e]&&t.mods.indexOf(+e)>-1||Vu[e]&&t.mods.indexOf(+e)===-1)&&(i=!1);(t.mods.length===0&&!Vu[16]&&!Vu[18]&&!Vu[17]&&!Vu[91]||i||t.shortcut===`*`)&&(t.keys=[],t.keys=t.keys.concat(K),t.method(e,t)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&=!0))}}function sd(e,t){let n=G[`*`],r=Lu(e,Ru,zu);if(e.key&&e.key.toLowerCase()===`capslock`||!(cd.filter||ed).call(this,e))return;if((r===93||r===224)&&(r=91),K.indexOf(r)===-1&&r!==229&&K.push(r),[`metaKey`,`ctrlKey`,`altKey`,`shiftKey`].forEach(t=>{let n=Bu[t];e[t]&&K.indexOf(n)===-1?K.push(n):!e[t]&&K.indexOf(n)>-1?K.splice(K.indexOf(n),1):t===`metaKey`&&e[t]&&(K=K.filter(e=>e in Bu||e===r))}),r in Vu){Vu[r]=!0;for(let t in zu)Object.prototype.hasOwnProperty.call(zu,t)&&(cd[t]=e[Bu[zu[t]]]);if(!n)return}for(let t in Vu)Object.prototype.hasOwnProperty.call(Vu,t)&&(Vu[t]=e[Bu[t]]);e.getModifierState&&!(e.altKey&&!e.ctrlKey)&&e.getModifierState(`AltGraph`)&&(K.indexOf(17)===-1&&K.push(17),K.indexOf(18)===-1&&K.push(18),Vu[17]=!0,Vu[18]=!0);let i=Xu();if(n)for(let r=0;r<n.length;r++)n[r].scope===i&&(e.type===`keydown`&&n[r].keydown||e.type===`keyup`&&n[r].keyup)&&od(e,n[r],i,t);if(!(r in G))return;let a=G[r],o=a.length;for(let n=0;n<o;n++)if((e.type===`keydown`&&a[n].keydown||e.type===`keyup`&&a[n].keyup)&&a[n].key){let r=a[n],{splitKey:o}=r,s=r.key.split(o),c=[];for(let e=0;e<s.length;e++)c.push(Ku(s[e]));c.sort().join(``)===K.sort().join(``)&&od(e,r,i,t)}}var cd=function e(t,n,r){K=[];let i=Fu(t),a=[],o=`all`,s=document,c=0,l=!1,u=!0,d=`+`,f=!1,p=!1;if(r===void 0&&typeof n==`function`&&(r=n),Object.prototype.toString.call(n)===`[object Object]`){let e=n;
19e.scope&&(o=e.scope),e.element&&(s=e.element),e.keyup&&(l=e.keyup),e.keydown!==void 0&&(u=e.keydown),e.capture!==void 0&&(f=e.capture),typeof e.splitKey==`string`&&(d=e.splitKey),e.single===!0&&(p=!0)}for(typeof n==`string`&&(o=n),p&&id(t,o);c<i.length;c++){let e=i[c].split(d);a=[],e.length>1&&(a=Pu(zu,e));let t=e[e.length-1];t=t===`*`?`*`:Ku(t),t in G||(G[t]=[]),G[t].push({keyup:l,keydown:u,scope:o,mods:a,shortcut:i[c],method:r,key:i[c],splitKey:d,element:s})}if(s!==void 0&&typeof window<`u`){if(!Gu.has(s)){let e=(e=window.event)=>sd(e,s),t=(e=window.event)=>{sd(e,s),rd(e)};Gu.set(s,{keydownListener:e,keyupListenr:t,capture:f}),Mu(s,`keydown`,e,f),Mu(s,`keyup`,t,f)}if(!Hu){let e=()=>{K=[]};Hu={listener:e,capture:f},Mu(window,`focus`,e,f)}if(!Uu&&typeof document<`u`){let t=()=>{K=[];for(let e in Vu)Vu[e]=!1;for(let t in zu)e[t]=!1},n=t,r=t;document.addEventListener(`fullscreenchange`,n),document.addEventListener(`webkitfullscreenchange`,r),Uu={fullscreen:n,webkit:r}}}};function ld(e,t=`all`){Object.keys(G).forEach(n=>{G[n].filter(n=>n.scope===t&&(n.shortcut===e||n.shortcut===`*`)).forEach(e=>{e&&e.method&&e.method({},e)})})}function ud(e){let t=Object.values(G).flat();if(t.findIndex(({element:t})=>t===e)<0&&e){let{keydownListener:t,keyupListenr:n,capture:r}=Gu.get(e)||{};t&&n&&(Nu(e,`keyup`,n,r),Nu(e,`keydown`,t,r),Gu.delete(e))}if(t.length<=0||Gu.size<=0){if(Array.from(Gu.keys()).forEach(e=>{let{keydownListener:t,keyupListenr:n,capture:r}=Gu.get(e)||{};t&&n&&(Nu(e,`keyup`,n,r),Nu(e,`keydown`,t,r),Gu.delete(e))}),Gu.clear(),Object.keys(G).forEach(e=>delete G[e]),Hu){let{listener:e,capture:t}=Hu;Nu(window,`focus`,e,t),Hu=null}Uu&&typeof document<`u`&&(document.removeEventListener(`fullscreenchange`,Uu.fullscreen),document.removeEventListener(`webkitfullscreenchange`,Uu.webkit),Uu=null)}}var dd={getPressedKeyString:Qu,setScope:Yu,getScope:Xu,deleteScope:nd,getPressedKeyCodes:Zu,getAllKeyCodes:$u,isPressed:td,filter:ed,trigger:ld,unbind:id,keyMap:Ru,modifier:zu,modifierMap:Bu};for(let e in dd){let t=e;Object.prototype.hasOwnProperty.call(dd,t)&&(cd[t]=dd[t])}if(typeof window<`u`){let e=window.hotkeys;cd.noConflict=t=>(t&&window.hotkeys===cd&&(window.hotkeys=e),cd),window.hotkeys=cd}var fd=new Set([`INPUT`,`TEXTAREA`,`SELECT`]),pd=new Set([`ctrl`,`cmd`,`alt`,`shift`,`mod`]),md=new Set([`ctrl`,`cmd`,`alt`,`mod`]),hd=[`ctrl`,`cmd`,`alt`,`shift`,`mod`],gd={ctrl:`Ctrl`,cmd:`⌘`,alt:`Alt`,shift:`Shift`,mod:`Mod`},_d={enter:`Enter`,space:`Space`,tab:`Tab`,escape:`Esc`,backspace:`Backspace`,delete:`Delete`,home:`Home`,end:`End`,pageup:`PageUp`,pagedown:`PageDown`,left:`←`,right:`→`,up:`↑`,down:`↓`},vd=new Set([`left`,`right`,`up`,`down`,`home`,`end`,`pageup`,`pagedown`,`backspace`,`delete`]),yd=!1;function bd(e){let t=e.composedPath?.();if(t?.length){for(let e of t){let t=e;if(t?.tagName&&(fd.has(t.tagName)||t.isContentEditable||t.getAttribute(`contenteditable`)===`true`))return t}return null}let n=e.target;return n?.tagName&&(fd.has(n.tagName)||n.isContentEditable||n.getAttribute(`contenteditable`)===`true`)?n:null}function xd(e){return e?!!bd(e):!1}function Sd(){yd||=(cd.filter=e=>{if(!bd(e)||e.key===`Escape`||e.ctrlKey||e.metaKey||e.altKey)return!0;if(e.shiftKey){let t=e.key??``;if(t.length>1&&!/^[a-z0-9]$/i.test(t))return!0}return!1},!0)}function Cd(e){if(!e)return;let t=e.split(`+`).map(e=>e.trim().toLowerCase()).filter(Boolean);if(t.length===0)return;let n;for(let e=t.length-1;e>=0;--e){let r=t[e];if(!pd.has(r)){n=r;break}}let r=t.some(e=>md.has(e));return{tokens:t,baseKey:n,hasSystemModifier:r}}function wd(e,t){if(!bd(t)||e.hasSystemModifier)return!1;let n=e.baseKey;return!!(!n||n.length===1&&/^[a-z0-9]$/i.test(n)||n===`space`||n===`tab`||n===`enter`||vd.has(n))}function Td(e){return e.map(e=>e===`cmd`?`command`:e).join(`+`)}function Ed(e){if(!e)return[];let{tokens:t}=e,n=Ue()?`cmd`:`ctrl`,r=t.map(e=>e===`cmd`||e===`ctrl`||e===`mod`?n:e);return[Td(Array.from(new Set(r)))]}function Dd(e,t){return e===`cmd`||e===`ctrl`||e===`mod`?t?gd.cmd:gd.ctrl:e===`alt`&&t?`⌥`:gd[e]}function Od(e){return _d[e]?_d[e]:(e.length===1||e.startsWith(`f`)&&/^\d+$/.test(e.slice(1)),e.toUpperCase())}function kd(e,t){let n=Cd(e);if(!n)return;let r=t?.isMac??!1,i=[];
19if(hd.forEach(e=>{if(n.tokens.includes(e)){let t=Dd(e,r);t&&i.push(t)}}),n.baseKey&&i.push(Od(n.baseKey)),i.length!==0)return i.join(` + `)}function Ad({shortcut:e,disabled:t=!1,onActivate:n}){let r=(0,U.useMemo)(()=>Cd(e),[e]),i=(0,U.useMemo)(()=>Ed(r),[r]);(0,U.useEffect)(()=>{if(!r||i.length===0||t)return;let e=(e,i)=>{t||wd(r,e)||(e.preventDefault(),n())};return i.forEach(t=>{cd(t,e)}),()=>{i.forEach(t=>{cd.unbind(t,e)})}},[r,i,t,n])}var jd=({icon:e,label:t,iconSize:n,iconPosition:r=`left`,shortcut:i,wrap:o=!0,addTitleTooltip:c=!1})=>{let l=(0,U.useMemo)(()=>kd(i,{isMac:Ue()}),[i]),u=!o,{titleRef:d,labelTextRef:f}=Rt(c,t);return s(zr,{ref:d,$truncate:u,children:a(Br,{"data-has-shortcut":!!l,$truncate:u,children:[e&&r===`left`&&s(B,{size:n??`base`,iconValue:e}),t&&s(`span`,{ref:f,style:{display:`contents`},children:s(It,{source:t,allowHTML:!1,isLabel:!0,disableLinks:!0,truncate:u,inheritLineHeight:!0})}),e&&r===`right`&&s(B,{size:n??`base`,iconValue:e}),l&&s(Lr,{"aria-label":`Shortcut ${l}`,children:l})]})})};function Md(e){let t=(0,U.useContext)(Zt),n=(t?.isInHorizontalLayout??!1)||(t?.isDirectlyInColumn??!1);return e??!n}var Nd=(e=[],t=-1,n=100)=>{let{values:[r,i],elementRef:a}=ri((0,U.useMemo)(()=>[`width`,`height`],[]),e,n);return{width:r||t,height:i||t,elementRef:a}},Pd=d(`div`,{target:`ecfxx9g0`})(({theme:e,$stretchWidth:t,$calculatedWidth:n=0})=>{let r=he(e);return{boxSizing:`border-box`,borderRadius:e.radii.xl,border:`${e.sizes.borderWidth} solid ${r?e.colors.bgColor:e.colors.borderColor}`,boxShadow:r?e.shadows.popover:e.shadows.none,padding:`calc(${e.spacing.twoXL} - ${e.sizes.borderWidth})`,maxHeight:`70vh`,overflow:`auto`,maxWidth:`calc(${e.sizes.contentMaxWidth} - 2 * ${e.spacing.lg})`,minWidth:t?`max(${n}px, 10rem)`:e.sizes.minPopupWidth,backgroundColor:e.colors.bgColor,zIndex:Ln(e),[`@media (max-width: ${e.breakpoints.sm})`]:{maxWidth:`calc(100% - ${e.spacing.threeXL})`}}}),Fd=d(`div`,{target:`ecfxx9g1`})(({theme:e,$hideChevron:t,$truncate:n})=>({display:`flex`,alignItems:`center`,gap:e.spacing.threeXS,marginRight:t?0:`calc(-${e.iconSizes.lg} * 0.25)`,...n&&{maxWidth:t?`100%`:`calc(100% + ${e.iconSizes.lg} * 0.25)`}})),Id=d(`div`,{target:`ecfxx9g2`})(({theme:e})=>({display:`inline-flex`,marginTop:e.spacing.threeXS,flexShrink:0}));function Ld({availableWidth:e,availableHeight:t,designMaxWidthPx:n,cssMinWidthPx:r}){let i=Math.min(Math.max(Math.floor(e),0),n);return{maxWidth:`${i}px`,maxHeight:`min(${Math.max(Math.floor(t),0)}px, 70vh)`,minWidth:r>i?`${i}px`:``}}var Rd=(0,U.memo)(({element:e,empty:t,children:n,stretchWidth:r,widgetMgr:i,blockId:o,fragmentId:c})=>{let l=on(),u=(0,U.useContext)(Bt),d=e.id,f=!!o&&!d,[p,m]=Jl({widgetMgr:i,id:f?o??``:``,key:`open`,defaultValue:e.open??!1}),h=f?p:e.open??!1,[g,_]=(0,U.useState)(h);ql(()=>{!d||!R(e.open)||(_(e.open),i?.setBoolValue(d,e.open,{formId:void 0,fragmentId:c,fromUser:!1}))},[d,e.open]);let{width:v,elementRef:y}=Nd(),b=Md(e.wrap),x=!b&&!e.help,S=(0,U.useRef)(0),C=(0,U.useCallback)(()=>{let e=!g;e&&(S.current=Date.now()),_(e),d?i?.setBoolValue(d,e,{formId:void 0,fragmentId:c,fromUser:!0}):f&&m(e)},[g,i,d,c,f,m]),w=(0,U.useCallback)(()=>{_(!1),d?i?.setBoolValue(d,!1,{formId:void 0,fragmentId:c,fromUser:!0}):f&&m(!1)},[i,d,c,f,m]),T=V.SECONDARY;e.type===`primary`?T=V.PRIMARY:e.type===`tertiary`&&(T=V.TERTIARY);let E=$t(e.icon,e.label),D=(0,U.useRef)(null),O=(0,U.useRef)(null),k=(0,U.useRef)(!1),A=(0,U.useMemo)(()=>{let e={open:g,placement:`bottom-start`,offsetPx:qe(l.spacing.twoXS)};if(typeof document>`u`)return e;let t=document.documentElement,n=parseFloat(l.sizes.contentMaxWidth)-2*qe(l.spacing.lg),i=r?Math.max(v,qe(`10rem`)):qe(l.sizes.minPopupWidth),a=Zr({padding:8,boundary:t,apply({availableHeight:e,availableWidth:t,elements:r}){let{maxWidth:a,maxHeight:o,minWidth:s}=Ld({availableWidth:t,availableHeight:e,designMaxWidthPx:n,cssMinWidthPx:i});Object.assign(r.floating.style,{maxWidth:a,maxHeight:o,minWidth:s})}});return u?{...e,flipOptions:{boundary:t},shiftOptions:{padding:8,boundary:t},extraMiddleware:[a]}:{...e,extraMiddleware:[a]}},[g,l.spacing.twoXS,l.spacing.lg,l.sizes.minPopupWidth,l.sizes.contentMaxWidth,u,r,v]),{refs:ee,floatingStyles:j}=$r(A);(0,U.useEffect)(()=>
19{if(!g)return;k.current=!1;let e=e=>{if(!e)return!1;let t=e instanceof Element?e:e.parentElement;return!!(D.current?.contains(e)||O.current?.contains(e)||t?.closest(`[data-st-overlay-root="true"]`))},t=t=>{k.current=e(t.target)},n=t=>{if(Date.now()-S.current<50)return;let n=k.current||e(t.target);k.current=!1,!n&&w()},r=t=>{if(t.key===`Escape`){let e=document.activeElement;if(e&&O.current?.contains(e)&&e.getAttribute(`aria-expanded`)===`true`)return;t.stopPropagation(),t.preventDefault(),w(),D.current?.querySelector(`button`)?.focus();return}(t.key===`Enter`||t.key===` `||t.key===`Spacebar`)&&(k.current=e(t.target))};return document.addEventListener(`pointerdown`,t,!0),document.addEventListener(`click`,n),document.addEventListener(`keydown`,r,!0),()=>{document.removeEventListener(`pointerdown`,t,!0),document.removeEventListener(`click`,n),document.removeEventListener(`keydown`,r,!0)}},[g,w]);let M=(0,U.useCallback)(e=>{ee.setFloating(e),O.current=e},[ee]),N=(0,U.useCallback)(e=>{ee.setReference(e),D.current=e},[ee]);return a(An,{"data-testid":`stPopover`,className:`stPopover`,ref:y,children:[s(`div`,{ref:N,children:s(Au,{help:e.help,containerWidth:!0,children:s(Vr,{"data-testid":`stPopoverButton`,kind:T,size:Rr.SMALL,disabled:t&&!d||e.disabled,containerWidth:!0,onClick:C,"aria-expanded":g,"aria-haspopup":`dialog`,children:a(Fd,{$hideChevron:E,$truncate:!b,children:[s(jd,{icon:e.icon,label:e.label,wrap:b,addTitleTooltip:x}),!E&&s(Id,{"aria-hidden":`true`,children:s(B,{iconValue:g?`:material/expand_less:`:`:material/expand_more:`,size:`base`})})]})})})}),g&&s(Qr,{id:`stFloatingOverlayPortal`,children:s(Pd,{ref:M,"data-testid":`stPopoverBody`,"data-st-overlay-root":`true`,role:`dialog`,"aria-label":e.label,style:j,$stretchWidth:r,$calculatedWidth:v,children:n})})]})}),zd=U.forwardRef(function(e,t){return U.createElement(li,f({iconAttrs:{fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`},iconVerticalAlign:`middle`,iconViewBox:`0 0 24 24`},e,{ref:t}),U.createElement(`path`,{fill:`none`,d:`M0 0h24v24H0V0z`}),U.createElement(`path`,{d:`M20.5 6c-2.61.7-5.67 1-8.5 1s-5.89-.3-8.5-1L3 8c1.86.5 4 .83 6 1v13h2v-6h2v6h2V9c2-.17 4.14-.5 6-1l-.5-2zM12 6c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z`}))});zd.displayName=`AccessibilityNew`;var Bd=U.forwardRef(function(e,t){return U.createElement(li,f({iconAttrs:{fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`},iconVerticalAlign:`middle`,iconViewBox:`0 0 24 24`},e,{ref:t}),U.createElement(`path`,{fill:`none`,d:`M0 0h24v24H0V0z`}),U.createElement(`circle`,{cx:18,cy:4.54,r:2}),U.createElement(`path`,{d:`M15 17h-2c0 1.65-1.35 3-3 3s-3-1.35-3-3 1.35-3 3-3v-2c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5zm3-3.5h-1.86l1.67-3.67C18.42 8.5 17.44 7 15.96 7h-5.2c-.81 0-1.54.47-1.87 1.2L8.22 10l1.92.53.65-1.53H13l-1.83 4.1c-.6 1.33.39 2.9 1.85 2.9H18v5h2v-5.5c0-1.1-.9-2-2-2z`}))});Bd.displayName=`AccessibleForward`;var Vd=U.forwardRef(function(e,t){return U.createElement(li,f({iconAttrs:{fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`},iconVerticalAlign:`middle`,iconViewBox:`0 0 24 24`},e,{ref:t}),U.createElement(`path`,{fill:`none`,d:`M0 0h24v24H0V0z`}),U.createElement(`path`,{d:`M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12l4.58-4.59z`}))});Vd.displayName=`ChevronLeft`;var Hd=U.forwardRef(function(e,t){return U.createElement(li,f({iconAttrs:{fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`},iconVerticalAlign:`middle`,iconViewBox:`0 0 24 24`},e,{ref:t}),U.createElement(`path`,{fill:`none`,d:`M0 0h24v24H0V0z`}),U.createElement(`path`,{d:`M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6-6-6z`}))});Hd.displayName=`ChevronRight`;var Ud=U.forwardRef(function(e,t){return U.createElement(li,f({iconAttrs:{fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`},iconVerticalAlign:`middle`,iconViewBox:`0 0 24 24`},e,{ref:t}),U.createElement(`path`,{fill:`none`,d:`M0 0h24v24H0V0z`}),U.createElement(`path`,{d:`M15.5 5.5c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zM5 12c-2.8 0-5 2.2-5 5s2.2 5 5 5 5-2.2 5-5-2.2-5-5-5zm0 8.5c-1.9 0-3.5-1.6-3.5-3.5s1.6-3.5 3.5-3.5 3.5 1.6 3.5 3.5-1.6 3.5-3.5 3.5zm5.8-10l2.4-2.4.8.8c1.3 1.3 3 2.1 5.1 2.1V9c-1.5 0-2.7-.6-3.6-1.5l-1.9-1.9c-.5-.4-1-.6-1.6-.
196s-1.1.2-1.4.6L7.8 8.4c-.4.4-.6.9-.6 1.4 0 .6.2 1.1.6 1.4L11 14v5h2v-6.2l-2.2-2.3zM19 12c-2.8 0-5 2.2-5 5s2.2 5 5 5 5-2.2 5-5-2.2-5-5-5zm0 8.5c-1.9 0-3.5-1.6-3.5-3.5s1.6-3.5 3.5-3.5 3.5 1.6 3.5 3.5-1.6 3.5-3.5 3.5z`}))});Ud.displayName=`DirectionsBike`;var Wd=U.forwardRef(function(e,t){return U.createElement(li,f({iconAttrs:{fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`},iconVerticalAlign:`middle`,iconViewBox:`0 0 24 24`},e,{ref:t}),U.createElement(`path`,{fill:`none`,d:`M0 0h24v24H0V0z`}),U.createElement(`path`,{d:`M13.49 5.48c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm-3.6 13.9l1-4.4 2.1 2v6h2v-7.5l-2.1-2 .6-3c1.3 1.5 3.3 2.5 5.5 2.5v-2c-1.9 0-3.5-1-4.3-2.4l-1-1.6c-.4-.6-1-1-1.7-1-.3 0-.5.1-.8.1l-5.2 2.2v4.7h2v-3.4l1.8-.7-1.6 8.1-4.9-1-.4 2 7 1.4z`}))});Wd.displayName=`DirectionsRun`;var Gd=U.forwardRef(function(e,t){return U.createElement(li,f({iconAttrs:{fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`},iconVerticalAlign:`middle`,iconViewBox:`0 0 24 24`},e,{ref:t}),U.createElement(`path`,{fill:`none`,d:`M0 0h24v24H0V0z`}),U.createElement(`path`,{d:`M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z`}))});Gd.displayName=`KeyboardArrowDown`;var Kd=U.forwardRef(function(e,t){return U.createElement(li,f({iconAttrs:{fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`},iconVerticalAlign:`middle`,iconViewBox:`0 0 24 24`},e,{ref:t}),U.createElement(`path`,{fill:`none`,d:`M0 0h24v24H0V0z`}),U.createElement(`path`,{d:`M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6 1.41 1.41z`}))});Kd.displayName=`KeyboardArrowUp`;var qd=U.forwardRef(function(e,t){return U.createElement(li,f({iconAttrs:{fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`},iconVerticalAlign:`middle`,iconViewBox:`0 0 24 24`},e,{ref:t}),U.createElement(`path`,{fill:`none`,d:`M0 0h24v24H0V0z`}),U.createElement(`path`,{d:`M10 8l-3.25 3.25c.31.12.56.27.77.39.37.23.59.36 1.15.36s.78-.13 1.15-.36c.46-.27 1.08-.64 2.19-.64s1.73.37 2.18.64c.37.22.6.36 1.15.36.55 0 .78-.13 1.15-.36.12-.07.26-.15.41-.23L10.48 5C8.93 3.45 7.5 2.99 5 3v2.5c1.82-.01 2.89.39 4 1.5l1 1zm12 8.5h-.02.02zm-16.65-1c.55 0 .78.14 1.15.36.45.27 1.07.64 2.18.64s1.73-.37 2.18-.64c.37-.23.59-.36 1.15-.36.55 0 .78.14 1.15.36.45.27 1.07.64 2.18.64s1.73-.37 2.18-.64c.37-.23.59-.36 1.15-.36.55 0 .78.14 1.15.36.45.27 1.06.63 2.16.64v-2c-.55 0-.78-.14-1.15-.36-.45-.27-1.07-.64-2.18-.64s-1.73.37-2.18.64c-.37.23-.6.36-1.15.36s-.78-.14-1.15-.36c-.45-.27-1.07-.64-2.18-.64s-1.73.37-2.18.64c-.37.23-.59.36-1.15.36-.55 0-.78-.14-1.15-.36-.45-.27-1.07-.64-2.18-.64s-1.73.37-2.18.64c-.37.23-.59.36-1.15.36v2c1.11 0 1.73-.37 2.2-.64.37-.23.6-.36 1.15-.36zM18.67 18c-1.11 0-1.73.37-2.18.64-.37.23-.6.36-1.15.36-.55 0-.78-.14-1.15-.36-.45-.27-1.07-.64-2.18-.64s-1.73.37-2.19.64c-.37.23-.59.36-1.15.36s-.78-.13-1.15-.36c-.45-.27-1.07-.64-2.18-.64s-1.73.37-2.19.64c-.37.23-.59.36-1.15.36v2c1.11 0 1.73-.37 2.19-.64.37-.23.6-.36 1.15-.36.55 0 .78.13 1.15.36.45.27 1.07.64 2.18.64s1.73-.37 2.19-.64c.37-.23.59-.36 1.15-.36.55 0 .78.14 1.15.36.45.27 1.07.64 2.18.64s1.72-.37 2.18-.64c.37-.23.59-.36 1.15-.36.55 0 .78.14 1.15.36.45.27 1.07.64 2.18.64v-2c-.56 0-.78-.13-1.15-.36-.45-.27-1.07-.64-2.18-.64z`}),U.createElement(`circle`,{cx:16.5,cy:5.5,r:2.5}))});qd.displayName=`Pool`;var Jd=U.forwardRef(function(e,t){return U.createElement(li,f({iconAttrs:{fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`},iconVerticalAlign:`middle`,iconViewBox:`0 0 24 24`},e,{ref:t}),U.createElement(`path`,{fill:`none`,d:`M0 0h24v24H0z`}),U.createElement(`path`,{d:`M8.5 14.5L4 19l1.5 1.5L9 17h2l-2.5-2.5zM15 1c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm6 20.01L18 24l-2.99-3.01V19.5l-7.1-7.09c-.31.05-.61.07-.91.07v-2.16c1.66.03 3.61-.87 4.67-2.04l1.4-1.55c.19-.21.43-.38.69-.5.29-.14.62-.23.96-.23h.03C15.99 6.01 17 7.02 17 8.26v5.75c0 .84-.35 1.61-.92 2.16l-3.58-3.58v-2.27c-.63.52-1.43 1.02-2.29 1.39L16.5 18H18l3 3.01z`}))});Jd.displayName=`Rowing`;function Yd(e){return e===Yt.HORIZONTAL?`stHorizontalBlock`:`stVerticalBlock`}function Xd(e,t){return e!==`empty`||t!==W.RUNNING}function Zd(e,t,n,r){return t===W.RERUN_REQUESTED?!0:t===W.RUNNING||t===W.STOP_REQUESTED?r?.length?!!(e.fragmentId&&r.includes(e.fragmentId)&&e.scriptRunId!==n):e.scriptRunId!==n:!1}function Qd(e,t,n,r,i){return!e||Zd(t,n,r,i)}function $d(e,t,n,r){return r?.length||t!==W.RUNNING&&t!==W.STOP_REQUESTED?!1:e.scriptRunId!==n}function ef(e,t){let n=me(t),r=Object.keys(n),{blue:i,green:a,orange:o,red:s,violet:c,yellow:l}=n,u={blue:i,green:a,orange:o,red:s,violet:c,yellow:l},d=Object.keys(u),f=0;for(let t of Va.collectElements(e)){let e=t.heading?.divider;if(t.type===`heading`&&e){if(e===`auto`){let e=d[f];t.heading.divider=u[e],f+=1,f===d.length&&(f=0)}else r.includes(e)&&(t.heading.divider=n[e])}}}function tf(e){return e?`st-key-`+e.trim().replaceAll(/[^a-zA-Z0-9_-]/g,`-`):``}function nf(e){if(!e||!dt(e))return;let t=e.split(`-`).slice(2).join(`-`);return t===`None`?void 0:t}function rf(e){let t=e.gapConfig;return typeof t?.pixelGap==`number`?{pixelGap:t.pixelGap}:t?.gapSize?{gapSize:t.gapSize}:{gapSize:x.GapSize.SMALL}}function af(e){return!!(e.flexContainer||e.vertical||e.horizontal)}function of(e){if(!e.deltaBlock.heightConfig?.pixelHeight)return!1;let{autoscroll:t}=e.deltaBlock;return t??e.children.some(e=>e instanceof Ra&&e.deltaBlock.type===`chatMessage`)}function sf(e){return e.flexContainer?.border||e.vertical?.border||!1}var cf=1;function lf({elementRef:e,enabled:t,layoutKey:n}){let[r,i]=(0,U.useState)(!1),[a,o]=(0,U.useState)(!1),s=(0,U.useRef)(!1),c=(0,U.useRef)(!1),l=(0,U.useCallback)((e,t)=>{s.current!==e&&(s.current=e,i(e)),c.current!==t&&(c.current=t,o(t))},[]),u=(0,U.useCallback)(()=>{let n=e.current;if(!n||!t){l(!1,!1);return}let{scrollLeft:r,scrollWidth:i,clientWidth:a}=n;l(r>cf,r+a<i-cf)},[l,e,t]);return(0,U.useEffect)(()=>
19{if(!t){l(!1,!1);return}let n=e.current;if(!n)return;n.addEventListener(`scroll`,u,{passive:!0});let r=new ResizeObserver(()=>{u()});return r.observe(n),()=>{n.removeEventListener(`scroll`,u),r.disconnect()}},[l,t,e,u]),(0,U.useEffect)(()=>{if(!t)return;let e=requestAnimationFrame(u);return()=>cancelAnimationFrame(e)},[t,n,u]),{canScrollLeft:r,canScrollRight:a}}var uf=d(`div`,{target:`e1ac7blb0`})(({isOverflowing:e,width:t,height:n,flex:r})=>({position:e?`relative`:void 0,width:t||void 0,height:n||void 0,...n?{display:`flex`,flexDirection:`column`,overflow:`hidden`}:{},flex:r||void 0})),df=d(`button`,{target:`e1ac7blb1`})(({theme:e,position:t})=>({position:`absolute`,top:0,[t]:0,zIndex:e.zIndices.priority,display:`flex`,alignItems:`center`,justifyContent:`center`,height:e.sizes.tabHeight,width:e.spacing.xl,padding:0,border:`none`,cursor:`pointer`,color:e.colors.fadedText60,background:`transparent`,backgroundImage:t===`right`?`linear-gradient(to right, ${fe(e.colors.bgColor,1)}, ${e.colors.bgColor} 40%)`:`linear-gradient(to left, ${fe(e.colors.bgColor,1)}, ${e.colors.bgColor} 40%)`,"&:hover":{color:e.colors.bodyText},"&:focus":{outline:`none`},"&:focus-visible":{boxShadow:e.shadows.focusRing}})),ff=d(sc,{shouldForwardProp:e=>e!==`$constrainedHeight`,target:`e1ac7blb2`})(({$constrainedHeight:e})=>({display:`flex`,flexDirection:`column`,width:`100%`,...e?{flex:1,minHeight:0}:{}})),pf=d(lc,{shouldForwardProp:e=>e!==`$isStale`,target:`e1ac7blb3`})(({theme:e,$isStale:t})=>({display:`flex`,gap:e.spacing.lg,overflowX:`auto`,overflowY:`clip`,scrollbarWidth:`none`,"&::-webkit-scrollbar":{display:`none`},position:`relative`,zIndex:0,"::after":{content:`""`,position:`absolute`,bottom:0,left:0,right:0,height:e.spacing.threeXS,backgroundColor:e.colors.borderColorLight,borderRadius:e.spacing.threeXS,zIndex:-1,pointerEvents:`none`},...t?Xl:{}})),mf=d(fc,{shouldForwardProp:e=>e!==`$isStale`,target:`e1ac7blb4`})(({theme:e,$isStale:t})=>({display:`flex`,alignItems:`center`,position:`relative`,height:e.sizes.tabHeight,whiteSpace:`nowrap`,padding:0,fontSize:e.fontSizes.sm,background:`transparent`,color:e.colors.bodyText,cursor:`pointer`,outline:`none`,"& .react-aria-SelectionIndicator":{position:`absolute`,bottom:0,left:0,width:`100%`,height:e.spacing.threeXS,backgroundColor:`transparent`,borderRadius:e.spacing.threeXS,transition:`translate 200ms, background-color 200ms`,"@media (prefers-reduced-motion: reduce)":{transition:`none`}},"&[data-selected]":{color:e.colors.primary,"& .react-aria-SelectionIndicator":{backgroundColor:e.colors.primary}},"&[data-hovered]":{color:e.colors.primary},"&[data-focus-visible]":{color:e.colors.primary,boxShadow:e.shadows.focusRing},"&[data-disabled]":{opacity:.4,cursor:`default`},...t?Xl:{}})),hf=d(pc,{shouldForwardProp:e=>e!==`$isActive`&&e!==`$constrainedHeight`,target:`e1ac7blb5`})(({theme:e,$isActive:t,$constrainedHeight:n})=>({display:t?void 0:`none`,paddingTop:e.spacing.lg,outline:`none`,...n?{flex:1,minHeight:0,overflow:`auto`}:{},"&[data-focus-visible]":{boxShadow:e.shadows.focusRing}})),gf=200;function _f(e,t,n){let r=e.getElementState(t,`activeTabLabel`);if(!r)return null;let i=n.indexOf(r);return i>=0?{index:i,label:r}:null}function vf(e){let{widgetsDisabled:t,node:n,isStale:r,width:i,height:o,flex:c,widgetMgr:l,fragmentId:u}=e,{scriptRunState:d,scriptRunId:f,fragmentIdsThisRun:p}=(0,U.useContext)(oo),m=n.deltaBlock?.tabContainer?.defaultTabIndex??0,h=n.deltaBlock?.tabContainer?.id,g=n.deltaBlock?.id??``,_=!!h,v=!!g&&!_,y=nf(g),b=(0,U.useMemo)(()=>n.children.map((e,t)=>e?.deltaBlock?.tab?.label??t.toString()),[n.children]),x=(0,U.useMemo)(()=>n.children.map(e=>Zd(e,d,f,p)),[n.children,d,f,p]),[S,C]=(0,U.useState)(()=>{if(v){let e=_f(l,g,b);if(e)return e.index}return m}),w=(0,U.useRef)(void 0);if(w.current===void 0){if(v){let e=_f(l,g,b);e&&(w.current=e.label)}w.current===void 0&&(w.current=n.children[m]?.deltaBlock?.tab?.label??`0`)}let T=(0,U.useRef)(null),{canScrollLeft:E,canScrollRight:D}=lf({elementRef:T,enabled:!0,layoutKey:b.join(`\0`)}),O=E||D,k=(0,U.useCallback)(e=>{T.current?.scrollBy({left:e===`left`?-200:gf,behavior:`smooth`})},[]),A=(0,U.useCallback)(()=>k(`left`),[k]),ee=(0,U.useCallback)(()=>k(`right`),[k]),j=(0,U.useRef)(m);(0,U.useEffect)(()=>
19{if(_&&b.length>0&&m!==j.current){let e=b[m];e&&(C(m),w.current=e,h&&l&&l.setStringValue(h,e,{formId:``,fragmentId:u,fromUser:!1})),j.current=m}},[m,_,b,h,l,u]),(0,U.useEffect)(()=>{if(v){let e=_f(l,g,b);if(e){C(e.index),w.current=e.label;return}}if(b.indexOf(w.current??`0`)===-1){let e=b[m];C(m),w.current=e,v&&l.setElementState(g,`activeTabLabel`,e)}},[b]),(0,U.useEffect)(()=>{let e=T.current;if(!e)return;let t=e.querySelector(`[aria-selected='true']`),n=window.matchMedia(`(prefers-reduced-motion: reduce)`).matches;t?.scrollIntoView({behavior:n?`instant`:`smooth`,block:`nearest`,inline:`nearest`})},[S]),(0,U.useEffect)(()=>{if(v){let e=_f(l,g,b);if(e){C(e.index),w.current=e.label;return}}let e=b.indexOf(w.current??`0`);if(e!==-1)C(e),w.current=b[e];else{let e=b[m];C(m),w.current=e,v&&l.setElementState(g,`activeTabLabel`,e)}},[n.children.length]);let M=(0,U.useCallback)(e=>{let t=Number(e);if(Number.isNaN(t))return;let n=b[t];C(t),w.current=n,v&&l.setElementState(g,`activeTabLabel`,n),_&&h&&l&&l.setStringValue(h,n,{formId:``,fragmentId:u,fromUser:!0})},[b,g,u,_,v,h,l]),N=o!==void 0;return a(uf,{className:[`stTabs`,tf(y)].filter(Boolean).join(` `),"data-testid":`stTabs`,isOverflowing:O,width:i,height:o,flex:c,children:[a(ff,{selectedKey:String(S),onSelectionChange:M,$constrainedHeight:N,children:[s(pf,{ref:T,$isStale:r,children:n.children.map((e,t)=>{let n=x[t],i=b[t]??t.toString();return a(mf,{"data-testid":`stTab`,id:String(t),isDisabled:!r&&n,$isStale:!r&&n,children:[s(It,{source:i,allowHTML:!1,isLabel:!0}),s(Ar,{})]},t)})}),n.children.map((i,a)=>{let o=x[a],c={...e,isStale:r||o,widgetsDisabled:t,node:n.children[a]};return s(hf,{"data-testid":`stTabPanel`,id:String(a),$isActive:S===a,shouldForceMount:!0,$constrainedHeight:N,children:e.renderTabContent(c)},a)})]}),E&&s(df,{position:`left`,onClick:A,"aria-label":`Scroll tabs left`,"data-testid":`stTabsScrollLeft`,children:s(Qt,{content:Vd,size:`lg`})}),D&&s(df,{position:`right`,onClick:ee,"aria-label":`Scroll tabs right`,"data-testid":`stTabsScrollRight`,children:s(Qt,{content:Hd,size:`lg`})})]})}var yf=(0,U.memo)(vf),bf=d(`div`,{target:`e1wbhg7m0`})({display:`flex`}),xf=d(`div`,{target:`e1wbhg7m1`})(({theme:e,border:t,overflow:n})=>({...t&&{border:`${e.sizes.borderWidth} solid ${e.colors.borderColor}`,borderRadius:e.radii.default,padding:`calc(${e.spacing.lg} - ${e.sizes.borderWidth})`},width:`100%`,height:`100%`,overflow:n}));function Sf(e){let{formId:t,widgetMgr:n,children:r,clearOnSubmit:i,enterToSubmit:a,border:o,overflow:c}=e;return(0,U.useEffect)(()=>{n.setFormSubmitBehaviors(t,i,a)},[n,t,i,a]),s(xf,{className:`stForm`,"data-testid":`stForm`,border:o,overflow:c,children:r})}var Cf=(0,U.memo)(Sf);function wf(e,t){let n=Math.sign(t-e),r=e+Math.sqrt(Math.abs(t-e))*n;return n>0?Math.min(t,r):Math.max(t,r)}function Tf(e,t,n,r){let i=e;for(let e=0;e<r;e++)i=n(i,t);return i}function Ef(e,t,n,r){let i=(0,U.useRef)(0),a=(0,U.useCallback)((n,r,o=Date.now())=>{cancelAnimationFrame(i.current),i.current=requestAnimationFrame(()=>{if(e){let i=e.scrollHeight-e.offsetHeight,s=Tf(n,i,wf,(Date.now()-o)/5);Math.abs(i-s)<1.5&&(s=i),e.scrollTop=s,i===s?t():a(n,r+1,o)}})},[i,t,e]),o=(0,U.useCallback)(()=>{cancelAnimationFrame(i.current),t()},[t]);(0,U.useLayoutEffect)(()=>{if(!(!e||!n||!r))return a(e.scrollTop,1),e?(e.addEventListener(`pointerdown`,o,{passive:!0}),e.addEventListener(`wheel`,o,{passive:!0}),()=>{e.removeEventListener(`pointerdown`,o),e.removeEventListener(`wheel`,o),cancelAnimationFrame(i.current)}):()=>cancelAnimationFrame(i.current)},[a,i,o,e,n,r])}var Df=100;function Of(e,t,n){let r=(0,U.useRef)(t),i=(0,U.useRef)(0),a=(0,U.useRef)();(0,U.useEffect)(()=>{r.current=t},[t]);let{clear:o,restart:s}=ti(()=>{a.current&&(r.current(a.current),a.current=void 0,i.current=Date.now())},Df,{autoStart:!1}),c=(0,U.useCallback)(e=>{let t=Date.now(),n=t-i.current;if(n>Df){o(),a.current=void 0,r.current(e),i.current=t;return}a.current=e,s(Math.max(0,Df-n))},[o,s]),l=(0,U.useCallback)(e=>{let t={timeStampLow:Date.now(),target:e.target};c(t)},[c]);(0,U.useLayoutEffect)(()=>!e||!n?()=>{o(),a.current=void 0}:(e.addEventListener(`scroll`,l,{passive:!0}),c({timeStampLow:Date.now(),target:e}),()=>{e.removeEventListener(`scroll`,l),o(),a.current=void 0}
19),[n,o,c,l,e])}function kf(e){let[t,n]=(0,U.useState)(e),r=(0,U.useRef)(e);return r.current=t,[t,n,r]}var Af=1,jf=34,Mf=17;function Nf(e,t){return e(),setInterval(e,t)}function Pf({scrollHeight:e,offsetHeight:t,scrollTop:n}){return e-n-t<Af}function Ff(e){let t=(0,U.useRef)(null),[n,r,i]=kf(!1),[a,o,s]=kf(!0);(0,U.useEffect)(()=>{r(!0)},[r]);let c=(0,U.useRef)(0),l=(0,U.useRef)(0),u=(0,U.useRef)(0),d=(0,U.useCallback)(()=>{c.current=Date.now(),s.current||r(!1),o(!1)},[c,s,o,r]),f=(0,U.useCallback)(({timeStampLow:e})=>{let{current:n}=t,a=s.current;if(e<=c.current||!n)return;let d=Pf(n),{offsetHeight:f,scrollHeight:p}=n,{current:m}=l,{current:h}=u,g=f!==m,_=p!==h;if(g&&(l.current=f),_&&(u.current=p),!g&&!_){let e=a||d;i.current!==e&&r(e)}else i.current&&(o(!0),r(!0))},[c,l,u,s,i,o,r]);return(0,U.useEffect)(()=>{if(t.current&&e){let e=0,n=Nf(()=>{let{current:n}=t,a=s.current;i.current&&n?Pf(n)?e=0:e?Date.now()-e>jf&&(a||(o(!0),r(!0)),e=0):e=Date.now():n&&n.scrollHeight<=n.offsetHeight&&!i.current&&r(!0)},Mf);return()=>clearInterval(n)}},[t,n,a,s,i,r,o,e]),(0,U.useEffect)(()=>{let n=t.current;if(n&&e){let e=()=>{u.current=n.scrollHeight};return n.addEventListener(`focus`,e,{capture:!0,passive:!0}),()=>{n.removeEventListener(`focus`,e,{capture:!0})}}},[t,e]),Of(t.current,f,e),Ef(t.current,d,a,e),t}var If=(0,U.memo)(function({children:e}){return s(u,{children:e})},(e,t)=>!(e.enable||t.enable)),Lf=d(`div`,{target:`ee8gipb0`})(({theme:e,$hasTitle:t})=>({display:`flex`,flexDirection:t?`column`:`row`,gap:t?e.spacing.twoXS:e.spacing.sm,width:`100%`,[`${Xr} code`]:{paddingRight:e.spacing.lg}})),Rf=d(`div`,{target:`ee8gipb1`})(({theme:e})=>({display:`flex`,alignItems:`flex-start`,gap:e.spacing.sm})),zf=d(`div`,{target:`ee8gipb2`})(({theme:e})=>({position:`relative`,top:e.spacing.threeXS,flexShrink:0})),Bf=d(`strong`,{target:`ee8gipb3`})(({theme:e})=>({fontSize:e.fontSizes.md,"& p":{fontWeight:e.fontWeights.bold}})),Vf=d(`div`,{target:`ee8gipb4`})({width:`100%`});function Hf({icon:e,body:t,title:n,kind:r}){let i=on(),o=e?{width:`calc(100% - (${i.iconSizes.lg} + ${i.spacing.sm}))`}:void 0,c=e?s(zf,{children:s(B,{iconValue:e,size:`lg`,testid:`stAlertDynamicIcon`})}):null;return s(`div`,{className:`stAlert`,"data-testid":`stAlert`,children:s(Yr,{kind:r,children:s(Lf,{$hasTitle:!!n,children:n?a(u,{children:[a(Rf,{children:[c,s(Bf,{"data-testid":`stAlertTitle`,children:s(It,{source:n,allowHTML:!1,isLabel:!0,inheritFont:!0})})]}),s(Vf,{children:s(It,{source:t,allowHTML:!1})})]}):a(u,{children:[c,s(It,{source:t,allowHTML:!1,style:o})]})})})})}var Uf=(0,U.memo)(Hf);function Wf(e){switch(e){case se.Format.ERROR:return Hr.ERROR;case se.Format.INFO:return Hr.INFO;case se.Format.SUCCESS:return Hr.SUCCESS;case se.Format.WARNING:return Hr.WARNING;default:throw Error(`Unexpected alert type: ${e}`)}}var Gf=()=>{},Kf=(0,U.createContext)({enabled:!1,onInstall:()=>Promise.resolve(void 0),onShown:Gf,claimCallout:()=>!1,releaseCallout:Gf});Kf.displayName=`SkillsInstallContext`;function qf(e){return e===null?!0:e.closest(`[inert]`)===null?typeof e.checkVisibility!=`function`||e.checkVisibility():!1}function Jf(e,t){let{claimCallout:n,releaseCallout:r}=(0,U.useContext)(Kf),i=(0,U.useRef)(null);i.current===null&&(i.current=Symbol(`skillsCalloutSlot`));let[a,o]=(0,U.useState)(!1);return(0,U.useLayoutEffect)(()=>{!e||a||qf(t?.current??null)&&n(i.current)&&o(!0)},[e,a,n,t]),(0,U.useLayoutEffect)(()=>{let e=i.current;return()=>{r(e),o(!1)}},[r]),a}var Yf=d(`div`,{target:`epg80gh0`})(({theme:e})=>({marginTop:e.spacing.sm,"&:first-of-type":{marginTop:0}})),Xf=d(`span`,{target:`epg80gh1`})(({theme:e})=>({fontWeight:e.fontWeights.bold})),Zf=d(`div`,{target:`epg80gh2`})(({theme:e})=>({marginBottom:e.spacing.sm})),Qf=d(`div`,{target:`epg80gh3`})({display:`inline-block`,minWidth:`100%`}),$f=d(`div`,{target:`epg80gh4`})({wordWrap:`break-word`}),ep=d(`div`,{target:`epg80gh5`})(({theme:e})=>({fontSize:e.fontSizes.sm,display:`flex`,flexWrap:`wrap`,gap:e.spacing.md,justifyContent:`flex-end`})),tp=d(`button`,{target:`epg80gh6`})(({theme:e})=>({all:`unset`,font:`inherit`,cursor:`pointer`,textDecoration:`underline`,borderRadius:e.radii.default,"&:focus-visible":{boxShadow:`0 0 0 ${e.sizes.focusRingWidth} currentColor`}})),np=d(`div`,{target:`epg80gh7`})(({theme:e})=>({display:`flex`,flexDirection:`column`,gap:e.spacing.lg})),rp=d(`div`,{target:`epg80gh8`})(({theme:e})=>({display:`flex`,flexDirection:`column`,gap:e.spacing.sm})),ip=d(Gr,{target:`epg80gh9`})(({theme:e})=>({display:`flex`,flexWrap:`wrap`,alignItems:`center`,gap:e.spacing.sm})),ap=d(`div`,{target:`epg80gh10`})(({theme:e})=>({display:`flex`,alignItems:`center`,gap:e.spacing.sm,flex:`1 1 0%`,minWidth:`min(8rem, 100%)`})),op=d(`span`,{target:`epg80gh11`})({display:`flex`,alignItems:`center`,flexShrink:0}),sp=d(`div`,{target:`epg80gh12`})({flex:`0 1 auto`,minWidth:0,overflowWrap:`anywhere`}),cp=d(tp,{target:`epg80gh13`})({flexShrink:0,whiteSpace:`nowrap`,'&[aria-disabled="true"]':{cursor:`default`,textDecoration:`none`}}),lp=3e3;function up({enabled:e,onInstall:t,onShown:n,onDismiss:r}){let[i,o]=(0,U.useState)(`idle`),[c,l]=(0,U.useState)(``),[u,d]=(0,U.useState)(``),f=(0,U.useRef)(!1);(0,U.useEffect)(()=>{f.current||(f.current=!0,n())},[n]),(0,U.useEffect)(()=>
19{if(i!==`success`)return;let e=setTimeout(r,lp);return()=>clearTimeout(e)},[i,r]);let p=i===`installing`,m=i===`success`,h=i===`error`,g=(0,U.useCallback)(()=>{p||(o(`installing`),l(``),t().then(e=>{d(e??``),o(`success`)}).catch(e=>{o(`error`),l(e instanceof Error?e.message:`Failed to install skills.`)}))},[p,t]),_=m?`:material/check_circle:`:h?`:material/error:`:`:material/auto_awesome:`,v=m?u||`Skills installed — your AI assistant is ready to help.`:p?`Installing Streamlit’s skills…`:h?`Couldn’t install skills. ${c}`:`Install Streamlit’s skills so your AI assistant can fix errors like this.`;return i===`idle`&&!e?null:a(ip,{$kind:m?Hr.SUCCESS:Hr.ERROR,"data-testid":`stSkillsInstallCallout`,className:`stSkillsInstallCallout`,children:[a(ap,{children:[s(op,{"aria-hidden":`true`,children:s(B,{iconValue:_,size:`base`})}),s(sp,{role:`status`,children:v})]}),!m&&s(cp,{onClick:g,"aria-disabled":p||void 0,children:p?`Installing…`:h?`Retry`:`Install skills`})]})}var dp=(0,U.memo)(up);function fp(e){return R(e)&&e!==``}function pp({type:e,message:t,messageIsMarkdown:n}){if(n){let n=t??``;return e.length!==0&&(n=`**${e}**: ${n}`),s(It,{source:n,allowHTML:!1})}return a(u,{children:[s(Xf,{children:e}),e.length!==0&&`: `,fp(t)?t:null]})}function mp({stackTrace:e}){return a(`div`,{children:[s(Zf,{children:`Traceback:`}),s(qr,{children:s(Qf,{children:s(Jr,{wrapLines:!1,children:e.map((e,t)=>s(Yf,{"data-testid":`stExceptionTraceRow`,children:e},t))})})})]})}function hp({element:e}){let{showErrorLinks:t=F.ShowErrorLinks.SHOW_ERROR_LINKS_AUTO}=(0,U.useContext)(tn),n=t===F.ShowErrorLinks.SHOW_ERROR_LINKS_TRUE||t===F.ShowErrorLinks.SHOW_ERROR_LINKS_AUTO&&Ca(),r=(0,U.useContext)(Kf),i=n&&!e.isWarning&&e.isStreamlitException&&r.enabled,o=(0,U.useRef)(null),c=Jf(i,o),[l,u]=(0,U.useState)(!1),d=(0,U.useCallback)(()=>u(!0),[]),f=c&&!l,p=`${e.type}: ${e.message}`,m=`${p}\n\n${e.stackTrace?.join(`
20`)}`,h=`https://www.google.com/search?q=${encodeURIComponent(p)}`,g=`https://chatgpt.com/?q=${encodeURIComponent(m)}`,{copyToClipboard:_}=pi(),v=(0,U.useCallback)(()=>{_(m)},[_,m]);return a(rp,{ref:o,children:[s(`div`,{className:`stException`,"data-testid":`stException`,children:s(Yr,{kind:e.isWarning?Hr.WARNING:Hr.ERROR,children:a(np,{children:[s($f,{"data-testid":`stExceptionMessage`,children:s(pp,{type:e.type,message:e.message,messageIsMarkdown:e.messageIsMarkdown})}),e.stackTrace&&e.stackTrace.length>0?s(mp,{stackTrace:e.stackTrace}):null,n&&a(ep,{children:[s(tp,{onClick:v,children:`Copy`}),s(`a`,{href:h,target:`_blank`,rel:`noopener noreferrer`,children:`Ask Google`}),s(`a`,{href:g,target:`_blank`,rel:`noopener noreferrer`,children:`Ask ChatGPT`})]})]})})}),f&&s(dp,{enabled:i,onInstall:r.onInstall,onShown:r.onShown,onDismiss:d})]})}var gp=(0,U.memo)(hp),_p=d(`span`,{target:`e1xlgy2u0`})(({theme:e})=>({"& > *":{marginRight:e.spacing.sm}})),vp=d(`span`,{target:`e1xlgy2u1`})(({theme:e})=>({fontWeight:e.fontWeights.codeBold})),yp=d(`span`,{target:`e1xlgy2u2`})(({theme:e})=>({color:e.colors.codeTextColor})),bp=d(`span`,{target:`e1xlgy2u3`})(),xp=d(`span`,{target:`e1xlgy2u4`})(({theme:e})=>({display:`flex`,flexDirection:`column`,borderRadius:e.radii.default,border:`${e.sizes.borderWidth} solid ${e.colors.borderColor}`,fontFamily:e.genericFonts.codeFont,fontSize:e.fontSizes.codeFontSize,fontWeight:e.fontWeights.code})),Sp=d(`div`,{target:`e1xlgy2u5`})(({theme:e})=>({padding:`${e.spacing.sm} ${e.spacing.lg}`,backgroundColor:e.colors.bgMix,borderBottom:`${e.sizes.borderWidth} solid ${e.colors.borderColor}`,borderTopLeftRadius:e.radii.default,borderTopRightRadius:e.radii.default,fontSize:e.fontSizes.codeFontSize,overflow:`auto`})),Cp=d(`div`,{target:`e1xlgy2u6`})(({theme:e})=>({whiteSpace:`pre`,overflow:`auto`,maxHeight:`30.5rem`,padding:`${e.spacing.sm} ${e.spacing.lg}`,fontSize:e.fontSizes.codeFontSize,"&:not(:last-child)":{borderBottom:`${e.sizes.borderWidth} solid ${e.colors.borderColor}`}})),wp=d(`table`,{target:`e1xlgy2u7`})(({theme:e})=>({width:`100%`,fontSize:e.fontSizes.codeFontSize,backgroundColor:e.colors.bgMix,tableLayout:`fixed`,borderCollapse:`collapse`,borderBottomLeftRadius:e.radii.default,borderBottomRightRadius:e.radii.default})),Tp=d(`tr`,{target:`e1xlgy2u8`})(({theme:e})=>({"&:not(:last-child)":{borderBottom:`${e.sizes.borderWidth} solid ${e.colors.borderColor}`}})),Ep=d(`td`,{target:`e1xlgy2u9`})(({theme:e})=>({width:`30%`,overflow:`auto`,padding:`${e.spacing.sm} ${e.spacing.lg}`,"& > *":{marginRight:e.spacing.sm}})),Dp=d(`td`,{target:`e1xlgy2u10`})(({theme:e})=>({width:`70%`,overflow:`auto`,padding:`${e.spacing.sm} ${e.spacing.lg}`})),Op=(0,U.memo)(function({member:e}){let{name:t,type:n,value:r,docString:i}=e;return a(Tp,{"data-testid":`stHelpMember`,children:[a(Ep,{children:[t?s(vp,{"data-testid":`stHelpMemberDocName`,children:t}):null,n?s(yp,{"data-testid":`stHelpMemberDocType`,children:n}):null]}),s(Dp,{children:r?s(bp,{"data-testid":`stHelpMemberDocValue`,children:r}):s(bp,{"data-testid":`stHelpMemberDocString`,children:i||`No docs available`})})]})});function kp({element:e}){let{name:t,type:n,value:r,docString:i,members:o}=e;return a(xp,{className:`stHelp`,"data-testid":`stHelp`,children:[s(Sp,{children:a(_p,{children:[t?s(vp,{"data-testid":`stHelpName`,children:t}):null,n?s(yp,{"data-testid":`stHelpType`,children:n}):null,r?s(bp,{"data-testid":`stHelpValue`,children:r}):null]})}),s(Cp,{"data-testid":`stHelpDoc`,children:i||`No docs available`}),o.length>0?s(wp,{"data-testid":`stHelpMembersTable`,children:s(`tbody`,{children:o.map(e=>s(Op,{member:e},e.name))})}):null]})}var Ap=(0,U.memo)(kp),jp=d(`div`,{target:`e2gf26j0`})({minWidth:0,flex:1,overflow:`hidden`}
20),Mp=/^:\w+-badge\[((?:\\.|[^\]\\])*)\]$/;function Np({element:e}){let{allowHtml:t,body:n,elementType:r,help:i,hideAnchors:o,unterminatedParsing:c}=e,l=r===A.Type.CAPTION,u=r===A.Type.LATEX,d=r===A.Type.DIVIDER,f=e.wrap===!1&&!u&&!d,p=r===A.Type.NATIVE&&Mp.test(n.trim()),{titleRef:m,labelTextRef:h}=Rt(f,n),g=!!i&&!f&&!p&&!u&&!t,_=g?`${n} :help[]`:n,v=s(It,{isCaption:l,source:_,allowHTML:t,helpText:g?i:void 0,unterminatedParsing:c,hideAnchors:o,isLabel:f,truncate:f,inheritFont:f&&!l}),y=f?s(jp,{ref:m,children:s(`span`,{ref:h,style:{display:`contents`},children:v})}):v,b;return b=i&&p&&!f?s(Au,{help:i,containerWidth:!1,constrainWidth:!0,children:y}):a(Nt,{isLatex:u,children:[y,i&&(u||t||f)&&s(Dt,{content:i,isLatex:u})]}),s(`div`,{className:`stMarkdown`,"data-testid":`stMarkdown`,children:b})}var Pp=(0,U.memo)(Np),Fp=500,Ip=(0,U.memo)(()=>{let[e,t]=(0,U.useState)(!1);return ti(()=>{t(!0)},Fp),e?a(zt,{className:`stAppSkeleton`,"data-testid":`stAppSkeleton`,"aria-hidden":`true`,children:[s(Et,{}),a(kt,{children:[s(Vt,{width:`98%`}),s(Vt,{width:`100%`}),s(Vt,{width:`96%`}),s(Vt,{width:`65%`})]}),s(wt,{width:`75%`,height:`9rem`})]}):s(u,{})}),Lp=(0,U.memo)(({fillContainerHeight:e=!1})=>s(wt,{className:`stSkeleton`,"data-testid":`stSkeletonElement`,height:e?`100%`:void 0,width:`100%`,"aria-hidden":`true`})),Rp=d(`span`,{target:`ev0ha4o0`})(({theme:e,$truncate:t})=>({fontFamily:e.genericFonts.bodyFont,color:e.colors.bodyText,verticalAlign:`middle`,width:`100%`,...t?{whiteSpace:`nowrap`,whiteSpaceCollapse:`preserve`,wordBreak:`normal`,display:`flex`,alignItems:`center`,minWidth:0,overflow:`hidden`}:{whiteSpace:`pre-line`,whiteSpaceCollapse:`preserve`,wordBreak:`break-word`,display:`inline-block`}})),zp=d(`span`,{target:`ev0ha4o1`})({overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,whiteSpaceCollapse:`preserve`,minWidth:0,flex:1}),Bp=d(`span`,{target:`ev0ha4o2`})(({theme:e})=>({display:`inline-block`,verticalAlign:`middle`,marginLeft:e.spacing.twoXS,flexShrink:0,transform:`translateY(-0.05em)`}));function Vp(e){return e.replaceAll(/\r\n|\r|\n/g,` `)}function Hp({element:e}){let t=e.wrap===!1,{titleRef:n,labelTextRef:r}=Rt(t,e.body),i=t?Vp(e.body):e.body;return s(Nt,{className:`stText`,"data-testid":`stText`,children:a(Rp,{$truncate:t,children:[t?s(zp,{ref:n,children:s(`span`,{ref:r,style:{display:`contents`},children:i})}):i,e.help&&s(Bp,{children:s(Dt,{content:e.help})})]})})}var Up=(0,U.memo)(Hp),Wp=t({});function Gp(e,t){switch(e.toLowerCase()){case jt.H1:return`# ${t}`;case jt.H2:return`## ${t}`;case jt.H3:return`### ${t}`;default:throw Error(`Unrecognized tag for header: ${e}`)}}var Kp={p:U.Fragment,h1:U.Fragment,h2:U.Fragment,h3:U.Fragment,h4:U.Fragment,h5:U.Fragment,h6:U.Fragment};function qp(e){let{element:t}=e,{tag:n,anchor:r,body:i,help:o,hideAnchor:c,divider:l,icon:u}=t,d=(0,U.useContext)(St),f=(0,U.useContext)(Zt),p=t.wrap===!1,[m,...h]=i.split(`
21`),g=u?s(Ft,{"aria-hidden":`true`,"data-testid":`stHeadingIconWrapper`,children:s(B,{iconValue:u,size:`inherit`,testid:`stHeadingIcon`})}):void 0;return a(`div`,{className:`stHeading`,"data-testid":`stHeading`,children:[a(Mt,{isCaption:!1,isInDialog:d,isInHorizontalLayout:f?.isInHorizontalLayout,"data-testid":`stMarkdownContainer`,children:[s(Lt,{anchor:r,help:o,hideAnchor:c,tag:n,icon:g,truncate:p,children:s(Pt,{allowHTML:!1,source:Gp(n,m),overrideComponents:Kp})}),!p&&h.length>0&&s(Pt,{source:h.join(`
22`),allowHTML:!1})]}),l&&s(Tt,{"data-testid":`stHeadingDivider`,rainbow:l.includes(`linear`),color:l})]})}var Jp=(0,U.createContext)({isFullScreen:!1,setFullScreen:()=>{}});Jp.displayName=`ViewStateContext`;var Yp=`.stCheckbox`;function Xp(e,t){if(typeof e?.pixelGap==`number`)return`${e.pixelGap}px`;switch(e?.gapSize){case x.GapSize.XXSMALL:return t.spacing.twoXS;case x.GapSize.XSMALL:return t.spacing.sm;case x.GapSize.SMALL:return t.spacing.lg;case x.GapSize.MEDIUM:return t.spacing.threeXL;case x.GapSize.LARGE:return t.spacing.fourXL;case x.GapSize.XLARGE:return t.spacing.fiveXL;case x.GapSize.XXLARGE:return t.spacing.sixXL;case x.GapSize.NONE:return t.spacing.none;default:return t.spacing.lg}}var Zp=d(`div`,{target:`ep3ma5o0`})({width:`100%`,height:`100%`}),Qp=[`balloons`,`snow`],$p=d(`div`,{target:`ep3ma5o1`})(({theme:e,isStale:t,width:n,height:r,elementType:i,overflow:a,flex:o,minWidth:s,textAlign:c})=>({width:n,height:r,textAlign:c,maxWidth:`100%`,minWidth:n===`0px`?0:s??`1rem`,position:`relative`,overflow:a,flex:o,"@media print":{overflow:`visible`},":has(> .stCacheSpinner)":{height:e.spacing.none,overflow:`visible`,visibility:`visible`,marginBottom:`-${e.spacing.lg}
22`,zIndex:e.zIndices.cacheSpinner},":has(> .stPageLink)":{marginTop:`-${e.spacing.xs}`,marginBottom:`-${e.spacing.xs}`},...t&&i!==`skeleton`&&Xl,...i===`empty`?{display:`none`}:{},...i===`space`?{minWidth:0,minHeight:0}:{},...Qp.includes(i)?{marginBottom:`-${e.spacing.lg}`}:{}})),em=d(`div`,{target:`ep3ma5o2`})(({theme:e,weight:t,gap:n,showBorder:r,verticalAlignment:i,$wrap:a=!0})=>{let{VerticalAlignment:o}=M.Column,s=t*100,c=Xp(n,e),l=c===e.spacing.none?`${s}%`:`calc(${s}% - ${c})`;return{width:l,flex:`1 1 ${l}`,...a?{[`@media (max-width: ${e.breakpoints.columns})`]:{minWidth:`calc(100% - ${e.spacing.twoXL})`}}:{minWidth:e.spacing.sixXL},...i===o.BOTTOM&&{marginTop:`auto`,[`& > .stVerticalBlock > ${$p}:last-of-type > ${Yp}`]:{marginBottom:e.spacing.sm}},...i===o.TOP&&{[`& > .stVerticalBlock > ${$p}:first-of-type > ${Yp}`]:{marginTop:e.spacing.sm}},...i===o.CENTER&&{marginTop:`auto`,marginBottom:`auto`},...r&&{border:`${e.sizes.borderWidth} solid ${e.colors.borderColor}`,borderRadius:e.radii.default,padding:`calc(${e.spacing.lg} - ${e.sizes.borderWidth})`}}}),tm=e=>{switch(e){case M.FlexContainer.Align.ALIGN_START:return`start`;case M.FlexContainer.Align.ALIGN_CENTER:return`center`;case M.FlexContainer.Align.ALIGN_END:return`end`;case M.FlexContainer.Align.STRETCH:return`stretch`;case M.FlexContainer.Align.ALIGN_UNDEFINED:case void 0:case null:return`stretch`;default:return I(e)}},nm=e=>{switch(e){case M.FlexContainer.Justify.JUSTIFY_START:return`start`;case M.FlexContainer.Justify.JUSTIFY_CENTER:return`center`;case M.FlexContainer.Justify.JUSTIFY_END:return`end`;case M.FlexContainer.Justify.SPACE_BETWEEN:return`space-between`;case M.FlexContainer.Justify.JUSTIFY_UNDEFINED:case void 0:case null:return`start`;default:return I(e)}},rm=d(`div`,{target:`ep3ma5o3`})(({theme:e,direction:t,gap:n,flex:r,$wrap:i,height:a,border:o,align:s,justify:c,overflow:l,overflowX:u})=>{let d;return n!==void 0&&(d=Xp(n,e)),{display:`flex`,gap:d,width:`100%`,maxWidth:`100%`,height:a??`auto`,minWidth:`1rem`,flexDirection:t,flex:r,alignItems:tm(s),justifyContent:nm(c),flexWrap:i?`wrap`:`nowrap`,...o&&{border:`${e.sizes.borderWidth} solid ${e.colors.borderColor}`,borderRadius:e.radii.default,padding:`calc(${e.spacing.lg} - ${e.sizes.borderWidth})`},...u===void 0?{overflow:l}:{overflowX:u,overflowY:l,...!o&&{paddingBlock:e.sizes.focusRingWidth,marginBlock:`-${e.sizes.focusRingWidth}`}},[Ja]:e.spacing.none,...t===Yt.VERTICAL&&d&&{[Ya]:{"--st-step-connector-bottom":`-${d}`}}}}),im=d(`div`,{target:`ep3ma5o4`})(({width:e,height:t,flex:n})=>({display:`flex`,flexDirection:`column`,width:e,maxWidth:`100%`,minWidth:`1rem`,height:t,flex:n})),am=({node:e,config:t,...n})=>{let{isInHorizontalLayout:r}=mi(Zt),i=(0,U.useMemo)(()=>t.computeStyleOverrides(),[t]),a=(0,U.useMemo)(()=>t.getMinStretchBehavior(),[t]),o=io({element:e.element,subElement:Xa(e.element),styleOverrides:i,minStretchBehavior:a});return e.element.type===`space`&&(o=r?{...o,height:`auto`}:{...o,width:`auto`}),s($p,{...n,...o})},q=(0,U.memo)(function({node:e,config:t,isStale:n,children:r}){let{isFullScreen:i}=(0,U.useContext)(Jp),a=e.element.type||``,o=nf(Fe(e.element));return s(am,{className:[`stElementContainer`,`element-container`,tf(o)].filter(Boolean).join(` `),"data-testid":`stElementContainer`,"data-stale":n,isStale:n&&!i,elementType:a,node:e,config:t,children:s(At,{children:s(U.Suspense,{fallback:s(wt,{"data-testid":`stSkeleton`,"aria-hidden":`true`}),children:r})})})}),om=function(e){return e.LARGE=`14rem`,e.MEDIUM=`8rem`,e.FIT_CONTENT=`fit-content`,e.NONE=`none`,e}({}),J=class e{static{this.DEFAULT=new e({})}static{this.LARGE_ELEMENT=new e({minStretchWidth:`14rem`})}static{this.MEDIUM_ELEMENT=new e({minStretchWidth:`8rem`})}static{this.FIT_CONTENT_ELEMENT=new e({minStretchWidth:`fit-content`})}static{this.FULL_WIDTH=new e({styleOverrides:{width:`100%`}})}static{this.LARGE_OVERFLOW_VISIBLE=new e({minStretchWidth:`14rem`,styleOverrides:{overflow:`visible`}})}constructor(e={}){this.minStretchWidth=e.minStretchWidth??`none`,this.styleOverrides=e.styleOverrides}with(t){return new e({minStretchWidth:t.minStretchWidth??this.minStretchWidth,styleOverrides:t.styleOverrides===void 0?this.styleOverrides:{...this.styleOverrides,...t.styleOverrides}})}computeStyleOverrides(){return this.styleOverrides??{}}getMinStretchBehavior(){return this.minStretchWidth===`none`?void 0:this.minStretchWidth}},sm=(0,U.lazy)(()=>H(()=>import(`./Table.C9zkVDcb.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40]),import.meta.url)),cm=(0,U.lazy)(()=>H(()=>import(`./ArrowVegaLiteChart.CnqICc92.js`),__vite__mapDeps([41,1,2,3,6,16,4,7,8,5,9,10,11,12,13,14,31,32,15,17,18,19,20,21,22,23,24,25,26,27,28,29,30,33,34,35,36,37,38,39,40,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96]),import.meta.url)),lm=(0,U.lazy)(()=>H(()=>import(`./Audio.CEpG_cwN.js`),__vite__mapDeps([97,1,2,3,6,20,19,4]),import.meta.url)),um=(0,U.lazy)(()=>H(()=>import(`./Balloons.DCOHPjUs.js`),__vite__mapDeps([98,1,2,3,16,19,4,99,23,34,13,10,9]),import.meta.url)),dm=(0,U.lazy)(()=>H(()=>
22import(`./DeckGlJsonChart.Cwh7y9Xq.js`),__vite__mapDeps([100,1,2,3,6,4,7,8,15,16,12,10,11,13,9,14,17,18,5,19,20,21,22,23,24,25,26,27,28,29,30,42,44,53,56,50,57,58,59,60,61,62,63,64,65,66,67,69,37,71,73,81,82,83,84,85,90,101,43,102]),import.meta.url)),fm=(0,U.lazy)(()=>H(()=>import(`./EChartsChart.xboV5vie.js`),__vite__mapDeps([103,1,2,3,6,4,7,8,11,10,12,13,9,14,5,21,29,55,44,56,15,16,17,18,19,20,22,23,24,25,26,27,28,30,50,57,58,59,60,61,62,63,64,65,66,67,69,71,96]),import.meta.url)),pm=(0,U.lazy)(()=>H(()=>import(`./GraphVizChart.BcyMJFej.js`),__vite__mapDeps([104,1,2,3,6,42,4,19,29,7,56,15,16,12,10,11,13,9,14,17,18,5,8,20,21,22,23,24,25,26,27,28,30,50,57,58,59,60,61,62,63,64,65,66,67,44,69,71,82,89,84,85,105]),import.meta.url)),mm=(0,U.lazy)(()=>H(()=>import(`./Html.BWKIiOvA.js`),__vite__mapDeps([106,1,2,3,107]),import.meta.url)),hm=(0,U.lazy)(()=>H(()=>import(`./IFrame.CJEcrs1k.js`),__vite__mapDeps([108,1,2,3,8,109]),import.meta.url)),gm=(0,U.lazy)(()=>H(()=>import(`./ImageList.Diw5VWen.js`),__vite__mapDeps([110,1,2,3,6,15,16,7,12,10,11,13,9,14,17,18,5,4,8,19,20,21,22,23,24,25,26,27,28,29,30,56,50,57,58,59,60,61,62,63,64,65,66,67,44,69,71]),import.meta.url)),_m=(0,U.lazy)(()=>H(()=>import(`./Json.DfzTeKsg.js`),__vite__mapDeps([111,1,2,3,7,49,5,6,4,8,9,10,11,12,13,14,50,16,21,29,24,23,68,51,73,74,75]),import.meta.url)),vm=(0,U.lazy)(()=>H(()=>import(`./LinkButton.CSp4iDJ5.js`),__vite__mapDeps([112,1,2,3,7,19,4,22,23,16,24,57,58,59,60,61,62,63,64,65,66,113]),import.meta.url)),ym=(0,U.lazy)(()=>H(()=>import(`./Metric.B02FwwbX.js`),__vite__mapDeps([114,1,2,3,6,16,4,7,5,8,9,10,11,12,13,14,15,17,18,19,20,21,22,23,24,25,26,27,28,29,30,50,49,44,115,116,76,40,77,80,81,82,83,84,85,86,87,88,89,90,91,92]),import.meta.url)),bm=(0,U.lazy)(()=>H(()=>import(`./PageLink.BKVzgcLV.js`),__vite__mapDeps([117,1,2,3,15,6,16,7,12,10,11,13,9,14,17,18,5,4,8,19,20,21,22,23,24,25,26,27,28,29,30,49,50,113]),import.meta.url)),xm=(0,U.lazy)(()=>H(()=>import(`./PlotlyChart.DbjBdK9w.js`),__vite__mapDeps([118,1,2,3,6,4,7,8,11,10,12,13,9,14,5,21,43,51,69,71,75]),import.meta.url)),Sm=(0,U.lazy)(()=>H(()=>import(`./Progress.D-aKfW--.js`),__vite__mapDeps([119,1,2,3,15,6,16,7,12,10,11,13,9,14,17,18,5,4,8,19,20,21,22,23,24,25,26,27,28,29,30,120,121,122,123,124]),import.meta.url)),Cm=(0,U.lazy)(()=>H(()=>import(`./Snow.BM4wYEfZ.js`),__vite__mapDeps([125,1,2,3,16,19,4,99,23,34,13,10,9]),import.meta.url)),wm=(0,U.lazy)(()=>H(()=>import(`./Spinner.DRKa_gCK.js`),__vite__mapDeps([126,1,2,3,15,6,16,7,12,10,11,13,9,14,17,18,5,4,8,19,20,21,22,23,24,25,26,27,28,29,30,49,50]),import.meta.url)),Tm=(0,U.lazy)(()=>H(()=>import(`./StreamlitSyntaxHighlighter.DjwkZDHJ.js`),__vite__mapDeps([127,1,2,3,4,8,15,6,16,7,12,10,11,13,9,14,17,18,5,19,20,21,22,23,24,25,26,27,28,29,30,128]),import.meta.url)),Em=(0,U.lazy)(()=>H(()=>import(`./Toast.D2J7TkN_.js`),__vite__mapDeps([129,1,2,3,4,8,21,29,7]),import.meta.url)),Dm=(0,U.lazy)(()=>H(()=>import(`./Video.Bioiuj5R.js`),__vite__mapDeps([130,1,2,3,6,4,20,19]),import.meta.url)),Om=(0,U.lazy)(()=>H(()=>import(`./AudioInput.XXvnX2J8.js`),__vite__mapDeps([131,1,2,3,4,8,5,6,7,9,10,11,12,13,14,132,35,36,50,16,49,19,21,22,23,24,57,58,59,60,61,62,63,64,65,66,67,43,44,54,55,56,15,17,18,20,25,26,27,28,29,30,133,115,134,79,135,136]),import.meta.url)),km=(0,U.lazy)(()=>H(()=>import(`./DataFrame.CZ6u6FRw.js`).then(e=>e.n),__vite__mapDeps([45,1,2,3,6,23,16,4,7,8,12,10,11,13,9,14,5,15,17,18,19,20,21,22,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,46,47,48,42,49,50,43,51,44,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93]),import.meta.url)),Am=(0,U.lazy)(()=>H(()=>import(`./Button.O77LRFsV.js`),__vite__mapDeps([137,1,2,3,22,23,16,7,24,57,58,59,60,61,62,63,64,65,66,67,113,4]),import.meta.url)),jm=(0,U.lazy)(()=>H(()=>import(`./ButtonGroup.Cx22Hfn9.js`),__vite__mapDeps([138,1,2,3,4,5,6,7,8,9,10,11,12,13,14,42,22,23,16,24,57,58,59,60,61,62,63,64,65,66,133,15,17,18,19,20,21,25,26,27,28,29,30,115,116,101,43]),import.meta.url)),Mm=(0,U.lazy)(()=>H(()=>import(`./ComponentInstance.BwNBFYRP.js`),__vite__mapDeps([139,1,2,3,6,23,4,8,5,7,9,10,11,12,13,14,15,16,17,18,19,20,21,22,24,25,26,27,28,29,30,51,109,136,140]),import.meta.url)),Nm=(0,U.lazy)(()=>H(()=>import(`./CameraInput.B3VD66Ch.js`),__vite__mapDeps([141,1,2,3,6,23,4,8,5,7,9,10,11,12,13,14,50,16,21,22,24,57,58,59,60,61,62,63,64,65,66,67,43,51,44,133,15,17,18,19,20,25,26,27,28,29,30,115,134,120,121,122,123,124,136,142]),import.meta.url)),Pm=(0,U.lazy)(()=>H(()=>import(`./ChatInput.C_woB0a7.js`),__vite__mapDeps([143,1,2,3,6,4,7,8,5,9,10,11,12,13,14,132,35,36,50,16,49,21,22,23,24,44,144,57,58,59,60,61,62,63,64,65,66,67,145,95,146,142,135,30,147,115,148,149]),import.meta.url)),Fm=(0,U.lazy)(()=>H(()=>import(`./Checkbox.CNx9itha.js`),__vite__mapDeps([150,1,2,3,4,7,5,6,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,58,60,151,61,
2262,152,153,154,63,116,115,101,43]),import.meta.url)),Im=(0,U.lazy)(()=>H(()=>import(`./ColorPicker.BL3ihIcu.js`),__vite__mapDeps([155,1,2,3,13,10,9,11,12,14,5,6,4,7,8,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,156,157,158,36,159,160,70,133,115,116,101,43]),import.meta.url)),Lm=(0,U.lazy)(()=>H(()=>import(`./DateInput.Cy1iyJU0.js`),__vite__mapDeps([161,1,2,3,8,5,6,4,7,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,50,162,58,163,122,164,151,61,62,124,152,165,153,166,65,167,168,169,170,60,171,172,173,174,64,44,145,146,133,115,134,101,43]),import.meta.url)),Rm=(0,U.lazy)(()=>H(()=>import(`./DateTimeInput.DGlI1YM6.js`),__vite__mapDeps([175,1,2,3,7,8,5,6,4,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,50,162,58,163,122,164,151,61,62,124,152,165,153,166,65,167,168,169,170,60,171,172,173,174,64,44,145,146,133,115,134,101,43]),import.meta.url)),zm=(0,U.lazy)(()=>H(()=>import(`./DownloadButton.BHgWCdF6.js`),__vite__mapDeps([176,1,2,3,19,4,57,7,22,23,16,24,58,59,60,61,62,63,64,65,66,67,51,79,113]),import.meta.url)),Bm=(0,U.lazy)(()=>H(()=>import(`./Feedback.CMkDF62V.js`),__vite__mapDeps([177,1,2,3,4,42,49,5,6,7,8,9,10,11,12,13,14,50,16,101,43]),import.meta.url)),Vm=(0,U.lazy)(()=>H(()=>import(`./FileUploader.CoRA2jyX.js`),__vite__mapDeps([178,1,2,3,23,4,8,5,6,7,9,10,11,12,13,14,132,35,36,57,22,16,24,58,59,60,61,62,63,64,65,66,67,43,144,50,49,44,145,95,146,142,133,15,17,18,19,20,21,25,26,27,28,29,30,115,134]),import.meta.url)),Hm=(0,U.lazy)(()=>H(()=>import(`./FormSubmitContent.CNp7e-aj.js`).then(e=>({default:e.FormSubmitContent})),__vite__mapDeps([179,1,2,3,22,23,16,7,24,57,58,59,60,61,62,63,64,65,66,67,69,113,4]),import.meta.url)),Um=(0,U.lazy)(()=>H(()=>import(`./Multiselect.mQJuGPmL.js`),__vite__mapDeps([180,1,2,3,4,8,5,6,7,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,172,170,58,163,60,151,171,61,62,65,122,164,173,174,168,64,166,181,182,157,158,36,159,152,153,183,165,167,66,146,44,133,115,134,101,43]),import.meta.url)),Wm=(0,U.lazy)(()=>H(()=>import(`./MenuButton.DJLNl_Ul.js`),__vite__mapDeps([184,1,2,3,5,6,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,49,50,170,58,163,60,151,171,61,62,65,173,174,168,64,57,59,63,66,67]),import.meta.url)),Gm=(0,U.lazy)(()=>H(()=>import(`./NumberInput.Df2wSd59.js`),__vite__mapDeps([185,1,2,3,6,4,8,5,7,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,50,49,166,58,151,186,122,173,152,183,60,165,153,44,145,146,133,115,134,77,101,43,147]),import.meta.url)),Km=(0,U.lazy)(()=>H(()=>import(`./Pagination.8gNQgOnm.js`),__vite__mapDeps([187,1,2,3,5,6,4,7,8,9,10,11,12,13,14,42,49,50,16,21,188,51,101,43]),import.meta.url)),qm=(0,U.lazy)(()=>H(()=>import(`./Radio.CzyUQudO.js`),__vite__mapDeps([189,1,2,3,8,5,6,4,7,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,58,122,60,151,61,62,152,165,153,154,64,65,133,115,116,101,43]),import.meta.url)),Jm=(0,U.lazy)(()=>H(()=>import(`./Selectbox.B6TvsQ3N.js`),__vite__mapDeps([190,1,2,3,4,8,5,6,7,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,172,170,58,163,60,151,171,61,62,65,122,164,173,174,168,64,166,181,182,157,158,36,159,152,153,183,165,167,146,44,133,115,134,101,43]),import.meta.url)),Ym=(0,U.lazy)(()=>H(()=>import(`./Slider.DAVZJBXN.js`),__vite__mapDeps([191,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,58,122,60,62,123,124,153,133,115,134,39,76,40,77,78,101,43,140]),import.meta.url)),Xm=(0,U.lazy)(()=>H(()=>import(`./TextArea.BCoUcqsn.js`),__vite__mapDeps([192,1,2,3,5,6,4,7,8,9,10,11,12,13,14,21,133,15,16,17,18,19,20,22,23,24,25,26,27,28,29,30,115,134,101,43,147,148,149,193]),import.meta.url)),Zm=(0,U.lazy)(()=>H(()=>import(`./TextInput.DZMdozJH.js`),__vite__mapDeps([194,1,2,3,6,4,8,5,7,9,10,11,12,13,14,50,16,49,21,22,23,24,166,58,151,186,122,173,152,183,60,165,153,145,44,146,133,15,17,18,19,20,25,26,27,28,29,30,115,134,72,51,101,43,147,149,193]),import.meta.url)),Qm=(0,U.lazy)(()=>H(()=>import(`./TimeInput.DVHGNTs_.js`),__vite__mapDeps([195,1,2,3,7,8,5,6,4,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,50,162,58,163,122,164,151,61,62,124,152,165,153,166,65,167,168,145,44,146,133,115,134,101,43,147]),import.meta.url)),$m=(0,U.lazy)(()=>H(()=>import(`./BidiComponent.CzdAZaBu.js`),__vite__mapDeps([196,1,2,3,6,4,7,12,10,197,20,19,21,29,30,69,38,37]),import.meta.url));function eh(e,t){return e?s(u,{}):t}var th=e=>{let{node:t,isStale:n}
22=e,{isInRoot:r,isInHorizontalLayout:i}=mi(Zt);if(!t)throw Error(`ElementNode not found.`);let a={disableFullscreenMode:e.disableFullscreenMode,widthConfig:t.element.widthConfig,heightConfig:t.element.heightConfig},o={...a,widgetMgr:e.widgetMgr,disabled:e.widgetsDisabled,fragmentId:t.fragmentId,componentRegistry:e.componentRegistry};switch(t.element.type){case`alert`:{let e=t.element.alert;return s(q,{node:t,config:J.DEFAULT,isStale:n,children:s(Uf,{icon:e.icon,body:e.body,title:e.title,kind:Wf(e.format),...a})})}case`table`:{let e=t.element.table;return s(q,{node:t,config:J.LARGE_ELEMENT,isStale:n,children:s(sm,{element:e,elementHash:t.elementHash,...a})})}case`audio`:return s(q,{node:t,config:J.LARGE_ELEMENT,isStale:n,children:s(lm,{element:t.element.audio,endpoints:e.endpoints,...a,elementMgr:e.widgetMgr})});case`balloons`:return eh(n,s(q,{node:t,config:J.DEFAULT,isStale:n,children:s(um,{scriptRunId:t.scriptRunId})}));case`code`:{let e=t.element.code;return s(q,{node:t,config:J.LARGE_ELEMENT,isStale:n,children:s(Tm,{language:e.language,showLineNumbers:e.showLineNumbers,wrapLines:e.wrapLines,children:e.codeText})})}case`deckGlJsonChart`:{let e=t.element.deckGlJsonChart;return s(q,{node:t,config:J.LARGE_OVERFLOW_VISIBLE,isStale:n,children:s(dm,{element:e,...o},e.id||void 0)})}case`helpInfo`:return s(q,{node:t,config:J.LARGE_ELEMENT,isStale:n,children:s(Ap,{element:t.element.helpInfo,...a})});case`empty`:return s(q,{node:t,config:J.DEFAULT,isStale:n,children:s(`div`,{className:`stEmpty`,"data-testid":`stEmpty`})});case`exception`:return s(q,{node:t,config:J.DEFAULT,isStale:n,children:s(gp,{element:t.element.exception,...a})});case`graphvizChart`:return s(q,{node:t,config:J.LARGE_OVERFLOW_VISIBLE,isStale:n,children:s(pm,{element:t.element.graphvizChart,...a})});case`heading`:return s(q,{node:t,config:J.DEFAULT,isStale:n,children:s(qp,{element:t.element.heading,...a})});case`iframe`:return s(q,{node:t,config:J.LARGE_OVERFLOW_VISIBLE,isStale:n,children:s(hm,{element:t.element.iframe,...a})});case`imgs`:{let r=!t.element.widthConfig||t.element.widthConfig.useStretch?J.FULL_WIDTH:new J({styleOverrides:{width:`auto`}});return s(q,{node:t,config:r,isStale:n,children:s(gm,{element:t.element.imgs,endpoints:e.endpoints,...a})})}case`json`:return s(q,{node:t,config:J.LARGE_ELEMENT,isStale:n,children:s(_m,{element:t.element.json,...a})});case`markdown`:{let e=t.element.widthConfig?J.DEFAULT:i?new J({styleOverrides:{width:`fit-content`}}):J.FULL_WIDTH;return s(q,{node:t,config:e,isStale:n,children:s(Pp,{element:t.element.markdown,...a})})}case`metric`:{let e=t.element.metric,r=e.chartData&&e.chartData.length>0;return s(q,{node:t,config:r?J.LARGE_ELEMENT:J.DEFAULT,isStale:n,children:s(ym,{element:e,...a})})}case`html`:return s(q,{node:t,config:J.DEFAULT,isStale:n,children:s(mm,{element:t.element.html,...a})});case`pageLink`:{let e=t.element.pageLink,r=o.disabled||e.disabled;return s(q,{node:t,config:J.DEFAULT,isStale:n,children:s(bm,{element:e,disabled:r,...a})})}case`progress`:return s(q,{node:t,config:J.MEDIUM_ELEMENT,isStale:n,children:s(Sm,{element:t.element.progress,...a})});case`skeleton`:{let e=t.element.skeleton.style===D.SkeletonStyle.APP,{heightConfig:r}=t.element,i=!!(r?.useStretch||r?.pixelHeight||r?.remHeight);return s(q,{node:t,config:e?J.FULL_WIDTH:J.LARGE_ELEMENT,isStale:n,children:e?s(Ip,{}):s(Lp,{fillContainerHeight:i})})}case`snow`:return eh(n,s(q,{node:t,config:J.DEFAULT,isStale:n,children:s(Cm,{scriptRunId:t.scriptRunId})}));case`space`:return s(q,{node:t,config:J.DEFAULT,isStale:n,children:s(Zp,{className:`stSpace`,"data-testid":`stSpace`})});case`spinner`:return s(q,{node:t,config:J.DEFAULT,isStale:n,children:s(wm,{element:t.element.spinner,...a})});case`text`:return s(q,{node:t,config:J.DEFAULT,isStale:n,children:s(Up,{element:t.element.text,...a})});case`video`:return s(q,{node:t,config:J.LARGE_ELEMENT,isStale:n,children:s(Dm,{element:t.element.video,endpoints:e.endpoints,...a,elementMgr:e.widgetMgr})});case`toast`:{let e=t.element.toast;return s(q,{node:t,config:J.DEFAULT,isStale:n,children:s(Em,{element:e,toastId:t.metadata.deltaPath.join(`-`),...a},t.scriptRunId)})}case`dataframe`:{let e=t.element.dataframe;o.disabled=o.disabled||e.disabled;let i=t.element.widthConfig?.useContent&&r?new J({minStretchWidth:om.LARGE,styleOverrides:{overflow:`visible`,width:`100%`}}):J.LARGE_OVERFLOW_VISIBLE;return s(q,{node:t,config:i,isStale:n,children:s(km,{element:e,elementHash:t.elementHash,...o}
22,e.id||void 0)})}case`vegaLiteChart`:{let e=t.element.vegaLiteChart,a=t.element.widthConfig?.useContent&&r,c=i&&!t.element.widthConfig,l=a||c?new J({minStretchWidth:om.LARGE,styleOverrides:{overflow:`visible`,...a&&{width:`100%`},...c&&{flex:`1 1 14rem`}}}):J.LARGE_OVERFLOW_VISIBLE;return s(q,{node:t,config:l,isStale:n,children:s(cm,{element:e,elementHash:t.elementHash,...o},e.id||void 0)})}case`audioInput`:{let r=t.element.audioInput;return o.disabled=o.disabled||r.disabled,s(q,{node:t,config:J.LARGE_ELEMENT,isStale:n,children:s(Om,{uploadClient:e.uploadClient,element:r,...o},r.id)})}case`button`:{let e=t.element.button;return o.disabled=o.disabled||e.disabled,s(q,{node:t,config:J.DEFAULT,isStale:n,children:e.isFormSubmitter?s(Hm,{element:e,...o}):s(Am,{element:e,...o})})}case`buttonGroup`:{let e=t.element.buttonGroup;return o.disabled=o.disabled||e.disabled,s(q,{node:t,config:J.LARGE_ELEMENT,isStale:n,children:s(jm,{element:e,...o},e.id)})}case`downloadButton`:{let r=t.element.downloadButton;return o.disabled=o.disabled||r.disabled,s(q,{node:t,config:J.DEFAULT,isStale:n,children:s(zm,{endpoints:e.endpoints,element:r,...o},r.id)})}case`feedback`:{let e=t.element.feedback;return o.disabled=o.disabled||e.disabled,s(q,{node:t,config:J.FIT_CONTENT_ELEMENT,isStale:n,children:s(Bm,{element:e,...o},e.id)})}case`pagination`:{let e=t.element.pagination;return o.disabled=o.disabled||e.disabled,s(q,{node:t,config:J.FULL_WIDTH,isStale:n,children:s(Km,{element:e,...o},e.id)})}case`cameraInput`:{let r=t.element.cameraInput;return o.disabled=o.disabled||r.disabled,s(q,{node:t,config:J.LARGE_ELEMENT,isStale:n,children:s(Nm,{element:r,uploadClient:e.uploadClient,...o},r.id)})}case`chatInput`:{let r=t.element.chatInput;o.disabled=o.disabled||r.disabled;let a=t.element.heightConfig,c=new J({minStretchWidth:om.MEDIUM,styleOverrides:a?.useStretch?{height:`100%`,flex:`1 1 8rem`}:a?.pixelHeight?{height:`auto`,overflow:`visible`,...i?{}:{flex:``}}:void 0});return s(q,{node:t,config:c,isStale:n,children:s(Pm,{element:r,uploadClient:e.uploadClient,...o},r.id)})}case`checkbox`:{let e=t.element.checkbox;return o.disabled=o.disabled||e.disabled,s(q,{node:t,config:J.DEFAULT,isStale:n,children:s(Fm,{element:e,...o},e.id)})}case`colorPicker`:{let e=t.element.colorPicker;return o.disabled=o.disabled||e.disabled,s(q,{node:t,config:J.DEFAULT,isStale:n,children:s(Im,{element:e,...o},e.id)})}case`componentInstance`:return s(q,{node:t,config:J.FULL_WIDTH,isStale:n,children:s(Mm,{element:t.element.componentInstance,...o})});case`dateInput`:{let e=t.element.dateInput;return o.disabled=o.disabled||e.disabled,s(q,{node:t,config:J.MEDIUM_ELEMENT,isStale:n,children:s(Lm,{element:e,...o},e.id)})}case`fileUploader`:{let r=t.element.fileUploader;return o.disabled=o.disabled||r.disabled,s(q,{node:t,config:J.LARGE_ELEMENT,isStale:n,children:s(Vm,{element:r,uploadClient:e.uploadClient,...o},r.id)})}case`linkButton`:{let r=t.element.linkButton;return s(q,{node:t,config:J.DEFAULT,isStale:n,children:s(vm,{element:r,widgetMgr:e.widgetMgr,fragmentId:t.fragmentId})})}case`multiselect`:{let e=t.element.multiselect;return o.disabled=o.disabled||e.disabled,s(q,{node:t,config:J.MEDIUM_ELEMENT,isStale:n,children:s(Um,{element:e,...o},e.id)})}case`menuButton`:{let e=t.element.menuButton;return o.disabled=o.disabled||e.disabled,s(q,{node:t,config:J.DEFAULT,isStale:n,children:s(Wm,{element:e,...o})})}case`numberInput`:{let e=t.element.numberInput;return o.disabled=o.disabled||e.disabled,s(q,{node:t,config:J.MEDIUM_ELEMENT,isStale:n,children:s(Gm,{element:e,...o},e.id)})}case`echartsChart`:{let e=t.element.echartsChart;return s(q,{node:t,config:J.LARGE_OVERFLOW_VISIBLE,isStale:n,children:s(fm,{element:e,...a},e.id||void 0)})}case`plotlyChart`:{let e=t.element.plotlyChart;return s(q,{node:t,config:J.LARGE_ELEMENT,isStale:n,children:s(xm,{element:e,...o},e.id)})}case`radio`:{let e=t.element.radio;return o.disabled=o.disabled||e.disabled,s(q,{node:t,config:J.MEDIUM_ELEMENT,isStale:n,children:s(qm,{element:e,...o},e.id)})}case`selectbox`:{let e=t.element.selectbox;return o.disabled=o.disabled||e.disabled,s(q,{node:t,config:J.MEDIUM_ELEMENT,isStale:n,children:s(Jm,{element:e,...o}
22,e.id)})}case`slider`:{let e=t.element.slider;return o.disabled=o.disabled||e.disabled,s(q,{node:t,config:J.MEDIUM_ELEMENT,isStale:n,children:s(Ym,{element:e,...o},e.id)})}case`textArea`:{let e=t.element.textArea;o.disabled=o.disabled||e.disabled;let r=t.element.heightConfig?.useStretch,a=new J({minStretchWidth:om.MEDIUM,styleOverrides:r?{height:`100%`,flex:`1 1 8rem`}:{height:`auto`,...i?{}:{flex:``}}});return s(q,{node:t,config:a,isStale:n,children:s(Xm,{element:e,outerElement:t.element,...o},e.id)})}case`textInput`:{let e=t.element.textInput;return o.disabled=o.disabled||e.disabled,s(q,{node:t,config:J.MEDIUM_ELEMENT,isStale:n,children:s(Zm,{element:e,...o},e.id)})}case`dateTimeInput`:{let e=t.element.dateTimeInput;return o.disabled=o.disabled||e.disabled,s(q,{node:t,config:J.DEFAULT,isStale:n,children:s(Rm,{element:e,...o},e.id)})}case`timeInput`:{let e=t.element.timeInput;return o.disabled=o.disabled||e.disabled,s(q,{node:t,config:J.MEDIUM_ELEMENT,isStale:n,children:s(Qm,{element:e,...o},e.id)})}case`bidiComponent`:{let e=t.element.bidiComponent;return s(q,{node:t,config:J.DEFAULT,isStale:n,children:s($m,{element:e,...o},e.id)})}default:throw Error(`Unrecognized Element type ${t.element.type}`)}},nh=e=>{let{scriptRunState:t,scriptRunId:n,fragmentIdsThisRun:r}=(0,U.useContext)(oo),{node:i}=e,a=Xd(i.element.type||``,t),o=Qd(a,i,t,n,r);return s(If,{enable:a,children:s(th,{...e,isStale:o})})},rh=class e{constructor(e,t){this.props=e,this.elementKeyOverride=t,this.elementKeySet=new Set,this.reactElements=[],this.index=0,this.transientElementCount=0}getCurrentKey(e){return this.elementKeyOverride||e||this.index.toString()}conformToArray(e){return e?Array.isArray(e)?e:[e]:[]}visitBlockNode(e){let t={...this.props,node:e},n=this.getCurrentKey(e.deltaBlock?.id||void 0);this.index+=1;let r=s(lh,{...t},n);return this.reactElements.push(r),r}visitTransientNode(t){let n=[];t.transientNodes.forEach(t=>{let r=this.getCurrentKey(`transient-${this.transientElementCount}`);this.transientElementCount+=1;let i=t.accept(new e(this.props,r));n.push(...this.conformToArray(i))}),this.reactElements.push(...n);let r=t.anchor?.accept(this);return n.push(...this.conformToArray(r)),n}visitElementNode(e){let t={...this.props,node:e},n=this.getCurrentKey(Fe(e.element));if(this.index+=1,this.elementKeySet.has(n))return null;this.elementKeySet.add(n);let r=s(nh,{...t},n);return this.reactElements.push(r),r}static collectReactElements(t){if(!t.node.children)return[];let n=new e(t);return t.node.children.forEach(e=>e.accept(n)),n.reactElements}},ih=e=>{ef(e.node,on());let{node:t,widgetsDisabled:n,disableFullscreenMode:r,endpoints:i,widgetMgr:a,uploadClient:o,componentRegistry:c}=e,l=(0,U.useMemo)(()=>rh.collectReactElements({node:t,widgetsDisabled:n,disableFullscreenMode:r,endpoints:i,widgetMgr:a,uploadClient:o,componentRegistry:c}),[t,n,r,i,a,o,c]);return s(u,{children:l})},ah=e=>{let t=(0,U.useContext)(Zt),n={direction:Yt.VERTICAL,flex:1,gap:{gapSize:x.GapSize.SMALL},height:e.height,border:!1};return s(Xt,{direction:Yt.VERTICAL,isRoot:e.isRoot,isDirectlyInColumn:R(e.node.deltaBlock.column),parentContext:t,children:s(rm,{...n,className:Yd(Yt.VERTICAL),"data-testid":Yd(Yt.VERTICAL),children:s(ih,{...e})})})},oh=e=>{let t=qt(e.node.deltaBlock),n=(0,U.useContext)(Zt),r=of(e.node),i=Ff(r),a=io({element:e.node.deltaBlock,subElement:Xa(e.node.deltaBlock)}),o=e.node.deltaBlock.flexContainer?.wrap??!1,c=t===Yt.HORIZONTAL&&!o,l={gap:e.node.deltaBlock.flexContainer?.gapConfig??{gapSize:x.GapSize.SMALL},direction:t,$wrap:o,overflow:a.overflow,overflowX:c?`auto`:void 0,border:sf(e.node.deltaBlock),height:a.height,flex:`1`,align:e.node.deltaBlock.flexContainer?.align,justify:e.node.deltaBlock.flexContainer?.justify},u=nf(e.node.deltaBlock.id),d=e.node.deltaBlock.widthConfig?.pixelWidth??void 0,f=e.node.deltaBlock.widthConfig?.useContent??!1,p=(e.node.deltaBlock.widthConfig?.pixelWidth??0)>0||(e.node.deltaBlock.widthConfig?.remWidth??0)>0;return s(Xt,{direction:t,wrap:o,parentWidth:d,hasContentWidth:f,hasFixedWidth:p,parentContext:n,children:s(rm,{...l,className:[Yd(t),tf(u)].filter(
22Boolean).join(` `),"data-testid":Yd(t),"data-test-wrap":String(o),ref:i,"data-test-scroll-behavior":r?`scroll-to-bottom`:`normal`,children:s(ih,{...e})})})},sh=[`tabContainer`],ch=[`chatInput`],lh=e=>{let{node:t}=e,{scriptRunState:n,scriptRunId:r,fragmentIdsThisRun:i}=(0,U.useContext)(oo),a=(0,U.useContext)(Zt),o;sh.includes(t.deltaBlock.type??``)?o=`14rem`:ch.includes(t.deltaBlock.type??``)?o=`8rem`:t.deltaBlock.type===`chatMessage`?t.isEmpty&&(o=`8rem`):(t.deltaBlock.type===`flexContainer`||t.deltaBlock.column||t.deltaBlock.expandable)&&(t.isEmpty||(o=`8rem`));let c=io({element:t.deltaBlock,subElement:Xa(t.deltaBlock),minStretchBehavior:o});if(t.isEmpty&&!t.deltaBlock.allowEmpty)return s(u,{});let l=Qd(Xd(``,n),t,n,r,i),d={...e,node:t},f=e.disableFullscreenMode||R(t.deltaBlock.dialog)||R(t.deltaBlock.popover);if(t.deltaBlock.transparent)return s(ih,{...d,disableFullscreenMode:f});let p,m=!1,h=t.deltaBlock.expandable?.type===M.Expandable.Type.STEP,g=nf(t.deltaBlock.id),_=s(ah,{...d,disableFullscreenMode:f,height:`100%`});if(af(t.deltaBlock)&&(p=s(oh,{...d})),t.deltaBlock.dialog)return $d(t,n,r,i)?s(u,{}):s(Gl,{element:t.deltaBlock.dialog,deltaMsgReceivedAt:t.deltaMsgReceivedAt,widgetMgr:e.widgetMgr,fragmentId:t.fragmentId,children:_});if(t.deltaBlock.expandable&&(m=!0,p=s(Du,{isStale:l,element:t.deltaBlock.expandable,empty:t.isEmpty,widgetMgr:e.widgetMgr,blockId:t.deltaBlock.id||void 0,fragmentId:t.fragmentId,children:_})),t.deltaBlock.popover&&(m=!0,p=s(Rd,{empty:t.isEmpty,element:t.deltaBlock.popover,stretchWidth:Kt(t.deltaBlock.widthConfig),widgetMgr:e.widgetMgr,blockId:t.deltaBlock.id||void 0,fragmentId:t.fragmentId,children:_})),t.deltaBlock.type===`form`){let{formId:n,clearOnSubmit:r,enterToSubmit:i,border:a}=t.deltaBlock.form;p=s(Cf,{formId:n,clearOnSubmit:r,enterToSubmit:i,widgetMgr:e.widgetMgr,border:a,overflow:c.overflow,children:_})}if(t.deltaBlock.chatMessage&&(p=s(mo,{element:t.deltaBlock.chatMessage,endpoints:e.endpoints,children:_})),t.deltaBlock.column)return s(em,{weight:t.deltaBlock.column.weight??0,gap:rf(t.deltaBlock.column),verticalAlignment:t.deltaBlock.column.verticalAlignment??void 0,showBorder:t.deltaBlock.column.showBorder??!1,$wrap:a?.wrap??!0,className:`stColumn`,"data-testid":`stColumn`,children:_});if(t.deltaBlock.tabContainer){let e=t.deltaBlock.heightConfig,n=R(e)&&!e.useContent,r=n?`100%`:`auto`,i=e=>s(ah,{...e,height:r}),a={...d,isStale:l,renderTabContent:i,width:c.width,height:n?c.height:void 0,flex:c.flex,fragmentId:t.fragmentId};return s(yf,{...a})}return p?s(im,{"data-testid":`stLayoutWrapper`,[qa]:h?`true`:void 0,className:tf(m?g:void 0),...c,children:p}):_},uh=(0,U.createContext)({backendOperationClient:void 0});uh.displayName=`BackendOperationContext`;var dh=(0,U.createContext)(null);dh.displayName=`FormsContext`;var fh=(0,U.createContext)({pageLinkBaseUrl:``,currentPageScriptHash:``,onPageChange:()=>{},navSections:[],appPages:[]});fh.displayName=`NavigationContext`;var ph=d(`div`,{target:`egah9gy0`})(({theme:e})=>({position:`fixed`,top:0,left:0,zIndex:e.zIndices.tablePortal,lineHeight:`100%`,...!he(e)&&{"& input[type='date'], & input[type='time'], & input[type='datetime-local']":{"&::-webkit-calendar-picker-indicator":{filter:`brightness(0) invert(1)`,opacity:1}}}})),mh=d(`small`,{target:`egah9gy1`})(({theme:e})=>({color:e.colors.redTextColor,fontSize:e.fontSizes.sm,marginTop:e.spacing.twoXS,display:`block`})),hh=(0,U.createContext)(null);hh.displayName=`PortalContext`;var gh=({children:e})=>{let t=(0,U.useRef)(null),n=(0,U.useCallback)(()=>t.current,[]);return a(hh.Provider,{value:n,children:[e,(0,As.createPortal)(s(ph,{"data-react-aria-top-layer":`true`,"data-st-overlay-root":`true`,"data-testid":`portal`,id:Ou,ref:t}),document.body),(0,As.createPortal)(s(`div`,{"data-react-aria-top-layer":`true`,"data-st-overlay-root":`true`,id:ku}),document.body)]})},_h=(0,U.createContext)({initialSidebarState:y.SidebarState.AUTO,appLogo:null,sidebarChevronDownshift:0,expandSidebarNav:!1,hideSidebarNav:!1,isSidebarLocked:!1});_h.displayName=`SidebarConfigContext`;var vh=(0,U.createContext)({activeTheme:at(),setTheme:()=>{},availableThemes:[]});vh.displayName=`ThemeContext`;function yh({theme:e,children:t}){return s(c,{theme:e,children:t})}function bh({text:e}){let{isCopied:t,copyToClipboard:n,label:r}=pi(),i=(0,U.useCallback)(()=>{n(e)},[n,e]);return s(Kr,{children:s(Ur,{children:s(fi,{label:r,icon:t?ui:di,onClick:i})})})}var xh=(0,U.memo)(bh);function Sh({children:e}){let t=typeof e==`string`&&e.trim().length>0;return a(Xr,{className:`stErrorCodeBlock`,"data-testid":`stErrorCodeBlock`,tabIndex:t?0:void 0,children:[s(Wr,{wrapLines:!1,children:s(Jr,{wrapLines:!1,children:e})}),t&&s(xh,{text:e})]})}var Ch=(0,U.memo)(Sh);function wh(e){let t=e.match(/^:(.+)\/(.+):$/);
22return t===null?``:`https://fonts.gstatic.com/s/i/short-term/release/materialsymbolsrounded/${t[2]}/default/24px.svg`}function Th(e,t,n){let r=e=>{Dh(e),t({type:`SET_PAGE_FAVICON`,favicon:e})};if(e.startsWith(`:material`)){r(wh(e));return}if(e.startsWith(`emoji:`)){r(Eh(e.slice(6)));return}/^:[a-zA-Z0-9_+-]+:$/.test(e)?Oh(e).then(t=>{r(t?Eh(t):n.buildMediaURL(e))}).catch(()=>{r(n.buildMediaURL(e))}):r(n.buildMediaURL(e))}function Eh(e){return`data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>${e}</text></svg>`}function Dh(e){let t=document.querySelector(`link[rel='shortcut icon']`);t&&(t.href=e)}async function Oh(e){let t=await H(()=>import(`./lib.Dd69Svmo.js`),__vite__mapDeps([198,1]),import.meta.url),n=e.replaceAll(`-`,`_`),r=t.get(n);return r&&r!==n&&t.has(r)?r:``}var kh=new ll({maxVisibleToasts:1/0}),Ah=U.forwardRef(function(e,t){return U.createElement(li,f({iconAttrs:{fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`},iconVerticalAlign:`middle`,iconViewBox:`0 0 24 24`},e,{ref:t}),U.createElement(`path`,{fill:`none`,d:`M0 0h24v24H0V0z`}),U.createElement(`path`,{d:`M18.3 5.71a.996.996 0 00-1.41 0L12 10.59 7.11 5.7A.996.996 0 105.7 7.11L10.59 12 5.7 16.89a.996.996 0 101.41 1.41L12 13.41l4.89 4.89a.996.996 0 101.41-1.41L13.41 12l4.89-4.89c.38-.38.38-1.02 0-1.4z`}))});Ah.displayName=`Close`;var jh=U.forwardRef(function(e,t){return U.createElement(li,f({iconAttrs:{fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`},iconVerticalAlign:`middle`,iconViewBox:`0 0 24 24`},e,{ref:t}),U.createElement(`path`,{fill:`none`,d:`M0 0h24v24H0V0z`}),U.createElement(`path`,{d:`M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z`}))});jh.displayName=`MoreVert`;var Mh=e=>({display:`flex`,flexDirection:`row`,gap:e.spacing.md,width:e.sizes.toastWidth,marginTop:e.spacing.sm,borderRadius:e.radii.default,paddingTop:e.spacing.lg,paddingBottom:e.spacing.lg,paddingLeft:e.spacing.twoXL,paddingRight:e.spacing.twoXL,backgroundColor:e.colors.bgColor,filter:he(e)?`brightness(0.98)`:`brightness(1.2)`,color:e.colors.bodyText,boxShadow:e.shadows.popover,outline:`none`}),Nh=d(fl,{target:`ebngmqm0`})(({theme:e})=>({position:`fixed`,top:e.sizes.headerHeight,right:0,display:`flex`,flexDirection:`column`,zIndex:e.zIndices.toast,outline:`none`,marginLeft:e.spacing.lg,marginRight:e.spacing.lg,"&[data-focus-visible]":{boxShadow:e.shadows.focusRing},"> ol":{display:`flex`,flexDirection:`column-reverse`,listStyle:`none`,margin:0,padding:0}})),Ph=d(ml,{target:`ebngmqm1`})(({theme:e})=>({...Mh(e),"&[data-focus-visible]":{boxShadow:e.shadows.focusRing}})),Fh=d(go,{target:`ebngmqm2`})(({theme:e})=>({color:e.colors.fadedText40,background:`none`,border:`none`,cursor:`pointer`,flexShrink:0,alignSelf:`flex-start`,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:0,marginRight:`calc(-1 * ${e.spacing.lg} / 2)`,borderRadius:e.radii.sm,"&[data-hovered]":{color:e.colors.bodyText},"&[data-focus-visible]":{outline:`none`,boxShadow:e.shadows.focusRing}})),Ih=d(`button`,{target:`ebngmqm3`})(({theme:e})=>({fontSize:e.fontSizes.sm,lineHeight:e.lineHeights.base,color:e.colors.fadedText60,backgroundColor:e.colors.transparent,fontFamily:`inherit`,margin:e.spacing.none,border:`none`,boxShadow:`none`,padding:e.spacing.none,"&:hover, &:active, &:focus":{border:`none`,outline:`none`,boxShadow:`none`},"&:hover":{color:e.colors.primary}})),Lh=d(`div`,{target:`ebngmqm4`})(({theme:e})=>({display:`flex`,flexDirection:`row`,gap:e.spacing.lg,flex:1,minWidth:0,"> span":{marginTop:e.spacing.twoXS}})),Rh=d(`div`,{target:`ebngmqm5`})(({theme:e})=>({display:`flex`,flexDirection:`column`,gap:e.spacing.sm,alignItems:`start`,justifyContent:`center`,overflow:`hidden`,minHeight:`100%`,fontSize:e.fontSizes.sm,lineHeight:e.lineHeights.base})),zh=d(`div`,{target:`ebngmqm6`})(({clamped:e})=>({...e&&{display:`-webkit-box`,WebkitLineClamp:3,WebkitBoxOrient:`vertical`,overflow:`hidden`}}));function Bh({toast:e}){let{body:t,icon:n}=e.content,[r,i]=(0,U.useState)(!1),[o,c]=(0,U.useState)(!1),l=(0,U.useRef)(null);(0,U.useLayoutEffect)(()=>{let e=l.current;if(e){let t=(parseFloat(getComputedStyle(e).lineHeight)||20)*3+1;c(e.scrollHeight>t)}},[t]);let u=(0,U.useCallback)(()=>i(e=>!e),[]);return a(Ph,{toast:e,"data-testid":`stToast`,className:`stToast`,children:[a(Lh,{children:[n&&s(B,{iconValue:n,size:`xl`,testid:`stToastDynamicIcon`}),a(Rh,{children:[s(zh,{ref:l,clamped:o&&!r,"data-testid":`stToastText`,children:s(It,{source:t,allowHTML:!1,isToast:!0})}),o&&s(Ih,{"data-testid":`stToastViewButton`,onClick:u,children:r?`view less`:`view more`})]})]}),s(Fh,{slot:`close`,"aria-label":`Close`,children:s(Qt,{content:Ah,size:`md`})})]})}function Vh(){return de(navigator.userAgent).deviceType===`mobile`}var Hh=class{constructor(e){this._buffer=Array(e),this._size=e,this._index=0,this._wrappedCount=0}push(e){this._buffer[this._index]=e,this._index=(this._index+1)%this._size,this._index===0&&(this._wrappedCount+=1)}get buffer(){return this._buffer}get totalWrittenEntries(){return this._wrappedCount*this._size+this._index}},Uh=(e,t,n,r,i,a)=>{window.__streamlit_profiles__=window.__streamlit_profiles__||{},window.__streamlit_profiles__[e]=window.__streamlit_profiles__[e]||new Hh(1e3),window.__streamlit_profiles__[e].push({phase:t,actualDuration:n,baseDuration:r,startTime:i,commitTime:a})},Wh=({id:e,children:t})=>s(U.Profiler,{id:e,onRender:Uh,children:t}),Gh=(e,{buttonSize:t,focusRing:n}={})=>({...t&&{height:t,width:t},padding:e.spacing.none,border:`none`,backgroundColor:e.colors.transparent,color:e.colors.fadedText60,cursor:`pointer`,borderRadius:e.radii.sm,display:`flex`,alignItems:`center`,justifyContent:`center`,"&:hover":{color:e.colors.bodyText,backgroundColor:e.colors.darkenedBgMix15},"&:active":{color:e.colors.bodyText,backgroundColor:e.colors.darkenedBgMix25},"&:focus-visible":{outline:`none`,boxShadow:n??e.shadows.focusRing}}),Kh=d(`button`,{target:`e1anvavm0`})(({theme:e,buttonSize:t})=>({...Gh(e,{buttonSize:t})})),qh=(0,U.memo)(({text:e,iconSize:t,buttonSize:n,copyLabel:r,copiedLabel:i,className:a,"data-testid":o,"aria-label":c,title:l})=>{let u=on(),{isCopied:d,copyToClipboard:f,label:p}=pi(),m=(0,U.useCallback)(()=>{f(e)},[f,e]),h=qe(t??u.iconSizes.base),g=n??u.iconSizes.threeXL,_=d?i??p:r??p;return s(Kh,{className:a,"data-testid":o,title:l??_,"aria-label":c??_,"data-copy-state":d?`copied`:`idle`,type:`button`,buttonSize:g,onClick:m,children:s(d?Fl:zl,{size:h})})}),Jh=(0,U.createContext)(null);Jh.displayName=`WindowDimensionsContext`;var Yh=100,Xh=()=>{let e=on(),[t,n]=(0,U.useState)({fullWidth:0,fullHeight:0,innerWidth:0,innerHeight:0}),r=(0,U.useCallback)(()=>{let t=qe(e.spacing.md),n=qe(e.sizes.fullScreenHeaderHeight),{innerWidth:r,innerHe
22ight:i}=window;return{fullWidth:r-t*2,fullHeight:i-(t+n),innerWidth:r,innerHeight:i}},[e.sizes.fullScreenHeaderHeight,e.spacing.md]),i=(0,U.useCallback)(()=>{n(r())},[r]),{throttledCallback:a,cancel:o}=ni(i,Yh);return(0,U.useEffect)(()=>(window.addEventListener(`resize`,a),()=>{window.removeEventListener(`resize`,a),o()}),[a,o]),(0,U.useLayoutEffect)(()=>{i()},[i]),t},Zh=({children:e})=>{let t=Xh();if((0,U.useContext)(Jh))throw Error("WindowDimensionsProvider should only be used once per app. If you need to read window dimensions, utilize `useWindowDimensionsContext()` instead.");return s(Jh.Provider,{value:t,children:e})},Qh=()=>mi(Jh),$h=(0,yi.getLogger)(`ComponentRegistry`),eg=class{constructor(e){this.msgListeners=new Map,this.registerListener=(e,t)=>{this.msgListeners.has(e)&&$h.warn(`MessageEventSource registered multiple times!`,e),this.msgListeners.set(e,t)},this.deregisterListener=e=>{this.msgListeners.delete(e)||$h.warn(`Could not deregister unregistered MessageEventSource!`)},this.checkSourceUrlResponse=(e,t)=>this.endpoints.checkSourceUrlResponse(e,`Custom Component`,t),this.sendTimeoutError=(e,t)=>{this.endpoints.sendClientErrorToHost(`Custom Component`,`Request Timeout`,`Your app is having trouble loading the component.`,e,t)},this.getComponentURL=(e,t)=>this.endpoints.buildComponentURL(e,t),this.getBidiComponentURL=(e,t)=>this.endpoints.buildBidiComponentURL(e,t),this.onMessageEvent=e=>{if(z(e.data)||!Object.hasOwn(e.data,`isStreamlitMessage`))return;if(z(e.source)){$h.warn(`Received component message with no eventSource!`,e.data);return}let t=this.msgListeners.get(e.source);if(z(t)||typeof t!=`function`){$h.warn(`Received component message for unregistered ComponentInstance!`,e.data);return}let{type:n}=e.data;if(z(n)){$h.warn(`Received Streamlit message with no type!`,e.data);return}t(n,e.data)},this.endpoints=e,window.addEventListener(`message`,this.onMessageEvent)}},tg=(0,yi.getLogger)(`FileUploadClient`),ng=class{constructor(e){this.formsWithPendingRequests=new Map,this.pendingFileURLsRequests=new Map,this.sessionInfo=e.sessionInfo,this.endpoints=e.endpoints,this.pendingFormUploadsChanged=e.formsWithPendingRequestsChanged,this.requestFileURLs=e.requestFileURLs}async uploadFile(e,t,n,r,i){return this.offsetPendingRequestCount(e.formId,1),this.endpoints.uploadFileUploaderFile(t,n,this.sessionInfo.current.sessionId,r,i).finally(()=>this.offsetPendingRequestCount(e.formId,-1))}deleteFile(e){return this.endpoints.deleteFileAtURL?this.endpoints.deleteFileAtURL(e,this.sessionInfo.current.sessionId):Promise.resolve()}fetchFileURLs(e){if(!this.requestFileURLs)return Promise.resolve([]);let t=Promise.withResolvers(),n=ge();return this.pendingFileURLsRequests.set(n,t),this.requestFileURLs(n,e),t.promise}onFileURLsResponse(e){let t=e.responseId,n=this.pendingFileURLsRequests.get(t);n?(e.errorMsg?n.reject(e.errorMsg):n.resolve(e.fileUrls||[]),this.pendingFileURLsRequests.delete(t)):tg.warn(`fileURLsResponse received for nonexistent request, ignoring.`)}getFormIdSet(){return new Set(this.formsWithPendingRequests.keys())}offsetPendingRequestCount(e,t){if(t===0||!nt(e))return;let n=this.formsWithPendingRequests.get(e)??0,r=n+t;if(r<0)throw Error(`Can't offset pendingRequestCount below 0 (formId=${e}, curCount=${n}, offset=${t})`);let i=this.getFormIdSet();r===0?this.formsWithPendingRequests.delete(e):this.formsWithPendingRequests.set(e,r);let a=this.getFormIdSet();Aa(a,i)||this.pendingFormUploadsChanged(a)}},rg=(0,yi.getLogger)(`BackendOperationClient`),ig=3e4,ag=18e4,og=12e4,sg=18e4,cg=`Connection closed`,lg=`Request timed out`,ug=class extends Error{constructor(e,t){super(e),this.name=`BackendOperationError`,this.reason=t||void 0}};function dg(e){let t=e?.reason;return typeof t==`string`&&t?t:void 0}var fg=class{constructor(e){this.pendingRequests=new Map,this.sendRequest=e.sendRequest,this.getSessionId=e.getSessionId,this.timeoutMs=e.timeoutMs??ig}request(e,t,n){let r=ge(),i=n??this.timeoutMs,a=Promise.withResolvers(),o,s;try{o=this.getSessionId(),s=new re({requestId:r,sessionId:o,[e]:t})}catch(e){return a.reject(e),a.promise}let c=setTimeout(()=>{this.handleTimeout(r)},i);this.pendingRequests.set(r,{resolver:a,timeoutId:c,requestType:e});try{this.sendRequest(s)}catch(e){this.cleanupRequest(r),a.reject(e)}return a.promise}requestDeferredFile(e,t){return this.request(`deferredFile`,{fileId:e},t??ag)}requestDataframeChunk(e,t){return this.request(`dataframeChunk`,e,t??og)}requestInstallSkills(){return this.request(`installSkills`,{},sg)}
22requestDismissSkillsNudge(){return this.request(`dismissSkillsNudge`,{})}onResponse(e){let t=e.requestId,n=this.pendingRequests.get(t);if(!n){rg.warn(`Received response for unknown request ${t}`);return}if(this.cleanupRequest(t),e.errorMsg)n.resolver.reject(new ug(e.errorMsg,e.errorReason??void 0));else try{let t=this.extractResponsePayload(e);n.resolver.resolve(t)}catch(e){n.resolver.reject(e)}}cleanup(){for(let[e,t]of this.pendingRequests)clearTimeout(t.timeoutId),t.resolver.reject(Error(cg)),rg.debug(`Cleaned up pending request ${e}`);this.pendingRequests.clear()}get pendingCount(){return this.pendingRequests.size}handleTimeout(e){let t=this.pendingRequests.get(e);t&&(rg.warn(`Request ${e} (${t.requestType}) timed out`),this.pendingRequests.delete(e),t.resolver.reject(Error(lg)))}cleanupRequest(e){let t=this.pendingRequests.get(e);t&&(clearTimeout(t.timeoutId),this.pendingRequests.delete(e))}extractResponsePayload(e){if(e.deferredFile)return e.deferredFile;if(e.dataframeChunk)return e.dataframeChunk;if(e.installSkills)return e.installSkills;if(e.dismissSkillsNudge)return e.dismissSkillsNudge;throw rg.warn(`Response contained no recognized payload`,e),Error(`Response contained no recognized payload`)}};function pg({isOpen:e,onClose:t,floatingSetFn:n,referenceSetFn:r,excludeSelectors:i,excludeEscape:a=!1,restoreFocusFn:o,closeOnTab:s=!1}){let c=(0,U.useRef)(null),l=(0,U.useRef)(null),u=(0,U.useRef)(i);(0,U.useEffect)(()=>{u.current=i},[i]);let d=(0,U.useCallback)(e=>{c.current=e,n(e)},[n]),f=(0,U.useCallback)(e=>{l.current=e,r?.(e)},[r]);return(0,U.useEffect)(()=>{if(!e)return;let n=e=>{let n=e.target;c.current?.contains(n)||l.current?.contains(n)||u.current?.some(e=>n.closest(e))||t()},r=e=>{let n=e.key===`Escape`,r=s&&e.key===`Tab`;if(!(!n&&!r)){if(n&&a){let t=e.target;if(u.current?.some(e=>t.closest(e)))return}n&&(e.stopPropagation(),e.preventDefault()),t(),n&&o?.()}};return document.addEventListener(`pointerdown`,n,!0),document.addEventListener(`keydown`,r,!0),()=>{document.removeEventListener(`pointerdown`,n,!0),document.removeEventListener(`keydown`,r,!0)}},[e,t,s,a,o]),{panelRef:c,setFloatingRef:d,referenceRef:l,setReferenceRef:f}}var mg=()=>{let e=document.createElement(`div`);e.style.position=`absolute`,e.style.top=`-9999px`,e.style.left=`-9999px`,e.style.visibility=`hidden`,e.style.overflow=`scroll`,e.style.width=`50px`,e.style.height=`50px`,document.body.appendChild(e);let t=document.createElement(`div`);t.style.width=`100%`,t.style.height=`100%`,e.appendChild(t);let n=e.offsetWidth-t.offsetWidth;return e.remove(),n},hg=()=>{let e=window.devicePixelRatio;return(0,U.useMemo)(()=>mg(),[e])},gg=(0,yi.getLogger)(`HostCommunicationManager`),_g=`isGuestToHostEcho`;function vg(e){return typeof e==`object`&&!!e&&Object.prototype.hasOwnProperty.call(e,`isGuestToHostEcho`)&&e.isGuestToHostEcho===!0}var yg=class{constructor(e){this.isHostCommOpen=!1,this.openHostCommunication=()=>{if(this.isHostCommOpen)return;this.isHostCommOpen=!0,window.addEventListener(`message`,this.receiveHostMessage);let e={type:`GUEST_READY`,streamlitExecutionStartedAt:this.props.streamlitExecutionStartedAt,guestReadyAt:Date.now()};this.sendMessageToHost(e)},this.closeHostCommunication=()=>{window.removeEventListener(`message`,this.receiveHostMessage),this.isHostCommOpen=!1},this.resetAuthToken=()=>{this.deferredAuthToken=Promise.withResolvers()},this.claimAuthToken=()=>this.deferredAuthToken.promise,this.setAllowedOrigins=({allowedOrigins:e,useExternalAuthToken:t})=>{t||this.deferredAuthToken.resolve(void 0),e?.length&&(this.allowedOrigins=e,this.openHostCommunication())},this.sendMessageToSameOriginHost=e=>{this.postMessageToParentAndEcho(e,window.location.origin)},this.sendMessageToHost=e=>{this.postMessageToParentAndEcho(e,`*`)},this.receiveHostMessage=e=>{let t=e.data,n=e.source===window.parent,r=e.source===window&&window!==window.parent;if(r&&vg(e.data))return;let i=e.isTrusted&&(n||r),a=t?.stCommVersion===1,o=a&&this.allowedOrigins.some(t=>nn(t,e.origin));if(!i||!a||!o){a&&gg.debug(`Ignoring host message: isTrusted=%s, sourceIsParent=%s, selfPost=%s, allowedOrigin=%s, origin=%s`,e.isTrusted,n,r,o,e.origin);return}if(t.type===`CLOSE_MODAL`&&this.props.closeModal(),t.type===`STOP_SCRIPT`&&this.props.stopScript(),t.type===`RERUN_SCRIPT`&&this.props.rerunScript(),t.type===`CLEAR_CACHE`&&this.props.clearCache(),t.type===`REQUEST_PAGE_CHANGE`&&this.props.pageChanged(t.pageScriptHash),t.type===`SEND_APP_HEARTBEAT`){let e=t.ackTimeoutMilliseconds,n=typeof e==`number`&&Number.isFinite(e)&&e>0?e:0;this.props.sendAppHeartbeat(n)}if(t.type===`SET_INPUTS_DISABLED`&&this.props.setInputsDisabled(t.disabled),t.type===`SET_AUTH_TOKEN`&&this.deferredAuthToken.resolve(t.authToken),t.type===`SET_FILE_UPLOAD_CLIENT_CONFIG`){let{prefix:e,headers:n}=t;this.props.fileUploadClientConfigChanged({prefix:e,headers:n})}t.type===`SET_IS_OWNER`&&this.props.isOwnerChanged(t.isOwner),t.type===`SET_MENU_ITEMS`&&this.props.hostMenuItemsChanged(t.items),t.type===`SET_METADATA`&&this.props.deployedAppMetadataChanged(t.metadata),t.type===`SET_PAGE_LINK_BASE_URL`&&this.props.pageLinkBaseUrlChanged(t.pageLinkBaseUrl),t.type===`SET_SIDEBAR_CHEVRON_DOWNSHIFT`&&this.props.sidebarChevronDownshiftChanged(t.sidebarChevronDownshift),t.type===`SET_SIDEBAR_NAV_VISIBILITY`&&this.props.hostHideSidebarNavChanged(t.hidden),t.type===`SET_TOOLBAR_ITEMS`&&this.props.hostToolbarItemsChanged(t.items),t.type===`UPDATE_FROM_QUERY_PARAMS`&&(this.props.queryParamsChanged(t.queryParams),this.props.send
22RerunBackMsg()),t.type===`UPDATE_HASH`&&(window.location.hash=t.hash),t.type===`SET_CUSTOM_THEME_CONFIG`&&this.props.themeChanged(t.themeName,t.themeInfo),t.type===`RESTART_WEBSOCKET_CONNECTION`&&this.props.restartWebsocketConnection(),t.type===`TERMINATE_WEBSOCKET_CONNECTION`&&this.props.terminateWebsocketConnection(),t.type===`PRINT_APP`&&this.props.printApp()},this.props=e,this.allowedOrigins=[],this.deferredAuthToken=Promise.withResolvers()}buildVersionedMessage(e){return{stCommVersion:1,...e}}postMessageToParentAndEcho(e,t){let n=this.buildVersionedMessage(e);if(window!==window.parent){let e={...n,[_g]:!0};window.postMessage(e,`/`)}window.parent.postMessage(n,t)}},bg=class{get current(){if(!this._current)throw Error(`Tried to use SessionInfo before it was initialized`);return this._current}get last(){return this._last}setCurrent(e){this._last=R(this._current)?{...this._current}:void 0,this._current=R(e)?{...e}:void 0}disconnect(){this._current&&this.setCurrent({...this._current,isConnected:!1})}get isSet(){return R(this._current)}get isHello(){return R(this._current)&&this._current.isHello}static propsFromNewSessionMessage(e){let t=e.initialize,n=e.config,r=t.userInfo,i=t.environmentInfo;return{appId:Ne(r.installationIdV3+e.mainScriptPath),sessionId:t.sessionId,streamlitVersion:i.streamlitVersion,pythonVersion:i.pythonVersion,serverOS:i.serverOs,hasDisplay:i.hasDisplay,installationId:r.installationId,installationIdV3:r.installationIdV3,installationIdV4:r.installationIdV4,maxCachedMessageAge:n.maxCachedMessageAge,isHello:t.isHello,isConnected:!0}}},xg=e=>_(`html{font-size:`,e.fontSizes.baseFontSize,`px;}@media print{html{height:100%;print-color-adjust:exact;-webkit-print-color-adjust:exact;}}*,*::before,*::after{box-sizing:border-box;}body{margin:0;font-family:`,e.genericFonts.bodyFont,`;font-weight:`,e.fontWeights.normal,`;line-height:`,e.lineHeights.base,`;color:`,e.colors.bodyText,`;background-color:`,e.colors.bgColor,`;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:`,fe(e.colors.black,1),`;-webkit-font-smoothing:auto;}body.embedded{overflow:hidden;}body.embedded:hover{overflow:auto;}[tabindex="-1"]:focus:not(:focus-visible){outline:0 !important;}p,ol,ul,dl{margin:0 0 1rem 0;padding:0;font-size:1rem;font-weight:`,e.fontWeights.normal,`;}ol ol,ul ul,ol ul,ul ol{margin-bottom:0;}a:not([href]):not([class]){&,&:hover{color:inherit;text-decoration:none;}}img,svg{vertical-align:middle;}input,button,select,optgroup,textarea{margin:0;font-family:inherit;line-height:inherit;font-size:inherit;}button,input{overflow:visible;}button,[role="button"]{&:not(:disabled){cursor:pointer;}}button,[type="button"],[type="reset"],[type="submit"]{-webkit-appearance:button;}[hidden]{display:none !important;}@supports (scrollbar-color:transparent transparent){*{scrollbar-width:thin;scrollbar-color:transparent transparent;}*:hover{scrollbar-color:`,e.colors.fadedText40,` transparent;}}@supports not (scrollbar-color:transparent transparent){::-webkit-scrollbar{background:transparent;border-radius:`,e.radii.full,`;height:6px;width:6px;}::-webkit-scrollbar:active{background:`,e.colors.fadedText10,`;}:hover::-webkit-scrollbar-thumb:vertical,:hover::-webkit-scrollbar-thumb:horizontal{background:`,e.colors.fadedText40,`;border-radius:`,e.radii.full,`;}}`),Sg=document.currentScript?.nonce||``,Cg=p({key:`st-emotion-cache`,...Sg&&{nonce:Sg}});function wg(e){let{children:t,theme:n}=e;return s(l,{value:Cg,children:a(c,{theme:n.emotion,children:[s(v,{styles:[xg]}),t]})})}function Tg(e){return e instanceof Error?e:Error(`${e}`)}var Eg=(e,t,n)=>performance.measure(e,t,n),Dg=e=>performance.mark(e),Og=Symbol.for(`immer-nothing`),kg=Symbol.for(`immer-draftable`),Y=Symbol.for(`immer-state`);function Ag(e,...t){throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var jg=Object,Mg=jg.getPrototypeOf,Ng=`constructor`,Pg=`prototype`,Fg=`configurable`,Ig=`enumerable`,Lg=`writable`,Rg=`value`,zg=e=>!!e&&!!e[Y];function Bg(e){return e?Ug(e)||Xg(e)||!!e[kg]||!!e[Ng]?.[kg]||Zg(e)||Qg(e):!1}var Vg=jg[Pg][Ng].toString(),Hg=new WeakMap;function Ug(e){if(!e||!$g(e))return!1;let t=Mg(e);
vendor: 9,037 bytes, line 22
22if(t===null||t===jg[Pg])return!0;let n=jg.hasOwnProperty.call(t,Ng)&&t[Ng];if(n===Object)return!0;if(!e_(n))return!1;let r=Hg.get(n);return r===void 0&&(r=Function.toString.call(n),Hg.set(n,r)),r===Vg}function Wg(e,t,n=!0){Gg(e)===0?(n?Reflect.ownKeys(e):jg.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function Gg(e){let t=e[Y];return t?t.type_:Xg(e)?1:Zg(e)?2:Qg(e)?3:0}var Kg=(e,t,n=Gg(e))=>n===2?e.has(t):jg[Pg].hasOwnProperty.call(e,t),qg=(e,t,n=Gg(e))=>n===2?e.get(t):e[t],Jg=(e,t,n,r=Gg(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function Yg(e,t){return e===t?e!==0||1/e==1/t:e!==e&&t!==t}var Xg=Array.isArray,Zg=e=>e instanceof Map,Qg=e=>e instanceof Set,$g=e=>typeof e==`object`,e_=e=>typeof e==`function`,t_=e=>typeof e==`boolean`;function n_(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var r_=e=>$g(e)?e?.[Y]:null,X=e=>e.copy_||e.base_,i_=e=>{let t=r_(e);return t?a_(t):e},a_=e=>e.modified_?e.copy_:e.base_;function o_(e,t){if(Zg(e))return new Map(e);if(Qg(e))return new Set(e);if(Xg(e))return Array[Pg].slice.call(e);let n=Ug(e);if(t===!0||t===`class_only`&&!n){let t=jg.getOwnPropertyDescriptors(e);delete t[Y];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){let i=n[r],a=t[i];a[Lg]===!1&&(a[Lg]=!0,a[Fg]=!0),(a.get||a.set)&&(t[i]={[Fg]:!0,[Lg]:!0,[Ig]:a[Ig],[Rg]:e[i]})}return jg.create(Mg(e),t)}{let t=Mg(e);if(t!==null&&n)return{...e};let r=jg.create(t);return jg.assign(r,e)}}function s_(e,t=!1){return u_(e)||zg(e)||!Bg(e)?e:(Gg(e)>1&&jg.defineProperties(e,{set:l_,add:l_,clear:l_,delete:l_}),jg.freeze(e),t&&Wg(e,(e,t)=>{s_(t,!0)},!1),e)}function c_(){Ag(2)}var l_={[Rg]:c_};function u_(e){return e===null||!$g(e)||jg.isFrozen(e)}var d_=`MapSet`,f_=`Patches`,p_=`ArrayMethods`,m_={};function h_(e){let t=m_[e];return t||Ag(0,e),t}var g_=e=>!!m_[e];function __(e,t){m_[e]||(m_[e]=t)}var v_,y_=()=>v_,b_=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:g_(d_)?h_(d_):void 0,arrayMethodsPlugin_:g_(p_)?h_(p_):void 0});function x_(e,t){t&&(e.patchPlugin_=h_(f_),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function S_(e){C_(e),e.drafts_.forEach(T_),e.drafts_=null}function C_(e){e===v_&&(v_=e.parent_)}var w_=e=>v_=b_(v_,e);function T_(e){let t=e[Y];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function E_(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];if(e!==void 0&&e!==n){n[Y].modified_&&(S_(t),Ag(4)),Bg(e)&&(e=D_(t,e));let{patchPlugin_:r}=t;r&&r.generateReplacementPatches_(n[Y].base_,e,t)}else e=D_(t,n);return O_(t,e,!0),S_(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e===Og?void 0:e}function D_(e,t){if(u_(t))return t;let n=t[Y];if(!n)return I_(t,e.handledSet_,e);if(!A_(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){let{callbacks_:t}=n;if(t)for(;t.length>0;)t.pop()(e);P_(n,e)}return n.copy_}function O_(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&s_(t,n)}function k_(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var A_=(e,t)=>e.scope_===t,j_=[];function M_(e,t,n,r){let i=X(e),a=e.type_;if(r!==void 0&&qg(i,r,a)===t){Jg(i,r,n,a);return}if(!e.draftLocations_){let t=e.draftLocations_=new Map;Wg(i,(e,n)=>{if(zg(n)){let r=t.get(n)||[];r.push(e),t.set(n,r)}})}let o=e.draftLocations_.get(t)??j_;for(let e of o)Jg(i,e,n,a)}function N_(e,t,n){e.callbacks_.push(function(r){let i=t;if(!i||!A_(i,r))return;r.mapSetPlugin_?.fixSetContents(i);let a=a_(i);M_(e,i.draft_??i,a,n),P_(i,r)})}function P_(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:n}=t;if(n){let r=n.getPath(e);r&&n.generatePatches_(e,r,t)}k_(e)}}function F_(e,t,n){let{scope_:r}=e;if(zg(n)){let i=n[Y];A_(i,r)&&i.callbacks_.push(function(){G_(e),M_(e,n,a_(i),t)})}else Bg(n)&&e.callbacks_.push(function(){let i=X(e);e.type_===3?i.has(n)&&I_(n,r.handledSet_,r):qg(i,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&I_(qg(e.copy_,t,e.type_),r.handledSet_,r)})}function I_(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||zg(e)||t.has(e)||!Bg(e)||u_(e)?e:(t.add(e),Wg(e,(r,i)=>{if(zg(i)){let t=i[Y];A_(t,n)&&(Jg(e,r,a_(t),e.type_),k_(t))}else Bg(i)&&I_(i,t,n)}),e)}function L_(e,t){let n=Xg(e),r={type_:+!!n,scope_:t?t.scope_:y_(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},i=r,a=R_;n&&(i=[r],a=z_);let{revoke:o,proxy:s}=Proxy.revocable(i,a);return r.draft_=s,r.revoke_=o,[s,r]}var R_={get(e,t){if(t===Y)return e;let n=e.scope_.arrayMethodsPlugin_,r=e.type_===1&&typeof t==`string`;if(r&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);let i=X(e);if(!Kg(i,t,e.type_))return H_(e,i,t);let a=i[t];if(e.finalized_||!Bg(a)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&n_(t))return a;if(a===B_(e.base_,t)||V_(e,t,a)){G_(e);let n=e.type_===1?+t:t,r=q_(e.scope_,a,e,n);return e.copy_[n]=r}return a},has(e,t){return t in X(e)},ownKeys(e){return Reflect.ownKeys(X(e))},set(e,t,n){let r=U_(X(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){let r=B_(X(e),t),i=r?.[Y];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(Yg(n,r)&&(n!==void 0||Kg(e.base_,t,e.type_)))return!0;G_(e),W_(e)}return e.copy_[t]===n&&(n!==void 0||Kg(e.copy_,t,e.type_))||Number.isNaN(n)&&Number.isNaN(e.copy_[t])?!0:(e.copy_[t]=n,e.assigned_.set(t,!0),F_(e,t,n),!0)},deleteProperty(e,t){return G_(e),B_(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),W_(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let n=X(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[Lg]:!0,[Fg]:e.type_!==1||t!==`length`,[Ig]:r[Ig],[Rg]:n[t]}},defineProperty(){Ag(11)},getPrototypeOf(e){return Mg(e.base_)},setPrototypeOf(){Ag(12)}},z_={};for(let e in R_){let t=R_[e];z_[e]=function(){let e=arguments;return e[0]=e[0][0],t.apply(this,e)}}z_.deleteProperty=function(e,t){return z_.set.call(this,e,t,void 0)},z_.set=function(e,t,n){return R_.set.call(this,e[0],t,n,e[0])};function B_(e,t){let n=e[Y];return(n?X(n):e)[t]}function V_(e,t,n){return e.type_!==1||!e.allIndicesReassigned_||e.assigned_?.get(t)||!Bg(n)||n[Y]?!1:e.baseRefs_.has(n)}function H_(e,t,n){let r=U_(t,n);return r?Rg in r?r[Rg]:r.get?.call(e.draft_):void 0}function U_(e,t){if(!(t in e))return;let n=Mg(e);for(;n;){let e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=Mg(n)}}function W_(e){e.modified_||(e.modified_=!0,e.parent_&&W_(e.parent_))}function G_(e){e.copy_||=(e.assigned_=new Map,o_(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var K_=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,n)=>{if(e_(e)&&!e_(t)){let n=t;t=e;let r=this;return function(e=n,...i){return r.produce(e,e=>t.call(this,e,...i))}}e_(t)||Ag(6),n!==void 0&&!e_(n)&&Ag(7);let r;if(Bg(e)){let i=w_(this),a=q_(i,e,void 0),o=!0;try{r=t(a),o=!1}finally{o?S_(i):C_(i)}return x_(i,n),E_(r,i)}if(!e||!$g(e)){if(r=t(e),r===void 0&&(r=e),r===Og&&(r=void 0),this.autoFreeze_&&s_(r,!0),n){let t=[],i=[];h_(f_).generateReplacementPatches_(e,r,{patches_:t,inversePatches_:i}),n(t,i)}return r}Ag(1,e)},this.produceWithPatches=(e,t)=>{if(e_(e))return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;return[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},t_(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),t_(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),t_(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){Bg(e)||Ag(8),zg(e)&&(e=J_(e));let t=w_(this),n=q_(t,e,void 0);return n[Y].isManual_=!0,C_(t),n}finishDraft(e,t){let n=e&&e[Y];(!n||!n.isManual_)&&Ag(9);let{scope_:r}=n;return x_(r,t),E_(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let r=t[n];if(r.path.length===0&&r.op===`replace`){e=r.value;break}}n>-1&&(t=t.slice(n+1));let r=h_(f_).applyPatches_;return zg(e)?r(e,t):this.produce(e,e=>r(e,t))}};function q_(e,t,n,r){let[i,a]=Zg(t)?h_(d_).proxyMap_(t,n):Qg(t)?h_(d_).proxySet_(t,n):L_(t,n);return(n?.scope_??y_()).drafts_.push(i),a.callbacks_=n?.callbacks_??[],a.key_=r,n&&r!==void 0?N_(n,a,r):a.callbacks_.push(function(e){e.mapSetPlugin_?.fixSetContents(a);let{patchPlugin_:t}=e;a.modified_&&t&&t.generatePatches_(a,[],e)}),i}function J_(e){return zg(e)||Ag(10,e),Y_(e)}function Y_(e){if(!Bg(e)||u_(e))return e;let t=e[Y],n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=o_(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=o_(e,!0);return Wg(n,(e,t)=>{Jg(n,e,Y_(t))},r),t&&(t.finalized_=!1),n}function X_(){function e(n,r=[]){if(n.key_!==void 0){let e=n.parent_.copy_??n.parent_.base_,t=r_(qg(e,n.
vendor: 6,066 bytes, line 22
22key_)),i=qg(e,n.key_);if(i===void 0||i!==n.draft_&&i!==n.base_&&i!==n.copy_||t!=null&&t.base_!==n.base_)return null;let a=n.parent_.type_===3,o;if(a){let e=n.parent_;o=Array.from(e.drafts_.keys()).indexOf(n.key_)}else o=n.key_;if(!(a&&e.size>o||Kg(e,o)))return null;r.push(o)}if(n.parent_)return e(n.parent_,r);r.reverse();try{t(n.copy_,r)}catch{return null}return r}function t(e,t){let n=e;for(let e=0;e<t.length-1;e++){let r=t[e];if(n=qg(n,r),!$g(n)||n===null)throw Error(`Cannot resolve path at '${t.join(`/`)}'`)}return n}let n=`replace`,r=`remove`;function i(e,t,n){if(e.scope_.processedForPatches_.has(e))return;e.scope_.processedForPatches_.add(e);let{patches_:r,inversePatches_:i}=n;switch(e.type_){case 0:case 2:return o(e,t,r,i);case 1:return a(e,t,r,i);case 3:return s(e,t,r,i)}}function a(e,t,i,a){let{base_:o,assigned_:s}=e,c=e.copy_;c.length<o.length&&([o,c]=[c,o],[i,a]=[a,i]);let l=e.allIndicesReassigned_===!0;for(let e=0;e<o.length;e++){let r=c[e],u=o[e];if((l||s?.get(e.toString()))&&r!==u){let o=r?.[Y];if(o&&o.modified_)continue;let s=t.concat([e]);i.push({op:n,path:s,value:d(r)}),a.push({op:n,path:s,value:d(u)})}}for(let e=o.length;e<c.length;e++){let n=t.concat([e]);i.push({op:`add`,path:n,value:d(c[e])})}for(let e=c.length-1;o.length<=e;--e){let n=t.concat([e]);a.push({op:r,path:n})}}function o(e,t,i,a){let{base_:o,copy_:s,type_:c}=e;Wg(e.assigned_,(e,l)=>{let u=qg(o,e,c),f=qg(s,e,c),p=l?Kg(o,e)?n:`add`:r;if(u===f&&p===n)return;let m=t.concat(e);i.push(p===r?{op:p,path:m}:{op:p,path:m,value:d(f)}),a.push(p===`add`?{op:r,path:m}:p===r?{op:`add`,path:m,value:d(u)}:{op:n,path:m,value:d(u)})})}function s(e,t,n,i){let{base_:a,copy_:o}=e,s=0;a.forEach(e=>{if(!o.has(e)){let a=t.concat([s]);n.push({op:r,path:a,value:e}),i.unshift({op:`add`,path:a,value:e})}s++}),s=0,o.forEach(e=>{if(!a.has(e)){let a=t.concat([s]);n.push({op:`add`,path:a,value:e}),i.unshift({op:r,path:a,value:e})}s++})}function c(e,t,r){let{patches_:i,inversePatches_:a}=r;i.push({op:n,path:[],value:t===Og?void 0:t}),a.push({op:n,path:[],value:e})}function l(e,t){return t.forEach(t=>{let{path:i,op:a}=t,o=e;for(let e=0;e<i.length-1;e++){let t=Gg(o),n=i[e];typeof n!=`string`&&typeof n!=`number`&&(n=``+n),(t===0||t===1)&&(n===`__proto__`||n===Ng)&&Ag(19),e_(o)&&n===Pg&&Ag(19),o=qg(o,n),(o===null||!$g(o))&&Ag(18,i.join(`/`))}let s=Gg(o),c=u(t.value),l=i[i.length-1];switch(a){case n:switch(s){case 2:return o.set(l,c);case 3:Ag(16);default:return o[l]=c}case`add`:switch(s){case 1:return l===`-`?o.push(c):o.splice(l,0,c);case 2:return o.set(l,c);case 3:return o.add(c);default:return o[l]=c}case r:switch(s){case 1:return o.splice(l,1);case 2:return o.delete(l);case 3:return o.delete(t.value);default:return delete o[l]}default:Ag(17,a)}}),e}function u(e){if(!Bg(e))return e;if(Xg(e))return e.map(u);if(Zg(e))return new Map(Array.from(e.entries()).map(([e,t])=>[e,u(t)]));if(Qg(e))return new Set(Array.from(e).map(u));let t=Object.create(Mg(e));for(let n in e)t[n]=u(e[n]);return Kg(e,kg)&&(t[kg]=e[kg]),t}function d(e){return zg(e)?u(e):e}__(f_,{applyPatches_:l,generatePatches_:i,generateReplacementPatches_:c,getPath:e})}var Z_=globalThis.Iterator,Q_=typeof Z_?.from==`function`;function $_(){class e extends Map{constructor(e,t){super(),this[Y]={type_:2,parent_:t,scope_:t?t.scope_:y_(),modified_:!1,finalized_:!1,copy_:void 0,assigned_:void 0,base_:e,draft_:this,isManual_:!1,revoked_:!1,callbacks_:[]}}get size(){return X(this[Y]).size}has(e){return X(this[Y]).has(e)}set(e,t){let n=this[Y];return s(n),(!X(n).has(e)||X(n).get(e)!==t)&&(r(n),W_(n),n.assigned_.set(e,!0),n.copy_.set(e,t),n.assigned_.set(e,!0),F_(n,e,t)),this}delete(e){if(!this.has(e))return!1;let t=this[Y];return s(t),r(t),W_(t),t.base_.has(e)?t.assigned_.set(e,!1):t.assigned_.delete(e),t.copy_.delete(e),!0}clear(){let e=this[Y];s(e),X(e).size&&(r(e),W_(e),e.assigned_=new Map,Wg(e.base_,t=>{e.assigned_.set(t,!1)}),e.copy_.clear())}forEach(e,t){let n=this[Y];X(n).forEach((n,r,i)=>{e.call(t,this.get(r),r,this)})}get(e){let t=this[Y];s(t);let n=X(t).get(e);if(t.finalized_||!Bg(n)||n!==t.base_.get(e))return n;let i=q_(t.scope_,n,t,e);return r(t),t.copy_.set(e,i),i}keys(){return X(this[Y]).keys()}values(){let e=this.keys();return t({next:()=>{let t=e.next();return t.done?t:{done:!1,value:this.get(t.value)}}})}entries(){let e=this.keys();return t({next:()=>{let t=e.next();if(t.done)return t;let n=this.get(t.value);return{done:!1,value:[t.value,n]}}})}[Symbol.iterator](){return this.entries()}}function t(e){if(Q_)return Z_.from(e);let t={...e,[Symbol.iterator]:()=>t};return t}function n(t,n){let r=new e(t,n);return[r,r[Y]]}function r(e){e.copy_||=(e.assigned_=new Map,new Map(e.base_))}class i extends Set{constructor(e,t){super(),this[Y]={type_:3,parent_:t,scope_:t?t.scope_:y_(),modified_:!1,finalized_:!1,copy_:void 0,base_:e,draft_:this,drafts_:new Map,revoked_:!1,isManual_:!1,assigned_:void 0,callbacks_:[]}}get size(){return X(this[Y]).size}has(e){let t=this[Y];return s(t),t.copy_?!!(t.copy_.has(e)||t.drafts_.has(e)&&t.copy_.has(t.drafts_.get(e))):t.base_.has(e)}add(e){let t=this[Y];return s(t),this.has(e)||(o(t),W_(t),t.copy_.add(e),F_(t,e,e)),this}delete(e){if(!this.has(e))return!1;let t=this[Y];return s(t),o(t),W_(t),t.copy_.delete(e)||(t.drafts_.has(e)?t.copy_.delete(t.drafts_.get(e)):!1)}clear(){let e=this[Y];s(e),X(e).size&&(o(e),W_(e),e.copy_.clear())}values(){let e=this[Y];return s(e),o(e),e.copy_.values()}entries(){let e=this[Y];return s(e),o(e),e.copy_.entries()}keys(){return this.values()}[Symbol.iterator](){return this.values()}forEach(e,t){let n=this.values(),r=n.next();for(;!r.done;)e.call(t,r.value,r.value,this),r=n.next()}}function a(e,t){let n=new i(e,t);return[n,n[Y]]}function o(e){e.copy_||(e.copy_=new Set,e.base_.forEach(t=>{if(Bg(t)){let n=q_(e.scope_,t,e,t);e.drafts_.set(t,n),e.copy_.add(n)}else e.copy_.add(t)}))}function s(e){e.revoked_&&Ag(3,JSON.stringify(X(e)))}function c(e){if(e.type_===3&&e.copy_){let t=new Set(e.copy_);e.copy_.clear(),t.forEach(t=>{e.copy_.add(i_(t))})}}__(d_,{proxyMap_:n,proxySet_:a,fixSetContents:c})}
22var ev=new K_().produce,tv=e(C(),1),nv=RegExp(`(%[a-f0-9]{2})+`,`gi`),rv=/^[a-f\d]{2}$/i;function iv(e,t){if(e.codePointAt(t)!==37||t+3>e.length)return;let n=e.slice(t+1,t+3);if(rv.test(n))return{byte:Number.parseInt(n,16),next:t+3}}function av(e){return e<=127?1:e>=194&&e<=223?2:e>=224&&e<=239?3:e>=240&&e<=244?4:0}function ov(e){return e>=128&&e<=191}function sv(e){try{return decodeURIComponent(e)}catch{let t=``,n=0;for(;n<e.length;){if(e.codePointAt(n)!==37){t+=e.charAt(n),n++;continue}let r=iv(e,n);if(!r){t+=e.charAt(n),n++;continue}let i=av(r.byte);if(i===0){t+=e.slice(n,n+3),n+=3;continue}let a=r.next,o=!0;for(let t=1;t<i;t++){let t=iv(e,a);if(!t||!ov(t.byte)){o=!1;break}a=t.next}if(o){let r=e.slice(n,a);try{t+=decodeURIComponent(r),n=a;continue}catch{}}t+=e.slice(n,n+3),n+=3}return t}}function cv(e){let t={"%FE%FF":`��`,"%FF%FE":`��`},n=nv.exec(e);for(;n;){try{t[n[0]]=decodeURIComponent(n[0])}catch{let e=sv(n[0]);e!==n[0]&&(t[n[0]]=e)}n=nv.exec(e)}t[`%C2`]=`�`;let r=Object.keys(t);for(let n of r)e=e.replace(new RegExp(n,`g`),t[n]);return e}function lv(e){if(typeof e!=`string`)throw TypeError(`Expected \`encodedURI\` to be of type \`string\`, got \`${typeof e}\``);try{return decodeURIComponent(e)}catch{return cv(e)}}function uv(e,t){let n={};if(Array.isArray(t))for(let r of t){let t=Object.getOwnPropertyDescriptor(e,r);t?.enumerable&&Object.defineProperty(n,r,t)}else for(let r of Reflect.ownKeys(e)){let i=Object.getOwnPropertyDescriptor(e,r);if(i.enumerable){let a=e[r];t(r,a,e)&&Object.defineProperty(n,r,i)}}return n}function dv(e,t){if(typeof e!=`string`||typeof t!=`string`)throw TypeError("Expected the arguments to be of type `string`");if(e===``||t===``)return[];let n=e.indexOf(t);return n===-1?[]:[e.slice(0,n),e.slice(n+t.length)]}var fv=t({exclude:()=>jv,extract:()=>Tv,parse:()=>Ev,parseUrl:()=>Ov,pick:()=>Av,stringify:()=>Dv,stringifyUrl:()=>kv}),pv=e=>e==null,mv=e=>encodeURIComponent(e).replaceAll(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),hv=Symbol(`encodeFragmentIdentifier`);function gv(e){switch(e.arrayFormat){case`index`:return t=>(n,r)=>{let i=n.length;return r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===``?n:r===null?(n.push([Z(t,e),`[`,i,`]`].join(``)),n):(n.push([Z(t,e),`[`,Z(i,e),`]=`,Z(r,e)].join(``)),n)};case`bracket`:return t=>(n,r)=>r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===``?n:r===null?(n.push([Z(t,e),`[]`].join(``)),n):(n.push([Z(t,e),`[]=`,Z(r,e)].join(``)),n);case`colon-list-separator`:return t=>(n,r)=>r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===``?n:r===null?(n.push([Z(t,e),`:list=`].join(``)),n):(n.push([Z(t,e),`:list=`,Z(r,e)].join(``)),n);case`comma`:case`separator`:case`bracket-separator`:{let t=e.arrayFormat===`bracket-separator`?`[]=`:`=`;return n=>(r,i)=>i===void 0||e.skipNull&&i===null||e.skipEmptyString&&i===``?r:(i=i===null?``:i,r.length===0?(r.push([Z(n,e),t,Z(i,e)].join(``)),r):(r.push(Z(i,e)),r))}default:return t=>(n,r)=>r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===``?n:r===null?(n.push(Z(t,e)),n):(n.push([Z(t,e),`=`,Z(r,e)].join(``)),n)}}function _v(e){let t;switch(e.arrayFormat){case`index`:return(e,n,r)=>{if(t=/\[(\d*)]$/.exec(e),e=e.replace(/\[\d*]$/,``),!t){r[e]=n;return}r[e]===void 0&&(r[e]={}),r[e][t[1]]=n};case`bracket`:return(e,n,r)=>{if(t=/(\[])$/.exec(e),e=e.replace(/\[]$/,``),!t){r[e]=n;return}if(r[e]===void 0){r[e]=[n];return}if(!Array.isArray(r[e])){r[e]=[r[e],n];return}r[e].push(n)};case`colon-list-separator`:return(e,n,r)=>{if(t=/(:list)$/.exec(e),e=e.replace(/:list$/,``),!t){r[e]=n;return}if(r[e]===void 0){r[e]=[n];return}if(!Array.isArray(r[e])){r[e]=[r[e],n];return}r[e].push(n)};case`comma`:case`separator`:return(t,n,r)=>{r[t]=typeof n==`string`&&n.includes(e.arrayFormatSeparator)?n.split(e.arrayFormatSeparator).map(t=>yv(t,e)):n===null?n:yv(n,e)};case`bracket-separator`:return(t,n,r)=>{let i=/(\[])$/.test(t);if(t=t.replace(/\[]$/,``),!i){r[t]=n&&yv(n,e);return}let a=n===null?[]:yv(n,e).split(e.arrayFormatSeparator);if(r[t]===void 0){r[t]=a;return}Array.isArray(r[t])||(r[t]=[r[t]]);for(let e of a)r[t].push(e)};default:return(e,t,n)=>{if(n[e]===void 0){n[e]=t;return}if(Array.isArray(n[e])){n[e].push(t);return}n[e]=[n[e],t]}}}function vv(e){if(typeof e!=`string`||e.length!==1)throw TypeError(`arrayFormatSeparator must be single character string`)}function Z(e,t){return t.encode?t.strict?mv(e):encodeURIComponent(e):e}function yv(e,t){return t.decode?lv(e):e}function bv(e){return Array.isArray(e)?e.sort():typeof e==`object`?bv(Object.keys(e)).sort((e,t)=>
22Number(e)-Number(t)).map(t=>e[t]):e}function xv(e){let t=e.indexOf(`#`);return t!==-1&&(e=e.slice(0,t)),e}function Sv(e){let t=``,n=e.indexOf(`#`);return n!==-1&&(t=e.slice(n)),t}function Cv(e){let t=e.indexOf(`?`);return t===-1?e:e.slice(0,t)}function wv(e,t,n){return n===`string`&&typeof e==`string`?e:typeof n==`function`&&typeof e==`string`?n(e):n===`boolean`&&e===null?!0:n===`boolean`&&e!==null&&(e.toLowerCase()===`true`||e.toLowerCase()===`false`)?e.toLowerCase()===`true`:n===`boolean`&&e!==null&&(e.toLowerCase()===`1`||e.toLowerCase()===`0`)?e.toLowerCase()===`1`:n===`string[]`&&t.arrayFormat!==`none`&&typeof e==`string`?[e]:n===`number[]`&&t.arrayFormat!==`none`&&!Number.isNaN(Number(e))&&typeof e==`string`&&e.trim()!==``?[Number(e)]:n===`number`&&!Number.isNaN(Number(e))&&typeof e==`string`&&e.trim()!==``?Number(e):t.parseBooleans&&e!==null&&(e.toLowerCase()===`true`||e.toLowerCase()===`false`)?e.toLowerCase()===`true`:t.parseNumbers&&!Number.isNaN(Number(e))&&typeof e==`string`&&e.trim()!==``?Number(e):e}function Tv(e){e=xv(e);let t=e.indexOf(`?`);return t===-1?``:e.slice(t+1)}function Ev(e,t){t={decode:!0,sort:!0,arrayFormat:`none`,arrayFormatSeparator:`,`,parseNumbers:!1,parseBooleans:!1,types:Object.create(null),...t},vv(t.arrayFormatSeparator);let n=_v(t),r=Object.create(null);if(typeof e!=`string`||(e=e.trim().replace(/^[?#&]/,``),!e)||/^&+$/.test(e))return r;let i=0,a=e.indexOf(`&`);a===-1&&(a=e.length);for(let o=a;o<=e.length;o++){if(o<e.length&&e[o]!==`&`)continue;if(o===i){i=o+1;continue}let a=e.slice(i,o),s=t.decode?a.replaceAll(`+`,` `):a,[c,l]=dv(s,`=`);c===void 0&&(c=s),l=l===void 0?null:[`comma`,`separator`,`bracket-separator`].includes(t.arrayFormat)?l:yv(l,t),n(yv(c,t),l,r),i=o+1}for(let[e,n]of Object.entries(r))if(typeof n==`object`&&n&&t.types[e]!==`string`)for(let[r,i]of Object.entries(n)){let a=t.types[e],o=typeof a==`function`?a:a?a.replace(`[]`,``):void 0;n[r]=wv(i,t,o)}else r[e]=typeof n==`object`&&n&&t.types[e]===`string`?Object.values(n).join(t.arrayFormatSeparator):wv(n,t,t.types[e]);return t.sort===!1?r:(t.sort===!0?Object.keys(r).sort():Object.keys(r).sort(t.sort)).reduce((e,t)=>{let n=r[t];return e[t]=n&&typeof n==`object`&&!Array.isArray(n)?bv(n):n,e},Object.create(null))}function Dv(e,t){if(!e)return``;t={encode:!0,strict:!0,arrayFormat:`none`,arrayFormatSeparator:`,`,...t},vv(t.arrayFormatSeparator);let n=n=>t.skipNull&&pv(e[n])||t.skipEmptyString&&e[n]===``,r=gv(t),i={};for(let[t,r]of Object.entries(e))n(t)||(i[t]=r);let a=Object.keys(i);return t.sort!==!1&&a.sort(t.sort),a.map(n=>{let i=e[n];if(t.replacer&&(i=t.replacer(n,i),i===void 0)||i===void 0)return``;if(i===null)return Z(n,t);if(Array.isArray(i)){if(i.length===0&&t.arrayFormat===`bracket-separator`)return Z(n,t)+`[]`;let e=i;t.replacer&&(e=i.map((e,r)=>t.replacer(`${n}[${r}]`,e)).filter(e=>e!==void 0));let a=e.reduce(r(n),[]),o=[`comma`,`separator`,`bracket-separator`].includes(t.arrayFormat)?t.arrayFormatSeparator:`&`;return a.join(o)}return Z(n,t)+`=`+Z(i,t)}).filter(e=>e.length>0).join(`&`)}function Ov(e,t){t={decode:!0,...t};let[n,r]=dv(e,`#`);return n===void 0&&(n=e),{url:Cv(n??``),query:Ev(Tv(e),t),...t&&t.parseFragmentIdentifier&&r?{fragmentIdentifier:yv(r,t)}:{}}}function kv(e,t){t={encode:!0,strict:!0,[hv]:!0,...t};let n=Cv(xv(e.url))||``,r=Dv({...Ev(Tv(e.url),{sort:!1,...t}),...e.query},t);r&&=`?${r}`;let i=Sv(e.url);if(typeof e.fragmentIdentifier==`string`&&(i=`#${e.fragmentIdentifier}`,t[hv])){let e=new URL(`https://query-string.invalid`);e.hash=i,i=e.hash}return`${n}${r}${i}`}function Av(e,t,n){n={parseFragmentIdentifier:!0,[hv]:!1,...n};let{url:r,query:i,fragmentIdentifier:a}=Ov(e,n);return kv({url:r,query:uv(i,t),fragmentIdentifier:a},n)}function jv(e,t,n){if(Array.isArray(t)){let r=new Set(t);return Av(e,e=>!r.has(e),n)}return Av(e,(e,n)=>!t(e,n),n)}var Mv=fv,Nv=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Collector=void 0,e.Collector=class{constructor(e){this.emit=(...t)=>{e.emitCollecting(this,t)}}}})),Pv=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CollectorArray=void 0;var t=Nv();e.CollectorArray=class extends t.Collector{constructor(){super(...arguments),this.result=[]}handleResult(e){return this.result.push(e),!0}getResult(){return this.result}reset(){this.result.length=0}}})),Fv=n((e=>
22{Object.defineProperty(e,"__esModule",{value:!0}),e.CollectorLast=void 0;var t=Nv();e.CollectorLast=class extends t.Collector{handleResult(e){return this.result=e,!0}getResult(){return this.result}reset(){delete this.result}}})),Iv=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CollectorUntil0=void 0;var t=Nv();e.CollectorUntil0=class extends t.Collector{constructor(){super(...arguments),this.result=!1}handleResult(e){return this.result=e,this.result}getResult(){return this.result}reset(){this.result=!1}}})),Lv=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CollectorWhile0=void 0;var t=Nv();e.CollectorWhile0=class extends t.Collector{constructor(){super(...arguments),this.result=!1}handleResult(e){return this.result=e,!this.result}getResult(){return this.result}reset(){this.result=!1}}})),Rv=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SignalConnectionImpl=void 0,e.SignalConnectionImpl=class{constructor(e){this.link=e}disconnect(){return this.link.unlink()}set enabled(e){this.link.setEnabled(e)}get enabled(){return this.link.isEnabled()}}})),zv=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SignalLink=void 0,e.SignalLink=class e{constructor(e,t,n){this.enabled=!0,this.newLink=!1,this.prev=e??this,this.next=t??this,this.order=n.order,this.isPublic=n.isPublic,this.callback=n.callback,this.onUnlink=n.onUnlink}isEnabled(){return this.enabled&&!this.newLink}setEnabled(e){this.enabled=e}unlink(){return this.callback?(delete this.callback,this.next.prev=this.prev,this.prev.next=this.next,this.onUnlink(),!0):!1}insert(t){let{order:n}=t,r=this.prev;for(;r!==this&&!(r.order<=n);)r=r.prev;let i=new e(r,r.next,t);return r.next=i,i.next.prev=i,i}}})),Bv=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Signal=void 0;var t=Rv(),n=zv(),r={order:0,isPublic:!0,onUnlink(){}};e.Signal=class{constructor(){this.head=new n.SignalLink(null,null,r),this.hasNewLinks=!1,this.emitDepth=0,this.connectionsCount=0,this.onUnlink=()=>{this.connectionsCount--}}getConnectionsCount(){return this.connectionsCount}hasConnections(){return this.connectionsCount>0}connect(e,{order:n=0,isPublic:r=!0}={}){this.connectionsCount++;let i=this.head.insert({callback:e,order:n,isPublic:r,onUnlink:this.onUnlink});return this.emitDepth>0&&(this.hasNewLinks=!0,i.newLink=!0),new t.SignalConnectionImpl(i)}disconnect(e){for(let t=this.head.next;t!==this.head;t=t.next)if(t.callback===e)return t.unlink(),!0;return!1}disconnectAll(){let{next:e}=this.head;for(;e!==this.head;)e.isPublic&&e.unlink(),e=e.next}emit(...e){this.emitDepth++;for(let t=this.head.next;t!==this.head;t=t.next)t.isEnabled()&&t.callback&&t.callback.apply(null,e);this.emitDepth--,this.unsetNewLink()}emitCollecting(e,t){this.emitDepth++;for(let n=this.head.next;n!==this.head;n=n.next)if(n.isEnabled()&&n.callback){let r=n.callback.apply(null,t);if(!e.handleResult(r))break}this.emitDepth--,this.unsetNewLink()}unsetNewLink(){if(this.hasNewLinks&&this.emitDepth===0){for(let e=this.head.next;e!==this.head;e=e.next)e.newLink=!1;this.hasNewLinks=!1}}}})),Vv=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SignalConnections=void 0,e.SignalConnections=class{constructor(){this.list=[]}add(e){this.list.push(e)}disconnectAll(){for(let e of this.list)e.disconnect();this.list=[]}getCount(){return this.list.length}isEmpty(){return this.list.length===0}}})),Hv=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SignalConnections=e.Signal=e.CollectorWhile0=e.CollectorUntil0=e.CollectorLast=e.CollectorArray=e.Collector=void 0;var t=Nv();Object.defineProperty(e,"Collector",{enumerable:!0,get:function(){return t.Collector}});var n=Pv();Object.defineProperty(e,"CollectorArray",{enumerable:!0,get:function(){return n.CollectorArray}});var r=Fv();Object.defineProperty(e,"CollectorLast",{enumerable:!0,get:function(){return r.CollectorLast}});var i=Iv();Object.defineProperty(e,"CollectorUntil0",{enumerable:!0,get:function(){return i.CollectorUntil0}});var a=Lv();Object.defineProperty(e,"CollectorWhile0",{enumerable:!0,get:function(){return a.CollectorWhile0}});var o=Bv();Object.defineProperty(e,"Signal",{enumerable:!0,get:function(){return o.Signal}});var s=Vv();Object.defineProperty(e,"SignalConnections",{enumerable:!0,get:function(){return s.SignalConnections}})}))();function Uv(e){return e.triggerRerun??e.fromUser}function Wv(){return{formsWithPendingChanges:new Set,formsWithUploads:new Set,submitButtons:new Map}}var Gv=(0,yi.getLogger)(`WidgetStateManager`);function Kv(e,t){let n=new Date(e/1e3).toISOString();switch(t){case`date`:return n.slice(0,10);case`time`:{let e=n.slice(11,19);return e.endsWith(`:00`)?e.slice(0,5):e}case`datetime`:return n.slice(17,19)===`00`?n.slice(0,16):n.slice(0,19)}}var qv=class{constructor(){this.widgetStates=new Map}createState(e){let t=new ee({id:e});return this.widgetStates.set(e,t),t}getState(e){return this.widgetStates.get(e)}deleteState(e){this.widgetStates.delete(e)}
22removeInactive(e){this.widgetStates.forEach((t,n)=>{e.has(n)||this.widgetStates.delete(n)})}clear(){this.widgetStates.clear()}get isEmpty(){return this.widgetStates.size===0}createWidgetStatesMsg(){let e=new j;return this.widgetStates.forEach(t=>e.widgets.push(t)),e}copyFrom(e){e.widgetStates.forEach((e,t)=>{this.widgetStates.set(t,e)})}forEach(e){this.widgetStates.forEach(e)}},Jv=class{constructor(){this.widgetStates=new qv,this.submitValidators=new Map,this.clearOnSubmit=!1,this.enterToSubmit=!0,this.formCleared=new Hv.Signal}get hasPendingChanges(){return!this.widgetStates.isEmpty}},Yv=class{constructor(e){this.widgetStates=new qv,this.forms=new Map,this.elementStates=new Map,this.pendingTriggerIds=new Set,this.triggerFlushResolvers=[],this.flushScheduled=!1,this.hasFragmentIdConflict=!1,this.boundWidgets=new Map,this.paramKeyToWidgetId=new Map,this.props=e,this.formsData=Wv()}addFormClearedListener(e,t){return this.getOrCreateFormState(e).formCleared.connect(t)}setFormSubmitBehaviors(e,t,n=!0){let r=this.getOrCreateFormState(e);r.clearOnSubmit=t,r.enterToSubmit=n}addFormSubmitValidator(e,t,n){this.getOrCreateFormState(e).submitValidators.set(t,n)}removeFormSubmitValidator(e,t){this.forms.get(e)?.submitValidators.delete(t)}submitForm(e,t,n){if(!nt(e))throw Error(`invalid formID '${e}'`);let r=this.getOrCreateFormState(e);if(Array.from(r.submitValidators.values()).map(e=>e()).some(e=>!e))return!1;let i=this.formsData.submitButtons.get(e),a;return n===void 0?i!==void 0&&i.length>0&&(a=i[0]):a=n,a&&(this.createWidgetState(a,{fromUser:!0}).triggerValue=!0),this.widgetStates.copyFrom(r.widgetStates),r.widgetStates.clear(),this.sendUpdateWidgetsMessage(t),this.syncFormsWithPendingChanges(),a&&this.deleteWidgetState(a.id),r.clearOnSubmit&&r.formCleared.emit(),!0}setChatInputValue(e,t,n){let r={id:e,formId:n.formId};this.createWidgetState(r,n).chatInputValue=new te(t),this.pendingTriggerIds.add(e),this.scheduleFlush(n.fragmentId)}setStringTriggerValue(e,t,n){let r={id:e,formId:n.formId};this.createWidgetState(r,n).stringTriggerValue=new O({data:t}),this.pendingTriggerIds.add(e),this.scheduleFlush(n.fragmentId)}setTriggerValue(e,t,n){let r={id:e,formId:t.formId},i=this.getWidgetState(r);if(i===void 0&&(i=this.createWidgetState(r,t)),n===void 0)i.triggerValue=!0;else{let e=n;try{if(z(i.jsonTriggerValue))i.jsonTriggerValue=JSON.stringify([e]);else{let t=i.jsonTriggerValue,n=JSON.parse(t),r=Array.isArray(n)?n:[n];r.push(e),i.jsonTriggerValue=JSON.stringify(r)}}catch(t){Gv.error(`Failed to parse or stringify widgetState.jsonTriggerValue:`,t),i.jsonTriggerValue=JSON.stringify([i.jsonTriggerValue,e])}}return this.pendingTriggerIds.add(e),new Promise(e=>{this.triggerFlushResolvers.push(e),this.scheduleFlush(t.fragmentId)})}getBoolValue(e){let t=this.getWidgetState(e);if(R(t)&&t.value===`boolValue`)return t.boolValue}setBoolValue(e,t,n){let r={id:e,formId:n.formId};this.createWidgetState(r,n).boolValue=t,this.onWidgetValueChanged(n),this.maybeSyncValueToUrl(r,n,t)}getIntValue(e){let t=this.getWidgetState(e);if(R(t)&&t.value===`intValue`)return Xv(t.intValue)}setIntValue(e,t,n){let r={id:e,formId:n.formId};this.createWidgetState(r,n).intValue=t,this.onWidgetValueChanged(n),this.maybeSyncValueToUrl(r,n,t)}getDoubleValue(e){let t=this.getWidgetState(e);if(R(t)&&t.value===`doubleValue`)return t.doubleValue}setDoubleValue(e,t,n){let r={id:e,formId:n.formId};this.createWidgetState(r,n).doubleValue=t,this.onWidgetValueChanged(n),this.maybeSyncValueToUrl(r,n,t)}getStringValue(e){let t=this.getWidgetState(e);if(R(t)&&t.value===`stringValue`)return t.stringValue}setStringValue(e,t,n){let r={id:e,formId:n.formId};this.createWidgetState(r,n).stringValue=t,this.onWidgetValueChanged(n),this.maybeSyncValueToUrl(r,n,t)}setStringArrayValue(e,t,n){let r={id:e,formId:n.formId};this.createWidgetState(r,n).stringArrayValue=new w({data:t}),this.onWidgetValueChanged(n),this.maybeSyncValueToUrl(r,n,t)}getStringArrayValue(e){let t=this.getWidgetState(e);if(R(t)&&t.value===`stringArrayValue`&&R(t.stringArrayValue)&&R(t.stringArrayValue.data))return t.stringArrayValue.data}getDoubleArrayValue(e){let t=this.getWidgetState(e);if(R(t)&&t.value===`doubleArrayValue`&&R(t.doubleArrayValue)&&R(t.doubleArrayValue.data))return t.doubleArrayValue.data}setDoubleArrayValue(e,t,n){let r={id:e,formId:n.formId},i=t.filter(e=>e!=null&&!Number.isNaN(e));if(i.length===0){Gv.warn(`setDoubleArrayValue: All values were invalid (NaN/null/undefined) for widget "${e}". Preserving previous state.`),this.maybeSyncValueToUrl(r,n,[]);return}this.createWidgetState(r,n).doubleArrayValue=new ae({data:i}),this.onWidgetValueChanged(n),this.maybeSyncValueToUrl(r,n,i)}getIntArrayValue(e){let t=this.getWidgetState(e);if(R(t)&&t.value===`intArrayValue`&&R(t.intArrayValue)&&R(t.intArrayValue.data))return t.intArrayValue.data.map(Xv)}setIntArrayValue(e,t,n){let r={id:e,formId:n.formId};this.createWidgetState(r,n).intArrayValue=new T({data:t}),this.onWidgetValueChanged(n),this.maybeSyncValueToUrl(r,n,t)}getJsonValue(e){let t=this.getWidgetState(e);if(R(t)&&t.value===`jsonValue`)return t.jsonValue}setJsonValue(e,t,n){let r={id:e,formId:n.formId};this.createWidgetState(r,n).jsonValue=JSON.stringify(t),this.onWidgetValueChanged(n)}setArrowValue(e,t,n){let r={id:e,formId:n.formId};this.createWidgetState(r,n).arrowValue=t,this.onWidgetValueChanged(n)}getArrowValue(e){let t=this.getWidgetState(e);if(R(t)&&t.value===`arrowValue`&&R(t.arrowValue))return t.arrowValue}setBytesValue(e,t,n){let r={id:e,formId:n.formId};this.createWidgetState(r,n).bytesValue=t,this.onWidgetValueChanged(n)}getBytesValue(e){let t=this.getWidgetState(e);if(R(t)&&t.value===`bytesValue`)return t.bytesValue}setFileUploaderStateValue(e,t,n){let r={id:e,formId:n.formId};this.createWidgetState(r,n).fileUploaderStateValue=t,this.onWidgetValueChanged(n)}getFileUploaderStateValue(e){let t=this.getWidgetState(e);if(R(t)&&t.value===`fileUploaderStateValue`)return t.fileUploaderStateValue}onWidgetValueChanged(e){nt(e.formId)?this.syncFormsWithPendingChanges():Uv(e)&&this.scheduleFlush(e.fragmentId)}syncFormsWithPendingChanges(){let e=new Set;
22this.forms.forEach((t,n)=>{t.hasPendingChanges&&e.add(n)}),this.updateFormsData(t=>{t.formsWithPendingChanges=e})}sendUpdateWidgetsMessage(e,t=void 0){this.props.sendRerunBackMsg(this.widgetStates.createWidgetStatesMsg(),e,void 0,t)}getActiveWidgetStates(e){let t=new j;return this.widgetStates.forEach(n=>{e.has(n.id)&&t.widgets.push(n)}),t}removeInactive(e){let t=this.pendingTriggerIds.size===0?e:new Set([...e,...this.pendingTriggerIds]);this.widgetStates.removeInactive(t),this.forms.forEach(e=>e.widgetStates.removeInactive(t)),this.elementStates.forEach((t,n)=>{e.has(n)||this.deleteElementState(n)})}createWidgetState(e,t){return(nt(e.formId)&&t.fromUser?this.getOrCreateFormState(e.formId).widgetStates:this.widgetStates).createState(e.id)}getWidgetState(e){if(nt(e.formId)){let t=this.forms.get(e.formId)?.widgetStates.getState(e.id);if(R(t))return t}return this.widgetStates.getState(e.id)}deleteWidgetState(e){this.widgetStates.deleteState(e)}getOrCreateFormState(e){let t=this.forms.get(e);return R(t)?t:(t=new Jv,this.forms.set(e,t),t)}setFormsWithUploadsInProgress(e){this.updateFormsData(t=>{t.formsWithUploads=e})}allowFormEnterToSubmit(e){if(!nt(e))return!1;let t=this.forms.get(e);if(t&&!t.enterToSubmit)return!1;let n=this.formsData.submitButtons.get(e)?.[0];return n?!n.disabled:!1}addSubmitButton(e,t){let n=this.formsData.submitButtons.get(e);if(n===void 0)this.setSubmitButtons(e,[t]);else{let r=Object.assign([],n);r.push(t),this.setSubmitButtons(e,r)}}removeSubmitButton(e,t){let n=this.formsData.submitButtons.get(e);if(n!==void 0){let r=Object.assign([],n),i=r.indexOf(t,0);i>-1&&r.splice(i,1),this.setSubmitButtons(e,r)}}setSubmitButtons(e,t){if(t.length<0)throw Error(`Bad submitButtons length ${t.length} (must be >= 0)`);this.updateFormsData(n=>{n.submitButtons.set(e,t)})}updateFormsData(e){let t=ev(this.formsData,e);this.formsData!==t&&(this.formsData=t,this.props.formsDataChanged(this.formsData))}getElementState(e,t){return this.elementStates.get(e)?.get(t)}setElementState(e,t,n){this.elementStates.has(e)||this.elementStates.set(e,new Map);let r=this.elementStates.get(e);r&&r.set(t,n)}deleteElementState(e,t){R(t)?this.elementStates.get(e)?.delete(t):this.elementStates.delete(e)}scheduleFlush(e){this.scheduledFragmentId===void 0&&(this.scheduledFragmentId=e),this.scheduledFragmentId!==void 0&&e!==void 0&&e!==this.scheduledFragmentId&&!this.hasFragmentIdConflict&&(Gv.warn(`Unexpected state: Multiple different fragmentIds detected in a single batch of widget updates. Proceeding with flushing updates using fragmentId '%s' for this batch.`,this.scheduledFragmentId),this.hasFragmentIdConflict=!0),!this.flushScheduled&&(this.flushScheduled=!0,setTimeout(()=>{this.sendUpdateWidgetsMessage(this.scheduledFragmentId),this.pendingTriggerIds.forEach(e=>this.deleteWidgetState(e)),this.pendingTriggerIds.clear(),this.triggerFlushResolvers.forEach(e=>e()),this.triggerFlushResolvers=[],this.flushScheduled=!1,this.scheduledFragmentId=void 0,this.hasFragmentIdConflict=!1},0))}registerQueryParamBinding(e,t,n,r,i,a,o){let s=this.paramKeyToWidgetId.get(t);s&&s!==e&&this.boundWidgets.delete(s);let c=r;o&&(Array.isArray(c)?c=c.map(e=>typeof e==`number`?Kv(e,o):String(e)):typeof c==`number`&&(c=Kv(c,o))),this.boundWidgets.set(e,{paramKey:t,valueType:n,defaultValue:c,urlFormat:a,clearable:i,dateType:o}),this.paramKeyToWidgetId.set(t,e)}unregisterQueryParamBinding(e){let t=this.boundWidgets.get(e);t&&(this.paramKeyToWidgetId.delete(t.paramKey),this.boundWidgets.delete(e))}hasQueryParamBinding(e){return this.boundWidgets.has(e)}filterParamsForPageChange(e){if(this.paramKeyToWidgetId.size===0)return e;let t=new URL(window.location.href),n={};this.paramKeyToWidgetId.forEach((e,r)=>{let i=t.searchParams.getAll(r);i.length===1?n[r]=i[0]:i.length>1&&(n[r]=i)});let r=Mv.stringify(n,{arrayFormat:`none`}).replaceAll(`%20`,`+`);return r?e?`${e}&${r}`:r:e}setQueryParamsChangeHandler(e){this.onQueryParamsChange=e}notifyQueryParamsChange(){if(this.onQueryParamsChange){let e=new URL(window.location.href);this.onQueryParamsChange(e.searchParams.toString())}}convertToUrlValue(e,t){if(e===null)return this.isEmptyValueValid(t)?``:null;switch(t.valueType){case`bool_value`:case`double_value`:case`int_value`:return String(e);case`string_value`:return e;case`string_array_value`:return e.filter(e=>e!==``);case`int_array_value`:return e.map(e=>String(e));case`double_array_value`:{let n=e;if(t.dateType){let e=t.dateType;return n.map(t=>Kv(t,e))}return n.map(e=>String(e))}default:return I(t.valueType)}}isEmptyValueValid(e){return e.clearable}shouldClearUrlParam(e,t){return(e===null||Array.isArray(e)&&e.length===0||e===``)&&!this.isEmptyValueValid(t)?!0:Array.isArray(e)?this.isDefaultArrayValue(e,t):this.isDefaultValue(e,t)}updateUrlParam(e,t,n){let r=Mv.parse(window.location.search,{arrayFormat:`none`});r[e]=t===null?null:Array.isArray(t)?t.length===0?``:n===`comma`?t.join(`,`):t:t;let i=Mv.stringify(r,{arrayFormat:`none`,skipNull:!0,skipEmptyString:!1}).replaceAll(`%20`,`+`);
22if(i===window.location.search.replace(/^\?/,``))return;let a=new URL(window.location.href);a.search=i,window.history.replaceState({},``,a.toString()),this.notifyQueryParamsChange()}maybeSyncValueToUrl(e,t,n){if(!t.fromUser)return;let r=this.boundWidgets.get(e.id);if(!r)return;let i=this.convertToUrlValue(n,r),a=this.shouldClearUrlParam(i,r);this.updateUrlParam(r.paramKey,a?null:i,r.urlFormat)}toStringPrimitive(e){if(typeof e==`string`||typeof e==`number`||typeof e==`boolean`)return String(e);if(e instanceof Date)return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`}isDefaultValue(e,t){let n=t.defaultValue;if(z(n))return z(e)||e===``;if(e===``&&Array.isArray(n)&&n.length===0)return!0;let r=this.toStringPrimitive(e),i=this.toStringPrimitive(n);return r===void 0||i===void 0?!1:r===i}isDefaultArrayValue(e,t){let n=t.defaultValue;if(!Array.isArray(n)){if(e.length===1&&n!==null){let t=this.toStringPrimitive(n);return t!==void 0&&e[0]===t}return!1}return e.length===n.length&&e.every((e,t)=>{let r=this.toStringPrimitive(n[t]);return r!==void 0&&e===r})}};function Xv(e){if(typeof e==`number`)return e;let t=tv.util.LongBits.from(e).toNumber();if(Number.isSafeInteger(t))return t;throw Error(`value ${e.toString()} cannot be converted to number without a loss of precision!`)}var Zv=d(`div`,{target:`e1yxiy6j0`})(({theme:e})=>({marginLeft:e.spacing.lg})),Qv=d(`header`,{target:`e1yxiy6j1`})(({theme:e,isTransparentBackground:t})=>({position:`absolute`,top:0,left:0,right:0,display:`flex`,alignItems:`center`,height:e.sizes.headerHeight,minHeight:e.sizes.headerHeight,width:`100%`,background:t?`transparent`:e.colors.bgColor,outline:`none`,zIndex:e.zIndices.header,pointerEvents:t?`none`:`auto`,fontSize:e.fontSizes.sm,"@media print":{position:`absolute`,background:`transparent`,"& *":{display:`none !important`},[`& ${Zv}, & ${Zv} *, & :has(${Zv})`]:{display:`flex !important`},[`& ${Zv} img`]:{display:`block !important`}}})),$v=d(`div`,{target:`e1yxiy6j2`})(({theme:e})=>({display:`flex`,alignItems:`center`,height:`100%`,width:`100%`,padding:0,pointerEvents:`auto`,position:`relative`,zIndex:e.zIndices.header})),ey=d(`div`,{target:`e1yxiy6j3`})(({theme:e})=>({display:`flex`,alignItems:`center`,justifyContent:`center`,marginLeft:e.spacing.lg,"@media print":{display:`none`}})),ty=d(`div`,{target:`e1yxiy6j4`})(()=>({flexShrink:0,display:`flex`,alignItems:`center`,justifyContent:`space-between`,width:`100%`,margin:0,border:0})),ny=d(`div`,{target:`e1yxiy6j5`})(()=>({display:`flex`,alignItems:`center`,flexShrink:0})),ry=d(`div`,{target:`e1yxiy6j6`})(({theme:e})=>({flexShrink:0,display:`flex`,alignItems:`center`,justifyContent:`flex-end`,marginLeft:`auto`,height:`100%`,minWidth:e.sizes.headerRightContentMaxWidth,marginRight:e.spacing.lg})),iy=({hasSidebar:e,isSidebarOpen:t,onToggleSidebar:n,navigation:r,rightContent:i,logoComponent:o,showToolbar:c})=>{let{activeTheme:l}=(0,U.useContext)(vh),u=o&&!t,d=e&&!t,f=c&&i,p=u||d||r||f;return s(Qv,{className:`stAppHeader`,"data-testid":`stHeader`,isTransparentBackground:!p,children:p?s($v,{className:`stAppToolbar`,"data-testid":`stToolbar`,theme:l.emotion,children:a(ty,{children:[a(ny,{children:[u?s(Zv,{children:o}):null,d&&s(ey,{children:s(Vr,{kind:V.HEADER_NO_PADDING,onClick:n,"data-testid":`stExpandSidebarButton`,children:s(B,{size:`xl`,iconValue:`:material/keyboard_double_arrow_right:`,color:l.emotion.colors.fadedText60})})})]}),r,f?s(ry,{children:i}):null]})}):null})},ay=(e,t)=>`max(
23    ${t}px,
24    calc(${e.spacing.xl} - ${t}px)
25  )`,oy=d(`section`,{target:`e16xr0mu0`})(({theme:e,isCollapsed:t,adjustTop:n,sidebarWidth:r,windowInnerWidth:i})=>{let a=t?0:Math.min(200,i),o=t?0:Math.min(600,i*.9);return{position:`relative`,top:n?e.sizes.headerDecorationHeight:e.spacing.none,backgroundColor:e.colors.bgColor,color:e.colors.bodyText,colorScheme:he(e)?`light`:`dark`,zIndex:e.zIndices.header+1,minWidth:a,maxWidth:o,transform:t?`translateX(-${r}px)`:`none`,transition:`transform 300ms, min-width 300ms, max-width 300ms`,"&:focus":{outline:`none`},[`@media (max-width: ${e.breakpoints.md})`]:{boxShadow:t?`-2rem 0 2rem 2rem transparent`:e.shadows.sidebar},"@media print":{display:t?`none`:`initial`,height:`auto !important`,maxHeight:`99%`,boxShadow:`none`}}}),sy=d(`div`,{target:`e16xr0mu1`})(({hasPageNavAbove:e,theme:t})=>({paddingTop:e?t.spacing.twoXL:0,paddingBottom:t.sizes.sidebarTopSpace})),cy=d(`div`,{target:`e16xr0mu2`})(({theme:e,scrollbarGutterSize:t})=>({position:`relative`,height:`100%`,width:`100%`,overflow:`auto`,scrollbarGutter:`stable both-edges`,paddingLeft:ay(e,t),paddingRight:ay(e,t)})),ly=d(`div`,{target:`e16xr0mu3`})(({theme:e})=>({position:`absolute`,width:`8px`,height:`100%`,cursor:`col-resize`,zIndex:e.zIndices.sidebarMobile,backgroundImage:e.showSidebarBorder?`linear-gradient(to right, transparent 20%, ${e.colors.borderColor} 28%, transparent 36%)`:`none`,"&:hover":{backgroundImage:`linear-gradient(to right, transparent 20%, ${e.colors.borderColor} 28%, transparent 44%)`}})),uy=d(`div`,{target:`e16xr0mu4`})(({theme:e})=>({display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:e.spacing.lg,height:e.sizes.headerHeight})),dy=d(`a`,{target:`e16xr0mu5`})({"&:hover":{opacity:`0.7`}}),fy=d(`button`,{target:`e16xr0mu6`})({background:`none`,border:`none`,padding:0,cursor:`pointer`,"&:hover":{opacity:`0.7`}});
25function py(e,t){return t===`small`?e.sizes.smallLogoHeight:t===`large`?e.sizes.largeLogoHeight:e.sizes.defaultLogoHeight}var my=d(`img`,{target:`e16xr0mu7`})(({theme:e,size:t})=>({height:py(e,t),marginTop:t===`small`?e.spacing.xs:e.spacing.twoXS,marginBottom:t===`small`?e.spacing.xs:e.spacing.twoXS,marginLeft:e.spacing.none,zIndex:e.zIndices.header,objectFit:`contain`,objectPosition:`left`,verticalAlign:`middle`,maxWidth:`100%`})),hy=d(`div`,{target:`e16xr0mu8`})(({theme:e,size:t})=>({display:`flex`,alignItems:`center`,justifyContent:`flex-start`,height:py(e,t),marginTop:t===`small`?e.spacing.xs:e.spacing.twoXS,marginBottom:t===`small`?e.spacing.xs:e.spacing.twoXS,marginLeft:e.spacing.none,zIndex:e.zIndices.header,fontSize:py(e,t),lineHeight:e.lineHeights.none,color:e.colors.bodyText})),gy=d(`div`,{target:`e16xr0mu9`})(({theme:e})=>({height:e.sizes.largeLogoHeight})),_y=d(`div`,{target:`e16xr0mu10`})(({showSidebarCollapse:e,theme:t})=>({display:`inline`,visibility:e?`visible`:`hidden`,marginLeft:t.spacing.sm,transition:`left 300ms`,transitionDelay:`left 300ms`,color:he(t)?t.colors.fadedText60:t.colors.bodyText,lineHeight:`0`,"@media print":{visibility:`hidden`},[`@media (max-width: ${t.breakpoints.sm})`]:{visibility:`visible`}})),vy=(0,yi.getLogger)(`LogoComponent`),yy={small:`lg`,medium:`xl`,large:`twoXL`},by=({appLogo:e,endpoints:t,collapsed:n=!1,componentName:r=`Logo`,dataTestId:i=`stLogo`})=>{let{resourceCrossOriginMode:a}=(0,U.useContext)(tn),{appPages:o,onPageChange:c,currentPageScriptHash:l}=(0,U.useContext)(fh),u=(0,U.useMemo)(()=>o.find(e=>e.isDefault),[o]),d=o.length>1,f=u?.pageScriptHash===l,p=(0,U.useCallback)(()=>{u?.pageScriptHash&&!f&&c(u.pageScriptHash)},[u,c,f]);if(!e)return null;let m=e=>{vy.error(`Client Error: ${r} source error - ${e}`),t.sendClientErrorToHost(r,`Logo source failed to load`,`onerror triggered`,e)},h=n&&e.iconImage?e.iconImage:e.image,g=n&&e.iconImage?e.iconImageType:e.imageType,_=t.buildMediaURL(h),v=rn(a,h),y=g===ce.ImageType.ICON||g===ce.ImageType.EMOJI,b=yy[e.size]||`xl`,x=y?s(hy,{size:e.size,className:`stLogo`,"data-testid":i,children:s(B,{iconValue:h,size:b})}):s(my,{src:_,size:e.size,alt:`Logo`,className:`stLogo`,"data-testid":i,onError:e=>m(_),crossOrigin:v});return e.link?s(dy,{href:e.link,target:`_blank`,rel:`noreferrer`,"data-testid":`stLogoLink`,"aria-label":y?`App Logo`:void 0,children:x}):d&&u&&!f?s(fy,{onClick:p,"data-testid":`stLogoLink`,"aria-label":`Navigate to home page`,children:x}):s(`div`,{children:x})};function xy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Sy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?xy(Object(n),!0).forEach(function(t){ai(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xy(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Cy(e){if(Array.isArray(e))return e}function wy(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function Ty(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ey(e,t){if(e){if(typeof e==`string`)return Ty(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ty(e,t):void 0}}function Dy(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
26In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Oy(e,t){return Cy(e)||wy(e,t)||Ey(e,t)||Dy()}var ky=n(((e,t)=>{(function(){var e={}.hasOwnProperty;function n(){for(var e=``,t=0;t<arguments.length;t++){var n=arguments[t];
26n&&(e=i(e,r(n)))}return e}function r(t){if(typeof t==`string`||typeof t==`number`)return t;if(typeof t!=`object`)return``;if(Array.isArray(t))return n.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes(`[native code]`))return t.toString();var r=``;for(var a in t)e.call(t,a)&&t[a]&&(r=i(r,a));return r}function i(e,t){return t?e?e+` `+t:e+t:e}t!==void 0&&t.exports?(n.default=n,t.exports=n):typeof define==`function`&&typeof define.amd==`object`&&define.amd?define(`classnames`,[],function(){return n}):window.classNames=n})()})),Ay=e(ky()),jy=Symbol.for(`react.element`),My=Symbol.for(`react.transitional.element`),Ny=Symbol.for(`react.fragment`);function Py(e){return e&&si(e)===`object`&&(e.$$typeof===jy||e.$$typeof===My)&&e.type===Ny}function Fy(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=[];return U.Children.forEach(e,function(e){e==null&&!t.keepEmpty||(Array.isArray(e)?n=n.concat(Fy(e)):Py(e)&&e.props?n=n.concat(Fy(e.props.children,t)):n.push(e))}),n}function Iy(e){return e instanceof HTMLElement||e instanceof SVGElement}function Ly(e){return e&&si(e)===`object`&&Iy(e.nativeElement)?e.nativeElement:Iy(e)?e:null}function Ry(e){return Ly(e)||(e instanceof U.Component?As.findDOMNode?.call(As.default,e):null)}var zy=n((e=>{var t=Symbol.for(`react.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.provider`),s=Symbol.for(`react.context`),c=Symbol.for(`react.server_context`),l=Symbol.for(`react.forward_ref`),u=Symbol.for(`react.suspense`),d=Symbol.for(`react.suspense_list`),f=Symbol.for(`react.memo`),p=Symbol.for(`react.lazy`);function m(e){if(typeof e==`object`&&e){var m=e.$$typeof;switch(m){case t:switch(e=e.type,e){case r:case a:case i:case u:case d:return e;default:switch(e&&=e.$$typeof,e){case c:case s:case l:case p:case f:case o:return e;default:return m}}case n:return m}}}e.ForwardRef=l,e.isMemo=function(e){return m(e)===f}})),By=n(((e,t)=>{t.exports=zy()}))();function Vy(e,t,n){var r=U.useRef({});return(!(`value`in r.current)||n(r.current.condition,t))&&(r.current.value=e(),r.current.condition=t),r.current.value}var Hy=Number(U.version.split(`.`)[0]),Uy=function(e,t){typeof e==`function`?e(t):si(e)===`object`&&e&&`current`in e&&(e.current=t)},Wy=function(){var e=[...arguments],t=e.filter(Boolean);return t.length<=1?t[0]:function(t){e.forEach(function(e){Uy(e,t)})}},Gy=function(){var e=[...arguments];return Vy(function(){return Wy.apply(void 0,e)},e,function(e,t){return e.length!==t.length||e.every(function(e,n){return e!==t[n]})})},Ky=function(e){var t,n;if(!e)return!1;if(qy(e)&&Hy>=19)return!0;var r=(0,By.isMemo)(e)?e.type.type:e.type;return!(typeof r==`function`&&!((t=r.prototype)!=null&&t.render)&&r.$$typeof!==By.ForwardRef||typeof e==`function`&&!((n=e.prototype)!=null&&n.render)&&e.$$typeof!==By.ForwardRef)};function qy(e){return(0,U.isValidElement)(e)&&!Py(e)}var Jy=function(e){if(e&&qy(e)){var t=e;return t.props.propertyIsEnumerable(`ref`)?t.props.ref:t.ref}return null},Yy=U.createContext(null);function Xy(e){var t=e.children,n=e.onBatchResize,r=U.useRef(0),i=U.useRef([]),a=U.useContext(Yy),o=U.useCallback(function(e,t,o){r.current+=1;var s=r.current;i.current.push({size:e,element:t,data:o}),Promise.resolve().then(function(){s===r.current&&(n?.(i.current),i.current=[])}),a?.(e,t,o)},[n,a]);return U.createElement(Yy.Provider,{value:o},t)}var Zy=(function(){if(typeof Map<`u`)return Map;function e(e,t){var n=-1;return e.some(function(e,r){return e[0]===t&&(n=r,!0)}),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var n=e(this.__entries__,t),r=this.__entries__[n];return r&&r[1]},t.prototype.set=function(t,n){var r=e(this.__entries__,t);~r?this.__entries__[r][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,r=e(n,t);~r&&n.splice(r,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){t===void 0&&(t=null);for(var n=0,r=this.__entries__;n<r.length;n++){var i=r[n];e.call(t,i[1],i[0])}},t}()})(),Qy=typeof window<`u`&&typeof document<`u`&&window.document===document,$y=(function(){return typeof global<`u`&&global.Math===Math?global:typeof self<`u`&&self.Math===Math?self:typeof window<`u`&&window.Math===Math?window:Function(`return this`)()})(),eb=(function(){return typeof requestAnimationFrame==`function`?requestAnimationFrame.bind($y):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}})(),tb=2;function nb(e,t){var n=!1,r=!1,i=0;function a(){n&&(n=!1,e()),r&&s()}function o(){eb(a)}function s(){var e=Date.now();if(n){if(e-i<tb)return;r=!0}else n=!0,r=!1,setTimeout(o,t);i=e}return s}var rb=20,ib=[`top`,`right`,`bottom`,`left`,`width`,`height`,`size`,`weight`],ab=typeof MutationObserver<`u`,ob=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=nb(this.refresh.bind(this),rb)}return e.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},e.prototype.removeObserver=function(e){var t=this.observers_,n=t.indexOf(e);~n&&t.splice(n,1),!t.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},e.prototype.updateObservers_=function(){var e=this.observers_.filter(function(e){return e.gatherActive(),e.hasActive()});return e.forEach(function(e){return e.broadcastActive()}),e.length>0},e.prototype.connect_=function(){!Qy||this.connected_||(document.addEventListener(`transitionend`,this.onTransitionEnd_),window.addEventListener(`resize`,this.refresh),ab?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener(`DOMSubtreeModified`,this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!Qy||!this.connected_||(document.removeEventListener(`transitionend`,this.onTransitionEnd_),window.removeEventListener(`resize`,this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener(`DOMSubtreeModified`,this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=t===void 0?``:t;ib.some(function(e){return!!~n.indexOf(e)})&&this.refresh()},e.getInstance=function(){return this.instance_||=new e,this.instance_},e.instance_=null,e}(),sb=(function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];Object.defineProperty(e,i,{value:t[i],enumerable:!1,writable:!1,
26configurable:!0})}return e}),cb=(function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||$y}),lb=yb(0,0,0,0);function ub(e){return parseFloat(e)||0}function db(e){return[...arguments].slice(1).reduce(function(t,n){var r=e[`border-`+n+`-width`];return t+ub(r)},0)}function fb(e){for(var t=[`top`,`right`,`bottom`,`left`],n={},r=0,i=t;r<i.length;r++){var a=i[r],o=e[`padding-`+a];n[a]=ub(o)}return n}function pb(e){var t=e.getBBox();return yb(0,0,t.width,t.height)}function mb(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return lb;var r=cb(e).getComputedStyle(e),i=fb(r),a=i.left+i.right,o=i.top+i.bottom,s=ub(r.width),c=ub(r.height);if(r.boxSizing===`border-box`&&(Math.round(s+a)!==t&&(s-=db(r,`left`,`right`)+a),Math.round(c+o)!==n&&(c-=db(r,`top`,`bottom`)+o)),!gb(e)){var l=Math.round(s+a)-t,u=Math.round(c+o)-n;Math.abs(l)!==1&&(s-=l),Math.abs(u)!==1&&(c-=u)}return yb(i.left,i.top,s,c)}var hb=(function(){return typeof SVGGraphicsElement<`u`?function(e){return e instanceof cb(e).SVGGraphicsElement}:function(e){return e instanceof cb(e).SVGElement&&typeof e.getBBox==`function`}})();function gb(e){return e===cb(e).document.documentElement}function _b(e){return Qy?hb(e)?pb(e):mb(e):lb}function vb(e){var t=e.x,n=e.y,r=e.width,i=e.height,a=Object.create((typeof DOMRectReadOnly<`u`?DOMRectReadOnly:Object).prototype);return sb(a,{x:t,y:n,width:r,height:i,top:n,right:t+r,bottom:i+n,left:t}),a}function yb(e,t,n,r){return{x:e,y:t,width:n,height:r}}var bb=function(){function e(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=yb(0,0,0,0),this.target=e}return e.prototype.isActive=function(){var e=_b(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},e}(),xb=function(){function e(e,t){var n=vb(t);sb(this,{target:e,contentRect:n})}return e}(),Sb=function(){function e(e,t,n){if(this.activeObservations_=[],this.observations_=new Zy,typeof e!=`function`)throw TypeError(`The callback provided as parameter 1 is not a function.`);this.callback_=e,this.controller_=t,this.callbackCtx_=n}return e.prototype.observe=function(e){if(!arguments.length)throw TypeError(`1 argument required, but only 0 present.`);if(!(typeof Element>`u`||!(Element instanceof Object))){if(!(e instanceof cb(e).Element))throw TypeError(`parameter 1 is not of type "Element".`);var t=this.observations_;t.has(e)||(t.set(e,new bb(e)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(e){if(!arguments.length)throw TypeError(`1 argument required, but only 0 present.`);if(!(typeof Element>`u`||!(Element instanceof Object))){if(!(e instanceof cb(e).Element))throw TypeError(`parameter 1 is not of type "Element".`);var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(t){t.isActive()&&e.activeObservations_.push(t)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map(function(e){return new xb(e.target,e.broadcastRect())});this.callback_.call(e,t,e),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),Cb=typeof WeakMap<`u`?new WeakMap:new Zy,wb=function(){function e(t){if(!(this instanceof e))throw TypeError(`Cannot call a class as a function.`);if(!arguments.length)throw TypeError(`1 argument required, but only 0 present.`);var n=new Sb(t,ob.getInstance(),this);Cb.set(this,n)}return e}();[`observe`,`unobserve`,`disconnect`].forEach(function(e){wb.prototype[e]=function(){var t;return(t=Cb.get(this))[e].apply(t,arguments)}});var Tb=(function(){return $y.ResizeObserver===void 0?wb:$y.ResizeObserver})(),Eb=new Map;function Db(e){e.forEach(function(e){var t,n=e.target;(t=Eb.get(n))==null||t.forEach(function(e){return e(n)})})}var Ob=new Tb(Db);function kb(e,t){Eb.has(e)||(Eb.set(e,new Set),Ob.observe(e)),Eb.get(e).add(t)}function Ab(e,t){Eb.has(e)&&(Eb.get(e).delete(t),Eb.get(e).size||(Ob.unobserve(e),Eb.delete(e)))}function jb(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function Mb(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,ii(r.key),r)}}function Nb(e,t,n){return t&&Mb(e.prototype,t),n&&Mb(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Pb(e,t){return Pb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Pb(e,t)}function Fb(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Pb(e,t)}function Ib(e){return Ib=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ib(e)}
26function Lb(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Lb=function(){return!!e})()}function Rb(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function zb(e,t){if(t&&(si(t)==`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return Rb(e)}function Bb(e){var t=Lb();return function(){var n,r=Ib(e);if(t){var i=Ib(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return zb(this,n)}}var Vb=function(e){Fb(n,e);var t=Bb(n);function n(){return jb(this,n),t.apply(this,arguments)}return Nb(n,[{key:`render`,value:function(){return this.props.children}}]),n}(U.Component);function Hb(e,t){var n=e.children,r=e.disabled,i=U.useRef(null),a=U.useRef(null),o=U.useContext(Yy),s=typeof n==`function`,c=s?n(i):n,l=U.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),u=!s&&U.isValidElement(c)&&Ky(c),d=Gy(u?Jy(c):null,i),f=function(){return Ry(i.current)||(i.current&&si(i.current)===`object`?Ry(i.current?.nativeElement):null)||Ry(a.current)};U.useImperativeHandle(t,function(){return f()});var p=U.useRef(e);p.current=e;var m=U.useCallback(function(e){var t=p.current,n=t.onResize,r=t.data,i=e.getBoundingClientRect(),a=i.width,s=i.height,c=e.offsetWidth,u=e.offsetHeight,d=Math.floor(a),f=Math.floor(s);if(l.current.width!==d||l.current.height!==f||l.current.offsetWidth!==c||l.current.offsetHeight!==u){var m={width:d,height:f,offsetWidth:c,offsetHeight:u};l.current=m;var h=c===Math.round(a)?a:c,g=u===Math.round(s)?s:u,_=Sy(Sy({},m),{},{offsetWidth:h,offsetHeight:g});o?.(_,e,r),n&&Promise.resolve().then(function(){n(_,e)})}},[]);return U.useEffect(function(){var e=f();return e&&!r&&kb(e,m),function(){return Ab(e,m)}},[i.current,r]),U.createElement(Vb,{ref:a},u?U.cloneElement(c,{ref:d}):c)}var Ub=U.forwardRef(Hb),Wb=`rc-observer-key`;function Gb(e,t){var n=e.children;return(typeof n==`function`?[n]:Fy(n)).map(function(n,r){var i=n?.key||`${Wb}-${r}`;return U.createElement(Ub,f({},e,{key:i,ref:r===0?t:void 0}),n)})}var Kb=U.forwardRef(Gb);Kb.Collection=Xy;function qb(){return!!(typeof window<`u`&&window.document&&window.document.createElement)}var Jb=qb()?U.useLayoutEffect:U.useEffect,Yb=function(e,t){var n=U.useRef(!0);Jb(function(){return e(n.current)},t),Jb(function(){return n.current=!1,function(){n.current=!0}},[])},Xb=[`prefixCls`,`invalidate`,`item`,`renderItem`,`responsive`,`responsiveDisabled`,`registerSize`,`itemKey`,`className`,`style`,`children`,`display`,`order`,`component`],Zb=void 0;function Qb(e,t){var n=e.prefixCls,r=e.invalidate,i=e.item,a=e.renderItem,o=e.responsive,s=e.responsiveDisabled,c=e.registerSize,l=e.itemKey,u=e.className,d=e.style,p=e.children,m=e.display,h=e.order,g=e.component,_=g===void 0?`div`:g,v=oi(e,Xb),y=o&&!m;function b(e){c(l,e)}U.useEffect(function(){return function(){b(null)}},[]);var x=a&&i!==Zb?a(i,{index:h}):p,S;r||(S={opacity:+!y,height:y?0:Zb,overflowY:y?`hidden`:Zb,order:o?h:Zb,pointerEvents:y?`none`:Zb,position:y?`absolute`:Zb});var C={};y&&(C[`aria-hidden`]=!0);var w=U.createElement(_,f({className:(0,Ay.default)(!r&&n,u),style:Sy(Sy({},S),d)},C,v,{ref:t}),x);return o&&(w=U.createElement(Kb,{onResize:function(e){var t=e.offsetWidth;b(t)},disabled:s},w)),w}var $b=U.forwardRef(Qb);$b.displayName=`Item`;function ex(e){var t=U.useRef();return t.current=e,U.useCallback(function(){var e,n=[...arguments];return(e=t.current)?.call.apply(e,[t].concat(n))},[])}var tx=function(e){return+setTimeout(e,16)},nx=function(e){return clearTimeout(e)};typeof window<`u`&&`requestAnimationFrame`in window&&(tx=function(e){return window.requestAnimationFrame(e)},nx=function(e){return window.cancelAnimationFrame(e)});var rx=0,ix=new Map;function ax(e){ix.delete(e)}var ox=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;rx+=1;var n=rx;function r(t){if(t===0)ax(n),e();else{var i=tx(function(){r(t-1)});ix.set(n,i)}}return r(t),n};ox.cancel=function(e){var t=ix.get(e);return ax(e),nx(t)};function sx(e){if(typeof MessageChannel>`u`)ox(e);else{var t=new MessageChannel;t.port1.onmessage=function(){return e()},t.port2.postMessage(void 0)}}function cx(){var e=U.useRef(null);return function(t){e.current||(e.current=[],sx(function(){(0,As.unstable_batchedUpdates)(function(){e.current.forEach(function(e){e()}),e.current=null})})),e.current.push(t)}}function lx(e,t){var n=Oy(U.useState(t),2),r=n[0],i=n[1];return[r,ex(function(t){e(function(){i(t)})})]}
26var ux=U.createContext(null),dx=[`component`],fx=[`className`],px=[`className`],mx=U.forwardRef(function(e,t){var n=U.useContext(ux);if(!n){var r=e.component,i=r===void 0?`div`:r,a=oi(e,dx);return U.createElement(i,f({},a,{ref:t}))}var o=n.className,s=oi(n,fx),c=e.className,l=oi(e,px);return U.createElement(ux.Provider,{value:null},U.createElement($b,f({ref:t,className:(0,Ay.default)(o,c)},s,l)))});mx.displayName=`RawItem`;var hx=[`prefixCls`,`data`,`renderItem`,`renderRawItem`,`itemKey`,`itemWidth`,`ssr`,`style`,`className`,`maxCount`,`renderRest`,`renderRawRest`,`prefix`,`suffix`,`component`,`itemComponent`,`onVisibleChange`],gx=`responsive`,_x=`invalidate`;function vx(e){return`+ ${e.length} ...`}function yx(e,t){var n=e.prefixCls,r=n===void 0?`rc-overflow`:n,i=e.data,a=i===void 0?[]:i,o=e.renderItem,s=e.renderRawItem,c=e.itemKey,l=e.itemWidth,u=l===void 0?10:l,d=e.ssr,p=e.style,m=e.className,h=e.maxCount,g=e.renderRest,_=e.renderRawRest,v=e.prefix,y=e.suffix,b=e.component,x=b===void 0?`div`:b,S=e.itemComponent,C=e.onVisibleChange,w=oi(e,hx),T=d===`full`,E=cx(),D=Oy(lx(E,null),2),O=D[0],k=D[1],A=O||0,ee=Oy(lx(E,new Map),2),j=ee[0],M=ee[1],N=Oy(lx(E,0),2),te=N[0],ne=N[1],re=Oy(lx(E,0),2),ie=re[0],ae=re[1],oe=Oy(lx(E,0),2),P=oe[0],se=oe[1],F=Oy(lx(E,0),2),ce=F[0],le=F[1],ue=Oy((0,U.useState)(null),2),I=ue[0],de=ue[1],L=Oy((0,U.useState)(null),2),fe=L[0],pe=L[1],me=U.useMemo(function(){return fe===null&&T?2**53-1:fe||0},[fe,O]),he=Oy((0,U.useState)(!1),2),ge=he[0],R=he[1],z=`${r}-item`,_e=Math.max(te,ie),ve=h===gx,ye=a.length&&ve,be=h===_x,xe=ye||typeof h==`number`&&a.length>h,Se=(0,U.useMemo)(function(){var e=a;return ye?e=O===null&&T?a:a.slice(0,Math.min(a.length,A/u)):typeof h==`number`&&(e=a.slice(0,h)),e},[a,u,O,h,ye]),Ce=(0,U.useMemo)(function(){return ye?a.slice(me+1):a.slice(Se.length)},[a,Se,ye,me]),we=(0,U.useCallback)(function(e,t){return typeof c==`function`?c(e):(c&&e?.[c])??t},[c]),Te=(0,U.useCallback)(o||function(e){return e},[o]);function Ee(e,t,n){(fe!==e||t!==void 0&&t!==I)&&(pe(e),n||(R(e<a.length-1),C?.(e)),t!==void 0&&de(t))}function De(e,t){k(t.clientWidth)}function Oe(e,t){M(function(n){var r=new Map(n);return t===null?r.delete(e):r.set(e,t),r})}function ke(e,t){ae(t),ne(ie)}function Ae(e,t){se(t)}function je(e,t){le(t)}function Me(e){return j.get(we(Se[e],e))}Yb(function(){if(A&&typeof _e==`number`&&Se){var e=P+ce,t=Se.length,n=t-1;if(!t){Ee(0,null);return}for(var r=0;r<t;r+=1){var i=Me(r);if(T&&(i||=0),i===void 0){Ee(r-1,void 0,!0);break}if(e+=i,n===0&&e<=A||r===n-1&&e+Me(n)<=A){Ee(n,null);break}if(e+_e>A){Ee(r-1,e-i-ce+ie);break}}y&&Me(0)+ce>A&&de(null)}},[A,j,ie,P,ce,we,Se]);var Ne=ge&&!!Ce.length,Pe={};I!==null&&ye&&(Pe={position:`absolute`,left:I,top:0});var Fe={prefixCls:z,responsive:ye,component:S,invalidate:be},Ie=s?function(e,t){var n=we(e,t);return U.createElement(ux.Provider,{key:n,value:Sy(Sy({},Fe),{},{order:t,item:e,itemKey:n,registerSize:Oe,display:t<=me})},s(e,t))}:function(e,t){var n=we(e,t);return U.createElement($b,f({},Fe,{order:t,key:n,item:e,renderItem:Te,itemKey:n,registerSize:Oe,display:t<=me}))},Le={order:Ne?me:2**53-1,className:`${z}-rest`,registerSize:ke,display:Ne},Re=g||vx,ze=_?U.createElement(ux.Provider,{value:Sy(Sy({},Fe),Le)},_(Ce)):U.createElement($b,f({},Fe,Le),typeof Re==`function`?Re(Ce):Re),Be=U.createElement(x,f({className:(0,Ay.default)(!be&&r,m),style:p,ref:t},w),v&&U.createElement($b,f({},Fe,{responsive:ve,responsiveDisabled:!ye,order:-1,className:`${z}-prefix`,registerSize:Ae,display:!0}),v),Se.map(Ie),xe?ze:null,y&&U.createElement($b,f({},Fe,{responsive:ve,responsiveDisabled:!ye,order:me,className:`${z}-suffix`,registerSize:je,display:!0,style:Pe}),y));return ve?U.createElement(Kb,{onResize:De,disabled:!ye},Be):Be}var bx=U.forwardRef(yx);bx.displayName=`Overflow`,bx.Item=mx,bx.RESPONSIVE=gx,bx.INVALIDATE=_x;var xx=bx,Sx=(e,t,n=!1,r)=>{if(n)return e.colors.fadedText40;if(r)return e.colors.bodyText;let i=he(e);return t?e.colors.bodyText:i?fe(e.colors.bodyText,.2):fe(e.colors.bodyText,.25)},Cx=d(`div`,{target:`e1md1dwn0`})(({theme:e})=>({position:`relative`,fontFamily:e.genericFonts.bodyFont})),wx=d(`ul`,{target:`e1md1dwn1`})(({theme:e})=>({listStyle:`none`,margin:e.spacing.none,paddingBottom:e.spacing.threeXS,paddingTop:e.spacing.none,paddingRight:e.spacing.none,paddingLeft:e.spacing.none})),Tx=d(`div`,{target:`e1md1dwn2`})(({disabled:e})=>({display:`flex`,flexDirection:`column`,cursor:e?`not-allowed`:`pointer`})),Ex=d(`span`,{target:`e1md1dwn3`})(({theme:e,isActive:t})=>({display:`inline-flex`,span:{fontWeight:t?e.fontWeights.bold:e.fontWeights.normal}})),Dx=d(`li`,{target:`e1md1dwn4`})(({theme:e})=>({marginTop:e.spacing.threeXS,marginBottom:e.spacing.threeXS})),Ox=d(`a`,{target:`e1md1dwn5`})(({theme:e,isActive:t,disabled:n})=>{let r={textDecoration:`none`,fontWeight:t?e.fontWeights.bold:e.fontWeights.normal};return{...r,display:`flex`,flexDirection:`row`,alignItems:`center`,gap:e.spacing.sm,borderRadius:e.radii.md2,paddingLeft:e.spacing.sm,paddingRight:e.spacing.sm,marginTop:e.spacing.threeXS,marginBottom:e.spacing.threeXS,lineHeight:e.lineHeights.menuItem,color:Sx(e,t),backgroundColor:t?e.colors.darkenedBgMix25:`transparent`,...n&&{pointerEvents:`none`},"&:hover":{backgroundColor:e.colors.darkenedBgMix15},"&:active,&:visited,&:hover":{...r},"&:focus":{outline:`none`},"&:focus-visible":{backgroundColor:e.colors.darkenedBgMix15},"@media print":{paddingLeft:e.spacing.none}}}
26),kx=d(`span`,{target:`e1md1dwn6`})(({isActive:e,theme:t,disabled:n,isTopNav:r,label:i})=>({color:Sx(t,e,n,r),fontSize:t.fontSizes.sm,overflow:`hidden`,whiteSpace:`nowrap`,textOverflow:`ellipsis`,display:`table-cell`,"&::after":{content:`"${i}"`,fontWeight:t.fontWeights.bold,visibility:`hidden`,display:`block`,width:`fit-content`,height:0}})),Ax=d(`div`,{target:`e1md1dwn7`})(({isExpanded:e})=>({visibility:`hidden`,display:`flex`,alignItems:`center`,justifyContent:`center`,transform:e?`rotate(0deg)`:`rotate(-90deg)`,transition:`transform 200ms ease`,flexShrink:0})),jx=d(`span`,{target:`e1md1dwn8`})(()=>({overflow:`hidden`,whiteSpace:`nowrap`,textOverflow:`ellipsis`,minWidth:0})),Mx=d(`header`,{target:`e1md1dwn9`})(({theme:e})=>({fontSize:e.fontSizes.sm,fontWeight:e.fontWeights.semiBold,color:Sx(e,!1),lineHeight:e.lineHeights.small,paddingRight:e.spacing.sm,marginTop:e.spacing.sm,marginBottom:e.spacing.twoXS,display:`flex`,flexDirection:`row`,alignItems:`center`,gap:e.spacing.sm,cursor:`pointer`,userSelect:`none`,"&:hover":{[`& > ${Ax}`]:{visibility:`visible`}}})),Nx=d(`button`,{target:`e1md1dwn10`})(({theme:e})=>({fontSize:e.fontSizes.sm,fontFamily:`inherit`,lineHeight:e.lineHeights.base,color:Sx(e,!0),backgroundColor:e.colors.transparent,border:`none`,borderRadius:e.radii.default,marginTop:e.spacing.twoXS,marginLeft:e.spacing.none,marginBottom:e.spacing.none,marginRight:e.spacing.none,padding:`${e.spacing.threeXS} ${e.spacing.sm}`,"&:hover, &:active, &:focus":{border:`none`,outline:`none`,boxShadow:`none`},"&:hover":{backgroundColor:e.colors.darkenedBgMix15}})),Px=d(`div`,{target:`e1md1dwn11`})(({theme:e})=>({paddingTop:e.spacing.lg,borderBottom:`${e.sizes.borderWidth} solid ${e.colors.borderColor}`})),Fx=d(`div`,{target:`e1md1dwn12`})(({theme:e})=>({"&:not(:first-child)":{marginTop:e.spacing.lg}})),Ix=d(`div`,{target:`e1md1dwn13`})(({theme:e})=>({display:`flex`,alignItems:`center`,width:`100%`,flexShrink:1,overflow:`hidden`,padding:`0 ${e.spacing.lg}`})),Lx=d(`button`,{target:`e1md1dwn14`})(({theme:e,isOpen:t})=>({border:`none`,background:`none`,font:`inherit`,cursor:`pointer`,display:`flex`,alignItems:`center`,justifyContent:`center`,position:`relative`,lineHeight:e.lineHeights.menuItem,fontSize:e.fontSizes.sm,padding:`0 ${e.spacing.sm}`,color:Sx(e,!1,!1,!0),borderRadius:e.radii.default,marginRight:e.spacing.twoXS,"&:not(:first-of-type)":{marginLeft:e.spacing.twoXS},...t?{backgroundColor:e.colors.darkenedBgMix25}:{},"&:hover":{backgroundColor:e.colors.darkenedBgMix15},"&:focus-visible":{outline:`none`,boxShadow:e.shadows.focusRingMuted}})),Rx=d(`div`,{target:`e1md1dwn15`})(({theme:e})=>({...Bn(e),backgroundColor:e.colors.bgColor,zIndex:Ln(e),maxHeight:`70vh`,minWidth:`8rem`,overflow:`auto`,maxWidth:`calc(${e.sizes.contentMaxWidth} - 2*${e.spacing.lg})`,[`@media (max-width: ${e.breakpoints.sm})`]:{maxWidth:`calc(100% - ${e.spacing.threeXL})`}})),zx=d(`div`,{target:`e1md1dwn16`})(({theme:e})=>({marginRight:e.spacing.twoXS,"&:not(:first-of-type)":{marginLeft:e.spacing.twoXS}})),Bx=d(`div`,{target:`e1md1dwn17`})(({theme:e})=>({margin:`${e.spacing.none} ${e.spacing.xs}`})),Vx=d(`span`,{target:`e1md1dwn18`})(()=>({whiteSpace:`nowrap`})),Hx=d(`div`,{target:`e1md1dwn19`})(({theme:e})=>({marginLeft:e.spacing.sm,marginTop:e.spacing.sm,marginBottom:e.spacing.sm,lineHeight:e.lineHeights.menuItem})),Ux=d(`div`,{target:`e1md1dwn20`})(({theme:e})=>({padding:`${e.spacing.twoXS} ${e.spacing.none}`,fontSize:e.fontSizes.sm})),Wx=d(`div`,{target:`e1md1dwn21`})(({theme:e})=>({marginLeft:e.spacing.twoXS})),Gx=d(`span`,{target:`e1md1dwn22`})({position:`absolute`,width:`1px`,height:`1px`,padding:0,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,border:0}),Kx=({isActive:e,pageUrl:t,icon:n,onClick:r,isTopNav:i,isInDropdown:o,children:c,widgetsDisabled:l,isExternal:u,externalUrl:d})=>{let f=on(),p=l,m;m=i&&o?`stTopNavDropdownLink`:i?`stTopNavLink`:`stSidebarNavLink`;let h=i?`stTopNavLinkContainer`:`stSidebarNavLinkContainer`,g=!u&&e;return s(Tx,{disabled:p,"data-testid":h,children:a(Ox,{"data-testid":m,isActive:g,disabled:p,href:u?d??t:t,onClick:r,"aria-current":g?`page`:void 0,target:u?`_blank`:void 0,rel:u?`noopener noreferrer`:void 0,children:[n?.length?s(Ex,{isActive:g,children:s(B,{size:`base`,iconValue:n,color:!g&&en(n)?f.colors.fadedText60:f.colors.bodyText})}
26):null,s(kx,{isActive:g,disabled:p,isTopNav:i,label:c,children:s(It,{source:c,allowHTML:!1,isLabel:!0,disableLinks:!0,truncate:!0,inheritFont:!0})}),u&&s(Gx,{children:`(opens in new tab)`})]})})};function qx(e){return e.externalUrl??void 0}function Jx(e){return!z(e.externalUrl)}function Yx(e){return $x(e).length>1}function Xx(e){return ka(e,e=>e.sectionHeader||``)}function Zx(e){return Object.keys(e).some(e=>e!==``)}function Qx(e){if(!Zx(e))return{individualPages:Object.values(e).flat(),sections:{}};let t=e[``]||[],n={};return Object.entries(e).forEach(([e,t])=>{e&&(n[e]=t)}),{individualPages:t,sections:n}}function $x(e){return e.filter(e=>!e.isHidden)}var eS=({title:e,sections:t,handlePageChange:n,endpoints:r,pageLinkBaseUrl:i,currentPageScriptHash:o,hideChevron:c=!1,widgetsDisabled:l})=>{let[d,f]=(0,U.useState)(!1),p=on(),m=t.length>1,h=(0,U.useRef)(null),{refs:g,floatingStyles:_}=$r({open:d,placement:`bottom-start`,offsetPx:qe(p.spacing.twoXS)}),{setFloatingRef:v,setReferenceRef:y}=pg({isOpen:d,onClose:()=>f(!1),floatingSetFn:g.setFloating,referenceSetFn:g.setReference,restoreFocusFn:()=>h.current?.focus()}),b=(0,U.useCallback)(e=>{h.current=e,y(e)},[y]);if(z(t)||t.length===0||t[0].length===0)return null;let x=t.map((e,t)=>{let c=e[0].sectionHeader;return e.map((e,t)=>{let u=Jx(e),d=t=>{if(u){f(!1);return}t.preventDefault(),e.pageScriptHash&&n(e.pageScriptHash),f(!1)},p=String(e.pageName||``);return a(U.Fragment,{children:[t===0&&m&&s(Hx,{children:s(It,{source:c||``,allowHTML:!1,isLabel:!0,disableLinks:!0,truncate:!0,inheritFont:!0})}),s(Bx,{children:s(Kx,{icon:e.icon||null,isTopNav:!0,isInDropdown:!0,isActive:o===e.pageScriptHash,onClick:d,pageUrl:r.buildAppPageURL(i,e),widgetsDisabled:l,isExternal:u,externalUrl:qx(e),children:p})})]},`${e.pageScriptHash}-${p}`)})});return a(u,{children:[a(Lx,{ref:b,type:`button`,onClick:()=>f(e=>!e),isOpen:d,"aria-expanded":d,"aria-haspopup":`true`,"data-testid":`stTopNavSection`,children:[s(Vx,{children:s(It,{source:e,allowHTML:!1,isLabel:!0,disableLinks:!0,truncate:!0,inheritFont:!0})}),!c&&s(Wx,{children:s(Qt,{content:d?Kd:Gd,size:`lg`})})]}),d&&s(Qr,{children:s(Rx,{ref:v,style:_,"data-testid":`stTopNavPopoverBody`,children:s(Ux,{"data-testid":`stTopNavPopover`,children:x})})})]})},tS=({endpoints:e,widgetsDisabled:t})=>{let{pageLinkBaseUrl:n,currentPageScriptHash:r,appPages:i,onPageChange:a}=(0,U.useContext)(fh),o=(0,U.useMemo)(()=>$x(i),[i]),{data:c,itemKey:l}=(0,U.useMemo)(()=>{let e=Qx(Xx(o));return{data:[...e.individualPages,...Object.values(e.sections)],itemKey:e=>Array.isArray(e)?e[0]?.sectionHeader??``:e.pageScriptHash??``}},[o]),u=(0,U.useCallback)((i,o)=>{if(Array.isArray(i))return s(eS,{sections:[i],title:i[0].sectionHeader||``,handlePageChange:a,endpoints:e,pageLinkBaseUrl:n,currentPageScriptHash:r,widgetsDisabled:t});let c=Jx(i);return s(zx,{children:s(Kx,{isTopNav:!0,isInDropdown:!1,isActive:r===i.pageScriptHash,icon:i.icon,pageUrl:e.buildAppPageURL(n,i),onClick:e=>{c||(e.preventDefault(),i.pageScriptHash&&a(i.pageScriptHash))},widgetsDisabled:t,isExternal:c,externalUrl:qx(i),children:String(i.pageName)})})},[a,e,n,r,t]),d=(0,U.useCallback)(i=>{if(z(i))return null;let o=`${i.flat().length} more`,c=i.map(e=>Array.isArray(e)?e:[e]);return s(eS,{hideChevron:!0,sections:c,title:o,handlePageChange:a,endpoints:e,pageLinkBaseUrl:n,currentPageScriptHash:r,widgetsDisabled:t})},[a,e,n,r,t]);return s(xx,{component:Ix,itemKey:l,data:c,maxCount:`responsive`,renderItem:u,renderRest:d})},nS=e(o()),Q=function(){return Q=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Q.apply(this,arguments)},rS={width:`100%`,height:`10px`,top:`0px`,left:`0px`,cursor:`row-resize`},iS={width:`10px`,height:`100%`,top:`0px`,left:`0px`,cursor:`col-resize`},aS={width:`20px`,height:`20px`,position:`absolute`,zIndex:1},oS={top:Q(Q({},rS),{top:`-5px`}),right:Q(Q({},iS),{left:void 0,right:`-5px`}),bottom:Q(Q({},rS),{top:void 0,bottom:`-5px`}),left:Q(Q({},iS),{left:`-5px`}),topRight:Q(Q({}
vendor: 13,548 bytes, line 26
26,aS),{right:`-10px`,top:`-10px`,cursor:`ne-resize`}),bottomRight:Q(Q({},aS),{right:`-10px`,bottom:`-10px`,cursor:`se-resize`}),bottomLeft:Q(Q({},aS),{left:`-10px`,bottom:`-10px`,cursor:`sw-resize`}),topLeft:Q(Q({},aS),{left:`-10px`,top:`-10px`,cursor:`nw-resize`})},sS=(0,U.memo)(function(e){var t=e.onResizeStart,n=e.direction,r=e.children,i=e.replaceStyles,a=e.className,o=(0,U.useCallback)(function(e){t(e,n)},[t,n]),s=(0,U.useCallback)(function(e){t(e,n)},[t,n]),c=(0,U.useMemo)(function(){return Q(Q({position:`absolute`,userSelect:`none`},oS[n]),i??{})},[i,n]);return(0,nS.jsx)(`div`,{className:a||void 0,style:c,onMouseDown:o,onTouchStart:s,children:r})}),cS=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),lS=function(){return lS=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},lS.apply(this,arguments)},uS={width:`auto`,height:`auto`},dS=function(e,t,n){return Math.max(Math.min(e,n),t)},fS=function(e,t,n){var r=Math.round(e/t);return r*t+n*(r-1)},pS=function(e,t){return new RegExp(e,`i`).test(t)},mS=function(e){return!!(e.touches&&e.touches.length)},hS=function(e){return!!((e.clientX||e.clientX===0)&&(e.clientY||e.clientY===0))},gS=function(e,t,n){n===void 0&&(n=0);var r=t.reduce(function(n,r,i){return Math.abs(r-e)<Math.abs(t[n]-e)?i:n},0),i=Math.abs(t[r]-e);return n===0||i<n?t[r]:e},_S=function(e){return e=e.toString(),e===`auto`||e.endsWith(`px`)||e.endsWith(`%`)||e.endsWith(`vh`)||e.endsWith(`vw`)||e.endsWith(`vmax`)||e.endsWith(`vmin`)?e:`${e}px`},vS=function(e,t,n,r){if(e&&typeof e==`string`){if(e.endsWith(`px`))return Number(e.replace(`px`,``));if(e.endsWith(`%`)){var i=Number(e.replace(`%`,``))/100;return t*i}if(e.endsWith(`vw`)){var i=Number(e.replace(`vw`,``))/100;return n*i}if(e.endsWith(`vh`)){var i=Number(e.replace(`vh`,``))/100;return r*i}}return e},yS=function(e,t,n,r,i,a,o){return r=vS(r,e.width,t,n),i=vS(i,e.height,t,n),a=vS(a,e.width,t,n),o=vS(o,e.height,t,n),{maxWidth:r===void 0?void 0:Number(r),maxHeight:i===void 0?void 0:Number(i),minWidth:a===void 0?void 0:Number(a),minHeight:o===void 0?void 0:Number(o)}},bS=function(e){return Array.isArray(e)?e:[e,e]},xS=`as.ref.style.className.grid.gridGap.snap.bounds.boundsByDirection.size.defaultSize.minWidth.minHeight.maxWidth.maxHeight.lockAspectRatio.lockAspectRatioExtraWidth.lockAspectRatioExtraHeight.enable.handleStyles.handleClasses.handleWrapperStyle.handleWrapperClass.children.onResizeStart.onResize.onResizeStop.handleComponent.scale.resizeRatio.snapGap`.split(`.`),SS=`__resizable_base__`,CS=function(e){cS(t,e);function t(t){var n=e.call(this,t)||this;return n.ratio=1,n.resizable=null,n.parentLeft=0,n.parentTop=0,n.resizableLeft=0,n.resizableRight=0,n.resizableTop=0,n.resizableBottom=0,n.targetLeft=0,n.targetTop=0,n.delta={width:0,height:0},n.appendBase=function(){if(!n.resizable||!n.window)return null;var e=n.parentNode;if(!e)return null;var t=n.window.document.createElement(`div`);return t.style.width=`100%`,t.style.height=`100%`,t.style.position=`absolute`,t.style.transform=`scale(0, 0)`,t.style.left=`0`,t.style.flex=`0 0 100%`,t.classList?t.classList.add(SS):t.className+=SS,e.appendChild(t),t},n.removeBase=function(e){var t=n.parentNode;t&&t.removeChild(e)},n.state={isResizing:!1,width:n.propsSize?.width??`auto`,height:n.propsSize?.height??`auto`,direction:`right`,original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:`100%`,width:`100%`,backgroundColor:`rgba(0,0,0,0)`,cursor:`auto`,opacity:0,position:`fixed`,zIndex:9999,top:`0`,left:`0`,bottom:`0`,right:`0`},flexBasis:void 0},n.onResizeStart=n.onResizeStart.bind(n),n.onMouseMove=n.onMouseMove.bind(n),n.onMouseUp=n.onMouseUp.bind(n),n}return Object.defineProperty(t.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"window",{get:function(){return!this.resizable||!this.resizable.ownerDocument?null:this.resizable.ownerDocument.defaultView},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||uS},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){var e=0,t=0;if(this.resizable&&this.window){var n=this.resizable.offsetWidth,r=this.resizable.offsetHeight,i=this.resizable.style.position;i!==`relative`&&(this.resizable.style.position=`relative`),e=this.resizable.style.width===`auto`?n:this.resizable.offsetWidth,t=this.resizable.style.height===`auto`?r:this.resizable.offsetHeight,this.resizable.style.position=i}return{width:e,height:t}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sizeStyle",{get:function(){var e=this,t=this.props.size,n=function(t){if(e.state[t]===void 0||e.state[t]===`auto`)return`auto`;if(e.propsSize&&e.propsSize[t]&&e.propsSize[t]?.toString().endsWith(`%`)){if(e.state[t].toString().endsWith(`%`))return e.state[t].toString();var n=e.getParentSize();return`${Number(e.state[t].toString().replace(`px`,``))/n[t]*100}%`}return _S(e.state[t])};return{width:t&&t.width!==void 0&&!this.state.isResizing?_S(t.width):n(`width`),height:t&&t.height!==void 0&&!this.state.isResizing?_S(t.height):n(`height`)}},enumerable:!1,configurable:!0}),t.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var e=this.appendBase();if(!e)return{width:0,height:0};var t=!1,n=this.parentNode.style.flexWrap;n!==`wrap`&&(t=!0,this.parentNode.style.flexWrap=`wrap`),e.style.position=`relative`,e.style.minWidth=`100%`,e.style.minHeight=`100%`;var r={width:e.offsetWidth,height:e.offsetHeight};return t&&(this.parentNode.style.flexWrap=n),this.removeBase(e),r},t.prototype.bindEvents=function(){this.window&&(this.window.addEventListener(`mouseup`,this.onMouseUp),this.window.addEventListener(`mousemove`,this.onMouseMove),this.window.addEventListener(`mouseleave`,this.onMouseUp),this.window.addEventListener(`touchmove`,this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener(`touchend`,this.onMouseUp))},t.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener(`mouseup`,this.onMouseUp),this.window.removeEventListener(`mousemove`,this.onMouseMove),this.window.removeEventListener(`mouseleave`,this.onMouseUp),this.window.removeEventListener(`touchmove`,this.onMouseMove,!0),this.window.removeEventListener(`touchend`,this.onMouseUp))},t.prototype.componentDidMount=function(){if(!(!this.resizable||!this.window)){var e=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:e.flexBasis===`auto`?void 0:e.flexBasis})}},t.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},t.prototype.createSizeForCssProperty=function(e,t){var n=this.propsSize&&this.propsSize[t];return this.state[t]===`auto`&&this.state.original[t]===e&&(n===void 0||n===`auto`)?`auto`:e},t.prototype.calculateNewMaxFromBoundary=function(e,t){var n=this.props.boundsByDirection,r=this.state.direction,i=n&&pS(`left`,r),a=n&&pS(`top`,r),o,s;if(this.props.bounds===`parent`){var c=this.parentNode;c&&(o=i?this.resizableRight-this.parentLeft:c.offsetWidth+(this.parentLeft-this.resizableLeft),s=a?this.resizableBottom-this.parentTop:c.offsetHeight+(this.parentTop-this.resizableTop))}else this.props.bounds===`window`?this.window&&(o=i?this.resizableRight:this.window.innerWidth-this.resizableLeft,s=a?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(o=i?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),s=a?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return o&&Number.isFinite(o)&&(e=e&&e<o?e:o),s&&Number.isFinite(s)&&(t=t&&t<s?t:s),{maxWidth:e,maxHeight:t}},t.prototype.calculateNewSizeFromDirection=function(e,t){var n=this.props.scale||1,r=bS(this.props.resizeRatio||1),i=r[0],a=r[1],o=this.state,s=o.direction,c=o.original,l=this.props,u=l.lockAspectRatio,d=l.lockAspectRatioExtraHeight,f=l.lockAspectRatioExtraWidth,p=c.width,m=c.height,h=d||0,g=f||0;return pS(`right`,s)&&(p=c.width+(e-c.x)*i/n,u&&(m=(p-g)/this.ratio+h)),pS(`left`,s)&&(p=c.width-(e-c.x)*i/n,u&&(m=(p-g)/this.ratio+h)),pS(`bottom`,s)&&(m=c.height+(t-c.y)*a/n,u&&(p=(m-h)*this.ratio+g)),pS(`top`,s)&&(m=c.height-(t-c.y)*a/n,u&&(p=(m-h)*this.ratio+g)),{newWidth:p,newHeight:m}},t.prototype.calculateNewSizeFromAspectRatio=function(e,t,n,r){var i=this.props,a=i.lockAspectRatio,o=i.lockAspectRatioExtraHeight,s=i.lockAspectRatioExtraWidth,c=r.width===void 0?10:r.width,l=n.width===void 0||n.width<0?e:n.width,u=r.height===void 0?10:r.height,d=n.height===void 0||n.height<0?t:n.height,f=o||0,p=s||0;if(a){var m=(u-f)*this.ratio+p,h=(d-f)*this.ratio+p,g=(c-p)/this.ratio+f,_=(l-p)/this.ratio+f,v=Math.max(c,m),y=Math.min(l,h),b=Math.max(u,g),x=Math.min(d,_);e=dS(e,v,y),t=dS(t,b,x)}else e=dS(e,c,l),t=dS(t,u,d);return{newWidth:e,newHeight:t}},t.prototype.setBoundingClientRect=function(){var e=1/(this.props.scale||1);if(this.props.bounds===`parent`){var t=this.parentNode;if(t){var n=t.getBoundingClientRect();this.parentLeft=n.left*e,this.parentTop=n.top*e}}if(this.props.bounds&&typeof this.props.bounds!=`string`){var r=this.props.bounds.getBoundingClientRect();this.targetLeft=r.left*e,this.targetTop=r.top*e}if(this.resizable){var i=this.resizable.getBoundingClientRect(),a=i.left,o=i.top,s=i.right,c=i.bottom;this.resizableLeft=a*e,this.resizableRight=s*e,this.resizableTop=o*e,this.resizableBottom=c*e}},t.prototype.onResizeStart=function(e,t){if(!(!this.resizable||!this.window)){var n=0,r=0;if(e.nativeEvent&&hS(e.nativeEvent)?(n=e.nativeEvent.clientX,r=e.nativeEvent.clientY):e.nativeEvent&&mS(e.nativeEvent)&&(n=e.nativeEvent.touches[0].clientX,r=e.nativeEvent.touches[0].clientY),!(this.props.onResizeStart&&this.resizable&&this.props.onResizeStart(e,t,this.resizable)===!1)){this.props.size&&(this.props.size.height!==void 0&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),this.props.size.width!==void 0&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio=typeof this.props.lockAspectRatio==`number`?this.props.lockAspectRatio:this.size.width/this.size.height;var i,a=this.window.getComputedStyle(this.resizable);if(a.flexBasis!==`auto`){var o=this.parentNode;if(o){var s=this.window.getComputedStyle(o).flexDirection;this.flexDir=s.startsWith(`row`)?`row`:`column`,i=a.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var c={original:{x:n,y:r,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:lS(lS({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(e.target).cursor||`auto`}),direction:t,flexBasis:i};this.setState(c)}}},t.prototype.onMouseMove=function(e){var t=this;if(!(!this.state.isResizing||!this.resizable||!this.window)){if(this.window.TouchEvent&&mS(e))try{e.preventDefault(),e.stopPropagation()}catch{}var n=this.props,r=n.maxWidth,i=n.maxHeight,a=n.minWidth,o=n.minHeight,s=mS(e)?e.touches[0].clientX:e.clientX,c=mS(e)?e.touches[0].clientY:e.clientY,l=this.state,u=l.direction,d=l.original,f=l.width,p=l.height,m=this.getParentSize(),h=yS(m,this.window.innerWidth,this.window.innerHeight,r,i,a,o);r=h.maxWidth,i=h.maxHeight,a=h.minWidth,o=h.minHeight;var g=this.calculateNewSizeFromDirection(s,c),_=g.newHeight,v=g.newWidth,y=this.calculateNewMaxFromBoundary(r,i);this.props.snap&&this.props.snap.x&&(v=gS(v,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(_=gS(_,this.props.snap.y,this.props.snapGap));var b=this.calculateNewSizeFromAspectRatio(v,_,{width:y.maxWidth,height:y.maxHeight},{width:a,height:o});if(v=b.newWidth,_=b.newHeight,this.props.grid){var x=fS(v,this.props.grid[0],this.props.gridGap?this.props.gridGap[0]:0),S=fS(_,this.props.grid[1],this.props.gridGap?this.props.gridGap[1]:0),C=this.props.snapGap||0,w=C===0||Math.abs(x-v)<=C?x:v,T=C===0||Math.abs(S-_)<=C?S:_;v=w,_=T}var E={width:v-d.width,height:_-d.height};if(this.delta=E,f&&typeof f==`string`){if(f.endsWith(`%`)){var D=v/m.width*100;v=`${D}%`}else if(f.endsWith(`vw`)){var O=v/this.window.innerWidth*100;v=`${O}vw`}else if(f.endsWith(`vh`)){var k=v/this.window.innerHeight*100;v=`${k}vh`}}if(p&&typeof p==`string`){if(p.endsWith(`%`)){var D=_/m.height*100;_=`${D}%`}else if(p.endsWith(`vw`)){var O=_/this.window.innerWidth*100;_=`${O}vw`}else if(p.endsWith(`vh`)){var k=_/this.window.innerHeight*100;_=`${k}vh`}}var A={width:this.createSizeForCssProperty(v,`width`),height:this.createSizeForCssProperty(_,`height`)};this.flexDir===`row`?A.flexBasis=A.width:this.flexDir===`column`&&(A.flexBasis=A.height);var ee=this.state.width!==A.width,j=this.state.height!==A.height,M=this.state.flexBasis!==A.flexBasis,N=ee||j||M;N&&(0,As.flushSync)(function(){t.setState(A)}),this.props.onResize&&N&&this.props.onResize(e,u,this.resizable,E)}}
26,t.prototype.onMouseUp=function(e){var t=this.state,n=t.isResizing,r=t.direction;t.original,!(!n||!this.resizable)&&(this.props.onResizeStop&&this.props.onResizeStop(e,r,this.resizable,this.delta),this.props.size&&this.setState({width:this.props.size.width??`auto`,height:this.props.size.height??`auto`}),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:lS(lS({},this.state.backgroundStyle),{cursor:`auto`})}))},t.prototype.updateSize=function(e){this.setState({width:e.width??`auto`,height:e.height??`auto`})},t.prototype.renderResizer=function(){var e=this,t=this.props,n=t.enable,r=t.handleStyles,i=t.handleClasses,a=t.handleWrapperStyle,o=t.handleWrapperClass,s=t.handleComponent;if(!n)return null;var c=Object.keys(n).map(function(t){return n[t]===!1?null:(0,nS.jsx)(sS,{direction:t,onResizeStart:e.onResizeStart,replaceStyles:r&&r[t],className:i&&i[t],children:s&&s[t]?s[t]:null},t)});return(0,nS.jsx)(`div`,{className:o,style:a,children:c})},t.prototype.render=function(){var e=this,t=Object.keys(this.props).reduce(function(t,n){return xS.indexOf(n)===-1&&(t[n]=e.props[n]),t},{}),n=lS(lS(lS({position:`relative`,userSelect:this.state.isResizing?`none`:`auto`},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:`border-box`,flexShrink:0});this.state.flexBasis&&(n.flexBasis=this.state.flexBasis);var r=this.props.as||`div`;return(0,nS.jsxs)(r,lS({style:n,className:this.props.className},t,{ref:function(t){t&&(e.resizable=t)},children:[this.state.isResizing&&(0,nS.jsx)(`div`,{style:this.state.backgroundStyle}),this.props.children,this.renderResizer()]}))},t.defaultProps={as:`div`,onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],gridGap:[0,0],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},t}(U.PureComponent),wS=({header:e=``,children:t,isExpanded:n,onToggle:r})=>a(Fx,{children:[e&&a(Mx,{"data-testid":`stNavSectionHeader`,onClick:r,isExpanded:n,children:[s(jx,{children:s(It,{source:e,allowHTML:!1,isLabel:!0,disableLinks:!0,truncate:!0,inheritFont:!0})}),s(Ax,{isExpanded:n,children:s(B,{iconValue:`:material/expand_more:`,size:`lg`})})]}),n&&t]}),TS=10,ES=(0,yi.getLogger)(`SidebarNav`);function DS({pageUrl:e,page:t,isActive:n,onClick:r,widgetsDisabled:i}){let a=t.pageName;return s(Dx,{children:s(Kx,{isActive:n,pageUrl:e,icon:t.icon,onClick:r,widgetsDisabled:i,isExternal:Jx(t),externalUrl:qx(t),children:a})})}function OS(e,t,n,r,i,a,o){let c=[],l=a;return Object.entries(e).forEach(([e,a])=>{let u=[...a],d=u,f=r[e];if(t){let e=o-l;e<=0?d=[]:u.length>e&&(d=u.slice(0,e))}f&&(l+=d.length),d.length>0&&c.push(s(wS,{header:e,isExpanded:f,onToggle:()=>i(e),children:d.map(n)},e))}),{sections:c,updatedPageCount:l}}var kS=({endpoints:e,collapseSidebar:t,hasSidebarElements:n,widgetsDisabled:r})=>{let[i,o]=(0,U.useState)(!1),{expandSidebarNav:c,sidebarNavVisibleItems:l}=(0,U.useContext)(_h),{pageLinkBaseUrl:u,appPages:d,onPageChange:f,currentPageScriptHash:p}=(0,U.useContext)(fh),m=R(l)&&l>0?l:TS,h=m+2,g=`stSidebarSectionsState-${u}`,[_,v]=(0,U.useState)(null),y=(0,U.useMemo)(()=>$x(d),[d]),b=(0,U.useMemo)(()=>Qx(Xx(y)),[y]),x=(0,U.useMemo)(()=>{if(!(Object.keys(b.sections).length>0))return y.length;let e=b.individualPages.length;return Object.entries(b.sections).forEach(([t,n])=>{_?.[t]&&(e+=n.length)}),e},[y.length,_,b]);(0,U.useEffect)(()=>{let e=L()&&window.localStorage.getItem(`sidebarNavState`)===`expanded`;!i&&(c||e)&&o(!0)},[i,c]),(0,U.useEffect)(()=>{let e={};if(L()){let t=window.localStorage.getItem(g);if(t)try{e=JSON.parse(t)}catch(e){ES.warn(`Could not parse sidebar nav state from localStorage`,e)}}let t=Object.keys(b.sections).reduce((t,n)=>(t[n]=e[n]??!0,t),{});v(t)},[b.sections,g]),(0,U.useEffect)(()=>{L()&&_&&window.localStorage.setItem(g,JSON.stringify(_))},[_,g]);let S=(0,U.useCallback)(e=>{v(t=>t?{...t,[e]:!t[e]}:null)},[]),C=(0,U.useCallback)(()=>{let e=!i;L()&&(e?window.localStorage.setItem(`sidebarNavState`,`expanded`):window.localStorage.removeItem(`sidebarNavState`)),o(e)},[i]),w=(0,U.useCallback)((n,i)=>{let a=e.buildAppPageURL(u,n),o=n.pageScriptHash===p,c=Jx(n);return s(DS,{pageUrl:a,page:n,isActive:o,onClick:e=>{if(c){Vh()&&t();return}e.preventDefault(),f(n.pageScriptHash),Vh()&&t()},widgetsDisabled:r},`${n.pageName}-${i}`)},[t,p,e,f,u,r]);if(!_)return null;let T=[],E=n&&x>h&&!c,D=E&&!i,O=0;if(b.individualPages.length>0){let e=D?b.individualPages.slice(0,m):b.individualPages;T.push(...e.map(w)),O+=e.length}if(Object.keys(b.sections).length>0){let e=OS(b.sections,D,w,_,S,O,m);T.push(...e.sections)}return a(Cx,{"data-testid":`stSidebarNav`,children:[s(wx,{"data-testid":`stSidebarNavItems`,children:T}),E&&s(Nx,{onClick:C,"data-testid":`stSidebarNavViewButton`,children:i?`View less`:`View ${x-m} more`}),n&&s(Px,{"data-testid":`stSidebarNavSeparator`})]})};function AS(e){return parseInt(e,10)-.02}function jS(e,t,n){switch(e){case y.SidebarState.EXPANDED:return!1;case y.SidebarState.COLLAPSED:return!0;case y.SidebarState.LOCKED:return n<=t;case y.SidebarState.AUTO:default:return n<=t}}var MS=e=>`stSidebarCollapsed-${e}`,NS=e=>{if(!L())return null;let t=window.localStorage.getItem(MS(e));return t===null?null:t===`true`},PS=(e,t)=>{L()&&window.localStorage.setItem(MS(e),t.toString())};function FS(e){return Number.isNaN(e)?Number.parseInt(`300`,10):Math.min(600,Math.max(200,e))}var IS=({endpoints:e,children:t,hasElements:n,isCollapsed:r,onToggleCollapse:i,widgetsDisabled:o})=>{let c=on(),l=AS(c.breakpoints.md),{innerWidth:u}=Qh(),{appPages:d}=(0,U.useContext)(fh),{hideSidebarNav:f,appLogo:p,initialSidebarWidth:m,appRootRef:h,isSidebarLocked:g}=(0,U.useContext)(_h),_=u>0&&u<=l,v=hg(),y=(0,U.useRef)(null),b=L()?window.localStorage.getItem(`sidebarWidth`):void 0,[x,S]=(0,U.useState)(()=>(()=>
26{if(b){let e=Number.parseInt(b,10);return Number.isNaN(e)?null:FS(e).toString()}return null})()||(R(m)?FS(m).toString():`300`)),[C,w]=(0,U.useState)(u??1/0),[T,E]=(0,U.useState)(!1),D=(0,U.useCallback)(()=>{E(!0)},[]),O=(0,U.useCallback)(()=>{E(!1)},[]),k=(0,U.useCallback)(e=>{let t=FS(e).toString();S(t),L()&&window.localStorage.setItem(`sidebarWidth`,t)},[]),A=(0,U.useCallback)((e,t,n,r)=>{if(n){let e=n.clientWidth||n.offsetWidth;k(e)}},[k]);ql(()=>{u<C&&u<=l&&!r&&i(!0,!1),w(u)},[u]),(0,U.useEffect)(()=>{let e=e=>{let t=y.current,n=h?.current,a=e.target;if(!t||!a)return;let o=t.contains(a),s=n?.contains(a)??!1;!o&&s&&u<=l&&!r&&i(!0)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[l,r,i,u,h]);function ee(){let e=R(m)?FS(m).toString():`300`;S(e),L()&&window.localStorage.setItem(`sidebarWidth`,e)}let j=(0,U.useCallback)(()=>{i(!r)},[r,i]),M=()=>p?s(by,{appLogo:p,endpoints:e,collapsed:r,componentName:`Sidebar Logo`,dataTestId:`stSidebarLogo`}):s(gy,{"data-testid":`stLogoSpacer`}),N=Yx(d)&&!f;return s(CS,{className:`stSidebar`,"data-testid":`stSidebar`,"aria-expanded":!r,enable:{top:!1,right:!0,bottom:!1,left:!1},handleStyles:{right:{width:`8px`,right:`-6px`}},handleComponent:{right:s(ly,{"data-testid":`stSidebarResizeHandle`,onDoubleClick:ee})},size:{width:x,height:`auto`},as:oy,onResizeStop:A,isCollapsed:r,sidebarWidth:x,windowInnerWidth:u,children:a(cy,{"data-testid":`stSidebarContent`,ref:y,onMouseOver:D,onMouseOut:O,scrollbarGutterSize:v,children:[a(uy,{"data-testid":`stSidebarHeader`,children:[M(),(!g||_)&&s(_y,{showSidebarCollapse:T,"data-testid":`stSidebarCollapseButton`,children:s(Vr,{kind:V.HEADER_NO_PADDING,onClick:j,children:s(B,{size:`xl`,iconValue:`:material/keyboard_double_arrow_left:`,color:c.colors.fadedText60})})})]}),N&&s(kS,{endpoints:e,collapseSidebar:j,hasSidebarElements:n,widgetsDisabled:o}),s(sy,{hasPageNavAbove:N,"data-testid":`stSidebarUserContent`,children:t})]})})};function LS(e){return s(Bt.Provider,{value:!0,children:s(IS,{...e})})}var RS=({children:e,...t})=>{let{activeTheme:n}=(0,U.useContext)(vh),r=Qe(n);return s(yh,{theme:r.emotion,children:s(LS,{...t,children:e})})},zS=d(`div`,{target:`e15ve43o0`})({display:`flex`,flexDirection:`row`,justifyContent:`flex-start`,alignItems:`stretch`,alignContent:`flex-start`,position:`absolute`,top:0,left:0,right:0,bottom:0,overflow:`hidden`,"@media print":{overflow:`visible`}}),BS=d(`section`,{target:`e15ve43o1`})(({disableScrolling:e,theme:t})=>({display:`flex`,flexDirection:`column`,width:t.sizes.full,overflow:e?`hidden`:`auto`,alignItems:`center`,height:`100dvh`,"&:focus":{outline:`none`},"@media not print":{[`@media (max-width: ${t.breakpoints.md})`]:{position:`absolute`,top:0,left:0,right:0,bottom:0,height:`100dvh`}},"@media print":{overflow:`visible`}})),VS=d(`div`,{target:`e15ve43o2`})(({theme:e})=>({position:`sticky`,left:0,bottom:0,width:`100%`,zIndex:e.zIndices.bottom,"@media print":{position:`static`}})),HS=d(`div`,{target:`e15ve43o3`})(({theme:e})=>({position:`relative`,bottom:0,width:`100%`,minWidth:`100%`,backgroundColor:e.colors.bgColor,display:`flex`,flexDirection:`column`,alignItems:`center`})),US=e=>({[`@media (min-width: calc(${e.sizes.contentMaxWidth} + 2 * (${e.sizes.wideSidePadding} - ${e.spacing.lg})))`]:{paddingLeft:e.sizes.wideSidePadding,paddingRight:e.sizes.wideSidePadding},minWidth:`auto`,maxWidth:`initial`}),WS=d(`div`,{target:`e15ve43o4`})(({hasBottom:e,isWideMode:t,showPadding:n,hasHeader:r,showToolbar:i,hasTopNav:a,hasSidebar:o,embedded:s,theme:c})=>{let l=`2.25rem`,u=l;s?n||i?u=`6rem`:(r||o)&&(u=`4.5rem`):u=a?`8rem`:`6rem`;let d=n&&!e?`10rem`:c.spacing.lg;return{width:c.sizes.full,paddingLeft:c.spacing.lg,paddingRight:c.spacing.lg,paddingTop:u,paddingBottom:d,maxWidth:c.sizes.contentMaxWidth,...t&&US(c),"@media print":{paddingTop:l}}}),GS=d(`div`,{target:`e15ve43o5`})(({theme:e})=>({width:e.sizes.full})),KS=d(`div`,{target:`e15ve43o6`})({display:`none`}),qS=d(`div`,{target:`e15ve43o7`})(({isWideMode:e,showPadding:t,theme:n})=>({width:n.sizes.full,paddingLeft:n.spacing.lg,paddingRight:n.spacing.lg,paddingTop:n.spacing.lg,paddingBottom:t?n.sizes.appDefaultBottomPadding:n.spacing.threeXL,maxWidth:n.sizes.contentMaxWidth,...e&&US(n),"@media print":{paddingTop:n.spacing.none}})),JS=d(`div`,{target:`e15ve43o8`})(({theme:e})=>({width:e.sizes.full,flexGrow:1})),YS=d(`div`,{target:`e15ve43o9`})(({theme:e})=>({position:`relative`,bottom:e.spacing.none})),XS=d(`div`,{target:`e15ve43o10`})(({theme:e})=>({width:e.sizes.full,minWidth:0,height:`100dvh`,[`@media (min-width: ${e.breakpoints.md})`]:{position:`relative`}})),ZS=d(`div`,{target:`e15ve43o11`})(({theme:e})=>({position:`fixed`,top:e.sizes.headerHeight,right:0,display:`flex`,flexDirection:`column`,alignItems:`flex-end`,zIndex:e.zIndices.toast,marginLeft:e.spacing.lg,marginRight:e.spacing.lg}));function QS(e){let{className:t,tabIndex:n,children:r,isEmbedded:i,disableScrolling:a}=e,o=Ff(!0);return s(BS,{tabIndex:n,className:t,isEmbedded:i,disableScrolling:a,ref:o,"data-testid":`stAppScrollToBottomContainer`,children:r})}function $S(e){if(e instanceof za)return e.element.type===`chatInput`;if(e instanceof Ra)return e.children.some($S);if(e instanceof Ia){let t=e.anchor?$S(e.anchor):!1,n=e.transientNodes.some(e=>e.element.type===`chatInput`);return t||n}return!1}function eC(e){let{elements:t,widgetMgr:n,uploadClient:r,sendMessageToHost:i,endpoints:o,navigationPosition:c,top
26RightContent:l,wideMode:u,embedded:d,showPadding:f,disableScrolling:p,addScriptFinishedHandler:m,removeScriptFinishedHandler:h,widgetsDisabled:g,showToolbar:_,disableFullscreenMode:v,componentRegistry:y,skillsNudge:b}=e,x=on(),S=(0,U.useRef)(null),[C,w]=(0,U.useState)(0),T=!!b;(0,U.useEffect)(()=>{let e=S.current;if(!e){w(0);return}let t=new ResizeObserver(e=>{w(e[0]?.contentRect.height??0)});return t.observe(e),()=>t.disconnect()},[T]),(0,U.useEffect)(()=>{let e=()=>{i({type:`UPDATE_HASH`,hash:window.location.hash})};return window.addEventListener(`hashchange`,e,!1),()=>window.removeEventListener(`hashchange`,e,!1)},[i]);let{activeTheme:D}=(0,U.useContext)(vh),{appPages:O,pageLinkBaseUrl:k}=(0,U.useContext)(fh),{initialSidebarState:A,appLogo:ee,hideSidebarNav:j,isSidebarLocked:M}=(0,U.useContext)(_h),{innerWidth:N}=Qh(),te=N>0&&N<=AS(D.emotion.breakpoints.md),ne=M&&!te,re=u?`wide`:`narrow`,ie=!t.sidebar.isEmpty,ae=!t.event.isEmpty,oe=!t.bottom.isEmpty,[P,se]=(0,U.useState)(!1),F=N>0&&(ie||c===E.Position.SIDEBAR&&!j&&Yx(O)||P);(0,U.useEffect)(()=>{F&&j&&!P&&se(!0)},[F,j,P]);let ce=(0,U.useCallback)(()=>{!ie&&P&&se(!1)},[ie,P]);(0,U.useEffect)(()=>(m(ce),()=>{h(ce)}),[ce,m,h]);let le=(0,U.useMemo)(()=>oe&&$S(t.bottom),[oe,t.bottom])?QS:BS,ue=e=>s(ah,{node:e,endpoints:o,widgetMgr:n,widgetsDisabled:g,uploadClient:r,disableFullscreenMode:v,componentRegistry:y,height:`auto`,isRoot:!0}),[I,de]=(0,U.useState)(()=>{if(ne)return!1;let e=NS(k);return e===null?jS(A,parseInt(D.emotion.breakpoints.md,10),N):e});ql(()=>{if(N>0&&F){if(ne){de(!1);return}let e=NS(k);de(e===null?jS(A,parseInt(D.emotion.breakpoints.md,10),N):e)}},[N,F,A,D.emotion.breakpoints.md,k,ne]);let L=(0,U.useCallback)((e,t=!0)=>{ne||(de(e),t&&PS(k,e))},[ne,k]),fe=(0,U.useCallback)(()=>{L(!I,!0)},[L,I]),pe=ee?s(by,{appLogo:ee,endpoints:o,collapsed:I||!F,componentName:`Header Logo`,dataTestId:`stHeaderLogo`}):null,me=pe&&(!F||I),he=F&&I,ge=c===E.Position.TOP&&Yx(O),R=me||he||ge||_;return a(zS,{className:`stAppViewContainer appview-container`,"data-testid":`stAppViewContainer`,"data-layout":re,children:[F&&s(Wh,{id:`Sidebar`,children:s(RS,{endpoints:o,hasElements:ie,isCollapsed:I,onToggleCollapse:L,widgetsDisabled:g,children:s(GS,{children:ue(t.sidebar)})})}),a(XS,{children:[s(iy,{hasSidebar:F,isSidebarOpen:F&&!I,onToggleSidebar:fe,navigation:c===E.Position.TOP&&Yx(O)?s(tS,{endpoints:o,widgetsDisabled:g}):null,rightContent:l,logoComponent:pe,showToolbar:_}),a(le,{tabIndex:0,isEmbedded:d,disableScrolling:p,className:`stMain`,"data-testid":`stMain`,children:[s(Wh,{id:`Main`,children:s(WS,{className:`stMainBlockContainer block-container`,"data-testid":`stMainBlockContainer`,isWideMode:u,showPadding:f,hasBottom:oe,hasHeader:R,hasSidebar:F,showToolbar:_,hasTopNav:ge,embedded:d,children:ue(t.main)})}),!oe&&s(YS,{"data-testid":`stAppIframeResizerAnchor`,"data-iframe-height":!0}),oe&&a(Wh,{id:`Bottom`,children:[s(JS,{}),s(VS,{className:`stBottom`,"data-testid":`stBottom`,children:s(HS,{children:s(qS,{"data-testid":`stBottomBlockContainer`,isWideMode:u,showPadding:f,children:ue(t.bottom)})})})]})]})]}),T&&s(ZS,{ref:S,"data-testid":`stSkillsNudgeAnchor`,children:b}),s(Nh,{queue:kh,"aria-label":`Notifications`,"data-testid":`stToastContainer`,className:`stToastContainer`,style:C>0?{top:`calc(${x.sizes.headerHeight} + ${C}px + ${x.spacing.sm})`}:void 0,children:({toast:e})=>s(Bh,{toast:e})}),ae&&s(Wh,{id:`Event`,children:s(KS,{className:`stEvent`,"data-testid":`stEvent`,children:ue(t.event)})})]})}var tC=d(`div`,{target:`e19wr9s00`})(({theme:e})=>({display:`flex`,gap:e.spacing.sm,alignItems:`center`,lineHeight:e.iconSizes.md})),nC=({onClick:e})=>s(`div`,{className:`stAppDeployButton`,"data-testid":`stAppDeployButton`,children:s(Vr,{kind:V.HEADER_BUTTON,onClick:e,children:s(tC,{children:s(`span`,{children:`Deploy`})})})});function rC(e){return e===`Escape`||e===`Esc`?`esc`:e.toLowerCase()}function iC({keyName:e,onKeyDown:t,onKeyUp:n,children:r}){let i=(0,U.useRef)(t),a=(0,U.useRef)(n);return i.current=t,a.current=n,(0,U.useEffect)(()=>{let t=new Set(e.split(`,`).map(e=>rC(e.trim()))),n=new Set,r=e=>
26{let r=rC(e.key),a=e.altKey||e.ctrlKey||e.metaKey||e.shiftKey&&r.length!==1;!t.has(r)||n.has(r)||e.repeat||a||xd(e)||(n.add(r),i.current?.(r,e))},o=e=>{let t=rC(e.key);n.delete(t)&&a.current?.(t,e)},s=()=>{n.clear()};return document.addEventListener(`keydown`,r),document.addEventListener(`keyup`,o),window.addEventListener(`blur`,s),()=>{document.removeEventListener(`keydown`,r),document.removeEventListener(`keyup`,o),window.removeEventListener(`blur`,s)}},[e]),s(u,{children:r})}var aC=`video/webm`,oC=(0,yi.getLogger)(`ScreenCastRecorder`),sC=class{static isSupportedBrowser(){try{return R(navigator.mediaDevices)&&R(navigator.mediaDevices.getUserMedia)&&R(navigator.mediaDevices.getDisplayMedia)&&MediaRecorder.isTypeSupported(aC)}catch{return!1}}constructor({recordAudio:e,onErrorOrStop:t}){this.recordAudio=e,this.onErrorOrStopCallback=t,this.inputStream=null,this.recordedChunks=[],this.mediaRecorder=null}async initialize(){let e=(await navigator.mediaDevices.getDisplayMedia({video:!0})).getTracks();if(this.recordAudio){let t=await navigator.mediaDevices.getUserMedia({video:!1,audio:!0});e=e.concat(t.getAudioTracks())}this.recordedChunks=[],this.inputStream=new MediaStream(e),this.mediaRecorder=new MediaRecorder(this.inputStream,{mimeType:aC}),this.mediaRecorder.ondataavailable=e=>this.recordedChunks.push(e.data)}getState(){return this.mediaRecorder?this.mediaRecorder.state:`inactive`}start(){if(!this.mediaRecorder)return oC.warn(`ScreenCastRecorder.start: mediaRecorder is null`),!1;let e=e=>{oC.warn(`mediaRecorder.start threw an error: ${String(e)}`)};this.mediaRecorder.onerror=t=>{e(t),this.onErrorOrStopCallback()},this.mediaRecorder.onstop=()=>this.onErrorOrStopCallback();try{this.mediaRecorder.start()}catch(t){return e(t),!1}return!0}stop(){if(!this.mediaRecorder)return;let e,t=new Promise(t=>{e=t});return this.mediaRecorder.onstop=()=>e(),this.mediaRecorder.stop(),this.inputStream&&=(this.inputStream.getTracks().forEach(e=>e.stop()),null),t.then(()=>this.buildOutputBlob())}buildOutputBlob(){return new Blob(this.recordedChunks,{type:aC})}};function cC(e){return!(e instanceof HTMLElement)||e.tabIndex<0||`disabled`in e&&e.disabled||e.hidden?NodeFilter.FILTER_SKIP:e.closest(`[inert]`)?NodeFilter.FILTER_REJECT:`checkVisibility`in e&&!e.checkVisibility({visibilityProperty:!0})?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT}function lC(e){let t=document.createTreeWalker(document.body,NodeFilter.SHOW_ELEMENT,{acceptNode:cC});t.currentNode=e,t.nextNode()?.focus()}function uC(e){let t=document.createTreeWalker(document.body,NodeFilter.SHOW_ELEMENT,{acceptNode:cC});t.currentNode=e,t.previousNode()?.focus()}var dC=e=>g(`0%{box-shadow:0 0 `,e.spacing.twoXS,` `,e.colors.redTextColor,`;}50%{box-shadow:0 0 `,e.spacing.sm,` `,e.spacing.twoXS,` `,e.colors.redTextColor,`;}100%{box-shadow:0 0 `,e.spacing.twoXS,` `,e.colors.redTextColor,`;}`),fC=d(`div`,{target:`enqxyix0`})(({theme:e})=>({position:`absolute`,bottom:e.spacing.lg,right:e.spacing.sm,width:e.spacing.sm,height:e.spacing.sm,backgroundColor:e.colors.redTextColor,borderRadius:e.radii.full,boxShadow:`0 0 ${e.spacing.twoXS} ${e.colors.redTextColor}`,animation:`${dC(e)} 2s linear infinite`})),pC=d(`div`,{target:`enqxyix1`})(({theme:e})=>({borderTop:`${e.sizes.borderWidth} solid ${e.colors.borderColor}`,width:`100%`})),mC=d(`div`,{target:`enqxyix2`})(({theme:e})=>({padding:e.spacing.sm,minWidth:e.sizes.appMainMenu,"@media print":{display:`none`}})),hC=d(`div`,{target:`enqxyix3`})(({theme:e})=>({display:`flex`,flexDirection:`column`,alignItems:`stretch`,gap:e.spacing.xs})),gC=d(`span`,{target:`enqxyix4`})({lineHeight:`initial`}),_C=d(`button`,{target:`enqxyix5`})(({theme:e,isRecording:t})=>({display:`flex`,alignItems:`center`,padding:`${e.spacing.threeXS} ${e.spacing.sm}`,border:`none`,borderRadius:e.radii.default,backgroundColor:e.colors.transparent,cursor:`pointer`,fontSize:e.fontSizes.sm,lineHeight:`${e.lineHeights.small}rem`,textAlign:`left`,color:t?e.colors.redTextColor:e.colors.bodyText,fontWeight:t?e.fontWeights.bold:e.fontWeights.normal,transition:`background-color 100ms ease`,"&:hover, &:focus-visible":{backgroundColor:e.colors.darkenedBgMix15},"&:focus":{outline:`none`},"&:focus-visible":{boxShadow:e.shadows.focusRingMuted},'&[aria-disabled="true"]':{color:e.colors.fadedText60,cursor:`not-allowed`},'&[aria-disabled="true"]:hover':{backgroundColor:e.colors.transparent}})),vC=d(`span`,{target:`enqxyix6`})(({theme:e})=>({display:`flex`,alignItems:`center`,width:`100%`,gap:e.spacing.sm})),yC=d(`span`,{target:`enqxyix7`})({display:`inline-flex`,alignItems:`center`,minWidth:0,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`}),bC=d(`kbd`,{target:`enqxyix8`})(({theme:e})=>({display:`inline-flex`,alignItems:`center`,justifyContent:`center`,whiteSpace:`nowrap`,fontSize:e.fontSizes.sm,opacity:e.opacities.secondary,fontFamily:`inherit`,lineHeight:e.lineHeights.tight,letterSpacing:`0.01em`})),xC=d(`div`,{target:`enqxyix9`})(({theme:e})=>({display:`flex`,flexDirection:`row`,gap:e.spacing.threeXS,width:`100%`})),SC=d(`button`,{target:`enqxyix10`})(({theme:e,isChecked:t})=>({display:`flex`,flex:1,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:e.spacing.twoXS,padding:`${e.spacing.xs} ${e.spacing.sm}`,border:`none`,borderRadius:e.radii.default,backgroundColor:t?e.colors.darkenedBgMix25:e.colors.transparent,cursor:`pointer`,fontSize:e.fontSizes.sm,lineHeight:e.lineHeights.tight,color:e.colors.bodyText,transition:`background-color 100ms ease`,"&:hover":{backgroundColor:t?e.colors.darkenedBgMix25:e.colors.darkenedBgMix15},"&:focus":{outline:`none`},"&:focus-visible":{boxShadow:e.shadows.focusRingMuted,backgroundColor:t?e.colors.darkenedBgMix25:e.colors.darkenedBgMix15}})),CC=d(`span`,{target:`enqxyix11`})({display:`inline-flex`,alignItems:`center`,justifyContent:`center`}),wC=d(`button`,{target:`enqxyix12`})(({theme:e,isDisabled:t})=>({display:`flex`,alignItems:`center`,justifyContent:`space-between`,width:`100%`,padding:`${e.spacing.threeXS} ${e.spacing.sm}`,border:`none`,borderRadius:e.radii.default,backgroundColor:e.colors.transparent,cursor:t?`not-allowed`:`pointer`,color:t?e.colors.fadedText60:e.colors.bodyText,fontSize:e.fontSizes.sm,lineHeight:`${e.lineHeights.small}rem`,textAlign:`left`,fontWeight:e.fontWeights.normal,transition:`background-color 100ms ease`,"&:hover":{backgroundColor:t?e.colors.transparent:e.colors.darkenedBgMix15},"&:focus":{outline:`none`},"&:focus-visible":{backgroundColor:e.colors.darkenedBgMix15,boxSh
26adow:e.shadows.focusRingMuted}})),TC=d(`div`,{target:`enqxyix13`})(({theme:e,isChecked:t,isDisabled:n})=>({display:`flex`,alignItems:`center`,flexShrink:0,width:`calc(2 * ${e.sizes.checkbox})`,minWidth:`calc(2 * ${e.sizes.checkbox})`,height:e.sizes.checkbox,minHeight:e.sizes.checkbox,padding:`0 ${e.spacing.threeXS}`,borderRadius:e.radii.full,backgroundColor:t&&!n?e.colors.primary:e.colors.borderColor,transition:`background-color 100ms ease`})),EC=d(`div`,{target:`enqxyix14`})(({theme:e,isChecked:t,isDisabled:n})=>{let r=he(e),i=r?e.colors.bgColor:e.colors.bodyText;return n&&(i=r?e.colors.gray70:e.colors.gray90),{width:`calc(${e.sizes.checkbox} - ${e.spacing.twoXS})`,height:`calc(${e.sizes.checkbox} - ${e.spacing.twoXS})`,borderRadius:e.radii.full,backgroundColor:i,transform:t?`translateX(${e.sizes.checkbox})`:`none`,transition:`transform 100ms ease, background-color 100ms ease`}}),DC=d(`div`,{target:`enqxyix15`})(({theme:e})=>({paddingLeft:e.spacing.sm,paddingRight:e.spacing.sm})),OC=d(`div`,{target:`enqxyix16`})(({theme:e})=>({display:`flex`,alignItems:`center`,gap:e.spacing.sm,marginTop:e.spacing.xs,".stMenuVersionCopyButton":{opacity:0,pointerEvents:`none`,transition:`opacity 120ms ease`},"&:hover .stMenuVersionCopyButton, &:focus-within .stMenuVersionCopyButton":{opacity:1,pointerEvents:`auto`}})),kC=d(`div`,{target:`enqxyix17`})(({theme:e})=>({...Bn(e),backgroundColor:e.colors.bgColor,zIndex:Ln(e),maxHeight:`70vh`,overflow:`auto`})),AC=d(`span`,{target:`enqxyix18`})(({theme:e})=>({display:`inline-flex`,alignItems:`center`,opacity:e.opacities.secondary,fontSize:e.fontSizes.twoSm,lineHeight:e.lineHeights.menuItem,color:e.colors.bodyText,whiteSpace:`nowrap`})),jC=[{label:`System`,icon:`:material/contrast:`},{label:`Light`,icon:`:material/light_mode:`}
26,{label:`Dark`,icon:`:material/dark_mode:`}];function MC(e,t){switch(e){case`System`:return t.find(e=>e.name===`Custom Theme Auto`||e.name===`Use system setting`);case`Light`:return t.find(e=>e.name===`Custom Theme Light`||e.name===Be.name);case`Dark`:return t.find(e=>e.name===`Custom Theme Dark`||e.name===vt.name)}}function NC(e,t,n,r){if(t.length<=1)return[];let i=_t(e);return jC.map(e=>({type:`radio`,key:`theme-${e.label}`,label:e.label,icon:e.icon,checked:i===e.label,onSelect:()=>{let i=MC(e.label,t);i&&(r.enqueue(`menuClick`,{label:`changeTheme`}),n(i))}}))}var PC=(0,U.memo)(function({item:e,tabIndex:t,itemIndex:n,setItemRef:r}){let{key:i,label:o,checked:c,disabled:l,onToggle:u}=e,d=(0,U.useCallback)(e=>{r(n,e)},[r,n]),f=(0,U.useCallback)(()=>{l||u()},[l,u]);return a(wC,{ref:d,type:`button`,isDisabled:l,role:`menuitemcheckbox`,"aria-checked":c,"aria-disabled":l||void 0,tabIndex:t,onClick:f,"data-testid":`stMainMenuItem-${i}`,children:[o,s(TC,{isChecked:c,isDisabled:l,children:s(EC,{isChecked:c,isDisabled:l})})]})}),FC=(0,yi.getLogger)(`MainMenu`),IC={COUNTDOWN:`Cancel recording`,RECORDING:`Stop recording`};function LC(e){return e.replace(/\.dev\d+/,`.dev`)}function RC(e,t){window.open(e,`_blank`)||FC.warn(`Failed to open "${t}" link. This may be due to a popup blocker. URL: ${e}`)}function zC(e){return e.type===`radio`}function BC(e){return e.type===`toggle`}function VC({isServerConnected:e,developmentMode:t,screenCastState:n,menuItems:r,hostMenuItems:i,quickRerunCallback:a,clearCacheCallback:o,printCallback:s,screencastCallback:c,aboutCallback:l,sendMessageToHost:u,isMinimalMode:d,themeSection:f,runOnSave:p,onRunOnSaveChange:m,allowRunOnSave:h,metricsMgr:g}){let _=!e,v=GC(r,i,u),y=KC(r,l);if(d)return[f,[...v,...y]];let b=WC(n,s,c);return[f,HC(t,a,_,p,m,h,g),UC(t,o,_),[...b,...y],v]}function HC(e,t,n,r,i,a,o){if(!e)return[];let s=[{type:`action`,key:`rerun`,label:`Rerun`,onClick:t,disabled:n,shortcut:`R`}];return a&&s.push({type:`toggle`,key:`autoRerun`,label:`Auto rerun`,checked:r,disabled:n,onToggle:()=>{o.enqueue(`menuClick`,{label:`autoRerun`}),i(!r)}}),s}function UC(e,t,n){return e?[{type:`action`,key:`clearCache`,label:`Clear cache`,onClick:t,disabled:n,shortcut:`C`}]:[]}function WC(e,t,n){let r=[{type:`action`,key:`print`,label:`Print`,onClick:t}];if(sC.isSupportedBrowser()){let t=IC[e]||`Record screen`;r.push({type:`action`,key:`recordScreencast`,label:t,onClick:n,isRecording:!!IC[e],shortcut:IC[e]?`ESC`:void 0})}return r}function GC(e,t,n){let r=[],i=e?.reportABugUrl;i&&!e?.hideReportABug&&r.push({type:`action`,key:`report`,label:`Report a bug`,onClick:()=>RC(i,`Report a bug`)});let a=e?.getHelpUrl;a&&!e?.hideGetHelp&&r.push({type:`action`,key:`community`,label:`Get help`,onClick:()=>RC(a,`Get help`)});for(let i of t)i.type!==`separator`&&(i.key===`reportBug`&&e?.hideGetHelp||i.key===`about`&&e?.aboutSectionMd||r.push({type:`action`,key:`host-${i.key}`,label:i.label,onClick:()=>n({type:`MENU_ITEM_CALLBACK`,key:i.key})}));return r}function KC(e,t){return e?.aboutSectionMd?[{type:`action`,key:`about`,label:`About`,onClick:t}]:[]}var qC=(0,U.memo)(function({item:e,onItemClick:t,tabIndex:n,itemIndex:r,setItemRef:i}){let o=()=>{e.disabled||t(e)},c=(0,U.useCallback)(e=>{i(r,e)},[i,r]);return s(_C,{type:`button`,ref:c,onClick:o,role:`menuitem`,"aria-disabled":e.disabled||void 0,tabIndex:n,isRecording:e.isRecording,"data-testid":`stMainMenuItem-${e.key}`,children:a(vC,{children:[s(yC,{"data-testid":`stMainMenuItemLabel`,children:e.label}),e.shortcut&&s(bC,{children:e.shortcut})]})})}),JC=(0,U.memo)(function({item:e,onRadioSelect:t,tabIndex:n,itemIndex:r,setItemRef:i}){let o=()=>{t(e)},c=(0,U.useCallback)(e=>{i(r,e)},[i,r]);return a(SC,{type:`button`,ref:c,onClick:o,role:`menuitemradio`,"aria-checked":e.checked,tabIndex:n,isChecked:e.checked,"data-testid":`stMainMenuItem-${e.key}`,children:[s(CC,{children:s(B,{iconValue:e.icon,size:`lg`})}),e.label]})}),YC=(0,U.memo)(function({sections:e,closeMenu:t,metricsMgr:n,streamlitVersion:r}){let i=on(),o=(0,U.useRef)([]),c=(0,U.useRef)(null),l=(0,U.useMemo)(()=>e.flat(),[e]),[u,d]=(0,U.useState)(0),f=Math.max(0,l.length-1),p=l.length===0?-1:Math.min(u,f),m=e=>{d(e),o.current[e]?.focus()},h=(0,U.useCallback)(e=>
26{e&&o.current[0]?.focus()},[]),g=(0,U.useCallback)((e,t)=>{o.current[e]=t},[]),_=e=>{let t=e.target,n=o.current.findIndex(e=>e===t);n!==-1&&d(n)},v=e=>{n.enqueue(`menuClick`,{label:e.label}),e.onClick(),t()},y=e=>{e.onSelect()},b=e=>{if(l.length!==0)switch(e.key){case`ArrowDown`:e.preventDefault(),m(p>=f?0:p+1);break;case`ArrowUp`:e.preventDefault(),m(p<=0?f:p-1);break;case`Home`:e.preventDefault(),m(0);break;case`End`:e.preventDefault(),m(f);break;case`Tab`:if(e.preventDefault(),r){let n=c.current?.querySelector(`.stMenuVersionCopyButton`);n?n.focus():t(e.shiftKey?`shift-tab`:`tab`)}else t(e.shiftKey?`shift-tab`:`tab`)}},x=e=>{e.key===`Tab`&&(e.preventDefault(),e.shiftKey?o.current[p]?.focus():t(`tab`))},S=[],C=0,w=0;for(let t of e)if(t.length!==0){if(S.length>0&&(S.push(s(pC,{role:`separator`,"aria-hidden":`true`,"data-testid":`stMainMenuDivider`},`divider-${C}`)),C+=1),zC(t[0])){let e=w;S.push(s(xC,{role:`group`,"aria-label":`Theme`,"data-testid":`stThemeSwitcher`,children:t.map((t,n)=>{let r=e+n;return s(JC,{item:t,onRadioSelect:y,tabIndex:p===r?0:-1,itemIndex:r,setItemRef:g},t.key)})},`theme-radio-group`)),w+=t.length}else for(let e of t)BC(e)?S.push(s(PC,{item:e,tabIndex:p===w?0:-1,itemIndex:w,setItemRef:g},e.key)):S.push(s(qC,{item:e,onItemClick:v,tabIndex:p===w?0:-1,itemIndex:w,setItemRef:g},e.key)),w+=1}return a(mC,{children:[s(hC,{ref:h,"data-testid":`stMainMenuList`,"aria-label":`Main menu`,role:`menu`,onFocus:_,onKeyDown:b,children:S}),r&&s(DC,{ref:c,onKeyDown:x,children:a(OC,{children:[a(AC,{children:[`Made with Streamlit v`,LC(r)]}),s(qh,{text:r,buttonSize:i.iconSizes.md,iconSize:i.iconSizes.sm,className:`stMenuVersionCopyButton`,copyLabel:`Copy version to clipboard`,copiedLabel:`Copied`})]})})]})});function XC(e){let{isServerConnected:t,developmentMode:n,screenCastState:r,menuItems:i,hostMenuItems:o,toolbarMode:c,metricsMgr:l,quickRerunCallback:d,clearCacheCallback:f,printCallback:p,screencastCallback:m,aboutCallback:h,sendMessageToHost:g,runOnSave:_,onRunOnSaveChange:v,allowRunOnSave:y,streamlitVersion:b}=e,x=on(),S=c===F.ToolbarMode.MINIMAL,{activeTheme:C,availableThemes:w,setTheme:T}=(0,U.useContext)(vh),E=(0,U.useMemo)(()=>NC(C,w,T,l),[C,w,T,l]),D=(0,U.useMemo)(()=>VC({isServerConnected:t,developmentMode:n,screenCastState:r,menuItems:i,hostMenuItems:o,quickRerunCallback:d,clearCacheCallback:f,printCallback:p,screencastCallback:m,aboutCallback:h,sendMessageToHost:g,isMinimalMode:S,themeSection:E,runOnSave:_,onRunOnSaveChange:v,allowRunOnSave:y,metricsMgr:l}),[t,n,r,i,o,d,f,p,m,h,g,S,E,_,v,y,l]),[O,k]=(0,U.useState)(!1),A=(0,U.useRef)(null),{refs:ee,floatingStyles:j}
26=$r({open:O,placement:`bottom-end`,offsetPx:qe(x.spacing.twoXS)}),M=(0,U.useRef)(`other`),N=(0,U.useCallback)((e=`other`)=>{M.current=e,k(!1)},[]),te=(0,U.useCallback)(()=>{k(e=>!e)},[]),ne=(0,U.useRef)(!1);(0,U.useLayoutEffect)(()=>{if(ne.current&&!O){let e=M.current;M.current=`other`;let t=A.current;t&&(e===`tab`?lC(t):e===`shift-tab`?uC(t):t.focus())}ne.current=O},[O]);let{setFloatingRef:re,setReferenceRef:ie}=pg({isOpen:O,onClose:N,floatingSetFn:ee.setFloating,referenceSetFn:ee.setReference}),ae=(0,U.useCallback)(e=>{A.current=e,ie(e)},[ie]),oe=D.some(e=>e.length>0);return S&&!oe?null:a(u,{children:[a(gC,{id:`MainMenu`,className:`stMainMenu`,"data-testid":`stMainMenu`,children:[s(Vr,{ref:ae,kind:V.HEADER_NO_PADDING,"data-testid":`stMainMenuButton`,"aria-label":`Main menu`,"aria-haspopup":`menu`,"aria-expanded":O,onClick:te,children:s(Qt,{content:jh,size:`lg`})}),r===`RECORDING`&&s(fC,{"data-testid":`stMainMenuRecordingIndicator`})]}),O&&s(Qr,{children:s(kC,{ref:re,style:j,"data-testid":`stMainMenuPopover`,className:`stMainMenuPopover`,children:s(YC,{sections:D,closeMenu:N,metricsMgr:l,streamlitVersion:b})})})]})}var ZC=(0,U.memo)(XC),QC=`stSkillsNudgeDismissed`,$C=`stSkillsNudgeSnoozedAt`,ew=`Lost connection during install — it may have finished. Reconnect or try again.`;function tw(){return L()&&window.localStorage.getItem(`stSkillsNudgeDismissed`)===`true`}function nw(){if(!L())return!1;let e=Number(window.localStorage.getItem($C)),t=Date.now()-e;return Number.isFinite(e)&&e>0&&t>=0&&t<864e5}function rw(){L()&&window.localStorage.setItem(QC,`true`)}function iw(){L()&&window.localStorage.setItem($C,String(Date.now()))}function aw(e){let t=e instanceof Error?e.message:``;return t===`Connection closed`||t===`Request timed out`}var ow=`non_loopback_`;function sw(e){return e.startsWith(ow)?`skillsNudgeSuppressedNonLocal:${e.slice(13)}`:`skillsNudgeSuppressed:${e}`}function cw(e){return e?`skillsNudgeInstallSucceeded:${e}`:`skillsNudgeInstallSucceeded`}var lw=`refused:`;function uw(e){let t=dg(e)??``,n=t.startsWith(lw),r=n?`skillsNudgeInstallRefused`:`skillsNudgeInstallFailed`,i=n?t.slice(8):t;return i?`${r}:${i}`:r}var dw=g({from:{opacity:0,transform:`translateX(1.5rem)`},to:{opacity:1,transform:`translateX(0)`}}),fw=d(`div`,{target:`epqrp290`})(({theme:e})=>({...Mh(e),paddingLeft:e.spacing.lg,paddingRight:e.spacing.lg,animation:`${dw} 0.2s ease-out`,"@media (prefers-reduced-motion: reduce)":{animation:`none`}})),pw=d(`div`,{target:`epqrp291`})(({theme:e})=>({display:`flex`,flexDirection:`row`,alignItems:`flex-start`,gap:e.spacing.lg,flex:1,minWidth:0})),mw=e=>({margin:e.spacing.none,padding:e.spacing.none,border:`none`,boxShadow:`none`,backgroundColor:e.colors.transparent,cursor:`pointer`,borderRadius:e.radii.default,"&:hover, &:active":{boxShadow:`none`},"&:hover":{color:e.colors.bodyText},"&:focus-visible":{outline:`none`,boxShadow:e.shadows.focusRingMuted},"&:disabled":{cursor:`not-allowed`}}),hw=d(`button`,{target:`epqrp292`})(({theme:e})=>({...mw(e),display:`flex`,flexShrink:0,alignSelf:`flex-start`,alignItems:`center`,justifyContent:`center`,marginTop:e.spacing.threeXS,color:e.colors.fadedText40})),gw=d(`div`,{target:`epqrp293`})(({theme:e})=>({fontWeight:e.fontWeights.bold,color:e.colors.bodyText})),_w=d(`div`,{target:`epqrp294`})(({theme:e})=>({color:e.colors.fadedText60})),vw=d(`div`,{target:`epqrp295`})(({theme:e})=>({display:`flex`,alignItems:`center`,gap:e.spacing.lg,marginTop:e.spacing.twoXS,button:{lineHeight:e.lineHeights.tight}})),yw=3e3;function bw({onInstall:e,onSnooze:t,onDontShowAgain:n,onClose:r}){let i=on(),[o,c]=(0,U.useState)(`idle`),[l,d]=(0,U.useState)(``),[f,p]=(0,U.useState)(``),m=(0,U.useCallback)(()=>{c(`installing`),d(``),e().then(e=>{p(e??``),c(`success`)}).catch(e=>{c(`error`),d(e instanceof Error?e.message:`Failed to install skills.`)})},[e]);(0,U.useEffect)(()=>{if(o!==`success`)return;let e=setTimeout(r,yw);return()=>clearTimeout(e)},[o,r]);let h=(0,U.useCallback)(()=>{t(),r()},[t,r]),g=(0,U.useCallback)(()=>{n(),r()},[n,r]),_=o===`installing`,v=o===`success`,y=o===`error`,b=(0,U.useCallback)(e=>{e.key===`Escape`&&!_&&!v&&(e.stopPropagation(),h())},[h,_,v]);return a(fw,{"data-testid":`stSkillsNudge`,className:`stSkillsNudge`,role:`status`,"aria-live":`polite`,onKeyDown:b,children:[a(pw,{children:[s(B,{iconValue:v?`:material/check_circle:`:y?`:material/error:`:`:material/auto_awesome:`,size:`lg`,color:v?i.colors.greenColor:y?i.colors.redTextColor:i.colors.fadedText60}),s(Rh,{children:v?a(u,{children:[s(gw,{children:`Skills installed`}),f&&s(_w,{children:f})]}):a(u,{children:[s(gw,{children:y?`Couldn't install skills`:`Help agents write better apps`}),s(_w,{children:y?l:`Install the official Streamlit skills so AI coding agents can build and debug your apps.`}),a(vw,{children:[s(Vr,{kind:V.SECONDARY,onClick:m,disabled:_,children:_?`Installing…`:y?`Retry`:`Install`}),s(Vr,{kind:V.TERTIARY,onClick:g,disabled:_,children:`Don't show again`})]})]})})]}),!v&&s(hw,{type:`button`,"aria-label":`Close`,onClick:h,disabled:_,children:s(B,{iconValue:`:material/close:`,size:`base`})})]})}function xw(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Pb(e,t)}function Sw(e,t){return e.classList?!!t&&e.classList.contains(t):(` `+(e.className.baseVal||e.className)+` `).indexOf(` `+t+` `)!==-1}function Cw(e,t){e.classList?e.classList.add(t):Sw(e,t)||(typeof e.className==`string`?e.className=e.className+` `+t:e.setAttribute(`class`,(e.className&&e.className.baseVal||``)+` `+t))}function ww(e,t){return e.replace(RegExp(`(^|\\s)`+t+`(?:\\s|$)`,`g`),`$1`).replace(/\s+/g,` `).replace(/^\s*|\s*$/g,``)}function Tw(e,t){e.classList?e.classList.remove(t):typeof e.className==`string`?e.className=ww(e.className,t):e.setAttribute(`class`,ww(e.className&&e.className.baseVal||``,t))}var Ew={disabled:!1},Dw=U.createContext(null),Ow=function(e){return e.scrollTop},kw=`unmounted`,Aw=`exited`,jw=`entering`,Mw=`entered`,Nw=`exiting`,Pw=function(e){xw(t,e);function t(t,n){var r=e.call(this,t,n)||this,i=n,a=i&&!i.isMounting?t.enter:t.appear,o;return r.appearStatus=null,t.in?a?(o=Aw,r.appearStatus=jw):o=Mw:o=t.unmountOnExit||t.mountOnEnter?kw:Aw,r.state={status:o},r.nextCallback=null,r}t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===`unmounted`?{status:Aw}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==`entering`&&n!==`entered`&&(t=jw):(n===`entering`||n===`entered`)&&(t=Nw)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e=this.props.timeout,t=n=r=e,n,r;return e!=null&&typeof e!=`number`&&(t=e.exit,n=e.enter,r=e.appear===void 0?n:e.appear),{exit:t,enter:n,appear:r}},n.updateStatus=function(e,t){if(e===void 0&&(e=!1),t!==null){if(this.cancelNextCallback(),t===`entering`){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:As.findDOMNode(this);n&&Ow(n)}this.performEnter(e)}else this.performExit()}else this.props.unmountOnExit&&this.state.status===`exited`&&this.setState({status:kw})},n.performEnter=function(e){var t=this,n=this.props.enter,r=this.context?this.context.
vendor: 2,360 bytes, line 26
26isMounting:e,i=this.props.nodeRef?[r]:[As.findDOMNode(this),r],a=i[0],o=i[1],s=this.getTimeouts(),c=r?s.appear:s.enter;if(!e&&!n||Ew.disabled){this.safeSetState({status:Mw},function(){t.props.onEntered(a)});return}this.props.onEnter(a,o),this.safeSetState({status:jw},function(){t.props.onEntering(a,o),t.onTransitionEnd(c,function(){t.safeSetState({status:Mw},function(){t.props.onEntered(a,o)})})})},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:As.findDOMNode(this);if(!t||Ew.disabled){this.safeSetState({status:Aw},function(){e.props.onExited(r)});return}this.props.onExit(r),this.safeSetState({status:Nw},function(){e.props.onExiting(r),e.onTransitionEnd(n.exit,function(){e.safeSetState({status:Aw},function(){e.props.onExited(r)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:As.findDOMNode(this),r=e==null&&!this.props.addEndListener;if(!n||r){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var i=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],a=i[0],o=i[1];this.props.addEndListener(a,o)}e!=null&&setTimeout(this.nextCallback,e)},n.render=function(){var e=this.state.status;if(e===`unmounted`)return null;var t=this.props,n=t.children;t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef;var r=ci(t,[`children`,`in`,`mountOnEnter`,`unmountOnExit`,`appear`,`enter`,`exit`,`timeout`,`addEndListener`,`onEnter`,`onEntering`,`onEntered`,`onExit`,`onExiting`,`onExited`,`nodeRef`]);return U.createElement(Dw.Provider,{value:null},typeof n==`function`?n(e,r):U.cloneElement(U.Children.only(n),r))},t}(U.Component);Pw.contextType=Dw,Pw.propTypes={};function Fw(){}Pw.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Fw,onEntering:Fw,onEntered:Fw,onExit:Fw,onExiting:Fw,onExited:Fw}
vendor: 1,537 bytes, line 26
26,Pw.UNMOUNTED=kw,Pw.EXITED=Aw,Pw.ENTERING=jw,Pw.ENTERED=Mw,Pw.EXITING=Nw;var Iw=function(e,t){return e&&t&&t.split(` `).forEach(function(t){return Cw(e,t)})},Lw=function(e,t){return e&&t&&t.split(` `).forEach(function(t){return Tw(e,t)})},Rw=function(e){xw(t,e);function t(){var t,n=[...arguments];return t=e.call.apply(e,[this].concat(n))||this,t.appliedClasses={appear:{},enter:{},exit:{}},t.onEnter=function(e,n){var r=t.resolveArguments(e,n),i=r[0],a=r[1];t.removeClasses(i,`exit`),t.addClass(i,a?`appear`:`enter`,`base`),t.props.onEnter&&t.props.onEnter(e,n)},t.onEntering=function(e,n){var r=t.resolveArguments(e,n),i=r[0],a=r[1]?`appear`:`enter`;t.addClass(i,a,`active`),t.props.onEntering&&t.props.onEntering(e,n)},t.onEntered=function(e,n){var r=t.resolveArguments(e,n),i=r[0],a=r[1]?`appear`:`enter`;t.removeClasses(i,a),t.addClass(i,a,`done`),t.props.onEntered&&t.props.onEntered(e,n)},t.onExit=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,`appear`),t.removeClasses(n,`enter`),t.addClass(n,`exit`,`base`),t.props.onExit&&t.props.onExit(e)},t.onExiting=function(e){var n=t.resolveArguments(e)[0];t.addClass(n,`exit`,`active`),t.props.onExiting&&t.props.onExiting(e)},t.onExited=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,`exit`),t.addClass(n,`exit`,`done`),t.props.onExited&&t.props.onExited(e)},t.resolveArguments=function(e,n){return t.props.nodeRef?[t.props.nodeRef.current,e]:[e,n]},t.getClassNames=function(e){var n=t.props.classNames,r=typeof n==`string`,i=r&&n?n+`-`:``,a=r?``+i+e:n[e];
26return{baseClassName:a,activeClassName:r?a+`-active`:n[e+`Active`],doneClassName:r?a+`-done`:n[e+`Done`]}},t}var n=t.prototype;return n.addClass=function(e,t,n){var r=this.getClassNames(t)[n+`ClassName`],i=this.getClassNames(`enter`).doneClassName;t===`appear`&&n===`done`&&i&&(r+=` `+i),n===`active`&&e&&Ow(e),r&&(this.appliedClasses[t][n]=r,Iw(e,r))},n.removeClasses=function(e,t){var n=this.appliedClasses[t],r=n.base,i=n.active,a=n.done;this.appliedClasses[t]={},r&&Lw(e,r),i&&Lw(e,i),a&&Lw(e,a)},n.render=function(){var e=this.props;e.classNames;var t=ci(e,[`classNames`]);return U.createElement(Pw,f({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(U.Component);Rw.defaultProps={classNames:``},Rw.propTypes={};var $=function(e){return e.CONNECTED=`CONNECTED`,e.DISCONNECTED_FOREVER=`DISCONNECTED_FOREVER`,e.INITIAL=`INITIAL`,e.PINGING_SERVER=`PINGING_SERVER`,e.CONNECTING=`CONNECTING`,e.STATIC_CONNECTING=`STATIC_CONNECTING`,e.STATIC_CONNECTED=`STATIC_CONNECTED`,e}({}),zw=`https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS`,Bw=`_stcore/stream`,Vw=`_stcore/health`,Hw=`_stcore/host-config`,Uw=4e3,Ww=4e3,Gw=!(typeof navigator>`u`)&&/Android/i.test(navigator.userAgent)?6e4:15e3,Kw=15e3;Promise.withResolvers===void 0&&(Promise.withResolvers=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r});return{resolve:e,reject:t,promise:n}});function qw(e){let t=document.cookie.match(`\\b${e}=([^;]*)\\b`);return t?t[1]:void 0}function Jw(){let e=`testData`;try{let{localStorage:t}=window;t.setItem(e,e),t.getItem(e),t.removeItem(e)}catch{return!1}return!0}function Yw(e){return Array.isArray(e)&&e.length>0&&e.every(e=>typeof e==`string`&&e.trim().length>0)}function Xw(e){return typeof structuredClone==`function`?structuredClone(e):JSON.parse(JSON.stringify(e))}function Zw(e){return Object.freeze(e),Array.isArray(e)?e.forEach(e=>{typeof e==`object`&&e&&!Object.isFrozen(e)&&Zw(e)}):Object.values(e).forEach(e=>{typeof e==`object`&&e&&!Object.isFrozen(e)&&Zw(e)}),e}var Qw=(()=>{let e=window.__streamlit;if(e)return Zw(Xw(e))})(),$w={get BACKEND_BASE_URL(){return Qw?.BACKEND_BASE_URL},get HOST_CONFIG_BASE_URL(){return Qw?.HOST_CONFIG_BASE_URL},get DOWNLOAD_ASSETS_BASE_URL(){return Qw?.DOWNLOAD_ASSETS_BASE_URL},get MAIN_PAGE_BASE_URL(){return Qw?.MAIN_PAGE_BASE_URL},get CUSTOM_COMPONENT_CLIENT_ID(){return Qw?.CUSTOM_COMPONENT_CLIENT_ID},get LIGHT_THEME(){return Qw?.LIGHT_THEME},get DARK_THEME(){return Qw?.DARK_THEME},get ENABLE_RELOAD_BASED_ON_HARDCODED_STREAMLIT_VERSION(){return Qw?.ENABLE_RELOAD_BASED_ON_HARDCODED_STREAMLIT_VERSION},get HOST_CONFIG(){return Qw?.HOST_CONFIG}};function eT(e){return e!=null}function tT(e){return e==null}var nT=/\/+$/,rT=/^\/+/;function iT({hostname:e,port:t,pathname:n,protocol:r},i){let a=aT(n,i);return`${r}//${e}${t?`:${t}`:``}/${a}`}function aT(e,t){return e=e.replace(nT,``).replace(rT,``),t=t.replace(nT,``).replace(rT,``),e.length===0?t:`${e}/${t}`}var oT=`https://data.streamlit.io/static.json`,sT=(0,yi.getLogger)(`StaticConnection`);async function cT(){let e=Jw(),t=``;if(e){let e=window.localStorage.getItem(`stStaticAssetUrl`);if(e)return e}try{let n=await fetch(oT,{signal:AbortSignal.timeout(5e3)});n.ok?(t=(await n.json()).static_url??void 0,e&&t&&window.localStorage.setItem(`stStaticAssetUrl`,t)):sT.error(`Failed to fetch static config url: `,n.status)}catch(e){sT.error(`Failed to fetch static config url:`,e)}return t}async function lT(e,t){let n=`${t}/${e}/protos.pb`,r=await fetch(n,{signal:AbortSignal.timeout(5e3)});if(!r.ok)sT.error(`Failed to fetch static app protos for id: ${e}`,r.status);else return r.arrayBuffer();return null}async function uT(e,t,n,r){let i=await lT(e,t);if(!i){sT.error(`Failed to retrieve static app protos`),r({message:`Failed to retrieve static app protos. Please confirm the id is correct and try again. Given static app id: ${e}`});return}N.decode(new Uint8Array(i)).messages.forEach(e=>{n(e)})}async function dT(e,t,n,r,i){t($.STATIC_CONNECTING);let a=await cT();i.setStaticConfigUrl(a),uT(e,a,n,r),t($.STATIC_CONNECTED)}var fT=/\/+$/,pT=/^\/+/;function mT(){let e=$w.HOST_CONFIG;if(!e)return!1;let{allowedOrigins:t,useExternalAuthToken:n}=e,r=!!$w.BACKEND_BASE_URL,i=Yw(t);return r&&i&&typeof n==`boolean`}function hT(e){let t=new URL(e??window.location.href);return t.pathname=t.pathname.replace(fT,``).replace(pT,``),t}function gT(){let e=hT($w.BACKEND_BASE_URL),{pathname:t}=e;if(t===`/`)return[e];let n=t.split(`/`),r=[];for(;n.length>0;){let t=new URL(e);t.pathname=n.join(`/`),r.push(t),n.pop()}return r.length<=2?r:r.slice(0,2)}function _T({hostname:e,port:t,pathname:n,protocol:r},i){return`${r===`https:`?`wss`:`ws`}://${e}:${t}/${aT(n,i)}`}function vT(e){if(e!=null)switch(typeof e){case`object`:return JSON.stringify(e,null,2);case`string`:case`number`:case`boolean`:return String(e);default:return}}
26var yT=class extends Error{constructor(e,t,n={}){super(e),this.name=`FetchError`,this.url=t,this.isTimeout=n.isTimeout??!1,this.isNetworkError=n.isNetworkError??!1,this.isAborted=n.isAborted??!1,this.response=n.response}};async function bT(e,t,n){let r=new AbortController,i=setTimeout(()=>r.abort(),t),a=()=>r.abort();n&&(n.aborted?r.abort():n.addEventListener(`abort`,a));let o=()=>{clearTimeout(i),n?.removeEventListener(`abort`,a)};try{let t=await fetch(e,{signal:r.signal});if(o(),!t.ok){let n;try{n=await t.json()}catch{try{n=await t.text()}catch{n=null}}throw new yT(`Request failed with status ${t.status}`,e,{response:{status:t.status,statusText:t.statusText,data:n}})}let n=await t.text();try{return{data:JSON.parse(n),url:e}}catch{return{data:n,url:e}}}catch(t){throw o(),t instanceof yT?t:t instanceof DOMException&&t.name===`AbortError`?n?.aborted?new yT(`Request aborted`,e,{isAborted:!0}):new yT(`Connection timed out`,e,{isTimeout:!0}):t instanceof TypeError?new yT(t.message||`Network error`,e,{isNetworkError:!0}):new yT(t instanceof Error?t.message:`Unknown error`,e)}}var xT=(0,yi.getLogger)(`DoInitPings`),ST=class extends Error{constructor(){super(`Ping cancelled`)}};function CT(e,t,n,r,i,a){let{promise:o,resolve:s,reject:c}=Promise.withResolvers(),l=0,u=0,d,f=!1,p=new AbortController,m=()=>{},h=()=>{f||(u++,u>=e.length&&(u=0),m())},g=e=>{if(f)return;let i=l===1?t:t*2**(l-1),a=Math.min(n,i),o=l===1?a:Math.floor(a*(.7+Math.random()*.3));r(l,e,o),!(typeof window>`u`)&&(d=globalThis.setTimeout(h,o))},_=()=>{let t=e[u];new URL(iT(t,``)).hostname===`localhost`?g({message:`Is Streamlit still running? If you accidentally stopped Streamlit, just restart it in your terminal:`,codeBlock:`streamlit run yourscript.py`}):g({message:`Streamlit server is not responding. Are you connected to the internet?`})},v=()=>{g({message:`Cannot connect to Streamlit (HTTP status: 403).
27
28If you are trying to access a Streamlit app running on another server, this could be due to the app's [CORS](${zw}) settings.`})},y=e=>{let t=`DoInitPings`;if(e)try{t=new URL(e).pathname}catch{xT.error(`unrecognized url: ${e}`)}return t};return m=()=>{if(f)return;let t=e[u],n=iT(t,Vw),r=$w.HOST_CONFIG_BASE_URL,o=iT(r?hT(r):t,Hw);xT.info(`Attempting to connect to ${n}.`),u===0&&l++,Promise.all([bT(n,Kw,p.signal),bT(o,Kw,p.signal)]).then(([e,t])=>{f||(a(t.data),s(u))}).catch(e=>{if(f)return;let t=l>=6;if(e.isTimeout){if(t){let t=y(e.url);xT.error(`Client error: DoInitPings timed out`),i(`DoInitPings timed out`,`Connection timed out - ECONNABORTED`,t)}return g({message:`Connection timed out.`})}if(e.response){let{data:n,status:r,statusText:a}=e.response,o=y(e.url);if(r===0)return t&&(xT.error(`Client Error: response received with status ${r} when attempting to reach ${o}`),i(`Response received with status ${r}`,a,o)),_();if(r===403)return t&&(xT.error(`Client Error: response received with status ${r} when attempting to reach ${o}`),i(r,a,o)),v();t&&(xT.error(`Client Error: response received with status ${r} when attempting to reach ${o}`),i(r,a,o));let s=vT(n);return g({message:`Connection failed with status ${r}${s?`, and response:`:`.`}`,...s&&{codeBlock:s}})}if(e.isNetworkError){if(t){let t=y(e.url);xT.error(`Client Error in reaching server endpoint - No response received when attempting to reach ${t}`),i(`No response received from server`,`Network error`,t)}return _()}if(t){let t=y(e.url);xT.error(`Client Error in reaching server endpoint - error in setting up request when attempting to reach ${t}`),i(`Error setting up request to server`,e.message??``,t)}return g({message:e.message})})},m(),{promise:o,cancel:()=>{f=!0,eT(d)&&globalThis.clearTimeout(d),p.abort(),c(new ST)}}}var wT=(0,yi.getLogger)(`ForwardMessageCache`),TT=class{getAge(e){return e-this.scriptRunCount}constructor(e,t,n){this.scriptRunCount=0,this.encodedMsg=e,this.scriptRunCount=t,this.fragmentId=n}},ET=class{constructor(){this.messages=new Map,this.scriptRunCount=0}incrementRunCount(e,t){this.scriptRunCount+=1,this.messages.forEach((n,r)=>{t.length>0&&(!n.fragmentId||!t.includes(n.fragmentId))||n.getAge(this.scriptRunCount)>e&&(wT.info(`Removing expired ForwardMsg [hash=${r}]`),this.messages.delete(r))})}getCachedMessageHashes(){return Array.from(this.messages.keys())}async processMessagePayload(e,t){if(this.maybeCacheMessage(e,t),e.type!==`refHash`)return e;let n=this.getCachedMessage(e.refHash,!0);if(tT(n))throw Error(`Cached ForwardMsg MISS [hash=${e.refHash}]. This is not expected to happen. Please [report this bug](https://github.com/streamlit/streamlit/issues).`);if(wT.info(`Cached ForwardMsg HIT [hash=${e.refHash}]`),!e.metadata)throw Error(`Reference ForwardMsg has no metadata. This is not expected to happen. Please [report this bug](https://github.com/streamlit/streamlit/issues).`);return n.metadata=e.metadata,n}maybeCacheMessage(e,t){if(e.type!==`refHash`&&e.metadata?.cacheable){if(!e.hash){wT.error(`ForwardMsg has no hash. This is not expected to happen, please report this bug.`,e);return}this.getCachedMessage(e.hash,!0)===void 0&&(wT.info(`Caching ForwardMsg [hash=${e.hash}]`),this.messages.set(e.hash,new TT(t,this.scriptRunCount,e.delta?.fragmentId??void 0)))}}getCachedMessage(e,t){let n=this.messages.get(e);if(!tT(n))return t&&(n.scriptRunCount=this.scriptRunCount),ue.decode(n.encodedMsg)}},DT=(0,yi.getLogger)(`WebsocketConnection`),OT=class{constructor(e){this.uriIndex=0,this.lastDispatchedMessageIndex=-1,this.nextMessageIndex=0,this.messageQueue=new Map,this.state=$.INITIAL,this.reconnectAttempt=0,this.args=e,this.cache=new ET,this.stepFsm(`INITIALIZED`)}getBaseUriParts(){if(this.state===$.CONNECTED)return this.args.baseUriPartsList[this.uriIndex]}disconnect(){this.setFsmState($.DISCONNECTED_FOREVER)}reconnect(){this.state===$.CONNECTED&&(this.closeConnection(),this.stepFsm(`CONNECTION_CLOSED`))}setFsmState(e,t,n=0){switch(DT.info(`New state: ${e}`),this.state=e,this.state){case $.PINGING_SERVER:this.schedulePingServer(n);break;case $.CONNECTED:this.reconnectAttempt=0,this.clearReconnectDelayTimeout(),this.connectedUriIndex=this.socketUriIndex??this.uriIndex,this.uriIndex=this.connectedUriIndex}switch(this.args.onConnectionStateChange(e,t),this.state){case $.CONNECTING:this.connectToWebSocket();break;case $.DISCONNECTED_FOREVER:this.closeConnection()}}stepFsm(e,t){if(DT.info(`State: ${this.state}; Event: ${e}`),e===`FATAL_ERROR`&&this.state!==$.DISCONNECTED_FOREVER){DT.error(`Client Error: Websocket connection encountered fatal error - ${t}`),this.args.sendClientError(`Websocket connection fatal error encountered`,t,`Websocket Connection`),this.setFsmState($.DISCONNECTED_FOREVER,{message:t||`Unknown error`});return}switch(this.state){case $.INITIAL:if(e===`INITIALIZED`){this.args.enableBypass?(this.setFsmState($.CONNECTING),this.pingServerInBackgroun
28d()):this.setFsmState($.PINGING_SERVER);return}break;case $.CONNECTING:if(e===`CONNECTION_SUCCEEDED`){this.setFsmState($.CONNECTED);return}if(e===`CONNECTION_TIMED_OUT`||e===`CONNECTION_ERROR`||e===`CONNECTION_CLOSED`){this.setFsmState($.PINGING_SERVER,void 0,this.nextReconnectDelayMs());return}break;case $.CONNECTED:if(e===`CONNECTION_CLOSED`||e===`CONNECTION_ERROR`){this.setFsmState($.PINGING_SERVER,void 0,this.nextReconnectDelayMs());return}break;case $.PINGING_SERVER:if(e===`SERVER_PING_SUCCEEDED`){this.setFsmState($.CONNECTING);return}break;case $.DISCONNECTED_FOREVER:DT.warn(`Discarding ${e} while in ${$.DISCONNECTED_FOREVER}`);return}throw Error(`Unsupported state transition.
29State: ${this.state}\nEvent: ${e}`)}nextReconnectDelayMs(){this.reconnectAttempt+=1;let e=Math.min(Ww,500*2**(this.reconnectAttempt-1)),t=this.reconnectAttempt===1?250:e/2;return Math.floor(t+Math.random()*(e-t))}schedulePingServer(e){if(this.clearReconnectDelayTimeout(),e<=0){this.pingServer();return}this.reconnectDelayTimeout=globalThis.setTimeout(()=>{this.reconnectDelayTimeout=void 0,this.state===$.PINGING_SERVER&&this.pingServer()},e)}clearReconnectDelayTimeout(){eT(this.reconnectDelayTimeout)&&(globalThis.clearTimeout(this.reconnectDelayTimeout),this.reconnectDelayTimeout=void 0)}getBaseUrisToProbe(){return this.connectedUriIndex===void 0?this.args.baseUriPartsList:[this.args.baseUriPartsList[this.connectedUriIndex]]}async pingServer(){let e=CT(this.getBaseUrisToProbe(),100,Uw,this.args.onRetry,this.args.sendClientError,this.args.onHostConfigResp);this.pingRequest=e;try{let t=await e.promise;this.uriIndex=this.connectedUriIndex??t,this.pingRequest===e&&(this.pingRequest=void 0),this.stepFsm(`SERVER_PING_SUCCEEDED`)}catch(e){e instanceof ST?DT.info(`Ping cancelled`):this.stepFsm(`FATAL_ERROR`,e instanceof Error?e.message:String(e))}finally{this.pingRequest===e&&(this.pingRequest=void 0)}}async pingServerInBackground(){let e=CT(this.args.baseUriPartsList,100,Uw,this.args.onRetry,this.args.sendClientError,this.args.onHostConfigResp);this.pingRequest=e;try{let t=await e.promise;this.connectedUriIndex===void 0&&(this.uriIndex=t),DT.info(`Background pings completed successfully`)}catch(e){e instanceof ST?DT.info(`Background pings cancelled`):this.stepFsm(`FATAL_ERROR`,e instanceof Error?e.message:String(e))}finally{this.pingRequest===e&&(this.pingRequest=void 0)}}async getSessionTokens(){let e=await this.args.claimHostAuthToken(),t=qw(`_streamlit_xsrf`);this.args.resetHostAuthToken();let n=this.args.getLastSessionId();return[e??t??`PLACEHOLDER_AUTH_TOKEN`,...n?[n]:[]]}async connectToWebSocket(){this.socketUriIndex=this.uriIndex;let e=_T(this.args.baseUriPartsList[this.socketUriIndex],Bw);if(eT(this.websocket))throw Error(`Websocket already exists`);DT.info(`creating WebSocket`);
29let t=await this.getSessionTokens();this.websocket=new WebSocket(e,[`streamlit`,...t]),this.websocket.binaryType=`arraybuffer`,this.setConnectionTimeout(e);let n=this.websocket,r=()=>n===this.websocket;this.websocket.addEventListener(`message`,e=>{r()&&this.handleMessage(e.data).catch(e=>{let t=`Failed to process a Websocket message. ${e}`;DT.error(t),this.stepFsm(`FATAL_ERROR`,t)})}),this.websocket.addEventListener(`open`,()=>{r()&&(DT.info(`WebSocket onopen`),this.stepFsm(`CONNECTION_SUCCEEDED`))}),this.websocket.addEventListener(`close`,()=>{r()&&(DT.warn(`WebSocket onclose`),this.closeConnection(),this.stepFsm(`CONNECTION_CLOSED`))}),this.websocket.addEventListener(`error`,e=>{r()&&(DT.error(`Client Error: WebSocket onerror`),this.args.sendClientError(`Websocket connection onerror triggered`,`Error: ${e}`,`Websocket Connection`),this.closeConnection(),this.stepFsm(`CONNECTION_ERROR`))})}setConnectionTimeout(e){if(eT(this.wsConnectionTimeout))throw Error(`WS timeout is already set`);let t=this.websocket;this.wsConnectionTimeout=globalThis.setTimeout(()=>{if(t!==this.websocket)return;if(tT(this.wsConnectionTimeout)){DT.warn(`Timeout fired after cancellation`);return}let n=this.websocket;if(tT(n)){this.closeConnection(),this.stepFsm(`FATAL_ERROR`,`Null Websocket in setConnectionTimeout`);return}n.readyState===0&&(DT.info(`Client error: ${e} timed out`),this.args.sendClientError(`Websocket connection timed out`,`${e} timed out`,`Websocket Connection`),this.closeConnection(),this.stepFsm(`CONNECTION_TIMED_OUT`))},Gw),DT.info(`Set WS timeout ${Number(this.wsConnectionTimeout)}`)}closeConnection(){this.websocket&&=(this.websocket.close(),void 0),eT(this.wsConnectionTimeout)&&(DT.info(`Clearing WS timeout ${Number(this.wsConnectionTimeout)}`),globalThis.clearTimeout(this.wsConnectionTimeout),this.wsConnectionTimeout=void 0),this.clearReconnectDelayTimeout(),this.pingRequest&&=(this.pingRequest.cancel(),void 0)}sendMessage(e){if(!this.websocket)return;let t=P.create(e),n=P.encode(t).finish(),r=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);this.websocket.send(r)}incrementMessageCacheRunCount(e,t){this.cache.incrementRunCount(e,t)}getCachedMessageHashes(){return this.cache.getCachedMessageHashes()}async handleMessage(e){let t=this.nextMessageIndex;this.nextMessageIndex+=1;let n=new Uint8Array(e),r=ue.decode(n);this.messageQueue.set(t,await this.cache.processMessagePayload(r,n));let i=this.messageQueue.get(this.lastDispatchedMessageIndex+1);for(;i!==void 0;){let e=this.lastDispatchedMessageIndex+1;this.args.onMessage(i),this.messageQueue.delete(e),this.lastDispatchedMessageIndex=e,i=this.messageQueue.get(e+1)}}},kT=(0,yi.getLogger)(`ConnectionManager`),AT=class{constructor(e){this.connectionState=$.INITIAL,this.setConnectionState=(e,t)=>{this.connectionState!==e&&(this.connectionState===$.CONNECTED&&e!==$.CONNECTED&&this.clearHeartbeatAckTimeout(),this.connectionState=e,this.props.connectionStateChanged(e)),t&&this.props.onConnectionError(t)},this.showRetryError=(e,t,n)=>{e>=6&&this.props.onConnectionError(t)},this.props=e,this.connect()}isConnected(){return this.connectionState===$.CONNECTED}getBaseUriParts(){if(this.websocketConnection instanceof OT)return this.websocketConnection.getBaseUriParts()}sendMessage(e){this.websocketConnection instanceof OT&&this.isConnected()?this.websocketConnection.sendMessage(e):kT.error(`Cannot send message when server is disconnected: ${e.type??`unknown`}`)}incrementMessageCacheRunCount(e,t){this.websocketConnection instanceof OT&&this.websocketConnection.incrementMessageCacheRunCount(e,t)}getCachedMessageHashes(){return this.websocketConnection instanceof OT?this.websocketConnection?.getCachedMessageHashes()??[]:[]}checkStaticConnection(){return new URLSearchParams(document.location.search).get(`staticAppId`)}async connect(){let e=this.checkStaticConnection();if(e)dT(e,this.setConnectionState,this.props.onMessage,this.props.onConnectionError,this.props.endpoints),this.websocketConnection=null;else try{this.websocketConnection=await this.connectToRunningServer()}catch(e){let t=e instanceof Error?e:Error(`${e}`);kT.error(`Client Error: Websocket connection - ${t.message}`),this.props.sendClientError(`Failed to establish websocket connection`,t.message,`C
29onnection Manager`),this.setConnectionState($.DISCONNECTED_FOREVER,{message:t.message})}}disconnect(){this.clearHeartbeatAckTimeout(),this.websocketConnection?.disconnect()}onHeartbeatSent(e){this.clearHeartbeatAckTimeout(),e&&(this.heartbeatAckTimeoutId=setTimeout(()=>{kT.warn(`Heartbeat ack not received within timeout, connection may be unhealthy`),this.heartbeatAckTimeoutId=void 0,this.isConnected()&&this.reconnect()},e))}reconnect(){this.clearHeartbeatAckTimeout(),this.websocketConnection?.reconnect()}onHeartbeatAckReceived(){this.clearHeartbeatAckTimeout()}clearHeartbeatAckTimeout(){this.heartbeatAckTimeoutId!==void 0&&(clearTimeout(this.heartbeatAckTimeoutId),this.heartbeatAckTimeoutId=void 0)}connectToRunningServer(){let e=gT(),t=mT();return new OT({getLastSessionId:this.props.getLastSessionId,endpoints:this.props.endpoints,baseUriPartsList:e,onMessage:this.props.onMessage,onConnectionStateChange:this.setConnectionState,onRetry:this.showRetryError,claimHostAuthToken:this.props.claimHostAuthToken,resetHostAuthToken:this.props.resetHostAuthToken,sendClientError:this.props.sendClientError,onHostConfigResp:this.props.onHostConfigResp,enableBypass:t})}},jT=(0,yi.getLogger)(`DefaultStreamlitEndpoints`),MT=`/media`,NT=`/app/static/`,PT=`/_stcore/upload_file`,FT=`/component`,IT=`/_stcore/bidi-components`,LT=class{constructor(e){this.getServerUri=e.getServerUri,this.csrfEnabled=e.csrfEnabled,this.sendClientError=e.sendClientError,this.staticConfigUrl=null}setStaticConfigUrl(e){this.staticConfigUrl=e}sendClientErrorToHost(e,t,n,r,i){this.sendClientError(e,t,n,r,i)}async checkSourceUrlResponse(e,t,n){let r=n?`${t} ${n}`:t;try{let i=await fetch(e);i.ok||(jT.error(`Client Error: ${r} source error - ${i.status}`),this.sendClientErrorToHost(t,i.status,i.statusText,e,n))}catch(i){let a=i instanceof Error?i.message:`Unknown Error`;jT.error(`Client Error: ${r} fetch error - ${a}`),this.sendClientErrorToHost(t,`Error fetching source`,a,e,n)}}buildComponentURL(e,t){return iT(this.requireServerUri(),`${FT}/${e}/${t}`)}buildBidiComponentURL(e,t){return iT(this.requireServerUri(),`${IT}/${e}/${t}`)}setFileUploadClientConfig({prefix:e,headers:t}){this.fileUploadClientConfig={prefix:e,headers:t}}buildStaticUrl(e){let t=new URLSearchParams(document.location.search).get(`staticAppId`);return`${this.staticConfigUrl}/${t}${e}`}buildMediaURL(e){return this.staticConfigUrl&&(e.startsWith(MT)||e.startsWith(NT))?this.buildStaticUrl(e):e.startsWith(MT)||e.startsWith(NT)?iT(this.requireServerUri(),e):e}buildDownloadUrl(e){if(!e.startsWith(MT))return e;let t=$w.DOWNLOAD_ASSETS_BASE_URL;return iT(t?hT(t):this.requireServerUri(),e)}buildFileUploadURL(e){return this.fileUploadClientConfig?aT(this.fileUploadClientConfig.prefix,e):e.startsWith(PT)?iT(this.requireServerUri(),e):e}buildAppPageURL(e,t){let n=t.urlPathname,r=t.isDefault?``:n;if(typeof e==`string`&&e.length>0)return`${e}/${r}`;let{port:i,protocol:a}=window.location,{pathname:o,hostname:s}=this.requireServerUri();return`${a}//${s}${i?`:${i}`:``}${o===`/`?`/`:`${o}/`}${r}`}async uploadFileUploaderFile(e,t,n,r,i){let a=new FormData,{name:o,webkitRelativePath:s}=t,c=s||o;a.append(o,t,c);let l=this.getAdditionalHeaders(),u=this.buildFileUploadURL(e);try{await this.csrfRequest(u,{signal:i,method:`PUT`,data:a,responseType:`text`,headers:l,onUploadProgress:r})}catch(e){jT.error(`Client Error: File uploader error on file upload - ${e}`);let t=e instanceof Error?e.message:`Unknown Error`;throw this.sendClientErrorToHost(`File Uploader`,`Error uploading file`,t,u),e}}getAdditionalHeaders(){let e={};return this.fileUploadClientConfig&&(e={...e,...this.fileUploadClientConfig.headers}),e}async deleteFileAtURL(e,t){let n=this.getAdditionalHeaders(),r=this.buildFileUploadURL(e);try{await this.csrfRequest(r,{method:`DELETE`,data:{sessionId:t},headers:n})}catch(e){jT.error(`Client Error: File uploader error on file delete - ${e}`);let t=e instanceof Error?e.message:`Unknown Error`;throw this.sendClientErrorToHost(`File Uploader`,`Error deleting file`,t,r),e}}requireServerUri(){let e=this.getServerUri();if(eT(e))return this.cachedServerUri=e,e;let t=this.cachedServerUri;if(eT(t))return t;throw Error(`not connected to a server!`)}
29async csrfRequest(e,t){if(t.url=e,this.csrfEnabled){let e=qw(`_streamlit_xsrf`);eT(e)&&(t.headers={"X-Xsrftoken":e,...t.headers},t.withCredentials=!0)}let{default:n}=await H(async()=>{let{default:e}=await import(`./axios.CdukPVqq.js`);return{default:e}},__vite__mapDeps([199,1]),import.meta.url);return n.request(t)}},RT=U.forwardRef(function(e,t){return U.createElement(li,f({iconAttrs:{fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`},iconVerticalAlign:`middle`,iconViewBox:`0 0 8 8`},e,{ref:t}),U.createElement(`path`,{d:`M0 3v2h2V3H0zm3 0v2h2V3H3zm3 0v2h2V3H6z`}))});RT.displayName=`Ellipses`;var zT=U.forwardRef(function(e,t){return U.createElement(li,f({iconAttrs:{fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`},iconVerticalAlign:`middle`,iconViewBox:`0 0 8 8`},e,{ref:t}),U.createElement(`path`,{d:`M3.09 0c-.06 0-.1.04-.13.09L.02 6.9c-.02.05-.03.13-.03.19v.81c0 .05.04.09.09.09h6.81c.05 0 .09-.04.09-.09v-.81c0-.05-.01-.14-.03-.19L4.01.09A.142.142 0 003.88 0h-.81zM3 3h1v2H3V3zm0 3h1v1H3V6z`}))});zT.displayName=`Warning`;var BT=`Connecting`,VT=`Connecting to Streamlit server`,HT=`Connecting to static app`,UT=`Error`,WT=`Unable to connect to Streamlit server`;function GT(e){switch(e){case $.INITIAL:case $.PINGING_SERVER:case $.CONNECTING:return{icon:RT,label:BT,tooltip:VT};case $.CONNECTED:return;case $.STATIC_CONNECTING:return{icon:RT,label:BT,tooltip:HT};case $.STATIC_CONNECTED:return;case $.DISCONNECTED_FOREVER:default:return{icon:zT,label:UT,tooltip:WT}}}var KT=``+new URL(`../media/fireworks.B4d-_KUe.gif`,import.meta.url).href,qT=d(`div`,{target:`e192nn00`})(({theme:e})=>({display:`flex`,alignItems:`center`,justifyContent:`center`,color:e.colors.gray60})),JT=d(`label`,{target:`e192nn01`})(({theme:e})=>({fontSize:e.fontSizes.sm,color:e.colors.gray60,textTransform:`uppercase`,marginTop:e.spacing.none,marginRight:e.spacing.lg,marginBottom:e.spacing.none,marginLeft:e.spacing.sm,whiteSpace:`nowrap`,maxWidth:e.sizes.appStatusMaxWidth,lineHeight:e.lineHeights.none})),YT=d(`div`,{target:`e192nn02`})(({theme:e})=>({display:`flex`,alignItems:`center`,justifyContent:`center`,borderRadius:e.radii.sm,margin:`0 ${e.spacing.sm} 0 0`,paddingLeft:e.spacing.sm,height:e.sizes.appRunningMen})),XT=d(`label`,{target:`e192nn03`})(({isPrompt:e,theme:t})=>({fontSize:t.fontSizes.sm,color:e?t.colors.bodyText:t.colors.gray60,textTransform:e?`none`:`uppercase`,margin:`0 0 0 ${t.spacing.sm}`,whiteSpace:`nowrap`,maxWidth:t.sizes.appStatusMaxWidth,borderRadius:e?t.radii.sm:void 0})),ZT=d(`span`,{target:`e192nn04`})(({theme:e})=>({marginLeft:e.spacing.md,whiteSpace:`nowrap`,color:e.colors.bodyText})),QT=d(`div`,{target:`e192nn05`})(({isNewYears:e,theme:t})=>({width:e?`2.2rem`:t.sizes.appRunningMen,height:e?`2.2rem`:t.sizes.appRunningMen,marginRight:`-${t.spacing.sm}`,display:`flex`,alignItems:`center`,justifyContent:`center`,transition:`opacity 0.3s ease-in-out`,cursor:`wait`})),$T=d(`div`,{target:`e192nn06`})({"&.StatusWidget-appear":{opacity:0}
29,"&.StatusWidget-appear-active":{opacity:1,transition:`opacity 200ms ease-out`},"&.StatusWidget-enter":{opacity:0},"&.StatusWidget-enter-active":{opacity:1,transition:`opacity 200ms ease-out`},"&.StatusWidget-exit":{opacity:1},"&.StatusWidget-exit-active":{opacity:0,transition:`opacity 200ms ease-out`}}),eE=d(`div`,{target:`e192nn07`})({"&::first-letter":{textDecoration:`underline`}}),tE=[{component:Bd,name:`accessible-forward`},{component:zd,name:`accessibility-new`},{component:Ud,name:`directions-bike`},{component:Wd,name:`directions-run`},{component:qd,name:`pool`},{component:Jd,name:`rowing`}],nE=()=>{let e=new Date,t=e.getMonth(),n=e.getDate();return t===11&&n===31||t===0&&n<=6},rE=200,iE=()=>{let[e,t]=(0,U.useState)(0),n=on(),r=(0,U.useMemo)(()=>nE(),[]);(0,U.useEffect)(()=>{if(r)return;let e=setInterval(()=>{t(e=>(e+1)%tE.length)},rE);return()=>clearInterval(e)},[r]);let i=tE[e].component;return s(QT,{isNewYears:r,"aria-label":`Running...`,role:`img`,"data-testid":`stStatusWidgetRunningIcon`,children:r?s(`img`,{src:KT,alt:`New Year's Celebration`,style:{width:`100%`,height:`100%`,objectFit:`contain`},"data-testid":`stStatusWidgetNewYearsIcon`}):s(i,{color:n.colors.fadedText60,"aria-hidden":`true`,"data-testid":`stStatusWidgetRunningManIcon`,style:{width:n.sizes.appRunningMen,height:n.sizes.appRunningMen}})})},aE=500,oE=e=>s(ZT,{children:s(Vr,{kind:V.HEADER_BUTTON,disabled:e.disabled,containerWidth:!0,onClick:e.onClick,children:e.title})}),sE=({connectionState:e,scriptRunState:t,rerunScript:n,stopScript:r,allowRunOnSave:i,showScriptChangedActions:o})=>{let[c,l]=(0,U.useState)(!1),d=on(),{clear:f,restart:p}=ti(()=>{l(!0)},aE,{autoStart:!1}),m=()=>{i&&n(!0)},h=(e,t)=>{e===`a`&&!xd(t)&&m()},g=e===$.CONNECTED,_=()=>{r()},v=()=>{n(!1)};(0,U.useEffect)(()=>{g&&(t===W.RUNNING||t===W.RERUN_REQUESTED)?p():f(),t===W.NOT_RUNNING&&l(!1)},[f,g,p,t]);let y=()=>{let e=t===W.STOP_REQUESTED;return c?a(YT,{children:[s(iE,{}),s(oE,{title:e?`Stopping...`:`Stop`,disabled:e,onClick:_})]}):s(u,{})},b=()=>{let e=t===W.RERUN_REQUESTED;return s(iC,{keyName:`a`,onKeyDown:h,children:a(YT,{children:[s(B,{size:`lg`,iconValue:`:material/info:`,color:d.colors.fadedText60}),s(XT,{isPrompt:!0,children:`File change.`}),s(oE,{title:s(eE,{children:`Rerun`}),disabled:e,onClick:v}),i&&s(oE,{title:s(eE,{children:`Always rerun`}),disabled:e,onClick:m})]})})},x=()=>{let t=GT(e);return t===void 0?null:s(Fn,{content:t.tooltip,placement:Hn.BOTTOM,children:a(qT,{className:`stConnectionStatus`,"data-testid":`stConnectionStatus`,children:[s(Qt,{size:`sm`,content:t.icon}),s(JT,{children:t.label})]})})},S=()=>{if(g){if(t===W.RUNNING||t===W.RERUN_REQUESTED)return y();if(o)return b()}return x()},C=(0,U.useRef)(),w=(0,U.useRef)(null),T=C.current;if(C.current=S(),z(C.current)&&z(T))return s(u,{});let E,D;return R(C.current)?(E=!0,D=C.current):(E=!1,D=T),s(Rw,{appear:!0,in:E,timeout:200,unmountOnExit:!0,classNames:`StatusWidget`,nodeRef:w,children:s($T,{ref:w,className:`stStatusWidget`,"data-testid":`stStatusWidget`,children:D},`StatusWidget`)})},cE=(0,U.memo)(({isFullScreen:e,setFullScreen:t,locale:n,mapboxToken:r,enforceDownloadInNewTab:i,resourceCrossOriginMode:a,showErrorLinks:o,disableDataExport:c,pageLinkBaseUrl:l,currentPageScriptHash:u,onPageChange:d,navSections:f,appPages:p,initialSidebarState:m,initialSidebarWidth:h,appLogo:g,sidebarChevronDownshift:_,expandSidebarNav:v,sidebarNavVisibleItems:b,hideSidebarNav:x,appRootRef:S,activeTheme:C,setTheme:w,availableThemes:T,stopScript:E,scriptRunState:D,scriptRunId:O,fragmentIdsThisRun:k,scriptRunFinishedSequence:A,scriptRunFinishedFragmentIds:ee,formsData:j,backendOperationClient:M,skillsInstallEnabled:N,onInstallSkills:te,onSkillsCalloutShown:ne,children:re})=>{let ie=(0,U.useMemo)(()=>({locale:n,mapboxToken:r,enforceDownloadInNewTab:i,resourceCrossOriginMode:a,showErrorLinks:o,disableDataExport:c}),[n,r,i,a,o,c]),ae=(0,U.useMemo)(()=>({initialSidebarState:m,initialSidebarWidth:h,appLogo:g,sidebarChevronDownshift:_,expandSidebarNav:v,sidebarNavVisibleItems:b,hideSidebarNav:x,appRootRef:S,isSidebarLocked:m===y.SidebarState.LOCKED}),[m,h,g,_,v,b,x,S]),oe=(0,U.useMemo)(()=>({activeTheme:C,setTheme:w,availableThemes:T}),[C,w,T]),P=(0,U.useMemo)(()=>({pageLinkBaseUrl:l,currentPageScriptHash:u,onPageChange:d,navSections:f,appPages:p}),[l,u,d,f,p]),se=(0,U.useMemo)(()=>({isFullScreen:e,setFullScreen:t}),[e,t]),F=(0,U.useMemo)(()=>({stopScript:E,scriptRunState:D,scriptRunId:O,fragmentIdsThisRun:k,scriptRunFinishedSequence:A,scriptRunFinishedFragmentIds:ee}),[E,D,O,k,A,ee]),ce=(0,U.useMemo)(()=>({formsData:j}),[j]),le=(0,U.useMemo)(()=>({backendOperationClient:M}),[M]),ue=(0,U.useRef)(null),I=(0,U.useCallback)(e=>ue.current===null||ue.current===e?(ue.current=e,!0):!1,[]),de=(0,U.useCallback)(e=>{ue.current===e&&(ue.current=null)},[]),L=(0,U.useMemo)(()=>({enabled:N??!1,onInstall:te??(()=>Promise.resolve(void 0)),onShown:ne??(()=>{}),claimCallout:I,releaseCallout:de}),[N,te,ne,I,de]);return s(tn.Provider,{value:ie,children:s(_h.Provider,{value:ae,children:s(vh.Provider,{value:oe,children:s(fh.Provider,{value:P,children:s(uh.Provider,{value:le,children:s(Jp.Provider,{value:se,children:s(oo.Provider,{value:F,children:s(dh.Provider,{value:ce,children:s(Kf.Provider,{value:L,children:re})})})})})})})})})}),lE=function(e){return e.ABOUT=`about`,e.CLEAR_CACHE=`clearCache`,e.CONNECTION_ERROR=`connectionError`,e.SCRIPT_COMPILE_ERROR=`scriptCompileError`,e.WARNING=`w
29arning`,e.DEPLOY_ERROR=`deployError`,e.DEPLOY_DIALOG=`deployDialog`,e}({}),uE=d(`div`,{target:`e14li120`})(({theme:e})=>({"& > ul":{paddingLeft:e.spacing.twoXL}})),dE=d(`div`,{target:`e14li121`})(({theme:e,hasCodeBelow:t})=>({...t&&{marginBottom:e.spacing.lg}}));function fE(e){let t=[],n=0,r=0,i=/\[([^\]]+)\]\(([^)]+)\)/g,a;for(;(a=i.exec(e))!==null;)a.index>n&&t.push(s(U.Fragment,{children:e.slice(n,a.index)},r++)),t.push(s(`a`,{href:a[2],target:`_blank`,rel:`noopener noreferrer`,children:a[1]},r++)),n=a.index+a[0].length;return n<e.length&&t.push(s(U.Fragment,{children:e.slice(n)},r)),t}function pE({message:e,codeBlock:t}){return a(u,{children:[s(dE,{hasCodeBelow:!!t,children:fE(e)}),t&&s(Ch,{children:t})]})}var mE=(0,U.memo)(pE),hE=`data:image/svg+xml,%3csvg%20width='32'%20height='19'%20viewBox='0%200%2032%2019'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Group%202'%3e%3cpath%20id='path3858'%20d='M15.998%2011.078L10.3882%208.04522L0.650371%202.78157C0.641482%202.77247%200.623705%202.77248%200.614816%202.77248C0.259259%202.59975%20-0.105186%202.96338%200.0281476%203.32702L4.98994%2016.2698L4.99083%2016.2725C4.99616%2016.2852%205.00061%2016.298%205.00594%2016.3107C5.2095%2016.7934%205.65394%2017.0916%206.1375%2017.2089C6.17839%2017.218%206.20764%2017.2262%206.25673%2017.2362C6.30559%2017.2473%206.37394%2017.2625%206.43261%2017.2671C6.44239%2017.268%206.45128%2017.268%206.46106%2017.2689H6.46817C6.47528%2017.2698%206.48239%2017.2698%206.4895%2017.2707H6.49928C6.5055%2017.2716%206.51261%2017.2716%206.51883%2017.2716H6.53039C6.5375%2017.2725%206.54461%2017.2725%206.55172%2017.2725C12.8348%2017.9731%2019.1763%2017.9731%2025.4593%2017.2725C25.5349%2017.2725%2025.6087%2017.2689%2025.6798%2017.2616C25.7029%2017.2589%2025.7251%2017.2562%2025.7473%2017.2534C25.75%2017.2525%2025.7536%2017.2525%2025.7562%2017.2516C25.7713%2017.2498%2025.7864%2017.2471%2025.8016%2017.2443C25.8238%2017.2416%2025.846%2017.2371%2025.8682%2017.2325C25.9127%2017.2225%2025.9329%2017.2152%2025.9932%2017.194C26.0535%2017.1729%2026.1536%2017.1358%2026.2163%2017.1049C26.279%2017.074%2026.3224%2017.0443%2026.3749%2017.0107C26.4398%2016.9689%2026.5015%2016.9261%2026.5641%2016.8781C26.5911%2016.8569%2026.6096%2016.8434%2026.6291%2016.8243L26.6184%2016.818L15.998%2011.078Z'%20fill='%23FF2B2B'/%3e%3cpath%20id='path5063'%20d='M31.3616%202.78158H31.3527L21.6113%208.04524L27.0265%2016.2935L31.9758%203.32704V3.30886C32.1003%202.92704%2031.7181%202.58158%2031.3616%202.78158Z'%20fill='%237D353B'/%3e%3cpath%20id='path5101'%20d='M16.5171%200.278788C16.2682%20-0.0930318%2015.726%20-0.0930318%2015.486%200.278788L10.3882%208.04518L15.998%2011.0779L26.6291%2016.8242C26.6959%2016.7574%2026.7494%2016.6922%2026.806%2016.6234C26.886%2016.5225%2026.9607%2016.4143%2027.0265%2016.2934L21.6113%208.04518L16.5171%200.278788Z'%20fill='%23BD4043'/%3e%3c/g%3e%3c/svg%3e`,gE=`data:image/svg+xml,%3csvg%20width='25'%20height='24'%20viewBox='0%200%2025%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Frame'%3e%3cpath%20id='Vector'%20d='M5.95077%2010.7642L8.09076%2011.6685C8.34683%2011.157%208.61204%2010.6637%208.8864%2010.1887C9.16076%209.71374%209.46256%209.23875%209.79179%208.76376L8.25538%208.46232L5.95077%2010.7642ZM9.84666%2013.0387L12.9743%2016.1352C13.7426%2015.8429%2014.5656%2015.3954%2015.4436%2014.7925C16.3215%2014.1896%2017.1446%2013.5045%2017.9128%2012.7372C19.1931%2011.4584%2020.1946%2010.038%2020.917%208.47602C21.6395%206.91403%2021.955%205.47536%2021.8636%204.16C20.5466%204.06866%2019.1017%204.38379%2017.5287%205.10541C15.9557%205.82703%2014.529%206.82726%2013.2487%208.10608C12.4805%208.87337%2011.7946%209.69547%2011.191%2010.5724C10.5874%2011.4493%2010.1393%2012.2714%209.84666%2013.0387ZM14.7302%2011.2575C14.3096%2010.8373%2014.0992%2010.3212%2014.0992%209.70917C14.0992%209.09716%2014.3096%208.58107%2014.7302%208.16088C15.1509%207.7407%2015.6722%207.53061%2016.2941%207.53061C16.916%207.53061%2017.4373%207.7407%2017.8579%208.16088C18.2786%208.58107%2018.489%209.09716%2018.489%209.70917C18.489%2010.3212%2018.2786%2010.8373%2017.8579%2011.2575C17.4373%2011.6776%2016.916%2011.8877%2016.2941%2011.8877C15.6722%2011.8877%2015.1509%2011.6776%2014.7302%2011.2575ZM15.2515%2020.0539L17.5561%201
297.752L17.2543%2016.2175C16.7788%2016.5463%2016.3032%2016.8432%2015.8277%2017.1081C15.3521%2017.373%2014.8583%2017.6333%2014.3461%2017.8891L15.2515%2020.0539ZM23.839%202.15956C24.1865%204.37009%2023.9716%206.52125%2023.1942%208.61304C22.4169%2010.7048%2021.0771%2012.7007%2019.1749%2014.6007L19.7236%2017.3136C19.7967%2017.679%2019.7784%2018.0352%2019.6687%2018.3823C19.559%2018.7294%2019.3761%2019.0309%2019.12%2019.2866L14.5108%2023.8904L12.2061%2018.4919L7.51461%2013.806L2.10974%2011.5041L6.69153%206.90033C6.9476%206.64457%207.25397%206.46188%207.61064%206.35227C7.9673%206.24265%208.32854%206.22438%208.69435%206.29746L11.4105%206.84553C13.3127%204.94556%2015.3064%203.6028%2017.3915%202.81724C19.4767%202.03168%2021.6258%201.81245%2023.839%202.15956ZM4.05769%2017.2862C4.69786%2016.6468%205.47978%2016.3225%206.40346%2016.3134C7.32713%2016.3042%208.10905%2016.6194%208.74922%2017.2588C9.38939%2017.8982%209.70491%2018.6792%209.69576%2019.6018C9.68662%2020.5243%209.36196%2021.3053%208.72179%2021.9448C8.26452%2022.4015%207.50089%2022.7943%206.43089%2023.1231C5.36089%2023.4519%203.88393%2023.7442%202%2024C2.25607%2022.1183%202.54872%2020.6431%202.87795%2019.5744C3.20718%2018.5056%203.60043%2017.7429%204.05769%2017.2862ZM5.62154%2018.8208C5.43863%2019.0035%205.25572%2019.3369%205.07282%2019.821C4.88991%2020.3051%204.76188%2020.7938%204.68872%2021.2871C5.18256%2021.214%205.67183%2021.0907%206.15653%2020.9171C6.64123%2020.7436%206.97504%2020.5655%207.15794%2020.3828C7.37743%2020.1635%207.49632%2019.8986%207.51461%2019.5881C7.5329%2019.2775%207.4323%2019.0126%207.21282%2018.7934C6.99333%2018.5741%206.72812%2018.4691%206.41718%2018.4782C6.10624%2018.4874%205.84102%2018.6015%205.62154%2018.8208Z'%20fill='%23A3A8B8'/%3e%3c/g%3e%3c/svg%3e`,_E=``+new URL(`../media/snowflake.JU2jBHL8.svg`,import.meta.url).href;function vE(){return{title:`Unable to deploy`,body:a(u,{children:[s(`p`,{children:`This Git tree is in a detached HEAD state.`}),s(`p`,{children:`Please commit the latest changes and push to GitHub to continue.`})]})}}function yE(e){return{title:`Unable to deploy`,body:s(It,{source:`
30The app's main file \`${e}\` has
31not been pushed to GitHub. Please add it to continue.
32`,allowHTML:!1})}}var bE=`https://share.streamlit.io/deploy`,xE=`https://streamlit.io/cloud`,SE=`https://share.streamlit.io/cloud-getting-started`,CE=`https://share.streamlit.io/deployment-tutorial`,wE=`https://share.streamlit.io/sis-about`,TE=`https://share.streamlit.io/snowflake-trial`,EE=d(`p`,{target:`euwf8ug0`})({textAlign:`justify`});function DE(){return{title:`Unable to deploy`,body:a(EE,{children:[`The app’s code is not connected to a remote GitHub repository. To deploy on Streamlit Community Cloud, please put your code in a GitHub repository and publish the current branch. Read more in`,` `,s(`a`,{href:SE,rel:`noopener noreferrer`,target:`_blank`,children:`our documentation`}),`.`]})}}var OE=`data:image/svg+xml,%3csvg%20width='12'%20height='9'%20viewBox='0%200%2012%209'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M4.00009%206.78L1.68676%204.46667C1.42676%204.20667%201.00676%204.20667%200.746758%204.46667C0.486758%204.72667%200.486758%205.14667%200.746758%205.40667L3.53342%208.19334C3.79342%208.45334%204.21342%208.45334%204.47342%208.19334L11.5268%201.14C11.7868%200.880005%2011.7868%200.460005%2011.5268%200.200005C11.2668%20-0.0599951%2010.8468%20-0.0599951%2010.5868%200.200005L4.00009%206.78Z'%20fill='%23808495'/%3e%3c/svg%3e`,kE=d(`div`,{target:`e1usqyca0`})(({theme:e})=>({borderTopWidth:e.sizes.borderWidth,borderRightWidth:e.sizes.borderWidth,borderBottomWidth:e.sizes.borderWidth,borderLeftWidth:e.sizes.borderWidth,borderTopStyle:`solid`,borderRightStyle:`solid`,borderBottomStyle:`none`,borderLeftStyle:`none`,borderTopColor:e.colors.borderColor,borderRightColor:e.colors.borderColor,borderBottomColor:e.colors.borderColor,borderLeftColor:e.colors.borderColor,padding:e.spacing.twoXL,height:`100%`,display:`flex`,flexDirection:`column`,"&:last-child":{borderRightStyle:`none`,borderBottomRightRadius:e.radii.xl},"&:first-child":{borderBottomLeftRadius:e.radii.xl},[`@media (max-width: ${e.breakpoints.md})`]:{padding:e.spacing.xl,"&:last-child":{borderBottomLeftRadius:e.radii.xl}}}
32)),AE=d(`div`,{shouldForwardProp:e=>e!==`$flexGrow`,target:`e1usqyca1`})(({$flexGrow:e=1})=>({flexGrow:e})),jE=d(`div`,{target:`e1usqyca2`})(({theme:e})=>({fontFamily:e.fonts.sansSerif,fontWeight:e.fontWeights.bold,fontSize:e.fontSizes.lg,marginTop:e.spacing.twoXL,marginBottom:e.spacing.twoXS,[`@media (max-width: ${e.breakpoints.md})`]:{marginTop:e.spacing.md}})),ME=d(`div`,{target:`e1usqyca3`})(({theme:e})=>({fontFamily:e.fonts.sansSerif,fontWeight:e.fontWeights.normal,fontSize:e.fontSizes.md,marginTop:e.spacing.twoXS,marginBottom:e.spacing.md,[`@media (max-width: ${e.breakpoints.md})`]:{marginTop:e.spacing.md}})),NE=d(`div`,{target:`e1usqyca4`})(({theme:e})=>({display:`grid`,maxWidth:`calc(1.25 * ${e.sizes.contentMaxWidth})`,gridTemplateColumns:`1fr 1fr 1fr`,gridGap:e.spacing.none,[`@media (max-width: ${e.breakpoints.md})`]:{gridTemplateColumns:`1fr`}})),PE=d(`div`,{target:`e1usqyca5`})(({theme:e})=>({display:`inline-flex`,marginTop:e.spacing.sm,"& > span":{fontFamily:e.fonts.sansSerif,fontWeight:e.fontWeights.normal,fontSize:e.fontSizes.md,marginLeft:e.spacing.twoXL,color:e.colors.gray70},"& > img":{position:`absolute`,marginTop:e.spacing.sm}})),FE=d(`div`,{target:`e1usqyca6`})(({theme:e})=>({display:`flex`,marginTop:e.spacing.threeXL,"& > button":{marginRight:e.spacing.twoXL},[`@media (max-width: ${e.breakpoints.md})`]:{marginTop:e.spacing.xl}}));function IE(e){let{children:t}=e;return a(PE,{children:[s(`img`,{src:OE,alt:`Checkmark`}),s(`span`,{children:t})]})}var LE=d(`div`,{target:`e1drl7a90`})(({theme:e})=>({paddingTop:e.spacing.md,color:e.colors.bodyText,fontSize:e.fontSizes.md,overflowY:`auto`}));function RE({children:e}){return s(LE,{children:e})}function zE(e){let{children:t,onClose:n}=e;return a(Al,{isOpen:!0,closeable:!0,onClose:n,size:`auto`,children:[s(wl,{children:`Deploy this app using...`}),s(RE,{children:t})]})}var{GitStates:BE}=k,VE=e=>{window.open(e,`_blank`)},HE=e=>{if(e){let t=new URL(bE);return t.searchParams.set(`repository`,e.repository??``),t.searchParams.set(`branch`,e.branch??``),t.searchParams.set(`mainModule`,e.module??``),t.toString()}return xE};function UE(e){let{gitInfo:t,onClose:n,metricsMgr:r,showDeployError:i,isDeployErrorModalOpen:o}=e,c=(0,U.useCallback)(()=>{if(r.enqueue(`menuClick`,{label:`deployButtonInDialog`}),!t){let e=DE();i(e.title,e.body);return}let{repository:e,branch:a,module:s,untrackedFiles:c,state:l}=t;if((!e||!a||!s)&&l===BE.DEFAULT){let e=DE();i(e.title,e.body);return}if(l===BE.HEAD_DETACHED){let e=vE();i(e.title,e.body);return}if(s&&c?.includes(s)){let e=yE(s);i(e.title,e.body);return}o&&n(),VE(HE(t))},[r,t,o,i,n]);return s(zE,{onClose:n,children:a(NE,{children:[a(kE,{children:[a(AE,{$flexGrow:1,children:[s(`img`,{src:hE,alt:`Streamlit Logo`,"data-testid":`stDeployDialogCommunityCloudIcon`}),s(jE,{children:`Streamlit Community Cloud`}),s(ME,{children:`For community, always free`}),s(IE,{children:`For personal hobbies and learning`}),s(IE,{children:`Deploy unlimited public apps`}),s(IE,{children:`Explore and learn from Streamlit’s community and popular apps`})]}),s(`div`,{children:a(FE,{children:[s(Vr,{kind:V.PRIMARY,onClick:c,children:`Deploy now`}),s(Vr,{onClick:()=>{r.enqueue(`menuClick`,{label:`readMoreCommunityCloudInDeployDialog`}),VE(SE)},kind:V.MINIMAL,children:`Learn more`})]})})]}),a(kE,{children:[a(AE,{$flexGrow:1,children:[s(`img`,{src:_E,alt:`Snowflake`,"data-testid":`stDeployDialogSnowflakeDeploymentIcon`}),s(jE,{children:`Snowflake`}),s(ME,{children:`For enterprise`}),s(IE,{children:`Enterprise-level security, support, and fully managed infrastructure`}),s(IE,{children:`Deploy unlimited private apps with role-based sharing`}),s(IE,{children:`Integrate with Snowflake’s full data stack`})]}),s(`div`,{children:a(FE,{children:[s(Vr,{kind:V.SECONDARY,onClick:()=>{r.enqueue(`menuClick`,{label:`startTrialInDeployDialog`}),VE(TE)},children:`Start trial`}),s(Vr,{onClick:()=>{r.enqueue(`menuClick`,{label:`learnMoreSnowflakeInDeployDialog`}),VE(wE)},kind:V.MINIMAL,children:`Learn more`})]})})]}),a(kE,{children:[a(AE,{$flexGrow:2,children:[s(`img`,{src:gE,alt:`Rocket`,"data-testid":`stDeployDialogCustomDeploymentIcon`}),s(jE,{children:`Other platforms`}),s(ME,{children:`For custom deployment `}),s(IE,{children:`Deploy on your own hardware or cloud service`}),s(IE,{children:`Set up and maintain your own authentication, resources, and costs`})]}),s(`div`,{children:s(FE,{children:s(Vr,{onClick:()=>{r.enqueue(`menuClick`,{label:`readMoreDeployTutorialInDeployDialog`}),VE(CE)},kind:V.MINIMAL,children:`Learn more`})})})]})]})})}function WE(e){switch(e.type){case lE.ABOUT:return s(GE,{...e});case lE.CLEAR_CACHE:return s(KE,{...e});case lE.SCRIPT_COMPILE_ERROR:return s(qE,{...e});
32case lE.WARNING:case lE.CONNECTION_ERROR:return s(JE,{...e});case lE.DEPLOY_DIALOG:return s(UE,{...e});case lE.DEPLOY_ERROR:return s(YE,{...e});case void 0:return XE(e);default:return ZE(e)}}function GE(e){return a(Al,{isOpen:!0,onClose:e.onClose,children:[s(wl,{children:`About`}),s(Tl,{children:e.aboutSectionMd&&s(It,{source:e.aboutSectionMd,allowHTML:!1})})]})}function KE(e){let t=[`**Are you sure you want to clear the app's function caches?**`,`This will remove all cached entries from functions using`,"`@st.cache_data` and `@st.cache_resource`."].join(`  
33`);return s(`div`,{"data-testid":`stClearCacheDialog`,children:a(Al,{isOpen:!0,onClose:e.onClose,children:[s(wl,{children:`Clear caches`}),s(Tl,{children:s(It,{source:t,allowHTML:!1})}),a(El,{children:[s(Dl,{autoFocus:!0,kind:V.GHOST,onClick:e.onClose,children:`Cancel`}),s(Dl,{kind:V.SECONDARY,onClick:e.confirmCallback,children:`Clear caches`})]})]})})}function qE(e){return a(Al,{isOpen:!0,onClose:e.onClose,size:`auto`,children:[s(wl,{children:`Script execution error`}),s(Tl,{children:s(Ch,{children:e.exception?.message?e.exception.message:`No message`})}),s(El,{children:s(Dl,{kind:V.SECONDARY,onClick:e.onClose,children:`Close`})})]})}function JE(e){return a(Al,{isOpen:!0,onClose:e.onClose,children:[s(wl,{children:e.title}),s(Tl,{children:e.msg})]})}function YE({title:e,msg:t,onClose:n,onContinue:r,onTryAgain:i}){return a(Al,{isOpen:!0,onClose:n,children:[s(wl,{children:e}),s(Tl,{children:s(uE,{children:t})}),a(El,{children:[s(Dl,{kind:V.GHOST,onClick:i,children:`Try again`}),s(Dl,{kind:V.SECONDARY,onClick:()=>{n(),r&&r()},children:r?`Continue anyway`:`Close`})]})]})}function XE({onClose:e}){return s(Al,{isOpen:!1,onClose:e})}function ZE(e){return s(Al,{isOpen:!0,onClose:e.onClose,children:s(Tl,{children:`Dialog type "${e.type}" not recognized.`})})}var QE=d(`div`,{target:`epm40z20`})(({theme:e})=>({display:`flex`,gap:e.spacing.sm,alignItems:`center`,lineHeight:e.iconSizes.md})),$E=d(`div`,{target:`epm40z21`})(({theme:e,icon:t})=>({background:`url("${t}") no-repeat center / contain`,width:e.iconSizes.base,height:e.iconSizes.base})),eD=d(`div`,{target:`epm40z22`})({display:`flex`,alignItems:`center`,flexDirection:`row`});function tD({label:e,icon:t,onClick:n}){return s(`div`,{className:`stToolbarActionButton`,"data-testid":`stToolbarActionButton`,children:s(Vr,{onClick:n,kind:V.HEADER_BUTTON,children:a(QE,{children:[t&&s($E,{"data-testid":`stToolbarActionButtonIcon`,icon:t}),e&&s(`span`,{"data-testid":`stToolbarActionButtonLabel`,children:e})]})})})}function nD({sendMessageToHost:e,hostToolbarItems:t,metricsMgr:n}){return s(eD,{className:`stToolbarActions`,"data-testid":`stToolbarActions`,children:t.map(({key:t,label:r,icon:i})=>s(tD,{label:r,icon:i,onClick:()=>{n.enqueue(`menuClick`,{label:t}),e({type:`TOOLBAR_ITEM_CALLBACK`,key:t})}},t))})}var rD=e(i(),1),iD=g(`0%{opacity:0;}25%{opacity:1;}100%{opacity:0;}`),aD=d(`div`,{target:`erg7rn60`})(({theme:e})=>({position:`fixed`,display:`flex`,justifyContent:`center`,alignItems:`center`,top:0,left:0,width:e.sizes.full,height:e.sizes.full,fontSize:`40vh`,color:e.colors.redTextColor,fontWeight:e.fontWeights.bold,opacity:`0.8`,textShadow:`1px 1px 10px ${e.colors.grayTextColor}`,transition:`opacity 0.3s ease-in-out`,animation:`${iD} 1s`})),oD=({countdown:e,endCallback:t})=>{let[n,r]=(0,U.useState)(e);return s(aD,{"data-testid":`stCountdown`,onAnimationEnd:()=>{let e=n-1;e>=0&&r(e),e===0&&t()},children:s(`span`,{children:n})},`frame${n}`)},sD=d(`label`,{target:`erxc94j0`})({margin:0}),cD=d(`div`,{target:`erxc94j1`})({margin:0}),lD=({onClose:e,toggleRecordAudio:t,recordAudio:n,startRecording:r})=>{let[i,o]=(0,U.useState)(n),c=(0,U.useCallback)(e=>{let{checked:n}=e.target;n!==i&&(o(n),t())},[i,t]),l=(0,U.useCallback)(()=>{r(),e()},[r,e]);return a(Al,{isOpen:!0,onClose:e,children:[s(wl,{children:`Record a screencast`}),a(Tl,{children:[s(`p`,{children:`This will record a video with the contents of your screen, so you can easily share what you're seeing with others.`}),s(`p`,{children:a(sD,{"data-testid":`stScreencastAudioCheckbox`,children:[s(`input`,{type:`checkbox`,name:`recordAudio`,"aria-label":`Also record audio`,checked:i,onChange:c}),` `,`Also record audio`]})}),s(cD,{"data-testid":`stScreencastInstruction`,children:s(It,{source:"Press `Esc` any time to stop recording.",allowHTML:!1})})]}),s(El,{children:s(Dl,{kind:V.SECONDARY,onClick:l,children:`Start recording!`})})]})},uD=d(`div`,{target:`e15jpqoz0`})({display:`flex`}),dD=d(`div`,{target:`e15jpqoz1`})(({theme:e})=>({display:`flex`,alignItems:`center`,justifyItems:`center`,marginRight:e.spacing.twoXL,marginLeft:e.spacing.sm,fontSize:e.fontSizes.fourXL})),fD=d(`p`,{target:`e15jpqoz2`})(({theme:e})=>({margin:e.spacing.none})),pD=(0,U.memo)(({onClose:e})=>a(Al,{isOpen:!0,onClose:e,children:[s(wl,{children:`Record a screencast`}),s(Tl,{children:a(uD,{"data-testid":`stUnsupportedBrowserDialog`,children:[s(dD,{children:s(`span`,{role:`img`,"aria-label":`Alien Monster`,children:`👾`})}),s(fD,{children:`Due to limitations with some browsers, this feature is only supported on recent desktop versions of Chrome, Firefox, and Edge.`})]})})]})),mD=d(`video`,{target:`e13wfkbd0`})(({theme:e})=>({width:e.sizes.full,borderRadius:e.radii.sm})),hD=d(`div`,{target:`e13wfkbd1`})(({theme:e})=>({display:`flex`,flexDirection:`column`,width:e.sizes.full})),gD=d(`div`,{target:`e13wfkbd2`})(({theme:e})=>({display:`flex`,flexDirection:`row`,paddingTop:e.spacing.md,paddingBottom:e.spacing.md})),_D=d(`div`,{target:`e13wfkbd3`})(({theme:e})=>({paddingRight:e.spacing.lg,textAlign:`right`,color:e.colors.grayTextColor,fontWeight:e.fontWeights.bold,width:`6em`})),vD=d(`div`,{target:`e13wfkbd4`})(({theme:e})=>({flex:1,paddingRight:e.spacing.lg,marginRight:`6em`,[`@media (max-width: ${e.breakpoints.sm})`]:{marginRight:e.spacing.none}})),yD=d(`p`,{target:`e13wfkbd5`})(({theme:e})=>({marginTop:e.spacing.sm,marginBottom:e.spacing.none,fontSize:e.fontSizes.sm})),bD=d(`div`,{target:`e13wfkbd6`})(({theme:e})=>({marginTop:e.spacing.twoXS})),xD=({onClose:e,videoBlob:t,fileName:n})=>{let[r,i]=(0,U.useState)(``);return(0,U.useEffect)(()=>{let e=URL.createObjectURL(t);return i(e),()=>URL.revokeObjectURL(e)},[t]),a(Al,{isOpen:!0,onClose:e,width:`80vw`,children:[s(wl,{children:`Next steps`}),s(Tl,{children:a(hD,{"data-testid":`stVideoRecordedDialog`,children:[a(gD,{children:[s(_D,{children:`Step 1`}),a(vD,{children:[s(`p`,{children:`Preview your video below:`}),s(mD,{src:r,controls:!0})]})]}),a(gD,{children:[s(_D,{children:`Step 2`}),a(vD,{children:[s(bD,{children:s(Vr,{kind:V.SECONDARY,onClick:()=>{let t=document.createElement(`a`);t.setAttribute(`href`,r),t.setAttribute(`download`,`${n}.webm`),t.click(),e()},children:`Save video to disk`})}),a(yD,{children:[`This video is encoded in the`,` `,s(`a`,{href:`https://www.webmproject.org/`,children:`WebM format`}),`, which is only supported by newer video players. You can also play it by dragging the file directly into your browser.`]})]})]}),a(gD,{children:[s(_D,{children:`Step 3`}),a(vD,{children:[`Share your video with the world on Twitter, LinkedIn, YouTube, or just plain email!`,` `,s(`span`,{role:`img`,"aria-label":`Happy`,children:`😀`})]})]})]})})]})},SD=(0,yi.getLogger)(`withScreencast`);function CD(e){let t=t=>{let{testOverride:n}=t,r=(0,U.useRef)(null),[i,o]=(0,U.useState)(`streamlit-screencast`),[c,l]=(0,U.useState)(!1),[u,d]=(0,U.useState)(void 0),[f,p]=(0,U.useState)(n||`OFF`),m=(0,U.useCallback)(()=>{l(e=>!e)},[]),h=(0,U.useCallback)(async()=>
33{if(!(f===`OFF`||z(r.current))){if(f===`COUNTDOWN`){p(`OFF`);return}if(f===`RECORDING`){let e=r.current;if(!e||e.getState()===`inactive`)p(`OFF`);else{let t=await e.stop();d(t),p(`PREVIEW_FILE`)}}}},[f]),g=(0,U.useCallback)(async()=>{if(!sC.isSupportedBrowser()){p(`UNSUPPORTED`);return}r.current=new sC({recordAudio:c,onErrorOrStop:()=>{h().catch(e=>SD.warn(`withScreencast.stopRecording threw an error: ${e}`))}});try{await r.current.initialize()}catch(e){SD.warn(`ScreenCastRecorder.initialize error: ${e}`),p(`UNSUPPORTED`);return}p(`COUNTDOWN`)},[c,h]),_=(0,U.useCallback)(e=>{if(!sC.isSupportedBrowser()){p(`UNSUPPORTED`);return}if(f===`OFF`){o(e),p(`SETUP`);return}h().catch(e=>SD.warn(`withScreencast.stopRecording threw an error: ${e}`))},[f,h]),v=(0,U.useCallback)(()=>{if(z(r.current))throw Error(`Countdown finished but recorder is null`);r.current.start()?p(`RECORDING`):h().catch(e=>SD.warn(`withScreencast.stopRecording threw an error: ${e}`))},[h]),y=(0,U.useCallback)(()=>{p(`OFF`)},[]),b={currentState:f,toggleRecordAudio:m,startRecording:_,stopRecording:h};return a(`div`,{className:`withScreencast`,"data-testid":`stScreencast`,children:[s(e,{...t,screenCast:b}),f===`UNSUPPORTED`&&s(pD,{onClose:y}),f===`SETUP`&&s(lD,{recordAudio:c,onClose:y,startRecording:g,toggleRecordAudio:m}),f===`COUNTDOWN`&&s(oD,{countdown:3,endCallback:v}),f===`PREVIEW_FILE`&&u&&s(xD,{onClose:y,videoBlob:u,fileName:i})]})};return t.displayName=`withScreencast(${e.displayName||e.name||`Component`})`,(0,rD.default)(t,e)}var wD=()=>{let{activeTheme:e}=(0,U.useContext)(vh),{innerWidth:t}=Qh();return{isMobile:t<parseInt(e.emotion.breakpoints.md,10)}},TD=`https://data.streamlit.io/metrics.json`,ED=(0,yi.getLogger)(`MetricsManager`),DD=class{constructor(e){this.initialized=!1,this.actuallySendMetrics=!1,this.metricsUrl=void 0,this.sendMessageToHost=()=>{},this.anonymousId=``,this.pendingEvents=[],this.appHash=`Not initialized`,this.metadata={},this.setAppHash=e=>{this.appHash=e},this.setMetricsConfig=(e=``)=>{this.metricsUrl=e},this.sessionInfo=e}async initialize({gatherUsageStats:e,sendMessageToHost:t}){this.sendMessageToHost=t,this.actuallySendMetrics=e&&this.metricsUrl!==`off`,this.getAnonymousId(),this.actuallySendMetrics&&!this.metricsUrl&&(await this.requestDefaultMetricsConfig(),this.metricsUrl||(ED.error(`Undefined metrics config - deactivating metrics tracking.`),this.actuallySendMetrics=!1)),this.actuallySendMetrics&&this.sendPendingEvents(),ED.info(`Gather usage stats: `,this.actuallySendMetrics),this.initialized=!0}enqueue(e,t={}){if(!this.initialized||!this.sessionInfo.isSet){this.pendingEvents.push([e,t]);return}this.actuallySendMetrics&&(this.pendingEvents.length&&this.sendPendingEvents(),this.send(e,t))}setMetadata(e){this.metadata=e}async requestDefaultMetricsConfig(){let e=L();if(e){let e=window.localStorage.getItem(`stMetricsConfig`);if(e){this.metricsUrl=e;return}}try{let t=await fetch(TD,{signal:AbortSignal.timeout(5e3)});if(!t.ok)this.metricsUrl=void 0,ED.error(`Failed to fetch metrics config: `,t.status);else{let n=await t.json();this.metricsUrl=n.url??void 0,e&&this.metricsUrl&&window.localStorage.setItem(`stMetricsConfig`,this.metricsUrl)}}catch(e){ED.error(`Failed to fetch metrics config:`,e)}}send(e,t={}){let n=this.buildEventProto(e,t);this.metricsUrl===`postMessage`?this.postMessageEvent(e,n):this.track(n)}sendPendingEvents(){this.pendingEvents.forEach(([e,t])=>{this.send(e,t)}),this.pendingEvents=[]}async track(e){let t=new Request(this.metricsUrl,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e.toJSON())});await fetch(t)}postMessageEvent(e,t){this.sendMessageToHost({type:`METRICS_EVENT`,eventName:e,data:t})}buildEventProto(e,t){let n=new b({event:e,anonymousId:this.anonymousId,...this.getHostTrackingData(),...this.getInstallationData(),reportHash:this.appHash,dev:!1,source:`browser`,streamlitVersion:this.sessionInfo.current.streamlitVersion,isHello:this.sessionInfo.isHello,appId:this.sessionInfo.current.appId,sessionId:this.sessionInfo.current.sessionId,pythonVersion:this.sessionInfo.current.pythonVersion,serverOs:this.sessionInfo.current.serverOS,hasDisplay:this.sessionInfo.current.hasDisplay,isWebdriver:OD(),...this.getContextData()});if(e===`menuClick`)n.label=t.label,t.surface&&(n.surface=t.surface);else if(e===`pageProfile`)return new b({...n,...t});return n}getInstallationData(){return{machineIdV3:this.sessionInfo.current.installationIdV3,machineIdV4:this.sessionInfo.current.installationIdV4}}getHostTrackingData(){return this.metadata?Pa(this.metadata,[`hostedAt`,`owner`,`repo`,`branch`,`mainModule`,`creatorId`]):{}}getContextData(){return{contextPageUrl:window.location.href,contextPageTitle:document.title,contextPagePath:window.location.pathname,contextPageReferrer:document.referrer,contextPageSearch:window.location.search,contextLocale:window.navigator.language,contextUserAgent:window.navigator.userAgent}}
33getAnonymousId(){if(!this.actuallySendMetrics)return;let e=`ajs_anonymous_id`,t=L(),n=pe(e),r=t?window.localStorage.getItem(e):null,i=new Date;if(i.setFullYear(new Date().getFullYear()+1),n)this.anonymousId=n,t&&window.localStorage.setItem(e,n);else if(r){try{this.anonymousId=JSON.parse(r)}catch{this.anonymousId=r}Xe(e,this.anonymousId,i)}else this.anonymousId=ge(),Xe(e,this.anonymousId,i),t&&window.localStorage.setItem(e,this.anonymousId)}};function OD(){return window.navigator?.webdriver??!1}var kD=class{constructor(){this.onSessionEvent=new Hv.Signal}handleSessionEventMsg(e){this.onSessionEvent.emit(e)}},AD=d(`div`,{target:`e1vju3fw0`})(({theme:e})=>{let t=he(e);return{position:`absolute`,background:e.colors.bgColor,color:e.colors.bodyText,top:e.spacing.none,left:e.spacing.none,right:e.spacing.none,bottom:e.spacing.none,colorScheme:t?`light`:`dark`,overflow:`hidden`,"@media print":{float:`none`,height:e.sizes.full,position:`static`,overflow:`visible`}}});function jD(){let e=de(navigator.userAgent);return{browserName:e.browserName||`Unknown`,browserVersion:e.browserVersion||`Unknown`,deviceType:e.deviceType||`desktop`,os:e.os||`Unknown`}}var MD=(e,t)=>t===F.ToolbarMode.DEVELOPER?!0:F.ToolbarMode.VIEWER===t||F.ToolbarMode.MINIMAL===t?!1:e||Ca();function ND(e){return e||`Streamlit`}var PD=class{constructor(e,t,n,r){this.hostCommunicationMgr=e,this.onUpdatePageUrl=t,this.onPageNotFound=n,this.onPageIconChange=r,this.isPageIconSet=!1,this.isPageTitleSet=!1,this.hasSetDefaultFavicon=!1,this.mainScriptHash=null,this.appPages=[],this.mainPage=null,this.hideSidebarNav=null}handleNewSession(e){return this.mainScriptHash!==e.mainScriptHash&&(this.isPageTitleSet=!1,this.isPageIconSet=!1,this.hasSetDefaultFavicon=!1),this.mainScriptHash=e.mainScriptHash,this.hideSidebarNav===null&&(this.hideSidebarNav=e.config?.hideSidebarNav??null),[{currentPageScriptHash:e.pageScriptHash,hideSidebarNav:this.hideSidebarNav??!1},()=>{}]}handleNavigation(e){let{sections:t,position:n,appPages:r}=e;this.appPages=r,this.hideSidebarNav=n===E.Position.HIDDEN;let i=e.pageScriptHash,a=r.find(e=>e.pageScriptHash===i),o=r.find(e=>e.isDefault);this.mainPage=o;let s=a.urlPathname;if(!this.isPageTitleSet){let e=ND(a.pageName);document.title=e,this.hostCommunicationMgr.sendMessageToHost({type:`SET_PAGE_TITLE`,title:a.pageName??``})}return!this.isPageIconSet&&a.icon&&this.onPageIconChange(a.icon),[{appPages:r,navSections:t,hideSidebarNav:this.hideSidebarNav,expandSidebarNav:e.expanded,sidebarNavVisibleItems:e.visibleItems??void 0,currentPageScriptHash:i},()=>{this.onUpdatePageUrl(o.urlPathname??``,s,a.isDefault??!1),this.hostCommunicationMgr.sendMessageToHost({type:`SET_APP_PAGES`,appPages:r}),this.hostCommunicationMgr.sendMessageToHost({type:`SET_CURRENT_PAGE_NAME`,currentPageName:a.isDefault?``:s,currentPageScriptHash:i})}]}handlePageNotFound(e){return this.onPageNotFound(e),[{currentPageScriptHash:this.mainScriptHash??``},()=>{this.hostCommunicationMgr.sendMessageToHost({type:`SET_CURRENT_PAGE_NAME`,currentPageName:``,currentPageScriptHash:this.mainScriptHash??``})}]}findPageByUrlPath(e){let t;try{t=decodeURIComponent(e)}catch{t=e}return this.appPages.find(e=>t.endsWith(`/`+e.urlPathname))??this.mainPage}handlePageConfigChanged(e){e.favicon&&(this.isPageIconSet=!0),e.title&&(this.isPageTitleSet=!0)}clearPageElements(e,t){return e.filterMainScriptElements(t)}};function FD(e){return Object.entries(e).reduce((e,[t,n])=>(n!==void 0&&(e[t]=n),e),{})}function ID(e,t){return e??t}function LD(e,t){if(!e)return t;let n=S(e.allowedOrigins)?e.allowedOrigins:void 0;return{...t,allowedOrigins:ID(n,t.allowedOrigins),useExternalAuthToken:ID(e.useExternalAuthToken,t.useExternalAuthToken),enableCustomParentMessages:ID(e.enableCustomParentMessages,t.enableCustomParentMessages),blockErrorDialogs:ID(e.blockErrorDialogs,t.blockErrorDialogs),mapboxToken:ID(e.mapboxToken,t.mapboxToken),disableFullscreenMode:ID(e.disableFullscreenMode,t.disableFullscreenMode),enforceDownloadInNewTab:ID(e.enforceDownloadInNewTab,t.enforceDownloadInNewTab),resourceCrossOriginMode:ID(e.resourceCrossOriginMode,t.resourceCrossOriginMode),setAnonymousCrossOriginPropertyOnMediaElements:t.setAnonymousCrossOriginPropertyOnMediaElements,metricsUrl:ID(e.metricsUrl,t.metricsUrl)}}var RD=(0,yi.getLogger)(`App`),zD=CD(class extends U.PureComponent{get skillsCalloutEnvEligible(){return this.cachedSkillsCalloutEnvEligible===void 0&&(this.cachedSkillsCalloutEnvEligible=Ca()&&!We()&&L()),this.cachedSkillsCalloutEnvEligible}constructor(e){super(e),this.sessionInfo=new bg,this.metricsMgr=new DD(this.sessionInfo),this.sessionEventDispatcher=new kD,this.embeddingId=Me(),this.appRootRef=(0,U.createRef)(),this.isInitializingConnectionManager=!0,this.hasReceivedNewSession=!1,this.autoRerunIntervals=new Map,this.skillsNudgeShown=!1,this.skillsNudgeSuppressionReported=!1,this.errorCalloutShown=!1,this.inFlightSkillsInstall=null,this.showDeployError=(e,t,n
33)=>{let r={type:lE.DEPLOY_ERROR,title:e,msg:t,onContinue:n,onClose:()=>{},onTryAgain:this.sendLoadGitInfoBackMsg};this.openDialog(r)},this.handleThemeMessage=(e,t)=>{let[,n,r]=Ye(),i=bt(this.props.theme.activeTheme);e===n.name&&i?this.props.theme.setTheme(n):e===r.name&&i?this.props.theme.setTheme(r):t&&this.props.theme.setImportedTheme(t)},this.handleConnectionStateChanged=e=>{if(RD.info(`Connection state changed from ${this.state.connectionState} to ${e}`),e===$.CONNECTED){RD.info(`Reconnected to server.`),this.state.connectionErrorDismissed&&this.setState({connectionErrorDismissed:!1});let e=this.state.scriptRunState===W.RUNNING,t=this.state.scriptRunState===W.RERUN_REQUESTED;!this.sessionInfo.last||e||t||this.state.fragmentIdsThisRun.length>0||this.autoRerunIntervals.size>0?(RD.info(`Requesting a script run.`),this.widgetMgr.sendUpdateWidgetsMessage(void 0),this.setState({dialog:null})):this.state.dialog?.type===lE.CONNECTION_ERROR&&this.setState({dialog:null}),this.hostCommunicationMgr.sendMessageToHost({type:`WEBSOCKET_CONNECTED`})}else this.state.connectionState===$.CONNECTED&&this.hostCommunicationMgr.sendMessageToHost({type:`WEBSOCKET_DISCONNECTED`,attemptingToReconnect:e!==$.DISCONNECTED_FOREVER}),this.sessionInfo.isSet&&this.sessionInfo.disconnect(),this.backendOperationClient.cleanup();this.isInitializingConnectionManager?this.setState({connectionState:e}):(0,As.flushSync)(()=>{this.setState({connectionState:e})})},this.handleGitInfoChanged=e=>{this.setState({gitInfo:e})},this.handleCustomParentMessage=e=>{this.state.appConfig.enableCustomParentMessages?this.hostCommunicationMgr.sendMessageToHost({type:`CUSTOM_PARENT_MESSAGE`,message:e.message}):RD.error(`Sending messages to the host is disabled in line with the platform policy.`)},this.handleMessage=e=>{let t=(e,t,n)=>{let r=e[t];if(r in n)return n[r](e[r]);throw Error(`Cannot handle ${t} "${r}".`)};try{t(e,`type`,{newSession:e=>this.handleNewSession(e),sessionStatusChanged:e=>this.handleSessionStatusChanged(e),sessionEvent:e=>this.handleSessionEvent(e),delta:t=>this.handleDeltaMsg(t,e.metadata,e.hash),pageConfigChanged:e=>this.handlePageConfigChanged(e),pageInfoChanged:e=>this.handlePageInfoChanged(e),pageNotFound:e=>this.handlePageNotFound(e),gitInfoChanged:e=>this.handleGitInfoChanged(e),scriptFinished:e=>this.handleScriptFinished(e),pageProfile:e=>this.handlePageProfileMsg(e),autoRerun:e=>this.handleAutoRerun(e),stopAutoRerun:e=>this.handleStopAutoRerun(e),fileUrlsResponse:e=>this.uploadClient.onFileURLsResponse(e),parentMessage:e=>this.handleCustomParentMessage(e),logo:t=>this.handleLogo(t,e.metadata),navigation:e=>this.handleNavigation(e),authRedirect:e=>{Le()?this.hostCommunicationMgr.sendMessageToSameOriginHost({type:`REDIRECT_TO_URL`,url:e.url}):window.location.href=e.url},heartbeatAck:()=>this.handleHeartbeatAck(),backendOperationResponse:e=>this.backendOperationClient.onResponse(e)})}catch(e){let t=Tg(e);RD.error(t),this.showError(`Bad message format`,{message:t.message})}},this.handleLogo=(e,t)=>{this.setState(n=>({elements:n.elements.appRootWithLogo(e,{activeScriptHash:t.activeScriptHash,scriptRunId:n.scriptRunId})}))},this.handlePageConfigChanged=e=>{let{title:t,favicon:n,layout:r,initialSidebarState:i,initialSidebarWidth:a,menuItems:o}=e;this.appNavigation.handlePageConfigChanged(e),t&&(this.hostCommunicationMgr.sendMessageToHost({type:`SET_PAGE_TITLE`,title:t}),document.title=t),n&&this.onPageIconChanged(n),r!==this.state.layout&&r!==y.Layout.LAYOUT_UNSET&&this.setState(e=>({layout:r,userSettings:{...e.userSettings,wideMode:r===y.Layout.WIDE}})),i!==this.state.initialSidebarState&&i!==y.SidebarState.SIDEBAR_UNSET&&this.setState(()=>({initialSidebarState:i}));let s=a?.pixelWidth===void 0?void 0:a.pixelWidth;R(s)&&s!==this.state.initialSidebarWidth&&this.setState(()=>({initialSidebarWidth:s})),o&&this.setState(e=>(o.clearAboutMd&&(o.aboutSectionMd=``),{menuItems:{...e.menuItems,...o}}))},this.handleQueryParamsFromWidget=e=>{this.setState({queryParams:e}),this.hostCommunicationMgr.sendMessageToHost({type:`SET_QUERY_PARAM`,queryParams:e?`?${e}`:``})},this.handlePageInfoChanged=e=>{let{queryString:t}=e,n=document.location.pathname+(t?`?${t}`:``);t!==document.location.search.replace(/^\?/,``)&&window.history.pushState({},``,n),this.setState({queryParams:t}),this.hostCommunicationMgr.sendMessageToHost({type:`SET_QUERY_PARAM`,queryParams:t?`?${t}`:``})},this.onPageNotFound=e=>{let t=e?`You have requested page /${e}, but no corresponding file was found in the app's pages/ directory`:`The page that you have requested does not seem to exist`;this.showError(`Page not found`,{message:`${t}. Running the app's main page.`})},this.handlePageNotFound=e=>{let{pageName:t}=e;this.maybeSetState(this.appNavigation.handlePageNotFound(t))},this.onPageIconChanged=e=>{Th(e,this.hostCommunicationMgr.sendMessageToHost,this.endpoints)},this.handleNavigation=e=>{this.setState({navigationPosition:e.position}),this.maybeSetState(this.appNavigation.handleNavigation(e))},this.handlePageProfileMsg=e=>{let t=ie.toObject(e),n=jD();this.metricsMgr.enqueue(`pageProfile`,{...t,isFragmentRun:!!t.isFragmentRun,numPages:this.state.appPages?.length,pageScriptHash:this.state.currentPageScriptHash,activeTheme:this.props.theme?.activeTheme?.name,totalLoadTime:Math.round((performance.now()-this.state.latestRunTime)*1e3),browserInfo:n})},this.handleAutoRerun=e=>{let{fragmentId:t}=e;if(!t){RD.warn(`Ignoring auto-rerun message without a fragment id.`);return}let{interval:n}=e;if(this.autoRerunIntervals.get(t)?.interval===n)return;this.clearAutoRerunInterval(t);let r=setInterval(()=>{this.widgetMgr.sendUpdateWidgetsMessage(t,!0)},n*1e3);this.autoRerunIntervals.set(t,{timer:r,interval:n})},this.handleStopAutoRerun=e=>
33{e.fragmentIds.forEach(e=>{this.clearAutoRerunInterval(e)})},this.handleSessionStatusChanged=e=>{this.setState(t=>{let{scriptRunState:n}=t,{dialog:r}=t;return e.scriptIsRunning&&t.scriptRunState!==W.STOP_REQUESTED?(n=W.RUNNING,R(r)&&r.type===lE.SCRIPT_COMPILE_ERROR&&(r=void 0)):!e.scriptIsRunning&&t.scriptRunState!==W.RERUN_REQUESTED&&t.scriptRunState!==W.COMPILATION_ERROR&&(n=W.NOT_RUNNING),{userSettings:{...t.userSettings,runOnSave:!!e.runOnSave},dialog:r,scriptRunState:n,scriptChangedOnDisk:!e.scriptIsRunning&&t.scriptChangedOnDisk}})},this.handleSessionEvent=e=>{if(this.sessionEventDispatcher.handleSessionEventMsg(e),e.type===`scriptCompilationException`){this.setState({scriptRunState:W.COMPILATION_ERROR});let t={type:lE.SCRIPT_COMPILE_ERROR,exception:e.scriptCompilationException,onClose:()=>{}};this.maybeShowErrorDialog(t,e.scriptCompilationException?.message??`No message`)}else e.type===`scriptChangedOnDisk`&&this.setState({scriptChangedOnDisk:!0})},this.maybeUpdatePageUrl=(e,t,n)=>{let r=this.getBaseUriParts();if(r){let i;i=oe.MAIN_PAGE_BASE_URL?hT(oe.MAIN_PAGE_BASE_URL).pathname:r.pathname;let a=ke(document.location.pathname,i);
33if((a===``?e:a)!==t){let e=n?``:t,r=this.state.queryParams||gt(),a=r?`?${r}`:``,o=`${i===`/`?``:i}/${e}${a}`;window.history.pushState({},``,o)}}},this.handleNewSession=e=>{let t=e.initialize;if(this.hasStreamlitVersionChanged(t)){window.location.reload();return}this.hasReceivedNewSession=!0,(!this.sessionInfo.isSet||!this.sessionInfo.current.isConnected)&&this.handleInitialization(e);let{appHash:n,currentPageScriptHash:r}=this.state,{scriptRunId:i,name:a,mainScriptPath:o,fragmentIdsThisRun:s,pageScriptHash:c,mainScriptHash:l}=e;if(s.length)this.setState({fragmentIdsThisRun:s,latestRunTime:performance.now()});else{this.cleanupAutoReruns();let t=e.config,n=e.customTheme;this.processThemeInput(n),this.setState({allowRunOnSave:t.allowRunOnSave,hideTopBar:t.hideTopBar,toolbarMode:t.toolbarMode,showErrorLinks:t.showErrorLinks,disableDataExport:t.disableDataExport,latestRunTime:performance.now(),mainScriptHash:l,fragmentIdsThisRun:s}),this.maybeSetState(this.appNavigation.handleNewSession(e)),!this.appNavigation.hasSetDefaultFavicon&&!this.appNavigation.isPageIconSet&&(this.appNavigation.hasSetDefaultFavicon=!0,this.onPageIconChanged(`./favicon.png`))}let u=Ne(this.sessionInfo.current.installationId+o);this.metricsMgr.setMetadata(this.state.deployedAppMetadata),this.metricsMgr.setAppHash(u),this.metricsMgr.enqueue(`updateReport`),n===u&&r===c?this.setState(e=>({elements:e.elements.clearTransientNodes(s),scriptRunId:i})):this.clearAppState(u,i,a,l)},this.handleInitialization=e=>{let t=e.initialize,n=e.config;this.sessionInfo.setCurrent(bg.propsFromNewSessionMessage(e)),this.metricsMgr.initialize({gatherUsageStats:n.gatherUsageStats,sendMessageToHost:this.hostCommunicationMgr.sendMessageToHost}),this.handleSessionStatusChanged(t.sessionStatus),this.setState({recommendSkillsInstall:!!t.recommendSkillsInstall}),t.recommendSkillsInstall&&Ca()&&!We()&&L()&&!tw()&&!nw()&&!this.state.skillsInstalledThisSession&&!this.state.skillsInstallFailedThisSession&&!this.skillsNudgeShown?(this.skillsNudgeShown=!0,this.setState({showSkillsNudge:!0}),this.trackSkillsNudge(`skillsNudgeShown`,`toast`)):t.skillsNudgeSuppressedReason&&!this.skillsNudgeSuppressionReported&&!this.skillsNudgeShown&&(this.skillsNudgeSuppressionReported=!0,this.trackSkillsNudge(sw(t.skillsNudgeSuppressedReason),`toast`))},this.trackSkillsNudge=(e,t)=>{this.metricsMgr.enqueue(`menuClick`,{label:e,surface:t})},this.handleSkillsNudgeInstall=e=>{if(this.inFlightSkillsInstall)return this.inFlightSkillsInstall;this.trackSkillsNudge(`skillsNudgeInstall`,e);let t=this.backendOperationClient.requestInstallSkills().then(t=>(this.trackSkillsNudge(cw(t.fallbackReason),e),this.setState(t=>({skillsInstalledThisSession:!0,showSkillsNudge:e!==`errorCallout`&&t.showSkillsNudge})),t.detail??void 0)).catch(t=>{throw aw(t)?(this.trackSkillsNudge(`skillsNudgeInstallDropped`,e),Error(ew)):(this.trackSkillsNudge(uw(t),e),this.setState({skillsInstallFailedThisSession:!0}),t)}).finally(()=>{this.inFlightSkillsInstall=null});return this.inFlightSkillsInstall=t,t},this.handleToastInstall=()=>this.handleSkillsNudgeInstall(`toast`),this.handleErrorCalloutInstall=()=>this.handleSkillsNudgeInstall(`errorCallout`),this.handleErrorCalloutShown=()=>{this.errorCalloutShown||(this.errorCalloutShown=!0,this.trackSkillsNudge(`skillsNudgeShown`,`errorCallout`))},this.handleSkillsNudgeSnooze=()=>{iw(),this.trackSkillsNudge(`skillsNudgeSnoozed`,`toast`)},this.handleSkillsNudgeDontShowAgain=()=>{rw(),this.backendOperationClient.requestDismissSkillsNudge().catch(e=>{RD.warn(`Failed to persist skills nudge dismissal`,e)}),this.trackSkillsNudge(`skillsNudgeDontShowAgain`,`toast`)},this.handleSkillsNudgeClose=()=>{this.setState({showSkillsNudge:!1})},this.onHistoryChange=()=>{let{currentPageScriptHash:e}=this.state,t=this.appNavigation.findPageByUrlPath(document.location.pathname),n=document.location.toString().includes(`#`),r=t?.pageScriptHash===e;z(t)||n&&r||this.onPageChange(t.pageScriptHash,void 0,!0)},this.setAndSendTheme=e=>{this.props.theme.setTheme(e),this.hostCommunicationMgr.sendMessageToHost({type:`SET_THEME_CONFIG`,themeInfo:De(e.emotion)})},this.createThemeHash=e=>{if(!e)return`hash_for_undefined_custom_theme`;let t=JSON.parse(JSON.stringify(e)),n=ze(t);return Ne(JSON.stringify(n))},this.closeDialog=()=>{this.state.dialog?.type===lE.CONNECTION_ERROR?this.setState({dialog:void 0,connectionErrorDismissed:!0}):this.setState({dialog:void 0})},this.saveSettings=e=>{let{runOnSave:t}=this.state.userSettings,{runOnSave:n}=e;if(this.setState({userSettings:e}),t!==n&&this.isServerConnected()){let e=new P({setRunOnSave:n});e.type=`setRunOnSave`,this.sendBackMsg(e)}},this.handleRunOnSaveChange=e=>{this.saveSettings({...this.state.userSettings,runOnSave:e})}
33,this.handleDeltaMsg=(e,t,n)=>{this.setState(r=>({elements:r.elements.applyDelta(r.scriptRunId,e,t,n)}))},this.debugShutdownRuntime=()=>{if(this.isServerConnected()){let e=new P({debugShutdownRuntime:!0});e.type=`debugShutdownRuntime`,this.sendBackMsg(e)}},this.debugDisconnectWebsocket=()=>{if(this.isServerConnected()){let e=new P({debugDisconnectWebsocket:!0});e.type=`debugDisconnectWebsocket`,this.sendBackMsg(e)}},this.debugClearForwardMsgCache=()=>{Ca()&&this.connectionManager?.websocketConnection?.cache.messages.clear()},this.cleanupAutoReruns=()=>{this.autoRerunIntervals.forEach(({timer:e})=>{clearInterval(e)}),this.autoRerunIntervals.clear()},this.rerunScript=(e=!1)=>{if(this.closeDialog(),!this.isServerConnected()){RD.error(`Cannot rerun script when disconnected from server.`);return}this.state.scriptRunState!==W.RUNNING&&this.state.scriptRunState!==W.RERUN_REQUESTED&&(this.setState({scriptRunState:W.RERUN_REQUESTED}),e===!0&&this.saveSettings({...this.state.userSettings,runOnSave:!0}),this.widgetMgr.sendUpdateWidgetsMessage(void 0))},this.sendLoadGitInfoBackMsg=()=>{if(!this.isServerConnected()){RD.error(`Cannot load git information when disconnected from server.`);return}this.sendBackMsg(new P({loadGitInfo:!0}))},this.onPageChange=(e,t,n)=>{let{elements:r,mainScriptHash:i}=this.state;this.cleanupAutoReruns();let a=this.appNavigation.clearPageElements(r,i),o=new Set(Array.from(a.getElements()).map(e=>Fe(e)).filter(it));this.sendRerunBackMsg(this.widgetMgr.getActiveWidgetStates(o),void 0,e,void 0,t,n)},this.isAppInReadyState=e=>this.state.connectionState===$.CONNECTED&&this.state.scriptRunState===W.NOT_RUNNING&&e.scriptRunState===W.RUNNING&&e.connectionState===$.CONNECTED,this.sendRerunBackMsg=(e,t,n,r,i,a)=>{let o=this.getBaseUriParts();if(!o){RD.error(`Cannot send rerun backMessage when disconnected from server.`);return}let{currentPageScriptHash:s}=this.state,c=i??this.getQueryString(),l=``,u={timezone:Ae(),timezoneOffset:Pe(),locale:He(),url:lt(),isEmbedded:We(),colorScheme:this.getThemeColorScheme()};if(n){if(n!==s&&!a){let e=this.widgetMgr.filterParamsForPageChange(gt());c=je(i,e),this.setState({queryParams:c}),this.hostCommunicationMgr.sendMessageToHost({type:`SET_QUERY_PARAM`,queryParams:c?`?${c}`:``})}}else if(s)n=s;else{let e;e=oe.MAIN_PAGE_BASE_URL?hT(oe.MAIN_PAGE_BASE_URL).pathname:o.pathname,l=ke(document.location.pathname,e),n=``}let d=this.connectionManager?.getCachedMessageHashes()??[];this.sendBackMsg(new P({rerunScript:{queryString:c,widgetStates:e,pageScriptHash:n,pageName:l,fragmentId:t,isAutoRerun:r,cachedMessageHashes:d,contextInfo:u}})),this.hasReceivedNewSession=!1},this.stopScript=()=>{if(!this.isServerConnected()){RD.error(`Cannot stop app when disconnected from server.`);return}if(this.state.scriptRunState===W.NOT_RUNNING||this.state.scriptRunState===W.STOP_REQUESTED)return;let e=new P({stopScript:!0});e.type=`stopScript`,this.sendBackMsg(e),this.setState({scriptRunState:W.STOP_REQUESTED})},this.openClearCacheDialog=()=>{if(this.isServerConnected()){let e={type:lE.CLEAR_CACHE,confirmCallback:this.clearCache,onClose:()=>{}};this.openDialog(e)}else RD.error(`Cannot clear cache: disconnected from server`)},this.openDeployDialog=()=>{let e={type:lE.DEPLOY_DIALOG,onClose:this.closeDialog,showDeployError:this.showDeployError,isDeployErrorModalOpen:this.state.dialog?.type===lE.DEPLOY_ERROR,metricsMgr:this.metricsMgr,gitInfo:this.state.gitInfo};this.openDialog(e)},this.clearCache=()=>{if(this.closeDialog(),this.isServerConnected()){let e=new P({clearCache:!0});e.type=`clearCache`,this.sendBackMsg(e)}else RD.error(`Cannot clear cache: disconnected from server`)},this.sendAppHeartbeat=e=>{if(this.isServerConnected()){let t=new P({appHeartbeat:!0});t.type=`appHeartbeat`,this.sendBackMsg(t),this.connectionManager?.onHeartbeatSent(e)}else RD.error(`Cannot send app heartbeat: disconnected from server`)},this.handleHeartbeatAck=()=>{this.connectionManager?.onHeartbeatAckReceived()},this.sendBackMsg=e=>{this.connectionManager?(RD.info(e),this.connectionManager.sendMessage(e)):RD.error(`Not connected. Cannot send back message: ${e.type??`unknown`}`)},this.handleConnectionError=e=>{this.state.connectionErrorDismissed||this.showError(`Connection error`,e,lE.CONNECTION_ERROR)},this.isServerConnected=()=>this.connectionManager?this.connectionManager.isConnected():!1,this.aboutCallback=()=>{let{menuItems:e}=this.state,t={type:lE.ABOUT,onClose:this.closeDialog,aboutSectionMd:e?.aboutSectionMd};this.openDialog(t)}
33,this.printCallback=()=>{let{scriptRunState:e}=this.state;if(e!==W.NOT_RUNNING){setTimeout(this.printCallback,500);return}let t;try{let e=xt(this.embeddingId);t=e?.contentWindow?e.contentWindow.window:window}catch{t=window}finally{t||=window,t.print()}},this.screencastCallback=()=>{let{scriptName:e}=this.state,{startRecording:t}=this.props.screenCast;t(`streamlit-${e}-${Ve()}`)},this.handleFullScreen=e=>{this.setState({isFullScreen:e})},this.setLibConfig=e=>{this.setState({libConfig:e})},this.setAppConfig=e=>{this.setState({appConfig:e})},this.addScriptFinishedHandler=e=>{this.setState((t,n)=>({scriptFinishedHandlers:t.scriptFinishedHandlers.concat(e)}))},this.removeScriptFinishedHandler=e=>{this.setState((t,n)=>({scriptFinishedHandlers:t.scriptFinishedHandlers.filter(t=>t!==e)}))},this.getBaseUriParts=()=>this.connectionManager?this.connectionManager.getBaseUriParts():void 0,this.getQueryString=()=>{let{queryParams:e}=this.state,t=e&&e.length>0?e:document.location.search;return t.startsWith(`?`)?t.slice(1):t},this.getThemeColorScheme=()=>{let{activeTheme:e}=this.props.theme;return he(e.emotion)?`light`:`dark`},this.showDeployButton=()=>Ca()&&MD(this.state.isOwner,this.state.toolbarMode)&&this.sessionInfo.isSet&&!this.sessionInfo.isHello,this.deployButtonClicked=()=>{this.metricsMgr.enqueue(`menuClick`,{label:`deployButtonInApp`}),this.sendLoadGitInfoBackMsg(),this.openDeployDialog()},this.requestFileURLs=(e,t)=>{let n=this.isServerConnected(),r=this.sessionInfo.isSet;if(n&&r){let n=new P({fileUrlsRequest:{requestId:e,fileNames:t.map(e=>e.name),sessionId:this.sessionInfo.current.sessionId}});n.type=`fileUrlsRequest`,this.sendBackMsg(n)}else RD.warn(`Cannot request file URLs (isServerConnected: ${n}, isSessionInfoSet: ${r})`),this.uploadClient.onFileURLsResponse({responseId:e,errorMsg:`Connection lost. Please wait for the app to reconnect, then try again.`})},this.handleKeyDown=(e,t)=>{if(!((e===`c`||e===`r`)&&xd(t)))switch(e){case`c`:MD(this.state.isOwner,this.state.toolbarMode)&&this.openClearCacheDialog();break;case`r`:this.rerunScript()}},this.handleKeyUp=e=>{e===`esc`&&this.props.screenCast.stopRecording()},this.hasAppDefinedMenuItems=()=>{let{menuItems:e}=this.state;return!!(e?.aboutSectionMd||e?.getHelpUrl&&!e?.hideGetHelp||e?.reportABugUrl&&!e?.hideReportABug)},this.shouldShowToolbar=(e,t)=>{let n=!We()||st(),r;return r=this.state.toolbarMode!==F.ToolbarMode.MINIMAL||e.length>0||t.length>0||this.hasAppDefinedMenuItems(),n&&r},Sd(),X_(),$_(),this.state={connectionState:$.INITIAL,elements:Ka.empty(``,!0),isFullScreen:!1,scriptName:``,scriptRunId:ao,appHash:null,scriptRunState:W.NOT_RUNNING,userSettings:{wideMode:!1,runOnSave:!1},connectionErrorDismissed:!1,layout:y.Layout.CENTERED,initialSidebarState:y.SidebarState.AUTO,initialSidebarWidth:void 0,menuItems:void 0,allowRunOnSave:!0,scriptFinishedHandlers:[],showErrorLinks:F.ShowErrorLinks.SHOW_ERROR_LINKS_AUTO,disableDataExport:!1,themeHash:``,gitInfo:null,formsData:Wv(),appPages:[],navSections:[],currentPageScriptHash:``,mainScriptHash:``,hideTopBar:!0,hideSidebarNav:!0,expandSidebarNav:!1,toolbarMode:F.ToolbarMode.MINIMAL,latestRunTime:performance.now(),fragmentIdsThisRun:[],scriptRunFinishedSequence:0,scriptRunFinishedFragmentIds:[],isOwner:!1,hostMenuItems:[],hostToolbarItems:[],hostHideSidebarNav:!1,sidebarChevronDownshift:0,pageLinkBaseUrl:``,queryParams:window.location?.search?.replace(/^\?/,``)??``,deployedAppMetadata:{},libConfig:{},appConfig:{},inputsDisabled:!1,navigationPosition:E.Position.SIDEBAR,scriptChangedOnDisk:!1,showSkillsNudge:!1,recommendSkillsInstall:!1,skillsInstalledThisSession:!1,skillsInstallFailedThisSession:!1},this.connectionManager=null,this.widgetMgr=new Yv({sendRerunBackMsg:this.sendRerunBackMsg,formsDataChanged:e=>this.setState({formsData:e})}),this.widgetMgr.setQueryParamsChangeHandler(this.handleQueryParamsFromWidget),this.hostCommunicationMgr=new yg({streamlitExecutionStartedAt:e.streamlitExecutionStartedAt,sendRerunBackMsg:this.sendRerunBackMsg,closeModal:this.closeDialog,stopScript:this.stopScript,rerunScript:this.rerunScript,clearCache:this.clearCache,sendAppHeartbeat:this.sendAppHeartbeat,setInputsDisabled:e=>{this.setState({inputsDisabled:e})}
33,themeChanged:this.handleThemeMessage,pageChanged:e=>this.onPageChange(e),isOwnerChanged:e=>this.setState({isOwner:e}),fileUploadClientConfigChanged:e=>{this.endpoints.setFileUploadClientConfig!==void 0&&this.endpoints.setFileUploadClientConfig(e)},hostMenuItemsChanged:e=>{this.setState({hostMenuItems:e})},hostToolbarItemsChanged:e=>{this.setState({hostToolbarItems:e})},hostHideSidebarNavChanged:e=>{this.setState({hostHideSidebarNav:e})},sidebarChevronDownshiftChanged:e=>{this.setState({sidebarChevronDownshift:e})},pageLinkBaseUrlChanged:e=>{this.setState({pageLinkBaseUrl:e})},queryParamsChanged:e=>{this.setState({queryParams:e})},deployedAppMetadataChanged:e=>{this.setState({deployedAppMetadata:e})},restartWebsocketConnection:()=>{this.connectionManager||(this.setState({scriptRunState:W.RERUN_REQUESTED}),this.initializeConnectionManager())},terminateWebsocketConnection:()=>{this.connectionManager?.disconnect(),this.connectionManager=null},printApp:this.printCallback}),this.endpoints=new LT({getServerUri:this.getBaseUriParts,csrfEnabled:!0,sendClientError:(e,t,n,r,i)=>{this.hostCommunicationMgr.sendMessageToHost({type:`CLIENT_ERROR`,component:e,error:t,message:n,source:r,customComponentName:i})}}),this.uploadClient=new ng({sessionInfo:this.sessionInfo,endpoints:this.endpoints,formsWithPendingRequestsChanged:e=>this.widgetMgr.setFormsWithUploadsInProgress(e),requestFileURLs:this.requestFileURLs}),this.componentRegistry=new eg(this.endpoints),this.appNavigation=new PD(this.hostCommunicationMgr,this.maybeUpdatePageUrl,this.onPageNotFound,this.onPageIconChanged),this.backendOperationClient=new fg({sendRequest:e=>{if(!this.isServerConnected()||!this.sessionInfo.isSet)throw Error(`Cannot send backend operation request: not connected to server`);let t=new P({backendOperationRequest:e});t.type=`backendOperationRequest`,this.sendBackMsg(t)},getSessionId:()=>this.sessionInfo.current.sessionId}),window.streamlitDebug={clearForwardMsgCache:this.debugClearForwardMsgCache,disconnectWebsocket:this.debugDisconnectWebsocket,shutdownRuntime:this.debugShutdownRuntime}}applyInitialHostConfig(){if(!mT())return;let e=oe.HOST_CONFIG,t=FD({allowedOrigins:e.allowedOrigins,useExternalAuthToken:e.useExternalAuthToken,enableCustomParentMessages:e.enableCustomParentMessages,blockErrorDialogs:e.blockErrorDialogs});this.hostCommunicationMgr.setAllowedOrigins(t),this.setAppConfig(t);let n=FD({mapboxToken:e.mapboxToken,disableFullscreenMode:e.disableFullscreenMode,enforceDownloadInNewTab:e.enforceDownloadInNewTab,resourceCrossOriginMode:e.resourceCrossOriginMode});Object.keys(n).length>0&&this.setLibConfig(n),e.metricsUrl!==void 0&&this.metricsMgr.setMetricsConfig(e.metricsUrl)}initializeConnectionManager(){this.isInitializingConnectionManager=!0,this.applyInitialHostConfig(),this.connectionManager=new AT({getLastSessionId:()=>this.sessionInfo.last?.sessionId,endpoints:this.endpoints,onMessage:this.handleMessage,onConnectionError:this.handleConnectionError,connectionStateChanged:this.handleConnectionStateChanged,claimHostAuthToken:this.hostCommunicationMgr.claimAuthToken,resetHostAuthToken:this.hostCommunicationMgr.resetAuthToken,sendClientError:(e,t,n
33)=>{this.hostCommunicationMgr.sendMessageToHost({type:`CLIENT_ERROR`,component:`Websocket Connection`,error:e,message:t,source:n})},onHostConfigResp:e=>{let{allowedOrigins:t,useExternalAuthToken:n,disableFullscreenMode:r,enableCustomParentMessages:i,mapboxToken:a,enforceDownloadInNewTab:o,metricsUrl:s,blockErrorDialogs:c,setAnonymousCrossOriginPropertyOnMediaElements:l,resourceCrossOriginMode:u}=LD(oe.HOST_CONFIG,e),d={allowedOrigins:t,useExternalAuthToken:n,enableCustomParentMessages:i,blockErrorDialogs:c},f={mapboxToken:a,disableFullscreenMode:r,enforceDownloadInNewTab:o,resourceCrossOriginMode:u??(l?`anonymous`:void 0)};this.metricsMgr.setMetricsConfig(s),this.hostCommunicationMgr.setAllowedOrigins(d),this.setAppConfig(d),this.setLibConfig(f)}}),this.isInitializingConnectionManager=!1}componentDidMount(){this.initializeConnectionManager(),Dg(this.state.scriptRunState),this.hostCommunicationMgr.sendMessageToHost({type:`SCRIPT_RUN_STATE_CHANGED`,scriptRunState:this.state.scriptRunState}),mt()&&document.body.classList.add(`embedded`),Le()&&(window.iFrameResizer={heightCalculationMethod:()=>{let e=document.querySelectorAll(`[data-iframe-height]`),t=Array.from(e).map(e=>Math.ceil(e.getBoundingClientRect().bottom));return Math.max(0,...t)}},H(()=>import(`./iframeResizer.contentWindow.CwEfsvtk.js`).then(t=>e(t.default,1)),__vite__mapDeps([200,1]),import.meta.url)),this.hostCommunicationMgr.sendMessageToHost({type:`SET_THEME_CONFIG`,themeInfo:De(this.props.theme.activeTheme.emotion)}),this.metricsMgr.enqueue(`viewReport`),window.addEventListener(`popstate`,this.onHistoryChange,!1)}componentDidUpdate(e,t){if(window.prerenderReady===!1&&this.isAppInReadyState(t)&&(window.prerenderReady=!0),this.state.scriptRunState!==t.scriptRunState){if(Dg(this.state.scriptRunState),this.state.scriptRunState===W.NOT_RUNNING)try{Eg(`script-run-cycle`,W.RUNNING,W.NOT_RUNNING)}catch{}this.hostCommunicationMgr.sendMessageToHost({type:`SCRIPT_RUN_STATE_CHANGED`,scriptRunState:this.state.scriptRunState})}}componentWillUnmount(){this.connectionManager?.disconnect(),this.hostCommunicationMgr.closeHostCommunication(),window.removeEventListener(`popstate`,this.onHistoryChange,!1)}maybeShowErrorDialog(e,t){let{blockErrorDialogs:n}=this.state.appConfig;n||this.openDialog(e);let r=e.type===lE.SCRIPT_COMPILE_ERROR?e.type:e.title;this.hostCommunicationMgr.sendMessageToHost({type:`CLIENT_ERROR_DIALOG`,error:r,message:t})}showError(e,t,n=lE.WARNING){RD.error(t.message);let r={type:n,title:e,msg:s(mE,{message:t.message,codeBlock:t.codeBlock}),onClose:()=>{}};this.maybeShowErrorDialog(r,t.message)}hasStreamlitVersionChanged(e){let t;if(oe.ENABLE_RELOAD_BASED_ON_HARDCODED_STREAMLIT_VERSION===!0?t={version:`1.64.0`}.version:this.sessionInfo.isSet&&(t=this.sessionInfo.current.streamlitVersion),t){let{environmentInfo:n}=e;if(R(n)&&R(n.streamlitVersion))return t!==n.streamlitVersion}return!1}maybeSetState(e){if(e){let[t,n]=e;this.setState(t,n)}}processThemeInput(e){let t=this.createThemeHash(e);if(t===this.state.themeHash)return;this.setState({themeHash:t});let n=!bt(this.props.theme.activeTheme);if(e){let t=ht(e);this.props.theme.addThemes(t,{keepPresetThemes:!1});let n=$e(t);if(n)this.setAndSendTheme(n);else if(t.length>1){let e=t.findIndex(e=>e.name===ot);this.setAndSendTheme(t[e])}else this.setAndSendTheme(t[0])}else if(this.props.theme.addThemes([]),n){let e=$e([Be,vt]);e?this.setAndSendTheme(e):this.setAndSendTheme(rt())}(e?.fontFaces&&e.fontFaces.length>0||e?.fontSources&&e.fontSources.length>0)&&this.props.theme.setFonts(e)}handleScriptFinished(e){this.setState(e=>({scriptRunFinishedSequence:e.scriptRunFinishedSequence+1,scriptRunFinishedFragmentIds:e.fragmentIdsThisRun})),(e===ue.ScriptFinishedStatus.FINISHED_SUCCESSFULLY||e===ue.ScriptFinishedStatus.FINISHED_EARLY_FOR_RERUN||e===ue.ScriptFinishedStatus.FINISHED_FRAGMENT_RUN_SUCCESSFULLY)&&(Promise.resolve().then(()=>{this.state.scriptFinishedHandlers.forEach(e=>e())}),(e===ue.ScriptFinishedStatus.FINISHED_SUCCESSFULLY||e===ue.ScriptFinishedStatus.FINISHED_FRAGMENT_RUN_SUCCESSFULLY)&&this.setState(({scriptRunId:e,fragmentIdsThisRun:t,elements:n})=>({elements:n.clearStaleNodes(e,t)}
33),()=>{this.removeInactiveWidgetState()}),this.connectionManager!==null&&e!==ue.ScriptFinishedStatus.FINISHED_EARLY_FOR_RERUN&&this.sessionInfo.isSet&&this.hasReceivedNewSession&&this.connectionManager.incrementMessageCacheRunCount(this.sessionInfo.current.maxCachedMessageAge,this.state.fragmentIdsThisRun))}clearAppState(e,t,n,r){this.setState(i=>({scriptRunId:t,scriptName:n,appHash:e,elements:this.appNavigation.clearPageElements(i.elements,r)}),()=>{this.removeInactiveWidgetState()})}removeInactiveWidgetState(){let{elements:e,blockIds:t}=this.state.elements.getActiveIds(),n=new Set([...Array.from(e).map(e=>Fe(e)).filter(it),...t]);this.widgetMgr.removeInactive(n)}openDialog(e){this.setState({dialog:e})}clearAutoRerunInterval(e){let t=this.autoRerunIntervals.get(e);t!==void 0&&(clearInterval(t.timer),this.autoRerunIntervals.delete(e))}render(){let{allowRunOnSave:e,connectionState:t,dialog:n,elements:r,initialSidebarState:i,menuItems:o,isFullScreen:c,scriptRunId:l,scriptRunState:d,userSettings:f,hideTopBar:p,hideSidebarNav:m,expandSidebarNav:h,sidebarNavVisibleItems:g,currentPageScriptHash:_,hostHideSidebarNav:v,pageLinkBaseUrl:y,sidebarChevronDownshift:b,hostMenuItems:x,hostToolbarItems:S,libConfig:C,inputsDisabled:w,appPages:T,navSections:D,navigationPosition:O,scriptChangedOnDisk:k}=this.state,A=this.props.isMobileViewport?E.Position.SIDEBAR:O,ee=MD(this.state.isOwner,this.state.toolbarMode),j=[`stApp`,Re(this.embeddingId),We()&&`streamlit-embedded`,f.wideMode&&`streamlit-wide`].filter(Boolean).join(` `),M=n?WE({...n,onClose:this.closeDialog}):null,N=this.shouldShowToolbar(x,S),te=!We()||Ze(),ne=mt();return s(cE,{initialSidebarState:i,initialSidebarWidth:this.state.initialSidebarWidth,appRootRef:this.appRootRef,pageLinkBaseUrl:y,currentPageScriptHash:_,onPageChange:this.onPageChange,navSections:D,appPages:T,appLogo:r.logo,sidebarChevronDownshift:b,expandSidebarNav:h,sidebarNavVisibleItems:g,hideSidebarNav:m||v||A===E.Position.TOP,isFullScreen:c,setFullScreen:this.handleFullScreen,activeTheme:this.props.theme.activeTheme,setTheme:this.setAndSendTheme,availableThemes:this.props.theme.availableThemes,fragmentIdsThisRun:this.state.fragmentIdsThisRun,scriptRunFinishedSequence:this.state.scriptRunFinishedSequence,scriptRunFinishedFragmentIds:this.state.scriptRunFinishedFragmentIds,locale:window.navigator.language,formsData:this.state.formsData,scriptRunState:d,scriptRunId:l,stopScript:this.stopScript,mapboxToken:C.mapboxToken,enforceDownloadInNewTab:C.enforceDownloadInNewTab,resourceCrossOriginMode:C.resourceCrossOriginMode,showErrorLinks:this.state.showErrorLinks,disableDataExport:this.state.disableDataExport,backendOperationClient:this.backendOperationClient,skillsInstallEnabled:this.state.recommendSkillsInstall&&this.skillsCalloutEnvEligible&&!this.state.skillsInstalledThisSession&&!this.state.skillsInstallFailedThisSession&&!tw()&&!this.state.showSkillsNudge,onInstallSkills:this.handleErrorCalloutInstall,onSkillsCalloutShown:this.handleErrorCalloutShown,children:s(iC,{keyName:`r,c,esc`,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,children:a(AD,{ref:this.appRootRef,className:j,"data-testid":`stApp`,"data-test-script-state":l===`<null>`?`initial`:d,"data-test-connection-state":t,children:[s(eC,{endpoints:this.endpoints,sendMessageToHost:this.hostCommunicationMgr.sendMessageToHost,elements:r,widgetMgr:this.widgetMgr,uploadClient:this.uploadClient,navigationPosition:A,wideMode:f.wideMode,embedded:We(),showPadding:te,disableScrolling:ne,addScriptFinishedHandler:this.addScriptFinishedHandler,removeScriptFinishedHandler:this.removeScriptFinishedHandler,widgetsDisabled:w||t!==$.CONNECTED,showToolbar:N,disableFullscreenMode:C.disableFullscreenMode,componentRegistry:this.componentRegistry,skillsNudge:this.state.showSkillsNudge?s(bw,{onInstall:this.handleToastInstall,onSnooze:this.handleSkillsNudgeSnooze,onDontShowAgain:this.handleSkillsNudgeDontShowAgain,onClose:this.handleSkillsNudgeClose}):void 0,topRightContent:a(u,{children:[!p&&s(sE,{connectionState:t,scriptRunState:d,rerunScript:this.rerunScript,stopScript:this.stopScript,allowRunOnSave:e,showScriptChangedActions:k}),!p&&s(nD,{hostToolbarItems:S,sendMessageToHost:this.hostCommunicationMgr.sendMessageToHost,metricsMgr:this.metricsMgr}),this.showDeployButton()&&!k&&s(nC,{onClick:this.deployButtonClicked}),!p&&s(ZC,{isServerConnected:this.isServerConnected(),quickRerunCallback:this.rerunScript,clearCacheCallback:this.openClearCacheDialog,aboutCallback:this.aboutCallback,printCallback:this.printCallback,screencastCallback:this.screencastCallback,screenCastState:this.props.screenCast.currentState,hostMenuItems:x,developmentMode:ee,sendMessageToHost:this.hostCommunicationMgr.sendMessageToHost,menuItems:o,metricsMgr:this.metricsMgr,toolbarMode:this.state.toolbarMode,runOnSave:this.state.userSettings.runOnSave,onRunOnSaveChange:this.handleRunOnSaveChange,allowRunOnSave:e&&ee,streamlitVersion:this.sessionInfo.isSet?this.sessionInfo.current.streamlitVersion:void 0})]})}),M]})})})}}),BD=e=>{let{isMobile:t}=wD();return s(zD,{...e,isMobileViewport:t})},VD=e=>e.find(e=>e.name===(Ge()===`dark`?ut:tt)),HD=e=>({...e,name:ot,displayName:pt});function UD(){let e=at(),[t,n]=(0,U.useState)(e),[r,i]=(0,U.useState)(e.themeInput?.fontFaces??[]),[a,o]=(0,U.useState)(null),[s,c]=(0,U.useState)(()=>[...Ye(),...bt(e)?[]:[e]]),l=(0,U.useRef)(s);(0,U.useEffect)(()=>{l.current=s},[s]);let u=(0,U.useCallback)((e,t={})=>{let{keepPresetThemes:n=!0}=t,r=[...n?Ye():[],...e];l.current=r,c(r)},[]),d=(0,U.useCallback)((e,t={})=>{let{persist:r=!0}=t;n(t=>e===t?t:(r&&yt(e),e))},[]),f=(0,U.useCallback)(e=>{if(e.name===`Use system setting`){d(et());return}if(e.name===`Custom Theme Auto`){let e=VD(l.current);if(e){d(HD(e));return}}d(e)},[d]),p=(0,U.useCallback)(()=>{let e=et();t.name===`Use system setting`&&d(e,{persist:!1});let n=s.filter(e=>e.name!==pt),r=n.some(e=>
33e.name===ot);if(r&&t.name===`Custom Theme Auto`){let e=VD(n);e&&d(HD(e),{persist:!1})}c(r?n:[rt(),...n])},[t.name,s,d]),m=(0,U.useCallback)(e=>{e.fontFaces&&i(e.fontFaces);let t=[...e.fontSources||[],...e.sidebar?.fontSources||[]],n={};t.forEach(e=>{e.sourceUrl&&e.configName&&(n[e.configName]=e.sourceUrl)}),o(Object.keys(n).length>0?n:null)},[]),h=(0,U.useCallback)(e=>{m(e);let t=new ne(e),n=ct(Ke,t);f(n)},[m,f]);return(0,U.useEffect)(()=>{let e=window.matchMedia(`(prefers-color-scheme: dark)`);return e.addEventListener(`change`,p),window.addEventListener(`afterprint`,p),()=>{window.removeEventListener(`afterprint`,p),e.removeEventListener(`change`,p)}},[p]),[{setTheme:f,activeTheme:t,addThemes:u,availableThemes:s,setFonts:m,setImportedTheme:h},r,a]}var WD=({streamlitExecutionStartedAt:e})=>{let[t,n,r]=UD(),{activeTheme:i}=t;return s(wg,{theme:i,children:s(Zh,{children:a(gh,{children:[n.length>0&&s(xa,{fontFaces:n}),r&&s(Sa,{fontSources:r}),s(BD,{theme:t,streamlitExecutionStartedAt:e})]})})})},GD=Date.now(),KD=document.getElementById(`root`);if(!KD)throw Error(`#root DOM element not found`);(0,bi.createRoot)(KD).render(s(U.StrictMode,{children:s(oa,{children:s(WD,{streamlitExecutionStartedAt:GD})})}));export{Eo as $,Wp as A,Ou as B,xh as C,dh as D,fh as E,Nd as F,Is as G,Jl as H,Md as I,Vo as J,Ms as K,jd as L,bf as M,lf as N,uh as O,Gd as P,To as Q,Ad as R,kh as S,mh as T,Kl as U,ku as V,ql as W,No as X,Lo as Y,Mo as Z,hg as _,Ib as a,ho as at,Vh as b,jb as c,W as ct,Oy as d,Ca as dt,wo as et,Ey as f,Tg as g,Mv as h,Rb as i,yo as it,Uf as j,Jp as k,Tb as l,Pa as lt,Sy as m,Bb as n,So as nt,Fb as o,go as ot,Ty as p,Os as q,zb as r,bo as rt,Nb as s,oo as st,CS as t,Co as tt,ky as u,Aa as ut,pg as v,hh as w,Ah as x,Qh as y,Au as z};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.