You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
210 KiB
2 lines
210 KiB
2 years ago
|
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).vant={},e.Vue)}(this,(function(e,t){"use strict";const o=e=>null!=e,n=e=>"function"==typeof e,a=e=>null!==e&&"object"==typeof e,r=e=>a(e)&&n(e.then)&&n(e.catch),l=e=>"[object Date]"===Object.prototype.toString.call(e)&&!Number.isNaN(e.getTime());function i(e){return e=e.replace(/[^-|\d]/g,""),/^((\+86)|(86))?(1)\d{10}$/.test(e)||/^0[0-9-]{10,13}$/.test(e)}const s=e=>"number"==typeof e||/^\d+(\.\d+)?$/.test(e);function c(){}const d=Object.assign,u="undefined"!=typeof window;function p(e,t){const o=t.split(".");let n=e;return o.forEach((e=>{var t;n=a(n)&&null!=(t=n[e])?t:""})),n}function f(e,t,o){return t.reduce(((t,n)=>(o&&void 0===e[n]||(t[n]=e[n]),t)),{})}const m=e=>Array.isArray(e)?e:[e],v=null,h=[Number,String],g={type:Boolean,default:!0},b=e=>({type:e,required:!0}),y=()=>({type:Array,default:()=>[]}),w=e=>({type:Number,default:e}),x=e=>({type:h,default:e}),V=e=>({type:String,default:e});var N="undefined"!=typeof window;function C(e){return N?requestAnimationFrame(e):-1}function k(e){N&&cancelAnimationFrame(e)}function S(e){C((()=>C(e)))}var B=(e,t)=>({top:0,left:0,right:e,bottom:t,width:e,height:t}),T=e=>{const o=t.unref(e);if(o===window){const e=o.innerWidth,t=o.innerHeight;return B(e,t)}return(null==o?void 0:o.getBoundingClientRect)?o.getBoundingClientRect():B(0,0)};function D(e){const o=t.inject(e,null);if(o){const e=t.getCurrentInstance(),{link:n,unlink:a,internalChildren:r}=o;n(e),t.onUnmounted((()=>a(e)));return{parent:o,index:t.computed((()=>r.indexOf(e)))}}return{parent:null,index:t.ref(-1)}}function O(e,o,n){const a=function(e){const o=[],n=e=>{Array.isArray(e)&&e.forEach((e=>{var a;t.isVNode(e)&&(o.push(e),(null==(a=e.component)?void 0:a.subTree)&&(o.push(e.component.subTree),n(e.component.subTree.children)),e.children&&n(e.children))}))};return n(e),o}(e.subTree.children);n.sort(((e,t)=>a.indexOf(e.vnode)-a.indexOf(t.vnode)));const r=n.map((e=>e.proxy));o.sort(((e,t)=>r.indexOf(e)-r.indexOf(t)))}function I(e){const o=t.reactive([]),n=t.reactive([]),a=t.getCurrentInstance();return{children:o,linkChildren:r=>{t.provide(e,Object.assign({link:e=>{e.proxy&&(n.push(e),o.push(e.proxy),O(a,o,n))},unlink:e=>{const t=n.indexOf(e);o.splice(t,1),n.splice(t,1)},children:o,internalChildren:n},r))}}}var P,A,z=1e3,$=6e4,E=36e5,M=24*E;function L(e){let o,n,a,r;const l=t.ref(e.time),i=t.computed((()=>{return{total:e=l.value,days:Math.floor(e/M),hours:Math.floor(e%M/E),minutes:Math.floor(e%E/$),seconds:Math.floor(e%$/z),milliseconds:Math.floor(e%z)};var e})),s=()=>{a=!1,k(o)},c=()=>Math.max(n-Date.now(),0),d=t=>{var o,n;l.value=t,null==(o=e.onChange)||o.call(e,i.value),0===t&&(s(),null==(n=e.onFinish)||n.call(e))},u=()=>{o=C((()=>{a&&(d(c()),l.value>0&&u())}))},p=()=>{o=C((()=>{if(a){const o=c();e=o,t=l.value,(Math.floor(e/1e3)!==Math.floor(t/1e3)||0===o)&&d(o),l.value>0&&p()}var e,t}))},f=()=>{N&&(e.millisecond?u():p())};return t.onBeforeUnmount(s),t.onActivated((()=>{r&&(a=!0,r=!1,f())})),t.onDeactivated((()=>{a&&(s(),r=!0)})),{start:()=>{a||(n=Date.now()+l.value,a=!0,f())},pause:s,reset:(t=e.time)=>{s(),l.value=t},current:i}}function F(e){let o;t.onMounted((()=>{e(),t.nextTick((()=>{o=!0}))})),t.onActivated((()=>{o&&e()}))}function H(e,o,n={}){if(!N)return;const{target:a=window,passive:r=!1,capture:l=!1}=n;let i;const s=n=>{const a=t.unref(n);a&&!i&&(a.addEventListener(e,o,{capture:l,passive:r}),i=!0)},c=n=>{const a=t.unref(n);a&&i&&(a.removeEventListener(e,o,l),i=!1)};t.onUnmounted((()=>c(a))),t.onDeactivated((()=>c(a))),F((()=>s(a))),t.isRef(a)&&t.watch(a,((e,t)=>{c(t),s(e)}))}function R(e,o,n={}){if(!N)return;const{eventName:a="click"}=n;H(a,(n=>{(Array.isArray(e)?e:[e]).every((e=>{const o=t.unref(e);return o&&!o.contains(n.target)}))&&o(n)}),{target:document})}var j,W=/scroll|auto|overlay/i,q=N?window:void 0;function U(e){return"HTML"!==e.tagName&&"BODY"!==e.tagName&&1===e.nodeType}function Y(e,t=q){let o
|