Socket
Socket
Sign inDemoInstall

react-dyn-tabs

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-dyn-tabs - npm Package Compare versions

Comparing version 4.5.1 to 4.6.0

lib/cjs/mock/mock-lazy-panel-1.js

28

CHANGELOG.md

@@ -0,6 +1,28 @@

# v4.6.0
- Adding lazy property into tabData object
- Provide an example for lazy loading
# v4.5.0
- Adding onFirstSelect event
# v4.3.0
- Passing handlers with same reference to instance.on method can prevent of attaching an event handler multiple times.
# v4.2.1
- Correct main style
- Adding some themes
- Correct description of setTab method in readme
# v4.0.0
- add getData method, a new version of getCopyData method.
- Add getData method, a new version of getCopyData method.
- add getPreviousData method, a new version of getCopyPerviousData method.
- Add getPreviousData method, a new version of getCopyPerviousData method.

@@ -13,3 +35,3 @@ - First parameter of onSelect function is an object and has perviousSelectedTabId property which is deprecated. you should use previousSelectedTabId property instead of perviousSelectedTabId property.

- since version v3.1.1, returning to last used tab after closing selected tab, should work correctly.
- Since version v3.1.1, returning to last used tab after closing selected tab, should work correctly.

@@ -16,0 +38,0 @@ # v3.0.0

2

dist/react-dyn-tabs.including-polyfills.umd.min.js

@@ -1,2 +0,2 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("react"),require("prop-types")):"function"==typeof define&&define.amd?define(["react","prop-types"],e):(t="undefined"!=typeof globalThis?globalThis:t||self).useDynTabs=e(t.React)}(this,(function(t){"use strict";function e(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var n=e(t),r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function o(t){var e={exports:{}};return t(e,e.exports),e.exports}var i=function(t){return t&&t.Math==Math&&t},a=i("object"==typeof globalThis&&globalThis)||i("object"==typeof window&&window)||i("object"==typeof self&&self)||i("object"==typeof r&&r)||function(){return this}()||Function("return this")(),s=function(t){try{return!!t()}catch(t){return!0}},c=!s((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),u={}.propertyIsEnumerable,l=Object.getOwnPropertyDescriptor,f={f:l&&!u.call({1:2},1)?function(t){var e=l(this,t);return!!e&&e.enumerable}:u},p=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},d={}.toString,h=function(t){return d.call(t).slice(8,-1)},v="".split,y=s((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==h(t)?v.call(t,""):Object(t)}:Object,b=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},g=function(t){return y(b(t))},m=function(t){return"object"==typeof t?null!==t:"function"==typeof t},T=function(t,e){if(!m(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!m(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!m(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!m(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")},_={}.hasOwnProperty,S=function(t,e){return _.call(t,e)},I=a.document,O=m(I)&&m(I.createElement),P=function(t){return O?I.createElement(t):{}},w=!c&&!s((function(){return 7!=Object.defineProperty(P("div"),"a",{get:function(){return 7}}).a})),C=Object.getOwnPropertyDescriptor,D={f:c?C:function(t,e){if(t=g(t),e=T(e,!0),w)try{return C(t,e)}catch(t){}if(S(t,e))return p(!f.f.call(t,e),t[e])}},j=/#|\.prototype\./,x=function(t,e){var n=A[E(t)];return n==M||n!=L&&("function"==typeof e?s(e):!!e)},E=x.normalize=function(t){return String(t).replace(j,".").toLowerCase()},A=x.data={},L=x.NATIVE="N",M=x.POLYFILL="P",F=x,R={},N=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t},k=function(t,e,n){if(N(t),void 0===e)return t;switch(n){case 0:return function(){return t.call(e)};case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}},U=function(t){if(!m(t))throw TypeError(String(t)+" is not an object");return t},H=Object.defineProperty,V={f:c?H:function(t,e,n){if(U(t),e=T(e,!0),U(n),w)try{return H(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},G=c?function(t,e,n){return V.f(t,e,p(1,n))}:function(t,e,n){return t[e]=n,t},B=D.f,q=function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e.prototype=t.prototype,e},W=function(t,e){var n,r,o,i,s,c,u,l,f=t.target,p=t.global,d=t.stat,h=t.proto,v=p?a:d?a[f]:(a[f]||{}).prototype,y=p?R:R[f]||(R[f]={}),b=y.prototype;for(o in e)n=!F(p?o:f+(d?".":"#")+o,t.forced)&&v&&S(v,o),s=y[o],n&&(c=t.noTargetGet?(l=B(v,o))&&l.value:v[o]),i=n&&c?c:e[o],n&&typeof s==typeof i||(u=t.bind&&n?k(i,a):t.wrap&&n?q(i):h&&"function"==typeof i?k(Function.call,i):i,(t.sham||i&&i.sham||s&&s.sham)&&G(u,"sham",!0),y[o]=u,h&&(S(R,r=f+"Prototype")||G(R,r,{}),R[r][o]=i,t.real&&b&&!b[o]&&G(b,o,i)))},z=[].slice,Y={},K=function(t,e,n){if(!(e in Y)){for(var r=[],o=0;o<e;o++)r[o]="a["+o+"]";Y[e]=Function("C,a","return new C("+r.join(",")+")")}return Y[e](t,n)},X=Function.bind||function(t){var e=N(this),n=z.call(arguments,1),r=function(){var o=n.concat(z.call(arguments));return this instanceof r?K(e,o.length,o):e.apply(t,o)};return m(e.prototype)&&(r.prototype=e.prototype),r};W({target:"Function",proto:!0},{bind:X});var J,Q,Z=function(t){return R[t+"Prototype"]},$=Z("Function").bind,tt=Function.prototype,et=function(t){var e=t.bind;return t===tt||t instanceof Function&&e===tt.bind?$:e},nt=function(t){return Object(b(t))},rt=Math.ceil,ot=Math.floor,it=function(t){return isNaN(t=+t)?0:(t>0?ot:rt)(t)},at=Math.min,st=function(t){return t>0?at(it(t),9007199254740991):0},ct=Array.isArray||function(t){return"Array"==h(t)},ut="__core-js_shared__",lt=a[ut]||function(t,e){try{G(a,t,e)}catch(n){a[t]=e}return e}(ut,{}),ft=o((function(t){(t.exports=function(t,e){return lt[t]||(lt[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.10.0",mode:"pure",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})})),pt=0,dt=Math.random(),ht=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++pt+dt).toString(36)},vt="process"==h(a.process),yt=function(t){return"function"==typeof t?t:void 0},bt=function(t,e){return arguments.length<2?yt(R[t])||yt(a[t]):R[t]&&R[t][e]||a[t]&&a[t][e]},gt=bt("navigator","userAgent")||"",mt=a.process,Tt=mt&&mt.versions,_t=Tt&&Tt.v8;_t?Q=(J=_t.split("."))[0]+J[1]:gt&&(!(J=gt.match(/Edge\/(\d+)/))||J[1]>=74)&&(J=gt.match(/Chrome\/(\d+)/))&&(Q=J[1]);var St=Q&&+Q,It=!!Object.getOwnPropertySymbols&&!s((function(){return!Symbol.sham&&(vt?38===St:St>37&&St<41)})),Ot=It&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Pt=ft("wks"),wt=a.Symbol,Ct=Ot?wt:wt&&wt.withoutSetter||ht,Dt=function(t){return S(Pt,t)&&(It||"string"==typeof Pt[t])||(It&&S(wt,t)?Pt[t]=wt[t]:Pt[t]=Ct("Symbol."+t)),Pt[t]},jt=Dt("species"),xt=function(t,e){var n;return ct(t)&&("function"!=typeof(n=t.constructor)||n!==Array&&!ct(n.prototype)?m(n)&&null===(n=n[jt])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===e?0:e)},Et=[].push,At=function(t){var e=1==t,n=2==t,r=3==t,o=4==t,i=6==t,a=7==t,s=5==t||i;return function(c,u,l,f){for(var p,d,h=nt(c),v=y(h),b=k(u,l,3),g=st(v.length),m=0,T=f||xt,_=e?T(c,g):n||a?T(c,0):void 0;g>m;m++)if((s||m in v)&&(d=b(p=v[m],m,h),t))if(e)_[m]=d;else if(d)switch(t){case 3:return!0;case 5:return p;case 6:return m;case 2:Et.call(_,p)}else switch(t){case 4:return!1;case 7:Et.call(_,p)}return i?-1:r||o?o:_}},Lt={forEach:At(0),map:At(1),filter:At(2),some:At(3),every:At(4),find:At(5),findIndex:At(6),filterOut:At(7)},Mt=Dt("species"),Ft=function(t){return St>=51||!s((function(){var e=[];return(e.constructor={})[Mt]=function(){return{foo:1}},1!==e[t](Boolean).foo}))},Rt=Lt.map,Nt=Ft("map");W({target:"Array",proto:!0,forced:!Nt},{map:function(t){return Rt(this,t,arguments.length>1?arguments[1]:void 0)}});var kt=Z("Array").map,Ut=Array.prototype,Ht=function(t){var e=t.map;return t===Ut||t instanceof Array&&e===Ut.map?kt:e},Vt=t.createContext({}),Gt=t.createContext({}),Bt=t.createContext({}),qt=Math.max,Wt=Math.min,zt=function(t,e){var n=it(t);return n<0?qt(n+e,0):Wt(n,e)},Yt=function(t){return function(e,n,r){var o,i=g(e),a=st(i.length),s=zt(r,a);if(t&&n!=n){for(;a>s;)if((o=i[s++])!=o)return!0}else for(;a>s;s++)if((t||s in i)&&i[s]===n)return t||s||0;return!t&&-1}},Kt={includes:Yt(!0),indexOf:Yt(!1)},Xt={},Jt=Kt.indexOf,Qt=function(t,e){var n,r=g(t),o=0,i=[];for(n in r)!S(Xt,n)&&S(r,n)&&i.push(n);for(;e.length>o;)S(r,n=e[o++])&&(~Jt(i,n)||i.push(n));return i},Zt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],$t=Object.keys||function(t){return Qt(t,Zt)},te={f:Object.getOwnPropertySymbols},ee=Object.assign,ne=Object.defineProperty,re=!ee||s((function(){if(c&&1!==ee({b:1},ee(ne({},"a",{enumerable:!0,get:function(){ne(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach((function(t){e[t]=t})),7!=ee({},t)[n]||$t(ee({},e)).join("")!=r}))?function(t,e){for(var n=nt(t),r=arguments.length,o=1,i=te.f,a=f.f;r>o;)for(var s,u=y(arguments[o++]),l=i?$t(u).concat(i(u)):$t(u),p=l.length,d=0;p>d;)s=l[d++],c&&!a.call(u,s)||(n[s]=u[s]);return n}:ee;W({target:"Object",stat:!0,forced:Object.assign!==re},{assign:re});var oe=R.Object.assign,ie=oe;function ae(){return(ae=ie||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}var se=function(t){var e=t.api,n=t.id,r=t.isSelected;this._api=e,this._id=n,this._isSelected=r,this._op=e.optionsManager.options,this._setting=e.optionsManager.setting,this._tabObj=e.getTab(n)};se.prototype.getTabProps=function(){var t={"tab-id":this._id,className:this._setting.tabClass,tabIndex:-1};return this._isSelected&&(t.tabIndex=0,t.className+=" "+this._setting.selectedClass),this._tabObj.disable&&(t.tabIndex=-1,t.className+=" "+this._setting.disableClass),this._op.accessibility&&(t.role="tab",t["aria-controls"]=this._setting.panelIdTemplate(this._id),t["aria-labelledby"]=this._setting.ariaLabelledbyIdTemplate(this._id),t["aria-selected"]=t["aria-expanded"]=this._isSelected),t},se.prototype.getTabInnerProps=function(){var t={id:this._id,isSelected:this._isSelected,api:this._api.userProxy,tabProps:{"tab-id":this._id,className:this._setting.titleClass,title:this._tabObj.tooltip,tabIndex:-1}};return this._tabObj.iconClass&&(t.iconProps={className:this._setting.iconClass+" "+this._tabObj.iconClass,role:"presentation"}),this._op.accessibility&&(t.tabProps.id=this._setting.ariaLabelledbyIdTemplate(this._id),t.tabProps.role="presentation"),t},se.prototype.getCloseIconProps=function(){var t={className:this._setting.closeClass};return this._op.accessibility&&(t.role="presentation"),t};var ce=function(t){n.default.useContext(Bt);var e=t.id,r=t.selectedTabID,o=n.default.useContext(Vt),i=o.getOption("tabComponent"),a=o.getTab(e),s=new se({api:o,id:e,isSelected:r===e});return n.default.createElement("li",ae({},s.getTabProps(),{onClick:function(t){!function(t){o.eventHandlerFactory({e:t,id:e})}(t)}}),n.default.createElement(i,s.getTabInnerProps(),a.title),a.closable?n.default.createElement("span",s.getCloseIconProps(),"×"):null)},ue=t.memo(ce,(function(t,e){var n=t.id,r=t.selectedTabID,o=e.selectedTabID;return r===o||n!==r&&n!==o}));var le=t.memo((function(){var t=n.default.useContext(Gt),e=t.openTabIDs,r=t.selectedTabID,o=function(t){var e=t.api,n=e.optionsManager.setting,r=e.optionsManager.options,o={className:n.tablistClass+" "+n[r.direction+"Class"]};return r.isVertical&&(o.className+=" "+n.verticalClass),r.accessibility&&(o.role="tablist"),o}({api:n.default.useContext(Vt)});return n.default.createElement("ul",o,Ht(e).call(e,(function(t){return n.default.createElement(ue,{key:t,id:t,selectedTabID:r})})))}),(function(){return!0}));var fe,pe,de=function(t){n.default.useContext(Bt);var e=t.id,r=t.selectedTabID,o=n.default.useContext(Vt),i=e===r,a=function(t){var e=t.isSelected,n=t.api,r=t.id,o=n.optionsManager.options,i=n.optionsManager.setting,a={"tab-id":r,className:i.panelClass};return e&&(a.className+=" "+i.selectedClass),o.accessibility&&(a.role="tabpanel",a.id=i.panelIdTemplate(r),a["aria-hidden"]=!e,a["aria-labelledby"]=i.ariaLabelledbyIdTemplate(r)),a}({isSelected:i,api:o,id:e}),s=o.getTab(e).panelComponent;return n.default.createElement("div",a,s?n.default.createElement(s,{id:e,isSelected:i,api:o.userProxy}):null)},he=t.memo(de,(function(t,e){var n=t.id,r=t.selectedTabID,o=e.selectedTabID;return r===o||n!==r&&n!==o})),ve=t.memo((function(){var t=n.default.useContext(Gt),e=t.openTabIDs,r=t.selectedTabID,o=n.default.useContext(Vt),i=o.optionsManager.setting,a=o.optionsManager.options,s=i.panellistClass+" "+i[a.direction+"Class"];return a.isVertical&&(s+=" "+i.verticalClass),n.default.createElement("div",{className:s},Ht(e).call(e,(function(t){return n.default.createElement(he,{key:t,id:t,selectedTabID:r})})))}),(function(){return!0})),ye=Kt.indexOf,be=[].indexOf,ge=!!be&&1/[1].indexOf(1,-0)<0,me=!!(pe=[]["indexOf"])&&s((function(){pe.call(null,fe||function(){throw 1},1)}));W({target:"Array",proto:!0,forced:ge||!me},{indexOf:function(t){return ge?be.apply(this,arguments)||0:ye(this,t,arguments.length>1?arguments[1]:void 0)}});var Te=Z("Array").indexOf,_e=Array.prototype,Se=function(t){var e=t.indexOf;return t===_e||t instanceof Array&&e===_e.indexOf?Te:e},Ie=function(t,e,n){var r=T(e);r in t?V.f(t,r,p(0,n)):t[r]=n},Oe=Ft("slice"),Pe=Dt("species"),we=[].slice,Ce=Math.max;W({target:"Array",proto:!0,forced:!Oe},{slice:function(t,e){var n,r,o,i=g(this),a=st(i.length),s=zt(t,a),c=zt(void 0===e?a:e,a);if(ct(i)&&("function"!=typeof(n=i.constructor)||n!==Array&&!ct(n.prototype)?m(n)&&null===(n=n[Pe])&&(n=void 0):n=void 0,n===Array||void 0===n))return we.call(i,s,c);for(r=new(void 0===n?Array:n)(Ce(c-s,0)),o=0;s<c;s++,o++)s in i&&Ie(r,o,i[s]);return r.length=o,r}});var De=Z("Array").slice,je=Array.prototype,xe=function(t){var e=t.slice;return t===je||t instanceof Array&&e===je.slice?De:e},Ee=Ft("splice"),Ae=Math.max,Le=Math.min,Me=9007199254740991,Fe="Maximum allowed length exceeded";W({target:"Array",proto:!0,forced:!Ee},{splice:function(t,e){var n,r,o,i,a,s,c=nt(this),u=st(c.length),l=zt(t,u),f=arguments.length;if(0===f?n=r=0:1===f?(n=0,r=u-l):(n=f-2,r=Le(Ae(it(e),0),u-l)),u+n-r>Me)throw TypeError(Fe);for(o=xt(c,r),i=0;i<r;i++)(a=l+i)in c&&Ie(o,i,c[a]);if(o.length=r,n<r){for(i=l;i<u-r;i++)s=i+n,(a=i+r)in c?c[s]=c[a]:delete c[s];for(i=u;i>u-r+n;i--)delete c[i-1]}else if(n>r)for(i=u-r;i>l;i--)s=i+n-1,(a=i+r-1)in c?c[s]=c[a]:delete c[s];for(i=0;i<n;i++)c[i+l]=arguments[i+2];return c.length=u-r+n,o}});var Re,Ne=Z("Array").splice,ke=Array.prototype,Ue=function(t){var e=t.splice;return t===ke||t instanceof Array&&e===ke.splice?Ne:e},He="open",Ve="close",Ge="active",Be="refresh",qe=ft("keys"),We=function(t){return qe[t]||(qe[t]=ht(t))},ze=!s((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),Ye=We("IE_PROTO"),Ke=Object.prototype,Xe=ze?Object.getPrototypeOf:function(t){return t=nt(t),S(t,Ye)?t[Ye]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?Ke:null},Je=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),e=n instanceof Array}catch(t){}return function(n,r){return U(n),function(t){if(!m(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype")}(r),e?t.call(n,r):n.__proto__=r,n}}():void 0),Qe=c?Object.defineProperties:function(t,e){U(t);for(var n,r=$t(e),o=r.length,i=0;o>i;)V.f(t,n=r[i++],e[n]);return t},Ze=bt("document","documentElement"),$e=We("IE_PROTO"),tn=function(){},en=function(t){return"<script>"+t+"</"+"script>"},nn=function(){try{Re=document.domain&&new ActiveXObject("htmlfile")}catch(t){}var t,e;nn=Re?function(t){t.write(en("")),t.close();var e=t.parentWindow.Object;return t=null,e}(Re):((e=P("iframe")).style.display="none",Ze.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(en("document.F=Object")),t.close(),t.F);for(var n=Zt.length;n--;)delete nn.prototype[Zt[n]];return nn()};Xt[$e]=!0;var rn=Object.create||function(t,e){var n;return null!==t?(tn.prototype=U(t),n=new tn,tn.prototype=null,n[$e]=t):n=nn(),void 0===e?n:Qe(n,e)},on={},an=Dt("iterator"),sn=Array.prototype,cn={};cn[Dt("toStringTag")]="z";var un="[object z]"===String(cn),ln=Dt("toStringTag"),fn="Arguments"==h(function(){return arguments}()),pn=un?h:function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),ln))?n:fn?h(e):"Object"==(r=h(e))&&"function"==typeof e.callee?"Arguments":r},dn=Dt("iterator"),hn=function(t){var e=t.return;if(void 0!==e)return U(e.call(t)).value},vn=function(t,e){this.stopped=t,this.result=e},yn=function(t,e,n){var r,o,i,a,s,c,u,l,f=n&&n.that,p=!(!n||!n.AS_ENTRIES),d=!(!n||!n.IS_ITERATOR),h=!(!n||!n.INTERRUPTED),v=k(e,f,1+p+h),y=function(t){return r&&hn(r),new vn(!0,t)},b=function(t){return p?(U(t),h?v(t[0],t[1],y):v(t[0],t[1])):h?v(t,y):v(t)};if(d)r=t;else{if("function"!=typeof(o=function(t){if(null!=t)return t[dn]||t["@@iterator"]||on[pn(t)]}(t)))throw TypeError("Target is not iterable");if(void 0!==(l=o)&&(on.Array===l||sn[an]===l)){for(i=0,a=st(t.length);a>i;i++)if((s=b(t[i]))&&s instanceof vn)return s;return new vn(!1)}r=o.call(t)}for(c=r.next;!(u=c.call(r)).done;){try{s=b(u.value)}catch(t){throw hn(r),t}if("object"==typeof s&&s&&s instanceof vn)return s}return new vn(!1)},bn=function(t,e){var n=this;if(!(n instanceof bn))return new bn(t,e);Je&&(n=Je(new Error(void 0),Xe(n))),void 0!==e&&G(n,"message",String(e));var r=[];return yn(t,r.push,{that:r}),G(n,"errors",r),n};bn.prototype=rn(Error.prototype,{constructor:p(5,bn),message:p(5,""),name:p(5,"AggregateError")}),W({global:!0},{AggregateError:bn});var gn=a.Promise,mn=function(t,e,n,r){r&&r.enumerable?t[e]=n:G(t,e,n)},Tn=un?{}.toString:function(){return"[object "+pn(this)+"]"},_n=V.f,Sn=Dt("toStringTag"),In=function(t,e,n,r){if(t){var o=n?t:t.prototype;S(o,Sn)||_n(o,Sn,{configurable:!0,value:e}),r&&!un&&G(o,"toString",Tn)}},On=Dt("species"),Pn=Function.toString;"function"!=typeof lt.inspectSource&&(lt.inspectSource=function(t){return Pn.call(t)});var wn=lt.inspectSource,Cn=Dt("iterator"),Dn=!1;try{var jn=0,xn={next:function(){return{done:!!jn++}},return:function(){Dn=!0}};xn[Cn]=function(){return this},Array.from(xn,(function(){throw 2}))}catch(t){}var En,An,Ln,Mn=Dt("species"),Fn=function(t,e){var n,r=U(t).constructor;return void 0===r||null==(n=U(r)[Mn])?e:N(n)},Rn=/(iphone|ipod|ipad).*applewebkit/i.test(gt),Nn=a.location,kn=a.setImmediate,Un=a.clearImmediate,Hn=a.process,Vn=a.MessageChannel,Gn=a.Dispatch,Bn=0,qn={},Wn="onreadystatechange",zn=function(t){if(qn.hasOwnProperty(t)){var e=qn[t];delete qn[t],e()}},Yn=function(t){return function(){zn(t)}},Kn=function(t){zn(t.data)},Xn=function(t){a.postMessage(t+"",Nn.protocol+"//"+Nn.host)};kn&&Un||(kn=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return qn[++Bn]=function(){("function"==typeof t?t:Function(t)).apply(void 0,e)},En(Bn),Bn},Un=function(t){delete qn[t]},vt?En=function(t){Hn.nextTick(Yn(t))}:Gn&&Gn.now?En=function(t){Gn.now(Yn(t))}:Vn&&!Rn?(Ln=(An=new Vn).port2,An.port1.onmessage=Kn,En=k(Ln.postMessage,Ln,1)):a.addEventListener&&"function"==typeof postMessage&&!a.importScripts&&Nn&&"file:"!==Nn.protocol&&!s(Xn)?(En=Xn,a.addEventListener("message",Kn,!1)):En=Wn in P("script")?function(t){Ze.appendChild(P("script")).onreadystatechange=function(){Ze.removeChild(this),zn(t)}}:function(t){setTimeout(Yn(t),0)});var Jn,Qn,Zn,$n,tr,er,nr,rr,or={set:kn,clear:Un},ir=/web0s(?!.*chrome)/i.test(gt),ar=D.f,sr=or.set,cr=a.MutationObserver||a.WebKitMutationObserver,ur=a.document,lr=a.process,fr=a.Promise,pr=ar(a,"queueMicrotask"),dr=pr&&pr.value;dr||(Jn=function(){var t,e;for(vt&&(t=lr.domain)&&t.exit();Qn;){e=Qn.fn,Qn=Qn.next;try{e()}catch(t){throw Qn?$n():Zn=void 0,t}}Zn=void 0,t&&t.enter()},Rn||vt||ir||!cr||!ur?fr&&fr.resolve?(nr=fr.resolve(void 0),rr=nr.then,$n=function(){rr.call(nr,Jn)}):$n=vt?function(){lr.nextTick(Jn)}:function(){sr.call(a,Jn)}:(tr=!0,er=ur.createTextNode(""),new cr(Jn).observe(er,{characterData:!0}),$n=function(){er.data=tr=!tr}));var hr,vr,yr,br=dr||function(t){var e={fn:t,next:void 0};Zn&&(Zn.next=e),Qn||(Qn=e,$n()),Zn=e},gr=function(t){var e,n;this.promise=new t((function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r})),this.resolve=N(e),this.reject=N(n)},mr={f:function(t){return new gr(t)}},Tr=function(t,e){if(U(t),m(e)&&e.constructor===t)return e;var n=mr.f(t);return(0,n.resolve)(e),n.promise},_r=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}},Sr=a.WeakMap,Ir="function"==typeof Sr&&/native code/.test(wn(Sr)),Or=a.WeakMap;if(Ir){var Pr=lt.state||(lt.state=new Or),wr=Pr.get,Cr=Pr.has,Dr=Pr.set;hr=function(t,e){return e.facade=t,Dr.call(Pr,t,e),e},vr=function(t){return wr.call(Pr,t)||{}},yr=function(t){return Cr.call(Pr,t)}}else{var jr=We("state");Xt[jr]=!0,hr=function(t,e){return e.facade=t,G(t,jr,e),e},vr=function(t){return S(t,jr)?t[jr]:{}},yr=function(t){return S(t,jr)}}var xr={set:hr,get:vr,has:yr,enforce:function(t){return yr(t)?vr(t):hr(t,{})},getterFor:function(t){return function(e){var n;if(!m(e)||(n=vr(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}},Er=or.set,Ar=Dt("species"),Lr="Promise",Mr=xr.get,Fr=xr.set,Rr=xr.getterFor(Lr),Nr=gn,kr=a.TypeError,Ur=a.document,Hr=a.process;bt("fetch");var Vr,Gr,Br,qr=mr.f,Wr=qr,zr=!!(Ur&&Ur.createEvent&&a.dispatchEvent),Yr="function"==typeof PromiseRejectionEvent,Kr="unhandledrejection",Xr=F(Lr,(function(){if(!(wn(Nr)!==String(Nr))){if(66===St)return!0;if(!vt&&!Yr)return!0}if(!Nr.prototype.finally)return!0;if(St>=51&&/native code/.test(Nr))return!1;var t=Nr.resolve(1),e=function(t){t((function(){}),(function(){}))};return(t.constructor={})[Ar]=e,!(t.then((function(){}))instanceof e)})),Jr=Xr||!function(t,e){if(!e&&!Dn)return!1;var n=!1;try{var r={};r[Cn]=function(){return{next:function(){return{done:n=!0}}}},t(r)}catch(t){}return n}((function(t){Nr.all(t).catch((function(){}))})),Qr=function(t){var e;return!(!m(t)||"function"!=typeof(e=t.then))&&e},Zr=function(t,e){if(!t.notified){t.notified=!0;var n=t.reactions;br((function(){for(var r=t.value,o=1==t.state,i=0;n.length>i;){var a,s,c,u=n[i++],l=o?u.ok:u.fail,f=u.resolve,p=u.reject,d=u.domain;try{l?(o||(2===t.rejection&&no(t),t.rejection=1),!0===l?a=r:(d&&d.enter(),a=l(r),d&&(d.exit(),c=!0)),a===u.promise?p(kr("Promise-chain cycle")):(s=Qr(a))?s.call(a,f,p):f(a)):p(r)}catch(t){d&&!c&&d.exit(),p(t)}}t.reactions=[],t.notified=!1,e&&!t.rejection&&to(t)}))}},$r=function(t,e,n){var r,o;zr?((r=Ur.createEvent("Event")).promise=e,r.reason=n,r.initEvent(t,!1,!0),a.dispatchEvent(r)):r={promise:e,reason:n},!Yr&&(o=a["on"+t])?o(r):t===Kr&&function(t,e){var n=a.console;n&&n.error&&(1===arguments.length?n.error(t):n.error(t,e))}("Unhandled promise rejection",n)},to=function(t){Er.call(a,(function(){var e,n=t.facade,r=t.value;if(eo(t)&&(e=_r((function(){vt?Hr.emit("unhandledRejection",r,n):$r(Kr,n,r)})),t.rejection=vt||eo(t)?2:1,e.error))throw e.value}))},eo=function(t){return 1!==t.rejection&&!t.parent},no=function(t){Er.call(a,(function(){var e=t.facade;vt?Hr.emit("rejectionHandled",e):$r("rejectionhandled",e,t.value)}))},ro=function(t,e,n){return function(r){t(e,r,n)}},oo=function(t,e,n){t.done||(t.done=!0,n&&(t=n),t.value=e,t.state=2,Zr(t,!0))},io=function(t,e,n){if(!t.done){t.done=!0,n&&(t=n);try{if(t.facade===e)throw kr("Promise can't be resolved itself");var r=Qr(e);r?br((function(){var n={done:!1};try{r.call(e,ro(io,n,t),ro(oo,n,t))}catch(e){oo(n,e,t)}})):(t.value=e,t.state=1,Zr(t,!1))}catch(e){oo({done:!1},e,t)}}};Xr&&(Nr=function(t){!function(t,e,n){if(!(t instanceof e))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation")}(this,Nr,Lr),N(t),Vr.call(this);var e=Mr(this);try{t(ro(io,e),ro(oo,e))}catch(t){oo(e,t)}},(Vr=function(t){Fr(this,{type:Lr,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=function(t,e,n){for(var r in e)n&&n.unsafe&&t[r]?t[r]=e[r]:mn(t,r,e[r],n);return t}(Nr.prototype,{then:function(t,e){var n=Rr(this),r=qr(Fn(this,Nr));return r.ok="function"!=typeof t||t,r.fail="function"==typeof e&&e,r.domain=vt?Hr.domain:void 0,n.parent=!0,n.reactions.push(r),0!=n.state&&Zr(n,!1),r.promise},catch:function(t){return this.then(void 0,t)}}),Gr=function(){var t=new Vr,e=Mr(t);this.promise=t,this.resolve=ro(io,e),this.reject=ro(oo,e)},mr.f=qr=function(t){return t===Nr||t===Br?new Gr(t):Wr(t)}),W({global:!0,wrap:!0,forced:Xr},{Promise:Nr}),In(Nr,Lr,!1,!0),function(t){var e=bt(t),n=V.f;c&&e&&!e[On]&&n(e,On,{configurable:!0,get:function(){return this}})}(Lr),Br=bt(Lr),W({target:Lr,stat:!0,forced:Xr},{reject:function(t){var e=qr(this);return e.reject.call(void 0,t),e.promise}}),W({target:Lr,stat:!0,forced:!0},{resolve:function(t){return Tr(this===Br?Nr:this,t)}}),W({target:Lr,stat:!0,forced:Jr},{all:function(t){var e=this,n=qr(e),r=n.resolve,o=n.reject,i=_r((function(){var n=N(e.resolve),i=[],a=0,s=1;yn(t,(function(t){var c=a++,u=!1;i.push(void 0),s++,n.call(e,t).then((function(t){u||(u=!0,i[c]=t,--s||r(i))}),o)})),--s||r(i)}));return i.error&&o(i.value),n.promise},race:function(t){var e=this,n=qr(e),r=n.reject,o=_r((function(){var o=N(e.resolve);yn(t,(function(t){o.call(e,t).then(n.resolve,r)}))}));return o.error&&r(o.value),n.promise}}),W({target:"Promise",stat:!0},{allSettled:function(t){var e=this,n=mr.f(e),r=n.resolve,o=n.reject,i=_r((function(){var n=N(e.resolve),o=[],i=0,a=1;yn(t,(function(t){var s=i++,c=!1;o.push(void 0),a++,n.call(e,t).then((function(t){c||(c=!0,o[s]={status:"fulfilled",value:t},--a||r(o))}),(function(t){c||(c=!0,o[s]={status:"rejected",reason:t},--a||r(o))}))})),--a||r(o)}));return i.error&&o(i.value),n.promise}});var ao="No one promise resolved";W({target:"Promise",stat:!0},{any:function(t){var e=this,n=mr.f(e),r=n.resolve,o=n.reject,i=_r((function(){var n=N(e.resolve),i=[],a=0,s=1,c=!1;yn(t,(function(t){var u=a++,l=!1;i.push(void 0),s++,n.call(e,t).then((function(t){l||c||(c=!0,r(t))}),(function(t){l||c||(l=!0,i[u]=t,--s||o(new(bt("AggregateError"))(i,ao)))}))})),--s||o(new(bt("AggregateError"))(i,ao))}));return i.error&&o(i.value),n.promise}});var so=!!gn&&s((function(){gn.prototype.finally.call({then:function(){}},(function(){}))}));W({target:"Promise",proto:!0,real:!0,forced:so},{finally:function(t){var e=Fn(this,bt("Promise")),n="function"==typeof t;return this.then(n?function(n){return Tr(e,t()).then((function(){return n}))}:t,n?function(n){return Tr(e,t()).then((function(){throw n}))}:t)}});var co,uo,lo,fo=function(t){return function(e,n){var r,o,i=String(b(e)),a=it(n),s=i.length;return a<0||a>=s?t?"":void 0:(r=i.charCodeAt(a))<55296||r>56319||a+1===s||(o=i.charCodeAt(a+1))<56320||o>57343?t?i.charAt(a):r:t?i.slice(a,a+2):o-56320+(r-55296<<10)+65536}},po={codeAt:fo(!1),charAt:fo(!0)},ho=Dt("iterator"),vo=!1;[].keys&&("next"in(lo=[].keys())?(uo=Xe(Xe(lo)))!==Object.prototype&&(co=uo):vo=!0);var yo=null==co||s((function(){var t={};return co[ho].call(t)!==t}));yo&&(co={}),yo&&!S(co,ho)&&G(co,ho,(function(){return this}));var bo={IteratorPrototype:co,BUGGY_SAFARI_ITERATORS:vo},go=bo.IteratorPrototype,mo=function(){return this},To=bo.IteratorPrototype,_o=bo.BUGGY_SAFARI_ITERATORS,So=Dt("iterator"),Io="keys",Oo="values",Po="entries",wo=function(){return this},Co=function(t,e,n,r,o,i,a){!function(t,e,n){var r=e+" Iterator";t.prototype=rn(go,{next:p(1,n)}),In(t,r,!1,!0),on[r]=mo}(n,e,r);var s,c,u,l=function(t){if(t===o&&y)return y;if(!_o&&t in h)return h[t];switch(t){case Io:case Oo:case Po:return function(){return new n(this,t)}}return function(){return new n(this)}},f=e+" Iterator",d=!1,h=t.prototype,v=h[So]||h["@@iterator"]||o&&h[o],y=!_o&&v||l(o),b="Array"==e&&h.entries||v;if(b&&(s=Xe(b.call(new t)),To!==Object.prototype&&s.next&&(In(s,f,!0,!0),on[f]=wo)),o==Oo&&v&&v.name!==Oo&&(d=!0,y=function(){return v.call(this)}),a&&h[So]!==y&&G(h,So,y),on[e]=y,o)if(c={values:l(Oo),keys:i?y:l(Io),entries:l(Po)},a)for(u in c)(_o||d||!(u in h))&&mn(h,u,c[u]);else W({target:e,proto:!0,forced:_o||d},c);return c},Do=po.charAt,jo="String Iterator",xo=xr.set,Eo=xr.getterFor(jo);Co(String,"String",(function(t){xo(this,{type:jo,string:String(t),index:0})}),(function(){var t,e=Eo(this),n=e.string,r=e.index;return r>=n.length?{value:void 0,done:!0}:(t=Do(n,r),e.index+=t.length,{value:t,done:!1})}));var Ao="Array Iterator",Lo=xr.set,Mo=xr.getterFor(Ao);Co(Array,"Array",(function(t,e){Lo(this,{type:Ao,target:g(t),index:0,kind:e})}),(function(){var t=Mo(this),e=t.target,n=t.kind,r=t.index++;return!e||r>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:e[r],done:!1}:{value:[r,e[r]],done:!1}}),"values"),on.Arguments=on.Array;var Fo=Dt("toStringTag");for(var Ro in{CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}){var No=a[Ro],ko=No&&No.prototype;ko&&pn(ko)!==Fo&&G(ko,Fo,Ro),on[Ro]=on.Array}var Uo=R.Promise,Ho=Dt("isConcatSpreadable"),Vo=9007199254740991,Go="Maximum allowed index exceeded",Bo=St>=51||!s((function(){var t=[];return t[Ho]=!1,t.concat()[0]!==t})),qo=Ft("concat"),Wo=function(t){if(!m(t))return!1;var e=t[Ho];return void 0!==e?!!e:ct(t)};W({target:"Array",proto:!0,forced:!Bo||!qo},{concat:function(t){var e,n,r,o,i,a=nt(this),s=xt(a,0),c=0;for(e=-1,r=arguments.length;e<r;e++)if(Wo(i=-1===e?a:arguments[e])){if(c+(o=st(i.length))>Vo)throw TypeError(Go);for(n=0;n<o;n++,c++)n in i&&Ie(s,c,i[n])}else{if(c>=Vo)throw TypeError(Go);Ie(s,c++,i)}return s.length=c,s}});var zo=Z("Array").concat,Yo=Array.prototype,Ko=function(t){var e=t.concat;return t===Yo||t instanceof Array&&e===Yo.concat?zo:e},Xo=s((function(){$t(1)}));W({target:"Object",stat:!0,forced:Xo},{keys:function(t){return $t(nt(t))}});var Jo=R.Object.keys,Qo=Zt.concat("length","prototype"),Zo={f:Object.getOwnPropertyNames||function(t){return Qt(t,Qo)}}.f,$o={}.toString,ti="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],ei=function(t){return ti&&"[object Window]"==$o.call(t)?function(t){try{return Zo(t)}catch(t){return ti.slice()}}(t):Zo(g(t))},ni=s((function(){return!Object.getOwnPropertyNames(1)}));W({target:"Object",stat:!0,forced:ni},{getOwnPropertyNames:ei});var ri=R.Object,oi=function(t){return ri.getOwnPropertyNames(t)};W({target:"Object",stat:!0,forced:!c,sham:!c},{defineProperty:V.f});var ii=o((function(t){var e=R.Object,n=t.exports=function(t,n,r){return e.defineProperty(t,n,r)};e.defineProperty.sham&&(n.sham=!0)}));W({target:"Object",stat:!0,forced:!c,sham:!c},{defineProperties:Qe});var ai=o((function(t){var e=R.Object,n=t.exports=function(t,n){return e.defineProperties(t,n)};e.defineProperties.sham&&(n.sham=!0)})),si=[].reverse,ci=[1,2];W({target:"Array",proto:!0,forced:String(ci)===String(ci.reverse())},{reverse:function(){return ct(this)&&(this.length=this.length),si.call(this)}});var ui=Z("Array").reverse,li=Array.prototype,fi=function(t){var e=t.reverse;return t===li||t instanceof Array&&e===li.reverse?ui:e},pi={};function di(t,e){switch(e.type){case Ve:var n=t.openTabIDs,r=Se(n).call(n,e.tabId);if(r>=0){var o=xe(n).call(n);return Ue(o).call(o,r,1),{selectedTabID:t.selectedTabID,openTabIDs:o}}return t;case He:var i=t.openTabIDs,a=e.tabId;if(-1===Se(i).call(i,a)){var s=xe(i).call(i);return s.push(a),{selectedTabID:t.selectedTabID,openTabIDs:s}}return t;case Be:return pi.getCopyState(t);case Ge:var c=e.tabId;return t.selectedTabID!==c?{selectedTabID:c,openTabIDs:t.openTabIDs}:t;default:throw new Error("Undefined action type '"+e.type+"'")}}pi.checkArrIndex=function(t,e){return t>=0&&t<e},pi.getInstance=function(t){new(et(Function.prototype).apply(t,arguments))},pi.resolve=function(t){return Uo.resolve(t)},pi.getCopyState=function(t){var e;return Object.prototype.hasOwnProperty.call(t,"openTabIDs")||(t.openTabIDs=[]),{selectedTabID:t.selectedTabID,openTabIDs:Ko(e=[]).call(e,t.openTabIDs)}},pi.assingAll=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return Ht(n).call(n,(function(e){var n,r=Jo(e);Ht(n=oi(e)).call(n,(function(n){Se(r).call(r,n)>=0?t[n]=e[n]:ii(t,n,{value:e[n],writable:!0})}))})),t},pi.setNoneEnumProps=function(t,e){var n,r={};return Ht(n=Jo(e)).call(n,(function(t){r[t]={writable:!0,value:e[t]}})),ai(t,r)},pi.getArraysDiff=function(t,e){var n,r,o=Ko(n=[]).call(n,t),i=Ko(r=[]).call(r,e);return Ht(t).call(t,(function(t){Se(e).call(e,t)>=0&&(Ue(o).call(o,Se(o).call(o,t),1),Ue(i).call(i,Se(i).call(i,t),1))})),[o,i]},pi.filterArrayUntilFirstValue=function(t,e,n){n&&fi(t).call(t);for(var r=0,o=t.length;r<o;r++)if(e(t[r],r,t))return t[r];return null},pi.throwMissingParam=function(t){throw'Missing parameter in "'+t+'" function'},pi.isObj=function(t){return"[object Object]"===Object.prototype.toString.call(t)},W({target:"Object",stat:!0,sham:!c},{create:rn});var hi=R.Object,vi=function(t,e){return hi.create(t,e)},yi=oe,bi=Kt.includes;W({target:"Array",proto:!0},{includes:function(t){return bi(this,t,arguments.length>1?arguments[1]:void 0)}});var gi=Z("Array").includes,mi=Dt("match"),Ti=function(t){if(function(t){var e;return m(t)&&(void 0!==(e=t[mi])?!!e:"RegExp"==h(t))}(t))throw TypeError("The method doesn't accept regular expressions");return t},_i=Dt("match");W({target:"String",proto:!0,forced:!function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[_i]=!1,"/./"[t](e)}catch(t){}}return!1}("includes")},{includes:function(t){return!!~String(b(this)).indexOf(Ti(t),arguments.length>1?arguments[1]:void 0)}});var Si=Z("String").includes,Ii=Array.prototype,Oi=String.prototype,Pi=function(t){var e=t.includes;return t===Ii||t instanceof Array&&e===Ii.includes?gi:"string"==typeof t||t===Oi||t instanceof String&&e===Oi.includes?Si:e},wi=pi.throwMissingParam,Ci=function(t,e){void 0===e&&(e={options:{}});var n=t.call(this,e.options),r=n.optionsManager,o=n.helper,i=n.activedTabsHistory;o.setNoneEnumProps(this,{optionsManager:r,helper:o,activedTabsHistory:i,userProxy:{}}),this._setUserProxy()._subscribeOnReadyEvent()._createReadyFunction()._subscribeSelectedTabsHistory()._subscribeCallbacksOptions()},Di={_setUserProxy:function(){var t=this,e={},n=this;for(var r in this)"_"!==r[0]&&"constructor"!==r&&function(){var o=t[r];e[r]="function"==typeof o?function(){var t=o.apply(n,arguments);return t===n?e:t}:o}();return this.userProxy=e,this},_subscribeOnReadyEvent:function(){var t=this;return this.one("_onReady",(function(){t._isReady=!0})),this},_createReadyFunction:function(){var t=this,e=function(e){!0===t._isReady?e.call(t.userProxy,t.userProxy):t.one("_onReady",(function(){e.call(t.userProxy,t.userProxy)}))};return e=et(e).call(e,this),yi(e,this.userProxy),this.helper.setNoneEnumProps(this,{ready:e}),this},_subscribeSelectedTabsHistory:function(){var t=this;return this.on("onChange",(function(e){for(var n=e.currentData,r=e.previousData,o=e.closedTabIDs,i=0,a=o.length;i<a;i++)t.activedTabsHistory.remove(o[i]);r.selectedTabID!==n.selectedTabID&&t.isOpen(r.selectedTabID)&&!t.isSelected(r.selectedTabID)&&t.activedTabsHistory.add(r.selectedTabID)})),this},_subscribeCallbacksOptions:function(){var t,e=this,n=this.optionsManager.options;return Ht(t=Jo(this._publishers)).call(t,(function(t){"_"!==t[0]&&e.on(t,(function(){n[t].apply(this,arguments)}))})),this},getOption:function(t){return this.optionsManager.getOption(t)},setOption:function(t,e){return this.optionsManager.setOption(t,e),this},getPreviousData:function(){return this.helper.getCopyState(this.previousState)},getCopyPerviousData:function(){return this.getPreviousData()},getData:function(){return this.helper.getCopyState(this.stateRef)},getCopyData:function(){return this.getData()},isSelected:function(t){return void 0===t&&(t=wi("isSelected")),this.stateRef.selectedTabID==t},isOpen:function(t){var e;return void 0===t&&(t=wi("isOpen")),Se(e=this.stateRef.openTabIDs).call(e,t)>=0},_getFlushEffectsPromise:function(){var t=this;return new Uo((function(e){t.one("_onFlushEffects",(function(){e.apply(this,arguments)}))}))},select:function(t){void 0===t&&(t=wi("select")),t&&(t+="");var e=this._getFlushEffectsPromise();return this._select(t),e},_getPreSelectedTabId:function(){for(var t=this.activedTabsHistory,e="";!e&&t.tabsId.length;){var n=t.popLastTabID();if(n){var r=this.getTab(n);r&&!r.disable&&this.isOpen(n)&&!this.isSelected(n)&&(e=n)}}return e},_getPreSiblingTabId:function(){var t=this,e=this.stateRef,n=e.selectedTabID,r=e.openTabIDs,o=xe(r).call(r,0,Se(r).call(r,n));return this.helper.filterArrayUntilFirstValue(o,(function(e){return!t.getTab(e).disable}),!0)},_getNextSiblingTabId:function(){var t=this,e=this.stateRef,n=e.selectedTabID,r=e.openTabIDs,o=xe(r).call(r,Se(r).call(r,n)+1);return this.helper.filterArrayUntilFirstValue(o,(function(e){return!t.getTab(e).disable}),!1)},_findTabIdForSwitching:function(){return this._getPreSelectedTabId()||this._getPreSiblingTabId()||this._getNextSiblingTabId()||""},setTab:function(t,e){return void 0===e&&(e={}),this.optionsManager.validateObjectiveTabData(e).validatePanelComponent(e),this._setTab(t,e),this},open:function(t){void 0===t&&(t=wi("open"));var e=this.optionsManager.validateTabData(t),n=this._getFlushEffectsPromise();return this._addTab(e),this._open(e.id),n},__close:function(t){var e=this._getFlushEffectsPromise();return this._close(t),this._removeTab(t),e},close:function(t,e){if(void 0===t&&(t=wi("close")),void 0===e&&(e=!0),t&&(t+=""),e&&this.isOpen(t)&&this.isSelected(t)){var n,r=Ko(n=[]).call(n,this.stateRef.openTabIDs);return Ue(r).call(r,Se(r).call(r,t),1),this.select(this._findTabIdForSwitching()),this.__close(t)}return this.__close(t)},refresh:function(){var t=this._getFlushEffectsPromise();return this._refresh(),t}};pi.setNoneEnumProps(Di,{onChange:function(t){var e,n=t.newState,r=t.oldState,o=t.closedTabIDs,i=t.openedTabIDs,a=t.isSwitched;(a||i.length||o.length)&&(this.trigger("onChange",this.userProxy,{currentData:ae({},n),previousData:ae({},r),perviousData:ae({},r),closedTabIDs:o,openedTabIDs:i}),i.length&&this.trigger("onOpen",this.userProxy,i),o.length&&this.trigger("onClose",this.userProxy,o),a&&(-1===Se(e=this.activedTabsHistory.tabsId).call(e,n.selectedTabID)&&this.trigger("onFirstSelect",this.userProxy,{currentSelectedTabId:n.selectedTabID,previousSelectedTabId:r.selectedTabID}),this.trigger("onSelect",this.userProxy,{currentSelectedTabId:n.selectedTabID,previousSelectedTabId:r.selectedTabID,perviousSelectedTabId:r.selectedTabID})));return this},eventHandlerFactory:function(t){var e,n,r=t.e,o=t.id,i=r.target,a=i.parentElement,s=this.optionsManager.setting,c=s.closeClass,u=s.tabClass;Pi(e=i.className).call(e,c)&&a&&a.lastChild&&a.lastChild==i&&Pi(n=a.className).call(n,u)?!1!==this.getOption("beforeClose").call(this.userProxy,r,o)&&this.close(o,!0):!1!==this.getOption("beforeSelect").call(this.userProxy,r,o)&&this.select(o)}});var ji=Di,xi=pi.throwMissingParam;function Ei(t,e){var n=e.options,r=t().globalDefaultOptions;this._defaultOptions=r,this._validateOptions(n),this.options=yi({},this._defaultOptions,n),this.setting={},this.initialState={},this.initialTabs=[],this._setSetting()._setInitialData()}Ei.prototype.getOption=function(t){if("tabs"===t){for(var e=[],n=0,r=this.options.tabs,o=r.length;n<o;n++)e.push(ae({},r[n]));return e}return this.options[t]},Ei.prototype.setOption=function(t,e){var n;return void 0===t&&(t=xi("setOption")),void 0===e&&(e=xi("setOption")),Se(n=["SELECTEDTABID","TABS"]).call(n,t.toUpperCase())>=0||Object.prototype.hasOwnProperty.call(this._defaultOptions,t)&&(this.options[t]=e),this},Ei.prototype.validatePanelComponent=function(t){if(t.panelComponent&&"function"!=typeof t.panelComponent&&n.default.isValidElement(t.panelComponent)){var e=t.panelComponent;t.panelComponent=function(){return e}}return this},Ei.prototype.validateObjectiveTabData=function(t){if("[object Object]"!==Object.prototype.toString.call(t))throw new Error("tabData must be type of Object");return this},Ei.prototype.validateTabData=function(t){return this.validateObjectiveTabData(t).validatePanelComponent(t),(t=yi(this.setting.getDefaultTabData(),t)).id=t.id+"",t},Ei.prototype._validateOptions=function(t){if("[object Object]"!==Object.prototype.toString.call(t))throw'Invalid argument in "useDynamicTabs" function. Argument must be type of an object';return this},Ei.prototype._setInitialData=function(){var t=this,e=this.options,n=e.selectedTabID,r=e.tabs,o=[];return Ht(r).call(r,(function(e){var n=t.validateTabData(e);t.initialTabs.push(n),o.push(n.id)})),this.initialState={selectedTabID:n+"",openTabIDs:o},this},Ei.prototype._setSetting=function(){var t=this;return this.setting={tabClass:"rc-dyn-tabs-tab",titleClass:"rc-dyn-tabs-title",iconClass:"rc-dyn-tabs-icon",selectedClass:"rc-dyn-tabs-selected",hoverClass:"rc-dyn-tabs-hover",tablistClass:"rc-dyn-tabs-tablist",closeClass:"rc-dyn-tabs-close",panelClass:"rc-dyn-tabs-panel",panellistClass:"rc-dyn-tabs-panellist",disableClass:"rc-dyn-tabs-disable",ltrClass:"rc-dyn-tabs-ltr",rtlClass:"rc-dyn-tabs-rtl",verticalClass:"rc-dyn-tabs-vertical",panelIdTemplate:function(t){return"rc-dyn-tabs-p-"+t},ariaLabelledbyIdTemplate:function(t){return"rc-dyn-tabs-l-"+t},getDefaultTabData:function(){return{title:"",tooltip:"",panelComponent:t.options.defaultPanelComponent,closable:!0,iconClass:"",disable:!1,id:"tab_"+(new Date).getTime()}}},this};var Ai=function(t){return n.default.createElement("button",t.tabProps,t.children,Object.prototype.hasOwnProperty.call(t,"iconProps")&&n.default.createElement("span",t.iconProps))},Li=function(t){void 0===t&&(t=null),this.defaultDirection="ltr",this._DefaulTabInnerComponent=t,this.directionsRange=["ltr","rtl"]};Li.prototype.getOptions=function(){return this._getOptions()},Li.prototype._getOptions=function(){var t={tabs:[],selectedTabID:"",beforeSelect:function(){return!0},beforeClose:function(){return!0},onOpen:function(){},onClose:function(){},onFirstSelect:function(){},onSelect:function(){},onChange:function(){},onLoad:function(){},onDestroy:function(){},onInit:function(){},accessibility:!0,isVertical:!1,defaultPanelComponent:function(){return n.default.createElement("div",null)}},e=this.defaultDirection,r=this._DefaulTabInnerComponent,o=this;return ai(t,{direction:{get:function(){return e},set:function(t){var n;if(-1===Se(n=o.directionsRange).call(n,t))throw'Invalid direction value! it can be eather of "ltr" or "rtl" ';e=t},enumerable:!0},tabComponent:{get:function(){return r},set:function(t){if(t&&"function"!=typeof t)throw"tabComponent property must be type of a function.";r=t||o._DefaulTabInnerComponent},enumerable:!0}}),t};var Mi=et(Ei).call(Ei,null,(function(){return{globalDefaultOptions:new Li(Ai).getOptions()}})),Fi=function(){this.tabsId=[]};Fi.prototype.popLastTabID=function(){return this.tabsId.pop()},Fi.prototype.reset=function(){this.tabsId=[]},Fi.prototype.add=function(t){this.tabsId.push(t)},Fi.prototype.remove=function(t){for(var e=this.tabsId;Se(e).call(e,t)>=0;)Ue(e).call(e,Se(e).call(e,t),1);return this};var Ri=function(){this._publishers={onChange:[],onLoad:[],onDestroy:[],onOpen:[],onClose:[],onSelect:[],onInit:[],_onFlushEffects:[],_onReady:[],onFirstSelect:[]}};Ri.prototype.off=function(t,e){if("function"==typeof e&&Object.prototype.hasOwnProperty.call(this._publishers,t)){var n,r,o=Se(n=this._publishers[t]).call(n,e);o>=0&&Ue(r=this._publishers[t]).call(r,o,1)}return this},Ri.prototype.on=function(t,e){var n;"function"==typeof e&&Object.prototype.hasOwnProperty.call(this._publishers,t)&&(-1===Se(n=this._publishers[t]).call(n,e)&&this._publishers[t].push(e));return this},Ri.prototype.one=function(t,e){if("function"==typeof e&&Object.prototype.hasOwnProperty.call(this._publishers,t)){return this.on(t,(function n(){e.apply(this,arguments),this.off(t,n)}))}return this},pi.setNoneEnumProps(Ri.prototype,{trigger:function(t,e){for(var n,r=arguments.length,o=new Array(r>2?r-2:0),i=2;i<r;i++)o[i-2]=arguments[i];e=e||null;var a=[],s=Ko(n=[]).call(n,this._publishers[t]);return Ht(s).call(s,(function(t){a.push(t.apply(e,o))})),a}});var Ni=Lt.findIndex,ki="findIndex",Ui=!0;ki in[]&&Array(1).findIndex((function(){Ui=!1})),W({target:"Array",proto:!0,forced:Ui},{findIndex:function(t){return Ni(this,t,arguments.length>1?arguments[1]:void 0)}});var Hi=Z("Array").findIndex,Vi=Array.prototype,Gi=function(t){var e=t.findIndex;return t===Vi||t instanceof Array&&e===Vi.findIndex?Hi:e},Bi=Lt.find,qi="find",Wi=!0;qi in[]&&Array(1).find((function(){Wi=!1})),W({target:"Array",proto:!0,forced:Wi},{find:function(t){return Bi(this,t,arguments.length>1?arguments[1]:void 0)}});var zi=Z("Array").find,Yi=Array.prototype,Ki=function(t){var e=t.find;return t===Yi||t instanceof Array&&e===Yi.find?zi:e};function Xi(t){var e=this,n=(void 0===t?{initialTabs:[]}:t).initialTabs;this._data=[],n&&n.constructor===Array&&n.length&&Ht(n).call(n,(function(t){e._addTab(t)}))}function Ji(t){var e=t.helper,n=t.initialState;this._helper=e,this._state=this._helper.getCopyState(n),this._dispatch=null,this._setFlushState=null,this._isReady=!1,e.setNoneEnumProps(this,{forceUpdateState:{},previousState:this._helper.getCopyState(n),stateRef:{}})}Xi.prototype._addTab=function(t){return this._data.push(t),this},Xi.prototype._removeTab=function(t){var e,n,r=Gi(e=this._data).call(e,(function(e){return e.id===t}));return r>=0&&Ue(n=this._data).call(n,r,1),this},Xi.prototype.getTab=function(t){var e;return Ki(e=this._data).call(e,(function(e){return e.id===t}))},Xi.prototype._setTab=function(t,e){var n,r=Gi(n=this._data).call(n,(function(e){return e.id==t}));if(r>=0){var o=this._data[r];e.id=o.id,yi(this._data[r],e)}return this},Ji.prototype._select=function(t){this._dispatch({type:Ge,tabId:t}),this.__flushEffects()},Ji.prototype._close=function(t){this._dispatch({type:Ve,tabId:t}),this.__flushEffects()},Ji.prototype._open=function(t){this._dispatch({type:He,tabId:t}),this.__flushEffects()},Ji.prototype._refresh=function(){this.forceUpdateState={},this._dispatch({type:Be}),this.__flushEffects()},Ji.prototype.__flushEffects=function(){this._setFlushState({})},pi.setNoneEnumProps(Ji.prototype,{updateStateRef:function(t,e){return this.stateRef=t,this._dispatch=e,this},updateState:function(t){return this.previousState=this._helper.getCopyState(this._state),this._state=this._helper.getCopyState(t),this},updateFlushState:function(t){return this._setFlushState=t,this}});Ci.prototype=vi(Ji.prototype),pi.assingAll(Ci.prototype,Xi.prototype,Ri.prototype,ji).constructor=Ci;var Qi=et(Ci).call(Ci,null,(function(t){void 0===t&&(t={});var e=new Fi,n=new Mi({options:t});return Ji.call(this,{helper:pi,initialState:n.initialState}),Xi.call(this,{initialTabs:n.initialTabs}),Ri.call(this),{activedTabsHistory:e,helper:pi,optionsManager:n}}));function Zi(e,r){void 0===r&&(r={});var o=e(),i=o.reducer,a=o.getApiInstance,s=o.PanelList,c=o.TabList,u=o.ApiContext,l=o.StateContext,f=o.ForceUpdateContext,p=t.useRef(null);null===p.current&&(p.current={api:a(r),TabListComponent:null,PanelListComponent:null});var d=p.current.api,h=p.current,v=t.useReducer(i,d.optionsManager.initialState),y=v[0],b=v[1],g=t.useState({}),m=g[0],T=g[1];return d.updateStateRef(y,b).updateFlushState(T),t.useLayoutEffect((function(){d.updateState(y)}),[y]),t.useLayoutEffect((function(){return d.trigger("onLoad",d.userProxy),function(){d.trigger("onDestroy",d.userProxy)}}),[]),t.useLayoutEffect((function(){d.trigger("onInit",d.userProxy)})),t.useLayoutEffect((function(){d.trigger("_onReady",d.userProxy)}),[]),t.useLayoutEffect((function(){var t=d.previousState,e=d.helper.getArraysDiff(y.openTabIDs,t.openTabIDs),n=e[0],r=e[1],o=t.selectedTabID!==y.selectedTabID;d.onChange({newState:y,oldState:t,closedTabIDs:r,openedTabIDs:n,isSwitched:o})}),[y]),t.useLayoutEffect((function(){d.trigger("_onFlushEffects",d.userProxy,{currentData:d.getData(),instance:d.userProxy})}),[m]),h.TabListComponent||(h.TabListComponent=function(t){return void 0===t&&(t={}),n.default.createElement(u.Provider,{value:d},n.default.createElement(l.Provider,{value:d.stateRef},n.default.createElement(f.Provider,{value:d.forceUpdateState},n.default.createElement(c,t,"props.children"))))}),h.PanelListCompoent||(h.PanelListCompoent=function(t){return n.default.createElement(u.Provider,{value:d},n.default.createElement(l.Provider,{value:d.stateRef},n.default.createElement(f.Provider,{value:d.forceUpdateState},n.default.createElement(s,t,"props.children"))))}),[h.TabListComponent,h.PanelListCompoent,d.ready]}return et(Zi).call(Zi,null,(function(){return{reducer:di,getApiInstance:function(t){return new Qi({options:t})},PanelList:ve,TabList:le,ApiContext:Vt,StateContext:Gt,ForceUpdateContext:Bt}}))}));
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("react"),require("prop-types")):"function"==typeof define&&define.amd?define(["react","prop-types"],e):(t="undefined"!=typeof globalThis?globalThis:t||self).useDynTabs=e(t.React)}(this,(function(t){"use strict";function e(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var n=e(t),r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function o(t){var e={exports:{}};return t(e,e.exports),e.exports}var i=function(t){return t&&t.Math==Math&&t},a=i("object"==typeof globalThis&&globalThis)||i("object"==typeof window&&window)||i("object"==typeof self&&self)||i("object"==typeof r&&r)||function(){return this}()||Function("return this")(),s=function(t){try{return!!t()}catch(t){return!0}},c=!s((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),u={}.propertyIsEnumerable,l=Object.getOwnPropertyDescriptor,f={f:l&&!u.call({1:2},1)?function(t){var e=l(this,t);return!!e&&e.enumerable}:u},p=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},d={}.toString,h=function(t){return d.call(t).slice(8,-1)},v="".split,y=s((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==h(t)?v.call(t,""):Object(t)}:Object,b=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},g=function(t){return y(b(t))},m=function(t){return"object"==typeof t?null!==t:"function"==typeof t},T=function(t,e){if(!m(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!m(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!m(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!m(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")},_={}.hasOwnProperty,S=function(t,e){return _.call(t,e)},I=a.document,O=m(I)&&m(I.createElement),P=function(t){return O?I.createElement(t):{}},w=!c&&!s((function(){return 7!=Object.defineProperty(P("div"),"a",{get:function(){return 7}}).a})),C=Object.getOwnPropertyDescriptor,D={f:c?C:function(t,e){if(t=g(t),e=T(e,!0),w)try{return C(t,e)}catch(t){}if(S(t,e))return p(!f.f.call(t,e),t[e])}},j=/#|\.prototype\./,x=function(t,e){var n=A[E(t)];return n==M||n!=L&&("function"==typeof e?s(e):!!e)},E=x.normalize=function(t){return String(t).replace(j,".").toLowerCase()},A=x.data={},L=x.NATIVE="N",M=x.POLYFILL="P",F=x,R={},N=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t},k=function(t,e,n){if(N(t),void 0===e)return t;switch(n){case 0:return function(){return t.call(e)};case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}},U=function(t){if(!m(t))throw TypeError(String(t)+" is not an object");return t},H=Object.defineProperty,V={f:c?H:function(t,e,n){if(U(t),e=T(e,!0),U(n),w)try{return H(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},G=c?function(t,e,n){return V.f(t,e,p(1,n))}:function(t,e,n){return t[e]=n,t},z=D.f,B=function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e.prototype=t.prototype,e},q=function(t,e){var n,r,o,i,s,c,u,l,f=t.target,p=t.global,d=t.stat,h=t.proto,v=p?a:d?a[f]:(a[f]||{}).prototype,y=p?R:R[f]||(R[f]={}),b=y.prototype;for(o in e)n=!F(p?o:f+(d?".":"#")+o,t.forced)&&v&&S(v,o),s=y[o],n&&(c=t.noTargetGet?(l=z(v,o))&&l.value:v[o]),i=n&&c?c:e[o],n&&typeof s==typeof i||(u=t.bind&&n?k(i,a):t.wrap&&n?B(i):h&&"function"==typeof i?k(Function.call,i):i,(t.sham||i&&i.sham||s&&s.sham)&&G(u,"sham",!0),y[o]=u,h&&(S(R,r=f+"Prototype")||G(R,r,{}),R[r][o]=i,t.real&&b&&!b[o]&&G(b,o,i)))},W=[].slice,Y={},K=function(t,e,n){if(!(e in Y)){for(var r=[],o=0;o<e;o++)r[o]="a["+o+"]";Y[e]=Function("C,a","return new C("+r.join(",")+")")}return Y[e](t,n)},X=Function.bind||function(t){var e=N(this),n=W.call(arguments,1),r=function(){var o=n.concat(W.call(arguments));return this instanceof r?K(e,o.length,o):e.apply(t,o)};return m(e.prototype)&&(r.prototype=e.prototype),r};q({target:"Function",proto:!0},{bind:X});var J,Q,Z=function(t){return R[t+"Prototype"]},$=Z("Function").bind,tt=Function.prototype,et=function(t){var e=t.bind;return t===tt||t instanceof Function&&e===tt.bind?$:e},nt=function(t){return Object(b(t))},rt=Math.ceil,ot=Math.floor,it=function(t){return isNaN(t=+t)?0:(t>0?ot:rt)(t)},at=Math.min,st=function(t){return t>0?at(it(t),9007199254740991):0},ct=Array.isArray||function(t){return"Array"==h(t)},ut="__core-js_shared__",lt=a[ut]||function(t,e){try{G(a,t,e)}catch(n){a[t]=e}return e}(ut,{}),ft=o((function(t){(t.exports=function(t,e){return lt[t]||(lt[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.10.0",mode:"pure",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})})),pt=0,dt=Math.random(),ht=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++pt+dt).toString(36)},vt="process"==h(a.process),yt=function(t){return"function"==typeof t?t:void 0},bt=function(t,e){return arguments.length<2?yt(R[t])||yt(a[t]):R[t]&&R[t][e]||a[t]&&a[t][e]},gt=bt("navigator","userAgent")||"",mt=a.process,Tt=mt&&mt.versions,_t=Tt&&Tt.v8;_t?Q=(J=_t.split("."))[0]+J[1]:gt&&(!(J=gt.match(/Edge\/(\d+)/))||J[1]>=74)&&(J=gt.match(/Chrome\/(\d+)/))&&(Q=J[1]);var St=Q&&+Q,It=!!Object.getOwnPropertySymbols&&!s((function(){return!Symbol.sham&&(vt?38===St:St>37&&St<41)})),Ot=It&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Pt=ft("wks"),wt=a.Symbol,Ct=Ot?wt:wt&&wt.withoutSetter||ht,Dt=function(t){return S(Pt,t)&&(It||"string"==typeof Pt[t])||(It&&S(wt,t)?Pt[t]=wt[t]:Pt[t]=Ct("Symbol."+t)),Pt[t]},jt=Dt("species"),xt=function(t,e){var n;return ct(t)&&("function"!=typeof(n=t.constructor)||n!==Array&&!ct(n.prototype)?m(n)&&null===(n=n[jt])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===e?0:e)},Et=[].push,At=function(t){var e=1==t,n=2==t,r=3==t,o=4==t,i=6==t,a=7==t,s=5==t||i;return function(c,u,l,f){for(var p,d,h=nt(c),v=y(h),b=k(u,l,3),g=st(v.length),m=0,T=f||xt,_=e?T(c,g):n||a?T(c,0):void 0;g>m;m++)if((s||m in v)&&(d=b(p=v[m],m,h),t))if(e)_[m]=d;else if(d)switch(t){case 3:return!0;case 5:return p;case 6:return m;case 2:Et.call(_,p)}else switch(t){case 4:return!1;case 7:Et.call(_,p)}return i?-1:r||o?o:_}},Lt={forEach:At(0),map:At(1),filter:At(2),some:At(3),every:At(4),find:At(5),findIndex:At(6),filterOut:At(7)},Mt=Dt("species"),Ft=function(t){return St>=51||!s((function(){var e=[];return(e.constructor={})[Mt]=function(){return{foo:1}},1!==e[t](Boolean).foo}))},Rt=Lt.map,Nt=Ft("map");q({target:"Array",proto:!0,forced:!Nt},{map:function(t){return Rt(this,t,arguments.length>1?arguments[1]:void 0)}});var kt=Z("Array").map,Ut=Array.prototype,Ht=function(t){var e=t.map;return t===Ut||t instanceof Array&&e===Ut.map?kt:e},Vt=t.createContext({}),Gt=t.createContext({}),zt=t.createContext({}),Bt=Math.max,qt=Math.min,Wt=function(t,e){var n=it(t);return n<0?Bt(n+e,0):qt(n,e)},Yt=function(t){return function(e,n,r){var o,i=g(e),a=st(i.length),s=Wt(r,a);if(t&&n!=n){for(;a>s;)if((o=i[s++])!=o)return!0}else for(;a>s;s++)if((t||s in i)&&i[s]===n)return t||s||0;return!t&&-1}},Kt={includes:Yt(!0),indexOf:Yt(!1)},Xt={},Jt=Kt.indexOf,Qt=function(t,e){var n,r=g(t),o=0,i=[];for(n in r)!S(Xt,n)&&S(r,n)&&i.push(n);for(;e.length>o;)S(r,n=e[o++])&&(~Jt(i,n)||i.push(n));return i},Zt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],$t=Object.keys||function(t){return Qt(t,Zt)},te={f:Object.getOwnPropertySymbols},ee=Object.assign,ne=Object.defineProperty,re=!ee||s((function(){if(c&&1!==ee({b:1},ee(ne({},"a",{enumerable:!0,get:function(){ne(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach((function(t){e[t]=t})),7!=ee({},t)[n]||$t(ee({},e)).join("")!=r}))?function(t,e){for(var n=nt(t),r=arguments.length,o=1,i=te.f,a=f.f;r>o;)for(var s,u=y(arguments[o++]),l=i?$t(u).concat(i(u)):$t(u),p=l.length,d=0;p>d;)s=l[d++],c&&!a.call(u,s)||(n[s]=u[s]);return n}:ee;q({target:"Object",stat:!0,forced:Object.assign!==re},{assign:re});var oe=R.Object.assign,ie=oe;function ae(){return(ae=ie||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}var se=function(t){var e=t.api,n=t.id,r=t.isSelected;this._api=e,this._id=n,this._isSelected=r,this._op=e.optionsManager.options,this._setting=e.optionsManager.setting,this._tabObj=e.getTab(n)};se.prototype.getTabProps=function(){var t={"tab-id":this._id,className:this._setting.tabClass,tabIndex:-1};return this._isSelected&&(t.tabIndex=0,t.className+=" "+this._setting.selectedClass),this._tabObj.disable&&(t.tabIndex=-1,t.className+=" "+this._setting.disableClass),this._op.accessibility&&(t.role="tab",t["aria-controls"]=this._setting.panelIdTemplate(this._id),t["aria-labelledby"]=this._setting.ariaLabelledbyIdTemplate(this._id),t["aria-selected"]=t["aria-expanded"]=this._isSelected),t},se.prototype.getTabInnerProps=function(){var t={id:this._id,isSelected:this._isSelected,api:this._api.userProxy,tabProps:{"tab-id":this._id,className:this._setting.titleClass,title:this._tabObj.tooltip,tabIndex:-1}};return this._tabObj.iconClass&&(t.iconProps={className:this._setting.iconClass+" "+this._tabObj.iconClass,role:"presentation"}),this._op.accessibility&&(t.tabProps.id=this._setting.ariaLabelledbyIdTemplate(this._id),t.tabProps.role="presentation"),t},se.prototype.getCloseIconProps=function(){var t={className:this._setting.closeClass};return this._op.accessibility&&(t.role="presentation"),t};var ce=function(t){n.default.useContext(zt);var e=t.id,r=t.selectedTabID,o=n.default.useContext(Vt),i=o.getOption("tabComponent"),a=o.getTab(e),s=new se({api:o,id:e,isSelected:r===e});return n.default.createElement("li",ae({},s.getTabProps(),{onClick:function(t){!function(t){o.eventHandlerFactory({e:t,id:e})}(t)}}),n.default.createElement(i,s.getTabInnerProps(),a.title),a.closable?n.default.createElement("span",s.getCloseIconProps(),"×"):null)},ue=t.memo(ce,(function(t,e){var n=t.id,r=t.selectedTabID,o=e.selectedTabID;return r===o||n!==r&&n!==o}));var le,fe,pe=t.memo((function(){var t=n.default.useContext(Gt),e=t.openTabIDs,r=t.selectedTabID,o=function(t){var e=t.api,n=e.optionsManager.setting,r=e.optionsManager.options,o={className:n.tablistClass+" "+n[r.direction+"Class"]};return r.isVertical&&(o.className+=" "+n.verticalClass),r.accessibility&&(o.role="tablist"),o}({api:n.default.useContext(Vt)});return n.default.createElement("ul",o,Ht(e).call(e,(function(t){return n.default.createElement(ue,{key:t,id:t,selectedTabID:r})})))}),(function(){return!0})),de=Kt.indexOf,he=[].indexOf,ve=!!he&&1/[1].indexOf(1,-0)<0,ye=!!(fe=[]["indexOf"])&&s((function(){fe.call(null,le||function(){throw 1},1)}));q({target:"Array",proto:!0,forced:ve||!ye},{indexOf:function(t){return ve?he.apply(this,arguments)||0:de(this,t,arguments.length>1?arguments[1]:void 0)}});var be=Z("Array").indexOf,ge=Array.prototype,me=function(t){var e=t.indexOf;return t===ge||t instanceof Array&&e===ge.indexOf?be:e};var Te=function(t){var e;n.default.useContext(zt);var r=t.id,o=t.selectedTabID,i=n.default.useContext(Vt),a=r===o,s=function(t){var e=t.isSelected,n=t.api,r=t.id,o=n.optionsManager.options,i=n.optionsManager.setting,a={"tab-id":r,className:i.panelClass};return e&&(a.className+=" "+i.selectedClass),o.accessibility&&(a.role="tabpanel",a.id=i.panelIdTemplate(r),a["aria-hidden"]=!e,a["aria-labelledby"]=i.ariaLabelledbyIdTemplate(r)),a}({isSelected:a,api:i,id:r}),c=i.state.selectedTabID,u=i.getTab(r),l=u.panelComponent,f=!1;return(!u.lazy||a||c===r||me(e=i.activedTabsHistory.tabsId).call(e,r)>=0)&&(f=!0),n.default.createElement("div",s,f&&l?n.default.createElement(l,{id:r,isSelected:a,api:i.userProxy}):null)},_e=t.memo(Te,(function(t,e){var n=t.id,r=t.selectedTabID,o=e.selectedTabID;return r===o||n!==r&&n!==o})),Se=t.memo((function(){var t=n.default.useContext(Gt),e=t.openTabIDs,r=t.selectedTabID,o=n.default.useContext(Vt),i=o.optionsManager.setting,a=o.optionsManager.options,s=i.panellistClass+" "+i[a.direction+"Class"];return a.isVertical&&(s+=" "+i.verticalClass),n.default.createElement("div",{className:s},Ht(e).call(e,(function(t){return n.default.createElement(_e,{key:t,id:t,selectedTabID:r})})))}),(function(){return!0})),Ie=function(t,e,n){var r=T(e);r in t?V.f(t,r,p(0,n)):t[r]=n},Oe=Ft("slice"),Pe=Dt("species"),we=[].slice,Ce=Math.max;q({target:"Array",proto:!0,forced:!Oe},{slice:function(t,e){var n,r,o,i=g(this),a=st(i.length),s=Wt(t,a),c=Wt(void 0===e?a:e,a);if(ct(i)&&("function"!=typeof(n=i.constructor)||n!==Array&&!ct(n.prototype)?m(n)&&null===(n=n[Pe])&&(n=void 0):n=void 0,n===Array||void 0===n))return we.call(i,s,c);for(r=new(void 0===n?Array:n)(Ce(c-s,0)),o=0;s<c;s++,o++)s in i&&Ie(r,o,i[s]);return r.length=o,r}});var De=Z("Array").slice,je=Array.prototype,xe=function(t){var e=t.slice;return t===je||t instanceof Array&&e===je.slice?De:e},Ee=Ft("splice"),Ae=Math.max,Le=Math.min,Me=9007199254740991,Fe="Maximum allowed length exceeded";q({target:"Array",proto:!0,forced:!Ee},{splice:function(t,e){var n,r,o,i,a,s,c=nt(this),u=st(c.length),l=Wt(t,u),f=arguments.length;if(0===f?n=r=0:1===f?(n=0,r=u-l):(n=f-2,r=Le(Ae(it(e),0),u-l)),u+n-r>Me)throw TypeError(Fe);for(o=xt(c,r),i=0;i<r;i++)(a=l+i)in c&&Ie(o,i,c[a]);if(o.length=r,n<r){for(i=l;i<u-r;i++)s=i+n,(a=i+r)in c?c[s]=c[a]:delete c[s];for(i=u;i>u-r+n;i--)delete c[i-1]}else if(n>r)for(i=u-r;i>l;i--)s=i+n-1,(a=i+r-1)in c?c[s]=c[a]:delete c[s];for(i=0;i<n;i++)c[i+l]=arguments[i+2];return c.length=u-r+n,o}});var Re,Ne=Z("Array").splice,ke=Array.prototype,Ue=function(t){var e=t.splice;return t===ke||t instanceof Array&&e===ke.splice?Ne:e},He="open",Ve="close",Ge="active",ze="refresh",Be=ft("keys"),qe=function(t){return Be[t]||(Be[t]=ht(t))},We=!s((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),Ye=qe("IE_PROTO"),Ke=Object.prototype,Xe=We?Object.getPrototypeOf:function(t){return t=nt(t),S(t,Ye)?t[Ye]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?Ke:null},Je=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),e=n instanceof Array}catch(t){}return function(n,r){return U(n),function(t){if(!m(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype")}(r),e?t.call(n,r):n.__proto__=r,n}}():void 0),Qe=c?Object.defineProperties:function(t,e){U(t);for(var n,r=$t(e),o=r.length,i=0;o>i;)V.f(t,n=r[i++],e[n]);return t},Ze=bt("document","documentElement"),$e=qe("IE_PROTO"),tn=function(){},en=function(t){return"<script>"+t+"</"+"script>"},nn=function(){try{Re=document.domain&&new ActiveXObject("htmlfile")}catch(t){}var t,e;nn=Re?function(t){t.write(en("")),t.close();var e=t.parentWindow.Object;return t=null,e}(Re):((e=P("iframe")).style.display="none",Ze.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(en("document.F=Object")),t.close(),t.F);for(var n=Zt.length;n--;)delete nn.prototype[Zt[n]];return nn()};Xt[$e]=!0;var rn=Object.create||function(t,e){var n;return null!==t?(tn.prototype=U(t),n=new tn,tn.prototype=null,n[$e]=t):n=nn(),void 0===e?n:Qe(n,e)},on={},an=Dt("iterator"),sn=Array.prototype,cn={};cn[Dt("toStringTag")]="z";var un="[object z]"===String(cn),ln=Dt("toStringTag"),fn="Arguments"==h(function(){return arguments}()),pn=un?h:function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),ln))?n:fn?h(e):"Object"==(r=h(e))&&"function"==typeof e.callee?"Arguments":r},dn=Dt("iterator"),hn=function(t){var e=t.return;if(void 0!==e)return U(e.call(t)).value},vn=function(t,e){this.stopped=t,this.result=e},yn=function(t,e,n){var r,o,i,a,s,c,u,l,f=n&&n.that,p=!(!n||!n.AS_ENTRIES),d=!(!n||!n.IS_ITERATOR),h=!(!n||!n.INTERRUPTED),v=k(e,f,1+p+h),y=function(t){return r&&hn(r),new vn(!0,t)},b=function(t){return p?(U(t),h?v(t[0],t[1],y):v(t[0],t[1])):h?v(t,y):v(t)};if(d)r=t;else{if("function"!=typeof(o=function(t){if(null!=t)return t[dn]||t["@@iterator"]||on[pn(t)]}(t)))throw TypeError("Target is not iterable");if(void 0!==(l=o)&&(on.Array===l||sn[an]===l)){for(i=0,a=st(t.length);a>i;i++)if((s=b(t[i]))&&s instanceof vn)return s;return new vn(!1)}r=o.call(t)}for(c=r.next;!(u=c.call(r)).done;){try{s=b(u.value)}catch(t){throw hn(r),t}if("object"==typeof s&&s&&s instanceof vn)return s}return new vn(!1)},bn=function(t,e){var n=this;if(!(n instanceof bn))return new bn(t,e);Je&&(n=Je(new Error(void 0),Xe(n))),void 0!==e&&G(n,"message",String(e));var r=[];return yn(t,r.push,{that:r}),G(n,"errors",r),n};bn.prototype=rn(Error.prototype,{constructor:p(5,bn),message:p(5,""),name:p(5,"AggregateError")}),q({global:!0},{AggregateError:bn});var gn=a.Promise,mn=function(t,e,n,r){r&&r.enumerable?t[e]=n:G(t,e,n)},Tn=un?{}.toString:function(){return"[object "+pn(this)+"]"},_n=V.f,Sn=Dt("toStringTag"),In=function(t,e,n,r){if(t){var o=n?t:t.prototype;S(o,Sn)||_n(o,Sn,{configurable:!0,value:e}),r&&!un&&G(o,"toString",Tn)}},On=Dt("species"),Pn=Function.toString;"function"!=typeof lt.inspectSource&&(lt.inspectSource=function(t){return Pn.call(t)});var wn=lt.inspectSource,Cn=Dt("iterator"),Dn=!1;try{var jn=0,xn={next:function(){return{done:!!jn++}},return:function(){Dn=!0}};xn[Cn]=function(){return this},Array.from(xn,(function(){throw 2}))}catch(t){}var En,An,Ln,Mn=Dt("species"),Fn=function(t,e){var n,r=U(t).constructor;return void 0===r||null==(n=U(r)[Mn])?e:N(n)},Rn=/(iphone|ipod|ipad).*applewebkit/i.test(gt),Nn=a.location,kn=a.setImmediate,Un=a.clearImmediate,Hn=a.process,Vn=a.MessageChannel,Gn=a.Dispatch,zn=0,Bn={},qn="onreadystatechange",Wn=function(t){if(Bn.hasOwnProperty(t)){var e=Bn[t];delete Bn[t],e()}},Yn=function(t){return function(){Wn(t)}},Kn=function(t){Wn(t.data)},Xn=function(t){a.postMessage(t+"",Nn.protocol+"//"+Nn.host)};kn&&Un||(kn=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return Bn[++zn]=function(){("function"==typeof t?t:Function(t)).apply(void 0,e)},En(zn),zn},Un=function(t){delete Bn[t]},vt?En=function(t){Hn.nextTick(Yn(t))}:Gn&&Gn.now?En=function(t){Gn.now(Yn(t))}:Vn&&!Rn?(Ln=(An=new Vn).port2,An.port1.onmessage=Kn,En=k(Ln.postMessage,Ln,1)):a.addEventListener&&"function"==typeof postMessage&&!a.importScripts&&Nn&&"file:"!==Nn.protocol&&!s(Xn)?(En=Xn,a.addEventListener("message",Kn,!1)):En=qn in P("script")?function(t){Ze.appendChild(P("script")).onreadystatechange=function(){Ze.removeChild(this),Wn(t)}}:function(t){setTimeout(Yn(t),0)});var Jn,Qn,Zn,$n,tr,er,nr,rr,or={set:kn,clear:Un},ir=/web0s(?!.*chrome)/i.test(gt),ar=D.f,sr=or.set,cr=a.MutationObserver||a.WebKitMutationObserver,ur=a.document,lr=a.process,fr=a.Promise,pr=ar(a,"queueMicrotask"),dr=pr&&pr.value;dr||(Jn=function(){var t,e;for(vt&&(t=lr.domain)&&t.exit();Qn;){e=Qn.fn,Qn=Qn.next;try{e()}catch(t){throw Qn?$n():Zn=void 0,t}}Zn=void 0,t&&t.enter()},Rn||vt||ir||!cr||!ur?fr&&fr.resolve?(nr=fr.resolve(void 0),rr=nr.then,$n=function(){rr.call(nr,Jn)}):$n=vt?function(){lr.nextTick(Jn)}:function(){sr.call(a,Jn)}:(tr=!0,er=ur.createTextNode(""),new cr(Jn).observe(er,{characterData:!0}),$n=function(){er.data=tr=!tr}));var hr,vr,yr,br=dr||function(t){var e={fn:t,next:void 0};Zn&&(Zn.next=e),Qn||(Qn=e,$n()),Zn=e},gr=function(t){var e,n;this.promise=new t((function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r})),this.resolve=N(e),this.reject=N(n)},mr={f:function(t){return new gr(t)}},Tr=function(t,e){if(U(t),m(e)&&e.constructor===t)return e;var n=mr.f(t);return(0,n.resolve)(e),n.promise},_r=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}},Sr=a.WeakMap,Ir="function"==typeof Sr&&/native code/.test(wn(Sr)),Or=a.WeakMap;if(Ir){var Pr=lt.state||(lt.state=new Or),wr=Pr.get,Cr=Pr.has,Dr=Pr.set;hr=function(t,e){return e.facade=t,Dr.call(Pr,t,e),e},vr=function(t){return wr.call(Pr,t)||{}},yr=function(t){return Cr.call(Pr,t)}}else{var jr=qe("state");Xt[jr]=!0,hr=function(t,e){return e.facade=t,G(t,jr,e),e},vr=function(t){return S(t,jr)?t[jr]:{}},yr=function(t){return S(t,jr)}}var xr={set:hr,get:vr,has:yr,enforce:function(t){return yr(t)?vr(t):hr(t,{})},getterFor:function(t){return function(e){var n;if(!m(e)||(n=vr(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}},Er=or.set,Ar=Dt("species"),Lr="Promise",Mr=xr.get,Fr=xr.set,Rr=xr.getterFor(Lr),Nr=gn,kr=a.TypeError,Ur=a.document,Hr=a.process;bt("fetch");var Vr,Gr,zr,Br=mr.f,qr=Br,Wr=!!(Ur&&Ur.createEvent&&a.dispatchEvent),Yr="function"==typeof PromiseRejectionEvent,Kr="unhandledrejection",Xr=F(Lr,(function(){if(!(wn(Nr)!==String(Nr))){if(66===St)return!0;if(!vt&&!Yr)return!0}if(!Nr.prototype.finally)return!0;if(St>=51&&/native code/.test(Nr))return!1;var t=Nr.resolve(1),e=function(t){t((function(){}),(function(){}))};return(t.constructor={})[Ar]=e,!(t.then((function(){}))instanceof e)})),Jr=Xr||!function(t,e){if(!e&&!Dn)return!1;var n=!1;try{var r={};r[Cn]=function(){return{next:function(){return{done:n=!0}}}},t(r)}catch(t){}return n}((function(t){Nr.all(t).catch((function(){}))})),Qr=function(t){var e;return!(!m(t)||"function"!=typeof(e=t.then))&&e},Zr=function(t,e){if(!t.notified){t.notified=!0;var n=t.reactions;br((function(){for(var r=t.value,o=1==t.state,i=0;n.length>i;){var a,s,c,u=n[i++],l=o?u.ok:u.fail,f=u.resolve,p=u.reject,d=u.domain;try{l?(o||(2===t.rejection&&no(t),t.rejection=1),!0===l?a=r:(d&&d.enter(),a=l(r),d&&(d.exit(),c=!0)),a===u.promise?p(kr("Promise-chain cycle")):(s=Qr(a))?s.call(a,f,p):f(a)):p(r)}catch(t){d&&!c&&d.exit(),p(t)}}t.reactions=[],t.notified=!1,e&&!t.rejection&&to(t)}))}},$r=function(t,e,n){var r,o;Wr?((r=Ur.createEvent("Event")).promise=e,r.reason=n,r.initEvent(t,!1,!0),a.dispatchEvent(r)):r={promise:e,reason:n},!Yr&&(o=a["on"+t])?o(r):t===Kr&&function(t,e){var n=a.console;n&&n.error&&(1===arguments.length?n.error(t):n.error(t,e))}("Unhandled promise rejection",n)},to=function(t){Er.call(a,(function(){var e,n=t.facade,r=t.value;if(eo(t)&&(e=_r((function(){vt?Hr.emit("unhandledRejection",r,n):$r(Kr,n,r)})),t.rejection=vt||eo(t)?2:1,e.error))throw e.value}))},eo=function(t){return 1!==t.rejection&&!t.parent},no=function(t){Er.call(a,(function(){var e=t.facade;vt?Hr.emit("rejectionHandled",e):$r("rejectionhandled",e,t.value)}))},ro=function(t,e,n){return function(r){t(e,r,n)}},oo=function(t,e,n){t.done||(t.done=!0,n&&(t=n),t.value=e,t.state=2,Zr(t,!0))},io=function(t,e,n){if(!t.done){t.done=!0,n&&(t=n);try{if(t.facade===e)throw kr("Promise can't be resolved itself");var r=Qr(e);r?br((function(){var n={done:!1};try{r.call(e,ro(io,n,t),ro(oo,n,t))}catch(e){oo(n,e,t)}})):(t.value=e,t.state=1,Zr(t,!1))}catch(e){oo({done:!1},e,t)}}};Xr&&(Nr=function(t){!function(t,e,n){if(!(t instanceof e))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation")}(this,Nr,Lr),N(t),Vr.call(this);var e=Mr(this);try{t(ro(io,e),ro(oo,e))}catch(t){oo(e,t)}},(Vr=function(t){Fr(this,{type:Lr,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=function(t,e,n){for(var r in e)n&&n.unsafe&&t[r]?t[r]=e[r]:mn(t,r,e[r],n);return t}(Nr.prototype,{then:function(t,e){var n=Rr(this),r=Br(Fn(this,Nr));return r.ok="function"!=typeof t||t,r.fail="function"==typeof e&&e,r.domain=vt?Hr.domain:void 0,n.parent=!0,n.reactions.push(r),0!=n.state&&Zr(n,!1),r.promise},catch:function(t){return this.then(void 0,t)}}),Gr=function(){var t=new Vr,e=Mr(t);this.promise=t,this.resolve=ro(io,e),this.reject=ro(oo,e)},mr.f=Br=function(t){return t===Nr||t===zr?new Gr(t):qr(t)}),q({global:!0,wrap:!0,forced:Xr},{Promise:Nr}),In(Nr,Lr,!1,!0),function(t){var e=bt(t),n=V.f;c&&e&&!e[On]&&n(e,On,{configurable:!0,get:function(){return this}})}(Lr),zr=bt(Lr),q({target:Lr,stat:!0,forced:Xr},{reject:function(t){var e=Br(this);return e.reject.call(void 0,t),e.promise}}),q({target:Lr,stat:!0,forced:!0},{resolve:function(t){return Tr(this===zr?Nr:this,t)}}),q({target:Lr,stat:!0,forced:Jr},{all:function(t){var e=this,n=Br(e),r=n.resolve,o=n.reject,i=_r((function(){var n=N(e.resolve),i=[],a=0,s=1;yn(t,(function(t){var c=a++,u=!1;i.push(void 0),s++,n.call(e,t).then((function(t){u||(u=!0,i[c]=t,--s||r(i))}),o)})),--s||r(i)}));return i.error&&o(i.value),n.promise},race:function(t){var e=this,n=Br(e),r=n.reject,o=_r((function(){var o=N(e.resolve);yn(t,(function(t){o.call(e,t).then(n.resolve,r)}))}));return o.error&&r(o.value),n.promise}}),q({target:"Promise",stat:!0},{allSettled:function(t){var e=this,n=mr.f(e),r=n.resolve,o=n.reject,i=_r((function(){var n=N(e.resolve),o=[],i=0,a=1;yn(t,(function(t){var s=i++,c=!1;o.push(void 0),a++,n.call(e,t).then((function(t){c||(c=!0,o[s]={status:"fulfilled",value:t},--a||r(o))}),(function(t){c||(c=!0,o[s]={status:"rejected",reason:t},--a||r(o))}))})),--a||r(o)}));return i.error&&o(i.value),n.promise}});var ao="No one promise resolved";q({target:"Promise",stat:!0},{any:function(t){var e=this,n=mr.f(e),r=n.resolve,o=n.reject,i=_r((function(){var n=N(e.resolve),i=[],a=0,s=1,c=!1;yn(t,(function(t){var u=a++,l=!1;i.push(void 0),s++,n.call(e,t).then((function(t){l||c||(c=!0,r(t))}),(function(t){l||c||(l=!0,i[u]=t,--s||o(new(bt("AggregateError"))(i,ao)))}))})),--s||o(new(bt("AggregateError"))(i,ao))}));return i.error&&o(i.value),n.promise}});var so=!!gn&&s((function(){gn.prototype.finally.call({then:function(){}},(function(){}))}));q({target:"Promise",proto:!0,real:!0,forced:so},{finally:function(t){var e=Fn(this,bt("Promise")),n="function"==typeof t;return this.then(n?function(n){return Tr(e,t()).then((function(){return n}))}:t,n?function(n){return Tr(e,t()).then((function(){throw n}))}:t)}});var co,uo,lo,fo=function(t){return function(e,n){var r,o,i=String(b(e)),a=it(n),s=i.length;return a<0||a>=s?t?"":void 0:(r=i.charCodeAt(a))<55296||r>56319||a+1===s||(o=i.charCodeAt(a+1))<56320||o>57343?t?i.charAt(a):r:t?i.slice(a,a+2):o-56320+(r-55296<<10)+65536}},po={codeAt:fo(!1),charAt:fo(!0)},ho=Dt("iterator"),vo=!1;[].keys&&("next"in(lo=[].keys())?(uo=Xe(Xe(lo)))!==Object.prototype&&(co=uo):vo=!0);var yo=null==co||s((function(){var t={};return co[ho].call(t)!==t}));yo&&(co={}),yo&&!S(co,ho)&&G(co,ho,(function(){return this}));var bo={IteratorPrototype:co,BUGGY_SAFARI_ITERATORS:vo},go=bo.IteratorPrototype,mo=function(){return this},To=bo.IteratorPrototype,_o=bo.BUGGY_SAFARI_ITERATORS,So=Dt("iterator"),Io="keys",Oo="values",Po="entries",wo=function(){return this},Co=function(t,e,n,r,o,i,a){!function(t,e,n){var r=e+" Iterator";t.prototype=rn(go,{next:p(1,n)}),In(t,r,!1,!0),on[r]=mo}(n,e,r);var s,c,u,l=function(t){if(t===o&&y)return y;if(!_o&&t in h)return h[t];switch(t){case Io:case Oo:case Po:return function(){return new n(this,t)}}return function(){return new n(this)}},f=e+" Iterator",d=!1,h=t.prototype,v=h[So]||h["@@iterator"]||o&&h[o],y=!_o&&v||l(o),b="Array"==e&&h.entries||v;if(b&&(s=Xe(b.call(new t)),To!==Object.prototype&&s.next&&(In(s,f,!0,!0),on[f]=wo)),o==Oo&&v&&v.name!==Oo&&(d=!0,y=function(){return v.call(this)}),a&&h[So]!==y&&G(h,So,y),on[e]=y,o)if(c={values:l(Oo),keys:i?y:l(Io),entries:l(Po)},a)for(u in c)(_o||d||!(u in h))&&mn(h,u,c[u]);else q({target:e,proto:!0,forced:_o||d},c);return c},Do=po.charAt,jo="String Iterator",xo=xr.set,Eo=xr.getterFor(jo);Co(String,"String",(function(t){xo(this,{type:jo,string:String(t),index:0})}),(function(){var t,e=Eo(this),n=e.string,r=e.index;return r>=n.length?{value:void 0,done:!0}:(t=Do(n,r),e.index+=t.length,{value:t,done:!1})}));var Ao="Array Iterator",Lo=xr.set,Mo=xr.getterFor(Ao);Co(Array,"Array",(function(t,e){Lo(this,{type:Ao,target:g(t),index:0,kind:e})}),(function(){var t=Mo(this),e=t.target,n=t.kind,r=t.index++;return!e||r>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:e[r],done:!1}:{value:[r,e[r]],done:!1}}),"values"),on.Arguments=on.Array;var Fo=Dt("toStringTag");for(var Ro in{CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}){var No=a[Ro],ko=No&&No.prototype;ko&&pn(ko)!==Fo&&G(ko,Fo,Ro),on[Ro]=on.Array}var Uo=R.Promise,Ho=Dt("isConcatSpreadable"),Vo=9007199254740991,Go="Maximum allowed index exceeded",zo=St>=51||!s((function(){var t=[];return t[Ho]=!1,t.concat()[0]!==t})),Bo=Ft("concat"),qo=function(t){if(!m(t))return!1;var e=t[Ho];return void 0!==e?!!e:ct(t)};q({target:"Array",proto:!0,forced:!zo||!Bo},{concat:function(t){var e,n,r,o,i,a=nt(this),s=xt(a,0),c=0;for(e=-1,r=arguments.length;e<r;e++)if(qo(i=-1===e?a:arguments[e])){if(c+(o=st(i.length))>Vo)throw TypeError(Go);for(n=0;n<o;n++,c++)n in i&&Ie(s,c,i[n])}else{if(c>=Vo)throw TypeError(Go);Ie(s,c++,i)}return s.length=c,s}});var Wo=Z("Array").concat,Yo=Array.prototype,Ko=function(t){var e=t.concat;return t===Yo||t instanceof Array&&e===Yo.concat?Wo:e},Xo=s((function(){$t(1)}));q({target:"Object",stat:!0,forced:Xo},{keys:function(t){return $t(nt(t))}});var Jo=R.Object.keys,Qo=Zt.concat("length","prototype"),Zo={f:Object.getOwnPropertyNames||function(t){return Qt(t,Qo)}}.f,$o={}.toString,ti="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],ei=function(t){return ti&&"[object Window]"==$o.call(t)?function(t){try{return Zo(t)}catch(t){return ti.slice()}}(t):Zo(g(t))},ni=s((function(){return!Object.getOwnPropertyNames(1)}));q({target:"Object",stat:!0,forced:ni},{getOwnPropertyNames:ei});var ri=R.Object,oi=function(t){return ri.getOwnPropertyNames(t)};q({target:"Object",stat:!0,forced:!c,sham:!c},{defineProperty:V.f});var ii=o((function(t){var e=R.Object,n=t.exports=function(t,n,r){return e.defineProperty(t,n,r)};e.defineProperty.sham&&(n.sham=!0)}));q({target:"Object",stat:!0,forced:!c,sham:!c},{defineProperties:Qe});var ai=o((function(t){var e=R.Object,n=t.exports=function(t,n){return e.defineProperties(t,n)};e.defineProperties.sham&&(n.sham=!0)})),si=[].reverse,ci=[1,2];q({target:"Array",proto:!0,forced:String(ci)===String(ci.reverse())},{reverse:function(){return ct(this)&&(this.length=this.length),si.call(this)}});var ui=Z("Array").reverse,li=Array.prototype,fi=function(t){var e=t.reverse;return t===li||t instanceof Array&&e===li.reverse?ui:e},pi={};function di(t,e){switch(e.type){case Ve:var n=t.openTabIDs,r=me(n).call(n,e.tabId);if(r>=0){var o=xe(n).call(n);return Ue(o).call(o,r,1),{selectedTabID:t.selectedTabID,openTabIDs:o}}return t;case He:var i=t.openTabIDs,a=e.tabId;if(-1===me(i).call(i,a)){var s=xe(i).call(i);return s.push(a),{selectedTabID:t.selectedTabID,openTabIDs:s}}return t;case ze:return pi.getCopyState(t);case Ge:var c=e.tabId;return t.selectedTabID!==c?{selectedTabID:c,openTabIDs:t.openTabIDs}:t;default:throw new Error("Undefined action type '"+e.type+"'")}}pi.checkArrIndex=function(t,e){return t>=0&&t<e},pi.getInstance=function(t){new(et(Function.prototype).apply(t,arguments))},pi.resolve=function(t){return Uo.resolve(t)},pi.getCopyState=function(t){var e;return Object.prototype.hasOwnProperty.call(t,"openTabIDs")||(t.openTabIDs=[]),{selectedTabID:t.selectedTabID,openTabIDs:Ko(e=[]).call(e,t.openTabIDs)}},pi.assingAll=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return Ht(n).call(n,(function(e){var n,r=Jo(e);Ht(n=oi(e)).call(n,(function(n){me(r).call(r,n)>=0?t[n]=e[n]:ii(t,n,{value:e[n],writable:!0})}))})),t},pi.setNoneEnumProps=function(t,e){var n,r={};return Ht(n=Jo(e)).call(n,(function(t){r[t]={writable:!0,value:e[t]}})),ai(t,r)},pi.getArraysDiff=function(t,e){var n,r,o=Ko(n=[]).call(n,t),i=Ko(r=[]).call(r,e);return Ht(t).call(t,(function(t){me(e).call(e,t)>=0&&(Ue(o).call(o,me(o).call(o,t),1),Ue(i).call(i,me(i).call(i,t),1))})),[o,i]},pi.filterArrayUntilFirstValue=function(t,e,n){n&&fi(t).call(t);for(var r=0,o=t.length;r<o;r++)if(e(t[r],r,t))return t[r];return null},pi.throwMissingParam=function(t){throw'Missing parameter in "'+t+'" function'},pi.isObj=function(t){return"[object Object]"===Object.prototype.toString.call(t)},q({target:"Object",stat:!0,sham:!c},{create:rn});var hi=R.Object,vi=function(t,e){return hi.create(t,e)},yi=oe,bi=Kt.includes;q({target:"Array",proto:!0},{includes:function(t){return bi(this,t,arguments.length>1?arguments[1]:void 0)}});var gi=Z("Array").includes,mi=Dt("match"),Ti=function(t){if(function(t){var e;return m(t)&&(void 0!==(e=t[mi])?!!e:"RegExp"==h(t))}(t))throw TypeError("The method doesn't accept regular expressions");return t},_i=Dt("match");q({target:"String",proto:!0,forced:!function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[_i]=!1,"/./"[t](e)}catch(t){}}return!1}("includes")},{includes:function(t){return!!~String(b(this)).indexOf(Ti(t),arguments.length>1?arguments[1]:void 0)}});var Si=Z("String").includes,Ii=Array.prototype,Oi=String.prototype,Pi=function(t){var e=t.includes;return t===Ii||t instanceof Array&&e===Ii.includes?gi:"string"==typeof t||t===Oi||t instanceof String&&e===Oi.includes?Si:e},wi=pi.throwMissingParam,Ci=function(t,e){void 0===e&&(e={options:{}});var n=t.call(this,e.options),r=n.optionsManager,o=n.helper,i=n.activedTabsHistory;o.setNoneEnumProps(this,{optionsManager:r,helper:o,activedTabsHistory:i,userProxy:{}}),this._setUserProxy()._subscribeOnReadyEvent()._createReadyFunction()._subscribeSelectedTabsHistory()._subscribeCallbacksOptions()},Di={_setUserProxy:function(){var t=this,e={},n=this;for(var r in this)"_"!==r[0]&&"constructor"!==r&&function(){var o=t[r];e[r]="function"==typeof o?function(){var t=o.apply(n,arguments);return t===n?e:t}:o}();return this.userProxy=e,this},_subscribeOnReadyEvent:function(){var t=this;return this.one("_onReady",(function(){t._isReady=!0})),this},_createReadyFunction:function(){var t=this,e=function(e){!0===t._isReady?e.call(t.userProxy,t.userProxy):t.one("_onReady",(function(){e.call(t.userProxy,t.userProxy)}))};return e=et(e).call(e,this),yi(e,this.userProxy),this.helper.setNoneEnumProps(this,{ready:e}),this},_subscribeSelectedTabsHistory:function(){var t=this;return this.on("onChange",(function(e){for(var n=e.currentData,r=e.previousData,o=e.closedTabIDs,i=0,a=o.length;i<a;i++)t.activedTabsHistory.remove(o[i]);r.selectedTabID!==n.selectedTabID&&t.isOpen(r.selectedTabID)&&!t.isSelected(r.selectedTabID)&&t.activedTabsHistory.add(r.selectedTabID)})),this},_subscribeCallbacksOptions:function(){var t,e=this,n=this.optionsManager.options;return Ht(t=Jo(this._publishers)).call(t,(function(t){"_"!==t[0]&&e.on(t,(function(){n[t].apply(this,arguments)}))})),this},getOption:function(t){return this.optionsManager.getOption(t)},setOption:function(t,e){return this.optionsManager.setOption(t,e),this},getPreviousData:function(){return this.helper.getCopyState(this.previousState)},getCopyPerviousData:function(){return this.getPreviousData()},getData:function(){return this.helper.getCopyState(this.stateRef)},getCopyData:function(){return this.getData()},isSelected:function(t){return void 0===t&&(t=wi("isSelected")),this.stateRef.selectedTabID==t},isOpen:function(t){var e;return void 0===t&&(t=wi("isOpen")),me(e=this.stateRef.openTabIDs).call(e,t)>=0},_getFlushEffectsPromise:function(){var t=this;return new Uo((function(e){t.one("_onFlushEffects",(function(){e.apply(this,arguments)}))}))},select:function(t){void 0===t&&(t=wi("select")),t&&(t+="");var e=this._getFlushEffectsPromise();return this._select(t),e},_getPreSelectedTabId:function(){for(var t=this.activedTabsHistory,e="";!e&&t.tabsId.length;){var n=t.popLastTabID();if(n){var r=this.getTab(n);r&&!r.disable&&this.isOpen(n)&&!this.isSelected(n)&&(e=n)}}return e},_getPreSiblingTabId:function(){var t=this,e=this.stateRef,n=e.selectedTabID,r=e.openTabIDs,o=xe(r).call(r,0,me(r).call(r,n));return this.helper.filterArrayUntilFirstValue(o,(function(e){return!t.getTab(e).disable}),!0)},_getNextSiblingTabId:function(){var t=this,e=this.stateRef,n=e.selectedTabID,r=e.openTabIDs,o=xe(r).call(r,me(r).call(r,n)+1);return this.helper.filterArrayUntilFirstValue(o,(function(e){return!t.getTab(e).disable}),!1)},_findTabIdForSwitching:function(){return this._getPreSelectedTabId()||this._getPreSiblingTabId()||this._getNextSiblingTabId()||""},setTab:function(t,e){return void 0===e&&(e={}),this.optionsManager.validateObjectiveTabData(e).validatePanelComponent(e),this._setTab(t,e),this},open:function(t){void 0===t&&(t=wi("open"));var e=this.optionsManager.validateTabData(t),n=this._getFlushEffectsPromise();return this._addTab(e),this._open(e.id),n},__close:function(t){var e=this._getFlushEffectsPromise();return this._close(t),this._removeTab(t),e},close:function(t,e){if(void 0===t&&(t=wi("close")),void 0===e&&(e=!0),t&&(t+=""),e&&this.isOpen(t)&&this.isSelected(t)){var n,r=Ko(n=[]).call(n,this.stateRef.openTabIDs);return Ue(r).call(r,me(r).call(r,t),1),this.select(this._findTabIdForSwitching()),this.__close(t)}return this.__close(t)},refresh:function(){var t=this._getFlushEffectsPromise();return this._refresh(),t}};pi.setNoneEnumProps(Di,{onChange:function(t){var e,n=t.newState,r=t.oldState,o=t.closedTabIDs,i=t.openedTabIDs,a=t.isSwitched;(a||i.length||o.length)&&(this.trigger("onChange",this.userProxy,{currentData:ae({},n),previousData:ae({},r),perviousData:ae({},r),closedTabIDs:o,openedTabIDs:i}),i.length&&this.trigger("onOpen",this.userProxy,i),o.length&&this.trigger("onClose",this.userProxy,o),a&&(-1===me(e=this.activedTabsHistory.tabsId).call(e,n.selectedTabID)&&this.trigger("onFirstSelect",this.userProxy,{currentSelectedTabId:n.selectedTabID,previousSelectedTabId:r.selectedTabID}),this.trigger("onSelect",this.userProxy,{currentSelectedTabId:n.selectedTabID,previousSelectedTabId:r.selectedTabID,perviousSelectedTabId:r.selectedTabID})));return this},eventHandlerFactory:function(t){var e,n,r=t.e,o=t.id,i=r.target,a=i.parentElement,s=this.optionsManager.setting,c=s.closeClass,u=s.tabClass;Pi(e=i.className).call(e,c)&&a&&a.lastChild&&a.lastChild==i&&Pi(n=a.className).call(n,u)?!1!==this.getOption("beforeClose").call(this.userProxy,r,o)&&this.close(o,!0):!1!==this.getOption("beforeSelect").call(this.userProxy,r,o)&&this.select(o)}});var ji=Di,xi=pi.throwMissingParam;function Ei(t,e){var n=e.options,r=t().globalDefaultOptions;this._defaultOptions=r,this._validateOptions(n),this.options=yi({},this._defaultOptions,n),this.setting={},this.initialState={},this.initialTabs=[],this._setSetting()._setInitialData()}Ei.prototype.getOption=function(t){if("tabs"===t){for(var e=[],n=0,r=this.options.tabs,o=r.length;n<o;n++)e.push(ae({},r[n]));return e}return this.options[t]},Ei.prototype.setOption=function(t,e){var n;return void 0===t&&(t=xi("setOption")),void 0===e&&(e=xi("setOption")),me(n=["SELECTEDTABID","TABS"]).call(n,t.toUpperCase())>=0||Object.prototype.hasOwnProperty.call(this._defaultOptions,t)&&(this.options[t]=e),this},Ei.prototype.validatePanelComponent=function(t){if(t.panelComponent&&"function"!=typeof t.panelComponent&&n.default.isValidElement(t.panelComponent)){var e=t.panelComponent;t.panelComponent=function(){return e}}return this},Ei.prototype.validateObjectiveTabData=function(t){if("[object Object]"!==Object.prototype.toString.call(t))throw new Error("tabData must be type of Object");return this},Ei.prototype.validateTabData=function(t){return this.validateObjectiveTabData(t).validatePanelComponent(t),(t=yi(this.setting.getDefaultTabData(),t)).id=t.id+"",t},Ei.prototype._validateOptions=function(t){if("[object Object]"!==Object.prototype.toString.call(t))throw'Invalid argument in "useDynamicTabs" function. Argument must be type of an object';return this},Ei.prototype._setInitialData=function(){var t=this,e=this.options,n=e.selectedTabID,r=e.tabs,o=[];return Ht(r).call(r,(function(e){var n=t.validateTabData(e);t.initialTabs.push(n),o.push(n.id)})),this.initialState={selectedTabID:n+"",openTabIDs:o},this},Ei.prototype._setSetting=function(){var t=this;return this.setting={tabClass:"rc-dyn-tabs-tab",titleClass:"rc-dyn-tabs-title",iconClass:"rc-dyn-tabs-icon",selectedClass:"rc-dyn-tabs-selected",hoverClass:"rc-dyn-tabs-hover",tablistClass:"rc-dyn-tabs-tablist",closeClass:"rc-dyn-tabs-close",panelClass:"rc-dyn-tabs-panel",panellistClass:"rc-dyn-tabs-panellist",disableClass:"rc-dyn-tabs-disable",ltrClass:"rc-dyn-tabs-ltr",rtlClass:"rc-dyn-tabs-rtl",verticalClass:"rc-dyn-tabs-vertical",panelIdTemplate:function(t){return"rc-dyn-tabs-p-"+t},ariaLabelledbyIdTemplate:function(t){return"rc-dyn-tabs-l-"+t},getDefaultTabData:function(){return{title:"",tooltip:"",panelComponent:t.options.defaultPanelComponent,closable:!0,iconClass:"",disable:!1,lazy:!1,id:"tab_"+(new Date).getTime()}}},this};var Ai=function(t){return n.default.createElement("button",t.tabProps,t.children,Object.prototype.hasOwnProperty.call(t,"iconProps")&&n.default.createElement("span",t.iconProps))},Li=function(t){void 0===t&&(t=null),this.defaultDirection="ltr",this._DefaulTabInnerComponent=t,this.directionsRange=["ltr","rtl"]};Li.prototype.getOptions=function(){return this._getOptions()},Li.prototype._getOptions=function(){var t={tabs:[],selectedTabID:"",beforeSelect:function(){return!0},beforeClose:function(){return!0},onOpen:function(){},onClose:function(){},onFirstSelect:function(){},onSelect:function(){},onChange:function(){},onLoad:function(){},onDestroy:function(){},onInit:function(){},accessibility:!0,isVertical:!1,defaultPanelComponent:function(){return n.default.createElement("div",null)}},e=this.defaultDirection,r=this._DefaulTabInnerComponent,o=this;return ai(t,{direction:{get:function(){return e},set:function(t){var n;if(-1===me(n=o.directionsRange).call(n,t))throw'Invalid direction value! it can be eather of "ltr" or "rtl" ';e=t},enumerable:!0},tabComponent:{get:function(){return r},set:function(t){if(t&&"function"!=typeof t)throw"tabComponent property must be type of a function.";r=t||o._DefaulTabInnerComponent},enumerable:!0}}),t};var Mi=et(Ei).call(Ei,null,(function(){return{globalDefaultOptions:new Li(Ai).getOptions()}})),Fi=function(){this.tabsId=[]};Fi.prototype.popLastTabID=function(){return this.tabsId.pop()},Fi.prototype.reset=function(){this.tabsId=[]},Fi.prototype.add=function(t){this.tabsId.push(t)},Fi.prototype.remove=function(t){for(var e=this.tabsId;me(e).call(e,t)>=0;)Ue(e).call(e,me(e).call(e,t),1);return this};var Ri=function(){this._publishers={onChange:[],onLoad:[],onDestroy:[],onOpen:[],onClose:[],onSelect:[],onInit:[],_onFlushEffects:[],_onReady:[],onFirstSelect:[]}};Ri.prototype.off=function(t,e){if("function"==typeof e&&Object.prototype.hasOwnProperty.call(this._publishers,t)){var n,r,o=me(n=this._publishers[t]).call(n,e);o>=0&&Ue(r=this._publishers[t]).call(r,o,1)}return this},Ri.prototype.on=function(t,e){var n;"function"==typeof e&&Object.prototype.hasOwnProperty.call(this._publishers,t)&&(-1===me(n=this._publishers[t]).call(n,e)&&this._publishers[t].push(e));return this},Ri.prototype.one=function(t,e){if("function"==typeof e&&Object.prototype.hasOwnProperty.call(this._publishers,t)){return this.on(t,(function n(){e.apply(this,arguments),this.off(t,n)}))}return this},pi.setNoneEnumProps(Ri.prototype,{trigger:function(t,e){for(var n,r=arguments.length,o=new Array(r>2?r-2:0),i=2;i<r;i++)o[i-2]=arguments[i];e=e||null;var a=[],s=Ko(n=[]).call(n,this._publishers[t]);return Ht(s).call(s,(function(t){a.push(t.apply(e,o))})),a}});var Ni=Lt.findIndex,ki="findIndex",Ui=!0;ki in[]&&Array(1).findIndex((function(){Ui=!1})),q({target:"Array",proto:!0,forced:Ui},{findIndex:function(t){return Ni(this,t,arguments.length>1?arguments[1]:void 0)}});var Hi=Z("Array").findIndex,Vi=Array.prototype,Gi=function(t){var e=t.findIndex;return t===Vi||t instanceof Array&&e===Vi.findIndex?Hi:e},zi=Lt.find,Bi="find",qi=!0;Bi in[]&&Array(1).find((function(){qi=!1})),q({target:"Array",proto:!0,forced:qi},{find:function(t){return zi(this,t,arguments.length>1?arguments[1]:void 0)}});var Wi=Z("Array").find,Yi=Array.prototype,Ki=function(t){var e=t.find;return t===Yi||t instanceof Array&&e===Yi.find?Wi:e};function Xi(t){var e=this,n=(void 0===t?{initialTabs:[]}:t).initialTabs;this._data=[],n&&n.constructor===Array&&n.length&&Ht(n).call(n,(function(t){e._addTab(t)}))}function Ji(t){var e=t.helper,n=t.initialState;this._helper=e,this._dispatch=null,this._setFlushState=null,this._isReady=!1,e.setNoneEnumProps(this,{state:this._helper.getCopyState(n),forceUpdateState:{},previousState:this._helper.getCopyState(n),stateRef:{}})}Xi.prototype._addTab=function(t){return this._data.push(t),this},Xi.prototype._removeTab=function(t){var e,n,r=Gi(e=this._data).call(e,(function(e){return e.id===t}));return r>=0&&Ue(n=this._data).call(n,r,1),this},Xi.prototype.getTab=function(t){var e;return Ki(e=this._data).call(e,(function(e){return e.id===t}))},Xi.prototype._setTab=function(t,e){var n,r=Gi(n=this._data).call(n,(function(e){return e.id==t}));if(r>=0){var o=this._data[r];e.id=o.id,yi(this._data[r],e)}return this},Ji.prototype._select=function(t){this._dispatch({type:Ge,tabId:t}),this.__flushEffects()},Ji.prototype._close=function(t){this._dispatch({type:Ve,tabId:t}),this.__flushEffects()},Ji.prototype._open=function(t){this._dispatch({type:He,tabId:t}),this.__flushEffects()},Ji.prototype._refresh=function(){this.forceUpdateState={},this._dispatch({type:ze}),this.__flushEffects()},Ji.prototype.__flushEffects=function(){this._setFlushState({})},pi.setNoneEnumProps(Ji.prototype,{updateStateRef:function(t,e){return this.stateRef=t,this._dispatch=e,this},updateState:function(t){return this.previousState=this._helper.getCopyState(this.state),this.state=this._helper.getCopyState(t),this},updateFlushState:function(t){return this._setFlushState=t,this}});Ci.prototype=vi(Ji.prototype),pi.assingAll(Ci.prototype,Xi.prototype,Ri.prototype,ji).constructor=Ci;var Qi=et(Ci).call(Ci,null,(function(t){void 0===t&&(t={});var e=new Fi,n=new Mi({options:t});return Ji.call(this,{helper:pi,initialState:n.initialState}),Xi.call(this,{initialTabs:n.initialTabs}),Ri.call(this),{activedTabsHistory:e,helper:pi,optionsManager:n}}));function Zi(e,r){void 0===r&&(r={});var o=e(),i=o.reducer,a=o.getApiInstance,s=o.PanelList,c=o.TabList,u=o.ApiContext,l=o.StateContext,f=o.ForceUpdateContext,p=t.useRef(null);null===p.current&&(p.current={api:a(r),TabListComponent:null,PanelListComponent:null});var d=p.current.api,h=p.current,v=t.useReducer(i,d.optionsManager.initialState),y=v[0],b=v[1],g=t.useState({}),m=g[0],T=g[1];return d.updateStateRef(y,b).updateFlushState(T),t.useLayoutEffect((function(){d.updateState(y)}),[y]),t.useLayoutEffect((function(){return d.trigger("onLoad",d.userProxy),function(){d.trigger("onDestroy",d.userProxy)}}),[]),t.useLayoutEffect((function(){d.trigger("onInit",d.userProxy)})),t.useLayoutEffect((function(){d.trigger("_onReady",d.userProxy)}),[]),t.useLayoutEffect((function(){var t=d.previousState,e=d.helper.getArraysDiff(y.openTabIDs,t.openTabIDs),n=e[0],r=e[1],o=t.selectedTabID!==y.selectedTabID;d.onChange({newState:y,oldState:t,closedTabIDs:r,openedTabIDs:n,isSwitched:o})}),[y]),t.useLayoutEffect((function(){d.trigger("_onFlushEffects",d.userProxy,{currentData:d.getData(),instance:d.userProxy})}),[m]),h.TabListComponent||(h.TabListComponent=function(t){return void 0===t&&(t={}),n.default.createElement(u.Provider,{value:d},n.default.createElement(l.Provider,{value:d.stateRef},n.default.createElement(f.Provider,{value:d.forceUpdateState},n.default.createElement(c,t,"props.children"))))}),h.PanelListCompoent||(h.PanelListCompoent=function(t){return n.default.createElement(u.Provider,{value:d},n.default.createElement(l.Provider,{value:d.stateRef},n.default.createElement(f.Provider,{value:d.forceUpdateState},n.default.createElement(s,t,"props.children"))))}),[h.TabListComponent,h.PanelListCompoent,d.ready]}return et(Zi).call(Zi,null,(function(){return{reducer:di,getApiInstance:function(t){return new Qi({options:t})},PanelList:Se,TabList:pe,ApiContext:Vt,StateContext:Gt,ForceUpdateContext:zt}}))}));
//# sourceMappingURL=react-dyn-tabs.including-polyfills.umd.min.js.map

@@ -1,2 +0,2 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("react"),require("prop-types")):"function"==typeof define&&define.amd?define(["react","prop-types"],e):(t="undefined"!=typeof globalThis?globalThis:t||self).useDynTabs=e(t.React)}(this,(function(t){"use strict";function e(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var n=e(t),i=t.createContext({}),s=t.createContext({}),a=t.createContext({}),r=function(t){var e=t.api,n=t.id,i=t.isSelected;this._api=e,this._id=n,this._isSelected=i,this._op=e.optionsManager.options,this._setting=e.optionsManager.setting,this._tabObj=e.getTab(n)};function o(){return(o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t}).apply(this,arguments)}r.prototype.getTabProps=function(){var t={"tab-id":this._id,className:this._setting.tabClass,tabIndex:-1};return this._isSelected&&(t.tabIndex=0,t.className+=" "+this._setting.selectedClass),this._tabObj.disable&&(t.tabIndex=-1,t.className+=" "+this._setting.disableClass),this._op.accessibility&&(t.role="tab",t["aria-controls"]=this._setting.panelIdTemplate(this._id),t["aria-labelledby"]=this._setting.ariaLabelledbyIdTemplate(this._id),t["aria-selected"]=t["aria-expanded"]=this._isSelected),t},r.prototype.getTabInnerProps=function(){var t={id:this._id,isSelected:this._isSelected,api:this._api.userProxy,tabProps:{"tab-id":this._id,className:this._setting.titleClass,title:this._tabObj.tooltip,tabIndex:-1}};return this._tabObj.iconClass&&(t.iconProps={className:this._setting.iconClass+" "+this._tabObj.iconClass,role:"presentation"}),this._op.accessibility&&(t.tabProps.id=this._setting.ariaLabelledbyIdTemplate(this._id),t.tabProps.role="presentation"),t},r.prototype.getCloseIconProps=function(){var t={className:this._setting.closeClass};return this._op.accessibility&&(t.role="presentation"),t};var l=function(t){n.default.useContext(a);var e=t.id,s=t.selectedTabID,l=n.default.useContext(i),c=l.getOption("tabComponent"),u=l.getTab(e),p=new r({api:l,id:e,isSelected:s===e});return n.default.createElement("li",o({},p.getTabProps(),{onClick:function(t){!function(t){l.eventHandlerFactory({e:t,id:e})}(t)}}),n.default.createElement(c,p.getTabInnerProps(),u.title),u.closable?n.default.createElement("span",p.getCloseIconProps(),"×"):null)},c=t.memo(l,(function(t,e){var n=t.id,i=t.selectedTabID,s=e.selectedTabID;return i===s||n!==i&&n!==s}));var u=t.memo((function(){var t=n.default.useContext(s),e=t.openTabIDs,a=t.selectedTabID,r=function(t){var e=t.api,n=e.optionsManager.setting,i=e.optionsManager.options,s={className:n.tablistClass+" "+n[i.direction+"Class"]};return i.isVertical&&(s.className+=" "+n.verticalClass),i.accessibility&&(s.role="tablist"),s}({api:n.default.useContext(i)});return n.default.createElement("ul",r,e.map((function(t){return n.default.createElement(c,{key:t,id:t,selectedTabID:a})})))}),(function(){return!0}));var p=function(t){n.default.useContext(a);var e=t.id,s=t.selectedTabID,r=n.default.useContext(i),o=e===s,l=function(t){var e=t.isSelected,n=t.api,i=t.id,s=n.optionsManager.options,a=n.optionsManager.setting,r={"tab-id":i,className:a.panelClass};return e&&(r.className+=" "+a.selectedClass),s.accessibility&&(r.role="tabpanel",r.id=a.panelIdTemplate(i),r["aria-hidden"]=!e,r["aria-labelledby"]=a.ariaLabelledbyIdTemplate(i)),r}({isSelected:o,api:r,id:e}),c=r.getTab(e).panelComponent;return n.default.createElement("div",l,c?n.default.createElement(c,{id:e,isSelected:o,api:r.userProxy}):null)},d=t.memo(p,(function(t,e){var n=t.id,i=t.selectedTabID,s=e.selectedTabID;return i===s||n!==i&&n!==s})),f=t.memo((function(){var t=n.default.useContext(s),e=t.openTabIDs,a=t.selectedTabID,r=n.default.useContext(i),o=r.optionsManager.setting,l=r.optionsManager.options,c=o.panellistClass+" "+o[l.direction+"Class"];return l.isVertical&&(c+=" "+o.verticalClass),n.default.createElement("div",{className:c},e.map((function(t){return n.default.createElement(d,{key:t,id:t,selectedTabID:a})})))}),(function(){return!0})),h="open",b="close",y="active",v="refresh",g={};function _(t,e){switch(e.type){case b:var n=t.openTabIDs,i=n.indexOf(e.tabId);if(i>=0){var s=n.slice();return s.splice(i,1),{selectedTabID:t.selectedTabID,openTabIDs:s}}return t;case h:var a=t.openTabIDs,r=e.tabId;if(-1===a.indexOf(r)){var o=a.slice();return o.push(r),{selectedTabID:t.selectedTabID,openTabIDs:o}}return t;case v:return g.getCopyState(t);case y:var l=e.tabId;return t.selectedTabID!==l?{selectedTabID:l,openTabIDs:t.openTabIDs}:t;default:throw new Error("Undefined action type '"+e.type+"'")}}function T(){return(T=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t}).apply(this,arguments)}g.checkArrIndex=function(t,e){return t>=0&&t<e},g.getInstance=function(t){new(Function.prototype.bind.apply(t,arguments))},g.resolve=function(t){return Promise.resolve(t)},g.getCopyState=function(t){return Object.prototype.hasOwnProperty.call(t,"openTabIDs")||(t.openTabIDs=[]),{selectedTabID:t.selectedTabID,openTabIDs:[].concat(t.openTabIDs)}},g.assingAll=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return n.map((function(e){var n=Object.keys(e);Object.getOwnPropertyNames(e).map((function(i){n.indexOf(i)>=0?t[i]=e[i]:Object.defineProperty(t,i,{value:e[i],writable:!0})}))})),t},g.setNoneEnumProps=function(t,e){var n={};return Object.keys(e).map((function(t){n[t]={writable:!0,value:e[t]}})),Object.defineProperties(t,n)},g.getArraysDiff=function(t,e){var n=[].concat(t),i=[].concat(e);return t.map((function(t){e.indexOf(t)>=0&&(n.splice(n.indexOf(t),1),i.splice(i.indexOf(t),1))})),[n,i]},g.filterArrayUntilFirstValue=function(t,e,n){n&&t.reverse();for(var i=0,s=t.length;i<s;i++)if(e(t[i],i,t))return t[i];return null},g.throwMissingParam=function(t){throw'Missing parameter in "'+t+'" function'},g.isObj=function(t){return"[object Object]"===Object.prototype.toString.call(t)};var I=g.throwMissingParam,m=function(t,e){void 0===e&&(e={options:{}});var n=t.call(this,e.options),i=n.optionsManager,s=n.helper,a=n.activedTabsHistory;s.setNoneEnumProps(this,{optionsManager:i,helper:s,activedTabsHistory:a,userProxy:{}}),this._setUserProxy()._subscribeOnReadyEvent()._createReadyFunction()._subscribeSelectedTabsHistory()._subscribeCallbacksOptions()},D={_setUserProxy:function(){var t=this,e={},n=this;for(var i in this)"_"!==i[0]&&"constructor"!==i&&function(){var s=t[i];e[i]="function"==typeof s?function(){var t=s.apply(n,arguments);return t===n?e:t}:s}();return this.userProxy=e,this},_subscribeOnReadyEvent:function(){var t=this;return this.one("_onReady",(function(){t._isReady=!0})),this},_createReadyFunction:function(){var t=this,e=function(e){!0===t._isReady?e.call(t.userProxy,t.userProxy):t.one("_onReady",(function(){e.call(t.userProxy,t.userProxy)}))};return e=e.bind(this),Object.assign(e,this.userProxy),this.helper.setNoneEnumProps(this,{ready:e}),this},_subscribeSelectedTabsHistory:function(){var t=this;return this.on("onChange",(function(e){for(var n=e.currentData,i=e.previousData,s=e.closedTabIDs,a=0,r=s.length;a<r;a++)t.activedTabsHistory.remove(s[a]);i.selectedTabID!==n.selectedTabID&&t.isOpen(i.selectedTabID)&&!t.isSelected(i.selectedTabID)&&t.activedTabsHistory.add(i.selectedTabID)})),this},_subscribeCallbacksOptions:function(){var t=this,e=this.optionsManager.options;return Object.keys(this._publishers).map((function(n){"_"!==n[0]&&t.on(n,(function(){e[n].apply(this,arguments)}))})),this},getOption:function(t){return this.optionsManager.getOption(t)},setOption:function(t,e){return this.optionsManager.setOption(t,e),this},getPreviousData:function(){return this.helper.getCopyState(this.previousState)},getCopyPerviousData:function(){return this.getPreviousData()},getData:function(){return this.helper.getCopyState(this.stateRef)},getCopyData:function(){return this.getData()},isSelected:function(t){return void 0===t&&(t=I("isSelected")),this.stateRef.selectedTabID==t},isOpen:function(t){return void 0===t&&(t=I("isOpen")),this.stateRef.openTabIDs.indexOf(t)>=0},_getFlushEffectsPromise:function(){var t=this;return new Promise((function(e){t.one("_onFlushEffects",(function(){e.apply(this,arguments)}))}))},select:function(t){void 0===t&&(t=I("select")),t&&(t+="");var e=this._getFlushEffectsPromise();return this._select(t),e},_getPreSelectedTabId:function(){for(var t=this.activedTabsHistory,e="";!e&&t.tabsId.length;){var n=t.popLastTabID();if(n){var i=this.getTab(n);i&&!i.disable&&this.isOpen(n)&&!this.isSelected(n)&&(e=n)}}return e},_getPreSiblingTabId:function(){var t=this,e=this.stateRef,n=e.selectedTabID,i=e.openTabIDs,s=i.slice(0,i.indexOf(n));return this.helper.filterArrayUntilFirstValue(s,(function(e){return!t.getTab(e).disable}),!0)},_getNextSiblingTabId:function(){var t=this,e=this.stateRef,n=e.selectedTabID,i=e.openTabIDs,s=i.slice(i.indexOf(n)+1);return this.helper.filterArrayUntilFirstValue(s,(function(e){return!t.getTab(e).disable}),!1)},_findTabIdForSwitching:function(){return this._getPreSelectedTabId()||this._getPreSiblingTabId()||this._getNextSiblingTabId()||""},setTab:function(t,e){return void 0===e&&(e={}),this.optionsManager.validateObjectiveTabData(e).validatePanelComponent(e),this._setTab(t,e),this},open:function(t){void 0===t&&(t=I("open"));var e=this.optionsManager.validateTabData(t),n=this._getFlushEffectsPromise();return this._addTab(e),this._open(e.id),n},__close:function(t){var e=this._getFlushEffectsPromise();return this._close(t),this._removeTab(t),e},close:function(t,e){if(void 0===t&&(t=I("close")),void 0===e&&(e=!0),t&&(t+=""),e&&this.isOpen(t)&&this.isSelected(t)){var n=[].concat(this.stateRef.openTabIDs);return n.splice(n.indexOf(t),1),this.select(this._findTabIdForSwitching()),this.__close(t)}return this.__close(t)},refresh:function(){var t=this._getFlushEffectsPromise();return this._refresh(),t}};g.setNoneEnumProps(D,{onChange:function(t){var e=t.newState,n=t.oldState,i=t.closedTabIDs,s=t.openedTabIDs,a=t.isSwitched;return(a||s.length||i.length)&&(this.trigger("onChange",this.userProxy,{currentData:T({},e),previousData:T({},n),perviousData:T({},n),closedTabIDs:i,openedTabIDs:s}),s.length&&this.trigger("onOpen",this.userProxy,s),i.length&&this.trigger("onClose",this.userProxy,i),a&&(-1===this.activedTabsHistory.tabsId.indexOf(e.selectedTabID)&&this.trigger("onFirstSelect",this.userProxy,{currentSelectedTabId:e.selectedTabID,previousSelectedTabId:n.selectedTabID}),this.trigger("onSelect",this.userProxy,{currentSelectedTabId:e.selectedTabID,previousSelectedTabId:n.selectedTabID,perviousSelectedTabId:n.selectedTabID}))),this},eventHandlerFactory:function(t){var e=t.e,n=t.id,i=e.target,s=i.parentElement,a=this.optionsManager.setting,r=a.closeClass,o=a.tabClass;i.className.includes(r)&&s&&s.lastChild&&s.lastChild==i&&s.className.includes(o)?!1!==this.getOption("beforeClose").call(this.userProxy,e,n)&&this.close(n,!0):!1!==this.getOption("beforeSelect").call(this.userProxy,e,n)&&this.select(n)}});var C=D;function O(){return(O=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t}).apply(this,arguments)}var P=g.throwMissingParam;function S(t,e){var n=e.options,i=t().globalDefaultOptions;this._defaultOptions=i,this._validateOptions(n),this.options=Object.assign({},this._defaultOptions,n),this.setting={},this.initialState={},this.initialTabs=[],this._setSetting()._setInitialData()}S.prototype.getOption=function(t){if("tabs"===t){for(var e=[],n=0,i=this.options.tabs,s=i.length;n<s;n++)e.push(O({},i[n]));return e}return this.options[t]},S.prototype.setOption=function(t,e){return void 0===t&&(t=P("setOption")),void 0===e&&(e=P("setOption")),["SELECTEDTABID","TABS"].indexOf(t.toUpperCase())>=0||Object.prototype.hasOwnProperty.call(this._defaultOptions,t)&&(this.options[t]=e),this},S.prototype.validatePanelComponent=function(t){if(t.panelComponent&&"function"!=typeof t.panelComponent&&n.default.isValidElement(t.panelComponent)){var e=t.panelComponent;t.panelComponent=function(){return e}}return this},S.prototype.validateObjectiveTabData=function(t){if("[object Object]"!==Object.prototype.toString.call(t))throw new Error("tabData must be type of Object");return this},S.prototype.validateTabData=function(t){return this.validateObjectiveTabData(t).validatePanelComponent(t),(t=Object.assign(this.setting.getDefaultTabData(),t)).id=t.id+"",t},S.prototype._validateOptions=function(t){if("[object Object]"!==Object.prototype.toString.call(t))throw'Invalid argument in "useDynamicTabs" function. Argument must be type of an object';return this},S.prototype._setInitialData=function(){var t=this,e=this.options,n=e.selectedTabID,i=e.tabs,s=[];return i.map((function(e){var n=t.validateTabData(e);t.initialTabs.push(n),s.push(n.id)})),this.initialState={selectedTabID:n+"",openTabIDs:s},this},S.prototype._setSetting=function(){var t=this;return this.setting={tabClass:"rc-dyn-tabs-tab",titleClass:"rc-dyn-tabs-title",iconClass:"rc-dyn-tabs-icon",selectedClass:"rc-dyn-tabs-selected",hoverClass:"rc-dyn-tabs-hover",tablistClass:"rc-dyn-tabs-tablist",closeClass:"rc-dyn-tabs-close",panelClass:"rc-dyn-tabs-panel",panellistClass:"rc-dyn-tabs-panellist",disableClass:"rc-dyn-tabs-disable",ltrClass:"rc-dyn-tabs-ltr",rtlClass:"rc-dyn-tabs-rtl",verticalClass:"rc-dyn-tabs-vertical",panelIdTemplate:function(t){return"rc-dyn-tabs-p-"+t},ariaLabelledbyIdTemplate:function(t){return"rc-dyn-tabs-l-"+t},getDefaultTabData:function(){return{title:"",tooltip:"",panelComponent:t.options.defaultPanelComponent,closable:!0,iconClass:"",disable:!1,id:"tab_"+(new Date).getTime()}}},this};var x=function(t){return n.default.createElement("button",t.tabProps,t.children,Object.prototype.hasOwnProperty.call(t,"iconProps")&&n.default.createElement("span",t.iconProps))},E=function(t){void 0===t&&(t=null),this.defaultDirection="ltr",this._DefaulTabInnerComponent=t,this.directionsRange=["ltr","rtl"]};E.prototype.getOptions=function(){return this._getOptions()},E.prototype._getOptions=function(){var t={tabs:[],selectedTabID:"",beforeSelect:function(){return!0},beforeClose:function(){return!0},onOpen:function(){},onClose:function(){},onFirstSelect:function(){},onSelect:function(){},onChange:function(){},onLoad:function(){},onDestroy:function(){},onInit:function(){},accessibility:!0,isVertical:!1,defaultPanelComponent:function(){return n.default.createElement("div",null)}},e=this.defaultDirection,i=this._DefaulTabInnerComponent,s=this;return Object.defineProperties(t,{direction:{get:function(){return e},set:function(t){if(-1===s.directionsRange.indexOf(t))throw'Invalid direction value! it can be eather of "ltr" or "rtl" ';e=t},enumerable:!0},tabComponent:{get:function(){return i},set:function(t){if(t&&"function"!=typeof t)throw"tabComponent property must be type of a function.";i=t||s._DefaulTabInnerComponent},enumerable:!0}}),t};var j=S.bind(null,(function(){return{globalDefaultOptions:new E(x).getOptions()}})),w=function(){this.tabsId=[]};w.prototype.popLastTabID=function(){return this.tabsId.pop()},w.prototype.reset=function(){this.tabsId=[]},w.prototype.add=function(t){this.tabsId.push(t)},w.prototype.remove=function(t){for(var e=this.tabsId;e.indexOf(t)>=0;)e.splice(e.indexOf(t),1);return this};var F=function(){this._publishers={onChange:[],onLoad:[],onDestroy:[],onOpen:[],onClose:[],onSelect:[],onInit:[],_onFlushEffects:[],_onReady:[],onFirstSelect:[]}};function L(t){var e=this,n=(void 0===t?{initialTabs:[]}:t).initialTabs;this._data=[],n&&n.constructor===Array&&n.length&&n.map((function(t){e._addTab(t)}))}function R(t){var e=t.helper,n=t.initialState;this._helper=e,this._state=this._helper.getCopyState(n),this._dispatch=null,this._setFlushState=null,this._isReady=!1,e.setNoneEnumProps(this,{forceUpdateState:{},previousState:this._helper.getCopyState(n),stateRef:{}})}F.prototype.off=function(t,e){if("function"==typeof e&&Object.prototype.hasOwnProperty.call(this._publishers,t)){var n=this._publishers[t].indexOf(e);n>=0&&this._publishers[t].splice(n,1)}return this},F.prototype.on=function(t,e){return"function"==typeof e&&Object.prototype.hasOwnProperty.call(this._publishers,t)&&-1===this._publishers[t].indexOf(e)&&this._publishers[t].push(e),this},F.prototype.one=function(t,e){if("function"==typeof e&&Object.prototype.hasOwnProperty.call(this._publishers,t)){return this.on(t,(function n(){e.apply(this,arguments),this.off(t,n)}))}return this},g.setNoneEnumProps(F.prototype,{trigger:function(t,e){for(var n=arguments.length,i=new Array(n>2?n-2:0),s=2;s<n;s++)i[s-2]=arguments[s];e=e||null;var a=[],r=[].concat(this._publishers[t]);return r.map((function(t){a.push(t.apply(e,i))})),a}}),L.prototype._addTab=function(t){return this._data.push(t),this},L.prototype._removeTab=function(t){var e=this._data.findIndex((function(e){return e.id===t}));return e>=0&&this._data.splice(e,1),this},L.prototype.getTab=function(t){return this._data.find((function(e){return e.id===t}))},L.prototype._setTab=function(t,e){var n=this._data.findIndex((function(e){return e.id==t}));if(n>=0){var i=this._data[n];e.id=i.id,Object.assign(this._data[n],e)}return this},R.prototype._select=function(t){this._dispatch({type:y,tabId:t}),this.__flushEffects()},R.prototype._close=function(t){this._dispatch({type:b,tabId:t}),this.__flushEffects()},R.prototype._open=function(t){this._dispatch({type:h,tabId:t}),this.__flushEffects()},R.prototype._refresh=function(){this.forceUpdateState={},this._dispatch({type:v}),this.__flushEffects()},R.prototype.__flushEffects=function(){this._setFlushState({})},g.setNoneEnumProps(R.prototype,{updateStateRef:function(t,e){return this.stateRef=t,this._dispatch=e,this},updateState:function(t){return this.previousState=this._helper.getCopyState(this._state),this._state=this._helper.getCopyState(t),this},updateFlushState:function(t){return this._setFlushState=t,this}});m.prototype=Object.create(R.prototype),g.assingAll(m.prototype,L.prototype,F.prototype,C).constructor=m;var N=m.bind(null,(function(t){void 0===t&&(t={});var e=new w,n=new j({options:t});return R.call(this,{helper:g,initialState:n.initialState}),L.call(this,{initialTabs:n.initialTabs}),F.call(this),{activedTabsHistory:e,helper:g,optionsManager:n}}));return function(e,i){void 0===i&&(i={});var s=e(),a=s.reducer,r=s.getApiInstance,o=s.PanelList,l=s.TabList,c=s.ApiContext,u=s.StateContext,p=s.ForceUpdateContext,d=t.useRef(null);null===d.current&&(d.current={api:r(i),TabListComponent:null,PanelListComponent:null});var f=d.current.api,h=d.current,b=t.useReducer(a,f.optionsManager.initialState),y=b[0],v=b[1],g=t.useState({}),_=g[0],T=g[1];return f.updateStateRef(y,v).updateFlushState(T),t.useLayoutEffect((function(){f.updateState(y)}),[y]),t.useLayoutEffect((function(){return f.trigger("onLoad",f.userProxy),function(){f.trigger("onDestroy",f.userProxy)}}),[]),t.useLayoutEffect((function(){f.trigger("onInit",f.userProxy)})),t.useLayoutEffect((function(){f.trigger("_onReady",f.userProxy)}),[]),t.useLayoutEffect((function(){var t=f.previousState,e=f.helper.getArraysDiff(y.openTabIDs,t.openTabIDs),n=e[0],i=e[1],s=t.selectedTabID!==y.selectedTabID;f.onChange({newState:y,oldState:t,closedTabIDs:i,openedTabIDs:n,isSwitched:s})}),[y]),t.useLayoutEffect((function(){f.trigger("_onFlushEffects",f.userProxy,{currentData:f.getData(),instance:f.userProxy})}),[_]),h.TabListComponent||(h.TabListComponent=function(t){return void 0===t&&(t={}),n.default.createElement(c.Provider,{value:f},n.default.createElement(u.Provider,{value:f.stateRef},n.default.createElement(p.Provider,{value:f.forceUpdateState},n.default.createElement(l,t,"props.children"))))}),h.PanelListCompoent||(h.PanelListCompoent=function(t){return n.default.createElement(c.Provider,{value:f},n.default.createElement(u.Provider,{value:f.stateRef},n.default.createElement(p.Provider,{value:f.forceUpdateState},n.default.createElement(o,t,"props.children"))))}),[h.TabListComponent,h.PanelListCompoent,f.ready]}.bind(null,(function(){return{reducer:_,getApiInstance:function(t){return new N({options:t})},PanelList:f,TabList:u,ApiContext:i,StateContext:s,ForceUpdateContext:a}}))}));
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("react"),require("prop-types")):"function"==typeof define&&define.amd?define(["react","prop-types"],e):(t="undefined"!=typeof globalThis?globalThis:t||self).useDynTabs=e(t.React)}(this,(function(t){"use strict";function e(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var n=e(t),i=t.createContext({}),s=t.createContext({}),a=t.createContext({}),r=function(t){var e=t.api,n=t.id,i=t.isSelected;this._api=e,this._id=n,this._isSelected=i,this._op=e.optionsManager.options,this._setting=e.optionsManager.setting,this._tabObj=e.getTab(n)};function o(){return(o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t}).apply(this,arguments)}r.prototype.getTabProps=function(){var t={"tab-id":this._id,className:this._setting.tabClass,tabIndex:-1};return this._isSelected&&(t.tabIndex=0,t.className+=" "+this._setting.selectedClass),this._tabObj.disable&&(t.tabIndex=-1,t.className+=" "+this._setting.disableClass),this._op.accessibility&&(t.role="tab",t["aria-controls"]=this._setting.panelIdTemplate(this._id),t["aria-labelledby"]=this._setting.ariaLabelledbyIdTemplate(this._id),t["aria-selected"]=t["aria-expanded"]=this._isSelected),t},r.prototype.getTabInnerProps=function(){var t={id:this._id,isSelected:this._isSelected,api:this._api.userProxy,tabProps:{"tab-id":this._id,className:this._setting.titleClass,title:this._tabObj.tooltip,tabIndex:-1}};return this._tabObj.iconClass&&(t.iconProps={className:this._setting.iconClass+" "+this._tabObj.iconClass,role:"presentation"}),this._op.accessibility&&(t.tabProps.id=this._setting.ariaLabelledbyIdTemplate(this._id),t.tabProps.role="presentation"),t},r.prototype.getCloseIconProps=function(){var t={className:this._setting.closeClass};return this._op.accessibility&&(t.role="presentation"),t};var l=function(t){n.default.useContext(a);var e=t.id,s=t.selectedTabID,l=n.default.useContext(i),c=l.getOption("tabComponent"),u=l.getTab(e),p=new r({api:l,id:e,isSelected:s===e});return n.default.createElement("li",o({},p.getTabProps(),{onClick:function(t){!function(t){l.eventHandlerFactory({e:t,id:e})}(t)}}),n.default.createElement(c,p.getTabInnerProps(),u.title),u.closable?n.default.createElement("span",p.getCloseIconProps(),"×"):null)},c=t.memo(l,(function(t,e){var n=t.id,i=t.selectedTabID,s=e.selectedTabID;return i===s||n!==i&&n!==s}));var u=t.memo((function(){var t=n.default.useContext(s),e=t.openTabIDs,a=t.selectedTabID,r=function(t){var e=t.api,n=e.optionsManager.setting,i=e.optionsManager.options,s={className:n.tablistClass+" "+n[i.direction+"Class"]};return i.isVertical&&(s.className+=" "+n.verticalClass),i.accessibility&&(s.role="tablist"),s}({api:n.default.useContext(i)});return n.default.createElement("ul",r,e.map((function(t){return n.default.createElement(c,{key:t,id:t,selectedTabID:a})})))}),(function(){return!0}));var p=function(t){n.default.useContext(a);var e=t.id,s=t.selectedTabID,r=n.default.useContext(i),o=e===s,l=function(t){var e=t.isSelected,n=t.api,i=t.id,s=n.optionsManager.options,a=n.optionsManager.setting,r={"tab-id":i,className:a.panelClass};return e&&(r.className+=" "+a.selectedClass),s.accessibility&&(r.role="tabpanel",r.id=a.panelIdTemplate(i),r["aria-hidden"]=!e,r["aria-labelledby"]=a.ariaLabelledbyIdTemplate(i)),r}({isSelected:o,api:r,id:e}),c=r.state.selectedTabID,u=r.getTab(e),p=u.panelComponent,d=!1;return(!u.lazy||o||c===e||r.activedTabsHistory.tabsId.indexOf(e)>=0)&&(d=!0),n.default.createElement("div",l,d&&p?n.default.createElement(p,{id:e,isSelected:o,api:r.userProxy}):null)},d=t.memo(p,(function(t,e){var n=t.id,i=t.selectedTabID,s=e.selectedTabID;return i===s||n!==i&&n!==s})),f=t.memo((function(){var t=n.default.useContext(s),e=t.openTabIDs,a=t.selectedTabID,r=n.default.useContext(i),o=r.optionsManager.setting,l=r.optionsManager.options,c=o.panellistClass+" "+o[l.direction+"Class"];return l.isVertical&&(c+=" "+o.verticalClass),n.default.createElement("div",{className:c},e.map((function(t){return n.default.createElement(d,{key:t,id:t,selectedTabID:a})})))}),(function(){return!0})),h="open",b="close",y="active",v="refresh",g={};function T(t,e){switch(e.type){case b:var n=t.openTabIDs,i=n.indexOf(e.tabId);if(i>=0){var s=n.slice();return s.splice(i,1),{selectedTabID:t.selectedTabID,openTabIDs:s}}return t;case h:var a=t.openTabIDs,r=e.tabId;if(-1===a.indexOf(r)){var o=a.slice();return o.push(r),{selectedTabID:t.selectedTabID,openTabIDs:o}}return t;case v:return g.getCopyState(t);case y:var l=e.tabId;return t.selectedTabID!==l?{selectedTabID:l,openTabIDs:t.openTabIDs}:t;default:throw new Error("Undefined action type '"+e.type+"'")}}function _(){return(_=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t}).apply(this,arguments)}g.checkArrIndex=function(t,e){return t>=0&&t<e},g.getInstance=function(t){new(Function.prototype.bind.apply(t,arguments))},g.resolve=function(t){return Promise.resolve(t)},g.getCopyState=function(t){return Object.prototype.hasOwnProperty.call(t,"openTabIDs")||(t.openTabIDs=[]),{selectedTabID:t.selectedTabID,openTabIDs:[].concat(t.openTabIDs)}},g.assingAll=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return n.map((function(e){var n=Object.keys(e);Object.getOwnPropertyNames(e).map((function(i){n.indexOf(i)>=0?t[i]=e[i]:Object.defineProperty(t,i,{value:e[i],writable:!0})}))})),t},g.setNoneEnumProps=function(t,e){var n={};return Object.keys(e).map((function(t){n[t]={writable:!0,value:e[t]}})),Object.defineProperties(t,n)},g.getArraysDiff=function(t,e){var n=[].concat(t),i=[].concat(e);return t.map((function(t){e.indexOf(t)>=0&&(n.splice(n.indexOf(t),1),i.splice(i.indexOf(t),1))})),[n,i]},g.filterArrayUntilFirstValue=function(t,e,n){n&&t.reverse();for(var i=0,s=t.length;i<s;i++)if(e(t[i],i,t))return t[i];return null},g.throwMissingParam=function(t){throw'Missing parameter in "'+t+'" function'},g.isObj=function(t){return"[object Object]"===Object.prototype.toString.call(t)};var I=g.throwMissingParam,m=function(t,e){void 0===e&&(e={options:{}});var n=t.call(this,e.options),i=n.optionsManager,s=n.helper,a=n.activedTabsHistory;s.setNoneEnumProps(this,{optionsManager:i,helper:s,activedTabsHistory:a,userProxy:{}}),this._setUserProxy()._subscribeOnReadyEvent()._createReadyFunction()._subscribeSelectedTabsHistory()._subscribeCallbacksOptions()},D={_setUserProxy:function(){var t=this,e={},n=this;for(var i in this)"_"!==i[0]&&"constructor"!==i&&function(){var s=t[i];e[i]="function"==typeof s?function(){var t=s.apply(n,arguments);return t===n?e:t}:s}();return this.userProxy=e,this},_subscribeOnReadyEvent:function(){var t=this;return this.one("_onReady",(function(){t._isReady=!0})),this},_createReadyFunction:function(){var t=this,e=function(e){!0===t._isReady?e.call(t.userProxy,t.userProxy):t.one("_onReady",(function(){e.call(t.userProxy,t.userProxy)}))};return e=e.bind(this),Object.assign(e,this.userProxy),this.helper.setNoneEnumProps(this,{ready:e}),this},_subscribeSelectedTabsHistory:function(){var t=this;return this.on("onChange",(function(e){for(var n=e.currentData,i=e.previousData,s=e.closedTabIDs,a=0,r=s.length;a<r;a++)t.activedTabsHistory.remove(s[a]);i.selectedTabID!==n.selectedTabID&&t.isOpen(i.selectedTabID)&&!t.isSelected(i.selectedTabID)&&t.activedTabsHistory.add(i.selectedTabID)})),this},_subscribeCallbacksOptions:function(){var t=this,e=this.optionsManager.options;return Object.keys(this._publishers).map((function(n){"_"!==n[0]&&t.on(n,(function(){e[n].apply(this,arguments)}))})),this},getOption:function(t){return this.optionsManager.getOption(t)},setOption:function(t,e){return this.optionsManager.setOption(t,e),this},getPreviousData:function(){return this.helper.getCopyState(this.previousState)},getCopyPerviousData:function(){return this.getPreviousData()},getData:function(){return this.helper.getCopyState(this.stateRef)},getCopyData:function(){return this.getData()},isSelected:function(t){return void 0===t&&(t=I("isSelected")),this.stateRef.selectedTabID==t},isOpen:function(t){return void 0===t&&(t=I("isOpen")),this.stateRef.openTabIDs.indexOf(t)>=0},_getFlushEffectsPromise:function(){var t=this;return new Promise((function(e){t.one("_onFlushEffects",(function(){e.apply(this,arguments)}))}))},select:function(t){void 0===t&&(t=I("select")),t&&(t+="");var e=this._getFlushEffectsPromise();return this._select(t),e},_getPreSelectedTabId:function(){for(var t=this.activedTabsHistory,e="";!e&&t.tabsId.length;){var n=t.popLastTabID();if(n){var i=this.getTab(n);i&&!i.disable&&this.isOpen(n)&&!this.isSelected(n)&&(e=n)}}return e},_getPreSiblingTabId:function(){var t=this,e=this.stateRef,n=e.selectedTabID,i=e.openTabIDs,s=i.slice(0,i.indexOf(n));return this.helper.filterArrayUntilFirstValue(s,(function(e){return!t.getTab(e).disable}),!0)},_getNextSiblingTabId:function(){var t=this,e=this.stateRef,n=e.selectedTabID,i=e.openTabIDs,s=i.slice(i.indexOf(n)+1);return this.helper.filterArrayUntilFirstValue(s,(function(e){return!t.getTab(e).disable}),!1)},_findTabIdForSwitching:function(){return this._getPreSelectedTabId()||this._getPreSiblingTabId()||this._getNextSiblingTabId()||""},setTab:function(t,e){return void 0===e&&(e={}),this.optionsManager.validateObjectiveTabData(e).validatePanelComponent(e),this._setTab(t,e),this},open:function(t){void 0===t&&(t=I("open"));var e=this.optionsManager.validateTabData(t),n=this._getFlushEffectsPromise();return this._addTab(e),this._open(e.id),n},__close:function(t){var e=this._getFlushEffectsPromise();return this._close(t),this._removeTab(t),e},close:function(t,e){if(void 0===t&&(t=I("close")),void 0===e&&(e=!0),t&&(t+=""),e&&this.isOpen(t)&&this.isSelected(t)){var n=[].concat(this.stateRef.openTabIDs);return n.splice(n.indexOf(t),1),this.select(this._findTabIdForSwitching()),this.__close(t)}return this.__close(t)},refresh:function(){var t=this._getFlushEffectsPromise();return this._refresh(),t}};g.setNoneEnumProps(D,{onChange:function(t){var e=t.newState,n=t.oldState,i=t.closedTabIDs,s=t.openedTabIDs,a=t.isSwitched;return(a||s.length||i.length)&&(this.trigger("onChange",this.userProxy,{currentData:_({},e),previousData:_({},n),perviousData:_({},n),closedTabIDs:i,openedTabIDs:s}),s.length&&this.trigger("onOpen",this.userProxy,s),i.length&&this.trigger("onClose",this.userProxy,i),a&&(-1===this.activedTabsHistory.tabsId.indexOf(e.selectedTabID)&&this.trigger("onFirstSelect",this.userProxy,{currentSelectedTabId:e.selectedTabID,previousSelectedTabId:n.selectedTabID}),this.trigger("onSelect",this.userProxy,{currentSelectedTabId:e.selectedTabID,previousSelectedTabId:n.selectedTabID,perviousSelectedTabId:n.selectedTabID}))),this},eventHandlerFactory:function(t){var e=t.e,n=t.id,i=e.target,s=i.parentElement,a=this.optionsManager.setting,r=a.closeClass,o=a.tabClass;i.className.includes(r)&&s&&s.lastChild&&s.lastChild==i&&s.className.includes(o)?!1!==this.getOption("beforeClose").call(this.userProxy,e,n)&&this.close(n,!0):!1!==this.getOption("beforeSelect").call(this.userProxy,e,n)&&this.select(n)}});var C=D;function O(){return(O=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t}).apply(this,arguments)}var P=g.throwMissingParam;function S(t,e){var n=e.options,i=t().globalDefaultOptions;this._defaultOptions=i,this._validateOptions(n),this.options=Object.assign({},this._defaultOptions,n),this.setting={},this.initialState={},this.initialTabs=[],this._setSetting()._setInitialData()}S.prototype.getOption=function(t){if("tabs"===t){for(var e=[],n=0,i=this.options.tabs,s=i.length;n<s;n++)e.push(O({},i[n]));return e}return this.options[t]},S.prototype.setOption=function(t,e){return void 0===t&&(t=P("setOption")),void 0===e&&(e=P("setOption")),["SELECTEDTABID","TABS"].indexOf(t.toUpperCase())>=0||Object.prototype.hasOwnProperty.call(this._defaultOptions,t)&&(this.options[t]=e),this},S.prototype.validatePanelComponent=function(t){if(t.panelComponent&&"function"!=typeof t.panelComponent&&n.default.isValidElement(t.panelComponent)){var e=t.panelComponent;t.panelComponent=function(){return e}}return this},S.prototype.validateObjectiveTabData=function(t){if("[object Object]"!==Object.prototype.toString.call(t))throw new Error("tabData must be type of Object");return this},S.prototype.validateTabData=function(t){return this.validateObjectiveTabData(t).validatePanelComponent(t),(t=Object.assign(this.setting.getDefaultTabData(),t)).id=t.id+"",t},S.prototype._validateOptions=function(t){if("[object Object]"!==Object.prototype.toString.call(t))throw'Invalid argument in "useDynamicTabs" function. Argument must be type of an object';return this},S.prototype._setInitialData=function(){var t=this,e=this.options,n=e.selectedTabID,i=e.tabs,s=[];return i.map((function(e){var n=t.validateTabData(e);t.initialTabs.push(n),s.push(n.id)})),this.initialState={selectedTabID:n+"",openTabIDs:s},this},S.prototype._setSetting=function(){var t=this;return this.setting={tabClass:"rc-dyn-tabs-tab",titleClass:"rc-dyn-tabs-title",iconClass:"rc-dyn-tabs-icon",selectedClass:"rc-dyn-tabs-selected",hoverClass:"rc-dyn-tabs-hover",tablistClass:"rc-dyn-tabs-tablist",closeClass:"rc-dyn-tabs-close",panelClass:"rc-dyn-tabs-panel",panellistClass:"rc-dyn-tabs-panellist",disableClass:"rc-dyn-tabs-disable",ltrClass:"rc-dyn-tabs-ltr",rtlClass:"rc-dyn-tabs-rtl",verticalClass:"rc-dyn-tabs-vertical",panelIdTemplate:function(t){return"rc-dyn-tabs-p-"+t},ariaLabelledbyIdTemplate:function(t){return"rc-dyn-tabs-l-"+t},getDefaultTabData:function(){return{title:"",tooltip:"",panelComponent:t.options.defaultPanelComponent,closable:!0,iconClass:"",disable:!1,lazy:!1,id:"tab_"+(new Date).getTime()}}},this};var x=function(t){return n.default.createElement("button",t.tabProps,t.children,Object.prototype.hasOwnProperty.call(t,"iconProps")&&n.default.createElement("span",t.iconProps))},E=function(t){void 0===t&&(t=null),this.defaultDirection="ltr",this._DefaulTabInnerComponent=t,this.directionsRange=["ltr","rtl"]};E.prototype.getOptions=function(){return this._getOptions()},E.prototype._getOptions=function(){var t={tabs:[],selectedTabID:"",beforeSelect:function(){return!0},beforeClose:function(){return!0},onOpen:function(){},onClose:function(){},onFirstSelect:function(){},onSelect:function(){},onChange:function(){},onLoad:function(){},onDestroy:function(){},onInit:function(){},accessibility:!0,isVertical:!1,defaultPanelComponent:function(){return n.default.createElement("div",null)}},e=this.defaultDirection,i=this._DefaulTabInnerComponent,s=this;return Object.defineProperties(t,{direction:{get:function(){return e},set:function(t){if(-1===s.directionsRange.indexOf(t))throw'Invalid direction value! it can be eather of "ltr" or "rtl" ';e=t},enumerable:!0},tabComponent:{get:function(){return i},set:function(t){if(t&&"function"!=typeof t)throw"tabComponent property must be type of a function.";i=t||s._DefaulTabInnerComponent},enumerable:!0}}),t};var j=S.bind(null,(function(){return{globalDefaultOptions:new E(x).getOptions()}})),w=function(){this.tabsId=[]};w.prototype.popLastTabID=function(){return this.tabsId.pop()},w.prototype.reset=function(){this.tabsId=[]},w.prototype.add=function(t){this.tabsId.push(t)},w.prototype.remove=function(t){for(var e=this.tabsId;e.indexOf(t)>=0;)e.splice(e.indexOf(t),1);return this};var F=function(){this._publishers={onChange:[],onLoad:[],onDestroy:[],onOpen:[],onClose:[],onSelect:[],onInit:[],_onFlushEffects:[],_onReady:[],onFirstSelect:[]}};function L(t){var e=this,n=(void 0===t?{initialTabs:[]}:t).initialTabs;this._data=[],n&&n.constructor===Array&&n.length&&n.map((function(t){e._addTab(t)}))}function R(t){var e=t.helper,n=t.initialState;this._helper=e,this._dispatch=null,this._setFlushState=null,this._isReady=!1,e.setNoneEnumProps(this,{state:this._helper.getCopyState(n),forceUpdateState:{},previousState:this._helper.getCopyState(n),stateRef:{}})}F.prototype.off=function(t,e){if("function"==typeof e&&Object.prototype.hasOwnProperty.call(this._publishers,t)){var n=this._publishers[t].indexOf(e);n>=0&&this._publishers[t].splice(n,1)}return this},F.prototype.on=function(t,e){return"function"==typeof e&&Object.prototype.hasOwnProperty.call(this._publishers,t)&&-1===this._publishers[t].indexOf(e)&&this._publishers[t].push(e),this},F.prototype.one=function(t,e){if("function"==typeof e&&Object.prototype.hasOwnProperty.call(this._publishers,t)){return this.on(t,(function n(){e.apply(this,arguments),this.off(t,n)}))}return this},g.setNoneEnumProps(F.prototype,{trigger:function(t,e){for(var n=arguments.length,i=new Array(n>2?n-2:0),s=2;s<n;s++)i[s-2]=arguments[s];e=e||null;var a=[],r=[].concat(this._publishers[t]);return r.map((function(t){a.push(t.apply(e,i))})),a}}),L.prototype._addTab=function(t){return this._data.push(t),this},L.prototype._removeTab=function(t){var e=this._data.findIndex((function(e){return e.id===t}));return e>=0&&this._data.splice(e,1),this},L.prototype.getTab=function(t){return this._data.find((function(e){return e.id===t}))},L.prototype._setTab=function(t,e){var n=this._data.findIndex((function(e){return e.id==t}));if(n>=0){var i=this._data[n];e.id=i.id,Object.assign(this._data[n],e)}return this},R.prototype._select=function(t){this._dispatch({type:y,tabId:t}),this.__flushEffects()},R.prototype._close=function(t){this._dispatch({type:b,tabId:t}),this.__flushEffects()},R.prototype._open=function(t){this._dispatch({type:h,tabId:t}),this.__flushEffects()},R.prototype._refresh=function(){this.forceUpdateState={},this._dispatch({type:v}),this.__flushEffects()},R.prototype.__flushEffects=function(){this._setFlushState({})},g.setNoneEnumProps(R.prototype,{updateStateRef:function(t,e){return this.stateRef=t,this._dispatch=e,this},updateState:function(t){return this.previousState=this._helper.getCopyState(this.state),this.state=this._helper.getCopyState(t),this},updateFlushState:function(t){return this._setFlushState=t,this}});m.prototype=Object.create(R.prototype),g.assingAll(m.prototype,L.prototype,F.prototype,C).constructor=m;var N=m.bind(null,(function(t){void 0===t&&(t={});var e=new w,n=new j({options:t});return R.call(this,{helper:g,initialState:n.initialState}),L.call(this,{initialTabs:n.initialTabs}),F.call(this),{activedTabsHistory:e,helper:g,optionsManager:n}}));return function(e,i){void 0===i&&(i={});var s=e(),a=s.reducer,r=s.getApiInstance,o=s.PanelList,l=s.TabList,c=s.ApiContext,u=s.StateContext,p=s.ForceUpdateContext,d=t.useRef(null);null===d.current&&(d.current={api:r(i),TabListComponent:null,PanelListComponent:null});var f=d.current.api,h=d.current,b=t.useReducer(a,f.optionsManager.initialState),y=b[0],v=b[1],g=t.useState({}),T=g[0],_=g[1];return f.updateStateRef(y,v).updateFlushState(_),t.useLayoutEffect((function(){f.updateState(y)}),[y]),t.useLayoutEffect((function(){return f.trigger("onLoad",f.userProxy),function(){f.trigger("onDestroy",f.userProxy)}}),[]),t.useLayoutEffect((function(){f.trigger("onInit",f.userProxy)})),t.useLayoutEffect((function(){f.trigger("_onReady",f.userProxy)}),[]),t.useLayoutEffect((function(){var t=f.previousState,e=f.helper.getArraysDiff(y.openTabIDs,t.openTabIDs),n=e[0],i=e[1],s=t.selectedTabID!==y.selectedTabID;f.onChange({newState:y,oldState:t,closedTabIDs:i,openedTabIDs:n,isSwitched:s})}),[y]),t.useLayoutEffect((function(){f.trigger("_onFlushEffects",f.userProxy,{currentData:f.getData(),instance:f.userProxy})}),[T]),h.TabListComponent||(h.TabListComponent=function(t){return void 0===t&&(t={}),n.default.createElement(c.Provider,{value:f},n.default.createElement(u.Provider,{value:f.stateRef},n.default.createElement(p.Provider,{value:f.forceUpdateState},n.default.createElement(l,t,"props.children"))))}),h.PanelListCompoent||(h.PanelListCompoent=function(t){return n.default.createElement(c.Provider,{value:f},n.default.createElement(u.Provider,{value:f.stateRef},n.default.createElement(p.Provider,{value:f.forceUpdateState},n.default.createElement(o,t,"props.children"))))}),[h.TabListComponent,h.PanelListCompoent,f.ready]}.bind(null,(function(){return{reducer:T,getApiInstance:function(t){return new N({options:t})},PanelList:f,TabList:u,ApiContext:i,StateContext:s,ForceUpdateContext:a}}))}));
//# sourceMappingURL=react-dyn-tabs.umd.min.js.map

@@ -20,2 +20,4 @@ "use strict";

function _readOnlyError(name) { throw new TypeError("\"" + name + "\" is read-only"); }
var PanelComponent = function PanelComponent(props) {

@@ -33,9 +35,18 @@ _react["default"].useContext(_context.ForceUpdateContext);

}),
PanelComponent = api.getTab(id).panelComponent;
previousSelectedTabID = api.state.selectedTabID,
_api$getTab = api.getTab(id),
PanelComponent = _api$getTab.panelComponent,
lazy = _api$getTab.lazy;
return /*#__PURE__*/_react["default"].createElement("div", panelProps, PanelComponent ? /*#__PURE__*/_react["default"].createElement(PanelComponent, {
var hasBeenSelected = false;
if (!lazy || isSelected || previousSelectedTabID === id || api.activedTabsHistory.tabsId.indexOf(id) >= 0) {
hasBeenSelected = true;
}
return /*#__PURE__*/_react["default"].createElement("div", panelProps, hasBeenSelected ? PanelComponent ? /*#__PURE__*/_react["default"].createElement(PanelComponent, {
id: id,
isSelected: isSelected,
api: api.userProxy
}) : null);
}) : null : null);
};

@@ -42,0 +53,0 @@

@@ -16,4 +16,2 @@ "use strict";

this._helper = helper;
this._state = this._helper.getCopyState(initialState); // it will be updated after each render
this._dispatch = null;

@@ -23,5 +21,7 @@ this._setFlushState = null;

helper.setNoneEnumProps(this, {
state: this._helper.getCopyState(initialState),
// it will be updated after each render
forceUpdateState: {},
previousState: this._helper.getCopyState(initialState),
// it is a previous value of this._state
// it is a previous value of this.state
stateRef: {} // have a same reference with state . It will be updated in each execution of useDynamicTabs.js

@@ -80,4 +80,4 @@

updateState: function updateState(state) {
this.previousState = this._helper.getCopyState(this._state);
this._state = this._helper.getCopyState(state);
this.previousState = this._helper.getCopyState(this.state);
this.state = this._helper.getCopyState(state);
return this;

@@ -84,0 +84,0 @@ },

@@ -148,2 +148,3 @@ "use strict";

disable: false,
lazy: false,
id: "tab_" + new Date().getTime()

@@ -150,0 +151,0 @@ };

@@ -0,1 +1,3 @@

import _readOnlyError from "@babel/runtime-corejs3/helpers/readOnlyError";
import _indexOfInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/index-of";
import React, { memo } from 'react';

@@ -7,3 +9,6 @@ import { ApiContext, ForceUpdateContext } from '../utils/context.js';

var PanelComponent = function PanelComponent(props) {
var _context;
React.useContext(ForceUpdateContext);
var id = props.id,

@@ -18,8 +23,18 @@ selectedTabID = props.selectedTabID,

}),
PanelComponent = api.getTab(id).panelComponent;
return /*#__PURE__*/React.createElement("div", panelProps, PanelComponent ? /*#__PURE__*/React.createElement(PanelComponent, {
previousSelectedTabID = api.state.selectedTabID,
_api$getTab = api.getTab(id),
PanelComponent = _api$getTab.panelComponent,
lazy = _api$getTab.lazy;
var hasBeenSelected = false;
if (!lazy || isSelected || previousSelectedTabID === id || _indexOfInstanceProperty(_context = api.activedTabsHistory.tabsId).call(_context, id) >= 0) {
hasBeenSelected = true;
}
return /*#__PURE__*/React.createElement("div", panelProps, hasBeenSelected ? PanelComponent ? /*#__PURE__*/React.createElement(PanelComponent, {
id: id,
isSelected: isSelected,
api: api.userProxy
}) : null);
}) : null : null);
};

@@ -26,0 +41,0 @@

@@ -8,4 +8,2 @@ import actions from '../stateManagement/actions';

this._helper = helper;
this._state = this._helper.getCopyState(initialState); // it will be updated after each render
this._dispatch = null;

@@ -15,5 +13,7 @@ this._setFlushState = null;

helper.setNoneEnumProps(this, {
state: this._helper.getCopyState(initialState),
// it will be updated after each render
forceUpdateState: {},
previousState: this._helper.getCopyState(initialState),
// it is a previous value of this._state
// it is a previous value of this.state
stateRef: {} // have a same reference with state . It will be updated in each execution of useDynamicTabs.js

@@ -72,4 +72,4 @@

updateState: function updateState(state) {
this.previousState = this._helper.getCopyState(this._state);
this._state = this._helper.getCopyState(state);
this.previousState = this._helper.getCopyState(this.state);
this.state = this._helper.getCopyState(state);
return this;

@@ -76,0 +76,0 @@ },

@@ -145,2 +145,3 @@ import _extends from "@babel/runtime-corejs3/helpers/extends";

disable: false,
lazy: false,
id: "tab_" + new Date().getTime()

@@ -147,0 +148,0 @@ };

@@ -0,1 +1,3 @@

function _readOnlyError(name) { throw new TypeError("\"" + name + "\" is read-only"); }
import React, { memo } from 'react';

@@ -8,2 +10,3 @@ import { ApiContext, ForceUpdateContext } from '../utils/context.js';

React.useContext(ForceUpdateContext);
var id = props.id,

@@ -18,8 +21,18 @@ selectedTabID = props.selectedTabID,

}),
PanelComponent = api.getTab(id).panelComponent;
return /*#__PURE__*/React.createElement("div", panelProps, PanelComponent ? /*#__PURE__*/React.createElement(PanelComponent, {
previousSelectedTabID = api.state.selectedTabID,
_api$getTab = api.getTab(id),
PanelComponent = _api$getTab.panelComponent,
lazy = _api$getTab.lazy;
var hasBeenSelected = false;
if (!lazy || isSelected || previousSelectedTabID === id || api.activedTabsHistory.tabsId.indexOf(id) >= 0) {
hasBeenSelected = true;
}
return /*#__PURE__*/React.createElement("div", panelProps, hasBeenSelected ? PanelComponent ? /*#__PURE__*/React.createElement(PanelComponent, {
id: id,
isSelected: isSelected,
api: api.userProxy
}) : null);
}) : null : null);
};

@@ -26,0 +39,0 @@

@@ -8,4 +8,2 @@ import actions from '../stateManagement/actions';

this._helper = helper;
this._state = this._helper.getCopyState(initialState); // it will be updated after each render
this._dispatch = null;

@@ -15,5 +13,7 @@ this._setFlushState = null;

helper.setNoneEnumProps(this, {
state: this._helper.getCopyState(initialState),
// it will be updated after each render
forceUpdateState: {},
previousState: this._helper.getCopyState(initialState),
// it is a previous value of this._state
// it is a previous value of this.state
stateRef: {} // have a same reference with state . It will be updated in each execution of useDynamicTabs.js

@@ -72,4 +72,4 @@

updateState: function updateState(state) {
this.previousState = this._helper.getCopyState(this._state);
this._state = this._helper.getCopyState(state);
this.previousState = this._helper.getCopyState(this.state);
this.state = this._helper.getCopyState(state);
return this;

@@ -76,0 +76,0 @@ },

@@ -139,2 +139,3 @@ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

disable: false,
lazy: false,
id: "tab_" + new Date().getTime()

@@ -141,0 +142,0 @@ };

{
"name": "react-dyn-tabs",
"version": "4.5.1",
"version": "4.6.0",
"private": false,

@@ -5,0 +5,0 @@ "author": "dev-javascript",

@@ -986,2 +986,3 @@ # react-dyn-tabs

<th>required</th>
<th>description</th>
</tr>

@@ -993,2 +994,3 @@ <tr>

<td>false</td>
<td>a unique identifier for each tab</td>
</tr>

@@ -1000,2 +1002,3 @@ <tr>

<td>false</td>
<td></td>
</tr>

@@ -1007,2 +1010,3 @@ <tr>

<td>false</td>
<td></td>
</tr>

@@ -1014,4 +1018,15 @@ <tr>

<td>false</td>
<td></td>
</tr>
<tr>
<td>lazy</td>
<td>boolean</td>
<td>false</td>
<td>false</td>
<td>
If set to false the panel will be rendered initially.
if set to true the panel will not be rendered until the tab is activated
</td>
</tr>
<tr>
<td>closable</td>

@@ -1021,2 +1036,3 @@ <td>boolean</td>

<td>false</td>
<td></td>
</tr>

@@ -1028,2 +1044,3 @@ <tr>

<td>false</td>
<td>class name for the icon</td>
</tr>

@@ -1035,2 +1052,3 @@ <tr>

<td>false</td>
<td></td>
</tr>

@@ -1048,2 +1066,3 @@ </tbody>

disable: true,
lazy: true,
iconClass: 'fa fa-home',

@@ -1062,4 +1081,54 @@ closable: false,

upcoming...
Defer loading of tab content until the tab is activated
Example 1
```js
const Panel3 = React.lazy(() => import('./components/panel3.js'));
function LazyLoadingPanel3(porps) {
return (
<Suspense fallback={<div>Loading...</div>}>
<Panel3 {...porps}></Panel3>
</Suspense>
);
}
useDynTabs({
tabs: [
{id: '1', title: 'eager loading tab 1', panelComponent: <p>panel 1</p>},
{id: '2', title: 'eager loading tab 2', lazy: true, panelComponent: <p>panel 2</p>},
{id: '3', title: 'lazy loading tab 3', lazy: true, panelComponent: LazyLoadingPanel3},
],
selectedTabID: '1',
});
```
**NOTE :**
- panel 1 is eagerly loaded and rendered.
- panel 2 is eagerly loaded but will not be rendered until tab 2 is activated.
- panel 3 will not be loaded and rendered until tab 3 is activated.
Example 2 ( using onFirstSelect event )
```js
useDynTabs({
tabs: [
{id: '1', title: 'eager loading tab 1', panelComponent: <p>panel 1</p>},
{id: '2', title: 'eager loading tab 2', lazy: true, panelComponent: <p>panel 2</p>},
{id: '3', title: 'lazy loading tab 3', lazy: true, panelComponent: <div>Loading...</div>},
],
onFirstSelect: function ({currentSelectedTabId, previousSelectedTabId}) {
const instance = this;
if (currentSelectedTabId === '3') {
import('./components/panel3.js').then((defaultExportedModule) => {
const Panel3 = defaultExportedModule.default;
instance.setTab('3', {panelComponent: Panel3});
instance.refresh();
});
}
},
selectedTabID: '1',
});
```
## Styling

@@ -1078,3 +1147,3 @@

You can find other themes at themes folder.
You can find other themes at themes folder and multiple themes example at example/multi-themes-example folder.

@@ -1081,0 +1150,0 @@ ## Caveats

@@ -0,1 +1,2 @@

/* eslint-disable react/prop-types */
import React from 'react';

@@ -28,2 +29,3 @@ import {render, unmountComponentAtNode} from 'react-dom';

selectedTabID: '1',
onFirstSelect: jest.fn(function () {}),
onSelect: jest.fn(function () {}),

@@ -39,4 +41,12 @@ onChange: jest.fn(function () {}),

};
App = function App() {
const [Tablist, Panellist, readyFunction] = useDynTabs(op);
App = function App({options}) {
const _options = Object.assign({}, op, options);
if (_options.tabs) {
const _tabs = [];
_options.tabs.map((tab) => {
_tabs.push({...tab});
});
_options.tabs = _tabs;
}
const [Tablist, Panellist, readyFunction] = useDynTabs(_options);
ready = readyFunction;

@@ -53,5 +63,5 @@ readyFunction((instanceParam) => {

};
renderApp = () => {
renderApp = (options = {}) => {
act(() => {
render(<App></App>, container);
render(<App options={options}></App>, container);
});

@@ -150,3 +160,3 @@ };

test('checking events execution count', () => {
expect.assertions(9);
expect.assertions(10);
const onSelectHandler = jest.fn(() => {});

@@ -168,2 +178,3 @@ renderApp();

expect(onSelectHandler.mock.calls.length).toBe(1);
expect(op.onFirstSelect.mock.calls.length).toBe(1);
expect(op.onSelect.mock.calls.length).toBe(1);

@@ -176,2 +187,76 @@ expect(op.onClose.mock.calls.length).toBe(1);

});
describe('lazy tabs : ', () => {
const LazyPanel = function LazyPanel() {
const Panel = React.lazy(() => import('./mock/mock-lazy-panel-1.js'));
return (
<React.Suspense fallback={<p>loading...</p>}>
<Panel></Panel>
</React.Suspense>
);
};
const renderLazyApp = () =>
renderApp({
tabs: [
{
id: '1',
title: 'mock tab 1',
lazy: true,
panelComponent: function Panel() {
return <p>tab1 content</p>;
},
},
{
id: '2',
title: 'mock tab 2',
panelComponent: function Panel() {
return <p>tab2 content</p>;
},
},
{
id: '3',
title: 'mock tab 3',
lazy: true,
panelComponent: function Panel() {
return <p>tab3 content</p>;
},
},
{
id: '4',
title: 'mock tab 4',
lazy: true,
panelComponent: LazyPanel,
},
],
});
test('lazy panels should be null initially expect selected panel', () => {
expect.assertions(16);
renderLazyApp();
expect(document.querySelector('.rc-dyn-tabs-panel[tab-id="1"] p') !== null).toBe(true);
expect(document.querySelector('.rc-dyn-tabs-panel[tab-id="2"] p') !== null).toBe(true);
expect(document.querySelector('.rc-dyn-tabs-panel[tab-id="3"] p') === null).toBe(true);
expect(document.querySelector('.rc-dyn-tabs-panel[tab-id="4"] p') === null).toBe(true);
act(() => {
instance.select('4');
instance.select('3');
});
expect(document.querySelector('.rc-dyn-tabs-panel[tab-id="1"] p') !== null).toBe(true);
expect(document.querySelector('.rc-dyn-tabs-panel[tab-id="2"] p') !== null).toBe(true);
expect(document.querySelector('.rc-dyn-tabs-panel[tab-id="3"] p') !== null).toBe(true);
expect(document.querySelector('.rc-dyn-tabs-panel[tab-id="4"] p') === null).toBe(true);
act(() => {
instance.select('4');
});
expect(document.querySelector('.rc-dyn-tabs-panel[tab-id="1"] p') !== null).toBe(true);
expect(document.querySelector('.rc-dyn-tabs-panel[tab-id="2"] p') !== null).toBe(true);
expect(document.querySelector('.rc-dyn-tabs-panel[tab-id="3"] p') !== null).toBe(true);
expect(document.querySelector('.rc-dyn-tabs-panel[tab-id="4"] p') !== null).toBe(true);
act(() => {
instance.select('3');
});
expect(document.querySelector('.rc-dyn-tabs-panel[tab-id="1"] p') !== null).toBe(true);
expect(document.querySelector('.rc-dyn-tabs-panel[tab-id="2"] p') !== null).toBe(true);
expect(document.querySelector('.rc-dyn-tabs-panel[tab-id="3"] p') !== null).toBe(true);
expect(document.querySelector('.rc-dyn-tabs-panel[tab-id="4"] p') !== null).toBe(true);
});
});
describe('calling some action inside the events options', () => {

@@ -187,2 +272,3 @@ test('select method can be called inside the onLoad option', () => {

expect(op.onChange.mock.calls.length === 1).toBe(true);
expect(op.onFirstSelect.mock.calls.length === 1).toBe(true);
expect(op.onSelect.mock.calls.length === 1).toBe(true);

@@ -438,1 +524,36 @@ });

});
describe('onFirstSelect callback : ', () => {
test('it is not triggered initially', () => {
renderApp();
expect(op.onFirstSelect.mock.calls.length).toBe(0);
});
test('it is triggered at most once per each tab, before onSelect event. if the tab has not been selected yet', () => {
renderApp();
expect(op.onFirstSelect.mock.calls.length).toBe(0);
expect(op.onSelect.mock.calls.length).toBe(0);
act(() => {
instance.select('2');
});
expect(op.onFirstSelect.mock.calls.length).toBe(1);
expect(op.onSelect.mock.calls.length).toBe(1);
expect(op.onFirstSelect).toHaveBeenCalledBefore(op.onSelect);
act(() => {
instance.select('1');
});
act(() => {
instance.select('2');
});
expect(op.onFirstSelect.mock.calls.length).toBe(1);
expect(op.onSelect.mock.calls.length).toBe(3);
});
test('onFirstSelect is called with {currentSelectedTabId,previousSelectedTabId} object as a parameter', () => {
renderApp();
act(() => {
instance.select('2');
});
expect(op.onFirstSelect.mock.calls[0][0]).toEqual({
currentSelectedTabId: '2',
previousSelectedTabId: '1',
});
});
});

@@ -11,6 +11,15 @@ import React, {memo} from 'react';

panelProps = panelPropsManager({isSelected, api, id}),
PanelComponent = api.getTab(id).panelComponent;
previousSelectedTabID = api.state.selectedTabID,
{panelComponent: PanelComponent, lazy} = api.getTab(id);
let hasBeenSelected = false;
if (!lazy || isSelected || previousSelectedTabID === id || api.activedTabsHistory.tabsId.indexOf(id) >= 0) {
hasBeenSelected = true;
}
return (
<div {...panelProps}>
{PanelComponent ? <PanelComponent id={id} isSelected={isSelected} api={api.userProxy}></PanelComponent> : null}
{hasBeenSelected ? (
PanelComponent ? (
<PanelComponent id={id} isSelected={isSelected} api={api.userProxy}></PanelComponent>
) : null
) : null}
</div>

@@ -17,0 +26,0 @@ );

@@ -37,5 +37,6 @@ import React from 'react';

});
const setMockUseContext = (op = {}) => {
const setMockUseContext = (op = {}, onCreateInstance = () => {}) => {
const defaultOp = getDefaultOptions();
const instance = new Api({options: Object.assign({}, defaultOp, op)});
onCreateInstance(instance);
React.useContext = jest.fn(() => instance);

@@ -134,2 +135,38 @@ };

});
test('lazy panels', () => {
setMockUseContext({accessibility: false}, (instance) => {
instance.state.selectedTabID = '1';
instance.activedTabsHistory.tabsId = ['3', '4'];
instance.getTab = (id) => ({
lazy: true,
panelComponent: function Panel() {
let LazyPanel;
if (id === '4') {
LazyPanel = function LazyPanel() {
const Panel = React.lazy(() => import('../mock/mock-lazy-panel-1.js'));
return (
<React.Suspense fallback={<p>loading...</p>}>
<Panel></Panel>
</React.Suspense>
);
};
return <LazyPanel></LazyPanel>;
}
return <p>{`lazy panel ${id}`}</p>;
},
});
});
const tree = renderer
.create(
<div>
<Panel id="1" selectedTabID="2"></Panel>
<Panel id="2" selectedTabID="2"></Panel>
<Panel id="3" selectedTabID="2"></Panel>
<Panel id="4" selectedTabID="2"></Panel>
<Panel id="5" selectedTabID="2"></Panel>
</div>,
)
.toJSON();
expect(tree).toMatchSnapshot();
});
});

@@ -443,3 +443,3 @@ import {apiProps, apiConstructor} from './api.factory';

});
test('In the onLoad event, return data is equal to getInitialState() and getData()', () => {
test('In the onLoad event, returned data is equal to getInitialState() and getData()', () => {
expect.assertions(3);

@@ -446,0 +446,0 @@ const _state = {selectedTabID: 'tab1', openTabIDs: ['tab1', 'tab2']};

@@ -5,3 +5,2 @@ import actions from '../stateManagement/actions';

this._helper = helper;
this._state = this._helper.getCopyState(initialState); // it will be updated after each render
this._dispatch = null;

@@ -11,4 +10,5 @@ this._setFlushState = null;

helper.setNoneEnumProps(this, {
state: this._helper.getCopyState(initialState), // it will be updated after each render
forceUpdateState: {},
previousState: this._helper.getCopyState(initialState), // it is a previous value of this._state
previousState: this._helper.getCopyState(initialState), // it is a previous value of this.state
stateRef: {}, // have a same reference with state . It will be updated in each execution of useDynamicTabs.js

@@ -44,4 +44,4 @@ });

updateState: function (state) {
this.previousState = this._helper.getCopyState(this._state);
this._state = this._helper.getCopyState(state);
this.previousState = this._helper.getCopyState(this.state);
this.state = this._helper.getCopyState(state);
return this;

@@ -48,0 +48,0 @@ },

@@ -99,2 +99,3 @@ import React from 'react';

disable: false,
lazy: false,
id: `tab_${new Date().getTime()}`,

@@ -101,0 +102,0 @@ };

@@ -82,2 +82,3 @@ import OptionManager from './optionManager.js';

disable: false,
lazy: false,
id: defaultTabData.id,

@@ -84,0 +85,0 @@ });

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc