s-uploader.43OLueNE.js 116 KB

1
  1. import{aB as e,bv as t,bw as s,bx as n,by as i,bz as r,bA as o,as as a,V as c,bB as l,bC as u,bD as h,bE as d,H as p,T as f,a0 as g,bF as m,bG as y,aY as _,aT as T,bl as w,X as v,bk as x,bH as b,bI as k,bJ as I,bK as S,aC as P,a$ as A,s as O,aU as L,e as C,d as E,w as F,x as U,F as R,y as D,n as N,f as M,N as B,z as q,al as $,k as j,i as K,L as V,g as H,j as J,bL as W,aW as z,l as Q,O as Y}from"./index-DNuNVpwk.js";import{_ as G}from"./_plugin-vue_export-helper.BCo6x5W8.js";const X={easycom:{autoscan:!0,custom:{"^s-(.*)":"@/sheep/components/s-$1/s-$1.vue","^su-(.*)":"@/sheep/ui/su-$1/su-$1.vue"}},pages:[{path:"pages/index/FirstIndex",aliasPath:"/",style:{navigationBarTitleText:"常来此购商城",enablePullDownRefresh:!0},meta:{auth:!1,sync:!0,title:"首页",group:"商城"}},{path:"pages/index/FirstActivity",style:{navigationBarTitleText:"活动",enablePullDownRefresh:!0},meta:{auth:!1,sync:!0,title:"活动",group:"商城"}},{path:"pages/index/FirstMerchant",style:{navigationBarTitleText:"商家",enablePullDownRefresh:!0},meta:{auth:!1,sync:!0,title:"视频",group:"商城"}},{path:"pages/index/FirstVideo",style:{navigationBarTitleText:"视频",enablePullDownRefresh:!0},meta:{auth:!1,sync:!0,title:"视频",group:"商城"}},{path:"pages/index/FirstList",style:{navigationBarTitleText:"列表",enablePullDownRefresh:!0},meta:{auth:!1,sync:!0,title:"列表",group:"商城"}},{path:"pages/index/index",style:{navigationBarTitleText:"常来此购商城",enablePullDownRefresh:!0},meta:{auth:!1,sync:!0,title:"首页",group:"商城"}},{path:"pages/index/user",style:{navigationBarTitleText:"个人中心",enablePullDownRefresh:!0},meta:{sync:!0,title:"个人中心",group:"商城"}},{path:"pages/index/category",style:{navigationBarTitleText:"商品分类"},meta:{sync:!0,title:"商品分类",group:"商城"}},{path:"pages/index/cart",style:{navigationBarTitleText:"购物车"},meta:{sync:!0,title:"购物车",group:"商城"}},{path:"pages/index/login"},{path:"pages/index/search",style:{navigationBarTitleText:"搜索"},meta:{sync:!0,title:"搜索",group:"商城"}},{path:"pages/index/page",style:{navigationBarTitleText:""},meta:{auth:!1,sync:!0,title:"自定义页面",group:"商城"}}],subPackages:[{root:"pages/goods",pages:[{path:"index",style:{navigationBarTitleText:"商品详情"},meta:{sync:!0,title:"普通商品",group:"商品"}},{path:"groupon",style:{navigationBarTitleText:"拼团商品"},meta:{sync:!0,title:"拼团商品",group:"商品"}},{path:"seckill",style:{navigationBarTitleText:"秒杀商品"},meta:{sync:!0,title:"秒杀商品",group:"商品"}},{path:"list",style:{navigationBarTitleText:"商品列表"},meta:{sync:!0,title:"商品列表",group:"商品"}},{path:"comment/add",style:{navigationBarTitleText:"评价商品"},meta:{auth:!0}},{path:"comment/list",style:{navigationBarTitleText:"商品评价"}}]},{root:"pages/order",pages:[{path:"detail",style:{navigationBarTitleText:"订单详情"},meta:{auth:!0,title:"订单详情"}},{path:"confirm",style:{navigationBarTitleText:"确认订单"},meta:{auth:!0,title:"确认订单"}},{path:"list",style:{navigationBarTitleText:"我的订单",enablePullDownRefresh:!0},meta:{auth:!0,sync:!0,title:"用户订单",group:"订单中心"}},{path:"aftersale/apply",style:{navigationBarTitleText:"申请售后"},meta:{auth:!0,title:"申请售后"}},{path:"aftersale/return-delivery",style:{navigationBarTitleText:"退货物流"},meta:{auth:!0,title:"退货物流"}},{path:"aftersale/list",style:{navigationBarTitleText:"售后列表"},meta:{auth:!0,sync:!0,title:"售后订单",group:"订单中心"}},{path:"aftersale/detail",style:{navigationBarTitleText:"售后详情"},meta:{auth:!0,title:"售后详情"}},{path:"aftersale/log",style:{navigationBarTitleText:"售后进度"},meta:{auth:!0,title:"售后进度"}},{path:"express/log",style:{navigationBarTitleText:"物流轨迹"},meta:{auth:!0,title:"物流轨迹"}},{path:"otherlist",style:{navigationBarTitleText:"",enablePullDownRefresh:!1}}]},{root:"pages/user",pages:[{path:"info",style:{navigationBarTitleText:"用户信息"},meta:{auth:!0,sync:!0,title:"用户信息",group:"用户中心"}},{path:"setting",style:{navigationBarTitleText:"用户设置"},meta:{auth:!0,sync:!0,title:"用户设置",group:"用户中心"}},{path:"qrcode-share",style:{navigationBarTitleText:"我的二维码/分享页"},meta:{auth:!0,sync:!0,title:"我的二维码/分享页",group:"用户中心"}},{path:"goods-collect",style:{navigationBarTitleText:"我的收藏"},meta:{auth:!0,sync:!0,title:"商品收藏",group:"用户中心"}},{path:"goods-log",style:{navigationBarTitleText:"我的足迹"},meta:{auth:!0,sync:!0,title:"浏览记录",group:"用户中心"}},{path:"address/list",style:{navigationBarTitleText:"实体商品收货地址"},meta:{auth:!0,sync:!0,title:"地址管理",group:"用户中心"}},{path:"dummyAddress/list",style:{navigationBarTitleText:"虚拟商品收货地址"},meta:{auth:!0,sync:!0,title:"虚拟商品收货地址",group:"用户中心"}},{path:"invoice/edit",style:{navigationBarTitleText:"发票抬头编辑"},meta:{auth:!0,title:"发票抬头"}},{path:"invoice/list",style:{navigationBarTitleText:"发票抬头管理"},meta:{auth:!0,sync:!0,title:"发票抬头管理",group:"用户中心"}},{path:"address/edit",style:{navigationBarTitleText:"编辑地址"},meta:{auth:!0,title:"编辑地址"}},{path:"dummyAddress/edit",style:{navigationBarTitleText:"编辑地址"},meta:{auth:!0,title:"编辑地址"}},{path:"wallet/money",style:{navigationBarTitleText:"我的余额"},meta:{auth:!0,sync:!0,title:"用户余额",group:"用户中心"}},{path:"wallet/score",style:{navigationBarTitleText:"钱包"},meta:{auth:!0,sync:!0,title:"钱包",group:"用户中心"}},{path:"wallet/consumptionLog",style:{navigationBarTitleText:"消费分来源"},meta:{auth:!0,sync:!0,title:"消费分来源",group:"用户中心"}},{path:"wallet/topupConsumptionPoints",style:{navigationBarTitleText:"消费分充值"},meta:{auth:!0,sync:!0,title:"消费分充值",group:"用户中心"}},{path:"wallet/consumptionTransfersLog",style:{navigationBarTitleText:"消费分转账"},meta:{auth:!0,sync:!0,title:"消费分转账",group:"用户中心"}},{path:"wallet/consumptionTransfers",style:{navigationBarTitleText:"消费分转让"},meta:{auth:!0,sync:!0,title:"消费分转让",group:"用户中心"}},{path:"wallet/scoreToConsumption",style:{navigationBarTitleText:"佣金转消费分"},meta:{auth:!0,sync:!0,title:"佣金转消费分",group:"用户中心"}},{path:"wallet/withdraw",style:{navigationBarTitleText:"提现"},meta:{auth:!0,sync:!0,title:"提现",group:"提现"}},{path:"wallet/withdrawalLog",style:{navigationBarTitleText:"提现记录"},meta:{auth:!0,sync:!0,title:"提现记录",group:"提现记录"}},{path:"wallet/scoreToMoney",style:{navigationBarTitleText:"佣金兑换"},meta:{auth:!0,sync:!0,title:"佣金兑换",group:"用户中心"}},{path:"wallet/ScoreLog"},{path:"wallet/maxScoreLog"},{path:"wallet/team",style:{navigationBarTitleText:"团队"},meta:{auth:!0,sync:!0,title:"团队",group:"用户中心"}}]},{root:"pages/commission",pages:[{path:"index",style:{navigationBarTitleText:"分销"},meta:{auth:!0,sync:!0,title:"分销中心",group:"分销商城"}},{path:"wallet",style:{navigationBarTitleText:"我的佣金"},meta:{auth:!0,sync:!0,title:"用户佣金",group:"分销中心"}},{path:"goods",style:{navigationBarTitleText:"推广商品"},meta:{auth:!0,sync:!0,title:"推广商品",group:"分销商城"}},{path:"order",style:{navigationBarTitleText:"分销订单"},meta:{auth:!0,sync:!0,title:"分销订单",group:"分销商城"}},{path:"team",style:{navigationBarTitleText:"我的团队"},meta:{auth:!0,sync:!0,title:"我的团队",group:"分销商城"}},{path:"promoter",style:{navigationBarTitleText:"推广人排行榜"},meta:{auth:!0,sync:!0,title:"推广人排行榜",group:"分销商城"}},{path:"commission-ranking",style:{navigationBarTitleText:"佣金排行榜"},meta:{auth:!0,sync:!0,title:"佣金排行榜",group:"分销商城"}},{path:"withdraw",style:{navigationBarTitleText:"申请提现"},meta:{auth:!0,sync:!0,title:"申请提现",group:"分销商城"}}]},{root:"pages/app",pages:[{path:"sign",style:{navigationBarTitleText:"签到中心"},meta:{auth:!0,sync:!0,title:"签到中心",group:"应用"}}]},{root:"pages/shop",pages:[{path:"index",style:{navigationBarTitleText:"店铺首页"},meta:{auth:!0,sync:!0,title:"店铺首页",group:"应用"}},{path:"category",style:{navigationBarTitleText:"店铺分类"},meta:{auth:!0,sync:!0,title:"店铺分类",group:"应用"}},{path:"allproduct",style:{navigationBarTitleText:"所有商品"},meta:{auth:!0,sync:!0,title:"所有商品",group:"应用"}}]},{root:"pages/public",pages:[{path:"setting",style:{navigationBarTitleText:"系统设置"},meta:{sync:!0,title:"系统设置",group:"通用"}},{path:"richtext",style:{navigationBarTitleText:"富文本"},meta:{sync:!0,title:"富文本",group:"通用"}},{path:"faq",style:{navigationBarTitleText:"常见问题"},meta:{sync:!0,title:"常见问题",group:"通用"}},{path:"error",style:{navigationBarTitleText:"错误页面"}},{path:"webview",style:{navigationBarTitleText:""}},{path:"merchant",style:{navigationBarTitleText:"",enablePullDownRefresh:!1}},{path:"merchantApplyList",style:{navigationBarTitleText:"",enablePullDownRefresh:!1}}]},{root:"pages/coupon",pages:[{path:"list",style:{navigationBarTitleText:"领券中心"},meta:{sync:!0,title:"领券中心",group:"优惠券"}},{path:"detail",style:{navigationBarTitleText:"优惠券"},meta:{auth:!1,sync:!0,title:"优惠券详情",group:"优惠券"}}]},{root:"pages/chat",pages:[{path:"index",style:{navigationBarTitleText:"客服"},meta:{auth:!0,sync:!0,title:"客服",group:"客服"}},{path:"speechtotext",style:{navigationBarTitleText:"语音转文字",enablePullDownRefresh:!1},meta:{auth:!0,sync:!0,title:"语音转文字",group:"语音转文字"}}]},{root:"pages/pay",pages:[{path:"index",style:{navigationBarTitleText:"收银台"}},{path:"result",style:{navigationBarTitleText:"富友支付结果"}},{path:"resultYuan",style:{navigationBarTitleText:"支付结果"}},{path:"recharge",style:{navigationBarTitleText:"充值余额"},meta:{auth:!0,sync:!0,title:"充值余额",group:"支付"}},{path:"recharge-log",style:{navigationBarTitleText:"充值记录"},meta:{auth:!0,sync:!0,title:"充值记录",group:"支付"}}]},{root:"pages/activity",pages:[{path:"groupon/detail",style:{navigationBarTitleText:"拼团详情"}},{path:"groupon/order",style:{navigationBarTitleText:"我的拼团",enablePullDownRefresh:!0},meta:{auth:!0,sync:!0,title:"拼团订单",group:"营销活动"}},{path:"index",style:{navigationBarTitleText:"营销商品"},meta:{sync:!0,title:"营销商品",group:"营销活动"}},{path:"groupon/list",style:{navigationBarTitleText:"拼团活动"},meta:{sync:!0,title:"拼团活动",group:"营销活动"}},{path:"seckill/list",style:{navigationBarTitleText:"秒杀活动"},meta:{sync:!0,title:"秒杀活动",group:"营销活动"}},{path:"bargain/list",style:{navigationBarTitleText:"砍价列表"},meta:{sync:!0,title:"砍价列表",group:"营销活动"}},{path:"bargain/detail",style:{navigationBarTitleText:"砍价详情"},meta:{sync:!0,title:"砍价详情",group:"营销活动"}}]}],globalStyle:{navigationBarTextStyle:"black",navigationBarTitleText:"常来此购",navigationBarBackgroundColor:"#FFFFFF",backgroundColor:"#FFFFFF",navigationStyle:"custom"},tabBar:{list:[{pagePath:"pages/index/index"},{pagePath:"pages/index/cart"},{pagePath:"pages/index/user"}]},condition:{current:0,list:[{name:"",path:"",query:""}]},usingComponents:{richtext:"@/pages/public/richtext"}};function Z(e,t,s){return e(s={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&s.path)}},s.exports),s.exports}var ee=Z((function(e,t){var s;e.exports=(s=s||function(e,t){var s=Object.create||function(){function e(){}return function(t){var s;return e.prototype=t,s=new e,e.prototype=null,s}}(),n={},i=n.lib={},r=i.Base={extend:function(e){var t=s(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},o=i.WordArray=r.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||c).stringify(this)},concat:function(e){var t=this.words,s=e.words,n=this.sigBytes,i=e.sigBytes;if(this.clamp(),n%4)for(var r=0;r<i;r++){var o=s[r>>>2]>>>24-r%4*8&255;t[n+r>>>2]|=o<<24-(n+r)%4*8}else for(r=0;r<i;r+=4)t[n+r>>>2]=s[r>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,s=this.sigBytes;t[s>>>2]&=4294967295<<32-s%4*8,t.length=e.ceil(s/4)},clone:function(){var e=r.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var s,n=[],i=function(t){var s=987654321,n=4294967295;return function(){var i=((s=36969*(65535&s)+(s>>16)&n)<<16)+(t=18e3*(65535&t)+(t>>16)&n)&n;return i/=4294967296,(i+=.5)*(e.random()>.5?1:-1)}},r=0;r<t;r+=4){var a=i(4294967296*(s||e.random()));s=987654071*a(),n.push(4294967296*a()|0)}return new o.init(n,t)}}),a=n.enc={},c=a.Hex={stringify:function(e){for(var t=e.words,s=e.sigBytes,n=[],i=0;i<s;i++){var r=t[i>>>2]>>>24-i%4*8&255;n.push((r>>>4).toString(16)),n.push((15&r).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,s=[],n=0;n<t;n+=2)s[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new o.init(s,t/2)}},l=a.Latin1={stringify:function(e){for(var t=e.words,s=e.sigBytes,n=[],i=0;i<s;i++){var r=t[i>>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(r))}return n.join("")},parse:function(e){for(var t=e.length,s=[],n=0;n<t;n++)s[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new o.init(s,t)}},u=a.Utf8={stringify:function(e){try{return decodeURIComponent(escape(l.stringify(e)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(e){return l.parse(unescape(encodeURIComponent(e)))}},h=i.BufferedBlockAlgorithm=r.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=u.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var s=this._data,n=s.words,i=s.sigBytes,r=this.blockSize,a=i/(4*r),c=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*r,l=e.min(4*c,i);if(c){for(var u=0;u<c;u+=r)this._doProcessBlock(n,u);var h=n.splice(0,c);s.sigBytes-=l}return new o.init(h,l)},clone:function(){var e=r.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});i.Hasher=h.extend({cfg:r.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){h.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,s){return new e.init(s).finalize(t)}},_createHmacHelper:function(e){return function(t,s){return new d.HMAC.init(e,s).finalize(t)}}});var d=n.algo={};return n}(Math),s)})),te=ee,se=(Z((function(e,t){var s;e.exports=(s=te,function(e){var t=s,n=t.lib,i=n.WordArray,r=n.Hasher,o=t.algo,a=[];!function(){for(var t=0;t<64;t++)a[t]=4294967296*e.abs(e.sin(t+1))|0}();var c=o.MD5=r.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var s=0;s<16;s++){var n=t+s,i=e[n];e[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var r=this._hash.words,o=e[t+0],c=e[t+1],p=e[t+2],f=e[t+3],g=e[t+4],m=e[t+5],y=e[t+6],_=e[t+7],T=e[t+8],w=e[t+9],v=e[t+10],x=e[t+11],b=e[t+12],k=e[t+13],I=e[t+14],S=e[t+15],P=r[0],A=r[1],O=r[2],L=r[3];P=l(P,A,O,L,o,7,a[0]),L=l(L,P,A,O,c,12,a[1]),O=l(O,L,P,A,p,17,a[2]),A=l(A,O,L,P,f,22,a[3]),P=l(P,A,O,L,g,7,a[4]),L=l(L,P,A,O,m,12,a[5]),O=l(O,L,P,A,y,17,a[6]),A=l(A,O,L,P,_,22,a[7]),P=l(P,A,O,L,T,7,a[8]),L=l(L,P,A,O,w,12,a[9]),O=l(O,L,P,A,v,17,a[10]),A=l(A,O,L,P,x,22,a[11]),P=l(P,A,O,L,b,7,a[12]),L=l(L,P,A,O,k,12,a[13]),O=l(O,L,P,A,I,17,a[14]),P=u(P,A=l(A,O,L,P,S,22,a[15]),O,L,c,5,a[16]),L=u(L,P,A,O,y,9,a[17]),O=u(O,L,P,A,x,14,a[18]),A=u(A,O,L,P,o,20,a[19]),P=u(P,A,O,L,m,5,a[20]),L=u(L,P,A,O,v,9,a[21]),O=u(O,L,P,A,S,14,a[22]),A=u(A,O,L,P,g,20,a[23]),P=u(P,A,O,L,w,5,a[24]),L=u(L,P,A,O,I,9,a[25]),O=u(O,L,P,A,f,14,a[26]),A=u(A,O,L,P,T,20,a[27]),P=u(P,A,O,L,k,5,a[28]),L=u(L,P,A,O,p,9,a[29]),O=u(O,L,P,A,_,14,a[30]),P=h(P,A=u(A,O,L,P,b,20,a[31]),O,L,m,4,a[32]),L=h(L,P,A,O,T,11,a[33]),O=h(O,L,P,A,x,16,a[34]),A=h(A,O,L,P,I,23,a[35]),P=h(P,A,O,L,c,4,a[36]),L=h(L,P,A,O,g,11,a[37]),O=h(O,L,P,A,_,16,a[38]),A=h(A,O,L,P,v,23,a[39]),P=h(P,A,O,L,k,4,a[40]),L=h(L,P,A,O,o,11,a[41]),O=h(O,L,P,A,f,16,a[42]),A=h(A,O,L,P,y,23,a[43]),P=h(P,A,O,L,w,4,a[44]),L=h(L,P,A,O,b,11,a[45]),O=h(O,L,P,A,S,16,a[46]),P=d(P,A=h(A,O,L,P,p,23,a[47]),O,L,o,6,a[48]),L=d(L,P,A,O,_,10,a[49]),O=d(O,L,P,A,I,15,a[50]),A=d(A,O,L,P,m,21,a[51]),P=d(P,A,O,L,b,6,a[52]),L=d(L,P,A,O,f,10,a[53]),O=d(O,L,P,A,v,15,a[54]),A=d(A,O,L,P,c,21,a[55]),P=d(P,A,O,L,T,6,a[56]),L=d(L,P,A,O,S,10,a[57]),O=d(O,L,P,A,y,15,a[58]),A=d(A,O,L,P,k,21,a[59]),P=d(P,A,O,L,g,6,a[60]),L=d(L,P,A,O,x,10,a[61]),O=d(O,L,P,A,p,15,a[62]),A=d(A,O,L,P,w,21,a[63]),r[0]=r[0]+P|0,r[1]=r[1]+A|0,r[2]=r[2]+O|0,r[3]=r[3]+L|0},_doFinalize:function(){var t=this._data,s=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;s[i>>>5]|=128<<24-i%32;var r=e.floor(n/4294967296),o=n;s[15+(i+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),s[14+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),t.sigBytes=4*(s.length+1),this._process();for(var a=this._hash,c=a.words,l=0;l<4;l++){var u=c[l];c[l]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return a},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e}});function l(e,t,s,n,i,r,o){var a=e+(t&s|~t&n)+i+o;return(a<<r|a>>>32-r)+t}function u(e,t,s,n,i,r,o){var a=e+(t&n|s&~n)+i+o;return(a<<r|a>>>32-r)+t}function h(e,t,s,n,i,r,o){var a=e+(t^s^n)+i+o;return(a<<r|a>>>32-r)+t}function d(e,t,s,n,i,r,o){var a=e+(s^(t|~n))+i+o;return(a<<r|a>>>32-r)+t}t.MD5=r._createHelper(c),t.HmacMD5=r._createHmacHelper(c)}(Math),s.MD5)})),Z((function(e,t){var s,n,i;e.exports=(n=(s=te).lib.Base,i=s.enc.Utf8,void(s.algo.HMAC=n.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=i.parse(t));var s=e.blockSize,n=4*s;t.sigBytes>n&&(t=e.finalize(t)),t.clamp();for(var r=this._oKey=t.clone(),o=this._iKey=t.clone(),a=r.words,c=o.words,l=0;l<s;l++)a[l]^=1549556828,c[l]^=909522486;r.sigBytes=o.sigBytes=n,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,s=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(s))}})))})),Z((function(e,t){e.exports=te.HmacMD5}))),ne=Z((function(e,t){e.exports=te.enc.Utf8})),ie=Z((function(e,t){var s,n,i;e.exports=(i=(n=s=te).lib.WordArray,n.enc.Base64={stringify:function(e){var t=e.words,s=e.sigBytes,n=this._map;e.clamp();for(var i=[],r=0;r<s;r+=3)for(var o=(t[r>>>2]>>>24-r%4*8&255)<<16|(t[r+1>>>2]>>>24-(r+1)%4*8&255)<<8|t[r+2>>>2]>>>24-(r+2)%4*8&255,a=0;a<4&&r+.75*a<s;a++)i.push(n.charAt(o>>>6*(3-a)&63));var c=n.charAt(64);if(c)for(;i.length%4;)i.push(c);return i.join("")},parse:function(e){var t=e.length,s=this._map,n=this._reverseMap;if(!n){n=this._reverseMap=[];for(var r=0;r<s.length;r++)n[s.charCodeAt(r)]=r}var o=s.charAt(64);if(o){var a=e.indexOf(o);-1!==a&&(t=a)}return function(e,t,s){for(var n=[],r=0,o=0;o<t;o++)if(o%4){var a=s[e.charCodeAt(o-1)]<<o%4*2,c=s[e.charCodeAt(o)]>>>6-o%4*2;n[r>>>2]|=(a|c)<<24-r%4*8,r++}return i.create(n,r)}(e,t,n)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},s.enc.Base64)}));const re="uni_id_token",oe="uni_id_token_expired",ae="FUNCTION",ce="OBJECT",le="CLIENT_DB",ue="pending",he="rejected";function de(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}function pe(e){return"object"===de(e)}function fe(e){return"function"==typeof e}function ge(e){return function(){try{return e.apply(e,arguments)}catch(t){console.error(t)}}}const me="REJECTED",ye="NOT_PENDING";class _e{constructor({createPromise:e,retryRule:t=me}={}){this.createPromise=e,this.status=null,this.promise=null,this.retryRule=t}get needRetry(){if(!this.status)return!0;switch(this.retryRule){case me:return this.status===he;case ye:return this.status!==ue}}exec(){return this.needRetry?(this.status=ue,this.promise=this.createPromise().then((e=>(this.status="fulfilled",Promise.resolve(e))),(e=>(this.status=he,Promise.reject(e)))),this.promise):this.promise}}function Te(e){return e&&"string"==typeof e?JSON.parse(e):e}const we=Te([]);Te("");const ve=Te("[]")||[];let xe="";try{xe="__UNI__7806143"}catch(ht){}let be,ke={};function Ie(e,t={}){var s,n;return s=ke,n=e,Object.prototype.hasOwnProperty.call(s,n)||(ke[e]=t),ke[e]}const Se=["invoke","success","fail","complete"],Pe=Ie("_globalUniCloudInterceptor");function Ae(e,t){Pe[e]||(Pe[e]={}),pe(t)&&Object.keys(t).forEach((s=>{Se.indexOf(s)>-1&&function(e,t,s){let n=Pe[e][t];n||(n=Pe[e][t]=[]),-1===n.indexOf(s)&&fe(s)&&n.push(s)}(e,s,t[s])}))}function Oe(e,t){Pe[e]||(Pe[e]={}),pe(t)?Object.keys(t).forEach((s=>{Se.indexOf(s)>-1&&function(e,t,s){const n=Pe[e][t];if(!n)return;const i=n.indexOf(s);i>-1&&n.splice(i,1)}(e,s,t[s])})):delete Pe[e]}function Le(e,t){return e&&0!==e.length?e.reduce(((e,s)=>e.then((()=>s(t)))),Promise.resolve()):Promise.resolve()}function Ce(e,t){return Pe[e]&&Pe[e][t]||[]}function Ee(e){Ae("callObject",e)}const Fe=Ie("_globalUniCloudListener"),Ue="response",Re="needLogin",De="refreshToken",Ne="clientdb",Me="cloudfunction",Be="cloudobject";function qe(e){return Fe[e]||(Fe[e]=[]),Fe[e]}function $e(e,t){const s=qe(e);s.includes(t)||s.push(t)}function je(e,t){const s=qe(e),n=s.indexOf(t);-1!==n&&s.splice(n,1)}function Ke(e,t){const s=qe(e);for(let n=0;n<s.length;n++)(0,s[n])(t)}let Ve,He=!1;function Je(){return Ve||(Ve=new Promise((e=>{He&&e(),function t(){if("function"==typeof s){const t=s();t&&t[0]&&(He=!0,e())}He||setTimeout((()=>{t()}),30)}()})),Ve)}function We(e){const t={};for(const s in e){const n=e[s];fe(n)&&(t[s]=ge(n))}return t}class ze extends Error{constructor(e){super(e.message),this.errMsg=e.message||e.errMsg||"unknown system error",this.code=this.errCode=e.code||e.errCode||"SYSTEM_ERROR",this.errSubject=this.subject=e.subject||e.errSubject,this.cause=e.cause,this.requestId=e.requestId}toJson(e=0){if(!(e>=10))return e++,{errCode:this.errCode,errMsg:this.errMsg,errSubject:this.errSubject,cause:this.cause&&this.cause.toJson?this.cause.toJson(e):this.cause}}}var Qe={request:e=>h(e),uploadFile:e=>d(e),setStorageSync:(e,t)=>p(e,t),getStorageSync:e=>f(e),removeStorageSync:e=>g(e),clearStorageSync:()=>m(),connectSocket:e=>y(e)};function Ye(e){return e&&Ye(e.__v_raw)||e}function Ge(){return{token:Qe.getStorageSync(re)||Qe.getStorageSync("uniIdToken"),tokenExpired:Qe.getStorageSync(oe)}}function Xe({token:e,tokenExpired:t}={}){e&&Qe.setStorageSync(re,e),t&&Qe.setStorageSync(oe,t)}let Ze,et;function tt(){return Ze||(Ze=_()),Ze}function st(){let e,t;try{if(S){if(S.toString().indexOf("not yet implemented")>-1)return;const{scene:s,channel:n}=S();e=n,t=s}}catch(s){}return{channel:e,scene:t}}let nt={};function it(){const e=I&&I()||"en";if(et)return{...nt,...et,locale:e,LOCALE:e};const t=tt(),{deviceId:s,osName:n,uniPlatform:i,appId:r}=t,o=["appId","appLanguage","appName","appVersion","appVersionCode","appWgtVersion","browserName","browserVersion","deviceBrand","deviceId","deviceModel","deviceType","osName","osVersion","romName","romVersion","ua","hostName","hostVersion","uniPlatform","uniRuntimeVersion","uniRuntimeVersionCode","uniCompilerVersion","uniCompilerVersionCode"];for(const a in t)Object.hasOwnProperty.call(t,a)&&-1===o.indexOf(a)&&delete t[a];return et={PLATFORM:i,OS:n,APPID:r,DEVICEID:s,...st(),...t},{...nt,...et,locale:e,LOCALE:e}}var rt=function(e,t){let s="";return Object.keys(e).sort().forEach((function(t){e[t]&&(s=s+"&"+t+"="+e[t])})),s=s.slice(1),se(s,t).toString()},ot=function(e,t){return new Promise(((s,n)=>{t(Object.assign(e,{complete(e){e||(e={});const t=e.data&&e.data.header&&e.data.header["x-serverless-request-id"]||e.header&&e.header["request-id"];if(!e.statusCode||e.statusCode>=400){const s=e.data&&e.data.error&&e.data.error.code||"SYS_ERR",i=e.data&&e.data.error&&e.data.error.message||e.errMsg||"request:fail";return n(new ze({code:s,message:i,requestId:t}))}const i=e.data;if(i.error)return n(new ze({code:i.error.code,message:i.error.message,requestId:t}));i.result=i.data,i.requestId=t,delete i.data,s(i)}}))}))},at=function(e){return ie.stringify(ne.parse(e))},ct={init(e){const t=new class{constructor(e){["spaceId","clientSecret"].forEach((t=>{if(!Object.prototype.hasOwnProperty.call(e,t))throw new Error(`${t} required`)})),this.config=Object.assign({},{endpoint:0===e.spaceId.indexOf("mp-")?"https://api.next.bspapp.com":"https://api.bspapp.com"},e),this.config.provider="aliyun",this.config.requestUrl=this.config.endpoint+"/client",this.config.envType=this.config.envType||"public",this.config.accessTokenKey="access_token_"+this.config.spaceId,this.adapter=Qe,this._getAccessTokenPromiseHub=new _e({createPromise:()=>this.requestAuth(this.setupRequest({method:"serverless.auth.user.anonymousAuthorize",params:"{}"},"auth")).then((e=>{if(!e.result||!e.result.accessToken)throw new ze({code:"AUTH_FAILED",message:"获取accessToken失败"});this.setAccessToken(e.result.accessToken)})),retryRule:ye})}get hasAccessToken(){return!!this.accessToken}setAccessToken(e){this.accessToken=e}requestWrapped(e){return ot(e,this.adapter.request)}requestAuth(e){return this.requestWrapped(e)}request(e,t){return Promise.resolve().then((()=>this.hasAccessToken?t?this.requestWrapped(e):this.requestWrapped(e).catch((t=>new Promise(((e,s)=>{!t||"GATEWAY_INVALID_TOKEN"!==t.code&&"InvalidParameter.InvalidToken"!==t.code?s(t):e()})).then((()=>this.getAccessToken())).then((()=>{const t=this.rebuildRequest(e);return this.request(t,!0)})))):this.getAccessToken().then((()=>{const t=this.rebuildRequest(e);return this.request(t,!0)}))))}rebuildRequest(e){const t=Object.assign({},e);return t.data.token=this.accessToken,t.header["x-basement-token"]=this.accessToken,t.header["x-serverless-sign"]=rt(t.data,this.config.clientSecret),t}setupRequest(e,t){const s=Object.assign({},e,{spaceId:this.config.spaceId,timestamp:Date.now()}),n={"Content-Type":"application/json"};return"auth"!==t&&(s.token=this.accessToken,n["x-basement-token"]=this.accessToken),n["x-serverless-sign"]=rt(s,this.config.clientSecret),{url:this.config.requestUrl,method:"POST",data:s,dataType:"json",header:n}}getAccessToken(){return this._getAccessTokenPromiseHub.exec()}async authorize(){await this.getAccessToken()}callFunction(e){const t={method:"serverless.function.runtime.invoke",params:JSON.stringify({functionTarget:e.name,functionArgs:e.data||{}})};return this.request({...this.setupRequest(t),timeout:e.timeout})}getOSSUploadOptionsFromPath(e){const t={method:"serverless.file.resource.generateProximalSign",params:JSON.stringify(e)};return this.request(this.setupRequest(t))}uploadFileToOSS({url:e,formData:t,name:s,filePath:n,fileType:i,onUploadProgress:r}){return new Promise(((o,a)=>{const c=this.adapter.uploadFile({url:e,formData:t,name:s,filePath:n,fileType:i,header:{"X-OSS-server-side-encrpytion":"AES256"},success(e){e&&e.statusCode<400?o(e):a(new ze({code:"UPLOAD_FAILED",message:"文件上传失败"}))},fail(e){a(new ze({code:e.code||"UPLOAD_FAILED",message:e.message||e.errMsg||"文件上传失败"}))}});"function"==typeof r&&c&&"function"==typeof c.onProgressUpdate&&c.onProgressUpdate((e=>{r({loaded:e.totalBytesSent,total:e.totalBytesExpectedToSend})}))}))}reportOSSUpload(e){const t={method:"serverless.file.resource.report",params:JSON.stringify(e)};return this.request(this.setupRequest(t))}async uploadFile({filePath:e,cloudPath:t,fileType:s="image",cloudPathAsRealPath:n=!1,onUploadProgress:i,config:r}){if("string"!==de(t))throw new ze({code:"INVALID_PARAM",message:"cloudPath必须为字符串类型"});if(!(t=t.trim()))throw new ze({code:"INVALID_PARAM",message:"cloudPath不可为空"});if(/:\/\//.test(t))throw new ze({code:"INVALID_PARAM",message:"cloudPath不合法"});const o=r&&r.envType||this.config.envType;if(n&&("/"!==t[0]&&(t="/"+t),t.indexOf("\\")>-1))throw new ze({code:"INVALID_PARAM",message:"使用cloudPath作为路径时,cloudPath不可包含“\\”"});const a=(await this.getOSSUploadOptionsFromPath({env:o,filename:n?t.split("/").pop():t,fileId:n?t:void 0})).result,c="https://"+a.cdnDomain+"/"+a.ossPath,{securityToken:l,accessKeyId:u,signature:h,host:d,ossPath:p,id:f,policy:g,ossCallbackUrl:m}=a,y={"Cache-Control":"max-age=2592000","Content-Disposition":"attachment",OSSAccessKeyId:u,Signature:h,host:d,id:f,key:p,policy:g,success_action_status:200};if(l&&(y["x-oss-security-token"]=l),m){const e=JSON.stringify({callbackUrl:m,callbackBody:JSON.stringify({fileId:f,spaceId:this.config.spaceId}),callbackBodyType:"application/json"});y.callback=at(e)}const _={url:"https://"+a.host,formData:y,fileName:"file",name:"file",filePath:e,fileType:s};if(await this.uploadFileToOSS(Object.assign({},_,{onUploadProgress:i})),m)return{success:!0,filePath:e,fileID:c};if((await this.reportOSSUpload({id:f})).success)return{success:!0,filePath:e,fileID:c};throw new ze({code:"UPLOAD_FAILED",message:"文件上传失败"})}getTempFileURL({fileList:e}={}){return new Promise(((t,s)=>{Array.isArray(e)&&0!==e.length||s(new ze({code:"INVALID_PARAM",message:"fileList的元素必须是非空的字符串"})),t({fileList:e.map((e=>({fileID:e,tempFileURL:e})))})}))}async getFileInfo({fileList:e}={}){if(!Array.isArray(e)||0===e.length)throw new ze({code:"INVALID_PARAM",message:"fileList的元素必须是非空的字符串"});const t={method:"serverless.file.resource.info",params:JSON.stringify({id:e.map((e=>e.split("?")[0])).join(",")})};return{fileList:(await this.request(this.setupRequest(t))).result}}}(e),s={signInAnonymously:function(){return t.authorize()},getLoginState:function(){return Promise.resolve(!1)}};return t.auth=function(){return s},t.customAuth=t.auth,t}};const lt="undefined"!=typeof location&&"http:"===location.protocol?"http:":"https:";var ut,ht;(ht=ut||(ut={})).local="local",ht.none="none",ht.session="session";var dt=function(){},pt=Z((function(e,t){var s;e.exports=(s=te,function(e){var t=s,n=t.lib,i=n.WordArray,r=n.Hasher,o=t.algo,a=[],c=[];!function(){function t(t){for(var s=e.sqrt(t),n=2;n<=s;n++)if(!(t%n))return!1;return!0}function s(e){return 4294967296*(e-(0|e))|0}for(var n=2,i=0;i<64;)t(n)&&(i<8&&(a[i]=s(e.pow(n,.5))),c[i]=s(e.pow(n,1/3)),i++),n++}();var l=[],u=o.SHA256=r.extend({_doReset:function(){this._hash=new i.init(a.slice(0))},_doProcessBlock:function(e,t){for(var s=this._hash.words,n=s[0],i=s[1],r=s[2],o=s[3],a=s[4],u=s[5],h=s[6],d=s[7],p=0;p<64;p++){if(p<16)l[p]=0|e[t+p];else{var f=l[p-15],g=(f<<25|f>>>7)^(f<<14|f>>>18)^f>>>3,m=l[p-2],y=(m<<15|m>>>17)^(m<<13|m>>>19)^m>>>10;l[p]=g+l[p-7]+y+l[p-16]}var _=n&i^n&r^i&r,T=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),w=d+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&u^~a&h)+c[p]+l[p];d=h,h=u,u=a,a=o+w|0,o=r,r=i,i=n,n=w+(T+_)|0}s[0]=s[0]+n|0,s[1]=s[1]+i|0,s[2]=s[2]+r|0,s[3]=s[3]+o|0,s[4]=s[4]+a|0,s[5]=s[5]+u|0,s[6]=s[6]+h|0,s[7]=s[7]+d|0},_doFinalize:function(){var t=this._data,s=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;return s[i>>>5]|=128<<24-i%32,s[14+(i+64>>>9<<4)]=e.floor(n/4294967296),s[15+(i+64>>>9<<4)]=n,t.sigBytes=4*s.length,this._process(),this._hash},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=r._createHelper(u),t.HmacSHA256=r._createHmacHelper(u)}(Math),s.SHA256)})),ft=pt,gt=Z((function(e,t){e.exports=te.HmacSHA256}));const mt=()=>{let e;if(!Promise){e=()=>{},e.promise={};const t=()=>{throw new ze({message:'Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.'})};return Object.defineProperty(e.promise,"then",{get:t}),Object.defineProperty(e.promise,"catch",{get:t}),e}const t=new Promise(((t,s)=>{e=(e,n)=>e?s(e):t(n)}));return e.promise=t,e};function yt(e){return void 0===e}function _t(e){return"[object Null]"===Object.prototype.toString.call(e)}function Tt(e=""){return e.replace(/([\s\S]+)\s+(请前往云开发AI小助手查看问题:.*)/,"$1")}function wt(e=32){let t="";for(let s=0;s<e;s++)t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(Math.floor(62*Math.random()));return t}var vt;!function(e){e.WEB="web",e.WX_MP="wx_mp"}(vt||(vt={}));const xt={adapter:null,runtime:void 0},bt=["anonymousUuidKey"];class kt extends dt{constructor(){super(),xt.adapter.root.tcbObject||(xt.adapter.root.tcbObject={})}setItem(e,t){xt.adapter.root.tcbObject[e]=t}getItem(e){return xt.adapter.root.tcbObject[e]}removeItem(e){delete xt.adapter.root.tcbObject[e]}clear(){delete xt.adapter.root.tcbObject}}function It(e,t){switch(e){case"local":return t.localStorage||new kt;case"none":return new kt;default:return t.sessionStorage||new kt}}class St{constructor(e){if(!this._storage){this._persistence=xt.adapter.primaryStorage||e.persistence,this._storage=It(this._persistence,xt.adapter);const t=`access_token_${e.env}`,s=`access_token_expire_${e.env}`,n=`refresh_token_${e.env}`,i=`anonymous_uuid_${e.env}`,r=`login_type_${e.env}`,o="device_id",a=`token_type_${e.env}`,c=`user_info_${e.env}`;this.keys={accessTokenKey:t,accessTokenExpireKey:s,refreshTokenKey:n,anonymousUuidKey:i,loginTypeKey:r,userInfoKey:c,deviceIdKey:o,tokenTypeKey:a}}}updatePersistence(e){if(e===this._persistence)return;const t="local"===this._persistence;this._persistence=e;const s=It(e,xt.adapter);for(const n in this.keys){const e=this.keys[n];if(t&&bt.includes(n))continue;const i=this._storage.getItem(e);yt(i)||_t(i)||(s.setItem(e,i),this._storage.removeItem(e))}this._storage=s}setStore(e,t,s){if(!this._storage)return;const n={version:s||"localCachev1",content:t},i=JSON.stringify(n);try{this._storage.setItem(e,i)}catch(r){throw r}}getStore(e,t){try{if(!this._storage)return}catch(n){return""}t=t||"localCachev1";const s=this._storage.getItem(e);return s&&s.indexOf(t)>=0?JSON.parse(s).content:""}removeStore(e){this._storage.removeItem(e)}}const Pt={},At={};function Ot(e){return Pt[e]}class Lt{constructor(e,t){this.data=t||null,this.name=e}}class Ct extends Lt{constructor(e,t){super("error",{error:e,data:t}),this.error=e}}const Et=new class{constructor(){this._listeners={}}on(e,t){return s=e,n=t,(i=this._listeners)[s]=i[s]||[],i[s].push(n),this;var s,n,i}off(e,t){return function(e,t,s){if(s&&s[e]){const n=s[e].indexOf(t);-1!==n&&s[e].splice(n,1)}}(e,t,this._listeners),this}fire(e,t){if(e instanceof Ct)return console.error(e.error),this;const s="string"==typeof e?new Lt(e,t||{}):e,n=s.name;if(this._listens(n)){s.target=this;const e=this._listeners[n]?[...this._listeners[n]]:[];for(const t of e)t.call(this,s)}return this}_listens(e){return this._listeners[e]&&this._listeners[e].length>0}};function Ft(e,t){Et.on(e,t)}function Ut(e,t={}){Et.fire(e,t)}function Rt(e,t){Et.off(e,t)}const Dt="loginStateChanged",Nt="loginStateExpire",Mt="loginTypeChanged",Bt="anonymousConverted",qt="refreshAccessToken";var $t;!function(e){e.ANONYMOUS="ANONYMOUS",e.WECHAT="WECHAT",e.WECHAT_PUBLIC="WECHAT-PUBLIC",e.WECHAT_OPEN="WECHAT-OPEN",e.CUSTOM="CUSTOM",e.EMAIL="EMAIL",e.USERNAME="USERNAME",e.NULL="NULL"}($t||($t={}));class jt{constructor(){this._fnPromiseMap=new Map}async run(e,t){let s=this._fnPromiseMap.get(e);return s||(s=new Promise((async(s,n)=>{try{await this._runIdlePromise();const n=t();s(await n)}catch(i){n(i)}finally{this._fnPromiseMap.delete(e)}})),this._fnPromiseMap.set(e,s)),s}_runIdlePromise(){return Promise.resolve()}}class Kt{constructor(e){this._singlePromise=new jt,this._cache=Ot(e.env),this._baseURL=`https://${e.env}.ap-shanghai.tcb-api.tencentcloudapi.com`,this._reqClass=new xt.adapter.reqClass({timeout:e.timeout,timeoutMsg:`请求在${e.timeout/1e3}s内未完成,已中断`,restrictedMethods:["post"]})}_getDeviceId(){if(this._deviceID)return this._deviceID;const{deviceIdKey:e}=this._cache.keys;let t=this._cache.getStore(e);return"string"==typeof t&&t.length>=16&&t.length<=48||(t=wt(),this._cache.setStore(e,t)),this._deviceID=t,t}async _request(e,t,s={}){const n={"x-request-id":wt(),"x-device-id":this._getDeviceId()};if(s.withAccessToken){const{tokenTypeKey:e}=this._cache.keys,t=await this.getAccessToken(),s=this._cache.getStore(e);n.authorization=`${s} ${t}`}return this._reqClass["get"===s.method?"get":"post"]({url:`${this._baseURL}${e}`,data:t,headers:n})}async _fetchAccessToken(){const{loginTypeKey:e,accessTokenKey:t,accessTokenExpireKey:s,tokenTypeKey:n}=this._cache.keys,i=this._cache.getStore(e);if(i&&i!==$t.ANONYMOUS)throw new ze({code:"INVALID_OPERATION",message:"非匿名登录不支持刷新 access token"});const r=await this._singlePromise.run("fetchAccessToken",(async()=>(await this._request("/auth/v1/signin/anonymously",{},{method:"post"})).data)),{access_token:o,expires_in:a,token_type:c}=r;return this._cache.setStore(n,c),this._cache.setStore(t,o),this._cache.setStore(s,Date.now()+1e3*a),o}isAccessTokenExpired(e,t){let s=!0;return e&&t&&(s=t<Date.now()),s}async getAccessToken(){const{accessTokenKey:e,accessTokenExpireKey:t}=this._cache.keys,s=this._cache.getStore(e),n=this._cache.getStore(t);return this.isAccessTokenExpired(s,n)?this._fetchAccessToken():s}async refreshAccessToken(){const{accessTokenKey:e,accessTokenExpireKey:t,loginTypeKey:s}=this._cache.keys;return this._cache.removeStore(e),this._cache.removeStore(t),this._cache.setStore(s,$t.ANONYMOUS),this.getAccessToken()}async getUserInfo(){return this._singlePromise.run("getUserInfo",(async()=>(await this._request("/auth/v1/user/me",{},{withAccessToken:!0,method:"get"})).data))}}const Vt=["auth.getJwt","auth.logout","auth.signInWithTicket","auth.signInAnonymously","auth.signIn","auth.fetchAccessTokenWithRefreshToken","auth.signUpWithEmailAndPassword","auth.activateEndUserMail","auth.sendPasswordResetEmail","auth.resetPasswordWithToken","auth.isUsernameRegistered"],Ht={"X-SDK-Version":"1.3.5"};function Jt(e,t,s){const n=e[t];e[t]=function(t){const i={},r={};s.forEach((s=>{const{data:n,headers:o}=s.call(e,t);Object.assign(i,n),Object.assign(r,o)}));const o=t.data;return o&&(()=>{var e;if(e=o,"[object FormData]"!==Object.prototype.toString.call(e))t.data={...o,...i};else for(const t in i)o.append(t,i[t])})(),t.headers={...t.headers||{},...r},n.call(e,t)}}function Wt(){const e=Math.random().toString(16).slice(2);return{data:{seqId:e},headers:{...Ht,"x-seqid":e}}}class zt{constructor(e={}){var t;this.config=e,this._reqClass=new xt.adapter.reqClass({timeout:this.config.timeout,timeoutMsg:`请求在${this.config.timeout/1e3}s内未完成,已中断`,restrictedMethods:["post"]}),this._cache=Ot(this.config.env),this._localCache=(t=this.config.env,At[t]),this.oauth=new Kt(this.config),Jt(this._reqClass,"post",[Wt]),Jt(this._reqClass,"upload",[Wt]),Jt(this._reqClass,"download",[Wt])}async post(e){return await this._reqClass.post(e)}async upload(e){return await this._reqClass.upload(e)}async download(e){return await this._reqClass.download(e)}async refreshAccessToken(){let e,t;this._refreshAccessTokenPromise||(this._refreshAccessTokenPromise=this._refreshAccessToken());try{e=await this._refreshAccessTokenPromise}catch(s){t=s}if(this._refreshAccessTokenPromise=null,this._shouldRefreshAccessTokenHook=null,t)throw t;return e}async _refreshAccessToken(){const{accessTokenKey:e,accessTokenExpireKey:t,refreshTokenKey:s,loginTypeKey:n,anonymousUuidKey:i}=this._cache.keys;this._cache.removeStore(e),this._cache.removeStore(t);let r=this._cache.getStore(s);if(!r)throw new ze({message:"未登录CloudBase"});const o={refresh_token:r},a=await this.request("auth.fetchAccessTokenWithRefreshToken",o);if(a.data.code){const{code:e}=a.data;if("SIGN_PARAM_INVALID"===e||"REFRESH_TOKEN_EXPIRED"===e||"INVALID_REFRESH_TOKEN"===e){if(this._cache.getStore(n)===$t.ANONYMOUS&&"INVALID_REFRESH_TOKEN"===e){const e=this._cache.getStore(i),t=this._cache.getStore(s),n=await this.send("auth.signInAnonymously",{anonymous_uuid:e,refresh_token:t});return this.setRefreshToken(n.refresh_token),this._refreshAccessToken()}Ut(Nt),this._cache.removeStore(s)}throw new ze({code:a.data.code,message:`刷新access token失败:${a.data.code}`})}if(a.data.access_token)return Ut(qt),this._cache.setStore(e,a.data.access_token),this._cache.setStore(t,a.data.access_token_expire+Date.now()),{accessToken:a.data.access_token,accessTokenExpire:a.data.access_token_expire};a.data.refresh_token&&(this._cache.removeStore(s),this._cache.setStore(s,a.data.refresh_token),this._refreshAccessToken())}async getAccessToken(){const{accessTokenKey:e,accessTokenExpireKey:t,refreshTokenKey:s}=this._cache.keys;if(!this._cache.getStore(s))throw new ze({message:"refresh token不存在,登录状态异常"});let n=this._cache.getStore(e),i=this._cache.getStore(t),r=!0;return this._shouldRefreshAccessTokenHook&&!(await this._shouldRefreshAccessTokenHook(n,i))&&(r=!1),(!n||!i||i<Date.now())&&r?this.refreshAccessToken():{accessToken:n,accessTokenExpire:i}}async request(e,t,s){const n=`x-tcb-trace_${this.config.env}`;let i="application/x-www-form-urlencoded";const r={action:e,env:this.config.env,dataVersion:"2019-08-16",...t};let o;if(-1===Vt.indexOf(e)&&(this._cache.keys,r.access_token=await this.oauth.getAccessToken()),"storage.uploadFile"===e){o=new FormData;for(let e in o)o.hasOwnProperty(e)&&void 0!==o[e]&&o.append(e,r[e]);i="multipart/form-data"}else{i="application/json",o={};for(let e in r)void 0!==r[e]&&(o[e]=r[e])}let a={headers:{"content-type":i}};s&&s.timeout&&(a.timeout=s.timeout),s&&s.onUploadProgress&&(a.onUploadProgress=s.onUploadProgress);const c=this._localCache.getStore(n);c&&(a.headers["X-TCB-Trace"]=c);const{parse:l,inQuery:u,search:h}=t;let d={env:this.config.env};l&&(d.parse=!0),u&&(d={...u,...d});let p=function(e,t,s={}){const n=/\?/.test(t);let i="";for(let r in s)""===i?!n&&(t+="?"):i+="&",i+=`${r}=${encodeURIComponent(s[r])}`;return/^http(s)?\:\/\//.test(t+=i)?t:`${e}${t}`}(lt,"//tcb-api.tencentcloudapi.com/web",d);h&&(p+=h);const f=await this.post({url:p,data:o,...a}),g=f.header&&f.header["x-tcb-trace"];if(g&&this._localCache.setStore(n,g),200!==Number(f.status)&&200!==Number(f.statusCode)||!f.data)throw new ze({code:"NETWORK_ERROR",message:"network request error"});return f}async send(e,t={},s={}){const n=await this.request(e,t,{...s,onUploadProgress:t.onUploadProgress});if(("ACCESS_TOKEN_DISABLED"===n.data.code||"ACCESS_TOKEN_EXPIRED"===n.data.code)&&-1===Vt.indexOf(e)){await this.oauth.refreshAccessToken();const n=await this.request(e,t,{...s,onUploadProgress:t.onUploadProgress});if(n.data.code)throw new ze({code:n.data.code,message:Tt(n.data.message)});return n.data}if(n.data.code)throw new ze({code:n.data.code,message:Tt(n.data.message)});return n.data}setRefreshToken(e){const{accessTokenKey:t,accessTokenExpireKey:s,refreshTokenKey:n}=this._cache.keys;this._cache.removeStore(t),this._cache.removeStore(s),this._cache.setStore(n,e)}}const Qt={};function Yt(e){return Qt[e]}class Gt{constructor(e){this.config=e,this._cache=Ot(e.env),this._request=Yt(e.env)}setRefreshToken(e){const{accessTokenKey:t,accessTokenExpireKey:s,refreshTokenKey:n}=this._cache.keys;this._cache.removeStore(t),this._cache.removeStore(s),this._cache.setStore(n,e)}setAccessToken(e,t){const{accessTokenKey:s,accessTokenExpireKey:n}=this._cache.keys;this._cache.setStore(s,e),this._cache.setStore(n,t)}async refreshUserInfo(){const{data:e}=await this._request.send("auth.getUserInfo",{});return this.setLocalUserInfo(e),e}setLocalUserInfo(e){const{userInfoKey:t}=this._cache.keys;this._cache.setStore(t,e)}}class Xt{constructor(e){if(!e)throw new ze({code:"PARAM_ERROR",message:"envId is not defined"});this._envId=e,this._cache=Ot(this._envId),this._request=Yt(this._envId),this.setUserInfo()}linkWithTicket(e){if("string"!=typeof e)throw new ze({code:"PARAM_ERROR",message:"ticket must be string"});return this._request.send("auth.linkWithTicket",{ticket:e})}linkWithRedirect(e){e.signInWithRedirect()}updatePassword(e,t){return this._request.send("auth.updatePassword",{oldPassword:t,newPassword:e})}updateEmail(e){return this._request.send("auth.updateEmail",{newEmail:e})}updateUsername(e){if("string"!=typeof e)throw new ze({code:"PARAM_ERROR",message:"username must be a string"});return this._request.send("auth.updateUsername",{username:e})}async getLinkedUidList(){const{data:e}=await this._request.send("auth.getLinkedUidList",{});let t=!1;const{users:s}=e;return s.forEach((e=>{e.wxOpenId&&e.wxPublicId&&(t=!0)})),{users:s,hasPrimaryUid:t}}setPrimaryUid(e){return this._request.send("auth.setPrimaryUid",{uid:e})}unlink(e){return this._request.send("auth.unlink",{platform:e})}async update(e){const{nickName:t,gender:s,avatarUrl:n,province:i,country:r,city:o}=e,{data:a}=await this._request.send("auth.updateUserInfo",{nickName:t,gender:s,avatarUrl:n,province:i,country:r,city:o});this.setLocalUserInfo(a)}async refresh(){const e=await this._request.oauth.getUserInfo();return this.setLocalUserInfo(e),e}setUserInfo(){const{userInfoKey:e}=this._cache.keys,t=this._cache.getStore(e);["uid","loginType","openid","wxOpenId","wxPublicId","unionId","qqMiniOpenId","email","hasPassword","customUserId","nickName","gender","avatarUrl"].forEach((e=>{this[e]=t[e]})),this.location={country:t.country,province:t.province,city:t.city}}setLocalUserInfo(e){const{userInfoKey:t}=this._cache.keys;this._cache.setStore(t,e),this.setUserInfo()}}class Zt{constructor(e){if(!e)throw new ze({code:"PARAM_ERROR",message:"envId is not defined"});this._cache=Ot(e);const{refreshTokenKey:t,accessTokenKey:s,accessTokenExpireKey:n}=this._cache.keys,i=this._cache.getStore(t),r=this._cache.getStore(s),o=this._cache.getStore(n);this.credential={refreshToken:i,accessToken:r,accessTokenExpire:o},this.user=new Xt(e)}get isAnonymousAuth(){return this.loginType===$t.ANONYMOUS}get isCustomAuth(){return this.loginType===$t.CUSTOM}get isWeixinAuth(){return this.loginType===$t.WECHAT||this.loginType===$t.WECHAT_OPEN||this.loginType===$t.WECHAT_PUBLIC}get loginType(){return this._cache.getStore(this._cache.keys.loginTypeKey)}}class es extends Gt{async signIn(){this._cache.updatePersistence("local"),await this._request.oauth.getAccessToken(),Ut(Dt),Ut(Mt,{env:this.config.env,loginType:$t.ANONYMOUS,persistence:"local"});const e=new Zt(this.config.env);return await e.user.refresh(),e}async linkAndRetrieveDataWithTicket(e){const{anonymousUuidKey:t,refreshTokenKey:s}=this._cache.keys,n=this._cache.getStore(t),i=this._cache.getStore(s),r=await this._request.send("auth.linkAndRetrieveDataWithTicket",{anonymous_uuid:n,refresh_token:i,ticket:e});if(r.refresh_token)return this._clearAnonymousUUID(),this.setRefreshToken(r.refresh_token),await this._request.refreshAccessToken(),Ut(Bt,{env:this.config.env}),Ut(Mt,{loginType:$t.CUSTOM,persistence:"local"}),{credential:{refreshToken:r.refresh_token}};throw new ze({message:"匿名转化失败"})}_setAnonymousUUID(e){const{anonymousUuidKey:t,loginTypeKey:s}=this._cache.keys;this._cache.removeStore(t),this._cache.setStore(t,e),this._cache.setStore(s,$t.ANONYMOUS)}_clearAnonymousUUID(){this._cache.removeStore(this._cache.keys.anonymousUuidKey)}}class ts extends Gt{async signIn(e){if("string"!=typeof e)throw new ze({code:"PARAM_ERROR",message:"ticket must be a string"});const{refreshTokenKey:t}=this._cache.keys,s=await this._request.send("auth.signInWithTicket",{ticket:e,refresh_token:this._cache.getStore(t)||""});if(s.refresh_token)return this.setRefreshToken(s.refresh_token),await this._request.refreshAccessToken(),Ut(Dt),Ut(Mt,{env:this.config.env,loginType:$t.CUSTOM,persistence:this.config.persistence}),await this.refreshUserInfo(),new Zt(this.config.env);throw new ze({message:"自定义登录失败"})}}class ss extends Gt{async signIn(e,t){if("string"!=typeof e)throw new ze({code:"PARAM_ERROR",message:"email must be a string"});const{refreshTokenKey:s}=this._cache.keys,n=await this._request.send("auth.signIn",{loginType:"EMAIL",email:e,password:t,refresh_token:this._cache.getStore(s)||""}),{refresh_token:i,access_token:r,access_token_expire:o}=n;if(i)return this.setRefreshToken(i),r&&o?this.setAccessToken(r,o):await this._request.refreshAccessToken(),await this.refreshUserInfo(),Ut(Dt),Ut(Mt,{env:this.config.env,loginType:$t.EMAIL,persistence:this.config.persistence}),new Zt(this.config.env);throw n.code?new ze({code:n.code,message:`邮箱登录失败: ${n.message}`}):new ze({message:"邮箱登录失败"})}async activate(e){return this._request.send("auth.activateEndUserMail",{token:e})}async resetPasswordWithToken(e,t){return this._request.send("auth.resetPasswordWithToken",{token:e,newPassword:t})}}class ns extends Gt{async signIn(e,t){if("string"!=typeof e)throw new ze({code:"PARAM_ERROR",message:"username must be a string"});"string"!=typeof t&&(t="",console.warn("password is empty"));const{refreshTokenKey:s}=this._cache.keys,n=await this._request.send("auth.signIn",{loginType:$t.USERNAME,username:e,password:t,refresh_token:this._cache.getStore(s)||""}),{refresh_token:i,access_token_expire:r,access_token:o}=n;if(i)return this.setRefreshToken(i),o&&r?this.setAccessToken(o,r):await this._request.refreshAccessToken(),await this.refreshUserInfo(),Ut(Dt),Ut(Mt,{env:this.config.env,loginType:$t.USERNAME,persistence:this.config.persistence}),new Zt(this.config.env);throw n.code?new ze({code:n.code,message:`用户名密码登录失败: ${n.message}`}):new ze({message:"用户名密码登录失败"})}}class is{constructor(e){this.config=e,this._cache=Ot(e.env),this._request=Yt(e.env),this._onAnonymousConverted=this._onAnonymousConverted.bind(this),this._onLoginTypeChanged=this._onLoginTypeChanged.bind(this),Ft(Mt,this._onLoginTypeChanged)}get currentUser(){const e=this.hasLoginState();return e&&e.user||null}get loginType(){return this._cache.getStore(this._cache.keys.loginTypeKey)}anonymousAuthProvider(){return new es(this.config)}customAuthProvider(){return new ts(this.config)}emailAuthProvider(){return new ss(this.config)}usernameAuthProvider(){return new ns(this.config)}async signInAnonymously(){return new es(this.config).signIn()}async signInWithEmailAndPassword(e,t){return new ss(this.config).signIn(e,t)}signInWithUsernameAndPassword(e,t){return new ns(this.config).signIn(e,t)}async linkAndRetrieveDataWithTicket(e){return this._anonymousAuthProvider||(this._anonymousAuthProvider=new es(this.config)),Ft(Bt,this._onAnonymousConverted),await this._anonymousAuthProvider.linkAndRetrieveDataWithTicket(e)}async signOut(){if(this.loginType===$t.ANONYMOUS)throw new ze({message:"匿名用户不支持登出操作"});const{refreshTokenKey:e,accessTokenKey:t,accessTokenExpireKey:s}=this._cache.keys,n=this._cache.getStore(e);if(!n)return;const i=await this._request.send("auth.logout",{refresh_token:n});return this._cache.removeStore(e),this._cache.removeStore(t),this._cache.removeStore(s),Ut(Dt),Ut(Mt,{env:this.config.env,loginType:$t.NULL,persistence:this.config.persistence}),i}async signUpWithEmailAndPassword(e,t){return this._request.send("auth.signUpWithEmailAndPassword",{email:e,password:t})}async sendPasswordResetEmail(e){return this._request.send("auth.sendPasswordResetEmail",{email:e})}onLoginStateChanged(e){Ft(Dt,(()=>{const t=this.hasLoginState();e.call(this,t)}));const t=this.hasLoginState();e.call(this,t)}onLoginStateExpired(e){Ft(Nt,e.bind(this))}onAccessTokenRefreshed(e){Ft(qt,e.bind(this))}onAnonymousConverted(e){Ft(Bt,e.bind(this))}onLoginTypeChanged(e){Ft(Mt,(()=>{const t=this.hasLoginState();e.call(this,t)}))}async getAccessToken(){return{accessToken:(await this._request.getAccessToken()).accessToken,env:this.config.env}}hasLoginState(){const{accessTokenKey:e,accessTokenExpireKey:t}=this._cache.keys,s=this._cache.getStore(e),n=this._cache.getStore(t);return this._request.oauth.isAccessTokenExpired(s,n)?null:new Zt(this.config.env)}async isUsernameRegistered(e){if("string"!=typeof e)throw new ze({code:"PARAM_ERROR",message:"username must be a string"});const{data:t}=await this._request.send("auth.isUsernameRegistered",{username:e});return t&&t.isRegistered}getLoginState(){return Promise.resolve(this.hasLoginState())}async signInWithTicket(e){return new ts(this.config).signIn(e)}shouldRefreshAccessToken(e){this._request._shouldRefreshAccessTokenHook=e.bind(this)}getUserInfo(){return this._request.send("auth.getUserInfo",{}).then((e=>e.code?e:{...e.data,requestId:e.seqId}))}getAuthHeader(){const{refreshTokenKey:e,accessTokenKey:t}=this._cache.keys,s=this._cache.getStore(e);return{"x-cloudbase-credentials":this._cache.getStore(t)+"/@@/"+s}}_onAnonymousConverted(e){const{env:t}=e.data;t===this.config.env&&this._cache.updatePersistence(this.config.persistence)}_onLoginTypeChanged(e){const{loginType:t,persistence:s,env:n}=e.data;n===this.config.env&&(this._cache.updatePersistence(s),this._cache.setStore(this._cache.keys.loginTypeKey,t))}}const rs=function(e,t){t=t||mt();const s=Yt(this.config.env),{cloudPath:n,filePath:i,onUploadProgress:r,fileType:o="image"}=e;return s.send("storage.getUploadMetadata",{path:n}).then((e=>{const{data:{url:a,authorization:c,token:l,fileId:u,cosFileId:h},requestId:d}=e,p={key:n,signature:c,"x-cos-meta-fileid":h,success_action_status:"201","x-cos-security-token":l};s.upload({url:a,data:p,file:i,name:n,fileType:o,onUploadProgress:r}).then((e=>{201===e.statusCode?t(null,{fileID:u,requestId:d}):t(new ze({code:"STORAGE_REQUEST_FAIL",message:`STORAGE_REQUEST_FAIL: ${e.data}`}))})).catch((e=>{t(e)}))})).catch((e=>{t(e)})),t.promise},os=function(e,t){t=t||mt();const s=Yt(this.config.env),{cloudPath:n}=e;return s.send("storage.getUploadMetadata",{path:n}).then((e=>{t(null,e)})).catch((e=>{t(e)})),t.promise},as=function({fileList:e},t){if(t=t||mt(),!e||!Array.isArray(e))return{code:"INVALID_PARAM",message:"fileList必须是非空的数组"};for(let n of e)if(!n||"string"!=typeof n)return{code:"INVALID_PARAM",message:"fileList的元素必须是非空的字符串"};const s={fileid_list:e};return Yt(this.config.env).send("storage.batchDeleteFile",s).then((e=>{e.code?t(null,e):t(null,{fileList:e.data.delete_list,requestId:e.requestId})})).catch((e=>{t(e)})),t.promise},cs=function({fileList:e},t){t=t||mt(),e&&Array.isArray(e)||t(null,{code:"INVALID_PARAM",message:"fileList必须是非空的数组"});let s=[];for(let i of e)"object"==typeof i?(i.hasOwnProperty("fileID")&&i.hasOwnProperty("maxAge")||t(null,{code:"INVALID_PARAM",message:"fileList的元素必须是包含fileID和maxAge的对象"}),s.push({fileid:i.fileID,max_age:i.maxAge})):"string"==typeof i?s.push({fileid:i}):t(null,{code:"INVALID_PARAM",message:"fileList的元素必须是字符串"});const n={file_list:s};return Yt(this.config.env).send("storage.batchGetDownloadUrl",n).then((e=>{e.code?t(null,e):t(null,{fileList:e.data.download_list,requestId:e.requestId})})).catch((e=>{t(e)})),t.promise},ls=async function({fileID:e},t){const s=(await cs.call(this,{fileList:[{fileID:e,maxAge:600}]})).fileList[0];if("SUCCESS"!==s.code)return t?t(s):new Promise((e=>{e(s)}));const n=Yt(this.config.env);let i=s.download_url;if(i=encodeURI(i),!t)return n.download({url:i});t(await n.download({url:i}))},us=function({name:e,data:t,query:s,parse:n,search:i,timeout:r},o){const a=o||mt();let c;try{c=t?JSON.stringify(t):""}catch(u){return Promise.reject(u)}if(!e)return Promise.reject(new ze({code:"PARAM_ERROR",message:"函数名不能为空"}));const l={inQuery:s,parse:n,search:i,function_name:e,request_data:c};return Yt(this.config.env).send("functions.invokeFunction",l,{timeout:r}).then((e=>{if(e.code)a(null,e);else{let s=e.data.response_data;if(n)a(null,{result:s,requestId:e.requestId});else try{s=JSON.parse(e.data.response_data),a(null,{result:s,requestId:e.requestId})}catch(t){a(new ze({message:"response data must be json"}))}}return a.promise})).catch((e=>{a(e)})),a.promise},hs={timeout:15e3,persistence:"session"},ds={};class ps{constructor(e){this.config=e||this.config,this.authObj=void 0}init(e){switch(xt.adapter||(this.requestClient=new xt.adapter.reqClass({timeout:e.timeout||5e3,timeoutMsg:`请求在${(e.timeout||5e3)/1e3}s内未完成,已中断`})),this.config={...hs,...e},!0){case this.config.timeout>6e5:console.warn("timeout大于可配置上限[10分钟],已重置为上限数值"),this.config.timeout=6e5;break;case this.config.timeout<100:console.warn("timeout小于可配置下限[100ms],已重置为下限数值"),this.config.timeout=100}return new ps(this.config)}auth({persistence:e}={}){if(this.authObj)return this.authObj;const t=e||xt.adapter.primaryStorage||hs.persistence;var s;return t!==this.config.persistence&&(this.config.persistence=t),function(e){const{env:t}=e;Pt[t]=new St(e),At[t]=new St({...e,persistence:"local"})}(this.config),s=this.config,Qt[s.env]=new zt(s),this.authObj=new is(this.config),this.authObj}on(e,t){return Ft.apply(this,[e,t])}off(e,t){return Rt.apply(this,[e,t])}callFunction(e,t){return us.apply(this,[e,t])}deleteFile(e,t){return as.apply(this,[e,t])}getTempFileURL(e,t){return cs.apply(this,[e,t])}downloadFile(e,t){return ls.apply(this,[e,t])}uploadFile(e,t){return rs.apply(this,[e,t])}getUploadMetadata(e,t){return os.apply(this,[e,t])}registerExtension(e){ds[e.name]=e}async invokeExtension(e,t){const s=ds[e];if(!s)throw new ze({message:`扩展${e} 必须先注册`});return await s.invoke(t,this)}useAdapters(e){const{adapter:t,runtime:s}=function(e){const t=(s=e,"[object Array]"===Object.prototype.toString.call(s)?e:[e]);var s;for(const n of t){const{isMatch:e,genAdapter:t,runtime:s}=n;if(e())return{adapter:t(),runtime:s}}}(e)||{};t&&(xt.adapter=t),s&&(xt.runtime=s)}}var fs=new ps;function gs(e,t,s){void 0===s&&(s={});var n=/\?/.test(t),i="";for(var r in s)""===i?!n&&(t+="?"):i+="&",i+=r+"="+encodeURIComponent(s[r]);return/^http(s)?:\/\//.test(t+=i)?t:""+e+t}class ms{get(e){const{url:t,data:s,headers:n,timeout:i}=e;return new Promise(((e,r)=>{Qe.request({url:gs("https:",t),data:s,method:"GET",header:n,timeout:i,success(t){e(t)},fail(e){r(e)}})}))}post(e){const{url:t,data:s,headers:n,timeout:i}=e;return new Promise(((e,r)=>{Qe.request({url:gs("https:",t),data:s,method:"POST",header:n,timeout:i,success(t){e(t)},fail(e){r(e)}})}))}upload(e){return new Promise(((t,s)=>{const{url:n,file:i,data:r,headers:o,fileType:a}=e,c=Qe.uploadFile({url:gs("https:",n),name:"file",formData:Object.assign({},r),filePath:i,fileType:a,header:o,success(e){const s={statusCode:e.statusCode,data:e.data||{}};200===e.statusCode&&r.success_action_status&&(s.statusCode=parseInt(r.success_action_status,10)),t(s)},fail(e){s(new Error(e.errMsg||"uploadFile:fail"))}});"function"==typeof e.onUploadProgress&&c&&"function"==typeof c.onProgressUpdate&&c.onProgressUpdate((t=>{e.onUploadProgress({loaded:t.totalBytesSent,total:t.totalBytesExpectedToSend})}))}))}}const ys={setItem(e,t){Qe.setStorageSync(e,t)},getItem:e=>Qe.getStorageSync(e),removeItem(e){Qe.removeStorageSync(e)},clear(){Qe.clearStorageSync()}};var _s={genAdapter:function(){return{root:{},reqClass:ms,localStorage:ys,primaryStorage:"local"}},isMatch:function(){return!0},runtime:"uni_app"};fs.useAdapters(_s);const Ts=fs,ws=Ts.init;Ts.init=function(e){e.env=e.spaceId;const t=ws.call(this,e);t.config.provider="tencent",t.config.spaceId=e.spaceId;const s=t.auth;return t.auth=function(e){const t=s.call(this,e);return["linkAndRetrieveDataWithTicket","signInAnonymously","signOut","getAccessToken","getLoginState","signInWithTicket","getUserInfo"].forEach((e=>{var s;t[e]=(s=t[e],function(e){e=e||{};const{success:t,fail:n,complete:i}=We(e);if(!(t||n||i))return s.call(this,e);s.call(this,e).then((e=>{t&&t(e),i&&i(e)}),(e=>{n&&n(e),i&&i(e)}))}).bind(t)})),t},t.customAuth=t.auth,t};var vs=Ts;async function xs(e,t){const s=`http://${e}:${t}/system/ping`;try{const e=await(n={url:s,timeout:500},new Promise(((e,t)=>{Qe.request({...n,success(t){e(t)},fail(e){t(e)}})})));return!(!e.data||0!==e.data.code)}catch(i){return!1}var n}const bs={"serverless.file.resource.generateProximalSign":"storage/generate-proximal-sign","serverless.file.resource.report":"storage/report","serverless.file.resource.delete":"storage/delete","serverless.file.resource.getTempFileURL":"storage/get-temp-file-url"};var ks={init(e){const t=new class{constructor(e){if(["spaceId","clientSecret"].forEach((t=>{if(!Object.prototype.hasOwnProperty.call(e,t))throw new Error(`${t} required`)})),!e.endpoint)throw new Error("集群空间未配置ApiEndpoint,配置后需要重新关联服务空间后生效");this.config=Object.assign({},e),this.config.provider="dcloud",this.config.requestUrl=this.config.endpoint+"/client",this.config.envType=this.config.envType||"public",this.adapter=Qe}async request(e,t=!0){return e=this.setupRequest(e),Promise.resolve().then((()=>ot(e,this.adapter.request)))}requestLocal(e){return new Promise(((t,s)=>{this.adapter.request(Object.assign(e,{complete(e){if(e||(e={}),!e.statusCode||e.statusCode>=400){const t=e.data&&e.data.code||"SYS_ERR",n=e.data&&e.data.message||"request:fail";return s(new ze({code:t,message:n}))}t({success:!0,result:e.data})}}))}))}setupRequest(e){const t=Object.assign({},e,{spaceId:this.config.spaceId,timestamp:Date.now()}),s={"Content-Type":"application/json"};s["x-serverless-sign"]=rt(t,this.config.clientSecret);const n=it();s["x-client-info"]=encodeURIComponent(JSON.stringify(n));const{token:i}=Ge();return s["x-client-token"]=i,{url:this.config.requestUrl,method:"POST",data:t,dataType:"json",header:JSON.parse(JSON.stringify(s))}}async setupLocalRequest(e){const t=it(),{token:s}=Ge(),n=Object.assign({},e,{spaceId:this.config.spaceId,timestamp:Date.now(),clientInfo:t,token:s}),{address:i,servePort:r}=this.__dev__&&this.__dev__.debugInfo||{},{address:o}=await async function(e,t){let s;for(let n=0;n<e.length;n++){const i=e[n];if(await xs(i,t)){s=i;break}}return{address:s,port:t}}(i,r);return{url:`http://${o}:${r}/${bs[e.method]}`,method:"POST",data:n,dataType:"json",header:JSON.parse(JSON.stringify({"Content-Type":"application/json"}))}}callFunction(e){const t={method:"serverless.function.runtime.invoke",params:JSON.stringify({functionTarget:e.name,functionArgs:e.data||{}})};return this.request(t,!1)}getUploadFileOptions(e){const t={method:"serverless.file.resource.generateProximalSign",params:JSON.stringify(e)};return this.request(t)}reportUploadFile(e){const t={method:"serverless.file.resource.report",params:JSON.stringify(e)};return this.request(t)}uploadFile({filePath:e,cloudPath:t,fileType:s="image",onUploadProgress:n}){if(!t)throw new ze({code:"CLOUDPATH_REQUIRED",message:"cloudPath不可为空"});let i;return this.getUploadFileOptions({cloudPath:t}).then((t=>{const{url:r,formData:o,name:a}=t.result;return i=t.result.fileUrl,new Promise(((t,i)=>{const c=this.adapter.uploadFile({url:r,formData:o,name:a,filePath:e,fileType:s,success(e){e&&e.statusCode<400?t(e):i(new ze({code:"UPLOAD_FAILED",message:"文件上传失败"}))},fail(e){i(new ze({code:e.code||"UPLOAD_FAILED",message:e.message||e.errMsg||"文件上传失败"}))}});"function"==typeof n&&c&&"function"==typeof c.onProgressUpdate&&c.onProgressUpdate((e=>{n({loaded:e.totalBytesSent,total:e.totalBytesExpectedToSend})}))}))})).then((()=>this.reportUploadFile({cloudPath:t}))).then((t=>new Promise(((s,n)=>{t.success?s({success:!0,filePath:e,fileID:i}):n(new ze({code:"UPLOAD_FAILED",message:"文件上传失败"}))}))))}deleteFile({fileList:e}){const t={method:"serverless.file.resource.delete",params:JSON.stringify({fileList:e})};return this.request(t).then((e=>{if(e.success)return e.result;throw new ze({code:"DELETE_FILE_FAILED",message:"删除文件失败"})}))}getTempFileURL({fileList:e,maxAge:t}={}){if(!Array.isArray(e)||0===e.length)throw new ze({code:"INVALID_PARAM",message:"fileList的元素必须是非空的字符串"});const s={method:"serverless.file.resource.getTempFileURL",params:JSON.stringify({fileList:e,maxAge:t})};return this.request(s).then((e=>{if(e.success)return{fileList:e.result.fileList.map((e=>({fileID:e.fileID,tempFileURL:e.tempFileURL})))};throw new ze({code:"GET_TEMP_FILE_URL_FAILED",message:"获取临时文件链接失败"})}))}}(e),s={signInAnonymously:function(){return Promise.resolve()},getLoginState:function(){return Promise.resolve(!1)}};return t.auth=function(){return s},t.customAuth=t.auth,t}},Is=Z((function(e,t){e.exports=te.enc.Hex}));function Ss(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}function Ps(e="",t={}){const{data:s,functionName:n,method:i,headers:r,signHeaderKeys:o=[],config:a}=t,c=String(Date.now()),l=Ss(),u=Object.assign({},r,{"x-from-app-id":a.spaceAppId,"x-from-env-id":a.spaceId,"x-to-env-id":a.spaceId,"x-from-instance-id":c,"x-from-function-name":n,"x-client-timestamp":c,"x-alipay-source":"client","x-request-id":l,"x-alipay-callid":l,"x-trace-id":l}),h=["x-from-app-id","x-from-env-id","x-to-env-id","x-from-instance-id","x-from-function-name","x-client-timestamp"].concat(o),[d="",p=""]=e.split("?")||[],f=function(e){const t="HMAC-SHA256",s=e.signedHeaders.join(";"),n=e.signedHeaders.map((t=>`${t.toLowerCase()}:${e.headers[t]}\n`)).join(""),i=ft(e.body).toString(Is),r=`${e.method.toUpperCase()}\n${e.path}\n${e.query}\n${n}\n${s}\n${i}\n`,o=ft(r).toString(Is),a=`${t}\n${e.timestamp}\n${o}\n`,c=gt(a,e.secretKey).toString(Is);return`${t} Credential=${e.secretId}, SignedHeaders=${s}, Signature=${c}`}({path:d,query:p,method:i,headers:u,timestamp:c,body:JSON.stringify(s),secretId:a.accessKey,secretKey:a.secretKey,signedHeaders:h.sort()});return{url:`${a.endpoint}${e}`,headers:Object.assign({},u,{Authorization:f})}}function As({url:e,data:t,method:s="POST",headers:n={},timeout:i}){return new Promise(((r,o)=>{Qe.request({url:e,method:s,data:"object"==typeof t?JSON.stringify(t):t,header:n,dataType:"json",timeout:i,complete:(e={})=>{const t=n["x-trace-id"]||"";if(!e.statusCode||e.statusCode>=400){const{message:s,errMsg:n,trace_id:i}=e.data||{};return o(new ze({code:"SYS_ERR",message:s||n||"request:fail",requestId:i||t}))}r({status:e.statusCode,data:e.data,headers:e.header,requestId:t})}})}))}function Os(e,t){const{path:s,data:n,method:i="GET"}=e,{url:r,headers:o}=Ps(s,{functionName:"",data:n,method:i,headers:{"x-alipay-cloud-mode":"oss","x-data-api-type":"oss","x-expire-timestamp":Date.now()+6e4},signHeaderKeys:["x-data-api-type","x-expire-timestamp"],config:t});return As({url:r,data:n,method:i,headers:o}).then((e=>{const t=e.data||{};if(!t.success)throw new ze({code:e.errCode,message:e.errMsg,requestId:e.requestId});return t.data||{}})).catch((e=>{throw new ze({code:e.errCode,message:e.errMsg,requestId:e.requestId})}))}function Ls(e=""){const t=e.trim().replace(/^cloud:\/\//,""),s=t.indexOf("/");if(s<=0)throw new ze({code:"INVALID_PARAM",message:"fileID不合法"});const n=t.substring(0,s),i=t.substring(s+1);return n!==this.config.spaceId&&console.warn("file ".concat(e," does not belong to env ").concat(this.config.spaceId)),i}function Cs(e=""){return"cloud://".concat(this.config.spaceId,"/").concat(e.replace(/^\/+/,""))}class Es{constructor(e){this.config=e}signedURL(e,t={}){const s=`/ws/function/${e}`,n=this.config.wsEndpoint.replace(/^ws(s)?:\/\//,""),i=Object.assign({},t,{accessKeyId:this.config.accessKey,signatureNonce:Ss(),timestamp:""+Date.now()}),r=[s,["accessKeyId","authorization","signatureNonce","timestamp"].sort().map((function(e){return i[e]?"".concat(e,"=").concat(i[e]):null})).filter(Boolean).join("&"),`host:${n}`].join("\n"),o=["HMAC-SHA256",ft(r).toString(Is)].join("\n"),a=gt(o,this.config.secretKey).toString(Is),c=Object.keys(i).map((e=>`${e}=${encodeURIComponent(i[e])}`)).join("&");return`${this.config.wsEndpoint}${s}?${c}&signature=${a}`}}var Fs={init:e=>{e.provider="alipay";const t=new class{constructor(e){if(["spaceId","spaceAppId","accessKey","secretKey"].forEach((t=>{if(!Object.prototype.hasOwnProperty.call(e,t))throw new Error(`${t} required`)})),e.endpoint){if("string"!=typeof e.endpoint)throw new Error("endpoint must be string");if(!/^https:\/\//.test(e.endpoint))throw new Error("endpoint must start with https://");e.endpoint=e.endpoint.replace(/\/$/,"")}this.config=Object.assign({},e,{endpoint:e.endpoint||`https://${e.spaceId}.api-hz.cloudbasefunction.cn`,wsEndpoint:e.wsEndpoint||`wss://${e.spaceId}.api-hz.cloudbasefunction.cn`}),this._websocket=new Es(this.config)}callFunction(e){return function(e,t){const{name:s,data:n,async:i=!1,timeout:r}=e,o="POST",a={"x-to-function-name":s};i&&(a["x-function-invoke-type"]="async");const{url:c,headers:l}=Ps("/functions/invokeFunction",{functionName:s,data:n,method:o,headers:a,signHeaderKeys:["x-to-function-name"],config:t});return As({url:c,data:n,method:o,headers:l,timeout:r}).then((e=>{let t=0;if(i){const s=e.data||{};t="200"===s.errCode?0:s.errCode,e.data=s.data||{},e.errMsg=s.errMsg}if(0!==t)throw new ze({code:t,message:e.errMsg,requestId:e.requestId});return{errCode:t,success:0===t,requestId:e.requestId,result:e.data}})).catch((e=>{throw new ze({code:e.errCode,message:e.errMsg,requestId:e.requestId})}))}(e,this.config)}uploadFileToOSS({url:e,filePath:t,fileType:s,formData:n,onUploadProgress:i}){return new Promise(((r,o)=>{const a=Qe.uploadFile({url:e,filePath:t,fileType:s,formData:n,name:"file",success(e){e&&e.statusCode<400?r(e):o(new ze({code:"UPLOAD_FAILED",message:"文件上传失败"}))},fail(e){o(new ze({code:e.code||"UPLOAD_FAILED",message:e.message||e.errMsg||"文件上传失败"}))}});"function"==typeof i&&a&&"function"==typeof a.onProgressUpdate&&a.onProgressUpdate((e=>{i({loaded:e.totalBytesSent,total:e.totalBytesExpectedToSend})}))}))}async uploadFile({filePath:e,cloudPath:t="",fileType:s="image",onUploadProgress:n}){if("string"!==de(t))throw new ze({code:"INVALID_PARAM",message:"cloudPath必须为字符串类型"});if(!(t=t.trim()))throw new ze({code:"INVALID_PARAM",message:"cloudPath不可为空"});if(/:\/\//.test(t))throw new ze({code:"INVALID_PARAM",message:"cloudPath不合法"});const i=await Os({path:"/".concat(t.replace(/^\//,""),"?post_url")},this.config),{file_id:r,upload_url:o,form_data:a}=i,c=a&&a.reduce(((e,t)=>(e[t.key]=t.value,e)),{});return this.uploadFileToOSS({url:o,filePath:e,fileType:s,formData:c,onUploadProgress:n}).then((()=>({fileID:r})))}async getTempFileURL({fileList:e}){return new Promise(((t,s)=>{(!e||e.length<0)&&t({code:"INVALID_PARAM",message:"fileList不能为空数组"}),e.length>50&&t({code:"INVALID_PARAM",message:"fileList数组长度不能超过50"});const n=[];for(const r of e){let e;"string"!==de(r)&&t({code:"INVALID_PARAM",message:"fileList的元素必须是非空的字符串"});try{e=Ls.call(this,r)}catch(i){console.warn(i.errCode,i.errMsg),e=r}n.push({file_id:e,expire:600})}Os({path:"/?download_url",data:{file_list:n},method:"POST"},this.config).then((e=>{const{file_list:s=[]}=e;t({fileList:s.map((e=>({fileID:Cs.call(this,e.file_id),tempFileURL:e.download_url})))})})).catch((e=>s(e)))}))}async connectWebSocket(e){const{name:t,query:s}=e;return Qe.connectSocket({url:this._websocket.signedURL(t,s),complete:()=>{}})}}(e);return t.auth=function(){return{signInAnonymously:function(){return Promise.resolve()},getLoginState:function(){return Promise.resolve(!0)}}},t}};function Us({data:e}){let t;t=it();const s=JSON.parse(JSON.stringify(e||{}));if(Object.assign(s,{clientInfo:t}),!s.uniIdToken){const{token:e}=Ge();e&&(s.uniIdToken=e)}return s}const Rs=[{rule:/fc_function_not_found|FUNCTION_NOT_FOUND/,content:",云函数[{functionName}]在云端不存在,请检查此云函数名称是否正确以及该云函数是否已上传到服务空间",mode:"append"}];var Ds=/[\\^$.*+?()[\]{}|]/g,Ns=RegExp(Ds.source);function Ms(e,t,s){return e.replace(new RegExp((n=t)&&Ns.test(n)?n.replace(Ds,"\\$&"):n,"g"),s);var n}const Bs="request",qs="response",$s="both",js="_globalUniCloudStatus",Ks={code:2e4,message:"System error"},Vs={code:20101,message:"Invalid client"};function Hs(e){const{errSubject:t,subject:s,errCode:n,errMsg:i,code:r,message:o,cause:a}=e||{};return new ze({subject:t||s||"uni-secure-network",code:n||r||Ks.code,message:i||o,cause:a})}let Js;function Ws({secretType:e}={}){return e===Bs||e===qs||e===$s}function zs({functionName:e,result:t,logPvd:s}){}function Qs(e){const t=e.callFunction,s=function(s){const n=s.name;s.data=Us.call(e,{data:s.data});const i={aliyun:"aliyun",tencent:"tcb",tcb:"tcb",alipay:"alipay",dcloud:"dcloud"}[this.config.provider],r=Ws(s)||false;return t.call(this,s).then((e=>(e.errCode=0,!r&&zs.call(this,{functionName:n,result:e,logPvd:i}),Promise.resolve(e))),(e=>(!r&&zs.call(this,{functionName:n,result:e,logPvd:i}),e&&e.message&&(e.message=function({message:e="",extraInfo:t={},formatter:s=[]}={}){for(let n=0;n<s.length;n++){const{rule:i,content:r,mode:o}=s[n],a=e.match(i);if(!a)continue;let c=r;for(let e=1;e<a.length;e++)c=Ms(c,`{$${e}}`,a[e]);for(const e in t)c=Ms(c,`{${e}}`,t[e]);return"replace"===o?c:e+c}return e}({message:`[${s.name}]: ${e.message}`,formatter:Rs,extraInfo:{functionName:n}})),Promise.reject(e))))};e.callFunction=function(t){const{provider:n,spaceId:i}=e.config,r=t.name;let o,a;return t.data=t.data||{},o=s,o=o.bind(e),a=Ws(t)?new Js({secretType:t.secretType,uniCloudIns:e}).wrapEncryptDataCallFunction(s.bind(e))(t):function({provider:e,spaceId:t,functionName:s}={}){const{appId:n,uniPlatform:i,osName:r}=tt();let o=i;"app"===i&&(o=r);const a=function({provider:e,spaceId:t}={}){const s=we;if(!s)return{};e=function(e){return"tencent"===e?"tcb":e}(e);const n=s.find((s=>s.provider===e&&s.spaceId===t));return n&&n.config}({provider:e,spaceId:t});if(!a||!a.accessControl||!a.accessControl.enable)return!1;const c=a.accessControl.function||{},l=Object.keys(c);if(0===l.length)return!0;const u=function(e,t){let s,n,i;for(let r=0;r<e.length;r++){const o=e[r];o!==t?"*"!==o?o.split(",").map((e=>e.trim())).indexOf(t)>-1&&(n=o):i=o:s=o}return s||n||i}(l,s);if(!u)return!1;if((c[u]||[]).find(((e={})=>e.appId===n&&(e.platform||"").toLowerCase()===o.toLowerCase())))return!0;throw console.error(`此应用[appId: ${n}, platform: ${o}]不在云端配置的允许访问的应用列表内,参考:https://uniapp.dcloud.net.cn/uniCloud/secure-network.html#verify-client`),Hs(Vs)}({provider:n,spaceId:i,functionName:r})?new Js({secretType:t.secretType,uniCloudIns:e}).wrapVerifyClientCallFunction(s.bind(e))(t):o(t),Object.defineProperty(a,"result",{get:()=>(console.warn("当前返回结果为Promise类型,不可直接访问其result属性,详情请参考:https://uniapp.dcloud.net.cn/uniCloud/faq?id=promise"),{})}),a.then((e=>("undefined"!=typeof UTSJSONObject&&(e.result=new UTSJSONObject(e.result)),e)))}}Js=class{constructor(){throw Hs({message:"Platform web is not supported by secure network"})}};const Ys=Symbol("CLIENT_DB_INTERNAL");function Gs(e,t){return e.then="DoNotReturnProxyWithAFunctionNamedThen",e._internalType=Ys,e.inspect=null,e.__v_raw=void 0,new Proxy(e,{get(e,s,n){if("_uniClient"===s)return null;if("symbol"==typeof s)return e[s];if(s in e||"string"!=typeof s){const t=e[s];return"function"==typeof t?t.bind(e):t}return t.get(e,s,n)}})}function Xs(e){return{on:(t,s)=>{e[t]=e[t]||[],e[t].indexOf(s)>-1||e[t].push(s)},off:(t,s)=>{e[t]=e[t]||[];const n=e[t].indexOf(s);-1!==n&&e[t].splice(n,1)}}}const Zs=["db.Geo","db.command","command.aggregate"];function en(e,t){return Zs.indexOf(`${e}.${t}`)>-1}function tn(e){switch(de(e=Ye(e))){case"array":return e.map((e=>tn(e)));case"object":return e._internalType===Ys||Object.keys(e).forEach((t=>{e[t]=tn(e[t])})),e;case"regexp":return{$regexp:{source:e.source,flags:e.flags}};case"date":return{$date:e.toISOString()};default:return e}}function sn(e){return e&&e.content&&e.content.$method}class nn{constructor(e,t,s){this.content=e,this.prevStage=t||null,this.udb=null,this._database=s}toJSON(){let e=this;const t=[e.content];for(;e.prevStage;)e=e.prevStage,t.push(e.content);return{$db:t.reverse().map((e=>({$method:e.$method,$param:tn(e.$param)})))}}toString(){return JSON.stringify(this.toJSON())}getAction(){const e=this.toJSON().$db.find((e=>"action"===e.$method));return e&&e.$param&&e.$param[0]}getCommand(){return{$db:this.toJSON().$db.filter((e=>"action"!==e.$method))}}get isAggregate(){let e=this;for(;e;){const t=sn(e),s=sn(e.prevStage);if("aggregate"===t&&"collection"===s||"pipeline"===t)return!0;e=e.prevStage}return!1}get isCommand(){let e=this;for(;e;){if("command"===sn(e))return!0;e=e.prevStage}return!1}get isAggregateCommand(){let e=this;for(;e;){const t=sn(e),s=sn(e.prevStage);if("aggregate"===t&&"command"===s)return!0;e=e.prevStage}return!1}getNextStageFn(e){const t=this;return function(){return rn({$method:e,$param:tn(Array.from(arguments))},t,t._database)}}get count(){return this.isAggregate?this.getNextStageFn("count"):function(){return this._send("count",Array.from(arguments))}}get remove(){return this.isCommand?this.getNextStageFn("remove"):function(){return this._send("remove",Array.from(arguments))}}get(){return this._send("get",Array.from(arguments))}get add(){return this.isCommand?this.getNextStageFn("add"):function(){return this._send("add",Array.from(arguments))}}update(){return this._send("update",Array.from(arguments))}end(){return this._send("end",Array.from(arguments))}get set(){return this.isCommand?this.getNextStageFn("set"):function(){throw new Error("JQL禁止使用set方法")}}_send(e,t){const s=this.getAction(),n=this.getCommand();return n.$db.push({$method:e,$param:tn(t)}),this._database._callCloudFunction({action:s,command:n})}}function rn(e,t,s){return Gs(new nn(e,t,s),{get(e,t){let n="db";return e&&e.content&&(n=e.content.$method),en(n,t)?rn({$method:t},e,s):function(){return rn({$method:t,$param:tn(Array.from(arguments))},e,s)}}})}function on({path:e,method:t}){return class{constructor(){this.param=Array.from(arguments)}toJSON(){return{$newDb:[...e.map((e=>({$method:e}))),{$method:t,$param:this.param}]}}toString(){return JSON.stringify(this.toJSON())}}}function an(e,t={}){return Gs(new e(t),{get:(e,t)=>en("db",t)?rn({$method:t},null,e):function(){return rn({$method:t,$param:tn(Array.from(arguments))},null,e)}})}class cn extends class{constructor({uniClient:e={},isJQL:t=!1}={}){this._uniClient=e,this._authCallBacks={},this._dbCallBacks={},e._isDefault&&(this._dbCallBacks=Ie("_globalUniCloudDatabaseCallback")),t||(this.auth=Xs(this._authCallBacks)),this._isJQL=t,Object.assign(this,Xs(this._dbCallBacks)),this.env=Gs({},{get:(e,t)=>({$env:t})}),this.Geo=Gs({},{get:(e,t)=>on({path:["Geo"],method:t})}),this.serverDate=on({path:[],method:"serverDate"}),this.RegExp=on({path:[],method:"RegExp"})}getCloudEnv(e){if("string"!=typeof e||!e.trim())throw new Error("getCloudEnv参数错误");return{$env:e.replace("$cloudEnv_","")}}_callback(e,t){const s=this._dbCallBacks;s[e]&&s[e].forEach((e=>{e(...t)}))}_callbackAuth(e,t){const s=this._authCallBacks;s[e]&&s[e].forEach((e=>{e(...t)}))}multiSend(){const e=Array.from(arguments),t=e.map((e=>{const t=e.getAction(),s=e.getCommand();if("getTemp"!==s.$db[s.$db.length-1].$method)throw new Error("multiSend只支持子命令内使用getTemp");return{action:t,command:s}}));return this._callCloudFunction({multiCommand:t,queryList:e})}}{_parseResult(e){return this._isJQL?e.result:e}_callCloudFunction({action:e,command:t,multiCommand:s,queryList:n}){function i(e,t){if(s&&n)for(let s=0;s<n.length;s++){const i=n[s];i.udb&&"function"==typeof i.udb.setResult&&(t?i.udb.setResult(t):i.udb.setResult(e.result.dataList[s]))}}const r=this,o=this._isJQL?"databaseForJQL":"database";function a(e){return r._callback("error",[e]),Le(Ce(o,"fail"),e).then((()=>Le(Ce(o,"complete"),e))).then((()=>(i(null,e),Ke(Ue,{type:Ne,content:e}),Promise.reject(e))))}const c=Le(Ce(o,"invoke")),l=this._uniClient;return c.then((()=>l.callFunction({name:"DCloud-clientDB",type:le,data:{action:e,command:t,multiCommand:s}}))).then((e=>{const{code:t,message:s,token:n,tokenExpired:c,systemInfo:l=[]}=e.result;if(l)for(let i=0;i<l.length;i++){const{level:e,message:t,detail:s}=l[i];let n="[System Info]"+t;s&&(n=`${n}\n详细信息:${s}`),(console[e]||console.log)(n)}if(t)return a(new ze({code:t,message:s,requestId:e.requestId}));e.result.errCode=e.result.errCode||e.result.code,e.result.errMsg=e.result.errMsg||e.result.message,n&&c&&(Xe({token:n,tokenExpired:c}),this._callbackAuth("refreshToken",[{token:n,tokenExpired:c}]),this._callback("refreshToken",[{token:n,tokenExpired:c}]),Ke(De,{token:n,tokenExpired:c}));const u=[{prop:"affectedDocs",tips:"affectedDocs不再推荐使用,请使用inserted/deleted/updated/data.length替代"},{prop:"code",tips:"code不再推荐使用,请使用errCode替代"},{prop:"message",tips:"message不再推荐使用,请使用errMsg替代"}];for(let i=0;i<u.length;i++){const{prop:t,tips:s}=u[i];if(t in e.result){const n=e.result[t];Object.defineProperty(e.result,t,{get:()=>(console.warn(s),n)})}}return h=e,Le(Ce(o,"success"),h).then((()=>Le(Ce(o,"complete"),h))).then((()=>{i(h,null);const e=r._parseResult(h);return Ke(Ue,{type:Ne,content:e}),Promise.resolve(e)}));var h}),(e=>(/fc_function_not_found|FUNCTION_NOT_FOUND/g.test(e.message)&&console.warn("clientDB未初始化,请在web控制台保存一次schema以开启clientDB"),a(new ze({code:e.code||"SYSTEM_ERROR",message:e.message,requestId:e.requestId})))))}}const ln="token无效,跳转登录页面",un="token过期,跳转登录页面",hn={TOKEN_INVALID_TOKEN_EXPIRED:un,TOKEN_INVALID_INVALID_CLIENTID:ln,TOKEN_INVALID:ln,TOKEN_INVALID_WRONG_TOKEN:ln,TOKEN_INVALID_ANONYMOUS_USER:ln},dn={"uni-id-token-expired":un,"uni-id-check-token-failed":ln,"uni-id-token-not-exist":ln,"uni-id-check-device-feature-failed":ln};function pn(e,t){let s="";return s=e?`${e}/${t}`:t,s.replace(/^\//,"")}function fn(e=[],t=""){const s=[],n=[];return e.forEach((e=>{!0===e.needLogin?s.push(pn(t,e.path)):!1===e.needLogin&&n.push(pn(t,e.path))})),{needLoginPage:s,notNeedLoginPage:n}}function gn(e){return e.split("?")[0].replace(/^\//,"")}function mn(){return function(e){let t=e&&e.$page&&e.$page.fullPath||"";return t?("/"!==t.charAt(0)&&(t="/"+t),t):t}(function(){const e=s();return e[e.length-1]}())}function yn(){return gn(mn())}function _n(e="",t={}){if(!e)return!1;if(!(t&&t.list&&t.list.length))return!1;const s=t.list,n=gn(e);return s.some((e=>e.pagePath===n))}const Tn=!!X.uniIdRouter,{loginPage:wn,routerNeedLogin:vn,resToLogin:xn,needLoginPage:bn,notNeedLoginPage:kn,loginPageInTabBar:In}=function({pages:e=[],subPackages:t=[],uniIdRouter:s={},tabBar:n={}}=X){const{loginPage:i,needLogin:r=[],resToLogin:o=!0}=s,{needLoginPage:a,notNeedLoginPage:c}=fn(e),{needLoginPage:l,notNeedLoginPage:u}=function(e=[]){const t=[],s=[];return e.forEach((e=>{const{root:n,pages:i=[]}=e,{needLoginPage:r,notNeedLoginPage:o}=fn(i,n);t.push(...r),s.push(...o)})),{needLoginPage:t,notNeedLoginPage:s}}(t);return{loginPage:i,routerNeedLogin:r,resToLogin:o,needLoginPage:[...a,...l],notNeedLoginPage:[...c,...u],loginPageInTabBar:_n(i,n)}}();if(bn.indexOf(wn)>-1)throw new Error(`Login page [${wn}] should not be "needLogin", please check your pages.json`);function Sn(e){const t=yn();if("/"===e.charAt(0))return e;const[s,n]=e.split("?"),i=s.replace(/^\//,"").split("/"),r=t.split("/");r.pop();for(let o=0;o<i.length;o++){const e=i[o];".."===e?r.pop():"."!==e&&r.push(e)}return""===r[0]&&r.shift(),"/"+r.join("/")+(n?"?"+n:"")}function Pn({redirect:e}){const t=gn(e),s=gn(wn);return yn()!==s&&t!==s}function An({api:e,redirect:t}={}){if(!t||!Pn({redirect:t}))return;const s=(i=t,"/"!==(n=wn).charAt(0)&&(n="/"+n),i?n.indexOf("?")>-1?n+`&uniIdRedirectUrl=${encodeURIComponent(i)}`:n+`?uniIdRedirectUrl=${encodeURIComponent(i)}`:n);var n,i;In?"navigateTo"!==e&&"redirectTo"!==e||(e="switchTab"):"switchTab"===e&&(e="navigateTo");const r={navigateTo:T,redirectTo:w,switchTab:v,reLaunch:x};setTimeout((()=>{r[e]({url:s})}),0)}function On({url:e}={}){const t={abortLoginPageJump:!1,autoToLoginPage:!1},s=function(){const{token:e,tokenExpired:t}=Ge();let s;if(e){if(t<Date.now()){const e="uni-id-token-expired";s={errCode:e,errMsg:dn[e]}}}else{const e="uni-id-check-token-failed";s={errCode:e,errMsg:dn[e]}}return s}();if(function(e){const t=gn(Sn(e));return!(kn.indexOf(t)>-1)&&(bn.indexOf(t)>-1||vn.some((t=>{return s=e,new RegExp(t).test(s);var s})))}(e)&&s){if(s.uniIdRedirectUrl=e,qe(Re).length>0)return setTimeout((()=>{Ke(Re,s)}),0),t.abortLoginPageJump=!0,t;t.autoToLoginPage=!0}return t}function Ln(){!function(){const e=mn(),{abortLoginPageJump:t,autoToLoginPage:s}=On({url:e});t||s&&An({api:"redirectTo",redirect:e})}();const e=["navigateTo","redirectTo","reLaunch","switchTab"];for(let t=0;t<e.length;t++){const s=e[t];n(s,{invoke(e){const{abortLoginPageJump:t,autoToLoginPage:n}=On({url:e.url});return t?e:n?(An({api:s,redirect:Sn(e.url)}),!1):e}})}}function Cn(){this.onResponse((e=>{const{type:t,content:s}=e;let n=!1;switch(t){case"cloudobject":n=function(e){if("object"!=typeof e)return!1;const{errCode:t}=e||{};return t in dn}(s);break;case"clientdb":n=function(e){if("object"!=typeof e)return!1;const{errCode:t}=e||{};return t in hn}(s)}n&&function(e={}){const t=qe(Re);Je().then((()=>{const s=mn();if(s&&Pn({redirect:s}))return t.length>0?Ke(Re,Object.assign({uniIdRedirectUrl:s},e)):void(wn&&An({api:"navigateTo",redirect:s}))}))}(s)}))}function En(e){var t;(t=e).onResponse=function(e){$e(Ue,e)},t.offResponse=function(e){je(Ue,e)},function(e){e.onNeedLogin=function(e){$e(Re,e)},e.offNeedLogin=function(e){je(Re,e)},Tn&&(Ie(js).needLoginInit||(Ie(js).needLoginInit=!0,Je().then((()=>{Ln.call(e)})),xn&&Cn.call(e)))}(e),function(e){e.onRefreshToken=function(e){$e(De,e)},e.offRefreshToken=function(e){je(De,e)}}(e)}let Fn;const Un="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Rn=/^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;function Dn(){const e=Ge().token||"",t=e.split(".");if(!e||3!==t.length)return{uid:null,role:[],permission:[],tokenExpired:0};let s;try{s=JSON.parse((n=t[1],decodeURIComponent(Fn(n).split("").map((function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join(""))))}catch(i){throw new Error("获取当前用户信息出错,详细错误信息为:"+i.message)}var n;return s.tokenExpired=1e3*s.exp,delete s.exp,delete s.iat,s}Fn="function"!=typeof atob?function(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!Rn.test(e))throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");var t;e+="==".slice(2-(3&e.length));for(var s,n,i="",r=0;r<e.length;)t=Un.indexOf(e.charAt(r++))<<18|Un.indexOf(e.charAt(r++))<<12|(s=Un.indexOf(e.charAt(r++)))<<6|(n=Un.indexOf(e.charAt(r++))),i+=64===s?String.fromCharCode(t>>16&255):64===n?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return i}:atob;var Nn=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(Z((function(s,n){Object.defineProperty(n,"__esModule",{value:!0});const r="chooseAndUploadFile:ok",o="chooseAndUploadFile:fail";function a(e,t){return e.tempFiles.forEach(((e,s)=>{e.name||(e.name=e.path.substring(e.path.lastIndexOf("/")+1)),t&&(e.fileType=t),e.cloudPath=Date.now()+"_"+s+e.name.substring(e.name.lastIndexOf("."))})),e.tempFilePaths||(e.tempFilePaths=e.tempFiles.map((e=>e.path))),e}function c(e,t,{onChooseFile:s,onUploadProgress:n}){return t.then((e=>{if(s){const t=s(e);if(void 0!==t)return Promise.resolve(t).then((t=>void 0===t?e:t))}return e})).then((t=>!1===t?{errMsg:r,tempFilePaths:[],tempFiles:[]}:function(e,t,s=5,n){(t=Object.assign({},t)).errMsg=r;const i=t.tempFiles,o=i.length;let a=0;return new Promise((r=>{for(;a<s;)c();function c(){const s=a++;if(s>=o)return void(!i.find((e=>!e.url&&!e.errMsg))&&r(t));const l=i[s];e.uploadFile({provider:l.provider,filePath:l.path,cloudPath:l.cloudPath,fileType:l.fileType,cloudPathAsRealPath:l.cloudPathAsRealPath,onUploadProgress(e){e.index=s,e.tempFile=l,e.tempFilePath=l.path,n&&n(e)}}).then((e=>{l.url=e.fileID,s<o&&c()})).catch((e=>{l.errMsg=e.errMsg||e.message,s<o&&c()}))}}))}(e,t,5,n)))}n.initChooseAndUploadFile=function(s){return function(n={type:"all"}){return"image"===n.type?c(s,function(t){const{count:s,sizeType:n,sourceType:i=["album","camera"],extension:r}=t;return new Promise(((t,c)=>{e({count:s,sizeType:n,sourceType:i,extension:r,success(e){t(a(e,"image"))},fail(e){c({errMsg:e.errMsg.replace("chooseImage:fail",o)})}})}))}(n),n):"video"===n.type?c(s,function(e){const{camera:s,compressed:n,maxDuration:i,sourceType:r=["album","camera"],extension:c}=e;return new Promise(((e,l)=>{t({camera:s,compressed:n,maxDuration:i,sourceType:r,extension:c,success(t){const{tempFilePath:s,duration:n,size:i,height:r,width:o}=t;e(a({errMsg:"chooseVideo:ok",tempFilePaths:[s],tempFiles:[{name:t.tempFile&&t.tempFile.name||"",path:s,size:i,type:t.tempFile&&t.tempFile.type||"",width:o,height:r,duration:n,fileType:"video",cloudPath:""}]},"video"))},fail(e){l({errMsg:e.errMsg.replace("chooseVideo:fail",o)})}})}))}(n),n):c(s,function(e){const{count:t,extension:s}=e;return new Promise(((e,n)=>{let r=i;if("undefined"!=typeof wx&&"function"==typeof wx.chooseMessageFile&&(r=wx.chooseMessageFile),"function"!=typeof r)return n({errMsg:o+" 请指定 type 类型,该平台仅支持选择 image 或 video。"});r({type:"all",count:t,extension:s,success(t){e(a(t))},fail(e){n({errMsg:e.errMsg.replace("chooseFile:fail",o)})}})}))}(n),n)}}})));const Mn="manual";function Bn(e){return{props:{localdata:{type:Array,default:()=>[]},options:{type:[Object,Array],default:()=>({})},spaceInfo:{type:Object,default:()=>({})},collection:{type:[String,Array],default:""},action:{type:String,default:""},field:{type:String,default:""},orderby:{type:String,default:""},where:{type:[String,Object],default:""},pageData:{type:String,default:"add"},pageCurrent:{type:Number,default:1},pageSize:{type:Number,default:20},getcount:{type:[Boolean,String],default:!1},gettree:{type:[Boolean,String],default:!1},gettreepath:{type:[Boolean,String],default:!1},startwith:{type:String,default:""},limitlevel:{type:Number,default:10},groupby:{type:String,default:""},groupField:{type:String,default:""},distinct:{type:[Boolean,String],default:!1},foreignKey:{type:String,default:""},loadtime:{type:String,default:"auto"},manual:{type:Boolean,default:!1}},data:()=>({mixinDatacomLoading:!1,mixinDatacomHasMore:!1,mixinDatacomResData:[],mixinDatacomErrorMessage:"",mixinDatacomPage:{},mixinDatacomError:null}),created(){this.mixinDatacomPage={current:this.pageCurrent,size:this.pageSize,count:0},this.$watch((()=>{var e=[];return["pageCurrent","pageSize","localdata","collection","action","field","orderby","where","getont","getcount","gettree","groupby","groupField","distinct"].forEach((t=>{e.push(this[t])})),e}),((e,t)=>{if(this.loadtime===Mn)return;let s=!1;const n=[];for(let i=2;i<e.length;i++)e[i]!==t[i]&&(n.push(e[i]),s=!0);e[0]!==t[0]&&(this.mixinDatacomPage.current=this.pageCurrent),this.mixinDatacomPage.size=this.pageSize,this.onMixinDatacomPropsChange(s,n)}))},methods:{onMixinDatacomPropsChange(e,t){},mixinDatacomEasyGet({getone:e=!1,success:t,fail:s}={}){this.mixinDatacomLoading||(this.mixinDatacomLoading=!0,this.mixinDatacomErrorMessage="",this.mixinDatacomError=null,this.mixinDatacomGet().then((s=>{this.mixinDatacomLoading=!1;const{data:n,count:i}=s.result;this.getcount&&(this.mixinDatacomPage.count=i),this.mixinDatacomHasMore=n.length<this.pageSize;const r=e?n.length?n[0]:void 0:n;this.mixinDatacomResData=r,t&&t(r)})).catch((e=>{this.mixinDatacomLoading=!1,this.mixinDatacomErrorMessage=e,this.mixinDatacomError=e,s&&s(e)})))},mixinDatacomGet(t={}){let s;t=t||{},s="undefined"!=typeof __uniX&&__uniX?e.databaseForJQL(this.spaceInfo):e.database(this.spaceInfo);const n=t.action||this.action;n&&(s=s.action(n));const i=t.collection||this.collection;s=Array.isArray(i)?s.collection(...i):s.collection(i);const r=t.where||this.where;r&&Object.keys(r).length&&(s=s.where(r));const o=t.field||this.field;o&&(s=s.field(o));const a=t.foreignKey||this.foreignKey;a&&(s=s.foreignKey(a));const c=t.groupby||this.groupby;c&&(s=s.groupBy(c));const l=t.groupField||this.groupField;l&&(s=s.groupField(l)),!0===(void 0!==t.distinct?t.distinct:this.distinct)&&(s=s.distinct());const u=t.orderby||this.orderby;u&&(s=s.orderBy(u));const h=void 0!==t.pageCurrent?t.pageCurrent:this.mixinDatacomPage.current,d=void 0!==t.pageSize?t.pageSize:this.mixinDatacomPage.size,p=void 0!==t.getcount?t.getcount:this.getcount,f=void 0!==t.gettree?t.gettree:this.gettree,g=void 0!==t.gettreepath?t.gettreepath:this.gettreepath,m={getCount:p},y={limitLevel:void 0!==t.limitlevel?t.limitlevel:this.limitlevel,startWith:void 0!==t.startwith?t.startwith:this.startwith};return f&&(m.getTree=y),g&&(m.getTreePath=y),s=s.skip(d*(h-1)).limit(d).get(m),s}}}}function qn(e){return Ie("_globalUniCloudSecureNetworkCache__{spaceId}".replace("{spaceId}",e.config.spaceId))}async function $n({openid:e,callLoginByWeixin:t=!1}={}){throw qn(this),new Error("[SecureNetwork] API `initSecureNetworkByWeixin` is not supported on platform `web`")}async function jn(e){const t=qn(this);return t.initPromise||(t.initPromise=$n.call(this,e).then((e=>e)).catch((e=>{throw delete t.initPromise,e}))),t.initPromise}function Kn(e){nt=e}function Vn(e){const t={getSystemInfo:b,getPushClientId:k};return function(s){return new Promise(((n,i)=>{t[e]({...s,success(e){n(e)},fail(e){i(e)}})}))}}class Hn extends class{constructor(){this._callback={}}addListener(e,t){this._callback[e]||(this._callback[e]=[]),this._callback[e].push(t)}on(e,t){return this.addListener(e,t)}removeListener(e,t){if(!t)throw new Error('The "listener" argument must be of type function. Received undefined');const s=this._callback[e];if(!s)return;const n=function(e,t){for(let s=e.length-1;s>=0;s--)if(e[s]===t)return s;return-1}(s,t);s.splice(n,1)}off(e,t){return this.removeListener(e,t)}removeAllListener(e){delete this._callback[e]}emit(e,...t){const s=this._callback[e];if(s)for(let n=0;n<s.length;n++)s[n](...t)}}{constructor(){super(),this._uniPushMessageCallback=this._receivePushMessage.bind(this),this._currentMessageId=-1,this._payloadQueue=[]}init(){return Promise.all([Vn("getSystemInfo")(),Vn("getPushClientId")()]).then((([{appId:e}={},{cid:t}={}]=[])=>{if(!e)throw new Error("Invalid appId, please check the manifest.json file");if(!t)throw new Error("Invalid push client id");this._appId=e,this._pushClientId=t,this._seqId=Date.now()+"-"+Math.floor(9e5*Math.random()+1e5),this.emit("open"),this._initMessageListener()}),(e=>{throw this.emit("error",e),this.close(),e}))}async open(){return this.init()}_isUniCloudSSE(e){if("receive"!==e.type)return!1;const t=e&&e.data&&e.data.payload;return!(!t||"UNI_CLOUD_SSE"!==t.channel||t.seqId!==this._seqId)}_receivePushMessage(e){if(!this._isUniCloudSSE(e))return;const t=e&&e.data&&e.data.payload,{action:s,messageId:n,message:i}=t;this._payloadQueue.push({action:s,messageId:n,message:i}),this._consumMessage()}_consumMessage(){for(;;){const e=this._payloadQueue.find((e=>e.messageId===this._currentMessageId+1));if(!e)break;this._currentMessageId++,this._parseMessagePayload(e)}}_parseMessagePayload(e){const{action:t,messageId:s,message:n}=e;"end"===t?this._end({messageId:s,message:n}):"message"===t&&this._appendMessage({messageId:s,message:n})}_appendMessage({messageId:e,message:t}={}){this.emit("message",t)}_end({messageId:e,message:t}={}){this.emit("end",t),this.close()}_initMessageListener(){l(this._uniPushMessageCallback)}_destroy(){u(this._uniPushMessageCallback)}toJSON(){return{appId:this._appId,pushClientId:this._pushClientId,seqId:this._seqId}}close(){this._destroy(),this.emit("close")}}const Jn={tcb:vs,tencent:vs,aliyun:ct,private:ks,dcloud:ks,alipay:Fs};let Wn=new class{init(e){let t={};const s=Jn[e.provider];if(!s)throw new Error("未提供正确的provider参数");var n;return t=s.init(e),function(e){e._initPromiseHub||(e._initPromiseHub=new _e({createPromise:function(){let t=Promise.resolve();t=new Promise((e=>{setTimeout((()=>{e()}),1)}));const s=e.auth();return t.then((()=>s.getLoginState())).then((e=>e?Promise.resolve():s.signInAnonymously()))}}))}(t),Qs(t),function(e){const t=e.uploadFile;e.uploadFile=function(e){return t.call(this,e)}}(t),(n=t).database=function(e){if(e&&Object.keys(e).length>0)return n.init(e).database();if(this._database)return this._database;const t=an(cn,{uniClient:n});return this._database=t,t},n.databaseForJQL=function(e){if(e&&Object.keys(e).length>0)return n.init(e).databaseForJQL();if(this._databaseForJQL)return this._databaseForJQL;const t=an(cn,{uniClient:n,isJQL:!0});return this._databaseForJQL=t,t},function(e){e.getCurrentUserInfo=Dn,e.chooseAndUploadFile=Nn.initChooseAndUploadFile(e),Object.assign(e,{get mixinDatacom(){return Bn(e)}}),e.SSEChannel=Hn,e.initSecureNetworkByWeixin=function(e){return function({openid:t,callLoginByWeixin:s=!1}={}){return jn.call(e,{openid:t,callLoginByWeixin:s})}}(e),e.setCustomClientInfo=Kn,e.importObject=function(t){return function(s,n={}){n=function(e,t={}){return e.customUI=t.customUI||e.customUI,e.parseSystemError=t.parseSystemError||e.parseSystemError,Object.assign(e.loadingOptions,t.loadingOptions),Object.assign(e.errorOptions,t.errorOptions),"object"==typeof t.secretMethods&&(e.secretMethods=t.secretMethods),e}({customUI:!1,loadingOptions:{title:"加载中...",mask:!0},errorOptions:{type:"modal",retry:!1}},n);const{customUI:i,loadingOptions:l,errorOptions:u,parseSystemError:h}=n,d=!i;return new Proxy({},{get(i,p){switch(p){case"toString":return"[object UniCloudObject]";case"toJSON":return{}}return function({fn:e,interceptorName:t,getCallbackArgs:s}={}){return async function(...n){const i=s?s({params:n}):{};let r,o;try{return await Le(Ce(t,"invoke"),{...i}),r=await e(...n),await Le(Ce(t,"success"),{...i,result:r}),r}catch(a){throw o=a,await Le(Ce(t,"fail"),{...i,error:o}),o}finally{await Le(Ce(t,"complete"),o?{...i,error:o}:{...i,result:r})}}}({fn:async function i(...f){let g;d&&r({title:l.title,mask:l.mask});const m={name:s,type:ce,data:{method:p,params:f}};"object"==typeof n.secretMethods&&function(e,t){const s=t.data.method,n=e.secretMethods||{},i=n[s]||n["*"];i&&(t.secretType=i)}(n,m);let y=!1;try{g=await t.callFunction(m)}catch(e){y=!0,g={result:new ze(e)}}const{errSubject:_,errCode:T,errMsg:w,newToken:v}=g.result||{};if(d&&o(),v&&v.token&&v.tokenExpired&&(Xe(v),Ke(De,{...v})),T){let e=w;if(y&&h&&(e=(await h({objectName:s,methodName:p,params:f,errSubject:_,errCode:T,errMsg:w})).errMsg||w),d)if("toast"===u.type)a({title:e,icon:"none"});else{if("modal"!==u.type)throw new Error(`Invalid errorOptions.type: ${u.type}`);{const{confirm:t}=await async function({title:e,content:t,showCancel:s,cancelText:n,confirmText:i}={}){return new Promise(((r,o)=>{c({title:e,content:t,showCancel:s,cancelText:n,confirmText:i,success(e){r(e)},fail(){r({confirm:!1,cancel:!0})}})}))}({title:"提示",content:e,showCancel:u.retry,cancelText:"取消",confirmText:u.retry?"重试":"确定"});if(u.retry&&t)return i(...f)}}const t=new ze({subject:_,code:T,message:w,requestId:g.requestId});throw t.detail=g.result,Ke(Ue,{type:Be,content:t}),t}return Ke(Ue,{type:Be,content:g.result}),g.result},interceptorName:"callObject",getCallbackArgs:function({params:e}={}){return{objectName:s,methodName:p,params:e}}})}})}}(e)}(t),["callFunction","uploadFile","deleteFile","getTempFileURL","downloadFile","chooseAndUploadFile"].forEach((e=>{if(!t[e])return;const s=t[e];t[e]=function(){return s.apply(t,Array.from(arguments))},t[e]=function(e,t){return function(s){let n=!1;if("callFunction"===t){const e=s&&s.type||ae;n=e!==ae}const i="callFunction"===t&&!n,r=this._initPromiseHub.exec();s=s||{};const{success:o,fail:a,complete:c}=We(s),l=r.then((()=>n?Promise.resolve():Le(Ce(t,"invoke"),s))).then((()=>e.call(this,s))).then((e=>n?Promise.resolve(e):Le(Ce(t,"success"),e).then((()=>Le(Ce(t,"complete"),e))).then((()=>(i&&Ke(Ue,{type:Me,content:e}),Promise.resolve(e))))),(e=>n?Promise.reject(e):Le(Ce(t,"fail"),e).then((()=>Le(Ce(t,"complete"),e))).then((()=>(Ke(Ue,{type:Me,content:e}),Promise.reject(e))))));if(!(o||a||c))return l;l.then((e=>{o&&o(e),c&&c(e),i&&Ke(Ue,{type:Me,content:e})}),(e=>{a&&a(e),c&&c(e),i&&Ke(Ue,{type:Me,content:e})}))}}(t[e],e).bind(t)})),t.init=this.init,t}};(()=>{const e=ve;let t={};if(e&&1===e.length)t=e[0],Wn=Wn.init(t),Wn._isDefault=!0;else{const t=["auth","callFunction","uploadFile","deleteFile","getTempFileURL","downloadFile","database","getCurrentUSerInfo","importObject"];let s;s=e&&e.length>0?"应用有多个服务空间,请通过uniCloud.init方法指定要使用的服务空间":"应用未关联服务空间,请在uniCloud目录右键关联服务空间",t.forEach((e=>{Wn[e]=function(){return console.error(s),Promise.reject(new ze({code:"SYS_ERR",message:s}))}}))}Object.assign(Wn,{get mixinDatacom(){return Bn(Wn)}}),En(Wn),Wn.addInterceptor=Ae,Wn.removeInterceptor=Oe,Wn.interceptObject=Ee;{const e=be||(be=function(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;function e(){return this}return void 0!==e()?e():new Function("return this")()}(),be);e.uniCloud=Wn,e.UniCloudError=ze}})();var zn=Wn;const Qn="chooseAndUploadFile:fail";function Yn(e,t){return e.tempFiles.forEach(((e,s)=>{e.name||(e.name=e.path.substring(e.path.lastIndexOf("/")+1)),t&&(e.fileType=t),e.cloudPath=Date.now()+"_"+s+e.name.substring(e.name.lastIndexOf("."))})),e.tempFilePaths||(e.tempFilePaths=e.tempFiles.map((e=>e.path))),e}function Gn(e,t=5,s){const n=(e=JSON.parse(JSON.stringify(e))).length;let i=0,r=this;return new Promise((o=>{for(;i<t;)a();function a(){let t=i++;if(t>=n)return void(!e.find((e=>!e.url&&!e.errMsg))&&o(e));const c=e[t],l=r.files.findIndex((e=>e.uuid===c.uuid));c.url="",delete c.errMsg,zn.uploadFile({filePath:c.path,cloudPath:c.cloudPath,fileType:c.fileType,onUploadProgress:e=>{e.index=l,s&&s(e)}}).then((e=>{c.url=e.fileID,c.index=l,t<n&&a()})).catch((e=>{c.errMsg=e.errMsg||e.message,c.index=l,t<n&&a()}))}}))}function Xn(e,{onChooseFile:t,onUploadProgress:s}){return e.then((e=>{if(t){const s=t(e);if(void 0!==s)return Promise.resolve(s).then((t=>void 0===t?e:t))}return e})).then((e=>!1===e?{errMsg:"chooseAndUploadFile:ok",tempFilePaths:[],tempFiles:[]}:e)).then((async e=>{for(let t of e.tempFiles){const{data:e}=await P.uploadFile(t.path);t.url=e}return e}))}function Zn(s={type:"all"}){return"image"===s.type?Xn(function(t){const{count:s,sizeType:n=["original","compressed"],sourceType:i=["album","camera"],extension:r}=t;return new Promise(((t,o)=>{e({count:s,sizeType:n,sourceType:i,extension:r,success(e){t(Yn(e,"image"))},fail(e){o({errMsg:e.errMsg.replace("chooseImage:fail",Qn)})}})}))}(s),s):"video"===s.type?Xn(function(e){const{camera:s,compressed:n,maxDuration:i,sourceType:r=["album","camera"],extension:o}=e;return new Promise(((e,a)=>{t({camera:s,compressed:n,maxDuration:i,sourceType:r,extension:o,success(t){const{tempFilePath:s,duration:n,size:i,height:r,width:o}=t;e(Yn({errMsg:"chooseVideo:ok",tempFilePaths:[s],tempFiles:[{name:t.tempFile&&t.tempFile.name||"",path:s,size:i,type:t.tempFile&&t.tempFile.type||"",width:o,height:r,duration:n,fileType:"video",cloudPath:""}]},"video"))},fail(e){a({errMsg:e.errMsg.replace("chooseVideo:fail",Qn)})}})}))}(s),s):Xn(function(e){const{count:t,extension:s}=e;return new Promise(((e,n)=>{let r=i;if("undefined"!=typeof wx&&"function"==typeof wx.chooseMessageFile&&(r=wx.chooseMessageFile),"function"!=typeof r)return n({errMsg:Qn+" 请指定 type 类型,该平台仅支持选择 image 或 video。"});r({type:"all",count:t,extension:s,success(t){e(Yn(t))},fail(e){n({errMsg:e.errMsg.replace("chooseFile:fail",Qn)})}})}))}(s),s)}const ei=e=>{const t=e.lastIndexOf("."),s=e.length;return{name:e.substring(0,t),ext:e.substring(t+1,s)}},ti=e=>{if(Array.isArray(e))return e;return e.replace(/(\[|\])/g,"").split(",")},si=async(e,t="image")=>{const s=ei(e.name).ext.toLowerCase();let n={name:e.name,uuid:e.uuid,extname:s||"",cloudPath:e.cloudPath,fileType:e.fileType,url:e.path||e.path,size:e.size,image:{},path:e.path,video:{}};if("image"===t){const t=await(i=e.path,new Promise(((e,t)=>{A({src:i,success(t){e(t)},fail(e){t(e)}})})));delete n.video,n.image.width=t.width,n.image.height=t.height,n.image.location=t.path}else delete n.image;var i;return n};const ni=G({name:"sUploader",components:{uploadImage:G({name:"uploadImage",emits:["uploadFiles","choose","delFile"],props:{filesList:{type:[Array,String],default:()=>[]},disabled:{type:Boolean,default:!1},disablePreview:{type:Boolean,default:!1},limit:{type:[Number,String],default:9},imageStyles:{type:Object,default:()=>({width:"auto",height:"auto",border:{}})},delIcon:{type:Boolean,default:!0},readonly:{type:Boolean,default:!1}},computed:{list(){return"string"==typeof this.filesList?this.filesList?[this.filesList]:[]:this.filesList},styles(){return Object.assign({width:"auto",height:"auto",border:{}},this.imageStyles)},boxStyle(){const{width:e="auto",height:t="auto"}=this.styles;let s={};"auto"===t?"auto"!==e?(s.height=this.value2px(e),s["padding-top"]=0):s.height=0:(s.height=this.value2px(t),s["padding-top"]=0),s.width="auto"===e?"auto"!==t?this.value2px(t):"33.3%":this.value2px(e);let n="";for(let i in s)n+=`${i}:${s[i]};`;return n},borderStyle(){let{border:e}=this.styles,t={};if("boolean"==typeof e)t.border=e?"1px #eee solid":"none";else{let s=e&&e.width||1;s=this.value2px(s);let n=e&&e.radius||3;n=this.value2px(n),t={"border-width":s,"border-style":e&&e.style||"solid","border-color":e&&e.color||"#eee","border-radius":n}}let s="";for(let n in t)s+=`${n}:${t[n]};`;return s}},methods:{getImageUrl:e=>"blob:http:"===e.substr(0,10)?e:O.$url.cdn(e),uploadFiles(e,t){this.$emit("uploadFiles",e)},choose(){this.$emit("choose")},delFile(e){this.$emit("delFile",e)},previewImage(e,t){let s=[];1===Number(this.limit)&&this.disablePreview&&!this.disabled&&this.$emit("choose"),this.disablePreview||(this.list.forEach((e=>{s.push(this.getImageUrl(e))})),L({urls:s,current:t}))},value2px:e=>("number"==typeof e?e+="px":-1===e.indexOf("%")&&(e=-1!==e.indexOf("px")?e:e+"px"),e)}},[["render",function(e,t,s,n,i,r){const o=j,a=K;return C(),E(a,{class:"uni-file-picker__container"},{default:F((()=>[(C(!0),U(R,null,D(r.list,((e,t)=>(C(),E(a,{class:"file-picker__box",key:t,style:N(r.boxStyle)},{default:F((()=>[M(a,{class:"file-picker__box-content",style:N(r.borderStyle)},{default:F((()=>[M(o,{class:"file-image",src:r.getImageUrl(e),mode:"aspectFill",onClick:B((s=>r.previewImage(e,t)),["stop"])},null,8,["src","onClick"]),s.delIcon&&!s.readonly?(C(),E(a,{key:0,class:"icon-del-box",onClick:B((e=>r.delFile(t)),["stop"])},{default:F((()=>[M(a,{class:"icon-del"}),M(a,{class:"icon-del rotate"})])),_:2},1032,["onClick"])):q("",!0)])),_:2},1032,["style"])])),_:2},1032,["style"])))),128)),r.list.length<s.limit&&!s.readonly?(C(),E(a,{key:0,class:"file-picker__box",style:N(r.boxStyle)},{default:F((()=>[M(a,{class:"file-picker__box-content is-add",style:N(r.borderStyle),onClick:r.choose},{default:F((()=>[$(e.$slots,"default",{},(()=>[M(a,{class:"icon-add"}),M(a,{class:"icon-add rotate"})]),!0)])),_:3},8,["style","onClick"])])),_:3},8,["style"])):q("",!0)])),_:3})}],["__scopeId","data-v-948a7290"]]),uploadFile:G({name:"uploadFile",emits:["uploadFiles","choose","delFile"],props:{filesList:{type:Array,default:()=>[]},delIcon:{type:Boolean,default:!0},limit:{type:[Number,String],default:9},showType:{type:String,default:""},listStyles:{type:Object,default:()=>({border:!0,dividline:!0,borderStyle:{}})},readonly:{type:Boolean,default:!1}},computed:{list(){let e=[];return this.filesList.forEach((t=>{e.push(t)})),e},styles(){return Object.assign({border:!0,dividline:!0,"border-style":{}},this.listStyles)},borderStyle(){let{borderStyle:e,border:t}=this.styles,s={};if(t){let t=e&&e.width||1;t=this.value2px(t);let n=e&&e.radius||5;n=this.value2px(n),s={"border-width":t,"border-style":e&&e.style||"solid","border-color":e&&e.color||"#eee","border-radius":n}}else s.border="none";let n="";for(let i in s)n+=`${i}:${s[i]};`;return n},borderLineStyle(){let e={},{borderStyle:t}=this.styles;if(t&&t.color&&(e["border-color"]=t.color),t&&t.width){let s=t&&t.width||1,n=t&&t.style||0;"number"==typeof s?s+="px":s=s.indexOf("px")?s:s+"px",e["border-width"]=s,"number"==typeof n?n+="px":n=n.indexOf("px")?n:n+"px",e["border-top-style"]=n}let s="";for(let n in e)s+=`${n}:${e[n]};`;return s}},methods:{uploadFiles(e,t){this.$emit("uploadFiles",{item:e,index:t})},choose(){this.$emit("choose")},delFile(e){this.$emit("delFile",e)},value2px:e=>("number"==typeof e?e+="px":e=-1!==e.indexOf("px")?e:e+"px",e)}},[["render",function(e,t,s,n,i,r){const o=K,a=W;return C(),E(o,{class:"uni-file-picker__files"},{default:F((()=>[s.readonly?q("",!0):(C(),E(o,{key:0,class:"files-button",onClick:r.choose},{default:F((()=>[$(e.$slots,"default",{},void 0,!0)])),_:3},8,["onClick"])),r.list.length>0?(C(),E(o,{key:1,class:"uni-file-picker__lists is-text-box",style:N(r.borderStyle)},{default:F((()=>[(C(!0),U(R,null,D(r.list,((e,t)=>(C(),E(o,{class:V(["uni-file-picker__lists-box",{"files-border":0!==t&&r.styles.dividline}]),key:t,style:N(0!==t&&r.styles.dividline&&r.borderLineStyle)},{default:F((()=>[M(o,{class:"uni-file-picker__item"},{default:F((()=>[M(o,{class:"files__name"},{default:F((()=>[H(J(e.name),1)])),_:2},1024),s.delIcon&&!s.readonly?(C(),E(o,{key:0,class:"icon-del-box icon-files",onClick:e=>r.delFile(t)},{default:F((()=>[M(o,{class:"icon-del icon-files"}),M(o,{class:"icon-del rotate"})])),_:2},1032,["onClick"])):q("",!0)])),_:2},1024),e.progress&&100!==e.progress||0===e.progress?(C(),E(o,{key:0,class:"file-picker__progress"},{default:F((()=>[M(a,{class:"file-picker__progress-item",percent:-1===e.progress?0:e.progress,"stroke-width":"4",backgroundColor:e.errMsg?"#ff5a5f":"#EBEBEB"},null,8,["percent","backgroundColor"])])),_:2},1024)):q("",!0),"error"===e.status?(C(),E(o,{key:1,class:"file-picker__mask",onClick:B((s=>r.uploadFiles(e,t)),["stop"])},{default:F((()=>[H(" 点击重试 ")])),_:2},1032,["onClick"])):q("",!0)])),_:2},1032,["class","style"])))),128))])),_:1},8,["style"])):q("",!0)])),_:3})}],["__scopeId","data-v-d33782e5"]])},options:{virtualHost:!0},emits:["select","success","fail","progress","delete","update:modelValue","update:url"],props:{modelValue:{type:[Array,Object],default:()=>[]},url:{type:[Array,String],default:()=>[]},disabled:{type:Boolean,default:!1},disablePreview:{type:Boolean,default:!1},delIcon:{type:Boolean,default:!0},autoUpload:{type:Boolean,default:!0},limit:{type:[Number,String],default:9},mode:{type:String,default:"grid"},fileMediatype:{type:String,default:"image"},fileExtname:{type:[Array,String],default:()=>[]},title:{type:String,default:""},listStyles:{type:Object,default:()=>({border:!0,dividline:!0,borderStyle:{}})},imageStyles:{type:Object,default:()=>({width:"auto",height:"auto"})},readonly:{type:Boolean,default:!1},sizeType:{type:Array,default:()=>["original","compressed"]},driver:{type:String,default:"local"},subtitle:{type:String,default:""}},data:()=>({files:[],localValue:[],imgsrc:O.$url.static("/static/images/add.png")}),watch:{modelValue:{handler(e,t){this.setValue(e,t)},immediate:!0},url:{handler(e){this.updateFilesFromUrl(e)},immediate:!0}},computed:{returnType(){return this.limit>1?"array":"object"},filesList(){let e=[];return this.files.forEach((t=>{e.push(t)})),e},showType(){return"image"===this.fileMediatype?this.mode:"list"},limitLength(){return"object"===this.returnType?1:this.limit?this.limit>=9?9:this.limit:1}},created(){"local"===this.driver&&(zn.chooseAndUploadFile=Zn),this.form=this.getForm("uniForms"),this.formItem=this.getForm("uniFormsItem"),this.form&&this.formItem&&this.formItem.name&&(this.rename=this.formItem.name,this.form.inputChildrens.push(this))},methods:{updateFilesFromUrl(e){Array.isArray(e)?this.files=e.map((e=>({url:e,status:"success"}))):this.files=e?[{url:e,status:"success"}]:[]},clearFiles(e){0===e||e?this.files.splice(e,1):(this.files=[],this.$nextTick((()=>{this.setEmit()}))),this.$nextTick((()=>{this.setEmit()}))},upload(){let e=[];return this.files.forEach(((t,s)=>{"ready"!==t.status&&"error"!==t.status||e.push(Object.assign({},t))})),this.uploadFiles(e)},async setValue(e,t){const s=async e=>{let t="";return t=e.fileID?e.fileID:e.url,/cloud:\/\/([\w.]+\/?)\S*/.test(t)&&(e.fileID=t,e.url=await this.getTempFileURL(t)),e.url&&(e.path=e.url),e};if("object"===this.returnType)e?await s(e):e={};else{e||(e=[]);for(let t=0;t<e.length;t++){let n=e[t];await s(n)}}this.localValue=e,this.form&&this.formItem&&!this.is_reset&&(this.is_reset=!1,this.formItem.setValue(this.localValue));let n=Object.keys(e).length>0?e:[];this.files=[].concat(n),this.updateFilesFromUrl(this.url)},choose(){this.disabled||(this.files.length>=Number(this.limitLength)&&"grid"!==this.showType&&"array"===this.returnType?a({title:`您最多选择 ${this.limitLength} 个文件`,icon:"none"}):this.chooseFiles())},chooseFiles(){const e=ti(this.fileExtname);zn.chooseAndUploadFile({type:this.fileMediatype,compressed:!1,sizeType:this.sizeType,extension:e.length>0?e:void 0,count:this.limitLength-this.files.length,onChooseFile:this.chooseFileCallback,onUploadProgress:e=>{this.setProgress(e,e.index)}}).then((e=>{this.setSuccessAndError(e.tempFiles)})).catch((e=>{console.log("选择失败",e)}))},async chooseFileCallback(e){const t=ti(this.fileExtname);(1===Number(this.limitLength)&&this.disablePreview&&!this.disabled||"object"===this.returnType)&&(this.files=[]);let{filePaths:s,files:n}=((e,t)=>{let s=[],n=[];return t&&0!==t.length?(e.tempFiles.forEach((e=>{const i=ei(e.name).ext.toLowerCase();-1!==t.indexOf(i)&&(n.push(e),s.push(e.path))})),n.length!==e.tempFiles.length&&a({title:`当前选择了${e.tempFiles.length}个文件 ,${e.tempFiles.length-n.length} 个文件格式不正确`,icon:"none",duration:5e3}),{filePaths:s,files:n}):{filePaths:s,files:n}})(e,t);t&&t.length>0||(s=e.tempFilePaths,n=e.tempFiles);let i=[];for(let r=0;r<n.length&&!(this.limitLength-this.files.length<=0);r++){n[r].uuid=Date.now();let e=await si(n[r],this.fileMediatype);e.progress=0,e.status="ready",this.files.push(e),i.push({...e,file:n[r]})}this.$emit("select",{tempFiles:i,tempFilePaths:s}),e.tempFiles=n,this.autoUpload||(e.tempFiles=[])},uploadFiles(e){return e=[].concat(e),Gn.call(this,e,5,(e=>{this.setProgress(e,e.index,!0)})).then((e=>(this.setSuccessAndError(e),e))).catch((e=>{console.log(e)}))},async setSuccessAndError(e,t){let s=[],n=[],i=[],r=[];for(let o=0;o<e.length;o++){const t=e[o],a=t.uuid?this.files.findIndex((e=>e.uuid===t.uuid)):t.index;if(-1===a||!this.files)break;if("request:fail"===t.errMsg)this.files[a].url=t.path,this.files[a].status="error",this.files[a].errMsg=t.errMsg,n.push(this.files[a]),r.push(this.files[a].url);else{this.files[a].errMsg="",this.files[a].fileID=t.url;/cloud:\/\/([\w.]+\/?)\S*/.test(t.url)?this.files[a].url=await this.getTempFileURL(t.url):this.files[a].url=t.url,this.files[a].status="success",this.files[a].progress+=1,s.push(this.files[a]),i.push(this.files[a].fileID)}}s.length>0&&(this.setEmit(),this.$emit("success",{tempFiles:this.backObject(s),tempFilePaths:i})),n.length>0&&this.$emit("fail",{tempFiles:this.backObject(n),tempFilePaths:r})},setProgress(e,t,s){this.files.length;const n=Math.round(100*e.loaded/e.total);let i=t;s||(i=this.files.findIndex((t=>t.uuid===e.tempFile.uuid))),-1!==i&&this.files[i]&&(this.files[i].progress=n-1,this.$emit("progress",{index:i,progress:parseInt(n),tempFile:this.files[i]}))},delFile(e){console.log(this.files),this.$emit("delete",{tempFile:this.files[e],tempFilePath:this.files[e].url}),this.files.splice(e,1),this.$nextTick((()=>{this.setEmit()}))},getFileExt(e){const t=e.lastIndexOf("."),s=e.length;return{name:e.substring(0,t),ext:e.substring(t+1,s)}},setEmit(){let e=[],t=[];"object"===this.returnType?(e=this.backObject(this.files)[0],this.localValue=e||null,t=e?e.url:""):(e=this.backObject(this.files),this.localValue||(this.localValue=[]),this.localValue=[...e],this.localValue.length>0&&this.localValue.forEach((e=>{t.push(e.url)}))),this.$emit("update:modelValue",this.localValue),this.$emit("update:url",t)},backObject(e){let t=[];return e.forEach((e=>{t.push({extname:e.extname,fileType:e.fileType,image:e.image,name:e.name,path:e.path,size:e.size,fileID:e.fileID,url:e.url})})),t},async getTempFileURL(e){e={fileList:[].concat(e)};return(await zn.getTempFileURL(e)).fileList[0].tempFileURL||""},getForm(e="uniForms"){let t=this.$parent,s=t.$options.name;for(;s!==e;){if(t=t.$parent,!t)return!1;s=t.$options.name}return t}}},[["render",function(e,t,s,n,i,r){const o=Q,a=K,c=j,l=z("upload-image"),u=Y,h=z("upload-file");return C(),E(a,{class:"uni-file-picker"},{default:F((()=>[s.title?(C(),E(a,{key:0,class:"uni-file-picker__header"},{default:F((()=>[M(o,{class:"file-title"},{default:F((()=>[H(J(s.title),1)])),_:1}),M(o,{class:"file-count"},{default:F((()=>[H(J(r.filesList.length)+"/"+J(r.limitLength),1)])),_:1})])),_:1})):q("",!0),s.subtitle?(C(),E(a,{key:1,class:"file-subtitle"},{default:F((()=>[M(a,null,{default:F((()=>[H(J(s.subtitle),1)])),_:1})])),_:1})):q("",!0),"image"===s.fileMediatype&&"grid"===r.showType?(C(),E(l,{key:2,readonly:s.readonly,"image-styles":s.imageStyles,"files-list":s.url,limit:r.limitLength,disablePreview:s.disablePreview,delIcon:s.delIcon,onUploadFiles:r.uploadFiles,onChoose:r.choose,onDelFile:r.delFile},{default:F((()=>[$(e.$slots,"default",{},(()=>[M(a,{class:"is-add"},{default:F((()=>[M(c,{src:i.imgsrc,class:"add-icon"},null,8,["src"])])),_:1})]),!0)])),_:3},8,["readonly","image-styles","files-list","limit","disablePreview","delIcon","onUploadFiles","onChoose","onDelFile"])):q("",!0),"image"!==s.fileMediatype||"grid"!==r.showType?(C(),E(h,{key:3,readonly:s.readonly,"list-styles":s.listStyles,"files-list":r.filesList,showType:r.showType,delIcon:s.delIcon,onUploadFiles:r.uploadFiles,onChoose:r.choose,onDelFile:r.delFile},{default:F((()=>[$(e.$slots,"default",{},(()=>[M(u,{type:"primary",size:"mini"},{default:F((()=>[H("选择文件")])),_:1})]),!0)])),_:3},8,["readonly","list-styles","files-list","showType","delIcon","onUploadFiles","onChoose","onDelFile"])):q("",!0)])),_:3})}],["__scopeId","data-v-a775a878"]]);export{ni as _,zn as e};