Socket
Socket
Sign inDemoInstall

@coveord/blitz-ui-2022

Package Overview
Dependencies
0
Maintainers
86
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.4 to 0.0.5

dist/ai/AggresiveAI.d.ts

2

dist/index.es.min.js

@@ -1,2 +0,2 @@

function t(){}const e=t=>t;function n(t,e){for(const n in e)t[n]=e[n];return t}function r(t){return t()}function o(){return Object.create(null)}function c(t){t.forEach(r)}function s(t){return"function"==typeof t}function i(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}const a="undefined"!=typeof window;let l=a?()=>window.performance.now():()=>Date.now(),u=a?t=>requestAnimationFrame(t):t;const d=new Set;function f(t){d.forEach((e=>{e.c(t)||(d.delete(e),e.f())})),0!==d.size&&u(f)}function p(t,e){t.appendChild(e)}function m(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function $(t){const e=y("style");return function(t,e){p(t.head||t,e)}(m(t),e),e}function h(t,e,n){t.insertBefore(e,n||null)}function g(t){t.parentNode.removeChild(t)}function y(t){return document.createElement(t)}function w(t){return document.createTextNode(t)}function x(){return w(" ")}function b(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function k(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}const v=new Set;let _,I=0;function S(t,e,n,r,o,c,s,i=0){const a=16.666/r;let l="{\n";for(let t=0;t<=1;t+=a){const r=e+(n-e)*c(t);l+=100*t+`%{${s(r,1-r)}}\n`}const u=l+`100% {${s(n,1-n)}}\n}`,d=`__svelte_${function(t){let e=5381,n=t.length;for(;n--;)e=(e<<5)-e^t.charCodeAt(n);return e>>>0}(u)}_${i}`,f=m(t);v.add(f);const p=f.__svelte_stylesheet||(f.__svelte_stylesheet=$(t).sheet),h=f.__svelte_rules||(f.__svelte_rules={});h[d]||(h[d]=!0,p.insertRule(`@keyframes ${d} ${u}`,p.cssRules.length));const g=t.style.animation||"";return t.style.animation=`${g?`${g}, `:""}${d} ${r}ms linear ${o}ms 1 both`,I+=1,d}function E(t,e){const n=(t.style.animation||"").split(", "),r=n.filter(e?t=>t.indexOf(e)<0:t=>-1===t.indexOf("__svelte")),o=n.length-r.length;o&&(t.style.animation=r.join(", "),I-=o,I||u((()=>{I||(v.forEach((t=>{const e=t.__svelte_stylesheet;let n=e.cssRules.length;for(;n--;)e.deleteRule(n);t.__svelte_rules={}})),v.clear())})))}function U(t){_=t}const A=[],M=[],T=[],B=[],F=Promise.resolve();let N=!1;function P(t){T.push(t)}let O=!1;const j=new Set;function C(){if(!O){O=!0;do{for(let t=0;t<A.length;t+=1){const e=A[t];U(e),R(e.$$)}for(U(null),A.length=0;M.length;)M.pop()();for(let t=0;t<T.length;t+=1){const e=T[t];j.has(e)||(j.add(e),e())}T.length=0}while(A.length);for(;B.length;)B.pop()();N=!1,O=!1,j.clear()}}function R(t){if(null!==t.fragment){t.update(),c(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(P)}}let z;function D(t,e,n){t.dispatchEvent(function(t,e,n=!1){const r=document.createEvent("CustomEvent");return r.initCustomEvent(t,n,!1,e),r}(`${e?"intro":"outro"}${n}`))}const q=new Set;let W;function G(){W={r:0,c:[],p:W}}function H(){W.r||c(W.c),W=W.p}function J(t,e){t&&t.i&&(q.delete(t),t.i(e))}function K(t,e,n,r){if(t&&t.o){if(q.has(t))return;q.add(t),W.c.push((()=>{q.delete(t),r&&(n&&t.d(1),r())})),t.o(e)}}const L={duration:0};function Q(n,r,o,i){let a=r(n,o),p=i?0:1,m=null,$=null,h=null;function g(){h&&E(n,h)}function y(t,e){const n=t.b-p;return e*=Math.abs(n),{a:p,b:t.b,d:n,duration:e,start:t.start,end:t.start+e,group:t.group}}function w(r){const{delay:o=0,duration:s=300,easing:i=e,tick:w=t,css:x}=a||L,b={start:l()+o,b:r};r||(b.group=W,W.r+=1),m||$?$=b:(x&&(g(),h=S(n,p,r,s,o,i,x)),r&&w(0,1),m=y(b,s),P((()=>D(n,r,"start"))),function(t){let e;0===d.size&&u(f),new Promise((n=>{d.add(e={c:t,f:n})}))}((t=>{if($&&t>$.start&&(m=y($,s),$=null,D(n,m.b,"start"),x&&(g(),h=S(n,p,m.b,m.duration,0,i,a.css))),m)if(t>=m.end)w(p=m.b,1-p),D(n,m.b,"end"),$||(m.b?g():--m.group.r||c(m.group.c)),m=null;else if(t>=m.start){const e=t-m.start;p=m.a+m.d*i(e/m.duration),w(p,1-p)}return!(!m&&!$)})))}return{run(t){s(a)?(z||(z=Promise.resolve(),z.then((()=>{z=null}))),z).then((()=>{a=a(),w(t)})):w(t)},end(){g(),m=$=null}}}function V(t,e){K(t,1,1,(()=>{e.delete(t.key)}))}function X(t){t&&t.c()}function Y(t,e,n,o){const{fragment:i,on_mount:a,on_destroy:l,after_update:u}=t.$$;i&&i.m(e,n),o||P((()=>{const e=a.map(r).filter(s);l?l.push(...e):c(e),t.$$.on_mount=[]})),u.forEach(P)}function Z(t,e){const n=t.$$;null!==n.fragment&&(c(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function tt(t,e){-1===t.$$.dirty[0]&&(A.push(t),N||(N=!0,F.then(C)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function et(e,n,r,s,i,a,l,u=[-1]){const d=_;U(e);const f=e.$$={fragment:null,ctx:null,props:a,update:t,not_equal:i,bound:o(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(n.context||(d?d.$$.context:[])),callbacks:o(),dirty:u,skip_bound:!1,root:n.target||d.$$.root};l&&l(f.root);let p=!1;if(f.ctx=r?r(e,n.props||{},((t,n,...r)=>{const o=r.length?r[0]:n;return f.ctx&&i(f.ctx[t],f.ctx[t]=o)&&(!f.skip_bound&&f.bound[t]&&f.bound[t](o),p&&tt(e,t)),n})):[],f.update(),p=!0,c(f.before_update),f.fragment=!!s&&s(f.ctx),n.target){if(n.hydrate){const t=function(t){return Array.from(t.childNodes)}(n.target);f.fragment&&f.fragment.l(t),t.forEach(g)}else f.fragment&&f.fragment.c();n.intro&&J(e.$$.fragment),Y(e,n.target,n.anchor,n.customElement),C()}U(d)}class nt{$destroy(){Z(this,1),this.$destroy=t}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}function rt(t){const e=t-1;return e*e*e+1}function ot(t,{delay:e=0,duration:n=400,easing:r=rt}={}){const o=getComputedStyle(t),c=+o.opacity,s=parseFloat(o.height),i=parseFloat(o.paddingTop),a=parseFloat(o.paddingBottom),l=parseFloat(o.marginTop),u=parseFloat(o.marginBottom),d=parseFloat(o.borderTopWidth),f=parseFloat(o.borderBottomWidth);return{delay:e,duration:n,easing:r,css:t=>`overflow: hidden;opacity: ${Math.min(20*t,1)*c};height: ${t*s}px;padding-top: ${t*i}px;padding-bottom: ${t*a}px;margin-top: ${t*l}px;margin-bottom: ${t*u}px;border-top-width: ${t*d}px;border-bottom-width: ${t*f}px;`}}function ct(t){let e;function n(t,e){return t[0].lastState.wasAttackedBy===t[1].id&&t[1].lastState.wasAttackedBy===t[0].id?it:st}let r=n(t),o=r(t);return{c(){e=y("span"),o.c()},m(t,n){h(t,e,n),o.m(e,null)},p(t,c){r===(r=n(t))&&o?o.p(t,c):(o.d(1),o=r(t),o&&(o.c(),o.m(e,null)))},d(t){t&&g(e),o.d()}}}function st(t){let e,n,r,o,c,s,i,a,l,u,d,f=t[0].crew.name+"",m=t[0].unitIndex+1+"",$=t[1].crew.name+"",x=t[1].unitIndex+1+"";return{c(){e=y("span"),n=w(f),r=w(" #"),o=w(m),s=w("\n killed\n "),i=y("span"),a=w($),l=w(" #"),u=w(x),b(e,"class",c="player-"+(t[0].crewIndex+1)+" svelte-buclr5"),b(i,"class",d="player-"+(t[1].crewIndex+1)+" svelte-buclr5")},m(t,c){h(t,e,c),p(e,n),p(e,r),p(e,o),h(t,s,c),h(t,i,c),p(i,a),p(i,l),p(i,u)},p(t,r){1&r&&f!==(f=t[0].crew.name+"")&&k(n,f),1&r&&m!==(m=t[0].unitIndex+1+"")&&k(o,m),1&r&&c!==(c="player-"+(t[0].crewIndex+1)+" svelte-buclr5")&&b(e,"class",c),2&r&&$!==($=t[1].crew.name+"")&&k(a,$),2&r&&x!==(x=t[1].unitIndex+1+"")&&k(u,x),2&r&&d!==(d="player-"+(t[1].crewIndex+1)+" svelte-buclr5")&&b(i,"class",d)},d(t){t&&g(e),t&&g(s),t&&g(i)}}}function it(t){let e,n,r,o,c,s,i,a,l,u,d,f,m,$,v=t[0].crew.name+"",_=t[0].unitIndex+1+"",I=t[1].crew.name+"",S=t[1].unitIndex+1+"",E=!t[0].hasSpawned&&at(t),U=!t[1].hasSpawned&&lt(t);return{c(){e=y("span"),n=w(v),r=w(" #"),o=w(_),s=w("\n and\n "),i=y("span"),a=w(I),l=w(" #"),u=w(S),f=w("\n\n both attacked.\n Only\n "),E&&E.c(),m=x(),U&&U.c(),$=w("\n survived"),b(e,"class",c="player-"+(t[0].crewIndex+1)+" svelte-buclr5"),b(i,"class",d="player-"+(t[1].crewIndex+1)+" svelte-buclr5")},m(t,c){h(t,e,c),p(e,n),p(e,r),p(e,o),h(t,s,c),h(t,i,c),p(i,a),p(i,l),p(i,u),h(t,f,c),E&&E.m(t,c),h(t,m,c),U&&U.m(t,c),h(t,$,c)},p(t,r){1&r&&v!==(v=t[0].crew.name+"")&&k(n,v),1&r&&_!==(_=t[0].unitIndex+1+"")&&k(o,_),1&r&&c!==(c="player-"+(t[0].crewIndex+1)+" svelte-buclr5")&&b(e,"class",c),2&r&&I!==(I=t[1].crew.name+"")&&k(a,I),2&r&&S!==(S=t[1].unitIndex+1+"")&&k(u,S),2&r&&d!==(d="player-"+(t[1].crewIndex+1)+" svelte-buclr5")&&b(i,"class",d),t[0].hasSpawned?E&&(E.d(1),E=null):E?E.p(t,r):(E=at(t),E.c(),E.m(m.parentNode,m)),t[1].hasSpawned?U&&(U.d(1),U=null):U?U.p(t,r):(U=lt(t),U.c(),U.m($.parentNode,$))},d(t){t&&g(e),t&&g(s),t&&g(i),t&&g(f),E&&E.d(t),t&&g(m),U&&U.d(t),t&&g($)}}}function at(t){let e,n,r,o,c,s=t[1].crew.name+"",i=t[1].unitIndex+1+"";return{c(){e=y("span"),n=w(s),r=w(" #"),o=w(i),b(e,"class",c="player-"+(t[1].crewIndex+1)+" svelte-buclr5")},m(t,c){h(t,e,c),p(e,n),p(e,r),p(e,o)},p(t,r){2&r&&s!==(s=t[1].crew.name+"")&&k(n,s),2&r&&i!==(i=t[1].unitIndex+1+"")&&k(o,i),2&r&&c!==(c="player-"+(t[1].crewIndex+1)+" svelte-buclr5")&&b(e,"class",c)},d(t){t&&g(e)}}}function lt(t){let e,n,r,o,c,s=t[0].crew.name+"",i=t[0].unitIndex+1+"";return{c(){e=y("span"),n=w(s),r=w(" #"),o=w(i),b(e,"class",c="player-"+(t[0].crewIndex+1)+" svelte-buclr5")},m(t,c){h(t,e,c),p(e,n),p(e,r),p(e,o)},p(t,r){1&r&&s!==(s=t[0].crew.name+"")&&k(n,s),1&r&&i!==(i=t[0].unitIndex+1+"")&&k(o,i),1&r&&c!==(c="player-"+(t[0].crewIndex+1)+" svelte-buclr5")&&b(e,"class",c)},d(t){t&&g(e)}}}function ut(e){let n,r=e[0]&&e[1]&&ct(e);return{c(){r&&r.c(),n=w("")},m(t,e){r&&r.m(t,e),h(t,n,e)},p(t,[e]){t[0]&&t[1]?r?r.p(t,e):(r=ct(t),r.c(),r.m(n.parentNode,n)):r&&(r.d(1),r=null)},i:t,o:t,d(t){r&&r.d(t),t&&g(n)}}}function dt(t,e,n){let{attackingUnit:r}=e,{receivingUnit:o}=e;return t.$$set=t=>{"attackingUnit"in t&&n(0,r=t.attackingUnit),"receivingUnit"in t&&n(1,o=t.receivingUnit)},[r,o]}class ft extends nt{constructor(t){super(),et(this,t,dt,ut,i,{attackingUnit:0,receivingUnit:1})}}function pt(t,e,n){const r=t.slice();return r[4]=e[n].component,r[5]=e[n].componentProps,r[6]=e[n].tick,r[7]=e[n].key,r}function mt(t,e){let r,o,c,s,i,a,l,u,d,f=e[6]+1+"";const m=[e[5]];var $=e[4];function v(t){let e={};for(let t=0;t<m.length;t+=1)e=n(e,m[t]);return{props:e}}return $&&(a=new $(v())),{key:t,first:null,c(){r=y("div"),o=y("span"),c=w(f),s=w(" -"),i=x(),a&&X(a.$$.fragment),l=x(),b(r,"class","bubble svelte-ba1z86"),this.first=r},m(t,e){h(t,r,e),p(r,o),p(o,c),p(o,s),p(r,i),a&&Y(a,r,null),p(r,l),d=!0},p(t,n){e=t,(!d||1&n)&&f!==(f=e[6]+1+"")&&k(c,f);const o=1&n?function(t,e){const n={},r={},o={$$scope:1};let c=t.length;for(;c--;){const s=t[c],i=e[c];if(i){for(const t in s)t in i||(r[t]=1);for(const t in i)o[t]||(n[t]=i[t],o[t]=1);t[c]=i}else for(const t in s)o[t]=1}for(const t in r)t in n||(n[t]=void 0);return n}(m,[(s=e[5],"object"==typeof s&&null!==s?s:{})]):{};var s;if($!==($=e[4])){if(a){G();const t=a;K(t.$$.fragment,1,0,(()=>{Z(t,1)})),H()}$?(a=new $(v()),X(a.$$.fragment),J(a.$$.fragment,1),Y(a,r,l)):a=null}else $&&a.$set(o)},i(t){d||(a&&J(a.$$.fragment,t),P((()=>{u||(u=Q(r,ot,{},!0)),u.run(1)})),d=!0)},o(t){a&&K(a.$$.fragment,t),u||(u=Q(r,ot,{},!1)),u.run(0),d=!1},d(t){t&&g(r),a&&Z(a),t&&u&&u.end()}}}function $t(t){let e,n,r=[],o=new Map,c=t[0];const s=t=>t[7];for(let e=0;e<c.length;e+=1){let n=pt(t,c,e),i=s(n);o.set(i,r[e]=mt(i,n))}return{c(){e=y("div");for(let t=0;t<r.length;t+=1)r[t].c()},m(t,o){h(t,e,o);for(let t=0;t<r.length;t+=1)r[t].m(e,null);n=!0},p(t,[n]){1&n&&(c=t[0],G(),r=function(t,e,n,r,o,c,s,i,a,l,u,d){let f=t.length,p=c.length,m=f;const $={};for(;m--;)$[t[m].key]=m;const h=[],g=new Map,y=new Map;for(m=p;m--;){const t=d(o,c,m),i=n(t);let a=s.get(i);a?r&&a.p(t,e):(a=l(i,t),a.c()),g.set(i,h[m]=a),i in $&&y.set(i,Math.abs(m-$[i]))}const w=new Set,x=new Set;function b(t){J(t,1),t.m(i,u),s.set(t.key,t),u=t.first,p--}for(;f&&p;){const e=h[p-1],n=t[f-1],r=e.key,o=n.key;e===n?(u=e.first,f--,p--):g.has(o)?!s.has(r)||w.has(r)?b(e):x.has(o)?f--:y.get(r)>y.get(o)?(x.add(r),b(e)):(w.add(o),f--):(a(n,s),f--)}for(;f--;){const e=t[f];g.has(e.key)||a(e,s)}for(;p;)b(h[p-1]);return h}(r,n,s,1,t,c,o,e,V,mt,null,pt),H())},i(t){if(!n){for(let t=0;t<c.length;t+=1)J(r[t]);n=!0}},o(t){for(let t=0;t<r.length;t+=1)K(r[t]);n=!1},d(t){t&&g(e);for(let t=0;t<r.length;t+=1)r[t].d()}}}function ht(t,e,n){let r,o,{ticks:c}=e,{tickIndex:s}=e;return t.$$set=t=>{"ticks"in t&&n(1,c=t.ticks),"tickIndex"in t&&n(2,s=t.tickIndex)},t.$$.update=()=>{6&t.$$.dirty&&n(3,r=((t,e)=>{if(!t)return[];const n=[];return t.slice(Math.max(0,e-50),e).forEach((t=>{const e=[];Object.values(t.allUnitsPerId).filter((t=>!!t.lastState.wasAttackedBy)).forEach((r=>{const o=t.allUnitsPerId[r.lastState.wasAttackedBy];e.some((t=>t===r.id))||(n.push({component:ft,componentProps:{attackingUnit:o,receivingUnit:r},tick:t.tick,key:t.tick+"-"+r.id}),e.push(o.id))}))})),n})(c,s)),8&t.$$.dirty&&n(0,o=r.slice(-5))},[o,c,s,r]}class gt extends nt{constructor(t){super(),et(this,t,ht,$t,i,{ticks:1,tickIndex:2})}}const yt=t=>{const e=t.crews.map((({units:t,...e},n)=>({...e,units:t.map(((t,r)=>({...t,crew:e,crewIndex:n,unitIndex:r})))})));return{...t,crews:e,allUnitsPerId:e.flatMap((t=>t.units)).reduce(((t,e)=>({...t,[e.id]:e})),{})}};function wt(t){let e,n;return e=new gt({props:{ticks:t[0],tickIndex:0}}),{c(){X(e.$$.fragment)},m(t,r){Y(e,t,r),n=!0},p(t,[n]){const r={};1&n&&(r.ticks=t[0]),e.$set(r)},i(t){n||(J(e.$$.fragment,t),n=!0)},o(t){K(e.$$.fragment,t),n=!1},d(t){Z(e,t)}}}function xt(t,e,n){let r,{ticks:o}=e,{currentTick:c=0}=e;return setInterval((()=>n(1,c+=1)),1e3),t.$$set=t=>{"ticks"in t&&n(2,o=t.ticks),"currentTick"in t&&n(1,c=t.currentTick)},t.$$.update=()=>{4&t.$$.dirty&&n(0,r=o.map(yt))},[r,c,o]}class bt extends nt{constructor(t){super(),et(this,t,xt,wt,i,{ticks:2,currentTick:1})}}export{bt as BlitzViz};
function t(){}const e=t=>t;function n(t,e){for(const n in e)t[n]=e[n];return t}function r(t){return t()}function o(){return Object.create(null)}function c(t){t.forEach(r)}function s(t){return"function"==typeof t}function i(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}const a="undefined"!=typeof window;let l=a?()=>window.performance.now():()=>Date.now(),u=a?t=>requestAnimationFrame(t):t;const d=new Set;function f(t){d.forEach((e=>{e.c(t)||(d.delete(e),e.f())})),0!==d.size&&u(f)}function p(t,e){t.appendChild(e)}function m(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function $(t){const e=y("style");return function(t,e){p(t.head||t,e)}(m(t),e),e}function h(t,e,n){t.insertBefore(e,n||null)}function g(t){t.parentNode.removeChild(t)}function y(t){return document.createElement(t)}function w(t){return document.createTextNode(t)}function x(){return w(" ")}function b(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function k(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}const v=new Set;let _,I=0;function S(t,e,n,r,o,c,s,i=0){const a=16.666/r;let l="{\n";for(let t=0;t<=1;t+=a){const r=e+(n-e)*c(t);l+=100*t+`%{${s(r,1-r)}}\n`}const u=l+`100% {${s(n,1-n)}}\n}`,d=`__svelte_${function(t){let e=5381,n=t.length;for(;n--;)e=(e<<5)-e^t.charCodeAt(n);return e>>>0}(u)}_${i}`,f=m(t);v.add(f);const p=f.__svelte_stylesheet||(f.__svelte_stylesheet=$(t).sheet),h=f.__svelte_rules||(f.__svelte_rules={});h[d]||(h[d]=!0,p.insertRule(`@keyframes ${d} ${u}`,p.cssRules.length));const g=t.style.animation||"";return t.style.animation=`${g?`${g}, `:""}${d} ${r}ms linear ${o}ms 1 both`,I+=1,d}function E(t,e){const n=(t.style.animation||"").split(", "),r=n.filter(e?t=>t.indexOf(e)<0:t=>-1===t.indexOf("__svelte")),o=n.length-r.length;o&&(t.style.animation=r.join(", "),I-=o,I||u((()=>{I||(v.forEach((t=>{const e=t.__svelte_stylesheet;let n=e.cssRules.length;for(;n--;)e.deleteRule(n);t.__svelte_rules={}})),v.clear())})))}function U(t){_=t}const A=[],M=[],T=[],B=[],F=Promise.resolve();let N=!1;function P(t){T.push(t)}let O=!1;const j=new Set;function C(){if(!O){O=!0;do{for(let t=0;t<A.length;t+=1){const e=A[t];U(e),R(e.$$)}for(U(null),A.length=0;M.length;)M.pop()();for(let t=0;t<T.length;t+=1){const e=T[t];j.has(e)||(j.add(e),e())}T.length=0}while(A.length);for(;B.length;)B.pop()();N=!1,O=!1,j.clear()}}function R(t){if(null!==t.fragment){t.update(),c(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(P)}}let z;function D(t,e,n){t.dispatchEvent(function(t,e,n=!1){const r=document.createEvent("CustomEvent");return r.initCustomEvent(t,n,!1,e),r}(`${e?"intro":"outro"}${n}`))}const q=new Set;let W;function G(){W={r:0,c:[],p:W}}function H(){W.r||c(W.c),W=W.p}function J(t,e){t&&t.i&&(q.delete(t),t.i(e))}function K(t,e,n,r){if(t&&t.o){if(q.has(t))return;q.add(t),W.c.push((()=>{q.delete(t),r&&(n&&t.d(1),r())})),t.o(e)}}const L={duration:0};function Q(n,r,o,i){let a=r(n,o),p=i?0:1,m=null,$=null,h=null;function g(){h&&E(n,h)}function y(t,e){const n=t.b-p;return e*=Math.abs(n),{a:p,b:t.b,d:n,duration:e,start:t.start,end:t.start+e,group:t.group}}function w(r){const{delay:o=0,duration:s=300,easing:i=e,tick:w=t,css:x}=a||L,b={start:l()+o,b:r};r||(b.group=W,W.r+=1),m||$?$=b:(x&&(g(),h=S(n,p,r,s,o,i,x)),r&&w(0,1),m=y(b,s),P((()=>D(n,r,"start"))),function(t){let e;0===d.size&&u(f),new Promise((n=>{d.add(e={c:t,f:n})}))}((t=>{if($&&t>$.start&&(m=y($,s),$=null,D(n,m.b,"start"),x&&(g(),h=S(n,p,m.b,m.duration,0,i,a.css))),m)if(t>=m.end)w(p=m.b,1-p),D(n,m.b,"end"),$||(m.b?g():--m.group.r||c(m.group.c)),m=null;else if(t>=m.start){const e=t-m.start;p=m.a+m.d*i(e/m.duration),w(p,1-p)}return!(!m&&!$)})))}return{run(t){s(a)?(z||(z=Promise.resolve(),z.then((()=>{z=null}))),z).then((()=>{a=a(),w(t)})):w(t)},end(){g(),m=$=null}}}function V(t,e){K(t,1,1,(()=>{e.delete(t.key)}))}function X(t){t&&t.c()}function Y(t,e,n,o){const{fragment:i,on_mount:a,on_destroy:l,after_update:u}=t.$$;i&&i.m(e,n),o||P((()=>{const e=a.map(r).filter(s);l?l.push(...e):c(e),t.$$.on_mount=[]})),u.forEach(P)}function Z(t,e){const n=t.$$;null!==n.fragment&&(c(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function tt(t,e){-1===t.$$.dirty[0]&&(A.push(t),N||(N=!0,F.then(C)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function et(e,n,r,s,i,a,l,u=[-1]){const d=_;U(e);const f=e.$$={fragment:null,ctx:null,props:a,update:t,not_equal:i,bound:o(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(n.context||(d?d.$$.context:[])),callbacks:o(),dirty:u,skip_bound:!1,root:n.target||d.$$.root};l&&l(f.root);let p=!1;if(f.ctx=r?r(e,n.props||{},((t,n,...r)=>{const o=r.length?r[0]:n;return f.ctx&&i(f.ctx[t],f.ctx[t]=o)&&(!f.skip_bound&&f.bound[t]&&f.bound[t](o),p&&tt(e,t)),n})):[],f.update(),p=!0,c(f.before_update),f.fragment=!!s&&s(f.ctx),n.target){if(n.hydrate){const t=function(t){return Array.from(t.childNodes)}(n.target);f.fragment&&f.fragment.l(t),t.forEach(g)}else f.fragment&&f.fragment.c();n.intro&&J(e.$$.fragment),Y(e,n.target,n.anchor,n.customElement),C()}U(d)}class nt{$destroy(){Z(this,1),this.$destroy=t}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}function rt(t){const e=t-1;return e*e*e+1}function ot(t,{delay:e=0,duration:n=400,easing:r=rt}={}){const o=getComputedStyle(t),c=+o.opacity,s=parseFloat(o.height),i=parseFloat(o.paddingTop),a=parseFloat(o.paddingBottom),l=parseFloat(o.marginTop),u=parseFloat(o.marginBottom),d=parseFloat(o.borderTopWidth),f=parseFloat(o.borderBottomWidth);return{delay:e,duration:n,easing:r,css:t=>`overflow: hidden;opacity: ${Math.min(20*t,1)*c};height: ${t*s}px;padding-top: ${t*i}px;padding-bottom: ${t*a}px;margin-top: ${t*l}px;margin-bottom: ${t*u}px;border-top-width: ${t*d}px;border-bottom-width: ${t*f}px;`}}function ct(t){let e;function n(t,e){return t[0].lastState.wasAttackedBy===t[1].id&&t[1].lastState.wasAttackedBy===t[0].id?it:st}let r=n(t),o=r(t);return{c(){e=y("span"),o.c()},m(t,n){h(t,e,n),o.m(e,null)},p(t,c){r===(r=n(t))&&o?o.p(t,c):(o.d(1),o=r(t),o&&(o.c(),o.m(e,null)))},d(t){t&&g(e),o.d()}}}function st(t){let e,n,r,o,c,s,i,a,l,u,d,f=t[0].crew.name+"",m=t[0].unitIndex+1+"",$=t[1].crew.name+"",x=t[1].unitIndex+1+"";return{c(){e=y("span"),n=w(f),r=w(" #"),o=w(m),s=w("\n killed\n "),i=y("span"),a=w($),l=w(" #"),u=w(x),b(e,"class",c="player-"+(t[0].crewIndex+1)+" svelte-buclr5"),b(i,"class",d="player-"+(t[1].crewIndex+1)+" svelte-buclr5")},m(t,c){h(t,e,c),p(e,n),p(e,r),p(e,o),h(t,s,c),h(t,i,c),p(i,a),p(i,l),p(i,u)},p(t,r){1&r&&f!==(f=t[0].crew.name+"")&&k(n,f),1&r&&m!==(m=t[0].unitIndex+1+"")&&k(o,m),1&r&&c!==(c="player-"+(t[0].crewIndex+1)+" svelte-buclr5")&&b(e,"class",c),2&r&&$!==($=t[1].crew.name+"")&&k(a,$),2&r&&x!==(x=t[1].unitIndex+1+"")&&k(u,x),2&r&&d!==(d="player-"+(t[1].crewIndex+1)+" svelte-buclr5")&&b(i,"class",d)},d(t){t&&g(e),t&&g(s),t&&g(i)}}}function it(t){let e,n,r,o,c,s,i,a,l,u,d,f,m,$,v=t[0].crew.name+"",_=t[0].unitIndex+1+"",I=t[1].crew.name+"",S=t[1].unitIndex+1+"",E=!t[0].hasSpawned&&at(t),U=!t[1].hasSpawned&&lt(t);return{c(){e=y("span"),n=w(v),r=w(" #"),o=w(_),s=w("\n and\n "),i=y("span"),a=w(I),l=w(" #"),u=w(S),f=w("\n\n both attacked.\n Only\n "),E&&E.c(),m=x(),U&&U.c(),$=w("\n survived"),b(e,"class",c="player-"+(t[0].crewIndex+1)+" svelte-buclr5"),b(i,"class",d="player-"+(t[1].crewIndex+1)+" svelte-buclr5")},m(t,c){h(t,e,c),p(e,n),p(e,r),p(e,o),h(t,s,c),h(t,i,c),p(i,a),p(i,l),p(i,u),h(t,f,c),E&&E.m(t,c),h(t,m,c),U&&U.m(t,c),h(t,$,c)},p(t,r){1&r&&v!==(v=t[0].crew.name+"")&&k(n,v),1&r&&_!==(_=t[0].unitIndex+1+"")&&k(o,_),1&r&&c!==(c="player-"+(t[0].crewIndex+1)+" svelte-buclr5")&&b(e,"class",c),2&r&&I!==(I=t[1].crew.name+"")&&k(a,I),2&r&&S!==(S=t[1].unitIndex+1+"")&&k(u,S),2&r&&d!==(d="player-"+(t[1].crewIndex+1)+" svelte-buclr5")&&b(i,"class",d),t[0].hasSpawned?E&&(E.d(1),E=null):E?E.p(t,r):(E=at(t),E.c(),E.m(m.parentNode,m)),t[1].hasSpawned?U&&(U.d(1),U=null):U?U.p(t,r):(U=lt(t),U.c(),U.m($.parentNode,$))},d(t){t&&g(e),t&&g(s),t&&g(i),t&&g(f),E&&E.d(t),t&&g(m),U&&U.d(t),t&&g($)}}}function at(t){let e,n,r,o,c,s=t[1].crew.name+"",i=t[1].unitIndex+1+"";return{c(){e=y("span"),n=w(s),r=w(" #"),o=w(i),b(e,"class",c="player-"+(t[1].crewIndex+1)+" svelte-buclr5")},m(t,c){h(t,e,c),p(e,n),p(e,r),p(e,o)},p(t,r){2&r&&s!==(s=t[1].crew.name+"")&&k(n,s),2&r&&i!==(i=t[1].unitIndex+1+"")&&k(o,i),2&r&&c!==(c="player-"+(t[1].crewIndex+1)+" svelte-buclr5")&&b(e,"class",c)},d(t){t&&g(e)}}}function lt(t){let e,n,r,o,c,s=t[0].crew.name+"",i=t[0].unitIndex+1+"";return{c(){e=y("span"),n=w(s),r=w(" #"),o=w(i),b(e,"class",c="player-"+(t[0].crewIndex+1)+" svelte-buclr5")},m(t,c){h(t,e,c),p(e,n),p(e,r),p(e,o)},p(t,r){1&r&&s!==(s=t[0].crew.name+"")&&k(n,s),1&r&&i!==(i=t[0].unitIndex+1+"")&&k(o,i),1&r&&c!==(c="player-"+(t[0].crewIndex+1)+" svelte-buclr5")&&b(e,"class",c)},d(t){t&&g(e)}}}function ut(e){let n,r=e[0]&&e[1]&&ct(e);return{c(){r&&r.c(),n=w("")},m(t,e){r&&r.m(t,e),h(t,n,e)},p(t,[e]){t[0]&&t[1]?r?r.p(t,e):(r=ct(t),r.c(),r.m(n.parentNode,n)):r&&(r.d(1),r=null)},i:t,o:t,d(t){r&&r.d(t),t&&g(n)}}}function dt(t,e,n){let{attackingUnit:r}=e,{receivingUnit:o}=e;return t.$$set=t=>{"attackingUnit"in t&&n(0,r=t.attackingUnit),"receivingUnit"in t&&n(1,o=t.receivingUnit)},[r,o]}class ft extends nt{constructor(t){super(),et(this,t,dt,ut,i,{attackingUnit:0,receivingUnit:1})}}function pt(t,e,n){const r=t.slice();return r[4]=e[n].component,r[5]=e[n].componentProps,r[6]=e[n].tick,r[7]=e[n].key,r}function mt(t,e){let r,o,c,s,i,a,l,u,d,f=e[6]+1+"";const m=[e[5]];var $=e[4];function v(t){let e={};for(let t=0;t<m.length;t+=1)e=n(e,m[t]);return{props:e}}return $&&(a=new $(v())),{key:t,first:null,c(){r=y("div"),o=y("span"),c=w(f),s=w(" -"),i=x(),a&&X(a.$$.fragment),l=x(),b(r,"class","bubble svelte-ba1z86"),this.first=r},m(t,e){h(t,r,e),p(r,o),p(o,c),p(o,s),p(r,i),a&&Y(a,r,null),p(r,l),d=!0},p(t,n){e=t,(!d||1&n)&&f!==(f=e[6]+1+"")&&k(c,f);const o=1&n?function(t,e){const n={},r={},o={$$scope:1};let c=t.length;for(;c--;){const s=t[c],i=e[c];if(i){for(const t in s)t in i||(r[t]=1);for(const t in i)o[t]||(n[t]=i[t],o[t]=1);t[c]=i}else for(const t in s)o[t]=1}for(const t in r)t in n||(n[t]=void 0);return n}(m,[(s=e[5],"object"==typeof s&&null!==s?s:{})]):{};var s;if($!==($=e[4])){if(a){G();const t=a;K(t.$$.fragment,1,0,(()=>{Z(t,1)})),H()}$?(a=new $(v()),X(a.$$.fragment),J(a.$$.fragment,1),Y(a,r,l)):a=null}else $&&a.$set(o)},i(t){d||(a&&J(a.$$.fragment,t),P((()=>{u||(u=Q(r,ot,{},!0)),u.run(1)})),d=!0)},o(t){a&&K(a.$$.fragment,t),u||(u=Q(r,ot,{},!1)),u.run(0),d=!1},d(t){t&&g(r),a&&Z(a),t&&u&&u.end()}}}function $t(t){let e,n,r=[],o=new Map,c=t[0];const s=t=>t[7];for(let e=0;e<c.length;e+=1){let n=pt(t,c,e),i=s(n);o.set(i,r[e]=mt(i,n))}return{c(){e=y("div");for(let t=0;t<r.length;t+=1)r[t].c()},m(t,o){h(t,e,o);for(let t=0;t<r.length;t+=1)r[t].m(e,null);n=!0},p(t,[n]){1&n&&(c=t[0],G(),r=function(t,e,n,r,o,c,s,i,a,l,u,d){let f=t.length,p=c.length,m=f;const $={};for(;m--;)$[t[m].key]=m;const h=[],g=new Map,y=new Map;for(m=p;m--;){const t=d(o,c,m),i=n(t);let a=s.get(i);a?r&&a.p(t,e):(a=l(i,t),a.c()),g.set(i,h[m]=a),i in $&&y.set(i,Math.abs(m-$[i]))}const w=new Set,x=new Set;function b(t){J(t,1),t.m(i,u),s.set(t.key,t),u=t.first,p--}for(;f&&p;){const e=h[p-1],n=t[f-1],r=e.key,o=n.key;e===n?(u=e.first,f--,p--):g.has(o)?!s.has(r)||w.has(r)?b(e):x.has(o)?f--:y.get(r)>y.get(o)?(x.add(r),b(e)):(w.add(o),f--):(a(n,s),f--)}for(;f--;){const e=t[f];g.has(e.key)||a(e,s)}for(;p;)b(h[p-1]);return h}(r,n,s,1,t,c,o,e,V,mt,null,pt),H())},i(t){if(!n){for(let t=0;t<c.length;t+=1)J(r[t]);n=!0}},o(t){for(let t=0;t<r.length;t+=1)K(r[t]);n=!1},d(t){t&&g(e);for(let t=0;t<r.length;t+=1)r[t].d()}}}function ht(t,e,n){let r,o,{ticks:c}=e,{tickIndex:s}=e;return t.$$set=t=>{"ticks"in t&&n(1,c=t.ticks),"tickIndex"in t&&n(2,s=t.tickIndex)},t.$$.update=()=>{6&t.$$.dirty&&n(3,r=((t,e)=>{if(!t)return[];const n=[];return t.slice(Math.max(0,e-50),e).forEach((t=>{const e=[];Object.values(t.allUnitsPerId).filter((t=>!!t.lastState.wasAttackedBy)).forEach((r=>{const o=t.allUnitsPerId[r.lastState.wasAttackedBy];e.some((t=>t===r.id))||(n.push({component:ft,componentProps:{attackingUnit:o,receivingUnit:r},tick:t.tick,key:t.tick+"-"+r.id}),e.push(o.id))}))})),n})(c,s)),8&t.$$.dirty&&n(0,o=r.slice(-5))},[o,c,s,r]}class gt extends nt{constructor(t){super(),et(this,t,ht,$t,i,{ticks:1,tickIndex:2})}}const yt=t=>{const e=t.crews.map((({units:t,...e},n)=>({...e,units:t.map(((t,r)=>({...t,crew:e,crewIndex:n,unitIndex:r})))})));return{...t,crews:e,allUnitsPerId:e.flatMap((t=>t.units)).reduce(((t,e)=>({...t,[e.id]:e})),{})}};function wt(t){let e,n;return e=new gt({props:{ticks:t[1],tickIndex:t[0]}}),{c(){X(e.$$.fragment)},m(t,r){Y(e,t,r),n=!0},p(t,[n]){const r={};2&n&&(r.ticks=t[1]),1&n&&(r.tickIndex=t[0]),e.$set(r)},i(t){n||(J(e.$$.fragment,t),n=!0)},o(t){K(e.$$.fragment,t),n=!1},d(t){Z(e,t)}}}function xt(t,e,n){let r,{ticks:o}=e,{currentTick:c=0}=e;return setInterval((()=>n(0,c+=1)),1e3),t.$$set=t=>{"ticks"in t&&n(2,o=t.ticks),"currentTick"in t&&n(0,c=t.currentTick)},t.$$.update=()=>{4&t.$$.dirty&&n(1,r=o.map(yt))},[c,r,o]}class bt extends nt{constructor(t){super(),et(this,t,xt,wt,i,{ticks:2,currentTick:0})}}export{bt as BlitzViz};
//# sourceMappingURL=index.es.min.js.map

@@ -1,2 +0,2 @@

var blitzui=function(t){"use strict";function e(){}const n=t=>t;function r(t,e){for(const n in e)t[n]=e[n];return t}function o(t){return t()}function c(){return Object.create(null)}function s(t){t.forEach(o)}function i(t){return"function"==typeof t}function l(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}const a="undefined"!=typeof window;let u=a?()=>window.performance.now():()=>Date.now(),d=a?t=>requestAnimationFrame(t):e;const f=new Set;function p(t){f.forEach((e=>{e.c(t)||(f.delete(e),e.f())})),0!==f.size&&d(p)}function m(t,e){t.appendChild(e)}function $(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function h(t){const e=w("style");return function(t,e){m(t.head||t,e)}($(t),e),e}function g(t,e,n){t.insertBefore(e,n||null)}function y(t){t.parentNode.removeChild(t)}function w(t){return document.createElement(t)}function b(t){return document.createTextNode(t)}function x(){return b(" ")}function k(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function v(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}const _=new Set;let I,S=0;function E(t,e,n,r,o,c,s,i=0){const l=16.666/r;let a="{\n";for(let t=0;t<=1;t+=l){const r=e+(n-e)*c(t);a+=100*t+`%{${s(r,1-r)}}\n`}const u=a+`100% {${s(n,1-n)}}\n}`,d=`__svelte_${function(t){let e=5381,n=t.length;for(;n--;)e=(e<<5)-e^t.charCodeAt(n);return e>>>0}(u)}_${i}`,f=$(t);_.add(f);const p=f.__svelte_stylesheet||(f.__svelte_stylesheet=h(t).sheet),m=f.__svelte_rules||(f.__svelte_rules={});m[d]||(m[d]=!0,p.insertRule(`@keyframes ${d} ${u}`,p.cssRules.length));const g=t.style.animation||"";return t.style.animation=`${g?`${g}, `:""}${d} ${r}ms linear ${o}ms 1 both`,S+=1,d}function U(t,e){const n=(t.style.animation||"").split(", "),r=n.filter(e?t=>t.indexOf(e)<0:t=>-1===t.indexOf("__svelte")),o=n.length-r.length;o&&(t.style.animation=r.join(", "),S-=o,S||d((()=>{S||(_.forEach((t=>{const e=t.__svelte_stylesheet;let n=e.cssRules.length;for(;n--;)e.deleteRule(n);t.__svelte_rules={}})),_.clear())})))}function A(t){I=t}const M=[],B=[],P=[],T=[],F=Promise.resolve();let N=!1;function O(t){P.push(t)}let j=!1;const z=new Set;function C(){if(!j){j=!0;do{for(let t=0;t<M.length;t+=1){const e=M[t];A(e),R(e.$$)}for(A(null),M.length=0;B.length;)B.pop()();for(let t=0;t<P.length;t+=1){const e=P[t];z.has(e)||(z.add(e),e())}P.length=0}while(M.length);for(;T.length;)T.pop()();N=!1,j=!1,z.clear()}}function R(t){if(null!==t.fragment){t.update(),s(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(O)}}let D;function q(t,e,n){t.dispatchEvent(function(t,e,n=!1){const r=document.createEvent("CustomEvent");return r.initCustomEvent(t,n,!1,e),r}(`${e?"intro":"outro"}${n}`))}const W=new Set;let V;function G(){V={r:0,c:[],p:V}}function H(){V.r||s(V.c),V=V.p}function J(t,e){t&&t.i&&(W.delete(t),t.i(e))}function K(t,e,n,r){if(t&&t.o){if(W.has(t))return;W.add(t),V.c.push((()=>{W.delete(t),r&&(n&&t.d(1),r())})),t.o(e)}}const L={duration:0};function Q(t,r,o,c){let l=r(t,o),a=c?0:1,m=null,$=null,h=null;function g(){h&&U(t,h)}function y(t,e){const n=t.b-a;return e*=Math.abs(n),{a:a,b:t.b,d:n,duration:e,start:t.start,end:t.start+e,group:t.group}}function w(r){const{delay:o=0,duration:c=300,easing:i=n,tick:w=e,css:b}=l||L,x={start:u()+o,b:r};r||(x.group=V,V.r+=1),m||$?$=x:(b&&(g(),h=E(t,a,r,c,o,i,b)),r&&w(0,1),m=y(x,c),O((()=>q(t,r,"start"))),function(t){let e;0===f.size&&d(p),new Promise((n=>{f.add(e={c:t,f:n})}))}((e=>{if($&&e>$.start&&(m=y($,c),$=null,q(t,m.b,"start"),b&&(g(),h=E(t,a,m.b,m.duration,0,i,l.css))),m)if(e>=m.end)w(a=m.b,1-a),q(t,m.b,"end"),$||(m.b?g():--m.group.r||s(m.group.c)),m=null;else if(e>=m.start){const t=e-m.start;a=m.a+m.d*i(t/m.duration),w(a,1-a)}return!(!m&&!$)})))}return{run(t){i(l)?(D||(D=Promise.resolve(),D.then((()=>{D=null}))),D).then((()=>{l=l(),w(t)})):w(t)},end(){g(),m=$=null}}}function X(t,e){K(t,1,1,(()=>{e.delete(t.key)}))}function Y(t){t&&t.c()}function Z(t,e,n,r){const{fragment:c,on_mount:l,on_destroy:a,after_update:u}=t.$$;c&&c.m(e,n),r||O((()=>{const e=l.map(o).filter(i);a?a.push(...e):s(e),t.$$.on_mount=[]})),u.forEach(O)}function tt(t,e){const n=t.$$;null!==n.fragment&&(s(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function et(t,e){-1===t.$$.dirty[0]&&(M.push(t),N||(N=!0,F.then(C)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function nt(t,n,r,o,i,l,a,u=[-1]){const d=I;A(t);const f=t.$$={fragment:null,ctx:null,props:l,update:e,not_equal:i,bound:c(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(n.context||(d?d.$$.context:[])),callbacks:c(),dirty:u,skip_bound:!1,root:n.target||d.$$.root};a&&a(f.root);let p=!1;if(f.ctx=r?r(t,n.props||{},((e,n,...r)=>{const o=r.length?r[0]:n;return f.ctx&&i(f.ctx[e],f.ctx[e]=o)&&(!f.skip_bound&&f.bound[e]&&f.bound[e](o),p&&et(t,e)),n})):[],f.update(),p=!0,s(f.before_update),f.fragment=!!o&&o(f.ctx),n.target){if(n.hydrate){const t=function(t){return Array.from(t.childNodes)}(n.target);f.fragment&&f.fragment.l(t),t.forEach(y)}else f.fragment&&f.fragment.c();n.intro&&J(t.$$.fragment),Z(t,n.target,n.anchor,n.customElement),C()}A(d)}class rt{$destroy(){tt(this,1),this.$destroy=e}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}function ot(t){const e=t-1;return e*e*e+1}function ct(t,{delay:e=0,duration:n=400,easing:r=ot}={}){const o=getComputedStyle(t),c=+o.opacity,s=parseFloat(o.height),i=parseFloat(o.paddingTop),l=parseFloat(o.paddingBottom),a=parseFloat(o.marginTop),u=parseFloat(o.marginBottom),d=parseFloat(o.borderTopWidth),f=parseFloat(o.borderBottomWidth);return{delay:e,duration:n,easing:r,css:t=>`overflow: hidden;opacity: ${Math.min(20*t,1)*c};height: ${t*s}px;padding-top: ${t*i}px;padding-bottom: ${t*l}px;margin-top: ${t*a}px;margin-bottom: ${t*u}px;border-top-width: ${t*d}px;border-bottom-width: ${t*f}px;`}}function st(t){let e;function n(t,e){return t[0].lastState.wasAttackedBy===t[1].id&&t[1].lastState.wasAttackedBy===t[0].id?lt:it}let r=n(t),o=r(t);return{c(){e=w("span"),o.c()},m(t,n){g(t,e,n),o.m(e,null)},p(t,c){r===(r=n(t))&&o?o.p(t,c):(o.d(1),o=r(t),o&&(o.c(),o.m(e,null)))},d(t){t&&y(e),o.d()}}}function it(t){let e,n,r,o,c,s,i,l,a,u,d,f=t[0].crew.name+"",p=t[0].unitIndex+1+"",$=t[1].crew.name+"",h=t[1].unitIndex+1+"";return{c(){e=w("span"),n=b(f),r=b(" #"),o=b(p),s=b("\n killed\n "),i=w("span"),l=b($),a=b(" #"),u=b(h),k(e,"class",c="player-"+(t[0].crewIndex+1)+" svelte-buclr5"),k(i,"class",d="player-"+(t[1].crewIndex+1)+" svelte-buclr5")},m(t,c){g(t,e,c),m(e,n),m(e,r),m(e,o),g(t,s,c),g(t,i,c),m(i,l),m(i,a),m(i,u)},p(t,r){1&r&&f!==(f=t[0].crew.name+"")&&v(n,f),1&r&&p!==(p=t[0].unitIndex+1+"")&&v(o,p),1&r&&c!==(c="player-"+(t[0].crewIndex+1)+" svelte-buclr5")&&k(e,"class",c),2&r&&$!==($=t[1].crew.name+"")&&v(l,$),2&r&&h!==(h=t[1].unitIndex+1+"")&&v(u,h),2&r&&d!==(d="player-"+(t[1].crewIndex+1)+" svelte-buclr5")&&k(i,"class",d)},d(t){t&&y(e),t&&y(s),t&&y(i)}}}function lt(t){let e,n,r,o,c,s,i,l,a,u,d,f,p,$,h=t[0].crew.name+"",_=t[0].unitIndex+1+"",I=t[1].crew.name+"",S=t[1].unitIndex+1+"",E=!t[0].hasSpawned&&at(t),U=!t[1].hasSpawned&&ut(t);return{c(){e=w("span"),n=b(h),r=b(" #"),o=b(_),s=b("\n and\n "),i=w("span"),l=b(I),a=b(" #"),u=b(S),f=b("\n\n both attacked.\n Only\n "),E&&E.c(),p=x(),U&&U.c(),$=b("\n survived"),k(e,"class",c="player-"+(t[0].crewIndex+1)+" svelte-buclr5"),k(i,"class",d="player-"+(t[1].crewIndex+1)+" svelte-buclr5")},m(t,c){g(t,e,c),m(e,n),m(e,r),m(e,o),g(t,s,c),g(t,i,c),m(i,l),m(i,a),m(i,u),g(t,f,c),E&&E.m(t,c),g(t,p,c),U&&U.m(t,c),g(t,$,c)},p(t,r){1&r&&h!==(h=t[0].crew.name+"")&&v(n,h),1&r&&_!==(_=t[0].unitIndex+1+"")&&v(o,_),1&r&&c!==(c="player-"+(t[0].crewIndex+1)+" svelte-buclr5")&&k(e,"class",c),2&r&&I!==(I=t[1].crew.name+"")&&v(l,I),2&r&&S!==(S=t[1].unitIndex+1+"")&&v(u,S),2&r&&d!==(d="player-"+(t[1].crewIndex+1)+" svelte-buclr5")&&k(i,"class",d),t[0].hasSpawned?E&&(E.d(1),E=null):E?E.p(t,r):(E=at(t),E.c(),E.m(p.parentNode,p)),t[1].hasSpawned?U&&(U.d(1),U=null):U?U.p(t,r):(U=ut(t),U.c(),U.m($.parentNode,$))},d(t){t&&y(e),t&&y(s),t&&y(i),t&&y(f),E&&E.d(t),t&&y(p),U&&U.d(t),t&&y($)}}}function at(t){let e,n,r,o,c,s=t[1].crew.name+"",i=t[1].unitIndex+1+"";return{c(){e=w("span"),n=b(s),r=b(" #"),o=b(i),k(e,"class",c="player-"+(t[1].crewIndex+1)+" svelte-buclr5")},m(t,c){g(t,e,c),m(e,n),m(e,r),m(e,o)},p(t,r){2&r&&s!==(s=t[1].crew.name+"")&&v(n,s),2&r&&i!==(i=t[1].unitIndex+1+"")&&v(o,i),2&r&&c!==(c="player-"+(t[1].crewIndex+1)+" svelte-buclr5")&&k(e,"class",c)},d(t){t&&y(e)}}}function ut(t){let e,n,r,o,c,s=t[0].crew.name+"",i=t[0].unitIndex+1+"";return{c(){e=w("span"),n=b(s),r=b(" #"),o=b(i),k(e,"class",c="player-"+(t[0].crewIndex+1)+" svelte-buclr5")},m(t,c){g(t,e,c),m(e,n),m(e,r),m(e,o)},p(t,r){1&r&&s!==(s=t[0].crew.name+"")&&v(n,s),1&r&&i!==(i=t[0].unitIndex+1+"")&&v(o,i),1&r&&c!==(c="player-"+(t[0].crewIndex+1)+" svelte-buclr5")&&k(e,"class",c)},d(t){t&&y(e)}}}function dt(t){let n,r=t[0]&&t[1]&&st(t);return{c(){r&&r.c(),n=b("")},m(t,e){r&&r.m(t,e),g(t,n,e)},p(t,[e]){t[0]&&t[1]?r?r.p(t,e):(r=st(t),r.c(),r.m(n.parentNode,n)):r&&(r.d(1),r=null)},i:e,o:e,d(t){r&&r.d(t),t&&y(n)}}}function ft(t,e,n){let{attackingUnit:r}=e,{receivingUnit:o}=e;return t.$$set=t=>{"attackingUnit"in t&&n(0,r=t.attackingUnit),"receivingUnit"in t&&n(1,o=t.receivingUnit)},[r,o]}class pt extends rt{constructor(t){super(),nt(this,t,ft,dt,l,{attackingUnit:0,receivingUnit:1})}}function mt(t,e,n){const r=t.slice();return r[4]=e[n].component,r[5]=e[n].componentProps,r[6]=e[n].tick,r[7]=e[n].key,r}function $t(t,e){let n,o,c,s,i,l,a,u,d,f=e[6]+1+"";const p=[e[5]];var $=e[4];function h(t){let e={};for(let t=0;t<p.length;t+=1)e=r(e,p[t]);return{props:e}}return $&&(l=new $(h())),{key:t,first:null,c(){n=w("div"),o=w("span"),c=b(f),s=b(" -"),i=x(),l&&Y(l.$$.fragment),a=x(),k(n,"class","bubble svelte-ba1z86"),this.first=n},m(t,e){g(t,n,e),m(n,o),m(o,c),m(o,s),m(n,i),l&&Z(l,n,null),m(n,a),d=!0},p(t,r){e=t,(!d||1&r)&&f!==(f=e[6]+1+"")&&v(c,f);const o=1&r?function(t,e){const n={},r={},o={$$scope:1};let c=t.length;for(;c--;){const s=t[c],i=e[c];if(i){for(const t in s)t in i||(r[t]=1);for(const t in i)o[t]||(n[t]=i[t],o[t]=1);t[c]=i}else for(const t in s)o[t]=1}for(const t in r)t in n||(n[t]=void 0);return n}(p,[(s=e[5],"object"==typeof s&&null!==s?s:{})]):{};var s;if($!==($=e[4])){if(l){G();const t=l;K(t.$$.fragment,1,0,(()=>{tt(t,1)})),H()}$?(l=new $(h()),Y(l.$$.fragment),J(l.$$.fragment,1),Z(l,n,a)):l=null}else $&&l.$set(o)},i(t){d||(l&&J(l.$$.fragment,t),O((()=>{u||(u=Q(n,ct,{},!0)),u.run(1)})),d=!0)},o(t){l&&K(l.$$.fragment,t),u||(u=Q(n,ct,{},!1)),u.run(0),d=!1},d(t){t&&y(n),l&&tt(l),t&&u&&u.end()}}}function ht(t){let e,n,r=[],o=new Map,c=t[0];const s=t=>t[7];for(let e=0;e<c.length;e+=1){let n=mt(t,c,e),i=s(n);o.set(i,r[e]=$t(i,n))}return{c(){e=w("div");for(let t=0;t<r.length;t+=1)r[t].c()},m(t,o){g(t,e,o);for(let t=0;t<r.length;t+=1)r[t].m(e,null);n=!0},p(t,[n]){1&n&&(c=t[0],G(),r=function(t,e,n,r,o,c,s,i,l,a,u,d){let f=t.length,p=c.length,m=f;const $={};for(;m--;)$[t[m].key]=m;const h=[],g=new Map,y=new Map;for(m=p;m--;){const t=d(o,c,m),i=n(t);let l=s.get(i);l?r&&l.p(t,e):(l=a(i,t),l.c()),g.set(i,h[m]=l),i in $&&y.set(i,Math.abs(m-$[i]))}const w=new Set,b=new Set;function x(t){J(t,1),t.m(i,u),s.set(t.key,t),u=t.first,p--}for(;f&&p;){const e=h[p-1],n=t[f-1],r=e.key,o=n.key;e===n?(u=e.first,f--,p--):g.has(o)?!s.has(r)||w.has(r)?x(e):b.has(o)?f--:y.get(r)>y.get(o)?(b.add(r),x(e)):(w.add(o),f--):(l(n,s),f--)}for(;f--;){const e=t[f];g.has(e.key)||l(e,s)}for(;p;)x(h[p-1]);return h}(r,n,s,1,t,c,o,e,X,$t,null,mt),H())},i(t){if(!n){for(let t=0;t<c.length;t+=1)J(r[t]);n=!0}},o(t){for(let t=0;t<r.length;t+=1)K(r[t]);n=!1},d(t){t&&y(e);for(let t=0;t<r.length;t+=1)r[t].d()}}}function gt(t,e,n){let r,o,{ticks:c}=e,{tickIndex:s}=e;return t.$$set=t=>{"ticks"in t&&n(1,c=t.ticks),"tickIndex"in t&&n(2,s=t.tickIndex)},t.$$.update=()=>{6&t.$$.dirty&&n(3,r=((t,e)=>{if(!t)return[];const n=[];return t.slice(Math.max(0,e-50),e).forEach((t=>{const e=[];Object.values(t.allUnitsPerId).filter((t=>!!t.lastState.wasAttackedBy)).forEach((r=>{const o=t.allUnitsPerId[r.lastState.wasAttackedBy];e.some((t=>t===r.id))||(n.push({component:pt,componentProps:{attackingUnit:o,receivingUnit:r},tick:t.tick,key:t.tick+"-"+r.id}),e.push(o.id))}))})),n})(c,s)),8&t.$$.dirty&&n(0,o=r.slice(-5))},[o,c,s,r]}class yt extends rt{constructor(t){super(),nt(this,t,gt,ht,l,{ticks:1,tickIndex:2})}}const wt=t=>{const e=t.crews.map((({units:t,...e},n)=>({...e,units:t.map(((t,r)=>({...t,crew:e,crewIndex:n,unitIndex:r})))})));return{...t,crews:e,allUnitsPerId:e.flatMap((t=>t.units)).reduce(((t,e)=>({...t,[e.id]:e})),{})}};function bt(t){let e,n;return e=new yt({props:{ticks:t[0],tickIndex:0}}),{c(){Y(e.$$.fragment)},m(t,r){Z(e,t,r),n=!0},p(t,[n]){const r={};1&n&&(r.ticks=t[0]),e.$set(r)},i(t){n||(J(e.$$.fragment,t),n=!0)},o(t){K(e.$$.fragment,t),n=!1},d(t){tt(e,t)}}}function xt(t,e,n){let r,{ticks:o}=e,{currentTick:c=0}=e;return setInterval((()=>n(1,c+=1)),1e3),t.$$set=t=>{"ticks"in t&&n(2,o=t.ticks),"currentTick"in t&&n(1,c=t.currentTick)},t.$$.update=()=>{4&t.$$.dirty&&n(0,r=o.map(wt))},[r,c,o]}return t.BlitzViz=class extends rt{constructor(t){super(),nt(this,t,xt,bt,l,{ticks:2,currentTick:1})}},Object.defineProperty(t,"__esModule",{value:!0}),t}({});
var blitzui=function(t){"use strict";function e(){}const n=t=>t;function r(t,e){for(const n in e)t[n]=e[n];return t}function o(t){return t()}function c(){return Object.create(null)}function s(t){t.forEach(o)}function i(t){return"function"==typeof t}function l(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}const a="undefined"!=typeof window;let u=a?()=>window.performance.now():()=>Date.now(),d=a?t=>requestAnimationFrame(t):e;const f=new Set;function p(t){f.forEach((e=>{e.c(t)||(f.delete(e),e.f())})),0!==f.size&&d(p)}function m(t,e){t.appendChild(e)}function $(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function h(t){const e=w("style");return function(t,e){m(t.head||t,e)}($(t),e),e}function g(t,e,n){t.insertBefore(e,n||null)}function y(t){t.parentNode.removeChild(t)}function w(t){return document.createElement(t)}function b(t){return document.createTextNode(t)}function x(){return b(" ")}function k(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function v(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}const _=new Set;let I,S=0;function E(t,e,n,r,o,c,s,i=0){const l=16.666/r;let a="{\n";for(let t=0;t<=1;t+=l){const r=e+(n-e)*c(t);a+=100*t+`%{${s(r,1-r)}}\n`}const u=a+`100% {${s(n,1-n)}}\n}`,d=`__svelte_${function(t){let e=5381,n=t.length;for(;n--;)e=(e<<5)-e^t.charCodeAt(n);return e>>>0}(u)}_${i}`,f=$(t);_.add(f);const p=f.__svelte_stylesheet||(f.__svelte_stylesheet=h(t).sheet),m=f.__svelte_rules||(f.__svelte_rules={});m[d]||(m[d]=!0,p.insertRule(`@keyframes ${d} ${u}`,p.cssRules.length));const g=t.style.animation||"";return t.style.animation=`${g?`${g}, `:""}${d} ${r}ms linear ${o}ms 1 both`,S+=1,d}function U(t,e){const n=(t.style.animation||"").split(", "),r=n.filter(e?t=>t.indexOf(e)<0:t=>-1===t.indexOf("__svelte")),o=n.length-r.length;o&&(t.style.animation=r.join(", "),S-=o,S||d((()=>{S||(_.forEach((t=>{const e=t.__svelte_stylesheet;let n=e.cssRules.length;for(;n--;)e.deleteRule(n);t.__svelte_rules={}})),_.clear())})))}function A(t){I=t}const M=[],B=[],P=[],T=[],F=Promise.resolve();let N=!1;function O(t){P.push(t)}let j=!1;const z=new Set;function C(){if(!j){j=!0;do{for(let t=0;t<M.length;t+=1){const e=M[t];A(e),R(e.$$)}for(A(null),M.length=0;B.length;)B.pop()();for(let t=0;t<P.length;t+=1){const e=P[t];z.has(e)||(z.add(e),e())}P.length=0}while(M.length);for(;T.length;)T.pop()();N=!1,j=!1,z.clear()}}function R(t){if(null!==t.fragment){t.update(),s(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(O)}}let D;function q(t,e,n){t.dispatchEvent(function(t,e,n=!1){const r=document.createEvent("CustomEvent");return r.initCustomEvent(t,n,!1,e),r}(`${e?"intro":"outro"}${n}`))}const W=new Set;let V;function G(){V={r:0,c:[],p:V}}function H(){V.r||s(V.c),V=V.p}function J(t,e){t&&t.i&&(W.delete(t),t.i(e))}function K(t,e,n,r){if(t&&t.o){if(W.has(t))return;W.add(t),V.c.push((()=>{W.delete(t),r&&(n&&t.d(1),r())})),t.o(e)}}const L={duration:0};function Q(t,r,o,c){let l=r(t,o),a=c?0:1,m=null,$=null,h=null;function g(){h&&U(t,h)}function y(t,e){const n=t.b-a;return e*=Math.abs(n),{a:a,b:t.b,d:n,duration:e,start:t.start,end:t.start+e,group:t.group}}function w(r){const{delay:o=0,duration:c=300,easing:i=n,tick:w=e,css:b}=l||L,x={start:u()+o,b:r};r||(x.group=V,V.r+=1),m||$?$=x:(b&&(g(),h=E(t,a,r,c,o,i,b)),r&&w(0,1),m=y(x,c),O((()=>q(t,r,"start"))),function(t){let e;0===f.size&&d(p),new Promise((n=>{f.add(e={c:t,f:n})}))}((e=>{if($&&e>$.start&&(m=y($,c),$=null,q(t,m.b,"start"),b&&(g(),h=E(t,a,m.b,m.duration,0,i,l.css))),m)if(e>=m.end)w(a=m.b,1-a),q(t,m.b,"end"),$||(m.b?g():--m.group.r||s(m.group.c)),m=null;else if(e>=m.start){const t=e-m.start;a=m.a+m.d*i(t/m.duration),w(a,1-a)}return!(!m&&!$)})))}return{run(t){i(l)?(D||(D=Promise.resolve(),D.then((()=>{D=null}))),D).then((()=>{l=l(),w(t)})):w(t)},end(){g(),m=$=null}}}function X(t,e){K(t,1,1,(()=>{e.delete(t.key)}))}function Y(t){t&&t.c()}function Z(t,e,n,r){const{fragment:c,on_mount:l,on_destroy:a,after_update:u}=t.$$;c&&c.m(e,n),r||O((()=>{const e=l.map(o).filter(i);a?a.push(...e):s(e),t.$$.on_mount=[]})),u.forEach(O)}function tt(t,e){const n=t.$$;null!==n.fragment&&(s(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function et(t,e){-1===t.$$.dirty[0]&&(M.push(t),N||(N=!0,F.then(C)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function nt(t,n,r,o,i,l,a,u=[-1]){const d=I;A(t);const f=t.$$={fragment:null,ctx:null,props:l,update:e,not_equal:i,bound:c(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(n.context||(d?d.$$.context:[])),callbacks:c(),dirty:u,skip_bound:!1,root:n.target||d.$$.root};a&&a(f.root);let p=!1;if(f.ctx=r?r(t,n.props||{},((e,n,...r)=>{const o=r.length?r[0]:n;return f.ctx&&i(f.ctx[e],f.ctx[e]=o)&&(!f.skip_bound&&f.bound[e]&&f.bound[e](o),p&&et(t,e)),n})):[],f.update(),p=!0,s(f.before_update),f.fragment=!!o&&o(f.ctx),n.target){if(n.hydrate){const t=function(t){return Array.from(t.childNodes)}(n.target);f.fragment&&f.fragment.l(t),t.forEach(y)}else f.fragment&&f.fragment.c();n.intro&&J(t.$$.fragment),Z(t,n.target,n.anchor,n.customElement),C()}A(d)}class rt{$destroy(){tt(this,1),this.$destroy=e}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}function ot(t){const e=t-1;return e*e*e+1}function ct(t,{delay:e=0,duration:n=400,easing:r=ot}={}){const o=getComputedStyle(t),c=+o.opacity,s=parseFloat(o.height),i=parseFloat(o.paddingTop),l=parseFloat(o.paddingBottom),a=parseFloat(o.marginTop),u=parseFloat(o.marginBottom),d=parseFloat(o.borderTopWidth),f=parseFloat(o.borderBottomWidth);return{delay:e,duration:n,easing:r,css:t=>`overflow: hidden;opacity: ${Math.min(20*t,1)*c};height: ${t*s}px;padding-top: ${t*i}px;padding-bottom: ${t*l}px;margin-top: ${t*a}px;margin-bottom: ${t*u}px;border-top-width: ${t*d}px;border-bottom-width: ${t*f}px;`}}function st(t){let e;function n(t,e){return t[0].lastState.wasAttackedBy===t[1].id&&t[1].lastState.wasAttackedBy===t[0].id?lt:it}let r=n(t),o=r(t);return{c(){e=w("span"),o.c()},m(t,n){g(t,e,n),o.m(e,null)},p(t,c){r===(r=n(t))&&o?o.p(t,c):(o.d(1),o=r(t),o&&(o.c(),o.m(e,null)))},d(t){t&&y(e),o.d()}}}function it(t){let e,n,r,o,c,s,i,l,a,u,d,f=t[0].crew.name+"",p=t[0].unitIndex+1+"",$=t[1].crew.name+"",h=t[1].unitIndex+1+"";return{c(){e=w("span"),n=b(f),r=b(" #"),o=b(p),s=b("\n killed\n "),i=w("span"),l=b($),a=b(" #"),u=b(h),k(e,"class",c="player-"+(t[0].crewIndex+1)+" svelte-buclr5"),k(i,"class",d="player-"+(t[1].crewIndex+1)+" svelte-buclr5")},m(t,c){g(t,e,c),m(e,n),m(e,r),m(e,o),g(t,s,c),g(t,i,c),m(i,l),m(i,a),m(i,u)},p(t,r){1&r&&f!==(f=t[0].crew.name+"")&&v(n,f),1&r&&p!==(p=t[0].unitIndex+1+"")&&v(o,p),1&r&&c!==(c="player-"+(t[0].crewIndex+1)+" svelte-buclr5")&&k(e,"class",c),2&r&&$!==($=t[1].crew.name+"")&&v(l,$),2&r&&h!==(h=t[1].unitIndex+1+"")&&v(u,h),2&r&&d!==(d="player-"+(t[1].crewIndex+1)+" svelte-buclr5")&&k(i,"class",d)},d(t){t&&y(e),t&&y(s),t&&y(i)}}}function lt(t){let e,n,r,o,c,s,i,l,a,u,d,f,p,$,h=t[0].crew.name+"",_=t[0].unitIndex+1+"",I=t[1].crew.name+"",S=t[1].unitIndex+1+"",E=!t[0].hasSpawned&&at(t),U=!t[1].hasSpawned&&ut(t);return{c(){e=w("span"),n=b(h),r=b(" #"),o=b(_),s=b("\n and\n "),i=w("span"),l=b(I),a=b(" #"),u=b(S),f=b("\n\n both attacked.\n Only\n "),E&&E.c(),p=x(),U&&U.c(),$=b("\n survived"),k(e,"class",c="player-"+(t[0].crewIndex+1)+" svelte-buclr5"),k(i,"class",d="player-"+(t[1].crewIndex+1)+" svelte-buclr5")},m(t,c){g(t,e,c),m(e,n),m(e,r),m(e,o),g(t,s,c),g(t,i,c),m(i,l),m(i,a),m(i,u),g(t,f,c),E&&E.m(t,c),g(t,p,c),U&&U.m(t,c),g(t,$,c)},p(t,r){1&r&&h!==(h=t[0].crew.name+"")&&v(n,h),1&r&&_!==(_=t[0].unitIndex+1+"")&&v(o,_),1&r&&c!==(c="player-"+(t[0].crewIndex+1)+" svelte-buclr5")&&k(e,"class",c),2&r&&I!==(I=t[1].crew.name+"")&&v(l,I),2&r&&S!==(S=t[1].unitIndex+1+"")&&v(u,S),2&r&&d!==(d="player-"+(t[1].crewIndex+1)+" svelte-buclr5")&&k(i,"class",d),t[0].hasSpawned?E&&(E.d(1),E=null):E?E.p(t,r):(E=at(t),E.c(),E.m(p.parentNode,p)),t[1].hasSpawned?U&&(U.d(1),U=null):U?U.p(t,r):(U=ut(t),U.c(),U.m($.parentNode,$))},d(t){t&&y(e),t&&y(s),t&&y(i),t&&y(f),E&&E.d(t),t&&y(p),U&&U.d(t),t&&y($)}}}function at(t){let e,n,r,o,c,s=t[1].crew.name+"",i=t[1].unitIndex+1+"";return{c(){e=w("span"),n=b(s),r=b(" #"),o=b(i),k(e,"class",c="player-"+(t[1].crewIndex+1)+" svelte-buclr5")},m(t,c){g(t,e,c),m(e,n),m(e,r),m(e,o)},p(t,r){2&r&&s!==(s=t[1].crew.name+"")&&v(n,s),2&r&&i!==(i=t[1].unitIndex+1+"")&&v(o,i),2&r&&c!==(c="player-"+(t[1].crewIndex+1)+" svelte-buclr5")&&k(e,"class",c)},d(t){t&&y(e)}}}function ut(t){let e,n,r,o,c,s=t[0].crew.name+"",i=t[0].unitIndex+1+"";return{c(){e=w("span"),n=b(s),r=b(" #"),o=b(i),k(e,"class",c="player-"+(t[0].crewIndex+1)+" svelte-buclr5")},m(t,c){g(t,e,c),m(e,n),m(e,r),m(e,o)},p(t,r){1&r&&s!==(s=t[0].crew.name+"")&&v(n,s),1&r&&i!==(i=t[0].unitIndex+1+"")&&v(o,i),1&r&&c!==(c="player-"+(t[0].crewIndex+1)+" svelte-buclr5")&&k(e,"class",c)},d(t){t&&y(e)}}}function dt(t){let n,r=t[0]&&t[1]&&st(t);return{c(){r&&r.c(),n=b("")},m(t,e){r&&r.m(t,e),g(t,n,e)},p(t,[e]){t[0]&&t[1]?r?r.p(t,e):(r=st(t),r.c(),r.m(n.parentNode,n)):r&&(r.d(1),r=null)},i:e,o:e,d(t){r&&r.d(t),t&&y(n)}}}function ft(t,e,n){let{attackingUnit:r}=e,{receivingUnit:o}=e;return t.$$set=t=>{"attackingUnit"in t&&n(0,r=t.attackingUnit),"receivingUnit"in t&&n(1,o=t.receivingUnit)},[r,o]}class pt extends rt{constructor(t){super(),nt(this,t,ft,dt,l,{attackingUnit:0,receivingUnit:1})}}function mt(t,e,n){const r=t.slice();return r[4]=e[n].component,r[5]=e[n].componentProps,r[6]=e[n].tick,r[7]=e[n].key,r}function $t(t,e){let n,o,c,s,i,l,a,u,d,f=e[6]+1+"";const p=[e[5]];var $=e[4];function h(t){let e={};for(let t=0;t<p.length;t+=1)e=r(e,p[t]);return{props:e}}return $&&(l=new $(h())),{key:t,first:null,c(){n=w("div"),o=w("span"),c=b(f),s=b(" -"),i=x(),l&&Y(l.$$.fragment),a=x(),k(n,"class","bubble svelte-ba1z86"),this.first=n},m(t,e){g(t,n,e),m(n,o),m(o,c),m(o,s),m(n,i),l&&Z(l,n,null),m(n,a),d=!0},p(t,r){e=t,(!d||1&r)&&f!==(f=e[6]+1+"")&&v(c,f);const o=1&r?function(t,e){const n={},r={},o={$$scope:1};let c=t.length;for(;c--;){const s=t[c],i=e[c];if(i){for(const t in s)t in i||(r[t]=1);for(const t in i)o[t]||(n[t]=i[t],o[t]=1);t[c]=i}else for(const t in s)o[t]=1}for(const t in r)t in n||(n[t]=void 0);return n}(p,[(s=e[5],"object"==typeof s&&null!==s?s:{})]):{};var s;if($!==($=e[4])){if(l){G();const t=l;K(t.$$.fragment,1,0,(()=>{tt(t,1)})),H()}$?(l=new $(h()),Y(l.$$.fragment),J(l.$$.fragment,1),Z(l,n,a)):l=null}else $&&l.$set(o)},i(t){d||(l&&J(l.$$.fragment,t),O((()=>{u||(u=Q(n,ct,{},!0)),u.run(1)})),d=!0)},o(t){l&&K(l.$$.fragment,t),u||(u=Q(n,ct,{},!1)),u.run(0),d=!1},d(t){t&&y(n),l&&tt(l),t&&u&&u.end()}}}function ht(t){let e,n,r=[],o=new Map,c=t[0];const s=t=>t[7];for(let e=0;e<c.length;e+=1){let n=mt(t,c,e),i=s(n);o.set(i,r[e]=$t(i,n))}return{c(){e=w("div");for(let t=0;t<r.length;t+=1)r[t].c()},m(t,o){g(t,e,o);for(let t=0;t<r.length;t+=1)r[t].m(e,null);n=!0},p(t,[n]){1&n&&(c=t[0],G(),r=function(t,e,n,r,o,c,s,i,l,a,u,d){let f=t.length,p=c.length,m=f;const $={};for(;m--;)$[t[m].key]=m;const h=[],g=new Map,y=new Map;for(m=p;m--;){const t=d(o,c,m),i=n(t);let l=s.get(i);l?r&&l.p(t,e):(l=a(i,t),l.c()),g.set(i,h[m]=l),i in $&&y.set(i,Math.abs(m-$[i]))}const w=new Set,b=new Set;function x(t){J(t,1),t.m(i,u),s.set(t.key,t),u=t.first,p--}for(;f&&p;){const e=h[p-1],n=t[f-1],r=e.key,o=n.key;e===n?(u=e.first,f--,p--):g.has(o)?!s.has(r)||w.has(r)?x(e):b.has(o)?f--:y.get(r)>y.get(o)?(b.add(r),x(e)):(w.add(o),f--):(l(n,s),f--)}for(;f--;){const e=t[f];g.has(e.key)||l(e,s)}for(;p;)x(h[p-1]);return h}(r,n,s,1,t,c,o,e,X,$t,null,mt),H())},i(t){if(!n){for(let t=0;t<c.length;t+=1)J(r[t]);n=!0}},o(t){for(let t=0;t<r.length;t+=1)K(r[t]);n=!1},d(t){t&&y(e);for(let t=0;t<r.length;t+=1)r[t].d()}}}function gt(t,e,n){let r,o,{ticks:c}=e,{tickIndex:s}=e;return t.$$set=t=>{"ticks"in t&&n(1,c=t.ticks),"tickIndex"in t&&n(2,s=t.tickIndex)},t.$$.update=()=>{6&t.$$.dirty&&n(3,r=((t,e)=>{if(!t)return[];const n=[];return t.slice(Math.max(0,e-50),e).forEach((t=>{const e=[];Object.values(t.allUnitsPerId).filter((t=>!!t.lastState.wasAttackedBy)).forEach((r=>{const o=t.allUnitsPerId[r.lastState.wasAttackedBy];e.some((t=>t===r.id))||(n.push({component:pt,componentProps:{attackingUnit:o,receivingUnit:r},tick:t.tick,key:t.tick+"-"+r.id}),e.push(o.id))}))})),n})(c,s)),8&t.$$.dirty&&n(0,o=r.slice(-5))},[o,c,s,r]}class yt extends rt{constructor(t){super(),nt(this,t,gt,ht,l,{ticks:1,tickIndex:2})}}const wt=t=>{const e=t.crews.map((({units:t,...e},n)=>({...e,units:t.map(((t,r)=>({...t,crew:e,crewIndex:n,unitIndex:r})))})));return{...t,crews:e,allUnitsPerId:e.flatMap((t=>t.units)).reduce(((t,e)=>({...t,[e.id]:e})),{})}};function bt(t){let e,n;return e=new yt({props:{ticks:t[1],tickIndex:t[0]}}),{c(){Y(e.$$.fragment)},m(t,r){Z(e,t,r),n=!0},p(t,[n]){const r={};2&n&&(r.ticks=t[1]),1&n&&(r.tickIndex=t[0]),e.$set(r)},i(t){n||(J(e.$$.fragment,t),n=!0)},o(t){K(e.$$.fragment,t),n=!1},d(t){tt(e,t)}}}function xt(t,e,n){let r,{ticks:o}=e,{currentTick:c=0}=e;return setInterval((()=>n(0,c+=1)),1e3),t.$$set=t=>{"ticks"in t&&n(2,o=t.ticks),"currentTick"in t&&n(0,c=t.currentTick)},t.$$.update=()=>{4&t.$$.dirty&&n(1,r=o.map(wt))},[c,r,o]}return t.BlitzViz=class extends rt{constructor(t){super(),nt(this,t,xt,bt,l,{ticks:2,currentTick:0})}},Object.defineProperty(t,"__esModule",{value:!0}),t}({});
//# sourceMappingURL=index.iife.min.js.map

@@ -1,2 +0,2 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).blitzui={})}(this,(function(t){"use strict";function e(){}const n=t=>t;function r(t,e){for(const n in e)t[n]=e[n];return t}function o(t){return t()}function c(){return Object.create(null)}function s(t){t.forEach(o)}function i(t){return"function"==typeof t}function l(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}const a="undefined"!=typeof window;let u=a?()=>window.performance.now():()=>Date.now(),d=a?t=>requestAnimationFrame(t):e;const f=new Set;function p(t){f.forEach((e=>{e.c(t)||(f.delete(e),e.f())})),0!==f.size&&d(p)}function m(t,e){t.appendChild(e)}function h(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function $(t){const e=w("style");return function(t,e){m(t.head||t,e)}(h(t),e),e}function g(t,e,n){t.insertBefore(e,n||null)}function y(t){t.parentNode.removeChild(t)}function w(t){return document.createElement(t)}function b(t){return document.createTextNode(t)}function x(){return b(" ")}function k(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function v(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}const _=new Set;let I,S=0;function E(t,e,n,r,o,c,s,i=0){const l=16.666/r;let a="{\n";for(let t=0;t<=1;t+=l){const r=e+(n-e)*c(t);a+=100*t+`%{${s(r,1-r)}}\n`}const u=a+`100% {${s(n,1-n)}}\n}`,d=`__svelte_${function(t){let e=5381,n=t.length;for(;n--;)e=(e<<5)-e^t.charCodeAt(n);return e>>>0}(u)}_${i}`,f=h(t);_.add(f);const p=f.__svelte_stylesheet||(f.__svelte_stylesheet=$(t).sheet),m=f.__svelte_rules||(f.__svelte_rules={});m[d]||(m[d]=!0,p.insertRule(`@keyframes ${d} ${u}`,p.cssRules.length));const g=t.style.animation||"";return t.style.animation=`${g?`${g}, `:""}${d} ${r}ms linear ${o}ms 1 both`,S+=1,d}function U(t,e){const n=(t.style.animation||"").split(", "),r=n.filter(e?t=>t.indexOf(e)<0:t=>-1===t.indexOf("__svelte")),o=n.length-r.length;o&&(t.style.animation=r.join(", "),S-=o,S||d((()=>{S||(_.forEach((t=>{const e=t.__svelte_stylesheet;let n=e.cssRules.length;for(;n--;)e.deleteRule(n);t.__svelte_rules={}})),_.clear())})))}function T(t){I=t}const A=[],M=[],B=[],P=[],j=Promise.resolve();let F=!1;function N(t){B.push(t)}let O=!1;const z=new Set;function C(){if(!O){O=!0;do{for(let t=0;t<A.length;t+=1){const e=A[t];T(e),R(e.$$)}for(T(null),A.length=0;M.length;)M.pop()();for(let t=0;t<B.length;t+=1){const e=B[t];z.has(e)||(z.add(e),e())}B.length=0}while(A.length);for(;P.length;)P.pop()();F=!1,O=!1,z.clear()}}function R(t){if(null!==t.fragment){t.update(),s(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(N)}}let D;function q(t,e,n){t.dispatchEvent(function(t,e,n=!1){const r=document.createEvent("CustomEvent");return r.initCustomEvent(t,n,!1,e),r}(`${e?"intro":"outro"}${n}`))}const W=new Set;let V;function G(){V={r:0,c:[],p:V}}function H(){V.r||s(V.c),V=V.p}function J(t,e){t&&t.i&&(W.delete(t),t.i(e))}function K(t,e,n,r){if(t&&t.o){if(W.has(t))return;W.add(t),V.c.push((()=>{W.delete(t),r&&(n&&t.d(1),r())})),t.o(e)}}const L={duration:0};function Q(t,r,o,c){let l=r(t,o),a=c?0:1,m=null,h=null,$=null;function g(){$&&U(t,$)}function y(t,e){const n=t.b-a;return e*=Math.abs(n),{a:a,b:t.b,d:n,duration:e,start:t.start,end:t.start+e,group:t.group}}function w(r){const{delay:o=0,duration:c=300,easing:i=n,tick:w=e,css:b}=l||L,x={start:u()+o,b:r};r||(x.group=V,V.r+=1),m||h?h=x:(b&&(g(),$=E(t,a,r,c,o,i,b)),r&&w(0,1),m=y(x,c),N((()=>q(t,r,"start"))),function(t){let e;0===f.size&&d(p),new Promise((n=>{f.add(e={c:t,f:n})}))}((e=>{if(h&&e>h.start&&(m=y(h,c),h=null,q(t,m.b,"start"),b&&(g(),$=E(t,a,m.b,m.duration,0,i,l.css))),m)if(e>=m.end)w(a=m.b,1-a),q(t,m.b,"end"),h||(m.b?g():--m.group.r||s(m.group.c)),m=null;else if(e>=m.start){const t=e-m.start;a=m.a+m.d*i(t/m.duration),w(a,1-a)}return!(!m&&!h)})))}return{run(t){i(l)?(D||(D=Promise.resolve(),D.then((()=>{D=null}))),D).then((()=>{l=l(),w(t)})):w(t)},end(){g(),m=h=null}}}function X(t,e){K(t,1,1,(()=>{e.delete(t.key)}))}function Y(t){t&&t.c()}function Z(t,e,n,r){const{fragment:c,on_mount:l,on_destroy:a,after_update:u}=t.$$;c&&c.m(e,n),r||N((()=>{const e=l.map(o).filter(i);a?a.push(...e):s(e),t.$$.on_mount=[]})),u.forEach(N)}function tt(t,e){const n=t.$$;null!==n.fragment&&(s(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function et(t,e){-1===t.$$.dirty[0]&&(A.push(t),F||(F=!0,j.then(C)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function nt(t,n,r,o,i,l,a,u=[-1]){const d=I;T(t);const f=t.$$={fragment:null,ctx:null,props:l,update:e,not_equal:i,bound:c(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(n.context||(d?d.$$.context:[])),callbacks:c(),dirty:u,skip_bound:!1,root:n.target||d.$$.root};a&&a(f.root);let p=!1;if(f.ctx=r?r(t,n.props||{},((e,n,...r)=>{const o=r.length?r[0]:n;return f.ctx&&i(f.ctx[e],f.ctx[e]=o)&&(!f.skip_bound&&f.bound[e]&&f.bound[e](o),p&&et(t,e)),n})):[],f.update(),p=!0,s(f.before_update),f.fragment=!!o&&o(f.ctx),n.target){if(n.hydrate){const t=function(t){return Array.from(t.childNodes)}(n.target);f.fragment&&f.fragment.l(t),t.forEach(y)}else f.fragment&&f.fragment.c();n.intro&&J(t.$$.fragment),Z(t,n.target,n.anchor,n.customElement),C()}T(d)}class rt{$destroy(){tt(this,1),this.$destroy=e}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}function ot(t){const e=t-1;return e*e*e+1}function ct(t,{delay:e=0,duration:n=400,easing:r=ot}={}){const o=getComputedStyle(t),c=+o.opacity,s=parseFloat(o.height),i=parseFloat(o.paddingTop),l=parseFloat(o.paddingBottom),a=parseFloat(o.marginTop),u=parseFloat(o.marginBottom),d=parseFloat(o.borderTopWidth),f=parseFloat(o.borderBottomWidth);return{delay:e,duration:n,easing:r,css:t=>`overflow: hidden;opacity: ${Math.min(20*t,1)*c};height: ${t*s}px;padding-top: ${t*i}px;padding-bottom: ${t*l}px;margin-top: ${t*a}px;margin-bottom: ${t*u}px;border-top-width: ${t*d}px;border-bottom-width: ${t*f}px;`}}function st(t){let e;function n(t,e){return t[0].lastState.wasAttackedBy===t[1].id&&t[1].lastState.wasAttackedBy===t[0].id?lt:it}let r=n(t),o=r(t);return{c(){e=w("span"),o.c()},m(t,n){g(t,e,n),o.m(e,null)},p(t,c){r===(r=n(t))&&o?o.p(t,c):(o.d(1),o=r(t),o&&(o.c(),o.m(e,null)))},d(t){t&&y(e),o.d()}}}function it(t){let e,n,r,o,c,s,i,l,a,u,d,f=t[0].crew.name+"",p=t[0].unitIndex+1+"",h=t[1].crew.name+"",$=t[1].unitIndex+1+"";return{c(){e=w("span"),n=b(f),r=b(" #"),o=b(p),s=b("\n killed\n "),i=w("span"),l=b(h),a=b(" #"),u=b($),k(e,"class",c="player-"+(t[0].crewIndex+1)+" svelte-buclr5"),k(i,"class",d="player-"+(t[1].crewIndex+1)+" svelte-buclr5")},m(t,c){g(t,e,c),m(e,n),m(e,r),m(e,o),g(t,s,c),g(t,i,c),m(i,l),m(i,a),m(i,u)},p(t,r){1&r&&f!==(f=t[0].crew.name+"")&&v(n,f),1&r&&p!==(p=t[0].unitIndex+1+"")&&v(o,p),1&r&&c!==(c="player-"+(t[0].crewIndex+1)+" svelte-buclr5")&&k(e,"class",c),2&r&&h!==(h=t[1].crew.name+"")&&v(l,h),2&r&&$!==($=t[1].unitIndex+1+"")&&v(u,$),2&r&&d!==(d="player-"+(t[1].crewIndex+1)+" svelte-buclr5")&&k(i,"class",d)},d(t){t&&y(e),t&&y(s),t&&y(i)}}}function lt(t){let e,n,r,o,c,s,i,l,a,u,d,f,p,h,$=t[0].crew.name+"",_=t[0].unitIndex+1+"",I=t[1].crew.name+"",S=t[1].unitIndex+1+"",E=!t[0].hasSpawned&&at(t),U=!t[1].hasSpawned&&ut(t);return{c(){e=w("span"),n=b($),r=b(" #"),o=b(_),s=b("\n and\n "),i=w("span"),l=b(I),a=b(" #"),u=b(S),f=b("\n\n both attacked.\n Only\n "),E&&E.c(),p=x(),U&&U.c(),h=b("\n survived"),k(e,"class",c="player-"+(t[0].crewIndex+1)+" svelte-buclr5"),k(i,"class",d="player-"+(t[1].crewIndex+1)+" svelte-buclr5")},m(t,c){g(t,e,c),m(e,n),m(e,r),m(e,o),g(t,s,c),g(t,i,c),m(i,l),m(i,a),m(i,u),g(t,f,c),E&&E.m(t,c),g(t,p,c),U&&U.m(t,c),g(t,h,c)},p(t,r){1&r&&$!==($=t[0].crew.name+"")&&v(n,$),1&r&&_!==(_=t[0].unitIndex+1+"")&&v(o,_),1&r&&c!==(c="player-"+(t[0].crewIndex+1)+" svelte-buclr5")&&k(e,"class",c),2&r&&I!==(I=t[1].crew.name+"")&&v(l,I),2&r&&S!==(S=t[1].unitIndex+1+"")&&v(u,S),2&r&&d!==(d="player-"+(t[1].crewIndex+1)+" svelte-buclr5")&&k(i,"class",d),t[0].hasSpawned?E&&(E.d(1),E=null):E?E.p(t,r):(E=at(t),E.c(),E.m(p.parentNode,p)),t[1].hasSpawned?U&&(U.d(1),U=null):U?U.p(t,r):(U=ut(t),U.c(),U.m(h.parentNode,h))},d(t){t&&y(e),t&&y(s),t&&y(i),t&&y(f),E&&E.d(t),t&&y(p),U&&U.d(t),t&&y(h)}}}function at(t){let e,n,r,o,c,s=t[1].crew.name+"",i=t[1].unitIndex+1+"";return{c(){e=w("span"),n=b(s),r=b(" #"),o=b(i),k(e,"class",c="player-"+(t[1].crewIndex+1)+" svelte-buclr5")},m(t,c){g(t,e,c),m(e,n),m(e,r),m(e,o)},p(t,r){2&r&&s!==(s=t[1].crew.name+"")&&v(n,s),2&r&&i!==(i=t[1].unitIndex+1+"")&&v(o,i),2&r&&c!==(c="player-"+(t[1].crewIndex+1)+" svelte-buclr5")&&k(e,"class",c)},d(t){t&&y(e)}}}function ut(t){let e,n,r,o,c,s=t[0].crew.name+"",i=t[0].unitIndex+1+"";return{c(){e=w("span"),n=b(s),r=b(" #"),o=b(i),k(e,"class",c="player-"+(t[0].crewIndex+1)+" svelte-buclr5")},m(t,c){g(t,e,c),m(e,n),m(e,r),m(e,o)},p(t,r){1&r&&s!==(s=t[0].crew.name+"")&&v(n,s),1&r&&i!==(i=t[0].unitIndex+1+"")&&v(o,i),1&r&&c!==(c="player-"+(t[0].crewIndex+1)+" svelte-buclr5")&&k(e,"class",c)},d(t){t&&y(e)}}}function dt(t){let n,r=t[0]&&t[1]&&st(t);return{c(){r&&r.c(),n=b("")},m(t,e){r&&r.m(t,e),g(t,n,e)},p(t,[e]){t[0]&&t[1]?r?r.p(t,e):(r=st(t),r.c(),r.m(n.parentNode,n)):r&&(r.d(1),r=null)},i:e,o:e,d(t){r&&r.d(t),t&&y(n)}}}function ft(t,e,n){let{attackingUnit:r}=e,{receivingUnit:o}=e;return t.$$set=t=>{"attackingUnit"in t&&n(0,r=t.attackingUnit),"receivingUnit"in t&&n(1,o=t.receivingUnit)},[r,o]}class pt extends rt{constructor(t){super(),nt(this,t,ft,dt,l,{attackingUnit:0,receivingUnit:1})}}function mt(t,e,n){const r=t.slice();return r[4]=e[n].component,r[5]=e[n].componentProps,r[6]=e[n].tick,r[7]=e[n].key,r}function ht(t,e){let n,o,c,s,i,l,a,u,d,f=e[6]+1+"";const p=[e[5]];var h=e[4];function $(t){let e={};for(let t=0;t<p.length;t+=1)e=r(e,p[t]);return{props:e}}return h&&(l=new h($())),{key:t,first:null,c(){n=w("div"),o=w("span"),c=b(f),s=b(" -"),i=x(),l&&Y(l.$$.fragment),a=x(),k(n,"class","bubble svelte-ba1z86"),this.first=n},m(t,e){g(t,n,e),m(n,o),m(o,c),m(o,s),m(n,i),l&&Z(l,n,null),m(n,a),d=!0},p(t,r){e=t,(!d||1&r)&&f!==(f=e[6]+1+"")&&v(c,f);const o=1&r?function(t,e){const n={},r={},o={$$scope:1};let c=t.length;for(;c--;){const s=t[c],i=e[c];if(i){for(const t in s)t in i||(r[t]=1);for(const t in i)o[t]||(n[t]=i[t],o[t]=1);t[c]=i}else for(const t in s)o[t]=1}for(const t in r)t in n||(n[t]=void 0);return n}(p,[(s=e[5],"object"==typeof s&&null!==s?s:{})]):{};var s;if(h!==(h=e[4])){if(l){G();const t=l;K(t.$$.fragment,1,0,(()=>{tt(t,1)})),H()}h?(l=new h($()),Y(l.$$.fragment),J(l.$$.fragment,1),Z(l,n,a)):l=null}else h&&l.$set(o)},i(t){d||(l&&J(l.$$.fragment,t),N((()=>{u||(u=Q(n,ct,{},!0)),u.run(1)})),d=!0)},o(t){l&&K(l.$$.fragment,t),u||(u=Q(n,ct,{},!1)),u.run(0),d=!1},d(t){t&&y(n),l&&tt(l),t&&u&&u.end()}}}function $t(t){let e,n,r=[],o=new Map,c=t[0];const s=t=>t[7];for(let e=0;e<c.length;e+=1){let n=mt(t,c,e),i=s(n);o.set(i,r[e]=ht(i,n))}return{c(){e=w("div");for(let t=0;t<r.length;t+=1)r[t].c()},m(t,o){g(t,e,o);for(let t=0;t<r.length;t+=1)r[t].m(e,null);n=!0},p(t,[n]){1&n&&(c=t[0],G(),r=function(t,e,n,r,o,c,s,i,l,a,u,d){let f=t.length,p=c.length,m=f;const h={};for(;m--;)h[t[m].key]=m;const $=[],g=new Map,y=new Map;for(m=p;m--;){const t=d(o,c,m),i=n(t);let l=s.get(i);l?r&&l.p(t,e):(l=a(i,t),l.c()),g.set(i,$[m]=l),i in h&&y.set(i,Math.abs(m-h[i]))}const w=new Set,b=new Set;function x(t){J(t,1),t.m(i,u),s.set(t.key,t),u=t.first,p--}for(;f&&p;){const e=$[p-1],n=t[f-1],r=e.key,o=n.key;e===n?(u=e.first,f--,p--):g.has(o)?!s.has(r)||w.has(r)?x(e):b.has(o)?f--:y.get(r)>y.get(o)?(b.add(r),x(e)):(w.add(o),f--):(l(n,s),f--)}for(;f--;){const e=t[f];g.has(e.key)||l(e,s)}for(;p;)x($[p-1]);return $}(r,n,s,1,t,c,o,e,X,ht,null,mt),H())},i(t){if(!n){for(let t=0;t<c.length;t+=1)J(r[t]);n=!0}},o(t){for(let t=0;t<r.length;t+=1)K(r[t]);n=!1},d(t){t&&y(e);for(let t=0;t<r.length;t+=1)r[t].d()}}}function gt(t,e,n){let r,o,{ticks:c}=e,{tickIndex:s}=e;return t.$$set=t=>{"ticks"in t&&n(1,c=t.ticks),"tickIndex"in t&&n(2,s=t.tickIndex)},t.$$.update=()=>{6&t.$$.dirty&&n(3,r=((t,e)=>{if(!t)return[];const n=[];return t.slice(Math.max(0,e-50),e).forEach((t=>{const e=[];Object.values(t.allUnitsPerId).filter((t=>!!t.lastState.wasAttackedBy)).forEach((r=>{const o=t.allUnitsPerId[r.lastState.wasAttackedBy];e.some((t=>t===r.id))||(n.push({component:pt,componentProps:{attackingUnit:o,receivingUnit:r},tick:t.tick,key:t.tick+"-"+r.id}),e.push(o.id))}))})),n})(c,s)),8&t.$$.dirty&&n(0,o=r.slice(-5))},[o,c,s,r]}class yt extends rt{constructor(t){super(),nt(this,t,gt,$t,l,{ticks:1,tickIndex:2})}}const wt=t=>{const e=t.crews.map((({units:t,...e},n)=>({...e,units:t.map(((t,r)=>({...t,crew:e,crewIndex:n,unitIndex:r})))})));return{...t,crews:e,allUnitsPerId:e.flatMap((t=>t.units)).reduce(((t,e)=>({...t,[e.id]:e})),{})}};function bt(t){let e,n;return e=new yt({props:{ticks:t[0],tickIndex:0}}),{c(){Y(e.$$.fragment)},m(t,r){Z(e,t,r),n=!0},p(t,[n]){const r={};1&n&&(r.ticks=t[0]),e.$set(r)},i(t){n||(J(e.$$.fragment,t),n=!0)},o(t){K(e.$$.fragment,t),n=!1},d(t){tt(e,t)}}}function xt(t,e,n){let r,{ticks:o}=e,{currentTick:c=0}=e;return setInterval((()=>n(1,c+=1)),1e3),t.$$set=t=>{"ticks"in t&&n(2,o=t.ticks),"currentTick"in t&&n(1,c=t.currentTick)},t.$$.update=()=>{4&t.$$.dirty&&n(0,r=o.map(wt))},[r,c,o]}t.BlitzViz=class extends rt{constructor(t){super(),nt(this,t,xt,bt,l,{ticks:2,currentTick:1})}},Object.defineProperty(t,"__esModule",{value:!0})}));
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).blitzui={})}(this,(function(t){"use strict";function e(){}const n=t=>t;function r(t,e){for(const n in e)t[n]=e[n];return t}function o(t){return t()}function c(){return Object.create(null)}function s(t){t.forEach(o)}function i(t){return"function"==typeof t}function l(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}const a="undefined"!=typeof window;let u=a?()=>window.performance.now():()=>Date.now(),d=a?t=>requestAnimationFrame(t):e;const f=new Set;function p(t){f.forEach((e=>{e.c(t)||(f.delete(e),e.f())})),0!==f.size&&d(p)}function m(t,e){t.appendChild(e)}function h(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function $(t){const e=w("style");return function(t,e){m(t.head||t,e)}(h(t),e),e}function g(t,e,n){t.insertBefore(e,n||null)}function y(t){t.parentNode.removeChild(t)}function w(t){return document.createElement(t)}function b(t){return document.createTextNode(t)}function x(){return b(" ")}function k(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function v(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}const _=new Set;let I,S=0;function E(t,e,n,r,o,c,s,i=0){const l=16.666/r;let a="{\n";for(let t=0;t<=1;t+=l){const r=e+(n-e)*c(t);a+=100*t+`%{${s(r,1-r)}}\n`}const u=a+`100% {${s(n,1-n)}}\n}`,d=`__svelte_${function(t){let e=5381,n=t.length;for(;n--;)e=(e<<5)-e^t.charCodeAt(n);return e>>>0}(u)}_${i}`,f=h(t);_.add(f);const p=f.__svelte_stylesheet||(f.__svelte_stylesheet=$(t).sheet),m=f.__svelte_rules||(f.__svelte_rules={});m[d]||(m[d]=!0,p.insertRule(`@keyframes ${d} ${u}`,p.cssRules.length));const g=t.style.animation||"";return t.style.animation=`${g?`${g}, `:""}${d} ${r}ms linear ${o}ms 1 both`,S+=1,d}function U(t,e){const n=(t.style.animation||"").split(", "),r=n.filter(e?t=>t.indexOf(e)<0:t=>-1===t.indexOf("__svelte")),o=n.length-r.length;o&&(t.style.animation=r.join(", "),S-=o,S||d((()=>{S||(_.forEach((t=>{const e=t.__svelte_stylesheet;let n=e.cssRules.length;for(;n--;)e.deleteRule(n);t.__svelte_rules={}})),_.clear())})))}function T(t){I=t}const A=[],M=[],B=[],P=[],j=Promise.resolve();let F=!1;function N(t){B.push(t)}let O=!1;const z=new Set;function C(){if(!O){O=!0;do{for(let t=0;t<A.length;t+=1){const e=A[t];T(e),R(e.$$)}for(T(null),A.length=0;M.length;)M.pop()();for(let t=0;t<B.length;t+=1){const e=B[t];z.has(e)||(z.add(e),e())}B.length=0}while(A.length);for(;P.length;)P.pop()();F=!1,O=!1,z.clear()}}function R(t){if(null!==t.fragment){t.update(),s(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(N)}}let D;function q(t,e,n){t.dispatchEvent(function(t,e,n=!1){const r=document.createEvent("CustomEvent");return r.initCustomEvent(t,n,!1,e),r}(`${e?"intro":"outro"}${n}`))}const W=new Set;let V;function G(){V={r:0,c:[],p:V}}function H(){V.r||s(V.c),V=V.p}function J(t,e){t&&t.i&&(W.delete(t),t.i(e))}function K(t,e,n,r){if(t&&t.o){if(W.has(t))return;W.add(t),V.c.push((()=>{W.delete(t),r&&(n&&t.d(1),r())})),t.o(e)}}const L={duration:0};function Q(t,r,o,c){let l=r(t,o),a=c?0:1,m=null,h=null,$=null;function g(){$&&U(t,$)}function y(t,e){const n=t.b-a;return e*=Math.abs(n),{a:a,b:t.b,d:n,duration:e,start:t.start,end:t.start+e,group:t.group}}function w(r){const{delay:o=0,duration:c=300,easing:i=n,tick:w=e,css:b}=l||L,x={start:u()+o,b:r};r||(x.group=V,V.r+=1),m||h?h=x:(b&&(g(),$=E(t,a,r,c,o,i,b)),r&&w(0,1),m=y(x,c),N((()=>q(t,r,"start"))),function(t){let e;0===f.size&&d(p),new Promise((n=>{f.add(e={c:t,f:n})}))}((e=>{if(h&&e>h.start&&(m=y(h,c),h=null,q(t,m.b,"start"),b&&(g(),$=E(t,a,m.b,m.duration,0,i,l.css))),m)if(e>=m.end)w(a=m.b,1-a),q(t,m.b,"end"),h||(m.b?g():--m.group.r||s(m.group.c)),m=null;else if(e>=m.start){const t=e-m.start;a=m.a+m.d*i(t/m.duration),w(a,1-a)}return!(!m&&!h)})))}return{run(t){i(l)?(D||(D=Promise.resolve(),D.then((()=>{D=null}))),D).then((()=>{l=l(),w(t)})):w(t)},end(){g(),m=h=null}}}function X(t,e){K(t,1,1,(()=>{e.delete(t.key)}))}function Y(t){t&&t.c()}function Z(t,e,n,r){const{fragment:c,on_mount:l,on_destroy:a,after_update:u}=t.$$;c&&c.m(e,n),r||N((()=>{const e=l.map(o).filter(i);a?a.push(...e):s(e),t.$$.on_mount=[]})),u.forEach(N)}function tt(t,e){const n=t.$$;null!==n.fragment&&(s(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function et(t,e){-1===t.$$.dirty[0]&&(A.push(t),F||(F=!0,j.then(C)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function nt(t,n,r,o,i,l,a,u=[-1]){const d=I;T(t);const f=t.$$={fragment:null,ctx:null,props:l,update:e,not_equal:i,bound:c(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(n.context||(d?d.$$.context:[])),callbacks:c(),dirty:u,skip_bound:!1,root:n.target||d.$$.root};a&&a(f.root);let p=!1;if(f.ctx=r?r(t,n.props||{},((e,n,...r)=>{const o=r.length?r[0]:n;return f.ctx&&i(f.ctx[e],f.ctx[e]=o)&&(!f.skip_bound&&f.bound[e]&&f.bound[e](o),p&&et(t,e)),n})):[],f.update(),p=!0,s(f.before_update),f.fragment=!!o&&o(f.ctx),n.target){if(n.hydrate){const t=function(t){return Array.from(t.childNodes)}(n.target);f.fragment&&f.fragment.l(t),t.forEach(y)}else f.fragment&&f.fragment.c();n.intro&&J(t.$$.fragment),Z(t,n.target,n.anchor,n.customElement),C()}T(d)}class rt{$destroy(){tt(this,1),this.$destroy=e}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}function ot(t){const e=t-1;return e*e*e+1}function ct(t,{delay:e=0,duration:n=400,easing:r=ot}={}){const o=getComputedStyle(t),c=+o.opacity,s=parseFloat(o.height),i=parseFloat(o.paddingTop),l=parseFloat(o.paddingBottom),a=parseFloat(o.marginTop),u=parseFloat(o.marginBottom),d=parseFloat(o.borderTopWidth),f=parseFloat(o.borderBottomWidth);return{delay:e,duration:n,easing:r,css:t=>`overflow: hidden;opacity: ${Math.min(20*t,1)*c};height: ${t*s}px;padding-top: ${t*i}px;padding-bottom: ${t*l}px;margin-top: ${t*a}px;margin-bottom: ${t*u}px;border-top-width: ${t*d}px;border-bottom-width: ${t*f}px;`}}function st(t){let e;function n(t,e){return t[0].lastState.wasAttackedBy===t[1].id&&t[1].lastState.wasAttackedBy===t[0].id?lt:it}let r=n(t),o=r(t);return{c(){e=w("span"),o.c()},m(t,n){g(t,e,n),o.m(e,null)},p(t,c){r===(r=n(t))&&o?o.p(t,c):(o.d(1),o=r(t),o&&(o.c(),o.m(e,null)))},d(t){t&&y(e),o.d()}}}function it(t){let e,n,r,o,c,s,i,l,a,u,d,f=t[0].crew.name+"",p=t[0].unitIndex+1+"",h=t[1].crew.name+"",$=t[1].unitIndex+1+"";return{c(){e=w("span"),n=b(f),r=b(" #"),o=b(p),s=b("\n killed\n "),i=w("span"),l=b(h),a=b(" #"),u=b($),k(e,"class",c="player-"+(t[0].crewIndex+1)+" svelte-buclr5"),k(i,"class",d="player-"+(t[1].crewIndex+1)+" svelte-buclr5")},m(t,c){g(t,e,c),m(e,n),m(e,r),m(e,o),g(t,s,c),g(t,i,c),m(i,l),m(i,a),m(i,u)},p(t,r){1&r&&f!==(f=t[0].crew.name+"")&&v(n,f),1&r&&p!==(p=t[0].unitIndex+1+"")&&v(o,p),1&r&&c!==(c="player-"+(t[0].crewIndex+1)+" svelte-buclr5")&&k(e,"class",c),2&r&&h!==(h=t[1].crew.name+"")&&v(l,h),2&r&&$!==($=t[1].unitIndex+1+"")&&v(u,$),2&r&&d!==(d="player-"+(t[1].crewIndex+1)+" svelte-buclr5")&&k(i,"class",d)},d(t){t&&y(e),t&&y(s),t&&y(i)}}}function lt(t){let e,n,r,o,c,s,i,l,a,u,d,f,p,h,$=t[0].crew.name+"",_=t[0].unitIndex+1+"",I=t[1].crew.name+"",S=t[1].unitIndex+1+"",E=!t[0].hasSpawned&&at(t),U=!t[1].hasSpawned&&ut(t);return{c(){e=w("span"),n=b($),r=b(" #"),o=b(_),s=b("\n and\n "),i=w("span"),l=b(I),a=b(" #"),u=b(S),f=b("\n\n both attacked.\n Only\n "),E&&E.c(),p=x(),U&&U.c(),h=b("\n survived"),k(e,"class",c="player-"+(t[0].crewIndex+1)+" svelte-buclr5"),k(i,"class",d="player-"+(t[1].crewIndex+1)+" svelte-buclr5")},m(t,c){g(t,e,c),m(e,n),m(e,r),m(e,o),g(t,s,c),g(t,i,c),m(i,l),m(i,a),m(i,u),g(t,f,c),E&&E.m(t,c),g(t,p,c),U&&U.m(t,c),g(t,h,c)},p(t,r){1&r&&$!==($=t[0].crew.name+"")&&v(n,$),1&r&&_!==(_=t[0].unitIndex+1+"")&&v(o,_),1&r&&c!==(c="player-"+(t[0].crewIndex+1)+" svelte-buclr5")&&k(e,"class",c),2&r&&I!==(I=t[1].crew.name+"")&&v(l,I),2&r&&S!==(S=t[1].unitIndex+1+"")&&v(u,S),2&r&&d!==(d="player-"+(t[1].crewIndex+1)+" svelte-buclr5")&&k(i,"class",d),t[0].hasSpawned?E&&(E.d(1),E=null):E?E.p(t,r):(E=at(t),E.c(),E.m(p.parentNode,p)),t[1].hasSpawned?U&&(U.d(1),U=null):U?U.p(t,r):(U=ut(t),U.c(),U.m(h.parentNode,h))},d(t){t&&y(e),t&&y(s),t&&y(i),t&&y(f),E&&E.d(t),t&&y(p),U&&U.d(t),t&&y(h)}}}function at(t){let e,n,r,o,c,s=t[1].crew.name+"",i=t[1].unitIndex+1+"";return{c(){e=w("span"),n=b(s),r=b(" #"),o=b(i),k(e,"class",c="player-"+(t[1].crewIndex+1)+" svelte-buclr5")},m(t,c){g(t,e,c),m(e,n),m(e,r),m(e,o)},p(t,r){2&r&&s!==(s=t[1].crew.name+"")&&v(n,s),2&r&&i!==(i=t[1].unitIndex+1+"")&&v(o,i),2&r&&c!==(c="player-"+(t[1].crewIndex+1)+" svelte-buclr5")&&k(e,"class",c)},d(t){t&&y(e)}}}function ut(t){let e,n,r,o,c,s=t[0].crew.name+"",i=t[0].unitIndex+1+"";return{c(){e=w("span"),n=b(s),r=b(" #"),o=b(i),k(e,"class",c="player-"+(t[0].crewIndex+1)+" svelte-buclr5")},m(t,c){g(t,e,c),m(e,n),m(e,r),m(e,o)},p(t,r){1&r&&s!==(s=t[0].crew.name+"")&&v(n,s),1&r&&i!==(i=t[0].unitIndex+1+"")&&v(o,i),1&r&&c!==(c="player-"+(t[0].crewIndex+1)+" svelte-buclr5")&&k(e,"class",c)},d(t){t&&y(e)}}}function dt(t){let n,r=t[0]&&t[1]&&st(t);return{c(){r&&r.c(),n=b("")},m(t,e){r&&r.m(t,e),g(t,n,e)},p(t,[e]){t[0]&&t[1]?r?r.p(t,e):(r=st(t),r.c(),r.m(n.parentNode,n)):r&&(r.d(1),r=null)},i:e,o:e,d(t){r&&r.d(t),t&&y(n)}}}function ft(t,e,n){let{attackingUnit:r}=e,{receivingUnit:o}=e;return t.$$set=t=>{"attackingUnit"in t&&n(0,r=t.attackingUnit),"receivingUnit"in t&&n(1,o=t.receivingUnit)},[r,o]}class pt extends rt{constructor(t){super(),nt(this,t,ft,dt,l,{attackingUnit:0,receivingUnit:1})}}function mt(t,e,n){const r=t.slice();return r[4]=e[n].component,r[5]=e[n].componentProps,r[6]=e[n].tick,r[7]=e[n].key,r}function ht(t,e){let n,o,c,s,i,l,a,u,d,f=e[6]+1+"";const p=[e[5]];var h=e[4];function $(t){let e={};for(let t=0;t<p.length;t+=1)e=r(e,p[t]);return{props:e}}return h&&(l=new h($())),{key:t,first:null,c(){n=w("div"),o=w("span"),c=b(f),s=b(" -"),i=x(),l&&Y(l.$$.fragment),a=x(),k(n,"class","bubble svelte-ba1z86"),this.first=n},m(t,e){g(t,n,e),m(n,o),m(o,c),m(o,s),m(n,i),l&&Z(l,n,null),m(n,a),d=!0},p(t,r){e=t,(!d||1&r)&&f!==(f=e[6]+1+"")&&v(c,f);const o=1&r?function(t,e){const n={},r={},o={$$scope:1};let c=t.length;for(;c--;){const s=t[c],i=e[c];if(i){for(const t in s)t in i||(r[t]=1);for(const t in i)o[t]||(n[t]=i[t],o[t]=1);t[c]=i}else for(const t in s)o[t]=1}for(const t in r)t in n||(n[t]=void 0);return n}(p,[(s=e[5],"object"==typeof s&&null!==s?s:{})]):{};var s;if(h!==(h=e[4])){if(l){G();const t=l;K(t.$$.fragment,1,0,(()=>{tt(t,1)})),H()}h?(l=new h($()),Y(l.$$.fragment),J(l.$$.fragment,1),Z(l,n,a)):l=null}else h&&l.$set(o)},i(t){d||(l&&J(l.$$.fragment,t),N((()=>{u||(u=Q(n,ct,{},!0)),u.run(1)})),d=!0)},o(t){l&&K(l.$$.fragment,t),u||(u=Q(n,ct,{},!1)),u.run(0),d=!1},d(t){t&&y(n),l&&tt(l),t&&u&&u.end()}}}function $t(t){let e,n,r=[],o=new Map,c=t[0];const s=t=>t[7];for(let e=0;e<c.length;e+=1){let n=mt(t,c,e),i=s(n);o.set(i,r[e]=ht(i,n))}return{c(){e=w("div");for(let t=0;t<r.length;t+=1)r[t].c()},m(t,o){g(t,e,o);for(let t=0;t<r.length;t+=1)r[t].m(e,null);n=!0},p(t,[n]){1&n&&(c=t[0],G(),r=function(t,e,n,r,o,c,s,i,l,a,u,d){let f=t.length,p=c.length,m=f;const h={};for(;m--;)h[t[m].key]=m;const $=[],g=new Map,y=new Map;for(m=p;m--;){const t=d(o,c,m),i=n(t);let l=s.get(i);l?r&&l.p(t,e):(l=a(i,t),l.c()),g.set(i,$[m]=l),i in h&&y.set(i,Math.abs(m-h[i]))}const w=new Set,b=new Set;function x(t){J(t,1),t.m(i,u),s.set(t.key,t),u=t.first,p--}for(;f&&p;){const e=$[p-1],n=t[f-1],r=e.key,o=n.key;e===n?(u=e.first,f--,p--):g.has(o)?!s.has(r)||w.has(r)?x(e):b.has(o)?f--:y.get(r)>y.get(o)?(b.add(r),x(e)):(w.add(o),f--):(l(n,s),f--)}for(;f--;){const e=t[f];g.has(e.key)||l(e,s)}for(;p;)x($[p-1]);return $}(r,n,s,1,t,c,o,e,X,ht,null,mt),H())},i(t){if(!n){for(let t=0;t<c.length;t+=1)J(r[t]);n=!0}},o(t){for(let t=0;t<r.length;t+=1)K(r[t]);n=!1},d(t){t&&y(e);for(let t=0;t<r.length;t+=1)r[t].d()}}}function gt(t,e,n){let r,o,{ticks:c}=e,{tickIndex:s}=e;return t.$$set=t=>{"ticks"in t&&n(1,c=t.ticks),"tickIndex"in t&&n(2,s=t.tickIndex)},t.$$.update=()=>{6&t.$$.dirty&&n(3,r=((t,e)=>{if(!t)return[];const n=[];return t.slice(Math.max(0,e-50),e).forEach((t=>{const e=[];Object.values(t.allUnitsPerId).filter((t=>!!t.lastState.wasAttackedBy)).forEach((r=>{const o=t.allUnitsPerId[r.lastState.wasAttackedBy];e.some((t=>t===r.id))||(n.push({component:pt,componentProps:{attackingUnit:o,receivingUnit:r},tick:t.tick,key:t.tick+"-"+r.id}),e.push(o.id))}))})),n})(c,s)),8&t.$$.dirty&&n(0,o=r.slice(-5))},[o,c,s,r]}class yt extends rt{constructor(t){super(),nt(this,t,gt,$t,l,{ticks:1,tickIndex:2})}}const wt=t=>{const e=t.crews.map((({units:t,...e},n)=>({...e,units:t.map(((t,r)=>({...t,crew:e,crewIndex:n,unitIndex:r})))})));return{...t,crews:e,allUnitsPerId:e.flatMap((t=>t.units)).reduce(((t,e)=>({...t,[e.id]:e})),{})}};function bt(t){let e,n;return e=new yt({props:{ticks:t[1],tickIndex:t[0]}}),{c(){Y(e.$$.fragment)},m(t,r){Z(e,t,r),n=!0},p(t,[n]){const r={};2&n&&(r.ticks=t[1]),1&n&&(r.tickIndex=t[0]),e.$set(r)},i(t){n||(J(e.$$.fragment,t),n=!0)},o(t){K(e.$$.fragment,t),n=!1},d(t){tt(e,t)}}}function xt(t,e,n){let r,{ticks:o}=e,{currentTick:c=0}=e;return setInterval((()=>n(0,c+=1)),1e3),t.$$set=t=>{"ticks"in t&&n(2,o=t.ticks),"currentTick"in t&&n(0,c=t.currentTick)},t.$$.update=()=>{4&t.$$.dirty&&n(1,r=o.map(wt))},[c,r,o]}t.BlitzViz=class extends rt{constructor(t){super(),nt(this,t,xt,bt,l,{ticks:2,currentTick:0})}},Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=index.umd.min.js.map
{
"name": "@coveord/blitz-ui-2022",
"version": "0.0.4",
"version": "0.0.5",
"module": "dist/index.es.min.js",

@@ -32,2 +32,4 @@ "scripts": {

"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.30.0",
"sveld": "^0.10.2",
"svelte": "^3.42.5",

@@ -34,0 +36,0 @@ "svelte-check": "^2.0.0",

import { createSocket } from '../sockets/socket';
import { writable } from 'svelte/store';
import { writable, get } from 'svelte/store';
import type { Tick } from '../../../../game/dist/game/types';
import { createHistory } from './history';
import type { EnhancedTick, EnhancedTickCrew } from '../../gametypings';
import type { EnhancedTick } from '../../gametypings';
import { enhanceTick } from '../ticks/ticksenhancer';

@@ -21,2 +21,3 @@

onClose: () => {
console.log(get(get(games).current).list);
isConnected.set(false);

@@ -23,0 +24,0 @@ },

@@ -5,3 +5,6 @@ {

"module": "es2020",
"lib": ["es2020", "DOM"],
"lib": [
"es2020",
"DOM"
],
"target": "es2019",

@@ -27,7 +30,22 @@ /**

"paths": {
"$lib": ["src/lib"],
"$lib/*": ["src/lib/*"]
}
"$lib": [
"src/lib"
],
"$lib/*": [
"src/lib/*"
]
},
"outDir": "dist",
"declaration": true,
"declarationDir": "."
},
"include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.ts", "src/**/*.svelte"]
}
"include": [
"src/**/*.d.ts",
"src/**/*.js",
"src/**/*.ts",
"src/**/*.svelte"
],
"exclude": [
"dist"
],
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc