canvasengine 2.0.0-beta.24 → 2.0.0-beta.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DebugRenderer-C8qYAVLT.js +172 -0
- package/dist/DebugRenderer-C8qYAVLT.js.map +1 -0
- package/dist/components/Canvas.d.ts +18 -0
- package/dist/components/Canvas.d.ts.map +1 -0
- package/dist/components/Container.d.ts +79 -0
- package/dist/components/Container.d.ts.map +1 -0
- package/dist/components/DOMContainer.d.ts +76 -0
- package/dist/components/DOMContainer.d.ts.map +1 -0
- package/dist/components/DOMElement.d.ts +44 -0
- package/dist/components/DOMElement.d.ts.map +1 -0
- package/dist/components/DisplayObject.d.ts +81 -0
- package/dist/components/DisplayObject.d.ts.map +1 -0
- package/dist/components/Graphic.d.ts +65 -0
- package/dist/components/Graphic.d.ts.map +1 -0
- package/dist/components/Mesh.d.ts +201 -0
- package/dist/components/Mesh.d.ts.map +1 -0
- package/dist/components/NineSliceSprite.d.ts +17 -0
- package/dist/components/NineSliceSprite.d.ts.map +1 -0
- package/dist/components/ParticleEmitter.d.ts +5 -0
- package/dist/components/ParticleEmitter.d.ts.map +1 -0
- package/dist/components/Scene.d.ts +2 -0
- package/dist/components/Scene.d.ts.map +1 -0
- package/dist/components/Sprite.d.ts +173 -0
- package/dist/components/Sprite.d.ts.map +1 -0
- package/dist/components/Text.d.ts +21 -0
- package/dist/components/Text.d.ts.map +1 -0
- package/dist/components/TilingSprite.d.ts +18 -0
- package/dist/components/TilingSprite.d.ts.map +1 -0
- package/dist/components/Video.d.ts +15 -0
- package/dist/components/Video.d.ts.map +1 -0
- package/dist/components/Viewport.d.ts +105 -0
- package/dist/components/Viewport.d.ts.map +1 -0
- package/dist/components/index.d.ts +16 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/types/DisplayObject.d.ts +106 -0
- package/dist/components/types/DisplayObject.d.ts.map +1 -0
- package/dist/components/types/MouseEvent.d.ts +4 -0
- package/dist/components/types/MouseEvent.d.ts.map +1 -0
- package/dist/components/types/Spritesheet.d.ts +366 -0
- package/dist/components/types/Spritesheet.d.ts.map +1 -0
- package/dist/components/types/index.d.ts +5 -0
- package/dist/components/types/index.d.ts.map +1 -0
- package/dist/directives/Drag.d.ts +70 -0
- package/dist/directives/Drag.d.ts.map +1 -0
- package/dist/directives/KeyboardControls.d.ts +530 -0
- package/dist/directives/KeyboardControls.d.ts.map +1 -0
- package/dist/directives/Scheduler.d.ts +36 -0
- package/dist/directives/Scheduler.d.ts.map +1 -0
- package/dist/directives/Sound.d.ts +26 -0
- package/dist/directives/Sound.d.ts.map +1 -0
- package/dist/directives/Transition.d.ts +11 -0
- package/dist/directives/Transition.d.ts.map +1 -0
- package/dist/directives/ViewportCull.d.ts +12 -0
- package/dist/directives/ViewportCull.d.ts.map +1 -0
- package/dist/directives/ViewportFollow.d.ts +19 -0
- package/dist/directives/ViewportFollow.d.ts.map +1 -0
- package/dist/directives/index.d.ts +2 -0
- package/dist/directives/index.d.ts.map +1 -0
- package/dist/engine/animation.d.ts +59 -0
- package/dist/engine/animation.d.ts.map +1 -0
- package/dist/engine/bootstrap.d.ts +16 -0
- package/dist/engine/bootstrap.d.ts.map +1 -0
- package/dist/engine/directive.d.ts +14 -0
- package/dist/engine/directive.d.ts.map +1 -0
- package/dist/engine/reactive.d.ts +68 -0
- package/dist/engine/reactive.d.ts.map +1 -0
- package/dist/engine/signal.d.ts +72 -0
- package/dist/engine/signal.d.ts.map +1 -0
- package/dist/engine/trigger.d.ts +51 -0
- package/dist/engine/trigger.d.ts.map +1 -0
- package/dist/engine/utils.d.ts +90 -0
- package/dist/engine/utils.d.ts.map +1 -0
- package/dist/hooks/addContext.d.ts +2 -0
- package/dist/hooks/addContext.d.ts.map +1 -0
- package/dist/hooks/useProps.d.ts +42 -0
- package/dist/hooks/useProps.d.ts.map +1 -0
- package/dist/hooks/useRef.d.ts +5 -0
- package/dist/hooks/useRef.d.ts.map +1 -0
- package/dist/index-6NvvNj5_.js +10932 -0
- package/dist/index-6NvvNj5_.js.map +1 -0
- package/dist/index.d.ts +15 -1287
- package/dist/index.d.ts.map +1 -0
- package/dist/index.global.js +28 -1442
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +62 -2
- package/dist/index.js.map +1 -1
- package/dist/utils/Ease.d.ts +17 -0
- package/dist/utils/Ease.d.ts.map +1 -0
- package/dist/utils/RadialGradient.d.ts +58 -0
- package/dist/utils/RadialGradient.d.ts.map +1 -0
- package/dist/utils/functions.d.ts +2 -0
- package/dist/utils/functions.d.ts.map +1 -0
- package/package.json +6 -4
- package/src/components/Graphic.ts +0 -3
- package/src/engine/bootstrap.ts +1 -0
- package/tsconfig.json +17 -0
- package/vite.config.ts +39 -0
- package/tsup.config.ts +0 -18
package/dist/index.js
CHANGED
|
@@ -1,2 +1,62 @@
|
|
|
1
|
-
var dt=Object.defineProperty;var Fe=r=>{throw TypeError(r)};var ht=(r,n)=>{for(var e in n)dt(r,e,{get:n[e],enumerable:!0})};var Re=(r,n,e)=>n.has(r)||Fe("Cannot "+e);var q=(r,n,e)=>(Re(r,n,"read from private field"),e?e.call(r):n.get(r)),He=(r,n,e)=>n.has(r)?Fe("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(r):n.set(r,e),Le=(r,n,e,i)=>(Re(r,n,"write to private field"),i?i.call(r,e):n.set(r,e),e);var G={},x=class{};function S(r,n){G[r]=n}function je(r,n){if(!G[n])return null;let e=new G[n];return e.onInit?.(r),e}var Q={};ht(Q,{arrayEquals:()=>H,calculateDistance:()=>J,error:()=>L,fps2ms:()=>D,get:()=>gt,isBrowser:()=>I,isFunction:()=>X,isObject:()=>Y,isObservable:()=>$,isPromise:()=>R,log:()=>bt,preciseNow:()=>k,set:()=>B,setObservablePoint:()=>C});import{Observable as pt}from"rxjs";function I(){return typeof window<"u"}function k(){return typeof performance<"u"?performance.now():Date.now()}function D(r){return 1e3/r}function R(r){return r&&r instanceof Promise}function H(r,n){if(r.length!==n.length)return!1;for(let e=0;e<r.length;e++){let i=r[e],s=n[e];if(typeof i=="object"&&i!==null){if(typeof s!="object"||s===null)return!1;if(Array.isArray(i)){if(!Array.isArray(s)||!H(i,s))return!1}else if(!We(i,s))return!1}else if(i!==s)return!1}return!0}function We(r,n){let e=Object.keys(r),i=Object.keys(n);if(e.length!==i.length)return!1;for(let s of e)if(!n.hasOwnProperty(s)||!yt(r[s],n[s]))return!1;return!0}function yt(r,n){return r===n?!0:typeof r!=typeof n?!1:typeof r=="object"&&r!==null?Array.isArray(r)?Array.isArray(n)&&H(r,n):We(r,n):!1}function X(r){return{}.toString.call(r)==="[object Function]"}function Y(r){return typeof r=="object"&&r!=null&&!Array.isArray(r)&&r.constructor===Object}function $(r){return r instanceof pt}function B(r,n,e,i=!1){if(Object(r)!==r)return r;typeof n=="string"&&(n=n.split("."));let s=n.length;if(!s)return r;let t=r;for(let a=0;a<s-1;a++){let l=n[a],o=n[a+1],c=!isNaN(Number(o))&&isFinite(Number(o));(!t[l]||typeof t[l]!="object")&&(t[l]=c&&!i?[]:{}),t=t[l]}return t[n[s-1]]=e,r}function gt(r,n){let e=n.split("."),i=r;for(let s of e){if(i[s]===void 0)return;i=i[s]}return i}function bt(r){console.log(r)}function L(r){console.error(r)}function C(r,n){typeof n=="number"?r.set(n):Array.isArray(n)?r.set(n[0],n[1]):r.set(n.x,n.y)}function J(r,n,e,i){let s=r-e,t=n-i;return Math.sqrt(s*s+t*t)}var Ue={3:"break",8:"backspace",9:"tab",12:"clear",13:"enter",16:"shift",17:"ctrl",18:"alt",19:"pause/break",20:"caps lock",27:"escape",28:"conversion",29:"non-conversion",32:"space",33:"page up",34:"page down",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",41:"select",42:"print",43:"execute",44:"Print Screen",45:"insert",46:"delete",48:"n0",49:"n1",50:"n2",51:"n3",52:"n4",53:"n5",54:"n6",55:"n7",56:"n8",57:"n9",58:":",59:"semicolon (firefox), equals",60:"<",61:"equals (firefox)",63:"\xDF",64:"@",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",91:"Windows Key / Left \u2318 / Chromebook Search key",92:"right window key",93:"Windows Menu / Right \u2318",96:"numpad 0",97:"numpad 1",98:"numpad 2",99:"numpad 3",100:"numpad 4",101:"numpad 5",102:"numpad 6",103:"numpad 7",104:"numpad 8",105:"numpad 9",106:"multiply",107:"add",108:"numpad period (firefox)",109:"subtract",110:"decimal point",111:"divide",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",124:"f13",125:"f14",126:"f15",127:"f16",128:"f17",129:"f18",130:"f19",131:"f20",132:"f21",133:"f22",134:"f23",135:"f24",144:"num lock",145:"scroll lock",160:"^",161:"!",163:"#",164:"$",165:"\xF9",166:"page backward",167:"page forward",169:"closing paren (AZERTY)",170:"*",171:"~ + * key",173:"minus (firefox), mute/unmute",174:"decrease volume level",175:"increase volume level",176:"next",177:"previous",178:"stop",179:"play/pause",180:"e-mail",181:"mute/unmute (firefox)",182:"decrease volume level (firefox)",183:"increase volume level (firefox)",186:"semi-colon / \xF1",187:"equal sign",188:"comma",189:"dash",190:"period",191:"forward slash / \xE7",192:"grave accent / \xF1 / \xE6",193:"?, / or \xB0",194:"numpad period (chrome)",219:"open bracket",220:"back slash",221:"close bracket / \xE5",222:"single quote / \xF8",223:"`",224:"left or right \u2318 key (firefox)",225:"altgr",226:"< /git >",230:"GNOME Compose Key",231:"\xE7",233:"XF86Forward",234:"XF86Back",240:"alphanumeric",242:"hiragana/katakana",243:"half-width/full-width",244:"kanji",255:"toggle touchpad"},vt=r=>{let n={};for(let e in r){let i=r[e];n[i]=e}return n},Ke=vt(Ue),Z=class extends x{constructor(){super(...arguments);this.keyState={};this.boundKeys={};this.stop=!1;this.lastKeyPressed=null;this._controlsOptions={};this.serverFps=60;this.directionState={up:!1,down:!1,left:!1,right:!1}}onInit(e){let i=e.props.controls.value??e.props.controls;i&&(this.setupListeners(),this.setInputs(i),this.interval=setInterval(()=>{this.preStep()},D(this.serverFps??60)))}onMount(e){}onUpdate(e){this.setInputs(e)}onDestroy(){clearInterval(this.interval),document.removeEventListener("keydown",e=>{this.onKeyChange(e,!0)}),document.removeEventListener("keyup",e=>{this.onKeyChange(e,!1)})}preStep(){if(this.stop)return;let e=this.getDirection();if(e!=="none"){let i=this.boundKeys[e];if(i){let{keyDown:s}=i.options;s&&this.applyInput(e)}}else{let i=Object.keys(this.boundKeys);for(let s of i)this.applyInput(s)}}applyInput(e){let i=this.keyState[e];if(!i)return;let{isDown:s,count:t}=i;if(s){let{repeat:a,keyDown:l}=this.boundKeys[e].options;if(a||t==0){let o=this.boundKeys[e].parameters;typeof o=="function"&&(o=o()),l&&l(this.boundKeys[e]),this.keyState[e].count++}}}setupListeners(){document.addEventListener("keydown",e=>{this.onKeyChange(e,!0)}),document.addEventListener("keyup",e=>{this.onKeyChange(e,!1)})}bindKey(e,i,s,t){Array.isArray(e)||(e=[e]);let a=Object.assign({repeat:!1},s);e.forEach(l=>{this.boundKeys[l]={actionName:i,options:a,parameters:t}})}applyKeyDown(e){let i=Ke[e],s=new Event("keydown");s.keyCode=i,this.onKeyChange(s,!0)}applyKeyUp(e){let i=Ke[e],s=new Event("keyup");s.keyCode=i,this.onKeyChange(s,!1)}applyKeyPress(e){return new Promise(i=>{this.applyKeyDown(e),setTimeout(()=>{this.applyKeyUp(e),i()},200)})}onKeyChange(e,i){e=e||window.event;let s=Ue[e.keyCode];if(s&&this.boundKeys[s]){if(this.keyState[s]==null&&(this.keyState[s]={count:0,isDown:!0}),this.keyState[s].isDown=i,!i){this.keyState[s].count=0;let{keyUp:t}=this.boundKeys[s].options;t&&t(this.boundKeys[s])}this.lastKeyPressed=i?e.keyCode:null}s&&this.updateDirectionState(s,i)}updateDirectionState(e,i){switch(e){case"up":this.directionState.up=i;break;case"down":this.directionState.down=i;break;case"left":this.directionState.left=i;break;case"right":this.directionState.right=i;break}}getDirection(){let{up:e,down:i,left:s,right:t}=this.directionState;return e&&s?"up_left":e&&t?"up_right":i&&s?"down_left":i&&t?"down_right":e?"up":i?"down":s?"left":t?"right":"none"}getControl(e){return this.boundKeys[e]}getControls(){return this.boundKeys}async applyControl(e,i){let s=this._controlsOptions[e];if(s){let t=Array.isArray(s.bind)?s.bind[0]:s.bind;i===void 0?await this.applyKeyPress(t):i?this.applyKeyDown(t):this.applyKeyUp(t)}}stopInputs(){this.stop=!0}listenInputs(){this.stop=!1,this.keyState={}}setInputs(e){if(!e)return;this.boundKeys={};let i={};for(let s in e){let t=e[s],{bind:a}=t,l=a;Array.isArray(l)||(l=[a]);for(let o of l)this.bindKey(o,s,t)}this._controlsOptions=e}get options(){return this._controlsOptions}};S("controls",Z);var ee=class extends x{constructor(){super(...arguments);this.fps=60;this.deltaTime=0;this.frame=0;this.timestamp=0;this.requestedDelay=0;this.lastTimestamp=0;this._stop=!1}onInit(e){this.tick=e.propObservables?.tick}onDestroy(){}onMount(e){}onUpdate(e){}nextTick(e){this.lastTimestamp=this.lastTimestamp||this.timestamp,this.deltaTime=k()-this.timestamp,this.timestamp=e,this.tick.set({timestamp:this.timestamp,deltaTime:this.deltaTime,frame:this.frame,deltaRatio:~~this.deltaTime/~~D(this.fps)}),this.lastTimestamp=this.timestamp,this.frame++}start(e={}){e.maxFps&&(this.maxFps=e.maxFps),e.fps&&(this.fps=e.fps),e.delay&&(this.requestedDelay=e.delay);let i=s=>{I()?window.requestAnimationFrame(s.bind(this)):setTimeout(()=>{this.requestedDelay=0,s(k())},D(this.fps)+this.requestedDelay)};if(this.maxFps){let s=D(this.maxFps),t=k(),a=k(),l=o=>{if(this._stop)return;i(l),t=k();let c=t-a;c>s&&(a=t-c%s,this.nextTick(o))};i(l)}else{let s=t=>{i(s),this.nextTick(t)};i(s)}return this}stop(){this._stop=!0}};S("tick",ee);import{isSignal as z,signal as se}from"@signe/reactive";import{isComputed as xt,isSignal as _,signal as Ne}from"@signe/reactive";import{Observable as ie,Subject as Be,defer as wt,from as _e,map as Pt,of as ze,share as St}from"rxjs";var te={},W=r=>r&&typeof r=="object"&&"tag"in r&&"props"in r&&"componentInstance"in r,ne=r=>typeof r=="string"||typeof r=="number"||typeof r=="boolean"||r===null||r===void 0;function y(r,n){te[r]=n}function j(r){if(Array.isArray(r)){r.forEach(n=>j(n));return}if(r){if(r.props?.children)for(let n of r.props.children)j(n);for(let n in r.directives)r.directives[n].onDestroy?.(r);r.componentInstance&&r.componentInstance.onDestroy?r.componentInstance.onDestroy(r.parent,()=>{r.propSubscriptions?.forEach(n=>n.unsubscribe()),r.effectSubscriptions?.forEach(n=>n.unsubscribe()),r.effectUnmounts?.forEach(n=>n?.())}):(r.propSubscriptions?.forEach(n=>n.unsubscribe()),r.effectSubscriptions?.forEach(n=>n.unsubscribe()),r.effectUnmounts?.forEach(n=>n?.()))}}function g(r,n){if(!te[r])throw new Error(`Component ${r} is not registered`);let e=new te[r],i={tag:r,props:{},componentInstance:e,propSubscriptions:[],propObservables:n,parent:null,directives:{},effectUnmounts:[],effectSubscriptions:[],effectMounts:[],destroy(){j(this)},allElements:new Be};if(n){let o=(c,f="")=>{let m=(u,d,h)=>{if(u==""){i.props[d]=h;return}B(i.props,u+"."+d,h)};Object.entries(c).forEach(([u,d])=>{if(_(d)){let h=d;if("dependencies"in h&&h.dependencies.size==0){m(f,u,h());return}i.propSubscriptions.push(h.observable.subscribe(p=>{m(f,u,p),i.directives[u]&&i.directives[u].onUpdate?.(p,i),u!="tick"&&e.onUpdate?.(f==""?{[u]:p}:B({},f+"."+u,p))}))}else Y(d)&&u!="context"&&!W(d)?o(d,(f?f+".":"")+u):m(f,u,d)})};o(n)}e.onInit?.(i.props);let s=new Be;if(n?.isRoot&&(i.allElements=s,i.props.context.rootElement=i,i.componentInstance.onMount?.(i),a(i)),n)for(let o in n){let c=je(i,o);c&&(i.directives[o]=c)}function t(o,c,f){c.props.context=o.props.context,c.parent=o,c.componentInstance.onMount?.(c,f);for(let m in c.directives)c.directives[m].onMount?.(c);c.effectMounts.forEach(m=>{c.effectUnmounts.push(m(c))})}async function a(o){if(o.props.attach&&(_(o.propObservables?.attach)?await new Promise(f=>{let m=null;o.propSubscriptions.push(o.propObservables.attach.observable.subscribe(async u=>{let d=u?.value??u;if(!d)throw new Error(`attach in ${o.tag} is undefined or null, add a component`);m&&j(m),m=d,await l(o,d),f(void 0)}))}):o.props.children.push(o.props.attach)),!!o.props.children)for(let c of o.props.children)c&&await l(o,c)}async function l(o,c){R(c)&&(c=await c),c instanceof ie?c.subscribe(({elements:f,prev:m})=>{let u=f.filter(d=>d!==null);if(m){u.forEach(d=>{let h=o.props.children.indexOf(m.props.key);t(o,d,h+1),a(d)});return}u.forEach(d=>{Array.isArray(d)?d.forEach(h=>{t(o,h),a(h)}):(t(o,d),a(d))}),s.next(void 0)}):(t(o,c),await a(c))}return i}function fn(r,n){return xt(r)&&r.dependencies.size==0?r=Ne(r()):_(r)||(r=Ne(r)),wt(()=>{let e=[],i=new Map,s=!0,t=a=>Array.isArray(a());return new ie(a=>t(r)?r.observable.subscribe(o=>{if(s){s=!1,e.forEach(f=>f.destroy()),e=[],i.clear();let c=r();c&&c.forEach((f,m)=>{let u=n(f,m);u&&(e.push(u),i.set(m,u))}),a.next({elements:[...e]});return}if(o.type==="init"||o.type==="reset"){e.forEach(f=>f.destroy()),e=[],i.clear();let c=r();c&&c.forEach((f,m)=>{let u=n(f,m);u&&(e.push(u),i.set(m,u))})}else if(o.type==="add"&&o.index!==void 0){let c=o.items.map((f,m)=>{let u=n(f,o.index+m);return u&&i.set(o.index+m,u),u}).filter(f=>f!==null);e.splice(o.index,0,...c)}else if(o.type==="remove"&&o.index!==void 0)e.splice(o.index,1).forEach(f=>{f.destroy(),i.delete(o.index)});else if(o.type==="update"&&o.index!==void 0&&o.items.length===1){let c=o.index,f=o.items[0];if(c>=e.length||e[c]===void 0||!i.has(c)){let m=n(f,c);m?(e.splice(c,0,m),i.set(c,m)):console.warn(`Element creation returned null for index ${c} during add-like update.`)}else{e[c].destroy();let u=n(f,c);u?(e[c]=u,i.set(c,u)):(e.splice(c,1),i.delete(c))}}a.next({elements:[...e]})}):r.observable.subscribe(o=>{let c=o.key;if(s){s=!1,e.forEach(m=>m.destroy()),e=[],i.clear();let f=r();f&&Object.entries(f).forEach(([m,u])=>{let d=n(u,m);d&&(e.push(d),i.set(m,d))}),a.next({elements:[...e]});return}if(o.type==="init"||o.type==="reset"){e.forEach(m=>m.destroy()),e=[],i.clear();let f=r();f&&Object.entries(f).forEach(([m,u])=>{let d=n(u,m);d&&(e.push(d),i.set(m,d))})}else if(o.type==="add"&&o.key&&o.value!==void 0){let f=n(o.value,c);f&&(e.push(f),i.set(c,f))}else if(o.type==="remove"&&o.key){let f=e.findIndex(m=>i.get(c)===m);if(f!==-1){let[m]=e.splice(f,1);m.destroy(),i.delete(c)}}else if(o.type==="update"&&o.key&&o.value!==void 0){let f=e.findIndex(m=>i.get(c)===m);if(f!==-1){e[f].destroy();let u=n(o.value,c);u&&(e[f]=u,i.set(c,u))}}a.next({elements:[...e]})}))})}function mn(r,n){let e=null;if(_(r)){let i=r;return new ie(s=>i.observable.subscribe(t=>{if(t){let a=n();R(a)?_e(a).subscribe(l=>{e=l,s.next({type:"init",elements:[l]})}):(e=a,s.next({type:"init",elements:[e]}))}else e?(j(e),s.next({elements:[]})):s.next({elements:[]})})).pipe(St())}else{if(r){let i=n();return R(i)?_e(i).pipe(Pt(s=>({type:"init",elements:[s]}))):ze({type:"init",elements:[i]})}return ze({elements:[]})}}var w=(r,n={})=>{if(z(r))return r();let e={};for(let i in r){let s=r[i];e[i]=ne(s)?se(s):s}for(let i in n)i in e||(e[i]=ne(n[i])?se(n[i]):n[i]);return e},oe=r=>n=>{let e=z(r)?r():r,i={};for(let s in n){let t=n[s],a=e[s],l;if(typeof t=="function")re(s,a,[t]),l=a;else if(Array.isArray(t))re(s,a,t),l=a;else if(t&&typeof t=="object"){if(t.required&&a===void 0)throw new Error(`Missing required prop: ${s}`);if(t.type){let o=Array.isArray(t.type)?t.type:[t.type];re(s,a,o)}if(t.validator&&!t.validator(a,e))throw new Error(`Invalid prop: custom validation failed for prop "${s}"`);a===void 0&&"default"in t?l=typeof t.default=="function"?t.default(e):t.default:l=a}i[s]=z(l)?l:se(l)}return{...w(e),...i}};function re(r,n,e){if(n==null)return;let i=z(n)?n():n;if(!e.some(t=>t===Number?typeof i=="number":t===String?typeof i=="string":t===Boolean?typeof i=="boolean":t===Function?typeof i=="function":t===Object?typeof i=="object":t===Array?Array.isArray(i):t===null?i===null:i instanceof t))throw new Error(`Invalid prop: type check failed for prop "${r}". Expected ${e.map(t=>t.name).join(" or ")}`)}var ae=class extends x{onInit(n){}onMount(n){this.onUpdate(n.props.viewportFollow,n)}onUpdate(n,e){let{viewport:i}=e.props.context;if(!i)throw L("ViewportFollow directive requires a Viewport component to be mounted in the same context");if(n)if(n===!0)i.follow(e.componentInstance);else{let s=w(n,{speed:void 0,acceleration:void 0,radius:void 0});i.follow(e.componentInstance,{speed:s.speed(),acceleration:s.acceleration(),radius:s.radius()})}else n===null&&i.plugins.remove("follow")}onDestroy(n){let{viewportFollow:e}=n.props,{viewport:i}=n.props.context;e&&i.plugins.remove("follow")}};S("viewportFollow",ae);import{effect as Et}from"@signe/reactive";import{Howl as Tt}from"howler";var Ve=["load","loaderror","playerror","play","end","pause","stop","mute","volume","rate","seek","fade","unlock"],le=class extends x{constructor(){super(...arguments);this.sounds=[];this.eventsFn=[];this.maxVolume=1;this.maxDistance=100}onInit(e){}onMount(e){let{props:i}=e,s=i.context.tick,t=i.sound.value??i.sound;if(!t.src)return;let{src:a,autoplay:l,loop:o,volume:c,spatial:f}=t,m=Array.isArray(a)?a:[a];for(let u of m){if(!u)continue;let d=new Tt({src:u,autoplay:l,loop:o,volume:c});for(let h of Ve){if(!t[h])continue;let p=t[h];this.eventsFn.push(p),d.on(h,p)}this.sounds.push(d)}if(f&&this.sounds.length>0){let{soundListenerPosition:u}=i.context;if(!u)throw new L("SoundListenerPosition directive is required for spatial sound in component parent");let{x:d,y:h}=u;this.tickSubscription=Et(()=>{s();let{x:p,y:P}=e.componentInstance,E=J(p,P,d(),h()),v=Math.max(this.maxVolume-E/this.maxDistance,0);this.sounds.forEach(T=>T.volume(v))}).subscription}this.onUpdate(t)}onUpdate(e){let i=e.value??e,{volume:s,loop:t,mute:a,seek:l,playing:o,rate:c,spatial:f}=i;this.sounds.forEach(m=>{s!==void 0&&m.volume(s),t!==void 0&&m.loop(t),a!==void 0&&m.mute(a),l!==void 0&&m.seek(l),o!==void 0&&(o?m.play():m.pause()),c!==void 0&&m.rate(c)}),f&&(this.maxVolume=f.maxVolume??this.maxVolume,this.maxDistance=f.maxDistance??this.maxDistance)}onDestroy(){this.sounds.forEach(e=>{e.stop();for(let i of Ve){let s=this.eventsFn.find(t=>t===this.eventsFn[i]);s&&e.off(i,s)}}),this.sounds=[],this.eventsFn=[],this.tickSubscription?.unsubscribe()}},ce=class extends x{onMount(n){n.props.context.soundListenerPosition=n.propObservables?.soundListenerPosition}onInit(n){}onUpdate(n){}onDestroy(){}};S("sound",le);S("soundListenerPosition",ce);import{effect as Ct,isComputed as Ot,isSignal as kt}from"@signe/reactive";import{Rectangle as Dt,Point as Ge}from"pixi.js";import{snap as Mt}from"popmotion";var qe=(r,n,e)=>{r.props.context={...r.props.context??{},[n]:e}};var fe=class extends x{constructor(){super(...arguments);this.elementRef=null}onInit(e){this.elementRef=e}onMount(e){qe(e,"drop",e)}onUpdate(){}onDestroy(){this.elementRef=null}},me=class extends x{constructor(){super(...arguments);this.elementRef=null;this.stageRef=null;this.offsetInParent=new Ge;this.isDragging=!1;this.viewport=null;this.animationFrameId=null;this.lastPointerPosition=new Ge;this.pressedKeys=new Set;this.pointerIsDown=!1;this.onDragMoveHandler=()=>{};this.onDragEndHandler=()=>{};this.onDragStartHandler=()=>{};this.onKeyDownHandler=()=>{};this.onKeyUpHandler=()=>{};this.subscriptions=[]}onInit(e){this.elementRef=e,this.onDragMoveHandler=this.onDragMove.bind(this),this.onDragEndHandler=this.onDragEnd.bind(this),this.onDragStartHandler=this.onPointerDown.bind(this),this.onKeyDownHandler=this.onKeyDown.bind(this),this.onKeyUpHandler=this.onKeyUp.bind(this)}onMount(e){let{rootElement:i,canvasSize:s,viewport:t,tick:a}=e.props.context,l=e.componentInstance,o=this.dragProps;if(Object.keys(o).length===0){this.onDestroy();return}if(!l||(this.stageRef=i.componentInstance,!this.stageRef))return;this.viewport=t,l.eventMode="static",this.stageRef.eventMode="static";let f=Ct(()=>{this.stageRef&&(this.stageRef.hitArea=new Dt(0,0,s().width,s().height))});l.on("pointerdown",this.onDragStartHandler),this.stageRef.on("pointerup",this.onDragEndHandler),this.stageRef.on("pointerupoutside",this.onDragEndHandler);let m=o.keyToPress?o.keyToPress:[];window.addEventListener("keydown",this.onKeyDownHandler),window.addEventListener("keyup",this.onKeyUpHandler),this.subscriptions=[a.observable.subscribe(()=>{this.isDragging&&this.viewport&&this.updateViewportPosition(this.lastPointerPosition)}),f.subscription]}get dragProps(){let e=this.elementRef?.props.drag,i=w(e?.value??e,{snap:0,viewport:{},direction:"all",keyToPress:[]});return i.viewport=w(i.viewport,{edgeThreshold:300,maxSpeed:40}),i}get axis(){let e=this.dragProps.direction(),i={x:!0,y:!0};return e==="x"&&(i.y=!1),e==="y"&&(i.x=!1),i}onDragMove(e){if(!this.isDragging||!this.elementRef?.componentInstance||!this.elementRef.componentInstance.parent)return;let i=this.elementRef.componentInstance,s=i.parent,t=this.dragProps,a=this.elementRef.propObservables,l=Mt(t?.snap()??0);t?.move?.(e);let o=s.toLocal(e.global),c=o.x-this.offsetInParent.x,f=o.y-this.offsetInParent.y;t?.snap()?(i.position.x=l(c),i.position.y=l(f)):(this.axis.x&&(i.position.x=c),this.axis.y&&(i.position.y=f)),this.lastPointerPosition.copyFrom(e.global);let{x:m,y:u}=a,d=(h,p)=>{Ot(h)?h.dependencies.forEach(P=>{P.set(p)}):kt(h)&&h.set(p)};m!==void 0&&d(m,i.position.x),u!==void 0&&d(u,i.position.y)}updateViewportPosition(e){if(!this.viewport||!this.elementRef)return;let i=this.dragProps,s=i?.viewport?.edgeThreshold(),t=i?.viewport?.maxSpeed(),a=0,l=this.viewport.screenWidth,o=0,c=this.viewport.screenHeight,f=this.elementRef.componentInstance,m=e.x-a,u=l-e.x,d=e.y-o,h=c-e.y,p=0,P=0;if(m<s?p=-(t*(1-m/s)):u<s&&(p=t*(1-u/s)),d<s?P=-(t*(1-d/s)):h<s&&(P=t*(1-h/s)),p!==0||P!==0){let E=this.viewport.center;this.viewport.moveCenter(this.viewport.center.x+p,this.viewport.center.y+P),this.axis.x&&E.x!==this.viewport.center.x&&(f.position.x+=p),this.axis.y&&E.y!==this.viewport.center.y&&(f.position.y+=P)}}onDragEnd(){if(this.pointerIsDown=!1,!this.isDragging)return;let e=this.dragProps;this.isDragging=!1,e?.end?.(),this.stageRef&&this.stageRef.off("pointermove",this.onDragMoveHandler)}onKeyDown(e){this.pressedKeys.add(e.code),this.pressedKeys.add(e.key.toLowerCase()),this.pointerIsDown&&!this.isDragging&&this.areRequiredKeysPressed()&&this.startDrag()}onKeyUp(e){this.pressedKeys.delete(e.code),this.pressedKeys.delete(e.key.toLowerCase()),this.isDragging&&!this.areRequiredKeysPressed()&&this.onDragEnd()}areRequiredKeysPressed(){let e=this.dragProps.keyToPress?this.dragProps.keyToPress:[];return!e||e.length===0?!0:e.some(i=>this.pressedKeys.has(i)?!0:i.toLowerCase()==="space"?this.pressedKeys.has("Space")||this.pressedKeys.has(" "):i.toLowerCase()==="shift"?this.pressedKeys.has("ShiftLeft")||this.pressedKeys.has("ShiftRight"):i.toLowerCase()==="control"||i.toLowerCase()==="ctrl"?this.pressedKeys.has("ControlLeft")||this.pressedKeys.has("ControlRight"):i.toLowerCase()==="alt"?this.pressedKeys.has("AltLeft")||this.pressedKeys.has("AltRight"):!1)}onPointerDown(e){if(!this.elementRef?.componentInstance||!this.stageRef||!this.elementRef.componentInstance.parent)return;this.pointerIsDown=!0;let i=this.elementRef.componentInstance,t=i.parent.toLocal(e.global);this.offsetInParent.x=t.x-i.position.x,this.offsetInParent.y=t.y-i.position.y,this.lastPointerPosition.copyFrom(e.global),this.areRequiredKeysPressed()&&this.startDrag()}startDrag(){if(this.isDragging||!this.stageRef)return;this.isDragging=!0,this.dragProps?.start?.(),this.stageRef.on("pointermove",this.onDragMoveHandler)}onUpdate(e){e.type&&e.type==="reset"&&(this.onDestroy(),this.onMount(this.elementRef))}onDestroy(){this.subscriptions.forEach(i=>i.unsubscribe());let e=this.elementRef?.componentInstance;e&&e.off("pointerdown",this.onDragStartHandler),this.stageRef&&(this.stageRef.off("pointermove",this.onDragMoveHandler),this.stageRef.off("pointerup",this.onDragEndHandler),this.stageRef.off("pointerupoutside",this.onDragEndHandler)),window.removeEventListener("keydown",this.onKeyDownHandler),window.removeEventListener("keyup",this.onKeyUpHandler),this.stageRef=null,this.viewport=null,this.pressedKeys.clear(),this.pointerIsDown=!1}};S("drag",me);S("drop",fe);import{DisplacementFilter as At,Sprite as Ft,Texture as Rt,WRAP_MODES as Ht}from"pixi.js";import{animate as Lt}from"popmotion";var ue=class extends x{onInit(n){}onMount(n){let{image:e}=n.props.transition,i=new Ft(Rt.from(e));i.texture.baseTexture.wrapMode=Ht.REPEAT;let s=new At(i),t=n.componentInstance;t.filters=[s],t.addChild(i),setTimeout(()=>{Lt({from:0,to:1,duration:500,onUpdate:a=>{s.scale.x=a,s.scale.y=a}})},5e3)}onUpdate(n){}onDestroy(){}};S("transition",ue);export*from"@signe/reactive";import{Howler as Io}from"howler";import{effect as de,signal as K}from"@signe/reactive";import{Container as Ut}from"pixi.js";import{signal as Ie}from"@signe/reactive";import{BlurFilter as Xe,ObservablePoint as jt}from"pixi.js";function M(r){return r&&typeof r=="string"?r.endsWith("%"):!1}import{BehaviorSubject as Wt}from"rxjs";var Kt=["added","childAdded","childRemoved","click","clickcapture","destroyed","globalmousemove","globalpointermove","globaltouchmove","mousedown","mousedowncapture","mouseenter","mouseentercapture","mouseleave","mouseleavecapture","mousemove","mousemovecapture","mouseout","mouseoutcapture","mouseover","mouseovercapture","mouseup","mouseupcapture","mouseupoutside","mouseupoutsidecapture","pointercancel","pointercancelcapture","pointerdown","pointerdowncapture","pointerenter","pointerentercapture","pointerleave","pointerleavecapture","pointermove","pointermovecapture","pointerout","pointeroutcapture","pointerover","pointerovercapture","pointertap","pointertapcapture","pointerup","pointerupcapture","pointerupoutside","pointerupoutsidecapture","removed","rightclick","rightclickcapture","rightdown","rightdowncapture","rightup","rightupcapture","rightupoutside","rightupoutsidecapture","tap","tapcapture","touchcancel","touchcancelcapture","touchend","touchendcapture","touchendoutside","touchendoutsidecapture","touchmove","touchmovecapture","touchstart","touchstartcapture","wheel","wheelcapture"];function b(r){var n,e;return e=class extends r{constructor(){super(...arguments);He(this,n,null);this.isFlex=!1;this.fullProps={};this.isMounted=!1;this._anchorPoints=new jt({_onUpdate:()=>{}},0,0);this.isCustomAnchor=!1;this.displayWidth=Ie(0);this.displayHeight=Ie(0);this.overrideProps=[];this.layout=null;this.onBeforeDestroy=null;this.onAfterMount=null;this.subjectInit=new Wt(null);this.disableLayout=!1}get deltaRatio(){return q(this,n)?.scheduler?.tick.value.deltaRatio}get parentIsFlex(){return this.disableLayout?!1:this.parent?.isFlex}onInit(t){this._id=t.id;for(let a of Kt)t[a]&&!this.overrideProps.includes(a)&&(this.eventMode="static",this.on(a,t[a]));(t.onBeforeDestroy||t["on-before-destroy"])&&(this.onBeforeDestroy=t.onBeforeDestroy||t["on-before-destroy"]),(t.onAfterMount||t["on-after-mount"])&&(this.onAfterMount=t.onAfterMount||t["on-after-mount"]),(t.justifyContent||t.alignItems||t.flexDirection||t.flexWrap||t.alignContent||t.display=="flex"||M(t.width)||M(t.height)||t.isRoot)&&(this.layout={},this.isFlex=!0),this.subjectInit.next(this)}async onMount({parent:t,props:a},l){if(Le(this,n,a.context),t){let o=t.componentInstance;if(o.isFlex&&!this.layout&&!this.disableLayout)try{this.layout={}}catch(c){console.warn("Failed to set layout:",c)}l===void 0?o.addChild(this):o.addChildAt(this,l),this.isMounted=!0,this.onUpdate(a),this.onAfterMount&&await this.onAfterMount()}}onUpdate(t){if(this.fullProps={...this.fullProps,...t},!q(this,n)||!this.parent)return;t.x!==void 0&&this.setX(t.x),t.y!==void 0&&this.setY(t.y),t.scale!==void 0&&C(this.scale,t.scale),t.anchor!==void 0&&!this.isCustomAnchor&&C(this.anchor,t.anchor),t.width!==void 0&&this.setWidth(t.width),t.height!==void 0&&this.setHeight(t.height),t.minWidth!==void 0&&this.setMinWidth(t.minWidth),t.minHeight!==void 0&&this.setMinHeight(t.minHeight),t.maxWidth!==void 0&&this.setMaxWidth(t.maxWidth),t.maxHeight!==void 0&&this.setMaxHeight(t.maxHeight),t.aspectRatio!==void 0&&this.setAspectRatio(t.aspectRatio),t.flexGrow!==void 0&&this.setFlexGrow(t.flexGrow),t.flexShrink!==void 0&&this.setFlexShrink(t.flexShrink),t.flexBasis!==void 0&&this.setFlexBasis(t.flexBasis),t.rowGap!==void 0&&this.setRowGap(t.rowGap),t.columnGap!==void 0&&this.setColumnGap(t.columnGap),t.top!==void 0&&this.setTop(t.top),t.left!==void 0&&this.setLeft(t.left),t.right!==void 0&&this.setRight(t.right),t.bottom!==void 0&&this.setBottom(t.bottom),t.objectFit!==void 0&&this.setObjectFit(t.objectFit),t.objectPosition!==void 0&&this.setObjectPosition(t.objectPosition),t.transformOrigin!==void 0&&this.setTransformOrigin(t.transformOrigin),t.skew!==void 0&&C(this.skew,t.skew),t.tint&&(this.tint=t.tint),t.rotation!==void 0&&(this.rotation=t.rotation),t.angle!==void 0&&(this.angle=t.angle),t.zIndex!==void 0&&(this.zIndex=t.zIndex),t.roundPixels!==void 0&&(this.roundPixels=t.roundPixels),t.cursor&&(this.cursor=t.cursor),t.visible!==void 0&&(this.visible=t.visible),t.alpha!==void 0&&(this.alpha=t.alpha),t.pivot&&C(this.pivot,t.pivot),t.flexDirection&&this.setFlexDirection(t.flexDirection),t.flexWrap&&this.setFlexWrap(t.flexWrap),t.justifyContent&&this.setJustifyContent(t.justifyContent),t.alignItems&&this.setAlignItems(t.alignItems),t.alignContent&&this.setAlignContent(t.alignContent),t.alignSelf&&this.setAlignSelf(t.alignSelf),t.margin&&this.setMargin(t.margin),t.padding&&this.setPadding(t.padding),t.gap&&this.setGap(t.gap),t.border&&this.setBorder(t.border),t.positionType&&this.setPositionType(t.positionType),t.filters&&(this.filters=t.filters),t.maskOf&&W(t.maskOf)&&(t.maskOf.componentInstance.mask=this),t.blendMode&&(this.blendMode=t.blendMode),t.filterArea&&(this.filterArea=t.filterArea);let a=this.filters||[];if(t.blur){let l=a.find(o=>o instanceof Xe);if(!l){let o=typeof t.blur=="number"?{strength:t.blur}:t.blur;l=new Xe(o),a.push(l)}Object.assign(l,t.blur)}this.filters=a}async onDestroy(t,a){this.onBeforeDestroy&&await this.onBeforeDestroy(),super.destroy(),a&&a()}setFlexDirection(t){this.layout={flexDirection:t}}setFlexWrap(t){this.layout={flexWrap:t}}setAlignContent(t){this.layout={alignContent:t}}setAlignSelf(t){this.layout={alignSelf:t}}setAlignItems(t){this.layout={alignItems:t}}setJustifyContent(t){this.layout={justifyContent:t}}setPosition(t){t instanceof Array?t.length===2?this.layout={positionY:t[0],positionX:t[1]}:t.length===4&&(this.layout={positionTop:t[0],positionRight:t[1],positionBottom:t[2],positionLeft:t[3]}):this.layout={position:t}}setX(t){t=t+this.getWidth()*this._anchorPoints.x,this.parentIsFlex?(this.x=t,this.layout={x:t}):this.x=t}setY(t){t=t+this.getHeight()*this._anchorPoints.y,this.parentIsFlex?(this.y=t,this.layout={y:t}):this.y=t}setPadding(t){t instanceof Array?t.length===2?this.layout={paddingVertical:t[0],paddingHorizontal:t[1]}:t.length===4&&(this.layout={paddingTop:t[0],paddingRight:t[1],paddingBottom:t[2],paddingLeft:t[3]}):this.layout={padding:t}}setMargin(t){t instanceof Array?t.length===2?this.layout={marginVertical:t[0],marginHorizontal:t[1]}:t.length===4&&(this.layout={marginTop:t[0],marginRight:t[1],marginBottom:t[2],marginLeft:t[3]}):this.layout={margin:t}}setGap(t){this.layout={gap:t}}setBorder(t){t instanceof Array?t.length===2?this.layout={borderVertical:t[0],borderHorizontal:t[1]}:t.length===4&&(this.layout={borderTop:t[0],borderRight:t[1],borderBottom:t[2],borderLeft:t[3]}):this.layout={border:t}}setPositionType(t){this.layout={position:t}}setWidth(t){this.displayWidth.set(t),this.parentIsFlex?this.layout={width:t}:this.width=t}setHeight(t){this.displayHeight.set(t),this.parentIsFlex?this.layout={height:t}:this.height=t}getWidth(){return this.displayWidth()}getHeight(){return this.displayHeight()}setMinWidth(t){this.layout={minWidth:t}}setMinHeight(t){this.layout={minHeight:t}}setMaxWidth(t){this.layout={maxWidth:t}}setMaxHeight(t){this.layout={maxHeight:t}}setAspectRatio(t){this.layout={aspectRatio:t}}setFlexGrow(t){this.layout={flexGrow:t}}setFlexShrink(t){this.layout={flexShrink:t}}setFlexBasis(t){this.layout={flexBasis:t}}setRowGap(t){this.layout={rowGap:t}}setColumnGap(t){this.layout={columnGap:t}}setTop(t){this.layout={top:t}}setLeft(t){this.layout={left:t}}setRight(t){this.layout={right:t}}setBottom(t){this.layout={bottom:t}}setObjectFit(t){this.layout={objectFit:t}}setObjectPosition(t){this.layout={objectPosition:t}}setTransformOrigin(t){this.layout={transformOrigin:t}}},n=new WeakMap,e}y("Canvas",class extends b(Ut){});var Nt=async(r={})=>{let{cursorStyles:n,width:e,height:i,class:s}=w(r);r.width||(e=K(800)),r.height||(i=K(600));let t=K({width:0,height:0});r.isRoot=!0;let a={...r,context:{canvasSize:t,app:K(null)},width:e?.(),height:i?.()};r.tick||(a.context.tick=a.tick=K({timestamp:0,deltaTime:0,frame:0,deltaRatio:1}));let l=g("Canvas",a);return l.render=(o,c)=>{if(!c)return;let f=c.renderer,m=f.view.canvas;globalThis.__PIXI_STAGE__=l.componentInstance,globalThis.__PIXI_RENDERER__=f,r.tickStart!==!1&&l.directives.tick.start(),de(()=>{l.propObservables.tick(),f.render(l.componentInstance)}),c.stage=l.componentInstance,c.stage.layout={width:c.screen.width,height:c.screen.height,justifyContent:r.justifyContent,alignItems:r.alignItems},t.set({width:c.screen.width,height:c.screen.height}),c.renderer.on("resize",(d,h)=>{t.set({width:d,height:h}),c.stage.layout&&(c.stage.layout={width:d,height:h})}),r.tickStart!==!1&&l.directives.tick.start(),c.ticker.add(()=>{l.propObservables.tick()}),n&&de(()=>{f.events.cursorStyles=n()}),s&&de(()=>{m.classList.add(s())});let u=o.querySelector("canvas");u?o.replaceChild(m,u):o.appendChild(m),a.context.app.set(c)},l};import{Container as Bt}from"pixi.js";var U=class extends b(Bt){constructor(){super(...arguments);this.isCustomAnchor=!0}onUpdate(e){e.anchor&&(C(this._anchorPoints,e.anchor),e.pivot=[this.getWidth()*this._anchorPoints.x,this.getHeight()*this._anchorPoints.y]),super.onUpdate(e),e.sortableChildren!=null&&(this.sortableChildren=e.sortableChildren)}async onMount(e){await super.onMount(e);let{componentInstance:i,props:s}=e,{pixiChildren:t}=s;t&&t.forEach(a=>{i.addChild(a)})}};y("Container",U);var he=r=>g("Container",r);import{effect as _t,isSignal as A,signal as V}from"@signe/reactive";import{Assets as zt,Graphics as Ye}from"pixi.js";var pe=class extends b(Ye){async onInit(n){await super.onInit(n)}async onMount(n,e){await super.onMount(n,e);let{props:i,propObservables:s}=n,t=A(s?.width)?s.width:V(i.width||0),a=A(s?.height)?s.height:V(i.height||0);this.width=t,this.height=a;let l=M(t()),o=M(a());i.draw&&(this.clearEffect=_t(()=>{let c=t(),f=a();typeof c=="string"||typeof f=="string"||c==0||f==0||(this.clear(),i.draw?.(this,c,f),this.subjectInit.next(this))})),this.on("layout",c=>{let f=c.computedLayout;l&&A(t)&&t.set(f.width),o&&A(a)&&a.set(f.height)})}onUpdate(n){super.onUpdate(n),n.width!==void 0&&this.width&&(A(n.width)?this.width=n.width:this.width.set(n.width)),n.height!==void 0&&this.height&&(A(n.height)?this.height=n.height:this.height.set(n.height))}async onDestroy(n,e){let i=async()=>{this.clearEffect.subscription.unsubscribe(),e()};await super.onDestroy(n,i)}};y("Graphics",pe);function F(r){return g("Graphics",r)}function Vt(r){let{color:n,borderRadius:e,border:i}=w(r,{borderRadius:null,border:null});return F({draw:(s,t,a)=>{e()?s.roundRect(0,0,t,a,e()):s.rect(0,0,t,a),i&&s.stroke(i),s.fill(n())},...r})}function $e(r,n,e){let{color:i,border:s}=e;"radius"in e?r.circle(0,0,e.radius()):r.ellipse(0,0,e.width()/2,e.height()/2),s()&&r.stroke(s()),r.fill(i())}function qt(r){let{radius:n,color:e,border:i}=w(r,{border:null});return F({draw:s=>$e(s,"circle",{radius:n,color:e,border:i}),...r})}function Gt(r){let{width:n,height:e,color:i,border:s}=w(r,{border:null});return F({draw:(t,a,l)=>$e(t,"ellipse",{width:V(a),height:V(l),color:i,border:s}),...r})}function It(r){let{width:n,height:e,color:i,border:s}=w(r,{border:null,color:"#000"});return F({draw:(t,a,l)=>{t.moveTo(0,l),t.lineTo(a/2,0),t.lineTo(a,l),t.lineTo(0,l),t.fill(i()),s&&t.stroke(s)},...r})}function Xt(r){return F({draw:async n=>{if(r.src){let e=await zt.load({src:r.src,data:{parseAsGraphicsContext:!0}}),i=new Ye(e);n.context=i.context}else r.content?n.svg(r.content):r.svg&&n.svg(r.svg)},...r})}import{Mesh as Yt,Geometry as $t,Assets as Je}from"pixi.js";var ye=class extends b(Yt){constructor(){super({geometry:new $t})}onInit(n){if(super.onInit(n),n.geometry)try{this.geometry=n.geometry}catch(e){console.warn("Failed to set geometry:",e)}n.shader&&(this.shader=n.shader)}async onUpdate(n){if(super.onUpdate(n),n.geometry)try{this.geometry=n.geometry}catch(e){console.warn("Failed to update geometry:",e)}n.shader&&(this.shader=n.shader),n.texture?typeof n.texture=="string"?this.texture=await Je.load(n.texture):this.texture=n.texture:n.image&&(this.texture=await Je.load(n.image)),n.tint!==void 0&&(this.tint=n.tint),n.blendMode!==void 0&&(this.blendMode=n.blendMode),n.roundPixels!==void 0&&(this.roundPixels=n.roundPixels)}async onDestroy(n,e){let i=async()=>{e()};await super.onDestroy(n,i)}};y("Mesh",ye);var Jt=r=>g("Mesh",r);var Qe=null,ge=null;function be(r){ge?.(r)}function qr(r){be(n=>{let{context:e}=n.props,i;return e.tick&&(i=e.tick.observable.subscribe(({value:s})=>{r(s,n)})),()=>{i?.unsubscribe()}})}function O(r,n={},...e){let i=new Set,s=new Set;Qe=a=>{i.add(a)},ge=a=>{s.add(a)},e[0]instanceof Array&&(e=e[0]);let t=r({...n,children:e});return t||(t={}),t.effectSubscriptions=Array.from(i),t.effectMounts=[...Array.from(s),...t.effectMounts??[]],t instanceof Promise&&t.then(a=>{a.props.isRoot&&s.forEach(l=>l(a))}),Qe=null,ge=null,t}function Qt(r){return O(he)}import*as Ze from"@barvynkoa/particle-emitter";var ve=class extends U{constructor(){super(...arguments);this.elapsed=Date.now()}async onMount(e){await super.onMount(e);let{props:i}=e,s=i.context.tick;this.emitter=new Ze.Emitter(this,i.config),this.subscriptionTick=s.observable.subscribe(t=>{if(!this.emitter)return;let a=Date.now();this.emitter.update((a-this.elapsed)*.001),this.elapsed=a})}onUpdate(e){}async onDestroy(e,i){let s=async()=>{this.emitter?.destroy(),this.emitter=null,this.subscriptionTick.unsubscribe(),i()};await super.onDestroy(e,s)}};y("ParticlesEmitter",ve);function Zt(r){return g("ParticlesEmitter",r)}import{Howl as ii}from"howler";import{computed as ni,effect as ri,isSignal as si}from"@signe/reactive";import{Assets as tt,Container as it,Sprite as nt,Rectangle as rt,Texture as st}from"pixi.js";import{effect as ei,signal as et}from"@signe/reactive";import{animate as ti}from"popmotion";function xe(r){return r.animatedState!==void 0}function is(r,n={}){let e={current:r,start:r,end:r},i,s=et(r),t=et(e);ei(()=>{let o=t();s.set(o.current)});function a(o,c={}){if(o===void 0)return t();let f=t(),m={current:f.current,start:f.current,end:o};t.set(m),i&&i.stop(),i=ti({duration:20,...n,...c,from:f.current,to:o,onUpdate:u=>{t.update(d=>({...d,current:u})),n.onUpdate&&n.onUpdate(u)}})}let l=function(){return t().current};for(let o in s)l[o]=s[o];return l.animatedState=t,l.update=o=>{a(o(t().current))},l.set=async(o,c={})=>new Promise(f=>{a(o,{...c,onComplete:f})}),l}async function ns(r){for(let n of r)Array.isArray(n)?await Promise.all(n.map(e=>e())):await n()}var ot=console.log;var we=class extends b(nt){constructor(){super(...arguments);this.currentAnimation=null;this.time=0;this.frameIndex=0;this.animations=new Map;this.subscriptionSheet=[];this.sheetParams={};this.sheetCurrentAnimation="stand";this.app=null;this.currentAnimationContainer=null}get renderer(){return this.app?.renderer}async createTextures(e){let{width:i,height:s,framesHeight:t,framesWidth:a,image:l,offset:o}=e;if(!l||typeof l!="string"||l.trim()==="")return console.warn("Invalid image path provided to createTextures:",l),[];let c=await tt.load(l),f=e.spriteWidth,m=e.spriteHeight,u=[],d=o&&o.x||0,h=o&&o.y||0;for(let p=0;p<t;p++){u[p]=[];for(let P=0;P<a;P++){let E=P*f+d,v=p*m+h;if(v>s)throw ot(`Warning, there is a problem with the height of the "${this.id}" spritesheet. When cutting into frames, the frame exceeds the height of the image.`);if(E>i)throw ot(`Warning, there is a problem with the width of the "${this.id}" spritesheet. When cutting into frames, the frame exceeds the width of the image.`);u[p].push(new st({source:c.source,frame:new rt(E,v,f,m)}))}}return u}async createAnimations(){let{textures:e}=this.spritesheet;if(e)for(let i in e){let a={...["width","height","framesHeight","framesWidth","rectWidth","rectHeight","offset","image","sound"].reduce((d,h)=>({...d,[h]:this.spritesheet[h]}),{}),...e[i]},{rectWidth:l,width:o=0,framesWidth:c=1,rectHeight:f,height:m=0,framesHeight:u=1}=a;a.spriteWidth=l||o/c,a.spriteHeight=f||m/u,this.animations.set(i,{frames:await this.createTextures(a),name:i,animations:e[i].animations,params:[],data:a,sprites:[]})}}async onMount(e){let{props:i,propObservables:s}=e,t=i.context.tick,a=i.sheet??{};if(this.app=i.context.app(),a?.onFinish&&(this.onFinish=a.onFinish),this.subscriptionTick=t.observable.subscribe(o=>{this.update(o)}),i.sheet?.definition&&(this.spritesheet=i.sheet.definition,await this.createAnimations()),a.params)for(let o in s?.sheet.params){let c=s?.sheet.params[o];si(c)?this.subscriptionSheet.push(c.observable.subscribe(f=>{this.animations.size!=0&&this.play(this.sheetCurrentAnimation,[{[o]:f}])})):this.play(this.sheetCurrentAnimation,[{[o]:c}])}let l=ni(()=>{let{x:o,y:c}=s??{};if(!o||!c)return!1;let f=o,m=c,u=xe(f)&&f.animatedState().current!==f.animatedState().end,d=xe(m)&&m.animatedState().current!==m.animatedState().end;return u||d});ri(()=>{let o=l();this.isMounted&&(o?this.sheetCurrentAnimation="walk":this.sheetCurrentAnimation="stand",this.spritesheet&&this.play(this.sheetCurrentAnimation,[this.sheetParams]))}),super.onMount(e)}async onUpdate(e){super.onUpdate(e);let i=async t=>{if(!t||typeof t!="string"||t.trim()==="")return console.warn("Invalid image path provided to setTexture:",t),null;let a=this.fullProps.loader?.onProgress,l=await tt.load(t,o=>{if(a&&a(o),o==1){let c=this.fullProps.loader?.onComplete;c&&setTimeout(()=>{c(l)})}});return l},s=e.sheet;if(s?.params&&(this.sheetParams=s?.params),s?.playing&&this.isMounted&&(this.sheetCurrentAnimation=s?.playing,this.play(this.sheetCurrentAnimation,[this.sheetParams])),e.hitbox&&(this.hitbox=e.hitbox),e.scaleMode)this.baseTexture.scaleMode=e.scaleMode;else if(e.image&&this.fullProps.rectangle===void 0){let t=await i(this.fullProps.image);t&&(this.texture=t)}else e.texture&&(W(e.texture)?(e.texture.componentInstance.subjectInit.subscribe(a=>{console.log("a",a?.width)}),this.texture=this.renderer?.generateTexture(e.texture.componentInstance)):this.texture=e.texture);if(e.rectangle!==void 0){let{x:t,y:a,width:l,height:o}=e.rectangle?.value??e.rectangle,c=await i(this.fullProps.image);c&&(this.texture=new st({source:c.source,frame:new rt(t,a,l,o)}))}}async onDestroy(e,i){await super.onDestroy(e),this.subscriptionSheet.forEach(s=>s.unsubscribe()),this.subscriptionTick.unsubscribe(),this.currentAnimationContainer&&this.parent instanceof it&&this.parent.removeChild(this.currentAnimationContainer)}has(e){return this.animations.has(e)}get(e){return this.animations.get(e)}isPlaying(e){return e?this.currentAnimation==null?!1:this.currentAnimation.name==e:!!this.currentAnimation}stop(){this.currentAnimation=null,this.destroy()}play(e,i=[]){let s=this.currentAnimation?.params;if(this.isPlaying(e)&&H(i,s||[]))return;let t=this.get(e);if(!t)throw new Error(`Impossible to play the ${e} animation because it doesn't exist on the "${this.id}" spritesheet`);let a=structuredClone(i);this.removeChildren(),t.sprites=[],this.currentAnimation=t,this.currentAnimation.params=a,this.time=0,this.frameIndex=0;let l=t.animations;l=X(l)?l(...a):l,this.currentAnimationContainer=new it;for(let c of l){let f=new nt;for(let m of c)this.currentAnimation.sprites.push(m);this.currentAnimationContainer.addChild(f)}let o=this.currentAnimation.data.sound;o&&new ii({src:o,autoplay:!0,loop:!1,volume:1}),this.update({deltaRatio:1})}update({deltaRatio:e}){if(!this.isPlaying()||!this.currentAnimation||!this.currentAnimationContainer)return;let i=this,{frames:s,sprites:t,data:a}=this.currentAnimation,l=t[this.frameIndex],o=t[this.frameIndex+1];for(let c of this.currentAnimationContainer.children){let d=function(v,T){let N=m(T||v);N!==void 0&&(i[v]=N)},f=c;if(!l||l.frameY==null||l.frameX==null)continue;this.texture=s[l.frameY][l.frameX];let m=v=>l[v]??a[v]??this.spritesheet[v],u=v=>{let T=m(v);T&&this[v].set(...T)};this.applyTransform&&(l={...l,...this.applyTransform(l,a,this.spritesheet)});let h=m("spriteRealSize"),p=typeof h=="number"?h:h?.height,P=typeof h=="number"?h:h?.width,E=()=>{if(p&&this.hitbox){let{spriteWidth:v,spriteHeight:T}=a,Ae=(v-this.hitbox.w)/2/v,N=(T-p)/2,ut=(T-this.hitbox.h-N)/T;this.anchor.set(Ae,ut)}};l.sound,E(),u("anchor"),u("scale"),u("skew"),u("pivot"),d("alpha","opacity"),d("x"),d("y"),d("angle"),d("rotation"),d("visible")}if(!o){this.time=0,this.frameIndex=0,this.onFinish&&t.length>1&&this.onFinish();return}this.time+=e??1,this.time>=o.time&&this.frameIndex++}};y("Sprite",we);var Pe=r=>g("Sprite",r);import{effect as oi,signal as ai}from"@signe/reactive";function li(r){let n={audioprocess:null,canplay:null,canplaythrough:null,complete:null,durationchange:null,emptied:null,ended:null,loadeddata:null,loadedmetadata:null,pause:null,play:null,playing:null,progress:null,ratechange:null,seeked:null,seeking:null,stalled:null,suspend:null,timeupdate:null,volumechange:null,waiting:null},e=ai(null),i=oe(r),{play:s,loop:t,muted:a}=i({play:{type:Boolean,default:!0},loop:{type:Boolean,default:!1},muted:{type:Boolean,default:!1}});return oi(()=>{let l=e(),o=s();l&&o!==void 0&&(o?l.play():l.pause()),l&&t()&&(l.loop=t()),l&&a()&&(l.muted=a())}),be(()=>()=>{for(let l in n)n[l]&&e().removeEventListener(l,n[l])}),O(Pe,{...r,image:r.src,loader:{onComplete:l=>{let o=l.source.resource;e.set(o),r?.loader?.onComplete&&r.loader.onComplete(l);for(let c in n)if(r[c]){let f=m=>{r[c](m)};n[c]=f,o.addEventListener(c,f)}}}})}import{Text as mi}from"pixi.js";import{effect as ci,signal as fi}from"@signe/reactive";function Se(r){return r?.start&&r?.listen}function Es(r){let n=fi({config:r,value:0,resolve:e=>{}});return{start:e=>new Promise(i=>{n.set({config:{...r,...e},resolve:i,value:Math.random()})}),listen:()=>({config:r,seed:n()})}}function at(r,n){if(!Se(r))throw new Error("In 'on(arg)' must have a trigger signal type");ci(()=>{let e=r.listen();if(e?.seed.value){let i=n(e?.seed.config);i&&typeof i.then=="function"&&i.then(e?.seed.resolve)}})}var Ee=class extends b(mi){constructor(){super(...arguments);this.fullText="";this.currentIndex=0;this.typewriterSpeed=1;this._wordWrapWidth=0;this.typewriterOptions={}}async onMount(e,i){let{props:s}=e;await super.onMount(e,i);let t=s.context.tick;s.text&&s.typewriter&&(this.fullText=s.text,this.text="",this.currentIndex=0,s.typewriter&&(this.typewriterOptions=s.typewriter,this.typewriterOptions.skip&&Se(this.typewriterOptions.skip)&&at(this.typewriterOptions.skip,()=>{this.skipTypewriter()}))),this.subscriptionTick=t.observable.subscribe(()=>{s.typewriter&&this.typewriterEffect()})}onUpdate(e){if(super.onUpdate(e),e.typewriter&&e.typewriter&&(this.typewriterOptions=e.typewriter),e.text!==void 0&&(this.text=""+e.text),e.text!==void 0&&e.text!==this.fullText&&this.fullProps.typewriter&&(this.text="",this.currentIndex=0,this.fullText=e.text),e.style){for(let i in e.style)this.style[i]=e.style[i];e.style.wordWrapWidth&&(this._wordWrapWidth=e.style.wordWrapWidth)}e.color&&(this.style.fill=e.color),e.size&&(this.style.fontSize=e.size),e.fontFamily&&(this.style.fontFamily=e.fontFamily),this._wordWrapWidth?this.setWidth(this._wordWrapWidth):this.setWidth(this.width),this.setHeight(this.height)}get onCompleteCallback(){return this.typewriterOptions.onComplete}typewriterEffect(){if(this.currentIndex<this.fullText.length){let e=Math.min(this.currentIndex+(this.typewriterOptions.speed??1),this.fullText.length);this.text=this.fullText.slice(0,e),this.currentIndex=e,this.currentIndex===this.fullText.length&&this.onCompleteCallback&&this.onCompleteCallback()}}skipTypewriter(){this.skipSignal&&this.skipSignal(),this.text=this.fullText,this.currentIndex=this.fullText.length}async onDestroy(e,i){let s=async()=>{this.subscriptionTick&&this.subscriptionTick.unsubscribe(),i&&i()};await super.onDestroy(e,s)}};y("Text",Ee);function ui(r){return g("Text",r)}import{TilingSprite as di,Texture as hi}from"pixi.js";var Te=class extends b(di){onUpdate(n){super.onUpdate(n),n.image&&(this.texture=hi.from(n.image)),n.tileScale&&this.tileScale.set(n.tileScale.x,n.tileScale.y),n.tilePosition&&this.tilePosition.set(n.tilePosition.x,n.tilePosition.y),n.width!==void 0&&(this.width=n.width),n.height!==void 0&&(this.height=n.height)}};y("TilingSprite",Te);function pi(r){return g("TilingSprite",r)}import{Viewport as yi}from"pixi-viewport";import{effect as lt}from"@signe/reactive";var gi=["bounce-x-end","bounce-x-start","bounce-y-end","bounce-y-start","clicked","drag-end","drag-start","frame-end","mouse-edge-end","mouse-edge-start","moved","moved-end","pinch-end","pinch-start","snap-end","snap-start","snap-zoom-end","snap-zoom-start","wheel-scroll","zoomed","zoomed-end"],Ce=class extends b(yi){constructor(){super({noTicker:!0,events:{domElement:{addEventListener:()=>{}}}});this.overrideProps=["wheel"]}onInit(e){super.onInit(e);for(let i of gi)e[i]&&this.on(i,e[i])}async onMount(e,i){await super.onMount(e,i);let{props:s}=e,{tick:t,app:a,canvasSize:l}=s.context,o=!1;lt(()=>{this.screenWidth=l().width,this.screenHeight=l().height}),lt(()=>{let c=a();if(!c)return;let f=c.renderer;f.events.domElement.addEventListener("wheel",this.input.wheelFunction),this.options.events=f.events}),this.tickSubscription=t.observable.subscribe(({value:c})=>{this.update(c.timestamp)}),e.props.context.viewport=this,this.updateViewportSettings(s)}onUpdate(e){super.onUpdate(e),this.updateViewportSettings(e)}updateViewportSettings(e){e.screenWidth!==void 0&&(this.screenWidth=e.screenWidth),e.screenHeight!==void 0&&(this.screenHeight=e.screenHeight),e.worldWidth!==void 0&&(this.worldWidth=e.worldWidth),e.worldHeight!==void 0&&(this.worldHeight=e.worldHeight),e.drag&&this.drag(e.drag),e.clamp&&this.clamp(e.clamp.value??e.clamp),e.wheel&&(e.wheel===!0?this.wheel():this.wheel(e.wheel)),e.decelerate&&(e.decelerate===!0?this.decelerate():this.decelerate(e.decelerate)),e.pinch&&(e.pinch===!0?this.pinch():this.pinch(e.pinch))}async onDestroy(e,i){let s=async()=>{this.tickSubscription.unsubscribe(),i()};await super.onDestroy(e,s)}};y("Viewport",Ce);function bi(r){return g("Viewport",r)}import{Assets as vi,NineSliceSprite as xi}from"pixi.js";var Oe=class extends b(xi){constructor(){super({width:0,height:0})}async onUpdate(n){for(let[e,i]of Object.entries(n))i!==void 0&&(e==="image"?this.texture=await vi.load(i):e in this&&(this[e]=i))}};y("NineSliceSprite",Oe);function wi(r){return g("NineSliceSprite",r)}import{DOMContainer as Pi}from"pixi.js";import{isSignal as ct}from"@signe/reactive";var ft=["click","mouseover","mouseout","mouseenter","mouseleave","mousemove","mouseup","mousedown","touchstart","touchend","touchmove","touchcancel","wheel","scroll","resize","focus","blur","change","input","submit","reset","keydown","keyup","keypress","contextmenu","drag","dragend","dragenter","dragleave","dragover","drop","dragstart","select","selectstart","selectend","selectall","selectnone"],ke=class{constructor(){this.eventListeners=new Map;this.onBeforeDestroy=null;this.valueSignal=null;this.isFormElementType=!1}isFormElement(n){return["input","textarea","select"].includes(n.toLowerCase())}onInit(n){typeof n.element=="string"?(this.element=document.createElement(n.element),this.isFormElementType=this.isFormElement(n.element)):(this.element=n.element.value,this.isFormElementType=this.isFormElement(this.element.tagName)),(n.onBeforeDestroy||n["on-before-destroy"])&&(this.onBeforeDestroy=n.onBeforeDestroy||n["on-before-destroy"]);for(let e of ft)if(n.attrs?.[e]){let i=s=>{if(e==="submit"&&this.element.tagName.toLowerCase()==="form"){s.preventDefault();let t=new FormData(this.element),a={};t.forEach((l,o)=>{a[o]?Array.isArray(a[o])?a[o].push(l):a[o]=[a[o],l]:a[o]=l}),n.attrs[e]?.(s,a)}else n.attrs[e]?.(s)};this.eventListeners.set(e,i),this.element.addEventListener(e,i,!1)}if(n.children)for(let e of n.children)$(e)?e.subscribe(({elements:i})=>{for(let s of i)this.element.appendChild(s.componentInstance.element)}):this.element.appendChild(e.componentInstance.element);this.onUpdate(n)}onMount(n){let i=n.propObservables.attrs;if(this.isFormElementType&&i?.value&&ct(i.value)){this.valueSignal=i.value,this.element.value=this.valueSignal();let s=t=>{let a=t.target;this.valueSignal.set(a.value)};this.eventListeners.set("input",s),this.element.addEventListener("input",s,!1)}}onUpdate(n){if(this.element){for(let[e,i]of Object.entries(n.attrs||{}))if(e==="class"){let s=i.items||i.value||i;if(this.element.className="",typeof s=="string")this.element.className=s;else if(Array.isArray(s))this.element.classList.add(...s);else if(typeof s=="object"&&s!==null)for(let[t,a]of Object.entries(s))a&&this.element.classList.add(t)}else if(e==="style"){let s=i.items||i.value||i;if(typeof s=="string")this.element.setAttribute("style",s);else if(typeof s=="object"&&s!==null)for(let[t,a]of Object.entries(s))a!=null&&(this.element.style[t]=a)}else if(e==="value"&&this.isFormElementType)if(ct(i)){let s=this.element.value,t=i();s!==t&&(this.element.value=t)}else this.element.value=i;else ft.includes(e)||this.element.setAttribute(e,i);n.textContent&&(this.element.textContent=n.textContent)}}async onDestroy(n,e){if(this.element){this.onBeforeDestroy&&await this.onBeforeDestroy();for(let[i,s]of this.eventListeners)this.element.removeEventListener(i,s,!1);this.eventListeners.clear(),this.element.remove(),e&&e()}}};y("DOMElement",ke);var De=r=>g("DOMElement",r);var Me=class extends b(Pi){constructor(){super(...arguments);this.disableLayout=!0}onInit(e){let i=O(De,{element:"div"},e.children);this.element=i.componentInstance.element}};y("DOMContainer",Me);var Si=r=>g("DOMContainer",r);import"@pixi/layout";import{Application as Ei}from"pixi.js";var jo=async(r,n,e)=>{let i=new Ei;await i.init({resizeTo:r,autoStart:!1,...e??{}});let s=await O(n);if(s.tag!="Canvas")throw new Error("Canvas is required");s.render(r,i);let{backgroundColor:t}=w(s.props,{backgroundColor:"black"});return i.renderer.background.color=t(),{canvasElement:s,app:i}};import{linear as Ti,easeIn as Ci,easeInOut as Oi,easeOut as ki,circIn as Di,circInOut as Mi,circOut as Ai,backIn as Fi,backInOut as Ri,backOut as Hi,anticipate as Li,bounceIn as ji,bounceInOut as Wi,bounceOut as Ki}from"popmotion";var Uo={linear:Ti,easeIn:Ci,easeInOut:Oi,easeOut:ki,circIn:Di,circInOut:Mi,circOut:Ai,backIn:Fi,backInOut:Ri,backOut:Hi,anticipate:Li,bounceIn:ji,bounceInOut:Wi,bounceOut:Ki};import{Texture as Ui,ImageSource as Ni,DOMAdapter as Bi,Matrix as _i}from"pixi.js";var mt=class{constructor(n,e,i,s,t,a,l=0){this.x0=n;this.y0=e;this.x1=i;this.y1=s;this.x2=t;this.y2=a;this.focalPoint=l;this.gradient=null;this.texture=null;this.size=600;this.size=n;let o=this.size*.5;this.canvas=Bi.get().createCanvas(),this.canvas.width=this.size,this.canvas.height=this.size,this.ctx=this.canvas.getContext("2d"),this.ctx&&(this.gradient=this.ctx.createRadialGradient(o*(1-l),o,0,o,o,o-.5))}addColorStop(n,e){this.gradient&&this.gradient.addColorStop(n,e)}render({translate:n}={}){let{x0:e,y0:i,x1:s,y1:t,x2:a,y2:l,focalPoint:o}=this,c=this.size;if(this.ctx&&this.gradient){this.ctx.fillStyle=this.gradient,this.ctx.fillRect(0,0,c,c),this.texture=new Ui({source:new Ni({resource:this.canvas,addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"})});let f=new _i,m=Math.sqrt((s-e)*(s-e)+(t-i)*(t-i)),u=Math.sqrt((a-e)*(a-e)+(l-i)*(l-i)),d=Math.atan2(t-i,s-e),h=m/c,p=u/c;f.rotate(-d),f.scale(h,p),n&&f.translate(n.x,n.y),this.transform=f}return{texture:this.texture,matrix:this.transform}}};import{isObservable as sa}from"rxjs";import*as oa from"howler";export{Nt as Canvas,qt as Circle,he as Container,Si as DOMContainer,De as DOMElement,b as DisplayObject,Kt as EVENTS,Uo as Easing,Gt as Ellipse,F as Graphics,oa as Howl,Io as Howler,Jt as Mesh,wi as NineSliceSprite,Zt as ParticlesEmitter,mt as RadialGradient,Vt as Rect,Qt as Scene,Pe as Sprite,Xt as Svg,ui as Text,pi as TilingSprite,It as Triangle,Q as Utils,li as Video,bi as Viewport,ns as animatedSequence,is as animatedSignal,jo as bootstrapCanvas,mn as cond,g as createComponent,Qe as currentSubscriptionsTracker,O as h,xe as isAnimatedSignal,W as isElement,sa as isObservable,ne as isPrimitive,Se as isTrigger,fn as loop,be as mount,ge as mountTracker,at as on,y as registerComponent,qr as tick,Es as trigger,oe as useDefineProps,w as useProps};
|
|
2
|
-
|
|
1
|
+
import { h as a } from "./index-6NvvNj5_.js";
|
|
2
|
+
import { A as r, C as n, m as o, l as c, D as l, v as p, a3 as m, a2 as S, a0 as g, n as u, G as b, c as d, M as C, N as j, O as T, P as E, a1 as O, R as f, o as v, p as w, S as h, q as D, r as P, T as k, b as x, V as y, t as A, $ as H, _ as M, Y as V, d as G, H as N, z as R, I as q, e as U, Q as z, Z as B, f as I, g as J, w as K, j as L, i as Q, x as W, k as X, U as Y, B as Z, K as _, J as $, X as F, y as aa, s as sa, L as ea, W as ia, a as ta, u as ra } from "./index-6NvvNj5_.js";
|
|
3
|
+
const e = a.Howler;
|
|
4
|
+
export {
|
|
5
|
+
r as ArraySubject,
|
|
6
|
+
n as Canvas,
|
|
7
|
+
o as Circle,
|
|
8
|
+
c as Container,
|
|
9
|
+
l as DOMContainer,
|
|
10
|
+
p as DOMElement,
|
|
11
|
+
m as DisplayObject,
|
|
12
|
+
S as EVENTS,
|
|
13
|
+
g as Easing,
|
|
14
|
+
u as Ellipse,
|
|
15
|
+
b as Graphics,
|
|
16
|
+
d as Howl,
|
|
17
|
+
e as Howler,
|
|
18
|
+
C as Mesh,
|
|
19
|
+
j as NineSliceSprite,
|
|
20
|
+
T as ObjectSubject,
|
|
21
|
+
E as ParticlesEmitter,
|
|
22
|
+
O as RadialGradient,
|
|
23
|
+
f as Rect,
|
|
24
|
+
v as Scene,
|
|
25
|
+
w as Sprite,
|
|
26
|
+
h as Svg,
|
|
27
|
+
D as Text,
|
|
28
|
+
P as TilingSprite,
|
|
29
|
+
k as Triangle,
|
|
30
|
+
x as Utils,
|
|
31
|
+
y as Video,
|
|
32
|
+
A as Viewport,
|
|
33
|
+
H as animatedSequence,
|
|
34
|
+
M as animatedSignal,
|
|
35
|
+
V as bootstrapCanvas,
|
|
36
|
+
G as computed,
|
|
37
|
+
N as cond,
|
|
38
|
+
R as createComponent,
|
|
39
|
+
q as currentSubscriptionsTracker,
|
|
40
|
+
U as effect,
|
|
41
|
+
z as h,
|
|
42
|
+
B as isAnimatedSignal,
|
|
43
|
+
I as isArraySubject,
|
|
44
|
+
J as isComputed,
|
|
45
|
+
K as isElement,
|
|
46
|
+
L as isObjectSubject,
|
|
47
|
+
Q as isObservable,
|
|
48
|
+
W as isPrimitive,
|
|
49
|
+
X as isSignal,
|
|
50
|
+
Y as isTrigger,
|
|
51
|
+
Z as loop,
|
|
52
|
+
_ as mount,
|
|
53
|
+
$ as mountTracker,
|
|
54
|
+
F as on,
|
|
55
|
+
aa as registerComponent,
|
|
56
|
+
sa as signal,
|
|
57
|
+
ea as tick,
|
|
58
|
+
ia as trigger,
|
|
59
|
+
ta as useDefineProps,
|
|
60
|
+
ra as useProps
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=index.js.map
|