Comparing version 1.1.7 to 1.1.8
@@ -208,15 +208,21 @@ import { useSSRContext as C } from "vue"; | ||
vconsole: { | ||
js: "https://cdn.bootcdn.net/ajax/libs/vConsole/3.15.1/vconsole.min.js" | ||
js: "https://cdnjs.cloudflare.com//ajax/libs/vConsole/3.15.1/vconsole.min.js" | ||
}, | ||
qrcode: { | ||
js: "https://cdn.bootcdn.net/ajax/libs/qrcode/1.5.1/qrcode.min.js" | ||
js: "https://cdnjs.cloudflare.com//ajax/libs/qrcode/1.5.1/qrcode.min.js" | ||
}, | ||
xlsx: { | ||
js: "https://cdn.bootcdn.net/ajax/libs/xlsx/0.18.5/xlsx.full.min.js" | ||
js: "https://cdnjs.cloudflare.com//ajax/libs/xlsx/0.18.5/xlsx.full.min.js" | ||
}, | ||
dayjs: { | ||
js: "https://cdn.bootcdn.net/ajax/libs/dayjs/1.10.8/dayjs.min.js", | ||
prefix: "https://cdn.bootcdn.net/ajax/libs/dayjs/1.10.8" | ||
js: "https://cdnjs.cloudflare.com//ajax/libs/dayjs/1.10.8/dayjs.min.js", | ||
prefix: "https://cdnjs.cloudflare.com//ajax/libs/dayjs/1.10.8" | ||
}, | ||
jszip: { | ||
js: "https://cdnjs.cloudflare.com//ajax/libs/jszip/3.10.1/jszip.min.js" | ||
}, | ||
highlight: { | ||
js: "https://cdnjs.cloudflare.com//ajax/libs/highlight.js/11.9.0/highlight.min.js" | ||
} | ||
}, L = {}, D = { | ||
}, L = {}, T = { | ||
css(i) { | ||
@@ -263,3 +269,3 @@ const n = document.head.children; | ||
} | ||
}, T = async (i, n, e) => { | ||
}, b = async (i, n, e) => { | ||
const t = J[i]; | ||
@@ -270,6 +276,6 @@ if (!t) { | ||
} | ||
n ? n === "js" ? await D.js(`${t.prefix}${e}`) : n === "css" && await D.css(`${t.prefix}${e}`) : (t.js && await D.js(t.js), t.css && await D.css(t.css)); | ||
n ? n === "js" ? await T.js(`${t.prefix}${e}`) : n === "css" && await T.css(`${t.prefix}${e}`) : (t.js && await T.js(t.js), t.css && await T.css(t.css)); | ||
}, W = async (i) => { | ||
if (typeof window < "u" && window) | ||
return await T("qrcode"), await new Promise((n, e) => { | ||
return await b("qrcode"), await new Promise((n, e) => { | ||
window.QRCode.toDataURL(i, (t, r) => { | ||
@@ -281,3 +287,3 @@ t && (console.error(t), e(t)), n(r); | ||
async import(i) { | ||
await T("xlsx"); | ||
await b("xlsx"); | ||
const n = await new Promise((r) => { | ||
@@ -295,3 +301,3 @@ const a = new window.FileReader(); | ||
async export({ name: i, type: n, data: e }) { | ||
await T("xlsx"); | ||
await b("xlsx"); | ||
const t = "default", r = window.XLSX.utils.aoa_to_sheet(e), a = window.XLSX.utils.book_new(); | ||
@@ -311,3 +317,3 @@ window.XLSX.utils.book_append_sheet(a, r, t), n = n || "xlsx", i = i || "export"; | ||
var _ = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; | ||
function k(i) { | ||
function j(i) { | ||
return i && i.__esModule && Object.prototype.hasOwnProperty.call(i, "default") ? i.default : i; | ||
@@ -339,3 +345,3 @@ } | ||
var K = N.exports; | ||
const V = /* @__PURE__ */ k(K); | ||
const V = /* @__PURE__ */ j(K); | ||
var P = { exports: {} }; | ||
@@ -423,3 +429,3 @@ (function(i, n) { | ||
var tt = P.exports; | ||
const et = /* @__PURE__ */ k(tt); | ||
const et = /* @__PURE__ */ j(tt); | ||
var H = { exports: {} }; | ||
@@ -473,7 +479,7 @@ (function(i, n) { | ||
var m = function(Y, $, O) { | ||
var S = Y - 60 * $ * 1e3, b = l(S, O); | ||
if ($ === b) | ||
var S = Y - 60 * $ * 1e3, k = l(S, O); | ||
if ($ === k) | ||
return [S, $]; | ||
var E = l(S -= 60 * (b - $) * 1e3, O); | ||
return b === E ? [S, b] : [Y - 60 * Math.min(b, E) * 1e3, Math.max(b, E)]; | ||
var E = l(S -= 60 * (k - $) * 1e3, O); | ||
return k === E ? [S, k] : [Y - 60 * Math.min(k, E) * 1e3, Math.max(k, E)]; | ||
}(o.utc(c, s).valueOf(), y, f), v = m[0], z = m[1], g = o(v).utcOffset(z); | ||
@@ -490,3 +496,3 @@ return g.$x.$timezone = f, g; | ||
var nt = H.exports; | ||
const it = /* @__PURE__ */ k(nt); | ||
const it = /* @__PURE__ */ j(nt); | ||
var ot = { exports: {} }; | ||
@@ -553,3 +559,3 @@ (function(i, n) { | ||
var at = A.exports; | ||
const st = /* @__PURE__ */ k(at); | ||
const st = /* @__PURE__ */ j(at); | ||
var X = { exports: {} }; | ||
@@ -569,3 +575,3 @@ (function(i, n) { | ||
var rt = X.exports; | ||
const dt = /* @__PURE__ */ k(rt); | ||
const dt = /* @__PURE__ */ j(rt); | ||
var F = { exports: {} }; | ||
@@ -597,3 +603,3 @@ (function(i, n) { | ||
var lt = F.exports; | ||
const ut = /* @__PURE__ */ k(lt); | ||
const ut = /* @__PURE__ */ j(lt); | ||
var q = { exports: {} }; | ||
@@ -627,3 +633,3 @@ (function(i, n) { | ||
var ct = q.exports; | ||
const ft = /* @__PURE__ */ k(ct); | ||
const ft = /* @__PURE__ */ j(ct); | ||
M.extend(V); | ||
@@ -673,3 +679,3 @@ M.extend(et); | ||
} | ||
const j = new mt(), pt = (i, n, e) => M(i).tz(e || j.timezone).locale(j.language.toLowerCase()).format(n), wt = (i, n) => (n = n || Date.now(), M(n).locale(j.language.toLowerCase()).to(M(i))), gt = { | ||
const D = new mt(), pt = (i, n, e) => M(i).tz(e || D.timezone).locale(D.language.toLowerCase()).format(n), wt = (i, n) => (n = n || Date.now(), M(n).locale(D.language.toLowerCase()).to(M(i))), gt = { | ||
parse: ht, | ||
@@ -689,3 +695,3 @@ format: pt, | ||
if (typeof window < "u" && window) { | ||
await T("vconsole"), new window.VConsole(); | ||
await b("vconsole"), new window.VConsole(); | ||
const i = document.querySelector(".vc-switch"); | ||
@@ -715,3 +721,3 @@ if (i) { | ||
store: Z, | ||
load: T, | ||
load: b, | ||
qrcode: W, | ||
@@ -722,3 +728,3 @@ table: Q, | ||
upload: vt, | ||
personalization: j | ||
personalization: D | ||
}; | ||
@@ -728,4 +734,4 @@ export { | ||
$t as default, | ||
T as load, | ||
j as personalization, | ||
b as load, | ||
D as personalization, | ||
W as qrcode, | ||
@@ -732,0 +738,0 @@ Z as store, |
@@ -1,2 +0,2 @@ | ||
(function(x,T){typeof exports=="object"&&typeof module<"u"?T(exports,require("vue"),require("axios"),require("dayjs")):typeof define=="function"&&define.amd?define(["exports","vue","axios","dayjs"],T):(x=typeof globalThis<"u"?globalThis:x||self,T(x.SumorUx={},x.Vue,x.Axios,x.Dayjs))})(this,function(x,T,V,S){"use strict";const G=i=>{typeof window<"u"&&window&&(window.addEventListener("resize",()=>{i.updateScreen()}),window.addEventListener("load",()=>{i.updateScreen()}),window.addEventListener("popstate",()=>{i.updateScreen()}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",t=>{i.updateScreen()}),i.updateScreen(),setTimeout(()=>{i.updateScreen()},100))},K=({title:i,description:n,keywords:t})=>{const e=(r,a)=>{const o=document.getElementsByTagName("head")[0],u=document.createElement("meta");u.setAttribute("name",r),u.setAttribute("content",a),o.appendChild(u)};document.title=i,document.getElementsByName("description")[0]?document.getElementsByName("description")[0].content=n:e("description",n),document.getElementsByName("keywords")[0]?document.getElementsByName("keywords")[0].content=t:e("keywords",t)},N=async(i,n,t)=>{t=t||{};let e=!1;for(const a in n)n[a]instanceof File&&(e=!0);let r;if(e){r=new FormData;for(const a in n)typeof n[a]=="object"&&!(n[a]instanceof File)&&(n[a]=JSON.stringify(n[a])),r.append(a,n[a])}else r=n;try{return await V({method:"POST",url:i,data:r,headers:{"Content-Type":e?"multipart/form-data":"application/json;charset=utf-8","Accept-Language":t.language?t.language:void 0,"sumor-timezone":t.timezone?t.timezone:void 0}})}catch(a){const o=a.response?a.response.data:{};return{error:!0,code:a.code,message:a.message,...o}}},P=i=>{i=i||{};const n=i.SSR||!1;return{state:()=>({screen:{height:0,width:0,dark:!1,landscape:!1,isIPhone:!1,isIPhoneX:!1,isWechat:!1},personalization:{dark:null,language:null,timezone:null},pageInfo:{title:"",description:"",keywords:""},instance:{},meta:{name:null,api:{},text:{},instance:{}},token:{id:null,user:null,time:null,permission:{},data:{}},_listened:!1}),getters:{dark(t){return t.personalization.dark!==null?t.personalization.dark:t.screen.dark},language(t){return t.personalization.language!==null?t.personalization.language:typeof window<"u"&&window?window.navigator.language:"en"},timezone(t){return t.personalization.timezone!==null?t.personalization.timezone:typeof window<"u"&&window?window.Intl.DateTimeFormat().resolvedOptions().timeZone:"Asia/Shanghai"}},actions:{getSSRData(){let t=null;if(n){const e=T.useSSRContext();t=e.data,delete e.data}return t},setPageInfo({title:t,name:e,keywords:r,desc:a,description:o}){if(this.pageInfo.title=t||e||"",this.pageInfo.description=a||o||"",this.pageInfo.keywords=r||"",n){const u=T.useSSRContext();u.pageInfo={title:this.pageInfo.title,description:this.pageInfo.description,keywords:this.pageInfo.keywords}}else K(this.pageInfo)},updateScreen(){if(typeof window<"u"&&window){const t=window.matchMedia("(prefers-color-scheme: dark)").matches,e={height:window.innerHeight,width:window.innerWidth,dark:t,landscape:window.innerHeight<=window.innerWidth},r=e.landscape?e.width:e.height;e.isIPhone=/iphone/gi.test(window.navigator.userAgent),e.isIPhoneX=e.isIPhone&&r>=812,e.isWechat=/micromessenger/gi.test(window.navigator.userAgent),this.screen=Object.assign({},this.screen,e)}},updatePersonalization(t,e){if(typeof window<"u"&&window){const r=window.localStorage.getItem("personalization");r!==JSON.stringify(this.personalization)&&(this.personalization=JSON.parse(r)||{},["dark","language","timezone"].forEach(o=>{this.personalization[o]===void 0&&(this.personalization[o]=null)}),window.sumorPersonalization=JSON.parse(r))}if(t&&(e===void 0&&(e=null),this.personalization=Object.assign({},this.personalization),this.personalization[t]=e),typeof window<"u"&&window){const r=JSON.stringify(this.personalization),a=window.localStorage.getItem("personalization");r!==a&&(window.sumorPersonalization=JSON.parse(JSON.stringify(this.personalization)),window.localStorage.setItem("personalization",JSON.stringify(this.personalization)))}},async call(t,e){if(n)throw new Error("Forbidden to call API in SSR mode, which will cause performance and other issues. Please use SSRContext mode to load data");const a=await N(t,e,{});if(a.error)return a;{let o=a.headers["sumor-instance"]||"";return o=o.split("_"),this.instance={version:o[0],server:o[1],port:o[2],time:o[3]},a.data}},async updateMeta(t){if(!this.meta.name||t){const e=await N("/sumor/meta");Object.assign(this.meta,e.data.data)}},async updateToken(){const t=await this.call("/sumor/token");Object.assign(this.token,t.data)},async logout(){await this.call("/sumor/logout"),await this.updateToken()},form(t){const e=this.call;class r{constructor(){this.pending=!1,this.data={}}async call(o){o=Object.assign({},this.data,o),this.pending=!0;const u=await e(t,o);if(this.pending=!1,u.error)throw u;return u.data}}return new r},listen(){this._listened||(this._listened=!0,G(this),this._listenTimer=setInterval(()=>{this.updatePersonalization()},100))},stop(){this._listened=!1,clearInterval(this._listenTimer)}}}},ee={vconsole:{js:"https://cdn.bootcdn.net/ajax/libs/vConsole/3.15.1/vconsole.min.js"},qrcode:{js:"https://cdn.bootcdn.net/ajax/libs/qrcode/1.5.1/qrcode.min.js"},xlsx:{js:"https://cdn.bootcdn.net/ajax/libs/xlsx/0.18.5/xlsx.full.min.js"},dayjs:{js:"https://cdn.bootcdn.net/ajax/libs/dayjs/1.10.8/dayjs.min.js",prefix:"https://cdn.bootcdn.net/ajax/libs/dayjs/1.10.8"}},L={},C={css(i){const n=document.head.children;let t=!1;for(const e in n)n[e].tagName==="LINK"&&n[e].href===i&&(t=!0);if(!t){const e=document.getElementsByTagName("head")[0],r=document.createElement("link");r.type="text/css",r.rel="stylesheet",r.href=i,e.appendChild(r)}},async js(i){if(L[i])await new Promise(n=>{L[i].push(()=>{n()})});else{const n=document.head.children;let t=!1;for(const e in n)n[e].tagName==="SCRIPT"&&n[e].src===i&&(t=!0);if(!t){L[i]=[],await new Promise(e=>{const r=document.getElementsByTagName("head")[0],a=document.createElement("script");a.src=i,a.type="text/javascript",a.addEventListener?a.addEventListener("load",function(){e()},!1):a.attachEvent&&a.attachEvent("onreadystatechange",function(){window.event.srcElement.readyState==="loaded"&&e()}),r.appendChild(a)});for(let e=0;e<L[i].length;e++)L[i][e]();delete L[i]}}}},D=async(i,n,t)=>{const e=ee[i];if(!e){console.error(`Resource ${i} not found`);return}n?n==="js"?await C.js(`${e.prefix}${t}`):n==="css"&&await C.css(`${e.prefix}${t}`):(e.js&&await C.js(e.js),e.css&&await C.css(e.css))},H=async i=>{if(typeof window<"u"&&window)return await D("qrcode"),await new Promise((n,t)=>{window.QRCode.toDataURL(i,(e,r)=>{e&&(console.error(e),t(e)),n(r)})})},q={async import(i){await D("xlsx");const n=await new Promise(r=>{const a=new window.FileReader;a.readAsArrayBuffer(i),a.onload=()=>{const o=window.XLSX.read(a.result,{type:"array"});r(o)}}),t=n.Props.SheetNames[0],e=n.Sheets[t];return window.XLSX.utils.sheet_to_json(e)},async export({name:i,type:n,data:t}){await D("xlsx");const e="default",r=window.XLSX.utils.aoa_to_sheet(t),a=window.XLSX.utils.book_new();window.XLSX.utils.book_append_sheet(a,r,e),n=n||"xlsx",i=i||"export";const o=`${i}.${n}`;return window.XLSX.writeFile(a,o)}},A=async i=>{if(navigator&&navigator.clipboard&&navigator.permissions)await navigator.clipboard.writeText(i);else{const n=document.createElement("textArea");n.value=i,n.style.width=0,n.style.position="fixed",n.style.left="-999px",n.style.top="10px",n.setAttribute("readonly","readonly"),document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n)}};var _=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function k(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var X={exports:{}};(function(i,n){(function(t,e){i.exports=e()})(_,function(){var t={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(e,r,a){var o=r.prototype,u=o.format;a.en.formats=t,o.format=function(d){d===void 0&&(d="YYYY-MM-DDTHH:mm:ssZ");var l=this.$locale().formats,h=function(z,c){return z.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(p,w,s){var f=s&&s.toUpperCase();return w||c[s]||t[s]||c[f].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(y,m,v){return m||v.slice(1)})})}(d,l===void 0?{}:l);return u.call(this,h)}}})})(X);var te=X.exports;const ne=k(te);var F={exports:{}};(function(i,n){(function(t,e){i.exports=e()})(_,function(){var t="minute",e=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g;return function(a,o,u){var d=o.prototype;u.utc=function(s){var f={date:s,utc:!0,args:arguments};return new o(f)},d.utc=function(s){var f=u(this.toDate(),{locale:this.$L,utc:!0});return s?f.add(this.utcOffset(),t):f},d.local=function(){return u(this.toDate(),{locale:this.$L,utc:!1})};var l=d.parse;d.parse=function(s){s.utc&&(this.$u=!0),this.$utils().u(s.$offset)||(this.$offset=s.$offset),l.call(this,s)};var h=d.init;d.init=function(){if(this.$u){var s=this.$d;this.$y=s.getUTCFullYear(),this.$M=s.getUTCMonth(),this.$D=s.getUTCDate(),this.$W=s.getUTCDay(),this.$H=s.getUTCHours(),this.$m=s.getUTCMinutes(),this.$s=s.getUTCSeconds(),this.$ms=s.getUTCMilliseconds()}else h.call(this)};var z=d.utcOffset;d.utcOffset=function(s,f){var y=this.$utils().u;if(y(s))return this.$u?0:y(this.$offset)?z.call(this):this.$offset;if(typeof s=="string"&&(s=function(g){g===void 0&&(g="");var $=g.match(e);if(!$)return null;var M=(""+$[0]).match(r)||["-",0,0],O=M[0],b=60*+M[1]+ +M[2];return b===0?0:O==="+"?b:-b}(s),s===null))return this;var m=Math.abs(s)<=16?60*s:s,v=this;if(f)return v.$offset=m,v.$u=s===0,v;if(s!==0){var Y=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(v=this.local().add(m+Y,t)).$offset=m,v.$x.$localOffset=Y}else v=this.utc();return v};var c=d.format;d.format=function(s){var f=s||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return c.call(this,f)},d.valueOf=function(){var s=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*s},d.isUTC=function(){return!!this.$u},d.toISOString=function(){return this.toDate().toISOString()},d.toString=function(){return this.toDate().toUTCString()};var p=d.toDate;d.toDate=function(s){return s==="s"&&this.$offset?u(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():p.call(this)};var w=d.diff;d.diff=function(s,f,y){if(s&&this.$u===s.$u)return w.call(this,s,f,y);var m=this.local(),v=u(s).local();return w.call(m,v,f,y)}}})})(F);var ie=F.exports;const oe=k(ie);var U={exports:{}};(function(i,n){(function(t,e){i.exports=e()})(_,function(){var t={year:0,month:1,day:2,hour:3,minute:4,second:5},e={};return function(r,a,o){var u,d=function(c,p,w){w===void 0&&(w={});var s=new Date(c),f=function(y,m){m===void 0&&(m={});var v=m.timeZoneName||"short",Y=y+"|"+v,g=e[Y];return g||(g=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:y,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:v}),e[Y]=g),g}(p,w);return f.formatToParts(s)},l=function(c,p){for(var w=d(c,p),s=[],f=0;f<w.length;f+=1){var y=w[f],m=y.type,v=y.value,Y=t[m];Y>=0&&(s[Y]=parseInt(v,10))}var g=s[3],$=g===24?0:g,M=s[0]+"-"+s[1]+"-"+s[2]+" "+$+":"+s[4]+":"+s[5]+":000",O=+c;return(o.utc(M).valueOf()-(O-=O%1e3))/6e4},h=a.prototype;h.tz=function(c,p){c===void 0&&(c=u);var w=this.utcOffset(),s=this.toDate(),f=s.toLocaleString("en-US",{timeZone:c}),y=Math.round((s-new Date(f))/1e3/60),m=o(f,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(15*-Math.round(s.getTimezoneOffset()/15)-y,!0);if(p){var v=m.utcOffset();m=m.add(w-v,"minute")}return m.$x.$timezone=c,m},h.offsetName=function(c){var p=this.$x.$timezone||o.tz.guess(),w=d(this.valueOf(),p,{timeZoneName:c}).find(function(s){return s.type.toLowerCase()==="timezonename"});return w&&w.value};var z=h.startOf;h.startOf=function(c,p){if(!this.$x||!this.$x.$timezone)return z.call(this,c,p);var w=o(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return z.call(w,c,p).tz(this.$x.$timezone,!0)},o.tz=function(c,p,w){var s=w&&p,f=w||p||u,y=l(+o(),f);if(typeof c!="string")return o(c).tz(f);var m=function($,M,O){var b=$-60*M*1e3,E=l(b,O);if(M===E)return[b,M];var I=l(b-=60*(E-M)*1e3,O);return E===I?[b,E]:[$-60*Math.min(E,I)*1e3,Math.max(E,I)]}(o.utc(c,s).valueOf(),y,f),v=m[0],Y=m[1],g=o(v).utcOffset(Y);return g.$x.$timezone=f,g},o.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},o.tz.setDefault=function(c){u=c}}})})(U);var ae=U.exports;const se=k(ae);var re={exports:{}};(function(i,n){(function(t,e){i.exports=e(S)})(_,function(t){function e(o){return o&&typeof o=="object"&&"default"in o?o:{default:o}}var r=e(t),a={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(o,u){return u==="W"?o+"周":o+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(o,u){var d=100*o+u;return d<600?"凌晨":d<900?"早上":d<1100?"上午":d<1300?"中午":d<1800?"下午":"晚上"}};return r.default.locale(a,null,!0),a})})(re);var R={exports:{}};(function(i,n){(function(t,e){i.exports=e()})(_,function(){return function(t,e,r){t=t||{};var a=e.prototype,o={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function u(l,h,z,c){return a.fromToBase(l,h,z,c)}r.en.relativeTime=o,a.fromToBase=function(l,h,z,c,p){for(var w,s,f,y=z.$locale().relativeTime||o,m=t.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],v=m.length,Y=0;Y<v;Y+=1){var g=m[Y];g.d&&(w=c?r(l).diff(z,g.d,!0):z.diff(l,g.d,!0));var $=(t.rounding||Math.round)(Math.abs(w));if(f=w>0,$<=g.r||!g.r){$<=1&&Y>0&&(g=m[Y-1]);var M=y[g.l];p&&($=p(""+$)),s=typeof M=="string"?M.replace("%d",$):M($,h,g.l,f);break}}if(h)return s;var O=f?y.future:y.past;return typeof O=="function"?O(s):O.replace("%s",s)},a.to=function(l,h){return u(l,h,this,!0)},a.from=function(l,h){return u(l,h,this)};var d=function(l){return l.$u?r.utc():r()};a.toNow=function(l){return this.to(d(this),l)},a.fromNow=function(l){return this.from(d(this),l)}}})})(R);var de=R.exports;const le=k(de);var B={exports:{}};(function(i,n){(function(t,e){i.exports=e()})(_,function(){return function(t,e,r){e.prototype.dayOfYear=function(a){var o=Math.round((r(this).startOf("day")-r(this).startOf("year"))/864e5)+1;return a==null?o:this.add(a-o,"day")}}})})(B);var ue=B.exports;const ce=k(ue);var Z={exports:{}};(function(i,n){(function(t,e){i.exports=e()})(_,function(){var t="week",e="year";return function(r,a,o){var u=a.prototype;u.week=function(d){if(d===void 0&&(d=null),d!==null)return this.add(7*(d-this.week()),"day");var l=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var h=o(this).startOf(e).add(1,e).date(l),z=o(this).endOf(t);if(h.isBefore(z))return 1}var c=o(this).startOf(e).date(l).startOf(t).subtract(1,"millisecond"),p=this.diff(c,t,!0);return p<0?o(this).startOf("week").week():Math.ceil(p)},u.weeks=function(d){return d===void 0&&(d=null),this.week(d)}}})})(Z);var fe=Z.exports;const he=k(fe);var J={exports:{}};(function(i,n){(function(t,e){i.exports=e()})(_,function(){var t="month",e="quarter";return function(r,a){var o=a.prototype;o.quarter=function(l){return this.$utils().u(l)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(l-1))};var u=o.add;o.add=function(l,h){return l=Number(l),this.$utils().p(h)===e?this.add(3*l,t):u.bind(this)(l,h)};var d=o.startOf;o.startOf=function(l,h){var z=this.$utils(),c=!!z.u(h)||h;if(z.p(l)===e){var p=this.quarter()-1;return c?this.month(3*p).startOf(t).startOf("day"):this.month(3*p+2).endOf(t).endOf("day")}return d.bind(this)(l,h)}}})})(J);var me=J.exports;const pe=k(me);S.extend(ne),S.extend(oe),S.extend(se),S.extend(le),S.extend(ce),S.extend(he),S.extend(pe);const we=i=>{const n=S(i);return{year:n.year(),month:n.month()+1,date:n.date(),hour:n.hour(),minute:n.minute(),second:n.second(),weekday:n.day()+1,yearday:n.dayOfYear(),week:n.week(),quarter:n.quarter()}};class ge{constructor(){if(typeof window<"u"&&window){const n=window.localStorage.getItem("personalization")||"{}";this.personalization=JSON.parse(n),["dark","language","timezone"].forEach(e=>{this.personalization[e]===void 0&&(this.personalization[e]=null)})}}get dark(){if(this.personalization.dark!==null)return this.personalization.dark;if(typeof window<"u"&&window)return window.matchMedia("(prefers-color-scheme: dark)").matches}get language(){return this.personalization.language!==null?this.personalization.language:navigator.language}get timezone(){return this.personalization.timezone!==null?this.personalization.timezone:Intl.DateTimeFormat().resolvedOptions().timeZone}}const j=new ge,W={parse:we,format:(i,n,t)=>S(i).tz(t||j.timezone).locale(j.language.toLowerCase()).format(n),timeTo:(i,n)=>(n=n||Date.now(),S(n).locale(j.language.toLowerCase()).to(S(i)))};async function Q(i){return await new Promise(n=>{const t=document.createElement("input");t.type="file",t.name="file",i&&(t.multiple="multiple"),t.addEventListener("change",function(e){n(i?e.target.files:e.target.files[0])}),t.value="",t.click()})}const ve=async()=>{if(typeof window<"u"&&window){await D("vconsole"),new window.VConsole;const i=document.querySelector(".vc-switch");if(i){i.innerText="开发控制台",i.style.right="20px",i.style.bottom="20px";let n=0,t=0,e=!1;i.addEventListener("mousedown",a=>{n=a.offsetX,t=a.offsetY,e=!0}),document.addEventListener("mousemove",a=>{e&&(i.style.right=`${window.innerWidth-a.clientX-n}px`,i.style.bottom=`${window.innerHeight-a.clientY-t}px`),i.style.cursor=e?"move":"pointer"}),document.addEventListener("mouseup",()=>{e=!1});const r=document.createElement("style");r.type="text/css",r.innerHTML=`.vc-switch { | ||
(function(x,L){typeof exports=="object"&&typeof module<"u"?L(exports,require("vue"),require("axios"),require("dayjs")):typeof define=="function"&&define.amd?define(["exports","vue","axios","dayjs"],L):(x=typeof globalThis<"u"?globalThis:x||self,L(x.SumorUx={},x.Vue,x.Axios,x.Dayjs))})(this,function(x,L,V,S){"use strict";const G=i=>{typeof window<"u"&&window&&(window.addEventListener("resize",()=>{i.updateScreen()}),window.addEventListener("load",()=>{i.updateScreen()}),window.addEventListener("popstate",()=>{i.updateScreen()}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",t=>{i.updateScreen()}),i.updateScreen(),setTimeout(()=>{i.updateScreen()},100))},K=({title:i,description:n,keywords:t})=>{const e=(r,a)=>{const o=document.getElementsByTagName("head")[0],u=document.createElement("meta");u.setAttribute("name",r),u.setAttribute("content",a),o.appendChild(u)};document.title=i,document.getElementsByName("description")[0]?document.getElementsByName("description")[0].content=n:e("description",n),document.getElementsByName("keywords")[0]?document.getElementsByName("keywords")[0].content=t:e("keywords",t)},N=async(i,n,t)=>{t=t||{};let e=!1;for(const a in n)n[a]instanceof File&&(e=!0);let r;if(e){r=new FormData;for(const a in n)typeof n[a]=="object"&&!(n[a]instanceof File)&&(n[a]=JSON.stringify(n[a])),r.append(a,n[a])}else r=n;try{return await V({method:"POST",url:i,data:r,headers:{"Content-Type":e?"multipart/form-data":"application/json;charset=utf-8","Accept-Language":t.language?t.language:void 0,"sumor-timezone":t.timezone?t.timezone:void 0}})}catch(a){const o=a.response?a.response.data:{};return{error:!0,code:a.code,message:a.message,...o}}},P=i=>{i=i||{};const n=i.SSR||!1;return{state:()=>({screen:{height:0,width:0,dark:!1,landscape:!1,isIPhone:!1,isIPhoneX:!1,isWechat:!1},personalization:{dark:null,language:null,timezone:null},pageInfo:{title:"",description:"",keywords:""},instance:{},meta:{name:null,api:{},text:{},instance:{}},token:{id:null,user:null,time:null,permission:{},data:{}},_listened:!1}),getters:{dark(t){return t.personalization.dark!==null?t.personalization.dark:t.screen.dark},language(t){return t.personalization.language!==null?t.personalization.language:typeof window<"u"&&window?window.navigator.language:"en"},timezone(t){return t.personalization.timezone!==null?t.personalization.timezone:typeof window<"u"&&window?window.Intl.DateTimeFormat().resolvedOptions().timeZone:"Asia/Shanghai"}},actions:{getSSRData(){let t=null;if(n){const e=L.useSSRContext();t=e.data,delete e.data}return t},setPageInfo({title:t,name:e,keywords:r,desc:a,description:o}){if(this.pageInfo.title=t||e||"",this.pageInfo.description=a||o||"",this.pageInfo.keywords=r||"",n){const u=L.useSSRContext();u.pageInfo={title:this.pageInfo.title,description:this.pageInfo.description,keywords:this.pageInfo.keywords}}else K(this.pageInfo)},updateScreen(){if(typeof window<"u"&&window){const t=window.matchMedia("(prefers-color-scheme: dark)").matches,e={height:window.innerHeight,width:window.innerWidth,dark:t,landscape:window.innerHeight<=window.innerWidth},r=e.landscape?e.width:e.height;e.isIPhone=/iphone/gi.test(window.navigator.userAgent),e.isIPhoneX=e.isIPhone&&r>=812,e.isWechat=/micromessenger/gi.test(window.navigator.userAgent),this.screen=Object.assign({},this.screen,e)}},updatePersonalization(t,e){if(typeof window<"u"&&window){const r=window.localStorage.getItem("personalization");r!==JSON.stringify(this.personalization)&&(this.personalization=JSON.parse(r)||{},["dark","language","timezone"].forEach(o=>{this.personalization[o]===void 0&&(this.personalization[o]=null)}),window.sumorPersonalization=JSON.parse(r))}if(t&&(e===void 0&&(e=null),this.personalization=Object.assign({},this.personalization),this.personalization[t]=e),typeof window<"u"&&window){const r=JSON.stringify(this.personalization),a=window.localStorage.getItem("personalization");r!==a&&(window.sumorPersonalization=JSON.parse(JSON.stringify(this.personalization)),window.localStorage.setItem("personalization",JSON.stringify(this.personalization)))}},async call(t,e){if(n)throw new Error("Forbidden to call API in SSR mode, which will cause performance and other issues. Please use SSRContext mode to load data");const a=await N(t,e,{});if(a.error)return a;{let o=a.headers["sumor-instance"]||"";return o=o.split("_"),this.instance={version:o[0],server:o[1],port:o[2],time:o[3]},a.data}},async updateMeta(t){if(!this.meta.name||t){const e=await N("/sumor/meta");Object.assign(this.meta,e.data.data)}},async updateToken(){const t=await this.call("/sumor/token");Object.assign(this.token,t.data)},async logout(){await this.call("/sumor/logout"),await this.updateToken()},form(t){const e=this.call;class r{constructor(){this.pending=!1,this.data={}}async call(o){o=Object.assign({},this.data,o),this.pending=!0;const u=await e(t,o);if(this.pending=!1,u.error)throw u;return u.data}}return new r},listen(){this._listened||(this._listened=!0,G(this),this._listenTimer=setInterval(()=>{this.updatePersonalization()},100))},stop(){this._listened=!1,clearInterval(this._listenTimer)}}}},ee={vconsole:{js:"https://cdnjs.cloudflare.com//ajax/libs/vConsole/3.15.1/vconsole.min.js"},qrcode:{js:"https://cdnjs.cloudflare.com//ajax/libs/qrcode/1.5.1/qrcode.min.js"},xlsx:{js:"https://cdnjs.cloudflare.com//ajax/libs/xlsx/0.18.5/xlsx.full.min.js"},dayjs:{js:"https://cdnjs.cloudflare.com//ajax/libs/dayjs/1.10.8/dayjs.min.js",prefix:"https://cdnjs.cloudflare.com//ajax/libs/dayjs/1.10.8"},jszip:{js:"https://cdnjs.cloudflare.com//ajax/libs/jszip/3.10.1/jszip.min.js"},highlight:{js:"https://cdnjs.cloudflare.com//ajax/libs/highlight.js/11.9.0/highlight.min.js"}},b={},C={css(i){const n=document.head.children;let t=!1;for(const e in n)n[e].tagName==="LINK"&&n[e].href===i&&(t=!0);if(!t){const e=document.getElementsByTagName("head")[0],r=document.createElement("link");r.type="text/css",r.rel="stylesheet",r.href=i,e.appendChild(r)}},async js(i){if(b[i])await new Promise(n=>{b[i].push(()=>{n()})});else{const n=document.head.children;let t=!1;for(const e in n)n[e].tagName==="SCRIPT"&&n[e].src===i&&(t=!0);if(!t){b[i]=[],await new Promise(e=>{const r=document.getElementsByTagName("head")[0],a=document.createElement("script");a.src=i,a.type="text/javascript",a.addEventListener?a.addEventListener("load",function(){e()},!1):a.attachEvent&&a.attachEvent("onreadystatechange",function(){window.event.srcElement.readyState==="loaded"&&e()}),r.appendChild(a)});for(let e=0;e<b[i].length;e++)b[i][e]();delete b[i]}}}},j=async(i,n,t)=>{const e=ee[i];if(!e){console.error(`Resource ${i} not found`);return}n?n==="js"?await C.js(`${e.prefix}${t}`):n==="css"&&await C.css(`${e.prefix}${t}`):(e.js&&await C.js(e.js),e.css&&await C.css(e.css))},H=async i=>{if(typeof window<"u"&&window)return await j("qrcode"),await new Promise((n,t)=>{window.QRCode.toDataURL(i,(e,r)=>{e&&(console.error(e),t(e)),n(r)})})},q={async import(i){await j("xlsx");const n=await new Promise(r=>{const a=new window.FileReader;a.readAsArrayBuffer(i),a.onload=()=>{const o=window.XLSX.read(a.result,{type:"array"});r(o)}}),t=n.Props.SheetNames[0],e=n.Sheets[t];return window.XLSX.utils.sheet_to_json(e)},async export({name:i,type:n,data:t}){await j("xlsx");const e="default",r=window.XLSX.utils.aoa_to_sheet(t),a=window.XLSX.utils.book_new();window.XLSX.utils.book_append_sheet(a,r,e),n=n||"xlsx",i=i||"export";const o=`${i}.${n}`;return window.XLSX.writeFile(a,o)}},A=async i=>{if(navigator&&navigator.clipboard&&navigator.permissions)await navigator.clipboard.writeText(i);else{const n=document.createElement("textArea");n.value=i,n.style.width=0,n.style.position="fixed",n.style.left="-999px",n.style.top="10px",n.setAttribute("readonly","readonly"),document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n)}};var _=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function T(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var X={exports:{}};(function(i,n){(function(t,e){i.exports=e()})(_,function(){var t={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(e,r,a){var o=r.prototype,u=o.format;a.en.formats=t,o.format=function(d){d===void 0&&(d="YYYY-MM-DDTHH:mm:ssZ");var l=this.$locale().formats,h=function(z,c){return z.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(p,w,s){var f=s&&s.toUpperCase();return w||c[s]||t[s]||c[f].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(y,m,v){return m||v.slice(1)})})}(d,l===void 0?{}:l);return u.call(this,h)}}})})(X);var te=X.exports;const ne=T(te);var F={exports:{}};(function(i,n){(function(t,e){i.exports=e()})(_,function(){var t="minute",e=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g;return function(a,o,u){var d=o.prototype;u.utc=function(s){var f={date:s,utc:!0,args:arguments};return new o(f)},d.utc=function(s){var f=u(this.toDate(),{locale:this.$L,utc:!0});return s?f.add(this.utcOffset(),t):f},d.local=function(){return u(this.toDate(),{locale:this.$L,utc:!1})};var l=d.parse;d.parse=function(s){s.utc&&(this.$u=!0),this.$utils().u(s.$offset)||(this.$offset=s.$offset),l.call(this,s)};var h=d.init;d.init=function(){if(this.$u){var s=this.$d;this.$y=s.getUTCFullYear(),this.$M=s.getUTCMonth(),this.$D=s.getUTCDate(),this.$W=s.getUTCDay(),this.$H=s.getUTCHours(),this.$m=s.getUTCMinutes(),this.$s=s.getUTCSeconds(),this.$ms=s.getUTCMilliseconds()}else h.call(this)};var z=d.utcOffset;d.utcOffset=function(s,f){var y=this.$utils().u;if(y(s))return this.$u?0:y(this.$offset)?z.call(this):this.$offset;if(typeof s=="string"&&(s=function(g){g===void 0&&(g="");var $=g.match(e);if(!$)return null;var M=(""+$[0]).match(r)||["-",0,0],O=M[0],k=60*+M[1]+ +M[2];return k===0?0:O==="+"?k:-k}(s),s===null))return this;var m=Math.abs(s)<=16?60*s:s,v=this;if(f)return v.$offset=m,v.$u=s===0,v;if(s!==0){var Y=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(v=this.local().add(m+Y,t)).$offset=m,v.$x.$localOffset=Y}else v=this.utc();return v};var c=d.format;d.format=function(s){var f=s||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return c.call(this,f)},d.valueOf=function(){var s=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*s},d.isUTC=function(){return!!this.$u},d.toISOString=function(){return this.toDate().toISOString()},d.toString=function(){return this.toDate().toUTCString()};var p=d.toDate;d.toDate=function(s){return s==="s"&&this.$offset?u(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():p.call(this)};var w=d.diff;d.diff=function(s,f,y){if(s&&this.$u===s.$u)return w.call(this,s,f,y);var m=this.local(),v=u(s).local();return w.call(m,v,f,y)}}})})(F);var ie=F.exports;const oe=T(ie);var U={exports:{}};(function(i,n){(function(t,e){i.exports=e()})(_,function(){var t={year:0,month:1,day:2,hour:3,minute:4,second:5},e={};return function(r,a,o){var u,d=function(c,p,w){w===void 0&&(w={});var s=new Date(c),f=function(y,m){m===void 0&&(m={});var v=m.timeZoneName||"short",Y=y+"|"+v,g=e[Y];return g||(g=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:y,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:v}),e[Y]=g),g}(p,w);return f.formatToParts(s)},l=function(c,p){for(var w=d(c,p),s=[],f=0;f<w.length;f+=1){var y=w[f],m=y.type,v=y.value,Y=t[m];Y>=0&&(s[Y]=parseInt(v,10))}var g=s[3],$=g===24?0:g,M=s[0]+"-"+s[1]+"-"+s[2]+" "+$+":"+s[4]+":"+s[5]+":000",O=+c;return(o.utc(M).valueOf()-(O-=O%1e3))/6e4},h=a.prototype;h.tz=function(c,p){c===void 0&&(c=u);var w=this.utcOffset(),s=this.toDate(),f=s.toLocaleString("en-US",{timeZone:c}),y=Math.round((s-new Date(f))/1e3/60),m=o(f,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(15*-Math.round(s.getTimezoneOffset()/15)-y,!0);if(p){var v=m.utcOffset();m=m.add(w-v,"minute")}return m.$x.$timezone=c,m},h.offsetName=function(c){var p=this.$x.$timezone||o.tz.guess(),w=d(this.valueOf(),p,{timeZoneName:c}).find(function(s){return s.type.toLowerCase()==="timezonename"});return w&&w.value};var z=h.startOf;h.startOf=function(c,p){if(!this.$x||!this.$x.$timezone)return z.call(this,c,p);var w=o(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return z.call(w,c,p).tz(this.$x.$timezone,!0)},o.tz=function(c,p,w){var s=w&&p,f=w||p||u,y=l(+o(),f);if(typeof c!="string")return o(c).tz(f);var m=function($,M,O){var k=$-60*M*1e3,D=l(k,O);if(M===D)return[k,M];var I=l(k-=60*(D-M)*1e3,O);return D===I?[k,D]:[$-60*Math.min(D,I)*1e3,Math.max(D,I)]}(o.utc(c,s).valueOf(),y,f),v=m[0],Y=m[1],g=o(v).utcOffset(Y);return g.$x.$timezone=f,g},o.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},o.tz.setDefault=function(c){u=c}}})})(U);var ae=U.exports;const se=T(ae);var re={exports:{}};(function(i,n){(function(t,e){i.exports=e(S)})(_,function(t){function e(o){return o&&typeof o=="object"&&"default"in o?o:{default:o}}var r=e(t),a={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(o,u){return u==="W"?o+"周":o+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(o,u){var d=100*o+u;return d<600?"凌晨":d<900?"早上":d<1100?"上午":d<1300?"中午":d<1800?"下午":"晚上"}};return r.default.locale(a,null,!0),a})})(re);var R={exports:{}};(function(i,n){(function(t,e){i.exports=e()})(_,function(){return function(t,e,r){t=t||{};var a=e.prototype,o={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function u(l,h,z,c){return a.fromToBase(l,h,z,c)}r.en.relativeTime=o,a.fromToBase=function(l,h,z,c,p){for(var w,s,f,y=z.$locale().relativeTime||o,m=t.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],v=m.length,Y=0;Y<v;Y+=1){var g=m[Y];g.d&&(w=c?r(l).diff(z,g.d,!0):z.diff(l,g.d,!0));var $=(t.rounding||Math.round)(Math.abs(w));if(f=w>0,$<=g.r||!g.r){$<=1&&Y>0&&(g=m[Y-1]);var M=y[g.l];p&&($=p(""+$)),s=typeof M=="string"?M.replace("%d",$):M($,h,g.l,f);break}}if(h)return s;var O=f?y.future:y.past;return typeof O=="function"?O(s):O.replace("%s",s)},a.to=function(l,h){return u(l,h,this,!0)},a.from=function(l,h){return u(l,h,this)};var d=function(l){return l.$u?r.utc():r()};a.toNow=function(l){return this.to(d(this),l)},a.fromNow=function(l){return this.from(d(this),l)}}})})(R);var de=R.exports;const le=T(de);var B={exports:{}};(function(i,n){(function(t,e){i.exports=e()})(_,function(){return function(t,e,r){e.prototype.dayOfYear=function(a){var o=Math.round((r(this).startOf("day")-r(this).startOf("year"))/864e5)+1;return a==null?o:this.add(a-o,"day")}}})})(B);var ue=B.exports;const ce=T(ue);var Z={exports:{}};(function(i,n){(function(t,e){i.exports=e()})(_,function(){var t="week",e="year";return function(r,a,o){var u=a.prototype;u.week=function(d){if(d===void 0&&(d=null),d!==null)return this.add(7*(d-this.week()),"day");var l=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var h=o(this).startOf(e).add(1,e).date(l),z=o(this).endOf(t);if(h.isBefore(z))return 1}var c=o(this).startOf(e).date(l).startOf(t).subtract(1,"millisecond"),p=this.diff(c,t,!0);return p<0?o(this).startOf("week").week():Math.ceil(p)},u.weeks=function(d){return d===void 0&&(d=null),this.week(d)}}})})(Z);var fe=Z.exports;const he=T(fe);var J={exports:{}};(function(i,n){(function(t,e){i.exports=e()})(_,function(){var t="month",e="quarter";return function(r,a){var o=a.prototype;o.quarter=function(l){return this.$utils().u(l)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(l-1))};var u=o.add;o.add=function(l,h){return l=Number(l),this.$utils().p(h)===e?this.add(3*l,t):u.bind(this)(l,h)};var d=o.startOf;o.startOf=function(l,h){var z=this.$utils(),c=!!z.u(h)||h;if(z.p(l)===e){var p=this.quarter()-1;return c?this.month(3*p).startOf(t).startOf("day"):this.month(3*p+2).endOf(t).endOf("day")}return d.bind(this)(l,h)}}})})(J);var me=J.exports;const pe=T(me);S.extend(ne),S.extend(oe),S.extend(se),S.extend(le),S.extend(ce),S.extend(he),S.extend(pe);const we=i=>{const n=S(i);return{year:n.year(),month:n.month()+1,date:n.date(),hour:n.hour(),minute:n.minute(),second:n.second(),weekday:n.day()+1,yearday:n.dayOfYear(),week:n.week(),quarter:n.quarter()}};class ge{constructor(){if(typeof window<"u"&&window){const n=window.localStorage.getItem("personalization")||"{}";this.personalization=JSON.parse(n),["dark","language","timezone"].forEach(e=>{this.personalization[e]===void 0&&(this.personalization[e]=null)})}}get dark(){if(this.personalization.dark!==null)return this.personalization.dark;if(typeof window<"u"&&window)return window.matchMedia("(prefers-color-scheme: dark)").matches}get language(){return this.personalization.language!==null?this.personalization.language:navigator.language}get timezone(){return this.personalization.timezone!==null?this.personalization.timezone:Intl.DateTimeFormat().resolvedOptions().timeZone}}const E=new ge,W={parse:we,format:(i,n,t)=>S(i).tz(t||E.timezone).locale(E.language.toLowerCase()).format(n),timeTo:(i,n)=>(n=n||Date.now(),S(n).locale(E.language.toLowerCase()).to(S(i)))};async function Q(i){return await new Promise(n=>{const t=document.createElement("input");t.type="file",t.name="file",i&&(t.multiple="multiple"),t.addEventListener("change",function(e){n(i?e.target.files:e.target.files[0])}),t.value="",t.click()})}const ve=async()=>{if(typeof window<"u"&&window){await j("vconsole"),new window.VConsole;const i=document.querySelector(".vc-switch");if(i){i.innerText="开发控制台",i.style.right="20px",i.style.bottom="20px";let n=0,t=0,e=!1;i.addEventListener("mousedown",a=>{n=a.offsetX,t=a.offsetY,e=!0}),document.addEventListener("mousemove",a=>{e&&(i.style.right=`${window.innerWidth-a.clientX-n}px`,i.style.bottom=`${window.innerHeight-a.clientY-t}px`),i.style.cursor=e?"move":"pointer"}),document.addEventListener("mouseup",()=>{e=!1});const r=document.createElement("style");r.type="text/css",r.innerHTML=`.vc-switch { | ||
background: #5374fa; | ||
@@ -6,3 +6,3 @@ border-radius: 2px; | ||
cursor: pointer; | ||
}`,document.head.appendChild(r)}}};typeof window<"u"&&window&&window.location.href.indexOf("debug=true")>-1&&ve();const ye={store:P,load:D,qrcode:H,table:q,copy:A,time:W,upload:Q,personalization:j};x.copy=A,x.default=ye,x.load=D,x.personalization=j,x.qrcode=H,x.store=P,x.table=q,x.time=W,x.upload=Q,Object.defineProperties(x,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}); | ||
}`,document.head.appendChild(r)}}};typeof window<"u"&&window&&window.location.href.indexOf("debug=true")>-1&&ve();const ye={store:P,load:j,qrcode:H,table:q,copy:A,time:W,upload:Q,personalization:E};x.copy=A,x.default=ye,x.load=j,x.personalization=E,x.qrcode=H,x.store=P,x.table=q,x.time=W,x.upload=Q,Object.defineProperties(x,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}); | ||
//# sourceMappingURL=index.umd.js.map |
{ | ||
"name": "@sumor/ux", | ||
"description": "Sumor Cloud UI Library", | ||
"version": "1.1.7", | ||
"version": "1.1.8", | ||
"license": "MIT", | ||
@@ -68,4 +68,4 @@ "repository": "sumor-cloud/ux", | ||
"prepare": "husky", | ||
"check": "eslint --fix . && prettier --write . && npm audit fix --force && npm run coverage" | ||
"check": "npm run autofix && npm run coverage" | ||
} | ||
} |
@@ -23,3 +23,3 @@ # ux | ||
Require Node.JS version 16.x or above | ||
Require Node.JS version 18.x or above | ||
@@ -26,0 +26,0 @@ ### require Node.JS ES module |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
174934
1147