(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[6780],{50029:e=>{e.exports={defaultsButtonText:"defaultsButtonText-aJgjxj2V",defaultsButtonItem:"defaultsButtonItem-aJgjxj2V",defaultsButtonIcon:"defaultsButtonIcon-aJgjxj2V"}},6165:e=>{e.exports={themesButtonText:"themesButtonText-AeBgp7zz",themesButtonIcon:"themesButtonIcon-AeBgp7zz",defaultsButtonText:"defaultsButtonText-AeBgp7zz",defaultsButtonItem:"defaultsButtonItem-AeBgp7zz"}},75146:e=>{e.exports={scrollable:"scrollable-Ycj0dUGE",tabs:"tabs-Ycj0dUGE"}},9090:e=>{e.exports={titleWrap:"titleWrap-e3jFxbHm",ellipsis:"ellipsis-e3jFxbHm",hideInput:"hideInput-e3jFxbHm",hideText:"hideText-e3jFxbHm",empty:"empty-e3jFxbHm",hideEmpty:"hideEmpty-e3jFxbHm",editIcon:"editIcon-e3jFxbHm"}},809:e=>{e.exports={tabs:"tabs-xNPrJ8dY"}},55185:e=>{e.exports={"link-item":"link-item-eIA09f0e"}},67033:e=>{e.exports={"arrow-icon":"arrow-icon-NIrWNOPk",dropped:"dropped-NIrWNOPk","size-xsmall":"size-xsmall-NIrWNOPk","size-small":"size-small-NIrWNOPk","size-medium":"size-medium-NIrWNOPk","size-large":"size-large-NIrWNOPk","size-xlarge":"size-xlarge-NIrWNOPk"}},58591:e=>{e.exports={"underline-tab":"underline-tab-cfYYXvwA","disable-focus-outline":"disable-focus-outline-cfYYXvwA","enable-cursor-pointer":"enable-cursor-pointer-cfYYXvwA",disabled:"disabled-cfYYXvwA",selected:"selected-cfYYXvwA","disable-active-state-styles":"disable-active-state-styles-cfYYXvwA","size-xsmall":"size-xsmall-cfYYXvwA","size-small":"size-small-cfYYXvwA","size-medium":"size-medium-cfYYXvwA","size-large":"size-large-cfYYXvwA","size-xlarge":"size-xlarge-cfYYXvwA",fake:"fake-cfYYXvwA","margin-xsmall":"margin-xsmall-cfYYXvwA","margin-small":"margin-small-cfYYXvwA","margin-medium":"margin-medium-cfYYXvwA","margin-large":"margin-large-cfYYXvwA","margin-xlarge":"margin-xlarge-cfYYXvwA",collapse:"collapse-cfYYXvwA","ellipsis-children":"ellipsis-children-cfYYXvwA"}},49682:e=>{e.exports={"scroll-wrap":"scroll-wrap-SmxgjhBJ","size-xlarge":"size-xlarge-SmxgjhBJ","enable-scroll":"enable-scroll-SmxgjhBJ","underline-tabs":"underline-tabs-SmxgjhBJ","size-large":"size-large-SmxgjhBJ","size-medium":"size-medium-SmxgjhBJ","size-small":"size-small-SmxgjhBJ","size-xsmall":"size-xsmall-SmxgjhBJ","make-grid-column":"make-grid-column-SmxgjhBJ","stretch-tabs":"stretch-tabs-SmxgjhBJ","equal-tab-size":"equal-tab-size-SmxgjhBJ"}},15427:e=>{e.exports={underline:"underline-Pun8HxCz",center:"center-Pun8HxCz",corner:"corner-Pun8HxCz",disabled:"disabled-Pun8HxCz"}},38546:(e,t,i)=>{"use strict";i.d(t,{DialogTabs:()=>n});var s=i(50959),a=i(67829);const n=s.forwardRef((function(e,t){const{id:i,tabs:n,activeTab:o,onChange:l,className:r}=e;return s.createElement("div",{className:r,ref:t},s.createElement(a.UnderlineButtonTabs,{id:i,items:n,isActive:function(e){return e.id===o},onActivate:function(e){l(e.id)},overflowBehaviour:"scroll"}))}))},78890:(e,t,i)=>{"use strict";i.d(t,{PropertyActions:()=>p});var s=i(50959),a=i(97754),n=i.n(a),o=i(9745),l=i(11542),r=i(95276),c=i(16396),u=i(44996),d=i(50029);const m={
reset:l.t(null,void 0,i(33533)),saveAsDefault:l.t(null,void 0,i(99687)),defaults:l.t(null,void 0,i(48572))};var h;!function(e){e.Normal="normal",e.Compact="compact"}(h||(h={}));class p extends s.PureComponent{render(){const{mode:e,saveAsDefaults:t,resetToDefaults:i}=this.props;return s.createElement(r.ControlDisclosure,{id:"property-actions",className:n()("normal"===e&&d.defaultsButtonText),hideArrowButton:"compact"===e,buttonChildren:this._getPlaceHolderItem("compact"===e)},s.createElement(c.PopupMenuItem,{className:d.defaultsButtonItem,isActive:!1,label:m.reset,onClick:i}),s.createElement(c.PopupMenuItem,{className:d.defaultsButtonItem,isActive:!1,label:m.saveAsDefault,onClick:t}))}_getPlaceHolderItem(e){return e?s.createElement(o.Icon,{className:d.defaultsButtonIcon,icon:u}):m.defaults}}},48531:(e,t,i)=>{"use strict";i.d(t,{FooterMenu:()=>C});var s=i(50959),a=i(11542),n=i(9745),o=i(95276),l=i(90692),r=i(6165),c=i(44996);function u(e){return e.isTabletWidth?s.createElement(n.Icon,{className:r.themesButtonIcon,icon:c}):s.createElement(s.Fragment,null,a.t(null,void 0,i(93553)))}function d(e){return s.createElement(l.MatchMedia,{rule:"(max-width: 768px)"},(t=>s.createElement(o.ControlDisclosure,{className:!t&&r.themesButtonText,hideArrowButton:t,buttonChildren:s.createElement(u,{isTabletWidth:t})},e.children)))}var m=i(16396),h=i(96040),p=i(70412),g=i(32563),b=i(60925);function f(e){const{name:t,onRemove:i,onClick:a}=e,[n,o]=(0,p.useHoverDeprecated)(),l=s.useCallback((()=>a(t)),[a,t]),c=s.useCallback((()=>{i&&i(t)}),[i,t]);return s.createElement("div",{...o},s.createElement(m.PopupMenuItem,{className:r.defaultsButtonItem,isActive:!1,label:t,onClick:l,toolbox:i&&s.createElement(h.RemoveButton,{hidden:!g.mobiletouch&&!n,onClick:c,icon:b})}))}function v(e){return s.createElement(d,null,s.createElement(f,{onClick:function(){const{sources:t,chartUndoModel:i}=e;i.restoreLineToolsFactoryDefaults(t)},name:a.t(null,void 0,i(62511))}))}function C(e){return s.createElement(v,{...e})}},37289:(e,t,i)=>{"use strict";i.d(t,{PropertiesEditorTab:()=>c});var s=i(50959),a=i(66849);const n={"Elliott Impulse Wave (12345)Degree":"normal","Elliott Triangle Wave (ABCDE)Degree":"normal","Elliott Triple Combo Wave (WXYXZ)Degree":"normal","Elliott Correction Wave (ABC)Degree":"normal","Elliott Double Combo Wave (WXY)Degree":"normal",BarsPatternMode:"normal",StudyInputSource:"normal",trendLineToolCheckableListGroup:"big",trendLineToolStatsPosition:"big",lineExtend:"big",datePriceRangeCheckableListGroup:"big"},o={TextText:"big",AnchoredTextText:"big",NoteText:"big",AnchoredNoteText:"big",CalloutText:"big",BalloonText:"big"};var l=i(33066),r=i(72852);function c(e){const{page:t,pageRef:i,tableKey:c}=e;return s.createElement(a.ControlCustomHeightContext.Provider,{value:o},s.createElement(a.ControlCustomWidthContext.Provider,{value:n},t&&s.createElement(l.PropertyTable,{reference:i,key:c},t.definitions.value().map((e=>s.createElement(r.Section,{key:e.id,definition:e}))))))}},75892:(e,t,i)=>{"use strict";i.r(t),i.d(t,{
SourcePropertiesEditorRenderer:()=>B});var s=i(50959),a=i(76422),n=i(50151),o=i(49483),l=i(1765),r=i(11542),c=i(50182),u=i(87713),d=i(48531),m=i(37289),h=i(86656),p=i(36313),g=i(26610),b=i(2088),f=i(2115),v=i(41414),C=i(13896),_=i(90692),x=i(95804),S=i(38546),T=i(78890),w=i(68495),y=i(37103),I=i(75146);const E=new x.TranslatedString("change {sourceTitle} title to {newSourceTitle}",r.t(null,void 0,i(23687)));class A extends s.PureComponent{constructor(e){super(e),this._activePageRef=s.createRef(),this._handleChangeMode=e=>{this.setState({isRenaming:e})},this._getTranslatedStringForSource=e=>new x.TranslatedString(e.name(),e.title(p.TitleDisplayTarget.StatusLine)),this._setTitle=e=>{const{source:t,model:i}=this.props,s=E.format({sourceTitle:t.properties().title.value()||this._getTranslatedStringForSource(t),newSourceTitle:e});i.setProperty(t.properties().title,e,s,C.lineToolsDoNotAffectChartInvalidation&&(0,g.isLineTool)(t))},this._getActionPageById=e=>{if(!e)return;const{pages:t}=this.props;return t.find((t=>t.id.toLowerCase()===e.toLowerCase()))},this._onChangeActivePageDefinitions=()=>{this.setState({tableKey:Date.now()},(()=>{this._requestResize&&this._requestResize()}))},this._handleResetToDefaults=()=>{const{source:e,model:t}=this.props;(0,b.isStudy)(e)&&t.restorePropertiesForSource(e)},this._handleSaveAsDefaults=()=>{const{source:e}=this.props;(0,b.isStudy)(e)&&e.properties().saveDefaults()},this._renderFooterLeft=()=>{const{source:e,model:t}=this.props;return(0,g.isLineTool)(e)?s.createElement(d.FooterMenu,{sources:[e],chartUndoModel:t}):s.createElement(_.MatchMedia,{rule:"(max-width: 440px)"},(t=>(0,b.isStudy)(e)&&s.createElement(T.PropertyActions,{saveAsDefaults:this._handleSaveAsDefaults,resetToDefaults:this._handleResetToDefaults,mode:t?"compact":"normal"})))},this._subscribe=e=>{e&&e.definitions.subscribe(this._onChangeActivePageDefinitions)},this._unsubscribe=e=>{e&&e.definitions.unsubscribe(this._onChangeActivePageDefinitions)},this._getActiveTabSettingsName=()=>{const{source:e}=this.props;return e instanceof f.Series?"properties_dialog.active_tab.chart":e instanceof v.LineDataSource?"properties_dialog.active_tab.drawing":(0,b.isStudy)(e)?"properties_dialog.active_tab.study":""},this._handleSelectPage=e=>{const{activePageId:t}=this.state,i=this._getActionPageById(t),s=this._getActionPageById(e),a=this._getActiveTabSettingsName();t!==e&&(this._unsubscribe(i),a&&l.default.setValue(a,e),this._subscribe(s),this.setState({activePageId:e,tableKey:Date.now()},(()=>{this._requestResize&&this._requestResize(),this._focusActivePageFirstTextInput()})))},this._handleScroll=()=>{u.globalCloseDelegate.fire()},this._handleSubmit=()=>{this.props.onSubmit(),this._closePopupDialog()},this._closePopupDialog=()=>{window.lineToolPropertiesToolbar&&window.lineToolPropertiesToolbar.refresh(),this.props.onClose()};const{pages:t}=this.props;let i;if(this._getActionPageById(this.props.activePageId))i=(0,n.ensureDefined)(this.props.activePageId);else{
const e=l.default.getValue(this._getActiveTabSettingsName(),""),s=this._getActionPageById(e);i=s?s.id:t[0].id}this.state={activePageId:i,tableKey:Date.now(),isRenaming:!1},window.lineToolPropertiesToolbar&&window.lineToolPropertiesToolbar.hide()}componentDidMount(){const{activePageId:e}=this.state,t=this._getActionPageById(e);this._focusActivePageFirstTextInput(),this._subscribe(t)}componentWillUnmount(){const{activePageId:e}=this.props,t=this._getActionPageById(e);clearTimeout(this._timeout),this._unsubscribe(t)}render(){const{onCancel:e,source:t}=this.props,{activePageId:i,isRenaming:a}=this.state,n=t.properties().title?.value()||t.title(p.TitleDisplayTarget.StatusLine),o=s.createElement(w.Title,{isRenaming:a,onChangeMode:this._handleChangeMode,setTitle:this._setTitle,defaultTitle:n,canBeRenamed:(0,g.isLineTool)(t)&&!y.enabled("widget")});return s.createElement(c.AdaptiveConfirmDialog,{dataName:(0,b.isStudy)(t)?"indicator-properties-dialog":"source-properties-editor",dataDialogName:n,title:o,isOpened:!0,onSubmit:this._handleSubmit,onCancel:e,onClickOutside:this._handleSubmit,onClose:this._closePopupDialog,footerLeftRenderer:this._renderFooterLeft,render:this._renderChildren(i),submitOnEnterKey:!1,showCloseIcon:!a})}_renderChildren(e){return({requestResize:t})=>{this._requestResize=t;const{pages:i,source:a}=this.props,n=i.filter((e=>e.visible.value())),o=n.find((t=>t.id===e))??n[0],l=(0,b.isStudy)(a)?"indicator-properties-dialog-tabs":"source-properties-editor-tabs",r=n.map((({title:e,id:t})=>({label:e,id:t,dataId:`${l}-${t}`})));return s.createElement(s.Fragment,null,s.createElement(S.DialogTabs,{className:I.tabs,id:l,activeTab:o.id,onChange:this._handleSelectPage,tabs:r}),s.createElement(h.TouchScrollContainer,{className:I.scrollable,onScroll:this._handleScroll},s.createElement(m.PropertiesEditorTab,{page:o,pageRef:this._activePageRef,tableKey:this.state.tableKey})))}}_focusActivePageFirstTextInput(){if(!o.CheckMobile.any()&&this._activePageRef.current){const e=this._activePageRef.current.querySelector("input[type=text],textarea");e&&(this._timeout=setTimeout((()=>{e.focus()}),0))}}}var P=i(38414),k=i(87896);class B extends P.DialogRenderer{constructor(e){super(),this._timeout=null,this._handleClose=()=>{this._rootInstance?.unmount(),this._setVisibility(!1),this._onClose&&this._onClose(),this._subscription.unsubscribe(this,this._handleCollectionChanged)},this._handleSubmit=()=>{const e=this._source;(0,g.isLineTool)(e)&&e.hasAlert().value()&&setTimeout((()=>{e.areLocalAndServerAlertsMismatch()&&e.synchronizeAlert(!0)}))},this._handleCancel=()=>{this._model.undoToCheckpoint(this._checkpoint)},this._propertyPages=e.propertyPages,this._model=e.model,this._activePageId=e.activePageId,this._onClose=e.onClose,this._source=e.source,this._checkpoint=this._ensureCheckpoint(e.undoCheckPoint),this._subscription=this._model.model().dataSourceCollectionChanged(),this._subscription.subscribe(this,this._handleCollectionChanged)}hide(e){e?this._handleCancel():this._handleSubmit(),this._handleClose()}isVisible(){
return this.visible().value()}show(e){this.isVisible()||(this._rootInstance=(0,k.createReactRoot)(s.createElement(A,{source:this._source,onSubmit:this._handleSubmit,onClose:this._handleClose,onCancel:this._handleCancel,pages:this._propertyPages,model:this._model,activePageId:this._activePageId,shouldReturnFocus:e?.shouldReturnFocus}),this._container),this._setVisibility(!0),a.emit("drawings_settings_dialog",{objectType:"drawing",scriptTitle:this._source.title(p.TitleDisplayTarget.StatusLine)}))}_handleCollectionChanged(){null===this._timeout&&(this._timeout=setTimeout((()=>{this._closeDialogIfSourceIsDeleted(),this._timeout=null})))}_closeDialogIfSourceIsDeleted(){const e=this._model.model().dataSourceForId(this._source.id());null!==e?e.instanceId()!==this._source.instanceId()&&this._handleClose():this._handleClose()}_ensureCheckpoint(e){return void 0===e&&(e=this._model.createUndoCheckpoint()),e}}},68495:(e,t,i)=>{"use strict";i.d(t,{Title:()=>m});var s=i(50959),a=i(97754),n=i(31261),o=i(9745),l=i(26867),r=i(68335),c=i(51768),u=i(48040),d=i(9090);function m(e){const{isRenaming:t,onChangeMode:i,setTitle:m,defaultTitle:h,canBeRenamed:p}=e,g=(0,s.useRef)(null),[b,f]=(0,s.useState)(h),[v,C]=(0,s.useState)(h);return(0,s.useEffect)((()=>{t&&g.current&&(g.current.focus(),g.current.setSelectionRange(0,b.length))}),[t]),s.createElement(s.Fragment,null,s.createElement("div",{className:a(d.titleWrap,t&&d.hideText)},s.createElement("span",{className:d.ellipsis}," ",v),p&&s.createElement(s.Fragment,null,s.createElement(o.Icon,{className:a(d.editIcon),icon:u,onClick:function(){(0,c.trackEvent)("GUI","Rename","Drawing settings"),f(v),i(!0)},"data-name":"edit","data-role":"button"}),s.createElement("div",{className:a(d.empty,!t&&d.hideEmpty)}))),p&&s.createElement("div",{className:a(!t&&d.hideInput),"data-disable-drag":!0},s.createElement(n.InputControl,{value:b,onChange:function(e){f(e.currentTarget.value)},onBlur:_,reference:g,onClick:l.preventDefault,onKeyDown:function(e){27===(0,r.hashFromEvent)(e)&&(e.preventDefault(),f(h),i(!1));13===(0,r.hashFromEvent)(e)&&(e.preventDefault(),_())},"data-disable-drag":!0,stretch:!0})));function _(){""!==b&&(m(b),C(b)),i(!1)}}},66512:(e,t,i)=>{"use strict";i.r(t),i.d(t,{SourcesPropertiesEditorRenderer:()=>f});var s=i(50959),a=i(38414),n=i(87896),o=i(11542),l=i(86656),r=i(50182),c=i(48531),u=i(37289),d=i(68495),m=i(37103),h=i(38546),p=i(809);const g=o.t(null,void 0,i(8954));function b(e){const{propertyPages:t,onSubmit:i,onCancel:a,onClose:n,title:o,activeTabId:b,sources:f,undoModel:v,renamable:C}=e,_=b&&t.filter((e=>e.id===b)).length>0?b:t[0].id,x=v.model().lineToolsGroupModel().groupForLineTool(f[0]),S=!!(C&&x&&o&&f.every((e=>x?.id===v.model().lineToolsGroupModel().groupForLineTool(e)?.id))),[T,w]=(0,s.useState)(_),[y,I]=(0,s.useState)(!1),[E,A]=(0,s.useState)(o||g),P=(0,s.useMemo)((()=>t.map((({title:e,id:t})=>({label:e,id:t,dataId:`sources-properties-editor-tabs-${t}`})))),[t]);const k=s.createElement(d.Title,{isRenaming:y,onChangeMode:function(e){I(e)},setTitle:function(e){
x&&(x.setName(e),A(e))},defaultTitle:E,canBeRenamed:S&&!m.enabled("widget")});return s.createElement(r.AdaptiveConfirmDialog,{dataName:"sources-properties-editor",dataDialogName:E,title:k,isOpened:!0,onSubmit:i,onCancel:a,onClickOutside:n,onClose:n,footerLeftRenderer:function(){return s.createElement(c.FooterMenu,{sources:f,chartUndoModel:v})},render:function(){const e=t.find((e=>e.id===T));return s.createElement(s.Fragment,null,s.createElement(h.DialogTabs,{className:p.tabs,id:"sources-properties-editor-tabs",activeTab:T,onChange:w,tabs:P}),s.createElement(l.TouchScrollContainer,null,s.createElement(u.PropertiesEditorTab,{page:e,tableKey:T})))},submitOnEnterKey:!1,showCloseIcon:!y})}class f extends a.DialogRenderer{constructor(e){super(),this._dataSourceChangedPromise=null,this._submitHandler=()=>{Promise.resolve().then((()=>{this._sources.map((e=>{e.areLocalAndServerAlertsMismatch()&&e.synchronizeAlert(!0)}))})),this._close()},this._cancelHandler=()=>{this._undoModel.undoToCheckpoint(this._undoCheckpoint)},this._closeHandler=()=>{this._close()},this._dataSourceCollectionChangedHandler=()=>{null===this._dataSourceChangedPromise&&(this._dataSourceChangedPromise=Promise.resolve().then((()=>{const e=this._undoModel.model();this._sources.find((t=>null===e.dataSourceForId(t.id())))&&this._close(),this._dataSourceChangedPromise=null})))},this._sources=e.sources,this._propertyPages=e.propertyPages,this._undoModel=e.undoModel,this._title=e.title,this._activeTabId=e.activeTabId,this._renamable=e.renamable,this._undoCheckpoint=this._undoModel.createUndoCheckpoint(),this._undoModel.model().dataSourceCollectionChanged().subscribe(this,this._dataSourceCollectionChangedHandler)}destroy(){this._close()}show(){this._isVisible()||(this._mount(),this._setVisibility(!0))}hide(){this._isVisible()&&(this._unmount(),this._setVisibility(!1))}_mount(){this._rootInstance=(0,n.createReactRoot)(s.createElement(b,{propertyPages:this._propertyPages,sources:this._sources,undoModel:this._undoModel,onSubmit:this._submitHandler,onCancel:this._cancelHandler,onClose:this._closeHandler,title:this._title,activeTabId:this._activeTabId,renamable:this._renamable}),this._container)}_unmount(){this._rootInstance?.unmount()}_isVisible(){return this.visible().value()}_close(){this.hide(),this._undoModel.model().dataSourceCollectionChanged().unsubscribe(this,this._dataSourceCollectionChangedHandler)}}},67829:(e,t,i)=>{"use strict";i.d(t,{UnderlineButtonTabs:()=>U});var s,a=i(50959),n=i(97754),o=i.n(n),l=i(11542),r=i(95854),c=i(38528),u=i(47201),d=i(7953),m=i(36966),h=i(26597);!function(e){e.XSmall="xsmall",e.Small="small",e.Medium="medium",e.Large="large",e.XLarge="xlarge"}(s||(s={}));const p=(0,a.createContext)({size:"small",overflowBehaviour:void 0});var g=i(17946),b=i(58591);function f(e){const{size:t="xsmall",active:i,fake:s,enableActiveStateStyles:a,anchor:n=!1,hideFocusOutline:l=!1,equalTabSize:r,className:c,overflowBehaviour:u,disabled:d}=e
;return o()(b["underline-tab"],b[`size-${t}`],i&&b.selected,!a&&b["disable-active-state-styles"],l&&b["disable-focus-outline"],s&&b.fake,n&&b["enable-cursor-pointer"],r&&b[`margin-${t}`],"collapse"===u&&b.collapse,d&&b.disabled,c)}const v=(0,a.forwardRef)(((e,t)=>{const{size:i,overflowBehaviour:s}=(0,a.useContext)(p),n=(0,a.useContext)(g.CustomBehaviourContext),{active:l,fake:r,className:c,enableActiveStateStyles:u=n.enableActiveStateStyles,hideFocusOutline:d=!1,equalTabSize:m,children:h,disabled:v,...C}=e;return a.createElement("button",{...C,ref:t,className:f({size:i,active:l,fake:r,enableActiveStateStyles:u,hideFocusOutline:d,equalTabSize:m,className:c,overflowBehaviour:s,disabled:v})},m&&"string"==typeof h?a.createElement("span",{className:o()(b["ellipsis-children"],"apply-overflow-tooltip")},h):h)}));v.displayName="UnderlineTabsBaseButton";const C=(0,a.forwardRef)(((e,t)=>{const{item:i,highlighted:s,handleItemRef:n,onClick:o,...l}=e,r=(0,a.useCallback)((()=>{o&&o(i)}),[o,i]),c=(0,a.useCallback)((e=>{n&&n(i,e),t&&"object"==typeof t?t.current=e:"function"==typeof t&&t(e)}),[i,n,t]);return a.createElement(v,{...l,id:i.id,onClick:r,ref:c},i.label)}));C.displayName="UnderlineButtonTab";var _=i(50151),x=i(16396),S=i(4523),T=i(9745),w=i(47531),y=i(2948),I=i(63509),E=i(68874),A=i(67033);function P(e){switch(e){case"xsmall":return w;case"small":return y;case"medium":case"large":return I;case"xlarge":return E}}function k(e){const{size:t,isDropped:i=!1}=e;return a.createElement(T.Icon,{icon:P(t),className:n(A["arrow-icon"],A[`size-${t}`],i&&A.dropped)})}var B=i(55185);const z=4,R=4;function N(e){const{size:t,disabled:i,isOpened:s,enableActiveStateStyles:n,hideFocusOutline:o,fake:l,items:r,buttonContent:u,buttonRef:d,isAnchorTabs:m,isHighlighted:h,onButtonClick:p,onItemClick:g,onClose:b}=e,f=(0,a.useRef)(null),C=(0,c.useMergedRefs)([d,f]),T=function(e,t){const i=(0,a.useRef)(M);return(0,a.useEffect)((()=>{const e=getComputedStyle((0,_.ensureNotNull)(t.current));i.current={xsmall:D(e,"xsmall"),small:D(e,"small"),medium:D(e,"medium"),large:D(e,"large"),xlarge:D(e,"xlarge")}}),[t]),(0,a.useCallback)((()=>{const s=(0,_.ensureNotNull)(t.current).getBoundingClientRect(),a=i.current[e];return{x:s.left,y:s.top+s.height+a+z,indentFromWindow:{top:R,bottom:R,left:R,right:R}}}),[t,e])}(t,f);return a.createElement(S.PopupMenuDisclosureView,{buttonRef:f,listboxTabIndex:-1,isOpened:s,onClose:b,listboxAria:{"aria-hidden":!0},popupPosition:T,button:a.createElement(v,{"aria-hidden":!0,disabled:i,active:s,onClick:p,ref:C,tabIndex:-1,enableActiveStateStyles:n,hideFocusOutline:o,fake:l},u,a.createElement(k,{size:t,isDropped:s})),popupChildren:r.map((e=>a.createElement(x.PopupMenuItem,{key:e.id,className:m?B["link-item"]:void 0,onClick:g,onClickArg:e,isActive:h(e),label:e.label,isDisabled:e.disabled,link:"href"in e?e.href:void 0,rel:"rel"in e?e.rel:void 0,target:"target"in e?e.target:void 0,renderComponent:"renderComponent"in e?e.renderComponent:void 0,dontClosePopup:!0})))})}function D(e,t){
return parseInt(e.getPropertyValue(`--ui-lib-underline-tabs-tab-margin-bottom-${t}`),10)}const M={xsmall:0,small:0,medium:0,large:0,xlarge:0};var F=i(75774),Y=i(42707),L=i(86240),H=i(49682);function X(e){const{size:t,overflowBehaviour:i,className:s}=e;return o()(H["scroll-wrap"],H[`size-${t}`],"scroll"===i&&H["enable-scroll"],s)}function j(){const[e,t]=(0,a.useState)(!1);return(0,a.useEffect)((()=>{t(F.mobiletouch)}),[]),e}var O=i(90484),W=i(24640),K=i(15427),V=i.n(K);const q=100;function J(e){const{disabled:t,translateX:i,transitionDuration:s}=e,o=e.scale/100;return a.createElement("div",{className:n(V().underline,t&&V().disabled),style:{transform:`translateX(${i}px) scaleX(${o})`,transitionDuration:`${s}ms`}},a.createElement("div",{className:V().corner,style:{transform:`scaleX(${1/o})`}}),a.createElement("div",{className:V().center,style:{transform:`scaleX(${1-30/e.scale})`}}),a.createElement("div",{className:V().corner,style:{transform:`scaleX(${1/o})`}}))}function U(e){const{id:t,items:s,activationType:n,disabled:g,moreButtonContent:b=l.t(null,void 0,i(37117)),size:f="small",onActivate:v,isActive:_,className:x,style:S,overflowBehaviour:T,enableActiveStateStyles:w,tablistLabelId:y,tablistLabel:I,"data-name":E="underline-tabs-buttons",stretchTabs:A,equalTabSize:P,defaultKeyboardFocus:k,stopPropagationIfKeyboardActionHandled:B,keyboardNavigationLoop:z,focusableItemAttributes:R,dataQaId:D="underline-tabs-buttons"}=e,M=j(),F=function(e){const t=(0,Y.useSafeMatchMedia)(L["media-mf-phone-landscape"],!0),i=j();return e??(i||!t?"scroll":"collapse")}(T),K=(0,a.useRef)(!1),V=(0,a.useCallback)((e=>e.id),[]),U="none"===F&&A,$="none"===F&&P,Z=w??!M,{visibleItems:G,hiddenItems:Q,containerRefCallback:ee,innerContainerRefCallback:te,moreButtonRef:ie,setItemRef:se}=(0,r.useCollapsible)(s,V,_),ae="collapse"===F?G:s,ne="collapse"===F?Q:[],oe=(0,a.useCallback)((e=>ne.includes(e)),[ne]),le=(0,a.useRef)(new Map),{isOpened:re,open:ce,close:ue,onButtonClick:de}=(0,d.useDisclosure)({id:t,disabled:g}),me=function(e="xsmall"){switch(e){case"xsmall":case"small":return 12;case"medium":return 16;case"large":case"xlarge":return 20}}(f),{tabsBindings:he,tablistBinding:pe,scrollWrapBinding:ge,onActivate:be,onHighlight:fe,isHighlighted:ve}=(0,m.useTabs)({id:t,items:[...ae,...ne],activationType:n,disabled:g,tablistLabelId:y,tablistLabel:I,onActivate:v,isActive:_,isCollapsed:oe,isRtl:W.isRtl,itemsRefs:le,isDisclosureOpened:re,defaultKeyboardFocus:k,stopPropagationIfKeyboardActionHandled:B,keyboardNavigationLoop:z,focusableItemAttributes:R,scrollIntoViewOptions:{additionalScroll:me}}),Ce=s.find(_),_e=ne.find(ve),xe=(0,a.useCallback)((()=>{Ce&&fe(Ce)}),[fe,Ce]),Se=(0,a.useCallback)((e=>he.find((t=>t.id===e.id))??{}),[he]),Te=(0,a.useCallback)((()=>{ue(),xe(),K.current=!0}),[ue,xe]),we=(0,a.useCallback)((()=>{_e&&(be(_e),fe(_e,200))}),[be,fe,_e]);ge.ref=(0,c.useMergedRefs)([ge.ref,ee]),pe.ref=(0,c.useMergedRefs)([pe.ref,te]),pe.onKeyDown=(0,u.createSafeMulticastEventHandler)((0,h.useKeyboardEventHandler)([(0,h.useKeyboardClose)(re,Te),(0,
h.useKeyboardActionHandler)([13,32],we,(0,a.useCallback)((()=>Boolean(_e)),[_e]))]),pe.onKeyDown);const ye=(0,a.useCallback)((e=>{K.current=!0,de(e)}),[K,de]),Ie=(0,a.useCallback)((e=>{e&&be(e)}),[be]);(0,a.useEffect)((()=>{K.current?K.current=!1:(_e&&!re&&ce(),!_e&&re&&ue())}),[_e,re,ce,ue]);const Ee=function(e,t,i=[]){const[s,n]=(0,a.useState)(),o=(0,a.useRef)(),l=(0,a.useRef)(),r=e=>{const t=e.parentElement??void 0;if(void 0===t)return;const i=void 0===l.current||l.current===e?0:q;l.current=e;const{left:s,right:a,width:o}=e.getBoundingClientRect(),{left:r,right:c}=t.getBoundingClientRect(),u=(0,W.isRtl)()?a-c:s-r;n({translateX:u,scale:o,transitionDuration:i})};return(0,a.useEffect)((()=>{const e=(0,O.default)((e=>{const t=e[0].target;void 0!==t&&r(t)}),50);o.current=new ResizeObserver(e)}),[]),(0,a.useEffect)((()=>{if(void 0===t)return;const i=e.get(t);return void 0!==i?(r(i),o.current?.observe(i),()=>o.current?.disconnect()):void 0}),i),s}(le.current,Ce??_e,[Ce??_e,ae,f,U,F]);return a.createElement(p.Provider,{value:{size:f,overflowBehaviour:F}},a.createElement("div",{...ge,className:X({size:f,overflowBehaviour:F,className:x}),style:S,"data-name":E,"data-qa-id":D},a.createElement("div",{...pe,className:o()(H["underline-tabs"],{[H["make-grid-column"]]:U||$,[H["stretch-tabs"]]:U,[H["equal-tab-size"]]:$})},ae.map((e=>a.createElement(C,{...Se(e),key:e.id,item:e,onClick:be,enableActiveStateStyles:Z,hideFocusOutline:M,ref:se(V(e)),...e.dataId&&{"data-id":e.dataId},"data-qa-id":e.dataId,equalTabSize:$}))),ne.map((e=>a.createElement(C,{...Se(e),ref:se(V(e)),key:e.id,item:e,fake:!0}))),"collapse"===F&&a.createElement(N,{size:f,disabled:g,isOpened:re,items:ne,buttonContent:b,buttonRef:ie,isHighlighted:ve,onButtonClick:ye,onItemClick:Ie,onClose:ue,enableActiveStateStyles:Z,hideFocusOutline:M,fake:0===ne.length}),Ee?a.createElement(J,{...Ee,disabled:g}):a.createElement("div",null))))}var $=i(38952);function Z(e){return a.createElement("a",{...(0,$.renameRef)(e)})}(0,a.forwardRef)(((e,t)=>{const{size:i,overflowBehaviour:s}=(0,a.useContext)(p),n=(0,a.useContext)(g.CustomBehaviourContext),{item:o,highlighted:l,handleItemRef:r,onClick:c,active:u,fake:d,className:m,enableActiveStateStyles:h=n.enableActiveStateStyles,hideFocusOutline:b=!1,disabled:v,"aria-disabled":C,..._}=e,x=(0,a.useCallback)((e=>{C?e.preventDefault():c&&c(o)}),[c,C,o]),S=(0,a.useCallback)((e=>{r&&r(o,e),t&&"object"==typeof t?t.current=e:"function"==typeof t&&t(e)}),[o,r,t]),T=o.renderComponent??Z;return a.createElement(T,{..._,id:o.id,"aria-disabled":C,onClick:x,reference:S,href:o.href,rel:o.rel,target:o.target,className:f({size:i,active:u,fake:d,enableActiveStateStyles:h,anchor:!0,hideFocusOutline:b,className:m,overflowBehaviour:s})},o.label)})).displayName="UnderlineAnchorTab"},47531:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" width="18" height="18"><path fill="currentColor" d="m4.67 7.38.66-.76L9 9.84l3.67-3.22.66.76L9 11.16 4.67 7.38Z"/></svg>'},63509:e=>{
e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" width="18" height="18"><path fill="currentColor" d="M3.57 7.85 9 12.62l5.43-4.77-1.32-1.5L9 9.95l-4.11-3.6-1.32 1.5Z"/></svg>'},48040:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path fill="currentColor" d="M16.73 6.56a2.5 2.5 0 0 1 3.54 0l1.17 1.17a2.5 2.5 0 0 1 0 3.54l-.59.58-9 9-1 1-.14.15H6v-4.7l.15-.15 1-1 9-9 .58-.59Zm2.83.7a1.5 1.5 0 0 0-2.12 0l-.23.24 3.29 3.3.23-.24a1.5 1.5 0 0 0 0-2.12l-1.17-1.17Zm.23 4.24L16.5 8.2l-8.3 8.3 3.3 3.3 8.3-8.3Zm-9 9L7.5 17.2l-.5.5V21h3.3l.5-.5Z"/></svg>'},68874:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path fill="currentColor" d="m14 18.41-6.7-6.7 1.4-1.42 5.3 5.3 5.3-5.3 1.4 1.41-6.7 6.71Z"/></svg>'}}]);