bkui-vue 0.0.2-beta.109 → 0.0.2-beta.110
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.umd.js +1 -1
- package/lib/shared/index.js +2 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
font-size: ${s["font-size"]};
|
5
5
|
word-break: ${s["word-break"]};
|
6
6
|
padding: ${s.padding};
|
7
|
-
`,r.textContent=a.textContent,r};let n=!1;try{const a=window.getComputedStyle(e,null);if(a.webkitLineClamp!=="none"){const r=parseFloat(a.height),o=t(e,a);document.body.appendChild(o);const l=window.getComputedStyle(o,null).height;document.body.removeChild(o),n=r<parseFloat(l)}else n=e.clientWidth<e.scrollWidth||e.clientHeight<e.scrollHeight}catch(a){console.warn("There is an error when check element overflow state: ",a)}return n}const lo={bottom:0,content:1,navi:100,fullScreen:1e3,modal:2e3,plugins:5e3,message:6e3,popper:8e3};class yg{constructor(){me(this,"storageLayerIndexValue",{});this.copyDefaultValue()}getNextIndex(t){return Object.prototype.hasOwnProperty.call(this.storageLayerIndexValue,t)?(this.storageLayerIndexValue[t]=this.storageLayerIndexValue[t]+1,this.storageLayerIndexValue[t]):(this.storageLayerIndexValue.modal=this.storageLayerIndexValue.modal+1,this.storageLayerIndexValue.modal)}getModalNextIndex(){return this.getNextIndex("modal")}getMessageNextIndex(){return this.getNextIndex("message")}getFullScreenNextIndex(){return this.getNextIndex("fullScreen")}getNaviNextIndex(){return this.getNextIndex("navi")}getPopperIndex(){return this.getNextIndex("popper")}setDefaultZIndex(t){Object.keys(t||{}).forEach(n=>{Object.prototype.hasOwnProperty.call(this.storageLayerIndexValue.__proto__,n)&&Object.assign(this.storageLayerIndexValue.__proto__,{[n]:t[n]})}),this.copyDefaultValue()}resetZIndex(t){Object.keys(t||{}).forEach(n=>{Object.prototype.hasOwnProperty.call(this.storageLayerIndexValue,n)&&Object.assign(this.storageLayerIndexValue,{[n]:t[n]})})}copyDefaultValue(){const t=Object.keys(lo).reduce((n,a)=>Object.assign(n,{[a]:{value:lo[a],writable:!0,configurable:!0}}),{});this.storageLayerIndexValue=Object.create(lo,t)}}const Gt=new yg;`${Tn(16)}`;const ws=new WeakMap,ko=e=>ws.has(e)?ws.get(e):[],bg=(e,t,n,a,s)=>{const r=ko(e);r.some(o=>o.instanceId===s)||(r.push({event:t,args:n,content:a,instanceId:s}),ws.set(e,r))},Cg=(e,t)=>{ws.set(e,t)};class Ng{constructor(){me(this,"timer",null);me(this,"store",[]);me(this,"maskMap",new WeakMap)}appendMaker(t){this.store.push(t),this.executeMaker()}pushMaskStyle(t,n){const a=this.getMaskMap(t);this.setMaskMap(t,{styles:[n],...a||{}})}getMaskStyles(t){var n;return((n=this.getMaskMap(t))==null?void 0:n.styles)||[]}setMaskId(t,n){const a=this.getMaskMap(t);a?(Object.assign(a,{id:n}),this.setMaskMap(t,a)):this.setMaskMap(t,{id:n,...a||{}})}getMaskId(t){var n;return(n=this.getMaskMap(t))==null?void 0:n.id}setMaskMap(t,n){this.maskMap.set(t,n)}getMaskMap(t){return this.maskMap.get(t)}executeMaker(){this.timer&&cancelAnimationFrame(this.timer),this.timer=requestAnimationFrame(()=>{const t=this.store.pop();typeof t=="function"&&(Reflect.apply(t,this,[]),this.executeMaker())})}}const fa=new Ng;class Hf{constructor(t){me(this,"mask");me(this,"backupMask");me(this,"multiInstance",!1);me(this,"uniqueMaskAttrTag","");me(this,"parentNode",document.body);me(this,"activeInstance");me(this,"zIndexStore",new Map);me(this,"lastUUID",null);me(this,"maskStyle",{position:"fixed",left:0,top:0,bottom:0,right:0,display:"none","background-color":"rgba(0,0,0,.6)"});me(this,"isInit",!1);me(this,"maskAttrTag","auto");const{multiInstance:n=!1,maskAttrTag:a="auto",parentNode:s=document.body,maskStyle:r={}}=t||{};this.parentNode=s||document,this.maskAttrTag=a,this.activeInstance=void 0,this.multiInstance=n,this.uniqueMaskAttrTag=this.getMaskAttrTag(a),fa.appendMaker(()=>{this.initInstance(r)})}setOption(t){const{parentNode:n=document.body,maskStyle:a={},maskAttrTag:s=this.maskAttrTag}=t||{};this.parentNode=n||document,this.setMaskStyle(Object.assign({},this.maskStyle,a)),this.uniqueMaskAttrTag=this.getMaskAttrTag(s)}destroyEvent(t){if(this.mask){const n=ko(this.mask)||[],a=n.findIndex(s=>s.instanceId===t);a>=0&&(n.splice(a,1),Cg(this.mask,n))}}show(t,n,a=!0,s={},r=null,o=!1,l,u){const c=r??Tn(16),d=/-?\d+/.test(`${n}`)?n:Gt.getModalNextIndex();let f=Object.assign({},this.maskStyle,s||{});if(!a&&this.lastUUID){const g=this.zIndexStore.get(this.lastUUID);g&&(f=g==null?void 0:g.style)}this.storeMaskInsCfg({zIndex:d,style:{...f},uuid:c,preUID:this.lastUUID}),Object.assign(f,{display:"block","z-index":`${d}`,"pointer-events":"all"}),this.initInstance(f),l&&this.catchClickEvent(t,l,u),this.setMaskStyle(f),fa.pushMaskStyle(this.parentNode,{...f}),this.backupMask.style.setProperty("z-index",`${d-1}`),a||(this.mask.style.setProperty("pointer-events","none"),t==null||t.style.setProperty("pointer-events","all")),t&&(o&&t.style.setProperty("z-index",`${d+1}`),this.activeInstance=t,this.appendContentToMask(t))}hide(t=!1,n,a){var o;const s=a??this.lastUUID;t||(n==null||n.remove(),(o=this.activeInstance)==null||o.remove()),this.removeClickEvent(),this.activeInstance=void 0,this.popIndexStore(s);const r=fa.getMaskStyles(this.parentNode);if(r==null||r.pop(),!(r!=null&&r.length))this.mask.style.setProperty("display","none");else{const l=r.slice(-1)[0];this.setMaskStyle(l)}}storeMaskInsCfg(t){return this.zIndexStore.set(t.uuid,t),this.lastUUID=t.uuid,this.zIndexStore.get(t.uuid)}popIndexStore(t){if(this.zIndexStore.has(t)){const n=this.zIndexStore.get(t);return this.lastUUID=n.preUID,this.zIndexStore.delete(t)}return this.lastUUID=null,!1}backupActiveInstance(){this.activeInstance&&this.backupMask.append(this.activeInstance)}backupContentElement(t){var n;t&&((n=this.backupMask)==null||n.append(t))}getActiveContentInstance(){return this.activeInstance}removeClickEvent(){}initInstance(t){if(!this.isInit){this.isInit=!0,this.backupMask=this.getBackupMask();const{instance:n,isExist:a}=this.getMask();this.mask=n,!a&&this.setMaskStyle(Object.assign({},this.maskStyle,t))}}getMask(){if(this.multiInstance)return{instance:this.createMask(),isExist:!1};let t=!0,n=this.parentNode.querySelector(`[data-bk-mask-uid='${this.uniqueMaskAttrTag}']`);return n||(t=!1,n=this.createMask(),n.addEventListener("click",a=>this.handleMaskClick(a),!0)),{instance:n,isExist:t}}catchClickEvent(t,n,a){this.mask&&bg(this.mask,n,[],t,a)}handleMaskClick(t){if(t.target!==this.mask)return;const n=ko(this.mask);if(n.length){const{event:a}=n.slice(-1)[0];typeof a=="function"&&a(t)}}getBackupMask(){const t="data-bk-backup-uid";let n=this.parentNode.querySelector(`[${t}]`);return n||(n=this.createMask(t)),n}createMask(t="data-bk-mask-uid"){const n=document.createElement("div");return n.setAttribute(t,this.uniqueMaskAttrTag),this.parentNode.append(n),n}setMaskStyle(t={}){this.mask&&Object.entries(t).forEach(n=>this.mask.style.setProperty(n[0],n[1]))}getMaskAttrTag(t){return/^(auto|\s+)$/i.test(t)||t===null||t===void 0||t===""?(fa.getMaskId(this.parentNode)||fa.setMaskId(this.parentNode,`__bk_mask_${Tn(16)}`),fa.getMaskId(this.parentNode)):t}appendContentToMask(t){this.mask.append(t)}}new Hf({});const Ui=new WeakMap;class Wf{constructor(t){me(this,"uuidAttrName");me(this,"clickFn");me(this,"bKMaskManagerInstance");me(this,"transfer");me(this,"uniqId");this.clickFn=void 0,this.uuidAttrName="data-bk-pop-uuid",this.uniqId=Tn(16),this.transfer=this.getParentNode(t==null?void 0:t.transfer),this.bKMaskManagerInstance=new Hf({parentNode:this.getParentNode(t==null?void 0:t.transfer),popInstance:this,onClick:this.onMaskClickFn})}get popInstanceList(){return Ui.has(this.transfer)||Ui.set(this.transfer,[]),Ui.get(this.transfer)}set popInstanceList(t){Ui.set(this.transfer,t)}getParentNode(t){if(typeof t=="string"){const n=document.querySelector(t);if(n)return n}return Zn(t)?t:document.body}onMaskClick(t,n){this.clickFn={fn:t,target:n}}show(t,n=!0,a={},s=!1,r=void 0,o){if(!t){console.warn("pop show error: content is null or undefined");return}const l=typeof r=="number"?r:Gt.getModalNextIndex(),u=Tn(16);t.setAttribute(this.uuidAttrName,u),this.popInstanceList.length>0&&n&&this.bKMaskManagerInstance.backupContentElement(this.popInstanceList.slice(-1)[0].content),this.popInstanceList.push({uuid:u,zIndex:l,content:t,showMask:n,appendStyle:a}),this.bKMaskManagerInstance.show(t,l,n,a,u,s,o,this.uniqId)}destroy(t,n=!1){this.clickFn=void 0,this.hide(t,n)}popHide(t=!0){if(this.popInstanceList.length){if(t){const n=this.popInstanceList.pop();this.bKMaskManagerInstance.popIndexStore(n.uuid),n.remove()}if(this.popInstanceList.length){const n=this.popInstanceList.slice(-1)[0],{zIndex:a,content:s,showMask:r,appendStyle:o,uuid:l}=n;this.bKMaskManagerInstance.show(s,a,r,o,l)}else this.bKMaskManagerInstance.hide()}}hide(t,n=!1){const a=t==null?void 0:t.getAttribute(this.uuidAttrName);if(a){const s=this.popInstanceList.findIndex(r=>r.uuid===a);s>=0&&(n||this.popInstanceList[s].content.remove(),this.popInstanceList.splice(s,1),this.bKMaskManagerInstance.popIndexStore(a),this.popInstanceList.length?this.popHide(!1):this.bKMaskManagerInstance.hide(n))}else t==null||t.remove();this.bKMaskManagerInstance.removeClickEvent()}removeLastEvent(){this.bKMaskManagerInstance.destroyEvent(this.uniqId)}onMaskClickFn(t){if(this.clickFn){const{fn:n}=this.clickFn;n&&Reflect.apply(n,this,[t])}}}new Wf;let Ki;const wg=new Uint8Array(16);function Mg(){if(!Ki&&(Ki=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Ki))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ki(wg)}const We=[];for(let e=0;e<256;++e)We.push((e+256).toString(16).slice(1));function Ig(e,t=0){return We[e[t+0]]+We[e[t+1]]+We[e[t+2]]+We[e[t+3]]+"-"+We[e[t+4]]+We[e[t+5]]+"-"+We[e[t+6]]+We[e[t+7]]+"-"+We[e[t+8]]+We[e[t+9]]+"-"+We[e[t+10]]+We[e[t+11]]+We[e[t+12]]+We[e[t+13]]+We[e[t+14]]+We[e[t+15]]}const Lg=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),su={randomUUID:Lg};function cn(e,t,n){if(su.randomUUID&&!t&&!e)return su.randomUUID();e=e||{};const a=e.random||(e.rng||Mg)();if(a[6]=a[6]&15|64,a[8]=a[8]&63|128,t){n=n||0;for(let s=0;s<16;++s)t[n+s]=a[s];return t}return Ig(a)}var ut="top",wt="bottom",Mt="right",dt="left",yl="auto",Oi=[ut,wt,Mt,dt],Ia="start",Mi="end",Tg="clippingParents",Ff="viewport",ei="popper",Sg="reference",ru=Oi.reduce(function(e,t){return e.concat([t+"-"+Ia,t+"-"+Mi])},[]),Bf=[].concat(Oi,[yl]).reduce(function(e,t){return e.concat([t,t+"-"+Ia,t+"-"+Mi])},[]),kg="beforeRead",xg="read",Dg="afterRead",jg="beforeMain",Og="main",Eg="afterMain",Pg="beforeWrite",Ag="write",zg="afterWrite",Vg=[kg,xg,Dg,jg,Og,Eg,Pg,Ag,zg];function Zt(e){return e?(e.nodeName||"").toLowerCase():null}function pt(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Xn(e){var t=pt(e).Element;return e instanceof t||e instanceof Element}function Nt(e){var t=pt(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function bl(e){if(typeof ShadowRoot>"u")return!1;var t=pt(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Jg(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var a=t.styles[n]||{},s=t.attributes[n]||{},r=t.elements[n];!Nt(r)||!Zt(r)||(Object.assign(r.style,a),Object.keys(s).forEach(function(o){var l=s[o];l===!1?r.removeAttribute(o):r.setAttribute(o,l===!0?"":l)}))})}function Rg(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(a){var s=t.elements[a],r=t.attributes[a]||{},o=Object.keys(t.styles.hasOwnProperty(a)?t.styles[a]:n[a]),l=o.reduce(function(u,c){return u[c]="",u},{});!Nt(s)||!Zt(s)||(Object.assign(s.style,l),Object.keys(r).forEach(function(u){s.removeAttribute(u)}))})}}const Qg={name:"applyStyles",enabled:!0,phase:"write",fn:Jg,effect:Rg,requires:["computeStyles"]};function Ht(e){return e.split("-")[0]}var Yn=Math.max,Ms=Math.min,La=Math.round;function xo(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function Gf(){return!/^((?!chrome|android).)*safari/i.test(xo())}function Ta(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var a=e.getBoundingClientRect(),s=1,r=1;t&&Nt(e)&&(s=e.offsetWidth>0&&La(a.width)/e.offsetWidth||1,r=e.offsetHeight>0&&La(a.height)/e.offsetHeight||1);var o=Xn(e)?pt(e):window,l=o.visualViewport,u=!Gf()&&n,c=(a.left+(u&&l?l.offsetLeft:0))/s,d=(a.top+(u&&l?l.offsetTop:0))/r,f=a.width/s,g=a.height/r;return{width:f,height:g,top:d,right:c+f,bottom:d+g,left:c,x:c,y:d}}function Cl(e){var t=Ta(e),n=e.offsetWidth,a=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-a)<=1&&(a=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:a}}function Zf(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&bl(n)){var a=t;do{if(a&&e.isSameNode(a))return!0;a=a.parentNode||a.host}while(a)}return!1}function un(e){return pt(e).getComputedStyle(e)}function $g(e){return["table","td","th"].indexOf(Zt(e))>=0}function jn(e){return((Xn(e)?e.ownerDocument:e.document)||window.document).documentElement}function nr(e){return Zt(e)==="html"?e:e.assignedSlot||e.parentNode||(bl(e)?e.host:null)||jn(e)}function ou(e){return!Nt(e)||un(e).position==="fixed"?null:e.offsetParent}function _g(e){var t=/firefox/i.test(xo()),n=/Trident/i.test(xo());if(n&&Nt(e)){var a=un(e);if(a.position==="fixed")return null}var s=nr(e);for(bl(s)&&(s=s.host);Nt(s)&&["html","body"].indexOf(Zt(s))<0;){var r=un(s);if(r.transform!=="none"||r.perspective!=="none"||r.contain==="paint"||["transform","perspective"].indexOf(r.willChange)!==-1||t&&r.willChange==="filter"||t&&r.filter&&r.filter!=="none")return s;s=s.parentNode}return null}function Ei(e){for(var t=pt(e),n=ou(e);n&&$g(n)&&un(n).position==="static";)n=ou(n);return n&&(Zt(n)==="html"||Zt(n)==="body"&&un(n).position==="static")?t:n||_g(e)||t}function Nl(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function mi(e,t,n){return Yn(e,Ms(t,n))}function Hg(e,t,n){var a=mi(e,t,n);return a>n?n:a}function Yf(){return{top:0,right:0,bottom:0,left:0}}function Uf(e){return Object.assign({},Yf(),e)}function Kf(e,t){return t.reduce(function(n,a){return n[a]=e,n},{})}var Wg=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,Uf(typeof t!="number"?t:Kf(t,Oi))};function Fg(e){var t,n=e.state,a=e.name,s=e.options,r=n.elements.arrow,o=n.modifiersData.popperOffsets,l=Ht(n.placement),u=Nl(l),c=[dt,Mt].indexOf(l)>=0,d=c?"height":"width";if(!(!r||!o)){var f=Wg(s.padding,n),g=Cl(r),m=u==="y"?ut:dt,v=u==="y"?wt:Mt,p=n.rects.reference[d]+n.rects.reference[u]-o[u]-n.rects.popper[d],N=o[u]-n.rects.reference[u],b=Ei(r),I=b?u==="y"?b.clientHeight||0:b.clientWidth||0:0,y=p/2-N/2,C=f[m],M=I-g[d]-f[v],w=I/2-g[d]/2+y,x=mi(C,w,M),L=u;n.modifiersData[a]=(t={},t[L]=x,t.centerOffset=x-w,t)}}function Bg(e){var t=e.state,n=e.options,a=n.element,s=a===void 0?"[data-popper-arrow]":a;s!=null&&(typeof s=="string"&&(s=t.elements.popper.querySelector(s),!s)||Zf(t.elements.popper,s)&&(t.elements.arrow=s))}const Gg={name:"arrow",enabled:!0,phase:"main",fn:Fg,effect:Bg,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Sa(e){return e.split("-")[1]}var Zg={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Yg(e,t){var n=e.x,a=e.y,s=t.devicePixelRatio||1;return{x:La(n*s)/s||0,y:La(a*s)/s||0}}function lu(e){var t,n=e.popper,a=e.popperRect,s=e.placement,r=e.variation,o=e.offsets,l=e.position,u=e.gpuAcceleration,c=e.adaptive,d=e.roundOffsets,f=e.isFixed,g=o.x,m=g===void 0?0:g,v=o.y,p=v===void 0?0:v,N=typeof d=="function"?d({x:m,y:p}):{x:m,y:p};m=N.x,p=N.y;var b=o.hasOwnProperty("x"),I=o.hasOwnProperty("y"),y=dt,C=ut,M=window;if(c){var w=Ei(n),x="clientHeight",L="clientWidth";if(w===pt(n)&&(w=jn(n),un(w).position!=="static"&&l==="absolute"&&(x="scrollHeight",L="scrollWidth")),w=w,s===ut||(s===dt||s===Mt)&&r===Mi){C=wt;var k=f&&w===M&&M.visualViewport?M.visualViewport.height:w[x];p-=k-a.height,p*=u?1:-1}if(s===dt||(s===ut||s===wt)&&r===Mi){y=Mt;var T=f&&w===M&&M.visualViewport?M.visualViewport.width:w[L];m-=T-a.width,m*=u?1:-1}}var E=Object.assign({position:l},c&&Zg),P=d===!0?Yg({x:m,y:p},pt(n)):{x:m,y:p};if(m=P.x,p=P.y,u){var V;return Object.assign({},E,(V={},V[C]=I?"0":"",V[y]=b?"0":"",V.transform=(M.devicePixelRatio||1)<=1?"translate("+m+"px, "+p+"px)":"translate3d("+m+"px, "+p+"px, 0)",V))}return Object.assign({},E,(t={},t[C]=I?p+"px":"",t[y]=b?m+"px":"",t.transform="",t))}function Ug(e){var t=e.state,n=e.options,a=n.gpuAcceleration,s=a===void 0?!0:a,r=n.adaptive,o=r===void 0?!0:r,l=n.roundOffsets,u=l===void 0?!0:l,c={placement:Ht(t.placement),variation:Sa(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:s,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,lu(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:u})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,lu(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const Kg={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Ug,data:{}};var Xi={passive:!0};function Xg(e){var t=e.state,n=e.instance,a=e.options,s=a.scroll,r=s===void 0?!0:s,o=a.resize,l=o===void 0?!0:o,u=pt(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return r&&c.forEach(function(d){d.addEventListener("scroll",n.update,Xi)}),l&&u.addEventListener("resize",n.update,Xi),function(){r&&c.forEach(function(d){d.removeEventListener("scroll",n.update,Xi)}),l&&u.removeEventListener("resize",n.update,Xi)}}const qg={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Xg,data:{}};var em={left:"right",right:"left",bottom:"top",top:"bottom"};function us(e){return e.replace(/left|right|bottom|top/g,function(t){return em[t]})}var tm={start:"end",end:"start"};function cu(e){return e.replace(/start|end/g,function(t){return tm[t]})}function wl(e){var t=pt(e),n=t.pageXOffset,a=t.pageYOffset;return{scrollLeft:n,scrollTop:a}}function Ml(e){return Ta(jn(e)).left+wl(e).scrollLeft}function nm(e,t){var n=pt(e),a=jn(e),s=n.visualViewport,r=a.clientWidth,o=a.clientHeight,l=0,u=0;if(s){r=s.width,o=s.height;var c=Gf();(c||!c&&t==="fixed")&&(l=s.offsetLeft,u=s.offsetTop)}return{width:r,height:o,x:l+Ml(e),y:u}}function am(e){var t,n=jn(e),a=wl(e),s=(t=e.ownerDocument)==null?void 0:t.body,r=Yn(n.scrollWidth,n.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),o=Yn(n.scrollHeight,n.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),l=-a.scrollLeft+Ml(e),u=-a.scrollTop;return un(s||n).direction==="rtl"&&(l+=Yn(n.clientWidth,s?s.clientWidth:0)-r),{width:r,height:o,x:l,y:u}}function Il(e){var t=un(e),n=t.overflow,a=t.overflowX,s=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+s+a)}function Xf(e){return["html","body","#document"].indexOf(Zt(e))>=0?e.ownerDocument.body:Nt(e)&&Il(e)?e:Xf(nr(e))}function vi(e,t){var n;t===void 0&&(t=[]);var a=Xf(e),s=a===((n=e.ownerDocument)==null?void 0:n.body),r=pt(a),o=s?[r].concat(r.visualViewport||[],Il(a)?a:[]):a,l=t.concat(o);return s?l:l.concat(vi(nr(o)))}function Do(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function im(e,t){var n=Ta(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function uu(e,t,n){return t===Ff?Do(nm(e,n)):Xn(t)?im(t,n):Do(am(jn(e)))}function sm(e){var t=vi(nr(e)),n=["absolute","fixed"].indexOf(un(e).position)>=0,a=n&&Nt(e)?Ei(e):e;return Xn(a)?t.filter(function(s){return Xn(s)&&Zf(s,a)&&Zt(s)!=="body"}):[]}function rm(e,t,n,a){var s=t==="clippingParents"?sm(e):[].concat(t),r=[].concat(s,[n]),o=r[0],l=r.reduce(function(u,c){var d=uu(e,c,a);return u.top=Yn(d.top,u.top),u.right=Ms(d.right,u.right),u.bottom=Ms(d.bottom,u.bottom),u.left=Yn(d.left,u.left),u},uu(e,o,a));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function qf(e){var t=e.reference,n=e.element,a=e.placement,s=a?Ht(a):null,r=a?Sa(a):null,o=t.x+t.width/2-n.width/2,l=t.y+t.height/2-n.height/2,u;switch(s){case ut:u={x:o,y:t.y-n.height};break;case wt:u={x:o,y:t.y+t.height};break;case Mt:u={x:t.x+t.width,y:l};break;case dt:u={x:t.x-n.width,y:l};break;default:u={x:t.x,y:t.y}}var c=s?Nl(s):null;if(c!=null){var d=c==="y"?"height":"width";switch(r){case Ia:u[c]=u[c]-(t[d]/2-n[d]/2);break;case Mi:u[c]=u[c]+(t[d]/2-n[d]/2);break}}return u}function Ii(e,t){t===void 0&&(t={});var n=t,a=n.placement,s=a===void 0?e.placement:a,r=n.strategy,o=r===void 0?e.strategy:r,l=n.boundary,u=l===void 0?Tg:l,c=n.rootBoundary,d=c===void 0?Ff:c,f=n.elementContext,g=f===void 0?ei:f,m=n.altBoundary,v=m===void 0?!1:m,p=n.padding,N=p===void 0?0:p,b=Uf(typeof N!="number"?N:Kf(N,Oi)),I=g===ei?Sg:ei,y=e.rects.popper,C=e.elements[v?I:g],M=rm(Xn(C)?C:C.contextElement||jn(e.elements.popper),u,d,o),w=Ta(e.elements.reference),x=qf({reference:w,element:y,strategy:"absolute",placement:s}),L=Do(Object.assign({},y,x)),k=g===ei?L:w,T={top:M.top-k.top+b.top,bottom:k.bottom-M.bottom+b.bottom,left:M.left-k.left+b.left,right:k.right-M.right+b.right},E=e.modifiersData.offset;if(g===ei&&E){var P=E[s];Object.keys(T).forEach(function(V){var D=[Mt,wt].indexOf(V)>=0?1:-1,j=[ut,wt].indexOf(V)>=0?"y":"x";T[V]+=P[j]*D})}return T}function om(e,t){t===void 0&&(t={});var n=t,a=n.placement,s=n.boundary,r=n.rootBoundary,o=n.padding,l=n.flipVariations,u=n.allowedAutoPlacements,c=u===void 0?Bf:u,d=Sa(a),f=d?l?ru:ru.filter(function(v){return Sa(v)===d}):Oi,g=f.filter(function(v){return c.indexOf(v)>=0});g.length===0&&(g=f);var m=g.reduce(function(v,p){return v[p]=Ii(e,{placement:p,boundary:s,rootBoundary:r,padding:o})[Ht(p)],v},{});return Object.keys(m).sort(function(v,p){return m[v]-m[p]})}function lm(e){if(Ht(e)===yl)return[];var t=us(e);return[cu(e),t,cu(t)]}function cm(e){var t=e.state,n=e.options,a=e.name;if(!t.modifiersData[a]._skip){for(var s=n.mainAxis,r=s===void 0?!0:s,o=n.altAxis,l=o===void 0?!0:o,u=n.fallbackPlacements,c=n.padding,d=n.boundary,f=n.rootBoundary,g=n.altBoundary,m=n.flipVariations,v=m===void 0?!0:m,p=n.allowedAutoPlacements,N=t.options.placement,b=Ht(N),I=b===N,y=u||(I||!v?[us(N)]:lm(N)),C=[N].concat(y).reduce(function(Z,_){return Z.concat(Ht(_)===yl?om(t,{placement:_,boundary:d,rootBoundary:f,padding:c,flipVariations:v,allowedAutoPlacements:p}):_)},[]),M=t.rects.reference,w=t.rects.popper,x=new Map,L=!0,k=C[0],T=0;T<C.length;T++){var E=C[T],P=Ht(E),V=Sa(E)===Ia,D=[ut,wt].indexOf(P)>=0,j=D?"width":"height",B=Ii(t,{placement:E,boundary:d,rootBoundary:f,altBoundary:g,padding:c}),R=D?V?Mt:dt:V?wt:ut;M[j]>w[j]&&(R=us(R));var X=us(R),Y=[];if(r&&Y.push(B[P]<=0),l&&Y.push(B[R]<=0,B[X]<=0),Y.every(function(Z){return Z})){k=E,L=!1;break}x.set(E,Y)}if(L)for(var re=v?3:1,H=function(_){var G=C.find(function(K){var Q=x.get(K);if(Q)return Q.slice(0,_).every(function(J){return J})});if(G)return k=G,"break"},U=re;U>0;U--){var W=H(U);if(W==="break")break}t.placement!==k&&(t.modifiersData[a]._skip=!0,t.placement=k,t.reset=!0)}}const um={name:"flip",enabled:!0,phase:"main",fn:cm,requiresIfExists:["offset"],data:{_skip:!1}};function du(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function fu(e){return[ut,Mt,wt,dt].some(function(t){return e[t]>=0})}function dm(e){var t=e.state,n=e.name,a=t.rects.reference,s=t.rects.popper,r=t.modifiersData.preventOverflow,o=Ii(t,{elementContext:"reference"}),l=Ii(t,{altBoundary:!0}),u=du(o,a),c=du(l,s,r),d=fu(u),f=fu(c);t.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":f})}const fm={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:dm};function hm(e,t,n){var a=Ht(e),s=[dt,ut].indexOf(a)>=0?-1:1,r=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,o=r[0],l=r[1];return o=o||0,l=(l||0)*s,[dt,Mt].indexOf(a)>=0?{x:l,y:o}:{x:o,y:l}}function gm(e){var t=e.state,n=e.options,a=e.name,s=n.offset,r=s===void 0?[0,0]:s,o=Bf.reduce(function(d,f){return d[f]=hm(f,t.rects,r),d},{}),l=o[t.placement],u=l.x,c=l.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=u,t.modifiersData.popperOffsets.y+=c),t.modifiersData[a]=o}const mm={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:gm};function vm(e){var t=e.state,n=e.name;t.modifiersData[n]=qf({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const pm={name:"popperOffsets",enabled:!0,phase:"read",fn:vm,data:{}};function ym(e){return e==="x"?"y":"x"}function bm(e){var t=e.state,n=e.options,a=e.name,s=n.mainAxis,r=s===void 0?!0:s,o=n.altAxis,l=o===void 0?!1:o,u=n.boundary,c=n.rootBoundary,d=n.altBoundary,f=n.padding,g=n.tether,m=g===void 0?!0:g,v=n.tetherOffset,p=v===void 0?0:v,N=Ii(t,{boundary:u,rootBoundary:c,padding:f,altBoundary:d}),b=Ht(t.placement),I=Sa(t.placement),y=!I,C=Nl(b),M=ym(C),w=t.modifiersData.popperOffsets,x=t.rects.reference,L=t.rects.popper,k=typeof p=="function"?p(Object.assign({},t.rects,{placement:t.placement})):p,T=typeof k=="number"?{mainAxis:k,altAxis:k}:Object.assign({mainAxis:0,altAxis:0},k),E=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,P={x:0,y:0};if(w){if(r){var V,D=C==="y"?ut:dt,j=C==="y"?wt:Mt,B=C==="y"?"height":"width",R=w[C],X=R+N[D],Y=R-N[j],re=m?-L[B]/2:0,H=I===Ia?x[B]:L[B],U=I===Ia?-L[B]:-x[B],W=t.elements.arrow,Z=m&&W?Cl(W):{width:0,height:0},_=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Yf(),G=_[D],K=_[j],Q=mi(0,x[B],Z[B]),J=y?x[B]/2-re-Q-G-T.mainAxis:H-Q-G-T.mainAxis,z=y?-x[B]/2+re+Q+K+T.mainAxis:U+Q+K+T.mainAxis,F=t.elements.arrow&&Ei(t.elements.arrow),S=F?C==="y"?F.clientTop||0:F.clientLeft||0:0,O=(V=E==null?void 0:E[C])!=null?V:0,$=R+J-O-S,ae=R+z-O,A=mi(m?Ms(X,$):X,R,m?Yn(Y,ae):Y);w[C]=A,P[C]=A-R}if(l){var ne,te=C==="x"?ut:dt,q=C==="x"?wt:Mt,ie=w[M],ve=M==="y"?"height":"width",ee=ie+N[te],se=ie-N[q],ce=[ut,dt].indexOf(b)!==-1,ge=(ne=E==null?void 0:E[M])!=null?ne:0,Ce=ce?ee:ie-x[ve]-L[ve]-ge+T.altAxis,Le=ce?ie+x[ve]+L[ve]-ge-T.altAxis:se,xe=m&&ce?Hg(Ce,ie,Le):mi(m?Ce:ee,ie,m?Le:se);w[M]=xe,P[M]=xe-ie}t.modifiersData[a]=P}}const Cm={name:"preventOverflow",enabled:!0,phase:"main",fn:bm,requiresIfExists:["offset"]};function Nm(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function wm(e){return e===pt(e)||!Nt(e)?wl(e):Nm(e)}function Mm(e){var t=e.getBoundingClientRect(),n=La(t.width)/e.offsetWidth||1,a=La(t.height)/e.offsetHeight||1;return n!==1||a!==1}function Im(e,t,n){n===void 0&&(n=!1);var a=Nt(t),s=Nt(t)&&Mm(t),r=jn(t),o=Ta(e,s,n),l={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(a||!a&&!n)&&((Zt(t)!=="body"||Il(r))&&(l=wm(t)),Nt(t)?(u=Ta(t,!0),u.x+=t.clientLeft,u.y+=t.clientTop):r&&(u.x=Ml(r))),{x:o.left+l.scrollLeft-u.x,y:o.top+l.scrollTop-u.y,width:o.width,height:o.height}}function Lm(e){var t=new Map,n=new Set,a=[];e.forEach(function(r){t.set(r.name,r)});function s(r){n.add(r.name);var o=[].concat(r.requires||[],r.requiresIfExists||[]);o.forEach(function(l){if(!n.has(l)){var u=t.get(l);u&&s(u)}}),a.push(r)}return e.forEach(function(r){n.has(r.name)||s(r)}),a}function Tm(e){var t=Lm(e);return Vg.reduce(function(n,a){return n.concat(t.filter(function(s){return s.phase===a}))},[])}function Sm(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function km(e){var t=e.reduce(function(n,a){var s=n[a.name];return n[a.name]=s?Object.assign({},s,a,{options:Object.assign({},s.options,a.options),data:Object.assign({},s.data,a.data)}):a,n},{});return Object.keys(t).map(function(n){return t[n]})}var hu={placement:"bottom",modifiers:[],strategy:"absolute"};function gu(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(a){return!(a&&typeof a.getBoundingClientRect=="function")})}function xm(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,a=n===void 0?[]:n,s=t.defaultOptions,r=s===void 0?hu:s;return function(l,u,c){c===void 0&&(c=r);var d={placement:"bottom",orderedModifiers:[],options:Object.assign({},hu,r),modifiersData:{},elements:{reference:l,popper:u},attributes:{},styles:{}},f=[],g=!1,m={state:d,setOptions:function(b){var I=typeof b=="function"?b(d.options):b;p(),d.options=Object.assign({},r,d.options,I),d.scrollParents={reference:Xn(l)?vi(l):l.contextElement?vi(l.contextElement):[],popper:vi(u)};var y=Tm(km([].concat(a,d.options.modifiers)));return d.orderedModifiers=y.filter(function(C){return C.enabled}),v(),m.update()},forceUpdate:function(){if(!g){var b=d.elements,I=b.reference,y=b.popper;if(gu(I,y)){d.rects={reference:Im(I,Ei(y),d.options.strategy==="fixed"),popper:Cl(y)},d.reset=!1,d.placement=d.options.placement,d.orderedModifiers.forEach(function(T){return d.modifiersData[T.name]=Object.assign({},T.data)});for(var C=0;C<d.orderedModifiers.length;C++){if(d.reset===!0){d.reset=!1,C=-1;continue}var M=d.orderedModifiers[C],w=M.fn,x=M.options,L=x===void 0?{}:x,k=M.name;typeof w=="function"&&(d=w({state:d,options:L,name:k,instance:m})||d)}}}},update:Sm(function(){return new Promise(function(N){m.forceUpdate(),N(d)})}),destroy:function(){p(),g=!0}};if(!gu(l,u))return m;m.setOptions(c).then(function(N){!g&&c.onFirstUpdate&&c.onFirstUpdate(N)});function v(){d.orderedModifiers.forEach(function(N){var b=N.name,I=N.options,y=I===void 0?{}:I,C=N.effect;if(typeof C=="function"){var M=C({state:d,name:b,instance:m,options:y}),w=function(){};f.push(M||w)}})}function p(){f.forEach(function(N){return N()}),f=[]}return m}}var Dm=[qg,pm,Kg,Qg,mm,um,Cm,Gg,fm],eh=xm({defaultModifiers:Dm});class jm{constructor(t,n,a){me(this,"isShow",!1);me(this,"trigger");me(this,"instance");me(this,"always",!1);me(this,"reference");me(this,"referenceTarget");me(this,"popperRefer");me(this,"instanceOptions");me(this,"delay",50);me(this,"isInnerPopper",!1);me(this,"disabled",!1);me(this,"afterShow",null);me(this,"afterHidden",null);me(this,"appendTo","parent");me(this,"container",null);me(this,"fixOnBoundary",!1);var s,r;this.instanceOptions=this.initDefaultOptions(a),this.reference=this.resolveInputSelectorToHtmlElement(t),this.popperRefer=this.resolveInputSelectorToHtmlElement(n),this.referenceTarget=this.getTargetReferenceElement(),this.container=(s=this.popperRefer)==null?void 0:s.parentElement,this.isShow=!!((r=this.instanceOptions)!=null&&r.isShow),this.always=this.instanceOptions.always,this.trigger=this.instanceOptions.trigger,this.disabled=this.instanceOptions.disabled,this.appendTo=this.instanceOptions.appendTo,this.afterHidden=typeof a.afterHidden=="function"?a.afterHidden:()=>{},this.afterShow=typeof a.afterShow=="function"?a.afterShow:()=>{},this.fixOnBoundary=this.instanceOptions.fixOnBoundary,this.initInstance(),this.registerEvents(),(this.isShow||this.always)&&this.show(null)}forceUpdate(){var t;(t=this.instance)==null||t.forceUpdate()}update(){var t;(t=this.instance)==null||t.update()}updateOptions(t){var n;this.instanceOptions=this.initDefaultOptions(t),this.isShow=!!((n=this.instanceOptions)!=null&&n.isShow),this.trigger=this.instanceOptions.trigger,this.disabled=this.instanceOptions.disabled,this.setOptions(this.instanceOptions)}setOptions(t){var n;(n=this.instance)==null||n.setOptions(t)}destroy(){var t;(t=this.instance)==null||t.destroy()}updateDisabled(t){this.disabled=t??!this.disabled,this.disabled&&this.hide()}show(t){var n;this.disabled||((n=this.popperRefer)==null||n.setAttribute("data-show",""),this.setOptions({modifiers:[...this.instanceOptions.modifiers||[],{name:"eventListeners",enabled:!0}]}),this.update(),this.isShow=!0,this.afterShow(),this.fixOnBoundary||this.appendToTarget())}hide(){var t;this.always||((t=this.popperRefer)==null||t.removeAttribute("data-show"),this.setOptions({modifiers:[...this.instanceOptions.modifiers||[],{name:"eventListeners",enabled:!1}]}),this.isShow=!1,this.isInnerPopper=!1,this.afterHidden(),this.fixOnBoundary||this.restorePopContent())}restorePopContent(){const t=this.getAppendToTarget();Zn(t)&&t.contains(this.popperRefer)&&this.container&&!this.container.contains(this.popperRefer)&&this.container.append(this.popperRefer)}appendToTarget(){const t=this.getAppendToTarget();Zn(t)&&t.contains(this.popperRefer)&&t.append(this.popperRefer)}getAppendToTarget(){const{appendTo:t}=this;let n=t;return t!=="parent"&&typeof t=="string"&&(n=document.querySelector(t)),n}initDefaultOptions(t){const a=Vf({placement:"top",modifiers:[{name:"offset",options:{offset:[0,8]}}],strategy:"absolute",onFirstUpdate:void 0,isShow:!1,theme:"dark",trigger:"hover",disabled:!1},t||{}),s=a.onFirstUpdate;return a.onFirstUpdate=r=>{typeof s=="function"&&(s.call(this,r),this.handleFirstUpdate())},a}handleFirstUpdate(){this.fixOnBoundary&&this.appendToTarget()}getTargetReferenceElement(){return this.isElement(this.reference)?this.reference.childElementCount===1?this.reference.firstElementChild:this.reference:this.reference}initInstance(){var t;this.referenceTarget&&(this.referenceTarget&&this.popperRefer?(this.instance=eh(this.referenceTarget,this.popperRefer,this.instanceOptions),(t=this.popperRefer)==null||t.setAttribute("data-theme",this.instanceOptions.theme??"dark")):console.error("reference or popperRefer is null, please check html element."))}resolveInputSelectorToHtmlElement(t){if(this.isElement(t))return t;if(typeof t=="string")return document.querySelector(t);if(typeof t=="object"){if(Object.prototype.hasOwnProperty.call(t,"getBoundingClientRect"))return t}else console.error("'getBoundingClientRect' is needed when use virtual elements");return null}isElement(t){return Zn(t)}registerEvents(){if(this.isElement(this.referenceTarget)&&this.trigger==="hover"){const t=["mouseenter","focus"],n=["mouseleave","blur"],a=["mouseenter","mouseleave"];t.forEach(s=>{this.referenceTarget.addEventListener(s,r=>{s==="mouseenter"&&(this.isInnerPopper=!0),this.show(r)})}),n.forEach(s=>{this.referenceTarget.addEventListener(s,()=>{this.isInnerPopper=!1,setTimeout(()=>{!this.isInnerPopper&&this.hide()},this.delay)})}),this.isElement(this.popperRefer)&&a.forEach(s=>{this.popperRefer.addEventListener(s,()=>{s==="mouseenter"&&(this.isInnerPopper=!0),s==="mouseleave"&&this.hide()})})}this.trigger==="click"&&["click"].forEach(n=>{document.body.addEventListener(n,a=>{this.isSameElement(a.target,this.reference)||this.reference.contains(a.target)?this.show(a):this.isShow&&!this.isSameElement(a.target,this.popperRefer)&&!this.popperRefer.contains(a.target)&&this.hide()})})}isSameElement(t,n){return t&&(t===n||t===n.firstElementChild)}}/*!
|
7
|
+
`,r.textContent=a.textContent,r};let n=!1;try{const a=window.getComputedStyle(e,null);if(a.webkitLineClamp!=="none"){const r=parseFloat(a.height),o=t(e,a);document.body.appendChild(o);const l=window.getComputedStyle(o,null).height;document.body.removeChild(o),n=r<parseFloat(l)}else n=e.clientWidth<e.scrollWidth||e.clientHeight<e.scrollHeight}catch(a){console.warn("There is an error when check element overflow state: ",a)}return n}const lo={bottom:0,content:1,navi:100,fullScreen:1e3,modal:2e3,plugins:5e3,message:6e3,popper:8e3};class yg{constructor(){me(this,"storageLayerIndexValue",{});this.copyDefaultValue()}getNextIndex(t){return Object.prototype.hasOwnProperty.call(this.storageLayerIndexValue,t)?(this.storageLayerIndexValue[t]=this.storageLayerIndexValue[t]+1,this.storageLayerIndexValue[t]):(this.storageLayerIndexValue.modal=this.storageLayerIndexValue.modal+1,this.storageLayerIndexValue.modal)}getModalNextIndex(){return this.getNextIndex("modal")}getMessageNextIndex(){return this.getNextIndex("message")}getFullScreenNextIndex(){return this.getNextIndex("fullScreen")}getNaviNextIndex(){return this.getNextIndex("navi")}getPopperIndex(){return this.getNextIndex("popper")}setDefaultZIndex(t){Object.keys(t||{}).forEach(n=>{Object.prototype.hasOwnProperty.call(this.storageLayerIndexValue.__proto__,n)&&Object.assign(this.storageLayerIndexValue.__proto__,{[n]:t[n]})}),this.copyDefaultValue()}resetZIndex(t){Object.keys(t||{}).forEach(n=>{Object.prototype.hasOwnProperty.call(this.storageLayerIndexValue,n)&&Object.assign(this.storageLayerIndexValue,{[n]:t[n]})})}copyDefaultValue(){const t=Object.keys(lo).reduce((n,a)=>Object.assign(n,{[a]:{value:lo[a],writable:!0,configurable:!0}}),{});this.storageLayerIndexValue=Object.create(lo,t)}}const Gt=new yg;`${Tn(16)}`;const ws=new WeakMap,ko=e=>ws.has(e)?ws.get(e):[],bg=(e,t,n,a,s)=>{const r=ko(e);r.some(o=>o.instanceId===s)||(r.push({event:t,args:n,content:a,instanceId:s}),ws.set(e,r))},Cg=(e,t)=>{ws.set(e,t)};class Ng{constructor(){me(this,"timer",null);me(this,"store",[]);me(this,"maskMap",new WeakMap)}appendMaker(t){this.store.push(t),this.executeMaker()}pushMaskStyle(t,n){const a=this.getMaskMap(t);this.setMaskMap(t,{styles:[n],...a||{}})}getMaskStyles(t){var n;return((n=this.getMaskMap(t))==null?void 0:n.styles)||[]}setMaskId(t,n){const a=this.getMaskMap(t);a?(Object.assign(a,{id:n}),this.setMaskMap(t,a)):this.setMaskMap(t,{id:n,...a||{}})}getMaskId(t){var n;return(n=this.getMaskMap(t))==null?void 0:n.id}setMaskMap(t,n){this.maskMap.set(t,n)}getMaskMap(t){return this.maskMap.get(t)}executeMaker(){this.timer&&cancelAnimationFrame(this.timer),this.timer=requestAnimationFrame(()=>{const t=this.store.pop();typeof t=="function"&&(Reflect.apply(t,this,[]),this.executeMaker())})}}const fa=new Ng;class Hf{constructor(t){me(this,"mask");me(this,"backupMask");me(this,"multiInstance",!1);me(this,"uniqueMaskAttrTag","");me(this,"parentNode",document.body);me(this,"activeInstance");me(this,"zIndexStore",new Map);me(this,"lastUUID",null);me(this,"maskStyle",{position:"fixed",left:0,top:0,bottom:0,right:0,display:"none","background-color":"rgba(0,0,0,.6)"});me(this,"isInit",!1);me(this,"maskAttrTag","auto");const{multiInstance:n=!1,maskAttrTag:a="auto",parentNode:s=document.body,maskStyle:r={}}=t||{};this.parentNode=s||document,this.maskAttrTag=a,this.activeInstance=void 0,this.multiInstance=n,this.uniqueMaskAttrTag=this.getMaskAttrTag(a),fa.appendMaker(()=>{this.initInstance(r)})}setOption(t){const{parentNode:n=document.body,maskStyle:a={},maskAttrTag:s=this.maskAttrTag}=t||{};this.parentNode=n||document,this.setMaskStyle(Object.assign({},this.maskStyle,a)),this.uniqueMaskAttrTag=this.getMaskAttrTag(s)}destroyEvent(t){if(this.mask){const n=ko(this.mask)||[],a=n.findIndex(s=>s.instanceId===t);a>=0&&(n.splice(a,1),Cg(this.mask,n))}}show(t,n,a=!0,s={},r=null,o=!1,l,u){const c=r??Tn(16),d=/-?\d+/.test(`${n}`)?n:Gt.getModalNextIndex();let f=Object.assign({},this.maskStyle,s||{});if(!a&&this.lastUUID){const g=this.zIndexStore.get(this.lastUUID);g&&(f=g==null?void 0:g.style)}this.storeMaskInsCfg({zIndex:d,style:{...f},uuid:c,preUID:this.lastUUID}),Object.assign(f,{display:"block","z-index":`${d}`,"pointer-events":"all"}),this.initInstance(f),l&&this.catchClickEvent(t,l,u),this.setMaskStyle(f),fa.pushMaskStyle(this.parentNode,{...f}),this.backupMask.style.setProperty("z-index",`${d-1}`),a||(this.mask.style.setProperty("pointer-events","none"),t==null||t.style.setProperty("pointer-events","all")),t&&(o&&t.style.setProperty("z-index",`${d+1}`),this.activeInstance=t,this.appendContentToMask(t))}hide(t=!1,n,a){var o;const s=a??this.lastUUID;t||(n==null||n.remove(),(o=this.activeInstance)==null||o.remove()),this.removeClickEvent(),this.activeInstance=void 0,this.popIndexStore(s);const r=fa.getMaskStyles(this.parentNode);if(r==null||r.pop(),!(r!=null&&r.length))this.mask.style.setProperty("display","none");else{const l=r.slice(-1)[0];this.setMaskStyle(l)}}storeMaskInsCfg(t){return this.zIndexStore.set(t.uuid,t),this.lastUUID=t.uuid,this.zIndexStore.get(t.uuid)}popIndexStore(t){if(this.zIndexStore.has(t)){const n=this.zIndexStore.get(t);return this.lastUUID=n.preUID,this.zIndexStore.delete(t)}return this.lastUUID=null,!1}backupActiveInstance(){this.activeInstance&&this.backupMask.append(this.activeInstance)}backupContentElement(t){var n;t&&((n=this.backupMask)==null||n.append(t))}getActiveContentInstance(){return this.activeInstance}removeClickEvent(){}initInstance(t){if(!this.isInit){this.isInit=!0,this.backupMask=this.getBackupMask();const{instance:n,isExist:a}=this.getMask();this.mask=n,!a&&this.setMaskStyle(Object.assign({},this.maskStyle,t))}}getMask(){if(this.multiInstance)return{instance:this.createMask(),isExist:!1};let t=!0,n=this.parentNode.querySelector(`[data-bk-mask-uid='${this.uniqueMaskAttrTag}']`);return n||(t=!1,n=this.createMask(),n.addEventListener("mousedown",a=>this.handleMaskClick(a),!0)),{instance:n,isExist:t}}catchClickEvent(t,n,a){this.mask&&bg(this.mask,n,[],t,a)}handleMaskClick(t){if(t.target!==this.mask)return;const n=ko(this.mask);if(n.length){const{event:a}=n.slice(-1)[0];typeof a=="function"&&a(t)}}getBackupMask(){const t="data-bk-backup-uid";let n=this.parentNode.querySelector(`[${t}]`);return n||(n=this.createMask(t)),n}createMask(t="data-bk-mask-uid"){const n=document.createElement("div");return n.setAttribute(t,this.uniqueMaskAttrTag),this.parentNode.append(n),n}setMaskStyle(t={}){this.mask&&Object.entries(t).forEach(n=>this.mask.style.setProperty(n[0],n[1]))}getMaskAttrTag(t){return/^(auto|\s+)$/i.test(t)||t===null||t===void 0||t===""?(fa.getMaskId(this.parentNode)||fa.setMaskId(this.parentNode,`__bk_mask_${Tn(16)}`),fa.getMaskId(this.parentNode)):t}appendContentToMask(t){this.mask.append(t)}}new Hf({});const Ui=new WeakMap;class Wf{constructor(t){me(this,"uuidAttrName");me(this,"clickFn");me(this,"bKMaskManagerInstance");me(this,"transfer");me(this,"uniqId");this.clickFn=void 0,this.uuidAttrName="data-bk-pop-uuid",this.uniqId=Tn(16),this.transfer=this.getParentNode(t==null?void 0:t.transfer),this.bKMaskManagerInstance=new Hf({parentNode:this.getParentNode(t==null?void 0:t.transfer),popInstance:this,onClick:this.onMaskClickFn})}get popInstanceList(){return Ui.has(this.transfer)||Ui.set(this.transfer,[]),Ui.get(this.transfer)}set popInstanceList(t){Ui.set(this.transfer,t)}getParentNode(t){if(typeof t=="string"){const n=document.querySelector(t);if(n)return n}return Zn(t)?t:document.body}onMaskClick(t,n){this.clickFn={fn:t,target:n}}show(t,n=!0,a={},s=!1,r=void 0,o){if(!t){console.warn("pop show error: content is null or undefined");return}const l=typeof r=="number"?r:Gt.getModalNextIndex(),u=Tn(16);t.setAttribute(this.uuidAttrName,u),this.popInstanceList.length>0&&n&&this.bKMaskManagerInstance.backupContentElement(this.popInstanceList.slice(-1)[0].content),this.popInstanceList.push({uuid:u,zIndex:l,content:t,showMask:n,appendStyle:a}),this.bKMaskManagerInstance.show(t,l,n,a,u,s,o,this.uniqId)}destroy(t,n=!1){this.clickFn=void 0,this.hide(t,n)}popHide(t=!0){if(this.popInstanceList.length){if(t){const n=this.popInstanceList.pop();this.bKMaskManagerInstance.popIndexStore(n.uuid),n.remove()}if(this.popInstanceList.length){const n=this.popInstanceList.slice(-1)[0],{zIndex:a,content:s,showMask:r,appendStyle:o,uuid:l}=n;this.bKMaskManagerInstance.show(s,a,r,o,l)}else this.bKMaskManagerInstance.hide()}}hide(t,n=!1){const a=t==null?void 0:t.getAttribute(this.uuidAttrName);if(a){const s=this.popInstanceList.findIndex(r=>r.uuid===a);s>=0&&(n||this.popInstanceList[s].content.remove(),this.popInstanceList.splice(s,1),this.bKMaskManagerInstance.popIndexStore(a),this.popInstanceList.length?this.popHide(!1):this.bKMaskManagerInstance.hide(n))}else t==null||t.remove();this.bKMaskManagerInstance.removeClickEvent()}removeLastEvent(){this.bKMaskManagerInstance.destroyEvent(this.uniqId)}onMaskClickFn(t){if(this.clickFn){const{fn:n}=this.clickFn;n&&Reflect.apply(n,this,[t])}}}new Wf;let Ki;const wg=new Uint8Array(16);function Mg(){if(!Ki&&(Ki=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Ki))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ki(wg)}const We=[];for(let e=0;e<256;++e)We.push((e+256).toString(16).slice(1));function Ig(e,t=0){return We[e[t+0]]+We[e[t+1]]+We[e[t+2]]+We[e[t+3]]+"-"+We[e[t+4]]+We[e[t+5]]+"-"+We[e[t+6]]+We[e[t+7]]+"-"+We[e[t+8]]+We[e[t+9]]+"-"+We[e[t+10]]+We[e[t+11]]+We[e[t+12]]+We[e[t+13]]+We[e[t+14]]+We[e[t+15]]}const Lg=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),su={randomUUID:Lg};function cn(e,t,n){if(su.randomUUID&&!t&&!e)return su.randomUUID();e=e||{};const a=e.random||(e.rng||Mg)();if(a[6]=a[6]&15|64,a[8]=a[8]&63|128,t){n=n||0;for(let s=0;s<16;++s)t[n+s]=a[s];return t}return Ig(a)}var ut="top",wt="bottom",Mt="right",dt="left",yl="auto",Oi=[ut,wt,Mt,dt],Ia="start",Mi="end",Tg="clippingParents",Ff="viewport",ei="popper",Sg="reference",ru=Oi.reduce(function(e,t){return e.concat([t+"-"+Ia,t+"-"+Mi])},[]),Bf=[].concat(Oi,[yl]).reduce(function(e,t){return e.concat([t,t+"-"+Ia,t+"-"+Mi])},[]),kg="beforeRead",xg="read",Dg="afterRead",jg="beforeMain",Og="main",Eg="afterMain",Pg="beforeWrite",Ag="write",zg="afterWrite",Vg=[kg,xg,Dg,jg,Og,Eg,Pg,Ag,zg];function Zt(e){return e?(e.nodeName||"").toLowerCase():null}function pt(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Xn(e){var t=pt(e).Element;return e instanceof t||e instanceof Element}function Nt(e){var t=pt(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function bl(e){if(typeof ShadowRoot>"u")return!1;var t=pt(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Jg(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var a=t.styles[n]||{},s=t.attributes[n]||{},r=t.elements[n];!Nt(r)||!Zt(r)||(Object.assign(r.style,a),Object.keys(s).forEach(function(o){var l=s[o];l===!1?r.removeAttribute(o):r.setAttribute(o,l===!0?"":l)}))})}function Rg(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(a){var s=t.elements[a],r=t.attributes[a]||{},o=Object.keys(t.styles.hasOwnProperty(a)?t.styles[a]:n[a]),l=o.reduce(function(u,c){return u[c]="",u},{});!Nt(s)||!Zt(s)||(Object.assign(s.style,l),Object.keys(r).forEach(function(u){s.removeAttribute(u)}))})}}const Qg={name:"applyStyles",enabled:!0,phase:"write",fn:Jg,effect:Rg,requires:["computeStyles"]};function Ht(e){return e.split("-")[0]}var Yn=Math.max,Ms=Math.min,La=Math.round;function xo(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function Gf(){return!/^((?!chrome|android).)*safari/i.test(xo())}function Ta(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var a=e.getBoundingClientRect(),s=1,r=1;t&&Nt(e)&&(s=e.offsetWidth>0&&La(a.width)/e.offsetWidth||1,r=e.offsetHeight>0&&La(a.height)/e.offsetHeight||1);var o=Xn(e)?pt(e):window,l=o.visualViewport,u=!Gf()&&n,c=(a.left+(u&&l?l.offsetLeft:0))/s,d=(a.top+(u&&l?l.offsetTop:0))/r,f=a.width/s,g=a.height/r;return{width:f,height:g,top:d,right:c+f,bottom:d+g,left:c,x:c,y:d}}function Cl(e){var t=Ta(e),n=e.offsetWidth,a=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-a)<=1&&(a=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:a}}function Zf(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&bl(n)){var a=t;do{if(a&&e.isSameNode(a))return!0;a=a.parentNode||a.host}while(a)}return!1}function un(e){return pt(e).getComputedStyle(e)}function $g(e){return["table","td","th"].indexOf(Zt(e))>=0}function jn(e){return((Xn(e)?e.ownerDocument:e.document)||window.document).documentElement}function nr(e){return Zt(e)==="html"?e:e.assignedSlot||e.parentNode||(bl(e)?e.host:null)||jn(e)}function ou(e){return!Nt(e)||un(e).position==="fixed"?null:e.offsetParent}function _g(e){var t=/firefox/i.test(xo()),n=/Trident/i.test(xo());if(n&&Nt(e)){var a=un(e);if(a.position==="fixed")return null}var s=nr(e);for(bl(s)&&(s=s.host);Nt(s)&&["html","body"].indexOf(Zt(s))<0;){var r=un(s);if(r.transform!=="none"||r.perspective!=="none"||r.contain==="paint"||["transform","perspective"].indexOf(r.willChange)!==-1||t&&r.willChange==="filter"||t&&r.filter&&r.filter!=="none")return s;s=s.parentNode}return null}function Ei(e){for(var t=pt(e),n=ou(e);n&&$g(n)&&un(n).position==="static";)n=ou(n);return n&&(Zt(n)==="html"||Zt(n)==="body"&&un(n).position==="static")?t:n||_g(e)||t}function Nl(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function mi(e,t,n){return Yn(e,Ms(t,n))}function Hg(e,t,n){var a=mi(e,t,n);return a>n?n:a}function Yf(){return{top:0,right:0,bottom:0,left:0}}function Uf(e){return Object.assign({},Yf(),e)}function Kf(e,t){return t.reduce(function(n,a){return n[a]=e,n},{})}var Wg=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,Uf(typeof t!="number"?t:Kf(t,Oi))};function Fg(e){var t,n=e.state,a=e.name,s=e.options,r=n.elements.arrow,o=n.modifiersData.popperOffsets,l=Ht(n.placement),u=Nl(l),c=[dt,Mt].indexOf(l)>=0,d=c?"height":"width";if(!(!r||!o)){var f=Wg(s.padding,n),g=Cl(r),m=u==="y"?ut:dt,v=u==="y"?wt:Mt,p=n.rects.reference[d]+n.rects.reference[u]-o[u]-n.rects.popper[d],N=o[u]-n.rects.reference[u],b=Ei(r),I=b?u==="y"?b.clientHeight||0:b.clientWidth||0:0,y=p/2-N/2,C=f[m],M=I-g[d]-f[v],w=I/2-g[d]/2+y,x=mi(C,w,M),L=u;n.modifiersData[a]=(t={},t[L]=x,t.centerOffset=x-w,t)}}function Bg(e){var t=e.state,n=e.options,a=n.element,s=a===void 0?"[data-popper-arrow]":a;s!=null&&(typeof s=="string"&&(s=t.elements.popper.querySelector(s),!s)||Zf(t.elements.popper,s)&&(t.elements.arrow=s))}const Gg={name:"arrow",enabled:!0,phase:"main",fn:Fg,effect:Bg,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Sa(e){return e.split("-")[1]}var Zg={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Yg(e,t){var n=e.x,a=e.y,s=t.devicePixelRatio||1;return{x:La(n*s)/s||0,y:La(a*s)/s||0}}function lu(e){var t,n=e.popper,a=e.popperRect,s=e.placement,r=e.variation,o=e.offsets,l=e.position,u=e.gpuAcceleration,c=e.adaptive,d=e.roundOffsets,f=e.isFixed,g=o.x,m=g===void 0?0:g,v=o.y,p=v===void 0?0:v,N=typeof d=="function"?d({x:m,y:p}):{x:m,y:p};m=N.x,p=N.y;var b=o.hasOwnProperty("x"),I=o.hasOwnProperty("y"),y=dt,C=ut,M=window;if(c){var w=Ei(n),x="clientHeight",L="clientWidth";if(w===pt(n)&&(w=jn(n),un(w).position!=="static"&&l==="absolute"&&(x="scrollHeight",L="scrollWidth")),w=w,s===ut||(s===dt||s===Mt)&&r===Mi){C=wt;var k=f&&w===M&&M.visualViewport?M.visualViewport.height:w[x];p-=k-a.height,p*=u?1:-1}if(s===dt||(s===ut||s===wt)&&r===Mi){y=Mt;var T=f&&w===M&&M.visualViewport?M.visualViewport.width:w[L];m-=T-a.width,m*=u?1:-1}}var E=Object.assign({position:l},c&&Zg),P=d===!0?Yg({x:m,y:p},pt(n)):{x:m,y:p};if(m=P.x,p=P.y,u){var V;return Object.assign({},E,(V={},V[C]=I?"0":"",V[y]=b?"0":"",V.transform=(M.devicePixelRatio||1)<=1?"translate("+m+"px, "+p+"px)":"translate3d("+m+"px, "+p+"px, 0)",V))}return Object.assign({},E,(t={},t[C]=I?p+"px":"",t[y]=b?m+"px":"",t.transform="",t))}function Ug(e){var t=e.state,n=e.options,a=n.gpuAcceleration,s=a===void 0?!0:a,r=n.adaptive,o=r===void 0?!0:r,l=n.roundOffsets,u=l===void 0?!0:l,c={placement:Ht(t.placement),variation:Sa(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:s,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,lu(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:u})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,lu(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const Kg={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Ug,data:{}};var Xi={passive:!0};function Xg(e){var t=e.state,n=e.instance,a=e.options,s=a.scroll,r=s===void 0?!0:s,o=a.resize,l=o===void 0?!0:o,u=pt(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return r&&c.forEach(function(d){d.addEventListener("scroll",n.update,Xi)}),l&&u.addEventListener("resize",n.update,Xi),function(){r&&c.forEach(function(d){d.removeEventListener("scroll",n.update,Xi)}),l&&u.removeEventListener("resize",n.update,Xi)}}const qg={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Xg,data:{}};var em={left:"right",right:"left",bottom:"top",top:"bottom"};function us(e){return e.replace(/left|right|bottom|top/g,function(t){return em[t]})}var tm={start:"end",end:"start"};function cu(e){return e.replace(/start|end/g,function(t){return tm[t]})}function wl(e){var t=pt(e),n=t.pageXOffset,a=t.pageYOffset;return{scrollLeft:n,scrollTop:a}}function Ml(e){return Ta(jn(e)).left+wl(e).scrollLeft}function nm(e,t){var n=pt(e),a=jn(e),s=n.visualViewport,r=a.clientWidth,o=a.clientHeight,l=0,u=0;if(s){r=s.width,o=s.height;var c=Gf();(c||!c&&t==="fixed")&&(l=s.offsetLeft,u=s.offsetTop)}return{width:r,height:o,x:l+Ml(e),y:u}}function am(e){var t,n=jn(e),a=wl(e),s=(t=e.ownerDocument)==null?void 0:t.body,r=Yn(n.scrollWidth,n.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),o=Yn(n.scrollHeight,n.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),l=-a.scrollLeft+Ml(e),u=-a.scrollTop;return un(s||n).direction==="rtl"&&(l+=Yn(n.clientWidth,s?s.clientWidth:0)-r),{width:r,height:o,x:l,y:u}}function Il(e){var t=un(e),n=t.overflow,a=t.overflowX,s=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+s+a)}function Xf(e){return["html","body","#document"].indexOf(Zt(e))>=0?e.ownerDocument.body:Nt(e)&&Il(e)?e:Xf(nr(e))}function vi(e,t){var n;t===void 0&&(t=[]);var a=Xf(e),s=a===((n=e.ownerDocument)==null?void 0:n.body),r=pt(a),o=s?[r].concat(r.visualViewport||[],Il(a)?a:[]):a,l=t.concat(o);return s?l:l.concat(vi(nr(o)))}function Do(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function im(e,t){var n=Ta(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function uu(e,t,n){return t===Ff?Do(nm(e,n)):Xn(t)?im(t,n):Do(am(jn(e)))}function sm(e){var t=vi(nr(e)),n=["absolute","fixed"].indexOf(un(e).position)>=0,a=n&&Nt(e)?Ei(e):e;return Xn(a)?t.filter(function(s){return Xn(s)&&Zf(s,a)&&Zt(s)!=="body"}):[]}function rm(e,t,n,a){var s=t==="clippingParents"?sm(e):[].concat(t),r=[].concat(s,[n]),o=r[0],l=r.reduce(function(u,c){var d=uu(e,c,a);return u.top=Yn(d.top,u.top),u.right=Ms(d.right,u.right),u.bottom=Ms(d.bottom,u.bottom),u.left=Yn(d.left,u.left),u},uu(e,o,a));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function qf(e){var t=e.reference,n=e.element,a=e.placement,s=a?Ht(a):null,r=a?Sa(a):null,o=t.x+t.width/2-n.width/2,l=t.y+t.height/2-n.height/2,u;switch(s){case ut:u={x:o,y:t.y-n.height};break;case wt:u={x:o,y:t.y+t.height};break;case Mt:u={x:t.x+t.width,y:l};break;case dt:u={x:t.x-n.width,y:l};break;default:u={x:t.x,y:t.y}}var c=s?Nl(s):null;if(c!=null){var d=c==="y"?"height":"width";switch(r){case Ia:u[c]=u[c]-(t[d]/2-n[d]/2);break;case Mi:u[c]=u[c]+(t[d]/2-n[d]/2);break}}return u}function Ii(e,t){t===void 0&&(t={});var n=t,a=n.placement,s=a===void 0?e.placement:a,r=n.strategy,o=r===void 0?e.strategy:r,l=n.boundary,u=l===void 0?Tg:l,c=n.rootBoundary,d=c===void 0?Ff:c,f=n.elementContext,g=f===void 0?ei:f,m=n.altBoundary,v=m===void 0?!1:m,p=n.padding,N=p===void 0?0:p,b=Uf(typeof N!="number"?N:Kf(N,Oi)),I=g===ei?Sg:ei,y=e.rects.popper,C=e.elements[v?I:g],M=rm(Xn(C)?C:C.contextElement||jn(e.elements.popper),u,d,o),w=Ta(e.elements.reference),x=qf({reference:w,element:y,strategy:"absolute",placement:s}),L=Do(Object.assign({},y,x)),k=g===ei?L:w,T={top:M.top-k.top+b.top,bottom:k.bottom-M.bottom+b.bottom,left:M.left-k.left+b.left,right:k.right-M.right+b.right},E=e.modifiersData.offset;if(g===ei&&E){var P=E[s];Object.keys(T).forEach(function(V){var D=[Mt,wt].indexOf(V)>=0?1:-1,j=[ut,wt].indexOf(V)>=0?"y":"x";T[V]+=P[j]*D})}return T}function om(e,t){t===void 0&&(t={});var n=t,a=n.placement,s=n.boundary,r=n.rootBoundary,o=n.padding,l=n.flipVariations,u=n.allowedAutoPlacements,c=u===void 0?Bf:u,d=Sa(a),f=d?l?ru:ru.filter(function(v){return Sa(v)===d}):Oi,g=f.filter(function(v){return c.indexOf(v)>=0});g.length===0&&(g=f);var m=g.reduce(function(v,p){return v[p]=Ii(e,{placement:p,boundary:s,rootBoundary:r,padding:o})[Ht(p)],v},{});return Object.keys(m).sort(function(v,p){return m[v]-m[p]})}function lm(e){if(Ht(e)===yl)return[];var t=us(e);return[cu(e),t,cu(t)]}function cm(e){var t=e.state,n=e.options,a=e.name;if(!t.modifiersData[a]._skip){for(var s=n.mainAxis,r=s===void 0?!0:s,o=n.altAxis,l=o===void 0?!0:o,u=n.fallbackPlacements,c=n.padding,d=n.boundary,f=n.rootBoundary,g=n.altBoundary,m=n.flipVariations,v=m===void 0?!0:m,p=n.allowedAutoPlacements,N=t.options.placement,b=Ht(N),I=b===N,y=u||(I||!v?[us(N)]:lm(N)),C=[N].concat(y).reduce(function(Z,_){return Z.concat(Ht(_)===yl?om(t,{placement:_,boundary:d,rootBoundary:f,padding:c,flipVariations:v,allowedAutoPlacements:p}):_)},[]),M=t.rects.reference,w=t.rects.popper,x=new Map,L=!0,k=C[0],T=0;T<C.length;T++){var E=C[T],P=Ht(E),V=Sa(E)===Ia,D=[ut,wt].indexOf(P)>=0,j=D?"width":"height",B=Ii(t,{placement:E,boundary:d,rootBoundary:f,altBoundary:g,padding:c}),R=D?V?Mt:dt:V?wt:ut;M[j]>w[j]&&(R=us(R));var X=us(R),Y=[];if(r&&Y.push(B[P]<=0),l&&Y.push(B[R]<=0,B[X]<=0),Y.every(function(Z){return Z})){k=E,L=!1;break}x.set(E,Y)}if(L)for(var re=v?3:1,H=function(_){var G=C.find(function(K){var Q=x.get(K);if(Q)return Q.slice(0,_).every(function(J){return J})});if(G)return k=G,"break"},U=re;U>0;U--){var W=H(U);if(W==="break")break}t.placement!==k&&(t.modifiersData[a]._skip=!0,t.placement=k,t.reset=!0)}}const um={name:"flip",enabled:!0,phase:"main",fn:cm,requiresIfExists:["offset"],data:{_skip:!1}};function du(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function fu(e){return[ut,Mt,wt,dt].some(function(t){return e[t]>=0})}function dm(e){var t=e.state,n=e.name,a=t.rects.reference,s=t.rects.popper,r=t.modifiersData.preventOverflow,o=Ii(t,{elementContext:"reference"}),l=Ii(t,{altBoundary:!0}),u=du(o,a),c=du(l,s,r),d=fu(u),f=fu(c);t.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":f})}const fm={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:dm};function hm(e,t,n){var a=Ht(e),s=[dt,ut].indexOf(a)>=0?-1:1,r=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,o=r[0],l=r[1];return o=o||0,l=(l||0)*s,[dt,Mt].indexOf(a)>=0?{x:l,y:o}:{x:o,y:l}}function gm(e){var t=e.state,n=e.options,a=e.name,s=n.offset,r=s===void 0?[0,0]:s,o=Bf.reduce(function(d,f){return d[f]=hm(f,t.rects,r),d},{}),l=o[t.placement],u=l.x,c=l.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=u,t.modifiersData.popperOffsets.y+=c),t.modifiersData[a]=o}const mm={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:gm};function vm(e){var t=e.state,n=e.name;t.modifiersData[n]=qf({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const pm={name:"popperOffsets",enabled:!0,phase:"read",fn:vm,data:{}};function ym(e){return e==="x"?"y":"x"}function bm(e){var t=e.state,n=e.options,a=e.name,s=n.mainAxis,r=s===void 0?!0:s,o=n.altAxis,l=o===void 0?!1:o,u=n.boundary,c=n.rootBoundary,d=n.altBoundary,f=n.padding,g=n.tether,m=g===void 0?!0:g,v=n.tetherOffset,p=v===void 0?0:v,N=Ii(t,{boundary:u,rootBoundary:c,padding:f,altBoundary:d}),b=Ht(t.placement),I=Sa(t.placement),y=!I,C=Nl(b),M=ym(C),w=t.modifiersData.popperOffsets,x=t.rects.reference,L=t.rects.popper,k=typeof p=="function"?p(Object.assign({},t.rects,{placement:t.placement})):p,T=typeof k=="number"?{mainAxis:k,altAxis:k}:Object.assign({mainAxis:0,altAxis:0},k),E=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,P={x:0,y:0};if(w){if(r){var V,D=C==="y"?ut:dt,j=C==="y"?wt:Mt,B=C==="y"?"height":"width",R=w[C],X=R+N[D],Y=R-N[j],re=m?-L[B]/2:0,H=I===Ia?x[B]:L[B],U=I===Ia?-L[B]:-x[B],W=t.elements.arrow,Z=m&&W?Cl(W):{width:0,height:0},_=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Yf(),G=_[D],K=_[j],Q=mi(0,x[B],Z[B]),J=y?x[B]/2-re-Q-G-T.mainAxis:H-Q-G-T.mainAxis,z=y?-x[B]/2+re+Q+K+T.mainAxis:U+Q+K+T.mainAxis,F=t.elements.arrow&&Ei(t.elements.arrow),S=F?C==="y"?F.clientTop||0:F.clientLeft||0:0,O=(V=E==null?void 0:E[C])!=null?V:0,$=R+J-O-S,ae=R+z-O,A=mi(m?Ms(X,$):X,R,m?Yn(Y,ae):Y);w[C]=A,P[C]=A-R}if(l){var ne,te=C==="x"?ut:dt,q=C==="x"?wt:Mt,ie=w[M],ve=M==="y"?"height":"width",ee=ie+N[te],se=ie-N[q],ce=[ut,dt].indexOf(b)!==-1,ge=(ne=E==null?void 0:E[M])!=null?ne:0,Ce=ce?ee:ie-x[ve]-L[ve]-ge+T.altAxis,Le=ce?ie+x[ve]+L[ve]-ge-T.altAxis:se,xe=m&&ce?Hg(Ce,ie,Le):mi(m?Ce:ee,ie,m?Le:se);w[M]=xe,P[M]=xe-ie}t.modifiersData[a]=P}}const Cm={name:"preventOverflow",enabled:!0,phase:"main",fn:bm,requiresIfExists:["offset"]};function Nm(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function wm(e){return e===pt(e)||!Nt(e)?wl(e):Nm(e)}function Mm(e){var t=e.getBoundingClientRect(),n=La(t.width)/e.offsetWidth||1,a=La(t.height)/e.offsetHeight||1;return n!==1||a!==1}function Im(e,t,n){n===void 0&&(n=!1);var a=Nt(t),s=Nt(t)&&Mm(t),r=jn(t),o=Ta(e,s,n),l={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(a||!a&&!n)&&((Zt(t)!=="body"||Il(r))&&(l=wm(t)),Nt(t)?(u=Ta(t,!0),u.x+=t.clientLeft,u.y+=t.clientTop):r&&(u.x=Ml(r))),{x:o.left+l.scrollLeft-u.x,y:o.top+l.scrollTop-u.y,width:o.width,height:o.height}}function Lm(e){var t=new Map,n=new Set,a=[];e.forEach(function(r){t.set(r.name,r)});function s(r){n.add(r.name);var o=[].concat(r.requires||[],r.requiresIfExists||[]);o.forEach(function(l){if(!n.has(l)){var u=t.get(l);u&&s(u)}}),a.push(r)}return e.forEach(function(r){n.has(r.name)||s(r)}),a}function Tm(e){var t=Lm(e);return Vg.reduce(function(n,a){return n.concat(t.filter(function(s){return s.phase===a}))},[])}function Sm(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function km(e){var t=e.reduce(function(n,a){var s=n[a.name];return n[a.name]=s?Object.assign({},s,a,{options:Object.assign({},s.options,a.options),data:Object.assign({},s.data,a.data)}):a,n},{});return Object.keys(t).map(function(n){return t[n]})}var hu={placement:"bottom",modifiers:[],strategy:"absolute"};function gu(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(a){return!(a&&typeof a.getBoundingClientRect=="function")})}function xm(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,a=n===void 0?[]:n,s=t.defaultOptions,r=s===void 0?hu:s;return function(l,u,c){c===void 0&&(c=r);var d={placement:"bottom",orderedModifiers:[],options:Object.assign({},hu,r),modifiersData:{},elements:{reference:l,popper:u},attributes:{},styles:{}},f=[],g=!1,m={state:d,setOptions:function(b){var I=typeof b=="function"?b(d.options):b;p(),d.options=Object.assign({},r,d.options,I),d.scrollParents={reference:Xn(l)?vi(l):l.contextElement?vi(l.contextElement):[],popper:vi(u)};var y=Tm(km([].concat(a,d.options.modifiers)));return d.orderedModifiers=y.filter(function(C){return C.enabled}),v(),m.update()},forceUpdate:function(){if(!g){var b=d.elements,I=b.reference,y=b.popper;if(gu(I,y)){d.rects={reference:Im(I,Ei(y),d.options.strategy==="fixed"),popper:Cl(y)},d.reset=!1,d.placement=d.options.placement,d.orderedModifiers.forEach(function(T){return d.modifiersData[T.name]=Object.assign({},T.data)});for(var C=0;C<d.orderedModifiers.length;C++){if(d.reset===!0){d.reset=!1,C=-1;continue}var M=d.orderedModifiers[C],w=M.fn,x=M.options,L=x===void 0?{}:x,k=M.name;typeof w=="function"&&(d=w({state:d,options:L,name:k,instance:m})||d)}}}},update:Sm(function(){return new Promise(function(N){m.forceUpdate(),N(d)})}),destroy:function(){p(),g=!0}};if(!gu(l,u))return m;m.setOptions(c).then(function(N){!g&&c.onFirstUpdate&&c.onFirstUpdate(N)});function v(){d.orderedModifiers.forEach(function(N){var b=N.name,I=N.options,y=I===void 0?{}:I,C=N.effect;if(typeof C=="function"){var M=C({state:d,name:b,instance:m,options:y}),w=function(){};f.push(M||w)}})}function p(){f.forEach(function(N){return N()}),f=[]}return m}}var Dm=[qg,pm,Kg,Qg,mm,um,Cm,Gg,fm],eh=xm({defaultModifiers:Dm});class jm{constructor(t,n,a){me(this,"isShow",!1);me(this,"trigger");me(this,"instance");me(this,"always",!1);me(this,"reference");me(this,"referenceTarget");me(this,"popperRefer");me(this,"instanceOptions");me(this,"delay",50);me(this,"isInnerPopper",!1);me(this,"disabled",!1);me(this,"afterShow",null);me(this,"afterHidden",null);me(this,"appendTo","parent");me(this,"container",null);me(this,"fixOnBoundary",!1);var s,r;this.instanceOptions=this.initDefaultOptions(a),this.reference=this.resolveInputSelectorToHtmlElement(t),this.popperRefer=this.resolveInputSelectorToHtmlElement(n),this.referenceTarget=this.getTargetReferenceElement(),this.container=(s=this.popperRefer)==null?void 0:s.parentElement,this.isShow=!!((r=this.instanceOptions)!=null&&r.isShow),this.always=this.instanceOptions.always,this.trigger=this.instanceOptions.trigger,this.disabled=this.instanceOptions.disabled,this.appendTo=this.instanceOptions.appendTo,this.afterHidden=typeof a.afterHidden=="function"?a.afterHidden:()=>{},this.afterShow=typeof a.afterShow=="function"?a.afterShow:()=>{},this.fixOnBoundary=this.instanceOptions.fixOnBoundary,this.initInstance(),this.registerEvents(),(this.isShow||this.always)&&this.show(null)}forceUpdate(){var t;(t=this.instance)==null||t.forceUpdate()}update(){var t;(t=this.instance)==null||t.update()}updateOptions(t){var n;this.instanceOptions=this.initDefaultOptions(t),this.isShow=!!((n=this.instanceOptions)!=null&&n.isShow),this.trigger=this.instanceOptions.trigger,this.disabled=this.instanceOptions.disabled,this.setOptions(this.instanceOptions)}setOptions(t){var n;(n=this.instance)==null||n.setOptions(t)}destroy(){var t;(t=this.instance)==null||t.destroy()}updateDisabled(t){this.disabled=t??!this.disabled,this.disabled&&this.hide()}show(t){var n;this.disabled||((n=this.popperRefer)==null||n.setAttribute("data-show",""),this.setOptions({modifiers:[...this.instanceOptions.modifiers||[],{name:"eventListeners",enabled:!0}]}),this.update(),this.isShow=!0,this.afterShow(),this.fixOnBoundary||this.appendToTarget())}hide(){var t;this.always||((t=this.popperRefer)==null||t.removeAttribute("data-show"),this.setOptions({modifiers:[...this.instanceOptions.modifiers||[],{name:"eventListeners",enabled:!1}]}),this.isShow=!1,this.isInnerPopper=!1,this.afterHidden(),this.fixOnBoundary||this.restorePopContent())}restorePopContent(){const t=this.getAppendToTarget();Zn(t)&&t.contains(this.popperRefer)&&this.container&&!this.container.contains(this.popperRefer)&&this.container.append(this.popperRefer)}appendToTarget(){const t=this.getAppendToTarget();Zn(t)&&t.contains(this.popperRefer)&&t.append(this.popperRefer)}getAppendToTarget(){const{appendTo:t}=this;let n=t;return t!=="parent"&&typeof t=="string"&&(n=document.querySelector(t)),n}initDefaultOptions(t){const a=Vf({placement:"top",modifiers:[{name:"offset",options:{offset:[0,8]}}],strategy:"absolute",onFirstUpdate:void 0,isShow:!1,theme:"dark",trigger:"hover",disabled:!1},t||{}),s=a.onFirstUpdate;return a.onFirstUpdate=r=>{typeof s=="function"&&(s.call(this,r),this.handleFirstUpdate())},a}handleFirstUpdate(){this.fixOnBoundary&&this.appendToTarget()}getTargetReferenceElement(){return this.isElement(this.reference)?this.reference.childElementCount===1?this.reference.firstElementChild:this.reference:this.reference}initInstance(){var t;this.referenceTarget&&(this.referenceTarget&&this.popperRefer?(this.instance=eh(this.referenceTarget,this.popperRefer,this.instanceOptions),(t=this.popperRefer)==null||t.setAttribute("data-theme",this.instanceOptions.theme??"dark")):console.error("reference or popperRefer is null, please check html element."))}resolveInputSelectorToHtmlElement(t){if(this.isElement(t))return t;if(typeof t=="string")return document.querySelector(t);if(typeof t=="object"){if(Object.prototype.hasOwnProperty.call(t,"getBoundingClientRect"))return t}else console.error("'getBoundingClientRect' is needed when use virtual elements");return null}isElement(t){return Zn(t)}registerEvents(){if(this.isElement(this.referenceTarget)&&this.trigger==="hover"){const t=["mouseenter","focus"],n=["mouseleave","blur"],a=["mouseenter","mouseleave"];t.forEach(s=>{this.referenceTarget.addEventListener(s,r=>{s==="mouseenter"&&(this.isInnerPopper=!0),this.show(r)})}),n.forEach(s=>{this.referenceTarget.addEventListener(s,()=>{this.isInnerPopper=!1,setTimeout(()=>{!this.isInnerPopper&&this.hide()},this.delay)})}),this.isElement(this.popperRefer)&&a.forEach(s=>{this.popperRefer.addEventListener(s,()=>{s==="mouseenter"&&(this.isInnerPopper=!0),s==="mouseleave"&&this.hide()})})}this.trigger==="click"&&["click"].forEach(n=>{document.body.addEventListener(n,a=>{this.isSameElement(a.target,this.reference)||this.reference.contains(a.target)?this.show(a):this.isShow&&!this.isSameElement(a.target,this.popperRefer)&&!this.popperRefer.contains(a.target)&&this.hide()})})}isSameElement(t,n){return t&&(t===n||t===n.firstElementChild)}}/*!
|
8
8
|
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
9
9
|
*
|
10
10
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
package/dist/index.esm.js
CHANGED
@@ -516,7 +516,7 @@ class p0 {
|
|
516
516
|
if (this.multiInstance)
|
517
517
|
return { instance: this.createMask(), isExist: !1 };
|
518
518
|
let t = !0, n = this.parentNode.querySelector(`[data-bk-mask-uid='${this.uniqueMaskAttrTag}']`);
|
519
|
-
return n || (t = !1, n = this.createMask(), n.addEventListener("
|
519
|
+
return n || (t = !1, n = this.createMask(), n.addEventListener("mousedown", (a) => this.handleMaskClick(a), !0)), {
|
520
520
|
instance: n,
|
521
521
|
isExist: t
|
522
522
|
};
|
package/dist/index.umd.js
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
font-size: ${s["font-size"]};
|
5
5
|
word-break: ${s["word-break"]};
|
6
6
|
padding: ${s.padding};
|
7
|
-
`,r.textContent=a.textContent,r};let n=!1;try{const a=window.getComputedStyle(e,null);if(a.webkitLineClamp!=="none"){const r=parseFloat(a.height),o=t(e,a);document.body.appendChild(o);const l=window.getComputedStyle(o,null).height;document.body.removeChild(o),n=r<parseFloat(l)}else n=e.clientWidth<e.scrollWidth||e.clientHeight<e.scrollHeight}catch(a){console.warn("There is an error when check element overflow state: ",a)}return n}const oo={bottom:0,content:1,navi:100,fullScreen:1e3,modal:2e3,plugins:5e3,message:6e3,popper:8e3};class eg{constructor(){pe(this,"storageLayerIndexValue",{});this.copyDefaultValue()}getNextIndex(t){return Object.prototype.hasOwnProperty.call(this.storageLayerIndexValue,t)?(this.storageLayerIndexValue[t]=this.storageLayerIndexValue[t]+1,this.storageLayerIndexValue[t]):(this.storageLayerIndexValue.modal=this.storageLayerIndexValue.modal+1,this.storageLayerIndexValue.modal)}getModalNextIndex(){return this.getNextIndex("modal")}getMessageNextIndex(){return this.getNextIndex("message")}getFullScreenNextIndex(){return this.getNextIndex("fullScreen")}getNaviNextIndex(){return this.getNextIndex("navi")}getPopperIndex(){return this.getNextIndex("popper")}setDefaultZIndex(t){Object.keys(t||{}).forEach(n=>{Object.prototype.hasOwnProperty.call(this.storageLayerIndexValue.__proto__,n)&&Object.assign(this.storageLayerIndexValue.__proto__,{[n]:t[n]})}),this.copyDefaultValue()}resetZIndex(t){Object.keys(t||{}).forEach(n=>{Object.prototype.hasOwnProperty.call(this.storageLayerIndexValue,n)&&Object.assign(this.storageLayerIndexValue,{[n]:t[n]})})}copyDefaultValue(){const t=Object.keys(oo).reduce((n,a)=>Object.assign(n,{[a]:{value:oo[a],writable:!0,configurable:!0}}),{});this.storageLayerIndexValue=Object.create(oo,t)}}const Vt=new eg;`${bn(16)}`;const es=new WeakMap,lo=e=>es.has(e)?es.get(e):[],tg=(e,t,n,a,s)=>{const r=lo(e);r.some(o=>o.instanceId===s)||(r.push({event:t,args:n,content:a,instanceId:s}),es.set(e,r))},ng=(e,t)=>{es.set(e,t)};class ag{constructor(){pe(this,"timer",null);pe(this,"store",[]);pe(this,"maskMap",new WeakMap)}appendMaker(t){this.store.push(t),this.executeMaker()}pushMaskStyle(t,n){const a=this.getMaskMap(t);this.setMaskMap(t,{styles:[n],...a||{}})}getMaskStyles(t){var n;return((n=this.getMaskMap(t))==null?void 0:n.styles)||[]}setMaskId(t,n){const a=this.getMaskMap(t);a?(Object.assign(a,{id:n}),this.setMaskMap(t,a)):this.setMaskMap(t,{id:n,...a||{}})}getMaskId(t){var n;return(n=this.getMaskMap(t))==null?void 0:n.id}setMaskMap(t,n){this.maskMap.set(t,n)}getMaskMap(t){return this.maskMap.get(t)}executeMaker(){this.timer&&cancelAnimationFrame(this.timer),this.timer=requestAnimationFrame(()=>{const t=this.store.pop();typeof t=="function"&&(Reflect.apply(t,this,[]),this.executeMaker())})}}const ga=new ag;class od{constructor(t){pe(this,"mask");pe(this,"backupMask");pe(this,"multiInstance",!1);pe(this,"uniqueMaskAttrTag","");pe(this,"parentNode",document.body);pe(this,"activeInstance");pe(this,"zIndexStore",new Map);pe(this,"lastUUID",null);pe(this,"maskStyle",{position:"fixed",left:0,top:0,bottom:0,right:0,display:"none","background-color":"rgba(0,0,0,.6)"});pe(this,"isInit",!1);pe(this,"maskAttrTag","auto");const{multiInstance:n=!1,maskAttrTag:a="auto",parentNode:s=document.body,maskStyle:r={}}=t||{};this.parentNode=s||document,this.maskAttrTag=a,this.activeInstance=void 0,this.multiInstance=n,this.uniqueMaskAttrTag=this.getMaskAttrTag(a),ga.appendMaker(()=>{this.initInstance(r)})}setOption(t){const{parentNode:n=document.body,maskStyle:a={},maskAttrTag:s=this.maskAttrTag}=t||{};this.parentNode=n||document,this.setMaskStyle(Object.assign({},this.maskStyle,a)),this.uniqueMaskAttrTag=this.getMaskAttrTag(s)}destroyEvent(t){if(this.mask){const n=lo(this.mask)||[],a=n.findIndex(s=>s.instanceId===t);a>=0&&(n.splice(a,1),ng(this.mask,n))}}show(t,n,a=!0,s={},r=null,o=!1,l,d){const c=r??bn(16),u=/-?\d+/.test(`${n}`)?n:Vt.getModalNextIndex();let f=Object.assign({},this.maskStyle,s||{});if(!a&&this.lastUUID){const g=this.zIndexStore.get(this.lastUUID);g&&(f=g==null?void 0:g.style)}this.storeMaskInsCfg({zIndex:u,style:{...f},uuid:c,preUID:this.lastUUID}),Object.assign(f,{display:"block","z-index":`${u}`,"pointer-events":"all"}),this.initInstance(f),l&&this.catchClickEvent(t,l,d),this.setMaskStyle(f),ga.pushMaskStyle(this.parentNode,{...f}),this.backupMask.style.setProperty("z-index",`${u-1}`),a||(this.mask.style.setProperty("pointer-events","none"),t==null||t.style.setProperty("pointer-events","all")),t&&(o&&t.style.setProperty("z-index",`${u+1}`),this.activeInstance=t,this.appendContentToMask(t))}hide(t=!1,n,a){var o;const s=a??this.lastUUID;t||(n==null||n.remove(),(o=this.activeInstance)==null||o.remove()),this.removeClickEvent(),this.activeInstance=void 0,this.popIndexStore(s);const r=ga.getMaskStyles(this.parentNode);if(r==null||r.pop(),!(r!=null&&r.length))this.mask.style.setProperty("display","none");else{const l=r.slice(-1)[0];this.setMaskStyle(l)}}storeMaskInsCfg(t){return this.zIndexStore.set(t.uuid,t),this.lastUUID=t.uuid,this.zIndexStore.get(t.uuid)}popIndexStore(t){if(this.zIndexStore.has(t)){const n=this.zIndexStore.get(t);return this.lastUUID=n.preUID,this.zIndexStore.delete(t)}return this.lastUUID=null,!1}backupActiveInstance(){this.activeInstance&&this.backupMask.append(this.activeInstance)}backupContentElement(t){var n;t&&((n=this.backupMask)==null||n.append(t))}getActiveContentInstance(){return this.activeInstance}removeClickEvent(){}initInstance(t){if(!this.isInit){this.isInit=!0,this.backupMask=this.getBackupMask();const{instance:n,isExist:a}=this.getMask();this.mask=n,!a&&this.setMaskStyle(Object.assign({},this.maskStyle,t))}}getMask(){if(this.multiInstance)return{instance:this.createMask(),isExist:!1};let t=!0,n=this.parentNode.querySelector(`[data-bk-mask-uid='${this.uniqueMaskAttrTag}']`);return n||(t=!1,n=this.createMask(),n.addEventListener("click",a=>this.handleMaskClick(a),!0)),{instance:n,isExist:t}}catchClickEvent(t,n,a){this.mask&&tg(this.mask,n,[],t,a)}handleMaskClick(t){if(t.target!==this.mask)return;const n=lo(this.mask);if(n.length){const{event:a}=n.slice(-1)[0];typeof a=="function"&&a(t)}}getBackupMask(){const t="data-bk-backup-uid";let n=this.parentNode.querySelector(`[${t}]`);return n||(n=this.createMask(t)),n}createMask(t="data-bk-mask-uid"){const n=document.createElement("div");return n.setAttribute(t,this.uniqueMaskAttrTag),this.parentNode.append(n),n}setMaskStyle(t={}){this.mask&&Object.entries(t).forEach(n=>this.mask.style.setProperty(n[0],n[1]))}getMaskAttrTag(t){return/^(auto|\s+)$/i.test(t)||t===null||t===void 0||t===""?(ga.getMaskId(this.parentNode)||ga.setMaskId(this.parentNode,`__bk_mask_${bn(16)}`),ga.getMaskId(this.parentNode)):t}appendContentToMask(t){this.mask.append(t)}}new od({});const ts=new WeakMap;class ld{constructor(t){pe(this,"uuidAttrName");pe(this,"clickFn");pe(this,"bKMaskManagerInstance");pe(this,"transfer");pe(this,"uniqId");this.clickFn=void 0,this.uuidAttrName="data-bk-pop-uuid",this.uniqId=bn(16),this.transfer=this.getParentNode(t==null?void 0:t.transfer),this.bKMaskManagerInstance=new od({parentNode:this.getParentNode(t==null?void 0:t.transfer),popInstance:this,onClick:this.onMaskClickFn})}get popInstanceList(){return ts.has(this.transfer)||ts.set(this.transfer,[]),ts.get(this.transfer)}set popInstanceList(t){ts.set(this.transfer,t)}getParentNode(t){if(typeof t=="string"){const n=document.querySelector(t);if(n)return n}return An(t)?t:document.body}onMaskClick(t,n){this.clickFn={fn:t,target:n}}show(t,n=!0,a={},s=!1,r=void 0,o){if(!t){console.warn("pop show error: content is null or undefined");return}const l=typeof r=="number"?r:Vt.getModalNextIndex(),d=bn(16);t.setAttribute(this.uuidAttrName,d),this.popInstanceList.length>0&&n&&this.bKMaskManagerInstance.backupContentElement(this.popInstanceList.slice(-1)[0].content),this.popInstanceList.push({uuid:d,zIndex:l,content:t,showMask:n,appendStyle:a}),this.bKMaskManagerInstance.show(t,l,n,a,d,s,o,this.uniqId)}destroy(t,n=!1){this.clickFn=void 0,this.hide(t,n)}popHide(t=!0){if(this.popInstanceList.length){if(t){const n=this.popInstanceList.pop();this.bKMaskManagerInstance.popIndexStore(n.uuid),n.remove()}if(this.popInstanceList.length){const n=this.popInstanceList.slice(-1)[0],{zIndex:a,content:s,showMask:r,appendStyle:o,uuid:l}=n;this.bKMaskManagerInstance.show(s,a,r,o,l)}else this.bKMaskManagerInstance.hide()}}hide(t,n=!1){const a=t==null?void 0:t.getAttribute(this.uuidAttrName);if(a){const s=this.popInstanceList.findIndex(r=>r.uuid===a);s>=0&&(n||this.popInstanceList[s].content.remove(),this.popInstanceList.splice(s,1),this.bKMaskManagerInstance.popIndexStore(a),this.popInstanceList.length?this.popHide(!1):this.bKMaskManagerInstance.hide(n))}else t==null||t.remove();this.bKMaskManagerInstance.removeClickEvent()}removeLastEvent(){this.bKMaskManagerInstance.destroyEvent(this.uniqId)}onMaskClickFn(t){if(this.clickFn){const{fn:n}=this.clickFn;n&&Reflect.apply(n,this,[t])}}}new ld;let ns;const ig=new Uint8Array(16);function sg(){if(!ns&&(ns=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!ns))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ns(ig)}const Fe=[];for(let e=0;e<256;++e)Fe.push((e+256).toString(16).slice(1));function rg(e,t=0){return Fe[e[t+0]]+Fe[e[t+1]]+Fe[e[t+2]]+Fe[e[t+3]]+"-"+Fe[e[t+4]]+Fe[e[t+5]]+"-"+Fe[e[t+6]]+Fe[e[t+7]]+"-"+Fe[e[t+8]]+Fe[e[t+9]]+"-"+Fe[e[t+10]]+Fe[e[t+11]]+Fe[e[t+12]]+Fe[e[t+13]]+Fe[e[t+14]]+Fe[e[t+15]]}const cd={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function tn(e,t,n){if(cd.randomUUID&&!t&&!e)return cd.randomUUID();e=e||{};const a=e.random||(e.rng||sg)();if(a[6]=a[6]&15|64,a[8]=a[8]&63|128,t){n=n||0;for(let s=0;s<16;++s)t[n+s]=a[s];return t}return rg(a)}var nt="top",Nt="bottom",wt="right",at="left",co="auto",ai=[nt,Nt,wt,at],ma="start",ii="end",og="clippingParents",dd="viewport",si="popper",lg="reference",ud=ai.reduce(function(e,t){return e.concat([t+"-"+ma,t+"-"+ii])},[]),fd=[].concat(ai,[co]).reduce(function(e,t){return e.concat([t,t+"-"+ma,t+"-"+ii])},[]),cg="beforeRead",dg="read",ug="afterRead",fg="beforeMain",hg="main",gg="afterMain",mg="beforeWrite",pg="write",yg="afterWrite",bg=[cg,dg,ug,fg,hg,gg,mg,pg,yg];function Jt(e){return e?(e.nodeName||"").toLowerCase():null}function mt(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function zn(e){var t=mt(e).Element;return e instanceof t||e instanceof Element}function Mt(e){var t=mt(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function uo(e){if(typeof ShadowRoot>"u")return!1;var t=mt(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Cg(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var a=t.styles[n]||{},s=t.attributes[n]||{},r=t.elements[n];!Mt(r)||!Jt(r)||(Object.assign(r.style,a),Object.keys(s).forEach(function(o){var l=s[o];l===!1?r.removeAttribute(o):r.setAttribute(o,l===!0?"":l)}))})}function vg(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(a){var s=t.elements[a],r=t.attributes[a]||{},o=Object.keys(t.styles.hasOwnProperty(a)?t.styles[a]:n[a]),l=o.reduce(function(d,c){return d[c]="",d},{});!Mt(s)||!Jt(s)||(Object.assign(s.style,l),Object.keys(r).forEach(function(d){s.removeAttribute(d)}))})}}const Ng={name:"applyStyles",enabled:!0,phase:"write",fn:Cg,effect:vg,requires:["computeStyles"]};function Rt(e){return e.split("-")[0]}var Vn=Math.max,as=Math.min,pa=Math.round;function fo(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function hd(){return!/^((?!chrome|android).)*safari/i.test(fo())}function ya(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var a=e.getBoundingClientRect(),s=1,r=1;t&&Mt(e)&&(s=e.offsetWidth>0&&pa(a.width)/e.offsetWidth||1,r=e.offsetHeight>0&&pa(a.height)/e.offsetHeight||1);var o=zn(e)?mt(e):window,l=o.visualViewport,d=!hd()&&n,c=(a.left+(d&&l?l.offsetLeft:0))/s,u=(a.top+(d&&l?l.offsetTop:0))/r,f=a.width/s,g=a.height/r;return{width:f,height:g,top:u,right:c+f,bottom:u+g,left:c,x:c,y:u}}function ho(e){var t=ya(e),n=e.offsetWidth,a=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-a)<=1&&(a=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:a}}function gd(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&uo(n)){var a=t;do{if(a&&e.isSameNode(a))return!0;a=a.parentNode||a.host}while(a)}return!1}function nn(e){return mt(e).getComputedStyle(e)}function wg(e){return["table","td","th"].indexOf(Jt(e))>=0}function Cn(e){return((zn(e)?e.ownerDocument:e.document)||window.document).documentElement}function is(e){return Jt(e)==="html"?e:e.assignedSlot||e.parentNode||(uo(e)?e.host:null)||Cn(e)}function md(e){return!Mt(e)||nn(e).position==="fixed"?null:e.offsetParent}function Mg(e){var t=/firefox/i.test(fo()),n=/Trident/i.test(fo());if(n&&Mt(e)){var a=nn(e);if(a.position==="fixed")return null}var s=is(e);for(uo(s)&&(s=s.host);Mt(s)&&["html","body"].indexOf(Jt(s))<0;){var r=nn(s);if(r.transform!=="none"||r.perspective!=="none"||r.contain==="paint"||["transform","perspective"].indexOf(r.willChange)!==-1||t&&r.willChange==="filter"||t&&r.filter&&r.filter!=="none")return s;s=s.parentNode}return null}function ri(e){for(var t=mt(e),n=md(e);n&&wg(n)&&nn(n).position==="static";)n=md(n);return n&&(Jt(n)==="html"||Jt(n)==="body"&&nn(n).position==="static")?t:n||Mg(e)||t}function go(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function oi(e,t,n){return Vn(e,as(t,n))}function Ig(e,t,n){var a=oi(e,t,n);return a>n?n:a}function pd(){return{top:0,right:0,bottom:0,left:0}}function yd(e){return Object.assign({},pd(),e)}function bd(e,t){return t.reduce(function(n,a){return n[a]=e,n},{})}var Lg=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,yd(typeof t!="number"?t:bd(t,ai))};function Tg(e){var t,n=e.state,a=e.name,s=e.options,r=n.elements.arrow,o=n.modifiersData.popperOffsets,l=Rt(n.placement),d=go(l),c=[at,wt].indexOf(l)>=0,u=c?"height":"width";if(!(!r||!o)){var f=Lg(s.padding,n),g=ho(r),m=d==="y"?nt:at,p=d==="y"?Nt:wt,y=n.rects.reference[u]+n.rects.reference[d]-o[d]-n.rects.popper[u],N=o[d]-n.rects.reference[d],C=ri(r),I=C?d==="y"?C.clientHeight||0:C.clientWidth||0:0,b=y/2-N/2,v=f[m],M=I-g[u]-f[p],w=I/2-g[u]/2+b,x=oi(v,w,M),L=d;n.modifiersData[a]=(t={},t[L]=x,t.centerOffset=x-w,t)}}function Sg(e){var t=e.state,n=e.options,a=n.element,s=a===void 0?"[data-popper-arrow]":a;s!=null&&(typeof s=="string"&&(s=t.elements.popper.querySelector(s),!s)||gd(t.elements.popper,s)&&(t.elements.arrow=s))}const kg={name:"arrow",enabled:!0,phase:"main",fn:Tg,effect:Sg,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ba(e){return e.split("-")[1]}var xg={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Dg(e,t){var n=e.x,a=e.y,s=t.devicePixelRatio||1;return{x:pa(n*s)/s||0,y:pa(a*s)/s||0}}function Cd(e){var t,n=e.popper,a=e.popperRect,s=e.placement,r=e.variation,o=e.offsets,l=e.position,d=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,f=e.isFixed,g=o.x,m=g===void 0?0:g,p=o.y,y=p===void 0?0:p,N=typeof u=="function"?u({x:m,y}):{x:m,y};m=N.x,y=N.y;var C=o.hasOwnProperty("x"),I=o.hasOwnProperty("y"),b=at,v=nt,M=window;if(c){var w=ri(n),x="clientHeight",L="clientWidth";if(w===mt(n)&&(w=Cn(n),nn(w).position!=="static"&&l==="absolute"&&(x="scrollHeight",L="scrollWidth")),w=w,s===nt||(s===at||s===wt)&&r===ii){v=Nt;var k=f&&w===M&&M.visualViewport?M.visualViewport.height:w[x];y-=k-a.height,y*=d?1:-1}if(s===at||(s===nt||s===Nt)&&r===ii){b=wt;var T=f&&w===M&&M.visualViewport?M.visualViewport.width:w[L];m-=T-a.width,m*=d?1:-1}}var E=Object.assign({position:l},c&&xg),P=u===!0?Dg({x:m,y},mt(n)):{x:m,y};if(m=P.x,y=P.y,d){var V;return Object.assign({},E,(V={},V[v]=I?"0":"",V[b]=C?"0":"",V.transform=(M.devicePixelRatio||1)<=1?"translate("+m+"px, "+y+"px)":"translate3d("+m+"px, "+y+"px, 0)",V))}return Object.assign({},E,(t={},t[v]=I?y+"px":"",t[b]=C?m+"px":"",t.transform="",t))}function jg(e){var t=e.state,n=e.options,a=n.gpuAcceleration,s=a===void 0?!0:a,r=n.adaptive,o=r===void 0?!0:r,l=n.roundOffsets,d=l===void 0?!0:l,c={placement:Rt(t.placement),variation:ba(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:s,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Cd(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:d})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Cd(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:d})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const Og={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:jg,data:{}};var ss={passive:!0};function Eg(e){var t=e.state,n=e.instance,a=e.options,s=a.scroll,r=s===void 0?!0:s,o=a.resize,l=o===void 0?!0:o,d=mt(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return r&&c.forEach(function(u){u.addEventListener("scroll",n.update,ss)}),l&&d.addEventListener("resize",n.update,ss),function(){r&&c.forEach(function(u){u.removeEventListener("scroll",n.update,ss)}),l&&d.removeEventListener("resize",n.update,ss)}}const Pg={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Eg,data:{}};var Ag={left:"right",right:"left",bottom:"top",top:"bottom"};function rs(e){return e.replace(/left|right|bottom|top/g,function(t){return Ag[t]})}var zg={start:"end",end:"start"};function vd(e){return e.replace(/start|end/g,function(t){return zg[t]})}function mo(e){var t=mt(e),n=t.pageXOffset,a=t.pageYOffset;return{scrollLeft:n,scrollTop:a}}function po(e){return ya(Cn(e)).left+mo(e).scrollLeft}function Vg(e,t){var n=mt(e),a=Cn(e),s=n.visualViewport,r=a.clientWidth,o=a.clientHeight,l=0,d=0;if(s){r=s.width,o=s.height;var c=hd();(c||!c&&t==="fixed")&&(l=s.offsetLeft,d=s.offsetTop)}return{width:r,height:o,x:l+po(e),y:d}}function Jg(e){var t,n=Cn(e),a=mo(e),s=(t=e.ownerDocument)==null?void 0:t.body,r=Vn(n.scrollWidth,n.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),o=Vn(n.scrollHeight,n.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),l=-a.scrollLeft+po(e),d=-a.scrollTop;return nn(s||n).direction==="rtl"&&(l+=Vn(n.clientWidth,s?s.clientWidth:0)-r),{width:r,height:o,x:l,y:d}}function yo(e){var t=nn(e),n=t.overflow,a=t.overflowX,s=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+s+a)}function Nd(e){return["html","body","#document"].indexOf(Jt(e))>=0?e.ownerDocument.body:Mt(e)&&yo(e)?e:Nd(is(e))}function li(e,t){var n;t===void 0&&(t=[]);var a=Nd(e),s=a===((n=e.ownerDocument)==null?void 0:n.body),r=mt(a),o=s?[r].concat(r.visualViewport||[],yo(a)?a:[]):a,l=t.concat(o);return s?l:l.concat(li(is(o)))}function bo(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Rg(e,t){var n=ya(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function wd(e,t,n){return t===dd?bo(Vg(e,n)):zn(t)?Rg(t,n):bo(Jg(Cn(e)))}function Qg(e){var t=li(is(e)),n=["absolute","fixed"].indexOf(nn(e).position)>=0,a=n&&Mt(e)?ri(e):e;return zn(a)?t.filter(function(s){return zn(s)&&gd(s,a)&&Jt(s)!=="body"}):[]}function $g(e,t,n,a){var s=t==="clippingParents"?Qg(e):[].concat(t),r=[].concat(s,[n]),o=r[0],l=r.reduce(function(d,c){var u=wd(e,c,a);return d.top=Vn(u.top,d.top),d.right=as(u.right,d.right),d.bottom=as(u.bottom,d.bottom),d.left=Vn(u.left,d.left),d},wd(e,o,a));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function Md(e){var t=e.reference,n=e.element,a=e.placement,s=a?Rt(a):null,r=a?ba(a):null,o=t.x+t.width/2-n.width/2,l=t.y+t.height/2-n.height/2,d;switch(s){case nt:d={x:o,y:t.y-n.height};break;case Nt:d={x:o,y:t.y+t.height};break;case wt:d={x:t.x+t.width,y:l};break;case at:d={x:t.x-n.width,y:l};break;default:d={x:t.x,y:t.y}}var c=s?go(s):null;if(c!=null){var u=c==="y"?"height":"width";switch(r){case ma:d[c]=d[c]-(t[u]/2-n[u]/2);break;case ii:d[c]=d[c]+(t[u]/2-n[u]/2);break}}return d}function ci(e,t){t===void 0&&(t={});var n=t,a=n.placement,s=a===void 0?e.placement:a,r=n.strategy,o=r===void 0?e.strategy:r,l=n.boundary,d=l===void 0?og:l,c=n.rootBoundary,u=c===void 0?dd:c,f=n.elementContext,g=f===void 0?si:f,m=n.altBoundary,p=m===void 0?!1:m,y=n.padding,N=y===void 0?0:y,C=yd(typeof N!="number"?N:bd(N,ai)),I=g===si?lg:si,b=e.rects.popper,v=e.elements[p?I:g],M=$g(zn(v)?v:v.contextElement||Cn(e.elements.popper),d,u,o),w=ya(e.elements.reference),x=Md({reference:w,element:b,strategy:"absolute",placement:s}),L=bo(Object.assign({},b,x)),k=g===si?L:w,T={top:M.top-k.top+C.top,bottom:k.bottom-M.bottom+C.bottom,left:M.left-k.left+C.left,right:k.right-M.right+C.right},E=e.modifiersData.offset;if(g===si&&E){var P=E[s];Object.keys(T).forEach(function(V){var D=[wt,Nt].indexOf(V)>=0?1:-1,j=[nt,Nt].indexOf(V)>=0?"y":"x";T[V]+=P[j]*D})}return T}function _g(e,t){t===void 0&&(t={});var n=t,a=n.placement,s=n.boundary,r=n.rootBoundary,o=n.padding,l=n.flipVariations,d=n.allowedAutoPlacements,c=d===void 0?fd:d,u=ba(a),f=u?l?ud:ud.filter(function(p){return ba(p)===u}):ai,g=f.filter(function(p){return c.indexOf(p)>=0});g.length===0&&(g=f);var m=g.reduce(function(p,y){return p[y]=ci(e,{placement:y,boundary:s,rootBoundary:r,padding:o})[Rt(y)],p},{});return Object.keys(m).sort(function(p,y){return m[p]-m[y]})}function Hg(e){if(Rt(e)===co)return[];var t=rs(e);return[vd(e),t,vd(t)]}function Wg(e){var t=e.state,n=e.options,a=e.name;if(!t.modifiersData[a]._skip){for(var s=n.mainAxis,r=s===void 0?!0:s,o=n.altAxis,l=o===void 0?!0:o,d=n.fallbackPlacements,c=n.padding,u=n.boundary,f=n.rootBoundary,g=n.altBoundary,m=n.flipVariations,p=m===void 0?!0:m,y=n.allowedAutoPlacements,N=t.options.placement,C=Rt(N),I=C===N,b=d||(I||!p?[rs(N)]:Hg(N)),v=[N].concat(b).reduce(function(Z,_){return Z.concat(Rt(_)===co?_g(t,{placement:_,boundary:u,rootBoundary:f,padding:c,flipVariations:p,allowedAutoPlacements:y}):_)},[]),M=t.rects.reference,w=t.rects.popper,x=new Map,L=!0,k=v[0],T=0;T<v.length;T++){var E=v[T],P=Rt(E),V=ba(E)===ma,D=[nt,Nt].indexOf(P)>=0,j=D?"width":"height",B=ci(t,{placement:E,boundary:u,rootBoundary:f,altBoundary:g,padding:c}),R=D?V?wt:at:V?Nt:nt;M[j]>w[j]&&(R=rs(R));var X=rs(R),Y=[];if(r&&Y.push(B[P]<=0),l&&Y.push(B[R]<=0,B[X]<=0),Y.every(function(Z){return Z})){k=E,L=!1;break}x.set(E,Y)}if(L)for(var re=p?3:1,H=function(_){var G=v.find(function(K){var Q=x.get(K);if(Q)return Q.slice(0,_).every(function(J){return J})});if(G)return k=G,"break"},U=re;U>0;U--){var W=H(U);if(W==="break")break}t.placement!==k&&(t.modifiersData[a]._skip=!0,t.placement=k,t.reset=!0)}}const Fg={name:"flip",enabled:!0,phase:"main",fn:Wg,requiresIfExists:["offset"],data:{_skip:!1}};function Id(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Ld(e){return[nt,wt,Nt,at].some(function(t){return e[t]>=0})}function Bg(e){var t=e.state,n=e.name,a=t.rects.reference,s=t.rects.popper,r=t.modifiersData.preventOverflow,o=ci(t,{elementContext:"reference"}),l=ci(t,{altBoundary:!0}),d=Id(o,a),c=Id(l,s,r),u=Ld(d),f=Ld(c);t.modifiersData[n]={referenceClippingOffsets:d,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":f})}const Gg={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Bg};function Zg(e,t,n){var a=Rt(e),s=[at,nt].indexOf(a)>=0?-1:1,r=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,o=r[0],l=r[1];return o=o||0,l=(l||0)*s,[at,wt].indexOf(a)>=0?{x:l,y:o}:{x:o,y:l}}function Yg(e){var t=e.state,n=e.options,a=e.name,s=n.offset,r=s===void 0?[0,0]:s,o=fd.reduce(function(u,f){return u[f]=Zg(f,t.rects,r),u},{}),l=o[t.placement],d=l.x,c=l.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=d,t.modifiersData.popperOffsets.y+=c),t.modifiersData[a]=o}const Ug={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Yg};function Kg(e){var t=e.state,n=e.name;t.modifiersData[n]=Md({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const Xg={name:"popperOffsets",enabled:!0,phase:"read",fn:Kg,data:{}};function qg(e){return e==="x"?"y":"x"}function em(e){var t=e.state,n=e.options,a=e.name,s=n.mainAxis,r=s===void 0?!0:s,o=n.altAxis,l=o===void 0?!1:o,d=n.boundary,c=n.rootBoundary,u=n.altBoundary,f=n.padding,g=n.tether,m=g===void 0?!0:g,p=n.tetherOffset,y=p===void 0?0:p,N=ci(t,{boundary:d,rootBoundary:c,padding:f,altBoundary:u}),C=Rt(t.placement),I=ba(t.placement),b=!I,v=go(C),M=qg(v),w=t.modifiersData.popperOffsets,x=t.rects.reference,L=t.rects.popper,k=typeof y=="function"?y(Object.assign({},t.rects,{placement:t.placement})):y,T=typeof k=="number"?{mainAxis:k,altAxis:k}:Object.assign({mainAxis:0,altAxis:0},k),E=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,P={x:0,y:0};if(w){if(r){var V,D=v==="y"?nt:at,j=v==="y"?Nt:wt,B=v==="y"?"height":"width",R=w[v],X=R+N[D],Y=R-N[j],re=m?-L[B]/2:0,H=I===ma?x[B]:L[B],U=I===ma?-L[B]:-x[B],W=t.elements.arrow,Z=m&&W?ho(W):{width:0,height:0},_=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:pd(),G=_[D],K=_[j],Q=oi(0,x[B],Z[B]),J=b?x[B]/2-re-Q-G-T.mainAxis:H-Q-G-T.mainAxis,z=b?-x[B]/2+re+Q+K+T.mainAxis:U+Q+K+T.mainAxis,F=t.elements.arrow&&ri(t.elements.arrow),S=F?v==="y"?F.clientTop||0:F.clientLeft||0:0,O=(V=E==null?void 0:E[v])!=null?V:0,$=R+J-O-S,ae=R+z-O,A=oi(m?as(X,$):X,R,m?Vn(Y,ae):Y);w[v]=A,P[v]=A-R}if(l){var ne,te=v==="x"?nt:at,q=v==="x"?Nt:wt,ie=w[M],ye=M==="y"?"height":"width",ee=ie+N[te],se=ie-N[q],ce=[nt,at].indexOf(C)!==-1,me=(ne=E==null?void 0:E[M])!=null?ne:0,Ne=ce?ee:ie-x[ye]-L[ye]-me+T.altAxis,Te=ce?ie+x[ye]+L[ye]-me-T.altAxis:se,De=m&&ce?Ig(Ne,ie,Te):oi(m?Ne:ee,ie,m?Te:se);w[M]=De,P[M]=De-ie}t.modifiersData[a]=P}}const tm={name:"preventOverflow",enabled:!0,phase:"main",fn:em,requiresIfExists:["offset"]};function nm(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function am(e){return e===mt(e)||!Mt(e)?mo(e):nm(e)}function im(e){var t=e.getBoundingClientRect(),n=pa(t.width)/e.offsetWidth||1,a=pa(t.height)/e.offsetHeight||1;return n!==1||a!==1}function sm(e,t,n){n===void 0&&(n=!1);var a=Mt(t),s=Mt(t)&&im(t),r=Cn(t),o=ya(e,s,n),l={scrollLeft:0,scrollTop:0},d={x:0,y:0};return(a||!a&&!n)&&((Jt(t)!=="body"||yo(r))&&(l=am(t)),Mt(t)?(d=ya(t,!0),d.x+=t.clientLeft,d.y+=t.clientTop):r&&(d.x=po(r))),{x:o.left+l.scrollLeft-d.x,y:o.top+l.scrollTop-d.y,width:o.width,height:o.height}}function rm(e){var t=new Map,n=new Set,a=[];e.forEach(function(r){t.set(r.name,r)});function s(r){n.add(r.name);var o=[].concat(r.requires||[],r.requiresIfExists||[]);o.forEach(function(l){if(!n.has(l)){var d=t.get(l);d&&s(d)}}),a.push(r)}return e.forEach(function(r){n.has(r.name)||s(r)}),a}function om(e){var t=rm(e);return bg.reduce(function(n,a){return n.concat(t.filter(function(s){return s.phase===a}))},[])}function lm(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function cm(e){var t=e.reduce(function(n,a){var s=n[a.name];return n[a.name]=s?Object.assign({},s,a,{options:Object.assign({},s.options,a.options),data:Object.assign({},s.data,a.data)}):a,n},{});return Object.keys(t).map(function(n){return t[n]})}var Td={placement:"bottom",modifiers:[],strategy:"absolute"};function Sd(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(a){return!(a&&typeof a.getBoundingClientRect=="function")})}function dm(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,a=n===void 0?[]:n,s=t.defaultOptions,r=s===void 0?Td:s;return function(l,d,c){c===void 0&&(c=r);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},Td,r),modifiersData:{},elements:{reference:l,popper:d},attributes:{},styles:{}},f=[],g=!1,m={state:u,setOptions:function(C){var I=typeof C=="function"?C(u.options):C;y(),u.options=Object.assign({},r,u.options,I),u.scrollParents={reference:zn(l)?li(l):l.contextElement?li(l.contextElement):[],popper:li(d)};var b=om(cm([].concat(a,u.options.modifiers)));return u.orderedModifiers=b.filter(function(v){return v.enabled}),p(),m.update()},forceUpdate:function(){if(!g){var C=u.elements,I=C.reference,b=C.popper;if(Sd(I,b)){u.rects={reference:sm(I,ri(b),u.options.strategy==="fixed"),popper:ho(b)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(T){return u.modifiersData[T.name]=Object.assign({},T.data)});for(var v=0;v<u.orderedModifiers.length;v++){if(u.reset===!0){u.reset=!1,v=-1;continue}var M=u.orderedModifiers[v],w=M.fn,x=M.options,L=x===void 0?{}:x,k=M.name;typeof w=="function"&&(u=w({state:u,options:L,name:k,instance:m})||u)}}}},update:lm(function(){return new Promise(function(N){m.forceUpdate(),N(u)})}),destroy:function(){y(),g=!0}};if(!Sd(l,d))return m;m.setOptions(c).then(function(N){!g&&c.onFirstUpdate&&c.onFirstUpdate(N)});function p(){u.orderedModifiers.forEach(function(N){var C=N.name,I=N.options,b=I===void 0?{}:I,v=N.effect;if(typeof v=="function"){var M=v({state:u,name:C,instance:m,options:b}),w=function(){};f.push(M||w)}})}function y(){f.forEach(function(N){return N()}),f=[]}return m}}var um=[Pg,Xg,Og,Ng,Ug,Fg,tm,kg,Gg],kd=dm({defaultModifiers:um});class fm{constructor(t,n,a){pe(this,"isShow",!1);pe(this,"trigger");pe(this,"instance");pe(this,"always",!1);pe(this,"reference");pe(this,"referenceTarget");pe(this,"popperRefer");pe(this,"instanceOptions");pe(this,"delay",50);pe(this,"isInnerPopper",!1);pe(this,"disabled",!1);pe(this,"afterShow",null);pe(this,"afterHidden",null);pe(this,"appendTo","parent");pe(this,"container",null);pe(this,"fixOnBoundary",!1);var s,r;this.instanceOptions=this.initDefaultOptions(a),this.reference=this.resolveInputSelectorToHtmlElement(t),this.popperRefer=this.resolveInputSelectorToHtmlElement(n),this.referenceTarget=this.getTargetReferenceElement(),this.container=(s=this.popperRefer)==null?void 0:s.parentElement,this.isShow=!!((r=this.instanceOptions)!=null&&r.isShow),this.always=this.instanceOptions.always,this.trigger=this.instanceOptions.trigger,this.disabled=this.instanceOptions.disabled,this.appendTo=this.instanceOptions.appendTo,this.afterHidden=typeof a.afterHidden=="function"?a.afterHidden:()=>{},this.afterShow=typeof a.afterShow=="function"?a.afterShow:()=>{},this.fixOnBoundary=this.instanceOptions.fixOnBoundary,this.initInstance(),this.registerEvents(),(this.isShow||this.always)&&this.show(null)}forceUpdate(){var t;(t=this.instance)==null||t.forceUpdate()}update(){var t;(t=this.instance)==null||t.update()}updateOptions(t){var n;this.instanceOptions=this.initDefaultOptions(t),this.isShow=!!((n=this.instanceOptions)!=null&&n.isShow),this.trigger=this.instanceOptions.trigger,this.disabled=this.instanceOptions.disabled,this.setOptions(this.instanceOptions)}setOptions(t){var n;(n=this.instance)==null||n.setOptions(t)}destroy(){var t;(t=this.instance)==null||t.destroy()}updateDisabled(t){this.disabled=t??!this.disabled,this.disabled&&this.hide()}show(t){var n;this.disabled||((n=this.popperRefer)==null||n.setAttribute("data-show",""),this.setOptions({modifiers:[...this.instanceOptions.modifiers||[],{name:"eventListeners",enabled:!0}]}),this.update(),this.isShow=!0,this.afterShow(),this.fixOnBoundary||this.appendToTarget())}hide(){var t;this.always||((t=this.popperRefer)==null||t.removeAttribute("data-show"),this.setOptions({modifiers:[...this.instanceOptions.modifiers||[],{name:"eventListeners",enabled:!1}]}),this.isShow=!1,this.isInnerPopper=!1,this.afterHidden(),this.fixOnBoundary||this.restorePopContent())}restorePopContent(){const t=this.getAppendToTarget();An(t)&&t.contains(this.popperRefer)&&this.container&&!this.container.contains(this.popperRefer)&&this.container.append(this.popperRefer)}appendToTarget(){const t=this.getAppendToTarget();An(t)&&t.contains(this.popperRefer)&&t.append(this.popperRefer)}getAppendToTarget(){const{appendTo:t}=this;let n=t;return t!=="parent"&&typeof t=="string"&&(n=document.querySelector(t)),n}initDefaultOptions(t){const a=Yc({placement:"top",modifiers:[{name:"offset",options:{offset:[0,8]}}],strategy:"absolute",onFirstUpdate:void 0,isShow:!1,theme:"dark",trigger:"hover",disabled:!1},t||{}),s=a.onFirstUpdate;return a.onFirstUpdate=r=>{typeof s=="function"&&(s.call(this,r),this.handleFirstUpdate())},a}handleFirstUpdate(){this.fixOnBoundary&&this.appendToTarget()}getTargetReferenceElement(){return this.isElement(this.reference)?this.reference.childElementCount===1?this.reference.firstElementChild:this.reference:this.reference}initInstance(){var t;this.referenceTarget&&(this.referenceTarget&&this.popperRefer?(this.instance=kd(this.referenceTarget,this.popperRefer,this.instanceOptions),(t=this.popperRefer)==null||t.setAttribute("data-theme",this.instanceOptions.theme??"dark")):console.error("reference or popperRefer is null, please check html element."))}resolveInputSelectorToHtmlElement(t){if(this.isElement(t))return t;if(typeof t=="string")return document.querySelector(t);if(typeof t=="object"){if(Object.prototype.hasOwnProperty.call(t,"getBoundingClientRect"))return t}else console.error("'getBoundingClientRect' is needed when use virtual elements");return null}isElement(t){return An(t)}registerEvents(){if(this.isElement(this.referenceTarget)&&this.trigger==="hover"){const t=["mouseenter","focus"],n=["mouseleave","blur"],a=["mouseenter","mouseleave"];t.forEach(s=>{this.referenceTarget.addEventListener(s,r=>{s==="mouseenter"&&(this.isInnerPopper=!0),this.show(r)})}),n.forEach(s=>{this.referenceTarget.addEventListener(s,()=>{this.isInnerPopper=!1,setTimeout(()=>{!this.isInnerPopper&&this.hide()},this.delay)})}),this.isElement(this.popperRefer)&&a.forEach(s=>{this.popperRefer.addEventListener(s,()=>{s==="mouseenter"&&(this.isInnerPopper=!0),s==="mouseleave"&&this.hide()})})}this.trigger==="click"&&["click"].forEach(n=>{document.body.addEventListener(n,a=>{this.isSameElement(a.target,this.reference)||this.reference.contains(a.target)?this.show(a):this.isShow&&!this.isSameElement(a.target,this.popperRefer)&&!this.popperRefer.contains(a.target)&&this.hide()})})}isSameElement(t,n){return t&&(t===n||t===n.firstElementChild)}}/*!
|
7
|
+
`,r.textContent=a.textContent,r};let n=!1;try{const a=window.getComputedStyle(e,null);if(a.webkitLineClamp!=="none"){const r=parseFloat(a.height),o=t(e,a);document.body.appendChild(o);const l=window.getComputedStyle(o,null).height;document.body.removeChild(o),n=r<parseFloat(l)}else n=e.clientWidth<e.scrollWidth||e.clientHeight<e.scrollHeight}catch(a){console.warn("There is an error when check element overflow state: ",a)}return n}const oo={bottom:0,content:1,navi:100,fullScreen:1e3,modal:2e3,plugins:5e3,message:6e3,popper:8e3};class eg{constructor(){pe(this,"storageLayerIndexValue",{});this.copyDefaultValue()}getNextIndex(t){return Object.prototype.hasOwnProperty.call(this.storageLayerIndexValue,t)?(this.storageLayerIndexValue[t]=this.storageLayerIndexValue[t]+1,this.storageLayerIndexValue[t]):(this.storageLayerIndexValue.modal=this.storageLayerIndexValue.modal+1,this.storageLayerIndexValue.modal)}getModalNextIndex(){return this.getNextIndex("modal")}getMessageNextIndex(){return this.getNextIndex("message")}getFullScreenNextIndex(){return this.getNextIndex("fullScreen")}getNaviNextIndex(){return this.getNextIndex("navi")}getPopperIndex(){return this.getNextIndex("popper")}setDefaultZIndex(t){Object.keys(t||{}).forEach(n=>{Object.prototype.hasOwnProperty.call(this.storageLayerIndexValue.__proto__,n)&&Object.assign(this.storageLayerIndexValue.__proto__,{[n]:t[n]})}),this.copyDefaultValue()}resetZIndex(t){Object.keys(t||{}).forEach(n=>{Object.prototype.hasOwnProperty.call(this.storageLayerIndexValue,n)&&Object.assign(this.storageLayerIndexValue,{[n]:t[n]})})}copyDefaultValue(){const t=Object.keys(oo).reduce((n,a)=>Object.assign(n,{[a]:{value:oo[a],writable:!0,configurable:!0}}),{});this.storageLayerIndexValue=Object.create(oo,t)}}const Vt=new eg;`${bn(16)}`;const es=new WeakMap,lo=e=>es.has(e)?es.get(e):[],tg=(e,t,n,a,s)=>{const r=lo(e);r.some(o=>o.instanceId===s)||(r.push({event:t,args:n,content:a,instanceId:s}),es.set(e,r))},ng=(e,t)=>{es.set(e,t)};class ag{constructor(){pe(this,"timer",null);pe(this,"store",[]);pe(this,"maskMap",new WeakMap)}appendMaker(t){this.store.push(t),this.executeMaker()}pushMaskStyle(t,n){const a=this.getMaskMap(t);this.setMaskMap(t,{styles:[n],...a||{}})}getMaskStyles(t){var n;return((n=this.getMaskMap(t))==null?void 0:n.styles)||[]}setMaskId(t,n){const a=this.getMaskMap(t);a?(Object.assign(a,{id:n}),this.setMaskMap(t,a)):this.setMaskMap(t,{id:n,...a||{}})}getMaskId(t){var n;return(n=this.getMaskMap(t))==null?void 0:n.id}setMaskMap(t,n){this.maskMap.set(t,n)}getMaskMap(t){return this.maskMap.get(t)}executeMaker(){this.timer&&cancelAnimationFrame(this.timer),this.timer=requestAnimationFrame(()=>{const t=this.store.pop();typeof t=="function"&&(Reflect.apply(t,this,[]),this.executeMaker())})}}const ga=new ag;class od{constructor(t){pe(this,"mask");pe(this,"backupMask");pe(this,"multiInstance",!1);pe(this,"uniqueMaskAttrTag","");pe(this,"parentNode",document.body);pe(this,"activeInstance");pe(this,"zIndexStore",new Map);pe(this,"lastUUID",null);pe(this,"maskStyle",{position:"fixed",left:0,top:0,bottom:0,right:0,display:"none","background-color":"rgba(0,0,0,.6)"});pe(this,"isInit",!1);pe(this,"maskAttrTag","auto");const{multiInstance:n=!1,maskAttrTag:a="auto",parentNode:s=document.body,maskStyle:r={}}=t||{};this.parentNode=s||document,this.maskAttrTag=a,this.activeInstance=void 0,this.multiInstance=n,this.uniqueMaskAttrTag=this.getMaskAttrTag(a),ga.appendMaker(()=>{this.initInstance(r)})}setOption(t){const{parentNode:n=document.body,maskStyle:a={},maskAttrTag:s=this.maskAttrTag}=t||{};this.parentNode=n||document,this.setMaskStyle(Object.assign({},this.maskStyle,a)),this.uniqueMaskAttrTag=this.getMaskAttrTag(s)}destroyEvent(t){if(this.mask){const n=lo(this.mask)||[],a=n.findIndex(s=>s.instanceId===t);a>=0&&(n.splice(a,1),ng(this.mask,n))}}show(t,n,a=!0,s={},r=null,o=!1,l,d){const c=r??bn(16),u=/-?\d+/.test(`${n}`)?n:Vt.getModalNextIndex();let f=Object.assign({},this.maskStyle,s||{});if(!a&&this.lastUUID){const g=this.zIndexStore.get(this.lastUUID);g&&(f=g==null?void 0:g.style)}this.storeMaskInsCfg({zIndex:u,style:{...f},uuid:c,preUID:this.lastUUID}),Object.assign(f,{display:"block","z-index":`${u}`,"pointer-events":"all"}),this.initInstance(f),l&&this.catchClickEvent(t,l,d),this.setMaskStyle(f),ga.pushMaskStyle(this.parentNode,{...f}),this.backupMask.style.setProperty("z-index",`${u-1}`),a||(this.mask.style.setProperty("pointer-events","none"),t==null||t.style.setProperty("pointer-events","all")),t&&(o&&t.style.setProperty("z-index",`${u+1}`),this.activeInstance=t,this.appendContentToMask(t))}hide(t=!1,n,a){var o;const s=a??this.lastUUID;t||(n==null||n.remove(),(o=this.activeInstance)==null||o.remove()),this.removeClickEvent(),this.activeInstance=void 0,this.popIndexStore(s);const r=ga.getMaskStyles(this.parentNode);if(r==null||r.pop(),!(r!=null&&r.length))this.mask.style.setProperty("display","none");else{const l=r.slice(-1)[0];this.setMaskStyle(l)}}storeMaskInsCfg(t){return this.zIndexStore.set(t.uuid,t),this.lastUUID=t.uuid,this.zIndexStore.get(t.uuid)}popIndexStore(t){if(this.zIndexStore.has(t)){const n=this.zIndexStore.get(t);return this.lastUUID=n.preUID,this.zIndexStore.delete(t)}return this.lastUUID=null,!1}backupActiveInstance(){this.activeInstance&&this.backupMask.append(this.activeInstance)}backupContentElement(t){var n;t&&((n=this.backupMask)==null||n.append(t))}getActiveContentInstance(){return this.activeInstance}removeClickEvent(){}initInstance(t){if(!this.isInit){this.isInit=!0,this.backupMask=this.getBackupMask();const{instance:n,isExist:a}=this.getMask();this.mask=n,!a&&this.setMaskStyle(Object.assign({},this.maskStyle,t))}}getMask(){if(this.multiInstance)return{instance:this.createMask(),isExist:!1};let t=!0,n=this.parentNode.querySelector(`[data-bk-mask-uid='${this.uniqueMaskAttrTag}']`);return n||(t=!1,n=this.createMask(),n.addEventListener("mousedown",a=>this.handleMaskClick(a),!0)),{instance:n,isExist:t}}catchClickEvent(t,n,a){this.mask&&tg(this.mask,n,[],t,a)}handleMaskClick(t){if(t.target!==this.mask)return;const n=lo(this.mask);if(n.length){const{event:a}=n.slice(-1)[0];typeof a=="function"&&a(t)}}getBackupMask(){const t="data-bk-backup-uid";let n=this.parentNode.querySelector(`[${t}]`);return n||(n=this.createMask(t)),n}createMask(t="data-bk-mask-uid"){const n=document.createElement("div");return n.setAttribute(t,this.uniqueMaskAttrTag),this.parentNode.append(n),n}setMaskStyle(t={}){this.mask&&Object.entries(t).forEach(n=>this.mask.style.setProperty(n[0],n[1]))}getMaskAttrTag(t){return/^(auto|\s+)$/i.test(t)||t===null||t===void 0||t===""?(ga.getMaskId(this.parentNode)||ga.setMaskId(this.parentNode,`__bk_mask_${bn(16)}`),ga.getMaskId(this.parentNode)):t}appendContentToMask(t){this.mask.append(t)}}new od({});const ts=new WeakMap;class ld{constructor(t){pe(this,"uuidAttrName");pe(this,"clickFn");pe(this,"bKMaskManagerInstance");pe(this,"transfer");pe(this,"uniqId");this.clickFn=void 0,this.uuidAttrName="data-bk-pop-uuid",this.uniqId=bn(16),this.transfer=this.getParentNode(t==null?void 0:t.transfer),this.bKMaskManagerInstance=new od({parentNode:this.getParentNode(t==null?void 0:t.transfer),popInstance:this,onClick:this.onMaskClickFn})}get popInstanceList(){return ts.has(this.transfer)||ts.set(this.transfer,[]),ts.get(this.transfer)}set popInstanceList(t){ts.set(this.transfer,t)}getParentNode(t){if(typeof t=="string"){const n=document.querySelector(t);if(n)return n}return An(t)?t:document.body}onMaskClick(t,n){this.clickFn={fn:t,target:n}}show(t,n=!0,a={},s=!1,r=void 0,o){if(!t){console.warn("pop show error: content is null or undefined");return}const l=typeof r=="number"?r:Vt.getModalNextIndex(),d=bn(16);t.setAttribute(this.uuidAttrName,d),this.popInstanceList.length>0&&n&&this.bKMaskManagerInstance.backupContentElement(this.popInstanceList.slice(-1)[0].content),this.popInstanceList.push({uuid:d,zIndex:l,content:t,showMask:n,appendStyle:a}),this.bKMaskManagerInstance.show(t,l,n,a,d,s,o,this.uniqId)}destroy(t,n=!1){this.clickFn=void 0,this.hide(t,n)}popHide(t=!0){if(this.popInstanceList.length){if(t){const n=this.popInstanceList.pop();this.bKMaskManagerInstance.popIndexStore(n.uuid),n.remove()}if(this.popInstanceList.length){const n=this.popInstanceList.slice(-1)[0],{zIndex:a,content:s,showMask:r,appendStyle:o,uuid:l}=n;this.bKMaskManagerInstance.show(s,a,r,o,l)}else this.bKMaskManagerInstance.hide()}}hide(t,n=!1){const a=t==null?void 0:t.getAttribute(this.uuidAttrName);if(a){const s=this.popInstanceList.findIndex(r=>r.uuid===a);s>=0&&(n||this.popInstanceList[s].content.remove(),this.popInstanceList.splice(s,1),this.bKMaskManagerInstance.popIndexStore(a),this.popInstanceList.length?this.popHide(!1):this.bKMaskManagerInstance.hide(n))}else t==null||t.remove();this.bKMaskManagerInstance.removeClickEvent()}removeLastEvent(){this.bKMaskManagerInstance.destroyEvent(this.uniqId)}onMaskClickFn(t){if(this.clickFn){const{fn:n}=this.clickFn;n&&Reflect.apply(n,this,[t])}}}new ld;let ns;const ig=new Uint8Array(16);function sg(){if(!ns&&(ns=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!ns))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ns(ig)}const Fe=[];for(let e=0;e<256;++e)Fe.push((e+256).toString(16).slice(1));function rg(e,t=0){return Fe[e[t+0]]+Fe[e[t+1]]+Fe[e[t+2]]+Fe[e[t+3]]+"-"+Fe[e[t+4]]+Fe[e[t+5]]+"-"+Fe[e[t+6]]+Fe[e[t+7]]+"-"+Fe[e[t+8]]+Fe[e[t+9]]+"-"+Fe[e[t+10]]+Fe[e[t+11]]+Fe[e[t+12]]+Fe[e[t+13]]+Fe[e[t+14]]+Fe[e[t+15]]}const cd={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function tn(e,t,n){if(cd.randomUUID&&!t&&!e)return cd.randomUUID();e=e||{};const a=e.random||(e.rng||sg)();if(a[6]=a[6]&15|64,a[8]=a[8]&63|128,t){n=n||0;for(let s=0;s<16;++s)t[n+s]=a[s];return t}return rg(a)}var nt="top",Nt="bottom",wt="right",at="left",co="auto",ai=[nt,Nt,wt,at],ma="start",ii="end",og="clippingParents",dd="viewport",si="popper",lg="reference",ud=ai.reduce(function(e,t){return e.concat([t+"-"+ma,t+"-"+ii])},[]),fd=[].concat(ai,[co]).reduce(function(e,t){return e.concat([t,t+"-"+ma,t+"-"+ii])},[]),cg="beforeRead",dg="read",ug="afterRead",fg="beforeMain",hg="main",gg="afterMain",mg="beforeWrite",pg="write",yg="afterWrite",bg=[cg,dg,ug,fg,hg,gg,mg,pg,yg];function Jt(e){return e?(e.nodeName||"").toLowerCase():null}function mt(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function zn(e){var t=mt(e).Element;return e instanceof t||e instanceof Element}function Mt(e){var t=mt(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function uo(e){if(typeof ShadowRoot>"u")return!1;var t=mt(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Cg(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var a=t.styles[n]||{},s=t.attributes[n]||{},r=t.elements[n];!Mt(r)||!Jt(r)||(Object.assign(r.style,a),Object.keys(s).forEach(function(o){var l=s[o];l===!1?r.removeAttribute(o):r.setAttribute(o,l===!0?"":l)}))})}function vg(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(a){var s=t.elements[a],r=t.attributes[a]||{},o=Object.keys(t.styles.hasOwnProperty(a)?t.styles[a]:n[a]),l=o.reduce(function(d,c){return d[c]="",d},{});!Mt(s)||!Jt(s)||(Object.assign(s.style,l),Object.keys(r).forEach(function(d){s.removeAttribute(d)}))})}}const Ng={name:"applyStyles",enabled:!0,phase:"write",fn:Cg,effect:vg,requires:["computeStyles"]};function Rt(e){return e.split("-")[0]}var Vn=Math.max,as=Math.min,pa=Math.round;function fo(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function hd(){return!/^((?!chrome|android).)*safari/i.test(fo())}function ya(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var a=e.getBoundingClientRect(),s=1,r=1;t&&Mt(e)&&(s=e.offsetWidth>0&&pa(a.width)/e.offsetWidth||1,r=e.offsetHeight>0&&pa(a.height)/e.offsetHeight||1);var o=zn(e)?mt(e):window,l=o.visualViewport,d=!hd()&&n,c=(a.left+(d&&l?l.offsetLeft:0))/s,u=(a.top+(d&&l?l.offsetTop:0))/r,f=a.width/s,g=a.height/r;return{width:f,height:g,top:u,right:c+f,bottom:u+g,left:c,x:c,y:u}}function ho(e){var t=ya(e),n=e.offsetWidth,a=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-a)<=1&&(a=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:a}}function gd(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&uo(n)){var a=t;do{if(a&&e.isSameNode(a))return!0;a=a.parentNode||a.host}while(a)}return!1}function nn(e){return mt(e).getComputedStyle(e)}function wg(e){return["table","td","th"].indexOf(Jt(e))>=0}function Cn(e){return((zn(e)?e.ownerDocument:e.document)||window.document).documentElement}function is(e){return Jt(e)==="html"?e:e.assignedSlot||e.parentNode||(uo(e)?e.host:null)||Cn(e)}function md(e){return!Mt(e)||nn(e).position==="fixed"?null:e.offsetParent}function Mg(e){var t=/firefox/i.test(fo()),n=/Trident/i.test(fo());if(n&&Mt(e)){var a=nn(e);if(a.position==="fixed")return null}var s=is(e);for(uo(s)&&(s=s.host);Mt(s)&&["html","body"].indexOf(Jt(s))<0;){var r=nn(s);if(r.transform!=="none"||r.perspective!=="none"||r.contain==="paint"||["transform","perspective"].indexOf(r.willChange)!==-1||t&&r.willChange==="filter"||t&&r.filter&&r.filter!=="none")return s;s=s.parentNode}return null}function ri(e){for(var t=mt(e),n=md(e);n&&wg(n)&&nn(n).position==="static";)n=md(n);return n&&(Jt(n)==="html"||Jt(n)==="body"&&nn(n).position==="static")?t:n||Mg(e)||t}function go(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function oi(e,t,n){return Vn(e,as(t,n))}function Ig(e,t,n){var a=oi(e,t,n);return a>n?n:a}function pd(){return{top:0,right:0,bottom:0,left:0}}function yd(e){return Object.assign({},pd(),e)}function bd(e,t){return t.reduce(function(n,a){return n[a]=e,n},{})}var Lg=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,yd(typeof t!="number"?t:bd(t,ai))};function Tg(e){var t,n=e.state,a=e.name,s=e.options,r=n.elements.arrow,o=n.modifiersData.popperOffsets,l=Rt(n.placement),d=go(l),c=[at,wt].indexOf(l)>=0,u=c?"height":"width";if(!(!r||!o)){var f=Lg(s.padding,n),g=ho(r),m=d==="y"?nt:at,p=d==="y"?Nt:wt,y=n.rects.reference[u]+n.rects.reference[d]-o[d]-n.rects.popper[u],N=o[d]-n.rects.reference[d],C=ri(r),I=C?d==="y"?C.clientHeight||0:C.clientWidth||0:0,b=y/2-N/2,v=f[m],M=I-g[u]-f[p],w=I/2-g[u]/2+b,x=oi(v,w,M),L=d;n.modifiersData[a]=(t={},t[L]=x,t.centerOffset=x-w,t)}}function Sg(e){var t=e.state,n=e.options,a=n.element,s=a===void 0?"[data-popper-arrow]":a;s!=null&&(typeof s=="string"&&(s=t.elements.popper.querySelector(s),!s)||gd(t.elements.popper,s)&&(t.elements.arrow=s))}const kg={name:"arrow",enabled:!0,phase:"main",fn:Tg,effect:Sg,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ba(e){return e.split("-")[1]}var xg={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Dg(e,t){var n=e.x,a=e.y,s=t.devicePixelRatio||1;return{x:pa(n*s)/s||0,y:pa(a*s)/s||0}}function Cd(e){var t,n=e.popper,a=e.popperRect,s=e.placement,r=e.variation,o=e.offsets,l=e.position,d=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,f=e.isFixed,g=o.x,m=g===void 0?0:g,p=o.y,y=p===void 0?0:p,N=typeof u=="function"?u({x:m,y}):{x:m,y};m=N.x,y=N.y;var C=o.hasOwnProperty("x"),I=o.hasOwnProperty("y"),b=at,v=nt,M=window;if(c){var w=ri(n),x="clientHeight",L="clientWidth";if(w===mt(n)&&(w=Cn(n),nn(w).position!=="static"&&l==="absolute"&&(x="scrollHeight",L="scrollWidth")),w=w,s===nt||(s===at||s===wt)&&r===ii){v=Nt;var k=f&&w===M&&M.visualViewport?M.visualViewport.height:w[x];y-=k-a.height,y*=d?1:-1}if(s===at||(s===nt||s===Nt)&&r===ii){b=wt;var T=f&&w===M&&M.visualViewport?M.visualViewport.width:w[L];m-=T-a.width,m*=d?1:-1}}var E=Object.assign({position:l},c&&xg),P=u===!0?Dg({x:m,y},mt(n)):{x:m,y};if(m=P.x,y=P.y,d){var V;return Object.assign({},E,(V={},V[v]=I?"0":"",V[b]=C?"0":"",V.transform=(M.devicePixelRatio||1)<=1?"translate("+m+"px, "+y+"px)":"translate3d("+m+"px, "+y+"px, 0)",V))}return Object.assign({},E,(t={},t[v]=I?y+"px":"",t[b]=C?m+"px":"",t.transform="",t))}function jg(e){var t=e.state,n=e.options,a=n.gpuAcceleration,s=a===void 0?!0:a,r=n.adaptive,o=r===void 0?!0:r,l=n.roundOffsets,d=l===void 0?!0:l,c={placement:Rt(t.placement),variation:ba(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:s,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Cd(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:d})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Cd(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:d})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const Og={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:jg,data:{}};var ss={passive:!0};function Eg(e){var t=e.state,n=e.instance,a=e.options,s=a.scroll,r=s===void 0?!0:s,o=a.resize,l=o===void 0?!0:o,d=mt(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return r&&c.forEach(function(u){u.addEventListener("scroll",n.update,ss)}),l&&d.addEventListener("resize",n.update,ss),function(){r&&c.forEach(function(u){u.removeEventListener("scroll",n.update,ss)}),l&&d.removeEventListener("resize",n.update,ss)}}const Pg={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Eg,data:{}};var Ag={left:"right",right:"left",bottom:"top",top:"bottom"};function rs(e){return e.replace(/left|right|bottom|top/g,function(t){return Ag[t]})}var zg={start:"end",end:"start"};function vd(e){return e.replace(/start|end/g,function(t){return zg[t]})}function mo(e){var t=mt(e),n=t.pageXOffset,a=t.pageYOffset;return{scrollLeft:n,scrollTop:a}}function po(e){return ya(Cn(e)).left+mo(e).scrollLeft}function Vg(e,t){var n=mt(e),a=Cn(e),s=n.visualViewport,r=a.clientWidth,o=a.clientHeight,l=0,d=0;if(s){r=s.width,o=s.height;var c=hd();(c||!c&&t==="fixed")&&(l=s.offsetLeft,d=s.offsetTop)}return{width:r,height:o,x:l+po(e),y:d}}function Jg(e){var t,n=Cn(e),a=mo(e),s=(t=e.ownerDocument)==null?void 0:t.body,r=Vn(n.scrollWidth,n.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),o=Vn(n.scrollHeight,n.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),l=-a.scrollLeft+po(e),d=-a.scrollTop;return nn(s||n).direction==="rtl"&&(l+=Vn(n.clientWidth,s?s.clientWidth:0)-r),{width:r,height:o,x:l,y:d}}function yo(e){var t=nn(e),n=t.overflow,a=t.overflowX,s=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+s+a)}function Nd(e){return["html","body","#document"].indexOf(Jt(e))>=0?e.ownerDocument.body:Mt(e)&&yo(e)?e:Nd(is(e))}function li(e,t){var n;t===void 0&&(t=[]);var a=Nd(e),s=a===((n=e.ownerDocument)==null?void 0:n.body),r=mt(a),o=s?[r].concat(r.visualViewport||[],yo(a)?a:[]):a,l=t.concat(o);return s?l:l.concat(li(is(o)))}function bo(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Rg(e,t){var n=ya(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function wd(e,t,n){return t===dd?bo(Vg(e,n)):zn(t)?Rg(t,n):bo(Jg(Cn(e)))}function Qg(e){var t=li(is(e)),n=["absolute","fixed"].indexOf(nn(e).position)>=0,a=n&&Mt(e)?ri(e):e;return zn(a)?t.filter(function(s){return zn(s)&&gd(s,a)&&Jt(s)!=="body"}):[]}function $g(e,t,n,a){var s=t==="clippingParents"?Qg(e):[].concat(t),r=[].concat(s,[n]),o=r[0],l=r.reduce(function(d,c){var u=wd(e,c,a);return d.top=Vn(u.top,d.top),d.right=as(u.right,d.right),d.bottom=as(u.bottom,d.bottom),d.left=Vn(u.left,d.left),d},wd(e,o,a));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function Md(e){var t=e.reference,n=e.element,a=e.placement,s=a?Rt(a):null,r=a?ba(a):null,o=t.x+t.width/2-n.width/2,l=t.y+t.height/2-n.height/2,d;switch(s){case nt:d={x:o,y:t.y-n.height};break;case Nt:d={x:o,y:t.y+t.height};break;case wt:d={x:t.x+t.width,y:l};break;case at:d={x:t.x-n.width,y:l};break;default:d={x:t.x,y:t.y}}var c=s?go(s):null;if(c!=null){var u=c==="y"?"height":"width";switch(r){case ma:d[c]=d[c]-(t[u]/2-n[u]/2);break;case ii:d[c]=d[c]+(t[u]/2-n[u]/2);break}}return d}function ci(e,t){t===void 0&&(t={});var n=t,a=n.placement,s=a===void 0?e.placement:a,r=n.strategy,o=r===void 0?e.strategy:r,l=n.boundary,d=l===void 0?og:l,c=n.rootBoundary,u=c===void 0?dd:c,f=n.elementContext,g=f===void 0?si:f,m=n.altBoundary,p=m===void 0?!1:m,y=n.padding,N=y===void 0?0:y,C=yd(typeof N!="number"?N:bd(N,ai)),I=g===si?lg:si,b=e.rects.popper,v=e.elements[p?I:g],M=$g(zn(v)?v:v.contextElement||Cn(e.elements.popper),d,u,o),w=ya(e.elements.reference),x=Md({reference:w,element:b,strategy:"absolute",placement:s}),L=bo(Object.assign({},b,x)),k=g===si?L:w,T={top:M.top-k.top+C.top,bottom:k.bottom-M.bottom+C.bottom,left:M.left-k.left+C.left,right:k.right-M.right+C.right},E=e.modifiersData.offset;if(g===si&&E){var P=E[s];Object.keys(T).forEach(function(V){var D=[wt,Nt].indexOf(V)>=0?1:-1,j=[nt,Nt].indexOf(V)>=0?"y":"x";T[V]+=P[j]*D})}return T}function _g(e,t){t===void 0&&(t={});var n=t,a=n.placement,s=n.boundary,r=n.rootBoundary,o=n.padding,l=n.flipVariations,d=n.allowedAutoPlacements,c=d===void 0?fd:d,u=ba(a),f=u?l?ud:ud.filter(function(p){return ba(p)===u}):ai,g=f.filter(function(p){return c.indexOf(p)>=0});g.length===0&&(g=f);var m=g.reduce(function(p,y){return p[y]=ci(e,{placement:y,boundary:s,rootBoundary:r,padding:o})[Rt(y)],p},{});return Object.keys(m).sort(function(p,y){return m[p]-m[y]})}function Hg(e){if(Rt(e)===co)return[];var t=rs(e);return[vd(e),t,vd(t)]}function Wg(e){var t=e.state,n=e.options,a=e.name;if(!t.modifiersData[a]._skip){for(var s=n.mainAxis,r=s===void 0?!0:s,o=n.altAxis,l=o===void 0?!0:o,d=n.fallbackPlacements,c=n.padding,u=n.boundary,f=n.rootBoundary,g=n.altBoundary,m=n.flipVariations,p=m===void 0?!0:m,y=n.allowedAutoPlacements,N=t.options.placement,C=Rt(N),I=C===N,b=d||(I||!p?[rs(N)]:Hg(N)),v=[N].concat(b).reduce(function(Z,_){return Z.concat(Rt(_)===co?_g(t,{placement:_,boundary:u,rootBoundary:f,padding:c,flipVariations:p,allowedAutoPlacements:y}):_)},[]),M=t.rects.reference,w=t.rects.popper,x=new Map,L=!0,k=v[0],T=0;T<v.length;T++){var E=v[T],P=Rt(E),V=ba(E)===ma,D=[nt,Nt].indexOf(P)>=0,j=D?"width":"height",B=ci(t,{placement:E,boundary:u,rootBoundary:f,altBoundary:g,padding:c}),R=D?V?wt:at:V?Nt:nt;M[j]>w[j]&&(R=rs(R));var X=rs(R),Y=[];if(r&&Y.push(B[P]<=0),l&&Y.push(B[R]<=0,B[X]<=0),Y.every(function(Z){return Z})){k=E,L=!1;break}x.set(E,Y)}if(L)for(var re=p?3:1,H=function(_){var G=v.find(function(K){var Q=x.get(K);if(Q)return Q.slice(0,_).every(function(J){return J})});if(G)return k=G,"break"},U=re;U>0;U--){var W=H(U);if(W==="break")break}t.placement!==k&&(t.modifiersData[a]._skip=!0,t.placement=k,t.reset=!0)}}const Fg={name:"flip",enabled:!0,phase:"main",fn:Wg,requiresIfExists:["offset"],data:{_skip:!1}};function Id(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Ld(e){return[nt,wt,Nt,at].some(function(t){return e[t]>=0})}function Bg(e){var t=e.state,n=e.name,a=t.rects.reference,s=t.rects.popper,r=t.modifiersData.preventOverflow,o=ci(t,{elementContext:"reference"}),l=ci(t,{altBoundary:!0}),d=Id(o,a),c=Id(l,s,r),u=Ld(d),f=Ld(c);t.modifiersData[n]={referenceClippingOffsets:d,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":f})}const Gg={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Bg};function Zg(e,t,n){var a=Rt(e),s=[at,nt].indexOf(a)>=0?-1:1,r=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,o=r[0],l=r[1];return o=o||0,l=(l||0)*s,[at,wt].indexOf(a)>=0?{x:l,y:o}:{x:o,y:l}}function Yg(e){var t=e.state,n=e.options,a=e.name,s=n.offset,r=s===void 0?[0,0]:s,o=fd.reduce(function(u,f){return u[f]=Zg(f,t.rects,r),u},{}),l=o[t.placement],d=l.x,c=l.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=d,t.modifiersData.popperOffsets.y+=c),t.modifiersData[a]=o}const Ug={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Yg};function Kg(e){var t=e.state,n=e.name;t.modifiersData[n]=Md({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const Xg={name:"popperOffsets",enabled:!0,phase:"read",fn:Kg,data:{}};function qg(e){return e==="x"?"y":"x"}function em(e){var t=e.state,n=e.options,a=e.name,s=n.mainAxis,r=s===void 0?!0:s,o=n.altAxis,l=o===void 0?!1:o,d=n.boundary,c=n.rootBoundary,u=n.altBoundary,f=n.padding,g=n.tether,m=g===void 0?!0:g,p=n.tetherOffset,y=p===void 0?0:p,N=ci(t,{boundary:d,rootBoundary:c,padding:f,altBoundary:u}),C=Rt(t.placement),I=ba(t.placement),b=!I,v=go(C),M=qg(v),w=t.modifiersData.popperOffsets,x=t.rects.reference,L=t.rects.popper,k=typeof y=="function"?y(Object.assign({},t.rects,{placement:t.placement})):y,T=typeof k=="number"?{mainAxis:k,altAxis:k}:Object.assign({mainAxis:0,altAxis:0},k),E=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,P={x:0,y:0};if(w){if(r){var V,D=v==="y"?nt:at,j=v==="y"?Nt:wt,B=v==="y"?"height":"width",R=w[v],X=R+N[D],Y=R-N[j],re=m?-L[B]/2:0,H=I===ma?x[B]:L[B],U=I===ma?-L[B]:-x[B],W=t.elements.arrow,Z=m&&W?ho(W):{width:0,height:0},_=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:pd(),G=_[D],K=_[j],Q=oi(0,x[B],Z[B]),J=b?x[B]/2-re-Q-G-T.mainAxis:H-Q-G-T.mainAxis,z=b?-x[B]/2+re+Q+K+T.mainAxis:U+Q+K+T.mainAxis,F=t.elements.arrow&&ri(t.elements.arrow),S=F?v==="y"?F.clientTop||0:F.clientLeft||0:0,O=(V=E==null?void 0:E[v])!=null?V:0,$=R+J-O-S,ae=R+z-O,A=oi(m?as(X,$):X,R,m?Vn(Y,ae):Y);w[v]=A,P[v]=A-R}if(l){var ne,te=v==="x"?nt:at,q=v==="x"?Nt:wt,ie=w[M],ye=M==="y"?"height":"width",ee=ie+N[te],se=ie-N[q],ce=[nt,at].indexOf(C)!==-1,me=(ne=E==null?void 0:E[M])!=null?ne:0,Ne=ce?ee:ie-x[ye]-L[ye]-me+T.altAxis,Te=ce?ie+x[ye]+L[ye]-me-T.altAxis:se,De=m&&ce?Ig(Ne,ie,Te):oi(m?Ne:ee,ie,m?Te:se);w[M]=De,P[M]=De-ie}t.modifiersData[a]=P}}const tm={name:"preventOverflow",enabled:!0,phase:"main",fn:em,requiresIfExists:["offset"]};function nm(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function am(e){return e===mt(e)||!Mt(e)?mo(e):nm(e)}function im(e){var t=e.getBoundingClientRect(),n=pa(t.width)/e.offsetWidth||1,a=pa(t.height)/e.offsetHeight||1;return n!==1||a!==1}function sm(e,t,n){n===void 0&&(n=!1);var a=Mt(t),s=Mt(t)&&im(t),r=Cn(t),o=ya(e,s,n),l={scrollLeft:0,scrollTop:0},d={x:0,y:0};return(a||!a&&!n)&&((Jt(t)!=="body"||yo(r))&&(l=am(t)),Mt(t)?(d=ya(t,!0),d.x+=t.clientLeft,d.y+=t.clientTop):r&&(d.x=po(r))),{x:o.left+l.scrollLeft-d.x,y:o.top+l.scrollTop-d.y,width:o.width,height:o.height}}function rm(e){var t=new Map,n=new Set,a=[];e.forEach(function(r){t.set(r.name,r)});function s(r){n.add(r.name);var o=[].concat(r.requires||[],r.requiresIfExists||[]);o.forEach(function(l){if(!n.has(l)){var d=t.get(l);d&&s(d)}}),a.push(r)}return e.forEach(function(r){n.has(r.name)||s(r)}),a}function om(e){var t=rm(e);return bg.reduce(function(n,a){return n.concat(t.filter(function(s){return s.phase===a}))},[])}function lm(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function cm(e){var t=e.reduce(function(n,a){var s=n[a.name];return n[a.name]=s?Object.assign({},s,a,{options:Object.assign({},s.options,a.options),data:Object.assign({},s.data,a.data)}):a,n},{});return Object.keys(t).map(function(n){return t[n]})}var Td={placement:"bottom",modifiers:[],strategy:"absolute"};function Sd(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(a){return!(a&&typeof a.getBoundingClientRect=="function")})}function dm(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,a=n===void 0?[]:n,s=t.defaultOptions,r=s===void 0?Td:s;return function(l,d,c){c===void 0&&(c=r);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},Td,r),modifiersData:{},elements:{reference:l,popper:d},attributes:{},styles:{}},f=[],g=!1,m={state:u,setOptions:function(C){var I=typeof C=="function"?C(u.options):C;y(),u.options=Object.assign({},r,u.options,I),u.scrollParents={reference:zn(l)?li(l):l.contextElement?li(l.contextElement):[],popper:li(d)};var b=om(cm([].concat(a,u.options.modifiers)));return u.orderedModifiers=b.filter(function(v){return v.enabled}),p(),m.update()},forceUpdate:function(){if(!g){var C=u.elements,I=C.reference,b=C.popper;if(Sd(I,b)){u.rects={reference:sm(I,ri(b),u.options.strategy==="fixed"),popper:ho(b)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(T){return u.modifiersData[T.name]=Object.assign({},T.data)});for(var v=0;v<u.orderedModifiers.length;v++){if(u.reset===!0){u.reset=!1,v=-1;continue}var M=u.orderedModifiers[v],w=M.fn,x=M.options,L=x===void 0?{}:x,k=M.name;typeof w=="function"&&(u=w({state:u,options:L,name:k,instance:m})||u)}}}},update:lm(function(){return new Promise(function(N){m.forceUpdate(),N(u)})}),destroy:function(){y(),g=!0}};if(!Sd(l,d))return m;m.setOptions(c).then(function(N){!g&&c.onFirstUpdate&&c.onFirstUpdate(N)});function p(){u.orderedModifiers.forEach(function(N){var C=N.name,I=N.options,b=I===void 0?{}:I,v=N.effect;if(typeof v=="function"){var M=v({state:u,name:C,instance:m,options:b}),w=function(){};f.push(M||w)}})}function y(){f.forEach(function(N){return N()}),f=[]}return m}}var um=[Pg,Xg,Og,Ng,Ug,Fg,tm,kg,Gg],kd=dm({defaultModifiers:um});class fm{constructor(t,n,a){pe(this,"isShow",!1);pe(this,"trigger");pe(this,"instance");pe(this,"always",!1);pe(this,"reference");pe(this,"referenceTarget");pe(this,"popperRefer");pe(this,"instanceOptions");pe(this,"delay",50);pe(this,"isInnerPopper",!1);pe(this,"disabled",!1);pe(this,"afterShow",null);pe(this,"afterHidden",null);pe(this,"appendTo","parent");pe(this,"container",null);pe(this,"fixOnBoundary",!1);var s,r;this.instanceOptions=this.initDefaultOptions(a),this.reference=this.resolveInputSelectorToHtmlElement(t),this.popperRefer=this.resolveInputSelectorToHtmlElement(n),this.referenceTarget=this.getTargetReferenceElement(),this.container=(s=this.popperRefer)==null?void 0:s.parentElement,this.isShow=!!((r=this.instanceOptions)!=null&&r.isShow),this.always=this.instanceOptions.always,this.trigger=this.instanceOptions.trigger,this.disabled=this.instanceOptions.disabled,this.appendTo=this.instanceOptions.appendTo,this.afterHidden=typeof a.afterHidden=="function"?a.afterHidden:()=>{},this.afterShow=typeof a.afterShow=="function"?a.afterShow:()=>{},this.fixOnBoundary=this.instanceOptions.fixOnBoundary,this.initInstance(),this.registerEvents(),(this.isShow||this.always)&&this.show(null)}forceUpdate(){var t;(t=this.instance)==null||t.forceUpdate()}update(){var t;(t=this.instance)==null||t.update()}updateOptions(t){var n;this.instanceOptions=this.initDefaultOptions(t),this.isShow=!!((n=this.instanceOptions)!=null&&n.isShow),this.trigger=this.instanceOptions.trigger,this.disabled=this.instanceOptions.disabled,this.setOptions(this.instanceOptions)}setOptions(t){var n;(n=this.instance)==null||n.setOptions(t)}destroy(){var t;(t=this.instance)==null||t.destroy()}updateDisabled(t){this.disabled=t??!this.disabled,this.disabled&&this.hide()}show(t){var n;this.disabled||((n=this.popperRefer)==null||n.setAttribute("data-show",""),this.setOptions({modifiers:[...this.instanceOptions.modifiers||[],{name:"eventListeners",enabled:!0}]}),this.update(),this.isShow=!0,this.afterShow(),this.fixOnBoundary||this.appendToTarget())}hide(){var t;this.always||((t=this.popperRefer)==null||t.removeAttribute("data-show"),this.setOptions({modifiers:[...this.instanceOptions.modifiers||[],{name:"eventListeners",enabled:!1}]}),this.isShow=!1,this.isInnerPopper=!1,this.afterHidden(),this.fixOnBoundary||this.restorePopContent())}restorePopContent(){const t=this.getAppendToTarget();An(t)&&t.contains(this.popperRefer)&&this.container&&!this.container.contains(this.popperRefer)&&this.container.append(this.popperRefer)}appendToTarget(){const t=this.getAppendToTarget();An(t)&&t.contains(this.popperRefer)&&t.append(this.popperRefer)}getAppendToTarget(){const{appendTo:t}=this;let n=t;return t!=="parent"&&typeof t=="string"&&(n=document.querySelector(t)),n}initDefaultOptions(t){const a=Yc({placement:"top",modifiers:[{name:"offset",options:{offset:[0,8]}}],strategy:"absolute",onFirstUpdate:void 0,isShow:!1,theme:"dark",trigger:"hover",disabled:!1},t||{}),s=a.onFirstUpdate;return a.onFirstUpdate=r=>{typeof s=="function"&&(s.call(this,r),this.handleFirstUpdate())},a}handleFirstUpdate(){this.fixOnBoundary&&this.appendToTarget()}getTargetReferenceElement(){return this.isElement(this.reference)?this.reference.childElementCount===1?this.reference.firstElementChild:this.reference:this.reference}initInstance(){var t;this.referenceTarget&&(this.referenceTarget&&this.popperRefer?(this.instance=kd(this.referenceTarget,this.popperRefer,this.instanceOptions),(t=this.popperRefer)==null||t.setAttribute("data-theme",this.instanceOptions.theme??"dark")):console.error("reference or popperRefer is null, please check html element."))}resolveInputSelectorToHtmlElement(t){if(this.isElement(t))return t;if(typeof t=="string")return document.querySelector(t);if(typeof t=="object"){if(Object.prototype.hasOwnProperty.call(t,"getBoundingClientRect"))return t}else console.error("'getBoundingClientRect' is needed when use virtual elements");return null}isElement(t){return An(t)}registerEvents(){if(this.isElement(this.referenceTarget)&&this.trigger==="hover"){const t=["mouseenter","focus"],n=["mouseleave","blur"],a=["mouseenter","mouseleave"];t.forEach(s=>{this.referenceTarget.addEventListener(s,r=>{s==="mouseenter"&&(this.isInnerPopper=!0),this.show(r)})}),n.forEach(s=>{this.referenceTarget.addEventListener(s,()=>{this.isInnerPopper=!1,setTimeout(()=>{!this.isInnerPopper&&this.hide()},this.delay)})}),this.isElement(this.popperRefer)&&a.forEach(s=>{this.popperRefer.addEventListener(s,()=>{s==="mouseenter"&&(this.isInnerPopper=!0),s==="mouseleave"&&this.hide()})})}this.trigger==="click"&&["click"].forEach(n=>{document.body.addEventListener(n,a=>{this.isSameElement(a.target,this.reference)||this.reference.contains(a.target)?this.show(a):this.isShow&&!this.isSameElement(a.target,this.popperRefer)&&!this.popperRefer.contains(a.target)&&this.hide()})})}isSameElement(t,n){return t&&(t===n||t===n.firstElementChild)}}/*!
|
8
8
|
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
9
9
|
*
|
10
10
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
package/lib/shared/index.js
CHANGED
@@ -1266,7 +1266,8 @@ var BkMaskManager = /*#__PURE__*/function () {
|
|
1266
1266
|
if (!div) {
|
1267
1267
|
isExist = false;
|
1268
1268
|
div = this.createMask();
|
1269
|
-
|
1269
|
+
// 选中 sideslider content 中的内容,将光标移动到 mask 处再松开鼠标,此时也会触发 mask 的 click,因此改为 mousedown
|
1270
|
+
div.addEventListener('mousedown', function (e) {
|
1270
1271
|
return _this3.handleMaskClick(e);
|
1271
1272
|
}, true);
|
1272
1273
|
}
|