From 0cd613b0572fee4e93fdebd390f6069bbc67258f Mon Sep 17 00:00:00 2001 From: sunhao Date: Fri, 21 Jun 2024 13:48:12 +0800 Subject: [PATCH] * [story #57368] show error modal on request failed. --- www/js/zui3/zin.js | 23 +++++++++++++++++++++-- www/js/zui3/zui.zentao.js | 14 +++++++------- 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/www/js/zui3/zin.js b/www/js/zui3/zin.js index e254a0c6e5..2d1c55c22e 100644 --- a/www/js/zui3/zin.js +++ b/www/js/zui3/zin.js @@ -547,8 +547,10 @@ if(!rawData && !ajax.sendedAgain) { ajax.sendedAgain = true; - headers['X-Zin-Debug'] = true; - ajax.send({headers: headers}); + ajax.setting.headers['X-Zin-Debug'] = true; + delete ajax.data; + delete ajax.error; + ajax.send(); ajax.canceled = true; return; } @@ -643,6 +645,23 @@ }, error: (error, type) => { + const data = ajax.data; + if(!data && !ajax.sendedAgain) + { + ajax.sendedAgain = true; + ajax.setting.headers['X-Zin-Debug'] = true; + delete ajax.data; + delete ajax.error; + ajax.send(); + ajax.canceled = true; + return; + } + else if(data) + { + showFatalError(data, _, options); + ajax.canceled = false; + } + if(ajax.canceled) return; updatePerfInfo(options, 'requestEnd', {error: error}); if(type === 'abort') return console.log('[ZIN] ', 'Abord fetch data from ' + url, {type, error});; diff --git a/www/js/zui3/zui.zentao.js b/www/js/zui3/zui.zentao.js index 87494b340b..e4194e533d 100644 --- a/www/js/zui3/zui.zentao.js +++ b/www/js/zui3/zui.zentao.js @@ -1,7 +1,7 @@ -var Zc=(R,Kt,me)=>{if(!Kt.has(R))throw TypeError("Cannot "+me)};var pe=(R,Kt,me)=>(Zc(R,Kt,"read from private field"),me?me.call(R):Kt.get(R)),Ce=(R,Kt,me)=>{if(Kt.has(R))throw TypeError("Cannot add the same private member more than once");Kt instanceof WeakSet?Kt.add(R):Kt.set(R,me)},Ee=(R,Kt,me,Fo)=>(Zc(R,Kt,"write to private field"),Fo?Fo.call(R,me):Kt.set(R,me),me);var Jc=(R,Kt,me)=>(Zc(R,Kt,"access private method"),me);(function(R,Kt){typeof exports=="object"&&typeof module<"u"?Kt(exports):typeof define=="function"&&define.amd?define(["exports"],Kt):(R=typeof globalThis<"u"?globalThis:R||self,Kt(R.zui={}))})(this,function(R){var ro,oo,_i,vi,wi,ki,Ci,xi,ao,Gf,lo,Yf,En,Nn;"use strict";const Kt="",me="",Fo="",Pb="",Ib="",Ab="",Db="",Lb="",Rb="",Ob="",Fb="",zb="",Qf="3.0.0-alpha.4",Ve=document,zi=window,th=Ve.documentElement,On=Ve.createElement.bind(Ve),eh=On("div"),zo=On("table"),Xf=On("tbody"),nh=On("tr"),{isArray:ji,prototype:sh}=Array,{concat:Zf,filter:jo,indexOf:ih,map:rh,push:Jf,slice:oh,some:Bo,splice:tp}=sh,ep=/^#(?:[\w-]|\\.|[^\x00-\xa0])*$/,np=/^\.(?:[\w-]|\\.|[^\x00-\xa0])*$/,sp=/<.+>/,ip=/^\w+$/;function Wo(s,t){const e=rp(t);return!s||!e&&!Fn(t)&&!Gt(t)?[]:!e&&np.test(s)?t.getElementsByClassName(s.slice(1).replace(/\\/g,"")):!e&&ip.test(s)?t.getElementsByTagName(s):t.querySelectorAll(s)}class Bi{constructor(t,e){if(!t)return;if(Ho(t))return t;let n=t;if(re(t)){const i=e||Ve;if(n=ep.test(t)&&Fn(i)?i.getElementById(t.slice(1).replace(/\\/g,"")):sp.test(t)?dh(t):Ho(i)?i.find(t):re(i)?m(i).find(t):Wo(t,i),!n)return}else if(zn(t))return this.ready(t);(n.nodeType||n===zi)&&(n=[n]),this.length=n.length;for(let i=0,r=this.length;i{for(;t.firstChild;)t.removeChild(t.firstChild)})};function Wi(...s){const t=ap(s[0])?s.shift():!1,e=s.shift(),n=s.length;if(!e)return{};if(!n)return Wi(t,m,e);for(let i=0;i{Gt(r)&&Jt(e,(o,a)=>{n?t?r.classList.add(a):r.classList.remove(a):r.classList.toggle(a)})})},et.addClass=function(s){return this.toggleClass(s,!0)},et.removeAttr=function(s){const t=Hi(s);return this.each((e,n)=>{Gt(n)&&Jt(t,(i,r)=>{n.removeAttribute(r)})})};function cp(s,t){if(s){if(re(s)){if(arguments.length<2){if(!this[0]||!Gt(this[0]))return;const e=this[0].getAttribute(s);return Hs(e)?void 0:e}return ge(t)?this:Hs(t)?this.removeAttr(s):this.each((e,n)=>{Gt(n)&&n.setAttribute(s,t)})}for(const e in s)this.attr(e,s[e]);return this}}et.attr=cp,et.removeClass=function(s){return arguments.length?this.toggleClass(s,!1):this.attr("class","")},et.hasClass=function(s){return!!s&&Bo.call(this,t=>Gt(t)&&t.classList.contains(s))},et.get=function(s){return ge(s)?oh.call(this):(s=Number(s),this[s<0?s+this.length:s])},et.eq=function(s){return m(this.get(s))},et.first=function(){return this.eq(0)},et.last=function(){return this.eq(-1)};function hp(s){return ge(s)?this.get().map(t=>Gt(t)||op(t)?t.textContent:"").join(""):this.each((t,e)=>{Gt(e)&&(e.textContent=s)})}et.text=hp;function qe(s,t,e){if(!Gt(s))return;const n=zi.getComputedStyle(s,null);return e?n.getPropertyValue(t)||void 0:n[t]||s.style[t]}function Oe(s,t){return parseInt(qe(s,t),10)||0}function lh(s,t){return Oe(s,`border${t?"Left":"Top"}Width`)+Oe(s,`padding${t?"Left":"Top"}`)+Oe(s,`padding${t?"Right":"Bottom"}`)+Oe(s,`border${t?"Right":"Bottom"}Width`)}const Uo={};function up(s){if(Uo[s])return Uo[s];const t=On(s);Ve.body.insertBefore(t,null);const e=qe(t,"display");return Ve.body.removeChild(t),Uo[s]=e!=="none"?e:"block"}function ch(s){return qe(s,"display")==="none"}function hh(s,t){const e=s&&(s.matches||s.webkitMatchesSelector||s.msMatchesSelector);return!!e&&!!t&&e.call(s,t)}function Ki(s){return re(s)?(t,e)=>hh(e,s):zn(s)?s:Ho(s)?(t,e)=>s.is(e):s?(t,e)=>e===s:()=>!1}et.filter=function(s){const t=Ki(s);return m(jo.call(this,(e,n)=>t.call(e,n,e)))};function hn(s,t){return t?s.filter(t):s}et.detach=function(s){return hn(this,s).each((t,e)=>{e.parentNode&&e.parentNode.removeChild(e)}),this};const dp=/^\s*<(\w+)[^>]*>/,fp=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,uh={"*":eh,tr:Xf,td:nh,th:nh,thead:zo,tbody:zo,tfoot:zo};function dh(s){if(!re(s))return[];if(fp.test(s))return[On(RegExp.$1)];const t=dp.test(s)&&RegExp.$1,e=uh[t]||uh["*"];return e.innerHTML=s,m(e.childNodes).detach().get()}m.parseHTML=dh,et.has=function(s){const t=re(s)?(e,n)=>Wo(s,n).length:(e,n)=>n.contains(s);return this.filter(t)},et.not=function(s){const t=Ki(s);return this.filter((e,n)=>(!re(s)||Gt(n))&&!t.call(n,e,n))};function Ge(s,t,e,n){const i=[],r=zn(t),o=n&&Ki(n);for(let a=0,c=s.length;at.selected&&!t.disabled&&!t.parentNode.disabled),"value"):s.value||""}function pp(s){return arguments.length?this.each((t,e)=>{const n=e.multiple&&e.options;if(n||xh.test(e.type)){const i=ji(s)?rh.call(s,String):Hs(s)?[]:[String(s)];n?Jt(e.options,(r,o)=>{o.selected=i.indexOf(o.value)>=0},!0):e.checked=i.indexOf(e.value)>=0}else e.value=ge(s)||Hs(s)?"":s}):this[0]&&fh(this[0])}et.val=pp,et.is=function(s){const t=Ki(s);return Bo.call(this,(e,n)=>t.call(e,n,e))},m.guid=1;function Fe(s){return s.length>1?jo.call(s,(t,e,n)=>ih.call(n,t)===e):s}m.unique=Fe,et.add=function(s,t){return m(Fe(this.get().concat(m(s,t).get())))},et.children=function(s){return hn(m(Fe(Ge(this,t=>t.children))),s)},et.parent=function(s){return hn(m(Fe(Ge(this,"parentNode"))),s)},et.index=function(s){const t=s?m(s)[0]:this[0],e=s?this:m(t).parent().children();return ih.call(e,t)},et.closest=function(s){const t=this.filter(s);if(t.length)return t;const e=this.parent();return e.length?e.closest(s):t},et.siblings=function(s){return hn(m(Fe(Ge(this,t=>m(t).parent().children().not(t)))),s)},et.find=function(s){return m(Fe(Ge(this,t=>Wo(s,t))))};const mp=/^\s*\s*$/g,gp=/^$|^module$|\/(java|ecma)script/i,yp=["type","src","nonce","noModule"];function bp(s,t){const e=m(s);e.filter("script").add(e.find("script")).each((n,i)=>{if(gp.test(i.type)&&th.contains(i)){const r=On("script");r.text=i.textContent.replace(mp,""),Jt(yp,(o,a)=>{i[a]&&(r[a]=i[a])}),t.head.insertBefore(r,null),t.head.removeChild(r)}})}function _p(s,t,e,n,i){n?s.insertBefore(t,e?s.firstChild:null):s.nodeName==="HTML"?s.parentNode.replaceChild(t,s):s.parentNode.insertBefore(t,e?s:s.nextSibling),i&&bp(t,s.ownerDocument)}function un(s,t,e,n,i,r,o,a){return Jt(s,(c,h)=>{Jt(m(h),(f,d)=>{Jt(m(t),(y,b)=>{const k=e?d:b,x=e?b:d,C=e?f:y;_p(k,C?x.cloneNode(!0):x,n,i,!C)},a)},o)},r),t}et.after=function(){return un(arguments,this,!1,!1,!1,!0,!0)},et.append=function(){return un(arguments,this,!1,!1,!0)};function vp(s){if(!arguments.length)return this[0]&&this[0].innerHTML;if(ge(s))return this;const t=/]/.test(s);return this.each((e,n)=>{Gt(n)&&(t?m(n).empty().append(s):n.innerHTML=s)})}et.html=vp,et.appendTo=function(s){return un(arguments,this,!0,!1,!0)},et.wrapInner=function(s){return this.each((t,e)=>{const n=m(e),i=n.contents();i.length?i.wrapAll(s):n.append(s)})},et.before=function(){return un(arguments,this,!1,!0)},et.wrapAll=function(s){let t=m(s),e=t[0];for(;e.children.length;)e=e.firstElementChild;return this.first().before(t),this.appendTo(e)},et.wrap=function(s){return this.each((t,e)=>{const n=m(s)[0];m(e).wrapAll(t?n.cloneNode(!0):n)})},et.insertAfter=function(s){return un(arguments,this,!0,!1,!1,!1,!1,!0)},et.insertBefore=function(s){return un(arguments,this,!0,!0)},et.prepend=function(){return un(arguments,this,!1,!0,!0,!0,!0)},et.prependTo=function(s){return un(arguments,this,!0,!0,!0,!1,!1,!0)},et.contents=function(){return m(Fe(Ge(this,s=>s.tagName==="IFRAME"?[s.contentDocument]:s.tagName==="TEMPLATE"?s.content.childNodes:s.childNodes)))},et.next=function(s,t,e){return hn(m(Fe(Ge(this,"nextElementSibling",t,e))),s)},et.nextAll=function(s){return this.next(s,!0)},et.nextUntil=function(s,t){return this.next(t,!0,s)},et.parents=function(s,t){return hn(m(Fe(Ge(this,"parentElement",!0,t))),s)},et.parentsUntil=function(s,t){return this.parents(t,s)},et.prev=function(s,t,e){return hn(m(Fe(Ge(this,"previousElementSibling",t,e))),s)},et.prevAll=function(s){return this.prev(s,!0)},et.prevUntil=function(s,t){return this.prev(t,!0,s)},et.map=function(s){return m(Zf.apply([],rh.call(this,(t,e)=>s.call(t,e,t))))},et.clone=function(){return this.map((s,t)=>t.cloneNode(!0))},et.offsetParent=function(){return this.map((s,t)=>{let e=t.offsetParent;for(;e&&qe(e,"position")==="static";)e=e.offsetParent;return e||th})},et.slice=function(s,t){return m(oh.call(this,s,t))};const wp=/-([a-z])/g;function Vo(s){return s.replace(wp,(t,e)=>e.toUpperCase())}et.ready=function(s){const t=()=>setTimeout(s,0,m);return Ve.readyState!=="loading"?t():Ve.addEventListener("DOMContentLoaded",t),this},et.unwrap=function(){return this.parent().each((s,t)=>{if(t.tagName==="BODY")return;const e=m(t);e.replaceWith(e.children())}),this},et.offset=function(){const s=this[0];if(!s)return;const t=s.getBoundingClientRect();return{top:t.top+zi.pageYOffset,left:t.left+zi.pageXOffset}},et.position=function(){const s=this[0];if(!s)return;const t=qe(s,"position")==="fixed",e=t?s.getBoundingClientRect():this.offset();if(!t){const n=s.ownerDocument;let i=s.offsetParent||n.documentElement;for(;(i===n.body||i===n.documentElement)&&qe(i,"position")==="static";)i=i.parentNode;if(i!==s&&Gt(i)){const r=m(i).offset();e.top-=r.top+Oe(i,"borderTopWidth"),e.left-=r.left+Oe(i,"borderLeftWidth")}}return{top:e.top-Oe(s,"marginTop"),left:e.left-Oe(s,"marginLeft")}};const ph={class:"className",contenteditable:"contentEditable",for:"htmlFor",readonly:"readOnly",maxlength:"maxLength",tabindex:"tabIndex",colspan:"colSpan",rowspan:"rowSpan",usemap:"useMap"};et.prop=function(s,t){if(s){if(re(s))return s=ph[s]||s,arguments.length<2?this[0]&&this[0][s]:this.each((e,n)=>{n[s]=t});for(const e in s)this.prop(e,s[e]);return this}},et.removeProp=function(s){return this.each((t,e)=>{delete e[ph[s]||s]})};const kp=/^--/;function qo(s){return kp.test(s)}const Go={},{style:Cp}=eh,xp=["webkit","moz","ms"];function Sp(s,t=qo(s)){if(t)return s;if(!Go[s]){const e=Vo(s),n=`${e[0].toUpperCase()}${e.slice(1)}`,i=`${e} ${xp.join(`${n} `)}${n}`.split(" ");Jt(i,(r,o)=>{if(o in Cp)return Go[s]=o,!1})}return Go[s]}const $p={animationIterationCount:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0};function mh(s,t,e=qo(s)){return!e&&!$p[s]&&ah(t)?`${t}px`:t}function Tp(s,t){if(re(s)){const e=qo(s);return s=Sp(s,e),arguments.length<2?this[0]&&qe(this[0],s,e):s?(t=mh(s,t,e),this.each((n,i)=>{Gt(i)&&(e?i.style.setProperty(s,t):i.style[s]=t)})):this}for(const e in s)this.css(e,s[e]);return this}et.css=Tp;function gh(s,t){try{return s(t)}catch{return t}}const Ep=/^\s+|\s+$/;function yh(s,t){const e=s.dataset[t]||s.dataset[Vo(t)];return Ep.test(e)?e:gh(JSON.parse,e)}function Np(s,t,e){e=gh(JSON.stringify,e),s.dataset[Vo(t)]=e}function Mp(s,t){if(!s){if(!this[0])return;const e={};for(const n in this[0].dataset)e[n]=yh(this[0],n);return e}if(re(s))return arguments.length<2?this[0]&&yh(this[0],s):ge(t)?this:this.each((e,n)=>{Np(n,s,t)});for(const e in s)this.data(e,s[e]);return this}et.data=Mp;function bh(s,t){const e=s.documentElement;return Math.max(s.body[`scroll${t}`],e[`scroll${t}`],s.body[`offset${t}`],e[`offset${t}`],e[`client${t}`])}Jt([!0,!1],(s,t)=>{Jt(["Width","Height"],(e,n)=>{const i=`${t?"outer":"inner"}${n}`;et[i]=function(r){if(this[0])return cs(this[0])?t?this[0][`inner${n}`]:this[0].document.documentElement[`client${n}`]:Fn(this[0])?bh(this[0],n):this[0][`${t?"offset":"client"}${n}`]+(r&&t?Oe(this[0],`margin${e?"Top":"Left"}`)+Oe(this[0],`margin${e?"Bottom":"Right"}`):0)}})}),Jt(["Width","Height"],(s,t)=>{const e=t.toLowerCase();et[e]=function(n){if(!this[0])return ge(n)?void 0:this;if(!arguments.length)return cs(this[0])?this[0].document.documentElement[`client${t}`]:Fn(this[0])?bh(this[0],t):this[0].getBoundingClientRect()[e]-lh(this[0],!s);const i=parseInt(n,10);return this.each((r,o)=>{if(!Gt(o))return;const a=qe(o,"boxSizing");o.style[e]=mh(e,i+(a==="border-box"?lh(o,!s):0))})}});const _h="___cd";et.toggle=function(s){return this.each((t,e)=>{if(!Gt(e))return;const n=ch(e);(ge(s)?n:s)?(e.style.display=e[_h]||"",ch(e)&&(e.style.display=up(e.tagName))):n||(e[_h]=qe(e,"display"),e.style.display="none")})},et.hide=function(){return this.toggle(!1)},et.show=function(){return this.toggle(!0)};const vh="___ce",Yo=".",Qo={focus:"focusin",blur:"focusout"},wh={mouseenter:"mouseover",mouseleave:"mouseout"},Pp=/^(mouse|pointer|contextmenu|drag|drop|click|dblclick)/i;function Xo(s){return wh[s]||Qo[s]||s}function Zo(s){const t=s.split(Yo);return[t[0],t.slice(1).sort()]}et.trigger=function(s,t){if(re(s)){const[n,i]=Zo(s),r=Xo(n);if(!r)return this;const o=Pp.test(r)?"MouseEvents":"HTMLEvents";s=Ve.createEvent(o),s.initEvent(r,!0,!0),s.namespace=i.join(Yo),s.___ot=n}s.___td=t;const e=s.___ot in Qo;return this.each((n,i)=>{e&&zn(i[s.___ot])&&(i[`___i${s.type}`]=!0,i[s.___ot](),i[`___i${s.type}`]=!1),i.dispatchEvent(s)})};function kh(s){return s[vh]=s[vh]||{}}function Ip(s,t,e,n,i){const r=kh(s);r[t]=r[t]||[],r[t].push([e,n,i]),s.addEventListener(t,i)}function Ch(s,t){return!t||!Bo.call(t,e=>s.indexOf(e)<0)}function Ui(s,t,e,n,i){const r=kh(s);if(t)r[t]&&(r[t]=r[t].filter(([o,a,c])=>{if(i&&c.guid!==i.guid||!Ch(o,e)||n&&n!==a)return!0;s.removeEventListener(t,c)}));else for(t in r)Ui(s,t,e,n,i)}et.off=function(s,t,e){if(ge(s))this.each((n,i)=>{!Gt(i)&&!Fn(i)&&!cs(i)||Ui(i)});else if(re(s))zn(t)&&(e=t,t=""),Jt(Hi(s),(n,i)=>{const[r,o]=Zo(i),a=Xo(r);this.each((c,h)=>{!Gt(h)&&!Fn(h)&&!cs(h)||Ui(h,a,o,t,e)})});else for(const n in s)this.off(n,s[n]);return this},et.remove=function(s){return hn(this,s).detach().off(),this},et.replaceWith=function(s){return this.before(s).remove()},et.replaceAll=function(s){return m(s).replaceWith(this),this};function Ap(s,t,e,n,i){if(!re(s)){for(const r in s)this.on(r,t,e,s[r],i);return this}return re(t)||(ge(t)||Hs(t)?t="":ge(e)?(e=t,t=""):(n=e,e=t,t="")),zn(n)||(n=e,e=void 0),n?(Jt(Hi(s),(r,o)=>{const[a,c]=Zo(o),h=Xo(a),f=a in wh,d=a in Qo;h&&this.each((y,b)=>{if(!Gt(b)&&!Fn(b)&&!cs(b))return;const k=function(x){if(x.target[`___i${x.type}`])return x.stopImmediatePropagation();if(x.namespace&&!Ch(c,x.namespace.split(Yo))||!t&&(d&&(x.target!==b||x.___ot===h)||f&&x.relatedTarget&&b.contains(x.relatedTarget)))return;let C=b;if(t){let P=x.target;for(;!hh(P,t);)if(P===b||(P=P.parentNode,!P))return;C=P}Object.defineProperty(x,"currentTarget",{configurable:!0,get(){return C}}),Object.defineProperty(x,"delegateTarget",{configurable:!0,get(){return b}}),Object.defineProperty(x,"data",{configurable:!0,get(){return e}});const S=n.call(C,x,x.___td);i&&Ui(b,h,c,t,k),S===!1&&(x.preventDefault(),x.stopPropagation())};k.guid=n.guid=n.guid||m.guid++,Ip(b,h,c,t,k)})}),this):this}et.on=Ap;function Dp(s,t,e,n){return this.on(s,t,e,n,!0)}et.one=Dp;const Lp=/\r?\n/g;function Rp(s,t){return`&${encodeURIComponent(s)}=${encodeURIComponent(t.replace(Lp,`\r -`))}`}const Op=/file|reset|submit|button|image/i,xh=/radio|checkbox/i;et.serialize=function(){let s="";return this.each((t,e)=>{Jt(e.elements||[e],(n,i)=>{if(i.disabled||!i.name||i.tagName==="FIELDSET"||Op.test(i.type)||xh.test(i.type)&&!i.checked)return;const r=fh(i);if(!ge(r)){const o=ji(r)?r:[r];Jt(o,(a,c)=>{s+=Rp(i.name,c)})}})}),s.slice(1)},window.$=m;function Sh(s,t){if(s==null)return[s,void 0];typeof t=="string"&&(t=t.split("."));const e=t.join(".");let n=s;const i=[n];for(;typeof n=="object"&&n!==null&&t.length;){let r=t.shift(),o;const a=r.indexOf("[");if(a>0&&a{const i=e[n]??"";s=s.replace(new RegExp(`\\{${n}\\}`,"g"),`${i}`)}),s}for(let e=0;e(s[s.B=1]="B",s[s.KB=1024]="KB",s[s.MB=1048576]="MB",s[s.GB=1073741824]="GB",s[s.TB=1099511627776]="TB",s))(Jo||{});function ce(s,t=2,e){return Number.isNaN(s)?"?KB":(e||(s<1024?e="B":s<1048576?e="KB":s<1073741824?e="MB":s<1099511627776?e="GB":e="TB"),(s/Jo[e]).toFixed(t)+e)}const hs=s=>{const t=/^[0-9]*(B|KB|MB|GB|TB)$/;s=s.toUpperCase();const e=s.match(t);if(!e)return 0;const n=e[1];return s=s.replace(n,""),Number.parseInt(s,10)*Jo[n]};let ta=(document.documentElement.getAttribute("lang")||"zh_cn").toLowerCase().replace("-","_"),Ye;function Fp(){return ta}function zp(s){ta=s.toLowerCase().replace("-","_")}function Th(s,t){Ye||(Ye={}),typeof s=="string"&&(s={[s]:t??{}}),m.extend(!0,Ye,s)}function St(s,t,e,n,i,r){Array.isArray(s)?Ye&&s.unshift(Ye):s=Ye?[Ye,s]:[s],typeof e=="string"&&(r=i,i=n,n=e,e=void 0);const o=i||ta;let a;for(const c of s){if(!c)continue;const h=c[o]||c.default;if(!h)continue;const f=r&&c===Ye?`${r}.${t}`:t;if(a=$h(h,f),a!==void 0)break}return a===void 0?n:e?xt(a,...Array.isArray(e)?e:[e]):a}function jp(s,t,e,n){return St(void 0,s,t,e,n)}St.addLang=Th,St.getLang=jp,St.getCode=Fp,St.setCode=zp,St.map=Ye,Th({zh_cn:{confirm:"确定",save:"保存",cancel:"取消",delete:"删除",reset:"重置",add:"添加",copy:"复制",close:"关闭"},zh_tw:{confirm:"確定",save:"儲存",cancel:"取消",delete:"刪除",reset:"重置",add:"添加",Copy:"複製",close:"關閉"},en:{confirm:"Confirm",save:"Save",cancel:"Cancel",delete:"Delete",reset:"Reset",add:"Add",copy:"Copy",close:"Close"}});function Eh(s,t,e){s instanceof Headers?s.set(t,e):Array.isArray(s)?s.push([t,e]):s[t]=e}function us(s,t,e){e!=null&&(Array.isArray(e)?e.forEach(n=>us(s,t,n)):!(e instanceof Blob)&&m.isPlainObject(e)?Object.entries(e).forEach(([n,i])=>{us(s,`${t}[${n}]`,i)}):s.append(t,e instanceof Blob?e:String(e)))}function Bp(s,t){if(s){const e={text:"text/plain",html:"text/html",json:"application/json",...t};for(const[n,i]of Object.entries(e))if(i.split(",").map(r=>r.trim()).includes(s))return n}return"text"}function Vi(s,t){const e=t||new FormData;return s&&(typeof s=="string"&&(s=new URLSearchParams(s)),s instanceof URLSearchParams?s.forEach((n,i)=>{us(e,i,n)}):Array.isArray(s)?s.forEach(([n,i])=>{us(e,n,i)}):s instanceof FormData?s.forEach((n,i)=>{us(e,i,n)}):m.isPlainObject(s)&&Object.entries(s).forEach(([n,i])=>{us(e,n,i)})),e}class qi{get completed(){return this.data!==void 0||this.error!==void 0}get[Symbol.toStringTag](){return"Ajax"}constructor(t){this.setting=t,this._controller=new AbortController,this._callbacks={success:[],error:[],complete:[]}}on(t,e){return this._callbacks[t].push(e),this}success(t){return this.on("success",t)}done(t){return this.success(t)}fail(t){return this.on("error",t)}complete(t){return this.on("complete",t)}always(t){return this.complete(t)}then(t,e){return this.completed?e&&this.error?e(this.error):t(this.data):(this.success(n=>t(n)),e&&this.fail(e)),this}catch(t){return this.error?(t(this.error),this):this.on("error",e=>t(e))}finally(t){return this.completed?(t(),this):this.complete(()=>t())}abort(t){return this.completed?!1:(this._abortError=t,this._controller.abort(),!0)}getResponseHeader(t){var e;return(e=this.response)==null?void 0:e.headers.get(t)}_init(){if(this.completed)return;const{url:t,type:e,data:n,processData:i=!0,contentType:r,crossDomain:o,accepts:a,dataType:c,timeout:h,dataFilter:f,beforeSend:d,success:y,error:b,complete:k,...x}=this.setting;if((d==null?void 0:d(x))===!1)return;e&&(x.method=e);let C=n;C&&(i&&(C=Vi(C)),x.body=C),o&&(x.mode="cors");const S=x.headers||{};Eh(S,"X-Requested-With","XMLHttpRequest"),r&&Eh(S,"Content-Type",r),x.headers=S,x.signal&&x.signal.addEventListener("abort",()=>{this.abort()}),y&&this.success(y),b&&this.fail(b),k&&this.complete(k),x.signal=this._controller.signal,this.url=t,this.request=x}_emit(t,...e){this._callbacks[t].forEach(n=>{n.call(this,...e)})}async send(){var f;if(this.completed)return[];this._init();const{timeout:t,dataType:e,accepts:n,dataFilter:i,throws:r,jsonParser:o}=this.setting;t&&(this._timeoutID=window.setTimeout(()=>{this.abort(new Error("timeout"))},t));let a,c,h;try{a=await fetch(this.url,this.request),this.response=a;const{statusText:d}=a;if(a.ok){const y=(f=a.headers.get("Content-Disposition"))==null?void 0:f.startsWith("attachment"),b=y?"blob":e||Bp(a.headers.get("Content-Type"),n);y||b==="blob"||b==="file"?h=await a.blob():b==="json"?typeof o=="function"?(h=await a.text(),h=o(h)):h=await a.json():h=await a.text(),this.data=h;const k=(i==null?void 0:i(h,b))??h;this._emit("success",k,d,a)}else throw new Error(d)}catch(d){c=d;let y=!1;c.name==="AbortError"&&(this._abortError?c=this._abortError:y=!0),this.error=c,y||this._emit("error",c,a==null?void 0:a.statusText,c.message)}if(this._timeoutID&&clearTimeout(this._timeoutID),this._emit("complete",a,a==null?void 0:a.statusText),c&&r)throw c;return[h,c,a]}}m.ajax=(s,t)=>{t=t||{},typeof s=="string"?t.url=s:m.extend(t,s);const e=new qi(t);return e.send(),e},m.getJSON=(s,t,e)=>(typeof t=="function"&&(e=t,t=void 0),m.ajax({url:s,data:t,success:e,dataType:"json"})),m.get=(s,t,e,n,i="GET")=>{let r,o;return typeof t=="function"?(r=t,o=void 0):o=t,typeof e=="function"?(r=e,n=void 0):n=e,m.ajax({method:i,url:s,data:o,success:r,dataType:n})},m.post=(s,t,e,n)=>m.get(s,t,e,n,"POST"),m.fn.load=function(s,t,e){typeof t=="function"&&(e=t,t=void 0);const[n,i]=s.split(" ");return m.get(n,t,(r,o,a)=>{i&&(r=m(r).find(i).html()),m(this).html(r),e==null||e.call(this,r,o,a)},"html"),this};async function jn(s,t=[],e){const n={throws:!0,dataType:"json"};if(typeof s=="string")n.url=s;else if(typeof s=="object")m.extend(n,s);else if(typeof s=="function"){const o=s(...t);return o instanceof Promise?await o:o}e&&m.extend(n,typeof e=="function"?e(n):e);const i=new qi(n),[r]=await i.send();return r}function ea(s){return!!(s&&(typeof s=="string"||typeof s=="object"&&s.url||typeof s=="function"))}m.fetch=jn;function he(){return m.guid++}function Gi(s,t){if(s===t)return!1;if(s&&t&&typeof s=="object"&&typeof t=="object"){const e=Array.isArray(s),n=Array.isArray(t);if(e!==n)return!0;if(e&&n){if(s.length!==t.length)return!0;for(let o=0;oGi(n instanceof Bn?n.value:n,e[i])))&&(this._value=this._compute(),this._lastDependencies=t.map(n=>n instanceof Bn?n.cache:n)),this._value}}function na(...s){const t=[],e=new Map,n=(i,r)=>{if(Array.isArray(i)&&(r=i[1],i=i[0]),!i.length)return;const o=e.get(i);typeof o=="number"?t[o][1]=!!r:(e.set(i,t.length),t.push([i,!!r]))};return s.forEach(i=>{typeof i=="function"&&(i=i()),Array.isArray(i)?na(...i).forEach(n):i&&typeof i=="object"?Object.entries(i).forEach(n):typeof i=="string"&&i.split(" ").forEach(r=>n(r,!0))}),t.sort((i,r)=>(e.get(i[0])||0)-(e.get(r[0])||0))}const Y=(...s)=>na(...s).reduce((t,[e,n])=>(n&&t.push(e),t),[]).join(" ");m.classes=Y,m.fn.setClass=function(s,...t){return this.each((e,n)=>{const i=m(n);s===!0?i.attr("class",Y(i.attr("class"),...t)):i.addClass(Y(s,...t))})};const Ks=new WeakMap;function sa(s,t,e){const n=Ks.has(s),i=n?Ks.get(s):{};typeof t=="string"?i[t]=e:t===null?Object.keys(i).forEach(r=>{delete i[r]}):Object.assign(i,t),Object.keys(i).forEach(r=>{i[r]===void 0&&delete i[r]}),Object.keys(i).length?(!n&&s instanceof Element&&Object.assign(i,m(s).dataset(),i),Ks.set(s,i)):Ks.delete(s)}function ia(s,t,e){let n=Ks.get(s)||{};return!e&&s instanceof Element&&(n=Object.assign({},m(s).dataset(),n)),t===void 0?n:n[t]}m.fn.dataset=m.fn.data,m.fn.data=function(...s){const[t,e]=s;return!s.length||s.length===1&&typeof t=="string"?this.length?ia(this[0],t):void 0:this.each((n,i)=>sa(i,t,e))},m.fn.removeData=function(s=null){return this.each((t,e)=>sa(e,s))};function Yi(s,t="z-"){const e=m(s)[0];if(e)return Array.from(e.attributes).reduce((n,i)=>{let{name:r,value:o}=i;if(r.startsWith(t)){r=r.slice(t.length).replace(/-([a-z])/g,a=>a[1].toUpperCase());try{o.startsWith("RAWJS<")&&o.endsWith(">RAWJS")?o=new Function(`return ${o.substring(6,o.length-6)}`)():o=JSON.parse(o)}catch{}n[r]=o}return n},{})}function ra(s,t,e="z-"){const n=m(s);Object.keys(t).forEach(i=>{let r=t[i];typeof r=="function"&&(r=`RAWJS<${r}>RAWJS`),typeof r!="string"&&(r=JSON.stringify(r)),i=i.replace(/[A-Z]/g,o=>`-${o.toLowerCase()}`),n.attr(`${e}${i}`,r)})}function Wp(...s){var e;const t=s.length;if(!t)return Yi(this);if(t===1){const[n]=s;return typeof n=="string"?(e=Yi(this))==null?void 0:e[n]:(m.isPlainObject(n)&&ra(this,n),this)}return ra(this,{[s[0]]:s[1]}),this}m.fn.z=Wp,m.fn._attr=m.fn.attr,m.fn.extend({attr(...s){const[t,e]=s;return!s.length||s.length===1&&typeof t=="string"?this._attr.apply(this,s):typeof t=="object"?(t&&Object.keys(t).forEach(n=>{const i=t[n];i===null?this.removeAttr(n):this._attr(n,i)}),this):e===null?this.removeAttr(t):this._attr(t,e)}}),m.Event=(s,t)=>{const[e,...n]=s.split("."),i=new Event(e,{bubbles:!0,cancelable:!0});return i.namespace=n.join("."),i.___ot=e,i.___td=t,i};const Us=(s,t)=>new Promise(e=>{const n=window.setTimeout(e,s);t&&t(n)}),Nh={};m.share=Nh;var Qi,Lt,Mh;R.isValidElement=void 0;var Wn,Ph,Ih,oa,aa,la,ca,Vs={},Ah=[],Hp=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Xi=Array.isArray;function dn(s,t){for(var e in t)s[e]=t[e];return s}function Dh(s){var t=s.parentNode;t&&t.removeChild(s)}function N(s,t,e){var n,i,r,o={};for(r in t)r=="key"?n=t[r]:r=="ref"?i=t[r]:o[r]=t[r];if(arguments.length>2&&(o.children=arguments.length>3?Qi.call(arguments,2):e),typeof s=="function"&&s.defaultProps!=null)for(r in s.defaultProps)o[r]===void 0&&(o[r]=s.defaultProps[r]);return Zi(s,o,n,i,null)}function Zi(s,t,e,n,i){var r={type:s,props:t,key:e,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:i??++Mh,__i:-1,__u:0};return i==null&&Lt.vnode!=null&&Lt.vnode(r),r}function wt(){return{current:null}}function fn(s){return s.children}function Ct(s,t){this.props=s,this.context=t}function Hn(s,t){if(t==null)return s.__?Hn(s.__,s.__i+1):null;for(var e;tt&&Wn.sort(oa));Ji.__r=0}function Oh(s,t,e,n,i,r,o,a,c,h,f){var d,y,b,k,x,C=n&&n.__k||Ah,S=t.length;for(e.__d=c,Kp(e,t,C),c=e.__d,d=0;d0?Zi(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)!=null?(i.__=s,i.__b=s.__b+1,a=Up(i,e,o,f),i.__i=a,r=null,a!==-1&&(f--,(r=e[a])&&(r.__u|=131072)),r==null||r.__v===null?(a==-1&&d--,typeof i.type!="function"&&(i.__u|=65536)):a!==o&&(a===o+1?d++:a>o?f>c-o?d+=a-o:d--:a(c!=null&&!(131072&c.__u)?1:0))for(;o>=0||a=0){if((c=t[o])&&!(131072&c.__u)&&i==c.key&&r===c.type)return o;o--}if(a{!e||typeof e!="object"||Object.keys(e).forEach(n=>{let i=e[n];const r=s[n];i!==r&&(r!==void 0&&(n==="className"||n.endsWith("Class")?i=[r,i]:n==="children"?i=[...tr(r),...tr(i)]:typeof r=="object"&&(n==="style"||n.endsWith("Style")||n==="attrs"||n.endsWith("Attrs")||n==="props")&&(i=m.extend(r,i))),s[n]=i)})}),s}function fa(s){return Object.keys(s).forEach(t=>{s[t]===void 0&&delete s[t]}),s}const ds=new Map;function qs(s){const{zui:t}=window;return(!ds.size||s&&!ds.has(s.toUpperCase()))&&Object.keys(t).forEach(e=>{const n=t[e];!n.NAME||!n.ZUI||ds.set(e.toLowerCase(),n)}),s?ds.get(s.toLowerCase()):void 0}function Wh(s,t,e){const n=qs(s);return n?!n.MULTI_INSTANCE&&n.get(t)?(console.error(`[ZUI] cannot create component "${s}" on element which already has a component instance.`,{element:t,options:e}),null):new n(t,e):null}function Gp(s){if(s){const t=qs(s);t&&t.defineFn()}else qs(),ds.forEach(t=>{t.defineFn()})}m.fn.zuiInit=function(){return this.find("[zui-create],[data-zui]").each(function(){const s=m(this);let t=Yi(s,"data-");const[e,n]=(t.zui||s.attr("zui-create")).split(":");s.zui(e)||(n?t=m.share[n]:delete t.zui,requestAnimationFrame(()=>Wh(e,this,t)))}),this.find("[zui-init]").each(function(){const s=m(this);s.z("zuiInited")||m.runJS(s.z("zuiInited",!0).attr("zui-init"),["$element",s])}),this.find(".hide-before-init").removeClass("invisible hidden opacity-0"),this.find(".scroll-into-view").scrollIntoView(),this.find('[data-on="inited"]').each((s,t)=>{const e=m(t);e.zui()||e.trigger("inited")}),this},m.fn.zui=function(s,t){const e=this[0];if(!e)return;if(typeof s!="string"){const i=ia(e,void 0,!0),r={};let o;return Object.keys(i).forEach(a=>{if(a.startsWith("zui.")){const c=i[a];r[a]=c,(!o||o.gid{m("body").zuiInit()});function Hh(s,t=!0){const e=m(s),n=e[0],i="zui-disable-scroll";if(t){if(e.data(i))return;if((e.css("scrollbar-gutter")||"").includes("stable")){e.data(i,{overflow:e.css("overflow")}).css("overflow","hidden");return}const r=n===document.body||e.is("html")?window.innerWidth-document.body.clientWidth:n.offsetWidth-n.clientWidth;if(!r)return;const o=e.css("paddingRight")||"0";e.data(i,{paddingRight:o,overflow:e.css("overflow")}).css({paddingRight:`${r+Number.parseInt(o,10)}px`,overflow:"hidden"})}else{const r=e.data(i);if(!r)return;e.css(r).removeData(i)}}m.fn.disableScroll=function(s=!0){return this.each((t,e)=>{Hh(e,s)})},m.fn.enableScroll=function(s=!0){return this.disableScroll(!s)};function Yp(s){const t=m(this),e=t.dataset();if(!(e.on||"click").split(" ").includes(s.type))return;const n=e.selector?m(s.target).closest(e.selector):t;if(!n.length)return;const i=c=>c===""?!0:c,r=c=>{if(typeof c=="string")try{c=JSON.parse(c)}catch{}return c};if(i(e.once)){if(e.onceCalled)return;t.dataset("once-called",!0)}if(i(e.prevent)&&s.preventDefault(),i(e.stop)&&s.stopPropagation(),i(e.self)&&s.currentTarget!==s.target)return;const o=[["$element",t],["event",s],["options",e],["$target",n]];if(e.if&&!m.runJS(e.if,...o))return;const a=e.call;if(a){let c=window[a];const h=/^[$A-Z_][0-9A-Z_$.]*$/i.test(a);if(c||(c=m.runJS(a,...o)),!h||!m.isFunction(c))return;const f=[],d=e.params;e.params=f,typeof d=="string"&&d.length?d[0]==="["?f.push(...r(d)):f.push(...d.split(", ").map(y=>(y=y.trim(),y==="$element"?t:y==="event"?s:y==="options"?e:y.startsWith("$element.")||y.startsWith("event.")||y.startsWith("options.")?m.runJS(y,...o):r(y)))):f.push(d),c(...f)}e.do&&m.runJS(e.do,...o)}m(document).on("click.zui.global change.zui.global inited.zui.global","[data-on]",Yp);function fs(s){if(typeof s=="function")return fs(s());if(typeof s=="number")return[s];let t=s.match(/(\d+)(%|px)?/);return t?[parseInt(t[1]),t[2]]:(t=s.match(/(\d+)\/(\d+)/),t?[100*parseInt(t[1])/parseInt(t[2]),"%"]:[NaN])}function Bt(s){if(s==null)return null;const[t,e="px"]=fs(s);return Number.isNaN(t)?typeof s=="string"?s:null:`${t}${e}`}async function nr(s,t){var n,i,r;if(s instanceof Blob){const o=document.createElement("a");return o.href=window.URL.createObjectURL(s),t&&(o.download=decodeURIComponent(t)),o.click(),o.remove(),s}if(s instanceof Response){const o=await s.blob();return t=t||((r=(i=(n=s.headers.get("Content-Disposition"))==null?void 0:n.split(";")[1])==null?void 0:i.split("=")[1])==null?void 0:r.replace(/"/g,"")),nr(o,t)}const e=await fetch(s);return nr(e)}class Kh{constructor(t){this._$target=m(t)}on(...t){return this._$target.on(...t),this}one(...t){return this._$target.one(...t),this}off(...t){return this._$target.off(...t),this}trigger(...t){return this._$target.trigger(...t),this}}const ze=new Kh(document);m.bus=ze,m.on=ze.on.bind(ze),m.one=ze.one.bind(ze),m.off=ze.off.bind(ze),m.trigger=ze.trigger.bind(ze);var Qp=["Shift","Meta","Alt","Control"],Uh=typeof navigator=="object"?navigator.platform:"",Vh=/Mac|iPod|iPhone|iPad/.test(Uh),Xp=Vh?"Meta":"Control",Zp=Uh==="Win32"?["Control","Alt"]:Vh?["Alt"]:[];function pa(s,t){return typeof s.getModifierState=="function"&&(s.getModifierState(t)||Zp.includes(t)&&s.getModifierState("AltGraph"))}function Jp(s){return s.trim().split(" ").map(function(t){var e=t.split(/\b\+/),n=e.pop();return[e=e.map(function(i){return i==="$mod"?Xp:i}),n]})}function qh(s,t){var e;t===void 0&&(t={});var n=(e=t.timeout)!=null?e:1e3,i=Object.keys(s).map(function(a){return[Jp(a),s[a]]}),r=new Map,o=null;return function(a){a instanceof KeyboardEvent&&(i.forEach(function(c){var h=c[0],f=c[1],d=r.get(h)||h;(function(y,b){return!(b[1].toUpperCase()!==y.key.toUpperCase()&&b[1]!==y.code||b[0].find(function(k){return!pa(y,k)})||Qp.find(function(k){return!b[0].includes(k)&&b[1]!==k&&pa(y,k)}))})(a,d[0])?d.length>1?r.set(h,d.slice(1)):(r.delete(h),f(a)):pa(a,a.key)||r.delete(h)}),o&&clearTimeout(o),o=setTimeout(r.clear.bind(r),n))}}function tm(s,t,e){var n;e===void 0&&(e={});var i=(n=e.event)!=null?n:"keydown",r=qh(t,e);return s.addEventListener(i,r),function(){s.removeEventListener(i,r)}}function ma(s,t={}){if(!s)return;const e=Object.keys(t).reduce((n,i)=>(t[i].optional||(n[i]={...t[i]}),n),{});return Object.keys(s).forEach(n=>{const i=s[n];i?i===!0?t[n]&&(e[n]={...t[n]}):e[n]=i:delete e[n]}),Object.keys(e).reduce((n,i)=>{const{keys:r,handler:o}=e[i];return typeof r=="string"?n[r]=o:r.forEach(a=>{n[a]=o}),n},{})}function ga(s,t,e){const{timeout:n,event:i="keydown",scope:r,when:o}=e||{},a=qh(t,{timeout:n}),c=`.zui.hotkeys${r?`.${r}`:""}`,h="zui-hotkeys-composing";return m(s).on(`${i}${c}`,function(f){o&&o(f)===!1||m(f.target).data(h)||a(f)}).on(`compositionstart${c}`,f=>{m(f.target).data(h,!0)}).on(`compositionend${c}`,f=>{m(f.target).removeData(h)})}function ya(s,t){return m(s).off(`.zui.hotkeys${t?`.${t}`:""}`)}const em=tm;m.fn.hotkeys=function(s,t){return ga(this,s,t)},m.fn.unbindHotkeys=function(s){return ya(this,s)},m.hotkeys=function(s,t){ga(window,s,t)},m.unbindHotkeys=function(s){ya(window,s)};function sr(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement}async function Gh(s){(typeof s=="string"||s instanceof Element||s instanceof m)&&(s={target:s});const{target:t,onError:e,onSuccess:n,afterExit:i,afterEnter:r}=s,o=m(t),a=o[0];if(!a)return;const c=a.requestFullscreen||a.webkitRequestFullscreen||a.mozRequestFullScreen;if(!c){e==null||e.call(a,new Error("[ZUI] The browser does not support full screen feature."));return}try{await c.call(a),n==null||n.call(a),m(a).off(".zui.fullscreen"),i&&o.on("exitFullscreen.zui.fullscreen",i),r&&o.on("enterFullscreen.zui.fullscreen",r)}catch(h){e==null||e.call(a,h)}document.zuiBindFullscreenChange||(document.zuiBindFullscreenChange=!0,m(document).on("fullscreenchange.zui webkitfullscreenchange.zui mozfullscreenchange.zui",h=>{const f=sr();let d=f;f?m(f).addClass("is-in-fullscreen"):(d=m(document).find(".is-in-fullscreen")[0]||document,m(d).removeClass("is-in-fullscreen")),m("body").toggleClass("has-in-fullscreen",!!f);const y={event:h,target:d,fullscreenElement:f};m(d).trigger(f?"enterFullscreen":"exitFullscreen",y).trigger("toggleFullscreen",y)}))}async function ba(s){const t=sr();return s===!1&&!!t===s?s:t?(document.exitFullscreen(),!1):(await Gh(s),!0)}m.fn.fullscreen=function(s){return ba({target:this,...s})},m.getFullscreenElement=sr,m.toggleFullscreen=ba;function Un(s){return s.parentNode===document?!1:s.parentNode?Un(s.parentNode):!0}m.isDetached=Un,m.fn.isDetached=function(){const s=this[0];return!s||Un(s)};class Ft{constructor(t,e){this._inited=!1,this._autoDestory=0;const{KEY:n,DATA_KEY:i,DEFAULT:r,MULTI_INSTANCE:o,NAME:a}=this.constructor;if(!a)throw new Error('[ZUI] The component must have a "NAME" static property.');const c=m(t);if(c.data(n)&&!o)throw new Error("[ZUI] The component has been initialized on element.");const h=c[0],f=he();this._gid=f,this._element=h;const d=c.parent();if(d.length&&(this._mobs=new MutationObserver(y=>{y.forEach(b=>{b.removedNodes.forEach(k=>{k===h&&(this._autoDestory&&clearTimeout(this._autoDestory),this._autoDestory=window.setTimeout(()=>{this._autoDestory=0,Un(h)&&this.destroy()},100))})})}),this._mobs.observe(d[0],{childList:!0,subtree:!1})),this._options={...r,...c.dataset()},this.setOptions(e),this._key=this.options.key??`__${f}`,c.data(n,this).attr(i,`${f}`),o){const y=`${n}:ALL`;let b=c.data(y);b||(b=new Map,c.data(y,b)),b.set(this._key,this)}this.init(),requestAnimationFrame(async()=>{this._inited=!0,await this.afterInit(),this.emit("inited",this.options)})}static get ZUI(){return this.NAME.replace(/(^[A-Z]+)/,t=>t.toLowerCase())}static get KEY(){return`zui.${this.NAME}`}static get NAMESPACE(){return`.zui.${this.ZUI}`}static get DATA_KEY(){return`data-zui-${this.NAME}`}static get SELECTOR(){return`[${this.DATA_KEY}]`}get inited(){return this._inited}get element(){return this._element}get key(){return this._key}get options(){return this._options}get gid(){return this._gid}get $element(){return m(this.element)}get $emitter(){return this.$element}get i18nData(){return[this.options.i18n,this.constructor.i18n]}init(){}afterInit(){}render(t){this.setOptions(t)}destroy(){var r;const{KEY:t,DATA_KEY:e,MULTI_INSTANCE:n}=this.constructor,{$element:i}=this;if(this.emit("destroyed"),(r=this._mobs)==null||r.disconnect(),i.off(this.namespace).removeData(t).attr(e,null),n){const o=this.$element.data(`${t}:ALL`);if(o)if(o.delete(this._key),o.size===0)this.$element.removeData(`${t}:ALL`);else{const a=o.values().next().value;i.data(t,a).attr(e,a.gid)}}}setOptions(t){return t&&m.extend(this._options,t),this._options}emit(t,...e){const n=m.Event(t);return n.__src=this,this.$emitter.trigger(n,[this,...e]),n}on(t,e,n){const i=this;this.$element[n!=null&&n.once?"one":"on"](this._wrapEvent(t),function(r,o){(!r.__src||r.__src===i)&&e.call(this,r,o)})}one(t,e){this.on(t,e,{once:!0})}off(t){this.$element.off(this._wrapEvent(t))}i18n(t,e,n){const{i18nData:i}=this;return St(i,t,e,n,this.options.lang,this.constructor.NAME)??St(i,t,e,n,this.options.lang)??`{i18n:${t}}`}get namespace(){return`${this.constructor.NAMESPACE}.${this._key}`}_wrapEvent(t){return t.split(" ").map(e=>e.includes(".")?e:`${e}${this.namespace}`).join(" ")}static get(t,e){const n=m(t);if(this.MULTI_INSTANCE&&e!==void 0){const i=n.data(`${this.KEY}:ALL`);return i?i.get(e):void 0}return n.data(this.KEY)}static isValid(t){return!0}static ensure(t,e){const n=this.get(t,e==null?void 0:e.key);if(n){if(this.isValid(n))return e&&n.setOptions(e),n;n.destroy()}return new this(t,e)}static getAll(t){const{MULTI_INSTANCE:e,SELECTOR:n}=this,i=[];return m(t||document).find(n).each((r,o)=>{if(e){const c=m(o).data(`${this.KEY}:ALL`);if(c){i.push(...c.values());return}}const a=m(o).data(this.KEY);a&&i.push(a)}),i.sort((r,o)=>r.gid-o.gid)}static query(t,e,n){if(t===void 0){let i=this.getAll();return n&&(i=i.filter(n)),i.pop()}return this.get(m(t).closest(this.SELECTOR),e)}static defineFn(t){let e=t||this.ZUI;m.fn[e]&&(e=`zui${this.NAME}`);const n=this;m.fn.extend({[e](i,...r){const o=typeof i=="object"?i:void 0,a=typeof i=="string"?i:void 0;let c;return this.each((h,f)=>{let d=n.get(f);if(d?o&&d.render(o):d=new n(f,o),a){let y=d[a],b=d;y===void 0&&(b=d.$,y=b[a]),typeof y=="function"?c=y.call(b,...r):c=y}}),c!==void 0?c:this}})}}Ft.DEFAULT={},Ft.MULTI_INSTANCE=!1;class _a extends Ft{init(){const{offset:t=1,side:e,zIndex:n,pinnedClass:i="is-pinned",targets:r,scrollContainer:o}=this.options,{$element:a}=this,c=r?a.find(r):a;if(c.css({position:"sticky",zIndex:n}),e&&c.css(e,-t),o){const h=a.closest(o)[0];if(h){const f=()=>{this._raf&&cancelAnimationFrame(this._raf),this._raf=requestAnimationFrame(()=>{if(this._raf=0,h.scrollTop===0&&(!e||e==="top")){c.toggleClass(i,!1);return}const d=h.getBoundingClientRect();c.each((y,b)=>{const x=b.getBoundingClientRect()[e||"top"]===d[e||"top"];b.classList.toggle(i,x)})})};this._scrollListener=f,h.addEventListener("scroll",f)}this._container=h}else this._ob=new IntersectionObserver(h=>{h.forEach(f=>{f.target.classList.toggle(i,f.intersectionRatiothis._ob.observe(f))}destroy(){var t;(t=this._ob)==null||t.disconnect(),this._container&&(this._container.removeEventListener("scroll",this._scrollListener),this._raf&&cancelAnimationFrame(this._raf))}}_a.NAME="Sticky";function Gs(s,t={}){const e=m(s)[0];if(!e)return!1;let{viewport:n}=t;const{left:i,top:r,width:o,height:a}=e.getBoundingClientRect();if(t.checkZeroSize&&!(o*a))return!1;if(!n)if(t.container)n=m(e).closest(t.container)[0].getBoundingClientRect();else{const{innerHeight:k,innerWidth:x}=window,{clientHeight:C,clientWidth:S}=document.documentElement;n={left:0,top:0,width:x||S,height:k||C}}const{left:c,top:h,width:f,height:d}=n;if(t.fullyCheck)return i>=c&&r>=h&&i+o<=f+c&&r+a<=d+h;const y=i<=c+f&&i+o>=c;return r<=h+d&&r+a>=h&&y}m.fn.isVisible=function(s){return Gs(this,s)};function va(s,t,e=!1){const n=m(s);if(t!==void 0){if(t.length){const i=`zui-runjs-${he()}`;n.append(`