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 2.1.1 to 2.1.2

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

@@ -40,3 +40,3 @@ "use strict";

api.updateReducer(state, dispatch);
api.updateStateRef(state).updateDispatch(dispatch).setPerviousState(state);
(0, _react.useLayoutEffect)(function () {

@@ -49,2 +49,5 @@ api.trigger('onLoad', api.userProxy);

(0, _react.useLayoutEffect)(function () {
api.updatePerviousState(state);
}, [state]);
(0, _react.useLayoutEffect)(function () {
api.trigger('onInit', api.userProxy);

@@ -51,0 +54,0 @@ });

@@ -80,5 +80,6 @@ "use strict";

this.on('onChange', function (_ref) {
var isSwitched = _ref.isSwitched,
oldState = _ref.oldState;
isSwitched && _this3.activedTabsHistory.add(oldState.selectedTabID);
var currentData = _ref.currentData,
perviousData = _ref.perviousData;
var isSwitched = perviousData.selectedTabID !== currentData.selectedTabID;
isSwitched && _this3.activedTabsHistory.add(perviousData.selectedTabID);
});

@@ -97,3 +98,3 @@ return this;

getCopyData: function getCopyData() {
return this.helper.getCopyState(this._state);
return this.helper.getCopyState(this.stateRef);
},

@@ -105,3 +106,3 @@ isSelected: function isSelected(id) {

return this._state.selectedTabID == id;
return this.stateRef.selectedTabID == id;
},

@@ -113,3 +114,3 @@ isOpen: function isOpen(id) {

return this._state.openTabIDs.indexOf(id) >= 0;
return this.stateRef.openTabIDs.indexOf(id) >= 0;
},

@@ -148,3 +149,3 @@ _getOnChangePromise: function _getOnChangePromise() {

_getPreSiblingTabId = function _getPreSiblingTabId() {
var data = this._state,
var data = this.stateRef,
arr = data.openTabIDs;

@@ -154,3 +155,3 @@ return _findOpenedAndNoneDisableTabId.call(this, arr.slice(0, arr.indexOf(data.selectedTabID)), true);

_getNextSiblingTabId = function _getNextSiblingTabId() {
var data = this._state,
var data = this.stateRef,
arr = data.openTabIDs;

@@ -203,3 +204,3 @@ return _findOpenedAndNoneDisableTabId.call(this, arr.slice(arr.indexOf(data.selectedTabID) + 1));

if (this.isSelected(id)) {
var _openTabsId = [].concat(this._state.openTabIDs);
var _openTabsId = [].concat(this.stateRef.openTabIDs);

@@ -206,0 +207,0 @@ _openTabsId.splice(_openTabsId.indexOf(id), 1);

@@ -14,11 +14,12 @@ "use strict";

this._helper = helper;
this._state = {};
this._state = null; // it will be updated after execution of useState
this._initialState = null;
this._perviousState = {};
this._perviousState = null; // it is a pervious value of this._state
this._dispatch = function () {};
this._dispatch = null;
helper.setNoneEnumProps(this, {
forceUpdateState: {},
stateRef: {}
stateRef: {} // both of stateRef and state have a same reference. It will be updated in each execution of useDynamicTabs.js
});

@@ -57,8 +58,22 @@ }

_helper["default"].setNoneEnumProps(BaseApi.prototype, {
updateReducer: function updateReducer(state, dispatch) {
updateStateRef: function updateStateRef(state) {
this.stateRef = state;
return this;
},
updateDispatch: function updateDispatch(dispatch) {
this._dispatch = dispatch;
return this;
},
setPerviousState: function setPerviousState(state) {
if (this._perviousState == null) {
this._perviousState = this._helper.getCopyState(state);
this._state = this._helper.getCopyState(state);
}
return this;
},
updatePerviousState: function updatePerviousState(state) {
this._perviousState = this._helper.getCopyState(this._state);
this._state = this._helper.getCopyState(state);
this._perviousState = this._perviousState.hasOwnProperty('openTabIDs') ? this._perviousState : this._helper.getCopyState(this._state);
this._dispatch = dispatch;
return this;
}

@@ -65,0 +80,0 @@ });

@@ -42,9 +42,6 @@ "use strict";

Pub_Sub.prototype.one = function (publisherName, fn) {
var _this = this;
if (typeof fn === 'function' && this._publishers.hasOwnProperty(publisherName)) {
var _fn = function _fn(param) {
fn(param);
_this.off(publisherName, _fn);
var _fn = function _fn() {
fn.apply(this, arguments);
this.off(publisherName, _fn);
};

@@ -51,0 +48,0 @@

@@ -5,5 +5,2 @@ "use strict";

exports["default"] = void 0;
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); }
var helper = {};

@@ -24,6 +21,7 @@

helper.getCopyState = function (state) {
var newState = _extends({}, state);
if (newState.hasOwnProperty('openTabIDs')) newState.openTabIDs = [].concat(newState.openTabIDs);
return newState;
if (!state.hasOwnProperty('openTabIDs')) state.openTabIDs = [];
return {
selectedTabID: state.selectedTabID,
openTabIDs: [].concat(state.openTabIDs)
};
};

@@ -30,0 +28,0 @@

@@ -24,3 +24,3 @@ import React, { useReducer, useLayoutEffect, useRef } from "react";

api.updateReducer(state, dispatch);
api.updateStateRef(state).updateDispatch(dispatch).setPerviousState(state);
useLayoutEffect(function () {

@@ -33,2 +33,5 @@ api.trigger('onLoad', api.userProxy);

useLayoutEffect(function () {
api.updatePerviousState(state);
}, [state]);
useLayoutEffect(function () {
api.trigger('onInit', api.userProxy);

@@ -35,0 +38,0 @@ });

@@ -79,5 +79,6 @@ import _extends from "@babel/runtime-corejs3/helpers/extends";

this.on('onChange', function (_ref) {
var isSwitched = _ref.isSwitched,
oldState = _ref.oldState;
isSwitched && _this3.activedTabsHistory.add(oldState.selectedTabID);
var currentData = _ref.currentData,
perviousData = _ref.perviousData;
var isSwitched = perviousData.selectedTabID !== currentData.selectedTabID;
isSwitched && _this3.activedTabsHistory.add(perviousData.selectedTabID);
});

@@ -96,3 +97,3 @@ return this;

getCopyData: function getCopyData() {
return this.helper.getCopyState(this._state);
return this.helper.getCopyState(this.stateRef);
},

@@ -104,3 +105,3 @@ isSelected: function isSelected(id) {

return this._state.selectedTabID == id;
return this.stateRef.selectedTabID == id;
},

@@ -114,3 +115,3 @@ isOpen: function isOpen(id) {

return _indexOfInstanceProperty(_context2 = this._state.openTabIDs).call(_context2, id) >= 0;
return _indexOfInstanceProperty(_context2 = this.stateRef.openTabIDs).call(_context2, id) >= 0;
},

@@ -151,3 +152,3 @@ _getOnChangePromise: function _getOnChangePromise() {

_getPreSiblingTabId = function _getPreSiblingTabId() {
var data = this._state,
var data = this.stateRef,
arr = data.openTabIDs;

@@ -157,3 +158,3 @@ return _findOpenedAndNoneDisableTabId.call(this, _sliceInstanceProperty(arr).call(arr, 0, _indexOfInstanceProperty(arr).call(arr, data.selectedTabID)), true);

_getNextSiblingTabId = function _getNextSiblingTabId() {
var data = this._state,
var data = this.stateRef,
arr = data.openTabIDs;

@@ -208,3 +209,3 @@ return _findOpenedAndNoneDisableTabId.call(this, _sliceInstanceProperty(arr).call(arr, _indexOfInstanceProperty(arr).call(arr, data.selectedTabID) + 1));

var _openTabsId = _concatInstanceProperty(_context4 = []).call(_context4, this._state.openTabIDs);
var _openTabsId = _concatInstanceProperty(_context4 = []).call(_context4, this.stateRef.openTabIDs);

@@ -211,0 +212,0 @@ _spliceInstanceProperty(_openTabsId).call(_openTabsId, _indexOfInstanceProperty(_openTabsId).call(_openTabsId, id), 1);

@@ -6,11 +6,12 @@ import actions from '../stateManagement/actions';

this._helper = helper;
this._state = {};
this._state = null; // it will be updated after execution of useState
this._initialState = null;
this._perviousState = {};
this._perviousState = null; // it is a pervious value of this._state
this._dispatch = function () {};
this._dispatch = null;
helper.setNoneEnumProps(this, {
forceUpdateState: {},
stateRef: {}
stateRef: {} // both of stateRef and state have a same reference. It will be updated in each execution of useDynamicTabs.js
});

@@ -49,10 +50,24 @@ }

Helper.setNoneEnumProps(BaseApi.prototype, {
updateReducer: function updateReducer(state, dispatch) {
updateStateRef: function updateStateRef(state) {
this.stateRef = state;
return this;
},
updateDispatch: function updateDispatch(dispatch) {
this._dispatch = dispatch;
return this;
},
setPerviousState: function setPerviousState(state) {
if (this._perviousState == null) {
this._perviousState = this._helper.getCopyState(state);
this._state = this._helper.getCopyState(state);
}
return this;
},
updatePerviousState: function updatePerviousState(state) {
this._perviousState = this._helper.getCopyState(this._state);
this._state = this._helper.getCopyState(state);
this._perviousState = this._perviousState.hasOwnProperty('openTabIDs') ? this._perviousState : this._helper.getCopyState(this._state);
this._dispatch = dispatch;
return this;
}
});
export default BaseApi;

@@ -41,9 +41,6 @@ import _indexOfInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/index-of";

Pub_Sub.prototype.one = function (publisherName, fn) {
var _this = this;
if (typeof fn === 'function' && this._publishers.hasOwnProperty(publisherName)) {
var _fn = function _fn(param) {
fn(param);
_this.off(publisherName, _fn);
var _fn = function _fn() {
fn.apply(this, arguments);
this.off(publisherName, _fn);
};

@@ -50,0 +47,0 @@

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

import _extends from "@babel/runtime-corejs3/helpers/extends";
import _bindInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/bind";

@@ -30,6 +29,7 @@ import _Promise from "@babel/runtime-corejs3/core-js-stable/promise";

var newState = _extends({}, state);
if (newState.hasOwnProperty('openTabIDs')) newState.openTabIDs = _concatInstanceProperty(_context = []).call(_context, newState.openTabIDs);
return newState;
if (!state.hasOwnProperty('openTabIDs')) state.openTabIDs = [];
return {
selectedTabID: state.selectedTabID,
openTabIDs: _concatInstanceProperty(_context = []).call(_context, state.openTabIDs)
};
};

@@ -36,0 +36,0 @@

@@ -24,3 +24,3 @@ import React, { useReducer, useLayoutEffect, useRef } from "react";

api.updateReducer(state, dispatch);
api.updateStateRef(state).updateDispatch(dispatch).setPerviousState(state);
useLayoutEffect(function () {

@@ -33,2 +33,5 @@ api.trigger('onLoad', api.userProxy);

useLayoutEffect(function () {
api.updatePerviousState(state);
}, [state]);
useLayoutEffect(function () {
api.trigger('onInit', api.userProxy);

@@ -35,0 +38,0 @@ });

@@ -69,5 +69,6 @@ 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); }

this.on('onChange', function (_ref) {
var isSwitched = _ref.isSwitched,
oldState = _ref.oldState;
isSwitched && _this3.activedTabsHistory.add(oldState.selectedTabID);
var currentData = _ref.currentData,
perviousData = _ref.perviousData;
var isSwitched = perviousData.selectedTabID !== currentData.selectedTabID;
isSwitched && _this3.activedTabsHistory.add(perviousData.selectedTabID);
});

@@ -86,3 +87,3 @@ return this;

getCopyData: function getCopyData() {
return this.helper.getCopyState(this._state);
return this.helper.getCopyState(this.stateRef);
},

@@ -94,3 +95,3 @@ isSelected: function isSelected(id) {

return this._state.selectedTabID == id;
return this.stateRef.selectedTabID == id;
},

@@ -102,3 +103,3 @@ isOpen: function isOpen(id) {

return this._state.openTabIDs.indexOf(id) >= 0;
return this.stateRef.openTabIDs.indexOf(id) >= 0;
},

@@ -137,3 +138,3 @@ _getOnChangePromise: function _getOnChangePromise() {

_getPreSiblingTabId = function _getPreSiblingTabId() {
var data = this._state,
var data = this.stateRef,
arr = data.openTabIDs;

@@ -143,3 +144,3 @@ return _findOpenedAndNoneDisableTabId.call(this, arr.slice(0, arr.indexOf(data.selectedTabID)), true);

_getNextSiblingTabId = function _getNextSiblingTabId() {
var data = this._state,
var data = this.stateRef,
arr = data.openTabIDs;

@@ -192,3 +193,3 @@ return _findOpenedAndNoneDisableTabId.call(this, arr.slice(arr.indexOf(data.selectedTabID) + 1));

if (this.isSelected(id)) {
var _openTabsId = [].concat(this._state.openTabIDs);
var _openTabsId = [].concat(this.stateRef.openTabIDs);

@@ -195,0 +196,0 @@ _openTabsId.splice(_openTabsId.indexOf(id), 1);

@@ -6,11 +6,12 @@ import actions from '../stateManagement/actions';

this._helper = helper;
this._state = {};
this._state = null; // it will be updated after execution of useState
this._initialState = null;
this._perviousState = {};
this._perviousState = null; // it is a pervious value of this._state
this._dispatch = function () {};
this._dispatch = null;
helper.setNoneEnumProps(this, {
forceUpdateState: {},
stateRef: {}
stateRef: {} // both of stateRef and state have a same reference. It will be updated in each execution of useDynamicTabs.js
});

@@ -49,10 +50,24 @@ }

Helper.setNoneEnumProps(BaseApi.prototype, {
updateReducer: function updateReducer(state, dispatch) {
updateStateRef: function updateStateRef(state) {
this.stateRef = state;
return this;
},
updateDispatch: function updateDispatch(dispatch) {
this._dispatch = dispatch;
return this;
},
setPerviousState: function setPerviousState(state) {
if (this._perviousState == null) {
this._perviousState = this._helper.getCopyState(state);
this._state = this._helper.getCopyState(state);
}
return this;
},
updatePerviousState: function updatePerviousState(state) {
this._perviousState = this._helper.getCopyState(this._state);
this._state = this._helper.getCopyState(state);
this._perviousState = this._perviousState.hasOwnProperty('openTabIDs') ? this._perviousState : this._helper.getCopyState(this._state);
this._dispatch = dispatch;
return this;
}
});
export default BaseApi;

@@ -35,9 +35,6 @@ import helper from '../helper.js';

Pub_Sub.prototype.one = function (publisherName, fn) {
var _this = this;
if (typeof fn === 'function' && this._publishers.hasOwnProperty(publisherName)) {
var _fn = function _fn(param) {
fn(param);
_this.off(publisherName, _fn);
var _fn = function _fn() {
fn.apply(this, arguments);
this.off(publisherName, _fn);
};

@@ -44,0 +41,0 @@

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

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); }
var helper = {};

@@ -18,6 +16,7 @@

helper.getCopyState = function (state) {
var newState = _extends({}, state);
if (newState.hasOwnProperty('openTabIDs')) newState.openTabIDs = [].concat(newState.openTabIDs);
return newState;
if (!state.hasOwnProperty('openTabIDs')) state.openTabIDs = [];
return {
selectedTabID: state.selectedTabID,
openTabIDs: [].concat(state.openTabIDs)
};
};

@@ -24,0 +23,0 @@

{
"name": "react-dyn-tabs",
"version": "2.1.1",
"version": "2.1.2",
"private": false,

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

@@ -56,6 +56,8 @@ # react-dyn-tabs

* [one](#one)
* [off](#off)
* [off](#off)
* [getCopyData](#getCopyData)
- [tabData](#tabData)
- [Lazy Loading](#lazy-loading)
- [Styling](#styling)
- [Caveats](#caveats)
- [Test](#test)

@@ -99,3 +101,6 @@ - [License](#license)

],
selectedTabID: '1'
selectedTabID: '1',
onLoad: function(){
// do sth here
}
};

@@ -301,2 +306,4 @@ const [TabList, PanelList, api] = useDynTabs(options);

Default value for panelComponent option.
<table>

@@ -385,3 +392,3 @@ <tbody>

<td>false</td>
<td>This event is fired only once</td>
<td>This event is fired only once, after first render</td>
</tr>

@@ -414,3 +421,3 @@ </tbody>

<td>false</td>
<td>This event is executed after every execution of useDynTabs hook.</td>
<td>This event is triggered after every render.</td>
</tr>

@@ -443,3 +450,3 @@ </tbody>

<td>false</td>
<td>fires when we open|close|select a tab.</td>
<td>fires when we open|close|select a tab. this event is not fired initially</td>
</tr>

@@ -608,2 +615,29 @@ </tbody>

### onDestroy
<table>
<tbody>
<tr>
<th>type</th>
<th>required</th>
<th>description</th>
</tr>
<tr>
<td>function</td>
<td>false</td>
<td>fires before destroying useDynTabs hook</td>
</tr>
</tbody>
</table>
**Example**
```js
const [ TabList , PanelList , api ] = useDynTabs({ onDestroy : function() {
// you can use 'this' here which refers to the api
}});
// or
api.setOption('onDestroy', () => { } ).refresh();
```
## Methodes

@@ -628,2 +662,4 @@

triggers 'onChange', 'onInit' and 'onOpen' event.
Return value : Promise

@@ -671,2 +707,4 @@

triggers 'onChange', 'onInit' and 'onSelect' event.
Return value : Promise

@@ -691,2 +729,4 @@

triggers 'onChange', 'onInit' and 'onClose' event.
Return value : Promise

@@ -711,2 +751,4 @@

triggers onInit event.
Return value : Promise

@@ -777,4 +819,4 @@

set tabData by id
for re-rendering immediately after this function, you should call refresh method after it.
set tabData by id.
for re-rendering immediately after this function, you should call refresh method after it.

@@ -859,3 +901,13 @@ Return value : api

### getCopyData
Return value : Object
**Example**
```js
const { selectedTabID , openTabIDs } = api.getCopyData();
```
## tabData

@@ -943,4 +995,6 @@

## Styling
react-dyn-tabs does not include any style loading by default. Default stylesheets and themes are provided and can be included in your application if desired.
```js

@@ -952,2 +1006,9 @@ import 'react-dyn-tabs/style/react-dyn-tabs.css';

## Caveats
Some actions like open, select, close and refresh cause re-rendering,
and using them immediately after calling useDynTabs hook will create an infinite loop and other bugs that most likely you don't want to cause.
you should use them inside event listeners or subscriptions.
## Test

@@ -954,0 +1015,0 @@

@@ -59,5 +59,7 @@ import React, { useState } from "react"

render(<App></App>, container);
_api.select('2');
if (_api.isSelected('2') == false)
_api.select('2');
});
expect(document.querySelector('[tab-id="2"]').className.includes('rc-dyn-tabs-selected')).toBe(true);
expect(op.onChange.mock.calls.length).toBe(1);
expect(op.onSelect.mock.calls.length).toBe(1);

@@ -80,9 +82,11 @@ expect(op.onLoad.mock.calls.length).toBe(1);

render(<App></App>, container);
_api.open({
id: '3',
title: 'mock tab 3',
closable: true,
panelComponent: <p>tab3 content</p>
});
_api.close('1');
if (_api.isOpen('3') == false)
_api.open({
id: '3',
title: 'mock tab 3',
closable: true,
panelComponent: <p>tab3 content</p>
});
if (_api.isOpen('1'))
_api.close('1');
});

@@ -111,26 +115,29 @@ expect(_api.isOpen('3')).toBe(true);

render(<App></App>, container);
_api.setTab('1', { closable: false });
_api.setOption('direction', 'rtl');
_api.setOption('tabComponent', function (props) {
return (
<a {...props.tabProps}>
{props.children}
{
props.hasOwnProperty('iconProps') &&
<span {...props.iconProps}></span>
}
</a>
);
});
_api.on('onInit', function () {
if (!counter) {
counter++;
this.setTab('1', {
panelComponent: function (props) {
return <div id="updatedPanel1"></div>;
}
}).refresh();
}
});
_api.refresh();
if (_api.getTab('1').closable == true)
_api.setTab('1', { closable: false });
if (_api.getOption('direction') === 'ltr') {
_api.setOption('direction', 'rtl');
_api.setOption('tabComponent', function (props) {
return (
<a {...props.tabProps}>
{props.children}
{
props.hasOwnProperty('iconProps') &&
<span {...props.iconProps}></span>
}
</a>
);
});
_api.on('onInit', function () {
if (!counter) {
counter++;
this.setTab('1', {
panelComponent: function (props) {
return <div id="updatedPanel1"></div>;
}
}).refresh();
}
});
_api.refresh();
}
});

@@ -145,2 +152,43 @@ expect(document.getElementById('updatedPanel1') != null).toBe(true);

});
describe("calling some action inside the events options", () => {
let _api;
test("calling select method inside the onLoad option", () => {
const op = {
tabs: [{
id: '1',
title: 'mock tab 1',
closable: true,
panelComponent: <p>tab1 content</p>
}, {
id: '2',
title: 'mock tab 2',
iconClass: 'ui-icon ui-icon-seek-end',
closable: false,
panelComponent: <p>tab2 content</p>
}],
selectedTabID: '1',
onLoad: jest.fn(function () { this.select('2'); }),
onSelect: jest.fn(function () { }),
onChange: jest.fn(function () { }),
onInit: jest.fn(function () { })
};
act(() => {
const App = function (props) {
const [Tablist, Panellist, api] = useDynTabs(op);
_api = api;
return (
<div>
<Tablist></Tablist>
<Panellist></Panellist>
</div>
);
};
render(<App></App>, container);
});
expect(op.onLoad.mock.calls.length === 1).toBe(true);
expect(op.onInit.mock.calls.length === 2).toBe(true);
expect(op.onChange.mock.calls.length === 1).toBe(true);
expect(op.onSelect.mock.calls.length === 1).toBe(true);
});
});
describe("events", () => {

@@ -190,10 +238,12 @@ test('checking events execution count and their parameters ', () => {

render(<App></App>, container);
_api.on('onSelect', onSelectHandler);
_api.open({
id: '3',
title: 'mock tab 3',
closable: true,
panelComponent: <p>tab3 content</p>
});
_api.close('1');
_api.one('onSelect', onSelectHandler);
if (_api.isOpen('3') == false)
_api.open({
id: '3',
title: 'mock tab 3',
closable: true,
panelComponent: <p>tab3 content</p>
});
if (_api.isSelected('2') == false)
_api.close('1');
});

@@ -209,2 +259,3 @@ //onload

expect(op.onChange.mock.calls[0][0].hasOwnProperty('perviousData')).toBe(true);
//onSelect

@@ -219,2 +270,3 @@ expect(onSelectHandler.mock.calls.length).toBe(1);

expect(onSelectHandler.mock.calls[0][0].hasOwnProperty('perviousSelectedTabId')).toBe(true);
//onclose

@@ -221,0 +273,0 @@ expect(op.onClose.mock.calls.length).toBe(1);

@@ -15,3 +15,3 @@

, [state, dispatch] = useReducer(reducer, api.getInitialState());
api.updateReducer(state, dispatch);
api.updateStateRef(state).updateDispatch(dispatch).setPerviousState(state);
useLayoutEffect(() => {

@@ -22,2 +22,5 @@ api.trigger('onLoad', api.userProxy);

useLayoutEffect(() => {
api.updatePerviousState(state);
}, [state]);
useLayoutEffect(() => {
api.trigger('onInit', api.userProxy);

@@ -24,0 +27,0 @@ });

@@ -36,4 +36,5 @@ import Helper from '../helper.js';

_subscribeSelectedTabsHistory: function () {
this.on('onChange', ({ isSwitched, oldState }) => {
isSwitched && this.activedTabsHistory.add(oldState.selectedTabID);
this.on('onChange', ({ currentData, perviousData }) => {
const isSwitched = perviousData.selectedTabID !== currentData.selectedTabID;
isSwitched && this.activedTabsHistory.add(perviousData.selectedTabID);
});

@@ -45,5 +46,5 @@ return this;

getCopyPerviousData: function () { return this.helper.getCopyState(this._perviousState); },
getCopyData: function () { return this.helper.getCopyState(this._state); },
isSelected: function (id = missingParamEr('isSelected')) { return this._state.selectedTabID == id; },
isOpen: function (id = missingParamEr('isOpen')) { return this._state.openTabIDs.indexOf(id) >= 0; },
getCopyData: function () { return this.helper.getCopyState(this.stateRef); },
isSelected: function (id = missingParamEr('isSelected')) { return this.stateRef.selectedTabID == id; },
isOpen: function (id = missingParamEr('isOpen')) { return this.stateRef.openTabIDs.indexOf(id) >= 0; },
_getOnChangePromise: function () {

@@ -66,7 +67,7 @@ return new (Promise)(resolve => { this.one('onChange', () => { resolve.call(this.userProxy); }); });

, _getPreSiblingTabId = function () {
const data = this._state, arr = data.openTabIDs;
const data = this.stateRef, arr = data.openTabIDs;
return _findOpenedAndNoneDisableTabId.call(this, arr.slice(0, arr.indexOf(data.selectedTabID)), true);
}
, _getNextSiblingTabId = function () {
const data = this._state, arr = data.openTabIDs;
const data = this.stateRef, arr = data.openTabIDs;
return _findOpenedAndNoneDisableTabId.call(this, arr.slice(arr.indexOf(data.selectedTabID) + 1));

@@ -100,3 +101,3 @@ };

if (this.isSelected(id)) {
const _openTabsId = [...this._state.openTabIDs];
const _openTabsId = [...this.stateRef.openTabIDs];
_openTabsId.splice(_openTabsId.indexOf(id), 1);

@@ -103,0 +104,0 @@ this.select(this._findTabIdForSwitching());

@@ -8,4 +8,12 @@ import API from './api.js';

test('list all available props for consumer', () => {
const userApiProps = `getTab,setTab,off,on,one,getOption,setOption,getCopyPerviousData,getCopyData,isSelected,isOpen,select,open,close,refresh`;
expect(Object.keys(obj.userProxy).join() === userApiProps).toBe(true);
const userApi = ['getTab', 'setTab', 'off', 'on', 'one', 'getOption', 'setOption', 'getCopyPerviousData', 'getCopyData',
'isSelected', 'isOpen', 'select', 'open', 'close', 'refresh'];
expect(Object.keys(obj.userProxy).length === userApi.length).toBe(true);
let _isEqual = true;
userApi.map((value) => {
if (!obj.userProxy.hasOwnProperty(value)) {
_isEqual = false;
}
});
expect(_isEqual).toBe(true);
});

@@ -12,0 +20,0 @@ });

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

this._helper = helper;
this._state = {};
this._state = null;// it will be updated after execution of useState
this._initialState = null;
this._perviousState = {};
this._dispatch = () => { };
this._perviousState = null;// it is a pervious value of this._state
this._dispatch = null;
helper.setNoneEnumProps(this, {
forceUpdateState: {},
stateRef: {}
stateRef: {}// both of stateRef and state have a same reference. It will be updated in each execution of useDynamicTabs.js
});

@@ -23,11 +23,20 @@ }

Helper.setNoneEnumProps(BaseApi.prototype, {
updateReducer: function (state, dispatch) {
updateStateRef: function (state) {
this.stateRef = state;
return this;
},
updateDispatch: function (dispatch) { this._dispatch = dispatch; return this; },
setPerviousState: function (state) {
if (this._perviousState == null) {
this._perviousState = this._helper.getCopyState(state);
this._state = this._helper.getCopyState(state);
}
return this;
},
updatePerviousState: function (state) {
this._perviousState = this._helper.getCopyState(this._state);
this._state = this._helper.getCopyState(state);
this._perviousState = this._perviousState.hasOwnProperty('openTabIDs') ? this._perviousState :
this._helper.getCopyState(this._state);
this._dispatch = dispatch;
return this;
}
});
export default BaseApi;

@@ -31,4 +31,4 @@ import helper from '../helper.js';

if (typeof fn === 'function' && this._publishers.hasOwnProperty(publisherName)) {
const _fn = param => {
fn(param);
const _fn = function () {
fn.apply(this, arguments);
this.off(publisherName, _fn);

@@ -35,0 +35,0 @@ };

@@ -6,6 +6,8 @@ const helper = {};

helper.getCopyState = function (state) {
const newState = { ...state };
if (newState.hasOwnProperty('openTabIDs'))
newState.openTabIDs = [...newState.openTabIDs];
return newState;
if (!state.hasOwnProperty('openTabIDs'))
state.openTabIDs = [];
return {
selectedTabID: state.selectedTabID,
openTabIDs: [...state.openTabIDs]
};
};

@@ -12,0 +14,0 @@ helper.assingAll = function (targetObj, ...sourcObjs) {

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

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