@norbert_bodziony/bloub 0.2.0 → 0.2.1
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/README.md +4 -3
- package/dist/package/index.js +471 -473
- package/dist/package/server.js +1 -1
- package/dist/package/types/components/BloubBot.d.ts +1 -1
- package/package.json +6 -4
package/dist/package/server.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Dynamic as e,createComponent as t,escape as n,mergeProps as r,ssr as i,ssrAttribute as a,ssrHydrationKey as o,ssrStyle as s}from"solid-js/web";import{For as c,Show as l,createEffect as u,createMemo as d,createSignal as f,createUniqueId as p,mergeProps as m,on as h,onCleanup as g,onMount as _}from"solid-js";var v=Math.PI*2,y=(e,t=0,n=1)=>e<t?t:e>n?n:e,b=(e,t,n)=>e+(t-e)*n,x={easeOutCubic:e=>1-(1-e)**3,easeInOutCubic:e=>e<.5?4*e**3:1-(-2*e+2)**3/2,easeOutQuint:e=>1-(1-e)**5};function S(e,t,n=0){let r=e/t*v;return .55*Math.sin(r+n)+.3*Math.sin(2*r+n*1.7+1.1)+.15*Math.sin(3*r+n*2.3+2.4)}function C(e){let t=e>>>0;return()=>{t=t+1831565813>>>0;let e=Math.imul(t^t>>>15,1|t);return e=e+Math.imul(e^e>>>7,61|e)^e,((e^e>>>14)>>>0)/4294967296}}var w=e=>Math.round(e*100)/100;function T(e,t=.55,n=.62){let r=(e%360+360)%360,i=(1-Math.abs(2*n-1))*t,a=i*(1-Math.abs(r/60%2-1)),o=n-i/2,[s,c,l]=r<60?[i,a,0]:r<120?[a,i,0]:r<180?[0,i,a]:r<240?[0,a,i]:r<300?[a,0,i]:[i,0,a],u=e=>Math.round((e+o)*255).toString(16).padStart(2,`0`);return`#${u(s)}${u(c)}${u(l)}`}function ee(e,t,n,r,i=1){let a=e.phase+t*e.speed*v,o=Math.cos(e.tilt),s=Math.sin(e.tilt),c=Math.sqrt(Math.max(0,1-e.k*e.k)),l=e.sweep*v,u=``,d=``,f=null;for(let t=0;t<=64;t++){let r=a+t/64*l,i=Math.cos(r),p=Math.sin(r),m=e.a*(i*o+p*-s*e.k)+e.cx,h=e.a*(i*s+p*o*e.k)+e.cy,g=e.a*p*c<0,_=w(m*n),v=w(h*n),y=g===f?`L`:`M`;g?d+=`${y}${_} ${v}`:u+=`${y}${_} ${v}`,f=g}let p=Math.cos(e.tilt)*e.a*n,m=Math.sin(e.tilt)*e.a*n;return{id:r,front:u,back:d,width:e.width*n,opacity:i,grad:{x1:w(e.cx*n-p),y1:w(e.cy*n-m),x2:w(e.cx*n+p),y2:w(e.cy*n+m),stops:[T(e.hue),T(e.hue+e.hueSpan*.5),T(e.hue+e.hueSpan)]}}}var E=C(659918),D=Array.from({length:6},(e,t)=>({a:1.3+E()*.1,k:.05+E()*.4,tilt:t/6*Math.PI+E()*.5,speed:3+E()*.7,phase:E()*v,sweep:.6+E()*.25,hue:t*360/6+E()*30,hueSpan:60+E()*60,width:.05+E()*.012,cx:0,cy:.1})),O=Array.from({length:4},(e,t)=>({a:.78+t*.2,k:.05+t*.02,tilt:-.62+t*.05,speed:.3,phase:.06*t,sweep:.4,hue:95+t*62,hueSpan:100,width:.05,cx:0,cy:-.12})),te=[-.557,-.013,.532],k=.165,ne=1.25,re=C(48879),ie=Array.from({length:5},(e,t)=>({birth:t*.2,angle:re()*v,rho:.58+re()*.18}));function ae(e,t){let n=[];for(let r of ie){let i=e-r.birth;if(i<0||i>.62)continue;let a=r.rho*.75**(i*10),o=r.angle+i*100*Math.PI/180;n.push({x:Math.cos(o)*a*t,y:Math.sin(o)*a*t,r:(.04+.028*y(i/.55))*t,depth:y(1-a/.8),opacity:y(i/.06)*y((.62-i)/.08)})}return n}var oe=C(49383),A=Array.from({length:4},(e,t)=>{let n=t-1.5;return{a:.85*(1+n*.03),k:.15/.85*(1+n*.16),tilt:34*Math.PI/180+n*.035,speed:210/360,phase:-t*.045+oe()*.012,sweep:.34,hue:t*85+oe()*20,hueSpan:80,width:.095,cx:0,cy:0}}),j=.129,se=`#2496e8`,M=1.003,N=.15,ce=1.14,le=.054,P=15.46,F=.186,I=.412,L={yaw:28.49,pitch:28.62,roll:-13},R=e=>e*Math.PI/180;function z(e,t,n){let r=Math.cos(n),i=Math.sin(n);return[[e[0]*r+t[0]*i,e[1]*r+t[1]*i,e[2]*r+t[2]*i],[t[0]*r-e[0]*i,t[1]*r-e[1]*i,t[2]*r-e[2]*i]]}function B(e,t,n=P){let r=[0,0,1],i=[1,0,0],a=[0,1,0];[r,i]=z(r,i,R(e.yaw)),[a,r]=z(a,r,R(e.pitch)),[i,a]=z(i,a,R(e.roll));let o=e=>{let[o,s]=z(r,i,R(n*e));return{x:o[0]*t,y:o[1]*t,a:s[0],b:s[1],c:a[0],d:a[1],depth:o[2]}};return[o(-1),o(1)]}var ue=C(24301),de=(()=>{let e=[],t=1.4;for(;t<900;)e.push(t),t+=1.9+ue()*2.7,ue()<.18&&(e.push(t),t+=.24);return e})(),fe=.18;function pe(e){for(let t=0;t<de.length;t++){let n=de[t];if(e<n)break;let r=(e-n)/fe;if(r>=0&&r<=1)return r<.45?1-r/.45:(r-.45)/.55}return 1}function me(e,t={}){let{wander:n=1,blink:r=!0,float:i=!0}=t;return{dYaw:(S(e,11.3,.4)*5.5+S(e,3.7,2.1)*1.6)*n,dPitch:(S(e,9.1,1.3)*4.2+S(e,4.3,.7)*1.3)*n,dRoll:S(e,13.7,3.2)*2.2*n,lid:r?pe(e):1,driftX:i?S(e,7.9,1.9)*.006:0,driftY:i?S(e,5.3,.3)*.007:0,breath:i?1+Math.sin(e/3.4*Math.PI*2)*.005:1}}function he(e){return .06+.94*y(e)}var V=(e,t,n=0,r=1)=>({w:e,h:t,tilt:n,open:r}),H=(e,t,n=0,r=1)=>[V(e,t,n,r),V(e,t,-n,r)],U=[{id:`neutre`,gaze:{...L},split:P,eyes:[V(F,I),V(F,I)]},{id:`attentif`,gaze:{yaw:4,pitch:5,roll:-4},split:16,eyes:H(.21,.44)},{id:`surpris`,gaze:{yaw:3,pitch:-3,roll:0},split:19,eyes:H(.45,.47)},{id:`excite`,gaze:{yaw:6,pitch:-14,roll:0},split:19.5,eyes:H(.4,.56,-10)},{id:`heureux`,gaze:{yaw:5,pitch:9,roll:0},split:17,eyes:H(.27,.17,14)},{id:`hilare`,gaze:{yaw:4,pitch:14,roll:0},split:18,eyes:H(.34,.13,20)},{id:`colere`,gaze:{yaw:3,pitch:7,roll:0},split:17,eyes:H(.34,.15,30)},{id:`triste`,gaze:{yaw:3,pitch:-13,roll:0},split:16,eyes:H(.22,.4,-28)},{id:`effraye`,gaze:{yaw:2,pitch:-20,roll:0},split:20.5,eyes:H(.4,.6)},{id:`mefiant`,gaze:{yaw:12,pitch:6,roll:-6},split:16,eyes:[V(.21,.4),V(.22,.15)]},{id:`confus`,gaze:{yaw:-14,pitch:3,roll:8},split:16.5,eyes:[V(.2,.44,-18),V(.28,.17,14)]},{id:`curieux`,gaze:{yaw:16,pitch:-9,roll:-15},split:16.5,eyes:[V(.24,.46,-8),V(.2,.38,-8)]},{id:`fier`,gaze:{yaw:5,pitch:17,roll:0},split:17,eyes:H(.3,.15,18)},{id:`timide`,gaze:{yaw:-19,pitch:-14,roll:-7},split:14,eyes:H(.17,.3)},{id:`blase`,gaze:{yaw:-22,pitch:2,roll:0},split:16,eyes:H(.3,.12)},{id:`somnolent`,gaze:{yaw:6,pitch:-9,roll:-3},split:16,eyes:H(.2,.42,0,.42)}],ge=new Map(U.map(e=>[e.id,e])),_e=`neutre`,ve=(e,t,n)=>({w:b(e.w,t.w,n),h:b(e.h,t.h,n),tilt:b(e.tilt??0,t.tilt??0,n),open:b(e.open,t.open,n)});function ye(e,t,n){return{id:t.id,gaze:{yaw:b(e.gaze.yaw,t.gaze.yaw,n),pitch:b(e.gaze.pitch,t.gaze.pitch,n),roll:b(e.gaze.roll,t.gaze.roll,n)},split:b(e.split,t.split,n),eyes:[ve(e.eyes[0],t.eyes[0],n),ve(e.eyes[1],t.eyes[1],n)]}}var be={egg:[.8369,.8424,.8497,.8585,.8674,.8775,.8878,.8983,.9089,.9185,.9288,.9374,.9445,.9504,.9543,.9559,.9555,.9519,.9466,.9389,.9302,.9193,.9085,.8969,.8852,.8734,.8625,.8513,.8411,.8325,.8243,.8179,.8137,.8112,.8102,.8128,.8178,.8262,.8374,.8518,.8702,.8922,.9169,.9446,.9741,1.0023,1.0267,1.0433,1.0481,1.0393,1.0216,.997,.9697,.9418,.9169,.8949,.876,.8604,.849,.8394,.8337,.8314,.8305,.8326],hexagon:[.921,.9282,.9441,.9706,.9984,1.0059,.9896,.9562,.929,.9124,.9047,.9058,.9157,.9349,.9642,.9873,.9882,.9665,.9336,.9105,.8968,.8918,.8955,.908,.9293,.9611,.982,.9812,.959,.9282,.9089,.8978,.8964,.9026,.9189,.9439,.9778,.999,.9964,.9713,.9439,.9274,.9196,.9206,.9308,.9502,.9799,1.0121,1.0226,1.0071,.9752,.951,.9366,.9316,.9351,.9485,.9711,1.0026,1.0213,1.0155,.9863,.9547,.9347,.9232],triangle:[.7819,.8211,.8747,.944,1.0223,1.096,1.1401,1.134,1.0808,1.0047,.9265,.8603,.8104,.773,.745,.7273,.7151,.7118,.7148,.7245,.7427,.768,.8037,.8518,.9148,.9876,1.0583,1.1073,1.1109,1.0667,.994,.9164,.8482,.7948,.7555,.7261,.7056,.6925,.6859,.6869,.6938,.7084,.7305,.7615,.804,.8595,.9311,1.0092,1.0791,1.1171,1.1054,1.0501,.9779,.905,.845,.799,.7656,.7413,.7258,.716,.7146,.7204,.733,.7528]},W=Array.from({length:64},(e,t)=>t/64*v),G=W.map(Math.cos),K=W.map(Math.sin);function xe(e,t={}){return{radii:[...be[e]],rot:0,cx:0,cy:0,sx:1,sy:1,...t}}function q(e,t={}){return{radii:Array(64).fill(e),rot:0,cx:0,cy:0,sx:1,sy:1,...t}}function Se(e,t,n,r){let i=r??{radii:Array(64),rot:0,cx:0,cy:0,sx:1,sy:1};for(let r=0;r<64;r++)i.radii[r]=b(e.radii[r]??1,t.radii[r]??1,n);let a=t.rot-e.rot;for(;a>Math.PI;)a-=v;for(;a<-Math.PI;)a+=v;return i.rot=e.rot+a*n,i.cx=b(e.cx,t.cx,n),i.cy=b(e.cy,t.cy,n),i.sx=b(e.sx,t.sx,n),i.sy=b(e.sy,t.sy,n),i}function Ce(e,t,n=[]){let r=Math.cos(e.rot),i=Math.sin(e.rot);for(let a=0;a<64;a++){let o=e.radii[a]??1,s=o*(G[a]??0),c=o*(K[a]??0),l=s*r-c*i,u=s*i+c*r,d=n[a]??{x:0,y:0};d.x=(l*e.sx+e.cx)*t,d.y=(u*e.sy+e.cy)*t,n[a]=d}return n.length=64,n}function we(e,t=1/6){let n=e.length;if(n<3)return``;let r=e[0],i=`M${w(r.x)} ${w(r.y)}`;for(let r=0;r<n;r++){let a=e[(r-1+n)%n],o=e[r],s=e[(r+1)%n],c=e[(r+2)%n],l=o.x+(s.x-a.x)*t,u=o.y+(s.y-a.y)*t,d=s.x-(c.x-o.x)*t,f=s.y-(c.y-o.y)*t;i+=`C${w(l)} ${w(u)} ${w(d)} ${w(f)} ${w(s.x)} ${w(s.y)}`}return`${i}Z`}function J(e,t,n){let r=Array(64).fill(0),i=e.length;for(let a=0;a<64;a++){let o=G[a]??0,s=K[a]??0,c=0;for(let r=0;r<i;r++){let a=e[r],l=e[(r+1)%i],u=l.x-a.x,d=l.y-a.y,f=o*d-s*u;if(Math.abs(f)<1e-9)continue;let p=a.x-t,m=a.y-n,h=(p*d-m*u)/f,g=(p*s-m*o)/f;h>c&&g>=0&&g<=1&&(c=h)}r[a]=c}return r}function Y(e,t,n,r,i,a,o=96){let s=r-e,c=i-t,l=Math.hypot(s,c)||1e-6,u=Math.atan2(c,s),d=Math.acos(Math.max(-1,Math.min(1,(n-a)/l))),f=[];for(let r=0;r<=o/2;r++){let i=u+d+(v-2*d)*r/(o/2);f.push({x:e+Math.cos(i)*n,y:t+Math.sin(i)*n})}for(let e=0;e<=o/2;e++){let t=u-d+2*d*e/(o/2);f.push({x:r+Math.cos(t)*a,y:i+Math.sin(t)*a})}return f}function Te(e,t){let n=e.length,r=(t/v%1+1)%1*n,i=Math.floor(r);return b(e[i%n]??1,e[(i+1)%n]??1,r-i)}function Ee(e,t=1,n=1){return W.map((r,i)=>(Math.abs((G[i]??0)/t)**e+Math.abs((K[i]??0)/n)**e)**(-1/e))}function De(e){let t=Array(64).fill(0);for(let n=0;n<64;n++){let r=G[n]??0,i=K[n]??0,a=0;for(let t of e){let e=r*t.x+i*t.y,n=e*e-(t.x*t.x+t.y*t.y-t.r*t.r);if(n<0)continue;let o=e+Math.sqrt(n);o>a&&(a=o)}t[n]=a}return t}function Oe(e,t,n=10){let r=e.length,i=[],a=(e,t)=>{let n=t.x-e.x,r=t.y-e.y,i=Math.hypot(n,r)||1;return Math.atan2(-n/i,r/i)};for(let o=0;o<r;o++){let s=e[(o-1+r)%r],c=e[o],l=e[(o+1)%r],u=a(s,c),d=a(c,l)-u;for(;d>Math.PI;)d-=v;for(;d<-Math.PI;)d+=v;for(let e=0;e<=n;e++){let r=u+d*e/n;i.push({x:c.x+Math.cos(r)*t,y:c.y+Math.sin(r)*t})}}return i}function ke(e,t,n,r=0){let i=r*Math.PI/180;return J(Oe(Array.from({length:e},(r,a)=>{let o=i+a/e*v;return{x:Math.cos(o)*(t-n),y:Math.sin(o)*(t-n)}}),n),0,0)}function Ae(e,t=1){if(e.length<3)return``;let n=``;for(let r=0;r<e.length;r++){let i=e[r];n+=`${r===0?`M`:`L`}${w(i.x*t)} ${w(i.y*t)}`}return`${n}Z`}function je(e,t){let n=Math.max(e,.01)/2,r=Math.max(t,.01)/2,i=Math.min(n,r);return`M${w(-n)} ${w(-r+i)}A${w(i)} ${w(i)} 0 0 1 ${w(-n+i)} ${w(-r)}L${w(n-i)} ${w(-r)}A${w(i)} ${w(i)} 0 0 1 ${w(n)} ${w(-r+i)}L${w(n)} ${w(r-i)}A${w(i)} ${w(i)} 0 0 1 ${w(n-i)} ${w(r)}L${w(-n+i)} ${w(r)}A${w(i)} ${w(i)} 0 0 1 ${w(-n)} ${w(r-i)}Z`}function Me(e,t=1){let n=Math.max(...e);if(n<=0)return e;let r=t/n;return e.map(e=>e*r)}var Ne=Me(Array.from({length:64},(e,t)=>t/64*Math.PI*2).map(e=>1+.075*Math.cos(2*e+.5)+.035*Math.cos(3*e+2.1)),1.02),Pe=Me(De([{x:-.44,y:.2,r:.54},{x:.46,y:.2,r:.5},{x:.02,y:.3,r:.6},{x:-.24,y:-.3,r:.48},{x:.3,y:-.24,r:.44}]),1.02),Fe=Me(J(Y(0,.28,.66,0,-.96,.05),0,0),1.04),Ie=J(Y(-.42,0,.62,.42,0,.62),0,0),Le=[{id:`cercle`,radii:Array(64).fill(1)},{id:`galet`,radii:Ne},{id:`squircle`,radii:Me(Ee(4.2),1.15)},{id:`capsule`,radii:Ie},{id:`triangle`,radii:ke(3,1.12,.34,-90)},{id:`hexagone`,radii:ke(6,1.04,.26,0)},{id:`nuage`,radii:Pe},{id:`goutte`,radii:Fe}],Re=new Map(Le.map(e=>[e.id,e])),ze=`cercle`,Be=[{id:`encre`,hex:`#0a0a0c`},{id:`brun`,hex:`#8b5e3c`},{id:`rouge`,hex:`#e8483f`},{id:`orange`,hex:`#f08a24`},{id:`ambre`,hex:`#f0b429`},{id:`vert`,hex:`#3ecf8e`},{id:`turquoise`,hex:`#2fbfa0`},{id:`bleu`,hex:`#3b93f0`},{id:`violet`,hex:`#8b5cf6`},{id:`rose`,hex:`#e152b0`},{id:`gris`,hex:`#a3a3a3`},{id:`creme`,hex:`#f1efe9`}],Ve=new Map(Be.map(e=>[e.id,e])),He=`encre`;function Ue(e,t,n){let r=e=>{let t=parseInt(e.slice(1),16);return[t>>16&255,t>>8&255,t&255]},i=r(e),a=r(t);return`#${i.map((e,t)=>Math.round(e+(a[t]-e)*n)).map(e=>e.toString(16).padStart(2,`0`)).join(``)}`}var X=(e,t)=>[{w:e,h:t,open:1},{w:e,h:t,open:1}];function Z(e={}){return{sil:q(1),offX:0,offY:0,gaze:{...L},split:P,eyes:X(F,I),eyeAlpha:1,bodyAlpha:1,dots:[],arcs:[],notif:null,dotsBehind:!1,...e}}var We=-.1875,Ge=J(Y(0,-.505,.132,0,.13,.075),0,We),Ke=J(Y(0,-.2535,.1345,0,.2535,.1345),0,0),qe=(e={})=>({radii:[...Ge],rot:0,cx:0,cy:We,sx:1,sy:1,...e}),Je=(e={})=>({radii:[...Ke],rot:0,cx:0,cy:0,sx:1,sy:1,...e}),Ye=Ae(Y(0,0,.118,0,.172,.012)),Xe=.213;function Ze(e){return xe(`triangle`,{rot:e,cx:-.213*Math.sin(e),cy:Xe*Math.cos(e)})}function Qe(e,t){let n=((e-t*.5)/1.5%1+1)%1;return y((n<.5?.5-.5*Math.cos(n*v):0)*2)}var $e=[{id:`idle`,duration:2.4,morph:.45,blinkIn:!1,baseFace:!0,baseBody:!0,pose:()=>Z()},{id:`thinking`,duration:2.6,morph:.4,baseFace:!1,baseBody:!1,blinkIn:!0,pose:e=>{let t=Qe(e,1),n=.3+.7*x.easeOutCubic(y(e/.3));return Z({sil:q(k*(1+(ne-1)*t),{cx:te[1]}),eyeAlpha:0,dots:[0,2].map(t=>{let r=Qe(e,t);return{x:te[t]*n,y:0,r:k*(1+(ne-1)*r),opacity:.55+.45*r}})})}},{id:`wink`,duration:1.6,morph:.3,blinkIn:!0,baseFace:!1,baseBody:!0,pose:()=>Z({gaze:{yaw:-5.37,pitch:4.55,roll:6.7},split:16.25,eyes:[{w:.236,h:.464,open:1},{w:.447,h:.089,open:1}]})},{id:`wide`,duration:1.8,morph:.55,blinkIn:!0,baseFace:!1,baseBody:!0,pose:()=>Z({gaze:{yaw:6.92,pitch:-21.96,roll:11.6},split:18.43,eyes:X(.356,.875)})},{id:`alert`,duration:2.4,minDuration:2,morph:.45,baseFace:!1,baseBody:!1,blinkIn:!1,pose:e=>{let t=y(e/1.5),n=x.easeInOutCubic(t)*.82-.087,r=e>1.6?y((e-1.6)/.4):0,i=n*(1-r)+.1*r,a=Math.sin(e*2.5*v)*.005,o=17.7*Math.PI/180;return Z({sil:Je({rot:o,cx:i,cy:-.325-a}),eyeAlpha:0,dots:[{x:i-Math.sin(o)*.58,y:-.325+Math.cos(o)*.58+a*2.8,r:.118,d:Ye,rot:o*180/Math.PI,opacity:1}]})}},{id:`notify`,duration:2.2,morph:.5,blinkIn:!0,baseFace:!1,baseBody:!0,pose:e=>{let t=y(e/.45),n=1+(ce-1)*Math.sin(t*Math.PI)*(1-t*.35),r=N*(t<1?n:1),i=-42*Math.PI/180;return Z({gaze:{yaw:-21.94,pitch:-5.82,roll:-12.2},split:18.89,eyes:X(.505,.498),notif:{x:Math.cos(i)*M,y:Math.sin(i)*M,r,notch:r+le}})}},{id:`exclaim`,duration:2,morph:.45,baseFace:!1,baseBody:!1,blinkIn:!1,pose:()=>Z({sil:qe(),eyeAlpha:0,dots:[{x:-.012,y:.526,r:.113,opacity:1}]})},{id:`sleep`,duration:2.4,morph:.5,baseFace:!1,baseBody:!1,blinkIn:!1,pose:e=>Z({sil:q(.1585,{cy:.11+Math.sin(v/.6*e)*.19}),eyeAlpha:0})},{id:`egg`,duration:1.8,morph:.4,baseFace:!1,baseBody:!1,blinkIn:!0,pose:()=>Z({sil:xe(`egg`),gaze:{yaw:19.97,pitch:26.01,roll:-17.1},split:11.07,eyes:X(.164,.385)})},{id:`hexagon`,duration:1.6,morph:.4,baseFace:!1,baseBody:!1,blinkIn:!0,pose:()=>Z({sil:xe(`hexagon`),gaze:{yaw:23.11,pitch:24.42,roll:-13.3},split:13.37,eyes:X(.177,.411)})},{id:`play`,duration:2,morph:.5,baseFace:!1,baseBody:!1,blinkIn:!0,pose:e=>{let t=y(e/.35)*y((2.2-e)/.5);return Z({sil:Ze(0),gaze:{yaw:12,pitch:-8,roll:-6},split:15,eyes:X(.18,.34),arcs:O.map((n,r)=>({id:`sw${r}`,seed:{...n,cx:.45-e*.42},t:e,opacity:t}))})}},{id:`orbit`,duration:3.4,minDuration:2.5,morph:.6,baseFace:!1,baseBody:!1,blinkIn:!1,pose:e=>{let t=x.easeInOutCubic(y(e/.35)),n=-v*1.25*e*t,r=x.easeInOutCubic(y((e-1.6)/.9)),i=Ze(n),a=q(1,{rot:n}),o={radii:i.radii.map((e,t)=>e+(a.radii[t]-e)*r),rot:n,cx:i.cx*(1-r),cy:i.cy*(1-r),sx:1,sy:1},s=y(e/.8)*y((3.6-e)/.9);return Z({sil:o,gaze:{yaw:L.yaw+Math.sin(e*6.5)*65*(1-r),pitch:-4+r*32,roll:-13},eyes:X(.18,.34+r*.07),arcs:D.map((t,n)=>({id:`rg${n}`,seed:t,t:e,opacity:s*y((e-n*.13)/.3)}))})}},{id:`swirl`,duration:1.3,minDuration:1.3,morph:.3,baseFace:!0,baseBody:!0,blinkIn:!0,pose:e=>Z({arcs:D.slice(0,3).map((t,n)=>({id:`sw${n}`,seed:t,t:e,opacity:y((e-n*.06)/.14)*y((1.22-e)/.34)}))})},{id:`burst`,duration:2.6,minDuration:2.4,morph:.4,baseFace:!1,baseBody:!1,blinkIn:!1,pose:e=>{let t=1-.834*x.easeOutQuint(y(e/.7)),n=x.easeOutQuint(y((e-1.7)/.7));return Z({sil:q(t+(1-t)*n),eyeAlpha:y((e-1.85)/.4),dots:ae(e,1),dotsBehind:!0})}},{id:`comet`,duration:2.4,minDuration:2.4,morph:.45,baseFace:!1,baseBody:!1,blinkIn:!1,pose:e=>{let t=1-(1-j)*x.easeOutQuint(y(e/.55)),n=x.easeOutQuint(y((e-1.85)/.6)),r=y((e-.15)/.25)*y((1.95-e)/.3);return Z({sil:q(t+(1-t)*n,{cy:Math.sin(y(e/1.7)*Math.PI)*.035}),eyeAlpha:y((e-2)/.35),arcs:A.map((t,n)=>({id:`cm${n}`,seed:t,t:e,opacity:r}))})}}],Q=new Map($e.map(e=>[e.id,e])),et={idle:1,thinking:1.1,wink:.8,wide:.8,alert:.75,notify:.9,exclaim:.8,sleep:.45,egg:.8,hexagon:.8,play:.9,orbit:1.2,swirl:.5,burst:.45,comet:1.15},tt=[`idle`,`thinking`,`wink`,`wide`,`alert`,`notify`,`exclaim`,`sleep`,`egg`,`hexagon`,`play`,`orbit`,`burst`,`comet`],$=100,nt=7.1,rt=5.5,it=.006,at=.007;function ot(e,t,n){let r=[],i=B(e.gaze,$,e.split);for(let a=0;a<2;a++){let o=i[a];if(o.depth<=.02)continue;let s=e.eyes[a],c=(s.tilt??0)*Math.PI/180,l=Math.cos(c),u=Math.sin(c),d=o.a*l+o.c*u,f=o.b*l+o.d*u,p=-o.a*u+o.c*l,m=-o.b*u+o.d*l,h=Math.max(s.w*$,.01)/2,g=Math.max(s.h*$,.01)/2,_=Math.min(h,g),v=g>h,y=v?g-_:h-_,b=Te(n,Math.atan2(o.y,o.x)-t.rot);r.push({x:o.x*b,y:o.y*b,ax:(v?p:d)*y,ay:(v?m:f)*y,r:_,m:[d,f,p,m]})}return r}function st(e,t,n,r,i){let a=r-t,o=i-n,s=a*a+o*o,c=1/0,l=0,u=0;for(let r=0;r<e.length;r++){let i=e[r],d=s>0?((i.x-t)*a+(i.y-n)*o)/s:0;d=d<0?0:d>1?1:d;let f=t+d*a-i.x,p=n+d*o-i.y,m=f*f+p*p;m<c&&(c=m,l=f,u=p)}let d=Math.sqrt(c);return{d,ux:d>1e-9?l/d:0,uy:d>1e-9?u/d:0}}var ct=Math.hypot(it,at)*$;function lt(e,t,n,r){let i=1/0,a=0,o=0;for(let s of t){let t=s.x+n,c=s.y+r,l=st(e,t-s.ax,c-s.ay,t+s.ax,c+s.ay),[u,d,f,p]=s.m,m=s.r*Math.hypot(u*l.ux+d*l.uy,f*l.ux+p*l.uy)+ct;l.d-m<i&&(i=l.d-m,a=l.ux,o=l.uy)}return{marge:i,ux:a,uy:o}}var ut=12,dt=8;function ft(e){if(!e.length)return{x:0,y:0};let t=(t,n)=>{let r=1/0;for(let i of e)r=Math.min(r,lt(i.contour,i.empreintes,t,n).marge);return r},n=1/0;for(let t of e)n=Math.min(n,lt(t.calContour,t.reference,0,0).marge);let r=0,i=0,a=e[0].empreintes;for(let e of a)r-=e.x/a.length,i-=e.y/a.length;let o=Math.max(.35*$,Math.hypot(r,i)*1.25);n=Math.min(n,t(r,i));let s=t(0,0);if(s>=n&&s>=0)return{x:0,y:0};let c=Math.max(n,0),l=0,u=0,d=1/0,f=0,p=0,m=s;for(let e=0;e<ut;e++){let n=e/ut*Math.PI*2,r=Math.cos(n),i=Math.sin(n);if(t(r*o,i*o)<c){for(let e of[.3,.6,1]){let n=t(r*o*e,i*o*e);n>m&&(m=n,f=r*o*e,p=i*o*e)}continue}let a=0,s=o;for(let e=0;e<dt;e++){let e=(a+s)/2;t(r*e,i*e)>=c?s=e:a=e}s<d&&(d=s,l=r*s,u=i*s)}let h=d===1/0?f:l,g=d===1/0?p:u;return{x:+(h/$).toFixed(6),y:+(g/$).toFixed(6)}}function pt(e,t,n){return e.baseFace&&n?{gaze:n.gaze,split:n.split,eyes:n.eyes}:{gaze:t.gaze,split:t.split,eyes:t.eyes}}function mt(e){let t=e=>JSON.stringify([e.gaze,e.split,e.eyes,e.sil.rot,e.sil.cx,e.sil.cy,e.sil.sx,e.sil.sy]);return t(e.pose(0))===t(e.pose(e.duration))?[0]:Array.from({length:3},(t,n)=>n/2*e.duration)}function ht(e,t,n){let r=[];for(let i of mt(e)){let a=e.pose(i),o=Ce({...a.sil,radii:t},$),s=Ce(a.sil,$),c=pt(e,a,n),l=[];for(let e of[-7.1,nt])for(let t of[-5.5,rt])l.push({...c,gaze:{yaw:c.gaze.yaw+e,pitch:c.gaze.pitch+t,roll:c.gaze.roll}});for(let e of l)r.push({empreintes:ot(e,a.sil,t),reference:ot(e,a.sil,a.sil.radii),contour:o,calContour:s})}return ft(r)}var gt={x:0,y:0},_t=(e,t)=>`${e}|${t??``}`;function vt(){return new Map(Le.map(e=>{let t=new Map;for(let n of $e){if(!n.baseBody)continue;let r=n.baseFace?[null,...U]:[null];for(let i of r)t.set(_t(n.id,i?.id??null),ht(n,e.radii,i))}return[e.radii,t]}))}var yt=vt();function bt(e,t,n){if(!e)return gt;let r=yt.get(e);return r?r.get(_t(t,n))??r.get(_t(t,null))??gt:gt}var xt={yaw:0,pitch:0,mix:0,spin:0,wander:1},St=(e,t,n)=>({yaw:b(e.yaw,t.yaw,n),pitch:b(e.pitch,t.pitch,n),mix:b(e.mix,t.mix,n),spin:b(e.spin,t.spin,n),wander:b(e.wander,t.wander,n)}),Ct=(e,t,n)=>({w:b(e.w,t.w,n),h:b(e.h,t.h,n),open:b(e.open,t.open,n),tilt:b(e.tilt??0,t.tilt??0,n)});function wt(e,t,n){let r=1-n;return{sil:Se(e.sil,t.sil,n),offX:b(e.offX,t.offX,n),offY:b(e.offY,t.offY,n),gaze:{yaw:b(e.gaze.yaw,t.gaze.yaw,n),pitch:b(e.gaze.pitch,t.gaze.pitch,n),roll:b(e.gaze.roll,t.gaze.roll,n)},split:b(e.split,t.split,n),eyes:[Ct(e.eyes[0],t.eyes[0],n),Ct(e.eyes[1],t.eyes[1],n)],eyeAlpha:b(e.eyeAlpha,t.eyeAlpha,n),bodyAlpha:b(e.bodyAlpha,t.bodyAlpha,n),dots:[...e.dots.map(e=>({...e,opacity:e.opacity*r})),...t.dots.map(e=>({...e,opacity:e.opacity*n}))],arcs:[...e.arcs.map(e=>({...e,id:`a${e.id}`,opacity:e.opacity*r})),...t.arcs.map(e=>({...e,id:`b${e.id}`,opacity:e.opacity*n}))],notif:n<.5?e.notif:t.notif,dotsBehind:n<.5?e.dotsBehind:t.dotsBehind}}var Tt=class e{scale;cur;prev=null;departFige=null;tCur=0;tPrev=0;blinkAt=-10;pts=[];shape=null;shapePrev=null;shapeAt=-10;expr=null;exprPrev=null;exprAt=-10;look=xt;lookPrev=xt;lookAt=-10;lookMorph=.24;static SHAPE_MORPH=.45;static LOOK_MORPH=.24;constructor(e=100,t=`idle`,n=null,r=null){this.scale=e,this.cur=t,this.shape=n,this.expr=r}setExpression(e,t=0){e!==this.expr&&(this.exprPrev=this.expr,this.expr=e,this.exprAt=t)}exprAtTime(t){let n=this.expr,r=this.exprPrev;if(!n||!r)return n;let i=(t-this.exprAt)/e.SHAPE_MORPH;return i>=1?n:ye(r,n,x.easeOutQuint(y(i)))}setShape(e,t=0){e!==this.shape&&(this.shapePrev=this.shape,this.shape=e,this.shapeAt=t)}shapeAtTime(t){let n=this.shape,r=this.shapePrev;if(!n||!r)return n;let i=(t-this.shapeAt)/e.SHAPE_MORPH;if(i>=1)return n;let a=x.easeOutQuint(y(i));return n.map((e,t)=>b(r[t]??e,e,a))}setLook(t,n,r=e.LOOK_MORPH){t&&!Number.isFinite(t.yaw+t.pitch+t.mix+t.spin+t.wander)||(this.lookPrev=this.lookAtTime(n),this.look=t??xt,this.lookAt=n,this.lookMorph=r)}lookAtTime(e){let t=(e-this.lookAt)/this.lookMorph;return t>=1?this.look:St(this.lookPrev,this.look,x.easeOutQuint(y(t)))}posed(e,t,n,r){let i=e.pose(t);return e.baseBody&&n&&(i={...i,sil:{...i.sil,radii:n}}),e.baseFace&&r&&(i={...i,gaze:r.gaze,split:r.split,eyes:r.eyes}),i}decalageAtTime(t,n){let r=(e,n,r,i)=>{if(r===i)return i;let a=(t-e)/n;if(a>=1)return i;let o=x.easeOutQuint(y(a));return{x:b(r.x,i.x,o),y:b(r.y,i.y,o)}},i=t=>r(this.exprAt,e.SHAPE_MORPH,bt(t,n,this.exprPrev?.id??null),bt(t,n,this.expr?.id??null));return r(this.shapeAt,e.SHAPE_MORPH,i(this.shapePrev),i(this.shape))}get state(){return this.cur}reset(e,t){this.cur=e,this.prev=null,this.departFige=null,this.tCur=t,this.tPrev=t,this.blinkAt=-10}origine(e,t,n){if(this.departFige)return this.departFige;if(!this.prev)return null;let r=Q.get(this.prev);return this.posed(r,Math.max(0,e-this.tPrev),t,n)}poseComposee(e){let t=Q.get(this.cur),n=this.shapeAtTime(e),r=this.exprAtTime(e),i=this.posed(t,Math.max(0,e-this.tCur),n,r),a=e-this.tCur;if(a>=t.morph)return i;let o=this.origine(e,n,r);return o?wt(o,i,x.easeOutQuint(y(a/t.morph))):i}setState(e,t){if(e===this.cur)return;let n=Q.get(this.cur).morph,r=this.prev!==null&&t-this.tCur<n;this.departFige=r?this.poseComposee(t):null,this.prev=this.cur,this.tPrev=this.tCur,this.cur=e,this.tCur=t,Q.get(e)?.blinkIn&&(this.blinkAt=t)}sample(e){let t=this.scale,n=Q.get(this.cur),r=this.shapeAtTime(e),i=this.exprAtTime(e),a=this.posed(n,Math.max(0,e-this.tCur),r,i),o=this.decalageAtTime(e,this.cur),s=e-this.tCur,c=s<n.morph?this.origine(e,r,i):null;if(c){let t=x.easeOutQuint(y(s/n.morph));a=wt(c,a,t);let r=this.prev;if(r){let n=this.decalageAtTime(e,r);o={x:b(n.x,o.x,t),y:b(n.y,o.y,t)}}}let l=a.eyeAlpha>.01,u=this.lookAtTime(e),d=me(e,{wander:l?u.wander:0,blink:l}),f={yaw:b(a.gaze.yaw,u.yaw,u.mix)+d.dYaw-u.spin,pitch:b(a.gaze.pitch,u.pitch,u.mix)+d.dPitch,roll:a.gaze.roll+d.dRoll},p=y((e-this.blinkAt)/.2),m=p<1?Math.abs(p*2-1):1,h=Math.min(d.lid,m),g=a.offX+d.driftX,_=a.offY+d.driftY,v=we(Ce({...a.sil,cx:a.sil.cx+g,cy:a.sil.cy+_,sy:a.sil.sy*d.breath},t,this.pts)),S=(e,t)=>Te(a.sil.radii,Math.atan2(t,e)-a.sil.rot),C=[];if(a.eyeAlpha>.01){let e=B(f,t,a.split);for(let n=0;n<2;n++){let r=e[n];if(r.depth<=.02)continue;let i=a.eyes[n],s=S(r.x,r.y),c=(i.tilt??0)*Math.PI/180,l=Math.cos(c),u=Math.sin(c),d=r.a*l+r.c*u,f=r.b*l+r.d*u,p=-r.a*u+r.c*l,m=-r.b*u+r.d*l,v=he(Math.min(h,i.open));C.push({d:je(i.w*t,i.h*t),matrix:`matrix(${w(d)},${w(f*v)},${w(p)},${w(m*v)},${w(r.x*s+(g+o.x)*t)},${w(r.y*s+(_+o.y)*t)})`,alpha:a.eyeAlpha*y(r.depth/.12)})}}let T=a.dots.filter(e=>e.opacity>.01&&e.r>5e-4).map(e=>({...e,x:(e.x+g)*t,y:(e.y+_)*t,r:e.r*t})),E=a.notif?S(a.notif.x,a.notif.y):1,D=a.notif?(a.notif.x*E+g)*t:0,O=a.notif?(a.notif.y*E+_)*t:0,te=a.notif?{x:D,y:O,r:a.notif.r*t}:null,k=a.notif?{x:D,y:O,r:a.notif.notch*t}:null;return{bodyPath:v,bodyAlpha:a.bodyAlpha,eyes:C,dots:T,dotsBehind:a.dotsBehind,arcs:a.arcs.filter(e=>e.opacity>.01).map(e=>ee(e.seed,e.t,t,e.id,e.opacity)),notif:te,notch:k}}},Et=1.1,Dt=1.5,Ot=e=>({yaw:0,pitch:0,mix:0,spin:360*(1-x.easeInOutCubic(y(e/Dt))),wander:1});function kt({nx:e,ny:t,tour:n,pointer:r}){return{yaw:-26+e*16,pitch:10-t*13,mix:n,spin:360*(1-n),wander:+!r}}var At=Math.max(...$e.map(e=>e.morph)),jt=10,Mt=200,Nt=50,Pt=.1,Ft=`defaut`;function It(e){return Math.max(At,Q.get(e)?.minDuration??At)}function Lt(e,t){let n=Math.round(t/Pt)*Pt,r=Math.min(10,Math.max(It(e),n));return Math.round(r*100)/100}function Rt(e){return{state:e,duration:Lt(e,Q.get(e)?.duration??2)}}function zt(){return{name:``,id:Ft,blocks:tt.map(Rt)}}function Bt(e){return e.reduce((e,t)=>e+t.duration,0)}function Vt(e,t){let n=0;for(let r=0;r<t&&r<e.length;r++)n+=e[r].duration;return n}function Ht(e,t){let n=Bt(e);if(!e.length||n<=0)return{index:0,elapsed:0};let r=t>=0&&t<n?t:(t%n+n)%n,i=0;for(let t=0;t<e.length;t++){let n=i+e[t].duration;if(r<n)return{index:t,elapsed:r-i};i=n}return{index:e.length-1,elapsed:0}}function Ut(e,t){return e.length>=200?e:[...e,Rt(t)]}function Wt(e,t,n){let r=e.slice(),[i]=r.splice(t,1);return i?(r.splice(Math.min(Math.max(n,0),r.length),0,i),r):e}function Gt(e,t){let n=new Set(t.map(e=>e.name));if(!n.has(e))return e;let r=2;for(;n.has(`${e} ${r}`);)r++;return`${e} ${r}`}function Kt(e){let t=new Set(e.map(e=>e.id)),n=1;for(;t.has(`c${n}`);)n++;return`c${n}`}function qt(e){if(typeof e!=`object`||!e)return null;let{state:t,duration:n}=e;return typeof t!=`string`||!tt.includes(t)||typeof n!=`number`||!Number.isFinite(n)?null:{state:t,duration:Lt(t,n)}}function Jt(e,t){if(typeof e!=`object`||!e)return null;let{id:n,name:r,blocks:i}=e;if(typeof n!=`string`||!n||typeof r!=`string`||!Array.isArray(i))return null;let a=i.slice(0,200).map(qt).filter(e=>e!==null);return!a.length||t.some(e=>e.id===n)?null:{id:n,name:r,blocks:a}}function Yt(e){if(!e)return[];let t;try{t=JSON.parse(e)}catch{return[]}if(!Array.isArray(t))return[];let n=[];for(let e of t.slice(0,50)){let t=Jt(e,n);t&&n.push(t)}return n}var Xt=100,Zt=158,Qt=[`<g`,`>`,`</g>`],$t=[`<svg`,` viewBox="`,`" role="img"`,` style="`,`"><defs><mask`,` maskUnits="userSpaceOnUse"`,`><path`,` fill="#fff"></path><!--$-->`,`<!--/--><!--$-->`,`<!--/--></mask><!--$-->`,`<!--/--></defs><g fill="none" stroke-linecap="round">`,`</g><!--$-->`,`<!--/--><g`,`><path`,`></path><g mask="`,`"><rect`,`></rect></g></g><!--$-->`,`<!--/--><!--$-->`,`<!--/--><g fill="none" stroke-linecap="round">`,`</g></svg>`],en=[`<path`,` fill="#000"></path>`],tn=[`<circle`,` fill="#000"></circle>`],nn=[`<linearGradient`,` id="`,`" gradientUnits="userSpaceOnUse"`,`>`,`</linearGradient>`],rn=[`<stop`,`></stop>`],an=[`<path`,` stroke="`,`"`,`></path>`],on=[`<circle`,`></circle>`];function sn(v){let y=m({size:320,shape:ze,color:He,expression:_e,paper:`#f9f9f9`,cycle:zt().blocks,follow:!1,gaze:null,ariaLabel:`Animated Bloub avatar`},v),[b,x]=f(0),[S,C]=f(`idle`),[w]=f(!1),[T,ee]=f(0),E=()=>v.block??b(),D=()=>v.state??S(),O=()=>v.playing??w(),te=()=>v.elapsed??T();function k(e){v.block===void 0&&x(e),v.onBlockChange?.(e)}function ne(e){v.state===void 0&&C(e),v.onStateChange?.(e)}function re(e){v.elapsed===void 0&&ee(e),v.onElapsedChange?.(e)}let ie=d(()=>Re.get(y.shape)?.radii??null),ae=d(()=>Ve.get(y.color)?.hex??`#0a0a0c`),oe=d(()=>ge.get(y.expression)??null),A=new Tt(100,D(),ie(),oe()),[j,M]=f(A.sample(y.frozenAt??0),{equals:!1}),N=p(),ce=`bot-mask-${N}`,le=0,P=1/0,F=0,I=0,L=0,R=0,z=-1;function B(e,t=0){let n=y.cycle[e];if(!n){P=1/0;return}L=I-t,re(t),ne(n.state),A.setState(n.state,I),P=O()?L+n.duration:1/0}function ue(e){k(e),B(e)}function de(e,t=0){if(E()===e){B(e,t);return}R=t,k(e)}function fe(e){let t=y.cycle;if(!t.length)return;let{index:n}=Ht(t,e);if(n!==z){let e=t[n];ne(e.state),n<z?A.reset(e.state,Vt(t,n)):A.setState(e.state,Vt(t,n)),z=n}M(A.sample(e))}let pe=!1,me=0,he=!1,V=1/60;function H(e){e.pointerType!==`touch`&&(e.clientX,e.clientY)}function U(){}function ve(){pe&&=(A.setLook(null,I,Et),!1)}function ye(){if(!Q.get(D())?.baseFace){ve();return}}function be(e){A.setLook(e(I-me),I,V)}function W(){window.removeEventListener(`pointermove`,H),document.removeEventListener(`pointerleave`,U)}function G(e){le=requestAnimationFrame(G);let t=F?Math.min((e-F)/1e3,.064):0;F=e,I+=t,O()&&(I>=P&&y.cycle.length?ue((E()+1)%y.cycle.length):re(I-L)),y.follow?ye():y.gaze&&be(y.gaze),M(A.sample(I))}function K(){y.frozenAt!==void 0&&M(A.sample(y.frozenAt))}u(h(()=>y.gaze,e=>{e?(me=I,he=!0,A.setLook(e(0),I-V,V)):he&&=(A.setLook(null,I),!1)})),u(h(E,e=>{B(e,R),R=0},{defer:!0})),u(h(D,e=>{A.state!==e&&(A.setState(e,I),K())},{defer:!0})),u(h(O,e=>{e?B(E(),te()):P=1/0},{defer:!0})),u(h(()=>y.cycle,e=>{if(!e.length){P=1/0;return}let t=Math.min(E(),e.length-1);t===E()?P=O()?L+e[t].duration:1/0:ue(t)},{defer:!0})),u(h(ie,e=>{A.setShape(e,I),K()},{defer:!0})),u(h(oe,e=>{A.setExpression(e,I),K()},{defer:!0})),u(h(()=>y.frozenAt,K,{defer:!0})),u(()=>{y.follow&&y.frozenAt===void 0?(window.addEventListener(`pointermove`,H),document.addEventListener(`pointerleave`,U)):(W(),ve())}),_(()=>{v.ref?.({get svg(){},seek:de,renderAt:fe}),y.frozenAt===void 0&&(B(E(),te()),le=requestAnimationFrame(G))}),g(()=>{typeof cancelAnimationFrame<`u`&&cancelAnimationFrame(le),typeof window<`u`&&W()});function xe(e){let t={fill:e.color??(e.depth===void 0?ae():Ue(y.paper,ae(),e.depth)),opacity:e.opacity};return e.d?{...t,d:e.d,transform:`translate(${e.x} ${e.y}) rotate(${e.rot??0}) scale(100)`}:{...t,cx:e.x,cy:e.y,r:e.r}}let q=()=>t(c,{get each(){return j().dots},children:n=>t(e,r({get component(){return n.d?`path`:`circle`}},()=>xe(n)))});return i($t,o()+a(`width`,n(y.size,!0),!1)+a(`height`,n(y.size,!0),!1),`-158 -158 ${n(158,!0)*2} ${n(158,!0)*2}`,a(`aria-label`,n(y.ariaLabel,!0),!1)+a(`class`,n(y.class,!0),!1),s(y.style),a(`id`,n(ce,!0),!1),a(`x`,-158,!1)+a(`y`,-158,!1)+a(`width`,n(158,!0)*2,!1)+a(`height`,n(158,!0)*2,!1),a(`d`,n(j().bodyPath,!0),!1),n(t(c,{get each(){return j().eyes},children:e=>i(en,o()+a(`d`,n(e.d,!0),!1)+a(`transform`,n(e.matrix,!0),!1)+a(`opacity`,n(e.alpha,!0),!1))})),n(t(l,{get when(){return j().notch},children:e=>i(tn,o()+a(`cx`,n(e().x,!0),!1)+a(`cy`,n(e().y,!0),!1)+a(`r`,n(e().r,!0),!1))})),n(t(c,{get each(){return j().arcs},children:e=>i(nn,o(),`${n(N,!0)}-${n(e.id,!0)}`,a(`x1`,n(e.grad.x1,!0),!1)+a(`y1`,n(e.grad.y1,!0),!1)+a(`x2`,n(e.grad.x2,!0),!1)+a(`y2`,n(e.grad.y2,!0),!1),n(t(c,{get each(){return e.grad.stops},children:(t,r)=>i(rn,o()+a(`offset`,n(r(),!0)/(n(e.grad.stops.length,!0)-1),!1)+a(`stop-color`,n(t,!0),!1))})))})),n(t(c,{get each(){return j().arcs},children:e=>i(an,o()+a(`d`,n(e.back,!0),!1),`url(#${n(N,!0)}-${n(e.id,!0)})`,a(`stroke-width`,n(e.width,!0),!1)+a(`opacity`,n(e.opacity,!0),!1))})),n(t(l,{get when(){return j().dotsBehind},get children(){return i(Qt,o(),n(t(q,{})))}})),a(`opacity`,n(j().bodyAlpha,!0),!1),a(`d`,n(j().bodyPath,!0),!1)+a(`fill`,n(y.paper,!0),!1),`url(#${n(ce,!0)})`,a(`x`,-158,!1)+a(`y`,-158,!1)+a(`width`,n(158,!0)*2,!1)+a(`height`,n(158,!0)*2,!1)+a(`fill`,n(ae(),!0),!1),n(t(l,{get when(){return!j().dotsBehind},get children(){return i(Qt,o(),n(t(q,{})))}})),n(t(l,{get when(){return j().notif},children:e=>i(on,o()+a(`cx`,n(e().x,!0),!1)+a(`cy`,n(e().y,!0),!1)+a(`r`,n(e().r,!0),!1)+a(`fill`,n(se,!0),!1))})),n(t(c,{get each(){return j().arcs},children:e=>i(an,o()+a(`d`,n(e.front,!0),!1),`url(#${n(N,!0)}-${n(e.id,!0)})`,a(`stroke-width`,n(e.width,!0),!1)+a(`opacity`,n(e.opacity,!0),!1))})))}export{sn as BloubBot,Tt as BotEngine,Be as COLORS,Ve as COLOR_BY_ID,He as DEFAULT_COLOR,_e as DEFAULT_EXPRESSION,ze as DEFAULT_SHAPE,Zt as DEMI_VIEWBOX,U as EXPRESSIONS,ge as EXPRESSION_BY_ID,jt as MAX_BLOCK,Mt as MAX_BLOCS,Nt as MAX_CYCLES,At as MIN_BLOCK,et as POSES,Xt as RAYON,tt as SEQUENCE,Le as SHAPES,Re as SHAPE_BY_ID,$e as STATES,Q as STATE_BY_ID,Pt as STEP,Dt as TOUR_TIME,Et as TURN_TIME,ye as blendExpression,Ht as blockAt,Ut as blocksWith,Lt as clampDuration,zt as defaultCycle,kt as lookTarget,Rt as makeBlock,It as minDurationOf,Ue as mixHex,Wt as moveBlock,Kt as nextCycleId,Vt as offsetOf,Yt as parseCycles,Bt as totalDuration,Ot as tourLook,Gt as uniqueName};
|
|
1
|
+
import{Dynamic as e,escape as t,mergeProps as n,ssr as r,ssrAttribute as i,ssrClassName as a,ssrGroup as o,ssrHydrationKey as s,ssrStyle as c}from"@solidjs/web";import{For as l,Show as u,createEffect as d,createMemo as f,createSignal as p,createUniqueId as m,onCleanup as h,onSettled as g,untrack as _}from"solid-js";var v=Math.PI*2,y=(e,t=0,n=1)=>e<t?t:e>n?n:e,b=(e,t,n)=>e+(t-e)*n,x={easeOutCubic:e=>1-(1-e)**3,easeInOutCubic:e=>e<.5?4*e**3:1-(-2*e+2)**3/2,easeOutQuint:e=>1-(1-e)**5};function S(e,t,n=0){let r=e/t*v;return .55*Math.sin(r+n)+.3*Math.sin(2*r+n*1.7+1.1)+.15*Math.sin(3*r+n*2.3+2.4)}function C(e){let t=e>>>0;return()=>{t=t+1831565813>>>0;let e=Math.imul(t^t>>>15,1|t);return e=e+Math.imul(e^e>>>7,61|e)^e,((e^e>>>14)>>>0)/4294967296}}var w=e=>Math.round(e*100)/100;function T(e,t=.55,n=.62){let r=(e%360+360)%360,i=(1-Math.abs(2*n-1))*t,a=i*(1-Math.abs(r/60%2-1)),o=n-i/2,[s,c,l]=r<60?[i,a,0]:r<120?[a,i,0]:r<180?[0,i,a]:r<240?[0,a,i]:r<300?[a,0,i]:[i,0,a],u=e=>Math.round((e+o)*255).toString(16).padStart(2,`0`);return`#${u(s)}${u(c)}${u(l)}`}function ee(e,t,n,r,i=1){let a=e.phase+t*e.speed*v,o=Math.cos(e.tilt),s=Math.sin(e.tilt),c=Math.sqrt(Math.max(0,1-e.k*e.k)),l=e.sweep*v,u=``,d=``,f=null;for(let t=0;t<=64;t++){let r=a+t/64*l,i=Math.cos(r),p=Math.sin(r),m=e.a*(i*o+p*-s*e.k)+e.cx,h=e.a*(i*s+p*o*e.k)+e.cy,g=e.a*p*c<0,_=w(m*n),v=w(h*n),y=g===f?`L`:`M`;g?d+=`${y}${_} ${v}`:u+=`${y}${_} ${v}`,f=g}let p=Math.cos(e.tilt)*e.a*n,m=Math.sin(e.tilt)*e.a*n;return{id:r,front:u,back:d,width:e.width*n,opacity:i,grad:{x1:w(e.cx*n-p),y1:w(e.cy*n-m),x2:w(e.cx*n+p),y2:w(e.cy*n+m),stops:[T(e.hue),T(e.hue+e.hueSpan*.5),T(e.hue+e.hueSpan)]}}}var E=C(659918),te=Array.from({length:6},(e,t)=>({a:1.3+E()*.1,k:.05+E()*.4,tilt:t/6*Math.PI+E()*.5,speed:3+E()*.7,phase:E()*v,sweep:.6+E()*.25,hue:t*360/6+E()*30,hueSpan:60+E()*60,width:.05+E()*.012,cx:0,cy:.1})),ne=Array.from({length:4},(e,t)=>({a:.78+t*.2,k:.05+t*.02,tilt:-.62+t*.05,speed:.3,phase:.06*t,sweep:.4,hue:95+t*62,hueSpan:100,width:.05,cx:0,cy:-.12})),re=[-.557,-.013,.532],D=.165,O=1.25,k=C(48879),ie=Array.from({length:5},(e,t)=>({birth:t*.2,angle:k()*v,rho:.58+k()*.18}));function ae(e,t){let n=[];for(let r of ie){let i=e-r.birth;if(i<0||i>.62)continue;let a=r.rho*.75**(i*10),o=r.angle+i*100*Math.PI/180;n.push({x:Math.cos(o)*a*t,y:Math.sin(o)*a*t,r:(.04+.028*y(i/.55))*t,depth:y(1-a/.8),opacity:y(i/.06)*y((.62-i)/.08)})}return n}var oe=C(49383),se=Array.from({length:4},(e,t)=>{let n=t-1.5;return{a:.85*(1+n*.03),k:.15/.85*(1+n*.16),tilt:34*Math.PI/180+n*.035,speed:210/360,phase:-t*.045+oe()*.012,sweep:.34,hue:t*85+oe()*20,hueSpan:80,width:.095,cx:0,cy:0}}),ce=.129,le=`#2496e8`,ue=1.003,de=.15,A=1.14,j=.054,M=15.46,N=.186,fe=.412,P={yaw:28.49,pitch:28.62,roll:-13},F=e=>e*Math.PI/180;function I(e,t,n){let r=Math.cos(n),i=Math.sin(n);return[[e[0]*r+t[0]*i,e[1]*r+t[1]*i,e[2]*r+t[2]*i],[t[0]*r-e[0]*i,t[1]*r-e[1]*i,t[2]*r-e[2]*i]]}function L(e,t,n=M){let r=[0,0,1],i=[1,0,0],a=[0,1,0];[r,i]=I(r,i,F(e.yaw)),[a,r]=I(a,r,F(e.pitch)),[i,a]=I(i,a,F(e.roll));let o=e=>{let[o,s]=I(r,i,F(n*e));return{x:o[0]*t,y:o[1]*t,a:s[0],b:s[1],c:a[0],d:a[1],depth:o[2]}};return[o(-1),o(1)]}var R=C(24301),z=(()=>{let e=[],t=1.4;for(;t<900;)e.push(t),t+=1.9+R()*2.7,R()<.18&&(e.push(t),t+=.24);return e})(),pe=.18;function B(e){for(let t=0;t<z.length;t++){let n=z[t];if(e<n)break;let r=(e-n)/pe;if(r>=0&&r<=1)return r<.45?1-r/.45:(r-.45)/.55}return 1}function me(e,t={}){let{wander:n=1,blink:r=!0,float:i=!0}=t;return{dYaw:(S(e,11.3,.4)*5.5+S(e,3.7,2.1)*1.6)*n,dPitch:(S(e,9.1,1.3)*4.2+S(e,4.3,.7)*1.3)*n,dRoll:S(e,13.7,3.2)*2.2*n,lid:r?B(e):1,driftX:i?S(e,7.9,1.9)*.006:0,driftY:i?S(e,5.3,.3)*.007:0,breath:i?1+Math.sin(e/3.4*Math.PI*2)*.005:1}}function he(e){return .06+.94*y(e)}var V=(e,t,n=0,r=1)=>({w:e,h:t,tilt:n,open:r}),H=(e,t,n=0,r=1)=>[V(e,t,n,r),V(e,t,-n,r)],U=[{id:`neutre`,gaze:{...P},split:M,eyes:[V(N,fe),V(N,fe)]},{id:`attentif`,gaze:{yaw:4,pitch:5,roll:-4},split:16,eyes:H(.21,.44)},{id:`surpris`,gaze:{yaw:3,pitch:-3,roll:0},split:19,eyes:H(.45,.47)},{id:`excite`,gaze:{yaw:6,pitch:-14,roll:0},split:19.5,eyes:H(.4,.56,-10)},{id:`heureux`,gaze:{yaw:5,pitch:9,roll:0},split:17,eyes:H(.27,.17,14)},{id:`hilare`,gaze:{yaw:4,pitch:14,roll:0},split:18,eyes:H(.34,.13,20)},{id:`colere`,gaze:{yaw:3,pitch:7,roll:0},split:17,eyes:H(.34,.15,30)},{id:`triste`,gaze:{yaw:3,pitch:-13,roll:0},split:16,eyes:H(.22,.4,-28)},{id:`effraye`,gaze:{yaw:2,pitch:-20,roll:0},split:20.5,eyes:H(.4,.6)},{id:`mefiant`,gaze:{yaw:12,pitch:6,roll:-6},split:16,eyes:[V(.21,.4),V(.22,.15)]},{id:`confus`,gaze:{yaw:-14,pitch:3,roll:8},split:16.5,eyes:[V(.2,.44,-18),V(.28,.17,14)]},{id:`curieux`,gaze:{yaw:16,pitch:-9,roll:-15},split:16.5,eyes:[V(.24,.46,-8),V(.2,.38,-8)]},{id:`fier`,gaze:{yaw:5,pitch:17,roll:0},split:17,eyes:H(.3,.15,18)},{id:`timide`,gaze:{yaw:-19,pitch:-14,roll:-7},split:14,eyes:H(.17,.3)},{id:`blase`,gaze:{yaw:-22,pitch:2,roll:0},split:16,eyes:H(.3,.12)},{id:`somnolent`,gaze:{yaw:6,pitch:-9,roll:-3},split:16,eyes:H(.2,.42,0,.42)}],ge=new Map(U.map(e=>[e.id,e])),_e=`neutre`,ve=(e,t,n)=>({w:b(e.w,t.w,n),h:b(e.h,t.h,n),tilt:b(e.tilt??0,t.tilt??0,n),open:b(e.open,t.open,n)});function ye(e,t,n){return{id:t.id,gaze:{yaw:b(e.gaze.yaw,t.gaze.yaw,n),pitch:b(e.gaze.pitch,t.gaze.pitch,n),roll:b(e.gaze.roll,t.gaze.roll,n)},split:b(e.split,t.split,n),eyes:[ve(e.eyes[0],t.eyes[0],n),ve(e.eyes[1],t.eyes[1],n)]}}var be={egg:[.8369,.8424,.8497,.8585,.8674,.8775,.8878,.8983,.9089,.9185,.9288,.9374,.9445,.9504,.9543,.9559,.9555,.9519,.9466,.9389,.9302,.9193,.9085,.8969,.8852,.8734,.8625,.8513,.8411,.8325,.8243,.8179,.8137,.8112,.8102,.8128,.8178,.8262,.8374,.8518,.8702,.8922,.9169,.9446,.9741,1.0023,1.0267,1.0433,1.0481,1.0393,1.0216,.997,.9697,.9418,.9169,.8949,.876,.8604,.849,.8394,.8337,.8314,.8305,.8326],hexagon:[.921,.9282,.9441,.9706,.9984,1.0059,.9896,.9562,.929,.9124,.9047,.9058,.9157,.9349,.9642,.9873,.9882,.9665,.9336,.9105,.8968,.8918,.8955,.908,.9293,.9611,.982,.9812,.959,.9282,.9089,.8978,.8964,.9026,.9189,.9439,.9778,.999,.9964,.9713,.9439,.9274,.9196,.9206,.9308,.9502,.9799,1.0121,1.0226,1.0071,.9752,.951,.9366,.9316,.9351,.9485,.9711,1.0026,1.0213,1.0155,.9863,.9547,.9347,.9232],triangle:[.7819,.8211,.8747,.944,1.0223,1.096,1.1401,1.134,1.0808,1.0047,.9265,.8603,.8104,.773,.745,.7273,.7151,.7118,.7148,.7245,.7427,.768,.8037,.8518,.9148,.9876,1.0583,1.1073,1.1109,1.0667,.994,.9164,.8482,.7948,.7555,.7261,.7056,.6925,.6859,.6869,.6938,.7084,.7305,.7615,.804,.8595,.9311,1.0092,1.0791,1.1171,1.1054,1.0501,.9779,.905,.845,.799,.7656,.7413,.7258,.716,.7146,.7204,.733,.7528]},xe=Array.from({length:64},(e,t)=>t/64*v),W=xe.map(Math.cos),Se=xe.map(Math.sin);function Ce(e,t={}){return{radii:[...be[e]],rot:0,cx:0,cy:0,sx:1,sy:1,...t}}function G(e,t={}){return{radii:Array(64).fill(e),rot:0,cx:0,cy:0,sx:1,sy:1,...t}}function we(e,t,n,r){let i=r??{radii:Array(64),rot:0,cx:0,cy:0,sx:1,sy:1};for(let r=0;r<64;r++)i.radii[r]=b(e.radii[r]??1,t.radii[r]??1,n);let a=t.rot-e.rot;for(;a>Math.PI;)a-=v;for(;a<-Math.PI;)a+=v;return i.rot=e.rot+a*n,i.cx=b(e.cx,t.cx,n),i.cy=b(e.cy,t.cy,n),i.sx=b(e.sx,t.sx,n),i.sy=b(e.sy,t.sy,n),i}function K(e,t,n=[]){let r=Math.cos(e.rot),i=Math.sin(e.rot);for(let a=0;a<64;a++){let o=e.radii[a]??1,s=o*(W[a]??0),c=o*(Se[a]??0),l=s*r-c*i,u=s*i+c*r,d=n[a]??{x:0,y:0};d.x=(l*e.sx+e.cx)*t,d.y=(u*e.sy+e.cy)*t,n[a]=d}return n.length=64,n}function Te(e,t=1/6){let n=e.length;if(n<3)return``;let r=e[0],i=`M${w(r.x)} ${w(r.y)}`;for(let r=0;r<n;r++){let a=e[(r-1+n)%n],o=e[r],s=e[(r+1)%n],c=e[(r+2)%n],l=o.x+(s.x-a.x)*t,u=o.y+(s.y-a.y)*t,d=s.x-(c.x-o.x)*t,f=s.y-(c.y-o.y)*t;i+=`C${w(l)} ${w(u)} ${w(d)} ${w(f)} ${w(s.x)} ${w(s.y)}`}return`${i}Z`}function q(e,t,n){let r=Array(64).fill(0),i=e.length;for(let a=0;a<64;a++){let o=W[a]??0,s=Se[a]??0,c=0;for(let r=0;r<i;r++){let a=e[r],l=e[(r+1)%i],u=l.x-a.x,d=l.y-a.y,f=o*d-s*u;if(Math.abs(f)<1e-9)continue;let p=a.x-t,m=a.y-n,h=(p*d-m*u)/f,g=(p*s-m*o)/f;h>c&&g>=0&&g<=1&&(c=h)}r[a]=c}return r}function J(e,t,n,r,i,a,o=96){let s=r-e,c=i-t,l=Math.hypot(s,c)||1e-6,u=Math.atan2(c,s),d=Math.acos(Math.max(-1,Math.min(1,(n-a)/l))),f=[];for(let r=0;r<=o/2;r++){let i=u+d+(v-2*d)*r/(o/2);f.push({x:e+Math.cos(i)*n,y:t+Math.sin(i)*n})}for(let e=0;e<=o/2;e++){let t=u-d+2*d*e/(o/2);f.push({x:r+Math.cos(t)*a,y:i+Math.sin(t)*a})}return f}function Ee(e,t){let n=e.length,r=(t/v%1+1)%1*n,i=Math.floor(r);return b(e[i%n]??1,e[(i+1)%n]??1,r-i)}function De(e,t=1,n=1){return xe.map((r,i)=>(Math.abs((W[i]??0)/t)**e+Math.abs((Se[i]??0)/n)**e)**(-1/e))}function Oe(e){let t=Array(64).fill(0);for(let n=0;n<64;n++){let r=W[n]??0,i=Se[n]??0,a=0;for(let t of e){let e=r*t.x+i*t.y,n=e*e-(t.x*t.x+t.y*t.y-t.r*t.r);if(n<0)continue;let o=e+Math.sqrt(n);o>a&&(a=o)}t[n]=a}return t}function ke(e,t,n=10){let r=e.length,i=[],a=(e,t)=>{let n=t.x-e.x,r=t.y-e.y,i=Math.hypot(n,r)||1;return Math.atan2(-n/i,r/i)};for(let o=0;o<r;o++){let s=e[(o-1+r)%r],c=e[o],l=e[(o+1)%r],u=a(s,c),d=a(c,l)-u;for(;d>Math.PI;)d-=v;for(;d<-Math.PI;)d+=v;for(let e=0;e<=n;e++){let r=u+d*e/n;i.push({x:c.x+Math.cos(r)*t,y:c.y+Math.sin(r)*t})}}return i}function Ae(e,t,n,r=0){let i=r*Math.PI/180;return q(ke(Array.from({length:e},(r,a)=>{let o=i+a/e*v;return{x:Math.cos(o)*(t-n),y:Math.sin(o)*(t-n)}}),n),0,0)}function je(e,t=1){if(e.length<3)return``;let n=``;for(let r=0;r<e.length;r++){let i=e[r];n+=`${r===0?`M`:`L`}${w(i.x*t)} ${w(i.y*t)}`}return`${n}Z`}function Me(e,t){let n=Math.max(e,.01)/2,r=Math.max(t,.01)/2,i=Math.min(n,r);return`M${w(-n)} ${w(-r+i)}A${w(i)} ${w(i)} 0 0 1 ${w(-n+i)} ${w(-r)}L${w(n-i)} ${w(-r)}A${w(i)} ${w(i)} 0 0 1 ${w(n)} ${w(-r+i)}L${w(n)} ${w(r-i)}A${w(i)} ${w(i)} 0 0 1 ${w(n-i)} ${w(r)}L${w(-n+i)} ${w(r)}A${w(i)} ${w(i)} 0 0 1 ${w(-n)} ${w(r-i)}Z`}function Ne(e,t=1){let n=Math.max(...e);if(n<=0)return e;let r=t/n;return e.map(e=>e*r)}var Pe=Ne(Array.from({length:64},(e,t)=>t/64*Math.PI*2).map(e=>1+.075*Math.cos(2*e+.5)+.035*Math.cos(3*e+2.1)),1.02),Fe=Ne(Oe([{x:-.44,y:.2,r:.54},{x:.46,y:.2,r:.5},{x:.02,y:.3,r:.6},{x:-.24,y:-.3,r:.48},{x:.3,y:-.24,r:.44}]),1.02),Ie=Ne(q(J(0,.28,.66,0,-.96,.05),0,0),1.04),Le=q(J(-.42,0,.62,.42,0,.62),0,0),Re=[{id:`cercle`,radii:Array(64).fill(1)},{id:`galet`,radii:Pe},{id:`squircle`,radii:Ne(De(4.2),1.15)},{id:`capsule`,radii:Le},{id:`triangle`,radii:Ae(3,1.12,.34,-90)},{id:`hexagone`,radii:Ae(6,1.04,.26,0)},{id:`nuage`,radii:Fe},{id:`goutte`,radii:Ie}],ze=new Map(Re.map(e=>[e.id,e])),Be=`cercle`,Ve=[{id:`encre`,hex:`#0a0a0c`},{id:`brun`,hex:`#8b5e3c`},{id:`rouge`,hex:`#e8483f`},{id:`orange`,hex:`#f08a24`},{id:`ambre`,hex:`#f0b429`},{id:`vert`,hex:`#3ecf8e`},{id:`turquoise`,hex:`#2fbfa0`},{id:`bleu`,hex:`#3b93f0`},{id:`violet`,hex:`#8b5cf6`},{id:`rose`,hex:`#e152b0`},{id:`gris`,hex:`#a3a3a3`},{id:`creme`,hex:`#f1efe9`}],He=new Map(Ve.map(e=>[e.id,e])),Ue=`encre`;function We(e,t,n){let r=e=>{let t=parseInt(e.slice(1),16);return[t>>16&255,t>>8&255,t&255]},i=r(e),a=r(t);return`#${i.map((e,t)=>Math.round(e+(a[t]-e)*n)).map(e=>e.toString(16).padStart(2,`0`)).join(``)}`}var Y=(e,t)=>[{w:e,h:t,open:1},{w:e,h:t,open:1}];function X(e={}){return{sil:G(1),offX:0,offY:0,gaze:{...P},split:M,eyes:Y(N,fe),eyeAlpha:1,bodyAlpha:1,dots:[],arcs:[],notif:null,dotsBehind:!1,...e}}var Ge=-.1875,Ke=q(J(0,-.505,.132,0,.13,.075),0,Ge),qe=q(J(0,-.2535,.1345,0,.2535,.1345),0,0),Je=(e={})=>({radii:[...Ke],rot:0,cx:0,cy:Ge,sx:1,sy:1,...e}),Ye=(e={})=>({radii:[...qe],rot:0,cx:0,cy:0,sx:1,sy:1,...e}),Xe=je(J(0,0,.118,0,.172,.012)),Ze=.213;function Qe(e){return Ce(`triangle`,{rot:e,cx:-.213*Math.sin(e),cy:Ze*Math.cos(e)})}function $e(e,t){let n=((e-t*.5)/1.5%1+1)%1;return y((n<.5?.5-.5*Math.cos(n*v):0)*2)}var et=[{id:`idle`,duration:2.4,morph:.45,blinkIn:!1,baseFace:!0,baseBody:!0,pose:()=>X()},{id:`thinking`,duration:2.6,morph:.4,baseFace:!1,baseBody:!1,blinkIn:!0,pose:e=>{let t=$e(e,1),n=.3+.7*x.easeOutCubic(y(e/.3));return X({sil:G(D*(1+(O-1)*t),{cx:re[1]}),eyeAlpha:0,dots:[0,2].map(t=>{let r=$e(e,t);return{x:re[t]*n,y:0,r:D*(1+(O-1)*r),opacity:.55+.45*r}})})}},{id:`wink`,duration:1.6,morph:.3,blinkIn:!0,baseFace:!1,baseBody:!0,pose:()=>X({gaze:{yaw:-5.37,pitch:4.55,roll:6.7},split:16.25,eyes:[{w:.236,h:.464,open:1},{w:.447,h:.089,open:1}]})},{id:`wide`,duration:1.8,morph:.55,blinkIn:!0,baseFace:!1,baseBody:!0,pose:()=>X({gaze:{yaw:6.92,pitch:-21.96,roll:11.6},split:18.43,eyes:Y(.356,.875)})},{id:`alert`,duration:2.4,minDuration:2,morph:.45,baseFace:!1,baseBody:!1,blinkIn:!1,pose:e=>{let t=y(e/1.5),n=x.easeInOutCubic(t)*.82-.087,r=e>1.6?y((e-1.6)/.4):0,i=n*(1-r)+.1*r,a=Math.sin(e*2.5*v)*.005,o=17.7*Math.PI/180;return X({sil:Ye({rot:o,cx:i,cy:-.325-a}),eyeAlpha:0,dots:[{x:i-Math.sin(o)*.58,y:-.325+Math.cos(o)*.58+a*2.8,r:.118,d:Xe,rot:o*180/Math.PI,opacity:1}]})}},{id:`notify`,duration:2.2,morph:.5,blinkIn:!0,baseFace:!1,baseBody:!0,pose:e=>{let t=y(e/.45),n=1+(A-1)*Math.sin(t*Math.PI)*(1-t*.35),r=de*(t<1?n:1),i=-42*Math.PI/180;return X({gaze:{yaw:-21.94,pitch:-5.82,roll:-12.2},split:18.89,eyes:Y(.505,.498),notif:{x:Math.cos(i)*ue,y:Math.sin(i)*ue,r,notch:r+j}})}},{id:`exclaim`,duration:2,morph:.45,baseFace:!1,baseBody:!1,blinkIn:!1,pose:()=>X({sil:Je(),eyeAlpha:0,dots:[{x:-.012,y:.526,r:.113,opacity:1}]})},{id:`sleep`,duration:2.4,morph:.5,baseFace:!1,baseBody:!1,blinkIn:!1,pose:e=>X({sil:G(.1585,{cy:.11+Math.sin(v/.6*e)*.19}),eyeAlpha:0})},{id:`egg`,duration:1.8,morph:.4,baseFace:!1,baseBody:!1,blinkIn:!0,pose:()=>X({sil:Ce(`egg`),gaze:{yaw:19.97,pitch:26.01,roll:-17.1},split:11.07,eyes:Y(.164,.385)})},{id:`hexagon`,duration:1.6,morph:.4,baseFace:!1,baseBody:!1,blinkIn:!0,pose:()=>X({sil:Ce(`hexagon`),gaze:{yaw:23.11,pitch:24.42,roll:-13.3},split:13.37,eyes:Y(.177,.411)})},{id:`play`,duration:2,morph:.5,baseFace:!1,baseBody:!1,blinkIn:!0,pose:e=>{let t=y(e/.35)*y((2.2-e)/.5);return X({sil:Qe(0),gaze:{yaw:12,pitch:-8,roll:-6},split:15,eyes:Y(.18,.34),arcs:ne.map((n,r)=>({id:`sw${r}`,seed:{...n,cx:.45-e*.42},t:e,opacity:t}))})}},{id:`orbit`,duration:3.4,minDuration:2.5,morph:.6,baseFace:!1,baseBody:!1,blinkIn:!1,pose:e=>{let t=x.easeInOutCubic(y(e/.35)),n=-v*1.25*e*t,r=x.easeInOutCubic(y((e-1.6)/.9)),i=Qe(n),a=G(1,{rot:n}),o={radii:i.radii.map((e,t)=>e+(a.radii[t]-e)*r),rot:n,cx:i.cx*(1-r),cy:i.cy*(1-r),sx:1,sy:1},s=y(e/.8)*y((3.6-e)/.9);return X({sil:o,gaze:{yaw:P.yaw+Math.sin(e*6.5)*65*(1-r),pitch:-4+r*32,roll:-13},eyes:Y(.18,.34+r*.07),arcs:te.map((t,n)=>({id:`rg${n}`,seed:t,t:e,opacity:s*y((e-n*.13)/.3)}))})}},{id:`swirl`,duration:1.3,minDuration:1.3,morph:.3,baseFace:!0,baseBody:!0,blinkIn:!0,pose:e=>X({arcs:te.slice(0,3).map((t,n)=>({id:`sw${n}`,seed:t,t:e,opacity:y((e-n*.06)/.14)*y((1.22-e)/.34)}))})},{id:`burst`,duration:2.6,minDuration:2.4,morph:.4,baseFace:!1,baseBody:!1,blinkIn:!1,pose:e=>{let t=1-.834*x.easeOutQuint(y(e/.7)),n=x.easeOutQuint(y((e-1.7)/.7));return X({sil:G(t+(1-t)*n),eyeAlpha:y((e-1.85)/.4),dots:ae(e,1),dotsBehind:!0})}},{id:`comet`,duration:2.4,minDuration:2.4,morph:.45,baseFace:!1,baseBody:!1,blinkIn:!1,pose:e=>{let t=1-(1-ce)*x.easeOutQuint(y(e/.55)),n=x.easeOutQuint(y((e-1.85)/.6)),r=y((e-.15)/.25)*y((1.95-e)/.3);return X({sil:G(t+(1-t)*n,{cy:Math.sin(y(e/1.7)*Math.PI)*.035}),eyeAlpha:y((e-2)/.35),arcs:se.map((t,n)=>({id:`cm${n}`,seed:t,t:e,opacity:r}))})}}],Z=new Map(et.map(e=>[e.id,e])),tt={idle:1,thinking:1.1,wink:.8,wide:.8,alert:.75,notify:.9,exclaim:.8,sleep:.45,egg:.8,hexagon:.8,play:.9,orbit:1.2,swirl:.5,burst:.45,comet:1.15},nt=[`idle`,`thinking`,`wink`,`wide`,`alert`,`notify`,`exclaim`,`sleep`,`egg`,`hexagon`,`play`,`orbit`,`burst`,`comet`],Q=100,rt=7.1,it=5.5,at=.006,ot=.007;function st(e,t,n){let r=[],i=L(e.gaze,Q,e.split);for(let a=0;a<2;a++){let o=i[a];if(o.depth<=.02)continue;let s=e.eyes[a],c=(s.tilt??0)*Math.PI/180,l=Math.cos(c),u=Math.sin(c),d=o.a*l+o.c*u,f=o.b*l+o.d*u,p=-o.a*u+o.c*l,m=-o.b*u+o.d*l,h=Math.max(s.w*Q,.01)/2,g=Math.max(s.h*Q,.01)/2,_=Math.min(h,g),v=g>h,y=v?g-_:h-_,b=Ee(n,Math.atan2(o.y,o.x)-t.rot);r.push({x:o.x*b,y:o.y*b,ax:(v?p:d)*y,ay:(v?m:f)*y,r:_,m:[d,f,p,m]})}return r}function ct(e,t,n,r,i){let a=r-t,o=i-n,s=a*a+o*o,c=1/0,l=0,u=0;for(let r=0;r<e.length;r++){let i=e[r],d=s>0?((i.x-t)*a+(i.y-n)*o)/s:0;d=d<0?0:d>1?1:d;let f=t+d*a-i.x,p=n+d*o-i.y,m=f*f+p*p;m<c&&(c=m,l=f,u=p)}let d=Math.sqrt(c);return{d,ux:d>1e-9?l/d:0,uy:d>1e-9?u/d:0}}var lt=Math.hypot(at,ot)*Q;function ut(e,t,n,r){let i=1/0,a=0,o=0;for(let s of t){let t=s.x+n,c=s.y+r,l=ct(e,t-s.ax,c-s.ay,t+s.ax,c+s.ay),[u,d,f,p]=s.m,m=s.r*Math.hypot(u*l.ux+d*l.uy,f*l.ux+p*l.uy)+lt;l.d-m<i&&(i=l.d-m,a=l.ux,o=l.uy)}return{marge:i,ux:a,uy:o}}var dt=12,ft=8;function pt(e){if(!e.length)return{x:0,y:0};let t=(t,n)=>{let r=1/0;for(let i of e)r=Math.min(r,ut(i.contour,i.empreintes,t,n).marge);return r},n=1/0;for(let t of e)n=Math.min(n,ut(t.calContour,t.reference,0,0).marge);let r=0,i=0,a=e[0].empreintes;for(let e of a)r-=e.x/a.length,i-=e.y/a.length;let o=Math.max(.35*Q,Math.hypot(r,i)*1.25);n=Math.min(n,t(r,i));let s=t(0,0);if(s>=n&&s>=0)return{x:0,y:0};let c=Math.max(n,0),l=0,u=0,d=1/0,f=0,p=0,m=s;for(let e=0;e<dt;e++){let n=e/dt*Math.PI*2,r=Math.cos(n),i=Math.sin(n);if(t(r*o,i*o)<c){for(let e of[.3,.6,1]){let n=t(r*o*e,i*o*e);n>m&&(m=n,f=r*o*e,p=i*o*e)}continue}let a=0,s=o;for(let e=0;e<ft;e++){let e=(a+s)/2;t(r*e,i*e)>=c?s=e:a=e}s<d&&(d=s,l=r*s,u=i*s)}let h=d===1/0?f:l,g=d===1/0?p:u;return{x:+(h/Q).toFixed(6),y:+(g/Q).toFixed(6)}}function mt(e,t,n){return e.baseFace&&n?{gaze:n.gaze,split:n.split,eyes:n.eyes}:{gaze:t.gaze,split:t.split,eyes:t.eyes}}function ht(e){let t=e=>JSON.stringify([e.gaze,e.split,e.eyes,e.sil.rot,e.sil.cx,e.sil.cy,e.sil.sx,e.sil.sy]);return t(e.pose(0))===t(e.pose(e.duration))?[0]:Array.from({length:3},(t,n)=>n/2*e.duration)}function gt(e,t,n){let r=[];for(let i of ht(e)){let a=e.pose(i),o=K({...a.sil,radii:t},Q),s=K(a.sil,Q),c=mt(e,a,n),l=[];for(let e of[-7.1,rt])for(let t of[-5.5,it])l.push({...c,gaze:{yaw:c.gaze.yaw+e,pitch:c.gaze.pitch+t,roll:c.gaze.roll}});for(let e of l)r.push({empreintes:st(e,a.sil,t),reference:st(e,a.sil,a.sil.radii),contour:o,calContour:s})}return pt(r)}var _t={x:0,y:0},vt=(e,t)=>`${e}|${t??``}`;function yt(){return new Map(Re.map(e=>{let t=new Map;for(let n of et){if(!n.baseBody)continue;let r=n.baseFace?[null,...U]:[null];for(let i of r)t.set(vt(n.id,i?.id??null),gt(n,e.radii,i))}return[e.radii,t]}))}var bt=yt();function xt(e,t,n){if(!e)return _t;let r=bt.get(e);return r?r.get(vt(t,n))??r.get(vt(t,null))??_t:_t}var St={yaw:0,pitch:0,mix:0,spin:0,wander:1},Ct=(e,t,n)=>({yaw:b(e.yaw,t.yaw,n),pitch:b(e.pitch,t.pitch,n),mix:b(e.mix,t.mix,n),spin:b(e.spin,t.spin,n),wander:b(e.wander,t.wander,n)}),wt=(e,t,n)=>({w:b(e.w,t.w,n),h:b(e.h,t.h,n),open:b(e.open,t.open,n),tilt:b(e.tilt??0,t.tilt??0,n)});function Tt(e,t,n){let r=1-n;return{sil:we(e.sil,t.sil,n),offX:b(e.offX,t.offX,n),offY:b(e.offY,t.offY,n),gaze:{yaw:b(e.gaze.yaw,t.gaze.yaw,n),pitch:b(e.gaze.pitch,t.gaze.pitch,n),roll:b(e.gaze.roll,t.gaze.roll,n)},split:b(e.split,t.split,n),eyes:[wt(e.eyes[0],t.eyes[0],n),wt(e.eyes[1],t.eyes[1],n)],eyeAlpha:b(e.eyeAlpha,t.eyeAlpha,n),bodyAlpha:b(e.bodyAlpha,t.bodyAlpha,n),dots:[...e.dots.map(e=>({...e,opacity:e.opacity*r})),...t.dots.map(e=>({...e,opacity:e.opacity*n}))],arcs:[...e.arcs.map(e=>({...e,id:`a${e.id}`,opacity:e.opacity*r})),...t.arcs.map(e=>({...e,id:`b${e.id}`,opacity:e.opacity*n}))],notif:n<.5?e.notif:t.notif,dotsBehind:n<.5?e.dotsBehind:t.dotsBehind}}var Et=class e{scale;cur;prev=null;departFige=null;tCur=0;tPrev=0;blinkAt=-10;pts=[];shape=null;shapePrev=null;shapeAt=-10;expr=null;exprPrev=null;exprAt=-10;look=St;lookPrev=St;lookAt=-10;lookMorph=.24;static SHAPE_MORPH=.45;static LOOK_MORPH=.24;constructor(e=100,t=`idle`,n=null,r=null){this.scale=e,this.cur=t,this.shape=n,this.expr=r}setExpression(e,t=0){e!==this.expr&&(this.exprPrev=this.expr,this.expr=e,this.exprAt=t)}exprAtTime(t){let n=this.expr,r=this.exprPrev;if(!n||!r)return n;let i=(t-this.exprAt)/e.SHAPE_MORPH;return i>=1?n:ye(r,n,x.easeOutQuint(y(i)))}setShape(e,t=0){e!==this.shape&&(this.shapePrev=this.shape,this.shape=e,this.shapeAt=t)}shapeAtTime(t){let n=this.shape,r=this.shapePrev;if(!n||!r)return n;let i=(t-this.shapeAt)/e.SHAPE_MORPH;if(i>=1)return n;let a=x.easeOutQuint(y(i));return n.map((e,t)=>b(r[t]??e,e,a))}setLook(t,n,r=e.LOOK_MORPH){t&&!Number.isFinite(t.yaw+t.pitch+t.mix+t.spin+t.wander)||(this.lookPrev=this.lookAtTime(n),this.look=t??St,this.lookAt=n,this.lookMorph=r)}lookAtTime(e){let t=(e-this.lookAt)/this.lookMorph;return t>=1?this.look:Ct(this.lookPrev,this.look,x.easeOutQuint(y(t)))}posed(e,t,n,r){let i=e.pose(t);return e.baseBody&&n&&(i={...i,sil:{...i.sil,radii:n}}),e.baseFace&&r&&(i={...i,gaze:r.gaze,split:r.split,eyes:r.eyes}),i}decalageAtTime(t,n){let r=(e,n,r,i)=>{if(r===i)return i;let a=(t-e)/n;if(a>=1)return i;let o=x.easeOutQuint(y(a));return{x:b(r.x,i.x,o),y:b(r.y,i.y,o)}},i=t=>r(this.exprAt,e.SHAPE_MORPH,xt(t,n,this.exprPrev?.id??null),xt(t,n,this.expr?.id??null));return r(this.shapeAt,e.SHAPE_MORPH,i(this.shapePrev),i(this.shape))}get state(){return this.cur}reset(e,t){this.cur=e,this.prev=null,this.departFige=null,this.tCur=t,this.tPrev=t,this.blinkAt=-10}origine(e,t,n){if(this.departFige)return this.departFige;if(!this.prev)return null;let r=Z.get(this.prev);return this.posed(r,Math.max(0,e-this.tPrev),t,n)}poseComposee(e){let t=Z.get(this.cur),n=this.shapeAtTime(e),r=this.exprAtTime(e),i=this.posed(t,Math.max(0,e-this.tCur),n,r),a=e-this.tCur;if(a>=t.morph)return i;let o=this.origine(e,n,r);return o?Tt(o,i,x.easeOutQuint(y(a/t.morph))):i}setState(e,t){if(e===this.cur)return;let n=Z.get(this.cur).morph,r=this.prev!==null&&t-this.tCur<n;this.departFige=r?this.poseComposee(t):null,this.prev=this.cur,this.tPrev=this.tCur,this.cur=e,this.tCur=t,Z.get(e)?.blinkIn&&(this.blinkAt=t)}sample(e){let t=this.scale,n=Z.get(this.cur),r=this.shapeAtTime(e),i=this.exprAtTime(e),a=this.posed(n,Math.max(0,e-this.tCur),r,i),o=this.decalageAtTime(e,this.cur),s=e-this.tCur,c=s<n.morph?this.origine(e,r,i):null;if(c){let t=x.easeOutQuint(y(s/n.morph));a=Tt(c,a,t);let r=this.prev;if(r){let n=this.decalageAtTime(e,r);o={x:b(n.x,o.x,t),y:b(n.y,o.y,t)}}}let l=a.eyeAlpha>.01,u=this.lookAtTime(e),d=me(e,{wander:l?u.wander:0,blink:l}),f={yaw:b(a.gaze.yaw,u.yaw,u.mix)+d.dYaw-u.spin,pitch:b(a.gaze.pitch,u.pitch,u.mix)+d.dPitch,roll:a.gaze.roll+d.dRoll},p=y((e-this.blinkAt)/.2),m=p<1?Math.abs(p*2-1):1,h=Math.min(d.lid,m),g=a.offX+d.driftX,_=a.offY+d.driftY,v=Te(K({...a.sil,cx:a.sil.cx+g,cy:a.sil.cy+_,sy:a.sil.sy*d.breath},t,this.pts)),S=(e,t)=>Ee(a.sil.radii,Math.atan2(t,e)-a.sil.rot),C=[];if(a.eyeAlpha>.01){let e=L(f,t,a.split);for(let n=0;n<2;n++){let r=e[n];if(r.depth<=.02)continue;let i=a.eyes[n],s=S(r.x,r.y),c=(i.tilt??0)*Math.PI/180,l=Math.cos(c),u=Math.sin(c),d=r.a*l+r.c*u,f=r.b*l+r.d*u,p=-r.a*u+r.c*l,m=-r.b*u+r.d*l,v=he(Math.min(h,i.open));C.push({d:Me(i.w*t,i.h*t),matrix:`matrix(${w(d)},${w(f*v)},${w(p)},${w(m*v)},${w(r.x*s+(g+o.x)*t)},${w(r.y*s+(_+o.y)*t)})`,alpha:a.eyeAlpha*y(r.depth/.12)})}}let T=a.dots.filter(e=>e.opacity>.01&&e.r>5e-4).map(e=>({...e,x:(e.x+g)*t,y:(e.y+_)*t,r:e.r*t})),E=a.notif?S(a.notif.x,a.notif.y):1,te=a.notif?(a.notif.x*E+g)*t:0,ne=a.notif?(a.notif.y*E+_)*t:0,re=a.notif?{x:te,y:ne,r:a.notif.r*t}:null,D=a.notif?{x:te,y:ne,r:a.notif.notch*t}:null;return{bodyPath:v,bodyAlpha:a.bodyAlpha,eyes:C,dots:T,dotsBehind:a.dotsBehind,arcs:a.arcs.filter(e=>e.opacity>.01).map(e=>ee(e.seed,e.t,t,e.id,e.opacity)),notif:re,notch:D}}},Dt=1.1,Ot=1.5,kt=e=>({yaw:0,pitch:0,mix:0,spin:360*(1-x.easeInOutCubic(y(e/Ot))),wander:1});function At({nx:e,ny:t,tour:n,pointer:r}){return{yaw:-26+e*16,pitch:10-t*13,mix:n,spin:360*(1-n),wander:+!r}}var jt=Math.max(...et.map(e=>e.morph)),Mt=10,Nt=200,Pt=50,Ft=.1,It=`defaut`;function Lt(e){return Math.max(jt,Z.get(e)?.minDuration??jt)}function Rt(e,t){let n=Math.round(t/Ft)*Ft,r=Math.min(10,Math.max(Lt(e),n));return Math.round(r*100)/100}function zt(e){return{state:e,duration:Rt(e,Z.get(e)?.duration??2)}}function Bt(){return{name:``,id:It,blocks:nt.map(zt)}}function Vt(e){return e.reduce((e,t)=>e+t.duration,0)}function Ht(e,t){let n=0;for(let r=0;r<t&&r<e.length;r++)n+=e[r].duration;return n}function Ut(e,t){let n=Vt(e);if(!e.length||n<=0)return{index:0,elapsed:0};let r=t>=0&&t<n?t:(t%n+n)%n,i=0;for(let t=0;t<e.length;t++){let n=i+e[t].duration;if(r<n)return{index:t,elapsed:r-i};i=n}return{index:e.length-1,elapsed:0}}function Wt(e,t){return e.length>=200?e:[...e,zt(t)]}function Gt(e,t,n){let r=e.slice(),[i]=r.splice(t,1);return i?(r.splice(Math.min(Math.max(n,0),r.length),0,i),r):e}function Kt(e,t){let n=new Set(t.map(e=>e.name));if(!n.has(e))return e;let r=2;for(;n.has(`${e} ${r}`);)r++;return`${e} ${r}`}function qt(e){let t=new Set(e.map(e=>e.id)),n=1;for(;t.has(`c${n}`);)n++;return`c${n}`}function Jt(e){if(typeof e!=`object`||!e)return null;let{state:t,duration:n}=e;return typeof t!=`string`||!nt.includes(t)||typeof n!=`number`||!Number.isFinite(n)?null:{state:t,duration:Rt(t,n)}}function Yt(e,t){if(typeof e!=`object`||!e)return null;let{id:n,name:r,blocks:i}=e;if(typeof n!=`string`||!n||typeof r!=`string`||!Array.isArray(i))return null;let a=i.slice(0,200).map(Jt).filter(e=>e!==null);return!a.length||t.some(e=>e.id===n)?null:{id:n,name:r,blocks:a}}function Xt(e){if(!e)return[];let t;try{t=JSON.parse(e)}catch{return[]}if(!Array.isArray(t))return[];let n=[];for(let e of t.slice(0,50)){let t=Yt(e,n);t&&n.push(t)}return n}var Zt=100,Qt=158,$t=[`<g`,`>`,`</g>`],en=`<svg... viewBox="." role="img". class="." style="."><defs><mask. maskUnits="userSpaceOnUse"....><path. fill="#fff"></path><!--$-->.<!--/--><!--$-->.<!--/--></mask><!--$-->.<!--/--></defs><g fill="none" stroke-linecap="round">.</g><!--$-->.<!--/--><g.><path..></path><g mask="."><rect.....></rect></g></g><!--$-->.<!--/--><!--$-->.<!--/--><g fill="none" stroke-linecap="round">.</g></svg>`.split(`.`),tn=[`<path`,``,``,``,` fill="#000"></path>`],nn=[`<circle`,``,``,``,` fill="#000"></circle>`],rn=[`<linearGradient`,` id="`,`" gradientUnits="userSpaceOnUse"`,``,``,``,`>`,`</linearGradient>`],an=[`<stop`,``,``,`></stop>`],on=[`<path`,``,` stroke="`,`"`,``,`></path>`],sn=[`<circle`,``,``,``,``,`></circle>`];function $(e,t,n){d(e,(e,n)=>{_(()=>t(e,n))},n?.defer?{defer:!0}:void 0)}function cn(v){var y,b,x,S;let C=n({size:320,shape:Be,color:Ue,expression:_e,paper:`#f9f9f9`,cycle:Bt().blocks,follow:!1,gaze:null,ariaLabel:`Animated Bloub avatar`},v),[w,T]=p(0),[ee,E]=p(`idle`),[te]=p(!1),[ne,re]=p(0),D=()=>v.block??w(),O=()=>v.state??ee(),k=()=>v.playing??te(),ie=()=>v.elapsed??ne();function ae(e){v.block===void 0&&T(e),v.onBlockChange?.(e)}function oe(e){v.state===void 0&&E(e),v.onStateChange?.(e)}function se(e){v.elapsed===void 0&&re(e),v.onElapsedChange?.(e)}let ce=f(()=>ze.get(C.shape)?.radii??null),ue=f(()=>He.get(C.color)?.hex??`#0a0a0c`),de=f(()=>ge.get(C.expression)??null),A=_(()=>new Et(100,O(),ce(),de())),[j,M]=p(_(()=>A.sample(C.frozenAt??0)),{equals:!1}),N=m(),fe=`bot-mask-${N}`,P=0,F=1/0,I=0,L=0,R=0,z=0,pe=-1;function B(e,t=0){let n=C.cycle[e];if(!n){F=1/0;return}R=L-t,se(t),oe(n.state),A.setState(n.state,L),F=k()?R+n.duration:1/0}function me(e){ae(e),B(e)}function he(e,t=0){if(D()===e){B(e,t);return}z=t,ae(e)}function V(e){let t=C.cycle;if(!t.length)return;let{index:n}=Ut(t,e);if(n!==pe){let e=t[n];oe(e.state),n<pe?A.reset(e.state,Ht(t,n)):A.setState(e.state,Ht(t,n)),pe=n}M(A.sample(e))}let H=!1,U=0,ve=!1,ye=1/60;function be(e){e.pointerType!==`touch`&&(e.clientX,e.clientY)}function xe(){}function W(){H&&=(A.setLook(null,L,Dt),!1)}function Se(){if(!Z.get(O())?.baseFace){W();return}}function Ce(e){A.setLook(e(L-U),L,ye)}function G(){window.removeEventListener(`pointermove`,be),document.removeEventListener(`pointerleave`,xe)}function we(e){P=requestAnimationFrame(we);let t=I?Math.min((e-I)/1e3,.064):0;I=e,L+=t,k()&&(L>=F&&C.cycle.length?me((D()+1)%C.cycle.length):se(L-R)),C.follow?Se():C.gaze&&Ce(C.gaze),M(A.sample(L))}function K(){C.frozenAt!==void 0&&M(A.sample(C.frozenAt))}$(()=>C.gaze,e=>{e?(U=L,ve=!0,A.setLook(e(0),L-ye,ye)):ve&&=(A.setLook(null,L),!1)}),$(D,e=>{B(e,z),z=0},{defer:!0}),$(O,e=>{A.state!==e&&(A.setState(e,L),K())},{defer:!0}),$(k,e=>{e?B(D(),ie()):F=1/0},{defer:!0}),$(()=>C.cycle,e=>{if(!e.length){F=1/0;return}let t=Math.min(D(),e.length-1);t===D()?F=k()?R+e[t].duration:1/0:me(t)},{defer:!0}),$(ce,e=>{A.setShape(e,L),K()},{defer:!0}),$(de,e=>{A.setExpression(e,L),K()},{defer:!0}),$(()=>C.frozenAt,K,{defer:!0}),d(()=>C.follow&&C.frozenAt===void 0,e=>{e?(window.addEventListener(`pointermove`,be),document.addEventListener(`pointerleave`,xe)):(G(),W())}),g(()=>{v.ref?.({get svg(){},seek:he,renderAt:V}),C.frozenAt===void 0&&(B(D(),ie()),P=requestAnimationFrame(we))}),h(()=>{typeof cancelAnimationFrame<`u`&&cancelAnimationFrame(P),typeof window<`u`&&G()});function Te(e){let t={fill:e.color??(e.depth===void 0?ue():We(C.paper,ue(),e.depth)),opacity:e.opacity};return e.d?{...t,d:e.d,transform:`translate(${e.x} ${e.y}) rotate(${e.rot??0}) scale(100)`}:{...t,cx:e.x,cy:e.y,r:e.r}}let q=()=>l({get each(){return j().dots},children:t=>e(n({get component(){return t.d?`path`:`circle`}},()=>Te(t)))});var J=s(),Ee=o(()=>[i(`width`,t(C.size,!0)),i(`height`,t(C.size,!0))],2),De=o(()=>[i(`aria-label`,t(C.ariaLabel,!0)),a(C.class),c(C.style)],3),Oe=()=>i(`d`,t(j().bodyPath,!0)),ke=t(l({get each(){return j().eyes},children:e=>{var n,a;return n=s(),a=o(()=>[i(`d`,t(e.d,!0)),i(`transform`,t(e.matrix,!0)),i(`opacity`,t(e.alpha,!0))],3),r(tn,n,a,a,a)}})),Ae=t(u({get when(){return j().notch},children:e=>{var n,a;return n=s(),a=o(()=>[i(`cx`,t(e().x,!0)),i(`cy`,t(e().y,!0)),i(`r`,t(e().r,!0))],3),r(nn,n,a,a,a)}})),je=t(l({get each(){return j().arcs},children:e=>{var n,a,c;return n=s(),a=o(()=>[`${t(N,!0)}-${t(e.id,!0)}`,i(`x1`,t(e.grad.x1,!0)),i(`y1`,t(e.grad.y1,!0)),i(`x2`,t(e.grad.x2,!0)),i(`y2`,t(e.grad.y2,!0))],5),c=t(l({get each(){return e.grad.stops},children:(n,a)=>{var o,c;return o=s(),c=()=>i(`offset`,t(a(),!0)/(t(e.grad.stops.length,!0)-1)),r(an,o,c,i(`stop-color`,t(n,!0)))}})),r(rn,n,a,a,a,a,a,c)}})),Me=t(l({get each(){return j().arcs},children:e=>{var n,a;return n=s(),a=o(()=>[i(`d`,t(e.back,!0)),`url(#${t(N,!0)}-${t(e.id,!0)})`,i(`stroke-width`,t(e.width,!0)),i(`opacity`,t(e.opacity,!0))],4),r(on,n,a,a,a,a)}})),Ne=t(u({get when(){return j().dotsBehind},get children(){return y=s(),b=t(q({})),r($t,y,b)}})),Pe=o(()=>[i(`opacity`,t(j().bodyAlpha,!0)),i(`d`,t(j().bodyPath,!0)),i(`fill`,t(C.paper,!0))],3),Fe=()=>i(`fill`,t(ue(),!0)),Ie=t(u({get when(){return!j().dotsBehind},get children(){return x=s(),S=t(q({})),r($t,x,S)}})),Le=t(u({get when(){return j().notif},children:e=>{var n,a;return n=s(),a=o(()=>[i(`cx`,t(e().x,!0)),i(`cy`,t(e().y,!0)),i(`r`,t(e().r,!0))],3),r(sn,n,a,a,a,i(`fill`,t(le,!0)))}})),Re=t(l({get each(){return j().arcs},children:e=>{var n,a;return n=s(),a=o(()=>[i(`d`,t(e.front,!0)),`url(#${t(N,!0)}-${t(e.id,!0)})`,i(`stroke-width`,t(e.width,!0)),i(`opacity`,t(e.opacity,!0))],4),r(on,n,a,a,a,a)}}));return r(en,J,Ee,Ee,`-158 -158 ${t(158,!0)*2} ${t(158,!0)*2}`,De,De,De,i(`id`,t(fe,!0)),i(`x`,-158),i(`y`,-158),i(`width`,t(158,!0)*2),i(`height`,t(158,!0)*2),Oe,ke,Ae,je,Me,Ne,Pe,Pe,Pe,`url(#${t(fe,!0)})`,i(`x`,-158),i(`y`,-158),i(`width`,t(158,!0)*2),i(`height`,t(158,!0)*2),Fe,Ie,Le,Re)}export{cn as BloubBot,Et as BotEngine,Ve as COLORS,He as COLOR_BY_ID,Ue as DEFAULT_COLOR,_e as DEFAULT_EXPRESSION,Be as DEFAULT_SHAPE,Qt as DEMI_VIEWBOX,U as EXPRESSIONS,ge as EXPRESSION_BY_ID,Mt as MAX_BLOCK,Nt as MAX_BLOCS,Pt as MAX_CYCLES,jt as MIN_BLOCK,tt as POSES,Zt as RAYON,nt as SEQUENCE,Re as SHAPES,ze as SHAPE_BY_ID,et as STATES,Z as STATE_BY_ID,Ft as STEP,Ot as TOUR_TIME,Dt as TURN_TIME,ye as blendExpression,Ut as blockAt,Wt as blocksWith,Rt as clampDuration,Bt as defaultCycle,At as lookTarget,zt as makeBlock,Lt as minDurationOf,We as mixHex,Gt as moveBlock,qt as nextCycleId,Ht as offsetOf,Xt as parseCycles,Vt as totalDuration,kt as tourLook,Kt as uniqueName};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@norbert_bodziony/bloub",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "SVG recreation of the x.ai bot avatar. One shape morphing through 14 states, measured off the reference video frame by frame.",
|
|
7
7
|
"license": "MIT",
|
|
@@ -52,18 +52,20 @@
|
|
|
52
52
|
"prepublishOnly": "bun run test && bun run typecheck && bun run pack:check"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
|
-
"
|
|
55
|
+
"@solidjs/web": "^2.0.0-rc.0",
|
|
56
|
+
"solid-js": "^2.0.0-rc.0"
|
|
56
57
|
},
|
|
57
58
|
"devDependencies": {
|
|
58
59
|
"@tailwindcss/vite": "^4.3.3",
|
|
59
60
|
"@types/node": "^26.0.0",
|
|
61
|
+
"@solidjs/vite-plugin": "3.0.0-next.30",
|
|
62
|
+
"@solidjs/web": "2.0.0-rc.0",
|
|
60
63
|
"happy-dom": "^20.11.2",
|
|
61
64
|
"mediabunny": "^1.54.0",
|
|
62
|
-
"solid-js": "
|
|
65
|
+
"solid-js": "2.0.0-rc.0",
|
|
63
66
|
"tailwindcss": "^4.3.3",
|
|
64
67
|
"typescript": "^5.9.3",
|
|
65
68
|
"vite": "^8.2.1",
|
|
66
|
-
"vite-plugin-solid": "^2.11.14",
|
|
67
69
|
"vitest": "^4.1.10"
|
|
68
70
|
}
|
|
69
71
|
}
|