Files
appco_dist/.output/public/_nuxt/yM3z5qW0.js
T
2025-08-27 20:20:03 +03:30

2 lines
3.8 KiB
JavaScript

import{aX as S,aY as I,af as _,k as x,r as w,K as P,aZ as L,dt as $,bm as D,a0 as R,o as Y,ad as M,dk as z,I as k,bA as V,d as A,C as p,du as W}from"./BAjARngS.js";import{m as b,t as j,b as v,c as y,h as m,d as C,j as F,w as B}from"./QwKuTeKk.js";var E=typeof window<"u";function de(e){const n=S(e,null);if(n){const t=I(),{link:r,unlink:a,internalChildren:c}=n;r(t),_(()=>a(t));const d=x(()=>c.indexOf(t));return{parent:n,index:d}}return{parent:null,index:w(-1)}}function H(e){const n=[],t=r=>{Array.isArray(r)&&r.forEach(a=>{var c;V(a)&&(n.push(a),(c=a.component)!=null&&c.subTree&&(n.push(a.component.subTree),t(a.component.subTree.children)),a.children&&t(a.children))})};return t(e),n}var O=(e,n)=>{const t=e.indexOf(n);return t===-1?e.findIndex(r=>n.key!==void 0&&n.key!==null&&r.type===n.type&&r.key===n.key):t};function K(e,n,t){const r=H(e.subTree.children);t.sort((c,d)=>O(r,c.vnode)-O(r,d.vnode));const a=t.map(c=>c.proxy);n.sort((c,d)=>{const o=a.indexOf(c),s=a.indexOf(d);return o-s})}function ue(e){const n=P([]),t=P([]),r=I();return{children:n,linkChildren:c=>{L(e,Object.assign({link:s=>{s.proxy&&(t.push(s),n.push(s.proxy),K(r,n,t))},unlink:s=>{const i=t.indexOf(s);n.splice(i,1),t.splice(i,1)},children:n,internalChildren:t},c))}}}function Z(e){let n;Y(()=>{e(),M(()=>{n=!0})}),z(()=>{n&&e()})}function le(e,n,t={}){if(!E)return;const{target:r=window,passive:a=!1,capture:c=!1}=t;let d=!1,o;const s=u=>{if(d)return;const l=k(u);l&&!o&&(l.addEventListener(e,n,{capture:c,passive:a}),o=!0)},i=u=>{if(d)return;const l=k(u);l&&o&&(l.removeEventListener(e,n,c),o=!1)};_(()=>i(r)),$(()=>i(r)),Z(()=>s(r));let f;return D(r)&&(f=R(r,(u,l)=>{i(l),s(u)})),()=>{f?.(),i(r),d=!0}}var g,h;function fe(){if(!g&&(g=w(0),h=w(0),E)){const e=()=>{g.value=window.innerWidth,h.value=window.innerHeight};e(),window.addEventListener("resize",e,{passive:!0}),window.addEventListener("orientationchange",e,{passive:!0})}return{width:g,height:h}}var U=/scroll|auto|overlay/i,X=E?window:void 0;function G(e){return e.tagName!=="HTML"&&e.tagName!=="BODY"&&e.nodeType===1}function me(e,n=X){let t=e;for(;t&&t!==n&&G(t);){const{overflowY:r}=window.getComputedStyle(t);if(U.test(r))return t;t=t.parentNode}return n}const ge="van-hairline",pe="van-haptics-feedback",ve=5,[q,T]=y("badge"),J={dot:Boolean,max:v,tag:b("div"),color:String,offset:Array,content:v,showZero:j,position:b("top-right")};var Q=A({name:q,props:J,setup(e,{slots:n}){const t=()=>{if(n.content)return!0;const{content:o,showZero:s}=e;return C(o)&&o!==""&&(s||o!==0&&o!=="0")},r=()=>{const{dot:o,max:s,content:i}=e;if(!o&&t())return n.content?n.content():C(s)&&F(i)&&+i>+s?`${s}+`:i},a=o=>o.startsWith("-")?o.replace("-",""):`-${o}`,c=x(()=>{const o={background:e.color};if(e.offset){const[s,i]=e.offset,{position:f}=e,[u,l]=f.split("-");n.default?(typeof i=="number"?o[u]=m(u==="top"?i:-i):o[u]=u==="top"?m(i):a(i),typeof s=="number"?o[l]=m(l==="left"?s:-s):o[l]=l==="left"?m(s):a(s)):(o.marginTop=m(i),o.marginLeft=m(s))}return o}),d=()=>{if(t()||e.dot)return p("div",{class:T([e.position,{dot:e.dot,fixed:!!n.default}]),style:c.value},[r()])};return()=>{if(n.default){const{tag:o}=e;return p(o,{class:T("wrapper")},{default:()=>[n.default(),d()]})}return d()}}});const ee=B(Q),[ne,he]=y("config-provider"),te=Symbol(ne),[oe,N]=y("icon"),re=e=>e?.includes("/"),se={dot:Boolean,tag:b("i"),name:String,size:v,badge:v,color:String,badgeProps:Object,classPrefix:String};var ae=A({name:oe,props:se,setup(e,{slots:n}){const t=S(te,null),r=x(()=>e.classPrefix||t?.iconPrefix||N());return()=>{const{tag:a,dot:c,name:d,size:o,badge:s,color:i}=e,f=re(d);return p(ee,W({dot:c,tag:a,class:[r.value,f?"":`${r.value}-${d}`],style:{color:i,fontSize:m(o)},content:s},e.badgeProps),{default:()=>{var u;return[(u=n.default)==null?void 0:u.call(n),f&&p("img",{class:N("image"),src:d},null)]}})}}});const we=B(ae);export{ge as B,pe as H,we as I,ve as T,le as a,ue as b,de as c,me as g,Z as o,fe as u};