import{r as U,w as K,c as ge,d as we,y as be,ay as Oe,ar as xe,f as Ee,a as D,Q as Se,h as Re,ae as Pe,F as ke,m as F,ab as De,n as Ae,t as X,a5 as Le,z as Ce,aG as oe,aH as je,ac as Me,I as Te,aI as Ie,k as Ne}from"./index-521a9826.js";const Be=(e,t)=>{const r=U(e());return K(e,n=>{n!==r.value&&(r.value=n)}),K(r,n=>{n!==e()&&t(n)}),r};function S(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function te(e){var t=S(e).Element;return e instanceof t||e instanceof Element}function E(e){var t=S(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function ue(e){if(typeof ShadowRoot>"u")return!1;var t=S(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}var B=Math.round;function Z(){var e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function qe(){return!/^((?!chrome|android).)*safari/i.test(Z())}function z(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!1);var n=e.getBoundingClientRect(),o=1,a=1;t&&E(e)&&(o=e.offsetWidth>0&&B(n.width)/e.offsetWidth||1,a=e.offsetHeight>0&&B(n.height)/e.offsetHeight||1);var f=te(e)?S(e):window,c=f.visualViewport,i=!qe()&&r,u=(n.left+(i&&c?c.offsetLeft:0))/o,s=(n.top+(i&&c?c.offsetTop:0))/a,v=n.width/o,x=n.height/a;return{width:v,height:x,top:s,right:u+v,bottom:s+x,left:u,x:u,y:s}}function pe(e){var t=S(e),r=t.pageXOffset,n=t.pageYOffset;return{scrollLeft:r,scrollTop:n}}function We(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function Ve(e){return e===S(e)||!E(e)?pe(e):We(e)}function P(e){return e?(e.nodeName||"").toLowerCase():null}function J(e){return((te(e)?e.ownerDocument:e.document)||window.document).documentElement}function He(e){return z(J(e)).left+pe(e).scrollLeft}function k(e){return S(e).getComputedStyle(e)}function re(e){var t=k(e),r=t.overflow,n=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+o+n)}function Fe(e){var t=e.getBoundingClientRect(),r=B(t.width)/e.offsetWidth||1,n=B(t.height)/e.offsetHeight||1;return r!==1||n!==1}function Xe(e,t,r){r===void 0&&(r=!1);var n=E(t),o=E(t)&&Fe(t),a=J(t),f=z(e,o,r),c={scrollLeft:0,scrollTop:0},i={x:0,y:0};return(n||!n&&!r)&&((P(t)!=="body"||re(a))&&(c=Ve(t)),E(t)?(i=z(t,!0),i.x+=t.clientLeft,i.y+=t.clientTop):a&&(i.x=He(a))),{x:f.left+c.scrollLeft-i.x,y:f.top+c.scrollTop-i.y,width:f.width,height:f.height}}function Ye(e){var t=z(e),r=e.offsetWidth,n=e.offsetHeight;return Math.abs(t.width-r)<=1&&(r=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:r,height:n}}function ne(e){return P(e)==="html"?e:e.assignedSlot||e.parentNode||(ue(e)?e.host:null)||J(e)}function ve(e){return["html","body","#document"].indexOf(P(e))>=0?e.ownerDocument.body:E(e)&&re(e)?e:ve(ne(e))}function $(e,t){var r;t===void 0&&(t=[]);var n=ve(e),o=n===((r=e.ownerDocument)==null?void 0:r.body),a=S(n),f=o?[a].concat(a.visualViewport||[],re(n)?n:[]):n,c=t.concat(f);return o?c:c.concat($(ne(f)))}function Ue(e){return["table","td","th"].indexOf(P(e))>=0}function ae(e){return!E(e)||k(e).position==="fixed"?null:e.offsetParent}function $e(e){var t=/firefox/i.test(Z()),r=/Trident/i.test(Z());if(r&&E(e)){var n=k(e);if(n.position==="fixed")return null}var o=ne(e);for(ue(o)&&(o=o.host);E(o)&&["html","body"].indexOf(P(o))<0;){var a=k(o);if(a.transform!=="none"||a.perspective!=="none"||a.contain==="paint"||["transform","perspective"].indexOf(a.willChange)!==-1||t&&a.willChange==="filter"||t&&a.filter&&a.filter!=="none")return o;o=o.parentNode}return null}function de(e){for(var t=S(e),r=ae(e);r&&Ue(r)&&k(r).position==="static";)r=ae(r);return r&&(P(r)==="html"||P(r)==="body"&&k(r).position==="static")?t:r||$e(e)||t}var N="top",_="bottom",H="right",M="left",he="auto",ze=[N,_,H,M],me="start",G="end",_e=[].concat(ze,[he]).reduce(function(e,t){return e.concat([t,t+"-"+me,t+"-"+G])},[]),Ge="beforeRead",Je="read",Qe="afterRead",Ke="beforeMain",Ze="main",et="afterMain",tt="beforeWrite",rt="write",nt="afterWrite",ee=[Ge,Je,Qe,Ke,Ze,et,tt,rt,nt];function ot(e){var t=new Map,r=new Set,n=[];e.forEach(function(a){t.set(a.name,a)});function o(a){r.add(a.name);var f=[].concat(a.requires||[],a.requiresIfExists||[]);f.forEach(function(c){if(!r.has(c)){var i=t.get(c);i&&o(i)}}),n.push(a)}return e.forEach(function(a){r.has(a.name)||o(a)}),n}function at(e){var t=ot(e);return ee.reduce(function(r,n){return r.concat(t.filter(function(o){return o.phase===n}))},[])}function it(e){var t;return function(){return t||(t=new Promise(function(r){Promise.resolve().then(function(){t=void 0,r(e())})})),t}}function A(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n=0?"x":"y"}function pt(e){var t=e.reference,r=e.element,n=e.placement,o=n?Q(n):null,a=n?ye(n):null,f=t.x+t.width/2-r.width/2,c=t.y+t.height/2-r.height/2,i;switch(o){case N:i={x:f,y:t.y-r.height};break;case _:i={x:f,y:t.y+t.height};break;case H:i={x:t.x+t.width,y:c};break;case M:i={x:t.x-r.width,y:c};break;default:i={x:t.x,y:t.y}}var u=o?ut(o):null;if(u!=null){var s=u==="y"?"height":"width";switch(a){case me:i[u]=i[u]-(t[s]/2-r[s]/2);break;case G:i[u]=i[u]+(t[s]/2-r[s]/2);break}}return i}var se="Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.",vt="Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.",ce={placement:"bottom",modifiers:[],strategy:"absolute"};function fe(){for(var e=arguments.length,t=new Array(e),r=0;r100){console.error(vt);break}if(s.reset===!0){s.reset=!1,m=-1;continue}var p=s.orderedModifiers[m],R=p.fn,L=p.options,q=L===void 0?{}:L,W=p.name;typeof R=="function"&&(s=R({state:s,options:q,name:W,instance:d})||s)}}},update:it(function(){return new Promise(function(y){d.forceUpdate(),y(s)})}),destroy:function(){g(),x=!0}};if(!fe(c,i))return console.error(se),d;d.setOptions(u).then(function(y){!x&&u.onFirstUpdate&&u.onFirstUpdate(y)});function T(){s.orderedModifiers.forEach(function(y){var w=y.name,l=y.options,h=l===void 0?{}:l,b=y.effect;if(typeof b=="function"){var m=b({state:s,name:w,instance:d,options:h}),p=function(){};v.push(m||p)}})}function g(){v.forEach(function(y){return y()}),v=[]}return d}}var Y={passive:!0};function ht(e){var t=e.state,r=e.instance,n=e.options,o=n.scroll,a=o===void 0?!0:o,f=n.resize,c=f===void 0?!0:f,i=S(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&u.forEach(function(s){s.addEventListener("scroll",r.update,Y)}),c&&i.addEventListener("resize",r.update,Y),function(){a&&u.forEach(function(s){s.removeEventListener("scroll",r.update,Y)}),c&&i.removeEventListener("resize",r.update,Y)}}var mt={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:ht,data:{}};function yt(e){var t=e.state,r=e.name;t.modifiersData[r]=pt({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}var gt={name:"popperOffsets",enabled:!0,phase:"read",fn:yt,data:{}},wt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function bt(e){var t=e.x,r=e.y,n=window,o=n.devicePixelRatio||1;return{x:B(t*o)/o||0,y:B(r*o)/o||0}}function le(e){var t,r=e.popper,n=e.popperRect,o=e.placement,a=e.variation,f=e.offsets,c=e.position,i=e.gpuAcceleration,u=e.adaptive,s=e.roundOffsets,v=e.isFixed,x=f.x,d=x===void 0?0:x,T=f.y,g=T===void 0?0:T,y=typeof s=="function"?s({x:d,y:g}):{x:d,y:g};d=y.x,g=y.y;var w=f.hasOwnProperty("x"),l=f.hasOwnProperty("y"),h=M,b=N,m=window;if(u){var p=de(r),R="clientHeight",L="clientWidth";if(p===S(r)&&(p=J(r),k(p).position!=="static"&&c==="absolute"&&(R="scrollHeight",L="scrollWidth")),p=p,o===N||(o===M||o===H)&&a===G){b=_;var q=v&&p===m&&m.visualViewport?m.visualViewport.height:p[R];g-=q-n.height,g*=i?1:-1}if(o===M||(o===N||o===_)&&a===G){h=H;var W=v&&p===m&&m.visualViewport?m.visualViewport.width:p[L];d-=W-n.width,d*=i?1:-1}}var O=Object.assign({position:c},u&&wt),I=s===!0?bt({x:d,y:g}):{x:d,y:g};if(d=I.x,g=I.y,i){var V;return Object.assign({},O,(V={},V[b]=l?"0":"",V[h]=w?"0":"",V.transform=(m.devicePixelRatio||1)<=1?"translate("+d+"px, "+g+"px)":"translate3d("+d+"px, "+g+"px, 0)",V))}return Object.assign({},O,(t={},t[b]=l?g+"px":"",t[h]=w?d+"px":"",t.transform="",t))}function Ot(e){var t=e.state,r=e.options,n=r.gpuAcceleration,o=n===void 0?!0:n,a=r.adaptive,f=a===void 0?!0:a,c=r.roundOffsets,i=c===void 0?!0:c;{var u=k(t.elements.popper).transitionProperty||"";f&&["transform","top","right","bottom","left"].some(function(v){return u.indexOf(v)>=0})&&console.warn(["Popper: Detected CSS transitions on at least one of the following",'CSS properties: "transform", "top", "right", "bottom", "left".',` `,'Disable the "computeStyles" modifier\'s `adaptive` option to allow',"for smooth transitions, or remove these properties from the CSS","transition declaration on the popper element if only transitioning","opacity or background-color for example.",` `,"We recommend using the popper element as a wrapper around an inner","element that can have any CSS property transitioned for animations."].join(" "))}var s={placement:Q(t.placement),variation:ye(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,le(Object.assign({},s,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:f,roundOffsets:i})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,le(Object.assign({},s,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:i})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}var xt={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Ot,data:{}};function Et(e){var t=e.state;Object.keys(t.elements).forEach(function(r){var n=t.styles[r]||{},o=t.attributes[r]||{},a=t.elements[r];!E(a)||!P(a)||(Object.assign(a.style,n),Object.keys(o).forEach(function(f){var c=o[f];c===!1?a.removeAttribute(f):a.setAttribute(f,c===!0?"":c)}))})}function St(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow),function(){Object.keys(t.elements).forEach(function(n){var o=t.elements[n],a=t.attributes[n]||{},f=Object.keys(t.styles.hasOwnProperty(n)?t.styles[n]:r[n]),c=f.reduce(function(i,u){return i[u]="",i},{});!E(o)||!P(o)||(Object.assign(o.style,c),Object.keys(a).forEach(function(i){o.removeAttribute(i)}))})}}var Rt={name:"applyStyles",enabled:!0,phase:"write",fn:Et,effect:St,requires:["computeStyles"]},Pt=[mt,gt,xt,Rt],kt=dt({defaultModifiers:Pt});function Dt(e,t,r){var n=Q(e),o=[M,N].indexOf(n)>=0?-1:1,a=typeof r=="function"?r(Object.assign({},t,{placement:e})):r,f=a[0],c=a[1];return f=f||0,c=(c||0)*o,[M,H].indexOf(n)>=0?{x:c,y:f}:{x:f,y:c}}function At(e){var t=e.state,r=e.options,n=e.name,o=r.offset,a=o===void 0?[0,0]:o,f=_e.reduce(function(s,v){return s[v]=Dt(v,t.rects,a),s},{}),c=f[t.placement],i=c.x,u=c.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=i,t.modifiersData.popperOffsets.y+=u),t.modifiersData[n]=f}var Lt={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:At};const[Ct,j]=ge("popover"),jt=["overlay","duration","teleport","overlayStyle","overlayClass","closeOnClickOverlay"],Mt={show:Boolean,theme:F("light"),overlay:Boolean,actions:De(),actionsDirection:F("vertical"),trigger:F("click"),duration:Ae,showArrow:X,placement:F("bottom"),iconPrefix:String,overlayClass:Le,overlayStyle:Object,closeOnClickAction:X,closeOnClickOverlay:X,closeOnClickOutside:X,offset:{type:Array,default:()=>[0,8]},teleport:{type:[String,Object],default:"body"}};var Tt=we({name:Ct,props:Mt,emits:["select","touchstart","update:show"],setup(e,{emit:t,slots:r,attrs:n}){let o;const a=U(),f=U(),c=U(),i=Be(()=>e.show,l=>t("update:show",l)),u=()=>({placement:e.placement,modifiers:[{name:"computeStyles",options:{adaptive:!1,gpuAcceleration:!1}},Me({},Lt,{options:{offset:e.offset}})]}),s=()=>f.value&&c.value?kt(f.value,c.value.popupRef.value,u()):null,v=()=>{Ce(()=>{i.value&&(o?o.setOptions(u()):(o=s(),oe&&(window.addEventListener("animationend",v),window.addEventListener("transitionend",v))))})},x=l=>{i.value=l},d=()=>{e.trigger==="click"&&(i.value=!i.value)},T=(l,h)=>{l.disabled||(t("select",l,h),e.closeOnClickAction&&(i.value=!1))},g=()=>{i.value&&e.closeOnClickOutside&&(!e.overlay||e.closeOnClickOverlay)&&(i.value=!1)},y=(l,h)=>r.action?r.action({action:l,index:h}):[l.icon&&D(Te,{name:l.icon,classPrefix:e.iconPrefix,class:j("action-icon")},null),D("div",{class:[j("action-text"),{[Ie]:e.actionsDirection==="vertical"}]},[l.text])],w=(l,h)=>{const{icon:b,color:m,disabled:p,className:R}=l;return D("div",{role:"menuitem",class:[j("action",{disabled:p,"with-icon":b}),{[je]:e.actionsDirection==="horizontal"},R],style:{color:m},tabindex:p?void 0:0,"aria-disabled":p||void 0,onClick:()=>T(l,h)},[y(l,h)])};return be(()=>{v(),Oe(()=>{var l;a.value=(l=c.value)==null?void 0:l.popupRef.value})}),xe(()=>{o&&(oe&&(window.removeEventListener("animationend",v),window.removeEventListener("transitionend",v)),o.destroy(),o=null)}),K(()=>[i.value,e.offset,e.placement],v),Ee([f,a],g,{eventName:"touchstart"}),()=>{var l;return D(ke,null,[D("span",{ref:f,class:j("wrapper"),onClick:d},[(l=r.reference)==null?void 0:l.call(r)]),D(Se,Re({ref:c,show:i.value,class:j([e.theme]),position:"",transition:"van-popover-zoom",lockScroll:!1,"onUpdate:show":x},n,Pe(e,jt)),{default:()=>[e.showArrow&&D("div",{class:j("arrow")},null),D("div",{role:"menu",class:j("content",e.actionsDirection)},[r.default?r.default():e.actions.map(w)])]})])}}});const Nt=Ne(Tt);export{Nt as P};