"use strict";const e=require("../../../common/vendor.js");require("../../index.js"),require("../../url/index.js"),require("../../store/index.js"),require("../../store/app.js"),require("../../api/promotion/diy.js"),require("../../request/index.js"),require("../../config/index.js"),require("../../platform/index.js"),require("../../platform/provider/wechat/index.js"),require("../../platform/provider/wechat/miniProgram.js"),require("../../api/member/auth.js"),require("../../api/member/social.js"),require("../../api/member/user.js"),require("../../platform/provider/apple/index.js"),require("../../platform/share.js"),require("../../router/index.js"),require("../../hooks/useModal.js"),require("../../helper/index.js"),require("../../helper/test.js"),require("../../helper/digit.js"),require("../../api/member/signin.js"),require("../../helper/throttle.js"),require("../../platform/pay.js"),require("../../api/pay/order.js"),require("../../store/user.js"),require("../../store/cart.js"),require("../../api/trade/cart.js"),require("../../api/pay/wallet.js"),require("../../api/trade/order.js"),require("../../api/promotion/coupon.js"),require("../../store/sys.js"),require("../../store/modal.js"),require("../../config/zIndex.js");const r={name:"UniNoticeBar",emits:["click","getmore","close"],props:{text:{type:String,default:""},moreText:{type:String,default:""},backgroundColor:{type:String,default:""},speed:{type:Number,default:100},color:{type:String,default:"var(--ui-BG-Main)"},moreColor:{type:String,default:"#FF9A43"},single:{type:[Boolean,String],default:!1},scrollable:{type:[Boolean,String],default:!1},showIcon:{type:[Boolean,String],default:!1},showGetMore:{type:[Boolean,String],default:!1},showClose:{type:[Boolean,String],default:!1}},data:()=>({textWidth:0,boxWidth:0,wrapWidth:"",webviewHide:!1,elId:`Uni_${Math.ceil(1e6*Math.random()).toString(36)}`,elIdBox:`Uni_${Math.ceil(1e6*Math.random()).toString(36)}`,show:!0,animationDuration:"none",animationPlayState:"paused",animationDelay:"0s"}),mounted(){this.$nextTick((()=>{this.initSize()}))},methods:{initSize(){if(this.scrollable){let r=[],o=new Promise(((r,o)=>{e.index.createSelectorQuery().in(this).select(`#${this.elId}`).boundingClientRect().exec((e=>{this.textWidth=e[0].width,r()}))})),t=new Promise(((r,o)=>{e.index.createSelectorQuery().in(this).select(`#${this.elIdBox}`).boundingClientRect().exec((e=>{this.boxWidth=e[0].width,r()}))}));r.push(o),r.push(t),Promise.all(r).then((()=>{this.animationDuration=this.textWidth/this.speed+"s",this.animationDelay=`-${this.boxWidth/this.speed}s`,setTimeout((()=>{this.animationPlayState="running"}),1e3)}))}},loopAnimation(){},clickMore(){this.$emit("getmore")},close(){this.show=!1,this.$emit("close")},onClick(){this.$emit("click")}}};if(!Array){e.resolveComponent("uni-icons")()}Math;const o=e._export_sfc(r,[["render",function(r,o,t,i,s,a){return e.e({a:s.show},s.show?e.e({b:!0===t.showIcon||"true"===t.showIcon},!0===t.showIcon||"true"===t.showIcon?{c:e.p({type:"sound",color:t.color,size:"22"})}:{},{d:e.t(t.text),e:s.elId,f:t.scrollable?1:"",g:t.scrollable||!t.single&&!t.showGetMore?"":1,h:t.color,i:s.wrapWidth+"px",j:s.animationDuration,k:s.animationDuration,l:s.webviewHide?"paused":s.animationPlayState,m:s.webviewHide?"paused":s.animationPlayState,n:s.animationDelay,o:s.animationDelay,p:s.elIdBox,q:t.scrollable?1:"",r:t.scrollable||!t.single&&!t.moreText?"":1,s:t.scrollable?1:"",t:t.scrollable||!t.single&&!t.moreText?"":1,v:!0===t.showGetMore||"true"===t.showGetMore},!0===t.showGetMore||"true"===t.showGetMore?e.e({w:t.moreText.length>0},t.moreText.length>0?{x:e.t(t.moreText),y:t.moreColor}:{z:e.p({type:"right",color:t.moreColor,size:"16"})},{A:e.o(((...e)=>a.clickMore&&a.clickMore(...e)))}):{},{B:!(!0!==t.showClose&&"true"!==t.showClose||!1!==t.showGetMore&&"false"!==t.showGetMore)},!0!==t.showClose&&"true"!==t.showClose||!1!==t.showGetMore&&"false"!==t.showGetMore?{}:{C:e.p({type:"closeempty",color:t.color,size:"16"}),D:e.o(((...e)=>a.close&&a.close(...e)))},{E:t.backgroundColor,F:e.o(((...e)=>a.onClick&&a.onClick(...e)))}):{})}],["__scopeId","data-v-02f0aeb6"]]);wx.createComponent(o);
