import{d as t,c as e,t as o,v as s,w as i,a as n,x as a,y as d,z as r,o as f,r as l}from"./index-830a56cb.js";const c=""+new URL("loading-9729222e.gif",import.meta.url).href,p="_loading_xbdvm_1",u=t({name:"o-loading",setup:()=>()=>e("div",{"class":p},[e("img",{"class":p,src:c},null)])});function m(t){var e;const o="function"==typeof(s=t)?s():i(s);var s;return null!=(e=null==o?void 0:o.$el)?e:o}const v="undefined"!=typeof window&&"undefined"!=typeof document?window:void 0;function y(t,e,i={}){const{window:l=v,...c}=i;let p;const u=function(t){const e=function(){const t=d(!1);return r()&&f((()=>{t.value=!0})),t}();return n((()=>(e.value,Boolean(t()))))}((()=>l&&"ResizeObserver"in l)),y=()=>{p&&(p.disconnect(),p=void 0)},h=n((()=>Array.isArray(t)?t.map((t=>m(t))):[m(t)])),g=a(h,(t=>{if(y(),u.value&&l){p=new ResizeObserver(e);for(const e of t)e&&p.observe(e,c)}}),{immediate:!0,flush:"post",deep:!0}),S=()=>{y(),g()};var x;return x=S,o()&&s(x),{isSupported:u,stop:S}}const h=t({name:"m-sticky",props:{position:{type:String,"default":"top"},mode:{type:String,"default":"fixed"},offsetTop:{type:String,"default":"0px"},offsetBottom:{"default":"0px"},varName:{type:String,"default":"--header-height"}},emits:["barHeight"],setup(t,{slots:o,emit:s}){const i=l({divStyle:{},heightV:0,sectionStyle:{width:"100%",height:"auto",left:"0"}}),n=d(),r=d();return f((()=>{"top"===t.position?i.divStyle.top=t.offsetTop||"0px":i.divStyle.bottom=t.offsetBottom||"0px";try{y(n.value,(e=>{const o=e[0],{height:n}=o.contentRect;Math.abs(n-i.heightV)>1&&setTimeout((()=>{var e;e=n,i.sectionStyle.height="".concat(e,"px"),i.heightV=e,document.documentElement.style.setProperty(t.varName,"".concat(e,"px")),s("barHeight",e)}),10)}))}catch(e){}})),a((()=>t.offsetTop),(()=>{i.divStyle.top=t.offsetTop})),a((()=>t.offsetBottom),(()=>{i.divStyle.bottom=t.offsetBottom})),()=>e("div",{style:[i.sectionStyle],"class":"sticky"===t.mode&&"_sticky_4d2w6_1"},[e("div",{ref:n,"class":["van-sticky","fixed"===t.mode?"van-sticky--fixed":""],style:[i.divStyle,i.sectionStyle]},[e("div",{ref:r},[o["default"]&&o["default"]()])])])}});export{h as O,u as a};