index-legacy-6d48fbf3.js 12 KB

1
  1. !function(){function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(t,n,r){return(n=function(t){var n=function(t,n){if("object"!==e(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,n||"default");if("object"!==e(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"===e(n)?n:String(n)}(n))in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t}function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,l=[],u=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(l.push(r.value),l.length!==t);u=!0);}catch(s){c=!0,i=s}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return l}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}System.register(["./index-legacy-ed52ea6c.js","./use-tab-status-legacy-eb048bb5.js","./index-legacy-5f8e6c06.js"],(function(e,r){"use strict";var i,o,a,l,u,c,s,d,f,v,p,b,h,y,g,m,x,w,S,I,k,C,B,T,A,R,z,j,O,Z,$,L,W,E,N,M,P,X,D,F,H,V,q,Y,Q,U,G,J,K,_,ee,te,ne,re,ie,oe;return{setters:[function(e){i=e.ad,o=e.aQ,a=e.bC,l=e.r,u=e.bc,c=e.ax,s=e.aE,d=e.aw,f=e.aS,v=e.c,p=e.n,b=e.m,h=e.b,y=e.d,g=e.aP,m=e.q,x=e.e,w=e.bA,S=e.a9,I=e.i,k=e.w,C=e.Y,B=e.a,T=e.bz,A=e.Z,R=e.k,z=e.t,j=e.W,O=e.au,Z=e.aX,$=e.x,L=e.X,W=e.bu,E=e.a7,N=e.aZ,M=e.y,P=e.aD,X=e.aR,D=e.o,F=e.a8,H=e.bq,V=e.bD,q=e.h,Y=e.ae,Q=e.$,U=e.bE,G=e.ar,J=e.a3,K=e.aa,_=e.ac,ee=e.aI,te=e.g,ne=e.v},function(e){re=e.T},function(e){ie=e.S,oe=e.a}],execute:function(){function r(e,t){if(c&&window.IntersectionObserver){var n=new IntersectionObserver((function(e){t(e[0].intersectionRatio>0)}),{root:document.body}),r=function(){e.value&&n.unobserve(e.value)};s(r),d(r),f((function(){e.value&&n.observe(e.value)}))}}var ae=n(v("sticky"),2),le=ae[0],ue=ae[1],ce={zIndex:p,position:b("top"),container:Object,offsetTop:h(0),offsetBottom:h(0)},se=y({name:le,props:ce,emits:["scroll","change"],setup:function(e,n){var i=n.emit,a=n.slots,u=l(),c=g(u),s=m({fixed:!1,width:0,height:0,transform:0}),d=x((function(){return w("top"===e.position?e.offsetTop:e.offsetBottom)})),f=x((function(){var e=s.fixed,t=s.height,n=s.width;if(e)return{width:"".concat(n,"px"),height:"".concat(t,"px")}})),v=x((function(){if(s.fixed){var n=S(I(e.zIndex),t({width:"".concat(s.width,"px"),height:"".concat(s.height,"px")},e.position,"".concat(d.value,"px")));return s.transform&&(n.transform="translate3d(0, ".concat(s.transform,"px, 0)")),n}})),p=function(){if(u.value&&!T(u)){var t=e.container,n=e.position,r=A(u),a=o(window);if(s.width=r.width,s.height=r.height,"top"===n)if(t){var l=A(t),c=l.bottom-d.value-s.height;s.fixed=d.value>r.top&&l.bottom>0,s.transform=c<0?c:0}else s.fixed=d.value>r.top;else{var f=document.documentElement.clientHeight;if(t){var v=A(t),p=f-v.top-d.value-s.height;s.fixed=f-d.value<r.bottom&&f>v.top,s.transform=p<0?-p:0}else s.fixed=f-d.value<r.bottom}!function(e){i("scroll",{scrollTop:e,isFixed:s.fixed})}(a)}};return k((function(){return s.fixed}),(function(e){return i("change",e)})),C("scroll",p,{target:c,passive:!0}),r(u,p),function(){var e;return B("div",{ref:u,style:f.value},[B("div",{class:ue({fixed:s.fixed}),style:v.value},[null==(e=a.default)?void 0:e.call(a)])])}}}),de=R(se),fe=n(v("tab"),2),ve=fe[0],pe=fe[1],be=y({name:ve,props:{id:String,dot:Boolean,type:String,color:String,title:String,badge:p,shrink:Boolean,isActive:Boolean,disabled:Boolean,controls:String,scrollable:Boolean,activeColor:String,inactiveColor:String,showZeroBadge:z},setup:function(e,t){var n=t.slots,r=x((function(){var t={},n=e.type,r=e.color,i=e.disabled,o=e.isActive,a=e.activeColor,l=e.inactiveColor;r&&"card"===n&&(t.borderColor=r,i||(o?t.backgroundColor=r:t.color=r));var u=o?a:l;return u&&(t.color=u),t}));return function(){return B("div",{id:e.id,role:"tab",class:[pe([e.type,{grow:e.scrollable&&!e.shrink,shrink:e.shrink,active:e.isActive,disabled:e.disabled}])],style:r.value,tabindex:e.disabled?void 0:e.isActive?0:-1,"aria-selected":e.isActive,"aria-disabled":e.disabled||void 0,"aria-controls":e.controls},[(t=B("span",{class:pe("text",{ellipsis:!e.scrollable})},[n.title?n.title():e.title]),e.dot||j(e.badge)&&""!==e.badge?B(O,{dot:e.dot,content:e.badge,showZero:e.showZeroBadge},{default:function(){return[t]}}):t)]);var t}}}),he=n(v("tabs"),2),ye=he[0],ge=he[1],me=y({name:ye,props:{count:Z(Number),inited:Boolean,animated:Boolean,duration:Z(p),swipeable:Boolean,lazyRender:Boolean,currentIndex:Z(Number)},emits:["change"],setup:function(e,t){var n=t.emit,r=t.slots,i=l(),o=function(e){return n("change",e)},a=function(t){var n=i.value;n&&n.state.active!==t&&n.swipeTo(t,{immediate:!e.inited})};return k((function(){return e.currentIndex}),a),$((function(){a(e.currentIndex)})),L({swipeRef:i}),function(){return B("div",{class:ge("content",{animated:e.animated||e.swipeable})},[(n=null==(t=r.default)?void 0:t.call(r),e.animated||e.swipeable?B(ie,{ref:i,loop:!1,class:ge("track"),duration:1e3*+e.duration,touchable:e.swipeable,lazyRender:e.lazyRender,showIndicators:!1,onChange:o},{default:function(){return[n]}}):n)]);var t,n}}}),xe=n(v("tabs"),2),we=xe[0],Se=xe[1],Ie={type:b("line"),color:String,border:Boolean,sticky:Boolean,shrink:Boolean,active:h(0),duration:h(.3),animated:Boolean,ellipsis:z,swipeable:Boolean,scrollspy:Boolean,offsetTop:h(0),background:String,lazyRender:z,lineWidth:p,lineHeight:p,beforeChange:Function,swipeThreshold:h(5),titleActiveColor:String,titleInactiveColor:String},ke=Symbol(we),Ce=y({name:we,props:Ie,emits:["change","scroll","rendered","clickTab","update:active"],setup:function(e,c){var s,d,v,p,b,h=c.emit,y=c.slots,S=l(),I=l(),R=l(),z=l(),O=W(),Z=g(S),$=n((p=l([]),b=[],u((function(){p.value=[]})),[p,function(e){return b[e]||(b[e]=function(t){p.value[e]=t}),b[e]}]),2),G=$[0],J=$[1],K=E(ke),_=K.children,ee=K.linkChildren,te=m({inited:!1,position:"",lineStyle:{},currentIndex:-1}),ne=x((function(){return _.length>+e.swipeThreshold||!e.ellipsis||e.shrink})),re=x((function(){return{borderColor:e.color,background:e.background}})),ie=function(e,t){var n;return null!=(n=e.name)?n:t},oe=x((function(){var e=_[te.currentIndex];if(e)return ie(e,te.currentIndex)})),ae=x((function(){return w(e.offsetTop)})),le=x((function(){return e.sticky?ae.value+s:0})),ue=function(t){var n=I.value,r=G.value;if(ne.value&&n&&r&&r[te.currentIndex]){var o=r[te.currentIndex].$el;!function(e,t,n){var r=0,o=e.scrollLeft,a=0===n?1:Math.round(1e3*n/16);!function n(){e.scrollLeft+=(t-o)/a,++r<a&&i(n)}()}(n,o.offsetLeft-(n.offsetWidth-o.offsetWidth)/2,t?0:+e.duration)}},ce=function(){var t=te.inited;M((function(){var n=G.value;if(n&&n[te.currentIndex]&&"line"===e.type&&!T(S.value)){var r=n[te.currentIndex].$el,i=e.lineWidth,o=e.lineHeight,a=r.offsetLeft+r.offsetWidth/2,l={width:D(i),backgroundColor:e.color,transform:"translateX(".concat(a,"px) translateX(-50%)")};if(t&&(l.transitionDuration="".concat(e.duration,"s")),j(o)){var u=D(o);l.height=u,l.borderRadius=u}te.lineStyle=l}}))},se=function(t,n){var r=function(e){for(var t=e<te.currentIndex?-1:1;e>=0&&e<_.length;){if(!_[e].disabled)return e;e+=t}}(t);if(j(r)){var i=_[r],o=ie(i,r),a=null!==te.currentIndex;te.currentIndex!==r&&(te.currentIndex=r,n||ue(),ce()),o!==e.active&&(h("update:active",o),a&&h("change",o,i.title)),v&&!e.scrollspy&&H(Math.ceil(V(S.value)-ae.value))}},fe=function(e,t){var n=_.find((function(t,n){return ie(t,n)===e})),r=n?_.indexOf(n):0;se(r,t)},ve=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e.scrollspy){var n=_[te.currentIndex].$el;if(n&&Z.value){var r=V(n,Z.value)-le.value;d=!0,function(e,t,n,r){var l=o(e),u=l<t,c=0===n?1:Math.round(1e3*n/16),s=(t-l)/c;!function n(){l+=s,(u&&l>t||!u&&l<t)&&(l=t),a(e,l),u&&l<t||!u&&l>t?i(n):r&&i(r)}()}(Z.value,r,t?0:+e.duration,(function(){d=!1}))}}},pe=function(e){v=e.isFixed,h("scroll",e)},he=function(){return _.map((function(t,n){return B(be,q({key:t.id,id:"".concat(O,"-").concat(n),ref:J(n),type:e.type,color:e.color,style:t.titleStyle,class:t.titleClass,shrink:e.shrink,isActive:n===te.currentIndex,controls:t.id,scrollable:ne.value,activeColor:e.titleActiveColor,inactiveColor:e.titleInactiveColor,onClick:function(r){return function(t,n,r){var i=_[n],o=i.title,a=i.disabled,l=ie(_[n],n);a||(Q(e.beforeChange,{args:[l],done:function(){se(n),ve()}}),U(t)),h("clickTab",{name:l,title:o,event:r,disabled:a})}(t,n,r)}},Y(t,["dot","badge","title","disabled","showZeroBadge"])),{title:t.$slots.title})}))},ye=function(){if("line"===e.type&&_.length)return B("div",{class:Se("line"),style:te.lineStyle},null)},ge=function(){var n,r,i,o=e.type,a=e.border,l=e.sticky,u=[B("div",{ref:l?void 0:R,class:[Se("wrap"),t({},F,"line"===o&&a)]},[B("div",{ref:I,role:"tablist",class:Se("nav",[o,{shrink:e.shrink,complete:ne.value}]),style:re.value,"aria-orientation":"horizontal"},[null==(n=y["nav-left"])?void 0:n.call(y),he(),ye(),null==(r=y["nav-right"])?void 0:r.call(y)])]),null==(i=y["nav-bottom"])?void 0:i.call(y)];return l?B("div",{ref:R},[u]):u};k([function(){return e.color},N],ce),k((function(){return e.active}),(function(e){e!==oe.value&&fe(e)})),k((function(){return _.length}),(function(){te.inited&&(fe(e.active),ce(),M((function(){ue(!0)})))}));return L({resize:function(){ce(),M((function(){var e,t;return null==(t=null==(e=z.value)?void 0:e.swipeRef.value)?void 0:t.resize()}))},scrollTo:function(e){M((function(){fe(e),ve(!0)}))}}),P(ce),X(ce),f((function(){fe(e.active,!0),M((function(){te.inited=!0,R.value&&(s=A(R.value).height),ue(!0)}))})),r(S,ce),C("scroll",(function(){if(e.scrollspy&&!d){var t=function(){for(var e=0;e<_.length;e++)if(A(_[e].$el).top>le.value)return 0===e?0:e-1;return _.length-1}();se(t)}}),{target:Z,passive:!0}),ee({id:O,props:e,setLine:ce,onRendered:function(e,t){return h("rendered",e,t)},currentName:oe,scrollIntoView:ue}),function(){return B("div",{ref:S,class:Se([e.type])},[e.sticky?B(de,{container:S.value,offsetTop:ae.value,onScroll:pe},{default:function(){return[ge()]}}):ge(),B(me,{ref:z,count:_.length,inited:te.inited,animated:e.animated,duration:e.duration,swipeable:e.swipeable,lazyRender:e.lazyRender,currentIndex:te.currentIndex,onChange:se},{default:function(){var e;return[null==(e=y.default)?void 0:e.call(y)]}})])}}}),Be=n(v("tab"),2),Te=Be[0],Ae=Be[1],Re=S({},G,{dot:Boolean,name:p,badge:p,title:String,disabled:Boolean,titleClass:J,titleStyle:[String,Object],showZeroBadge:z}),ze=y({name:Te,props:Re,setup:function(e,t){var n=t.slots,r=W(),i=l(!1),o=K(ke),a=o.parent,u=o.index;if(a){var c=function(){var t;return null!=(t=e.name)?t:u.value},s=x((function(){var t=c()===a.currentName.value;return t&&!i.value&&(i.value=!0,a.props.lazyRender&&M((function(){a.onRendered(c(),e.title)}))),t})),d=l(!s.value);return k(s,(function(e){e?d.value=!1:_((function(){d.value=!0}))})),k((function(){return e.title}),(function(){a.setLine(),a.scrollIntoView()})),ee(re,s),function(){var e,t="".concat(a.id,"-").concat(u.value),o=a.props,l=o.animated,c=o.swipeable,f=o.scrollspy,v=o.lazyRender;if(n.default||l){var p=f||s.value;if(l||c)return B(oe,{id:r,role:"tabpanel",class:Ae("panel-wrapper",{inactive:d.value}),tabindex:s.value?0:-1,"aria-hidden":!s.value,"aria-labelledby":t},{default:function(){var e;return[B("div",{class:Ae("panel")},[null==(e=n.default)?void 0:e.call(n)])]}});var b=i.value||f||!v?null==(e=n.default)?void 0:e.call(n):null;return L({id:r}),te(B("div",{id:r,role:"tabpanel",class:Ae("panel"),tabindex:p?0:-1,"aria-labelledby":t},[b]),[[ne,p]])}}}}});e("a",R(ze)),e("T",R(Ce))}}}))}();