ba-js-common-header 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -11810,6 +11810,8 @@ function Row(props) {
|
|
|
11810
11810
|
const subMenuOpen = headerIsOpen && subMenus.find((subMenuId) => subMenuId === id);
|
|
11811
11811
|
const isFirstInGroup = !!group && ((_a2 = items.find((i2) => i2.group === group)) == null ? void 0 : _a2.id) === id;
|
|
11812
11812
|
const dispatch = useDispatch();
|
|
11813
|
+
if (!i18n)
|
|
11814
|
+
return null;
|
|
11813
11815
|
if (isPremium && isLocked) {
|
|
11814
11816
|
return /* @__PURE__ */ jsxs("li", {
|
|
11815
11817
|
className: "hd-nav-has-children",
|
|
@@ -99,7 +99,7 @@ const store = createStore(
|
|
|
99
99
|
`+this.lexer.showPosition()+`
|
|
100
100
|
Expecting `+j.join(", ")+", got '"+this.terminals_[q]+"'":z="Parse error on line "+(A+1)+": Unexpected "+(q==1?"end of input":"'"+(this.terminals_[q]||q)+"'"),this.parseError(z,{text:this.lexer.match,token:this.terminals_[q]||q,line:this.lexer.yylineno,loc:V,expected:j})}if(d==3){if(q==H)throw new Error(z||"Parsing halted.");B=this.lexer.yyleng,L=this.lexer.yytext,A=this.lexer.yylineno,V=this.lexer.yylloc,q=oe()}for(;!(U.toString()in _[ee]);){if(ee==0)throw new Error(z||"Parsing halted.");ae(1),ee=b[b.length-1]}ce=q,q=U,ee=b[b.length-1],x=_[ee]&&_[ee][U],d=3}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+ee+", token: "+q);switch(x[0]){case 1:b.push(q),I.push(this.lexer.yytext),R.push(this.lexer.yylloc),b.push(x[1]),q=null,ce?(q=ce,ce=null):(B=this.lexer.yyleng,L=this.lexer.yytext,A=this.lexer.yylineno,V=this.lexer.yylloc,d>0&&d--);break;case 2:if(D=this.productions_[x[1]][1],E.$=I[I.length-D],E._$={first_line:R[R.length-(D||1)].first_line,last_line:R[R.length-1].last_line,first_column:R[R.length-(D||1)].first_column,last_column:R[R.length-1].last_column},C=this.performAction.call(E,L,B,A,this.yy,x[1],I,R),typeof C!="undefined")return C;D&&(b=b.slice(0,-1*D*2),I=I.slice(0,-1*D),R=R.slice(0,-1*D)),b.push(this.productions_[x[1]][0]),I.push(E.$),R.push(E._$),k=_[b[b.length-2]][b[b.length-1]],b.push(k);break;case 3:return!0}}return!0}},m=function(){var c={EOF:1,parseError:function(v,b){if(this.yy.parseError)this.yy.parseError(v,b);else throw new Error(v)},setInput:function(f){return this._input=f,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this},input:function(){var f=this._input[0];this.yytext+=f,this.yyleng++,this.match+=f,this.matched+=f;var v=f.match(/\n/);return v&&this.yylineno++,this._input=this._input.slice(1),f},unput:function(f){return this._input=f+this._input,this},more:function(){return this._more=!0,this},pastInput:function(){var f=this.matched.substr(0,this.matched.length-this.match.length);return(f.length>20?"...":"")+f.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var f=this.match;return f.length<20&&(f+=this._input.substr(0,20-f.length)),(f.substr(0,20)+(f.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var f=this.pastInput(),v=new Array(f.length+1).join("-");return f+this.upcomingInput()+`
|
|
101
101
|
`+v+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var f,v,b;this._more||(this.yytext="",this.match="");for(var I=this._currentRules(),R=0;R<I.length;R++)if(v=this._input.match(this.rules[I[R]]),v)return b=v[0].match(/\n.*/g),b&&(this.yylineno+=b.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:b?b[b.length-1].length-1:this.yylloc.last_column+v[0].length},this.yytext+=v[0],this.match+=v[0],this.matches=v,this.yyleng=this.yytext.length,this._more=!1,this._input=this._input.slice(v[0].length),this.matched+=v[0],f=this.performAction.call(this,this.yy,this,I[R],this.conditionStack[this.conditionStack.length-1]),f||void 0;if(this._input==="")return this.EOF;this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
102
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var v=this.next();return typeof v!="undefined"?v:this.lex()},begin:function(v){this.conditionStack.push(v)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(v){this.begin(v)}};return c.performAction=function(v,b,I,R){switch(I){case 0:break;case 1:return 20;case 2:return 19;case 3:return 8;case 4:return 9;case 5:return 6;case 6:return 7;case 7:return 11;case 8:return 13;case 9:return 10;case 10:return 12;case 11:return 14;case 12:return 15;case 13:return 16;case 14:return 17;case 15:return 18;case 16:return 5;case 17:return"INVALID"}},c.rules=[/^\s+/,/^[0-9]+(\.[0-9]+)?\b/,/^n\b/,/^\|\|/,/^&&/,/^\?/,/^:/,/^<=/,/^>=/,/^</,/^>/,/^!=/,/^==/,/^%/,/^\(/,/^\)/,/^$/,/^./],c.conditions={INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],inclusive:!0}},c}();return p.lexer=m,p}(),e.exports&&(t=e.exports=g),t.Jed=g})()})(es,es.exports);var k3=es.exports;const Q3=e=>fetch(e).then(t=>t.json());function q3(e,t){return e.replace(/\{(\d+)\}/g,function(){return t[arguments[1]]})}function yt(){const{i18nFeed:e}=ie(i=>i.headerInfo),t=ie(i=>i.userLanguage),{data:r,error:n}=Wu(e&&t?q3(e,[t]):null,Q3);return fe(ne({},r&&{i18n:new k3({locale_data:r})}),{error:n})}function Zt(e){return e.match(/^(http|www).+/)}function ts(e){var f;const{item:t,level:r,hasChildren:n,children:i}=e,{href:a,label:o,id:s,group:l,premium:u={}}=t,{value:h=!1,locked:g=!1}=u,{i18n:y}=yt(),{isOpen:w,subMenus:O}=ie(v=>v.headerInfo),{items:P}=ie(v=>v.menuItems),p=w&&O.find(v=>v===s),m=!!l&&((f=P.find(v=>v.group===l))==null?void 0:f.id)===s,c=Be();if(h&&g)return Z("li",{className:"hd-nav-has-children",onClick:()=>{c(xt(s))},children:[M("div",{className:"row m-0 py-lg-0 align-items-center",children:M("div",{className:"col py-2 py-lg-0 px-0",children:Z("span",{className:"px-lg-3 py-2 py-lg-1 d-block",children:[y&&y.translate("label").fetch(),M("span",{className:"float-end",children:M(Pe.Lock,{className:"hd-icon hd-icon-lock"})})]})})}),M("ul",{className:He("py-3","list-unstyled",{"hd-nav-second-level":r===1,"hd-nav-third-level":r===2,"hd-submenu-opened":p}),children:M("li",{className:"hd-premium",children:M("div",{className:"row m-0 py-lg-0 align-items-center",children:Z("div",{className:"col p-lg-3",children:[M("span",{className:"d-lg-none mb-3",children:M(Pe.Lock,{className:"hd-icon hd-icon-lock"})}),Z("p",{children:["This premium functionality has not been activated.",M("br",{}),"Please contact us to activate this feature."]}),M("a",{className:"btn btn-sm btn-outline-primary",href:"#",target:"_blank",children:"Learn more"})]})})})})]});if(r===1)return Z("li",{className:"col-lg-auto p-0",onClick:()=>{n&&c(xt(s))},children:[Z("div",{className:"row m-0 py-lg-0 align-items-center",children:[M("div",{className:"col py-2 py-lg-0 px-0",children:a?M("a",fe(ne({className:"ps-lg-3 pe-3 py-2",href:a},Zt(a)&&{target:"_blank"}),{onClick:()=>{c(En(s))},children:y&&y.translate(o).fetch()})):M("span",{className:"ps-lg-3 pe-3 py-2",children:y&&y.translate(o).fetch()})}),n&&M("div",{className:"col-auto p-2 d-block d-lg-none",children:M(Pe.ArrowAngleRight,{className:"hd-icon hd-icon-arrow-angle-right"})})]}),n&&M("ul",{className:He("py-3","list-unstyled","hd-nav-second-level",{"hd-submenu-opened":p}),children:i})]});if(r===2)return Z(As,{children:[m&&M("div",{className:"row m-0 pt-3 pb-1 hd-nav-section",children:M("div",{className:"col py-2 py-lg-0 px-0",children:M("div",{className:"px-lg-3 d-block text-uppercase",children:y&&y.translate(l).fetch()})})}),Z("li",{onClick:()=>{n&&c(xt(s))},children:[Z("div",{className:"row m-0 py-lg-0 align-items-center",children:[M("div",{className:"col py-2 py-lg-0 px-0",children:a?M("a",fe(ne({className:"px-lg-3 py-2 py-lg-1 d-block",href:a},Zt(a)&&{target:"_blank"}),{onClick:()=>{c(En(s))},children:y&&y.translate(o).fetch()})):M("span",{className:"px-lg-3 py-2 py-lg-1 d-block",children:y&&y.translate(o).fetch()})}),n&&M("div",{className:"col-auto px-0",children:M("span",{className:"p-2 py-lg-1 d-lg-block",children:M(Pe.ArrowAngleRight,{className:"hd-icon hd-icon-arrow-angle-right"})})})]}),n&&M("ul",{className:He("py-3","ps-3","ps-lg-0","list-unstyled","hd-nav-third-level",{"hd-submenu-opened":p}),children:i})]})]});if(r===3)return M("li",{children:M("div",{className:"row m-0 py-1 py-lg-0 align-items-center",children:M("div",{className:"col p-lg-0",children:M("a",fe(ne({className:"px-lg-3 py-2 py-lg-1 d-block",href:a},Zt(a)&&{target:"_blank"}),{onClick:()=>{c(En(s))},children:y&&y.translate(o).fetch()}))})})})}const qf=X.exports.shape({id:X.exports.oneOfType([X.exports.string,X.exports.number]).isRequired,parentId:X.exports.oneOfType([X.exports.string,X.exports.number]),label:X.exports.string.isRequired,href:X.exports.string,premium:X.exports.shape({value:X.exports.bool,locked:X.exports.bool}),group:X.exports.string});ts.propTypes={item:qf.isRequired,level:X.exports.number.isRequired,hasChildren:X.exports.bool.isRequired,children:X.exports.element},ts.defaultProps={children:void 0};const Xf=Wr();function ci(e){const{menuItems:t,parentId:r=Xf,level:n=1}=e,i=t.filter(a=>(a.parentId||Xf)===r);return i.length?i.map(a=>{const o=!!t.find(h=>h.parentId===a.id),{premium:s={}}=a,{value:l=!1,locked:u=!1}=s;return M(ts,{item:a,level:n,hasChildren:o,premium:l,locked:u,children:M(ci,{menuItems:t,parentId:a.id,level:n+1})},a.id)}):null}ci.propTypes={menuItems:X.exports.arrayOf(qf).isRequired,parentId:X.exports.oneOfType([X.exports.string,X.exports.number]),level:X.exports.number},ci.defaultProps={parentId:void 0,level:void 0};function X3(){const{items:e}=ie(u=>u.menuItems),{isOpen:t,isMobileOrTablet:r,subMenus:n}=ie(u=>u.headerInfo),i=Be(),[a,{height:o}]=Oi(),s=S.useRef(null),l=Lr(!r||t,{from:{height:0},enter:{height:o},leave:{height:0},update:{height:o},config:fe(ne({},Kt.stiff),{clamp:!0})});return S.useEffect(()=>{if(e.length>0){const{origin:u,pathname:h,search:g}=new URL(window.location.href),y=Jo.parse(g),w=e.filter(m=>!!m.href).map(m=>new URL(m.href,u).pathname),O=new Set(w),P=w.filter(m=>{if(O.has(m)){O.delete(m);return}return m}),p=e.find(m=>{const{origin:c,pathname:f,search:v}=new URL(m.href,u);return P.find(b=>b===f)?c===u&&f===h&&H3(y,Jo.parse(v)):c===u&&f===h});p&&i(En(p.id))}},[e]),S.useEffect(()=>{s&&n.length>0&&(s.current.scrollTop=0)},[n.length]),l((u,h)=>h&&M(kt.div,{className:"container-xxl",id:"hd-nav-container",style:r?fe(ne({},u),{display:"block"}):{},children:M("nav",{className:"hd-nav",ref:a,children:M("ul",{ref:s,className:"row list-unstyled mb-0 hd-nav-first-level",children:M(ci,{menuItems:e})})})}))}function Yf(e){return Array.isArray(e)&&e.length>0}function li(e=new Date){const t=e.getMonth()+1,r=e.getDate();return+[e.getFullYear(),(t>9?"":"0")+t,(r>9?"":"0")+r].join("")}function Y3(){const[e,t]=S.useState([]),[r,n]=S.useState(0),[i,a]=S.useState(),[o,s]=S.useState(!0),{notifications:l}=ie(c=>c.titleBar),u=ie(c=>c.userLanguage),{isOpen:h,isMobileOrTablet:g}=ie(c=>c.headerInfo),{notifications:y,showNotifications:w}=ie(c=>c.notifications),O=g&&h,P=eg({opacity:O||e.length===0?0:1}),p=S.useRef(),m=Be();return F3(p,()=>{m(wu(!1))}),S.useEffect(()=>{(async()=>{if(l){let{type:c,items:f={}}=l;if(c==="fetch")try{f=await(await fetch(f)).json()}catch(v){console.error(v)}try{let v=new Date;v.setDate(-42),v=li(v),Object.keys(f).forEach(b=>{f[b].forEach(I=>{I.items=I.items.filter(R=>!R.date||li(new Date(R.date))>v)}),f[b]=f[b].filter(I=>I.items.length>0)}),f=DO(f,b=>b.length===0),m(yp(f))}catch(v){console.error(v)}}})()},[l]),S.useEffect(()=>{let c=y[u];u!=="en"&&!Yf(c)&&(c=y.en),Yf(c)&&(t(c),n(c.reduce((f,{items:v=[]})=>f+v.length,0)),a(Math.max(...c.reduce((f,{items:v=[]})=>[...f,...v],[]).filter(f=>{var v;return(v=f.date)==null?void 0:v.match(/^\d\d\d\d-\d\d-\d\d$/)}).map(f=>li(new Date(f.date))),19700101)))},[u,y]),S.useEffect(()=>{const c=Vc.get("ba-notif-read-date");i&&(!c||c<i?s(!1):s(!0))},[i]),M(kt.div,{className:He("col-auto","pe-lg-0","order-lg-4",{"hd-ringing":!o}),id:"hd-notifications",style:P,children:M("div",{className:"col-6 col-lg-auto p-lg-0",children:M("div",{className:"d-inline-block me-lg-3 my-1 my-lg-0",children:Z("div",{className:"hd-dropdown",children:[Z("button",{className:"btn p-2 hd-dropdown-toggle",type:"button",id:"hd-dropdown-notifications",onClick:c=>{O||(c.stopPropagation(),s(!0),Vc.set("ba-notif-read-date",li(),{expires:new Date(2147483647*1e3)}),m(wu(!w)))},children:[M(Pe.Bell,{className:"hd-icon hd-icon-bell"}),r>0&&Z(As,{children:[M("span",{className:"visually-hidden",children:"Notifications"}),M("span",{className:He("badge","rounded-pill",{"bg-danger":!o,"bg-primary":o}),children:r>=9?"9+":`${r}`})]})]}),M("ul",{className:"hd-dropdown-menu shadow",style:w?{display:"block"}:{},ref:p,children:e.map(c=>{const{title:f,items:v=[]}=c;return v.map((b,I)=>{const{title:R,url:_}=b;return Z(ue.default.Fragment,{children:[I===0&&f&&M("li",{children:M("span",{className:"hd-dropdown-header text-uppercase",children:f})}),M("li",{children:M("a",fe(ne({className:"hd-dropdown-item",href:_},Zt(_)&&{target:"_blank"}),{children:R}))})]},Wr())})})})]})})})})}function J3(e=!1){const[t,r]=S.useState(e),n=S.useCallback(()=>r(i=>!i),[]);return[t,n]}function Z3(){const[e,t]=J3(),{isOpen:r}=ie(i=>i.headerInfo),n=Be();return S.useEffect(()=>{n(dp(e)),e?document.body.style.overflow="hidden":(document.body.style.overflow="auto",n(pp()))},[e]),M("div",{className:He("col-auto","d-inline-block","d-lg-none","ms-0","ms-sm-4","me-3",{"hd-menu-opened":r}),id:"hd-menu-hamburger",onClick:t,children:M("div",{className:"d-block",children:M("div",{})})})}var pe={};/** @license React v17.0.2
|
|
102
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var v=this.next();return typeof v!="undefined"?v:this.lex()},begin:function(v){this.conditionStack.push(v)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(v){this.begin(v)}};return c.performAction=function(v,b,I,R){switch(I){case 0:break;case 1:return 20;case 2:return 19;case 3:return 8;case 4:return 9;case 5:return 6;case 6:return 7;case 7:return 11;case 8:return 13;case 9:return 10;case 10:return 12;case 11:return 14;case 12:return 15;case 13:return 16;case 14:return 17;case 15:return 18;case 16:return 5;case 17:return"INVALID"}},c.rules=[/^\s+/,/^[0-9]+(\.[0-9]+)?\b/,/^n\b/,/^\|\|/,/^&&/,/^\?/,/^:/,/^<=/,/^>=/,/^</,/^>/,/^!=/,/^==/,/^%/,/^\(/,/^\)/,/^$/,/^./],c.conditions={INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],inclusive:!0}},c}();return p.lexer=m,p}(),e.exports&&(t=e.exports=g),t.Jed=g})()})(es,es.exports);var k3=es.exports;const Q3=e=>fetch(e).then(t=>t.json());function q3(e,t){return e.replace(/\{(\d+)\}/g,function(){return t[arguments[1]]})}function yt(){const{i18nFeed:e}=ie(i=>i.headerInfo),t=ie(i=>i.userLanguage),{data:r,error:n}=Wu(e&&t?q3(e,[t]):null,Q3);return fe(ne({},r&&{i18n:new k3({locale_data:r})}),{error:n})}function Zt(e){return e.match(/^(http|www).+/)}function ts(e){var f;const{item:t,level:r,hasChildren:n,children:i}=e,{href:a,label:o,id:s,group:l,premium:u={}}=t,{value:h=!1,locked:g=!1}=u,{i18n:y}=yt(),{isOpen:w,subMenus:O}=ie(v=>v.headerInfo),{items:P}=ie(v=>v.menuItems),p=w&&O.find(v=>v===s),m=!!l&&((f=P.find(v=>v.group===l))==null?void 0:f.id)===s,c=Be();if(!y)return null;if(h&&g)return Z("li",{className:"hd-nav-has-children",onClick:()=>{c(xt(s))},children:[M("div",{className:"row m-0 py-lg-0 align-items-center",children:M("div",{className:"col py-2 py-lg-0 px-0",children:Z("span",{className:"px-lg-3 py-2 py-lg-1 d-block",children:[y&&y.translate("label").fetch(),M("span",{className:"float-end",children:M(Pe.Lock,{className:"hd-icon hd-icon-lock"})})]})})}),M("ul",{className:He("py-3","list-unstyled",{"hd-nav-second-level":r===1,"hd-nav-third-level":r===2,"hd-submenu-opened":p}),children:M("li",{className:"hd-premium",children:M("div",{className:"row m-0 py-lg-0 align-items-center",children:Z("div",{className:"col p-lg-3",children:[M("span",{className:"d-lg-none mb-3",children:M(Pe.Lock,{className:"hd-icon hd-icon-lock"})}),Z("p",{children:["This premium functionality has not been activated.",M("br",{}),"Please contact us to activate this feature."]}),M("a",{className:"btn btn-sm btn-outline-primary",href:"#",target:"_blank",children:"Learn more"})]})})})})]});if(r===1)return Z("li",{className:"col-lg-auto p-0",onClick:()=>{n&&c(xt(s))},children:[Z("div",{className:"row m-0 py-lg-0 align-items-center",children:[M("div",{className:"col py-2 py-lg-0 px-0",children:a?M("a",fe(ne({className:"ps-lg-3 pe-3 py-2",href:a},Zt(a)&&{target:"_blank"}),{onClick:()=>{c(En(s))},children:y&&y.translate(o).fetch()})):M("span",{className:"ps-lg-3 pe-3 py-2",children:y&&y.translate(o).fetch()})}),n&&M("div",{className:"col-auto p-2 d-block d-lg-none",children:M(Pe.ArrowAngleRight,{className:"hd-icon hd-icon-arrow-angle-right"})})]}),n&&M("ul",{className:He("py-3","list-unstyled","hd-nav-second-level",{"hd-submenu-opened":p}),children:i})]});if(r===2)return Z(As,{children:[m&&M("div",{className:"row m-0 pt-3 pb-1 hd-nav-section",children:M("div",{className:"col py-2 py-lg-0 px-0",children:M("div",{className:"px-lg-3 d-block text-uppercase",children:y&&y.translate(l).fetch()})})}),Z("li",{onClick:()=>{n&&c(xt(s))},children:[Z("div",{className:"row m-0 py-lg-0 align-items-center",children:[M("div",{className:"col py-2 py-lg-0 px-0",children:a?M("a",fe(ne({className:"px-lg-3 py-2 py-lg-1 d-block",href:a},Zt(a)&&{target:"_blank"}),{onClick:()=>{c(En(s))},children:y&&y.translate(o).fetch()})):M("span",{className:"px-lg-3 py-2 py-lg-1 d-block",children:y&&y.translate(o).fetch()})}),n&&M("div",{className:"col-auto px-0",children:M("span",{className:"p-2 py-lg-1 d-lg-block",children:M(Pe.ArrowAngleRight,{className:"hd-icon hd-icon-arrow-angle-right"})})})]}),n&&M("ul",{className:He("py-3","ps-3","ps-lg-0","list-unstyled","hd-nav-third-level",{"hd-submenu-opened":p}),children:i})]})]});if(r===3)return M("li",{children:M("div",{className:"row m-0 py-1 py-lg-0 align-items-center",children:M("div",{className:"col p-lg-0",children:M("a",fe(ne({className:"px-lg-3 py-2 py-lg-1 d-block",href:a},Zt(a)&&{target:"_blank"}),{onClick:()=>{c(En(s))},children:y&&y.translate(o).fetch()}))})})})}const qf=X.exports.shape({id:X.exports.oneOfType([X.exports.string,X.exports.number]).isRequired,parentId:X.exports.oneOfType([X.exports.string,X.exports.number]),label:X.exports.string.isRequired,href:X.exports.string,premium:X.exports.shape({value:X.exports.bool,locked:X.exports.bool}),group:X.exports.string});ts.propTypes={item:qf.isRequired,level:X.exports.number.isRequired,hasChildren:X.exports.bool.isRequired,children:X.exports.element},ts.defaultProps={children:void 0};const Xf=Wr();function ci(e){const{menuItems:t,parentId:r=Xf,level:n=1}=e,i=t.filter(a=>(a.parentId||Xf)===r);return i.length?i.map(a=>{const o=!!t.find(h=>h.parentId===a.id),{premium:s={}}=a,{value:l=!1,locked:u=!1}=s;return M(ts,{item:a,level:n,hasChildren:o,premium:l,locked:u,children:M(ci,{menuItems:t,parentId:a.id,level:n+1})},a.id)}):null}ci.propTypes={menuItems:X.exports.arrayOf(qf).isRequired,parentId:X.exports.oneOfType([X.exports.string,X.exports.number]),level:X.exports.number},ci.defaultProps={parentId:void 0,level:void 0};function X3(){const{items:e}=ie(u=>u.menuItems),{isOpen:t,isMobileOrTablet:r,subMenus:n}=ie(u=>u.headerInfo),i=Be(),[a,{height:o}]=Oi(),s=S.useRef(null),l=Lr(!r||t,{from:{height:0},enter:{height:o},leave:{height:0},update:{height:o},config:fe(ne({},Kt.stiff),{clamp:!0})});return S.useEffect(()=>{if(e.length>0){const{origin:u,pathname:h,search:g}=new URL(window.location.href),y=Jo.parse(g),w=e.filter(m=>!!m.href).map(m=>new URL(m.href,u).pathname),O=new Set(w),P=w.filter(m=>{if(O.has(m)){O.delete(m);return}return m}),p=e.find(m=>{const{origin:c,pathname:f,search:v}=new URL(m.href,u);return P.find(b=>b===f)?c===u&&f===h&&H3(y,Jo.parse(v)):c===u&&f===h});p&&i(En(p.id))}},[e]),S.useEffect(()=>{s&&n.length>0&&(s.current.scrollTop=0)},[n.length]),l((u,h)=>h&&M(kt.div,{className:"container-xxl",id:"hd-nav-container",style:r?fe(ne({},u),{display:"block"}):{},children:M("nav",{className:"hd-nav",ref:a,children:M("ul",{ref:s,className:"row list-unstyled mb-0 hd-nav-first-level",children:M(ci,{menuItems:e})})})}))}function Yf(e){return Array.isArray(e)&&e.length>0}function li(e=new Date){const t=e.getMonth()+1,r=e.getDate();return+[e.getFullYear(),(t>9?"":"0")+t,(r>9?"":"0")+r].join("")}function Y3(){const[e,t]=S.useState([]),[r,n]=S.useState(0),[i,a]=S.useState(),[o,s]=S.useState(!0),{notifications:l}=ie(c=>c.titleBar),u=ie(c=>c.userLanguage),{isOpen:h,isMobileOrTablet:g}=ie(c=>c.headerInfo),{notifications:y,showNotifications:w}=ie(c=>c.notifications),O=g&&h,P=eg({opacity:O||e.length===0?0:1}),p=S.useRef(),m=Be();return F3(p,()=>{m(wu(!1))}),S.useEffect(()=>{(async()=>{if(l){let{type:c,items:f={}}=l;if(c==="fetch")try{f=await(await fetch(f)).json()}catch(v){console.error(v)}try{let v=new Date;v.setDate(-42),v=li(v),Object.keys(f).forEach(b=>{f[b].forEach(I=>{I.items=I.items.filter(R=>!R.date||li(new Date(R.date))>v)}),f[b]=f[b].filter(I=>I.items.length>0)}),f=DO(f,b=>b.length===0),m(yp(f))}catch(v){console.error(v)}}})()},[l]),S.useEffect(()=>{let c=y[u];u!=="en"&&!Yf(c)&&(c=y.en),Yf(c)&&(t(c),n(c.reduce((f,{items:v=[]})=>f+v.length,0)),a(Math.max(...c.reduce((f,{items:v=[]})=>[...f,...v],[]).filter(f=>{var v;return(v=f.date)==null?void 0:v.match(/^\d\d\d\d-\d\d-\d\d$/)}).map(f=>li(new Date(f.date))),19700101)))},[u,y]),S.useEffect(()=>{const c=Vc.get("ba-notif-read-date");i&&(!c||c<i?s(!1):s(!0))},[i]),M(kt.div,{className:He("col-auto","pe-lg-0","order-lg-4",{"hd-ringing":!o}),id:"hd-notifications",style:P,children:M("div",{className:"col-6 col-lg-auto p-lg-0",children:M("div",{className:"d-inline-block me-lg-3 my-1 my-lg-0",children:Z("div",{className:"hd-dropdown",children:[Z("button",{className:"btn p-2 hd-dropdown-toggle",type:"button",id:"hd-dropdown-notifications",onClick:c=>{O||(c.stopPropagation(),s(!0),Vc.set("ba-notif-read-date",li(),{expires:new Date(2147483647*1e3)}),m(wu(!w)))},children:[M(Pe.Bell,{className:"hd-icon hd-icon-bell"}),r>0&&Z(As,{children:[M("span",{className:"visually-hidden",children:"Notifications"}),M("span",{className:He("badge","rounded-pill",{"bg-danger":!o,"bg-primary":o}),children:r>=9?"9+":`${r}`})]})]}),M("ul",{className:"hd-dropdown-menu shadow",style:w?{display:"block"}:{},ref:p,children:e.map(c=>{const{title:f,items:v=[]}=c;return v.map((b,I)=>{const{title:R,url:_}=b;return Z(ue.default.Fragment,{children:[I===0&&f&&M("li",{children:M("span",{className:"hd-dropdown-header text-uppercase",children:f})}),M("li",{children:M("a",fe(ne({className:"hd-dropdown-item",href:_},Zt(_)&&{target:"_blank"}),{children:R}))})]},Wr())})})})]})})})})}function J3(e=!1){const[t,r]=S.useState(e),n=S.useCallback(()=>r(i=>!i),[]);return[t,n]}function Z3(){const[e,t]=J3(),{isOpen:r}=ie(i=>i.headerInfo),n=Be();return S.useEffect(()=>{n(dp(e)),e?document.body.style.overflow="hidden":(document.body.style.overflow="auto",n(pp()))},[e]),M("div",{className:He("col-auto","d-inline-block","d-lg-none","ms-0","ms-sm-4","me-3",{"hd-menu-opened":r}),id:"hd-menu-hamburger",onClick:t,children:M("div",{className:"d-block",children:M("div",{})})})}var pe={};/** @license React v17.0.2
|
|
103
103
|
* react-is.production.min.js
|
|
104
104
|
*
|
|
105
105
|
* Copyright (c) Facebook, Inc. and its affiliates.
|