react-dyn-tabs
Advanced tools
Comparing version 1.1.5 to 1.1.6
@@ -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)},g="".split,b=u((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==y(t)?g.call(t,""):Object(t)}:Object,m=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},_=function(t){return b(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={},U=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t},H=function(t,e,n){if(U(t),void 0===e)return t;switch(n){case 0:return function(){return t.call(e)};case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}},G=function(t){if(!T(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]={}),g=y.prototype;for(o in e)n=!F(p?o:f+(d?".":"#")+o,t.forced)&&v&&w(v,o),a=y[o],n&&(s=t.noTargetGet?(l=q(v,o))&&l.value:v[o]),i=n&&s?s:e[o],n&&typeof a==typeof i||(u=t.bind&&n?H(i,c):t.wrap&&n?z(i):h&&"function"==typeof i?H(Function.call,i):i,(t.sham||i&&i.sham||a&&a.sham)&&W(u,"sham",!0),y[o]=u,h&&(w(R,r=f+"Prototype")||W(R,r,{}),R[r][o]=i,t.real&&g&&!g[o]&&W(g,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,gt=rt("wks"),bt=c.Symbol,mt=yt?bt:bt&&bt.withoutSetter||at,_t=function(t){return w(gt,t)&&(vt||"string"==typeof gt[t])||(vt&&w(bt,t)?gt[t]=bt[t]:gt[t]=mt("Symbol."+t)),gt[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=b(h),y=H(u,l,3),g=$(v.length),m=0,_=f||Ot,T=e?_(c,g):n||a?_(c,0):void 0;g>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,Ut=function(t,e){var n=Q(t);return n<0?Ft(n+e,0):Rt(n,e)},Ht=function(t){return function(e,n,r){var o,i=_(e),a=$(i.length),s=Ut(r,a);if(t&&n!=n){for(;a>s;)if((o=i[s++])!=o)return!0}else for(;a>s;s++)if((t||s in i)&&i[s]===n)return t||s||0;return!t&&-1}},Gt={includes:Ht(!0),indexOf:Ht(!1)},Vt={},Bt=Gt.indexOf,Wt=function(t,e){var n,r=_(t),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=b(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,ge=Math.min,be=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=Ut(t,u),f=arguments.length;if(0===f?n=r=0:1===f?(n=0,r=u-l):(n=f-2,r=ge(ye(Q(e),0),u-l)),u+n-r>be)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=U(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"),Ue=Object.prototype,He=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?Ue: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=H(e,f,1+p+h),y=function(t){return r&&on(r),new an(!0,t)},g=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=g(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=g(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),He(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 gn=nt.inspectSource,bn=_t("iterator"),mn=!1;try{var _n=0,Tn={next:function(){return{done:!!_n++}},return:function(){mn=!0}};Tn[bn]=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:U(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)}},Un=function(t){Fn(t.data)},Hn=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=Un,On=H(wn.postMessage,wn,1)):c.addEventListener&&"function"==typeof postMessage&&!c.importScripts&&jn&&"file:"!==jn.protocol&&!u(Hn)?(On=Hn,c.addEventListener("message",Un,!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=U(e),this.reject=U(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(gn(dr)),vr=c.WeakMap;if(hr){var yr=nt.state||(nt.state=new vr),gr=yr.get,br=yr.has,mr=yr.set;ir=function(t,e){return e.facade=t,mr.call(yr,t,e),e},ar=function(t){return gr.call(yr,t)||{}},sr=function(t){return br.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,Ur="unhandledrejection",Hr=F(wr,(function(){if(!(gn(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=Hr||!function(t,e){if(!e&&!mn)return!1;var n=!1;try{var r={};r[bn]=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===Ur&&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(Ur,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)}}};Hr&&(jr=function(t){!function(t,e,n){if(!(t instanceof e))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation")}(this,jr,wr),U(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:Hr},{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:Hr},{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=U(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=U(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=U(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=U(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=He(He(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",go=function(){return this},bo=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),g="Array"==e&&d.entries||v;if(g&&(s=He(g.call(new t)),lo!==Object.prototype&&s.next&&(hn(s,f,!0,!0),Xe[f]=go)),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);bo(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);bo(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,Uo=function(t){var e=t.concat;return t===Ro||t instanceof Array&&e===Ro.concat?Fo:e},Ho=qt.concat("length","prototype"),Go={f:Object.getOwnPropertyNames||function(t){return Wt(t,Ho)}}.f,Vo={}.toString,Bo="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],Wo=function(t){return Bo&&"[object Window]"==Vo.call(t)?function(t){try{return Go(t)}catch(t){return Bo.slice()}}(t):Go(_(t))},qo=u((function(){return!Object.getOwnPropertyNames(1)}));Y({target:"Object",stat:!0,forced:qo},{getOwnPropertyNames:Wo});var zo=R.Object,Yo=function(t){return zo.getOwnPropertyNames(t)},Ko=u((function(){zt(1)}));Y({target:"Object",stat:!0,forced:Ko},{keys:function(t){return zt(K(t))}});var Xo=R.Object.keys;Y({target:"Object",stat:!0,forced:!l,sham:!l},{defineProperties:Ve});var Jo=o((function(t){var e=R.Object,n=t.exports=function(t,n){return e.defineProperties(t,n)};e.defineProperties.sham&&(n.sham=!0)})),Qo=[].reverse,Zo=[1,2];Y({target:"Array",proto:!0,forced:String(Zo)===String(Zo.reverse())},{reverse:function(){return tt(this)&&(this.length=this.length),Qo.call(this)}});var $o=xt("Array").reverse,ti=Array.prototype,ei=function(t){var e=t.reverse;return t===ti||t instanceof Array&&e===ti.reverse?$o:e},ni={};function ri(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),t=ni.getCopyState(t)),t;case Se:var o=t.openTabIDs,i=e.tabId;return-1===de(o).call(o,i)?(o.push(i),ni.getCopyState(t)):t;case Pe:return ni.getCopyState(t);case Ce:var a=e.tabId;return t.selectedTabID!==a?(t.selectedTabID=a,ni.getCopyState(t)):t;default:throw new Error("Undefined action type '"+e.type+"'")}}ni.checkArrIndex=function(t,e){return t>=0&&t<e},ni.getInstance=function(t){new(Me(Function.prototype).apply(t,arguments))},ni.resolve=function(t){return xo.resolve(t)},ni.getCopyState=function(t){var e,n=$t({},t);return n.hasOwnProperty("openTabIDs")&&(n.openTabIDs=Uo(e=[]).call(e,n.openTabIDs)),n},ni.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;Lt(n=Yo(e)).call(n,(function(n){t[n]=e[n]}))})),t},ni.setNoneEnumProps=function(t,e){var n,r={};return Lt(n=Xo(e)).call(n,(function(t){r[t]={writable:!0,value:e[t]}})),Jo(t,r)},ni.getArraysDiff=function(t,e){var n,r,o=Uo(n=[]).call(n,t),i=Uo(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]},ni.arrFilterUntilFirstValue=function(t,e,n){n&&ei(t).call(t);for(var r=0,o=t.length;r<o;r++)if(e(t[r],r,t))return t[r];return null},ni.throwMissingParam=function(t){throw'Missing parameter in "'+t+'" function'},ni.throwInvalidParam=function(t){throw'Invalid parameter error in "'+t+'" function'},ni.isObj=function(t){return"[object Object]"===Object.prototype.toString.call(t)},Y({target:"Object",stat:!0,sham:!l},{create:Ke});var oi=R.Object,ii=function(t,e){return oi.create(t,e)},ai=It("slice"),si=_t("species"),ci=[].slice,ui=Math.max;Y({target:"Array",proto:!0,forced:!ai},{slice:function(t,e){var n,r,o,i=_(this),a=$(i.length),s=Ut(t,a),c=Ut(void 0===e?a:e,a);if(tt(i)&&("function"!=typeof(n=i.constructor)||n!==Array&&!tt(n.prototype)?T(n)&&null===(n=n[si])&&(n=void 0):n=void 0,n===Array||void 0===n))return ci.call(i,s,c);for(r=new(void 0===n?Array:n)(ui(c-s,0)),o=0;s<c;s++,o++)s in i&&he(r,o,i[s]);return r.length=o,r}});var li=xt("Array").slice,fi=Array.prototype,pi=function(t){var e=t.slice;return t===fi||t instanceof Array&&e===fi.slice?li:e},di=Gt.includes;Y({target:"Array",proto:!0},{includes:function(t){return di(this,t,arguments.length>1?arguments[1]:void 0)}});var hi=xt("Array").includes,vi=_t("match"),yi=function(t){if(function(t){var e;return T(t)&&(void 0!==(e=t[vi])?!!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(yi(t),arguments.length>1?arguments[1]:void 0)}});var bi,mi,_i,Ti,Oi=xt("String").includes,Si=Array.prototype,wi=String.prototype,Ci=function(t){var e=t.includes;return t===Si||t instanceof Array&&e===Si.includes?hi:"string"==typeof t||t===wi||t instanceof String&&e===wi.includes?Oi:e},Pi=ni.throwMissingParam,Ii=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()},ji={_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=Xo(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=Pi("isSelected")),this._state.selectedTabID==t},isOpen:function(t){var e;return void 0===t&&(t=Pi("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=Pi("select"));var e=this._getOnChangePromise();return this._select(t),e},_findTabIdForSwitching:(bi=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)||""},mi=function(){var t;return bi.call(this,Uo(t=[]).call(t,this.activedTabsHistory.tabsId),!0)},_i=function(){var t=this._state,e=t.openTabIDs;return bi.call(this,pi(e).call(e,0,de(e).call(e,t.selectedTabID)),!0)},Ti=function(){var t=this._state,e=t.openTabIDs;return bi.call(this,pi(e).call(e,de(e).call(e,t.selectedTabID)+1))},function(){return mi.call(this)||_i.call(this)||Ti.call(this)}),open:function(t){void 0===t&&(t=Pi("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=Pi("close")),this.isSelected(t)){var e,n=Uo(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}};ni.setNoneEnumProps(ji,{getInitialState:function(){var t=this,e=this.optionsManager.options,n=e.selectedTabID,r=e.tabs,o=e.defaultPanelComponent,i=[];return Lt(r).call(r,(function(e){t._addTab(e,{defaultPanelComponent:o}),i.push(e.id)})),{selectedTabID:n,openTabIDs:i}},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;Ci(e=s.className).call(e,l)&&c&&c.lastChild&&c.lastChild==s&&Ci(n=c.className).call(n,f)?Ci(r=this.trigger("beforeClose",this.userProxy,i,a)).call(r,!1)||this.close(a):Ci(o=this.trigger("beforeSelect",this.userProxy,i,a)).call(o,!1)||this.select(a)}});var Ai=ji,xi=Qt,Ei=ni.throwMissingParam;function Di(t,e){var n=e.options,r=t().globalDefaultOptions;this._defaultOptions=r,this._validateOptions(n),this.options=xi({},this._defaultOptions,n),this._setSetting()}Di.prototype.getOption=function(t){return this.options[t]},Di.prototype.setOption=function(t,e){return void 0===t&&(t=Ei("setOption")),void 0===e&&(e=Ei("setOption")),"SELECTEDTABID"===t.toUpperCase()||this._defaultOptions.hasOwnProperty(t)&&(this.options[t]=e),this},Di.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},Di.prototype._setSetting=function(){return this.setting={tabClass:"rc-dyntabs-tab",titleClass:"rc-dyntabs-title",iconClass:"rc-dyntabs-icon",selectedClass:"rc-dyntabs-selected",hoverClass:"rc-dyntabs-hover",tablistClass:"rc-dyntabs-tablist",closeClass:"rc-dyntabs-close",panelClass:"rc-dyntabs-panel",panellistClass:"rc-dyntabs-panellist",disableClass:"rc-dyntabs-disable",ltrClass:"rc-dyntabs-ltr",rtlClass:"rc-dyntabs-rtl",panelIdTemplate:function(t){return"rc-dyn-tabs-p-"+t},ariaLabelledbyIdTemplate:function(t){return"rc-dyn-tabs-l-"+t}},this};var Li=function(t){return n.default.createElement("button",t.tabProps,t.children,t.hasOwnProperty("iconProps")&&n.default.createElement("span",t.iconProps))},Mi=function(t){void 0===t&&(t=null),this.defaultDirection="ltr",this._DefaulTabInnerComponent=t,this.directionsRange=["ltr","rtl"]};Mi.prototype.getOptions=function(){return this._getOptions()},Mi.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 Jo(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 Ni=Me(Di).call(Di,null,(function(){return{globalDefaultOptions:new Mi(Li).getOptions()}})),ki=function(){this.tabsId=[]};ki.prototype.getTab=function(){return this.tabsId.pop()},ki.prototype.reset=function(){this.tabsId=[]},ki.prototype.add=function(t){var e=this.tabsId;e[e.length-1]===t||e.push(t)};var Fi=function(){this._publishers={onChange:[],onLoad:[],onDestroy:[],onOpen:[],onClose:[],onSelect:[],beforeSelect:[],beforeClose:[],onInit:[],onFirstSelect:[]}};Fi.prototype.off=function(t,e){if("function"==typeof e&&this._publishers.hasOwnProperty(t)){var n,r,o=de(n=this._publishers[t]).call(n,e);o>=0&&Oe(r=this._publishers[t]).call(r,o,1)}return this},Fi.prototype.on=function(t,e){return"function"==typeof e&&this._publishers.hasOwnProperty(t)&&this._publishers[t].push(e),this},Fi.prototype.one=function(t,e){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},ni.setNoneEnumProps(Fi.prototype,{trigger:function(t,e){for(var n,r=arguments.length,o=new Array(r>2?r-2:0),i=2;i<r;i++)o[i-2]=arguments[i];e=e||null;var a=[],s=Uo(n=[]).call(n,this._publishers[t]);return Lt(s).call(s,(function(t){a.push(t.apply(e,o))})),a}});var Ri=Ct.findIndex,Ui="findIndex",Hi=!0;Ui in[]&&Array(1).findIndex((function(){Hi=!1})),Y({target:"Array",proto:!0,forced:Hi},{findIndex:function(t){return Ri(this,t,arguments.length>1?arguments[1]:void 0)}});var Gi=xt("Array").findIndex,Vi=Array.prototype,Bi=function(t){var e=t.findIndex;return t===Vi||t instanceof Array&&e===Vi.findIndex?Gi:e},Wi=Ct.find,qi="find",zi=!0;qi in[]&&Array(1).find((function(){zi=!1})),Y({target:"Array",proto:!0,forced:zi},{find:function(t){return Wi(this,t,arguments.length>1?arguments[1]:void 0)}});var Yi=xt("Array").find,Ki=Array.prototype,Xi=function(t){var e=t.find;return t===Ki||t instanceof Array&&e===Ki.find?Yi:e},Ji=t.memo((function(t){return t.childComponent}),(function(){return!0}));function Qi(){this._data=[]}function Zi(t){this._helper=t,this._state={},this._perviousState={},this._dispatch=function(){},t.setNoneEnumProps(this,{forceUpdateState:{},stateRef:{}})}Qi.prototype._getDefaultTabData=function(t){return{title:"unnamed tab",tooltip:"",panelComponent:t,closable:!0,iconClass:"",disable:!1,id:"tab_"+(new Date).getTime()}},Qi.prototype._addTab=function(t,e){var n=e.defaultPanelComponent;return t=xi(this._getDefaultTabData(n),t),this._data.push(t),this},Qi.prototype._removeTab=function(t){var e,n,r=Bi(e=this._data).call(e,(function(e){return e.id===t}));return r>=0&&Oe(n=this._data).call(n,r,1),this},Qi.prototype.getTab=function(t){var e;return Xi(e=this._data).call(e,(function(e){return e.id===t}))},Qi.prototype.setTab=function(t,e,r){var o;void 0===e&&(e={}),void 0===r&&(r=!0);var i=Bi(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(Ji,null,"newData.panelComponent")),xi(this._data[i],e)}return e},Zi.prototype._select=function(t){this._dispatch({type:Ce,tabId:t})},Zi.prototype._close=function(t){this._dispatch({type:we,tabId:t})},Zi.prototype._open=function(t){this._dispatch({type:Se,tabId:t})},Zi.prototype._refresh=function(){this.forceUpdateState={},this._dispatch({type:Pe})},ni.setNoneEnumProps(Zi.prototype,{updateReducer:function(t,e){this.stateRef=t,this._perviousState=this._helper.getCopyState(this._state),this._state=this._helper.getCopyState(t),this._perviousState=this._perviousState.hasOwnProperty("openTabIDs")?this._perviousState:this._helper.getCopyState(this._state),this._dispatch=e}});Ii.prototype=ii(Zi.prototype),ni.assingAll(Ii.prototype,Qi.prototype,Fi.prototype,Ai).constructor=Ii;var $i=Me(Ii).call(Ii,null,(function(t){void 0===t&&(t={});var e=new ki,n=new Ni({options:t});return Zi.call(this,ni),Qi.call(this),Fi.call(this),{activedTabsHistory:e,helper:ni,optionsManager:n}}));return function(e){var r=t.useRef(null);null===r.current&&(r.current={api:new $i({options:e}),TabListComponent:null,PanelListCompoent:null});var o=r.current.api,i=r.current,a=t.useReducer(ri,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:i.api},n.default.createElement(Nt.Provider,{value:i.api.stateRef},n.default.createElement(kt.Provider,{value:i.api.forceUpdateState},n.default.createElement(ne,t,"props.children"))))}),i.PanelListCompoent||(i.PanelListCompoent=function(t){return n.default.createElement(Mt.Provider,{value:i.api},n.default.createElement(Nt.Provider,{value:i.api.stateRef},n.default.createElement(kt.Provider,{value:i.api.forceUpdateState},n.default.createElement(ae,t,"props.children"))))}),[i.TabListComponent,i.PanelListCompoent,i.api.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)},g="".split,b=u((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==y(t)?g.call(t,""):Object(t)}:Object,m=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},_=function(t){return b(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={},U=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t},H=function(t,e,n){if(U(t),void 0===e)return t;switch(n){case 0:return function(){return t.call(e)};case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}},G=function(t){if(!T(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]={}),g=y.prototype;for(o in e)n=!F(p?o:f+(d?".":"#")+o,t.forced)&&v&&w(v,o),a=y[o],n&&(s=t.noTargetGet?(l=q(v,o))&&l.value:v[o]),i=n&&s?s:e[o],n&&typeof a==typeof i||(u=t.bind&&n?H(i,c):t.wrap&&n?z(i):h&&"function"==typeof i?H(Function.call,i):i,(t.sham||i&&i.sham||a&&a.sham)&&W(u,"sham",!0),y[o]=u,h&&(w(R,r=f+"Prototype")||W(R,r,{}),R[r][o]=i,t.real&&g&&!g[o]&&W(g,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,gt=rt("wks"),bt=c.Symbol,mt=yt?bt:bt&&bt.withoutSetter||at,_t=function(t){return w(gt,t)&&(vt||"string"==typeof gt[t])||(vt&&w(bt,t)?gt[t]=bt[t]:gt[t]=mt("Symbol."+t)),gt[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=b(h),y=H(u,l,3),g=$(v.length),m=0,_=f||Ot,T=e?_(c,g):n||a?_(c,0):void 0;g>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,Ut=function(t,e){var n=Q(t);return n<0?Ft(n+e,0):Rt(n,e)},Ht=function(t){return function(e,n,r){var o,i=_(e),a=$(i.length),s=Ut(r,a);if(t&&n!=n){for(;a>s;)if((o=i[s++])!=o)return!0}else for(;a>s;s++)if((t||s in i)&&i[s]===n)return t||s||0;return!t&&-1}},Gt={includes:Ht(!0),indexOf:Ht(!1)},Vt={},Bt=Gt.indexOf,Wt=function(t,e){var n,r=_(t),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=b(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,ge=Math.min,be=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=Ut(t,u),f=arguments.length;if(0===f?n=r=0:1===f?(n=0,r=u-l):(n=f-2,r=ge(ye(Q(e),0),u-l)),u+n-r>be)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=U(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"),Ue=Object.prototype,He=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?Ue: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=H(e,f,1+p+h),y=function(t){return r&&on(r),new an(!0,t)},g=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=g(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=g(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),He(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 gn=nt.inspectSource,bn=_t("iterator"),mn=!1;try{var _n=0,Tn={next:function(){return{done:!!_n++}},return:function(){mn=!0}};Tn[bn]=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:U(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)}},Un=function(t){Fn(t.data)},Hn=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=Un,On=H(wn.postMessage,wn,1)):c.addEventListener&&"function"==typeof postMessage&&!c.importScripts&&jn&&"file:"!==jn.protocol&&!u(Hn)?(On=Hn,c.addEventListener("message",Un,!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=U(e),this.reject=U(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(gn(dr)),vr=c.WeakMap;if(hr){var yr=nt.state||(nt.state=new vr),gr=yr.get,br=yr.has,mr=yr.set;ir=function(t,e){return e.facade=t,mr.call(yr,t,e),e},ar=function(t){return gr.call(yr,t)||{}},sr=function(t){return br.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,Ur="unhandledrejection",Hr=F(wr,(function(){if(!(gn(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=Hr||!function(t,e){if(!e&&!mn)return!1;var n=!1;try{var r={};r[bn]=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===Ur&&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(Ur,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)}}};Hr&&(jr=function(t){!function(t,e,n){if(!(t instanceof e))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation")}(this,jr,wr),U(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:Hr},{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:Hr},{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=U(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=U(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=U(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=U(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=He(He(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",go=function(){return this},bo=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),g="Array"==e&&d.entries||v;if(g&&(s=He(g.call(new t)),lo!==Object.prototype&&s.next&&(hn(s,f,!0,!0),Xe[f]=go)),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);bo(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);bo(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,Uo=function(t){var e=t.concat;return t===Ro||t instanceof Array&&e===Ro.concat?Fo:e},Ho=qt.concat("length","prototype"),Go={f:Object.getOwnPropertyNames||function(t){return Wt(t,Ho)}}.f,Vo={}.toString,Bo="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],Wo=function(t){return Bo&&"[object Window]"==Vo.call(t)?function(t){try{return Go(t)}catch(t){return Bo.slice()}}(t):Go(_(t))},qo=u((function(){return!Object.getOwnPropertyNames(1)}));Y({target:"Object",stat:!0,forced:qo},{getOwnPropertyNames:Wo});var zo=R.Object,Yo=function(t){return zo.getOwnPropertyNames(t)},Ko=u((function(){zt(1)}));Y({target:"Object",stat:!0,forced:Ko},{keys:function(t){return zt(K(t))}});var Xo=R.Object.keys;Y({target:"Object",stat:!0,forced:!l,sham:!l},{defineProperties:Ve});var Jo=o((function(t){var e=R.Object,n=t.exports=function(t,n){return e.defineProperties(t,n)};e.defineProperties.sham&&(n.sham=!0)})),Qo=[].reverse,Zo=[1,2];Y({target:"Array",proto:!0,forced:String(Zo)===String(Zo.reverse())},{reverse:function(){return tt(this)&&(this.length=this.length),Qo.call(this)}});var $o=xt("Array").reverse,ti=Array.prototype,ei=function(t){var e=t.reverse;return t===ti||t instanceof Array&&e===ti.reverse?$o:e},ni={};function ri(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),t=ni.getCopyState(t)),t;case Se:var o=t.openTabIDs,i=e.tabId;return-1===de(o).call(o,i)?(o.push(i),ni.getCopyState(t)):t;case Pe:return ni.getCopyState(t);case Ce:var a=e.tabId;return t.selectedTabID!==a?(t.selectedTabID=a,ni.getCopyState(t)):t;default:throw new Error("Undefined action type '"+e.type+"'")}}ni.checkArrIndex=function(t,e){return t>=0&&t<e},ni.getInstance=function(t){new(Me(Function.prototype).apply(t,arguments))},ni.resolve=function(t){return xo.resolve(t)},ni.getCopyState=function(t){var e,n=$t({},t);return n.hasOwnProperty("openTabIDs")&&(n.openTabIDs=Uo(e=[]).call(e,n.openTabIDs)),n},ni.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;Lt(n=Yo(e)).call(n,(function(n){t[n]=e[n]}))})),t},ni.setNoneEnumProps=function(t,e){var n,r={};return Lt(n=Xo(e)).call(n,(function(t){r[t]={writable:!0,value:e[t]}})),Jo(t,r)},ni.getArraysDiff=function(t,e){var n,r,o=Uo(n=[]).call(n,t),i=Uo(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]},ni.arrFilterUntilFirstValue=function(t,e,n){n&&ei(t).call(t);for(var r=0,o=t.length;r<o;r++)if(e(t[r],r,t))return t[r];return null},ni.throwMissingParam=function(t){throw'Missing parameter in "'+t+'" function'},ni.throwInvalidParam=function(t){throw'Invalid parameter error in "'+t+'" function'},ni.isObj=function(t){return"[object Object]"===Object.prototype.toString.call(t)},Y({target:"Object",stat:!0,sham:!l},{create:Ke});var oi=R.Object,ii=function(t,e){return oi.create(t,e)},ai=It("slice"),si=_t("species"),ci=[].slice,ui=Math.max;Y({target:"Array",proto:!0,forced:!ai},{slice:function(t,e){var n,r,o,i=_(this),a=$(i.length),s=Ut(t,a),c=Ut(void 0===e?a:e,a);if(tt(i)&&("function"!=typeof(n=i.constructor)||n!==Array&&!tt(n.prototype)?T(n)&&null===(n=n[si])&&(n=void 0):n=void 0,n===Array||void 0===n))return ci.call(i,s,c);for(r=new(void 0===n?Array:n)(ui(c-s,0)),o=0;s<c;s++,o++)s in i&&he(r,o,i[s]);return r.length=o,r}});var li=xt("Array").slice,fi=Array.prototype,pi=function(t){var e=t.slice;return t===fi||t instanceof Array&&e===fi.slice?li:e},di=Gt.includes;Y({target:"Array",proto:!0},{includes:function(t){return di(this,t,arguments.length>1?arguments[1]:void 0)}});var hi=xt("Array").includes,vi=_t("match"),yi=function(t){if(function(t){var e;return T(t)&&(void 0!==(e=t[vi])?!!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(yi(t),arguments.length>1?arguments[1]:void 0)}});var bi,mi,_i,Ti,Oi=xt("String").includes,Si=Array.prototype,wi=String.prototype,Ci=function(t){var e=t.includes;return t===Si||t instanceof Array&&e===Si.includes?hi:"string"==typeof t||t===wi||t instanceof String&&e===wi.includes?Oi:e},Pi=ni.throwMissingParam,Ii=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()},ji={_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=Xo(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=Pi("isSelected")),this._state.selectedTabID==t},isOpen:function(t){var e;return void 0===t&&(t=Pi("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=Pi("select"));var e=this._getOnChangePromise();return this._select(t),e},_findTabIdForSwitching:(bi=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)||""},mi=function(){var t;return bi.call(this,Uo(t=[]).call(t,this.activedTabsHistory.tabsId),!0)},_i=function(){var t=this._state,e=t.openTabIDs;return bi.call(this,pi(e).call(e,0,de(e).call(e,t.selectedTabID)),!0)},Ti=function(){var t=this._state,e=t.openTabIDs;return bi.call(this,pi(e).call(e,de(e).call(e,t.selectedTabID)+1))},function(){return mi.call(this)||_i.call(this)||Ti.call(this)}),open:function(t){void 0===t&&(t=Pi("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=Pi("close")),this.isSelected(t)){var e,n=Uo(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}};ni.setNoneEnumProps(ji,{getInitialState:function(){var t=this,e=this.optionsManager.options,n=e.selectedTabID,r=e.tabs,o=e.defaultPanelComponent,i=[];return Lt(r).call(r,(function(e){t._addTab(e,{defaultPanelComponent:o}),i.push(e.id)})),{selectedTabID:n,openTabIDs:i}},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;Ci(e=s.className).call(e,l)&&c&&c.lastChild&&c.lastChild==s&&Ci(n=c.className).call(n,f)?Ci(r=this.trigger("beforeClose",this.userProxy,i,a)).call(r,!1)||this.close(a):Ci(o=this.trigger("beforeSelect",this.userProxy,i,a)).call(o,!1)||this.select(a)}});var Ai=ji,xi=Qt,Ei=ni.throwMissingParam;function Di(t,e){var n=e.options,r=t().globalDefaultOptions;this._defaultOptions=r,this._validateOptions(n),this.options=xi({},this._defaultOptions,n),this._setSetting()}Di.prototype.getOption=function(t){return this.options[t]},Di.prototype.setOption=function(t,e){return void 0===t&&(t=Ei("setOption")),void 0===e&&(e=Ei("setOption")),"SELECTEDTABID"===t.toUpperCase()||this._defaultOptions.hasOwnProperty(t)&&(this.options[t]=e),this},Di.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},Di.prototype._setSetting=function(){return this.setting={tabClass:"rc-dyntabs-tab",titleClass:"rc-dyntabs-title",iconClass:"rc-dyntabs-icon",selectedClass:"rc-dyntabs-selected",hoverClass:"rc-dyntabs-hover",tablistClass:"rc-dyntabs-tablist",closeClass:"rc-dyntabs-close",panelClass:"rc-dyntabs-panel",panellistClass:"rc-dyntabs-panellist",disableClass:"rc-dyntabs-disable",ltrClass:"rc-dyntabs-ltr",rtlClass:"rc-dyntabs-rtl",panelIdTemplate:function(t){return"rc-dyn-tabs-p-"+t},ariaLabelledbyIdTemplate:function(t){return"rc-dyn-tabs-l-"+t}},this};var Li=function(t){return n.default.createElement("button",t.tabProps,t.children,t.hasOwnProperty("iconProps")&&n.default.createElement("span",t.iconProps))},Mi=function(t){void 0===t&&(t=null),this.defaultDirection="ltr",this._DefaulTabInnerComponent=t,this.directionsRange=["ltr","rtl"]};Mi.prototype.getOptions=function(){return this._getOptions()},Mi.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 Jo(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 Ni=Me(Di).call(Di,null,(function(){return{globalDefaultOptions:new Mi(Li).getOptions()}})),ki=function(){this.tabsId=[]};ki.prototype.getTab=function(){return this.tabsId.pop()},ki.prototype.reset=function(){this.tabsId=[]},ki.prototype.add=function(t){var e=this.tabsId;e[e.length-1]===t||e.push(t)};var Fi=function(){this._publishers={onChange:[],onLoad:[],onDestroy:[],onOpen:[],onClose:[],onSelect:[],beforeSelect:[],beforeClose:[],onInit:[],onFirstSelect:[]}};Fi.prototype.off=function(t,e){if("function"==typeof e&&this._publishers.hasOwnProperty(t)){var n,r,o=de(n=this._publishers[t]).call(n,e);o>=0&&Oe(r=this._publishers[t]).call(r,o,1)}return this},Fi.prototype.on=function(t,e){return"function"==typeof e&&this._publishers.hasOwnProperty(t)&&this._publishers[t].push(e),this},Fi.prototype.one=function(t,e){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},ni.setNoneEnumProps(Fi.prototype,{trigger:function(t,e){for(var n,r=arguments.length,o=new Array(r>2?r-2:0),i=2;i<r;i++)o[i-2]=arguments[i];e=e||null;var a=[],s=Uo(n=[]).call(n,this._publishers[t]);return Lt(s).call(s,(function(t){a.push(t.apply(e,o))})),a}});var Ri=Ct.findIndex,Ui="findIndex",Hi=!0;Ui in[]&&Array(1).findIndex((function(){Hi=!1})),Y({target:"Array",proto:!0,forced:Hi},{findIndex:function(t){return Ri(this,t,arguments.length>1?arguments[1]:void 0)}});var Gi=xt("Array").findIndex,Vi=Array.prototype,Bi=function(t){var e=t.findIndex;return t===Vi||t instanceof Array&&e===Vi.findIndex?Gi:e},Wi=Ct.find,qi="find",zi=!0;qi in[]&&Array(1).find((function(){zi=!1})),Y({target:"Array",proto:!0,forced:zi},{find:function(t){return Wi(this,t,arguments.length>1?arguments[1]:void 0)}});var Yi=xt("Array").find,Ki=Array.prototype,Xi=function(t){var e=t.find;return t===Ki||t instanceof Array&&e===Ki.find?Yi:e},Ji=t.memo((function(t){return t.childComponent}),(function(){return!0}));function Qi(){this._data=[]}function Zi(t){this._helper=t,this._state={},this._perviousState={},this._dispatch=function(){},t.setNoneEnumProps(this,{forceUpdateState:{},stateRef:{}})}Qi.prototype._getDefaultTabData=function(t){return{title:"unnamed tab",tooltip:"",panelComponent:t,closable:!0,iconClass:"",disable:!1,id:"tab_"+(new Date).getTime()}},Qi.prototype._addTab=function(t,e){var n=e.defaultPanelComponent;return t=xi(this._getDefaultTabData(n),t),this._data.push(t),this},Qi.prototype._removeTab=function(t){var e,n,r=Bi(e=this._data).call(e,(function(e){return e.id===t}));return r>=0&&Oe(n=this._data).call(n,r,1),this},Qi.prototype.getTab=function(t){var e;return Xi(e=this._data).call(e,(function(e){return e.id===t}))},Qi.prototype.setTab=function(t,e,r){var o;void 0===e&&(e={}),void 0===r&&(r=!0);var i=Bi(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(Ji,null,"newData.panelComponent")),xi(this._data[i],e)}return e},Zi.prototype._select=function(t){this._dispatch({type:Ce,tabId:t})},Zi.prototype._close=function(t){this._dispatch({type:we,tabId:t})},Zi.prototype._open=function(t){this._dispatch({type:Se,tabId:t})},Zi.prototype._refresh=function(){this.forceUpdateState={},this._dispatch({type:Pe})},ni.setNoneEnumProps(Zi.prototype,{updateReducer:function(t,e){this.stateRef=t,this._perviousState=this._helper.getCopyState(this._state),this._state=this._helper.getCopyState(t),this._perviousState=this._perviousState.hasOwnProperty("openTabIDs")?this._perviousState:this._helper.getCopyState(this._state),this._dispatch=e}});Ii.prototype=ii(Zi.prototype),ni.assingAll(Ii.prototype,Qi.prototype,Fi.prototype,Ai).constructor=Ii;var $i=Me(Ii).call(Ii,null,(function(t){void 0===t&&(t={});var e=new ki,n=new Ni({options:t});return Zi.call(this,ni),Qi.call(this),Fi.call(this),{activedTabsHistory:e,helper:ni,optionsManager:n}}));return function(e){var r=t.useRef(null);null===r.current&&(r.current={api:new $i({options:e}),TabListComponent:null,PanelListCompoent:null});var o=r.current.api,i=r.current,a=t.useReducer(ri,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:i.api},n.default.createElement(Nt.Provider,{value:i.api.stateRef},n.default.createElement(kt.Provider,{value:i.api.forceUpdateState},n.default.createElement(ne,t,"props.children"))))}),i.PanelListCompoent||(i.PanelListCompoent=function(t){return n.default.createElement(Mt.Provider,{value:i.api},n.default.createElement(Nt.Provider,{value:i.api.stateRef},n.default.createElement(kt.Provider,{value:i.api.forceUpdateState},n.default.createElement(ae,t,"props.children"))))}),[i.TabListComponent,i.PanelListCompoent,i.api.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),t=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?(t.selectedTabID=o,g.getCopyState(t)):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){Object.getOwnPropertyNames(e).map((function(n){t[n]=e[n]}))})),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,e=this.optionsManager.options,n=e.selectedTabID,i=e.tabs,s=e.defaultPanelComponent,a=[];return i.map((function(e){t._addTab(e,{defaultPanelComponent:s}),a.push(e.id)})),{selectedTabID:n,openTabIDs:a}},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)}});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-dyntabs-tab",titleClass:"rc-dyntabs-title",iconClass:"rc-dyntabs-icon",selectedClass:"rc-dyntabs-selected",hoverClass:"rc-dyntabs-hover",tablistClass:"rc-dyntabs-tablist",closeClass:"rc-dyntabs-close",panelClass:"rc-dyntabs-panel",panellistClass:"rc-dyntabs-panellist",disableClass:"rc-dyntabs-disable",ltrClass:"rc-dyntabs-ltr",rtlClass:"rc-dyntabs-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._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 U=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 U({options:e}),TabListComponent:null,PanelListCompoent: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:l.api},n.default.createElement(s.Provider,{value:l.api.stateRef},n.default.createElement(a.Provider,{value:l.api.forceUpdateState},n.default.createElement(c,t,"props.children"))))}),l.PanelListCompoent||(l.PanelListCompoent=function(t){return n.default.createElement(i.Provider,{value:l.api},n.default.createElement(s.Provider,{value:l.api.stateRef},n.default.createElement(a.Provider,{value:l.api.forceUpdateState},n.default.createElement(p,t,"props.children"))))}),[l.TabListComponent,l.PanelListCompoent,l.api.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);return i>=0&&(n.splice(i,1),t=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?(t.selectedTabID=o,g.getCopyState(t)):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){Object.getOwnPropertyNames(e).map((function(n){t[n]=e[n]}))})),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,e=this.optionsManager.options,n=e.selectedTabID,i=e.tabs,s=e.defaultPanelComponent,a=[];return i.map((function(e){t._addTab(e,{defaultPanelComponent:s}),a.push(e.id)})),{selectedTabID:n,openTabIDs:a}},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)}});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-dyntabs-tab",titleClass:"rc-dyntabs-title",iconClass:"rc-dyntabs-icon",selectedClass:"rc-dyntabs-selected",hoverClass:"rc-dyntabs-hover",tablistClass:"rc-dyntabs-tablist",closeClass:"rc-dyntabs-close",panelClass:"rc-dyntabs-panel",panellistClass:"rc-dyntabs-panellist",disableClass:"rc-dyntabs-disable",ltrClass:"rc-dyntabs-ltr",rtlClass:"rc-dyntabs-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._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 U=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 U({options:e}),TabListComponent:null,PanelListCompoent: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:l.api},n.default.createElement(s.Provider,{value:l.api.stateRef},n.default.createElement(a.Provider,{value:l.api.forceUpdateState},n.default.createElement(c,t,"props.children"))))}),l.PanelListCompoent||(l.PanelListCompoent=function(t){return n.default.createElement(i.Provider,{value:l.api},n.default.createElement(s.Provider,{value:l.api.stateRef},n.default.createElement(a.Provider,{value:l.api.forceUpdateState},n.default.createElement(p,t,"props.children"))))}),[l.TabListComponent,l.PanelListCompoent,l.api.userProxy]}})); | ||
//# sourceMappingURL=react-dyn-tabs.umd.min.js.map |
@@ -11,3 +11,3 @@ "use strict"; | ||
result = { | ||
className: _setting.tablistClass + ' ' + _setting[_op.direction + 'class'] | ||
className: _setting.tablistClass + ' ' + _setting[_op.direction + 'Class'] | ||
}; | ||
@@ -22,19 +22,2 @@ | ||
; // Object.create({ | ||
// get: function ({ api }) { | ||
// this._setting = api.optionsManager. ; | ||
// this._op = api.optionsManager.options; | ||
// return this._getA11Y(this._getBase()); | ||
// }, | ||
// _getBase: function () { | ||
// return { | ||
// className: this._setting.tablistClass + ' ' + | ||
// this._setting[this._op.direction + 'class'] | ||
// }; | ||
// }, | ||
// _getA11Y: function (obj) { | ||
// if (this._op.accessibility) | ||
// obj.role = 'tablist'; | ||
// return obj; | ||
// } | ||
// }); | ||
; |
@@ -6,3 +6,3 @@ export default function (_ref) { | ||
result = { | ||
className: _setting.tablistClass + ' ' + _setting[_op.direction + 'class'] | ||
className: _setting.tablistClass + ' ' + _setting[_op.direction + 'Class'] | ||
}; | ||
@@ -16,19 +16,2 @@ | ||
} | ||
; // Object.create({ | ||
// get: function ({ api }) { | ||
// this._setting = api.optionsManager. ; | ||
// this._op = api.optionsManager.options; | ||
// return this._getA11Y(this._getBase()); | ||
// }, | ||
// _getBase: function () { | ||
// return { | ||
// className: this._setting.tablistClass + ' ' + | ||
// this._setting[this._op.direction + 'class'] | ||
// }; | ||
// }, | ||
// _getA11Y: function (obj) { | ||
// if (this._op.accessibility) | ||
// obj.role = 'tablist'; | ||
// return obj; | ||
// } | ||
// }); | ||
; |
@@ -6,3 +6,3 @@ export default function (_ref) { | ||
result = { | ||
className: _setting.tablistClass + ' ' + _setting[_op.direction + 'class'] | ||
className: _setting.tablistClass + ' ' + _setting[_op.direction + 'Class'] | ||
}; | ||
@@ -16,19 +16,2 @@ | ||
} | ||
; // Object.create({ | ||
// get: function ({ api }) { | ||
// this._setting = api.optionsManager. ; | ||
// this._op = api.optionsManager.options; | ||
// return this._getA11Y(this._getBase()); | ||
// }, | ||
// _getBase: function () { | ||
// return { | ||
// className: this._setting.tablistClass + ' ' + | ||
// this._setting[this._op.direction + 'class'] | ||
// }; | ||
// }, | ||
// _getA11Y: function (obj) { | ||
// if (this._op.accessibility) | ||
// obj.role = 'tablist'; | ||
// return obj; | ||
// } | ||
// }); | ||
; |
{ | ||
"name": "react-dyn-tabs", | ||
"version": "1.1.5", | ||
"version": "1.1.6", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "author": "dev-javascript", |
@@ -5,3 +5,3 @@ export default function ({ api }) { | ||
, result = { | ||
className: _setting.tablistClass + ' ' + _setting[_op.direction + 'class'] | ||
className: _setting.tablistClass + ' ' + _setting[_op.direction + 'Class'] | ||
}; | ||
@@ -12,20 +12,2 @@ if (_op.accessibility) { | ||
return result; | ||
}; | ||
// Object.create({ | ||
// get: function ({ api }) { | ||
// this._setting = api.optionsManager. ; | ||
// this._op = api.optionsManager.options; | ||
// return this._getA11Y(this._getBase()); | ||
// }, | ||
// _getBase: function () { | ||
// return { | ||
// className: this._setting.tablistClass + ' ' + | ||
// this._setting[this._op.direction + 'class'] | ||
// }; | ||
// }, | ||
// _getA11Y: function (obj) { | ||
// if (this._op.accessibility) | ||
// obj.role = 'tablist'; | ||
// return obj; | ||
// } | ||
// }); | ||
}; |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1279150
11396