1(function(){try{var l=typeof window!="undefined"?window:typeof global!="undefined"?global:typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:{};l.SENTRY_RELEASE={id:"f9b0ef460ef6f95b1d7f321428c950242b680c25"};var r=new l.Error().stack;r&&(l._sentryDebugIds=l._sentryDebugIds||{},l._sentryDebugIds[r]="a4c4ea7d-6747-4496-9073-a54603f62eb8",l._sentryDebugIdIdentifier="sentry-dbid-a4c4ea7d-6747-4496-9073-a54603f62eb8")}catch(t){}})();var ht=function(l,r){return ht=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var e in i)Object.prototype.hasOwnProperty.call(i,e)&&(t[e]=i[e])},ht(l,r)};function lt(l,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function t(){this.constructor=l}ht(l,r),l.prototype=r===null?Object.create(r):(t.prototype=r.prototype,new t)}var R=function(){return R=Object.assign||function(l){for(var r,t=1,i=arguments.length;t<i;t++)for(var e in r=arguments[t])Object.prototype.hasOwnProperty.call(r,e)&&(l[e]=r[e]);return l},R.apply(this,arguments)};function D(l,r,t,i){return new(t||(t=Promise))(function(e,n){function a(h){try{u(i.next(h))}catch(s){n(s)}}function o(h){try{u(i.throw(h))}catch(s){n(s)}}function u(h){var s;h.done?e(h.value):(s=h.value,s instanceof t?s:new t(function(c){c(s)})).then(a,o)}u((i=i.apply(l,[])).next())})}function F(l,r){var t,i,e,n,a={label:0,sent:function(){if(1&e[0])throw e[1];return e[1]},trys:[],ops:[]};return n={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(n[Symbol.iterator]=function(){return this}),n;function o(u){return function(h){return function(s){if(t)throw new TypeError("Generator is already executing.");for(;a;)try{if(t=1,i&&(e=2&s[0]?i.return:s[0]?i.throw||((e=i.return)&&e.call(i),0):i.next)&&!(e=e.call(i,s[1])).done)return e;switch(i=0,e&&(s=[2&s[0],e.value]),s[0]){case 0:case 1:e=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,i=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(e=a.trys,!((e=e.length>0&&e[e.length-1])||s[0]!==6&&s[0]!==2)){a=0;continue}if(s[0]===3&&(!e||s[1]>e[0]&&s[1]<e[3])){a.label=s[1];break}if(s[0]===6&&a.label<e[1]){a.label=e[1],e=s;break}if(e&&a.label<e[2]){a.label=e[2],a.ops.push(s);break}e[2]&&a.ops.pop(),a.trys.pop();continue}s=r.call(l,a)}catch(c){s=[6,c],i=0}finally{t=e=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([u,h])}}}function G(l,r){for(var t=0,i=r.length,e=l.length;t<i;t++,e++)l[e]=r[t];return l}Array.prototype.includes||Object.defineProperty(Array.prototype,"includes",{value:function(l,r){if(this==null)throw new TypeError('"this" is null or not defined');var t=Object(this),i=t.length>>>0;if(i===0)return!1;for(var e,n,a=0|r,o=Math.max(a>=0?a:i-Math.abs(a),0);o<i;){if((e=t[o])===(n=l)||typeof e=="number"&&typeof n=="number"&&isNaN(e)&&isNaN(n))return!0;o++}return!1}}),String.prototype.includes||(String.prototype.includes=function(l,r){return typeof r!="number"&&(r=0),!(r+l.length>this.length)&&this.indexOf(l,r)!==-1}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(l){if(this==null)throw new TypeError('"this" is null or not defined');var r=Object(this),t=r.length>>>0;if(typeof l!="function")throw new TypeError("predicate must be a function");for(var i=arguments[1],e=0;e<t;){var n=r[e];if(l.call(i,n,e,r))return n;e++}}});var K=function(l){for(var r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];return r.some(function(i){return Object.prototype.toString.call(l).slice(8,-1).toLowerCase()===i})},U=function(l,r){return Object.prototype.hasOwnProperty.call(l,r)},ct=function(l){return[].filter.call(l,function(r){return r!==` 2`}).join("")},H=function(l){if(typeof l!="string"||(l=l.toLocaleLowerCase().trim())==="transparent")return!1;if(/^rgba/.test(l)){var r=/([^\s,]+)\)$/.exec(l);if(((t=r)===null?0:typeof t=="object"?NaN:typeof t=="number"?t:typeof t=="string"?t[t.length-1]==="%"?Number(t.slice(0,-1))/100:Number(t):NaN)===0)return!1}var t;return!0},bt=function(l,r){var t,i=((t=l.padding)===null||t===void 0?void 0:t.split(" ").map(function(s){return r(s)}))||[0],e=0,n=0,a=0,o=0;switch(i.length){case 1:e=n=a=o=i[0];break;case 2:e=n=i[0],a=o=i[1];break;case 3:e=i[0],a=o=i[1],n=i[2];break;default:e=i[0],n=i[1],a=i[2],o=i[3]}var u={paddingTop:e,paddingBottom:n,paddingLeft:a,paddingRight:o};for(var h in u)u[h]=U(l,h)&&K(l[h],"string","number")?r(l[h]):u[h];return[e,n,a,o]},St=function(l){var r=[],t=l.map(function(e){return Number(e)}).reduce(function(e,n){if(n>0){var a=e+n;return r.push(a),a}return r.push(NaN),e},0),i=Math.random()*t;return r.findIndex(function(e){return i<=e})},ut=function(l,r,t,i){i===void 0&&(i=1/0),i<=0&&(i=1/0);for(var e="",n=[],a=l.measureText("...").width,o=0;o<r.length;o++){e+=r[o];var u=l.measureText(e).width,h=t(n);if(i===n.length+1&&(u+=a),h<0)return n;if(u>h&&(n.push(e.slice(0,-1)),e=r[o]),i===n.length)return n[n.length-1]+="...",n}return e&&n.push(e),n.length||n.push(r),n},B=function(){function l(){this.subs=[]}return l.prototype.addSub=function(r){this.subs.includes(r)||this.subs.push(r)}
2,l.prototype.notify=function(){this.subs.forEach(function(r){r.update()})},l}(),Lt="__proto__"in{};function wt(l,r,t,i){Object.defineProperty(l,r,{value:t,enumerable:!1,writable:!0,configurable:!0})}var Ct=Array.prototype,it=Object.create(Ct);["push","pop","shift","unshift","sort","splice","reverse"].forEach(function(l){it[l]=function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var i=Ct[l].apply(this,r),e=this.__luckyOb__;return["push","unshift","splice"].includes(l)&&e.walk(this),e.dep.notify(),i}});var Tt=function(){function l(r){this.dep=new B,wt(r,"__luckyOb__",this),Array.isArray(r)&&(Lt?r.__proto__=it:Object.getOwnPropertyNames(it).forEach(function(t){wt(r,t,it[t])})),this.walk(r)}return l.prototype.walk=function(r){Object.keys(r).forEach(function(t){zt(r,t,r[t])})},l}();function yt(l){if(l&&typeof l=="object")return"__luckyOb__"in l?l.__luckyOb__:new Tt(l)}function zt(l,r,t){var i=new B,e=Object.getOwnPropertyDescriptor(l,r);if(!e||e.configurable!==!1){var n=e&&e.get,a=e&&e.set;n&&!a||arguments.length!==2||(t=l[r]);var o=yt(t);Object.defineProperty(l,r,{get:function(){var u=n?n.call(l):t;return B.target&&(i.addSub(B.target),o&&o.dep.addSub(B.target)),u},set:function(u){u!==t&&(t=u,n&&!a||(a?a.call(l,u):t=u,o=yt(u),i.notify()))}})}}var _t=0,Et=function(){function l(r,t,i,e){e===void 0&&(e={}),this.id=_t++,this.$lucky=r,this.expr=t,this.deep=!!e.deep,this.getter=typeof t=="function"?t:function(n){n+=".";for(var a=[],o="",u=0;u<n.length;u++){var h=n[u];if(/\[|\./.test(h))a.push(o),o="";else{if(/\W/.test(h))continue;o+=h}}return function(s){return a.reduce(function(c,f){return c[f]},s)}}(t),this.cb=i,this.value=this.get()}return l.prototype.get=function(){B.target=this;var r=this.getter.call(this.$lucky,this.$lucky);return this.deep&&function(t){var i=function(e){K(e,"array","object")&&Object.keys(e).forEach(function(n){var a=e[n];i(a)})};i(t)}(r),B.target=null,r},l.prototype.update=function(){var r=this.get(),t=this.value;this.value=r,this.cb.call(this.$lucky,r,t)},l}(),ft=function(){function l(r,t){var i=this;this.version="1.7.25",this.htmlFontSize=16,this.rAF=function(){},this.boxWidth=0,this.boxHeight=0,typeof r=="string"?r={el:r}:r.nodeType===1&&(r={el:"",divElement:r}),r=r,this.config=r,this.data=t,r.flag||(r.flag="WEB"),r.el&&(r.divElement=document.querySelector(r.el)),r.divElement&&(r.canvasElement=document.createElement("canvas"),r.divElement.appendChild(r.canvasElement)),r.canvasElement&&(r.ctx=r.canvasElement.getContext("2d"),r.canvasElement.setAttribute("package","[email protected]"),r.canvasElement.addEventListener("click",function(e){return i.handleClick(e)})),this.ctx=r.ctx,this.initWindowFunction(),this.config.ctx,window&&typeof window.addEventListener=="function"&&window.addEventListener("resize",function(e,n){var a=null;return function(){for(var o=this,u=[],h=0;h<arguments.length;h++)u[h]=arguments[h];a||(a=setTimeout(function(){e.apply(o,u),clearTimeout(a),a=null},n))}}(function(){return i.resize()},300)),window&&typeof window.MutationObserver=="function"&&new window.MutationObserver(function(){i.resize()}).observe(document.documentElement,{attributes:!0})}return l.prototype.resize=function(){var r,t;(t=(r=this.config).beforeResize)===null||t===void 0||t.call(r),this.setHTMLFontSize(),this.setDpr(),this.resetWidthAndHeight(),this.zoomCanvas()},l.prototype.initLucky=function(){this.resize(),!this.boxWidth||this.boxHeight},l.prototype.handleClick=function(r){},l.prototype.setHTMLFontSize=function(){window&&(this.htmlFontSize=+window.getComputedStyle(document.documentElement).fontSize.slice(0,-2))},l.prototype.clearCanvas=function(){var r=[this.boxWidth,this.boxHeight],t=r[0],i=r[1];this.ctx.clearRect(-t,-i,2*t,2*i)},l.prototype.setDpr=function(){var r=this.config;r.dpr||(window?window.dpr=r.dpr=window.devicePixelRatio||1:r.dpr)},l.prototype.resetWidthAndHeight=function(){var r=this.config,t=this.data,i=0,e=0;r.divElement&&(i=r.divElement.offsetWidth,e=r.divElement.offsetHeight),this.boxWidth=this.getLength(t.width||r.width)||i,this.boxHeight=this.getLength(t.height||r.height)||e,r.divElement&&(r.divElement.style.overflow="hidden",r.divElement.style.width=this.boxWidth+"px",r.divElement.style.height=this.boxHeight+"px")},l.prototype.zoomCanvas=function(){var r=this.config,t=this.ctx,i=r.canvasElement,e=r.dpr,n=[this.boxWidth*e,this.boxHeight*e],a=n[0],o=n[1];i&&(i.width=a,i.height=o,i.style.width=a+"px",i.style.height=o+"px",i.style["transform-origin"]="left top",i.style.transform="scale("+1/e+")",t.scale(e,e))},l.prototype.initWindowFunction=function(){var r=this.config;if(window)return this.rAF=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(i){window.setTimeout(i,1e3/60)},r.setTimeout=window.setTimeout,r.setInterval=window.setInterval,r.clearTimeout=window.clearTimeout,void(r.clearInterval=window.clearInterval);if(r.rAF)this.rAF=r.rAF;else if(r.setTimeout){var t=r.setTimeout;this.rAF=function(i){return t(i,16.7)}}else this.rAF=function(i){return setTimeout(i,16.7)}},l.prototype.isWeb=function(){return["WEB","UNI-H5","TARO-H5"].includes(this.config.flag)},l.prototype.loadImg=function(r,t,i){var e=this;return i===void 0&&(i="$resolve"),new Promise(function(n,a){if(r||a("=> '"+t.src+"' ä¸è½ä¸ºç©ºæä¸åæ³"),e.config.flag!=="WEB")return t[i]=n,void(t.$reject=a);var o=new Image;o.onload=function(){return n(o)},o.onerror=function(){return a("=> '"+t.src+"' å¾çå 载失败")},o.src=r})},l.prototype.drawImage=function(r,t){for(var i,e,n,a=[],o=2;o<arguments.length;o++)a[o-2]=arguments[o];var u=this.config,h=u.flag,s=u.dpr;if(["WEB","MP-WX"].includes(h))n=t;else{if(!["UNI-H5","UNI-MP","TARO-H5","TARO-MP"].includes(h))return;n=t.path}var c=(e=(i=n.canvas||n).getContext)===null||e===void 0?void 0:e.call(i,"2d");if(c&&!this.isWeb()){a=a.map(function(w){return w*s});var f=c.getImageData.apply(c,a.slice(0,4));
2r.putImageData.apply(r,G([f],a.slice(4,6)))}else{a.length===8&&(a=a.map(function(w,p){return p<4?w*s:w}));try{r.drawImage.apply(r,G([n],a))}catch(w){}}},l.prototype.computedWidthAndHeight=function(r,t,i,e){if(!t.width&&!t.height)return[r.width,r.height];if(t.width&&!t.height){var n=this.getLength(t.width,i);return[n,r.height*(n/r.width)]}if(!t.width&&t.height){var a=this.getLength(t.height,e);return[r.width*(a/r.height),a]}return[this.getLength(t.width,i),this.getLength(t.height,e)]},l.prototype.changeUnits=function(r,t){var i=this;t===void 0&&(t=1);var e=this.config;return Number(r.replace(/^([-]*[0-9.]*)([a-z%]*)$/,function(n,a,o){var u={"%":function(s){return s*(t/100)},px:function(s){return 1*s},rem:function(s){return s*i.htmlFontSize},vw:function(s){return s/100*window.innerWidth}}[o];if(u)return u(a);var h=e.handleCssUnit||e.unitFunc;return h?h(a,o):a}))},l.prototype.getLength=function(r,t){return K(r,"number")?r:K(r,"string")?this.changeUnits(r,t):0},l.prototype.getOffsetX=function(r,t){return t===void 0&&(t=0),(t-r)/2},l.prototype.getOffscreenCanvas=function(r,t){if(!(!U(this,"_offscreenCanvas")&&(window&&window.document&&this.config.flag==="WEB"?this._offscreenCanvas=document.createElement("canvas"):this._offscreenCanvas=this.config.offscreenCanvas,!this._offscreenCanvas))){var i=this.config.dpr,e=this._offscreenCanvas;e.width=(r||300)*i,e.height=(t||150)*i;var n=e.getContext("2d");return n.clearRect(0,0,r,t),n.scale(i,i),n.dpr=i,{_offscreenCanvas:e,_ctx:n}}},l.prototype.$set=function(r,t,i){r&&typeof r=="object"&&zt(r,t,i)},l.prototype.$computed=function(r,t,i){var e=this;Object.defineProperty(r,t,{get:function(){return i.call(e)}})},l.prototype.$watch=function(r,t,i){i===void 0&&(i={}),typeof t=="object"&&(t=(i=t).handler);var e=new Et(this,r,t,i);return i.immediate&&t.call(this,e.value),function(){}},l.version="1.7.25",l}(),M=function(l){return Math.PI/180*l},Wt=function(l,r,t,i,e,n){l.beginPath();var a,o,u=M(90/Math.PI/t*n),h=i+u,s=e-u;l.arc(0,0,t,h,s,!1),l.lineTo.apply(l,(a=(i+e)/2,o=n/2/Math.abs(Math.sin((i-e)/2)),[+(Math.cos(a)*o).toFixed(8),+(Math.sin(a)*o).toFixed(8)])),l.closePath()},nt=function(l){for(var r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];var i=r[0],e=r[1],n=r[2],a=r[3],o=r[4],u=Math.min(n,a),h=Math.PI;o>u/2&&(o=u/2),l.beginPath(),l.moveTo(i+o,e),l.lineTo(i+o,e),l.lineTo(i+n-o,e),l.arc(i+n-o,e+o,o,-h/2,0),l.lineTo(i+n,e+a-o),l.arc(i+n-o,e+a-o,o,0,h/2),l.lineTo(i+o,e+a),l.arc(i+o,e+a-o,o,h/2,h),l.lineTo(i,e+o),l.arc(i+o,e+o,o,h,-h/2),l.closePath()},dt=function(l,r,t,i){return l>=i&&(l=i),t*(l/=i)*l+r},q=function(l,r,t,i){return l>=i&&(l=i),-t*(l/=i)*(l-2)+r},$t=function(l){function r(t,i){var e,n=l.call(this,t,{width:i.width,height:i.height})||this;return n.blocks=[],n.prizes=[],n.buttons=[],n.defaultConfig={},n.defaultStyle={},n._defaultConfig={},n._defaultStyle={},n.Radius=0,n.prizeRadius=0,n.prizeDeg=0,n.prizeAng=0,n.rotateDeg=0,n.maxBtnRadius=0,n.startTime=0,n.endTime=0,n.stopDeg=0,n.endDeg=0,n.FPS=16.6,n.step=0,n.ImageCache=new Map,n.initData(i),n.initWatch(),n.initComputed(),(e=t.beforeCreate)===null||e===void 0||e.call(n),n.init(),n}return lt(r,l),r.prototype.resize=function(){var t,i;l.prototype.resize.call(this),this.Radius=Math.min(this.boxWidth,this.boxHeight)/2,this.ctx.translate(this.Radius,this.Radius),this.draw(),(i=(t=this.config).afterResize)===null||i===void 0||i.call(t)},r.prototype.initLucky=function(){this.Radius=0,this.prizeRadius=0,this.prizeDeg=0,this.prizeAng=0,this.rotateDeg=0,this.maxBtnRadius=0,this.startTime=0,this.endTime=0,this.stopDeg=0,this.endDeg=0,this.FPS=16.6,this.prizeFlag=-1,this.step=0,l.prototype.initLucky.call(this)},r.prototype.initData=function(t){this.$set(this,"width",t.width),this.$set(this,"height",t.height),this.$set(this,"blocks",t.blocks||[]),this.$set(this,"prizes",t.prizes||[]),this.$set(this,"buttons",t.buttons||[]),this.$set(this,"defaultConfig",t.defaultConfig||{}),this.$set(this,"defaultStyle",t.defaultStyle||{}),this.$set(this,"startCallback",t.start),this.$set(this,"endCallback",t.end)},r.prototype.initComputed=function(){var t=this;this.$computed(this,"_defaultConfig",function(){return R({gutter:"0px",offsetDegree:0,speed:20,speedFunction:"quad",accelerationTime:2500,decelerationTime:2500,stopRange:0},t.defaultConfig)}),this.$computed(this,"_defaultStyle",function(){return R({fontSize:"18px",fontColor:"#000",fontStyle:"sans-serif",fontWeight:"400",background:"rgba(0,0,0,0)",wordWrap:!0,lengthLimit:"90%"},t.defaultStyle)})},r.prototype.initWatch=function(){var t=this;this.$watch("width",function(i){t.data.width=i,t.resize()}),this.$watch("height",function(i){t.data.height=i,t.resize()}),this.$watch("blocks",function(i){t.initImageCache()},{deep:!0}),this.$watch("prizes",function(i){t.initImageCache()},{deep:!0}),this.$watch("buttons",function(i){t.initImageCache()},{deep:!0}),this.$watch("defaultConfig",function(){return t.draw()},{deep:!0}),this.$watch("defaultStyle",function(){return t.draw()},{deep:!0}),this.$watch("startCallback",function(){return t.init()}),this.$watch("endCallback",function(){return t.init()})},r.prototype.init=function(){var t,i;return D(this,void 0,void 0,function(){var e;return F(this,function(n){switch(n.label){case 0:return this.initLucky(),e=this.config,(t=e.beforeInit)===null||t===void 0||t.call(this),this.draw(),this.draw(),[4,this.initImageCache()];case 1:return n.sent(),(i=e.afterInit)===null||i===void 0||i.call(this),[2]}})})},r.prototype.initImageCache=function(){var t=this;return new Promise(function(i){var e={blocks:t.blocks.map(function(n){return n.imgs}),prizes:t.prizes.map(function(n){return n.imgs}),buttons:t.buttons.map(function(n){return n.imgs})};Object.keys(e).forEach(function(n){var a=e[n],o=[];a&&a.forEach(function(u,h){u&&u.forEach(function(s,c){o.push(t.loadAndCacheImg(n,h,c))})}),Promise.all(o).then(function(){t.draw(),i()})})})},r.prototype.handleClick=function(t){var i,e=this.ctx;e.beginPath(),e.arc(0,0,this.maxBtnRadius,0,2*Math.PI,!1),e.isPointInPath(t.offsetX,t.offsetY)&&this.step===0&&((i=this.startCallback)===null||i===void 0||i.call(this,t))},r.prototype.loadAndCacheImg=function(t,i,e){return D(this,void 0,void 0,function(){var n=this;return F(this,function(a){return[2,new Promise(function(o,u){var h=n[t][i];if(h&&h.imgs){var s=h.imgs[e];s&&n.loadImg(s.src,s).then(function(c){return D(n,void 0,void 0,function(){return F(this,function(f){switch(f.label){case 0:return typeof s.formatter!="function"?[3,2]:[4,Promise.resolve(s.formatter.call(this,c))];case 1:c=f.sent(),f.label=2;case 2:return this.ImageCache.set(s.src,c),o(),[2]}})})}).catch(function(c){u()})}})]})})},r.prototype.drawBlock=function(t,i,e){var n=this,a=this.ctx;
2H(i.background)&&(a.beginPath(),a.fillStyle=i.background,a.arc(0,0,t,0,2*Math.PI,!1),a.fill()),i.imgs&&i.imgs.forEach(function(o,u){var h=n.ImageCache.get(o.src);if(h){var s=n.computedWidthAndHeight(h,o,2*t,2*t),c=s[0],f=s[1],w=[n.getOffsetX(c)+n.getLength(o.left,2*t),n.getLength(o.top,2*t)-t],p=w[0],d=w[1];a.save(),o.rotate&&a.rotate(M(n.rotateDeg)),n.drawImage(a,h,p,d,c,f),a.restore()}})},r.prototype.draw=function(){var t,i,e=this,n=this,a=n.config,o=n.ctx,u=n._defaultConfig,h=n._defaultStyle;(t=a.beforeDraw)===null||t===void 0||t.call(this,o),o.clearRect(-this.Radius,-this.Radius,2*this.Radius,2*this.Radius),this.prizeRadius=this.blocks.reduce(function(p,d,g){return e.drawBlock(p,d,g),p-e.getLength(d.padding&&d.padding.split(" ")[0])},this.Radius),this.prizeDeg=360/this.prizes.length,this.prizeAng=M(this.prizeDeg);var s=this.prizeRadius*Math.sin(this.prizeAng/2)*2,c=M(this.rotateDeg-90+this.prizeDeg/2+u.offsetDegree),f=function(p,d){return e.getOffsetX(o.measureText(d).width)+e.getLength(p.left,s)},w=function(p,d,g){var m=p.lineHeight||h.lineHeight||p.fontSize||h.fontSize;return e.getLength(p.top,d)+(g+1)*e.getLength(m)};o.save(),this.prizes.forEach(function(p,d){var g=c+d*e.prizeAng,m=e.prizeRadius-e.maxBtnRadius,C=p.background||h.background;H(C)&&(o.fillStyle=C,Wt(o,e.maxBtnRadius,e.prizeRadius,g-e.prizeAng/2,g+e.prizeAng/2,e.getLength(u.gutter)),o.fill());var y=Math.cos(g)*e.prizeRadius,b=Math.sin(g)*e.prizeRadius;o.translate(y,b),o.rotate(g+M(90)),p.imgs&&p.imgs.forEach(function(S,v){var z=e.ImageCache.get(S.src);if(z){var x=e.computedWidthAndHeight(z,S,e.prizeAng*e.prizeRadius,m),k=x[0],L=x[1],I=[e.getOffsetX(k)+e.getLength(S.left,s),e.getLength(S.top,m)],A=I[0],E=I[1];e.drawImage(o,z,A,E,k,L)}}),p.fonts&&p.fonts.forEach(function(S){var v=S.fontColor||h.fontColor,z=S.fontWeight||h.fontWeight,x=e.getLength(S.fontSize||h.fontSize),k=S.fontStyle||h.fontStyle,L=U(S,"wordWrap")?S.wordWrap:h.wordWrap,I=S.lengthLimit||h.lengthLimit,A=S.lineClamp||h.lineClamp;o.fillStyle=v,o.font=z+" "+(x>>0)+"px "+k;var E=String(S.text);(L?ut(o,ct(E),function(T){var _=2*((e.prizeRadius-w(S,m,T.length))*Math.tan(e.prizeAng/2))-e.getLength(u.gutter);return e.getLength(I,_)},A):E.split(` 3`)).filter(function(T){return!!T}).forEach(function(T,_){o.fillText(T,f(S,T),w(S,m,_))})}),o.rotate(M(360)-g-M(90)),o.translate(-y,-b)}),o.restore(),this.buttons.forEach(function(p,d){var g=e.getLength(p.radius,e.prizeRadius);e.maxBtnRadius=Math.max(e.maxBtnRadius,g),H(p.background)&&(o.beginPath(),o.fillStyle=p.background,o.arc(0,0,g,0,2*Math.PI,!1),o.fill()),p.pointer&&H(p.background)&&(o.beginPath(),o.fillStyle=p.background,o.moveTo(-g,0),o.lineTo(g,0),o.lineTo(0,2*-g),o.closePath(),o.fill()),p.imgs&&p.imgs.forEach(function(m,C){var y=e.ImageCache.get(m.src);if(y){var b=e.computedWidthAndHeight(y,m,2*g,2*g),S=b[0],v=b[1],z=[e.getOffsetX(S)+e.getLength(m.left,g),e.getLength(m.top,g)],x=z[0],k=z[1];e.drawImage(o,y,x,k,S,v)}}),p.fonts&&p.fonts.forEach(function(m){var C=m.fontColor||h.fontColor,y=m.fontWeight||h.fontWeight,b=e.getLength(m.fontSize||h.fontSize),S=m.fontStyle||h.fontStyle;o.fillStyle=C,o.font=y+" "+(b>>0)+"px "+S,String(m.text).split(` 4`).forEach(function(v,z){o.fillText(v,f(m,v),w(m,g,z))})})}),(i=a.afterDraw)===null||i===void 0||i.call(this,o)},r.prototype.carveOnGunwaleOfAMovingBoat=function(){var t=this,i=t._defaultConfig,e=t.prizeFlag,n=t.prizeDeg,a=t.rotateDeg;this.endTime=Date.now();for(var o=this.stopDeg=a,u=i.speed,h=(Math.random()*n-n/2)*this.getLength(i.stopRange),s=0,c=0,f=0;++s;){var w=360*s-e*n-a-i.offsetDegree+h-n/2,p=q(this.FPS,o,w,i.decelerationTime)-o;if(p>u){this.endDeg=u-c>p-u?w:f;break}f=w,c=p}},r.prototype.play=function(){var t,i;this.step===0&&(this.startTime=Date.now(),this.prizeFlag=void 0,this.step=1,(i=(t=this.config).afterStart)===null||i===void 0||i.call(t),this.run())},r.prototype.stop=function(t){if(this.step!==0&&this.step!==3){if(!t&&t!==0){var i=this.prizes.map(function(e){return e.range});t=St(i)}t<0?(this.step=0,this.prizeFlag=-1):(this.step=2,this.prizeFlag=t%this.prizes.length)}},r.prototype.run=function(t){var i;t===void 0&&(t=0);var e=this,n=e.rAF,a=e.step,o=e.prizeFlag,u=e._defaultConfig,h=u.accelerationTime,s=u.decelerationTime,c=u.speed;if(a!==0){if(o!==-1){a!==3||this.endDeg||this.carveOnGunwaleOfAMovingBoat();var f=Date.now()-this.startTime,w=Date.now()-this.endTime,p=this.rotateDeg;if(a===1||f<h){this.FPS=f/t;var d=dt(f,0,c,h);d===c&&(this.step=2),p+=d%360}else a===2?(p+=c%360,o!==void 0&&o>=0&&(this.step=3,this.stopDeg=0,this.endDeg=0)):a===3?(p=q(w,this.stopDeg,this.endDeg,s),w>=s&&(this.step=0)):this.stop(-1);this.rotateDeg=p,this.draw(),n(this.run.bind(this,t+1))}}else(i=this.endCallback)===null||i===void 0||i.call(this,this.prizes.find(function(g,m){return m===o})||{})},r.prototype.conversionAxis=function(t,i){var e=this.config;return[t/e.dpr-this.Radius,i/e.dpr-this.Radius]},r}(ft);(function(l){function r(t,i){var e,n=l.call(this,t,{width:i.width,height:i.height})||this;return n.rows=3,n.cols=3,n.blocks=[],n.prizes=[],n.buttons=[],n.defaultConfig={},n.defaultStyle={},n.activeStyle={},n._defaultConfig={},n._defaultStyle={},n._activeStyle={},n.cellWidth=0,n.cellHeight=0,n.startTime=0,n.endTime=0,n.currIndex=0,n.stopIndex=0,n.endIndex=0,n.demo=!1,n.timer=0,n.FPS=16.6,n.step=0,n.prizeFlag=-1,n.cells=[],n.ImageCache=new Map,n.initData(i),n.initWatch(),n.initComputed(),(e=t.beforeCreate)===null||e===void 0||e.call(n),n.init(),n}return lt(r,l),r.prototype.resize=function(){var t,i;l.prototype.resize.call(this),this.draw(),(i=(t=this.config).afterResize)===null||i===void 0||i.call(t)},r.prototype.initLucky=function(){this.cellWidth=0,this.cellHeight=0,this.startTime=0,this.endTime=0,this.currIndex=0,this.stopIndex=0,this.endIndex=0,this.demo=!1,this.timer=0,this.FPS=16.6,this.prizeFlag=-1,this.step=0,l.prototype.initLucky.call(this)},r.prototype.initData=function(t){this.$set(this,"width",t.width),this.$set(this,"height",t.height),this.$set(this,"rows",Number(t.rows)||3),this.$set(this,"cols",Number(t.cols
4)||3),this.$set(this,"blocks",t.blocks||[]),this.$set(this,"prizes",t.prizes||[]),this.$set(this,"buttons",t.buttons||[]),this.$set(this,"button",t.button),this.$set(this,"defaultConfig",t.defaultConfig||{}),this.$set(this,"defaultStyle",t.defaultStyle||{}),this.$set(this,"activeStyle",t.activeStyle||{}),this.$set(this,"startCallback",t.start),this.$set(this,"endCallback",t.end)},r.prototype.initComputed=function(){var t=this;this.$computed(this,"_defaultConfig",function(){var i=R({gutter:5,speed:20,accelerationTime:2500,decelerationTime:2500},t.defaultConfig);return i.gutter=t.getLength(i.gutter),i.speed=i.speed/40,i}),this.$computed(this,"_defaultStyle",function(){return R({borderRadius:20,fontColor:"#000",fontSize:"18px",fontStyle:"sans-serif",fontWeight:"400",background:"rgba(0,0,0,0)",shadow:"",wordWrap:!0,lengthLimit:"90%"},t.defaultStyle)}),this.$computed(this,"_activeStyle",function(){return R({background:"#ffce98",shadow:""},t.activeStyle)})},r.prototype.initWatch=function(){var t=this;this.$watch("width",function(i){t.data.width=i,t.resize()}),this.$watch("height",function(i){t.data.height=i,t.resize()}),this.$watch("blocks",function(i){t.initImageCache()},{deep:!0}),this.$watch("prizes",function(i){t.initImageCache()},{deep:!0}),this.$watch("buttons",function(i){t.initImageCache()},{deep:!0}),this.$watch("rows",function(){return t.init()}),this.$watch("cols",function(){return t.init()}),this.$watch("defaultConfig",function(){return t.draw()},{deep:!0}),this.$watch("defaultStyle",function(){return t.draw()},{deep:!0}),this.$watch("activeStyle",function(){return t.draw()},{deep:!0}),this.$watch("startCallback",function(){return t.init()}),this.$watch("endCallback",function(){return t.init()})},r.prototype.init=function(){var t,i;return D(this,void 0,void 0,function(){var e;return F(this,function(n){switch(n.label){case 0:return this.initLucky(),e=this.config,(t=e.beforeInit)===null||t===void 0||t.call(this),this.draw(),[4,this.initImageCache()];case 1:return n.sent(),(i=e.afterInit)===null||i===void 0||i.call(this),[2]}})})},r.prototype.initImageCache=function(){var t=this;return new Promise(function(i){var e=t.buttons.map(function(a){return a.imgs});t.button&&e.push(t.button.imgs);var n={blocks:t.blocks.map(function(a){return a.imgs}),prizes:t.prizes.map(function(a){return a.imgs}),buttons:e};Object.keys(n).forEach(function(a){var o=n[a],u=[];o&&o.forEach(function(h,s){h&&h.forEach(function(c,f){u.push(t.loadAndCacheImg(a,s,f))})}),Promise.all(u).then(function(){t.draw(),i()})})})},r.prototype.handleClick=function(t){var i=this,e=this.ctx;G(G([],this.buttons),[this.button]).forEach(function(n){var a;if(n){var o=i.getGeometricProperty([n.x,n.y,n.col||1,n.row||1]),u=o[0],h=o[1],s=o[2],c=o[3];e.beginPath(),e.rect(u,h,s,c),e.isPointInPath(t.offsetX,t.offsetY)&&i.step===0&&(typeof n.callback=="function"&&n.callback.call(i,n),(a=i.startCallback)===null||a===void 0||a.call(i,t,n))}})},r.prototype.loadAndCacheImg=function(t,i,e){return D(this,void 0,void 0,function(){var n=this;return F(this,function(a){return[2,new Promise(function(o,u){var h=n[t][i];if(t==="buttons"&&!n.buttons.length&&n.button&&(h=n.button),h&&h.imgs){var s=h.imgs[e];if(s){var c=[n.loadImg(s.src,s),s.activeSrc&&n.loadImg(s.activeSrc,s,"$activeResolve")];Promise.all(c).then(function(f){var w=f[0],p=f[1];return D(n,void 0,void 0,function(){var d;return F(this,function(g){switch(g.label){case 0:return typeof(d=s.formatter)!="function"?[3,3]:[4,Promise.resolve(d.call(this,w))];case 1:return w=g.sent(),p?[4,Promise.resolve(d.call(this,p))]:[3,3];case 2:p=g.sent(),g.label=3;case 3:return this.ImageCache.set(s.src,w),p&&this.ImageCache.set(s.activeSrc,p),o(),[2]}})})}).catch(function(f){u()})}}})]})})},r.prototype.draw=function(){var t,i,e=this,n=this,a=n.config,o=n.ctx,u=n._defaultConfig,h=n._defaultStyle,s=n._activeStyle;(t=a.beforeDraw)===null||t===void 0||t.call(this,o),o.clearRect(0,0,this.boxWidth,this.boxHeight),this.cells=G(G([],this.prizes),this.buttons),this.button&&this.cells.push(this.button),this.cells.forEach(function(c){c.col=c.col||1,c.row=c.row||1}),this.prizeArea=this.blocks.reduce(function(c,f,w){var p=c.x,d=c.y,g=c.w,m=c.h,C=bt(f,e.getLength.bind(e)),y=C[0],b=C[1],S=C[2],v=C[3],z=f.borderRadius?e.getLength(f.borderRadius):0,x=f.background;
4return H(x)&&(o.fillStyle=e.handleBackground(p,d,g,m,x),nt(o,p,d,g,m,z),o.fill()),f.imgs&&f.imgs.forEach(function(k,L){var I=e.ImageCache.get(k.src);if(I){var A=e.computedWidthAndHeight(I,k,g,m),E=A[0],T=A[1],_=[e.getOffsetX(E,g)+e.getLength(k.left,g),e.getLength(k.top,m)],P=_[0],j=_[1];e.drawImage(o,I,p+P,d+j,E,T)}}),{x:p+S,y:d+y,w:g-S-v,h:m-y-b}},{x:0,y:0,w:this.boxWidth,h:this.boxHeight}),this.cellWidth=(this.prizeArea.w-u.gutter*(this.cols-1))/this.cols,this.cellHeight=(this.prizeArea.h-u.gutter*(this.rows-1))/this.rows,this.cells.forEach(function(c,f){var w=e.getGeometricProperty([c.x,c.y,c.col,c.row]),p=w[0],d=w[1],g=w[2],m=w[3],C=!1;(e.prizeFlag===void 0||e.prizeFlag>-1)&&(C=f===e.currIndex%e.prizes.length>>0);var y=C?s.background:c.background||h.background;if(H(y)){var b=(C?s.shadow:c.shadow||h.shadow).replace(/px/g,"").split(",")[0].split(" ").map(function(v,z){return z<3?Number(v):v});b.length===4&&(o.shadowColor=b[3],o.shadowOffsetX=b[0]*a.dpr,o.shadowOffsetY=b[1]*a.dpr,o.shadowBlur=b[2],b[0]>0?g-=b[0]:(g+=b[0],p-=b[0]),b[1]>0?m-=b[1]:(m+=b[1],d-=b[1])),o.fillStyle=e.handleBackground(p,d,g,m,y);var S=e.getLength(c.borderRadius?c.borderRadius:h.borderRadius);nt(o,p,d,g,m,S),o.fill(),o.shadowColor="rgba(0, 0, 0, 0)",o.shadowOffsetX=0,o.shadowOffsetY=0,o.shadowBlur=0}f>=e.prizes.length&&(f-=e.prizes.length),c.imgs&&c.imgs.forEach(function(v,z){var x=e.ImageCache.get(v.src),k=e.ImageCache.get(v.activeSrc);if(x){var L=C&&k||x;if(L){var I=e.computedWidthAndHeight(L,v,g,m),A=I[0],E=I[1],T=[p+e.getOffsetX(A,g)+e.getLength(v.left,g),d+e.getLength(v.top,m)],_=T[0],P=T[1];e.drawImage(o,L,_,P,A,E)}}}),c.fonts&&c.fonts.forEach(function(v){var z=C&&s.fontStyle?s.fontStyle:v.fontStyle||h.fontStyle,x=C&&s.fontWeight?s.fontWeight:v.fontWeight||h.fontWeight,k=C&&s.fontSize?e.getLength(s.fontSize):e.getLength(v.fontSize||h.fontSize),L=C&&s.lineHeight?s.lineHeight:v.lineHeight||h.lineHeight||v.fontSize||h.fontSize,I=U(v,"wordWrap")?v.wordWrap:h.wordWrap,A=v.lengthLimit||h.lengthLimit,E=v.lineClamp||h.lineClamp;o.font=x+" "+(k>>0)+"px "+z,o.fillStyle=C&&s.fontColor?s.fontColor:v.fontColor||h.fontColor;var T=[],_=String(v.text);if(I){var P=e.getLength(A,g);T=ut(o,ct(_),function(){return P},E)}else T=_.split(` 5`);T.forEach(function(j,rt){o.fillText(j,p+e.getOffsetX(o.measureText(j).width,g)+e.getLength(v.left,g),d+e.getLength(v.top,m)+(rt+1)*e.getLength(L))})})}),(i=a.afterDraw)===null||i===void 0||i.call(this,o)},r.prototype.handleBackground=function(t,i,e,n,a){var o=this.ctx;return a.includes("linear-gradient")&&(a=function(u,h,s,c,f,w){var p=/linear-gradient\((.+)\)/.exec(w)[1].split(",").map(function(y){return y.trim()}),d=p.shift(),g=[0,0,0,0];if(d.includes("deg")){var m=function(y){return Math.tan(y/180*Math.PI)};(d=d.slice(0,-3)%360)>=0&&d<45?g=[h,s+f,h+c,s+f-c*m(d-0)]:d>=45&&d<90?g=[h,s+f,h+c-f*m(d-45),s]:d>=90&&d<135?g=[h+c,s+f,h+c-f*m(d-90),s]:d>=135&&d<180?g=[h+c,s+f,h,s+c*m(d-135)]:d>=180&&d<225?g=[h+c,s,h,s+c*m(d-180)]:d>=225&&d<270?g=[h+c,s,h+f*m(d-225),s+f]:d>=270&&d<315?g=[h,s,h+f*m(d-270),s+f]:d>=315&&d<360&&(g=[h,s,h+c,s+f-c*m(d-315)])}else d.includes("top")?g=[h,s+f,h,s]:d.includes("bottom")?g=[h,s,h,s+f]:d.includes("left")?g=[h+c,s,h,s]:d.includes("right")&&(g=[h,s,h+c,s]);var C=u.createLinearGradient.apply(u,g.map(function(y){return y>>0}));return p.reduce(function(y,b,S){var v=b.split(" ");return v.length===1?y.addColorStop(S,v[0]):v.length===2&&y.addColorStop.apply(y,v),y},C)}(o,t,i,e,n,a)),a},r.prototype.carveOnGunwaleOfAMovingBoat=function(){var t=this,i=t._defaultConfig,e=t.prizeFlag,n=t.currIndex;this.endTime=Date.now();for(var a=this.stopIndex=n,o=i.speed,u=0,h=0,s=0;++u;){var c=this.prizes.length*u+e-a,f=q(this.FPS,a,c,i.decelerationTime)-a;if(f>o){this.endIndex=o-h>f-o?c:s;break}s=c,h=f}},r.prototype.play=function(){var t,i;this.step===0&&(this.startTime=Date.now(),this.prizeFlag=void 0,this.step=1,(i=(t=this.config).afterStart)===null||i===void 0||i.call(t),this.run())},r.prototype.stop=function(t){if(this.step!==0&&this.step!==3){if(!t&&t!==0){var i=this.prizes.map(function(e){return e.range});t=St(i)}t<0?(this.step=0,this.prizeFlag=-1):(this.step=2,this.prizeFlag=t%this.prizes.length)}},r.prototype.run=function(t){var i;t===void 0&&(t=0);var e=this,n=e.rAF,a=e.step,o=e.prizes,u=e.prizeFlag,h=e._defaultConfig,s=h.accelerationTime,c=h.decelerationTime,f=h.speed;if(a!==0){if(u!==-1){a!==3||this.endIndex||this.carveOnGunwaleOfAMovingBoat();var w=Date.now()-this.startTime,p=Date.now()-this.endTime,d=this.currIndex;if(a===1||w<s){this.FPS=w/t;var g=dt(w,.1,f-.1,s);g===f&&(this.step=2),d+=g%o.length}else a===2?(d+=f%o.length,u!==void 0&&u>=0&&(this.step=3,this.stopIndex=0,this.endIndex=0)):a===3?(d=q(p,this.stopIndex,this.endIndex,c),p>=c&&(this.step=0)):this.stop(-1);this.currIndex=d,this.draw(),n(this.run.bind(this,t+1))}}else(i=this.endCallback)===null||i===void 0||i.call(this,this.prizes.find(function(m,C){return C===u})||{})},r.prototype.getGeometricProperty=function(t){var i=t[0],e=t[1],n=t[2],a=n===void 0?1:n,o=t[3],u=o===void 0?1:o,h=this.cellWidth,s=this.cellHeight,c=this._defaultConfig.gutter,f=[this.prizeArea.x+(h+c)*i,this.prizeArea.y+(s+c)*e];
5return a&&u&&f.push(h*a+c*(a-1),s*u+c*(u-1)),f},r.prototype.conversionAxis=function(t,i){var e=this.config;return[t/e.dpr,i/e.dpr]},r})(ft);(function(l){function r(t,i){var e,n=l.call(this,t,{width:i.width,height:i.height})||this;return n.blocks=[],n.prizes=[],n.slots=[],n.defaultConfig={},n._defaultConfig={},n.defaultStyle={},n._defaultStyle={},n.endCallback=function(){},n.cellWidth=0,n.cellHeight=0,n.cellAndSpacing=0,n.widthAndSpacing=0,n.heightAndSpacing=0,n.FPS=16.6,n.scroll=[],n.stopScroll=[],n.endScroll=[],n.startTime=0,n.endTime=0,n.step=0,n.prizeFlag=void 0,n.ImageCache=new Map,n.initData(i),n.initWatch(),n.initComputed(),(e=t.beforeCreate)===null||e===void 0||e.call(n),n.init(),n}return lt(r,l),r.prototype.resize=function(){var t,i;l.prototype.resize.call(this),this.draw(),(i=(t=this.config).afterResize)===null||i===void 0||i.call(t)},r.prototype.initLucky=function(){this.cellWidth=0,this.cellHeight=0,this.cellAndSpacing=0,this.widthAndSpacing=0,this.heightAndSpacing=0,this.FPS=16.6,this.scroll=[],this.stopScroll=[],this.endScroll=[],this.startTime=0,this.endTime=0,this.prizeFlag=void 0,this.step=0,l.prototype.initLucky.call(this)},r.prototype.initData=function(t){this.$set(this,"width",t.width),this.$set(this,"height",t.height),this.$set(this,"blocks",t.blocks||[]),this.$set(this,"prizes",t.prizes||[]),this.$set(this,"slots",t.slots||[]),this.$set(this,"defaultConfig",t.defaultConfig||{}),this.$set(this,"defaultStyle",t.defaultStyle||{}),this.$set(this,"endCallback",t.end)},r.prototype.initComputed=function(){var t=this;this.$computed(this,"_defaultConfig",function(){var i=R({mode:"vertical",rowSpacing:0,colSpacing:5,speed:20,direction:1,accelerationTime:2500,decelerationTime:2500},t.defaultConfig);return i.rowSpacing=t.getLength(i.rowSpacing),i.colSpacing=t.getLength(i.colSpacing),i}),this.$computed(this,"_defaultStyle",function(){return R({borderRadius:0,fontColor:"#000",fontSize:"18px",fontStyle:"sans-serif",fontWeight:"400",background:"rgba(0,0,0,0)",wordWrap:!0,lengthLimit:"90%"},t.defaultStyle)})},r.prototype.initWatch=function(){var t=this;this.$watch("width",function(i){t.data.width=i,t.resize()}),this.$watch("height",function(i){t.data.height=i,t.resize()}),this.$watch("blocks",function(i){t.initImageCache()},{deep:!0}),this.$watch("prizes",function(i){t.initImageCache()},{deep:!0}),this.$watch("slots",function(i){t.drawOffscreenCanvas(),t.draw()},{deep:!0}),this.$watch("defaultConfig",function(){return t.draw()},{deep:!0}),this.$watch("defaultStyle",function(){return t.draw()},{deep:!0}),this.$watch("endCallback",function(){return t.init()})},r.prototype.init=function(){var t,i;return D(this,void 0,void 0,function(){var e;return F(this,function(n){switch(n.label){case 0:return this.initLucky(),e=this.config,(t=e.beforeInit)===null||t===void 0||t.call(this),this.drawOffscreenCanvas(),this.draw(),[4,this.initImageCache()];case 1:return n.sent(),(i=e.afterInit)===null||i===void 0||i.call(this),[2]}})})},r.prototype.initImageCache=function(){var t=this;return new Promise(function(i){var e={blocks:t.blocks.map(function(n){return n.imgs}),prizes:t.prizes.map(function(n){return n.imgs})};Object.keys(e).forEach(function(n){var a=e[n],o=[];a&&a.forEach(function(u,h){u&&u.forEach(function(s,c){o.push(t.loadAndCacheImg(n,h,c))})}),Promise.all(o).then(function(){t.drawOffscreenCanvas(),t.draw(),i()})})})},r.prototype.loadAndCacheImg=function(t,i,e){return D(this,void 0,void 0,function(){var n=this;return F(this,function(a){return[2,new Promise(function(o,u){var h=n[t][i];if(h&&h.imgs){var s=h.imgs[e];s&&n.loadImg(s.src,s).then(function(c){return D(n,void 0,void 0,function(){return F(this,function(f){switch(f.label){case 0:return typeof s.formatter!="function"?[3,2]:[4,Promise.resolve(s.formatter.call(this,c))];case 1:c=f.sent(),f.label=2;case 2:return this.ImageCache.set(s.src,c),o(),[2]}})})}).catch(function(c){u()})}})]})})},r.prototype.drawOffscreenCanvas=function(){var t=this,i=this._defaultConfig,e=this._defaultStyle,n=this.drawBlocks(),a=n.w,o=n.h,u=this.prizes.length,h=this.displacementWidthOrHeight(),s=h.cellWidth,c=h.cellHeight,f=h.widthAndSpacing,w=h.heightAndSpacing,p=new Array(u).fill(void 0).map(function(b,S){return S}),d=0,g=0;
5this.slots.forEach(function(b,S){t.scroll[S]===void 0&&(t.scroll[S]=0),b.order=b.order||p;var v=b.order.length;d=Math.max(d,a+f*v),g=Math.max(g,o+w*v)});var m=this.getOffscreenCanvas(d,g),C=m._offscreenCanvas,y=m._ctx;this._offscreenCanvas=C,this.slots.forEach(function(b,S){var v=s*S,z=c*S,x=0,k=function(O,N){for(var Q={},V=[],$=0;$<O.length;$++)Q[$]=O[$];for($=0;$<N.length;$++){var X=Q[N[$]];X&&(V[$]=X)}return V}(t.prizes,b.order);if(k.length){k.forEach(function(O,N){if(O){b.order[N];var Q=f*N+i.colSpacing/2,V=w*N+i.rowSpacing/2,$=t.displacement([v,V,w],[Q,z,f]),X=$[0],ot=$[1],xt=$[2];x+=xt;var gt=O.background||e.background;if(H(gt)){var kt=t.getLength(U(O,"borderRadius")?O.borderRadius:e.borderRadius);nt(y,X,ot,s,s,kt),y.fillStyle=gt,y.fill()}O.imgs&&O.imgs.forEach(function(W,pt){var Y=t.ImageCache.get(W.src);if(Y){var Z=t.computedWidthAndHeight(Y,W,s,c),tt=Z[0],at=Z[1],et=[X+t.getOffsetX(tt,s)+t.getLength(W.left,s),ot+t.getLength(W.top,c)],st=et[0],J=et[1];t.drawImage(y,Y,st,J,tt,at)}}),O.fonts&&O.fonts.forEach(function(W){var pt=W.fontStyle||e.fontStyle,Y=W.fontWeight||e.fontWeight,Z=t.getLength(W.fontSize||e.fontSize),tt=W.lineHeight||e.lineHeight||W.fontSize||e.fontSize,at=U(W,"wordWrap")?W.wordWrap:e.wordWrap,et=W.lengthLimit||e.lengthLimit,st=W.lineClamp||e.lineClamp;y.font=Y+" "+(Z>>0)+"px "+pt,y.fillStyle=W.fontColor||e.fontColor;var J=[],vt=String(W.text);if(at){var It=t.getLength(et,s);J=ut(y,ct(vt),function(){return It},st)}else J=vt.split(` 6`);J.forEach(function(mt,At){y.fillText(mt,X+t.getOffsetX(y.measureText(mt).width,s)+t.getLength(W.left,s),ot+t.getLength(W.top,c)+(At+1)*t.getLength(tt))})})}});for(var L=t.displacement([v,0,s,x],[0,z,x,c]),I=L[0],A=L[1],E=L[2],T=L[3],_=x;_<g+x;){var P=t.displacement([I,_],[_,A]),j=P[0],rt=P[1];t.drawImage(y,C,I,A,E,T,j,rt,E,T),_+=x}}})},r.prototype.drawBlocks=function(){var t=this,i=this;i.config;var e=i.ctx;i._defaultConfig;var n=i._defaultStyle;return this.prizeArea=this.blocks.reduce(function(a,o,u){var h=a.x,s=a.y,c=a.w,f=a.h,w=bt(o,t.getLength.bind(t)),p=w[0],d=w[1],g=w[2],m=w[3],C=o.borderRadius?t.getLength(o.borderRadius):0,y=o.background||n.background;return H(y)&&(nt(e,h,s,c,f,C),e.fillStyle=y,e.fill()),o.imgs&&o.imgs.forEach(function(b,S){var v=t.ImageCache.get(b.src);if(v){var z=t.computedWidthAndHeight(v,b,c,f),x=z[0],k=z[1],L=[t.getOffsetX(x,c)+t.getLength(b.left,c),t.getLength(b.top,f)],I=L[0],A=L[1];t.drawImage(e,v,h+I,s+A,x,k)}}),{x:h+g,y:s+p,w:c-g-m,h:f-p-d}},{x:0,y:0,w:this.boxWidth,h:this.boxHeight})},r.prototype.draw=function(){var t,i=this,e=this,n=e.config,a=e.ctx;e._defaultConfig,e._defaultStyle,(t=n.beforeDraw)===null||t===void 0||t.call(this,a),a.clearRect(0,0,this.boxWidth,this.boxHeight);var o=this.drawBlocks(),u=o.x,h=o.y,s=o.w,c=o.h;if(this._offscreenCanvas){var f=this,w=f.cellWidth,p=f.cellHeight,d=f.cellAndSpacing,g=f.widthAndSpacing,m=f.heightAndSpacing;this.slots.forEach(function(C,y){var b=d*C.order.length,S=i.displacement(-(c-m)/2,-(s-g)/2),v=i.scroll[y]+S;v<0&&(v=v%b+b),v>b&&(v%=b);var z=i.displacement([w*y,v,w,c],[v,p*y,s,p]),x=z[0],k=z[1],L=z[2],I=z[3],A=i.displacement([u+g*y,h,w,c],[u,h+m*y,s,p]),E=A[0],T=A[1],_=A[2],P=A[3];i.drawImage(a,i._offscreenCanvas,x,k,L,I,E,T,_,P)})}},r.prototype.carveOnGunwaleOfAMovingBoat=function(){var t=this,i=this,e=i._defaultConfig,n=i.prizeFlag,a=i.cellAndSpacing;this.endTime=Date.now(),this.slots.forEach(function(o,u){var h=o.order;if(h.length)for(var s=o.speed||e.speed,c=o.direction||e.direction,f=h.findIndex(function(C){return C===n[u]}),w=a*h.length,p=t.stopScroll[u]=t.scroll[u],d=0;++d;){var g=a*f+w*d*c-p,m=q(t.FPS,p,g,e.decelerationTime)-p;if(Math.abs(m)>s){t.endScroll[u]=g;break}}})},r.prototype.play=function(){var t,i;this.step===0&&(this.startTime=Date.now(),this.prizeFlag=void 0,this.step=1,(i=(t=this.config).afterStart)===null||i===void 0||i.call(t),this.run())},r.prototype.stop=function(t){var i;if(this.step!==0&&this.step!==3){if(typeof t=="number")this.prizeFlag=new Array(this.slots.length).fill(t);else{if(!K(t,"array"))return this.stop(-1),void 0;if(t.length!==this.slots.length)return this.stop(-1),void 0;this.prizeFlag=t}!((i=this.prizeFlag)===null||i===void 0)&&i.includes(-1)?(this.prizeFlag=[],this.step=0):this.step=2}},r.prototype.run=function(t){var i,e,n=this;t===void 0&&(t=0);var a=this,o=a.rAF,u=a.step,h=a.prizeFlag,s=a._defaultConfig,c=a.cellAndSpacing,f=a.slots,w=s.accelerationTime,p=s.decelerationTime;if(this.step!==0||(h==null?void 0:h.length)!==f.length){if(h===void 0||h.length){this.step!==3||this.endScroll.length||this.carveOnGunwaleOfAMovingBoat();var d=Date.now()-this.startTime,g=Date.now()-this.endTime;f.forEach(function(S,v){var z=S.order;if(z&&z.length){var x=c*z.length,k=Math.abs(S.speed||s.speed),L=S.direction||s.direction,I=0,A=n.scroll[v];if(u===1||d<w){n.FPS=d/t;var E=dt(d,0,k,w);E===k&&(n.step=2),I=(A+E*L)%x}else if(u===2)I=(A+k*L)%x,(h==null?void 0:h.length)===f.length&&(n.step=3,n.stopScroll=[],n.endScroll=[]);else if(u===3&&g){var T=n.stopScroll[v],_=n.endScroll[v];I=q(g,T,_,p),g>=p&&(n.step=0)}n.scroll[v]=I}}),this.draw(),o(this.run.bind(this,t+1))}}else{for(var m=h[0],C=0;C<f.length;C++){var y=f[C],b=h[C];if(!(!((i=y.order)===null||i===void 0)&&i.includes(b))||m!==b){m=-1;break}}(e=this.endCallback)===null||e===void 0||e.call(this,this.prizes.find(function(S,v){return v===m})||void 0)}},r.prototype.displacement=function(t,i){return this._defaultConfig.mode==="horizontal"?i:t},r.prototype.displacementWidthOrHeight=function(){var t=this._defaultConfig.mode,i=this.slots.length,e=this._defaultConfig,n=e.colSpacing,a=e.rowSpacing,o=this.prizeArea||this.drawBlocks();o.x,o.y;var u,h,s=o.w,c=o.h,f=0,w=0;return t==="horizontal"?(w=this.cellHeight=(c-a*(i-1))/i,f=this.cellWidth=w):(f=this.cellWidth=(s-n*(i-1))/i,w=this.cellHeight=f),u=this.widthAndSpacing=this.cellWidth+n,h=this.heightAndSpacing=this.cellHeight+a,this.cellAndSpacing=t==="horizontal"?u:h,{cellWidth:f,cellHeight:w,widthAndSpacing:u,heightAndSpacing:h}},r})(ft);export{$t as LuckyWheel};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.