"use strict";(self.webpackChunkcoinflip=self.webpackChunkcoinflip||[]).push([[766],{8766:(e,t,n)=>{n.d(t,{sf:()=>r,YT:()=>i,Il:()=>S,hh:()=>N,JS:()=>C,wf:()=>R,M8:()=>I,bq:()=>s,mJ:()=>a,Kg:()=>B,T:()=>o,pe:()=>L,RN:()=>P,YK:()=>l,o$:()=>D,Ww:()=>$,J:()=>q,RF:()=>G,T0:()=>U,PA:()=>T,Yi:()=>b,Rb:()=>x,F$:()=>y,Qb:()=>g,QY:()=>m,Df:()=>p,Tl:()=>E,Qe:()=>h,cQ:()=>k,FM:()=>F,dT:()=>Y,u_:()=>c,Xd:()=>_,n0:()=>d});var r=(e=>(e[e.Region=0]="Region",e[e.BoundingBox=1]="BoundingBox",e[e.Mesh=2]="Mesh",e[e.LinkedMesh=3]="LinkedMesh",e[e.Path=4]="Path",e[e.Point=5]="Point",e[e.Clipping=6]="Clipping",e))(r||{});class i{constructor(e,t=new Array,n=0,r=new DataView(e.buffer)){this.strings=t,this.index=n,this.buffer=r}readByte(){return this.buffer.getInt8(this.index++)}readUnsignedByte(){return this.buffer.getUint8(this.index++)}readShort(){const e=this.buffer.getInt16(this.index);return this.index+=2,e}readInt32(){const e=this.buffer.getInt32(this.index);return this.index+=4,e}readInt(e){let t=this.readByte(),n=127&t;return 0!=(128&t)&&(t=this.readByte(),n|=(127&t)<<7,0!=(128&t)&&(t=this.readByte(),n|=(127&t)<<14,0!=(128&t)&&(t=this.readByte(),n|=(127&t)<<21,0!=(128&t)&&(t=this.readByte(),n|=(127&t)<<28)))),e?n:n>>>1^-(1&n)}readStringRef(){const e=this.readInt(!0);return 0==e?null:this.strings[e-1]}readString(){let e=this.readInt(!0);switch(e){case 0:return null;case 1:return""}e--;let t="";for(let n=0;n>4){case 12:case 13:t+=String.fromCharCode((31&e)<<6|63&this.readByte()),n+=2;break;case 14:t+=String.fromCharCode((15&e)<<12|(63&this.readByte())<<6|63&this.readByte()),n+=3;break;default:t+=String.fromCharCode(e),n++}}return t}readFloat(){const e=this.buffer.getFloat32(this.index);return this.index+=4,e}readBoolean(){return 0!=this.readByte()}}var s=(e=>(e[e.setup=0]="setup",e[e.first=1]="first",e[e.replace=2]="replace",e[e.add=3]="add",e))(s||{}),a=(e=>(e[e.mixIn=0]="mixIn",e[e.mixOut=1]="mixOut",e))(a||{}),o=(e=>(e[e.Fixed=0]="Fixed",e[e.Percent=1]="Percent",e))(o||{}),l=(e=>(e[e.Tangent=0]="Tangent",e[e.Chain=1]="Chain",e[e.ChainScale=2]="ChainScale",e))(l||{}),h=(e=>(e[e.Normal=0]="Normal",e[e.OnlyTranslation=1]="OnlyTranslation",e[e.NoRotationOrReflection=2]="NoRotationOrReflection",e[e.NoScale=3]="NoScale",e[e.NoScaleOrReflection=4]="NoScaleOrReflection",e))(h||{}),u=n(6951);function c(e){switch(e.toLowerCase()){case"nearest":return g.Nearest;case"linear":return g.Linear;case"mipmap":return g.MipMap;case"mipmapnearestnearest":return g.MipMapNearestNearest;case"mipmaplinearnearest":return g.MipMapLinearNearest;case"mipmapnearestlinear":return g.MipMapNearestLinear;case"mipmaplinearlinear":return g.MipMapLinearLinear;default:throw new Error(`Unknown texture filter ${e}`)}}function d(e){switch(e.toLowerCase()){case"mirroredtepeat":return p.MirroredRepeat;case"clamptoedge":return p.ClampToEdge;case"repeat":return p.Repeat;default:throw new Error(`Unknown texture wrap ${e}`)}}var g=(e=>(e[e.Nearest=9728]="Nearest",e[e.Linear=9729]="Linear",e[e.MipMap=9987]="MipMap",e[e.MipMapNearestNearest=9984]="MipMapNearestNearest",e[e.MipMapLinearNearest=9985]="MipMapLinearNearest",e[e.MipMapNearestLinear=9986]="MipMapNearestLinear",e[e.MipMapLinearLinear=9987]="MipMapLinearLinear",e))(g||{}),p=(e=>(e[e.MirroredRepeat=33648]="MirroredRepeat",e[e.ClampToEdge=33071]="ClampToEdge",e[e.Repeat=10497]="Repeat",e))(p||{});class m{constructor(){this.size=null,this.names=null,this.values=null,this.renderObject=null}get width(){const e=this.texture;return e.trim?e.trim.width:e.orig.width}get height(){const e=this.texture;return e.trim?e.trim.height:e.orig.height}get u(){return this.texture._uvs.x0}get v(){return this.texture._uvs.y0}get u2(){return this.texture._uvs.x2}get v2(){return this.texture._uvs.y2}get offsetX(){const e=this.texture;return e.trim?e.trim.x:0}get offsetY(){return this.spineOffsetY}get pixiOffsetY(){const e=this.texture;return e.trim?e.trim.y:0}get spineOffsetY(){const e=this.texture;return this.originalHeight-this.height-(e.trim?e.trim.y:0)}get originalWidth(){return this.texture.orig.width}get originalHeight(){return this.texture.orig.height}get x(){return this.texture.frame.x}get y(){return this.texture.frame.y}get rotate(){return 0!==this.texture.rotate}get degrees(){return(360-45*this.texture.rotate)%360}}class f{constructor(){this.x=0,this.y=0,this.width=0,this.height=0,this.offsetX=0,this.offsetY=0,this.originalWidth=0,this.originalHeight=0,this.rotate=0,this.index=0}}class b{constructor(e,t,n){this.pages=new Array,this.regions=new Array,e&&this.addSpineAtlas(e,t,n)}addTexture(e,t){const n=this.pages;let r=null;for(let e=0;e{s.width=parseInt(i[1]),s.height=parseInt(i[2])},a.format=()=>{},a.filter=()=>{s.minFilter=c(i[1]),s.magFilter=c(i[2])},a.repeat=()=>{-1!=i[1].indexOf("x")&&(s.uWrap=p.Repeat),-1!=i[1].indexOf("y")&&(s.vWrap=p.Repeat)},a.pma=()=>{s.pma="true"==i[1]};const l={xy:()=>{o.x=parseInt(i[1]),o.y=parseInt(i[2])},size:()=>{o.width=parseInt(i[1]),o.height=parseInt(i[2])},bounds:()=>{o.x=parseInt(i[1]),o.y=parseInt(i[2]),o.width=parseInt(i[3]),o.height=parseInt(i[4])},offset:()=>{o.offsetX=parseInt(i[1]),o.offsetY=parseInt(i[2])},orig:()=>{o.originalWidth=parseInt(i[1]),o.originalHeight=parseInt(i[2])},offsets:()=>{o.offsetX=parseInt(i[1]),o.offsetY=parseInt(i[2]),o.originalWidth=parseInt(i[3]),o.originalHeight=parseInt(i[4])},rotate:()=>{const e=i[1];let t=0;t="true"==e.toLocaleLowerCase()?6:"false"==e.toLocaleLowerCase()?0:(720-parseFloat(e))%360/45,o.rotate=t},index:()=>{o.index=parseInt(i[1])}};let h=r.readLine();for(;null!=h&&0==h.trim().length;)h=r.readLine();for(;null!=h&&0!=h.trim().length&&0!=r.readEntry(i,h);)h=r.readLine();const d=()=>{for(;;){if(null==h)return n&&n(this);if(0==h.trim().length)s=null,h=r.readLine();else{if(null===s){for(s=new x,s.name=h.trim();0!=r.readEntry(i,h=r.readLine());){const e=a[i[0]];e&&e()}this.pages.push(s),t(s.name,(e=>{if(null===e)return this.pages.splice(this.pages.indexOf(s),1),n&&n(null);s.baseTexture=e,s.pma&&(e.alphaMode=u.iw.PMA),e.valid||e.setSize(s.width,s.height),s.setFilters(),s.width&&s.height||(s.width=e.realWidth,s.height=e.realHeight,s.width&&s.height||console.log(`ERROR spine atlas page ${s.name}: meshes wont work if you dont specify size in atlas (http://www.html5gamedevs.com/topic/18888-pixi-spines-and-meshes/?p=107121)`)),d()}));break}{o=new f;const e=new y;e.name=h,e.page=s;let t=null,n=null;for(;;){const e=r.readEntry(i,h=r.readLine());if(0==e)break;const s=l[i[0]];if(s)s();else{null==t&&(t=[],n=[]),t.push(i[0]);const r=[];for(let t=0;t=this.lines.length?null:this.lines[this.index++]}readEntry(e,t){if(null==t)return 0;if(0==(t=t.trim()).length)return 0;const n=t.indexOf(":");if(-1==n)return 0;e[0]=t.substr(0,n).trim();for(let r=1,i=n+1;;r++){const n=t.indexOf(",",i);if(-1==n)return e[r]=t.substr(i).trim(),r;if(e[r]=t.substr(i,n-i).trim(),i=n+1,4==r)return 4}}}class x{constructor(){this.minFilter=g.Nearest,this.magFilter=g.Nearest,this.uWrap=p.ClampToEdge,this.vWrap=p.ClampToEdge}setFilters(){const e=this.baseTexture,t=this.minFilter;t==g.Linear?e.scaleMode=u.aH.LINEAR:this.minFilter==g.Nearest?e.scaleMode=u.aH.NEAREST:(e.mipmap=u.KI.POW2,t==g.MipMapNearestNearest?e.scaleMode=u.aH.NEAREST:e.scaleMode=u.aH.LINEAR)}}class y extends m{}class C{constructor(){this.array=new Array}add(e){const t=this.contains(e);return this.array[0|e]=0|e,!t}contains(e){return null!=this.array[0|e]}remove(e){this.array[0|e]=void 0}clear(){this.array.length=0}}class T{constructor(){this.entries={},this.size=0}add(e){const t=this.entries[e];return this.entries[e]=!0,!t&&(this.size++,!0)}addAll(e){const t=this.size;for(let t=0,n=e.length;t1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this}static rgba8888ToColor(e,t){e.r=((4278190080&t)>>>24)/255,e.g=((16711680&t)>>>16)/255,e.b=((65280&t)>>>8)/255,e.a=(255&t)/255}static rgb888ToColor(e,t){e.r=((16711680&t)>>>16)/255,e.g=((65280&t)>>>8)/255,e.b=(255&t)/255}static fromString(e){return(new M).setFromString(e)}};let S=M;S.WHITE=new M(1,1,1,1),S.RED=new M(1,0,0,1),S.GREEN=new M(0,1,0,1),S.BLUE=new M(0,0,1,1),S.MAGENTA=new M(1,0,1,1);const A=class{static clamp(e,t,n){return en?n:e}static cosDeg(e){return Math.cos(e*A.degRad)}static sinDeg(e){return Math.sin(e*A.degRad)}static signum(e){return Math.sign(e)}static toInt(e){return e>0?Math.floor(e):Math.ceil(e)}static cbrt(e){const t=Math.pow(Math.abs(e),1/3);return e<0?-t:t}static randomTriangular(e,t){return A.randomTriangularWith(e,t,.5*(e+t))}static randomTriangularWith(e,t,n){const r=Math.random(),i=t-e;return r<=(n-e)/i?e+Math.sqrt(r*i*(n-e)):t-Math.sqrt((1-r)*i*(t-n))}static isPowerOfTwo(e){return e&&0==(e&e-1)}};let I=A;I.PI=3.1415927,I.PI2=2*A.PI,I.radiansToDegrees=180/A.PI,I.radDeg=A.radiansToDegrees,I.degreesToRadians=A.PI/180,I.degRad=A.degreesToRadians;class R{apply(e,t,n){return e+(t-e)*this.applyInternal(n)}}class L extends R{constructor(e){super(),this.power=2,this.power=e}applyInternal(e){return e<=.5?Math.pow(2*e,this.power)/2:Math.pow(2*(e-1),this.power)/(this.power%2==0?-2:2)+1}}class P extends L{applyInternal(e){return Math.pow(e-1,this.power)*(this.power%2==0?-1:1)+1}}const v=class{static arrayCopy(e,t,n,r,i){for(let s=t,a=r;s=t?e:v.setArraySize(e,t,n)}static newArray(e,t){const n=new Array(e);for(let r=0;r0?this.items.pop():this.instantiator()}free(e){e.reset&&e.reset(),this.items.push(e)}freeAll(e){for(let t=0;tthis.maxDelta&&(this.delta=this.maxDelta),this.lastTime=e,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)}}class Y{constructor(e=32){this.addedValues=0,this.lastValue=0,this.mean=0,this.dirty=!0,this.values=new Array(e)}hasEnoughData(){return this.addedValues>=this.values.length}addValue(e){this.addedValuesthis.values.length-1&&(this.lastValue=0),this.dirty=!0}getMean(){if(this.hasEnoughData()){if(this.dirty){let e=0;for(let t=0;tk.newFloatArray(16)))}update(e,t){if(!e)throw new Error("skeleton cannot be null.");const n=this.boundingBoxes,i=this.polygons,s=this.polygonPool,a=e.slots,o=a.length;n.length=0,s.freeAll(i),i.length=0;for(let e=0;e=this.minX&&e<=this.maxX&&t>=this.minY&&t<=this.maxY}aabbIntersectsSegment(e,t,n,r){const i=this.minX,s=this.minY,a=this.maxX,o=this.maxY;if(e<=i&&n<=i||t<=s&&r<=s||e>=a&&n>=a||t>=o&&r>=o)return!1;const l=(r-t)/(n-e);let h=l*(i-e)+t;if(h>s&&hs&&hi&&ui&&ue.minX&&this.minYe.minY}containsPoint(e,t){const n=this.polygons;for(let r=0,i=n.length;r=n||o=n){const l=r[e];l+(n-i)/(o-i)*(r[s]-l)=u&&b<=a||b>=a&&b<=u)&&(b>=t&&b<=r||b>=r&&b<=t)){const e=(h*m-l*g)/f;if((e>=c&&e<=d||e>=d&&e<=c)&&(e>=n&&e<=i||e>=i&&e<=n))return!0}u=a,c=d}return!1}getPolygon(e){if(!e)throw new Error("boundingBox cannot be null.");const t=this.boundingBoxes.indexOf(e);return-1==t?null:this.polygons[t]}getWidth(){return this.maxX-this.minX}getHeight(){return this.maxY-this.minY}}const _={yDown:!0,FAIL_ON_NON_EXISTING_SKIN:!1,GLOBAL_AUTO_UPDATE:!0,GLOBAL_DELAY_LIMIT:0};var O=n(8820),W=n(2274),V=n(5638),H=n(7627);const X=[0,0,0];class U extends W.j{constructor(){super(...arguments),this.region=null,this.attachment=null}}class G extends V.AL{constructor(e,t,n,r,i){super(e,t,n,r,i),this.region=null,this.attachment=null}}const z=class extends O.W2{constructor(e){if(super(),!e)throw new Error("The spineData param is required.");if("string"==typeof e)throw new Error('spineData param cant be string. Please use spine.Spine.fromAtlas("YOUR_RESOURCE_NAME") from now on.');this.spineData=e,this.createSkeleton(e),this.slotContainers=[],this.tempClipContainers=[];for(let e=0,t=this.skeleton.slots.length;et&&(e=t),this.state.update(e),this.state.apply(this.skeleton),!this.skeleton)return;this.skeleton.updateWorldTransform();const n=this.skeleton.slots,i=this.color;let s=null,a=null;i?(s=i.light,a=i.dark):s=this.tintRgb;for(let e=0,t=n.length;e0;e--)t.bones.children[e-1].destroy({children:!0,texture:!0,baseTexture:!0});const n=e.scale.x||e.scale.y||1,r=this.lineWidth/n;this.drawBones&&this.drawBonesFunc(e,t,r,n),this.drawPaths&&this.drawPathsFunc(e,t,r),this.drawBoundingBoxes&&this.drawBoundingBoxesFunc(e,t,r),this.drawClipping&&this.drawClippingFunc(e,t,r),(this.drawMeshHull||this.drawMeshTriangles)&&this.drawMeshHullAndMeshTriangles(e,t,r),this.drawRegionAttachments&&this.drawRegionAttachmentsFunc(e,t,r)}drawBonesFunc(e,t,n,r){const i=e.skeleton,s=i.x,a=i.y,o=i.bones;t.skeletonXY.lineStyle(n,this.skeletonXYColor,1);for(let e=0,i=o.length;ec&&uc&&u>d?S=-C:hd?S=C:u===d&&hc?S=-90*y:h===c&&ud&&(S=0),T.rotation=S,T.lineStyle(n+M/2.4,this.bonesColor,1),T.beginFill(0,.6),T.drawCircle(0,w,1.2*M),T.endFill()}const l=3*n;t.skeletonXY.moveTo(s-l,a-l),t.skeletonXY.lineTo(s+l,a+l),t.skeletonXY.moveTo(s+l,a-l),t.skeletonXY.lineTo(s-l,a+l)}drawRegionAttachmentsFunc(e,t,n){const i=e.skeleton.slots;t.regionAttachmentsShape.lineStyle(n,this.regionAttachmentsColor,1);for(let e=0,n=i.length;e0){h=2*(h>>1);let e=o[h-2],n=o[h-1];for(let r=0,i=h;r{if(t.boundingBoxesPolygon.lineStyle(n,this.boundingBoxesPolygonColor,1),t.boundingBoxesPolygon.beginFill(this.boundingBoxesPolygonColor,.1),i<3)throw new Error("Polygon must contain at least 3 vertices");const s=[],a=2*n;for(let n=0,r=e.length;n