@joy-ride/joy-ride 0.6.0 → 0.7.0

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.
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./vehicle-popover-C0m9IGMZ.js","./rolldown-runtime-XKyaHtl9.js","./bookmarklet-CETkHiK_.js","./IconBase.es-CgBjh3hj.js","../embed-assets/vehicle-popover-B6vGzw7u.css"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./vehicle-popover-CPOB9Lo3.js","./rolldown-runtime-XKyaHtl9.js","./bookmarklet-CETkHiK_.js","./IconBase.es-CgBjh3hj.js","../embed-assets/vehicle-popover-B6vGzw7u.css"])))=>i.map(i=>d[i]);
2
2
  import{r as e,t}from"./rolldown-runtime-XKyaHtl9.js";import{$ as n,A as r,At as i,B as a,C as o,Ct as s,D as c,Dt as l,E as u,Et as d,F as f,Ft as p,G as m,H as h,I as g,It as _,J as v,K as y,L as b,Lt as x,M as S,Mt as C,N as w,Nt as T,O as E,Ot as D,P as ee,Pt as te,Q as ne,R as re,S as O,St as ie,T as k,Tt as A,U as ae,V as oe,W as se,X as ce,Y as le,_ as ue,_t as de,a as fe,at as pe,bt as me,c as he,ct as ge,d as j,dt as M,et as _e,f as ve,ft as ye,g as be,gt as xe,h as Se,ht as Ce,i as we,it as Te,j as N,jt as Ee,k as De,kt as Oe,l as ke,m as Ae,n as je,o as Me,ot as Ne,p as Pe,q as Fe,r as Ie,rt as Le,s as Re,st as ze,t as Be,tt as Ve,u as He,ut as Ue,v as We,vt as Ge,w as Ke,wt as qe,x as Je,xt as Ye,y as Xe,yt as Ze,z as Qe}from"./bookmarklet-CETkHiK_.js";import{H as $e,n as et,r as tt,t as nt}from"./IconBase.es-CgBjh3hj.js";var rt=Oe.map(e=>`Digit${e}`),it=[{id:`accelerate`,label:`Accelerate`,keys:[`W`,`↑`],codes:[`KeyW`,`ArrowUp`]},{id:`reverse`,label:`Reverse`,keys:[`S`,`↓`],codes:[`KeyS`,`ArrowDown`]},{id:`left`,label:`Steer left`,keys:[`A`,`←`],codes:[`KeyA`,`ArrowLeft`]},{id:`right`,label:`Steer right`,keys:[`D`,`→`],codes:[`KeyD`,`ArrowRight`]},{id:`handbrake`,label:`Handbrake`,keys:[`Space`],codes:[`Space`]},{id:`boost`,label:`Hold boost / charge burnout launch`,keys:[`Shift`],codes:[`ShiftLeft`,`ShiftRight`]},...Oe.map(e=>({id:`slot${e}`,label:`Use assigned action in slot ${e}`,keys:[String(e)],codes:[`Digit${e}`]})),{id:`slowMo`,label:`Hold slow-mo`,keys:[`V`],codes:[`KeyV`]},{id:`underglow`,label:`Toggle underglow`,keys:[`U`],codes:[`KeyU`]},{id:`horn`,label:`Horn`,keys:[`H`],codes:[`KeyH`]},{id:`record`,label:`Record`,keys:[`R`],codes:[`KeyR`]},{id:`clean`,label:`Reset screen`,keys:[`C`],codes:[`KeyC`]},{id:`targets`,label:`Flash destroyable objects`,keys:[`F`],codes:[`KeyF`]},{id:`pause`,label:`Pause`,keys:[`P`],codes:[`KeyP`]},{id:`exit`,label:`Exit`,keys:[`Esc`],codes:[`Escape`]}],at=new Set([`KeyW`,`KeyA`,`KeyS`,`KeyD`,`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Space`,`ShiftLeft`,`ShiftRight`,...rt]),ot=new Set([`KeyR`,`KeyU`,`KeyC`,`KeyF`,`KeyV`,`KeyP`,`KeyB`,`KeyG`,`KeyZ`,`KeyX`,`Escape`]);function st(e){return(e instanceof Event?e.composedPath():[e]).some(e=>e instanceof Element&&!!e.closest(`input, textarea, select, [contenteditable="true"]`))}function ct(e){return{throttle:Number(e.has(`KeyW`)||e.has(`ArrowUp`))-Number(e.has(`KeyS`)||e.has(`ArrowDown`)),steer:Number(e.has(`KeyA`)||e.has(`ArrowLeft`))-Number(e.has(`KeyD`)||e.has(`ArrowRight`)),action:e.has(`Space`),boost:e.has(`ShiftLeft`)||e.has(`ShiftRight`),slots:Oe.filter(t=>e.has(`Digit${t}`))}}var lt=new Set([`KeyW`,`ArrowUp`,`KeyS`,`ArrowDown`,`KeyA`,`ArrowLeft`,`KeyD`,`ArrowRight`,`Space`,`ShiftLeft`,`ShiftRight`,`KeyH`,`Digit1`,`Digit2`,`Digit3`,`Digit4`,`Digit5`,`Digit6`,`Digit7`,`Digit8`,`Digit9`]),ut=e=>lt.has(e),dt=class{metadata;elapsed=0;held=new Set;events=[];constructor(e){this.metadata=e,this.metadata=structuredClone(e)}get elapsedMs(){return Math.round(this.elapsed)}advance(e){this.elapsed+=e*1e3}down(e){ut(e)&&!this.held.has(e)&&(this.held.add(e),this.events.push({atMs:this.elapsedMs,code:e,type:`down`}))}up(e){ut(e)&&this.held.delete(e)&&this.events.push({atMs:this.elapsedMs,code:e,type:`up`})}releaseAll(){for(let e of[...this.held])this.up(e)}finish(){return this.releaseAll(),structuredClone({...this.metadata,durationMs:this.elapsedMs,events:this.events})}},ft=class{elapsed=0;index=0;pendingWeaponPresses=new Set;held=new Set;recording;constructor(e){this.recording=structuredClone(e)}get elapsedMs(){return Math.min(this.recording.durationMs,Math.round(this.elapsed))}get complete(){return Math.round(this.elapsed)>=this.recording.durationMs&&this.index>=this.recording.events.length}applyThrough(e){for(;this.index<this.recording.events.length&&this.recording.events[this.index].atMs<=e;){let e=this.recording.events[this.index++];e.type===`down`?(this.held.add(e.code),/^Digit[1-9]$/.test(e.code)&&this.pendingWeaponPresses.add(e.code)):this.held.delete(e.code)}}next(e){this.applyThrough(Math.round(this.elapsed));let t=ct(this.held);return t.slotPresses=[...this.pendingWeaponPresses].map(e=>Number(e.slice(-1))),this.pendingWeaponPresses.clear(),this.elapsed+=e*1e3,Math.round(this.elapsed)>=this.recording.durationMs&&this.applyThrough(this.recording.durationMs),t}};function pt(e){if(!e||typeof e!=`object`)throw Error(`This is not a Joy Ride recording.`);let t=e,n=e=>typeof e==`number`&&Number.isFinite(e),r=t.viewport,i=t.initial;if(t.format!==`joy-ride-recording`||t.version!==2||typeof t.createdAt!=`string`||typeof t.viewportWalls!=`boolean`||!r||!n(r.widthPx)||r.widthPx<=0||!n(r.heightPx)||r.heightPx<=0||!n(r.pixelsPerMeter)||r.pixelsPerMeter<=0||!i||![`xPx`,`yPx`,`angleRad`,`velocityXMps`,`velocityYMps`,`spinRadPerSecond`].every(e=>n(i[e]))||!Number.isSafeInteger(t.durationMs)||t.durationMs<0||t.durationMs>18e5||!Array.isArray(t.events)||t.events.length>2e4)throw Error(`This recording has missing or invalid fields.`);let a=new Set,o=0;for(let e of t.events){if(!e||typeof e!=`object`)throw Error(`Invalid key event.`);let n=e;if(!Number.isSafeInteger(n.atMs)||n.atMs<o||n.atMs>t.durationMs||typeof n.code!=`string`||!ut(n.code)||n.type!==`down`&&n.type!==`up`)throw Error(`Invalid key event.`);if(n.type===`down`){if(a.has(n.code))throw Error(`A key was pressed twice without release.`);a.add(n.code)}else if(!a.delete(n.code))throw Error(`A key was released before it was pressed.`);o=n.atMs}if(a.size)throw Error(`This recording ends with keys still held.`);let s=m(t.vehicle);return structuredClone({...t,vehicle:s})}var mt=`joy-ride:recording:v2`;function ht(){try{let e=localStorage.getItem(mt);if(e===null)return null;let t=JSON.parse(e);if(!t||typeof t!=`object`)return null;let n=t;return n.recording==null?null:pt(n.recording)}catch{return null}}var gt=class{listeners=new Set;state;constructor(e=`playback`){let t=ht();this.state={recording:t,mode:t?`ready`:`idle`,uiMode:e,pose:`recorded`,customPose:null,playbackStart:null,showPath:!1,error:null}}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});update(e,t=!1){if(this.state={...this.state,...e},t)try{localStorage.setItem(mt,JSON.stringify({version:2,recording:this.state.recording}))}catch{this.state.error=`Browser storage is unavailable. Export the recording to keep it.`}this.listeners.forEach(e=>e())}setRecording(e){let t=pt(e);this.update({recording:t,mode:`ready`,pose:`recorded`,customPose:null,playbackStart:null,error:null},!0)}clear(){this.update({recording:null,mode:`idle`,pose:`recorded`,customPose:null,playbackStart:null,showPath:!1,error:null},!0)}setMode(e){this.update({mode:e,playbackStart:e===`playing`?this.state.playbackStart:null,error:null})}setUiMode(e){this.update({uiMode:e})}beginPlayback(e){this.update({mode:`playing`,playbackStart:e,error:null})}setShowPath(e){this.update({showPath:e})}setPose(e,t){this.update({pose:e,customPose:e===`custom`?t??this.state.customPose:null})}setError(e){this.update({error:e})}};function _t(e){let t=new Blob([JSON.stringify(e,null,2)],{type:`application/json`}),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=`joy-ride-recording.json`,r.click(),setTimeout(()=>URL.revokeObjectURL(n),1e3)}var vt=1/120,yt=class{sim=new Je;playback;steps;sampleEvery;index=0;points=[N()];angle=0;constructor(e,t){this.sim.setPreset(t),this.sim.body.angle=e.initial.angleRad,this.sim.body.velocity=N(e.initial.velocityXMps,e.initial.velocityYMps),this.sim.body.spin=e.initial.spinRadPerSecond,this.playback=new ft(e),this.steps=Math.ceil(e.durationMs/(vt*1e3)),this.sampleEvery=Math.max(4,Math.ceil(this.steps/4e3)),this.angle=this.sim.body.angle}advance(e){let t=Math.min(this.steps,this.index+e);for(;this.index<t;)this.sim.tick(this.playback.next(vt),vt,null),this.index++,(this.index%this.sampleEvery===0||this.index===this.steps)&&this.points.push({...this.sim.body.position});return this.angle=this.sim.body.angle,this.index>=this.steps}},bt=(e,t)=>e.childNodes.length===1&&e.firstChild===t.node&&t.node.data===t.last,xt=class{registry;values=new Map;disposed=!1;constructor(e){this.registry=e}update(e){if(this.disposed)return;let t=new Set;for(let n of this.registry.objects){let r=n.spec.hud;if(!r||n.spec.enabled===!1)continue;let i=n.target;t.add(i);let a=St(r,e),o=this.values.get(i);if(!o||!bt(i,o)){let e=[...i.childNodes],t=i.ownerDocument.createTextNode(a);i.replaceChildren(t),o={original:e,node:t,last:a},this.values.set(i,o)}else o.last!==a&&(o.node.data=a,o.last=a)}for(let e of this.values.keys())t.has(e)||this.restore(e)}restore(e){let t=this.values.get(e);t&&(bt(e,t)&&e.replaceChildren(...t.original),this.values.delete(e))}dispose(){if(!this.disposed){this.disposed=!0;for(let e of this.values.keys())this.restore(e)}}};function St(e,t){let n=e.field===`speed`?t.speedMps:t[e.field];return e.field===`gear`?n==null?`—`:String(n):typeof n!=`number`||!Number.isFinite(n)?`—`:(e.field===`speed`&&(n*=e.unit===`kmh`?3.6:e.unit===`mps`?1:1/.44704),n.toFixed(e.precision??0))}var Ct=[`low`,`medium`,`high`],wt=1e3/60,Tt=2e3,Et=8,Dt=2e3,Ot=1e4,kt=12e4,At=5e3,jt=class{cap=Ct.length-1;misses=[];lastTime=null;lastChange=-1/0;lastStepUp=-1/0;stepUpDelay=Ot;get limit(){return Ct[this.cap]}apply(e){return Ct[Math.min(Ct.indexOf(e),this.cap)]}sample(e,t,n,r){let i=this.lastTime;if(this.lastTime=e,i===null)return!1;let a=e-i;if(!(a>0)||a>250)return!1;for(a>wt*1.5&&t<wt*.8&&n&&this.misses.push(e);this.misses.length&&e-this.misses[0]>Tt;)this.misses.shift();if(e-this.lastChange<Dt)return!1;let o=Ct.indexOf(r);return this.misses.length>=Et&&Math.min(this.cap,o)>0?(e-this.lastStepUp<At&&(this.stepUpDelay=Math.min(kt,this.stepUpDelay*2)),this.cap=Math.min(this.cap,o)-1,this.changed(e),!0):n&&this.cap<o&&!this.misses.length&&e-this.lastChange>=this.stepUpDelay?(this.cap++,this.lastStepUp=e,this.changed(e),!0):!1}restoreLimit(e){this.cap=e?Math.max(0,Ct.indexOf(e)):Ct.length-1,this.misses=[],this.lastTime=null}reset(){this.cap=Ct.length-1,this.misses=[],this.lastTime=null,this.lastChange=this.lastStepUp=-1/0,this.stepUpDelay=Ot}changed(e){this.lastChange=e,this.misses=[]}};function Mt(e,t){let n=t.x-e.point.x,r=t.y-e.point.y;if(Math.hypot(e.direction.x,e.direction.y)<.1)return Math.exp(-(n*n+r*r)/Math.max(1,e.radius*e.radius))*e.intensity;let i=n*e.direction.x+r*e.direction.y;if(i<0||i>e.range)return 0;let a=n*-e.direction.y+r*e.direction.x,o=e.radius+i*e.spread,s=i/Math.max(1,e.range),c=Math.max(0,Math.min(1,(1-s)/.36));return Math.exp(-(a*a)/Math.max(1,o*o))*c*c*(3-2*c)*(1-s*.42)*e.intensity}var Nt=`
3
3
  uniform int vehicleLightCount;
4
4
  uniform vec4 vehicleLightPosition[12];
@@ -645,7 +645,7 @@ void main() {
645
645
  smoke = scatterVehicleLight(smoke, material.a, vec2(vUv.x, 1.0 - vUv.y) * size, darkBackground);
646
646
  color = vec4((rgb * flameAlpha + smoke * smokeAlpha) / max(alpha, 0.0001),
647
647
  alpha * lifecycleOpacity);
648
- }`},wf=class{quality;tint;vorticity;flamePalette;flameSmokeTail;ghostPalette;agePalette;ghostStyle=`phantom`;batchStamps=new Float32Array(64);batchValues=new Float32Array(64);canvas=document.createElement(`canvas`);gl;programs={};quad;positions={};lightPositions=new Float32Array(48);lightShapes=new Float32Array(48);lightColors=new Float32Array(48);flameStampProgram=null;flameStampBuffer=null;flameSource=null;flameInk=null;sceneInk=new Map;flameStampData=new Float32Array(10240);simulation;dyeSize;velocity;dye;pressure;curl;divergence;wallTexture=null;wallPixels=new Uint8Array;wallNext=new Uint8Array;hasWalls=!1;allSurfaces=[];width=1;height=1;pixelRatio=1;presentationPixelRatio;view=null;active=!1;sceneFireActive=!1;radialBlasts=[];idle=0;lost=!1;flameOrigin={x:0,y:0};gpuTimer=null;beginGpu(e){}endGpu(){this.gpuTimer?.end()}captureState(){if(this.lost)throw Error(`Cannot checkpoint a lost fluid context`);let e=this.gl,t=this.active||this.sceneFireActive||this.radialBlasts.length>0,n=t?new gf(e,this.velocity.read.framebuffer,this.velocity.read.width,this.velocity.read.height,e.RGBA16F,e.HALF_FLOAT):null,r=null;try{r=t?new gf(e,this.dye.read.framebuffer,this.dye.read.width,this.dye.read.height,e.RGBA16F,e.HALF_FLOAT):null}catch(e){throw n?.dispose(),e}return{velocity:n,dye:r,width:this.width,height:this.height,quality:this.quality,view:A(this.view),active:this.active,sceneFireActive:this.sceneFireActive,idle:this.idle,radialBlasts:A(this.radialBlasts),flameOrigin:A(this.flameOrigin),dispose:()=>{n?.dispose(),r?.dispose()}}}restoreState(e){if(this.lost)throw Error(`Cannot restore a lost fluid context`);this.quality=e.quality,this.resize(e.width,e.height,!0),this.reset(),e.velocity?.restore(this.velocity.read.framebuffer,this.velocity.read.width,this.velocity.read.height),e.dye?.restore(this.dye.read.framebuffer,this.dye.read.width,this.dye.read.height),this.view=A(e.view),this.active=e.active,this.sceneFireActive=e.sceneFireActive,this.idle=e.idle,this.radialBlasts=A(e.radialBlasts),this.flameOrigin=A(e.flameOrigin)}constructor(e,t,n,r=`natural`,i=18,a=!1,o=!1,s=!1,c=!1){this.quality=n,this.tint=r,this.vorticity=i,this.flamePalette=a,this.flameSmokeTail=o,this.ghostPalette=s,this.agePalette=c;let l=this.canvas.getContext(`webgl2`,{alpha:!0,depth:!1,stencil:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!0});if(!l||!l.getExtension(`EXT_color_buffer_float`))throw Error(`Float WebGL2 render targets are unavailable`);this.gl=l,this.canvas.addEventListener(`webglcontextlost`,e=>{e.preventDefault(),this.lost=!0}),this.quad=lf(l,new Float32Array([-1,-1,1,-1,-1,1,1,1]));for(let[e,t]of Object.entries(Cf)){if((e===`inkFlame`||e===`inkFlow`||e===`sceneInkFlame`||e===`sceneFlow`)&&!this.flameSmokeTail||e===`ghostDisplay`&&!this.ghostPalette)continue;let n=nf(l,yf,t,`Fluid ${e}`);this.programs[e]=n,this.positions[e]=of(n,`aPosition`)}for(let e of[`vehicleLightPosition[0]`,`vehicleLightShape[0]`,`vehicleLightColor[0]`])this.uniform(`display`,e);if(this.flamePalette){let e=nf(l,bf,xf,`Flame stamps`),t=l.createBuffer();if(!t)throw uf(l,e),Error(`Unable to allocate flame stamps`);this.flameStampProgram=e,this.flameStampBuffer=t}this.resize(e,t)}get resolution(){return{quality:this.quality,cols:this.simulation.width,rows:this.simulation.height,engine:`WebGL2`}}get available(){return!this.lost}dispose(){if(!this.lost){this.gpuTimer?.dispose();for(let e of this.allSurfaces)this.gl.deleteTexture(e.texture),this.gl.deleteFramebuffer(e.framebuffer);for(let e of Object.values(this.programs))uf(this.gl,e);for(let e of this.sceneInk.values())this.gl.deleteTexture(e.texture);this.flameInk&&this.gl.deleteTexture(this.flameInk.texture),this.wallTexture&&this.gl.deleteTexture(this.wallTexture),this.flameStampProgram&&uf(this.gl,this.flameStampProgram),this.flameStampBuffer&&this.gl.deleteBuffer(this.flameStampBuffer),this.gl.deleteBuffer(this.quad),this.gl.getExtension(`WEBGL_lose_context`)?.loseContext(),this.lost=!0}}get managedBytes(){return this.active&&!this.lost?this.allSurfaces.reduce((e,t)=>e+t.width*t.height*t.bytesPerPixel,0)+this.wallPixels.byteLength+this.wallNext.byteLength+[...this.sceneInk.values()].reduce((e,t)=>e+t.width*t.height,0):0}get hasSceneFire(){return this.sceneFireActive}activateBuoyancy(){this.sceneFireActive=!0}queueRadialBlast(e,t){this.radialBlasts.push({center:e,radius:t}),this.sceneFireActive=!0}setTint(e){this.tint=e}setGhostStyle(e){this.ghostStyle=e}get running(){return this.active&&!this.lost}setQuality(e){e!==this.quality&&(this.quality=e,this.lost||this.resize(this.width,this.height,!0))}use(e){let t=this.gl,n=this.programs[e];t.useProgram(n),t.bindBuffer(t.ARRAY_BUFFER,this.quad);let r=this.positions[e];t.enableVertexAttribArray(r),t.vertexAttribPointer(r,2,t.FLOAT,!1,0,0)}uniform(e,t){return af(this.programs[e],t)}texture(e,t,n,r){let i=this.gl;i.activeTexture(i.TEXTURE0+r),i.bindTexture(i.TEXTURE_2D,n.texture),i.uniform1i(this.uniform(e,t),r)}bindWalls(e){let t=this.gl;t.activeTexture(t.TEXTURE2),t.bindTexture(t.TEXTURE_2D,this.wallTexture),t.uniform1i(this.uniform(e,`uWalls`),2),t.uniform1i(this.uniform(e,`hasWalls`),Number(this.hasWalls))}vec2(e,t,n,r){this.gl.uniform2f(this.uniform(e,t),n,r)}draw(e){let t=this.gl;ff(t,e,e?.width??this.canvas.width,e?.height??this.canvas.height),t.drawArrays(t.TRIANGLE_STRIP,0,4),Xe(this.flamePalette?`gpu.combustion.passes`:`gpu.smoke.passes`)}surface(e,t,n=!1){let r=this.gl,i={...df(r,e,t,n?r.RGBA8:r.RGBA16F,n?r.UNSIGNED_BYTE:r.HALF_FLOAT,r.NEAREST,`Fluid render target`),width:e,height:t,bytesPerPixel:n?4:8};return this.allSurfaces.push(i),r.viewport(0,0,e,t),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),i}pair(e,t){let n={read:this.surface(e,t),write:this.surface(e,t),swap:()=>{[n.read,n.write]=[n.write,n.read]}};return n}scaled(e){let t=this.presentationPixelRatio===void 0?this.width/this.height:this.canvas.width/this.canvas.height;return t>=1?{width:e,height:Math.max(1,Math.round(e/t))}:{width:Math.max(1,Math.round(e*t)),height:e}}resize(e,t,n=!1,r){if(this.lost)return;e=Math.max(1,Math.round(e)),t=Math.max(1,Math.round(t)),r!==void 0&&(this.presentationPixelRatio=Math.max(.1,Math.min(2,r)));let i=this.presentationPixelRatio??Math.min(2,window.devicePixelRatio||1);if(!n&&e===this.width&&t===this.height&&i===this.pixelRatio&&this.allSurfaces.length)return;let a=this.allSurfaces.length?{surfaces:this.allSurfaces,velocity:this.velocity,dye:this.dye,active:this.active,view:this.view,idle:this.idle}:null;if(a?.view){let n=e/this.width,r=t/this.height;a.view={origin:{x:a.view.origin.x*n,y:a.view.origin.y*r},scaleX:a.view.scaleX*n,scaleY:a.view.scaleY*r},this.flameOrigin={x:this.flameOrigin.x*n,y:this.flameOrigin.y*r}}this.width=e,this.height=t,this.pixelRatio=i;let o=vf[this.quality],s=this.quality===`high`?Math.min(2304,Math.max(o.dye,Math.round(Math.max(e,t)*i))):o.dye,c=Math.min(i,Math.max(1,s*1.5/Math.max(e,t))),l=Math.round(e*c),u=Math.round(t*c);this.canvas.width!==l&&(this.canvas.width=l),this.canvas.height!==u&&(this.canvas.height=u);let d=this.scaled(o.simulation),f=this.scaled(s);if(!n&&a&&d.width===this.simulation.width&&d.height===this.simulation.height&&f.width===this.dyeSize.width&&f.height===this.dyeSize.height){this.view=a.view;return}let p=this.gl;if(this.allSurfaces=[],this.simulation=d,this.wallTexture&&p.deleteTexture(this.wallTexture),this.wallTexture=p.createTexture(),!this.wallTexture)throw Error(`Unable to allocate fluid wall mask`);p.bindTexture(p.TEXTURE_2D,this.wallTexture),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MIN_FILTER,p.NEAREST),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MAG_FILTER,p.NEAREST),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_S,p.CLAMP_TO_EDGE),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_T,p.CLAMP_TO_EDGE),p.pixelStorei(p.UNPACK_ALIGNMENT,1),this.wallPixels=new Uint8Array(this.simulation.width*this.simulation.height),this.wallNext=new Uint8Array(this.wallPixels.length),p.texImage2D(p.TEXTURE_2D,0,p.R8,this.simulation.width,this.simulation.height,0,p.RED,p.UNSIGNED_BYTE,this.wallPixels),this.hasWalls=!1,this.dyeSize=f,this.velocity=this.pair(this.simulation.width,this.simulation.height),this.dye=this.pair(this.dyeSize.width,this.dyeSize.height),this.flameSource=this.flamePalette?this.surface(this.dyeSize.width,this.dyeSize.height,!0):null,this.pressure=this.pair(this.simulation.width,this.simulation.height),this.curl=this.surface(this.simulation.width,this.simulation.height),this.divergence=this.surface(this.simulation.width,this.simulation.height),a?.active&&(this.use(`copy`),this.texture(`copy`,`uTexture`,a.velocity.read,0),this.draw(this.velocity.read),this.texture(`copy`,`uTexture`,a.dye.read,0),this.draw(this.dye.read));for(let e of a?.surfaces??[])p.deleteTexture(e.texture),p.deleteFramebuffer(e.framebuffer);this.view=a?.view??null,this.active=a?.active??!1,this.idle=a?.idle??0}reset(){if(this.lost)return;let e=this.gl;for(let t of this.sceneInk.values())e.deleteTexture(t.texture);this.sceneInk.clear(),e.clearColor(0,0,0,0);for(let t of this.allSurfaces)e.bindFramebuffer(e.FRAMEBUFFER,t.framebuffer),e.viewport(0,0,t.width,t.height),e.clear(e.COLOR_BUFFER_BIT);this.active=!1,this.sceneFireActive=!1,this.radialBlasts=[],this.idle=0,this.view=null}align(e){if(!this.view||!this.active){this.view=e;return}let t=this.view,n=Math.abs(e.origin.x-t.origin.x)+Math.abs(e.origin.y-t.origin.y),r=Math.abs(e.scaleX/t.scaleX-1)+Math.abs(e.scaleY/t.scaleY-1);if(n<.2&&r<.001)return;let i=this.gl;this.beginGpu(`fire.align`),this.use(`align`),this.vec2(`align`,`size`,this.width,this.height),this.vec2(`align`,`oldOrigin`,t.origin.x,t.origin.y),this.vec2(`align`,`nextOrigin`,e.origin.x,e.origin.y),this.vec2(`align`,`oldScale`,t.scaleX,t.scaleY),this.vec2(`align`,`nextScale`,e.scaleX,e.scaleY);for(let e of[this.velocity,this.dye])this.texture(`align`,`uSource`,e.read,0),this.draw(e.write),e.swap();this.endGpu(),this.flamePalette&&(this.flameOrigin={x:e.origin.x+(this.flameOrigin.x-t.origin.x)/t.scaleX*e.scaleX,y:e.origin.y+(this.flameOrigin.y-t.origin.y)/t.scaleY*e.scaleY}),this.view=e,i.bindFramebuffer(i.FRAMEBUFFER,null)}splat(e,t,n,r){if(t.x<-n*2||t.y<-n*2||t.x>this.width+n*2||t.y>this.height+n*2)return;let i=this.gl;this.use(`splat`),this.texture(`splat`,`uTarget`,e.read,0),this.vec2(`splat`,`point`,t.x/this.width,1-t.y/this.height),this.vec2(`splat`,`size`,this.width,this.height),i.uniform1f(this.uniform(`splat`,`radius`),Math.max(2,n)),i.uniform4f(this.uniform(`splat`,`value`),...r),this.draw(e.write),e.swap()}splatBatch(e,t){if(!t)return;let n=this.gl;this.use(`splatBatch`),this.texture(`splatBatch`,`uTarget`,e.read,0),this.vec2(`splatBatch`,`size`,this.width,this.height),n.uniform1i(this.uniform(`splatBatch`,`count`),t),n.uniform4fv(this.uniform(`splatBatch`,`stamps[0]`),this.batchStamps.subarray(0,t*4)),n.uniform4fv(this.uniform(`splatBatch`,`values[0]`),this.batchValues.subarray(0,t*4)),this.draw(e.write),e.swap()}splatSegment(e,t,n,r,i,a){let o=this.gl;this.use(`splatSegment`),this.texture(`splatSegment`,`uTarget`,e.read,0),this.vec2(`splatSegment`,`start`,t.x/this.width,1-t.y/this.height),this.vec2(`splatSegment`,`end`,n.x/this.width,1-n.y/this.height),this.vec2(`splatSegment`,`size`,this.width,this.height),this.vec2(`splatSegment`,`radii`,Math.max(2,r),Math.max(2,i)),o.uniform4f(this.uniform(`splatSegment`,`value`),...a),this.draw(e.write),e.swap()}splatFlame(e,t,n,r,i){let a=this.gl;this.use(`flameSource`),this.texture(`flameSource`,`uTarget`,this.dye.read,0),this.vec2(`flameSource`,`start`,e.x/this.width,1-e.y/this.height),this.vec2(`flameSource`,`end`,t.x/this.width,1-t.y/this.height),this.vec2(`flameSource`,`size`,this.width,this.height),a.uniform3f(this.uniform(`flameSource`,`radii`),...n),a.uniform3f(this.uniform(`flameSource`,`strengths`),...r),a.uniform1f(this.uniform(`flameSource`,`time`),i),this.draw(this.dye.write),this.dye.swap()}stirFlame(e,t,n,r,i,a){let o=this.gl;this.use(`flameEddies`),this.texture(`flameEddies`,`uTarget`,this.velocity.read,0),this.vec2(`flameEddies`,`start`,e.x,e.y),this.vec2(`flameEddies`,`end`,t.x,t.y),this.vec2(`flameEddies`,`size`,this.width,this.height),this.vec2(`flameEddies`,`cellSize`,i,a),o.uniform1f(this.uniform(`flameEddies`,`time`),n),o.uniform1f(this.uniform(`flameEddies`,`dt`),r),this.draw(this.velocity.write),this.velocity.swap()}applyBody(e){let t=this.gl;this.use(`body`),this.texture(`body`,`uVelocity`,this.velocity.read,0),this.vec2(`body`,`size`,this.width,this.height),this.vec2(`body`,`texelSize`,1/this.simulation.width,1/this.simulation.height),this.vec2(`body`,`center`,e.center.x,e.center.y),this.vec2(`body`,`forward`,e.forward.x,e.forward.y),this.vec2(`body`,`halfSize`,e.halfLength,e.halfWidth),this.vec2(`body`,`motion`,e.velocity.x,e.velocity.y),t.uniform1f(this.uniform(`body`,`spin`),e.spin),t.uniform1f(this.uniform(`body`,`bodyInfluence`),e.influence??(this.flamePalette?.35:1)),this.draw(this.velocity.write),this.velocity.swap()}updateWalls(e){let{width:t,height:n}=this.simulation;this.wallNext.fill(0);let r=!1;for(let i of e){if(i.width<=0||i.height<=0)continue;let e=Math.max(0,Math.floor(i.x/this.width*t)),a=Math.min(t-1,Math.ceil((i.x+i.width)/this.width*t)-1),o=Math.max(0,Math.floor(i.y/this.height*n)),s=Math.min(n-1,Math.ceil((i.y+i.height)/this.height*n)-1);for(let i=o;i<=s;i++)for(let o=e;o<=a;o++)this.wallNext[(n-1-i)*t+o]=255,r=!0}let i=r!==this.hasWalls;if(!i){for(let e=0;e<this.wallNext.length;e++)if(this.wallNext[e]!==this.wallPixels[e]){i=!0;break}}if(this.hasWalls=r,!i)return;[this.wallPixels,this.wallNext]=[this.wallNext,this.wallPixels];let a=this.gl;a.activeTexture(a.TEXTURE2),a.bindTexture(a.TEXTURE_2D,this.wallTexture),a.texSubImage2D(a.TEXTURE_2D,0,0,0,t,n,a.RED,a.UNSIGNED_BYTE,this.wallPixels)}inject(e,t,n,r,i){if(this.lost||t<=0)return;this.active=!0,this.idle=0;let a=this.width/this.simulation.width,o=this.height/this.simulation.height;this.splat(this.velocity,e,r*1.3,[n.x/a*t*.22,-n.y/o*t*.22,0,0]),i&&this.splat(this.velocity,{x:e.x+r*.5,y:e.y+r*.5},r,[-i/a*t*.08,i/o*t*.08,0,0]),this.splat(this.dye,e,r*1.2,[t*2.2,0,0,0])}injectBatch(e){if(this.lost||e.length===0)return;if(e.length===1){let t=e[0];this.inject(t.point,t.amount,t.flow,t.radiusPx,t.swirlPx);return}this.active=!0,this.idle=0;let t=this.width/this.simulation.width,n=this.height/this.simulation.height,r=0,i=(e,t,n,i)=>{if(e.x<-t*2||e.y<-t*2||e.x>this.width+t*2||e.y>this.height+t*2)return;let a=r*4;this.batchStamps[a]=e.x/this.width,this.batchStamps[a+1]=1-e.y/this.height,this.batchStamps[a+2]=Math.max(2,t),this.batchStamps[a+3]=0,this.batchValues[a]=n,this.batchValues[a+1]=i,this.batchValues[a+2]=0,this.batchValues[a+3]=0,r++,r===16&&(this.splatBatch(this.velocity,r),r=0)};for(let r of e){let{point:e,amount:a,flow:o,radiusPx:s,swirlPx:c}=r;a<=0||(i(e,s*1.3,o.x/t*a*.22,-o.y/n*a*.22),c&&i({x:e.x+s*.5,y:e.y+s*.5},s,-c/t*a*.08,c/n*a*.08))}this.splatBatch(this.velocity,r),r=0;for(let t of e){let{point:e,amount:n,radiusPx:i}=t;if(n<=0)continue;let a=i*1.2;if(e.x<-a*2||e.y<-a*2||e.x>this.width+a*2||e.y>this.height+a*2)continue;let o=r*4;this.batchStamps[o]=e.x/this.width,this.batchStamps[o+1]=1-e.y/this.height,this.batchStamps[o+2]=Math.max(2,a),this.batchStamps[o+3]=0,this.batchValues[o]=n*2.2,this.batchValues[o+1]=0,this.batchValues[o+2]=0,this.batchValues[o+3]=0,r++,r===16&&(this.splatBatch(this.dye,r),r=0)}this.splatBatch(this.dye,r)}disturb(e,t,n,r){if(!this.active||this.lost||r<=0)return;let i=this.width/this.simulation.width,a=this.height/this.simulation.height,o={x:e.x-t.x*r,y:e.y-t.y*r};this.splatSegment(this.velocity,o,e,n,n,[t.x/i*r*2.8,-t.y/a*r*2.8,0,0])}injectFlameSegment(e,t,n,r,i){if(this.lost||n<=0)return;this.active=!0,this.idle=0,this.flameOrigin=e;let a=this.width/this.simulation.width,o=this.height/this.simulation.height;this.splatSegment(this.velocity,e,t,8,21,[r.x/a*n*.26,-r.y/o*n*.26,0,0]);let s={x:e.x+(t.x-e.x)*.9,y:e.y+(t.y-e.y)*.9};this.stirFlame(e,s,i,n,a,o),this.splatFlame(e,t,[24,17,9],[n*.65,n*1.55,n*2.2],i)}injectFlameStamps(e,t,n){if(!e.length||this.lost||!this.flameSource||!this.flameStampProgram||!this.flameStampBuffer)return;this.beginGpu(`fire.stamps`);let r=this.gl,i=Math.min(e.length,this.flameStampData.length/5),a=null,o=null,s=0,c=0,l=0;for(let n=0;n<i;n++){let r=e[Math.floor(n*e.length/i)];!r.blast&&r.stir!==!1&&((!a||r.progress<a.progress)&&(a=r),(!o||r.progress>o.progress)&&(o=r),s+=r.flow.x,c+=r.flow.y,l++);let u=n*5;this.flameStampData[u]=r.point.x,this.flameStampData[u+1]=r.point.y,this.flameStampData[u+2]=Math.max(3,r.radius),this.flameStampData[u+3]=r.progress,this.flameStampData[u+4]=(r.blast?Math.min(.4,t*12):Math.min(.08,t*.65))*(r.strength??1)}this.active=!0,this.idle=0,this.flameOrigin=a?.point??{x:-1e3,y:-1e3},r.bindFramebuffer(r.FRAMEBUFFER,this.flameSource.framebuffer),r.viewport(0,0,this.flameSource.width,this.flameSource.height),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),r.useProgram(this.flameStampProgram),r.bindBuffer(r.ARRAY_BUFFER,this.flameStampBuffer),r.bufferData(r.ARRAY_BUFFER,this.flameStampData.subarray(0,i*5),r.DYNAMIC_DRAW);let u=of(this.flameStampProgram,`aStamp`),d=of(this.flameStampProgram,`aStrength`);if(r.enableVertexAttribArray(u),r.vertexAttribPointer(u,4,r.FLOAT,!1,20,0),r.enableVertexAttribArray(d),r.vertexAttribPointer(d,1,r.FLOAT,!1,20,16),r.uniform2f(af(this.flameStampProgram,`canvasSize`),this.width,this.height),r.uniform2f(af(this.flameStampProgram,`dyeSize`),this.flameSource.width,this.flameSource.height),r.uniform1i(af(this.flameStampProgram,`agePalette`),Number(this.agePalette)),r.enable(r.BLEND),r.blendFunc(r.ONE,r.ONE),r.drawArrays(r.POINTS,0,i),r.disable(r.BLEND),this.use(`addFlame`),this.texture(`addFlame`,`uTarget`,this.dye.read,0),this.texture(`addFlame`,`uSource`,this.flameSource,1),this.draw(this.dye.write),this.dye.swap(),!a||!o||!l){this.endGpu();return}let f=this.width/this.simulation.width,p=this.height/this.simulation.height,m={x:s/l,y:c/l},h=[m.x/f*t*.18,-m.y/p*t*.18,0,0],g=Math.hypot(m.x,m.y);if(g>.001){let r=1/0,i=-1/0;for(let t of e){if(t.blast||t.stir===!1)continue;let e=(-t.point.x*m.y+t.point.y*m.x)/g;r=Math.min(r,e),i=Math.max(i,e)}if(i-r>10){let a=(r+i)*.5,o=null,s=null,c=null,l=null;for(let t of e)t.blast||t.stir===!1||((-t.point.x*m.y+t.point.y*m.x)/g<a?((!o||t.progress<o.progress)&&(o=t),(!s||t.progress>s.progress)&&(s=t)):((!c||t.progress<c.progress)&&(c=t),(!l||t.progress>l.progress)&&(l=t)));if(o&&s&&c&&l){this.splatSegment(this.velocity,o.point,s.point,7,19,h),this.splatSegment(this.velocity,c.point,l.point,7,19,h),this.stirFlame(o.point,s.point,n,t*.55,f,p),this.stirFlame(c.point,l.point,n,t*.55,f,p),this.endGpu();return}}}this.splatSegment(this.velocity,a.point,o.point,7,19,h),this.stirFlame(a.point,o.point,n,t*.55,f,p),this.endGpu()}setFlameInk(e){if(!this.flamePalette||!this.flameSmokeTail||this.lost)return;let t=this.gl;this.flameInk&&t.deleteTexture(this.flameInk.texture);let n=t.createTexture();if(!n)throw Error(`Unable to allocate flame ink texture`);t.bindTexture(t.TEXTURE_2D,n),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.pixelStorei(t.UNPACK_ALIGNMENT,1),t.texImage2D(t.TEXTURE_2D,0,t.R8,e.pixelWidth,e.pixelHeight,0,t.RED,t.UNSIGNED_BYTE,e.alpha),this.flameInk={texture:n,x:e.x,y:e.y,width:e.width,height:e.height,ignitionX:e.origin.x-e.x}}injectFlameInk(e,t){let n=this.flameInk;if(!n||!this.flameSource||this.lost||e>(n.width-n.ignitionX)/88+1.28)return;let r=this.gl;this.active=!0,this.idle=0,this.flameOrigin={x:-1e3,y:-1e3},this.use(`inkFlame`),r.activeTexture(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,n.texture),r.uniform1i(this.uniform(`inkFlame`,`uInk`),0),this.vec2(`inkFlame`,`uCanvasSize`,this.width,this.height),this.vec2(`inkFlame`,`uInkOrigin`,n.x,n.y),this.vec2(`inkFlame`,`uInkSize`,n.width,n.height),this.vec2(`inkFlame`,`uIgnition`,n.ignitionX,0),r.uniform1f(this.uniform(`inkFlame`,`uTime`),e),r.uniform1f(this.uniform(`inkFlame`,`uDt`),Math.min(.05,t)),this.draw(this.flameSource),this.use(`addFlame`),this.texture(`addFlame`,`uTarget`,this.dye.read,0),this.texture(`addFlame`,`uSource`,this.flameSource,1),this.draw(this.dye.write),this.dye.swap(),this.use(`inkFlow`),this.texture(`inkFlow`,`uVelocity`,this.velocity.read,0),this.vec2(`inkFlow`,`uCanvasSize`,this.width,this.height),this.vec2(`inkFlow`,`uCellSize`,this.width/this.simulation.width,this.height/this.simulation.height),this.vec2(`inkFlow`,`uInkOrigin`,n.x,n.y),this.vec2(`inkFlow`,`uInkSize`,n.width,n.height),r.uniform1f(this.uniform(`inkFlow`,`uIgnitionX`),n.ignitionX),r.uniform1f(this.uniform(`inkFlow`,`uTime`),e),r.uniform1f(this.uniform(`inkFlow`,`uDt`),Math.min(.05,t)),this.draw(this.velocity.write),this.velocity.swap()}injectBurnMasks(e,t,n){if(!this.flameSmokeTail||!this.flameSource||this.lost)return;this.beginGpu(`fire.mask`);let r=this.gl,i=this.flameSource,a=new Set;r.bindFramebuffer(r.FRAMEBUFFER,i.framebuffer),r.viewport(0,0,i.width,i.height),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),this.use(`sceneInkFlame`),this.vec2(`sceneInkFlame`,`uCanvasSize`,this.width,this.height),r.uniform1f(this.uniform(`sceneInkFlame`,`uDt`),Math.min(.05,t)),r.uniform1f(this.uniform(`sceneInkFlame`,`uTime`),n),r.uniform1i(this.uniform(`sceneInkFlame`,`uAgePalette`),Number(this.agePalette)),r.enable(r.BLEND),r.blendFunc(r.ONE,r.ONE),r.enable(r.SCISSOR_TEST);let o=0;for(let t of e){if(t.width<=0||t.height<=0||t.pixelWidth<=0||t.pixelHeight<=0||t.alpha.length<t.pixelWidth*t.pixelHeight)continue;let e=t.x+t.width/2,n=t.y+t.height/2,s=Math.hypot(t.width,t.height)/2+5;if(e+s<0||e-s>this.width||n+s<0||n-s>this.height)continue;let c=Math.max(0,Math.floor((e-s)*i.width/this.width)),l=Math.min(i.width,Math.ceil((e+s)*i.width/this.width)),u=Math.max(0,Math.floor((this.height-n-s)*i.height/this.height)),d=Math.min(i.height,Math.ceil((this.height-n+s)*i.height/this.height));if(l<=c||d<=u)continue;a.add(t.key);let f=this.sceneInk.get(t.key);if(!f||f.width!==t.pixelWidth||f.height!==t.pixelHeight){f&&r.deleteTexture(f.texture);let e=r.createTexture();if(!e)continue;f={texture:e,width:t.pixelWidth,height:t.pixelHeight,alpha:t.alpha,revision:t.revision??0},this.sceneInk.set(t.key,f),r.activeTexture(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,e),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.pixelStorei(r.UNPACK_ALIGNMENT,1),r.texImage2D(r.TEXTURE_2D,0,r.R8,f.width,f.height,0,r.RED,r.UNSIGNED_BYTE,t.alpha)}else r.activeTexture(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,f.texture),(f.alpha!==t.alpha||f.revision!==(t.revision??0))&&(r.texSubImage2D(r.TEXTURE_2D,0,0,0,f.width,f.height,r.RED,r.UNSIGNED_BYTE,t.alpha),f.alpha=t.alpha,f.revision=t.revision??0);r.uniform1i(this.uniform(`sceneInkFlame`,`uInk`),0),r.scissor(c,u,l-c,d-u),r.uniform4f(this.uniform(`sceneInkFlame`,`uRect`),t.x,t.y,t.width,t.height),this.vec2(`sceneInkFlame`,`uOrigin`,t.origin.x,t.origin.y),r.uniform1f(this.uniform(`sceneInkFlame`,`uAngle`),t.angle??0),r.uniform1f(this.uniform(`sceneInkFlame`,`uAge`),t.age),r.uniform1f(this.uniform(`sceneInkFlame`,`uFarthest`),t.farthest),r.uniform1f(this.uniform(`sceneInkFlame`,`uSpreadSeconds`),t.spreadSeconds),r.uniform1f(this.uniform(`sceneInkFlame`,`uBurnSeconds`),t.burnSeconds),r.uniform1f(this.uniform(`sceneInkFlame`,`uSmokeRate`),(t.smokeRate??13)/13),r.uniform1f(this.uniform(`sceneInkFlame`,`uIntensity`),t.intensity??1),r.uniform1f(this.uniform(`sceneInkFlame`,`uFixedRadius`),t.fixedRadius??0),r.uniform1f(this.uniform(`sceneInkFlame`,`uSmokeOnly`),+!!t.smokeOnly),r.uniform1f(this.uniform(`sceneInkFlame`,`uBlastAge`),t.blastAge??-1),r.uniform1f(this.uniform(`sceneInkFlame`,`uBlastSeconds`),t.blastSeconds??0),this.draw(i),o++}r.disable(r.SCISSOR_TEST),r.disable(r.BLEND);for(let[e,t]of this.sceneInk)a.has(e)||(r.deleteTexture(t.texture),this.sceneInk.delete(e));o&&(this.active=!0,this.sceneFireActive=!0,this.idle=0,this.flameOrigin={x:-1e3,y:-1e3},this.use(`addFlame`),this.texture(`addFlame`,`uTarget`,this.dye.read,0),this.texture(`addFlame`,`uSource`,i,1),this.draw(this.dye.write),this.dye.swap()),this.endGpu()}applySceneFlow(e,t){let n=this.gl;this.use(`sceneFlow`),this.texture(`sceneFlow`,`uVelocity`,this.velocity.read,0),this.texture(`sceneFlow`,`uDye`,this.dye.read,1),this.vec2(`sceneFlow`,`uCanvasSize`,this.width,this.height),this.vec2(`sceneFlow`,`uCellSize`,this.width/this.simulation.width,this.height/this.simulation.height),n.uniform1f(this.uniform(`sceneFlow`,`uTime`),t),n.uniform1f(this.uniform(`sceneFlow`,`uDt`),Math.min(.05,e)),this.draw(this.velocity.write),this.velocity.swap()}step(e,t,n=[]){if(!this.active||this.lost)return;let r=this.gl;if(e=Math.min(.05,e),this.idle+=e,this.idle>(this.ghostPalette?1.7:this.flamePalette?this.flameSmokeTail?3.2:1.35:10)){this.reset();return}this.beginGpu(`fire.curlAndWalls`),r.disable(r.BLEND),this.updateWalls(n);let i=1/this.simulation.width,a=1/this.simulation.height;t&&this.applyBody(t),this.use(`curl`),this.vec2(`curl`,`texelSize`,i,a),this.texture(`curl`,`uVelocity`,this.velocity.read,0),this.draw(this.curl),this.use(`vorticity`),this.vec2(`vorticity`,`texelSize`,i,a),this.texture(`vorticity`,`uVelocity`,this.velocity.read,0),this.texture(`vorticity`,`uCurl`,this.curl,1),r.uniform1f(this.uniform(`vorticity`,`curl`),this.vorticity),r.uniform1f(this.uniform(`vorticity`,`dt`),e),this.draw(this.velocity.write),this.velocity.swap(),this.use(`divergence`),this.bindWalls(`divergence`),this.vec2(`divergence`,`texelSize`,i,a),this.texture(`divergence`,`uVelocity`,this.velocity.read,0),this.draw(this.divergence),this.endGpu(),this.beginGpu(`fire.pressure`),this.use(`clear`),this.texture(`clear`,`uTexture`,this.pressure.read,0),r.uniform1f(this.uniform(`clear`,`value`),.8),this.draw(this.pressure.write),this.pressure.swap(),this.use(`pressure`),this.bindWalls(`pressure`),this.vec2(`pressure`,`texelSize`,i,a),this.texture(`pressure`,`uDivergence`,this.divergence,0);for(let e=0;e<vf[this.quality].iterations;e++)this.texture(`pressure`,`uPressure`,this.pressure.read,1),this.draw(this.pressure.write),this.pressure.swap();this.use(`gradient`),this.bindWalls(`gradient`),this.vec2(`gradient`,`texelSize`,i,a),this.texture(`gradient`,`uPressure`,this.pressure.read,0),this.texture(`gradient`,`uVelocity`,this.velocity.read,1),this.draw(this.velocity.write),this.velocity.swap(),this.endGpu(),this.beginGpu(`fire.transport`),t&&this.applyBody(t),this.use(`advection`),this.bindWalls(`advection`),r.uniform1i(this.uniform(`advection`,`ageDye`),0),this.vec2(`advection`,`velocityTexel`,i,a),this.vec2(`advection`,`sourceTexel`,i,a),r.uniform1f(this.uniform(`advection`,`dt`),e),r.uniform4f(this.uniform(`advection`,`dissipation`),.2,.2,.2,.2),this.texture(`advection`,`uVelocity`,this.velocity.read,0),this.texture(`advection`,`uSource`,this.velocity.read,1),this.draw(this.velocity.write),this.velocity.swap(),this.sceneFireActive&&this.applySceneFlow(e,performance.now()*.001);for(let e of this.radialBlasts)this.use(`radialBlast`),this.texture(`radialBlast`,`uVelocity`,this.velocity.read,0),this.vec2(`radialBlast`,`uCanvasSize`,this.width,this.height),this.vec2(`radialBlast`,`uCellSize`,this.width/this.simulation.width,this.height/this.simulation.height),this.vec2(`radialBlast`,`uCenter`,e.center.x,e.center.y),r.uniform1f(this.uniform(`radialBlast`,`uRadius`),e.radius),this.draw(this.velocity.write),this.velocity.swap();this.radialBlasts=[],this.use(`advection`),this.bindWalls(`advection`),r.uniform1i(this.uniform(`advection`,`ageDye`),Number(this.agePalette)),this.vec2(`advection`,`velocityTexel`,i,a),r.uniform1f(this.uniform(`advection`,`dt`),e),this.vec2(`advection`,`sourceTexel`,1/this.dyeSize.width,1/this.dyeSize.height);let o=this.idle<.1,s=o?1:2.8;r.uniform4f(this.uniform(`advection`,`dissipation`),this.agePalette?s:this.flamePalette?o?.7:3:this.ghostPalette?2.1:.65,this.agePalette?s:this.flamePalette?o?.85:3.8:0,this.agePalette?s:this.flamePalette?o?1.05:4.8:0,this.flameSmokeTail?hf(this.idle).dissipation:0),this.texture(`advection`,`uVelocity`,this.velocity.read,0),this.texture(`advection`,`uSource`,this.dye.read,1),this.draw(this.dye.write),this.dye.swap(),this.endGpu()}drawTo(e,t,n=!1,r=[]){if(!this.active||this.lost)return;this.align(t),this.beginGpu(`fire.display`);let i=this.gl,a=this.ghostPalette?`ghostDisplay`:`display`;this.use(a),this.bindWalls(a),this.texture(a,`uDye`,this.dye.read,0);let o=typeof this.tint==`string`?this.tint===`cyan`?[.34,.83,.96]:this.tint===`magenta`?[.94,.38,.81]:_f:this.tint;if(i.uniform3f(this.uniform(a,`smokeColor`),o[0],o[1],o[2]),i.uniform1i(this.uniform(a,`darkBackground`),Number(n)),this.ghostPalette&&i.uniform1i(this.uniform(a,`ghostStyle`),this.ghostStyle===`specter`?0:this.ghostStyle===`phantom`?1:2),!this.ghostPalette){let e=Math.min(r.length,12);i.uniform1i(this.uniform(`display`,`vehicleLightCount`),e);for(let t=0;t<e;t++){let e=r[t],n=t*4;this.lightPositions[n]=e.point.x,this.lightPositions[n+1]=e.point.y,this.lightPositions[n+2]=e.range,this.lightPositions[n+3]=e.radius,this.lightShapes[n]=e.direction.x,this.lightShapes[n+1]=e.direction.y,this.lightShapes[n+2]=e.spread,this.lightShapes[n+3]=0,this.lightColors[n]=e.color[0],this.lightColors[n+1]=e.color[1],this.lightColors[n+2]=e.color[2],this.lightColors[n+3]=e.intensity}e&&(i.uniform4fv(this.uniform(`display`,`vehicleLightPosition[0]`),this.lightPositions),i.uniform4fv(this.uniform(`display`,`vehicleLightShape[0]`),this.lightShapes),i.uniform4fv(this.uniform(`display`,`vehicleLightColor[0]`),this.lightColors)),i.uniform1i(this.uniform(`display`,`flamePalette`),Number(this.flamePalette)),i.uniform1i(this.uniform(`display`,`agePalette`),Number(this.agePalette)),i.uniform1f(this.uniform(`display`,`lifecycleOpacity`),this.flameSmokeTail?hf(this.idle).opacity:1),this.vec2(`display`,`flameOrigin`,this.flameOrigin.x,this.height-this.flameOrigin.y),this.vec2(`display`,`size`,this.width,this.height)}i.bindFramebuffer(i.FRAMEBUFFER,null),i.viewport(0,0,this.canvas.width,this.canvas.height),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),this.draw(null),this.endGpu(),Xe(`composited megapixels`,this.canvas.width*this.canvas.height/1e6),e.drawImage(this.canvas,0,0,this.width,this.height)}};function Tf(e,t,n,r=`fuel-age`){return new wf(e,t,n,`natural`,12,!0,!0,!1,r===`fuel-age`)}var Ef=class{camera;quality;tireFire=new Ha;fluid=null;fluidAttempted=!1;fluidClock=0;maskBatch=new Va;sceneMasks=new Map;hadSceneMasks=!1;stamps=[];blasts=[];vehicleAlpha=new WeakMap;previousFireTire=new Map;fireRefreshClock=0;constructor(e,t){this.camera=e,this.quality=t}get count(){return this.tireFire.count}get managedBytes(){return this.tireFire.managedBytes+(this.fluid?.managedBytes??0)}get resolution(){return this.fluid?.resolution}get available(){return this.fluid?.available??!1}prepare(){if(!this.fluidAttempted){this.fluidAttempted=!0,performance.now();try{this.fluid=Tf(this.camera.width,this.camera.height,this.quality)}catch(e){console.error(`Joy Ride fire requires WebGL2`,e)}}return this.fluid?.available?this.fluid:null}ensure(){return!!this.prepare()}get running(){return!!this.fluid?.running}setQuality(e){this.quality=e,this.fluid?.setQuality(e)}resize(e){this.fluid?.resize(this.camera.width,this.camera.height,!1,e)}alphaFor(e){let t=this.vehicleAlpha.get(e);return t||(t=e.map(e=>e?255:0),this.vehicleAlpha.set(e,t)),t}sceneMasksDue(e){return!this.sceneMasks.size||this.fluidClock+e>=this.solveInterval()}solveInterval(){return 1/(this.quality===`high`?45:this.quality===`medium`?30:24)}queueMask(e){this.prepare()&&this.sceneMasks.set(e.key,e)}queueBlast(e,t){this.blasts.push({point:e,radius:t})}queueStamp(e){this.prepare()&&this.stamps.push(e)}activateBuoyancy(){let e=this.prepare();return e?(e.activateBuoyancy(),!0):!1}emitJet(e,t,n,i,a,o){if(!this.prepare())return;let s=this.camera.particlePoint(e),l=this.camera.particlePoint(t),d=c(l,s),f=this.camera.particleScale(),p=Math.max(o===`rocket`?6:4,i*f*1.9),m=o===`exhaust`&&u(d)<.001?0:Math.min(10,Math.max(1,Math.ceil(u(d)/Math.max(4,p)))),h=this.camera.pixelSpace?N(n.x*this.camera.zoom,-n.y*this.camera.zoom):{...n};for(let e=0;e<=m;e++){let t=1-e/Math.max(1,m);this.stamps.push({point:E(E(s,r(d,e/Math.max(1,m))),o===`rocket`?r(h,t*.025):N()),radius:p*(o===`rocket`?.8+t*.65:1),progress:o===`rocket`?.08+t*.48:.95,flow:h,strength:o===`rocket`?a*5.2:4+a*8,source:o===`rocket`?`rocket`:void 0,stir:o===`rocket`})}}igniteTire(e,t,n,r,i){this.tireFire.ignite(e,t,n,r,i)}stepTire(e){this.tireFire.step(e)}emberSource(){return this.tireFire.emberSource()}clearTireHistory(){this.previousFireTire.clear(),this.fireRefreshClock=0}stepBoostFire(e,t,n){if(!e.car.boostActive){this.clearTireHistory();return}this.fireRefreshClock+=t;let r=this.fireRefreshClock>=1/15;r&&(this.fireRefreshClock%=1/15);let i=this.camera.particleScale();e.car.tires.forEach((t,a)=>{if(t.front)return;let o=this.camera.particlePoint(e.body.world(t.local));n(o);let s=this.previousFireTire.get(a)??o;!r&&u(c(o,s))<.24*i&&this.previousFireTire.has(a)||(this.igniteTire(s,o,e.car.preset.geometry.tireWidthM*i,e.car.preset.launch.fireLifetimeSeconds,.24*i),this.previousFireTire.set(a,o))})}particleScreen(e){return this.camera.pixelSpace?c(e,this.camera.sceneScroll()):this.camera.screen(e)}step(e,t,n,r,i,a,o){let s=this.fluid??(this.tireFire.count?this.prepare():null);if(!s?.available){this.stamps=[],this.blasts=[],this.sceneMasks.clear();return}if(!this.stamps.length&&!this.blasts.length&&!this.sceneMasks.size&&!this.tireFire.count&&s.managedBytes===0)return;this.fluidClock+=e;let l=this.solveInterval();if(this.fluidClock<l)return;let u=Math.min(.1,this.fluidClock);this.fluidClock=Math.max(0,this.fluidClock-l),s.align(a);let d=i?[]:this.tireFire.stamps();d.length&&s.activateBuoyancy();let f=[...this.stamps,...d].map(e=>({...e,point:this.particleScreen(e.point),radius:e.radius*(this.camera.pixelSpace?1:this.camera.zoom),flow:this.camera.pixelSpace?e.flow:N(e.flow.x*this.camera.zoom,-e.flow.y*this.camera.zoom)}));this.stamps=[];for(let e of this.blasts)s.queueRadialBlast(this.particleScreen(e.point),e.radius*(this.camera.pixelSpace?1:this.camera.zoom));this.blasts=[];let p=this.camera.pixelSpace?this.camera.sceneScroll():N(),m=[...this.sceneMasks.values()].map(e=>({...e,x:e.x-p.x,y:e.y-p.y,origin:c(e.origin,p)}));this.sceneMasks.clear();let h=Math.min(8,m.length);for(let e=0;e<h;e++){let t=m[Math.floor((e+.5)*m.length/h)];t.smokeOnly||o.emitFire(t,u)}performance.now();let g=this.maskBatch.combine(m,this.camera.width,this.camera.height);(g.length||this.hadSceneMasks||s.hasSceneFire)&&(performance.now(),s.injectBurnMasks(g,u,t),this.hadSceneMasks=g.length>0),performance.now();let _=f.filter(e=>e.source===`rocket`);s.injectFlameStamps(_.length?f.filter(e=>e.source!==`rocket`):f,u,t),_.length&&s.injectFlameStamps(_,u,t);let v=this.camera.pixelSpace?r.map(e=>({x:e.x-p.x,y:e.y-p.y,width:e.width,height:e.height})):[];performance.now(),s.step(u,n&&this.camera.pixelSpace?{...n,center:c(n.center,N(this.camera.smokeMargin,this.camera.smokeMargin))}:n,v)}draw(e,t,n,r){this.fluid?.drawTo(e,t,n,r)}captureState(){let e=this.tireFire.captureState();try{let t=this.fluid?.captureState()??null;return{tireFire:e,flame:t,fluidAttempted:this.fluidAttempted,fluidClock:this.fluidClock,hadSceneMasks:this.hadSceneMasks,stamps:this.stamps.map(e=>({...e,point:{...e.point},flow:{...e.flow}})),blasts:this.blasts.map(e=>({point:{...e.point},radius:e.radius})),previousFireTire:new Map([...this.previousFireTire].map(([e,t])=>[e,{...t}])),fireRefreshClock:this.fireRefreshClock,dispose:()=>{e.dispose(),t?.dispose()}}}catch(t){throw e.dispose(),t}}restoreState(e){if(this.reset(),this.tireFire.restoreState(e.tireFire),e.flame){this.fluid||(this.fluidAttempted=!1);let t=this.fluid??this.prepare();if(!t)throw Error(`Flame GPU context is unavailable`);t.restoreState(e.flame),this.fluidAttempted=e.fluidAttempted}else this.fluid?.dispose(),this.fluid=null,this.fluidAttempted=!1;this.fluidClock=e.fluidClock,this.hadSceneMasks=e.hadSceneMasks,this.stamps=e.stamps.map(e=>({...e,point:{...e.point},flow:{...e.flow}})),this.blasts=e.blasts.map(e=>({point:{...e.point},radius:e.radius}));for(let[t,n]of e.previousFireTire)this.previousFireTire.set(t,{...n});this.fireRefreshClock=e.fireRefreshClock}reset(){this.tireFire.reset(),this.fluid?.reset(),this.fluidClock=0,this.sceneMasks.clear(),this.hadSceneMasks=!1,this.stamps=[],this.blasts=[],this.clearTireHistory()}dispose(){this.fluid?.dispose(),this.tireFire.dispose()}},Df=class{quality;gpu=null;constructor(e,t,n,r=`natural`){this.quality=n;try{this.gpu=new wf(e,t,n,r)}catch(e){console.error(`Joy Ride smoke requires WebGL2`,e)}}get running(){return!!this.gpu?.running}get usesWebGL(){return!!this.gpu?.available}get managedBytes(){return this.usesWebGL?this.gpu.managedBytes:0}get resolution(){return this.usesWebGL?this.gpu.resolution:{quality:this.quality,cols:0,rows:0,engine:`WebGL2 required`}}captureState(){return this.usesWebGL?this.gpu.captureState():null}restoreState(e){if(e&&!this.usesWebGL)throw Error(`Smoke GPU context is unavailable`);e?this.gpu.restoreState(e):this.reset()}setQuality(e){this.quality=e,this.usesWebGL&&this.gpu.setQuality(e)}setTint(e){this.usesWebGL&&this.gpu.setTint(e)}resize(e,t,n){this.usesWebGL&&this.gpu.resize(e,t,!1,n)}reset(){this.usesWebGL&&this.gpu.reset()}dispose(){this.gpu?.dispose(),this.gpu=null}align(e){this.usesWebGL&&this.gpu.align(e)}inject(e,t,n,r,i){this.usesWebGL&&this.gpu.inject(e,t,n,r,i)}injectBatch(e){this.usesWebGL&&this.gpu.injectBatch(e)}disturb(e,t,n,r){this.usesWebGL&&this.gpu.disturb(e,t,n,r)}step(e,t,n=[]){this.usesWebGL&&this.gpu.step(e,t,n)}draw(e,t,n=[],r=!1){this.usesWebGL&&this.gpu.drawTo(e,t,r,n)}},Of=class{camera;quality;smoke;sources=[];smokeClock=0;ghost=null;ghostAttempted=!1;ghostClock=0;ghostStyle=`phantom`;ghostWallCoverage=new Map;ghostEmergence=new Map;constructor(e,t){this.camera=e,this.quality=t,this.smoke=new Df(1,1,t)}get smokeResolution(){return this.smoke.resolution}get smokeBytes(){return this.sources.length*64+this.smoke.managedBytes}get ghostBytes(){return this.ghost?.managedBytes??0}get ghostAvailable(){return this.ghost?.available??!1}get style(){return this.ghostStyle}get running(){return this.smoke.running||!!this.ghost?.running}setQuality(e){this.quality=e,this.smoke.setQuality(e),this.ghost?.setQuality(e)}setSmokeTint(e){this.smoke.setTint(e)}setGhostStyle(e){this.ghostStyle=e,this.ghost?.setGhostStyle(e)}resize(e){this.smoke.resize(this.camera.width+2*this.camera.smokeMargin,this.camera.height+2*this.camera.smokeMargin,e),this.ghost?.resize(this.camera.width,this.camera.height,!1,e)}emitSmoke(e){this.sources.push(e)}clearSmokeSources(){this.sources=[]}particleScreen(e){return this.camera.pixelSpace?c(e,this.camera.sceneScroll()):this.camera.screen(e)}stepSmoke(e,t,n,r){if(!this.smoke.usesWebGL){this.sources=[];return}this.smokeClock+=e;let i=1/(this.quality===`high`?45:this.quality===`medium`?30:24);if(this.smokeClock<i)return;let a=Math.min(.1,this.smokeClock);this.smokeClock=Math.max(0,this.smokeClock-i),this.smoke.align(r),this.smoke.injectBatch(this.sources.map(e=>({...e,point:E(this.particleScreen(e.point),N(this.camera.smokeMargin,this.camera.smokeMargin))}))),this.sources=[];let o=this.camera.sceneScroll(),s=this.camera.pixelSpace?n.map(e=>({x:e.x-o.x+this.camera.smokeMargin,y:e.y-o.y+this.camera.smokeMargin,width:e.width,height:e.height})):[];this.smoke.step(a,t,s)}drawSmoke(e,t,n,r){this.smoke.draw(e,t,n,r)}prepareGhost(){if(!this.ghostAttempted){this.ghostAttempted=!0;try{this.ghost=new wf(this.camera.width,this.camera.height,this.quality,Ma.lightColor,Ma.vorticity,!1,!1,!0),this.ghost.setGhostStyle(this.ghostStyle)}catch(e){console.error(`Joy Ride ghost mode requires WebGL2`,e)}}return this.ghost?.available?this.ghost:null}stepGhost(e,t,n,i,a,o){let s=t.filter(e=>e.isGhost);if(!s.length)this.ghostWallCoverage.clear(),this.ghostEmergence.clear();else{let e=new Set(s.map(e=>e.id));for(let t of this.ghostWallCoverage.keys())e.has(t)||this.ghostWallCoverage.delete(t);for(let t of this.ghostEmergence.keys())e.has(t)||this.ghostEmergence.delete(t)}let c=s.length?this.prepareGhost():this.ghost;if(!c?.available||!s.length&&c.managedBytes===0)return;this.ghostClock+=e;let l=1/(this.quality===`high`?45:this.quality===`medium`?30:24);if(this.ghostClock<l)return;let d=Math.min(.1,this.ghostClock);this.ghostClock=Math.max(0,this.ghostClock-l),c.align(a);let f=this.camera.sceneScroll(),p=this.camera.pixelSpace?n.map(e=>({x:e.x-f.x,y:e.y-f.y,width:e.width,height:e.height})):[],m=null;if(i&&s.length){let e=Ma.styles[this.ghostStyle],n=[];for(let a of s){let{sim:s}=a,c=i(a),l=E(this.camera.screen(s.body.position),a===t[0]?o(a):N()),f=N(Math.cos(s.body.angle),-Math.sin(s.body.angle)),h=N(-f.y,f.x),g=c.lengthM*this.camera.zoom/2,_=c.widthM*this.camera.zoom/2,v=Na(l,f,g,_,p),y=this.ghostWallCoverage.get(a.id)??0,b=y+(v-y)*(1-Math.exp(-d*12));this.ghostWallCoverage.set(a.id,b);let x=Math.max(0,(this.ghostEmergence.get(a.id)??0)-d/Ma.emergenceFadeSeconds,(y-v)*1.8);this.ghostEmergence.set(a.id,x);let S=N(s.body.velocity.x*this.camera.zoom,-s.body.velocity.y*this.camera.zoom),C=r(S,Math.min(1,Ma.maxMotionSpeedPxPerSecond/Math.max(1,u(S)))),w=u(C),T=Math.min(1,w/Ma.wakeSpeedPxPerSecond),D=C.x*f.x+C.y*f.y,ee=Math.max(3,Math.min(14,_*e.radiusFactor));m||={center:l,forward:f,halfLength:g*.94,halfWidth:_*.78,velocity:C,spin:-s.body.spin,influence:e.bodyInfluence};let te=Fa(c.alpha,this.quality),ne=Fa(c.alpha,`low`).length/te.length;for(let t of te){let i=Math.max(0,D>=0?-t.x:t.x);n.push({point:E(l,E(r(f,t.x*g),r(h,t.y*_))),amount:d*e.emissionPerSecond*Ma.emissionFactor*ne*(1+T*i*Ma.wakeEmissionFactor)*(1+b*Ma.wallSmokeFactor+x*Ma.emergenceSmokeFactor),flow:E(r(C,.18-T*i*Ma.wakeFlowFactor),E(r(h,t.y*e.driftPixelsPerSecond),r(f,-e.driftPixelsPerSecond*.65))),radiusPx:ee,swirlPx:e.driftPixelsPerSecond*(t.y<0?-1:1)})}if(x>.05){let t=D>=0?-1:1,i=E(l,r(f,g*t*.72));for(let a of[-1,1])n.push({point:E(i,r(h,a*_*.45)),amount:d*e.emissionPerSecond*Ma.emissionFactor*x*1.35,flow:E(r(f,t*e.driftPixelsPerSecond*2),r(h,a*e.driftPixelsPerSecond*.7)),radiusPx:ee*1.55,swirlPx:a*e.driftPixelsPerSecond})}}c.injectBatch(n)}c.step(d,m,p)}drawGhost(e,t,n){this.ghost?.available&&(this.ghost.setTint(n?Ma.darkColor:Ma.lightColor),this.ghost.drawTo(e,t,n))}captureState(){let e=this.smoke.captureState();try{let t=this.ghost?.captureState()??null;return{smoke:e,ghost:t,sources:this.sources.map(e=>({...e,point:{...e.point},flow:{...e.flow}})),smokeClock:this.smokeClock,ghostAttempted:this.ghostAttempted,ghostClock:this.ghostClock,ghostStyle:this.ghostStyle,ghostWallCoverage:new Map(this.ghostWallCoverage),ghostEmergence:new Map(this.ghostEmergence),dispose:()=>{e?.dispose(),t?.dispose()}}}catch(t){throw e?.dispose(),t}}restoreState(e){if(this.reset(),this.smoke.restoreState(e.smoke),this.ghostStyle=e.ghostStyle,e.ghost){this.ghost||(this.ghostAttempted=!1);let t=this.ghost??this.prepareGhost();if(!t)throw Error(`Ghost GPU context is unavailable`);t.restoreState(e.ghost),t.setGhostStyle(this.ghostStyle),this.ghostAttempted=e.ghostAttempted}else this.ghost?.dispose(),this.ghost=null,this.ghostAttempted=!1;this.sources=e.sources.map(e=>({...e,point:{...e.point},flow:{...e.flow}})),this.smokeClock=e.smokeClock,this.ghostClock=e.ghostClock,this.ghostWallCoverage=new Map(e.ghostWallCoverage),this.ghostEmergence=new Map(e.ghostEmergence)}reset(){this.smoke.reset(),this.ghost?.reset(),this.sources=[],this.smokeClock=0,this.ghostClock=0,this.ghostWallCoverage.clear(),this.ghostEmergence.clear()}dispose(){this.smoke.dispose(),this.ghost?.dispose()}},kf={world:2147483643,foreground:2147483644,backdrop:2147483645,hud:2147483646,controls:2147483647};function Af(e){return`calc(var(--joy-ride-z-index, ${kf.world}) + ${kf[e]-kf.world})`}var jf=`[data-jr-foreground]`,Mf=new WeakMap;function Nf(e=jf){let t=new Map,n=!1,r=!1,i=(e,t)=>{if(--t.users>0)return;Mf.delete(e);let n=e.style;n.zIndex===Af(`foreground`)&&(t.zIndex?n.setProperty(`z-index`,t.zIndex,t.zIndexPriority):n.removeProperty(`z-index`)),t.positioned&&n.position===`relative`&&!t.position?n.removeProperty(`position`):t.positioned&&n.position===`relative`&&t.position===`static`&&n.setProperty(`position`,t.position,t.positionPriority),e.getAttribute(`data-jr-ui`)===``&&(t.ui===null?e.removeAttribute(`data-jr-ui`):e.setAttribute(`data-jr-ui`,t.ui))},a=new MutationObserver(()=>{r||(r=!0,queueMicrotask(()=>{r=!1,n||o()}))}),o=()=>{if(n)return;let r=new Set(e?[...document.querySelectorAll(e)].filter(e=>e instanceof HTMLElement&&e!==document.body&&e!==document.documentElement):[]);a.disconnect();for(let[e,n]of t)r.has(e)||(i(e,n),t.delete(e));for(let e of r){let n=e.style;if(!t.has(e)){let r=Mf.get(e);r?r.users++:(r={position:n.position,positionPriority:n.getPropertyPriority(`position`),zIndex:n.zIndex,zIndexPriority:n.getPropertyPriority(`z-index`),ui:e.getAttribute(`data-jr-ui`),positioned:!1,users:1},Mf.set(e,r)),t.set(e,r)}getComputedStyle(e).position===`static`&&(n.setProperty(`position`,`relative`,`important`),t.get(e).positioned=!0),n.setProperty(`z-index`,Af(`foreground`),`important`),e.setAttribute(`data-jr-ui`,``)}a.observe(document.body,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`class`,`id`,`data-jr-foreground`,...[...e.matchAll(/\[([\w-]+)/g)].map(e=>e[1])]})};return o(),{refresh:o,dispose(){n=!0,a.disconnect();for(let[e,n]of t)i(e,n);t.clear()}}}var Pf={color:[.14,.64,1],corona:[.28,.13,1]},Ff=11,If=`#version 300 es
648
+ }`},wf=class{quality;tint;vorticity;flamePalette;flameSmokeTail;ghostPalette;agePalette;ghostStyle=`phantom`;batchStamps=new Float32Array(64);batchValues=new Float32Array(64);canvas=document.createElement(`canvas`);gl;programs={};quad;positions={};lightPositions=new Float32Array(48);lightShapes=new Float32Array(48);lightColors=new Float32Array(48);flameStampProgram=null;flameStampBuffer=null;flameSource=null;flameInk=null;sceneInk=new Map;flameStampData=new Float32Array(10240);simulation;dyeSize;velocity;dye;pressure;curl;divergence;wallTexture=null;wallPixels=new Uint8Array;wallNext=new Uint8Array;hasWalls=!1;allSurfaces=[];width=1;height=1;pixelRatio=1;presentationPixelRatio;view=null;active=!1;sceneFireActive=!1;radialBlasts=[];idle=0;lost=!1;flameOrigin={x:0,y:0};gpuTimer=null;beginGpu(e){}endGpu(){this.gpuTimer?.end()}captureState(){if(this.lost)throw Error(`Cannot checkpoint a lost fluid context`);let e=this.gl,t=this.active||this.sceneFireActive||this.radialBlasts.length>0,n=t?new gf(e,this.velocity.read.framebuffer,this.velocity.read.width,this.velocity.read.height,e.RGBA16F,e.HALF_FLOAT):null,r=null;try{r=t?new gf(e,this.dye.read.framebuffer,this.dye.read.width,this.dye.read.height,e.RGBA16F,e.HALF_FLOAT):null}catch(e){throw n?.dispose(),e}return{velocity:n,dye:r,width:this.width,height:this.height,quality:this.quality,view:A(this.view),active:this.active,sceneFireActive:this.sceneFireActive,idle:this.idle,radialBlasts:A(this.radialBlasts),flameOrigin:A(this.flameOrigin),dispose:()=>{n?.dispose(),r?.dispose()}}}restoreState(e){if(this.lost)throw Error(`Cannot restore a lost fluid context`);this.quality=e.quality,this.resize(e.width,e.height,!0),this.reset(),e.velocity?.restore(this.velocity.read.framebuffer,this.velocity.read.width,this.velocity.read.height),e.dye?.restore(this.dye.read.framebuffer,this.dye.read.width,this.dye.read.height),this.view=A(e.view),this.active=e.active,this.sceneFireActive=e.sceneFireActive,this.idle=e.idle,this.radialBlasts=A(e.radialBlasts),this.flameOrigin=A(e.flameOrigin)}constructor(e,t,n,r=`natural`,i=18,a=!1,o=!1,s=!1,c=!1){this.quality=n,this.tint=r,this.vorticity=i,this.flamePalette=a,this.flameSmokeTail=o,this.ghostPalette=s,this.agePalette=c;let l=this.canvas.getContext(`webgl2`,{alpha:!0,depth:!1,stencil:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!0});if(!l||!l.getExtension(`EXT_color_buffer_float`))throw Error(`Float WebGL2 render targets are unavailable`);this.gl=l,this.canvas.addEventListener(`webglcontextlost`,e=>{e.preventDefault(),this.lost=!0}),this.quad=lf(l,new Float32Array([-1,-1,1,-1,-1,1,1,1]));for(let[e,t]of Object.entries(Cf)){if((e===`inkFlame`||e===`inkFlow`||e===`sceneInkFlame`||e===`sceneFlow`)&&!this.flameSmokeTail||e===`ghostDisplay`&&!this.ghostPalette)continue;let n=nf(l,yf,t,`Fluid ${e}`);this.programs[e]=n,this.positions[e]=of(n,`aPosition`)}for(let e of[`vehicleLightPosition[0]`,`vehicleLightShape[0]`,`vehicleLightColor[0]`])this.uniform(`display`,e);if(this.flamePalette){let e=nf(l,bf,xf,`Flame stamps`),t=l.createBuffer();if(!t)throw uf(l,e),Error(`Unable to allocate flame stamps`);this.flameStampProgram=e,this.flameStampBuffer=t}this.resize(e,t)}get resolution(){return{quality:this.quality,cols:this.simulation.width,rows:this.simulation.height,engine:`WebGL2`}}get available(){return!this.lost}dispose(){if(!this.lost){this.gpuTimer?.dispose();for(let e of this.allSurfaces)this.gl.deleteTexture(e.texture),this.gl.deleteFramebuffer(e.framebuffer);for(let e of Object.values(this.programs))uf(this.gl,e);for(let e of this.sceneInk.values())this.gl.deleteTexture(e.texture);this.flameInk&&this.gl.deleteTexture(this.flameInk.texture),this.wallTexture&&this.gl.deleteTexture(this.wallTexture),this.flameStampProgram&&uf(this.gl,this.flameStampProgram),this.flameStampBuffer&&this.gl.deleteBuffer(this.flameStampBuffer),this.gl.deleteBuffer(this.quad),this.gl.getExtension(`WEBGL_lose_context`)?.loseContext(),this.lost=!0}}get managedBytes(){return this.active&&!this.lost?this.allSurfaces.reduce((e,t)=>e+t.width*t.height*t.bytesPerPixel,0)+this.wallPixels.byteLength+this.wallNext.byteLength+[...this.sceneInk.values()].reduce((e,t)=>e+t.width*t.height,0):0}get hasSceneFire(){return this.sceneFireActive}activateBuoyancy(){this.sceneFireActive=!0}queueRadialBlast(e,t){this.radialBlasts.push({center:e,radius:t}),this.sceneFireActive=!0}setTint(e){this.tint=e}setGhostStyle(e){this.ghostStyle=e}get running(){return this.active&&!this.lost}setQuality(e){e!==this.quality&&(this.quality=e,this.lost||this.resize(this.width,this.height,!0))}use(e){let t=this.gl,n=this.programs[e];t.useProgram(n),t.bindBuffer(t.ARRAY_BUFFER,this.quad);let r=this.positions[e];t.enableVertexAttribArray(r),t.vertexAttribPointer(r,2,t.FLOAT,!1,0,0)}uniform(e,t){return af(this.programs[e],t)}texture(e,t,n,r){let i=this.gl;i.activeTexture(i.TEXTURE0+r),i.bindTexture(i.TEXTURE_2D,n.texture),i.uniform1i(this.uniform(e,t),r)}bindWalls(e){let t=this.gl;t.activeTexture(t.TEXTURE2),t.bindTexture(t.TEXTURE_2D,this.wallTexture),t.uniform1i(this.uniform(e,`uWalls`),2),t.uniform1i(this.uniform(e,`hasWalls`),Number(this.hasWalls))}vec2(e,t,n,r){this.gl.uniform2f(this.uniform(e,t),n,r)}draw(e){let t=this.gl;ff(t,e,e?.width??this.canvas.width,e?.height??this.canvas.height),t.drawArrays(t.TRIANGLE_STRIP,0,4),Xe(this.flamePalette?`gpu.combustion.passes`:`gpu.smoke.passes`)}surface(e,t,n=!1){let r=this.gl,i={...df(r,e,t,n?r.RGBA8:r.RGBA16F,n?r.UNSIGNED_BYTE:r.HALF_FLOAT,r.NEAREST,`Fluid render target`),width:e,height:t,bytesPerPixel:n?4:8};return this.allSurfaces.push(i),r.viewport(0,0,e,t),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),i}pair(e,t){let n={read:this.surface(e,t),write:this.surface(e,t),swap:()=>{[n.read,n.write]=[n.write,n.read]}};return n}scaled(e){let t=this.presentationPixelRatio===void 0?this.width/this.height:this.canvas.width/this.canvas.height;return t>=1?{width:e,height:Math.max(1,Math.round(e/t))}:{width:Math.max(1,Math.round(e*t)),height:e}}resize(e,t,n=!1,r){if(this.lost)return;e=Math.max(1,Math.round(e)),t=Math.max(1,Math.round(t)),r!==void 0&&(this.presentationPixelRatio=Math.max(.1,Math.min(2,r)));let i=this.presentationPixelRatio??Math.min(2,window.devicePixelRatio||1);if(!n&&e===this.width&&t===this.height&&i===this.pixelRatio&&this.allSurfaces.length)return;let a=this.allSurfaces.length?{surfaces:this.allSurfaces,velocity:this.velocity,dye:this.dye,active:this.active,view:this.view,idle:this.idle}:null;if(a?.view){let n=e/this.width,r=t/this.height;a.view={origin:{x:a.view.origin.x*n,y:a.view.origin.y*r},scaleX:a.view.scaleX*n,scaleY:a.view.scaleY*r},this.flameOrigin={x:this.flameOrigin.x*n,y:this.flameOrigin.y*r}}this.width=e,this.height=t,this.pixelRatio=i;let o=vf[this.quality],s=this.quality===`high`?Math.min(2304,Math.max(o.dye,Math.round(Math.max(e,t)*i))):o.dye,c=Math.min(i,Math.max(1,s*1.5/Math.max(e,t))),l=Math.round(e*c),u=Math.round(t*c);this.canvas.width!==l&&(this.canvas.width=l),this.canvas.height!==u&&(this.canvas.height=u);let d=this.scaled(o.simulation),f=this.scaled(s);if(!n&&a&&d.width===this.simulation.width&&d.height===this.simulation.height&&f.width===this.dyeSize.width&&f.height===this.dyeSize.height){this.view=a.view;return}let p=this.gl;if(this.allSurfaces=[],this.simulation=d,this.wallTexture&&p.deleteTexture(this.wallTexture),this.wallTexture=p.createTexture(),!this.wallTexture)throw Error(`Unable to allocate fluid wall mask`);p.bindTexture(p.TEXTURE_2D,this.wallTexture),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MIN_FILTER,p.NEAREST),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MAG_FILTER,p.NEAREST),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_S,p.CLAMP_TO_EDGE),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_T,p.CLAMP_TO_EDGE),p.pixelStorei(p.UNPACK_ALIGNMENT,1),this.wallPixels=new Uint8Array(this.simulation.width*this.simulation.height),this.wallNext=new Uint8Array(this.wallPixels.length),p.texImage2D(p.TEXTURE_2D,0,p.R8,this.simulation.width,this.simulation.height,0,p.RED,p.UNSIGNED_BYTE,this.wallPixels),this.hasWalls=!1,this.dyeSize=f,this.velocity=this.pair(this.simulation.width,this.simulation.height),this.dye=this.pair(this.dyeSize.width,this.dyeSize.height),this.flameSource=this.flamePalette?this.surface(this.dyeSize.width,this.dyeSize.height,!0):null,this.pressure=this.pair(this.simulation.width,this.simulation.height),this.curl=this.surface(this.simulation.width,this.simulation.height),this.divergence=this.surface(this.simulation.width,this.simulation.height),a?.active&&(this.use(`copy`),this.texture(`copy`,`uTexture`,a.velocity.read,0),this.draw(this.velocity.read),this.texture(`copy`,`uTexture`,a.dye.read,0),this.draw(this.dye.read));for(let e of a?.surfaces??[])p.deleteTexture(e.texture),p.deleteFramebuffer(e.framebuffer);this.view=a?.view??null,this.active=a?.active??!1,this.idle=a?.idle??0}reset(){if(this.lost)return;let e=this.gl;for(let t of this.sceneInk.values())e.deleteTexture(t.texture);this.sceneInk.clear(),e.clearColor(0,0,0,0);for(let t of this.allSurfaces)e.bindFramebuffer(e.FRAMEBUFFER,t.framebuffer),e.viewport(0,0,t.width,t.height),e.clear(e.COLOR_BUFFER_BIT);this.active=!1,this.sceneFireActive=!1,this.radialBlasts=[],this.idle=0,this.view=null}align(e){if(!this.view||!this.active){this.view=e;return}let t=this.view,n=Math.abs(e.origin.x-t.origin.x)+Math.abs(e.origin.y-t.origin.y),r=Math.abs(e.scaleX/t.scaleX-1)+Math.abs(e.scaleY/t.scaleY-1);if(n<.2&&r<.001)return;let i=this.gl;this.beginGpu(`fire.align`),this.use(`align`),this.vec2(`align`,`size`,this.width,this.height),this.vec2(`align`,`oldOrigin`,t.origin.x,t.origin.y),this.vec2(`align`,`nextOrigin`,e.origin.x,e.origin.y),this.vec2(`align`,`oldScale`,t.scaleX,t.scaleY),this.vec2(`align`,`nextScale`,e.scaleX,e.scaleY);for(let e of[this.velocity,this.dye])this.texture(`align`,`uSource`,e.read,0),this.draw(e.write),e.swap();this.endGpu(),this.flamePalette&&(this.flameOrigin={x:e.origin.x+(this.flameOrigin.x-t.origin.x)/t.scaleX*e.scaleX,y:e.origin.y+(this.flameOrigin.y-t.origin.y)/t.scaleY*e.scaleY}),this.view=e,i.bindFramebuffer(i.FRAMEBUFFER,null)}splat(e,t,n,r){if(t.x<-n*2||t.y<-n*2||t.x>this.width+n*2||t.y>this.height+n*2)return;let i=this.gl;this.use(`splat`),this.texture(`splat`,`uTarget`,e.read,0),this.vec2(`splat`,`point`,t.x/this.width,1-t.y/this.height),this.vec2(`splat`,`size`,this.width,this.height),i.uniform1f(this.uniform(`splat`,`radius`),Math.max(2,n)),i.uniform4f(this.uniform(`splat`,`value`),...r),this.draw(e.write),e.swap()}splatBatch(e,t){if(!t)return;let n=this.gl;this.use(`splatBatch`),this.texture(`splatBatch`,`uTarget`,e.read,0),this.vec2(`splatBatch`,`size`,this.width,this.height),n.uniform1i(this.uniform(`splatBatch`,`count`),t),n.uniform4fv(this.uniform(`splatBatch`,`stamps[0]`),this.batchStamps.subarray(0,t*4)),n.uniform4fv(this.uniform(`splatBatch`,`values[0]`),this.batchValues.subarray(0,t*4)),this.draw(e.write),e.swap()}splatSegment(e,t,n,r,i,a){let o=this.gl;this.use(`splatSegment`),this.texture(`splatSegment`,`uTarget`,e.read,0),this.vec2(`splatSegment`,`start`,t.x/this.width,1-t.y/this.height),this.vec2(`splatSegment`,`end`,n.x/this.width,1-n.y/this.height),this.vec2(`splatSegment`,`size`,this.width,this.height),this.vec2(`splatSegment`,`radii`,Math.max(2,r),Math.max(2,i)),o.uniform4f(this.uniform(`splatSegment`,`value`),...a),this.draw(e.write),e.swap()}splatFlame(e,t,n,r,i){let a=this.gl;this.use(`flameSource`),this.texture(`flameSource`,`uTarget`,this.dye.read,0),this.vec2(`flameSource`,`start`,e.x/this.width,1-e.y/this.height),this.vec2(`flameSource`,`end`,t.x/this.width,1-t.y/this.height),this.vec2(`flameSource`,`size`,this.width,this.height),a.uniform3f(this.uniform(`flameSource`,`radii`),...n),a.uniform3f(this.uniform(`flameSource`,`strengths`),...r),a.uniform1f(this.uniform(`flameSource`,`time`),i),this.draw(this.dye.write),this.dye.swap()}stirFlame(e,t,n,r,i,a){let o=this.gl;this.use(`flameEddies`),this.texture(`flameEddies`,`uTarget`,this.velocity.read,0),this.vec2(`flameEddies`,`start`,e.x,e.y),this.vec2(`flameEddies`,`end`,t.x,t.y),this.vec2(`flameEddies`,`size`,this.width,this.height),this.vec2(`flameEddies`,`cellSize`,i,a),o.uniform1f(this.uniform(`flameEddies`,`time`),n),o.uniform1f(this.uniform(`flameEddies`,`dt`),r),this.draw(this.velocity.write),this.velocity.swap()}applyBody(e){let t=this.gl;this.use(`body`),this.texture(`body`,`uVelocity`,this.velocity.read,0),this.vec2(`body`,`size`,this.width,this.height),this.vec2(`body`,`texelSize`,1/this.simulation.width,1/this.simulation.height),this.vec2(`body`,`center`,e.center.x,e.center.y),this.vec2(`body`,`forward`,e.forward.x,e.forward.y),this.vec2(`body`,`halfSize`,e.halfLength,e.halfWidth),this.vec2(`body`,`motion`,e.velocity.x,e.velocity.y),t.uniform1f(this.uniform(`body`,`spin`),e.spin),t.uniform1f(this.uniform(`body`,`bodyInfluence`),e.influence??(this.flamePalette?.35:1)),this.draw(this.velocity.write),this.velocity.swap()}updateWalls(e){let{width:t,height:n}=this.simulation;this.wallNext.fill(0);let r=!1;for(let i of e){if(i.width<=0||i.height<=0)continue;let e=Math.max(0,Math.floor(i.x/this.width*t)),a=Math.min(t-1,Math.ceil((i.x+i.width)/this.width*t)-1),o=Math.max(0,Math.floor(i.y/this.height*n)),s=Math.min(n-1,Math.ceil((i.y+i.height)/this.height*n)-1);for(let i=o;i<=s;i++)for(let o=e;o<=a;o++)this.wallNext[(n-1-i)*t+o]=255,r=!0}let i=r!==this.hasWalls;if(!i){for(let e=0;e<this.wallNext.length;e++)if(this.wallNext[e]!==this.wallPixels[e]){i=!0;break}}if(this.hasWalls=r,!i)return;[this.wallPixels,this.wallNext]=[this.wallNext,this.wallPixels];let a=this.gl;a.activeTexture(a.TEXTURE2),a.bindTexture(a.TEXTURE_2D,this.wallTexture),a.texSubImage2D(a.TEXTURE_2D,0,0,0,t,n,a.RED,a.UNSIGNED_BYTE,this.wallPixels)}inject(e,t,n,r,i){if(this.lost||t<=0)return;this.active=!0,this.idle=0;let a=this.width/this.simulation.width,o=this.height/this.simulation.height;this.splat(this.velocity,e,r*1.3,[n.x/a*t*.22,-n.y/o*t*.22,0,0]),i&&this.splat(this.velocity,{x:e.x+r*.5,y:e.y+r*.5},r,[-i/a*t*.08,i/o*t*.08,0,0]),this.splat(this.dye,e,r*1.2,[t*2.2,0,0,0])}injectBatch(e){if(this.lost||e.length===0)return;if(e.length===1){let t=e[0];this.inject(t.point,t.amount,t.flow,t.radiusPx,t.swirlPx);return}this.active=!0,this.idle=0;let t=this.width/this.simulation.width,n=this.height/this.simulation.height,r=0,i=(e,t,n,i)=>{if(e.x<-t*2||e.y<-t*2||e.x>this.width+t*2||e.y>this.height+t*2)return;let a=r*4;this.batchStamps[a]=e.x/this.width,this.batchStamps[a+1]=1-e.y/this.height,this.batchStamps[a+2]=Math.max(2,t),this.batchStamps[a+3]=0,this.batchValues[a]=n,this.batchValues[a+1]=i,this.batchValues[a+2]=0,this.batchValues[a+3]=0,r++,r===16&&(this.splatBatch(this.velocity,r),r=0)};for(let r of e){let{point:e,amount:a,flow:o,radiusPx:s,swirlPx:c}=r;a<=0||(i(e,s*1.3,o.x/t*a*.22,-o.y/n*a*.22),c&&i({x:e.x+s*.5,y:e.y+s*.5},s,-c/t*a*.08,c/n*a*.08))}this.splatBatch(this.velocity,r),r=0;for(let t of e){let{point:e,amount:n,radiusPx:i}=t;if(n<=0)continue;let a=i*1.2;if(e.x<-a*2||e.y<-a*2||e.x>this.width+a*2||e.y>this.height+a*2)continue;let o=r*4;this.batchStamps[o]=e.x/this.width,this.batchStamps[o+1]=1-e.y/this.height,this.batchStamps[o+2]=Math.max(2,a),this.batchStamps[o+3]=0,this.batchValues[o]=n*2.2,this.batchValues[o+1]=0,this.batchValues[o+2]=0,this.batchValues[o+3]=0,r++,r===16&&(this.splatBatch(this.dye,r),r=0)}this.splatBatch(this.dye,r)}disturb(e,t,n,r){if(!this.active||this.lost||r<=0)return;let i=this.width/this.simulation.width,a=this.height/this.simulation.height,o={x:e.x-t.x*r,y:e.y-t.y*r};this.splatSegment(this.velocity,o,e,n,n,[t.x/i*r*2.8,-t.y/a*r*2.8,0,0])}injectFlameSegment(e,t,n,r,i){if(this.lost||n<=0)return;this.active=!0,this.idle=0,this.flameOrigin=e;let a=this.width/this.simulation.width,o=this.height/this.simulation.height;this.splatSegment(this.velocity,e,t,8,21,[r.x/a*n*.26,-r.y/o*n*.26,0,0]);let s={x:e.x+(t.x-e.x)*.9,y:e.y+(t.y-e.y)*.9};this.stirFlame(e,s,i,n,a,o),this.splatFlame(e,t,[24,17,9],[n*.65,n*1.55,n*2.2],i)}injectFlameStamps(e,t,n){if(!e.length||this.lost||!this.flameSource||!this.flameStampProgram||!this.flameStampBuffer)return;this.beginGpu(`fire.stamps`);let r=this.gl,i=Math.min(e.length,this.flameStampData.length/5),a=null,o=null,s=0,c=0,l=0;for(let n=0;n<i;n++){let r=e[Math.floor(n*e.length/i)];!r.blast&&r.stir!==!1&&((!a||r.progress<a.progress)&&(a=r),(!o||r.progress>o.progress)&&(o=r),s+=r.flow.x,c+=r.flow.y,l++);let u=n*5;this.flameStampData[u]=r.point.x,this.flameStampData[u+1]=r.point.y,this.flameStampData[u+2]=Math.max(3,r.radius),this.flameStampData[u+3]=r.progress,this.flameStampData[u+4]=(r.blast?Math.min(.4,t*12):Math.min(.08,t*.65))*(r.strength??1)}this.active=!0,this.idle=0,this.flameOrigin=a?.point??{x:-1e3,y:-1e3},r.bindFramebuffer(r.FRAMEBUFFER,this.flameSource.framebuffer),r.viewport(0,0,this.flameSource.width,this.flameSource.height),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),r.useProgram(this.flameStampProgram),r.bindBuffer(r.ARRAY_BUFFER,this.flameStampBuffer),r.bufferData(r.ARRAY_BUFFER,this.flameStampData.subarray(0,i*5),r.DYNAMIC_DRAW);let u=of(this.flameStampProgram,`aStamp`),d=of(this.flameStampProgram,`aStrength`);if(r.enableVertexAttribArray(u),r.vertexAttribPointer(u,4,r.FLOAT,!1,20,0),r.enableVertexAttribArray(d),r.vertexAttribPointer(d,1,r.FLOAT,!1,20,16),r.uniform2f(af(this.flameStampProgram,`canvasSize`),this.width,this.height),r.uniform2f(af(this.flameStampProgram,`dyeSize`),this.flameSource.width,this.flameSource.height),r.uniform1i(af(this.flameStampProgram,`agePalette`),Number(this.agePalette)),r.enable(r.BLEND),r.blendFunc(r.ONE,r.ONE),r.drawArrays(r.POINTS,0,i),r.disable(r.BLEND),this.use(`addFlame`),this.texture(`addFlame`,`uTarget`,this.dye.read,0),this.texture(`addFlame`,`uSource`,this.flameSource,1),this.draw(this.dye.write),this.dye.swap(),!a||!o||!l){this.endGpu();return}let f=this.width/this.simulation.width,p=this.height/this.simulation.height,m={x:s/l,y:c/l},h=[m.x/f*t*.18,-m.y/p*t*.18,0,0],g=Math.hypot(m.x,m.y);if(g>.001){let r=1/0,i=-1/0;for(let t of e){if(t.blast||t.stir===!1)continue;let e=(-t.point.x*m.y+t.point.y*m.x)/g;r=Math.min(r,e),i=Math.max(i,e)}if(i-r>10){let a=(r+i)*.5,o=null,s=null,c=null,l=null;for(let t of e)t.blast||t.stir===!1||((-t.point.x*m.y+t.point.y*m.x)/g<a?((!o||t.progress<o.progress)&&(o=t),(!s||t.progress>s.progress)&&(s=t)):((!c||t.progress<c.progress)&&(c=t),(!l||t.progress>l.progress)&&(l=t)));if(o&&s&&c&&l){this.splatSegment(this.velocity,o.point,s.point,7,19,h),this.splatSegment(this.velocity,c.point,l.point,7,19,h),this.stirFlame(o.point,s.point,n,t*.55,f,p),this.stirFlame(c.point,l.point,n,t*.55,f,p),this.endGpu();return}}}this.splatSegment(this.velocity,a.point,o.point,7,19,h),this.stirFlame(a.point,o.point,n,t*.55,f,p),this.endGpu()}setFlameInk(e){if(!this.flamePalette||!this.flameSmokeTail||this.lost)return;let t=this.gl;this.flameInk&&t.deleteTexture(this.flameInk.texture);let n=t.createTexture();if(!n)throw Error(`Unable to allocate flame ink texture`);t.bindTexture(t.TEXTURE_2D,n),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.pixelStorei(t.UNPACK_ALIGNMENT,1),t.texImage2D(t.TEXTURE_2D,0,t.R8,e.pixelWidth,e.pixelHeight,0,t.RED,t.UNSIGNED_BYTE,e.alpha),this.flameInk={texture:n,x:e.x,y:e.y,width:e.width,height:e.height,ignitionX:e.origin.x-e.x}}injectFlameInk(e,t){let n=this.flameInk;if(!n||!this.flameSource||this.lost||e>(n.width-n.ignitionX)/88+1.28)return;let r=this.gl;this.active=!0,this.idle=0,this.flameOrigin={x:-1e3,y:-1e3},this.use(`inkFlame`),r.activeTexture(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,n.texture),r.uniform1i(this.uniform(`inkFlame`,`uInk`),0),this.vec2(`inkFlame`,`uCanvasSize`,this.width,this.height),this.vec2(`inkFlame`,`uInkOrigin`,n.x,n.y),this.vec2(`inkFlame`,`uInkSize`,n.width,n.height),this.vec2(`inkFlame`,`uIgnition`,n.ignitionX,0),r.uniform1f(this.uniform(`inkFlame`,`uTime`),e),r.uniform1f(this.uniform(`inkFlame`,`uDt`),Math.min(.05,t)),this.draw(this.flameSource),this.use(`addFlame`),this.texture(`addFlame`,`uTarget`,this.dye.read,0),this.texture(`addFlame`,`uSource`,this.flameSource,1),this.draw(this.dye.write),this.dye.swap(),this.use(`inkFlow`),this.texture(`inkFlow`,`uVelocity`,this.velocity.read,0),this.vec2(`inkFlow`,`uCanvasSize`,this.width,this.height),this.vec2(`inkFlow`,`uCellSize`,this.width/this.simulation.width,this.height/this.simulation.height),this.vec2(`inkFlow`,`uInkOrigin`,n.x,n.y),this.vec2(`inkFlow`,`uInkSize`,n.width,n.height),r.uniform1f(this.uniform(`inkFlow`,`uIgnitionX`),n.ignitionX),r.uniform1f(this.uniform(`inkFlow`,`uTime`),e),r.uniform1f(this.uniform(`inkFlow`,`uDt`),Math.min(.05,t)),this.draw(this.velocity.write),this.velocity.swap()}injectBurnMasks(e,t,n){if(!this.flameSmokeTail||!this.flameSource||this.lost)return;this.beginGpu(`fire.mask`);let r=this.gl,i=this.flameSource,a=new Set;r.bindFramebuffer(r.FRAMEBUFFER,i.framebuffer),r.viewport(0,0,i.width,i.height),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),this.use(`sceneInkFlame`),this.vec2(`sceneInkFlame`,`uCanvasSize`,this.width,this.height),r.uniform1f(this.uniform(`sceneInkFlame`,`uDt`),Math.min(.05,t)),r.uniform1f(this.uniform(`sceneInkFlame`,`uTime`),n),r.uniform1i(this.uniform(`sceneInkFlame`,`uAgePalette`),Number(this.agePalette)),r.enable(r.BLEND),r.blendFunc(r.ONE,r.ONE),r.enable(r.SCISSOR_TEST);let o=0;for(let t of e){if(t.width<=0||t.height<=0||t.pixelWidth<=0||t.pixelHeight<=0||t.alpha.length<t.pixelWidth*t.pixelHeight)continue;let e=t.x+t.width/2,n=t.y+t.height/2,s=Math.hypot(t.width,t.height)/2+5;if(e+s<0||e-s>this.width||n+s<0||n-s>this.height)continue;let c=Math.max(0,Math.floor((e-s)*i.width/this.width)),l=Math.min(i.width,Math.ceil((e+s)*i.width/this.width)),u=Math.max(0,Math.floor((this.height-n-s)*i.height/this.height)),d=Math.min(i.height,Math.ceil((this.height-n+s)*i.height/this.height));if(l<=c||d<=u)continue;a.add(t.key);let f=this.sceneInk.get(t.key);if(!f||f.width!==t.pixelWidth||f.height!==t.pixelHeight){f&&r.deleteTexture(f.texture);let e=r.createTexture();if(!e)continue;f={texture:e,width:t.pixelWidth,height:t.pixelHeight,alpha:t.alpha,revision:t.revision??0},this.sceneInk.set(t.key,f),r.activeTexture(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,e),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.pixelStorei(r.UNPACK_ALIGNMENT,1),r.texImage2D(r.TEXTURE_2D,0,r.R8,f.width,f.height,0,r.RED,r.UNSIGNED_BYTE,t.alpha)}else r.activeTexture(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,f.texture),(f.alpha!==t.alpha||f.revision!==(t.revision??0))&&(r.texSubImage2D(r.TEXTURE_2D,0,0,0,f.width,f.height,r.RED,r.UNSIGNED_BYTE,t.alpha),f.alpha=t.alpha,f.revision=t.revision??0);r.uniform1i(this.uniform(`sceneInkFlame`,`uInk`),0),r.scissor(c,u,l-c,d-u),r.uniform4f(this.uniform(`sceneInkFlame`,`uRect`),t.x,t.y,t.width,t.height),this.vec2(`sceneInkFlame`,`uOrigin`,t.origin.x,t.origin.y),r.uniform1f(this.uniform(`sceneInkFlame`,`uAngle`),t.angle??0),r.uniform1f(this.uniform(`sceneInkFlame`,`uAge`),t.age),r.uniform1f(this.uniform(`sceneInkFlame`,`uFarthest`),t.farthest),r.uniform1f(this.uniform(`sceneInkFlame`,`uSpreadSeconds`),t.spreadSeconds),r.uniform1f(this.uniform(`sceneInkFlame`,`uBurnSeconds`),t.burnSeconds),r.uniform1f(this.uniform(`sceneInkFlame`,`uSmokeRate`),(t.smokeRate??13)/13),r.uniform1f(this.uniform(`sceneInkFlame`,`uIntensity`),t.intensity??1),r.uniform1f(this.uniform(`sceneInkFlame`,`uFixedRadius`),t.fixedRadius??0),r.uniform1f(this.uniform(`sceneInkFlame`,`uSmokeOnly`),+!!t.smokeOnly),r.uniform1f(this.uniform(`sceneInkFlame`,`uBlastAge`),t.blastAge??-1),r.uniform1f(this.uniform(`sceneInkFlame`,`uBlastSeconds`),t.blastSeconds??0),this.draw(i),o++}r.disable(r.SCISSOR_TEST),r.disable(r.BLEND);for(let[e,t]of this.sceneInk)a.has(e)||(r.deleteTexture(t.texture),this.sceneInk.delete(e));o&&(this.active=!0,this.sceneFireActive=!0,this.idle=0,this.flameOrigin={x:-1e3,y:-1e3},this.use(`addFlame`),this.texture(`addFlame`,`uTarget`,this.dye.read,0),this.texture(`addFlame`,`uSource`,i,1),this.draw(this.dye.write),this.dye.swap()),this.endGpu()}applySceneFlow(e,t){let n=this.gl;this.use(`sceneFlow`),this.texture(`sceneFlow`,`uVelocity`,this.velocity.read,0),this.texture(`sceneFlow`,`uDye`,this.dye.read,1),this.vec2(`sceneFlow`,`uCanvasSize`,this.width,this.height),this.vec2(`sceneFlow`,`uCellSize`,this.width/this.simulation.width,this.height/this.simulation.height),n.uniform1f(this.uniform(`sceneFlow`,`uTime`),t),n.uniform1f(this.uniform(`sceneFlow`,`uDt`),Math.min(.05,e)),this.draw(this.velocity.write),this.velocity.swap()}step(e,t,n=[]){if(!this.active||this.lost)return;let r=this.gl;if(e=Math.min(.05,e),this.idle+=e,this.idle>(this.ghostPalette?1.7:this.flamePalette?this.flameSmokeTail?3.2:1.35:10)){this.reset();return}this.beginGpu(`fire.curlAndWalls`),r.disable(r.BLEND),this.updateWalls(n);let i=1/this.simulation.width,a=1/this.simulation.height;t&&this.applyBody(t),this.use(`curl`),this.vec2(`curl`,`texelSize`,i,a),this.texture(`curl`,`uVelocity`,this.velocity.read,0),this.draw(this.curl),this.use(`vorticity`),this.vec2(`vorticity`,`texelSize`,i,a),this.texture(`vorticity`,`uVelocity`,this.velocity.read,0),this.texture(`vorticity`,`uCurl`,this.curl,1),r.uniform1f(this.uniform(`vorticity`,`curl`),this.vorticity),r.uniform1f(this.uniform(`vorticity`,`dt`),e),this.draw(this.velocity.write),this.velocity.swap(),this.use(`divergence`),this.bindWalls(`divergence`),this.vec2(`divergence`,`texelSize`,i,a),this.texture(`divergence`,`uVelocity`,this.velocity.read,0),this.draw(this.divergence),this.endGpu(),this.beginGpu(`fire.pressure`),this.use(`clear`),this.texture(`clear`,`uTexture`,this.pressure.read,0),r.uniform1f(this.uniform(`clear`,`value`),.8),this.draw(this.pressure.write),this.pressure.swap(),this.use(`pressure`),this.bindWalls(`pressure`),this.vec2(`pressure`,`texelSize`,i,a),this.texture(`pressure`,`uDivergence`,this.divergence,0);for(let e=0;e<vf[this.quality].iterations;e++)this.texture(`pressure`,`uPressure`,this.pressure.read,1),this.draw(this.pressure.write),this.pressure.swap();this.use(`gradient`),this.bindWalls(`gradient`),this.vec2(`gradient`,`texelSize`,i,a),this.texture(`gradient`,`uPressure`,this.pressure.read,0),this.texture(`gradient`,`uVelocity`,this.velocity.read,1),this.draw(this.velocity.write),this.velocity.swap(),this.endGpu(),this.beginGpu(`fire.transport`),t&&this.applyBody(t),this.use(`advection`),this.bindWalls(`advection`),r.uniform1i(this.uniform(`advection`,`ageDye`),0),this.vec2(`advection`,`velocityTexel`,i,a),this.vec2(`advection`,`sourceTexel`,i,a),r.uniform1f(this.uniform(`advection`,`dt`),e),r.uniform4f(this.uniform(`advection`,`dissipation`),.2,.2,.2,.2),this.texture(`advection`,`uVelocity`,this.velocity.read,0),this.texture(`advection`,`uSource`,this.velocity.read,1),this.draw(this.velocity.write),this.velocity.swap(),this.sceneFireActive&&this.applySceneFlow(e,performance.now()*.001);for(let e of this.radialBlasts)this.use(`radialBlast`),this.texture(`radialBlast`,`uVelocity`,this.velocity.read,0),this.vec2(`radialBlast`,`uCanvasSize`,this.width,this.height),this.vec2(`radialBlast`,`uCellSize`,this.width/this.simulation.width,this.height/this.simulation.height),this.vec2(`radialBlast`,`uCenter`,e.center.x,e.center.y),r.uniform1f(this.uniform(`radialBlast`,`uRadius`),e.radius),this.draw(this.velocity.write),this.velocity.swap();this.radialBlasts=[],this.use(`advection`),this.bindWalls(`advection`),r.uniform1i(this.uniform(`advection`,`ageDye`),Number(this.agePalette)),this.vec2(`advection`,`velocityTexel`,i,a),r.uniform1f(this.uniform(`advection`,`dt`),e),this.vec2(`advection`,`sourceTexel`,1/this.dyeSize.width,1/this.dyeSize.height);let o=this.idle<.1,s=o?1:2.8;r.uniform4f(this.uniform(`advection`,`dissipation`),this.agePalette?s:this.flamePalette?o?.7:3:this.ghostPalette?2.1:.65,this.agePalette?s:this.flamePalette?o?.85:3.8:0,this.agePalette?s:this.flamePalette?o?1.05:4.8:0,this.flameSmokeTail?hf(this.idle).dissipation:0),this.texture(`advection`,`uVelocity`,this.velocity.read,0),this.texture(`advection`,`uSource`,this.dye.read,1),this.draw(this.dye.write),this.dye.swap(),this.endGpu()}drawTo(e,t,n=!1,r=[]){if(!this.active||this.lost)return;this.align(t),this.beginGpu(`fire.display`);let i=this.gl,a=this.ghostPalette?`ghostDisplay`:`display`;this.use(a),this.bindWalls(a),this.texture(a,`uDye`,this.dye.read,0);let o=typeof this.tint==`string`?this.tint===`cyan`?[.34,.83,.96]:this.tint===`magenta`?[.94,.38,.81]:_f:this.tint;if(i.uniform3f(this.uniform(a,`smokeColor`),o[0],o[1],o[2]),i.uniform1i(this.uniform(a,`darkBackground`),Number(n)),this.ghostPalette&&i.uniform1i(this.uniform(a,`ghostStyle`),this.ghostStyle===`specter`?0:this.ghostStyle===`phantom`?1:2),!this.ghostPalette){let e=Math.min(r.length,12);i.uniform1i(this.uniform(`display`,`vehicleLightCount`),e);for(let t=0;t<e;t++){let e=r[t],n=t*4;this.lightPositions[n]=e.point.x,this.lightPositions[n+1]=e.point.y,this.lightPositions[n+2]=e.range,this.lightPositions[n+3]=e.radius,this.lightShapes[n]=e.direction.x,this.lightShapes[n+1]=e.direction.y,this.lightShapes[n+2]=e.spread,this.lightShapes[n+3]=0,this.lightColors[n]=e.color[0],this.lightColors[n+1]=e.color[1],this.lightColors[n+2]=e.color[2],this.lightColors[n+3]=e.intensity}e&&(i.uniform4fv(this.uniform(`display`,`vehicleLightPosition[0]`),this.lightPositions),i.uniform4fv(this.uniform(`display`,`vehicleLightShape[0]`),this.lightShapes),i.uniform4fv(this.uniform(`display`,`vehicleLightColor[0]`),this.lightColors)),i.uniform1i(this.uniform(`display`,`flamePalette`),Number(this.flamePalette)),i.uniform1i(this.uniform(`display`,`agePalette`),Number(this.agePalette)),i.uniform1f(this.uniform(`display`,`lifecycleOpacity`),this.flameSmokeTail?hf(this.idle).opacity:1),this.vec2(`display`,`flameOrigin`,this.flameOrigin.x,this.height-this.flameOrigin.y),this.vec2(`display`,`size`,this.width,this.height)}i.bindFramebuffer(i.FRAMEBUFFER,null),i.viewport(0,0,this.canvas.width,this.canvas.height),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),this.draw(null),this.endGpu(),Xe(`composited megapixels`,this.canvas.width*this.canvas.height/1e6),e.drawImage(this.canvas,0,0,this.width,this.height)}};function Tf(e,t,n,r=`fuel-age`){return new wf(e,t,n,`natural`,12,!0,!0,!1,r===`fuel-age`)}var Ef=class{camera;quality;tireFire=new Ha;fluid=null;fluidAttempted=!1;fluidClock=0;maskBatch=new Va;sceneMasks=new Map;hadSceneMasks=!1;stamps=[];blasts=[];vehicleAlpha=new WeakMap;previousFireTire=new Map;fireRefreshClock=0;constructor(e,t){this.camera=e,this.quality=t}get count(){return this.tireFire.count}get managedBytes(){return this.tireFire.managedBytes+(this.fluid?.managedBytes??0)}get resolution(){return this.fluid?.resolution}get available(){return this.fluid?.available??!1}prepare(){if(!this.fluidAttempted){this.fluidAttempted=!0,performance.now();try{this.fluid=Tf(this.camera.width,this.camera.height,this.quality)}catch(e){console.error(`Joy Ride fire requires WebGL2`,e)}}return this.fluid?.available?this.fluid:null}ensure(){return!!this.prepare()}get running(){return!!this.fluid?.running}setQuality(e){this.quality=e,this.fluid?.setQuality(e)}resize(e){this.fluid?.resize(this.camera.width,this.camera.height,!1,e)}alphaFor(e){let t=this.vehicleAlpha.get(e);return t||(t=e.map(e=>e?255:0),this.vehicleAlpha.set(e,t)),t}sceneMasksDue(e){return!this.sceneMasks.size||this.fluidClock+e>=this.solveInterval()}solveInterval(){return 1/(this.quality===`high`?45:this.quality===`medium`?30:24)}queueMask(e){this.prepare()&&this.sceneMasks.set(e.key,e)}queueBlast(e,t){this.blasts.push({point:e,radius:t})}queueStamp(e){this.prepare()&&this.stamps.push(e)}activateBuoyancy(){let e=this.prepare();return e?(e.activateBuoyancy(),!0):!1}emitJet(e,t,n,i,a,o){if(!this.prepare())return;let s=this.camera.particlePoint(e),l=this.camera.particlePoint(t),d=c(l,s),f=this.camera.particleScale(),p=Math.max(o===`rocket`?6:4,i*f*1.9),m=o===`exhaust`&&u(d)<.001?0:Math.min(10,Math.max(1,Math.ceil(u(d)/Math.max(4,p)))),h=this.camera.pixelSpace?N(n.x*this.camera.zoom,-n.y*this.camera.zoom):{...n};for(let e=0;e<=m;e++){let t=1-e/Math.max(1,m);this.stamps.push({point:E(E(s,r(d,e/Math.max(1,m))),o===`rocket`?r(h,t*.025):N()),radius:p*(o===`rocket`?.8+t*.65:1),progress:o===`rocket`?.08+t*.48:.95,flow:h,strength:o===`rocket`?a*5.2:4+a*8,source:o===`rocket`?`rocket`:void 0,stir:o===`rocket`})}}igniteTire(e,t,n,r,i){this.tireFire.ignite(e,t,n,r,i)}stepTire(e){this.tireFire.step(e)}emberSource(){return this.tireFire.emberSource()}clearTireHistory(){this.previousFireTire.clear(),this.fireRefreshClock=0}stepBoostFire(e,t,n){if(!e.car.boostActive){this.clearTireHistory();return}this.fireRefreshClock+=t;let r=this.fireRefreshClock>=1/15;r&&(this.fireRefreshClock%=1/15);let i=this.camera.particleScale();e.car.tires.forEach((t,a)=>{if(t.front)return;let o=this.camera.particlePoint(e.body.world(t.local));n(o);let s=this.previousFireTire.get(a)??o;!r&&u(c(o,s))<.24*i&&this.previousFireTire.has(a)||(this.igniteTire(s,o,e.car.preset.geometry.tireWidthM*i,e.car.preset.launch.fireLifetimeSeconds,.24*i),this.previousFireTire.set(a,o))})}particleScreen(e){return this.camera.pixelSpace?c(e,this.camera.sceneScroll()):this.camera.screen(e)}step(e,t,n,r,i,a,o){let s=this.fluid??(this.tireFire.count?this.prepare():null);if(!s?.available){this.stamps=[],this.blasts=[],this.sceneMasks.clear();return}if(!this.stamps.length&&!this.blasts.length&&!this.sceneMasks.size&&!this.tireFire.count&&s.managedBytes===0)return;this.fluidClock+=e;let l=this.solveInterval();if(this.fluidClock<l)return;let u=Math.min(.1,this.fluidClock);this.fluidClock=Math.max(0,this.fluidClock-l),s.align(a);let d=i?[]:this.tireFire.stamps();d.length&&s.activateBuoyancy();let f=[...this.stamps,...d].map(e=>({...e,point:this.particleScreen(e.point),radius:e.radius*(this.camera.pixelSpace?1:this.camera.zoom),flow:this.camera.pixelSpace?e.flow:N(e.flow.x*this.camera.zoom,-e.flow.y*this.camera.zoom)}));this.stamps=[];for(let e of this.blasts)s.queueRadialBlast(this.particleScreen(e.point),e.radius*(this.camera.pixelSpace?1:this.camera.zoom));this.blasts=[];let p=this.camera.pixelSpace?this.camera.sceneScroll():N(),m=[...this.sceneMasks.values()].map(e=>({...e,x:e.x-p.x,y:e.y-p.y,origin:c(e.origin,p)}));this.sceneMasks.clear();let h=Math.min(8,m.length);for(let e=0;e<h;e++){let t=m[Math.floor((e+.5)*m.length/h)];t.smokeOnly||o.emitFire(t,u)}performance.now();let g=this.maskBatch.combine(m,this.camera.width,this.camera.height);(g.length||this.hadSceneMasks||s.hasSceneFire)&&(performance.now(),s.injectBurnMasks(g,u,t),this.hadSceneMasks=g.length>0),performance.now();let _=f.filter(e=>e.source===`rocket`);s.injectFlameStamps(_.length?f.filter(e=>e.source!==`rocket`):f,u,t),_.length&&s.injectFlameStamps(_,u,t);let v=this.camera.pixelSpace?r.map(e=>({x:e.x-p.x,y:e.y-p.y,width:e.width,height:e.height})):[];performance.now(),s.step(u,n&&this.camera.pixelSpace?{...n,center:c(n.center,N(this.camera.smokeMargin,this.camera.smokeMargin))}:n,v)}draw(e,t,n,r){this.fluid?.drawTo(e,t,n,r)}captureState(){let e=this.tireFire.captureState();try{let t=this.fluid?.captureState()??null;return{tireFire:e,flame:t,fluidAttempted:this.fluidAttempted,fluidClock:this.fluidClock,hadSceneMasks:this.hadSceneMasks,stamps:this.stamps.map(e=>({...e,point:{...e.point},flow:{...e.flow}})),blasts:this.blasts.map(e=>({point:{...e.point},radius:e.radius})),previousFireTire:new Map([...this.previousFireTire].map(([e,t])=>[e,{...t}])),fireRefreshClock:this.fireRefreshClock,dispose:()=>{e.dispose(),t?.dispose()}}}catch(t){throw e.dispose(),t}}restoreState(e){if(this.reset(),this.tireFire.restoreState(e.tireFire),e.flame){this.fluid||(this.fluidAttempted=!1);let t=this.fluid??this.prepare();if(!t)throw Error(`Flame GPU context is unavailable`);t.restoreState(e.flame),this.fluidAttempted=e.fluidAttempted}else this.fluid?.dispose(),this.fluid=null,this.fluidAttempted=!1;this.fluidClock=e.fluidClock,this.hadSceneMasks=e.hadSceneMasks,this.stamps=e.stamps.map(e=>({...e,point:{...e.point},flow:{...e.flow}})),this.blasts=e.blasts.map(e=>({point:{...e.point},radius:e.radius}));for(let[t,n]of e.previousFireTire)this.previousFireTire.set(t,{...n});this.fireRefreshClock=e.fireRefreshClock}reset(){this.tireFire.reset(),this.fluid?.reset(),this.fluidClock=0,this.sceneMasks.clear(),this.hadSceneMasks=!1,this.stamps=[],this.blasts=[],this.clearTireHistory()}dispose(){this.fluid?.dispose(),this.tireFire.dispose()}},Df=class{quality;gpu=null;constructor(e,t,n,r=`natural`){this.quality=n;try{this.gpu=new wf(e,t,n,r)}catch(e){console.error(`Joy Ride smoke requires WebGL2`,e)}}get running(){return!!this.gpu?.running}get usesWebGL(){return!!this.gpu?.available}get managedBytes(){return this.usesWebGL?this.gpu.managedBytes:0}get resolution(){return this.usesWebGL?this.gpu.resolution:{quality:this.quality,cols:0,rows:0,engine:`WebGL2 required`}}captureState(){return this.usesWebGL?this.gpu.captureState():null}restoreState(e){if(e&&!this.usesWebGL)throw Error(`Smoke GPU context is unavailable`);e?this.gpu.restoreState(e):this.reset()}setQuality(e){this.quality=e,this.usesWebGL&&this.gpu.setQuality(e)}setTint(e){this.usesWebGL&&this.gpu.setTint(e)}resize(e,t,n){this.usesWebGL&&this.gpu.resize(e,t,!1,n)}reset(){this.usesWebGL&&this.gpu.reset()}dispose(){this.gpu?.dispose(),this.gpu=null}align(e){this.usesWebGL&&this.gpu.align(e)}inject(e,t,n,r,i){this.usesWebGL&&this.gpu.inject(e,t,n,r,i)}injectBatch(e){this.usesWebGL&&this.gpu.injectBatch(e)}disturb(e,t,n,r){this.usesWebGL&&this.gpu.disturb(e,t,n,r)}step(e,t,n=[]){this.usesWebGL&&this.gpu.step(e,t,n)}draw(e,t,n=[],r=!1){this.usesWebGL&&this.gpu.drawTo(e,t,r,n)}},Of=class{camera;quality;smoke;sources=[];smokeClock=0;ghost=null;ghostAttempted=!1;ghostClock=0;ghostStyle=`phantom`;ghostWallCoverage=new Map;ghostEmergence=new Map;constructor(e,t){this.camera=e,this.quality=t,this.smoke=new Df(1,1,t)}get smokeResolution(){return this.smoke.resolution}get smokeBytes(){return this.sources.length*64+this.smoke.managedBytes}get ghostBytes(){return this.ghost?.managedBytes??0}get ghostAvailable(){return this.ghost?.available??!1}get style(){return this.ghostStyle}get running(){return this.smoke.running||!!this.ghost?.running}setQuality(e){this.quality=e,this.smoke.setQuality(e),this.ghost?.setQuality(e)}setSmokeTint(e){this.smoke.setTint(e)}setGhostStyle(e){this.ghostStyle=e,this.ghost?.setGhostStyle(e)}resize(e){this.smoke.resize(this.camera.width+2*this.camera.smokeMargin,this.camera.height+2*this.camera.smokeMargin,e),this.ghost?.resize(this.camera.width,this.camera.height,!1,e)}emitSmoke(e){this.sources.push(e)}clearSmokeSources(){this.sources=[]}particleScreen(e){return this.camera.pixelSpace?c(e,this.camera.sceneScroll()):this.camera.screen(e)}stepSmoke(e,t,n,r){if(!this.smoke.usesWebGL){this.sources=[];return}this.smokeClock+=e;let i=1/(this.quality===`high`?45:this.quality===`medium`?30:24);if(this.smokeClock<i)return;let a=Math.min(.1,this.smokeClock);this.smokeClock=Math.max(0,this.smokeClock-i),this.smoke.align(r),this.smoke.injectBatch(this.sources.map(e=>({...e,point:E(this.particleScreen(e.point),N(this.camera.smokeMargin,this.camera.smokeMargin))}))),this.sources=[];let o=this.camera.sceneScroll(),s=this.camera.pixelSpace?n.map(e=>({x:e.x-o.x+this.camera.smokeMargin,y:e.y-o.y+this.camera.smokeMargin,width:e.width,height:e.height})):[];this.smoke.step(a,t,s)}drawSmoke(e,t,n,r){this.smoke.draw(e,t,n,r)}prepareGhost(){if(!this.ghostAttempted){this.ghostAttempted=!0;try{this.ghost=new wf(this.camera.width,this.camera.height,this.quality,Ma.lightColor,Ma.vorticity,!1,!1,!0),this.ghost.setGhostStyle(this.ghostStyle)}catch(e){console.error(`Joy Ride ghost mode requires WebGL2`,e)}}return this.ghost?.available?this.ghost:null}stepGhost(e,t,n,i,a,o){let s=t.filter(e=>e.isGhost);if(!s.length)this.ghostWallCoverage.clear(),this.ghostEmergence.clear();else{let e=new Set(s.map(e=>e.id));for(let t of this.ghostWallCoverage.keys())e.has(t)||this.ghostWallCoverage.delete(t);for(let t of this.ghostEmergence.keys())e.has(t)||this.ghostEmergence.delete(t)}let c=s.length?this.prepareGhost():this.ghost;if(!c?.available||!s.length&&c.managedBytes===0)return;this.ghostClock+=e;let l=1/(this.quality===`high`?45:this.quality===`medium`?30:24);if(this.ghostClock<l)return;let d=Math.min(.1,this.ghostClock);this.ghostClock=Math.max(0,this.ghostClock-l),c.align(a);let f=this.camera.sceneScroll(),p=this.camera.pixelSpace?n.map(e=>({x:e.x-f.x,y:e.y-f.y,width:e.width,height:e.height})):[],m=null;if(i&&s.length){let e=Ma.styles[this.ghostStyle],n=[];for(let a of s){let{sim:s}=a,c=i(a),l=E(this.camera.screen(s.body.position),a===t[0]?o(a):N()),f=N(Math.cos(s.body.angle),-Math.sin(s.body.angle)),h=N(-f.y,f.x),g=c.lengthM*this.camera.zoom/2,_=c.widthM*this.camera.zoom/2,v=Na(l,f,g,_,p),y=this.ghostWallCoverage.get(a.id)??0,b=y+(v-y)*(1-Math.exp(-d*12));this.ghostWallCoverage.set(a.id,b);let x=Math.max(0,(this.ghostEmergence.get(a.id)??0)-d/Ma.emergenceFadeSeconds,(y-v)*1.8);this.ghostEmergence.set(a.id,x);let S=N(s.body.velocity.x*this.camera.zoom,-s.body.velocity.y*this.camera.zoom),C=r(S,Math.min(1,Ma.maxMotionSpeedPxPerSecond/Math.max(1,u(S)))),w=u(C),T=Math.min(1,w/Ma.wakeSpeedPxPerSecond),D=C.x*f.x+C.y*f.y,ee=Math.max(3,Math.min(14,_*e.radiusFactor));m||={center:l,forward:f,halfLength:g*.94,halfWidth:_*.78,velocity:C,spin:-s.body.spin,influence:e.bodyInfluence};let te=Fa(c.alpha,this.quality),ne=Fa(c.alpha,`low`).length/te.length;for(let t of te){let i=Math.max(0,D>=0?-t.x:t.x);n.push({point:E(l,E(r(f,t.x*g),r(h,t.y*_))),amount:d*e.emissionPerSecond*Ma.emissionFactor*ne*(1+T*i*Ma.wakeEmissionFactor)*(1+b*Ma.wallSmokeFactor+x*Ma.emergenceSmokeFactor),flow:E(r(C,.18-T*i*Ma.wakeFlowFactor),E(r(h,t.y*e.driftPixelsPerSecond),r(f,-e.driftPixelsPerSecond*.65))),radiusPx:ee,swirlPx:e.driftPixelsPerSecond*(t.y<0?-1:1)})}if(x>.05){let t=D>=0?-1:1,i=E(l,r(f,g*t*.72));for(let a of[-1,1])n.push({point:E(i,r(h,a*_*.45)),amount:d*e.emissionPerSecond*Ma.emissionFactor*x*1.35,flow:E(r(f,t*e.driftPixelsPerSecond*2),r(h,a*e.driftPixelsPerSecond*.7)),radiusPx:ee*1.55,swirlPx:a*e.driftPixelsPerSecond})}}c.injectBatch(n)}c.step(d,m,p)}drawGhost(e,t,n){this.ghost?.available&&(this.ghost.setTint(n?Ma.darkColor:Ma.lightColor),this.ghost.drawTo(e,t,n))}captureState(){let e=this.smoke.captureState();try{let t=this.ghost?.captureState()??null;return{smoke:e,ghost:t,sources:this.sources.map(e=>({...e,point:{...e.point},flow:{...e.flow}})),smokeClock:this.smokeClock,ghostAttempted:this.ghostAttempted,ghostClock:this.ghostClock,ghostStyle:this.ghostStyle,ghostWallCoverage:new Map(this.ghostWallCoverage),ghostEmergence:new Map(this.ghostEmergence),dispose:()=>{e?.dispose(),t?.dispose()}}}catch(t){throw e?.dispose(),t}}restoreState(e){if(this.reset(),this.smoke.restoreState(e.smoke),this.ghostStyle=e.ghostStyle,e.ghost){this.ghost||(this.ghostAttempted=!1);let t=this.ghost??this.prepareGhost();if(!t)throw Error(`Ghost GPU context is unavailable`);t.restoreState(e.ghost),t.setGhostStyle(this.ghostStyle),this.ghostAttempted=e.ghostAttempted}else this.ghost?.dispose(),this.ghost=null,this.ghostAttempted=!1;this.sources=e.sources.map(e=>({...e,point:{...e.point},flow:{...e.flow}})),this.smokeClock=e.smokeClock,this.ghostClock=e.ghostClock,this.ghostWallCoverage=new Map(e.ghostWallCoverage),this.ghostEmergence=new Map(e.ghostEmergence)}reset(){this.smoke.reset(),this.ghost?.reset(),this.sources=[],this.smokeClock=0,this.ghostClock=0,this.ghostWallCoverage.clear(),this.ghostEmergence.clear()}dispose(){this.smoke.dispose(),this.ghost?.dispose()}},kf={world:1,foreground:2,backdrop:3,hud:4,controls:5};function Af(e){return`calc(var(--joy-ride-z-index, ${kf.world}) + ${kf[e]-kf.world})`}var jf=`[data-jr-foreground]`,Mf=new WeakMap;function Nf(e=jf){let t=new Map,n=!1,r=!1,i=(e,t)=>{if(--t.users>0)return;Mf.delete(e);let n=e.style;n.zIndex===Af(`foreground`)&&(t.zIndex?n.setProperty(`z-index`,t.zIndex,t.zIndexPriority):n.removeProperty(`z-index`)),t.positioned&&n.position===`relative`&&!t.position?n.removeProperty(`position`):t.positioned&&n.position===`relative`&&t.position===`static`&&n.setProperty(`position`,t.position,t.positionPriority),e.getAttribute(`data-jr-ui`)===``&&(t.ui===null?e.removeAttribute(`data-jr-ui`):e.setAttribute(`data-jr-ui`,t.ui))},a=new MutationObserver(()=>{r||(r=!0,queueMicrotask(()=>{r=!1,n||o()}))}),o=()=>{if(n)return;let r=new Set(e?[...document.querySelectorAll(e)].filter(e=>e instanceof HTMLElement&&e!==document.body&&e!==document.documentElement):[]);a.disconnect();for(let[e,n]of t)r.has(e)||(i(e,n),t.delete(e));for(let e of r){let n=e.style;if(!t.has(e)){let r=Mf.get(e);r?r.users++:(r={position:n.position,positionPriority:n.getPropertyPriority(`position`),zIndex:n.zIndex,zIndexPriority:n.getPropertyPriority(`z-index`),ui:e.getAttribute(`data-jr-ui`),positioned:!1,users:1},Mf.set(e,r)),t.set(e,r)}let r=getComputedStyle(e);r.position===`static`&&(n.setProperty(`position`,`relative`,`important`),t.get(e).positioned=!0),r.zIndex&&r.zIndex!==`auto`||n.setProperty(`z-index`,Af(`foreground`),`important`),e.setAttribute(`data-jr-ui`,``)}a.observe(document.body,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`class`,`id`,`data-jr-foreground`,...[...e.matchAll(/\[([\w-]+)/g)].map(e=>e[1])]})};return o(),{refresh:o,dispose(){n=!0,a.disconnect();for(let[e,n]of t)i(e,n);t.clear()}}}var Pf={color:[.14,.64,1],corona:[.28,.13,1]},Ff=11,If=`#version 300 es
649
649
  precision highp float;
650
650
  in vec2 aStart, aEnd, aMotion;
651
651
  in vec4 aStyle;
@@ -1249,4 +1249,4 @@ registerProcessor('engine-combustion', CombustionProcessor);
1249
1249
  `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Ne=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Me(n):``}function Fe(e,t){switch(e.tag){case 26:case 27:case 5:return Me(e.type);case 16:return Me(`Lazy`);case 13:return e.child!==t&&t!==null?Me(`Suspense Fallback`):Me(`Suspense`);case 19:return Me(`SuspenseList`);case 0:case 15:return Pe(e.type,!1);case 11:return Pe(e.type.render,!1);case 1:return Pe(e.type,!0);case 31:return Me(`Activity`);case 30:return Me(`ViewTransition`);default:return``}}function Ie(e){try{var t=``,n=null;do t+=Fe(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
1250
1250
  Error generating stack: `+e.message+`
1251
1251
  `+e.stack}}var Le=Object.prototype.hasOwnProperty,Re=t.unstable_scheduleCallback,ze=t.unstable_cancelCallback,Be=t.unstable_shouldYield,Ve=t.unstable_requestPaint,He=t.unstable_now,Ue=t.unstable_getCurrentPriorityLevel,We=t.unstable_ImmediatePriority,Ge=t.unstable_UserBlockingPriority,Ke=t.unstable_NormalPriority,qe=t.unstable_LowPriority,Je=t.unstable_IdlePriority,Ye=t.log,Xe=t.unstable_setDisableYieldValue,Ze=null,Qe=null;function et(e){if(typeof Ye==`function`&&Xe(e),Qe&&typeof Qe.setStrictMode==`function`)try{Qe.setStrictMode(Ze,e)}catch{}}var tt=Math.clz32?Math.clz32:it,nt=Math.log,rt=Math.LN2;function it(e){return e>>>=0,e===0?32:31-(nt(e)/rt|0)|0}var at=256,ot=262144,st=4194304;function ct(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function lt(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=ct(n))):i=ct(o):i=ct(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=ct(n))):i=ct(o)):i=ct(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function ut(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function dt(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-tt(n),i=1<<r;t|=e[r],n&=~i}return t}function ft(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function pt(){var e=st;return st<<=1,!(st&62914560)&&(st=4194304),e}function mt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ht(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function gt(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-tt(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&_t(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function _t(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-tt(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function vt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-tt(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function yt(e,t){var n=t&-t;return n=n&42?1:bt(n),(n&(e.suspendedLanes|t))===0?n:0}function bt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function xt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function St(){var e=M.p;return e===0?(e=window.event,e===void 0?32:Ah(e.type)):e}function Ct(e,t){var n=M.p;try{return M.p=e,t()}finally{M.p=n}}var wt=Math.random().toString(36).slice(2),Tt=`__reactFiber$`+wt,Et=`__reactProps$`+wt,Dt=`__reactContainer$`+wt,Ot=`__reactEvents$`+wt,kt=`__reactListeners$`+wt,At=`__reactHandles$`+wt,jt=`__reactResources$`+wt,Mt=`__reactMarker$`+wt,Nt=`__reactLoad$`+wt;function Pt(e){delete e[Tt],delete e[Et],delete e[kt],delete e[At]}function Ft(e){var t;if(t=e[Tt])return t;for(var n=e.parentNode;n;){if(t=n[Dt]||n[Tt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=bm(e);e!==null;){if(n=e[Tt])return n;e=bm(e)}return t}e=n,n=e.parentNode}return null}function It(e){if(e=e[Tt]||e[Dt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Lt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Rt(e){var t=e[jt];return t||=e[jt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function zt(e){e[Mt]=!0}function Bt(e){e[Nt]=void 0}var Vt=new Set,Ht={};function Ut(e,t){Wt(e,t),Wt(e+`Capture`,t)}function Wt(e,t){for(Ht[e]=t,e=0;e<t.length;e++)Vt.add(t[e])}var Gt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Kt={},qt={};function Jt(e){return Le.call(qt,e)?!0:Le.call(Kt,e)?!1:Gt.test(e)?qt[e]=!0:(Kt[e]=!0,!1)}var Yt=!1;function Xt(){var e=Yt;return Yt=!1,e}function Zt(e,t,n){if(Jt(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,n)}}}function Qt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,n)}}function $t(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,r)}}function en(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function tn(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function nn(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function rn(e){if(!e._valueTracker){var t=tn(e)?`checked`:`value`;e._valueTracker=nn(e,t,``+e[t])}}function an(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=tn(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var on=/[\n"\\]/g;function sn(e){return e.replace(on,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function cn(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+en(t)):e.value!==``+en(t)&&(e.value=``+en(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):un(e,en(n)):o===`number`&&e.value==t?un(e,en(e.value)):un(e,en(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+en(s):e.removeAttribute(`name`)}function ln(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){rn(e);return}n=n==null?``:``+en(n),t=t==null?n:``+en(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),rn(e)}function un(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function dn(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+en(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function fn(e,t,n){t!=null&&(t=``+en(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+en(n)}function pn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ge(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=en(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),rn(e)}function mn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var hn=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function gn(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||hn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function _n(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``,Yt=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(gn(e,a,r),Yt=!0)}else for(var o in t)t.hasOwnProperty(o)&&gn(e,o,t[o])}function vn(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var yn=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`maskType`,`mask-type`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),bn=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function xn(e){return bn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Sn(){}var Cn=null;function wn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Tn=null,En=null;function Dn(e){var t=It(e);if(t&&(e=t.stateNode)){var n=e[Et]||null;a:switch(e=t.stateNode,t.type){case`input`:if(cn(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+sn(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[Et]||null;if(!a)throw Error(i(90));cn(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&an(r)}break a;case`textarea`:fn(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&dn(e,!!n.multiple,t,!1)}}}var On=!1;function kn(e,t,n){if(On)return e(t,n);On=!0;try{return e(t)}finally{if(On=!1,(Tn!==null||En!==null)&&(Gd(),Tn&&(t=Tn,e=En,En=Tn=null,Dn(t),e)))for(t=0;t<e.length;t++)Dn(e[t])}}function An(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Et]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var jn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Mn=!1;if(jn)try{var Nn={};Object.defineProperty(Nn,"passive",{get:function(){Mn=!0}}),window.addEventListener(`test`,Nn,Nn),window.removeEventListener(`test`,Nn,Nn)}catch{Mn=!1}var Pn=null,Fn=null,In=null;function Ln(){if(In)return In;var e,t=Fn,n=t.length,r,i=`value`in Pn?Pn.value:Pn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return In=i.slice(e,1<r?1-r:void 0)}function Rn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function zn(){return!0}function Bn(){return!1}function Vn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?zn:Bn,this.isPropagationStopped=Bn,this}return w(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=zn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=zn)},persist:function(){},isPersistent:zn}),t}var Hn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Un=Vn(Hn),Wn=w({},Hn,{view:0,detail:0}),Gn=Vn(Wn),Kn,qn,Jn,Yn=w({},Wn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:or,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Jn&&(Jn&&e.type===`mousemove`?(Kn=e.screenX-Jn.screenX,qn=e.screenY-Jn.screenY):qn=Kn=0,Jn=e),Kn)},movementY:function(e){return`movementY`in e?e.movementY:qn}}),Xn=Vn(Yn),Zn=Vn(w({},Yn,{dataTransfer:0})),Qn=Vn(w({},Wn,{relatedTarget:0})),$n=Vn(w({},Hn,{animationName:0,elapsedTime:0,pseudoElement:0})),er=Vn(w({},Hn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),tr=Vn(w({},Hn,{data:0})),nr={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},rr={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},ir={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function ar(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=ir[e])?!!t[e]:!1}function or(){return ar}var sr=Vn(w({},Wn,{key:function(e){if(e.key){var t=nr[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Rn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?rr[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:or,charCode:function(e){return e.type===`keypress`?Rn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Rn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),cr=Vn(w({},Yn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),lr=Vn(w({},Hn,{submitter:0})),ur=Vn(w({},Wn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:or})),dr=Vn(w({},Hn,{propertyName:0,elapsedTime:0,pseudoElement:0})),fr=Vn(w({},Yn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),pr=Vn(w({},Hn,{newState:0,oldState:0,source:0})),mr=[9,13,27,32],hr=jn&&`CompositionEvent`in window,gr=null;jn&&`documentMode`in document&&(gr=document.documentMode);var _r=jn&&`TextEvent`in window&&!gr,vr=jn&&(!hr||gr&&8<gr&&11>=gr),yr=` `,br=!1;function xr(e,t){switch(e){case`keyup`:return mr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Sr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Cr=!1;function wr(e,t){switch(e){case`compositionend`:return Sr(t);case`keypress`:return t.which===32?(br=!0,yr):null;case`textInput`:return e=t.data,e===yr&&br?null:e;default:return null}}function Tr(e,t){if(Cr)return e===`compositionend`||!hr&&xr(e,t)?(e=Ln(),In=Fn=Pn=null,Cr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return vr&&t.locale!==`ko`?null:t.data;default:return null}}var Er={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Dr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Er[e.type]:t===`textarea`}function Or(e,t,n,r){Tn?En?En.push(r):En=[r]:Tn=r,t=tp(t,`onChange`),0<t.length&&(n=new Un(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var kr=null,Ar=null;function jr(e){qf(e,0)}function Mr(e){if(an(Lt(e)))return e}function Nr(e,t){if(e===`change`)return t}var Pr=!1;if(jn){var Fr;if(jn){var P=`oninput`in document;if(!P){var F=document.createElement(`div`);F.setAttribute(`oninput`,`return;`),P=typeof F.oninput==`function`}Fr=P}else Fr=!1;Pr=Fr&&(!document.documentMode||9<document.documentMode)}function Ir(){kr&&(kr.detachEvent(`onpropertychange`,Lr),Ar=kr=null)}function Lr(e){if(e.propertyName===`value`&&Mr(Ar)){var t=[];Or(t,Ar,e,wn(e)),kn(jr,t)}}function Rr(e,t,n){e===`focusin`?(Ir(),kr=t,Ar=n,kr.attachEvent(`onpropertychange`,Lr)):e===`focusout`&&Ir()}function zr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Mr(Ar)}function Br(e,t){if(e===`click`)return Mr(t)}function Vr(e,t){if(e===`input`||e===`change`)return Mr(t)}function Hr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Ur=typeof Object.is==`function`?Object.is:Hr;function Wr(e,t){if(Ur(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Le.call(t,i)||!Ur(e[i],t[i]))return!1}return!0}function Gr(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Kr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function qr(e,t){var n=Kr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Kr(n)}}function Jr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Jr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Yr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Gr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Gr(e.document)}return t}function Xr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Zr=jn&&`documentMode`in document&&11>=document.documentMode,Qr=null,$r=null,ei=null,ti=!1;function ni(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ti||Qr==null||Qr!==Gr(r)||(r=Qr,`selectionStart`in r&&Xr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ei&&Wr(ei,r)||(ei=r,r=tp($r,`onSelect`),0<r.length&&(t=new Un(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Qr)))}function ri(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var ii={animationend:ri(`Animation`,`AnimationEnd`),animationiteration:ri(`Animation`,`AnimationIteration`),animationstart:ri(`Animation`,`AnimationStart`),transitionrun:ri(`Transition`,`TransitionRun`),transitionstart:ri(`Transition`,`TransitionStart`),transitioncancel:ri(`Transition`,`TransitionCancel`),transitionend:ri(`Transition`,`TransitionEnd`)},ai={},oi={};jn&&(oi=document.createElement(`div`).style,`AnimationEvent`in window||(delete ii.animationend.animation,delete ii.animationiteration.animation,delete ii.animationstart.animation),`TransitionEvent`in window||delete ii.transitionend.transition);function si(e){if(ai[e])return ai[e];if(!ii[e])return e;var t=ii[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in oi)return ai[e]=t[n];return e}var ci=si(`animationend`),li=si(`animationiteration`),ui=si(`animationstart`),di=si(`transitionrun`),fi=si(`transitionstart`),pi=si(`transitioncancel`),mi=si(`transitionend`),hi=new Map,gi=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);gi.push(`scrollEnd`);function _i(e,t){hi.set(e,t),Ut(t,[e])}var vi=0;function yi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=Ed.identifierPrefix;var n=vi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function bi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Pd;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function xi(e,t){return e=bi(e),t=bi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var Si=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Ci=[],wi=0,Ti=0;function Ei(){for(var e=wi,t=Ti=wi=0;t<e;){var n=Ci[t];Ci[t++]=null;var r=Ci[t];Ci[t++]=null;var i=Ci[t];Ci[t++]=null;var a=Ci[t];if(Ci[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Ai(n,i,a)}}function Di(e,t,n,r){Ci[wi++]=e,Ci[wi++]=t,Ci[wi++]=n,Ci[wi++]=r,Ti|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Oi(e,t,n,r){return Di(e,t,n,r),ji(e)}function ki(e,t){return Di(e,null,null,t),ji(e)}function Ai(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-tt(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ji(e){if(50<Fd)throw Fd=0,Id=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Mi={};function Ni(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Pi(e,t,n,r){return new Ni(e,t,n,r)}function Fi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ii(e,t){var n=e.alternate;return n===null?(n=Pi(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&1206910976,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Li(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Ri(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Fi(r)&&(s=1);else if(typeof r==`string`)s=eh(e,n,Ce.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case se:return e=Pi(31,n,t,a),e.elementType=se,e.lanes=o,e;case ee:return zi(n.children,a,o,t);case te:s=8,a|=24;break;case ne:return e=Pi(12,n,t,a|2),e.elementType=ne,e.lanes=o,e;case k:return e=Pi(13,n,t,a),e.elementType=k,e.lanes=o,e;case A:return e=Pi(19,n,t,a),e.elementType=A,e.lanes=o,e;case ce:case ue:return e=a|32,e=Pi(30,n,t,e),e.elementType=ue,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case O:s=10;break a;case re:s=9;break a;case ie:s=11;break a;case ae:s=14;break a;case oe:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Pi(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function zi(e,t,n,r){return e=Pi(7,e,r,t),e.lanes=n,e}function Bi(e,t,n){return e=Pi(6,e,null,t),e.lanes=n,e}function Vi(e){var t=Pi(18,null,null,0);return t.stateNode=e,t}function Hi(e,t,n){return t=Pi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ui=new WeakMap;function Wi(e,t){if(typeof e==`object`&&e){var n=Ui.get(e);return n===void 0?(t={value:e,source:t,stack:Ie(t)},Ui.set(e,t),t):n}return{value:e,source:t,stack:Ie(t)}}var Gi=[],Ki=0,qi=null,Ji=0,Yi=[],Xi=0,Zi=null,Qi=1,$i=``;function ea(e,t){Gi[Ki++]=Ji,Gi[Ki++]=qi,qi=e,Ji=t}function ta(e,t,n){Yi[Xi++]=Qi,Yi[Xi++]=$i,Yi[Xi++]=Zi,Zi=e;var r=Qi;e=$i;var i=32-tt(r)-1;r&=~(1<<i),n+=1;var a=32-tt(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Qi=1<<32-tt(t)+i|n<<i|r,$i=a+e}else Qi=1<<a|n<<i|r,$i=e}function na(e){e.return!==null&&(ea(e,1),ta(e,1,0))}function ra(e){for(;e===qi;)qi=Gi[--Ki],Gi[Ki]=null,Ji=Gi[--Ki],Gi[Ki]=null;for(;e===Zi;)Zi=Yi[--Xi],Yi[Xi]=null,$i=Yi[--Xi],Yi[Xi]=null,Qi=Yi[--Xi],Yi[Xi]=null}function ia(e,t){Yi[Xi++]=Qi,Yi[Xi++]=$i,Yi[Xi++]=Zi,Qi=t.id,$i=t.overflow,Zi=e}var aa=null,oa=null,I=!1,sa=null,ca=!1,la=Error(i(519));function ua(e){throw ga(Wi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),la}function da(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[Tt]=e,t[Et]=r,n){case`dialog`:Jf(`cancel`,t),Jf(`close`,t);break;case`iframe`:case`object`:case`embed`:Jf(`load`,t);break;case`video`:case`audio`:for(n=0;n<Gf.length;n++)Jf(Gf[n],t);break;case`source`:Jf(`error`,t);break;case`img`:case`image`:case`link`:Jf(`error`,t),Jf(`load`,t);break;case`details`:Jf(`toggle`,t);break;case`input`:Jf(`invalid`,t),ln(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Jf(`invalid`,t);break;case`textarea`:Jf(`invalid`,t),pn(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||sp(t.textContent,n)?(r.popover!=null&&(Jf(`beforetoggle`,t),Jf(`toggle`,t)),r.onScroll!=null&&Jf(`scroll`,t),r.onScrollEnd!=null&&Jf(`scrollend`,t),r.onClick!=null&&(t.onclick=Sn),t=!0):t=!1,t||ua(e,!0)}function fa(e){for(aa=e.return;aa;)switch(aa.tag){case 5:case 31:case 13:ca=!1;return;case 27:case 3:ca=!0;return;default:aa=aa.return}}function pa(e){if(e!==aa)return!1;if(!I)return fa(e),I=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||xp(e.type,e.memoizedProps)),n=!n),n&&oa&&ua(e),fa(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));oa=ym(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));oa=ym(e)}else t===27?(t=oa,Ap(e.type)?(e=vm,vm=null,oa=e):oa=t):oa=aa?_m(e.stateNode.nextSibling):null;return!0}function ma(){oa=aa=null,I=!1}function ha(){var e=sa;return e!==null&&(vd===null?vd=e:vd.push.apply(vd,e),sa=null),e}function ga(e){sa===null?sa=[e]:sa.push(e)}var _a=be(null),va=null,ya=null;function ba(e,t,n){Se(_a,t._currentValue),t._currentValue=n}function xa(e){e._currentValue=_a.current,xe(_a)}function Sa(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Ca(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Sa(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Sa(s,n,e),s=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),Sa(a.return,n,e),s=a.child,s=s===null?null:s.sibling):s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function wa(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Ur(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===N.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[mh]:e.push(mh))}a=a.return}return e!==null&&Ca(t,e,n,r),t.flags|=262144,e!==null}function Ta(e){for(e=e.firstContext;e!==null;){if(!Ur(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ea(e){va=e,ya=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Da(e){return ka(va,e)}function Oa(e,t){return va===null&&Ea(e),ka(e,t)}function ka(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ya===null){if(e===null)throw Error(i(308));ya=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ya=ya.next=t;return n}var Aa=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},ja=t.unstable_scheduleCallback,Ma=t.unstable_NormalPriority,Na={$$typeof:O,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Pa(){return{controller:new Aa,data:new Map,refCount:0}}function Fa(e){e.refCount--,e.refCount===0&&ja(Ma,function(){e.controller.abort()})}function Ia(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var La=null;function Ra(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var za=null,Ba=0,Va=0,Ha=null;function Ua(e,t){if(za===null){var n=za=[];Ba=0,Va=Bf(),Ha={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Ba++,t.then(Wa,Wa),t}function Wa(){if(--Ba===0&&(La=null,za!==null)){Ha!==null&&(Ha.status=`fulfilled`);var e=za;za=null,Va=0,Ha=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ga(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var Ka=j.S;j.S=function(e,t){if(xd=He(),typeof t==`object`&&t&&typeof t.then==`function`&&Ua(e,t),La!==null)for(var n=Ef;n!==null;)Ia(n,La),n=n.next;if(n=e.types,n!==null){for(var r=Ef;r!==null;)Ia(r,n),r=r.next;if(Va!==0){r=La,r===null&&(r=La=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Ka!==null&&Ka(e,t)};var qa=be(null);function Ja(){var e=qa.current;return e===null?B.pooledCache:e}function Ya(e,t){t===null?Se(qa,qa.current):Se(qa,t.pool)}function Xa(){var e=Ja();return e===null?null:{parent:Na._currentValue,pool:e}}var Za=Error(i(460)),Qa=Error(i(474)),$a=Error(i(542)),eo={then:function(){}};function to(e){return e=e.status,e===`fulfilled`||e===`rejected`}function no(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Sn,Sn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,oo(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(Sn,Sn);else{if(e=B,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,oo(e),e}throw io=t,Za}}function ro(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(io=e,Za):e}}var io=null;function ao(){if(io===null)throw Error(i(459));var e=io;return io=null,e}function oo(e){if(e===Za||e===$a)throw Error(i(483))}var so=null,co=0;function lo(e){var t=co;return co+=1,so===null&&(so=[]),no(so,e,t)}function uo(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function fo(e,t){throw t.$$typeof===T?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function po(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=Ii(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Bi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===ee?(e=d(e,t,n.props.children,r,n.key),uo(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===oe&&ro(i)===t.type)?(t=a(t,n.props),uo(t,n),t.return=e,t):(t=Ri(n.type,n.key,n.props,null,e.mode,r),uo(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=Hi(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=zi(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Bi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case E:return n=Ri(t.type,t.key,t.props,null,e.mode,n),uo(n,t),n.return=e,n;case D:return t=Hi(t,e.mode,n),t.return=e,t;case oe:return t=ro(t),f(e,t,n)}if(ge(t)||pe(t))return t=zi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,lo(t),n);if(t.$$typeof===O)return f(e,Oa(e,t),n);fo(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case E:return n.key===i?l(e,t,n,r):null;case D:return n.key===i?u(e,t,n,r):null;case oe:return n=ro(n),p(e,t,n,r)}if(ge(n)||pe(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,lo(n),r);if(n.$$typeof===O)return p(e,t,Oa(e,n),r);fo(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case E:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case D:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case oe:return r=ro(r),m(e,t,n,r,i)}if(ge(r)||pe(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,lo(r),i);if(r.$$typeof===O)return m(e,t,n,Oa(t,r),i);fo(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),I&&ea(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return I&&ea(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&(_=g.alternate,_!==null&&d.delete(_.key===null?h:_.key)),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),I&&ea(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),I&&ea(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return I&&ea(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),I&&ea(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===ee&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case E:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===ee){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),uo(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===oe&&ro(l)===r.type){n(e,r.sibling),c=a(r,o.props),uo(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===ee?(c=zi(o.props.children,e.mode,c,o.key),uo(c,o),c.return=e,e=c):(c=Ri(o.type,o.key,o.props,null,e.mode,c),uo(c,o),c.return=e,e=c)}return s(e);case D:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Hi(o,e.mode,c),c.return=e,e=c}return s(e);case oe:return o=ro(o),_(e,r,o,c)}if(ge(o))return h(e,r,o,c);if(pe(o)){if(l=pe(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,lo(o),c);if(o.$$typeof===O)return _(e,r,Oa(e,o),c);fo(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=Bi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{co=0;var i=_(e,t,n,r);return so=null,i}catch(t){if(t===Za||t===$a)throw t;var a=Pi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var mo=po(!0),ho=po(!1),go=!1;function _o(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function vo(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function yo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function bo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,z&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ji(e),Ai(e,null,n),t}return Di(e,r,t,n),ji(e)}function xo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,vt(e,n)}}function So(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Co=!1;function wo(){if(Co){var e=Ha;if(e!==null)throw e}}function To(e,t,n,r){Co=!1;var i=e.updateQueue;go=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(H&f)===f:(r&f)===f){f!==0&&f===Va&&(Co=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=w({},d,f);break a;case 2:go=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),fd|=o,e.lanes=o,e.memoizedState=d}}function Eo(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Do(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Eo(n[e],t)}var Oo=be(null),ko=be(0);function Ao(e,t){e=ud,Se(ko,e),Se(Oo,t),ud=e|t.baseLanes}function jo(){Se(ko,ud),Se(Oo,Oo.current)}function Mo(){ud=ko.current,xe(Oo),xe(ko)}var No=be(null),Po=null;function Fo(e){var t=e.alternate;Se(Bo,Bo.current&1),Se(No,e),Po===null&&(t===null||Oo.current!==null||t.memoizedState!==null)&&(Po=e)}function Io(e){Se(Bo,Bo.current),Se(No,e),Po===null&&(Po=e)}function Lo(e){e.tag===22?(Se(Bo,Bo.current),Se(No,e),Po===null&&(Po=e)):Ro()}function Ro(){Se(Bo,Bo.current),Se(No,No.current)}function zo(e){xe(No),Po===e&&(Po=null),xe(Bo)}var Bo=be(0);function Vo(e,t){Se(No,No.current),Se(Bo,t)}function Ho(e){xe(Bo),xe(No),Po===e&&(Po=null)}function Uo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||mm(n)||hm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Wo=0,L=null,Go=null,Ko=null,qo=!1,Jo=!1,Yo=!1,Xo=0,Zo=0,Qo=null,$o=0;function es(){throw Error(i(321))}function ts(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Ur(e[n],t[n]))return!1;return!0}function ns(e,t,n,r,i,a){return Wo=a,L=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,j.H=e===null||e.memoizedState===null?yc:bc,Yo=!1,a=n(r,i),Yo=!1,Jo&&(a=is(t,n,r,i)),rs(e),a}function rs(e){j.H=vc;var t=Go!==null&&Go.next!==null;if(Wo=0,Ko=Go=L=null,qo=!1,Zo=0,Qo=null,t)throw Error(i(300));e===null||Lc||(e=e.dependencies,e!==null&&Ta(e)&&(Lc=!0))}function is(e,t,n,r){L=e;var a=0;do{if(Jo&&(Qo=null),Zo=0,Jo=!1,25<=a)throw Error(i(301));if(a+=1,Ko=Go=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}j.H=xc,o=t(n,r)}while(Jo);return o}function as(){var e=j.H,t=e.useState()[0];return t=typeof t.then==`function`?fs(t):t,e=e.useState()[0],(Go===null?null:Go.memoizedState)!==e&&(L.flags|=1024),t}function os(){var e=Xo!==0;return Xo=0,e}function ss(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function cs(e){if(qo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}qo=!1}Wo=0,Ko=Go=L=null,Jo=!1,Zo=Xo=0,Qo=null}function ls(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ko===null?L.memoizedState=Ko=e:Ko=Ko.next=e,Ko}function us(){if(Go===null){var e=L.alternate;e=e===null?null:e.memoizedState}else e=Go.next;var t=Ko===null?L.memoizedState:Ko.next;if(t!==null)Ko=t,Go=e;else{if(e===null)throw L.alternate===null?Error(i(467)):Error(i(310));Go=e,e={memoizedState:Go.memoizedState,baseState:Go.baseState,baseQueue:Go.baseQueue,queue:Go.queue,next:null},Ko===null?L.memoizedState=Ko=e:Ko=Ko.next=e}return Ko}function ds(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function fs(e){var t=Zo;return Zo+=1,Qo===null&&(Qo=[]),e=no(Qo,e,t),t=L,(Ko===null?t.memoizedState:Ko.next)===null&&(t=t.alternate,j.H=t===null||t.memoizedState===null?yc:bc),e}function ps(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return fs(e);if(e.$$typeof===de)return;if(e.$$typeof===O)return Da(e)}throw Error(i(438,String(e)))}function ms(e){var t=null,n=L.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=L.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=ds(),L.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=le;return t.index++,n}function hs(e,t){return typeof t==`function`?t(e):t}function gs(e){return _s(us(),Go,e)}function _s(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(Wo&f)===f:(H&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Va&&(d=!0);else if((Wo&p)===p){u=u.next,p===Va&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,L.lanes|=p,fd|=p;f=u.action,Yo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,L.lanes|=f,fd|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Ur(o,e.memoizedState)&&(Lc=!0,d&&(n=Ha,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function vs(e){var t=us(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Ur(o,t.memoizedState)||(Lc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function ys(e,t,n){var r=L,a=us(),o=I;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Ur((Go||a).memoizedState,n);if(s&&(a.memoizedState=n,Lc=!0),a=a.queue,Ws(Ss.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Ko!==null&&!!(Ko.memoizedState.tag&1),zs(e?9:8,{destroy:void 0},xs.bind(null,r,a,n,t),null),e){if(r.flags|=2048,B===null)throw Error(i(349));o||Wo&127||bs(r,t,n)}return n}function bs(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=L.updateQueue,t===null?(t=ds(),L.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function xs(e,t,n,r){t.value=n,t.getSnapshot=r,Cs(t)&&ws(e)}function Ss(e,t,n){return n(function(){Cs(t)&&ws(e)})}function Cs(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ur(e,n)}catch{return!0}}function ws(e){var t=ki(e,2);t!==null&&Bd(t,e,2)}function Ts(e){var t=ls();if(typeof e==`function`){var n=e;if(e=n(),Yo){et(!0);try{n()}finally{et(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:hs,lastRenderedState:e},t}function Es(e,t,n,r){return e.baseState=n,_s(e,Go,typeof r==`function`?r:hs)}function Ds(e,t,n,r,a){if(hc(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};j.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Os(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Os(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=j.T,o={};o.types=a===null?null:a.types,j.T=o;try{var s=n(i,r),c=j.S;c!==null&&c(o,s),ks(e,t,s)}catch(n){js(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),j.T=a}}else try{a=n(i,r),ks(e,t,a)}catch(n){js(e,t,n)}}function ks(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){As(e,t,n)},function(n){return js(e,t,n)}):As(e,t,n)}function As(e,t,n){t.status=`fulfilled`,t.value=n,Ms(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Os(e,n)))}function js(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Ms(t),t=t.next;while(t!==r)}e.action=null}function Ms(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ns(e,t){return t}function Ps(e,t){if(I){var n=B.formState;if(n!==null){a:{var r=L;if(I){if(oa){b:{for(var i=oa,a=ca;i.nodeType!==8;)if(!a||(i=_m(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){oa=_m(i.nextSibling),r=i.data===`F!`;break a}}ua(r)}r=!1}r&&(t=n[0])}}return n=ls(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ns,lastRenderedState:t},n.queue=r,n=fc.bind(null,L,r),r.dispatch=n,r=Ts(!1),a=mc.bind(null,L,!1,r.queue),r=ls(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Ds.bind(null,L,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Fs(e){return Is(us(),Go,e)}function Is(e,t,n){if(t=_s(e,t,Ns)[0],e=gs(hs)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=fs(t)}catch(e){throw e===Za?$a:e}else r=t;t=us();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(L.flags|=2048,zs(9,{destroy:void 0},Ls.bind(null,i,n),null)),[r,a,e]}function Ls(e,t){e.action=t}function Rs(e){var t=us(),n=Go;if(n!==null)return Is(t,n,e);us(),t=t.memoizedState,n=us();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function zs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=L.updateQueue,t===null&&(t=ds(),L.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Bs(){return us().memoizedState}function Vs(e,t,n,r){var i=ls();L.flags|=e,i.memoizedState=zs(1|t,{destroy:void 0},n,r===void 0?null:r)}function Hs(e,t,n,r){var i=us();r=r===void 0?null:r;var a=i.memoizedState.inst;Go!==null&&r!==null&&ts(r,Go.memoizedState.deps)?i.memoizedState=zs(t,a,n,r):(L.flags|=e,i.memoizedState=zs(1|t,a,n,r))}function Us(e,t){Vs(8390656,8,e,t)}function Ws(e,t){Hs(2048,8,e,t)}function Gs(e){L.flags|=4;var t=L.updateQueue;if(t===null)t=ds(),L.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Ks(e){var t=us().memoizedState;return Gs({ref:t,nextImpl:e}),function(){if(z&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function qs(e,t){return Hs(4,2,e,t)}function Js(e,t){return Hs(4,4,e,t)}function Ys(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Xs(e,t,n){n=n==null?null:n.concat([e]),Hs(4,4,Ys.bind(null,t,e),n)}function Zs(){}function Qs(e,t){var n=us();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&ts(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function $s(e,t){var n=us();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&ts(t,r[1]))return r[0];if(r=e(),Yo){et(!0);try{e()}finally{et(!1)}}return n.memoizedState=[r,t],r}function ec(e,t,n){return n===void 0||Wo&1073741824&&!(H&261930)?e.memoizedState=t:(e.memoizedState=n,e=Rd(),L.lanes|=e,fd|=e,n)}function tc(e,t,n,r){return Ur(n,t)?n:Oo.current===null?!(Wo&106)||Wo&1073741824&&!(H&261930)?(Lc=!0,e.memoizedState=n):(e=Rd(),L.lanes|=e,fd|=e,t):(e=ec(e,n,r),Ur(e,t)||(Lc=!0),e)}function nc(e,t,n,r,i){var a=M.p;M.p=a!==0&&8>a?a:8;var o=j.T,s={};s.types=o===null?null:o.types,j.T=s,mc(e,!1,t,n);try{var c=i(),l=j.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?pc(e,t,Ga(c,r),Ld(e)):pc(e,t,r,Ld(e))}catch(n){pc(e,t,{then:function(){},status:`rejected`,reason:n},Ld())}finally{M.p=a,o!==null&&s.types!==null&&(o.types=s.types),j.T=o}}function rc(){}function ic(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=ac(e).queue;nc(e,a,t,_e,n===null?rc:function(){return oc(e),n(r)})}function ac(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:_e,baseState:_e,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:hs,lastRenderedState:_e},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:hs,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function oc(e){var t=ac(e);t.next===null&&(t=e.alternate.memoizedState),pc(e,t.next.queue,{},Ld())}function sc(){return Da(mh)}function cc(){return us().memoizedState}function lc(){return us().memoizedState}function uc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Ld();e=yo(n);var r=bo(t,e,n);r!==null&&(Bd(r,t,n),xo(r,t,n)),t={cache:Pa()},e.payload=t;return}t=t.return}}function dc(e,t,n){var r=Ld();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},hc(e)?gc(t,n):(n=Oi(e,t,n,r),n!==null&&(Bd(n,e,r),_c(n,t,r)))}function fc(e,t,n){pc(e,t,n,Ld())}function pc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(hc(e))gc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Ur(s,o))return Di(e,t,i,0),B===null&&Ei(),!1}catch{}if(n=Oi(e,t,i,r),n!==null)return Bd(n,e,r),_c(n,t,r),!0}return!1}function mc(e,t,n,r){if(r={lane:2,revertLane:Bf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},hc(e)){if(t)throw Error(i(479))}else t=Oi(e,n,r,2),t!==null&&Bd(t,e,2)}function hc(e){var t=e.alternate;return e===L||t!==null&&t===L}function gc(e,t){Jo=qo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function _c(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,vt(e,n)}}var vc={readContext:Da,use:ps,useCallback:es,useContext:es,useEffect:es,useImperativeHandle:es,useLayoutEffect:es,useInsertionEffect:es,useMemo:es,useReducer:es,useRef:es,useState:es,useDebugValue:es,useDeferredValue:es,useTransition:es,useSyncExternalStore:es,useId:es,useHostTransitionStatus:es,useFormState:es,useActionState:es,useOptimistic:es,useMemoCache:es,useCacheRefresh:es,useEffectEvent:es},yc={readContext:Da,use:ps,useCallback:function(e,t){return ls().memoizedState=[e,t===void 0?null:t],e},useContext:Da,useEffect:Us,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Vs(4194308,4,Ys.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Vs(4194308,4,e,t)},useInsertionEffect:function(e,t){Vs(4,2,e,t)},useMemo:function(e,t){var n=ls();t=t===void 0?null:t;var r=e();if(Yo){et(!0);try{e()}finally{et(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=ls();if(n!==void 0){var i=n(t);if(Yo){et(!0);try{n(t)}finally{et(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=dc.bind(null,L,e),[r.memoizedState,e]},useRef:function(e){var t=ls();return e={current:e},t.memoizedState=e},useState:function(e){e=Ts(e);var t=e.queue,n=fc.bind(null,L,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Zs,useDeferredValue:function(e,t){return ec(ls(),e,t)},useTransition:function(){var e=Ts(!1);return e=nc.bind(null,L,e.queue,!0,!1),ls().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=L,a=ls();if(I){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),B===null)throw Error(i(349));H&127||bs(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Us(Ss.bind(null,r,o,e),[e]),r.flags|=2048,zs(9,{destroy:void 0},xs.bind(null,r,o,n,t),null),n},useId:function(){var e=ls(),t=B.identifierPrefix;if(I){var n=$i,r=Qi;n=(r&~(1<<32-tt(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Xo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=$o++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:sc,useFormState:Ps,useActionState:Ps,useOptimistic:function(e){var t=ls();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=mc.bind(null,L,!0,n),n.dispatch=t,[e,t]},useMemoCache:ms,useCacheRefresh:function(){return ls().memoizedState=uc.bind(null,L)},useEffectEvent:function(e){var t=ls(),n={impl:e};return t.memoizedState=n,function(){if(z&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},bc={readContext:Da,use:ps,useCallback:Qs,useContext:Da,useEffect:Ws,useImperativeHandle:Xs,useInsertionEffect:qs,useLayoutEffect:Js,useMemo:$s,useReducer:gs,useRef:Bs,useState:function(){return gs(hs)},useDebugValue:Zs,useDeferredValue:function(e,t){return tc(us(),Go.memoizedState,e,t)},useTransition:function(){var e=gs(hs)[0],t=us().memoizedState;return[typeof e==`boolean`?e:fs(e),t]},useSyncExternalStore:ys,useId:cc,useHostTransitionStatus:sc,useFormState:Fs,useActionState:Fs,useOptimistic:function(e,t){return Es(us(),Go,e,t)},useMemoCache:ms,useCacheRefresh:lc,useEffectEvent:Ks},xc={readContext:Da,use:ps,useCallback:Qs,useContext:Da,useEffect:Ws,useImperativeHandle:Xs,useInsertionEffect:qs,useLayoutEffect:Js,useMemo:$s,useReducer:vs,useRef:Bs,useState:function(){return vs(hs)},useDebugValue:Zs,useDeferredValue:function(e,t){var n=us();return Go===null?ec(n,e,t):tc(n,Go.memoizedState,e,t)},useTransition:function(){var e=vs(hs)[0],t=us().memoizedState;return[typeof e==`boolean`?e:fs(e),t]},useSyncExternalStore:ys,useId:cc,useHostTransitionStatus:sc,useFormState:Rs,useActionState:Rs,useOptimistic:function(e,t){var n=us();return Go===null?(n.baseState=e,[e,n.queue.dispatch]):Es(n,Go,e,t)},useMemoCache:ms,useCacheRefresh:lc,useEffectEvent:Ks};function Sc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:w({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Cc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Ld(),i=yo(r);i.payload=t,n!=null&&(i.callback=n),t=bo(e,i,r),t!==null&&(Bd(t,e,r),xo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Ld(),i=yo(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=bo(e,i,r),t!==null&&(Bd(t,e,r),xo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ld(),r=yo(n);r.tag=2,t!=null&&(r.callback=t),t=bo(e,r,n),t!==null&&(Bd(t,e,n),xo(t,e,n))}};function wc(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Wr(n,r)||!Wr(i,a):!0}function Tc(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Cc.enqueueReplaceState(t,t.state,null)}function Ec(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=w({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Dc(e){Si(e)}function Oc(e){console.error(e)}function kc(e){Si(e)}function Ac(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function jc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Mc(e,t,n){return n=yo(n),n.tag=3,n.payload={element:null},n.callback=function(){Ac(e,t)},n}function Nc(e){return e=yo(e),e.tag=3,e}function Pc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){jc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){jc(t,n,r),typeof i!=`function`&&(wd===null?wd=new Set([this]):wd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Fc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&wa(t,n,a,!0),n=No.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Po===null?Qd():n.alternate===null&&dd===0&&(dd=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===eo?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),bf(e,r,a)),!1;case 22:return n.flags|=65536,r===eo?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),bf(e,r,a)),!1}throw Error(i(435,n.tag))}return bf(e,r,a),Qd(),!1}if(I)return t=No.current,t===null?(r!==la&&(t=Error(i(423),{cause:r}),ga(Wi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Wi(r,n),a=Mc(e.stateNode,r,a),So(e,a),dd!==4&&(dd=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==la&&(e=Error(i(422),{cause:r}),ga(Wi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Wi(o,n),_d===null?_d=[o]:_d.push(o),dd!==4&&(dd=2),t===null)return!0;r=Wi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Mc(n.stateNode,r,e),So(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(wd===null||!wd.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Nc(a),Pc(a,e,n,r),So(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Ic=Error(i(461)),Lc=!1;function Rc(e,t,n,r){t.child=e===null?ho(t,null,n,r):mo(t,e.child,n,r)}function zc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Ea(t),r=ns(e,t,n,o,a,i),s=os(),e!==null&&!Lc?(ss(e,t,i),pl(e,t,i)):(I&&s&&na(t),t.flags|=1,Rc(e,t,r,i),t.child)}function Bc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Fi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Vc(e,t,a,r,i)):(e=Ri(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!ml(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Wr:n,n(o,r)&&e.ref===t.ref)return pl(e,t,i)}return t.flags|=1,e=Ii(a,r),e.ref=t.ref,e.return=t,t.child=e}function Vc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Wr(a,r)&&e.ref===t.ref){if(Lc=!1,t.pendingProps=r=a,ml(e,i))e.flags&131072&&(Lc=!0);else return t.lanes=e.lanes,pl(e,t,i)}}return Yc(e,t,n,r,i)}function Hc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return Wc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ya(t,a===null?null:a.cachePool),a===null?jo():Ao(t,a),Lo(t);else return r=t.lanes=536870912,Wc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ya(t,null),jo(),Ro()):(Ya(t,a.cachePool),Ao(t,a),Ro(),t.memoizedState=null);return Rc(e,t,i,n),t.child}function Uc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Wc(e,t,n,r,i){var a=Ja();return a=a===null?null:{parent:Na._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ya(t,null),jo(),Lo(t),e!==null&&wa(e,t,r,!0),t.childLanes=i,null}function Gc(e,t){return t=il({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Kc(e,t,n){return mo(t,e.child,null,n),e=Gc(t,t.pendingProps),e.flags|=2,zo(t),t.memoizedState=null,e}function qc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(I){if(r.mode===`hidden`)return e=Gc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Uc(null,e);if(Io(t),(e=oa)?(e=pm(e,ca),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Zi===null?null:{id:Qi,overflow:$i},retryLane:536870912,hydrationErrors:null},n=Vi(e),n.return=t,t.child=n,aa=t,oa=null)):e=null,e===null)throw ua(t);return t.lanes=536870912,null}return Gc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Io(t),a){if(t.flags&256)t.flags&=-257,t=Kc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Lc||wa(e,t,n,!1),a=(n&e.childLanes)!==0,Lc||a){if(Oo.current===null){if(r=B,r!==null&&(s=yt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ki(e,s),Bd(r,e,s),Ic;Qd()}t=Kc(e,t,n)}else e=o.treeContext,oa=_m(s.nextSibling),aa=t,I=!0,sa=null,ca=!1,e!==null&&ia(t,e),t=Gc(t,r),t.flags|=134221824;return t}return e=Ii(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Jc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Yc(e,t,n,r,i){return Ea(t),n=ns(e,t,n,r,void 0,i),r=os(),e!==null&&!Lc?(ss(e,t,i),pl(e,t,i)):(I&&r&&na(t),t.flags|=1,Rc(e,t,n,i),t.child)}function Xc(e,t,n,r,i,a){return Ea(t),t.updateQueue=null,n=is(t,r,n,i),rs(e),r=os(),e!==null&&!Lc?(ss(e,t,a),pl(e,t,a)):(I&&r&&na(t),t.flags|=1,Rc(e,t,n,a),t.child)}function Zc(e,t,n,r,i){if(Ea(t),t.stateNode===null){var a=Mi,o=n.contextType;typeof o==`object`&&o&&(a=Da(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Cc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},_o(t),o=n.contextType,a.context=typeof o==`object`&&o?Da(o):Mi,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Sc(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Cc.enqueueReplaceState(a,a.state,null),To(t,r,a,i),wo(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Ec(n,s);a.props=c;var l=a.context,u=n.contextType;o=Mi,typeof u==`object`&&u&&(o=Da(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Tc(t,a,r,o),go=!1;var f=t.memoizedState;a.state=f,To(t,r,a,i),wo(),l=t.memoizedState,s||f!==l||go?(typeof d==`function`&&(Sc(t,n,d,r),l=t.memoizedState),(c=go||wc(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,vo(e,t),o=t.memoizedProps,u=Ec(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Mi,typeof l==`object`&&l&&(c=Da(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Tc(t,a,r,c),go=!1,f=t.memoizedState,a.state=f,To(t,r,a,i),wo();var p=t.memoizedState;o!==d||f!==p||go||e!==null&&e.dependencies!==null&&Ta(e.dependencies)?(typeof s==`function`&&(Sc(t,n,s,r),p=t.memoizedState),(u=go||wc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Ta(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Jc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=mo(t,e.child,null,i),t.child=mo(t,null,n,i)):Rc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=pl(e,t,i),e}function Qc(e,t,n,r){return ma(),t.flags|=256,Rc(e,t,n,r),t.child}var $c={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function el(e){return{baseLanes:e,cachePool:Xa()}}function tl(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=hd),e}function nl(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Bo.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(I){if(i?Fo(t):Ro(),(e=oa)?(e=pm(e,ca),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Zi===null?null:{id:Qi,overflow:$i},retryLane:536870912,hydrationErrors:null},n=Vi(e),n.return=t,t.child=n,aa=t,oa=null)):e=null,e===null)throw ua(t);return t.lanes=hm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Ro(),i=t.mode,a=il({mode:`hidden`,children:a},i),r=zi(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=el(n),r.childLanes=tl(e,o,n),t.memoizedState=$c,Uc(null,r)):(Fo(t),rl(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return ol(e,t,a,o,r,c,s,n)}return i?(Ro(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Ii(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=zi(i,a,n,null),i.flags|=2):i=Ii(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Uc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=el(n):(a=i.cachePool,a===null?a=Xa():(s=Na._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=tl(e,o,n),t.memoizedState=$c,Uc(e.child,r)):(Fo(t),n=e.child,e=n.sibling,n=Ii(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function rl(e,t){return t=il({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function il(e,t){return e=Pi(22,e,null,t),e.lanes=0,e}function al(e,t,n){return mo(t,e.child,null,n),e=rl(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function ol(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(Fo(t),t.flags&=-257,al(e,t,c)):t.memoizedState===null?(Ro(),o=a.fallback,s=t.mode,a=il({mode:`visible`,children:a.children},s),o=zi(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,mo(t,e.child,null,c),a=t.child,a.memoizedState=el(c),a.childLanes=tl(e,r,c),t.memoizedState=$c,Uc(null,a)):(Ro(),t.child=e.child,t.flags|=128,null);if(Fo(t),hm(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(a=Error(i(419)),a.stack=``,a.digest=r,ga({value:a,source:null,stack:null})),al(e,t,c)}if(Lc||wa(e,t,c,!1),r=(c&e.childLanes)!==0,Lc||r){if(Oo.current!==null)return al(e,t,c);if(r=B,r!==null&&(a=yt(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,ki(e,a),Bd(r,e,a),Ic;return mm(o)||Qd(),al(e,t,c)}return mm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,oa=_m(o.nextSibling),aa=t,I=!0,sa=null,ca=!1,e!==null&&ia(t,e),t=rl(t,a.children),t.flags|=134221824,t)}function sl(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Sa(e.return,t,n)}function cl(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Uo(n)===null&&(t=e),e=e.sibling}return t}function ll(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function ul(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function dl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Bo.current;if(t.flags&128)return Vo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Vo(t,o),i===`backwards`&&e!==null?(ul(e),Rc(e,t,r,n),ul(e)):Rc(e,t,r,n),r=I?Ji:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&sl(e,n,t);else if(e.tag===19)sl(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`backwards`:n=cl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,ul(t)),ll(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Uo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}ll(t,!0,n,null,a,r);break;case`together`:ll(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=cl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),ll(t,!1,i,n,a,r)}return t.child}function fl(e,t,n){var r=t.pendingProps;return ba(t,t.type,r.value),Rc(e,t,r.children,n),t.child}function pl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),fd|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(wa(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=Ii(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ii(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function ml(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Ta(e)))}function hl(e,t,n){switch(t.tag){case 3:Ee(t,t.stateNode.containerInfo),ba(t,Na,e.memoizedState.cache),ma();break;case 27:case 5:Oe(t);break;case 4:Ee(t,t.stateNode.containerInfo);break;case 10:ba(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Io(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Fo(t),t.flags|=128,null;r=wa(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?nl(e,t,n):(Fo(t),e=pl(e,t,n),e===null?null:e.sibling)}Fo(t);break;case 19:if(t.flags&128)return dl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(wa(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return dl(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Vo(t,Bo.current),r)break;return null;case 22:return t.lanes=0,Hc(e,t,n,t.pendingProps);case 24:ba(t,Na,e.memoizedState.cache)}return pl(e,t,n)}function gl(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Lc=!0;else{if(!ml(e,n)&&!(t.flags&128))return Lc=!1,hl(e,t,n);Lc=!!(e.flags&131072)}}else Lc=!1,I&&t.flags&1048576&&ta(t,Ji,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=ro(t.elementType),t.type=e,typeof e==`function`)Fi(e)?(r=Ec(e,r),t.tag=1,t=Zc(null,t,e,r,n)):(t.tag=0,t=Yc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===ie){t.tag=11,t=zc(null,t,e,r,n);break a}if(a===ae){t.tag=14,t=Bc(null,t,e,r,n);break a}if(a===O){t.tag=10,t.type=e,t=fl(null,t,n);break a}}throw t=he(e)||e,Error(i(306,t,``))}}return t;case 0:return Yc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Ec(r,t.pendingProps),Zc(e,t,r,a,n);case 3:a:{if(Ee(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,vo(e,t),To(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ba(t,Na,r),r!==o.cache&&Ca(t,[Na],n,!0),wo(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Qc(e,t,r,n);break a}if(r!==a){a=Wi(Error(i(424)),t),ga(a),t=Qc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(oa=_m(e.firstChild),aa=t,I=!0,sa=null,ca=!0,n=ho(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(ma(),r===a){t=pl(e,t,n);break a}Rc(e,t,r,n)}t=t.child}return t;case 26:return Jc(e,t),e===null?(n=Vm(t.type,null,t.pendingProps,null))?t.memoizedState=n:I||(t.stateNode=bp(t.type,t.pendingProps,Te.current,t)):t.memoizedState=Vm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Oe(t),e===null&&I&&(r=t.stateNode=Cm(t.type,t.pendingProps,Te.current),aa=t,ca=!0,a=oa,Ap(t.type)?(vm=a,oa=_m(r.firstChild)):oa=a),Rc(e,t,t.pendingProps.children,n),Jc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&I&&((a=r=oa)&&(r=dm(r,t.type,t.pendingProps,ca),r===null?a=!1:(t.stateNode=r,aa=t,oa=_m(r.firstChild),ca=!1,a=!0)),a||ua(t)),Oe(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,xp(a,o)?r=null:s!==null&&xp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=ns(e,t,as,null,null,n),mh._currentValue=a),Jc(e,t),Rc(e,t,r,n),t.child;case 6:return e===null&&I&&((e=n=oa)&&(n=fm(n,t.pendingProps,ca),n===null?e=!1:(t.stateNode=n,aa=t,oa=null,e=!0)),e||ua(t)),null;case 13:return nl(e,t,n);case 4:return Ee(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=mo(t,null,r,n):Rc(e,t,r,n),t.child;case 11:return zc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Jc(e,t),Rc(e,t,r,n),t.child;case 8:return Rc(e,t,t.pendingProps.children,n),t.child;case 12:return Rc(e,t,t.pendingProps.children,n),t.child;case 10:return fl(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,Ea(t),a=Da(a),r=r(a),t.flags|=1,Rc(e,t,r,n),t.child;case 14:return Bc(e,t,t.type,t.pendingProps,n);case 15:return Vc(e,t,t.type,t.pendingProps,n);case 19:return dl(e,t,n);case 31:return qc(e,t,n);case 22:return Hc(e,t,n,t.pendingProps);case 24:return Ea(t),r=Da(Na),e===null?(a=Ja(),a===null&&(a=B,o=Pa(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},_o(t),ba(t,Na,a)):((e.lanes&n)!==0&&(vo(e,t),To(t,null,null,n),wo()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,ba(t,Na,r),r!==a.cache&&Ca(t,[Na],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),ba(t,Na,r))),Rc(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:I&&na(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Jc(e,t),Rc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function _l(e){e.flags|=4}function vl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?th(t,r):th(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Yd())e.flags|=8192;else throw io=eo,Qa}}else e.flags&=-16777217}function yl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!nh(t)){if(Yd())e.flags|=8192;else throw io=eo,Qa}}function bl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:pt(),e.lanes|=t,gd|=t)}function xl(e,t){if(!I)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function Sl(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&1206910976,r|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Cl(e,t,n){var r=t.pendingProps;switch(ra(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Sl(t),null;case 1:return Sl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),xa(Na),De(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(pa(t)?_l(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ha())),Sl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(_l(t),o===null?(Sl(t),vl(t,a,null,r,n)):(Sl(t),yl(t,o))):o?o===e.memoizedState?(Sl(t),t.flags&=-16777217):(_l(t),Sl(t),yl(t,o)):(e=e.memoizedProps,e!==r&&_l(t),Sl(t),vl(t,a,e,r,n)),null;case 27:if(ke(t),n=Te.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&_l(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Sl(t),t.subtreeFlags&=-33554433,null}e=Ce.current,pa(t)?da(t,e):(e=Cm(a,r,n),t.stateNode=e,_l(t))}return Sl(t),t.subtreeFlags&=-33554433,null;case 5:if(ke(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&_l(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Sl(t),t.subtreeFlags&=-33554433,null}if(o=Ce.current,pa(t))da(t,o);else{var s=_p(Te.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[Tt]=t,o[Et]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(up(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&_l(t)}}return Sl(t),t.subtreeFlags&=-33554433,vl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&_l(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=Te.current,pa(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=aa,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[Tt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||sp(e.nodeValue,n)),e||ua(t,!0)}else e=_p(e).createTextNode(r),e[Tt]=t,t.stateNode=e}return Sl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=pa(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[Tt]=t}else ma(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Sl(t),e=!1}else n=ha(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(zo(t),t):(zo(t),null);if(t.flags&128)throw Error(i(558))}return Sl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=pa(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[Tt]=t}else ma(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Sl(t),a=!1}else a=ha(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(zo(t),t):(zo(t),null)}return zo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),bl(t,t.updateQueue),Sl(t),null);case 4:return De(),e===null&&Zf(t.stateNode.containerInfo),t.flags|=67108864,Sl(t),null;case 10:return xa(t.type),Sl(t),null;case 19:if(Ho(t),r=t.memoizedState,r===null)return Sl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)xl(r,!1);else{if(dd!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Uo(e),o!==null){for(t.flags|=128,xl(r,!1),e=o.updateQueue,t.updateQueue=e,bl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Li(n,e),n=n.sibling;return Vo(t,Bo.current&1|2),I&&ea(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&He()>Sd&&(t.flags|=128,a=!0,xl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Uo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,bl(t,e),xl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!I)return Sl(t),null}else 2*He()-r.renderingStartTime>Sd&&n!==536870912&&(t.flags|=128,a=!0,xl(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=He(),e.sibling=null,o=Bo.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||I?Vo(t,o):(n=o,Se(No,t),Se(Bo,n),Po===null&&(Po=t)),I&&ea(t,r.treeForkCount),e}return Sl(t),null;case 22:case 23:return zo(t),Mo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Sl(t),t.subtreeFlags&6&&(t.flags|=8192)):Sl(t),n=t.updateQueue,n!==null&&bl(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&xe(qa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),xa(Na),Sl(t),null;case 25:return null;case 30:return t.flags|=33554432,Sl(t),null}throw Error(i(156,t.tag))}function wl(e,t){switch(ra(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return xa(Na),De(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ke(t),null;case 31:if(t.memoizedState!==null){if(zo(t),t.alternate===null)throw Error(i(340));ma()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(zo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));ma()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ho(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return De(),null;case 10:return xa(t.type),null;case 22:case 23:return zo(t),Mo(),e!==null&&xe(qa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return xa(Na),null;case 25:return null;default:return null}}function Tl(e,t){switch(ra(t),t.tag){case 3:xa(Na),De();break;case 26:case 27:case 5:ke(t);break;case 4:De();break;case 31:t.memoizedState!==null&&zo(t);break;case 13:zo(t);break;case 19:Ho(t);break;case 10:xa(t.type);break;case 22:case 23:zo(t),Mo(),e!==null&&xe(qa);break;case 24:xa(Na)}}function El(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){U(t,t.return,e)}}function Dl(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){U(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){U(t,t.return,e)}}function Ol(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Do(t,n)}catch(t){U(e,e.return,t)}}}function kl(e,t,n){n.props=Ec(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){U(e,t,n)}}function Al(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=yi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Hp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Up(e);f(e.child,!1,om,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){U(e,t,n)}}function jl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){U(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){U(e,t,n)}else n.current=null}}function Ml(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)cm(e.stateNode,t[n])}function Nl(e){for(var t=e.return;t!==null&&(Il(t)&&cm(e.stateNode,t.stateNode),!Fl(t));)t=t.return}function Pl(e){for(var t=e.return;t!==null&&(Il(t)&&lm(e.stateNode,t.stateNode),!Fl(t));)t=t.return}function Fl(e){return e.tag===5||e.tag===3||e.tag===27}function Il(e){return e&&e.tag===7&&e.stateNode!==null}function Ll(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){U(e,e.return,t)}}function Rl(e,t,n){try{var r=e.stateNode;fp(r,e.type,n,t),r[Et]=t}catch(t){U(e,e.return,t)}}function zl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ap(e.type)||e.tag===4}function Bl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||zl(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Ap(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Vl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Sn)),Ml(e,r),Yt=!0;else if(i!==4&&(i===27&&(Ml(e,r),r=null,Ap(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Vl(e,t,n,r),e=e.sibling;e!==null;)Vl(e,t,n,r),e=e.sibling}function Hl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Ml(e,r),Yt=!0;else if(i!==4&&(i===27&&(Ml(e,r),r=null,Ap(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Hl(e,t,n,r),e=e.sibling;e!==null;)Hl(e,t,n,r),e=e.sibling}function Ul(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);up(t,r,n),t[Tt]=e,t[Et]=n}catch(t){U(e,e.return,t)}}var Wl=!1,Gl=null;function Kl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Wl=!0)}var ql=null;function Jl(){var e=ql;return ql=null,e}var Yl=0;function Xl(e,t,n,r,i){return Yl=0,Zl(e.child,t,n,r,i)}function Zl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Ip(o);r.push(s),s.view&&(a=!0)}else a||Ip(o).view&&(a=!0);Wl=!0,Np(o,Yl===0?t:t+`_`+Yl,n),Yl++}else e.tag===22&&e.memoizedState!==null||e.tag===30&&i||Zl(e.child,t,n,r,i)&&(a=!0);e=e.sibling}return a}function Ql(e,t){for(;e!==null;)e.tag===5?Pp(e.stateNode,e.memoizedProps):e.tag===22&&e.memoizedState!==null||e.tag===30&&t||Ql(e.child,t),e=e.sibling}function $l(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&($l(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(i(544));var n=t.name;t=xi(t.default,t.share),t!==`none`&&(Xl(e,n,t,null,!1)||Ql(e.child,!1))}e=e.sibling}}function eu(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=yi(r,n),a=xi(r.default,n.paired?r.share:r.enter);a===`none`?$l(e):Xl(e,i,a,null,!1)?($l(e),n.paired||t||zd(e,r.onEnter)):Ql(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)eu(e,t),e=e.sibling;else $l(e)}function tu(e){if(Gl!==null&&Gl.size!==0){var t=Gl;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=xi(n.default,n.share);if(a!==`none`&&(Xl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,zd(e,n.onShare)):Ql(e.child,!1)),t.delete(r),t.size===0)break}}}tu(e)}e=e.sibling}}}function nu(e){if(e.tag===30){var t=e.memoizedProps,n=yi(t,e.stateNode),r=Gl===null?void 0:Gl.get(n),i=xi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Xl(e,n,i,null,!1)?r===void 0?zd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Gl.delete(n),zd(e,t.onShare)):Ql(e.child,!1)),Gl!==null&&tu(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)nu(e),e=e.sibling;else Gl!==null&&tu(e)}function ru(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=yi(t,e.stateNode);t=xi(t.default,t.update),e.flags&=-5,t!==`none`&&Xl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&ru(e);e=e.sibling}}function iu(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Ql(e.child,!1))}iu(e)}e=e.sibling}}function au(e){if(e.tag===30)e.stateNode.paired=null,Ql(e.child,!1),iu(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)au(e),e=e.sibling;else iu(e)}function ou(e){for(e=e.child;e!==null;)e.tag===30?Ql(e.child,!1):e.subtreeFlags&33554432&&ou(e),e=e.sibling}function su(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Yl<a.length){var l=a[Yl],u=Ip(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&Np(c,Yl===0?n:n+`_`+Yl,i),s&&e.flags&4||(ql===null&&(ql=[]),ql.push(c,Yl===0?r:r+`_`+Yl,t.memoizedProps)),Yl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:su(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function cu(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=yi(n,r),a=xi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(Lp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Yl=0,i=su(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||zd(e,n.onUpdate))}else e.subtreeFlags&33554432&&cu(e,t);e=e.sibling}}var lu=!1,uu=!1,du=!1,fu=!1,pu=typeof WeakSet==`function`?WeakSet:Set,mu=null,hu=!1,gu=!1,_u=!1,vu=!1;function yu(e,t,n){if(e=e.containerInfo,hp=Ch,e=Yr(e),Xr(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(gp={focusedElem:e,selectionRange:r},Ch=!1,n=(n&335544064)===n,mu=t,t=n?9270:1024;mu!==null;){if(e=mu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&nu(r[a]);if(e.alternate===null&&e.flags&2)n&&Kl(e),bu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&nu(r),bu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Kl(e),bu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,mu=r):(n&&ru(e),bu(n))}}Gl=null}function bu(e){for(;mu!==null;){var t=mu,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=Ec(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){U(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)um(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:um(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=yi(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=xi(a.default,a.update),a!==`none`&&Xl(r,n,a,r.memoizedState=[],!0));break;default:if(a&1024)throw Error(i(163))}if(r=t.sibling,r!==null){r.return=t.return,mu=r;break}mu=t.return}}function xu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Bu(e,n),r&4&&El(5,n);break;case 1:if(Bu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){U(n,n.return,e)}else{var i=Ec(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){U(n,n.return,e)}}}r&64&&Ol(n),r&512&&Al(n,n.return);break;case 3:if(Bu(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Do(e,t)}catch(e){U(n,n.return,e)}}break;case 27:t===null&&r&4&&Ul(n);case 26:case 5:Bu(e,n),t===null&&r&4&&Ll(n),r&512&&Al(n,n.return);break;case 12:Bu(e,n);break;case 31:Bu(e,n),r&4&&Au(e,n);break;case 13:Bu(e,n),r&4&&ju(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Cf.bind(null,n),gm(e,n))));break;case 22:if(r=n.memoizedState!==null||lu,!r){var a=t!==null&&t.memoizedState!==null||uu;t=lu,i=uu,lu=r,(uu=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Hu(e,n,r)):Bu(e,n),lu=t,uu=i}break;case 30:Bu(e,n),r&512&&Al(n,n.return);break;case 7:r&512&&Al(n,n.return);default:Bu(e,n)}}function Su(e,t){for(e=e.child;e!==null;)Cu(e,t),e=e.sibling}function Cu(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){U(e,e.return,t)}wu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,Yt=!0}catch(t){U(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Mp(s,!0):Mp(e.stateNode,!1)}catch(t){U(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&Su(e,t);break;default:Su(e,t)}}function wu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:Cu(n,r);break a;case 22:n.memoizedState===null&&wu(n,r);break a;default:wu(n,r)}}e=e.sibling}}function Tu(e){var t=e.alternate;t!==null&&(e.alternate=null,Tu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Pt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Eu=null,Du=!1;function Ou(e,t,n){for(n=n.child;n!==null;)ku(e,t,n),n=n.sibling}function ku(e,t,n){if(Qe&&typeof Qe.onCommitFiberUnmount==`function`)try{Qe.onCommitFiberUnmount(Ze,n)}catch{}switch(n.tag){case 26:uu||jl(n,t),Ou(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!uu&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:uu||jl(n,t),Pl(n);var r=Eu,i=Du;Ap(n.type)&&(Eu=n.stateNode,Du=!1),Ou(e,t,n),wm(n.stateNode,n.type,n.memoizedProps),Eu=r,Du=i;break;case 5:uu||jl(n,t),Pl(n);case 6:if(n.tag===6&&Pl(n),r=Eu,i=Du,Eu=null,Ou(e,t,n),Eu=r,Du=i,Eu!==null){if(Du)try{(Eu.nodeType===9?Eu.body:Eu.nodeName===`HTML`?Eu.ownerDocument.body:Eu).removeChild(n.stateNode),Yt=!0}catch(e){U(n,t,e)}else try{Eu.removeChild(n.stateNode),Yt=!0}catch(e){U(n,t,e)}}break;case 18:Eu!==null&&(Du?(e=Eu,jp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Yh(e)):jp(Eu,n.stateNode));break;case 4:r=Eu,i=Du,Eu=n.stateNode.containerInfo,Du=!0,Ou(e,t,n),Eu=r,Du=i;break;case 0:case 11:case 14:case 15:Dl(2,n,t),uu||Dl(4,n,t),Ou(e,t,n);break;case 1:uu||(jl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&kl(n,t,r)),Ou(e,t,n);break;case 21:Ou(e,t,n);break;case 22:uu=(r=uu)||n.memoizedState!==null,Ou(e,t,n),uu=r;break;case 30:jl(n,t),Ou(e,t,n);break;case 7:uu||jl(n,t),Ou(e,t,n);break;default:Ou(e,t,n)}}function Au(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Yh(e)}catch(e){U(t,t.return,e)}}}function ju(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Yh(e)}catch(e){U(t,t.return,e)}}function Mu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new pu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new pu),t;default:throw Error(i(435,e.tag))}}function Nu(e,t){var n=Mu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=wf.bind(null,e,t);t.then(r,r)}})}function R(e,t,n){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Ap(l.type)){Eu=l.stateNode,Du=!1;break a}break;case 5:Eu=l.stateNode,Du=!1;break a;case 3:case 4:Eu=l.stateNode.containerInfo,Du=!0;break a}l=l.return}if(Eu===null)throw Error(i(160));ku(s,c,o),Eu=null,Du=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Fu(t,e,n),t=t.sibling}var Pu=null;function Fu(e,t,n){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}R(t,e,n),Iu(e),a&4&&(Dl(3,e,e.return),El(3,e),Dl(5,e,e.return));break;case 1:R(t,e,n),Iu(e),a&512&&(uu||r===null||jl(r,r.return)),a&64&&lu&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=Pu,R(t,e,n),Iu(e),a&512&&(uu||r===null||jl(r,r.return)),a&4){if(a=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(lu)e.stateNode=bp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,a=o.ownerDocument||o;b:switch(t){case`title`:r=a.getElementsByTagName(`title`)[0],(!r||r[Mt]||r[Tt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),up(r,t,n),r[Tt]=e,zt(r),t=r;break a;case`link`:if(o=W(`link`,`href`,a).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break b}}r=a.createElement(t),up(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=W(`meta`,`content`,a).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break b}}r=a.createElement(t),up(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[Tt]=e,zt(r),t=r}e.stateNode=t}}else lu||$m(o,e.type,e.stateNode)}else e.stateNode=Jm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Rl(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||uu||t.parentNode.removeChild(t)):a.count--,n===null?lu||$m(o,e.type,e.stateNode):Jm(o,n,e.memoizedProps))}break;case 27:R(t,e,n),Iu(e),a&512&&(uu||r===null||jl(r,r.return)),r!==null&&a&4&&Rl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=du,du=!1,R(t,e,n),du=o,Iu(e),a&512&&(uu||r===null||jl(r,r.return)),e.flags&32){t=e.stateNode;try{mn(t,``),Yt=!0}catch(t){U(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Rl(e,t,r===null?t:r.memoizedProps)),a&1024&&(fu=!0);break;case 6:if(R(t,e,n),Iu(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,Yt=!0}catch(t){U(e,e.return,t)}}break;case 3:if(Yt=!1,Qm=null,o=Pu,Pu=Om(t.containerInfo),R(t,e,n),Pu=o,Iu(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Yh(t.containerInfo)}catch(t){U(e,e.return,t)}fu&&(fu=!1,Lu(e)),Yt=!1;break;case 4:a=du,du=lu,r=Xt(),o=Pu,Pu=Om(e.stateNode.containerInfo),R(t,e,n),Iu(e),Pu=o,Yt&&gu&&(_u=!0),Yt=r,du=a;break;case 12:R(t,e,n),Iu(e);break;case 31:R(t,e,n),Iu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Nu(e,t)));break;case 13:R(t,e,n),Iu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(bd=He()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Nu(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=lu,l=uu,u=du;lu=c||o,du=u||o,uu=l||s,R(t,e,n),uu=l,du=u,lu=c,Iu(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||lu||uu||(t=s||uu,n=lu,r=uu,lu=o||lu,uu=t,Vu(e,2),lu=n,uu=r),!o&&du||Su(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Nu(e,n))));break;case 19:R(t,e,n),Iu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Nu(e,t)));break;case 30:a&512&&(uu||r===null||jl(r,r.return)),a=Xt(),o=gu,s=(n&335544064)===n,c=e.memoizedProps,gu=s&&xi(c.default,c.update)!==`none`,R(t,e,n),Iu(e),s&&r!==null&&Yt&&(e.flags|=4),gu=o,Yt=a;break;case 21:break;case 7:a&512&&(uu||r===null||jl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:R(t,e,n),Iu(e)}}function Iu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(zl(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Il(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(Fl(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Hl(e,Bl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(mn(l,``),n.flags&=-33),Hl(e,Bl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Vl(e,Bl(e),u,s);break;default:throw Error(i(161))}}catch(t){U(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Lu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Lu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,Ch=!0,t.reset(),Ch=!1),e=e.sibling}}function Ru(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)zu(t,e),t=t.sibling;else cu(t,!1)}function zu(e,t){var n=e.alternate;if(n===null)eu(e,!1);else switch(e.tag){case 3:if(vu=hu=!1,Jl(),Ru(t,e),!hu&&!_u){if(e=ql,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Pp(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),vu=!0}ql=null;break;case 5:Ru(t,e);break;case 4:r=hu,hu=!1,Ru(t,e),hu&&(_u=!0),hu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Ru(t,e):eu(e,!1));break;case 30:r=hu,i=Jl(),hu=!1,Ru(t,e),hu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=yi(a,o),o=yi(n.memoizedProps,o);var s=xi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Yl=0,t=su(e,n,t,o,s,a,!0),Yl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(zd(e,e.memoizedProps.onUpdate),ql=i):i!==null&&(i.push.apply(i,ql),ql=i),hu=e.flags&32?!0:r;break;default:Ru(t,e)}}function Bu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)xu(e,t.alternate,t),t=t.sibling}function Vu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:Dl(4,n,n.return),Vu(n,r);break;case 1:jl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&kl(n,n.return,i),Vu(n,r);break;case 27:r&2&&wm(n.stateNode,n.type,n.memoizedProps);case 5:jl(n,n.return),n.tag!==5&&n.tag!==27||Pl(n),Vu(n,r);break;case 6:Pl(n);break;case 26:jl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||uu||i.parentNode.removeChild(i),Vu(n,r);break;case 22:n.memoizedState===null&&Vu(n,r);break;case 30:jl(n,n.return),Vu(n,r);break;case 7:jl(n,n.return);default:Vu(n,r)}e=e.sibling}}function Hu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:Hu(i,a,n),El(4,a);break;case 1:if(Hu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){U(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)Eo(l[i],c)}catch(e){U(r,r.return,e)}}s&&o&64&&Ol(a),Al(a,a.return);break;case 27:n&2&&Ul(a);case 5:a.tag!==5&&a.tag!==27||Nl(a),Hu(i,a,n),s&&r===null&&o&4&&Ll(a),Al(a,a.return);break;case 6:Nl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||lu||$m(Om(c.ownerDocument),a.type,c),Hu(i,a,n),s&&r===null&&o&4&&Ll(a),Al(a,a.return);break;case 12:Hu(i,a,n);break;case 31:Hu(i,a,n),s&&o&4&&Au(i,a);break;case 13:Hu(i,a,n),s&&o&4&&ju(i,a);break;case 22:a.memoizedState===null&&Hu(i,a,n),Al(a,a.return);break;case 30:Hu(i,a,n),Al(a,a.return);break;case 7:Al(a,a.return);default:Hu(i,a,n)}t=t.sibling}}function Uu(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Fa(n))}function Wu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Fa(e))}function Gu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Ku(e,t,n,r),t=t.sibling;else i&&ou(t)}function Ku(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&au(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Gu(e,t,n,r),a&2048&&El(9,t);break;case 1:Gu(e,t,n,r);break;case 3:Gu(e,t,n,r),i&&vu&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&Fa(a)));break;case 12:if(a&2048){Gu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){U(t,t.return,e)}}else Gu(e,t,n,r);break;case 31:Gu(e,t,n,r);break;case 13:Gu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&au(t),o._visibility&2?Gu(e,t,n,r):(o._visibility|=2,qu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&au(s),o._visibility&2?Gu(e,t,n,r):Ju(e,t)),a&2048&&Uu(s,t);break;case 24:Gu(e,t,n,r),a&2048&&Wu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Ql(a.child,!0),Ql(t.child,!0))),Gu(e,t,n,r);break;default:Gu(e,t,n,r)}}function qu(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:qu(a,o,s,c,i),El(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,qu(a,o,s,c,i)):u._visibility&2?qu(a,o,s,c,i):Ju(a,o),i&&l&2048&&Uu(o.alternate,o);break;case 24:qu(a,o,s,c,i),i&&l&2048&&Wu(o.alternate,o);break;default:qu(a,o,s,c,i)}t=t.sibling}}function Ju(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Ju(n,r),i&2048&&Uu(r.alternate,r);break;case 24:Ju(n,r),i&2048&&Wu(r.alternate,r);break;default:Ju(n,r)}t=t.sibling}}var Yu=8192;function Xu(e,t,n){if(e.subtreeFlags&Yu)for(e=e.child;e!==null;)Zu(e,t,n),e=e.sibling}function Zu(e,t,n){switch(e.tag){case 26:Xu(e,t,n),e.flags&Yu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&ih(n,e)):ah(n,Pu,e.memoizedState,e.memoizedProps));break;case 5:Xu(e,t,n),e.flags&Yu&&(e=e.stateNode,(t&335544128)===t&&ih(n,e));break;case 3:case 4:var r=Pu;Pu=Om(e.stateNode.containerInfo),Xu(e,t,n),Pu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Yu,Yu=16777216,Xu(e,t,n),Yu=r):Xu(e,t,n));break;case 30:if((e.flags&Yu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Gl===null&&(Gl=new Map),Gl.set(r,i)}Xu(e,t,n);break;default:Xu(e,t,n)}}function Qu(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function $u(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];mu=r,nd(r,e)}Qu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)ed(e),e=e.sibling}function ed(e){switch(e.tag){case 0:case 11:case 15:$u(e),e.flags&2048&&Dl(9,e,e.return);break;case 3:$u(e);break;case 12:$u(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,td(e)):$u(e);break;default:$u(e)}}function td(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];mu=r,nd(r,e)}Qu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Dl(8,t,t.return),td(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,td(t));break;default:td(t)}e=e.sibling}}function nd(e,t){for(;mu!==null;){var n=mu;switch(n.tag){case 0:case 11:case 15:Dl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Fa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,mu=r;else a:for(n=e;mu!==null;){r=mu;var i=r.sibling,a=r.return;if(Tu(r),r===n){mu=null;break a}if(i!==null){i.return=a,mu=i;break a}mu=a}}}var rd={getCacheForType:function(e){var t=Da(Na),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Da(Na).controller.signal}},id=typeof WeakMap==`function`?WeakMap:Map,z=0,B=null,V=null,H=0,ad=0,od=null,sd=!1,cd=!1,ld=!1,ud=0,dd=0,fd=0,pd=0,md=0,hd=0,gd=0,_d=null,vd=null,yd=!1,bd=0,xd=0,Sd=1/0,Cd=null,wd=null,Td=0,Ed=null,Dd=null,Od=0,kd=0,Ad=null,jd=null,Md=null,Nd=null,Pd=null,Fd=0,Id=null;function Ld(){return z&2&&H!==0?H&-H:j.T===null?St():Bf()}function Rd(){if(hd===0){if(!(H&536870912)||I){var e=ot;ot<<=1,!(ot&3932160)&&(ot=262144),hd=e}else hd=536870912}return e=No.current,e!==null&&(e.flags|=32),hd}function zd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Hp(yi(e.memoizedProps,n))),Nd===null&&(Nd=[]),Nd.push(t.bind(null,r))}}function Bd(e,t,n){(e===B&&(ad===2||ad===9)||e.cancelPendingCommit!==null)&&(qd(e,0),Wd(e,H,hd,!1)),ht(e,n),z&2&&e===B||(e===B&&(!(z&2)&&(pd|=n),dd===4&&Wd(e,H,hd,!1)),Mf(e))}function Vd(e,t,n){if(z&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||ut(e,t),a=r?tf(e,t):$d(e,t,!0),o=r;do{if(a===0){cd&&!r&&Wd(e,t,0,!1);break}if(n=e.current.alternate,o&&!Ud(n))a=$d(e,t,!1),o=!1;else{if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=_d;var l=c.current.memoizedState.isDehydrated;if(l&&(qd(c,s).flags|=256),s=$d(c,s,!1),s!==2&&s!==6){if(ld&&!l){c.errorRecoveryDisabledLanes|=o,pd|=o,a=4;break a}o=vd,vd=a,o!==null&&(vd===null?vd=o:vd.push.apply(vd,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){qd(e,0),Wd(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Wd(r,t,hd,!sd);break a;case 2:vd=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=bd+300-He(),10<a)){if(Wd(r,t,hd,!sd),lt(r,0,!0)!==0)break a;Od=t,r.timeoutHandle=wp(Hd.bind(null,r,n,vd,Cd,yd,t,hd,pd,gd,sd,o,`Throttled`,-0,0),a);break a}Hd(r,n,vd,Cd,yd,t,hd,pd,gd,sd,o,null,-0,0)}break}}while(1);Mf(e)}function Hd(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Sn},Gl=null,Zu(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=lh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?bd-He():(a&4194048)===a?xd-He():0,m=sh(d,m),m!==null)?(Od=a,e.cancelPendingCommit=m(lf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Wd(e,a,o,!l)):lf(e,t,a,n,r,i,o,s,c,l,u,d)}function Ud(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Ur(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Wd(e,t,n,r){t=dt(e,t),t&=~md,t&=~pd,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-tt(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&_t(e,n,t)}function Gd(){return z&6?!0:(Nf(0,!1),!1)}function Kd(){if(V!==null){if(ad===0)var e=V.return;else e=V,ya=va=null,cs(e),so=null,co=0,e=V;for(;e!==null;)Tl(e.alternate,e),e=e.return;V=null}}function qd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,Tp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Od=0,Kd(),B=e,V=n=Ii(e.current,null),H=t,ad=0,od=null,sd=!1,cd=ut(e,t),ld=!1,gd=hd=md=pd=fd=dd=0,vd=_d=null,yd=!1,ud=dt(e,t),Ei(),n}function Jd(e,t){L=null,j.H=vc,t===Za||t===$a?(t=ao(),ad=3):t===Qa?(t=ao(),ad=4):ad=t===Ic?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,od=t,V===null&&(dd=1,Ac(e,Wi(t,e.current)))}function Yd(){var e=No.current;return e===null?!0:(H&4194048)===H?Po===null:(H&62914560)===H||H&536870912?e===Po:!1}function Xd(){var e=j.H;return j.H=vc,e===null?vc:e}function Zd(){var e=j.A;return j.A=rd,e}function Qd(){dd=4,sd||(H&4194048)!==H&&No.current!==null||(cd=!0),!(fd&134217727)&&!(pd&134217727)||B===null||Wd(B,H,hd,!1)}function $d(e,t,n){var r=z;z|=2;var i=Xd(),a=Zd();(B!==e||H!==t)&&(Cd=null,qd(e,t)),t=!1;var o=dd;a:do try{if(ad!==0&&V!==null){var s=V,c=od;switch(ad){case 8:Kd(),o=6;break a;case 3:case 2:case 9:case 6:No.current===null&&(t=!0);var l=ad;if(ad=0,od=null,of(e,s,c,l),n&&cd){o=0;break a}break;default:l=ad,ad=0,od=null,of(e,s,c,l)}}ef(),o=dd;break}catch(t){Jd(e,t)}while(1);return t&&e.shellSuspendCounter++,ya=va=null,z=r,j.H=i,j.A=a,V===null&&(B=null,H=0,Ei()),o}function ef(){for(;V!==null;)rf(V)}function tf(e,t){var n=z;z|=2;var r=Xd(),a=Zd();B!==e||H!==t?(Cd=null,Sd=He()+500,qd(e,t)):cd=ut(e,t);a:do try{if(ad!==0&&V!==null){t=V;var o=od;b:switch(ad){case 1:ad=0,od=null,of(e,t,o,1);break;case 2:case 9:if(to(o)){ad=0,od=null,af(t);break}t=function(){ad!==2&&ad!==9||B!==e||(ad=7),Mf(e)},o.then(t,t);break a;case 3:ad=7;break a;case 4:ad=5;break a;case 7:to(o)?(ad=0,od=null,af(t)):(ad=0,od=null,of(e,t,o,7));break;case 5:var s=null;switch(V.tag){case 26:s=V.memoizedState;case 5:case 27:var c=V;if(s?nh(s):c.stateNode.complete){ad=0,od=null;var l=c.sibling;if(l!==null)V=l;else{var u=c.return;u===null?V=null:(V=u,sf(u))}break b}}ad=0,od=null,of(e,t,o,5);break;case 6:ad=0,od=null,of(e,t,o,6);break;case 8:Kd(),dd=6;break a;default:throw Error(i(462))}}nf();break}catch(t){Jd(e,t)}while(1);return ya=va=null,j.H=r,j.A=a,z=n,V===null?(B=null,H=0,Ei(),dd):0}function nf(){for(;V!==null&&!Be();)rf(V)}function rf(e){var t=gl(e.alternate,e,ud);e.memoizedProps=e.pendingProps,t===null?sf(e):V=t}function af(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Xc(n,t,t.pendingProps,t.type,void 0,H);break;case 11:t=Xc(n,t,t.pendingProps,t.type.render,t.ref,H);break;case 5:cs(t);var r=t;r===aa&&(I?(fa(r),r.tag===5&&r.stateNode!=null&&(oa=r.stateNode)):(fa(r),I=!0));default:Tl(n,t),t=V=Li(t,ud),t=gl(n,t,ud)}e.memoizedProps=e.pendingProps,t===null?sf(e):V=t}function of(e,t,n,r){ya=va=null,cs(t),so=null,co=0;var i=t.return;try{if(Fc(e,i,t,n,H)){dd=1,Ac(e,Wi(n,e.current)),V=null;return}}catch(t){if(i!==null)throw V=i,t;dd=1,Ac(e,Wi(n,e.current)),V=null;return}t.flags&32768?(I||r===1?e=!0:cd||H&536870912?e=!1:(sd=e=!0,(r===2||r===9||r===3||r===6)&&(r=No.current,r!==null&&r.tag===13&&(r.flags|=16384))),cf(t,e)):sf(t)}function sf(e){var t=e;do{if(t.flags&32768){cf(t,sd);return}e=t.return;var n=Cl(t.alternate,t,ud);if(n!==null){V=n;return}if(t=t.sibling,t!==null){V=t;return}V=t=e}while(t!==null);dd===0&&(dd=5)}function cf(e,t){do{var n=wl(e.alternate,e);if(n!==null){n.flags&=32767,V=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){V=e;return}V=e=n}while(e!==null);dd=6,V=null}function lf(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do _f();while(Td!==0);if(z&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===B&&(V=B=null,H=0),Dd=t,Ed=e,Od=n,Ad=a,jd=r,uf(e,t,n,s,c,l,f)}}function uf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(kd=s,s|=Ti,gt(e,n,s,r,i,a),Nd=null,(n&335544064)===n?(Pd=Ra(e),r=10262):(Pd=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,Tf(Ke,function(){return vf(),null})):(e.callbackNode=null,e.callbackPriority=0),Wl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=j.T,j.T=null,i=M.p,M.p=2,a=z,z|=4;try{yu(e,t,n)}finally{z=a,M.p=i,j.T=r}}Td=1,Wl?Md=Bp(o,e.containerInfo,Pd,pf,mf,ff,hf,vf,df,null,null):(pf(),mf(),hf())}function df(e){if(Td!==0){var t=Ed.onRecoverableError;t(e,{componentStack:null})}}function ff(){Td===3&&(Td=0,zu(Dd,Ed),Td=4)}function pf(){if(Td===1){Td=0;var e=Ed,t=Dd,n=Od,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=j.T,j.T=null;var i=M.p;M.p=2;var a=z;z|=4;try{gu=_u=!1,Fu(t,e,n),n=gp;var o=Yr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Jr(s.ownerDocument.documentElement,s)){if(c!==null&&Xr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=qr(s,h),v=qr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}Ch=!!hp,gp=hp=null}finally{z=a,M.p=i,j.T=r}}e.current=t,Td=2}}function mf(){if(Td===2){Td=0;var e=Ed,t=Dd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=j.T,j.T=null;var r=M.p;M.p=2;var i=z;z|=4;try{xu(e,t.alternate,t)}finally{z=i,M.p=r,j.T=n}}Td=3}}function hf(){if(Td===4||Td===3){Td=0;var e=Md;Md=null,Ve();var t=Ed,n=Dd,r=Od,i=jd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?Td=5:(Td=0,Dd=Ed=null,gf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(wd=null),xt(r),n=n.stateNode,Qe&&typeof Qe.onCommitFiberRoot==`function`)try{Qe.onCommitFiberRoot(Ze,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=j.T,a=M.p,M.p=2,j.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{j.T=n,M.p=a}}if(i=Nd,o=Pd,Pd=null,i!==null&&(Nd=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);Od&3&&_f(),Mf(t),a=t.pendingLanes,r&261930&&a&42?t===Id?Fd++:(Fd=0,Id=t):(Fd=0,Id=null),Nf(0,!1)}}function gf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Fa(t)))}function _f(){return Md!==null&&(Md.skipTransition(),Md=null),pf(),mf(),hf(),vf()}function vf(){if(Td!==5)return!1;var e=Ed,t=kd;kd=0;var n=xt(Od),r=j.T,a=M.p;try{M.p=32>n?32:n,j.T=null,n=Ad,Ad=null;var o=Ed,s=Od;if(Td=0,Dd=Ed=null,Od=0,z&6)throw Error(i(331));var c=z;if(z|=4,ed(o.current),Ku(o,o.current,s,n),z=c,Nf(0,!1),Qe&&typeof Qe.onPostCommitFiberRoot==`function`)try{Qe.onPostCommitFiberRoot(Ze,o)}catch{}return!0}finally{M.p=a,j.T=r,gf(e,t)}}function yf(e,t,n){t=Wi(n,t),t=Mc(e.stateNode,t,2),e=bo(e,t,2),e!==null&&(ht(e,2),Mf(e))}function U(e,t,n){if(e.tag===3)yf(e,e,n);else for(;t!==null;){if(t.tag===3){yf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(wd===null||!wd.has(r))){e=Wi(n,e),n=Nc(2),r=bo(t,n,2),r!==null&&(Pc(n,r,t,e),ht(r,2),Mf(r));break}}t=t.return}}function bf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new id;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(ld=!0,i.add(n),e=xf.bind(null,e,t,n),t.then(e,e))}function xf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,B===e&&(H&n)===n&&(dd===4||dd===3&&(H&62914560)===H&&300>He()-bd?z&2?md|=n:qd(e,0):md|=n,gd===H&&(gd=0)),Mf(e)}function Sf(e,t){t===0&&(t=pt()),e=ki(e,t),e!==null&&(ht(e,t),Mf(e))}function Cf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Sf(e,n)}function wf(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Sf(e,n)}function Tf(e,t){return Re(e,t)}var Ef=null,Df=null,Of=!1,kf=!1,Af=!1,jf=0;function Mf(e){e!==Df&&e.next===null&&(Df===null?Ef=Df=e:Df=Df.next=e),kf=!0,Of||(Of=!0,zf())}function Nf(e,t){if(!Af&&kf){Af=!0;do for(var n=!1,r=Ef;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-tt(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Rf(r,a))}else a=H,a=lt(r,r===B?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||ut(r,a)||(n=!0,Rf(r,a))}r=r.next}while(n);Af=!1}}function Pf(){Ff()}function Ff(){kf=Of=!1;var e=0;jf!==0&&Cp()&&(e=jf);for(var t=He(),n=null,r=Ef;r!==null;){var i=r.next,a=If(r,t);a===0?(r.next=null,n===null?Ef=i:n.next=i,i===null&&(Df=n)):(n=r,(e!==0||a&3)&&(kf=!0)),r=i}Td!==0&&Td!==5||Nf(e,!1),jf!==0&&(jf=0)}function If(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-tt(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=ft(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=B,n=H,n=lt(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(ad===2||ad===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&ze(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||ut(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&ze(r),xt(n)){case 2:case 8:n=Ge;break;case 32:n=Ke;break;case 268435456:n=Je;break;default:n=Ke}return r=Lf.bind(null,e),n=Re(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&ze(r),e.callbackPriority=2,e.callbackNode=null,2}function Lf(e,t){if(Td!==0&&Td!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(_f()&&e.callbackNode!==n)return null;var r=H;return r=lt(e,e===B?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Vd(e,r,t),If(e,He()),e.callbackNode!=null&&e.callbackNode===n?Lf.bind(null,e):null)}function Rf(e,t){if(_f())return null;Vd(e,t,!0)}function zf(){Op(function(){z&6?Re(We,Pf):Ff()})}function Bf(){if(jf===0){var e=Va;e===0&&(e=at,at<<=1,!(at&261888)&&(at=256)),jf=e}return jf}function Vf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:xn(e)}function Hf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Vf((i[Et]||null).action),o=r.submitter;o&&(t=(t=o[Et]||null)?Vf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Un(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(jf!==0){var e=new FormData(i,o);ic(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),ic(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Uf=0;Uf<gi.length;Uf++){var Wf=gi[Uf];_i(Wf.toLowerCase(),`on`+(Wf[0].toUpperCase()+Wf.slice(1)))}_i(ci,`onAnimationEnd`),_i(li,`onAnimationIteration`),_i(ui,`onAnimationStart`),_i(`dblclick`,`onDoubleClick`),_i(`focusin`,`onFocus`),_i(`focusout`,`onBlur`),_i(di,`onTransitionRun`),_i(fi,`onTransitionStart`),_i(pi,`onTransitionCancel`),_i(mi,`onTransitionEnd`),Wt(`onMouseEnter`,[`mouseout`,`mouseover`]),Wt(`onMouseLeave`,[`mouseout`,`mouseover`]),Wt(`onPointerEnter`,[`pointerout`,`pointerover`]),Wt(`onPointerLeave`,[`pointerout`,`pointerover`]),Ut(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Ut(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Ut(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Ut(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Ut(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Ut(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Gf=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),Kf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Gf));function qf(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Si(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Si(e)}i.currentTarget=null,a=c}}}}function Jf(e,t){var n=t[Ot];n===void 0&&(n=t[Ot]=new Set);var r=e+`__bubble`;n.has(r)||(Qf(t,e,2,!1),n.add(r))}function Yf(e,t,n){var r=0;t&&(r|=4),Qf(n,e,r,t)}var Xf=`_reactListening`+Math.random().toString(36).slice(2);function Zf(e){if(!e[Xf]){e[Xf]=!0,Vt.forEach(function(t){t!==`selectionchange`&&(Kf.has(t)||Yf(t,!1,e),Yf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Xf]||(t[Xf]=!0,Yf(`selectionchange`,!1,t))}}function Qf(e,t,n,r){switch(Ah(t)){case 2:var i=wh;break;case 8:i=Th;break;default:i=Eh}n=i.bind(null,t,n,e),i=void 0,!Mn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function $f(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=Ft(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}kn(function(){var r=a,i=wn(n),s=[];a:{var c=hi.get(e);if(c!==void 0){var l=Un,u=e;switch(e){case`keypress`:if(Rn(n)===0)break a;case`keydown`:case`keyup`:l=sr;break;case`focusin`:u=`focus`,l=Qn;break;case`focusout`:u=`blur`,l=Qn;break;case`beforeblur`:case`afterblur`:l=Qn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Xn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Zn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=ur;break;case ci:case li:case ui:l=$n;break;case mi:l=dr;break;case`scroll`:case`scrollend`:l=Gn;break;case`wheel`:l=fr;break;case`copy`:case`cut`:case`paste`:l=er;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=cr;break;case`submit`:l=lr;break;case`toggle`:case`beforetoggle`:l=pr}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=An(m,p),g!=null&&d.push(ep(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==Cn&&(u=n.relatedTarget||n.fromElement)&&(Ft(u)||u[Dt]))break a;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?Ft(l):null,l!==null&&(f=o(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=Xn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=cr,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Lt(c),h=l==null?u:Lt(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Ft(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?C(c,l,np):null,c!==null&&rp(s,u,c,d,!1),l!==null&&f!==null&&rp(s,f,l,d,!0)))}a:{if(c=r?Lt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Nr;else if(Dr(c)){if(Pr)_=Vr;else{_=zr;var v=Rr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&vn(r.elementType)&&(_=Nr):_=Br;if(_&&=_(e,r)){Or(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Lt(r):window,e){case`focusin`:(Dr(v)||v.contentEditable===`true`)&&(Qr=v,$r=r,ei=null);break;case`focusout`:ei=$r=Qr=null;break;case`mousedown`:ti=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:ti=!1,ni(s,n,i);break;case`selectionchange`:if(Zr)break;case`keydown`:case`keyup`:ni(s,n,i)}var y;if(hr)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else Cr?xr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(vr&&n.locale!==`ko`&&(Cr||b!==`onCompositionStart`?b===`onCompositionEnd`&&Cr&&(y=Ln()):(Pn=i,Fn=`value`in Pn?Pn.value:Pn.textContent,Cr=!0)),v=tp(r,b),0<v.length&&(b=new tr(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=Sr(n),y!==null&&(b.data=y)))),(y=_r?wr(e,n):Tr(e,n))&&(b=tp(r,`onBeforeInput`),0<b.length&&(v=new tr(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),Hf(s,e,r,n,i)}qf(s,t)})}function ep(e,t,n){return{instance:e,listener:t,currentTarget:n}}function tp(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=An(e,n),i!=null&&r.unshift(ep(e,i,a)),i=An(e,t),i!=null&&r.push(ep(e,i,a))),e.tag===3)return r;e=e.return}return[]}function np(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function rp(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=An(n,a),l!=null&&o.unshift(ep(n,l,c))):i||(l=An(n,a),l!=null&&o.push(ep(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var ip=/\r\n?/g,ap=/\u0000|\uFFFD/g;function op(e){return(typeof e==`string`?e:``+e).replace(ip,`
1252
- `).replace(ap,``)}function sp(e,t){return t=op(t),op(e)===t}function cp(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||mn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&mn(e,``+r);else return;break;case`className`:Qt(e,`class`,r);break;case`tabIndex`:Qt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Qt(e,n,r);break;case`style`:_n(e,r,o);return;case`data`:if(t!==`object`){Qt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=xn(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&cp(e,t,`name`,a.name,a,null),cp(e,t,`formEncType`,a.formEncType,a,null),cp(e,t,`formMethod`,a.formMethod,a,null),cp(e,t,`formTarget`,a.formTarget,a,null)):(cp(e,t,`encType`,a.encType,a,null),cp(e,t,`method`,a.method,a,null),cp(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=xn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Sn);return;case`onScroll`:r!=null&&Jf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Jf(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=xn(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Jf(`beforetoggle`,e),Jf(`toggle`,e),Zt(e,`popover`,r);break;case`xlinkActuate`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:$t(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:$t(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:$t(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Zt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=yn.get(n)||n,Zt(e,n,r);else return}Yt=!0}function lp(e,t,n,r,a,o){switch(n){case`style`:_n(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)mn(e,r);else if(typeof r==`number`||typeof r==`bigint`)mn(e,``+r);else return;break;case`onScroll`:r!=null&&Jf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Jf(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=Sn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Ht.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[Et]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}Yt=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Zt(e,n,r)}return}Yt=!0}function up(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Jf(`error`,e),Jf(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:cp(e,t,o,s,n,null)}}a&&cp(e,t,`srcSet`,n.srcSet,n,null),r&&cp(e,t,`src`,n.src,n,null);return;case`input`:Jf(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:cp(e,t,r,d,n,null)}}ln(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Jf(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:cp(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&dn(e,!!r,n,!0):dn(e,!!r,t,!1);return;case`textarea`:for(s in Jf(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:cp(e,t,s,c,n,null)}pn(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:cp(e,t,l,r,n,null)}return;case`dialog`:Jf(`beforetoggle`,e),Jf(`toggle`,e),Jf(`cancel`,e),Jf(`close`,e);break;case`iframe`:case`object`:Jf(`load`,e);break;case`video`:case`audio`:for(r=0;r<Gf.length;r++)Jf(Gf[r],e);break;case`image`:Jf(`error`,e),Jf(`load`,e);break;case`details`:Jf(`toggle`,e);break;case`embed`:case`source`:case`link`:Jf(`error`,e),Jf(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:cp(e,t,u,r,n,null)}return;default:if(vn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&lp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&cp(e,t,c,r,n,null))}var dp={};function fp(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||cp(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(Yt=!0),o=m;break;case`name`:m!==f&&(Yt=!0),a=m;break;case`checked`:m!==f&&(Yt=!0),u=m;break;case`defaultChecked`:m!==f&&(Yt=!0),d=m;break;case`value`:m!==f&&(Yt=!0),s=m;break;case`defaultValue`:m!==f&&(Yt=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&cp(e,t,p,m,r,f)}}cn(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||cp(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:o!==l&&(Yt=!0),p=o;break;case`defaultValue`:o!==l&&(Yt=!0),c=o;break;case`multiple`:o!==l&&(Yt=!0),s=o;default:o!==l&&cp(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?dn(e,!!n,n?[]:``,!1):dn(e,!!n,t,!0)):dn(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:cp(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:a!==o&&(Yt=!0),p=a;break;case`defaultValue`:a!==o&&(Yt=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&cp(e,t,s,a,r,o)}fn(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:cp(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(Yt=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:cp(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&cp(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:cp(e,t,u,p,r,m)}return;default:if(vn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&lp(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||lp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&cp(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||cp(e,t,f,p,r,m)}function pp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function mp(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&pp(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&pp(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var hp=null,gp=null;function _p(e){return e.nodeType===9?e:e.ownerDocument}function vp(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function yp(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function bp(e,t,n,r){return n=_p(n).createElement(e),n[Tt]=r,n[Et]=t,up(n,e,t),zt(n),n}function xp(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Sp=null;function Cp(){var e=window.event;return e&&e.type===`popstate`?e!==Sp&&(Sp=e,!0):(Sp=null,!1)}var wp=typeof setTimeout==`function`?setTimeout:void 0,Tp=typeof clearTimeout==`function`?clearTimeout:void 0,Ep=typeof Promise==`function`?Promise:void 0,Dp=typeof requestAnimationFrame==`function`?requestAnimationFrame:wp,Op=typeof queueMicrotask==`function`?queueMicrotask:Ep===void 0?wp:function(e){return Ep.resolve(null).then(e).catch(kp)};function kp(e){setTimeout(function(){throw e})}function Ap(e){return e===`head`}function jp(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Yh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Tm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Tm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Mt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Tm(e.ownerDocument.body)}n=i}while(n);Yh(t)}function Mp(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function Np(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Pp(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Fp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Ip(e){return Fp(e.getBoundingClientRect(),getComputedStyle(e),e)}function Lp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Fp(t,n,e)}function Rp(e){return e.documentElement.clientHeight}function zp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Bp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Rp(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=rh(f),u>oh){s.length=o;break}f=new Promise(zp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Vp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Vp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:w({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Vp.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Vp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Hp(e){return{name:e,group:new Vp(`group`,e),imagePair:new Vp(`image-pair`,e),old:new Vp(`old`,e),new:new Vp(`new`,e)}}function Up(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Up.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Jp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Kp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),f(this._fragmentFiber.child,!1,Wp,e,s,r)}this._eventListeners=a}};function Wp(e,t,n,r){return _(e).addEventListener(t,n,r),!1}Up.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Jp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Kp(i.optionsOrUseCapture),f(this._fragmentFiber.child,!1,Gp,e,n,i),r.splice(t,1),a!==null&&a()}};function Gp(e,t,n,r){return _(e).removeEventListener(t,n,r),!1}function Kp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function qp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Jp(e,t,n,r){if(e.length===0)return-1;r=qp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&qp(a.optionsOrUseCapture)===r)return i}return-1}Up.prototype.dispatchEvent=function(e){var t=p(this._fragmentFiber);if(t===null)return!0;t=_(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Kp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Kp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Up.prototype.focus=function(e){f(this._fragmentFiber.child,!0,Yp,e,void 0,void 0)};function Yp(e,t){return e.tag!==6&&(e=_(e),xm(e,t))}Up.prototype.focusLast=function(e){var t=[];f(this._fragmentFiber.child,!0,Xp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Yp(t[n],e);n--);};function Xp(e,t){return t.push(e),!1}Up.prototype.blur=function(){var e=p(this._fragmentFiber);e!==null&&(e=_(e),e=_p(e).activeElement,e!==null&&f(this._fragmentFiber.child,!1,Zp,e,void 0,void 0))};function Zp(e,t){return e.tag!==6&&(e=_(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Up.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),f(this._fragmentFiber.child,!1,Qp,e,void 0,void 0)};function Qp(e,t){return e.tag===6||(e=_(e),t.observe(e)),!1}Up.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),f(this._fragmentFiber.child,!1,$p,e,void 0,void 0);for(var n=t=0;n<em.length;n++){var r=em[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):em[t++]=r}em.length=t}};function $p(e,t){return e.tag===6||(e=_(e),t.unobserve(e)),!1}var em=[],tm=!1;function nm(e,t,n){em.push({fragmentInstance:e,observer:t,instance:n}),tm||(tm=!0,Sm(function(){tm=!1;var e=em;em=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Up.prototype.getClientRects=function(){var e=[];return f(this._fragmentFiber.child,!1,rm,e,void 0,void 0),e};function rm(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=_(e),t.push.apply(t,e.getClientRects());return!1}Up.prototype.getRootNode=function(e){var t=p(this._fragmentFiber);return t===null?this:_(t).getRootNode(e)},Up.prototype.compareDocumentPosition=function(e){var t=p(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];f(this._fragmentFiber.child,!1,Xp,n,void 0,void 0);var r=_(t);if(n.length===0){if(n=r,m(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=h(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=_(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=_(n[0]),i=_(n[n.length-1]);var a=m(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||im(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function im(e,t,n,r,i){var a=Ft(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=p(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=C(n,a,S),t===null?t=!1:(f(t,!0,b,a,n),a=v,v=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=C(r,a,S),t===null?t=!1:(f(t,!0,x,a,r),a=v,y=v=null,t=a!==null)),t):!1}function am(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Up.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];f(this._fragmentFiber.child,!1,Xp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=h(this._fragmentFiber);if(r=n?r[1]||r[0]||p(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=_(r),am(e,n);return}if(r=_(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=_(a),am(a,n)):_(a).scrollIntoView(e),r+=n?-1:1}};function om(e,t){return e=_(e),sm(e,t),!1}function sm(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function cm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Kp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<em.length;i++){var a=em[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(em[r++]=a)}em.length=r,n.observe(e)}),sm(e,t))}function lm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Kp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?nm(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function um(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:um(n),Pt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function dm(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[Mt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=_m(e.nextSibling),e===null)break}return null}function fm(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=_m(e.nextSibling),e===null))return null;return e}function pm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=_m(e.nextSibling),e===null))return null;return e}function mm(e){return e.data===`$?`||e.data===`$~`}function hm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function gm(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function _m(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var vm=null;function ym(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return _m(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function bm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function xm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function Sm(e){Dp(function(){Dp(function(t){return e(t)})})}function Cm(e,t,n){switch(t=_p(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function wm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&cp(e,t,r,null,dp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===Sn&&(e.onclick=null),Pt(e)}function Tm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Pt(e)}var Em=new Map,Dm=new Set;function Om(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var km=M.d;M.d={f:Am,r:jm,D:Pm,C:Fm,L:Im,m:Lm,X:zm,S:Rm,M:Bm};function Am(){var e=km.f(),t=Gd();return e||t}function jm(e){var t=It(e);t!==null&&t.tag===5&&t.type===`form`?oc(t):km.r(e)}var Mm=typeof document>`u`?null:document;function Nm(e,t,n){var r=Mm;if(r&&typeof t==`string`&&t){var i=sn(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Dm.has(i)||(Dm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),up(t,`link`,e),zt(t),r.head.appendChild(t)))}}function Pm(e){km.D(e),Nm(`dns-prefetch`,e,null)}function Fm(e,t){km.C(e,t),Nm(`preconnect`,e,t)}function Im(e,t,n){km.L(e,t,n);var r=Mm;if(r&&e&&t){var i=`link[rel="preload"][as="`+sn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+sn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+sn(n.imageSizes)+`"]`)):i+=`[href="`+sn(e)+`"]`;var a=i;switch(t){case`style`:a=Hm(e);break;case`script`:a=Km(e)}if(!(Em.has(a)||(e=w({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Em.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Um(a))||t===`script`&&r.querySelector(qm(a))))){var o=r.createElement(`link`);up(o,`link`,e),t===`style`&&(o[Nt]=!0,o.onload=o.onerror=function(){Bt(o)}),zt(o),r.head.appendChild(o)}}}function Lm(e,t){km.m(e,t);var n=Mm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+sn(r)+`"][href="`+sn(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Km(e)}if(!Em.has(a)&&(e=w({rel:`modulepreload`,href:e},t),Em.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(qm(a)))return}r=n.createElement(`link`),up(r,`link`,e),zt(r),n.head.appendChild(r)}}}function Rm(e,t,n){km.S(e,t,n);var r=Mm;if(r&&e){var i=Rt(r).hoistableStyles,a=Hm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Um(a)))s.loading=5;else{e=w({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Em.get(a))&&Xm(e,n);var c=o=r.createElement(`link`);zt(c),up(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Ym(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function zm(e,t){km.X(e,t);var n=Mm;if(n&&e){var r=Rt(n).hoistableScripts,i=Km(e),a=r.get(i);a||(a=n.querySelector(qm(i)),a||(e=w({src:e,async:!0},t),(t=Em.get(i))&&Zm(e,t),a=n.createElement(`script`),zt(a),up(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Bm(e,t){km.M(e,t);var n=Mm;if(n&&e){var r=Rt(n).hoistableScripts,i=Km(e),a=r.get(i);a||(a=n.querySelector(qm(i)),a||(e=w({src:e,async:!0,type:`module`},t),(t=Em.get(i))&&Zm(e,t),a=n.createElement(`script`),zt(a),up(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Vm(e,t,n,r){var a=(a=Te.current)?Om(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Hm(n.href),t=Rt(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Hm(n.href);var o=Rt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Um(e)))?o._p||(s.instance=o,s.state.loading=5):(o=Em.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Em.set(e,o)),Gm(a,e,o,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Km(n),t=Rt(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Hm(e){return`href="`+sn(e)+`"`}function Um(e){return`link[rel="stylesheet"][`+e+`]`}function Wm(e){return w({},e,{"data-precedence":e.precedence,precedence:null})}function Gm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Nt]){r.loading=1;return}}else t=e.createElement(`link`),t[Nt]=!0,t.onload=t.onerror=Bt.bind(null,t),up(t,`link`,n),zt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Km(e){return`[src="`+sn(e)+`"]`}function qm(e){return`script[async]`+e}function Jm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+sn(n.href)+`"]`);if(r)return t.instance=r,zt(r),r;var a=w({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),zt(r),up(r,`style`,a),Ym(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Hm(n.href);var o=e.querySelector(Um(a));if(o)return t.state.loading|=4,t.instance=o,zt(o),o;r=Wm(n),(a=Em.get(a))&&Xm(r,a),o=(e.ownerDocument||e).createElement(`link`),zt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),up(o,`link`,r),t.state.loading|=4,Ym(o,n.precedence,e),t.instance=o;case`script`:return o=Km(n.src),(a=e.querySelector(qm(o)))?(t.instance=a,zt(a),a):(r=n,(a=Em.get(o))&&(r=w({},n),Zm(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),zt(a),up(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Ym(r,n.precedence,e));return t.instance}function Ym(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Xm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Zm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Qm=null;function W(e,t,n){if(Qm===null){var r=new Map,i=Qm=new Map;i.set(n,r)}else i=Qm,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[Mt]||a[Tt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function $m(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function eh(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function th(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function nh(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function rh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function ih(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=rh(t),e.suspenseyImages.push(t)),e=uh.bind(e),t.decode().then(e,e))}function ah(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Hm(r.href),a=t.querySelector(Um(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=lh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,zt(a);return}a=t.ownerDocument||t,r=Wm(r),(i=Em.get(i))&&Xm(r,i),a=a.createElement(`link`),zt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),up(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=lh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var oh=0;function sh(e,t){return e.stylesheets&&e.count===0&&fh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&fh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&oh===0&&(oh=62500*mp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&fh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>oh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function ch(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)fh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function lh(){this.count--,ch(this)}function uh(){this.imgCount--,ch(this)}var dh=null;function fh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,dh=new Map,t.forEach(ph,e),dh=null,lh.call(e))}function ph(e,t){if(!(t.state.loading&4)){var n=dh.get(e);if(n)var r=n.get(null);else{n=new Map,dh.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=lh.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var mh={$$typeof:O,Provider:null,Consumer:null,_currentValue:_e,_currentValue2:_e,_threadCount:0};function hh(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=mt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=mt(0),this.hiddenUpdates=mt(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function gh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new hh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Pi(3,null,null,t),e.current=a,a.stateNode=e,t=Pa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},_o(a),e}function _h(e){return e?(e=Mi,e):Mi}function vh(e,t,n,r,i,a){i=_h(i),r.context===null?r.context=i:r.pendingContext=i,r=yo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=bo(e,r,t),n!==null&&(Bd(n,e,t),xo(n,e,t))}function yh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function bh(e,t){yh(e,t),(e=e.alternate)&&yh(e,t)}function xh(e){if(e.tag===13||e.tag===31){var t=ki(e,67108864);t!==null&&Bd(t,e,67108864),bh(e,67108864)}}function Sh(e){if(e.tag===13||e.tag===31){var t=Ld();t=bt(t);var n=ki(e,t);n!==null&&Bd(n,e,t),bh(e,t)}}var Ch=!0;function wh(e,t,n,r){var i=j.T;j.T=null;var a=M.p;try{M.p=2,Eh(e,t,n,r)}finally{M.p=a,j.T=i}}function Th(e,t,n,r){var i=j.T;j.T=null;var a=M.p;try{M.p=8,Eh(e,t,n,r)}finally{M.p=a,j.T=i}}function Eh(e,t,n,r){if(Ch){var i=Dh(r);if(i===null)$f(e,t,r,Oh,n),zh(e,r);else if(Vh(i,e,t,n,r))r.stopPropagation();else if(zh(e,r),t&4&&-1<Rh.indexOf(e)){for(;i!==null;){var a=It(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=ct(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-tt(o);s.entanglements[1]|=c,o&=~c}Mf(a),!(z&6)&&(Sd=He()+500,Nf(0,!1))}}break;case 31:case 13:s=ki(a,2),s!==null&&Bd(s,a,2),Gd(),bh(a,2)}if(a=Dh(r),a===null&&$f(e,t,r,Oh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else $f(e,t,r,null,n)}}function Dh(e){return e=wn(e),kh(e)}var Oh=null;function kh(e){if(Oh=null,e=Ft(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Oh=e,null}function Ah(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`fullscreenerror`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Ue()){case We:return 2;case Ge:return 8;case Ke:case qe:return 32;case Je:return 268435456;default:return 32}default:return 32}}var jh=!1,Mh=null,Nh=null,Ph=null,Fh=new Map,Ih=new Map,Lh=[],Rh=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function zh(e,t){switch(e){case`focusin`:case`focusout`:Mh=null;break;case`dragenter`:case`dragleave`:Nh=null;break;case`mouseover`:case`mouseout`:Ph=null;break;case`pointerover`:case`pointerout`:Fh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Ih.delete(t.pointerId)}}function Bh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=It(t),t!==null&&xh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Vh(e,t,n,r,i){switch(t){case`focusin`:return Mh=Bh(Mh,e,t,n,r,i),!0;case`dragenter`:return Nh=Bh(Nh,e,t,n,r,i),!0;case`mouseover`:return Ph=Bh(Ph,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Fh.set(a,Bh(Fh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Ih.set(a,Bh(Ih.get(a)||null,e,t,n,r,i)),!0}return!1}function Hh(e){var t=Ft(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,Ct(e.priority,function(){Sh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,Ct(e.priority,function(){Sh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Uh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Dh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Cn=r,n.target.dispatchEvent(r),Cn=null}else return t=It(n),t!==null&&xh(t),e.blockedOn=n,!1;t.shift()}return!0}function Wh(e,t,n){Uh(e)&&n.delete(t)}function Gh(){jh=!1,Mh!==null&&Uh(Mh)&&(Mh=null),Nh!==null&&Uh(Nh)&&(Nh=null),Ph!==null&&Uh(Ph)&&(Ph=null),Fh.forEach(Wh),Ih.forEach(Wh)}function Kh(e,n){e.blockedOn===n&&(e.blockedOn=null,jh||(jh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Gh)))}var qh=null;function Jh(e){qh!==e&&(qh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){qh===e&&(qh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(kh(r||n)===null)continue;break}var a=It(n);a!==null&&(e.splice(t,3),t-=3,ic(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Yh(e){function t(t){return Kh(t,e)}Mh!==null&&Kh(Mh,e),Nh!==null&&Kh(Nh,e),Ph!==null&&Kh(Ph,e),Fh.forEach(t),Ih.forEach(t);for(var n=0;n<Lh.length;n++){var r=Lh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Lh.length&&(n=Lh[0],n.blockedOn===null);)Hh(n),n.blockedOn===null&&Lh.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[Et]||null;if(typeof a==`function`)o||Jh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[Et]||null)s=o.formAction;else if(kh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Jh(n)}}}function Xh(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Zh(e){this._internalRoot=e}Qh.prototype.render=Zh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;vh(n,Ld(),e,t,null,null)},Qh.prototype.unmount=Zh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;vh(e.current,2,null,e,null,null),Gd(),t[Dt]=null}};function Qh(e){this._internalRoot=e}Qh.prototype.unstable_scheduleHydration=function(e){if(e){var t=St();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Lh.length&&t!==0&&t<Lh[n].priority;n++);Lh.splice(n,0,e),n===0&&Hh(e)}};var $h=n.version;if($h!==`19.3.1`)throw Error(i(527,$h,`19.3.1`));M.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:d(e),e=e===null?null:e.stateNode,e};var eg={bundleType:0,version:`19.3.1`,rendererPackageName:`react-dom`,currentDispatcherRef:j,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var tg=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!tg.isDisabled&&tg.supportsFiber)try{Ze=tg.inject(eg),Qe=tg}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Dc,s=Oc,c=kc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=gh(e,1,!1,null,null,n,r,null,o,s,c,Xh),e[Dt]=t.current,Zf(e),new Zh(t)}})),xD=t(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=bD()}))(),SD={root:`selector`,definitions:`portable`,bindings:`portable`,player:`portable`,options:`portable`,routes:`portable`,foregroundSelector:`host`,screenShakeProfiles:`host`,canPlaceManually:`host`,recordingUiMode:`host`,shadowDom:`host`,hudMode:`host`,hudLinks:`host`},CD=Object.keys(SD),wD=Object.entries(SD).filter(([,e])=>e===`host`).map(([e])=>e),TD=class{root;report;isStopped;subscriptions=new Set;constructor(e,t,n){this.root=e,this.report=t,this.isStopped=n}on(e,t){if(this.isStopped())throw Error(`Playground is disposed`);let n=!0,r=r=>{let i=r.detail;if(e===`dispose`){if(n)try{t(i)}catch(e){this.report(e)}}else queueMicrotask(()=>{if(!this.isStopped()&&n)try{t(i)}catch(t){e!==`diagnostic`&&this.report(t)}})};this.root.addEventListener(`joyride:${e}`,r);let i=()=>{n=!1,this.root.removeEventListener(`joyride:${e}`,r),this.subscriptions.delete(i)};return this.subscriptions.add(i),i}emitDispose(){this.root.dispatchEvent(new CustomEvent(`joyride:dispose`))}emitStateChange(e){this.root.dispatchEvent(new CustomEvent(`joyride:state:change`,{bubbles:!0,detail:e}))}emitTourChange(e){this.root.dispatchEvent(new CustomEvent(`joyride:tour:change`,{bubbles:!0,detail:e}))}emitRecordingEnd(e){this.root.dispatchEvent(new CustomEvent(`joyride:recording:end`,{bubbles:!0,detail:e}))}clear(){for(let e of this.subscriptions)Sg(this.report,e);this.subscriptions.clear()}};function ED(e){let{settings:t,preset:n,recording:r,aiCars:i,popoverAnchor:a,popoverTab:o,selectedAiId:s,embedSettings:c,requestedMasterVolume:l,exportConfiguration:u}=e,d=c??Fe({...t,masterVolume:l}),f,p;if(a&&u)try{if(f=u(),c){let{format:e,version:n,...r}=f;f=ae({...r,options:Fe(le({...t,masterVolume:l},c))})}}catch(e){p=e instanceof Error?e.message:String(e)}return{settings:t,preset:n,recording:r,aiCars:i,popover:{anchor:a,tab:o,selectedAiId:s},exportedConfiguration:f,embed:{bookmarklet:a&&f?je(f):``,html:a&&f?Ie(f):``,async:a&&f?Be(f):``,npm:a&&f?we(f):``,error:p,configuration:d}}}function DD({options:e,registry:t,resources:n,getDrive:r,render:i,onDisposed:a}){let o=le(y,e.options??{}),s,c,l=new Promise((e,t)=>{s=e,c=t});l.catch(()=>{});let u=!1,d=new TD(t.root,e=>t.report(e),()=>u);n.own(()=>d.clear());let f=de.porsche911997,p=o.masterVolume,m=p>0;o={...o,masterVolume:0};let g=p||1,_={popoverAnchor:null,popoverTab:`vehicle`,selectedAiId:null},v=new MS;n.own(()=>v.detach());let b=new gt(e.recordingUiMode),x=new xy(f,{idleSound:o.idleSound,masterVolume:o.masterVolume});n.own(()=>x.stop());let S=()=>{if(u)throw Error(`Playground is disposed`);let e=r()?.getPlayground();if(!e)throw Error(`Playground is initializing; await ride.ready before issuing this command`);return e},C=e=>{_={..._,...e},i()},w=(e,t=e.masterVolume!==void 0)=>{if(u)throw Error(`Playground is disposed`);t&&(m=!1);let n=o.masterVolume<=0;o=le(o,Fe({...o,...e})),o.masterVolume>0&&(g=o.masterVolume),x.setMasterVolume(o.masterVolume),n&&o.masterVolume>0&&x.start(),x.setIdleSound(o.idleSound),i()},T=0,E=e=>{let n=Te(e);if(!n)return!1;let r=pe(e)||Ne(e)?t.registerVehiclePreset(`editor-${++T}`,n):e;return S().player?.update({vehicle:r}),i(),!0},D={ready:l,bind:(e,n)=>t.bind(e,n),inspect:e=>typeof e==`string`?t.objects.find(t=>t.id===e)??null:t.get(e)??null,on:(e,t)=>d.on(e,t),spawn:e=>S().spawn(e),pour:(e,t)=>S().pour(e,t),debris:(e,t)=>S().debris(e,t),route:(e,t)=>S().route(e,t),reset:()=>S().reset(),dispose(){u||(u=!0,Sg(e=>t.report(e),()=>d.emitDispose()),c(Error(`Playground disposed before initialization completed`)),n.dispose())},update(e){if(u)throw Error(`Playground is disposed`);w(le(o,e),e.audio?.masterVolume!==void 0)},get options(){return Fe({...o,masterVolume:m?g:o.masterVolume})},exportConfiguration(){let n=S(),r=wD.filter(t=>e[t]!==void 0).map(e=>({path:e,reason:`this host presentation override is not part of portable playground authoring`}));if(e.root instanceof Element&&r.push({path:`root`,reason:`use a selector root for portable configuration`}),r.length)throw new h(r);let i=n.player?.state,a=n.world.playerVehicle;return ae({root:typeof e.root==`string`?e.root:void 0,definitions:t.exportDefinitions(),player:i&&a?{vehicle:t.vehicleName(a.sim.car.preset.id),appearance:i.appearance,slots:i.slots}:void 0,bindings:t.exportBindings(),routes:n.zones.exportRoutes(),options:D.options})},openConfigure(){S();let e=r()?.getCarAnchor();return!e||u?!1:(C({popoverAnchor:e,popoverTab:`vehicle`,selectedAiId:null}),!0)},startAudio:()=>(S(),x.start()),async setSlowMo(e,t){await l,S(),r()?.setSlowMo(e,t)},getCarAnchor:()=>r()?.getCarAnchor()??null,async arriveAt(e){return await l,S(),r()?.arriveAt(e)??`unavailable`},async startTour(e,t){return await l,S(),r()?.startTour(e,t)??!1},stopTour:()=>{S(),r()?.stopTour()},getVehicle:e=>S().getVehicle(e),get player(){return S().player},get state(){let e=r()?.getPlayground();return u||!e?null:Object.freeze({playerId:e.world.playerVehicle?.id??null,focusVehicleId:e.world.cameraVehicle?.id??null,player:e.player?.state??null,points:e.world.points})},async driveVehicleTo(e,t,n){return await l,S(),r()?.driveVehicleTo(e,t,n)??!1},async tourVehicle(e,t,n){return await l,S(),r()?.tourVehicle(e,t,n)??!1},startRecording:()=>(S(),r()?.startRecording()??!1),stopRecording:()=>(S(),r()?.stopRecording()??null),async playRecording(e,t){let n;try{n=pt(e)}catch{return!1}return await l,S(),r()?.playRecording(n,t)??!1},stopPlayback:()=>{S(),r()?.stopPlayback()}};return{controller:D,events:d,aiFleet:v,recordingSession:b,audio:x,get stopped(){return u},get ui(){return _},presentation(){return ED({options:e,settings:o,preset:r()?.getPlayground()?.world.focusVehicle?.sim.car.preset??f,recording:b.state,aiCars:v.getSnapshot(),..._,requestedMasterVolume:_.embedSettings&&r()?.getPlayground()?D.options.audio.masterVolume:o.masterVolume,exportConfiguration:r()?.getPlayground()?()=>D.exportConfiguration():void 0})},applySettings:w,selectPreset:E,savePreset(e){Ue(e),E(e.id)},deletePreset(e){Le(e),E(pe(e)?de.porsche911997.id:e)},updateUi:C,toggleMute(){w({masterVolume:o.masterVolume>0?0:g})},onAudioInteraction(){m&&w({masterVolume:g})},openHudSettings(){let e=r()?.getCarAnchor();e&&C({popoverAnchor:e,popoverTab:`settings`,selectedAiId:null})},onReady(){try{e.player&&S().player?.update(e.player);for(let[t,n]of Object.entries(e.routes??{}))S().route(t,n);s(D),i()}catch(e){c(e),queueMicrotask(()=>D.dispose())}},onReactError(e){c(e),queueMicrotask(()=>D.dispose())},onRecordingEnd(e,t){b.setRecording(e),d.emitRecordingEnd({recording:e,reason:t})},onPlaybackEnd(){b.state.mode===`playing`&&b.setMode(`ready`)},onPlacementEnd(e){b.state.recording&&b.setPose(`custom`,e)},connect(){let e=()=>i();t.root.addEventListener(`joyride:vehicle:change`,e),n.own(()=>t.root.removeEventListener(`joyride:vehicle:change`,e)),n.own(b.subscribe(i)),n.own(()=>{u=!0,c(Error(`Playground disposed before initialization completed`)),a(D)})},attachAiWhenReady(){l.then(()=>{let e=r();!u&&e&&v.attach(e)}).catch(()=>{})}}}var OD=`[data-jr-arrive-to]`;function kD(e,t,n,r=()=>!0){let i=e.getAttribute(t);if(i===null)return n;let a=Number(i);if(!i.trim()||!Number.isFinite(a)||!r(a))throw TypeError(`${t} must be a valid number`);return a}function AD(e){let t=e.querySelector(OD);if(!t)return null;let n=kD(t,`data-jr-arrive-to-angle-rad`,0),r=kD(t,`data-jr-arrive-to-distance-px`,185,e=>e>0),i=kD(t,`data-jr-arrive-to-fade-fraction`,.5,e=>e>=0&&e<=1),a=kD(t,`data-jr-arrive-to-steer`,.04,e=>Math.abs(e)<=1),o=kD(t,`data-jr-arrive-to-delay-ms`,0,e=>e>=0),s=t.getAttribute(`data-jr-arrive-to-speed-mps`)===null?void 0:kD(t,`data-jr-arrive-to-speed-mps`,0,e=>e>0);return{target:t,delayMs:o,approach:{angleRad:n,distancePx:r,fadeFraction:i,...s?{initialSpeedMps:s}:{}},handbrake:{steer:a}}}function jD(e,t=Math.random){return{target:{xPx:e.scrollX+e.innerWidth/2,yPx:e.scrollY+e.innerHeight/2},approach:{angleRad:t()*Math.PI*2,distancePx:Math.min(185,Math.max(80,Math.min(e.innerWidth,e.innerHeight)*.4)),fadeFraction:.5},handbrake:{steer:.04}}}function MD(e,t,n){if(n.aborted)return Promise.resolve(!1);let r=Math.max(0,t+e-performance.now());return r===0?Promise.resolve(!0):new Promise(e=>{let t=t=>{clearTimeout(a),n.removeEventListener(`abort`,i),e(t)},i=()=>t(!1),a=setTimeout(()=>t(!0),r);n.addEventListener(`abort`,i,{once:!0})})}async function ND(e,t){let n=performance.now()+2e3,r=null;for(;!t();){let t=e.getBoundingClientRect(),i=e.isConnected&&t.width>0&&t.height>0&&t.left>=0&&t.top>=0&&t.right<=window.innerWidth&&t.bottom<=window.innerHeight&&getComputedStyle(e).visibility!==`hidden`;if(i&&r&&Math.abs(t.x-r.x)<2&&Math.abs(t.y-r.y)<2&&Math.abs(t.width-r.width)<2&&Math.abs(t.height-r.height)<2)return!0;if(r=i?t:null,performance.now()>=n)return!1;await new Promise(e=>requestAnimationFrame(()=>e()))}return!1}var PD=`modulepreload`,FD=function(e,t){return new URL(e,t).href},ID={},LD=function(e){return e.pathname.endsWith(`.css`)},RD=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},zD=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=FD(t,n);let r=s(t),i=LD(r);return RD(ID,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:PD,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{t.addEventListener(`load`,e),t.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${r}`)))})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},BD=rD(iD),VD=(0,Q.lazy)(()=>zD(()=>import(`./vehicle-popover-C0m9IGMZ.js`).then(e=>({default:e.VehiclePopover})),__vite__mapDeps([0,1,2,3,4]),import.meta.url)),HD,UD=()=>HD;function WD(e={}){let t=performance.now(),n=AD(document),{format:r,version:i,...a}=`format`in e?se(e):e,o=new Set(CD);for(let e of Object.keys(a))if(!o.has(e))throw TypeError(`Unknown mount option: ${e}`);let s=a;if(HD)throw Error(`JoyRide is already mounted. Dispose the current playground before mounting another.`);let c=typeof s.root==`string`?document.querySelector(s.root):s.root;if(s.root&&!c)throw Error(`Playground root did not match an element`);let l=new zS;try{let e=new We(c??document,s.definitions);if(l.own(()=>e.dispose()),s.player){let t=me(s.player);e.resolveVehicle(t.vehicle);for(let n of Object.values(t.slots??{}))n&&n.action===`eject`&&e.resolveLiquid(n.liquid)}let r=(0,Q.createRef)(),i=!0,a=()=>{},o=()=>{},u=DD({options:s,registry:e,resources:l,getDrive:()=>r.current,render:()=>o(),onDisposed:e=>{HD===e&&(HD=void 0)}}),{controller:d,events:f,aiFleet:p,recordingSession:m,audio:h}=u,g=document.createElement(`div`);l.own(()=>g.remove()),g.dataset.jrEmbed=``,g.style.display=`contents`;let _=s.shadowDom===!1?null:g.attachShadow({mode:`open`});if(_){let e=document.createElement(`style`);e.textContent=BD,_.append(e)}l.own(_?_D(g):()=>{}),document.body.append(g);let v=(0,xD.createRoot)(_??g,{onUncaughtError:e=>u.onReactError(e)});l.own(()=>v.unmount()),o=()=>{if(u.stopped)return;let t=u.presentation(),{preset:n,recording:c,popover:l}=t,g=gD(m,{driveRef:r,close:()=>u.updateUi({popoverAnchor:null})});v.render((0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(dD,{workMode:t.settings,showGithub:t.settings.showGithub,brandColor:t.settings.brandColor,brandName:t.settings.brandName,vehicleDestructible:t.settings.vehicleDestructible,weaponsEnabled:t.settings.weaponsEnabled,enabledTools:t.settings.enabledTools,ref:r,playground:e,initialArrivalPending:!0,onReady:e=>{i&&(a=()=>{i&&(i=!1,e.sim.paused=!1)}),u.onReady()},overlay:!0,overlayRoot:_??void 0,showHud:t.settings.showHud,showTotalPoints:t.settings.showTotalPoints,hudMode:s.hudMode,hudLinks:[{id:`hide`,label:`Hide`,ariaLabel:`Hide HUD`,onClick:()=>u.applySettings({showHud:!1})},...(s.hudLinks??[]).map(t=>({...t,onClick:()=>Sg(t=>e.report(t),t.onClick)}))],onHudConfigure:u.openHudSettings,mode:`car`,preset:n,canPlaceManually:s.canPlaceManually,audioEngine:h,paused:!!l.anchor,viewportWalls:t.settings.viewportWalls,viewportMode:t.settings.viewportMode,speedZoom:t.settings.speedZoom,lighting:t.settings.lighting,onLightingChange:e=>u.applySettings({lighting:e}),masterVolume:t.settings.masterVolume,onAudioInteraction:u.onAudioInteraction,onToggleMute:u.toggleMute,showToolbar:c.uiMode!==`record`||c.mode===`idle`,idleSound:t.settings.idleSound,quality:t.settings.quality,smokeTint:t.settings.smokeTint,sparks:t.settings.sparks,deform:t.settings.deform,screenShake:t.settings.screenShake,showHealthBars:t.settings.showHealthBars,showVehicleMarkers:t.settings.showVehicleMarkers,showWeaponBar:t.settings.showWeaponBar,weaponCooldown:t.settings.weaponCooldown,screenShakeProfiles:s.screenShakeProfiles,surfaceTone:t.settings.surfaceTone,debug:t.settings.debug,autoPaint:t.settings.autoPaint,bindings:s.bindings,foregroundSelector:s.foregroundSelector,rocketBlastStrength:t.settings.rocketBlastStrength,onCarClick:e=>{m.state.uiMode===`record`&&g.onExitPlayback(),u.updateUi({popoverAnchor:u.ui.popoverAnchor?null:e,popoverTab:`vehicle`,selectedAiId:null})},onCompanionClick:(e,t)=>u.updateUi({popoverAnchor:t,popoverTab:`ai`,selectedAiId:e}),onCompanionRemove:e=>{p.remove(e),u.updateUi(u.ui.selectedAiId===e?{selectedAiId:null,popoverAnchor:null}:{})},onStateChange:()=>f.emitStateChange(d.state),onTourStateChange:e=>f.emitTourChange(e),onRecordingEnd:u.onRecordingEnd,onRecordShortcut:g.onRecordShortcut,onPlaybackEnd:u.onPlaybackEnd,onPlacementEnd:u.onPlacementEnd,onExit:()=>{d.dispose()}}),c.uiMode===`record`&&(0,$.jsx)(pD,{mode:c.mode,showPath:c.showPath,driveRef:r,onTogglePath:g.onTogglePath,onStartRecord:g.onStartRecord,onStopRecord:g.onStopRecord,onPlay:g.onPlay,onStopPlayback:g.onStopPlayback,onDownload:g.onDownload,onDelete:g.onDelete,onExitPlayback:g.onExitPlayback}),c.uiMode===`record`&&(0,$.jsx)(mD,{snapshot:c,driveRef:r}),c.uiMode===`record`&&c.showPath&&c.mode===`playing`&&c.recording&&(0,$.jsx)(hD,{driveRef:r,durationMs:c.recording.durationMs}),l.anchor&&(0,$.jsx)(Q.Suspense,{fallback:null,children:(0,$.jsx)(VD,{objects:r.current?.getPlayground()?.objects,onDriveToObject:e=>{let t=r.current?.getPose()??null;u.updateUi({popoverAnchor:null}),requestAnimationFrame(()=>{e.scrollIntoView({block:`center`,inline:`center`,behavior:`instant`}),r.current?.arriveAt(Gw(e,t))})},...t.settings,preset:n,slots:d.player?.state.slots,presets:ge(),options:t.settings,initialTab:l.tab,embed:{...t.embed,onConfigure:e=>u.updateUi({embedSettings:e})},onSelectPreset:e=>u.selectPreset(e.id),onSavePreset:u.savePreset,onDeletePreset:u.deletePreset,onChange:e=>u.applySettings(e),onClose:()=>u.updateUi({popoverAnchor:null}),recording:g,ai:{cars:t.aiCars,selectedId:l.selectedAiId,onSelect:e=>u.updateUi({selectedAiId:e}),onSpawn:(e,t,n,r)=>{u.updateUi({selectedAiId:p.add(e,t,n,r).id})},onUpdate:(e,t)=>{p.update(e,t),o()},onRemove:e=>{p.remove(e),u.updateUi({selectedAiId:null})}},onReset:()=>r.current?.reset(),onQuit:()=>queueMicrotask(()=>d.dispose())})})]}))},u.connect(),HD=d,o(),u.attachAiWhenReady();let y=new AbortController;return l.own(()=>y.abort()),d.ready.then(async()=>{let e=n?await ND(n.target,()=>u.stopped):!1;if(u.stopped)return;let i=e?n:jD(window),o=await MD(i.delayMs??0,t,y.signal);if(u.stopped||!o)return;a();let s=r.current?.arriveAt({...i,delayMs:0});s?s.finally(()=>{u.stopped||r.current?.getPlayground()?.world.renderer.setVehicleArrivalOpacity(1)}):r.current?.getPlayground()?.world.renderer.setVehicleArrivalOpacity(1)}).catch(t=>{e.report(t),u.stopped||(a(),r.current?.getPlayground()?.world.renderer.setVehicleArrivalOpacity(1))}),d}catch(e){throw l.dispose(),e}}var GD={mount:WD,options:{presets:{sfw(e={}){return{...e,options:{...v,...e.options,policy:{...v.policy,...e.options?.policy},ui:{...v.ui,...e.options?.ui}}}}}},vehicleTools:n,availableVehicleTools:ne,overlayLayers:kf,overlayZIndex:Af,define:Ge,get active(){return UD()},listPresets:ge,listVehicleOptions:ze,getPreset:Te,keyboardControls:it};export{it as S,xy as _,rD as a,dn as b,XE as c,WE as d,zT as f,jS as g,cT as h,iD as i,YE as l,_T as m,zD as n,$E as o,mT as p,_D as r,QE as s,GD as t,GE as u,Wm as v,st as x,Af as y};
1252
+ `).replace(ap,``)}function sp(e,t){return t=op(t),op(e)===t}function cp(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||mn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&mn(e,``+r);else return;break;case`className`:Qt(e,`class`,r);break;case`tabIndex`:Qt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Qt(e,n,r);break;case`style`:_n(e,r,o);return;case`data`:if(t!==`object`){Qt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=xn(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&cp(e,t,`name`,a.name,a,null),cp(e,t,`formEncType`,a.formEncType,a,null),cp(e,t,`formMethod`,a.formMethod,a,null),cp(e,t,`formTarget`,a.formTarget,a,null)):(cp(e,t,`encType`,a.encType,a,null),cp(e,t,`method`,a.method,a,null),cp(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=xn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Sn);return;case`onScroll`:r!=null&&Jf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Jf(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=xn(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Jf(`beforetoggle`,e),Jf(`toggle`,e),Zt(e,`popover`,r);break;case`xlinkActuate`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:$t(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:$t(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:$t(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Zt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=yn.get(n)||n,Zt(e,n,r);else return}Yt=!0}function lp(e,t,n,r,a,o){switch(n){case`style`:_n(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)mn(e,r);else if(typeof r==`number`||typeof r==`bigint`)mn(e,``+r);else return;break;case`onScroll`:r!=null&&Jf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Jf(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=Sn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Ht.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[Et]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}Yt=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Zt(e,n,r)}return}Yt=!0}function up(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Jf(`error`,e),Jf(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:cp(e,t,o,s,n,null)}}a&&cp(e,t,`srcSet`,n.srcSet,n,null),r&&cp(e,t,`src`,n.src,n,null);return;case`input`:Jf(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:cp(e,t,r,d,n,null)}}ln(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Jf(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:cp(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&dn(e,!!r,n,!0):dn(e,!!r,t,!1);return;case`textarea`:for(s in Jf(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:cp(e,t,s,c,n,null)}pn(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:cp(e,t,l,r,n,null)}return;case`dialog`:Jf(`beforetoggle`,e),Jf(`toggle`,e),Jf(`cancel`,e),Jf(`close`,e);break;case`iframe`:case`object`:Jf(`load`,e);break;case`video`:case`audio`:for(r=0;r<Gf.length;r++)Jf(Gf[r],e);break;case`image`:Jf(`error`,e),Jf(`load`,e);break;case`details`:Jf(`toggle`,e);break;case`embed`:case`source`:case`link`:Jf(`error`,e),Jf(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:cp(e,t,u,r,n,null)}return;default:if(vn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&lp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&cp(e,t,c,r,n,null))}var dp={};function fp(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||cp(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(Yt=!0),o=m;break;case`name`:m!==f&&(Yt=!0),a=m;break;case`checked`:m!==f&&(Yt=!0),u=m;break;case`defaultChecked`:m!==f&&(Yt=!0),d=m;break;case`value`:m!==f&&(Yt=!0),s=m;break;case`defaultValue`:m!==f&&(Yt=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&cp(e,t,p,m,r,f)}}cn(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||cp(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:o!==l&&(Yt=!0),p=o;break;case`defaultValue`:o!==l&&(Yt=!0),c=o;break;case`multiple`:o!==l&&(Yt=!0),s=o;default:o!==l&&cp(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?dn(e,!!n,n?[]:``,!1):dn(e,!!n,t,!0)):dn(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:cp(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:a!==o&&(Yt=!0),p=a;break;case`defaultValue`:a!==o&&(Yt=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&cp(e,t,s,a,r,o)}fn(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:cp(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(Yt=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:cp(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&cp(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:cp(e,t,u,p,r,m)}return;default:if(vn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&lp(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||lp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&cp(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||cp(e,t,f,p,r,m)}function pp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function mp(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&pp(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&pp(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var hp=null,gp=null;function _p(e){return e.nodeType===9?e:e.ownerDocument}function vp(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function yp(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function bp(e,t,n,r){return n=_p(n).createElement(e),n[Tt]=r,n[Et]=t,up(n,e,t),zt(n),n}function xp(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Sp=null;function Cp(){var e=window.event;return e&&e.type===`popstate`?e!==Sp&&(Sp=e,!0):(Sp=null,!1)}var wp=typeof setTimeout==`function`?setTimeout:void 0,Tp=typeof clearTimeout==`function`?clearTimeout:void 0,Ep=typeof Promise==`function`?Promise:void 0,Dp=typeof requestAnimationFrame==`function`?requestAnimationFrame:wp,Op=typeof queueMicrotask==`function`?queueMicrotask:Ep===void 0?wp:function(e){return Ep.resolve(null).then(e).catch(kp)};function kp(e){setTimeout(function(){throw e})}function Ap(e){return e===`head`}function jp(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Yh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Tm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Tm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Mt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Tm(e.ownerDocument.body)}n=i}while(n);Yh(t)}function Mp(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function Np(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Pp(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Fp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Ip(e){return Fp(e.getBoundingClientRect(),getComputedStyle(e),e)}function Lp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Fp(t,n,e)}function Rp(e){return e.documentElement.clientHeight}function zp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Bp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Rp(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=rh(f),u>oh){s.length=o;break}f=new Promise(zp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Vp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Vp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:w({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Vp.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Vp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Hp(e){return{name:e,group:new Vp(`group`,e),imagePair:new Vp(`image-pair`,e),old:new Vp(`old`,e),new:new Vp(`new`,e)}}function Up(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Up.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Jp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Kp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),f(this._fragmentFiber.child,!1,Wp,e,s,r)}this._eventListeners=a}};function Wp(e,t,n,r){return _(e).addEventListener(t,n,r),!1}Up.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Jp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Kp(i.optionsOrUseCapture),f(this._fragmentFiber.child,!1,Gp,e,n,i),r.splice(t,1),a!==null&&a()}};function Gp(e,t,n,r){return _(e).removeEventListener(t,n,r),!1}function Kp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function qp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Jp(e,t,n,r){if(e.length===0)return-1;r=qp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&qp(a.optionsOrUseCapture)===r)return i}return-1}Up.prototype.dispatchEvent=function(e){var t=p(this._fragmentFiber);if(t===null)return!0;t=_(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Kp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Kp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Up.prototype.focus=function(e){f(this._fragmentFiber.child,!0,Yp,e,void 0,void 0)};function Yp(e,t){return e.tag!==6&&(e=_(e),xm(e,t))}Up.prototype.focusLast=function(e){var t=[];f(this._fragmentFiber.child,!0,Xp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Yp(t[n],e);n--);};function Xp(e,t){return t.push(e),!1}Up.prototype.blur=function(){var e=p(this._fragmentFiber);e!==null&&(e=_(e),e=_p(e).activeElement,e!==null&&f(this._fragmentFiber.child,!1,Zp,e,void 0,void 0))};function Zp(e,t){return e.tag!==6&&(e=_(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Up.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),f(this._fragmentFiber.child,!1,Qp,e,void 0,void 0)};function Qp(e,t){return e.tag===6||(e=_(e),t.observe(e)),!1}Up.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),f(this._fragmentFiber.child,!1,$p,e,void 0,void 0);for(var n=t=0;n<em.length;n++){var r=em[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):em[t++]=r}em.length=t}};function $p(e,t){return e.tag===6||(e=_(e),t.unobserve(e)),!1}var em=[],tm=!1;function nm(e,t,n){em.push({fragmentInstance:e,observer:t,instance:n}),tm||(tm=!0,Sm(function(){tm=!1;var e=em;em=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Up.prototype.getClientRects=function(){var e=[];return f(this._fragmentFiber.child,!1,rm,e,void 0,void 0),e};function rm(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=_(e),t.push.apply(t,e.getClientRects());return!1}Up.prototype.getRootNode=function(e){var t=p(this._fragmentFiber);return t===null?this:_(t).getRootNode(e)},Up.prototype.compareDocumentPosition=function(e){var t=p(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];f(this._fragmentFiber.child,!1,Xp,n,void 0,void 0);var r=_(t);if(n.length===0){if(n=r,m(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=h(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=_(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=_(n[0]),i=_(n[n.length-1]);var a=m(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||im(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function im(e,t,n,r,i){var a=Ft(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=p(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=C(n,a,S),t===null?t=!1:(f(t,!0,b,a,n),a=v,v=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=C(r,a,S),t===null?t=!1:(f(t,!0,x,a,r),a=v,y=v=null,t=a!==null)),t):!1}function am(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Up.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];f(this._fragmentFiber.child,!1,Xp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=h(this._fragmentFiber);if(r=n?r[1]||r[0]||p(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=_(r),am(e,n);return}if(r=_(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=_(a),am(a,n)):_(a).scrollIntoView(e),r+=n?-1:1}};function om(e,t){return e=_(e),sm(e,t),!1}function sm(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function cm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Kp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<em.length;i++){var a=em[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(em[r++]=a)}em.length=r,n.observe(e)}),sm(e,t))}function lm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Kp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?nm(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function um(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:um(n),Pt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function dm(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[Mt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=_m(e.nextSibling),e===null)break}return null}function fm(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=_m(e.nextSibling),e===null))return null;return e}function pm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=_m(e.nextSibling),e===null))return null;return e}function mm(e){return e.data===`$?`||e.data===`$~`}function hm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function gm(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function _m(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var vm=null;function ym(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return _m(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function bm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function xm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function Sm(e){Dp(function(){Dp(function(t){return e(t)})})}function Cm(e,t,n){switch(t=_p(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function wm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&cp(e,t,r,null,dp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===Sn&&(e.onclick=null),Pt(e)}function Tm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Pt(e)}var Em=new Map,Dm=new Set;function Om(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var km=M.d;M.d={f:Am,r:jm,D:Pm,C:Fm,L:Im,m:Lm,X:zm,S:Rm,M:Bm};function Am(){var e=km.f(),t=Gd();return e||t}function jm(e){var t=It(e);t!==null&&t.tag===5&&t.type===`form`?oc(t):km.r(e)}var Mm=typeof document>`u`?null:document;function Nm(e,t,n){var r=Mm;if(r&&typeof t==`string`&&t){var i=sn(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Dm.has(i)||(Dm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),up(t,`link`,e),zt(t),r.head.appendChild(t)))}}function Pm(e){km.D(e),Nm(`dns-prefetch`,e,null)}function Fm(e,t){km.C(e,t),Nm(`preconnect`,e,t)}function Im(e,t,n){km.L(e,t,n);var r=Mm;if(r&&e&&t){var i=`link[rel="preload"][as="`+sn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+sn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+sn(n.imageSizes)+`"]`)):i+=`[href="`+sn(e)+`"]`;var a=i;switch(t){case`style`:a=Hm(e);break;case`script`:a=Km(e)}if(!(Em.has(a)||(e=w({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Em.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Um(a))||t===`script`&&r.querySelector(qm(a))))){var o=r.createElement(`link`);up(o,`link`,e),t===`style`&&(o[Nt]=!0,o.onload=o.onerror=function(){Bt(o)}),zt(o),r.head.appendChild(o)}}}function Lm(e,t){km.m(e,t);var n=Mm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+sn(r)+`"][href="`+sn(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Km(e)}if(!Em.has(a)&&(e=w({rel:`modulepreload`,href:e},t),Em.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(qm(a)))return}r=n.createElement(`link`),up(r,`link`,e),zt(r),n.head.appendChild(r)}}}function Rm(e,t,n){km.S(e,t,n);var r=Mm;if(r&&e){var i=Rt(r).hoistableStyles,a=Hm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Um(a)))s.loading=5;else{e=w({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Em.get(a))&&Xm(e,n);var c=o=r.createElement(`link`);zt(c),up(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Ym(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function zm(e,t){km.X(e,t);var n=Mm;if(n&&e){var r=Rt(n).hoistableScripts,i=Km(e),a=r.get(i);a||(a=n.querySelector(qm(i)),a||(e=w({src:e,async:!0},t),(t=Em.get(i))&&Zm(e,t),a=n.createElement(`script`),zt(a),up(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Bm(e,t){km.M(e,t);var n=Mm;if(n&&e){var r=Rt(n).hoistableScripts,i=Km(e),a=r.get(i);a||(a=n.querySelector(qm(i)),a||(e=w({src:e,async:!0,type:`module`},t),(t=Em.get(i))&&Zm(e,t),a=n.createElement(`script`),zt(a),up(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Vm(e,t,n,r){var a=(a=Te.current)?Om(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Hm(n.href),t=Rt(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Hm(n.href);var o=Rt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Um(e)))?o._p||(s.instance=o,s.state.loading=5):(o=Em.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Em.set(e,o)),Gm(a,e,o,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Km(n),t=Rt(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Hm(e){return`href="`+sn(e)+`"`}function Um(e){return`link[rel="stylesheet"][`+e+`]`}function Wm(e){return w({},e,{"data-precedence":e.precedence,precedence:null})}function Gm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Nt]){r.loading=1;return}}else t=e.createElement(`link`),t[Nt]=!0,t.onload=t.onerror=Bt.bind(null,t),up(t,`link`,n),zt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Km(e){return`[src="`+sn(e)+`"]`}function qm(e){return`script[async]`+e}function Jm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+sn(n.href)+`"]`);if(r)return t.instance=r,zt(r),r;var a=w({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),zt(r),up(r,`style`,a),Ym(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Hm(n.href);var o=e.querySelector(Um(a));if(o)return t.state.loading|=4,t.instance=o,zt(o),o;r=Wm(n),(a=Em.get(a))&&Xm(r,a),o=(e.ownerDocument||e).createElement(`link`),zt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),up(o,`link`,r),t.state.loading|=4,Ym(o,n.precedence,e),t.instance=o;case`script`:return o=Km(n.src),(a=e.querySelector(qm(o)))?(t.instance=a,zt(a),a):(r=n,(a=Em.get(o))&&(r=w({},n),Zm(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),zt(a),up(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Ym(r,n.precedence,e));return t.instance}function Ym(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Xm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Zm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Qm=null;function W(e,t,n){if(Qm===null){var r=new Map,i=Qm=new Map;i.set(n,r)}else i=Qm,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[Mt]||a[Tt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function $m(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function eh(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function th(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function nh(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function rh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function ih(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=rh(t),e.suspenseyImages.push(t)),e=uh.bind(e),t.decode().then(e,e))}function ah(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Hm(r.href),a=t.querySelector(Um(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=lh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,zt(a);return}a=t.ownerDocument||t,r=Wm(r),(i=Em.get(i))&&Xm(r,i),a=a.createElement(`link`),zt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),up(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=lh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var oh=0;function sh(e,t){return e.stylesheets&&e.count===0&&fh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&fh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&oh===0&&(oh=62500*mp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&fh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>oh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function ch(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)fh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function lh(){this.count--,ch(this)}function uh(){this.imgCount--,ch(this)}var dh=null;function fh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,dh=new Map,t.forEach(ph,e),dh=null,lh.call(e))}function ph(e,t){if(!(t.state.loading&4)){var n=dh.get(e);if(n)var r=n.get(null);else{n=new Map,dh.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=lh.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var mh={$$typeof:O,Provider:null,Consumer:null,_currentValue:_e,_currentValue2:_e,_threadCount:0};function hh(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=mt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=mt(0),this.hiddenUpdates=mt(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function gh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new hh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Pi(3,null,null,t),e.current=a,a.stateNode=e,t=Pa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},_o(a),e}function _h(e){return e?(e=Mi,e):Mi}function vh(e,t,n,r,i,a){i=_h(i),r.context===null?r.context=i:r.pendingContext=i,r=yo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=bo(e,r,t),n!==null&&(Bd(n,e,t),xo(n,e,t))}function yh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function bh(e,t){yh(e,t),(e=e.alternate)&&yh(e,t)}function xh(e){if(e.tag===13||e.tag===31){var t=ki(e,67108864);t!==null&&Bd(t,e,67108864),bh(e,67108864)}}function Sh(e){if(e.tag===13||e.tag===31){var t=Ld();t=bt(t);var n=ki(e,t);n!==null&&Bd(n,e,t),bh(e,t)}}var Ch=!0;function wh(e,t,n,r){var i=j.T;j.T=null;var a=M.p;try{M.p=2,Eh(e,t,n,r)}finally{M.p=a,j.T=i}}function Th(e,t,n,r){var i=j.T;j.T=null;var a=M.p;try{M.p=8,Eh(e,t,n,r)}finally{M.p=a,j.T=i}}function Eh(e,t,n,r){if(Ch){var i=Dh(r);if(i===null)$f(e,t,r,Oh,n),zh(e,r);else if(Vh(i,e,t,n,r))r.stopPropagation();else if(zh(e,r),t&4&&-1<Rh.indexOf(e)){for(;i!==null;){var a=It(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=ct(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-tt(o);s.entanglements[1]|=c,o&=~c}Mf(a),!(z&6)&&(Sd=He()+500,Nf(0,!1))}}break;case 31:case 13:s=ki(a,2),s!==null&&Bd(s,a,2),Gd(),bh(a,2)}if(a=Dh(r),a===null&&$f(e,t,r,Oh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else $f(e,t,r,null,n)}}function Dh(e){return e=wn(e),kh(e)}var Oh=null;function kh(e){if(Oh=null,e=Ft(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Oh=e,null}function Ah(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`fullscreenerror`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Ue()){case We:return 2;case Ge:return 8;case Ke:case qe:return 32;case Je:return 268435456;default:return 32}default:return 32}}var jh=!1,Mh=null,Nh=null,Ph=null,Fh=new Map,Ih=new Map,Lh=[],Rh=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function zh(e,t){switch(e){case`focusin`:case`focusout`:Mh=null;break;case`dragenter`:case`dragleave`:Nh=null;break;case`mouseover`:case`mouseout`:Ph=null;break;case`pointerover`:case`pointerout`:Fh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Ih.delete(t.pointerId)}}function Bh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=It(t),t!==null&&xh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Vh(e,t,n,r,i){switch(t){case`focusin`:return Mh=Bh(Mh,e,t,n,r,i),!0;case`dragenter`:return Nh=Bh(Nh,e,t,n,r,i),!0;case`mouseover`:return Ph=Bh(Ph,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Fh.set(a,Bh(Fh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Ih.set(a,Bh(Ih.get(a)||null,e,t,n,r,i)),!0}return!1}function Hh(e){var t=Ft(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,Ct(e.priority,function(){Sh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,Ct(e.priority,function(){Sh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Uh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Dh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Cn=r,n.target.dispatchEvent(r),Cn=null}else return t=It(n),t!==null&&xh(t),e.blockedOn=n,!1;t.shift()}return!0}function Wh(e,t,n){Uh(e)&&n.delete(t)}function Gh(){jh=!1,Mh!==null&&Uh(Mh)&&(Mh=null),Nh!==null&&Uh(Nh)&&(Nh=null),Ph!==null&&Uh(Ph)&&(Ph=null),Fh.forEach(Wh),Ih.forEach(Wh)}function Kh(e,n){e.blockedOn===n&&(e.blockedOn=null,jh||(jh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Gh)))}var qh=null;function Jh(e){qh!==e&&(qh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){qh===e&&(qh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(kh(r||n)===null)continue;break}var a=It(n);a!==null&&(e.splice(t,3),t-=3,ic(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Yh(e){function t(t){return Kh(t,e)}Mh!==null&&Kh(Mh,e),Nh!==null&&Kh(Nh,e),Ph!==null&&Kh(Ph,e),Fh.forEach(t),Ih.forEach(t);for(var n=0;n<Lh.length;n++){var r=Lh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Lh.length&&(n=Lh[0],n.blockedOn===null);)Hh(n),n.blockedOn===null&&Lh.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[Et]||null;if(typeof a==`function`)o||Jh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[Et]||null)s=o.formAction;else if(kh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Jh(n)}}}function Xh(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Zh(e){this._internalRoot=e}Qh.prototype.render=Zh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;vh(n,Ld(),e,t,null,null)},Qh.prototype.unmount=Zh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;vh(e.current,2,null,e,null,null),Gd(),t[Dt]=null}};function Qh(e){this._internalRoot=e}Qh.prototype.unstable_scheduleHydration=function(e){if(e){var t=St();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Lh.length&&t!==0&&t<Lh[n].priority;n++);Lh.splice(n,0,e),n===0&&Hh(e)}};var $h=n.version;if($h!==`19.3.1`)throw Error(i(527,$h,`19.3.1`));M.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:d(e),e=e===null?null:e.stateNode,e};var eg={bundleType:0,version:`19.3.1`,rendererPackageName:`react-dom`,currentDispatcherRef:j,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var tg=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!tg.isDisabled&&tg.supportsFiber)try{Ze=tg.inject(eg),Qe=tg}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Dc,s=Oc,c=kc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=gh(e,1,!1,null,null,n,r,null,o,s,c,Xh),e[Dt]=t.current,Zf(e),new Zh(t)}})),xD=t(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=bD()}))(),SD={root:`selector`,definitions:`portable`,bindings:`portable`,player:`portable`,options:`portable`,routes:`portable`,foregroundSelector:`host`,screenShakeProfiles:`host`,canPlaceManually:`host`,recordingUiMode:`host`,shadowDom:`host`,hudMode:`host`,hudLinks:`host`},CD=Object.keys(SD),wD=Object.entries(SD).filter(([,e])=>e===`host`).map(([e])=>e),TD=class{root;report;isStopped;subscriptions=new Set;constructor(e,t,n){this.root=e,this.report=t,this.isStopped=n}on(e,t){if(this.isStopped())throw Error(`Playground is disposed`);let n=!0,r=r=>{let i=r.detail;if(e===`dispose`){if(n)try{t(i)}catch(e){this.report(e)}}else queueMicrotask(()=>{if(!this.isStopped()&&n)try{t(i)}catch(t){e!==`diagnostic`&&this.report(t)}})};this.root.addEventListener(`joyride:${e}`,r);let i=()=>{n=!1,this.root.removeEventListener(`joyride:${e}`,r),this.subscriptions.delete(i)};return this.subscriptions.add(i),i}emitDispose(){this.root.dispatchEvent(new CustomEvent(`joyride:dispose`))}emitStateChange(e){this.root.dispatchEvent(new CustomEvent(`joyride:state:change`,{bubbles:!0,detail:e}))}emitTourChange(e){this.root.dispatchEvent(new CustomEvent(`joyride:tour:change`,{bubbles:!0,detail:e}))}emitRecordingEnd(e){this.root.dispatchEvent(new CustomEvent(`joyride:recording:end`,{bubbles:!0,detail:e}))}clear(){for(let e of this.subscriptions)Sg(this.report,e);this.subscriptions.clear()}};function ED(e){let{settings:t,preset:n,recording:r,aiCars:i,popoverAnchor:a,popoverTab:o,selectedAiId:s,embedSettings:c,requestedMasterVolume:l,exportConfiguration:u}=e,d=c??Fe({...t,masterVolume:l}),f,p;if(a&&u)try{if(f=u(),c){let{format:e,version:n,...r}=f;f=ae({...r,options:Fe(le({...t,masterVolume:l},c))})}}catch(e){p=e instanceof Error?e.message:String(e)}return{settings:t,preset:n,recording:r,aiCars:i,popover:{anchor:a,tab:o,selectedAiId:s},exportedConfiguration:f,embed:{bookmarklet:a&&f?je(f):``,html:a&&f?Ie(f):``,async:a&&f?Be(f):``,npm:a&&f?we(f):``,error:p,configuration:d}}}function DD({options:e,registry:t,resources:n,getDrive:r,render:i,onDisposed:a}){let o=le(y,e.options??{}),s,c,l=new Promise((e,t)=>{s=e,c=t});l.catch(()=>{});let u=!1,d=new TD(t.root,e=>t.report(e),()=>u);n.own(()=>d.clear());let f=de.porsche911997,p=o.masterVolume,m=p>0;o={...o,masterVolume:0};let g=p||1,_={popoverAnchor:null,popoverTab:`vehicle`,selectedAiId:null},v=new MS;n.own(()=>v.detach());let b=new gt(e.recordingUiMode),x=new xy(f,{idleSound:o.idleSound,masterVolume:o.masterVolume});n.own(()=>x.stop());let S=()=>{if(u)throw Error(`Playground is disposed`);let e=r()?.getPlayground();if(!e)throw Error(`Playground is initializing; await ride.ready before issuing this command`);return e},C=e=>{_={..._,...e},i()},w=(e,t=e.masterVolume!==void 0)=>{if(u)throw Error(`Playground is disposed`);t&&(m=!1);let n=o.masterVolume<=0;o=le(o,Fe({...o,...e})),o.masterVolume>0&&(g=o.masterVolume),x.setMasterVolume(o.masterVolume),n&&o.masterVolume>0&&x.start(),x.setIdleSound(o.idleSound),i()},T=0,E=e=>{let n=Te(e);if(!n)return!1;let r=pe(e)||Ne(e)?t.registerVehiclePreset(`editor-${++T}`,n):e;return S().player?.update({vehicle:r}),i(),!0},D={ready:l,bind:(e,n)=>t.bind(e,n),inspect:e=>typeof e==`string`?t.objects.find(t=>t.id===e)??null:t.get(e)??null,on:(e,t)=>d.on(e,t),spawn:e=>S().spawn(e),pour:(e,t)=>S().pour(e,t),debris:(e,t)=>S().debris(e,t),route:(e,t)=>S().route(e,t),reset:()=>S().reset(),dispose(){u||(u=!0,Sg(e=>t.report(e),()=>d.emitDispose()),c(Error(`Playground disposed before initialization completed`)),n.dispose())},update(e){if(u)throw Error(`Playground is disposed`);w(le(o,e),e.audio?.masterVolume!==void 0)},get options(){return Fe({...o,masterVolume:m?g:o.masterVolume})},exportConfiguration(){let n=S(),r=wD.filter(t=>e[t]!==void 0).map(e=>({path:e,reason:`this host presentation override is not part of portable playground authoring`}));if(e.root instanceof Element&&r.push({path:`root`,reason:`use a selector root for portable configuration`}),r.length)throw new h(r);let i=n.player?.state,a=n.world.playerVehicle;return ae({root:typeof e.root==`string`?e.root:void 0,definitions:t.exportDefinitions(),player:i&&a?{vehicle:t.vehicleName(a.sim.car.preset.id),appearance:i.appearance,slots:i.slots}:void 0,bindings:t.exportBindings(),routes:n.zones.exportRoutes(),options:D.options})},openConfigure(){S();let e=r()?.getCarAnchor();return!e||u?!1:(C({popoverAnchor:e,popoverTab:`vehicle`,selectedAiId:null}),!0)},startAudio:()=>(S(),x.start()),async setSlowMo(e,t){await l,S(),r()?.setSlowMo(e,t)},getCarAnchor:()=>r()?.getCarAnchor()??null,async arriveAt(e){return await l,S(),r()?.arriveAt(e)??`unavailable`},async startTour(e,t){return await l,S(),r()?.startTour(e,t)??!1},stopTour:()=>{S(),r()?.stopTour()},getVehicle:e=>S().getVehicle(e),get player(){return S().player},get state(){let e=r()?.getPlayground();return u||!e?null:Object.freeze({playerId:e.world.playerVehicle?.id??null,focusVehicleId:e.world.cameraVehicle?.id??null,player:e.player?.state??null,points:e.world.points})},async driveVehicleTo(e,t,n){return await l,S(),r()?.driveVehicleTo(e,t,n)??!1},async tourVehicle(e,t,n){return await l,S(),r()?.tourVehicle(e,t,n)??!1},startRecording:()=>(S(),r()?.startRecording()??!1),stopRecording:()=>(S(),r()?.stopRecording()??null),async playRecording(e,t){let n;try{n=pt(e)}catch{return!1}return await l,S(),r()?.playRecording(n,t)??!1},stopPlayback:()=>{S(),r()?.stopPlayback()}};return{controller:D,events:d,aiFleet:v,recordingSession:b,audio:x,get stopped(){return u},get ui(){return _},presentation(){return ED({options:e,settings:o,preset:r()?.getPlayground()?.world.focusVehicle?.sim.car.preset??f,recording:b.state,aiCars:v.getSnapshot(),..._,requestedMasterVolume:_.embedSettings&&r()?.getPlayground()?D.options.audio.masterVolume:o.masterVolume,exportConfiguration:r()?.getPlayground()?()=>D.exportConfiguration():void 0})},applySettings:w,selectPreset:E,savePreset(e){Ue(e),E(e.id)},deletePreset(e){Le(e),E(pe(e)?de.porsche911997.id:e)},updateUi:C,toggleMute(){w({masterVolume:o.masterVolume>0?0:g})},onAudioInteraction(){m&&w({masterVolume:g})},openHudSettings(){let e=r()?.getCarAnchor();e&&C({popoverAnchor:e,popoverTab:`settings`,selectedAiId:null})},onReady(){try{e.player&&S().player?.update(e.player);for(let[t,n]of Object.entries(e.routes??{}))S().route(t,n);s(D),i()}catch(e){c(e),queueMicrotask(()=>D.dispose())}},onReactError(e){c(e),queueMicrotask(()=>D.dispose())},onRecordingEnd(e,t){b.setRecording(e),d.emitRecordingEnd({recording:e,reason:t})},onPlaybackEnd(){b.state.mode===`playing`&&b.setMode(`ready`)},onPlacementEnd(e){b.state.recording&&b.setPose(`custom`,e)},connect(){let e=()=>i();t.root.addEventListener(`joyride:vehicle:change`,e),n.own(()=>t.root.removeEventListener(`joyride:vehicle:change`,e)),n.own(b.subscribe(i)),n.own(()=>{u=!0,c(Error(`Playground disposed before initialization completed`)),a(D)})},attachAiWhenReady(){l.then(()=>{let e=r();!u&&e&&v.attach(e)}).catch(()=>{})}}}var OD=`[data-jr-arrive-to]`;function kD(e,t,n,r=()=>!0){let i=e.getAttribute(t);if(i===null)return n;let a=Number(i);if(!i.trim()||!Number.isFinite(a)||!r(a))throw TypeError(`${t} must be a valid number`);return a}function AD(e){let t=e.querySelector(OD);if(!t)return null;let n=kD(t,`data-jr-arrive-to-angle-rad`,0),r=kD(t,`data-jr-arrive-to-distance-px`,185,e=>e>0),i=kD(t,`data-jr-arrive-to-fade-fraction`,.5,e=>e>=0&&e<=1),a=kD(t,`data-jr-arrive-to-steer`,.04,e=>Math.abs(e)<=1),o=kD(t,`data-jr-arrive-to-delay-ms`,0,e=>e>=0),s=t.getAttribute(`data-jr-arrive-to-speed-mps`)===null?void 0:kD(t,`data-jr-arrive-to-speed-mps`,0,e=>e>0);return{target:t,delayMs:o,approach:{angleRad:n,distancePx:r,fadeFraction:i,...s?{initialSpeedMps:s}:{}},handbrake:{steer:a}}}function jD(e,t=Math.random){return{target:{xPx:e.scrollX+e.innerWidth/2,yPx:e.scrollY+e.innerHeight/2},approach:{angleRad:t()*Math.PI*2,distancePx:Math.min(185,Math.max(80,Math.min(e.innerWidth,e.innerHeight)*.4)),fadeFraction:.5},handbrake:{steer:.04}}}function MD(e,t,n){if(n.aborted)return Promise.resolve(!1);let r=Math.max(0,t+e-performance.now());return r===0?Promise.resolve(!0):new Promise(e=>{let t=t=>{clearTimeout(a),n.removeEventListener(`abort`,i),e(t)},i=()=>t(!1),a=setTimeout(()=>t(!0),r);n.addEventListener(`abort`,i,{once:!0})})}async function ND(e,t){let n=performance.now()+2e3,r=null;for(;!t();){let t=e.getBoundingClientRect(),i=e.isConnected&&t.width>0&&t.height>0&&t.left>=0&&t.top>=0&&t.right<=window.innerWidth&&t.bottom<=window.innerHeight&&getComputedStyle(e).visibility!==`hidden`;if(i&&r&&Math.abs(t.x-r.x)<2&&Math.abs(t.y-r.y)<2&&Math.abs(t.width-r.width)<2&&Math.abs(t.height-r.height)<2)return!0;if(r=i?t:null,performance.now()>=n)return!1;await new Promise(e=>requestAnimationFrame(()=>e()))}return!1}var PD=`modulepreload`,FD=function(e,t){return new URL(e,t).href},ID={},LD=function(e){return e.pathname.endsWith(`.css`)},RD=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},zD=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=FD(t,n);let r=s(t),i=LD(r);return RD(ID,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:PD,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{t.addEventListener(`load`,e),t.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${r}`)))})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},BD=rD(iD),VD=(0,Q.lazy)(()=>zD(()=>import(`./vehicle-popover-CPOB9Lo3.js`).then(e=>({default:e.VehiclePopover})),__vite__mapDeps([0,1,2,3,4]),import.meta.url)),HD,UD=()=>HD;function WD(e={}){let t=performance.now(),n=AD(document),{format:r,version:i,...a}=`format`in e?se(e):e,o=new Set(CD);for(let e of Object.keys(a))if(!o.has(e))throw TypeError(`Unknown mount option: ${e}`);let s=a;if(HD)throw Error(`JoyRide is already mounted. Dispose the current playground before mounting another.`);let c=typeof s.root==`string`?document.querySelector(s.root):s.root;if(s.root&&!c)throw Error(`Playground root did not match an element`);let l=new zS;try{let e=new We(c??document,s.definitions);if(l.own(()=>e.dispose()),s.player){let t=me(s.player);e.resolveVehicle(t.vehicle);for(let n of Object.values(t.slots??{}))n&&n.action===`eject`&&e.resolveLiquid(n.liquid)}let r=(0,Q.createRef)(),i=!0,a=()=>{},o=()=>{},u=DD({options:s,registry:e,resources:l,getDrive:()=>r.current,render:()=>o(),onDisposed:e=>{HD===e&&(HD=void 0)}}),{controller:d,events:f,aiFleet:p,recordingSession:m,audio:h}=u,g=document.createElement(`div`);l.own(()=>g.remove()),g.dataset.jrEmbed=``,g.style.display=`contents`;let _=s.shadowDom===!1?null:g.attachShadow({mode:`open`});if(_){let e=document.createElement(`style`);e.textContent=BD,_.append(e)}l.own(_?_D(g):()=>{}),document.body.append(g);let v=(0,xD.createRoot)(_??g,{onUncaughtError:e=>u.onReactError(e)});l.own(()=>v.unmount()),o=()=>{if(u.stopped)return;let t=u.presentation(),{preset:n,recording:c,popover:l}=t,g=gD(m,{driveRef:r,close:()=>u.updateUi({popoverAnchor:null})});v.render((0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(dD,{workMode:t.settings,showGithub:t.settings.showGithub,brandColor:t.settings.brandColor,brandName:t.settings.brandName,vehicleDestructible:t.settings.vehicleDestructible,weaponsEnabled:t.settings.weaponsEnabled,enabledTools:t.settings.enabledTools,ref:r,playground:e,initialArrivalPending:!0,onReady:e=>{i&&(a=()=>{i&&(i=!1,e.sim.paused=!1)}),u.onReady()},overlay:!0,overlayRoot:_??void 0,showHud:t.settings.showHud,showTotalPoints:t.settings.showTotalPoints,hudMode:s.hudMode,hudLinks:[{id:`hide`,label:`Hide`,ariaLabel:`Hide HUD`,onClick:()=>u.applySettings({showHud:!1})},...(s.hudLinks??[]).map(t=>({...t,onClick:()=>Sg(t=>e.report(t),t.onClick)}))],onHudConfigure:u.openHudSettings,mode:`car`,preset:n,canPlaceManually:s.canPlaceManually,audioEngine:h,paused:!!l.anchor,viewportWalls:t.settings.viewportWalls,viewportMode:t.settings.viewportMode,speedZoom:t.settings.speedZoom,lighting:t.settings.lighting,onLightingChange:e=>u.applySettings({lighting:e}),masterVolume:t.settings.masterVolume,onAudioInteraction:u.onAudioInteraction,onToggleMute:u.toggleMute,showToolbar:c.uiMode!==`record`||c.mode===`idle`,idleSound:t.settings.idleSound,quality:t.settings.quality,smokeTint:t.settings.smokeTint,sparks:t.settings.sparks,deform:t.settings.deform,screenShake:t.settings.screenShake,showHealthBars:t.settings.showHealthBars,showVehicleMarkers:t.settings.showVehicleMarkers,showWeaponBar:t.settings.showWeaponBar,weaponCooldown:t.settings.weaponCooldown,screenShakeProfiles:s.screenShakeProfiles,surfaceTone:t.settings.surfaceTone,debug:t.settings.debug,autoPaint:t.settings.autoPaint,bindings:s.bindings,foregroundSelector:s.foregroundSelector,rocketBlastStrength:t.settings.rocketBlastStrength,onCarClick:e=>{m.state.uiMode===`record`&&g.onExitPlayback(),u.updateUi({popoverAnchor:u.ui.popoverAnchor?null:e,popoverTab:`vehicle`,selectedAiId:null})},onCompanionClick:(e,t)=>u.updateUi({popoverAnchor:t,popoverTab:`ai`,selectedAiId:e}),onCompanionRemove:e=>{p.remove(e),u.updateUi(u.ui.selectedAiId===e?{selectedAiId:null,popoverAnchor:null}:{})},onStateChange:()=>f.emitStateChange(d.state),onTourStateChange:e=>f.emitTourChange(e),onRecordingEnd:u.onRecordingEnd,onRecordShortcut:g.onRecordShortcut,onPlaybackEnd:u.onPlaybackEnd,onPlacementEnd:u.onPlacementEnd,onExit:()=>{d.dispose()}}),c.uiMode===`record`&&(0,$.jsx)(pD,{mode:c.mode,showPath:c.showPath,driveRef:r,onTogglePath:g.onTogglePath,onStartRecord:g.onStartRecord,onStopRecord:g.onStopRecord,onPlay:g.onPlay,onStopPlayback:g.onStopPlayback,onDownload:g.onDownload,onDelete:g.onDelete,onExitPlayback:g.onExitPlayback}),c.uiMode===`record`&&(0,$.jsx)(mD,{snapshot:c,driveRef:r}),c.uiMode===`record`&&c.showPath&&c.mode===`playing`&&c.recording&&(0,$.jsx)(hD,{driveRef:r,durationMs:c.recording.durationMs}),l.anchor&&(0,$.jsx)(Q.Suspense,{fallback:null,children:(0,$.jsx)(VD,{objects:r.current?.getPlayground()?.objects,onDriveToObject:e=>{let t=r.current?.getPose()??null;u.updateUi({popoverAnchor:null}),requestAnimationFrame(()=>{e.scrollIntoView({block:`center`,inline:`center`,behavior:`instant`}),r.current?.arriveAt(Gw(e,t))})},...t.settings,preset:n,slots:d.player?.state.slots,presets:ge(),options:t.settings,initialTab:l.tab,embed:{...t.embed,onConfigure:e=>u.updateUi({embedSettings:e})},onSelectPreset:e=>u.selectPreset(e.id),onSavePreset:u.savePreset,onDeletePreset:u.deletePreset,onChange:e=>u.applySettings(e),onClose:()=>u.updateUi({popoverAnchor:null}),recording:g,ai:{cars:t.aiCars,selectedId:l.selectedAiId,onSelect:e=>u.updateUi({selectedAiId:e}),onSpawn:(e,t,n,r)=>{u.updateUi({selectedAiId:p.add(e,t,n,r).id})},onUpdate:(e,t)=>{p.update(e,t),o()},onRemove:e=>{p.remove(e),u.updateUi({selectedAiId:null})}},onReset:()=>r.current?.reset(),onQuit:()=>queueMicrotask(()=>d.dispose())})})]}))},u.connect(),HD=d,o(),u.attachAiWhenReady();let y=new AbortController;return l.own(()=>y.abort()),d.ready.then(async()=>{let e=n?await ND(n.target,()=>u.stopped):!1;if(u.stopped)return;let i=e?n:jD(window),o=await MD(i.delayMs??0,t,y.signal);if(u.stopped||!o)return;a();let s=r.current?.arriveAt({...i,delayMs:0});s?s.finally(()=>{u.stopped||r.current?.getPlayground()?.world.renderer.setVehicleArrivalOpacity(1)}):r.current?.getPlayground()?.world.renderer.setVehicleArrivalOpacity(1)}).catch(t=>{e.report(t),u.stopped||(a(),r.current?.getPlayground()?.world.renderer.setVehicleArrivalOpacity(1))}),d}catch(e){throw l.dispose(),e}}var GD={mount:WD,options:{presets:{sfw(e={}){return{...e,options:{...v,...e.options,policy:{...v.policy,...e.options?.policy},ui:{...v.ui,...e.options?.ui}}}}}},vehicleTools:n,availableVehicleTools:ne,overlayLayers:kf,overlayZIndex:Af,define:Ge,get active(){return UD()},listPresets:ge,listVehicleOptions:ze,getPreset:Te,keyboardControls:it};export{it as S,xy as _,rD as a,dn as b,XE as c,WE as d,zT as f,jS as g,cT as h,iD as i,YE as l,_T as m,zD as n,$E as o,mT as p,_D as r,QE as s,GD as t,GE as u,Wm as v,st as x,Af as y};