ba-js-common-header 0.0.66 → 0.0.67

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.
@@ -15112,7 +15112,7 @@ function Notifications() {
15112
15112
  }
15113
15113
  }
15114
15114
  }, [notificationDate]);
15115
- if (!notificationsLang)
15115
+ if (!notificationsLang || notificationsLang.length === 0)
15116
15116
  return null;
15117
15117
  return /* @__PURE__ */ jsx(animated.div, {
15118
15118
  className: cn("col-auto", "pe-lg-0", "order-lg-4", {
@@ -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 "+(M+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(v==3){if(Q==B)throw new Error(z||"Parsing halted.");H=this.lexer.yyleng,L=this.lexer.yytext,M=this.lexer.yylineno,V=this.lexer.yylloc,Q=oe()}for(;!(U.toString()in S[ee]);){if(ee==0)throw new Error(z||"Parsing halted.");ie(1),ee=O[O.length-1]}fe=Q,Q=U,ee=O[O.length-1],P=S[ee]&&S[ee][U],v=3}if(P[0]instanceof Array&&P.length>1)throw new Error("Parse Error: multiple actions possible at state: "+ee+", token: "+Q);switch(P[0]){case 1:O.push(Q),$.push(this.lexer.yytext),R.push(this.lexer.yylloc),O.push(P[1]),Q=null,fe?(Q=fe,fe=null):(H=this.lexer.yyleng,L=this.lexer.yytext,M=this.lexer.yylineno,V=this.lexer.yylloc,v>0&&v--);break;case 2:if(D=this.productions_[P[1]][1],x.$=$[$.length-D],x._$={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},E=this.performAction.call(x,L,H,M,this.yy,P[1],$,R),typeof E!="undefined")return E;D&&(O=O.slice(0,-1*D*2),$=$.slice(0,-1*D),R=R.slice(0,-1*D)),O.push(this.productions_[P[1]][0]),$.push(x.$),R.push(x._$),k=S[O[O.length-2]][O[O.length-1]],O.push(k);break;case 3:return!0}}return!0}},g=function(){var f={EOF:1,parseError:function(y,O){if(this.yy.parseError)this.yy.parseError(y,O);else throw new Error(y)},setInput:function(d){return this._input=d,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 d=this._input[0];this.yytext+=d,this.yyleng++,this.match+=d,this.matched+=d;var y=d.match(/\n/);return y&&this.yylineno++,this._input=this._input.slice(1),d},unput:function(d){return this._input=d+this._input,this},more:function(){return this._more=!0,this},pastInput:function(){var d=this.matched.substr(0,this.matched.length-this.match.length);return(d.length>20?"...":"")+d.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var d=this.match;return d.length<20&&(d+=this._input.substr(0,20-d.length)),(d.substr(0,20)+(d.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var d=this.pastInput(),y=new Array(d.length+1).join("-");return d+this.upcomingInput()+`
101
101
  `+y+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var d,y,O;this._more||(this.yytext="",this.match="");for(var $=this._currentRules(),R=0;R<$.length;R++)if(y=this._input.match(this.rules[$[R]]),y)return O=y[0].match(/\n.*/g),O&&(this.yylineno+=O.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:O?O[O.length-1].length-1:this.yylloc.last_column+y[0].length},this.yytext+=y[0],this.match+=y[0],this.matches=y,this.yyleng=this.yytext.length,this._more=!1,this._input=this._input.slice(y[0].length),this.matched+=y[0],d=this.performAction.call(this,this.yy,this,$[R],this.conditionStack[this.conditionStack.length-1]),d||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 y=this.next();return typeof y!="undefined"?y:this.lex()},begin:function(y){this.conditionStack.push(y)},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(y){this.begin(y)}};return f.performAction=function(y,O,$,R){switch($){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"}},f.rules=[/^\s+/,/^[0-9]+(\.[0-9]+)?\b/,/^n\b/,/^\|\|/,/^&&/,/^\?/,/^:/,/^<=/,/^>=/,/^</,/^>/,/^!=/,/^==/,/^%/,/^\(/,/^\)/,/^$/,/^./],f.conditions={INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],inclusive:!0}},f}();return p.lexer=g,p}(),e.exports&&(t=e.exports=h),t.Jed=h})()})(qf,qf.exports);var P9=qf.exports;const $9=e=>fetch(e).then(t=>t.json());function I9(e,t){return e.replace(/\{(\d+)\}/g,function(){return t[arguments[1]]})}function or(){const{i18nFeed:e}=ae(a=>a.headerInfo),t=ae(a=>a.userLanguage),{data:r,error:n}=Ad(e&&t?I9(e,[t]):null,$9);return{i18n:new P9({locale_data:r||{messages:{"":{}}}}),error:n}}function Wr(e){return e.match(/^(http|www).+/)}function Qf(e){var d;const{item:t,level:r,hasChildren:n,children:a}=e,{href:i,label:o,id:s,group:c,premium:u={}}=t,{value:l=!1,locked:h=!1}=u,{i18n:m}=or(),{isOpen:w,subMenus:b}=ae(y=>y.headerInfo),{items:_}=ae(y=>y.menuItems),p=w&&b.find(y=>y===s),g=!!c&&((d=_.find(y=>y.group===c))==null?void 0:d.id)===s,f=at();if(l&&h)return Z("li",{className:"hd-nav-has-children",onClick:()=>{f(qt(s))},children:[C("div",{className:"row m-0 py-lg-0 align-items-center",children:C("div",{className:"col py-2 py-lg-0 px-0",children:Z("span",{className:"px-lg-3 py-2 d-block",children:[m.translate("label").fetch(),C("span",{className:"float-end",children:C(xe.Lock,{className:"hd-icon hd-icon-lock"})})]})})}),C("ul",{className:Ye("py-3","list-unstyled",{"hd-nav-second-level":r===1,"hd-nav-third-level":r===2,"hd-submenu-opened":p}),children:C("li",{className:"hd-premium",children:C("div",{className:"row m-0 py-lg-0 align-items-center",children:Z("div",{className:"col p-lg-3",children:[C("span",{className:"d-lg-none mb-3",children:C(xe.Lock,{className:"hd-icon hd-icon-lock"})}),Z("p",{children:["This premium functionality has not been activated.",C("br",{}),"Please contact us to activate this feature."]}),C("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&&f(qt(s))},children:[Z("div",{className:"row m-0 py-lg-0 align-items-center",children:[C("div",{className:"col py-2 py-lg-0 px-0",children:i?C("a",de(se({className:"ps-lg-3 pe-3 py-2",href:i},Wr(i)&&{target:"_blank"}),{onClick:()=>{f(Da(s))},children:m.translate(o).fetch()})):C("span",{className:"ps-lg-3 pe-3 py-2",children:m.translate(o).fetch()})}),n&&C("div",{className:"col-auto p-2 d-block d-lg-none",children:C(xe.ArrowAngleRight,{className:"hd-icon hd-icon-arrow-angle-right"})})]}),n&&C("ul",{className:Ye("py-3","list-unstyled","hd-nav-second-level",{"hd-submenu-opened":p}),children:a})]});if(r===2)return Z($l,{children:[g&&C("div",{className:"row m-0 pt-3 hd-nav-section",children:C("div",{className:"col py-2 py-lg-0 px-0",children:C("div",{className:"px-lg-3 d-block text-uppercase",children:m.translate(c).fetch()})})}),Z("li",{onClick:()=>{n&&f(qt(s))},children:[Z("div",{className:"row m-0 py-lg-0 align-items-center",children:[C("div",{className:"col py-2 py-lg-0 px-0",children:i?C("a",de(se({className:"px-lg-3 py-2 d-block",href:i},Wr(i)&&{target:"_blank"}),{onClick:()=>{f(Da(s))},children:m.translate(o).fetch()})):C("span",{className:"px-lg-3 py-2 d-block",children:m.translate(o).fetch()})}),n&&C("div",{className:"col-auto px-0",children:C("span",{className:"p-2 d-lg-block",children:C(xe.ArrowAngleRight,{className:"hd-icon hd-icon-arrow-angle-right"})})})]}),n&&C("ul",{className:Ye("py-3","ps-3","ps-lg-0","list-unstyled","hd-nav-third-level",{"hd-submenu-opened":p}),children:a})]})]});if(r===3)return C("li",{children:C("div",{className:"row m-0 py-1 py-lg-0 align-items-center",children:C("div",{className:"col p-lg-0",children:C("a",de(se({className:"px-lg-3 py-2 d-block",href:i},Wr(i)&&{target:"_blank"}),{onClick:()=>{f(Da(s))},children:m.translate(o).fetch()}))})})})}const Yy=Y.exports.shape({id:Y.exports.oneOfType([Y.exports.string,Y.exports.number]).isRequired,parentId:Y.exports.oneOfType([Y.exports.string,Y.exports.number]),label:Y.exports.string.isRequired,href:Y.exports.string,premium:Y.exports.shape({value:Y.exports.bool,locked:Y.exports.bool}),group:Y.exports.string});Qf.propTypes={item:Yy.isRequired,level:Y.exports.number.isRequired,hasChildren:Y.exports.bool.isRequired,children:Y.exports.element},Qf.defaultProps={children:void 0};const Xy=In();function To(e){const{menuItems:t,parentId:r=Xy,level:n=1}=e,a=t.filter(i=>(i.parentId||Xy)===r);return a.length?a.map(i=>{const o=!!t.find(l=>l.parentId===i.id),{premium:s={}}=i,{value:c=!1,locked:u=!1}=s;return C(Qf,{item:i,level:n,hasChildren:o,premium:c,locked:u,children:C(To,{menuItems:t,parentId:i.id,level:n+1})},i.id)}):null}To.propTypes={menuItems:Y.exports.arrayOf(Yy).isRequired,parentId:Y.exports.oneOfType([Y.exports.string,Y.exports.number]),level:Y.exports.number},To.defaultProps={parentId:void 0,level:void 0};function x9(){const{items:e}=ae(u=>u.menuItems),{isOpen:t,isMobileOrTablet:r,subMenus:n}=ae(u=>u.headerInfo),a=at(),[i,{height:o}]=Ko(),s=I.useRef(null),c=Pn(!r||t,{from:{height:0},enter:{height:o},leave:{height:0},update:{height:o},config:de(se({},Or.stiff),{clamp:!0})});return I.useEffect(()=>{if(e.length>0){const{origin:u,pathname:l,search:h,hash:m}=new URL(window.location.href),w=Gf.parse(h),b=e.find(_=>{const{origin:p,pathname:g,search:f,hash:d}=new URL(_.href,u);return p===u&&g===l&&y9(w,Gf.parse(f))&&d===m});b&&a(Da(b.id))}},[e]),I.useEffect(()=>{s&&n.length>0&&(s.current.scrollTop=0)},[n.length]),c((u,l)=>l&&C(Sr.div,{className:"container-xxl",id:"hd-nav-container",style:r?de(se({},u),{display:"block"}):{},children:C("nav",{className:"hd-nav",ref:i,children:C("ul",{ref:s,className:"row list-unstyled mb-0 hd-nav-first-level",children:C(To,{menuItems:e})})})}))}function Jy(e){return Array.isArray(e)&&e.length>0}function Ao(e=new Date){const t=e.getMonth()+1,r=e.getDate();return+[e.getFullYear(),(t>9?"":"0")+t,(r>9?"":"0")+r].join("")}function E9(){const[e,t]=I.useState([]),[r,n]=I.useState(0),[a,i]=I.useState(),[o,s]=I.useState(!0),{notifications:c}=ae(f=>f.titleBar),u=ae(f=>f.userLanguage),{isOpen:l,isMobileOrTablet:h}=ae(f=>f.headerInfo),{notifications:m,showNotifications:w}=ae(f=>f.notifications),b=h&&l,_=tw({opacity:b?0:1}),p=I.useRef(),g=at();return p9(p,()=>{g(hd(!1))}),I.useEffect(()=>{(async()=>{if(c){let{type:f,items:d={}}=c;if(f==="fetch")try{d=await(await fetch(d)).json()}catch(y){console.error(y)}try{let y=new Date;y.setDate(-42),y=Ao(y),Object.keys(d).forEach(O=>{d[O].forEach($=>{$.items=$.items.filter(R=>R.date&&Ao(new Date(R.date))>y)}),d[O]=d[O].filter($=>$.items.length>0)}),d=Fx(d,O=>O.length===0),g(bb(d))}catch(y){console.error(y)}}})()},[c]),I.useEffect(()=>{let f=m[u];u!=="en"&&!Jy(f)&&(f=m.en),Jy(f)&&(t(f),n(f.reduce((d,{items:y=[]})=>d+y.length,0)),i(Math.max(...f.reduce((d,{items:y=[]})=>[...d,...y],[]).filter(d=>{var y;return(y=d.date)==null?void 0:y.match(/^\d\d\d\d-\d\d-\d\d$/)}).map(d=>Ao(new Date(d.date))),19700101)))},[u,m]),I.useEffect(()=>{const f=Dp.get("ba-notif-read-date");a&&(!f||f<a?s(!1):s(!0))},[a]),e?C(Sr.div,{className:Ye("col-auto","pe-lg-0","order-lg-4",{"hd-ringing":!o}),id:"hd-notifications",style:_,children:C("div",{className:"col-6 col-lg-auto p-lg-0",children:C("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:f=>{b||(f.stopPropagation(),s(!0),Dp.set("ba-notif-read-date",Ao(),{expires:new Date(2147483647*1e3)}),g(hd(!w)))},children:[C(xe.Bell,{className:"hd-icon hd-icon-bell"}),r>0&&Z($l,{children:[C("span",{className:"visually-hidden",children:"Notifications"}),C("span",{className:Ye("badge","rounded-pill",{"bg-danger":!o,"bg-primary":o}),children:r>=9?"9+":`${r}`})]})]}),C("ul",{className:"hd-dropdown-menu shadow",style:w?{display:"block"}:{},ref:p,children:e.map(f=>{const{title:d,items:y=[]}=f;return y.map((O,$)=>{const{title:R,url:S}=O;return Z(ce.default.Fragment,{children:[$===0&&d&&C("li",{children:C("span",{className:"hd-dropdown-header text-uppercase",children:d})}),C("li",{children:C("a",de(se({className:"hd-dropdown-item",href:S},Wr(S)&&{target:"_blank"}),{children:R}))})]},In())})})})]})})})}):null}function C9(e=!1){const[t,r]=I.useState(e),n=I.useCallback(()=>r(a=>!a),[]);return[t,n]}function R9(){const[e,t]=C9(),{isOpen:r}=ae(a=>a.headerInfo),n=at();return I.useEffect(()=>{n(pb(e)),e?document.body.style.overflow="hidden":(document.body.style.overflow="auto",n(vb()))},[e]),C("div",{className:Ye("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:C("div",{className:"d-block",children:C("div",{})})})}var ve={};/** @license React v17.0.2
102
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var y=this.next();return typeof y!="undefined"?y:this.lex()},begin:function(y){this.conditionStack.push(y)},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(y){this.begin(y)}};return f.performAction=function(y,O,$,R){switch($){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"}},f.rules=[/^\s+/,/^[0-9]+(\.[0-9]+)?\b/,/^n\b/,/^\|\|/,/^&&/,/^\?/,/^:/,/^<=/,/^>=/,/^</,/^>/,/^!=/,/^==/,/^%/,/^\(/,/^\)/,/^$/,/^./],f.conditions={INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],inclusive:!0}},f}();return p.lexer=g,p}(),e.exports&&(t=e.exports=h),t.Jed=h})()})(qf,qf.exports);var P9=qf.exports;const $9=e=>fetch(e).then(t=>t.json());function I9(e,t){return e.replace(/\{(\d+)\}/g,function(){return t[arguments[1]]})}function or(){const{i18nFeed:e}=ae(a=>a.headerInfo),t=ae(a=>a.userLanguage),{data:r,error:n}=Ad(e&&t?I9(e,[t]):null,$9);return{i18n:new P9({locale_data:r||{messages:{"":{}}}}),error:n}}function Wr(e){return e.match(/^(http|www).+/)}function Qf(e){var d;const{item:t,level:r,hasChildren:n,children:a}=e,{href:i,label:o,id:s,group:c,premium:u={}}=t,{value:l=!1,locked:h=!1}=u,{i18n:m}=or(),{isOpen:w,subMenus:b}=ae(y=>y.headerInfo),{items:_}=ae(y=>y.menuItems),p=w&&b.find(y=>y===s),g=!!c&&((d=_.find(y=>y.group===c))==null?void 0:d.id)===s,f=at();if(l&&h)return Z("li",{className:"hd-nav-has-children",onClick:()=>{f(qt(s))},children:[C("div",{className:"row m-0 py-lg-0 align-items-center",children:C("div",{className:"col py-2 py-lg-0 px-0",children:Z("span",{className:"px-lg-3 py-2 d-block",children:[m.translate("label").fetch(),C("span",{className:"float-end",children:C(xe.Lock,{className:"hd-icon hd-icon-lock"})})]})})}),C("ul",{className:Ye("py-3","list-unstyled",{"hd-nav-second-level":r===1,"hd-nav-third-level":r===2,"hd-submenu-opened":p}),children:C("li",{className:"hd-premium",children:C("div",{className:"row m-0 py-lg-0 align-items-center",children:Z("div",{className:"col p-lg-3",children:[C("span",{className:"d-lg-none mb-3",children:C(xe.Lock,{className:"hd-icon hd-icon-lock"})}),Z("p",{children:["This premium functionality has not been activated.",C("br",{}),"Please contact us to activate this feature."]}),C("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&&f(qt(s))},children:[Z("div",{className:"row m-0 py-lg-0 align-items-center",children:[C("div",{className:"col py-2 py-lg-0 px-0",children:i?C("a",de(se({className:"ps-lg-3 pe-3 py-2",href:i},Wr(i)&&{target:"_blank"}),{onClick:()=>{f(Da(s))},children:m.translate(o).fetch()})):C("span",{className:"ps-lg-3 pe-3 py-2",children:m.translate(o).fetch()})}),n&&C("div",{className:"col-auto p-2 d-block d-lg-none",children:C(xe.ArrowAngleRight,{className:"hd-icon hd-icon-arrow-angle-right"})})]}),n&&C("ul",{className:Ye("py-3","list-unstyled","hd-nav-second-level",{"hd-submenu-opened":p}),children:a})]});if(r===2)return Z($l,{children:[g&&C("div",{className:"row m-0 pt-3 hd-nav-section",children:C("div",{className:"col py-2 py-lg-0 px-0",children:C("div",{className:"px-lg-3 d-block text-uppercase",children:m.translate(c).fetch()})})}),Z("li",{onClick:()=>{n&&f(qt(s))},children:[Z("div",{className:"row m-0 py-lg-0 align-items-center",children:[C("div",{className:"col py-2 py-lg-0 px-0",children:i?C("a",de(se({className:"px-lg-3 py-2 d-block",href:i},Wr(i)&&{target:"_blank"}),{onClick:()=>{f(Da(s))},children:m.translate(o).fetch()})):C("span",{className:"px-lg-3 py-2 d-block",children:m.translate(o).fetch()})}),n&&C("div",{className:"col-auto px-0",children:C("span",{className:"p-2 d-lg-block",children:C(xe.ArrowAngleRight,{className:"hd-icon hd-icon-arrow-angle-right"})})})]}),n&&C("ul",{className:Ye("py-3","ps-3","ps-lg-0","list-unstyled","hd-nav-third-level",{"hd-submenu-opened":p}),children:a})]})]});if(r===3)return C("li",{children:C("div",{className:"row m-0 py-1 py-lg-0 align-items-center",children:C("div",{className:"col p-lg-0",children:C("a",de(se({className:"px-lg-3 py-2 d-block",href:i},Wr(i)&&{target:"_blank"}),{onClick:()=>{f(Da(s))},children:m.translate(o).fetch()}))})})})}const Yy=Y.exports.shape({id:Y.exports.oneOfType([Y.exports.string,Y.exports.number]).isRequired,parentId:Y.exports.oneOfType([Y.exports.string,Y.exports.number]),label:Y.exports.string.isRequired,href:Y.exports.string,premium:Y.exports.shape({value:Y.exports.bool,locked:Y.exports.bool}),group:Y.exports.string});Qf.propTypes={item:Yy.isRequired,level:Y.exports.number.isRequired,hasChildren:Y.exports.bool.isRequired,children:Y.exports.element},Qf.defaultProps={children:void 0};const Xy=In();function To(e){const{menuItems:t,parentId:r=Xy,level:n=1}=e,a=t.filter(i=>(i.parentId||Xy)===r);return a.length?a.map(i=>{const o=!!t.find(l=>l.parentId===i.id),{premium:s={}}=i,{value:c=!1,locked:u=!1}=s;return C(Qf,{item:i,level:n,hasChildren:o,premium:c,locked:u,children:C(To,{menuItems:t,parentId:i.id,level:n+1})},i.id)}):null}To.propTypes={menuItems:Y.exports.arrayOf(Yy).isRequired,parentId:Y.exports.oneOfType([Y.exports.string,Y.exports.number]),level:Y.exports.number},To.defaultProps={parentId:void 0,level:void 0};function x9(){const{items:e}=ae(u=>u.menuItems),{isOpen:t,isMobileOrTablet:r,subMenus:n}=ae(u=>u.headerInfo),a=at(),[i,{height:o}]=Ko(),s=I.useRef(null),c=Pn(!r||t,{from:{height:0},enter:{height:o},leave:{height:0},update:{height:o},config:de(se({},Or.stiff),{clamp:!0})});return I.useEffect(()=>{if(e.length>0){const{origin:u,pathname:l,search:h,hash:m}=new URL(window.location.href),w=Gf.parse(h),b=e.find(_=>{const{origin:p,pathname:g,search:f,hash:d}=new URL(_.href,u);return p===u&&g===l&&y9(w,Gf.parse(f))&&d===m});b&&a(Da(b.id))}},[e]),I.useEffect(()=>{s&&n.length>0&&(s.current.scrollTop=0)},[n.length]),c((u,l)=>l&&C(Sr.div,{className:"container-xxl",id:"hd-nav-container",style:r?de(se({},u),{display:"block"}):{},children:C("nav",{className:"hd-nav",ref:i,children:C("ul",{ref:s,className:"row list-unstyled mb-0 hd-nav-first-level",children:C(To,{menuItems:e})})})}))}function Jy(e){return Array.isArray(e)&&e.length>0}function Ao(e=new Date){const t=e.getMonth()+1,r=e.getDate();return+[e.getFullYear(),(t>9?"":"0")+t,(r>9?"":"0")+r].join("")}function E9(){const[e,t]=I.useState([]),[r,n]=I.useState(0),[a,i]=I.useState(),[o,s]=I.useState(!0),{notifications:c}=ae(f=>f.titleBar),u=ae(f=>f.userLanguage),{isOpen:l,isMobileOrTablet:h}=ae(f=>f.headerInfo),{notifications:m,showNotifications:w}=ae(f=>f.notifications),b=h&&l,_=tw({opacity:b?0:1}),p=I.useRef(),g=at();return p9(p,()=>{g(hd(!1))}),I.useEffect(()=>{(async()=>{if(c){let{type:f,items:d={}}=c;if(f==="fetch")try{d=await(await fetch(d)).json()}catch(y){console.error(y)}try{let y=new Date;y.setDate(-42),y=Ao(y),Object.keys(d).forEach(O=>{d[O].forEach($=>{$.items=$.items.filter(R=>R.date&&Ao(new Date(R.date))>y)}),d[O]=d[O].filter($=>$.items.length>0)}),d=Fx(d,O=>O.length===0),g(bb(d))}catch(y){console.error(y)}}})()},[c]),I.useEffect(()=>{let f=m[u];u!=="en"&&!Jy(f)&&(f=m.en),Jy(f)&&(t(f),n(f.reduce((d,{items:y=[]})=>d+y.length,0)),i(Math.max(...f.reduce((d,{items:y=[]})=>[...d,...y],[]).filter(d=>{var y;return(y=d.date)==null?void 0:y.match(/^\d\d\d\d-\d\d-\d\d$/)}).map(d=>Ao(new Date(d.date))),19700101)))},[u,m]),I.useEffect(()=>{const f=Dp.get("ba-notif-read-date");a&&(!f||f<a?s(!1):s(!0))},[a]),!e||e.length===0?null:C(Sr.div,{className:Ye("col-auto","pe-lg-0","order-lg-4",{"hd-ringing":!o}),id:"hd-notifications",style:_,children:C("div",{className:"col-6 col-lg-auto p-lg-0",children:C("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:f=>{b||(f.stopPropagation(),s(!0),Dp.set("ba-notif-read-date",Ao(),{expires:new Date(2147483647*1e3)}),g(hd(!w)))},children:[C(xe.Bell,{className:"hd-icon hd-icon-bell"}),r>0&&Z($l,{children:[C("span",{className:"visually-hidden",children:"Notifications"}),C("span",{className:Ye("badge","rounded-pill",{"bg-danger":!o,"bg-primary":o}),children:r>=9?"9+":`${r}`})]})]}),C("ul",{className:"hd-dropdown-menu shadow",style:w?{display:"block"}:{},ref:p,children:e.map(f=>{const{title:d,items:y=[]}=f;return y.map((O,$)=>{const{title:R,url:S}=O;return Z(ce.default.Fragment,{children:[$===0&&d&&C("li",{children:C("span",{className:"hd-dropdown-header text-uppercase",children:d})}),C("li",{children:C("a",de(se({className:"hd-dropdown-item",href:S},Wr(S)&&{target:"_blank"}),{children:R}))})]},In())})})})]})})})})}function C9(e=!1){const[t,r]=I.useState(e),n=I.useCallback(()=>r(a=>!a),[]);return[t,n]}function R9(){const[e,t]=C9(),{isOpen:r}=ae(a=>a.headerInfo),n=at();return I.useEffect(()=>{n(pb(e)),e?document.body.style.overflow="hidden":(document.body.style.overflow="auto",n(vb()))},[e]),C("div",{className:Ye("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:C("div",{className:"d-block",children:C("div",{})})})}var ve={};/** @license React v17.0.2
103
103
  * react-is.production.min.js
104
104
  *
105
105
  * Copyright (c) Facebook, Inc. and its affiliates.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ba-js-common-header",
3
- "version": "0.0.66",
3
+ "version": "0.0.67",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "vite build",