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.0.0 to 2.0.1

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},_=function(t){return g(m(t))},T=function(t){return"object"==typeof t?null!==t:"function"==typeof t},O=function(t,e){if(!T(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!T(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!T(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!T(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)},C=c.document,P=T(C)&&T(C.createElement),I=function(t){return P?C.createElement(t):{}},j=!l&&!u((function(){return 7!=Object.defineProperty(I("div"),"a",{get:function(){return 7}}).a})),A=Object.getOwnPropertyDescriptor,x={f:l?A:function(t,e){if(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={},H=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t},U=function(t,e,n){if(H(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(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?U(i,c):t.wrap&&n?z(i):h&&"function"==typeof i?U(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,_t=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]},Tt=_t("species"),Ot=function(t,e){var n;return tt(t)&&("function"!=typeof(n=t.constructor)||n!==Array&&!tt(n.prototype)?T(n)&&null===(n=n[Tt])&&(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=U(u,l,3),b=$(v.length),m=0,_=f||Ot,T=e?_(c,b):n||a?_(c,0):void 0;b>m;m++)if((s||m in v)&&(d=y(p=v[m],m,h),t))if(e)T[m]=d;else if(d)switch(t){case 3:return!0;case 5:return p;case 6:return m;case 2:St.call(T,p)}else switch(t){case 4:return!1;case 7:St.call(T,p)}return i?-1:r||o?o:T}},Ct={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=_t("species"),It=function(t){return ht>=51||!u((function(){var e=[];return(e.constructor={})[Pt]=function(){return{foo:1}},1!==e[t](Boolean).foo}))},jt=Ct.map,At=It("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,Ht=function(t,e){var n=Q(t);return n<0?Ft(n+e,0):Rt(n,e)},Ut=function(t){return function(e,n,r){var o,i=_(e),a=$(i.length),s=Ht(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:Ut(!0),indexOf:Ut(!1)},Vt={},Bt=Gt.indexOf,Wt=function(t,e){var n,r=_(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,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=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:r===o,api:i,id:r});return n.default.createElement("div",a,i.getTab(r).panelComponent)}),(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=It("splice"),ye=Math.max,be=Math.min,ge=9007199254740991,me="Maximum allowed length exceeded";Y({target:"Array",proto:!0,forced:!ve},{splice:function(t,e){var n,r,o,i,a,s,c=K(this),u=$(c.length),l=Ht(t,u),f=arguments.length;if(0===f?n=r=0:1===f?(n=0,r=u-l):(n=f-2,r=be(ye(Q(e),0),u-l)),u+n-r>ge)throw TypeError(me);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 _e=xt("Array").splice,Te=Array.prototype,Oe=function(t){var e=t.splice;return t===Te||t instanceof Array&&e===Te.splice?_e:e},Se="open",we="close",Ce="active",Pe="refresh",Ie=[].slice,je={},Ae=function(t,e,n){if(!(e in je)){for(var r=[],o=0;o<e;o++)r[o]="a["+o+"]";je[e]=Function("C,a","return new C("+r.join(",")+")")}return je[e](t,n)},xe=Function.bind||function(t){var e=H(this),n=Ie.call(arguments,1),r=function(){var o=n.concat(Ie.call(arguments));return this instanceof r?Ae(e,o.length,o):e.apply(t,o)};return T(e.prototype)&&(r.prototype=e.prototype),r};Y({target:"Function",proto:!0},{bind:xe});var Ee,De=xt("Function").bind,Le=Function.prototype,Me=function(t){var e=t.bind;return t===Le||t instanceof Function&&e===Le.bind?De:e},Ne=rt("keys"),ke=function(t){return Ne[t]||(Ne[t]=at(t))},Fe=!u((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),Re=ke("IE_PROTO"),He=Object.prototype,Ue=Fe?Object.getPrototypeOf:function(t){return t=K(t),w(t,Re)?t[Re]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?He:null},Ge=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(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),Ve=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},Be=ut("document","documentElement"),We=ke("IE_PROTO"),qe=function(){},ze=function(t){return"<script>"+t+"</"+"script>"},Ye=function(){try{Ee=document.domain&&new ActiveXObject("htmlfile")}catch(t){}var t,e;Ye=Ee?function(t){t.write(ze("")),t.close();var e=t.parentWindow.Object;return t=null,e}(Ee):((e=I("iframe")).style.display="none",Be.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(ze("document.F=Object")),t.close(),t.F);for(var n=qt.length;n--;)delete Ye.prototype[qt[n]];return Ye()};Vt[We]=!0;var Ke=Object.create||function(t,e){var n;return null!==t?(qe.prototype=G(t),n=new qe,qe.prototype=null,n[We]=t):n=Ye(),void 0===e?n:Ve(n,e)},Xe={},Je=_t("iterator"),Qe=Array.prototype,Ze={};Ze[_t("toStringTag")]="z";var $e="[object z]"===String(Ze),tn=_t("toStringTag"),en="Arguments"==y(function(){return arguments}()),nn=$e?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),tn))?n:en?y(e):"Object"==(r=y(e))&&"function"==typeof e.callee?"Arguments":r},rn=_t("iterator"),on=function(t){var e=t.return;if(void 0!==e)return G(e.call(t)).value},an=function(t,e){this.stopped=t,this.result=e},sn=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=U(e,f,1+p+h),y=function(t){return r&&on(r),new an(!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[rn]||t["@@iterator"]||Xe[nn(t)]}(t)))throw TypeError("Target is not iterable");if(void 0!==(l=o)&&(Xe.Array===l||Qe[Je]===l)){for(i=0,a=$(t.length);a>i;i++)if((s=b(t[i]))&&s instanceof an)return s;return new an(!1)}r=o.call(t)}for(c=r.next;!(u=c.call(r)).done;){try{s=b(u.value)}catch(t){throw on(r),t}if("object"==typeof s&&s&&s instanceof an)return s}return new an(!1)},cn=function(t,e){var n=this;if(!(n instanceof cn))return new cn(t,e);Ge&&(n=Ge(new Error(void 0),Ue(n))),void 0!==e&&W(n,"message",String(e));var r=[];return sn(t,r.push,{that:r}),W(n,"errors",r),n};cn.prototype=Ke(Error.prototype,{constructor:h(5,cn),message:h(5,""),name:h(5,"AggregateError")}),Y({global:!0},{AggregateError:cn});var un=c.Promise,ln=function(t,e,n,r){r&&r.enumerable?t[e]=n:W(t,e,n)},fn=$e?{}.toString:function(){return"[object "+nn(this)+"]"},pn=B.f,dn=_t("toStringTag"),hn=function(t,e,n,r){if(t){var o=n?t:t.prototype;w(o,dn)||pn(o,dn,{configurable:!0,value:e}),r&&!$e&&W(o,"toString",fn)}},vn=_t("species"),yn=Function.toString;"function"!=typeof nt.inspectSource&&(nt.inspectSource=function(t){return yn.call(t)});var bn=nt.inspectSource,gn=_t("iterator"),mn=!1;try{var _n=0,Tn={next:function(){return{done:!!_n++}},return:function(){mn=!0}};Tn[gn]=function(){return this},Array.from(Tn,(function(){throw 2}))}catch(t){}var On,Sn,wn,Cn=_t("species"),Pn=function(t,e){var n,r=G(t).constructor;return void 0===r||null==(n=G(r)[Cn])?e:H(n)},In=/(iphone|ipod|ipad).*applewebkit/i.test(lt),jn=c.location,An=c.setImmediate,xn=c.clearImmediate,En=c.process,Dn=c.MessageChannel,Ln=c.Dispatch,Mn=0,Nn={},kn="onreadystatechange",Fn=function(t){if(Nn.hasOwnProperty(t)){var e=Nn[t];delete Nn[t],e()}},Rn=function(t){return function(){Fn(t)}},Hn=function(t){Fn(t.data)},Un=function(t){c.postMessage(t+"",jn.protocol+"//"+jn.host)};An&&xn||(An=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return Nn[++Mn]=function(){("function"==typeof t?t:Function(t)).apply(void 0,e)},On(Mn),Mn},xn=function(t){delete Nn[t]},st?On=function(t){En.nextTick(Rn(t))}:Ln&&Ln.now?On=function(t){Ln.now(Rn(t))}:Dn&&!In?(wn=(Sn=new Dn).port2,Sn.port1.onmessage=Hn,On=U(wn.postMessage,wn,1)):c.addEventListener&&"function"==typeof postMessage&&!c.importScripts&&jn&&"file:"!==jn.protocol&&!u(Un)?(On=Un,c.addEventListener("message",Hn,!1)):On=kn in I("script")?function(t){Be.appendChild(I("script")).onreadystatechange=function(){Be.removeChild(this),Fn(t)}}:function(t){setTimeout(Rn(t),0)});var Gn,Vn,Bn,Wn,qn,zn,Yn,Kn,Xn={set:An,clear:xn},Jn=/web0s(?!.*chrome)/i.test(lt),Qn=x.f,Zn=Xn.set,$n=c.MutationObserver||c.WebKitMutationObserver,tr=c.document,er=c.process,nr=c.Promise,rr=Qn(c,"queueMicrotask"),or=rr&&rr.value;or||(Gn=function(){var t,e;for(st&&(t=er.domain)&&t.exit();Vn;){e=Vn.fn,Vn=Vn.next;try{e()}catch(t){throw Vn?Wn():Bn=void 0,t}}Bn=void 0,t&&t.enter()},In||st||Jn||!$n||!tr?nr&&nr.resolve?(Yn=nr.resolve(void 0),Kn=Yn.then,Wn=function(){Kn.call(Yn,Gn)}):Wn=st?function(){er.nextTick(Gn)}:function(){Zn.call(c,Gn)}:(qn=!0,zn=tr.createTextNode(""),new $n(Gn).observe(zn,{characterData:!0}),Wn=function(){zn.data=qn=!qn}));var ir,ar,sr,cr=or||function(t){var e={fn:t,next:void 0};Bn&&(Bn.next=e),Vn||(Vn=e,Wn()),Bn=e},ur=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=H(e),this.reject=H(n)},lr={f:function(t){return new ur(t)}},fr=function(t,e){if(G(t),T(e)&&e.constructor===t)return e;var n=lr.f(t);return(0,n.resolve)(e),n.promise},pr=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}},dr=c.WeakMap,hr="function"==typeof dr&&/native code/.test(bn(dr)),vr=c.WeakMap;if(hr){var yr=nt.state||(nt.state=new vr),br=yr.get,gr=yr.has,mr=yr.set;ir=function(t,e){return e.facade=t,mr.call(yr,t,e),e},ar=function(t){return br.call(yr,t)||{}},sr=function(t){return gr.call(yr,t)}}else{var _r=ke("state");Vt[_r]=!0,ir=function(t,e){return e.facade=t,W(t,_r,e),e},ar=function(t){return w(t,_r)?t[_r]:{}},sr=function(t){return w(t,_r)}}var Tr={set:ir,get:ar,has:sr,enforce:function(t){return sr(t)?ar(t):ir(t,{})},getterFor:function(t){return function(e){var n;if(!T(e)||(n=ar(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}},Or=Xn.set,Sr=_t("species"),wr="Promise",Cr=Tr.get,Pr=Tr.set,Ir=Tr.getterFor(wr),jr=un,Ar=c.TypeError,xr=c.document,Er=c.process;ut("fetch");var Dr,Lr,Mr,Nr=lr.f,kr=Nr,Fr=!!(xr&&xr.createEvent&&c.dispatchEvent),Rr="function"==typeof PromiseRejectionEvent,Hr="unhandledrejection",Ur=F(wr,(function(){if(!(bn(jr)!==String(jr))){if(66===ht)return!0;if(!st&&!Rr)return!0}if(!jr.prototype.finally)return!0;if(ht>=51&&/native code/.test(jr))return!1;var t=jr.resolve(1),e=function(t){t((function(){}),(function(){}))};return(t.constructor={})[Sr]=e,!(t.then((function(){}))instanceof e)})),Gr=Ur||!function(t,e){if(!e&&!mn)return!1;var n=!1;try{var r={};r[gn]=function(){return{next:function(){return{done:n=!0}}}},t(r)}catch(t){}return n}((function(t){jr.all(t).catch((function(){}))})),Vr=function(t){var e;return!(!T(t)||"function"!=typeof(e=t.then))&&e},Br=function(t,e){if(!t.notified){t.notified=!0;var n=t.reactions;cr((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&&Yr(t),t.rejection=1),!0===l?a=r:(d&&d.enter(),a=l(r),d&&(d.exit(),c=!0)),a===u.promise?p(Ar("Promise-chain cycle")):(s=Vr(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&&qr(t)}))}},Wr=function(t,e,n){var r,o;Fr?((r=xr.createEvent("Event")).promise=e,r.reason=n,r.initEvent(t,!1,!0),c.dispatchEvent(r)):r={promise:e,reason:n},!Rr&&(o=c["on"+t])?o(r):t===Hr&&function(t,e){var n=c.console;n&&n.error&&(1===arguments.length?n.error(t):n.error(t,e))}("Unhandled promise rejection",n)},qr=function(t){Or.call(c,(function(){var e,n=t.facade,r=t.value;if(zr(t)&&(e=pr((function(){st?Er.emit("unhandledRejection",r,n):Wr(Hr,n,r)})),t.rejection=st||zr(t)?2:1,e.error))throw e.value}))},zr=function(t){return 1!==t.rejection&&!t.parent},Yr=function(t){Or.call(c,(function(){var e=t.facade;st?Er.emit("rejectionHandled",e):Wr("rejectionhandled",e,t.value)}))},Kr=function(t,e,n){return function(r){t(e,r,n)}},Xr=function(t,e,n){t.done||(t.done=!0,n&&(t=n),t.value=e,t.state=2,Br(t,!0))},Jr=function(t,e,n){if(!t.done){t.done=!0,n&&(t=n);try{if(t.facade===e)throw Ar("Promise can't be resolved itself");var r=Vr(e);r?cr((function(){var n={done:!1};try{r.call(e,Kr(Jr,n,t),Kr(Xr,n,t))}catch(e){Xr(n,e,t)}})):(t.value=e,t.state=1,Br(t,!1))}catch(e){Xr({done:!1},e,t)}}};Ur&&(jr=function(t){!function(t,e,n){if(!(t instanceof e))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation")}(this,jr,wr),H(t),Dr.call(this);var e=Cr(this);try{t(Kr(Jr,e),Kr(Xr,e))}catch(t){Xr(e,t)}},(Dr=function(t){Pr(this,{type:wr,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]:ln(t,r,e[r],n);return t}(jr.prototype,{then:function(t,e){var n=Ir(this),r=Nr(Pn(this,jr));return r.ok="function"!=typeof t||t,r.fail="function"==typeof e&&e,r.domain=st?Er.domain:void 0,n.parent=!0,n.reactions.push(r),0!=n.state&&Br(n,!1),r.promise},catch:function(t){return this.then(void 0,t)}}),Lr=function(){var t=new Dr,e=Cr(t);this.promise=t,this.resolve=Kr(Jr,e),this.reject=Kr(Xr,e)},lr.f=Nr=function(t){return t===jr||t===Mr?new Lr(t):kr(t)}),Y({global:!0,wrap:!0,forced:Ur},{Promise:jr}),hn(jr,wr,!1,!0),function(t){var e=ut(t),n=B.f;l&&e&&!e[vn]&&n(e,vn,{configurable:!0,get:function(){return this}})}(wr),Mr=ut(wr),Y({target:wr,stat:!0,forced:Ur},{reject:function(t){var e=Nr(this);return e.reject.call(void 0,t),e.promise}}),Y({target:wr,stat:!0,forced:!0},{resolve:function(t){return fr(this===Mr?jr:this,t)}}),Y({target:wr,stat:!0,forced:Gr},{all:function(t){var e=this,n=Nr(e),r=n.resolve,o=n.reject,i=pr((function(){var n=H(e.resolve),i=[],a=0,s=1;sn(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=Nr(e),r=n.reject,o=pr((function(){var o=H(e.resolve);sn(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=lr.f(e),r=n.resolve,o=n.reject,i=pr((function(){var n=H(e.resolve),o=[],i=0,a=1;sn(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 Qr="No one promise resolved";Y({target:"Promise",stat:!0},{any:function(t){var e=this,n=lr.f(e),r=n.resolve,o=n.reject,i=pr((function(){var n=H(e.resolve),i=[],a=0,s=1,c=!1;sn(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,Qr)))}))})),--s||o(new(ut("AggregateError"))(i,Qr))}));return i.error&&o(i.value),n.promise}});var Zr=!!un&&u((function(){un.prototype.finally.call({then:function(){}},(function(){}))}));Y({target:"Promise",proto:!0,real:!0,forced:Zr},{finally:function(t){var e=Pn(this,ut("Promise")),n="function"==typeof t;return this.then(n?function(n){return fr(e,t()).then((function(){return n}))}:t,n?function(n){return fr(e,t()).then((function(){throw n}))}:t)}});var $r,to,eo,no=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}},ro={codeAt:no(!1),charAt:no(!0)},oo=_t("iterator"),io=!1;[].keys&&("next"in(eo=[].keys())?(to=Ue(Ue(eo)))!==Object.prototype&&($r=to):io=!0);var ao=null==$r||u((function(){var t={};return $r[oo].call(t)!==t}));ao&&($r={}),ao&&!w($r,oo)&&W($r,oo,(function(){return this}));var so={IteratorPrototype:$r,BUGGY_SAFARI_ITERATORS:io},co=so.IteratorPrototype,uo=function(){return this},lo=so.IteratorPrototype,fo=so.BUGGY_SAFARI_ITERATORS,po=_t("iterator"),ho="keys",vo="values",yo="entries",bo=function(){return this},go=function(t,e,n,r,o,i,a){!function(t,e,n){var r=e+" Iterator";t.prototype=Ke(co,{next:h(1,n)}),hn(t,r,!1,!0),Xe[r]=uo}(n,e,r);var s,c,u,l=function(t){if(t===o&&y)return y;if(!fo&&t in d)return d[t];switch(t){case ho:case vo:case yo:return function(){return new n(this,t)}}return function(){return new n(this)}},f=e+" Iterator",p=!1,d=t.prototype,v=d[po]||d["@@iterator"]||o&&d[o],y=!fo&&v||l(o),b="Array"==e&&d.entries||v;if(b&&(s=Ue(b.call(new t)),lo!==Object.prototype&&s.next&&(hn(s,f,!0,!0),Xe[f]=bo)),o==vo&&v&&v.name!==vo&&(p=!0,y=function(){return v.call(this)}),a&&d[po]!==y&&W(d,po,y),Xe[e]=y,o)if(c={values:l(vo),keys:i?y:l(ho),entries:l(yo)},a)for(u in c)(fo||p||!(u in d))&&ln(d,u,c[u]);else Y({target:e,proto:!0,forced:fo||p},c);return c},mo=ro.charAt,_o="String Iterator",To=Tr.set,Oo=Tr.getterFor(_o);go(String,"String",(function(t){To(this,{type:_o,string:String(t),index:0})}),(function(){var t,e=Oo(this),n=e.string,r=e.index;return r>=n.length?{value:void 0,done:!0}:(t=mo(n,r),e.index+=t.length,{value:t,done:!1})}));var So="Array Iterator",wo=Tr.set,Co=Tr.getterFor(So);go(Array,"Array",(function(t,e){wo(this,{type:So,target:_(t),index:0,kind:e})}),(function(){var t=Co(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"),Xe.Arguments=Xe.Array;var Po=_t("toStringTag");for(var Io 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 jo=c[Io],Ao=jo&&jo.prototype;Ao&&nn(Ao)!==Po&&W(Ao,Po,Io),Xe[Io]=Xe.Array}var xo=R.Promise,Eo=_t("isConcatSpreadable"),Do=9007199254740991,Lo="Maximum allowed index exceeded",Mo=ht>=51||!u((function(){var t=[];return t[Eo]=!1,t.concat()[0]!==t})),No=It("concat"),ko=function(t){if(!T(t))return!1;var e=t[Eo];return void 0!==e?!!e:tt(t)};Y({target:"Array",proto:!0,forced:!Mo||!No},{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(ko(i=-1===e?a:arguments[e])){if(c+(o=$(i.length))>Do)throw TypeError(Lo);for(n=0;n<o;n++,c++)n in i&&he(s,c,i[n])}else{if(c>=Do)throw TypeError(Lo);he(s,c++,i)}return s.length=c,s}});var Fo=xt("Array").concat,Ro=Array.prototype,Ho=function(t){var e=t.concat;return t===Ro||t instanceof Array&&e===Ro.concat?Fo:e},Uo=u((function(){zt(1)}));Y({target:"Object",stat:!0,forced:Uo},{keys:function(t){return zt(K(t))}});var Go=R.Object.keys,Vo=qt.concat("length","prototype"),Bo={f:Object.getOwnPropertyNames||function(t){return Wt(t,Vo)}}.f,Wo={}.toString,qo="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],zo=function(t){return qo&&"[object Window]"==Wo.call(t)?function(t){try{return Bo(t)}catch(t){return qo.slice()}}(t):Bo(_(t))},Yo=u((function(){return!Object.getOwnPropertyNames(1)}));Y({target:"Object",stat:!0,forced:Yo},{getOwnPropertyNames:zo});var Ko=R.Object,Xo=function(t){return Ko.getOwnPropertyNames(t)};Y({target:"Object",stat:!0,forced:!l,sham:!l},{defineProperty:B.f});var Jo=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:Ve});var Qo=o((function(t){var e=R.Object,n=t.exports=function(t,n){return e.defineProperties(t,n)};e.defineProperties.sham&&(n.sham=!0)})),Zo=[].reverse,$o=[1,2];Y({target:"Array",proto:!0,forced:String($o)===String($o.reverse())},{reverse:function(){return tt(this)&&(this.length=this.length),Zo.call(this)}});var ti=xt("Array").reverse,ei=Array.prototype,ni=function(t){var e=t.reverse;return t===ei||t instanceof Array&&e===ei.reverse?ti:e},ri={};function oi(t,e){switch(e.type){case we:var n=t.openTabIDs,r=de(n).call(n,e.tabId);return r>=0?(Oe(n).call(n,r,1),ri.getCopyState(t)):t;case Se:var o=t.openTabIDs,i=e.tabId;return-1===de(o).call(o,i)?(o.push(i),ri.getCopyState(t)):t;case Pe:return ri.getCopyState(t);case Ce:var a=e.tabId;return t.selectedTabID!==a?{selectedTabID:a,openTabIDs:t.openTabIDs}:t;default:throw new Error("Undefined action type '"+e.type+"'")}}ri.checkArrIndex=function(t,e){return t>=0&&t<e},ri.getInstance=function(t){new(Me(Function.prototype).apply(t,arguments))},ri.resolve=function(t){return xo.resolve(t)},ri.getCopyState=function(t){var e,n=$t({},t);return n.hasOwnProperty("openTabIDs")&&(n.openTabIDs=Ho(e=[]).call(e,n.openTabIDs)),n},ri.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=Go(e);Lt(n=Xo(e)).call(n,(function(n){de(r).call(r,n)>=0?t[n]=e[n]:Jo(t,n,{value:e[n],writable:!0})}))})),t},ri.setNoneEnumProps=function(t,e){var n,r={};return Lt(n=Go(e)).call(n,(function(t){r[t]={writable:!0,value:e[t]}})),Qo(t,r)},ri.getArraysDiff=function(t,e){var n,r,o=Ho(n=[]).call(n,t),i=Ho(r=[]).call(r,e);return Lt(t).call(t,(function(t){de(e).call(e,t)>=0&&(Oe(o).call(o,de(o).call(o,t),1),Oe(i).call(i,de(i).call(i,t),1))})),[o,i]},ri.arrFilterUntilFirstValue=function(t,e,n){n&&ni(t).call(t);for(var r=0,o=t.length;r<o;r++)if(e(t[r],r,t))return t[r];return null},ri.throwMissingParam=function(t){throw'Missing parameter in "'+t+'" function'},ri.throwInvalidParam=function(t){throw'Invalid parameter error in "'+t+'" function'},ri.isObj=function(t){return"[object Object]"===Object.prototype.toString.call(t)},Y({target:"Object",stat:!0,sham:!l},{create:Ke});var ii=R.Object,ai=function(t,e){return ii.create(t,e)},si=It("slice"),ci=_t("species"),ui=[].slice,li=Math.max;Y({target:"Array",proto:!0,forced:!si},{slice:function(t,e){var n,r,o,i=_(this),a=$(i.length),s=Ht(t,a),c=Ht(void 0===e?a:e,a);if(tt(i)&&("function"!=typeof(n=i.constructor)||n!==Array&&!tt(n.prototype)?T(n)&&null===(n=n[ci])&&(n=void 0):n=void 0,n===Array||void 0===n))return ui.call(i,s,c);for(r=new(void 0===n?Array:n)(li(c-s,0)),o=0;s<c;s++,o++)s in i&&he(r,o,i[s]);return r.length=o,r}});var fi=xt("Array").slice,pi=Array.prototype,di=function(t){var e=t.slice;return t===pi||t instanceof Array&&e===pi.slice?fi: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=_t("match"),bi=function(t){if(function(t){var e;return T(t)&&(void 0!==(e=t[yi])?!!e:"RegExp"==y(t))}(t))throw TypeError("The method doesn't accept regular expressions");return t},gi=_t("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,_i,Ti,Oi,Si=xt("String").includes,wi=Array.prototype,Ci=String.prototype,Pi=function(t){var e=t.includes;return t===wi||t instanceof Array&&e===wi.includes?vi:"string"==typeof t||t===Ci||t instanceof String&&e===Ci.includes?Si:e},Ii=ri.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()._subscribeOnChange()},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},_subscribeOnChange:function(){var t=this;return this.on("onChange",(function(e){var n=e.newState,r=e.oldState,o=e.closedTabsId,i=e.openedTabsId,a=e.isSwitched;i.length&&t.trigger("onOpen",t.userProxy,i),o.length&&t.trigger("onClose",t.userProxy,o),a&&t.trigger("onSelect",t.userProxy,{currentSelectedTabId:n.selectedTabID,perviousSelectedTabId:r.selectedTabID})})),this},_subscribeCallbacksOptions:function(){var t,e=this,n=this.optionsManager.options;return Lt(t=Go(this._publishers)).call(t,(function(t){e.on(t,(function(){n[t].apply(this.userProxy,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=Ii("isSelected")),this._state.selectedTabID==t},isOpen:function(t){var e;return void 0===t&&(t=Ii("isOpen")),de(e=this._state.openTabIDs).call(e,t)>=0},_getOnChangePromise:function(){var t=this;return new xo((function(e){t.one("onChange",(function(){e.call(t.userProxy)}))}))},select:function(t){void 0===t&&(t=Ii("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)||""},_i=function(){var t;return mi.call(this,Ho(t=[]).call(t,this.activedTabsHistory.tabsId),!0)},Ti=function(){var t=this._state,e=t.openTabIDs;return mi.call(this,di(e).call(e,0,de(e).call(e,t.selectedTabID)),!0)},Oi=function(){var t=this._state,e=t.openTabIDs;return mi.call(this,di(e).call(e,de(e).call(e,t.selectedTabID)+1))},function(){return _i.call(this)||Ti.call(this)||Oi.call(this)}),open:function(t){void 0===t&&(t=Ii("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=Ii("close")),this.isSelected(t)){var e,n=Ho(e=[]).call(e,this._state.openTabIDs);return Oe(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}};ri.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},eventHandlerFactory:function(t){var e,n,r,o,i=t.e,a=t.id,s=i.target,c=s.parentElement,u=this.optionsManager.setting,l=u.closeClass,f=u.tabClass;Pi(e=s.className).call(e,l)&&c&&c.lastChild&&c.lastChild==s&&Pi(n=c.className).call(n,f)?Pi(r=this.trigger("beforeClose",this.userProxy,i,a)).call(r,!1)||this.close(a):Pi(o=this.trigger("beforeSelect",this.userProxy,i,a)).call(o,!1)||this.select(a).then((function(t){})).catch((function(t){}))}});var xi=Ai,Ei=Qt,Di=ri.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:null},e=this.defaultDirection,n=this._DefaulTabInnerComponent,r=this;return Qo(t,{direction:{get:function(){return e},set:function(t){var n;if(-1===de(n=r.directionsRange).call(n,t))throw'Invalid direction value! it can be eather of "ltr" or "rtl" ';e=t},enumerable:!0},tabComponent:{get:function(){return n},set:function(t){if(t&&"function"!=typeof t)throw"tabComponent property must be type of a function.";n=t||r._DefaulTabInnerComponent},enumerable:!0}}),t};var ki=Me(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:[],beforeSelect:[],beforeClose:[],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&&Oe(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},ri.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=Ho(n=[]).call(n,this._publishers[t]);return Lt(s).call(s,(function(t){a.push(t.apply(e,o))})),a}});var Hi=Ct.findIndex,Ui="findIndex",Gi=!0;Ui in[]&&Array(1).findIndex((function(){Gi=!1})),Y({target:"Array",proto:!0,forced:Gi},{findIndex:function(t){return Hi(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=Ct.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},Qi=t.memo((function(t){return t.childComponent}),(function(){return!0}));function Zi(){this._data=[]}function $i(t){this._helper=t,this._state={},this._initialState=null,this._perviousState={},this._dispatch=function(){},t.setNoneEnumProps(this,{forceUpdateState:{},stateRef:{}})}Zi.prototype._getDefaultTabData=function(t){return{title:"unnamed tab",tooltip:"",panelComponent:t,closable:!0,iconClass:"",disable:!1,id:"tab_"+(new Date).getTime()}},Zi.prototype._addTab=function(t,e){var n=e.defaultPanelComponent;return t=Ei(this._getDefaultTabData(n),t),this._data.push(t),this},Zi.prototype._removeTab=function(t){var e,n,r=Wi(e=this._data).call(e,(function(e){return e.id===t}));return r>=0&&Oe(n=this._data).call(n,r,1),this},Zi.prototype.getTab=function(t){var e;return Ji(e=this._data).call(e,(function(e){return e.id===t}))},Zi.prototype.setTab=function(t,e,r){var o;void 0===e&&(e={}),void 0===r&&(r=!0);var i=Wi(o=this._data).call(o,(function(e){return e.id===t}));if(i>=0){var a=this._data[i];e.id=a.id,r&&e.panelComponent!==a.panelComponent&&n.default.isValidElement(e.panelComponent)&&(e.panelComponent=n.default.createElement(Qi,null,"newData.panelComponent")),Ei(this._data[i],e)}return e},$i.prototype._select=function(t){this._dispatch({type:Ce,tabId:t})},$i.prototype._close=function(t){this._dispatch({type:we,tabId:t})},$i.prototype._open=function(t){this._dispatch({type:Se,tabId:t})},$i.prototype._refresh=function(){this.forceUpdateState={},this._dispatch({type:Pe})},ri.setNoneEnumProps($i.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=ai($i.prototype),ri.assingAll(ji.prototype,Zi.prototype,Ri.prototype,xi).constructor=ji;var ta=Me(ji).call(ji,null,(function(t){void 0===t&&(t={});var e=new Fi,n=new ki({options:t});return $i.call(this,ri),Zi.call(this),Ri.call(this),{activedTabsHistory:e,helper:ri,optionsManager:n}}));return function(e){var r=t.useRef(null);null===r.current&&(r.current={api:new ta({options:e}),TabListComponent:null,PanelListComponent:null});var o=r.current.api,i=r.current,a=t.useReducer(oi,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.trigger("onChange",o.userProxy,{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:s},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,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={},H=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t},U=function(t,e,n){if(H(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?U(i,c):t.wrap&&n?z(i):h&&"function"==typeof i?U(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=U(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,Ht=function(t,e){var n=Q(t);return n<0?Ft(n+e,0):Rt(n,e)},Ut=function(t){return function(e,n,r){var o,i=T(e),a=$(i.length),s=Ht(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:Ut(!0),indexOf:Ut(!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,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=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:r===o,api:i,id:r});return n.default.createElement("div",a,i.getTab(r).panelComponent)}),(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=Ht(t,a),c=Ht(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=Ht(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=H(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,He=xt("Function").bind,Ue=Function.prototype,Ge=function(t){var e=t.bind;return t===Ue||t instanceof Function&&e===Ue.bind?He: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=U(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:H(n)},Mn=/(iphone|ipod|ipad).*applewebkit/i.test(lt),Nn=c.location,kn=c.setImmediate,Fn=c.clearImmediate,Rn=c.process,Hn=c.MessageChannel,Un=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))}:Un&&Un.now?An=function(t){Un.now(qn(t))}:Hn&&!Mn?(En=(xn=new Hn).port2,xn.port1.onmessage=zn,An=U(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=H(e),this.reject=H(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 Hr,Ur,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),H(t),Hr.call(this);var e=Dr(this);try{t(eo(ro,e),eo(no,e))}catch(t){no(e,t)}},(Hr=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)}}),Ur=function(){var t=new Hr,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 Ur(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=H(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=H(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=H(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=H(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"),Ho=9007199254740991,Uo="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))>Ho)throw TypeError(Uo);for(n=0;n<o;n++,c++)n in i&&he(s,c,i[n])}else{if(c>=Ho)throw TypeError(Uo);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()._subscribeOnChange()},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},_subscribeOnChange:function(){var t=this;return this.on("onChange",(function(e){var n=e.newState,r=e.oldState,o=e.closedTabsId,i=e.openedTabsId,a=e.isSwitched;i.length&&t.trigger("onOpen",t.userProxy,i),o.length&&t.trigger("onClose",t.userProxy,o),a&&t.trigger("onSelect",t.userProxy,{currentSelectedTabId:n.selectedTabID,perviousSelectedTabId:r.selectedTabID})})),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.userProxy,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)}),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},eventHandlerFactory:function(t){var e,n,r,o,i=t.e,a=t.id,s=i.target,c=s.parentElement,u=this.optionsManager.setting,l=u.closeClass,f=u.tabClass;Pi(e=s.className).call(e,l)&&c&&c.lastChild&&c.lastChild==s&&Pi(n=c.className).call(n,f)?Pi(r=this.trigger("beforeClose",this.userProxy,i,a)).call(r,!1)||this.close(a):Pi(o=this.trigger("beforeSelect",this.userProxy,i,a)).call(o,!1)||this.select(a).then((function(t){})).catch((function(t){}))}});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:null},e=this.defaultDirection,n=this._DefaulTabInnerComponent,r=this;return oi(t,{direction:{get:function(){return e},set:function(t){var n;if(-1===de(n=r.directionsRange).call(n,t))throw'Invalid direction value! it can be eather of "ltr" or "rtl" ';e=t},enumerable:!0},tabComponent:{get:function(){return n},set:function(t){if(t&&"function"!=typeof t)throw"tabComponent property must be type of a function.";n=t||r._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:[],beforeSelect:[],beforeClose:[],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 Hi=It.findIndex,Ui="findIndex",Gi=!0;Ui in[]&&Array(1).findIndex((function(){Gi=!1})),Y({target:"Array",proto:!0,forced:Gi},{findIndex:function(t){return Hi(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},Qi=t.memo((function(t){return t.childComponent}),(function(){return!0}));function Zi(){this._data=[]}function $i(t){this._helper=t,this._state={},this._initialState=null,this._perviousState={},this._dispatch=function(){},t.setNoneEnumProps(this,{forceUpdateState:{},stateRef:{}})}Zi.prototype._getDefaultTabData=function(t){return{title:"unnamed tab",tooltip:"",panelComponent:t,closable:!0,iconClass:"",disable:!1,id:"tab_"+(new Date).getTime()}},Zi.prototype._addTab=function(t,e){var n=e.defaultPanelComponent;return t=Ei(this._getDefaultTabData(n),t),this._data.push(t),this},Zi.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},Zi.prototype.getTab=function(t){var e;return Ji(e=this._data).call(e,(function(e){return e.id===t}))},Zi.prototype.setTab=function(t,e,r){var o;void 0===e&&(e={}),void 0===r&&(r=!0);var i=Wi(o=this._data).call(o,(function(e){return e.id===t}));if(i>=0){var a=this._data[i];e.id=a.id,r&&e.panelComponent!==a.panelComponent&&n.default.isValidElement(e.panelComponent)&&(e.panelComponent=n.default.createElement(Qi,null,"newData.panelComponent")),Ei(this._data[i],e)}return e},$i.prototype._select=function(t){this._dispatch({type:De,tabId:t})},$i.prototype._close=function(t){this._dispatch({type:Ee,tabId:t})},$i.prototype._open=function(t){this._dispatch({type:xe,tabId:t})},$i.prototype._refresh=function(){this.forceUpdateState={},this._dispatch({type:Le})},li.setNoneEnumProps($i.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($i.prototype),li.assingAll(ji.prototype,Zi.prototype,Ri.prototype,xi).constructor=ji;var ta=Ge(ji).call(ji,null,(function(t){void 0===t&&(t={});var e=new Fi,n=new ki({options:t});return $i.call(this,li),Zi.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 ta({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.trigger("onChange",o.userProxy,{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:s},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,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=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:s===o,api:r,id:s});return n.default.createElement("div",l,r.getTab(s).panelComponent)}),(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);return i>=0?(n.splice(i,1),g.getCopyState(t)):t;case d:var s=t.openTabIDs,a=e.tabId;return-1===s.indexOf(a)?(s.push(a),g.getCopyState(t)):t;case b:return g.getCopyState(t);case h:var o=e.tabId;return t.selectedTabID!==o?{selectedTabID:o,openTabIDs:t.openTabIDs}:t;default:throw new Error("Undefined action type '"+e.type+"'")}}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=g.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()._subscribeOnChange()},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},_subscribeOnChange:function(){var t=this;return this.on("onChange",(function(e){var n=e.newState,i=e.oldState,s=e.closedTabsId,a=e.openedTabsId,o=e.isSwitched;a.length&&t.trigger("onOpen",t.userProxy,a),s.length&&t.trigger("onClose",t.userProxy,s),o&&t.trigger("onSelect",t.userProxy,{currentSelectedTabId:n.selectedTabID,perviousSelectedTabId:i.selectedTabID})})),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.userProxy,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=I("isSelected")),this._state.selectedTabID==t},isOpen:function(t){return void 0===t&&(t=I("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=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)},C=function(){var t=this._state,e=t.openTabIDs;return _.call(this,e.slice(0,e.indexOf(t.selectedTabID)),!0)},T=function(){var t=this._state,e=t.openTabIDs;return _.call(this,e.slice(e.indexOf(t.selectedTabID)+1))},function(){return m.call(this)||C.call(this)||T.call(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._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(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},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)?this.trigger("beforeClose",this.userProxy,e,n).includes(!1)||this.close(n):this.trigger("beforeSelect",this.userProxy,e,n).includes(!1)||this.select(n).then((function(t){})).catch((function(t){}))}});var D=P,S=g.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:null},e=this.defaultDirection,n=this._DefaulTabInnerComponent,i=this;return Object.defineProperties(t,{direction:{get:function(){return e},set:function(t){if(-1===i.directionsRange.indexOf(t))throw'Invalid direction value! it can be eather of "ltr" or "rtl" ';e=t},enumerable:!0},tabComponent:{get:function(){return n},set:function(t){if(t&&"function"!=typeof t)throw"tabComponent property must be type of a function.";n=t||i._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:[],beforeSelect:[],beforeClose:[],onInit:[],onFirstSelect:[]}};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){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(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}});var N=t.memo((function(t){return t.childComponent}),(function(){return!0}));function R(){this._data=[]}function F(t){this._helper=t,this._state={},this._initialState=null,this._perviousState={},this._dispatch=function(){},t.setNoneEnumProps(this,{forceUpdateState:{},stateRef:{}})}R.prototype._getDefaultTabData=function(t){return{title:"unnamed tab",tooltip:"",panelComponent:t,closable:!0,iconClass:"",disable:!1,id:"tab_"+(new Date).getTime()}},R.prototype._addTab=function(t,e){var n=e.defaultPanelComponent;return t=Object.assign(this._getDefaultTabData(n),t),this._data.push(t),this},R.prototype._removeTab=function(t){var e=this._data.findIndex((function(e){return e.id===t}));return e>=0&&this._data.splice(e,1),this},R.prototype.getTab=function(t){return this._data.find((function(e){return e.id===t}))},R.prototype.setTab=function(t,e,i){void 0===e&&(e={}),void 0===i&&(i=!0);var s=this._data.findIndex((function(e){return e.id===t}));if(s>=0){var a=this._data[s];e.id=a.id,i&&e.panelComponent!==a.panelComponent&&n.default.isValidElement(e.panelComponent)&&(e.panelComponent=n.default.createElement(N,null,"newData.panelComponent")),Object.assign(this._data[s],e)}return e},F.prototype._select=function(t){this._dispatch({type:h,tabId:t})},F.prototype._close=function(t){this._dispatch({type:f,tabId:t})},F.prototype._open=function(t){this._dispatch({type:d,tabId:t})},F.prototype._refresh=function(){this.forceUpdateState={},this._dispatch({type:b})},g.setNoneEnumProps(F.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}});O.prototype=Object.create(F.prototype),g.assingAll(O.prototype,R.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 F.call(this,g),R.call(this),M.call(this),{activedTabsHistory:e,helper:g,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(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.trigger("onChange",r.userProxy,{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:d},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,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=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:s===o,api:r,id:s});return n.default.createElement("div",l,r.getTab(s).panelComponent)}),(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+"'")}}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=g.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()._subscribeOnChange()},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},_subscribeOnChange:function(){var t=this;return this.on("onChange",(function(e){var n=e.newState,i=e.oldState,s=e.closedTabsId,a=e.openedTabsId,o=e.isSwitched;a.length&&t.trigger("onOpen",t.userProxy,a),s.length&&t.trigger("onClose",t.userProxy,s),o&&t.trigger("onSelect",t.userProxy,{currentSelectedTabId:n.selectedTabID,perviousSelectedTabId:i.selectedTabID})})),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.userProxy,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=I("isSelected")),this._state.selectedTabID==t},isOpen:function(t){return void 0===t&&(t=I("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=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)},C=function(){var t=this._state,e=t.openTabIDs;return _.call(this,e.slice(0,e.indexOf(t.selectedTabID)),!0)},T=function(){var t=this._state,e=t.openTabIDs;return _.call(this,e.slice(e.indexOf(t.selectedTabID)+1))},function(){return m.call(this)||C.call(this)||T.call(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._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(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},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)?this.trigger("beforeClose",this.userProxy,e,n).includes(!1)||this.close(n):this.trigger("beforeSelect",this.userProxy,e,n).includes(!1)||this.select(n).then((function(t){})).catch((function(t){}))}});var D=P,S=g.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:null},e=this.defaultDirection,n=this._DefaulTabInnerComponent,i=this;return Object.defineProperties(t,{direction:{get:function(){return e},set:function(t){if(-1===i.directionsRange.indexOf(t))throw'Invalid direction value! it can be eather of "ltr" or "rtl" ';e=t},enumerable:!0},tabComponent:{get:function(){return n},set:function(t){if(t&&"function"!=typeof t)throw"tabComponent property must be type of a function.";n=t||i._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:[],beforeSelect:[],beforeClose:[],onInit:[],onFirstSelect:[]}};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){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(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}});var N=t.memo((function(t){return t.childComponent}),(function(){return!0}));function R(){this._data=[]}function F(t){this._helper=t,this._state={},this._initialState=null,this._perviousState={},this._dispatch=function(){},t.setNoneEnumProps(this,{forceUpdateState:{},stateRef:{}})}R.prototype._getDefaultTabData=function(t){return{title:"unnamed tab",tooltip:"",panelComponent:t,closable:!0,iconClass:"",disable:!1,id:"tab_"+(new Date).getTime()}},R.prototype._addTab=function(t,e){var n=e.defaultPanelComponent;return t=Object.assign(this._getDefaultTabData(n),t),this._data.push(t),this},R.prototype._removeTab=function(t){var e=this._data.findIndex((function(e){return e.id===t}));return e>=0&&this._data.splice(e,1),this},R.prototype.getTab=function(t){return this._data.find((function(e){return e.id===t}))},R.prototype.setTab=function(t,e,i){void 0===e&&(e={}),void 0===i&&(i=!0);var s=this._data.findIndex((function(e){return e.id===t}));if(s>=0){var a=this._data[s];e.id=a.id,i&&e.panelComponent!==a.panelComponent&&n.default.isValidElement(e.panelComponent)&&(e.panelComponent=n.default.createElement(N,null,"newData.panelComponent")),Object.assign(this._data[s],e)}return e},F.prototype._select=function(t){this._dispatch({type:h,tabId:t})},F.prototype._close=function(t){this._dispatch({type:f,tabId:t})},F.prototype._open=function(t){this._dispatch({type:d,tabId:t})},F.prototype._refresh=function(){this.forceUpdateState={},this._dispatch({type:b})},g.setNoneEnumProps(F.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}});O.prototype=Object.create(F.prototype),g.assingAll(O.prototype,R.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 F.call(this,g),R.call(this),M.call(this),{activedTabsHistory:e,helper:g,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(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.trigger("onChange",r.userProxy,{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:d},n.default.createElement(p,t,"props.children"))))}),[l.TabListComponent,l.PanelListCompoent,r.userProxy]}}));
//# sourceMappingURL=react-dyn-tabs.umd.min.js.map

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

if (removedItemIndex >= 0) {
arr.splice(removedItemIndex, 1);
return _helper["default"].getCopyState(state);
var newArr = arr.slice();
newArr.splice(removedItemIndex, 1);
return {
selectedTabID: state.selectedTabID,
openTabIDs: newArr
};
}

@@ -34,5 +38,10 @@

if (_arr.indexOf(tabId) === -1) {
_arr.push(tabId);
var _newArr = _arr.slice();
return _helper["default"].getCopyState(state);
_newArr.push(tabId);
return {
selectedTabID: state.selectedTabID,
openTabIDs: _newArr
};
}

@@ -39,0 +48,0 @@

import _indexOfInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/index-of";
import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/slice";
import _spliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/splice";

@@ -13,5 +14,10 @@ import actions from './actions.js';

if (removedItemIndex >= 0) {
_spliceInstanceProperty(arr).call(arr, removedItemIndex, 1);
var newArr = _sliceInstanceProperty(arr).call(arr);
return helper.getCopyState(state);
_spliceInstanceProperty(newArr).call(newArr, removedItemIndex, 1);
return {
selectedTabID: state.selectedTabID,
openTabIDs: newArr
};
}

@@ -28,5 +34,10 @@

if (_indexOfInstanceProperty(_arr).call(_arr, tabId) === -1) {
_arr.push(tabId);
var _newArr = _sliceInstanceProperty(_arr).call(_arr);
return helper.getCopyState(state);
_newArr.push(tabId);
return {
selectedTabID: state.selectedTabID,
openTabIDs: _newArr
};
}

@@ -33,0 +44,0 @@

@@ -11,4 +11,8 @@ import actions from './actions.js';

if (removedItemIndex >= 0) {
arr.splice(removedItemIndex, 1);
return helper.getCopyState(state);
var newArr = arr.slice();
newArr.splice(removedItemIndex, 1);
return {
selectedTabID: state.selectedTabID,
openTabIDs: newArr
};
}

@@ -25,5 +29,10 @@

if (_arr.indexOf(tabId) === -1) {
_arr.push(tabId);
var _newArr = _arr.slice();
return helper.getCopyState(state);
_newArr.push(tabId);
return {
selectedTabID: state.selectedTabID,
openTabIDs: _newArr
};
}

@@ -30,0 +39,0 @@

{
"name": "react-dyn-tabs",
"version": "2.0.0",
"version": "2.0.1",
"private": false,

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

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

if (removedItemIndex >= 0) {
arr.splice(removedItemIndex, 1);
return helper.getCopyState(state);
const newArr = arr.slice();
newArr.splice(removedItemIndex, 1);
return { selectedTabID: state.selectedTabID, openTabIDs: newArr };
}

@@ -19,4 +20,5 @@ return state;

if (arr.indexOf(tabId) === -1) {
arr.push(tabId);
return helper.getCopyState(state);
const newArr = arr.slice();
newArr.push(tabId);
return { selectedTabID: state.selectedTabID, openTabIDs: newArr };
}

@@ -23,0 +25,0 @@ return state;

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